📄 defaultcs.aspx
字号:
<%@ Page CodeBehind="DefaultCS.aspx.cs" Language="c#" AutoEventWireup="false" Inherits="Telerik.EditorExamplesCSharp.Editor.Examples.EditorFilters.DefaultCS" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" Assembly="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
<%@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
<%@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
<%@ Register TagPrefix="radE" Namespace="Telerik.WebControls" Assembly="RadEditor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head runat="server">
<telerik:HeadTag runat="server" ID="Headtag1"></telerik:HeadTag>
</head>
<body class="BODY">
<form runat="server" id="mainForm" method="post" style="width:100%;">
<telerik:Header runat="server" ID="Header1" NavigationLanguage="C#"></telerik:Header>
<script type="text/javascript">
//<![CDATA[
/* Implementing a custom filter. A filter should have the following methods:
this.GetDesignContent = null; //Called when the editor is moving from some other mode to DESIGN mode
this.GetHtmlContent = null; //Called when the editor is moving from some other state to HTML mode
this.GetPreviewContent = null; //Called when the editor is moving from some other state to PREVIEW mode
*/
function RadEditorCustomFilter()
{
this.GetDesignContent = function (content)
{
/* Conditional check if filter is enabled */
if (!document.getElementById("CustomFilterCheckbox").checked) return content;
var newContent = content;
//Make changes to the content and return it
newContent = newContent.toLowerCase();
return newContent;
};
this.GetHtmlContent = function (content)
{
/* Conditional check if filter is enabled */
if (!document.getElementById("CustomFilterCheckbox").checked) return content;
var newContent = content;
//Make changes to the content and return it
newContent = newContent.toUpperCase();
return newContent;
};
this.GetPreviewContent = null; //Not mandatory to implement.
}
/* Use the editor onload function to register the filter with the FiltersManager */
function onClientLoad (editor)
{
var customFilter = new RadEditorCustomFilter();
editor.FiltersManager.Add(customFilter);
}
//]]>
</script>
<radE:RadEditor
ID="editor1"
Runat="server"
OnClientLoad="onClientLoad"
HasPermission="True"
SaveInFile="True"
ImagesPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations"
UploadImagesPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations"
DeleteImagesPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations"
FlashPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations"
UploadFlashPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations"
DeleteFlashPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations"
MediaPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations"
UploadMediaPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations"
DeleteMediaPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations"
DocumentsPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations"
UploadDocumentsPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations"
DeleteDocumentsPaths="~/Editor/Img/UserDir/Marketing,~/Editor/Img/UserDir/PublicRelations">This instance of r.a.d.editor contains some
relative links and images in its content area. When
StripAbsoluteAnchorPaths/StripAbsoluteImagesPaths properties set to true with
the <b>AnchorPathToStrip</b> and <b>ImagesPathToStrip</b> properties set to
<b>http://localhost</b>, when switching to design mode
or saving the content, the href/src attributes of these relative objects will be
stripped by these values. <br/>Go to the <a href="/r.a.d.editor/Editor/Examples/Default/DefaultCS.aspx">
Default example</a><br/>Go to the <a href="/r.a.d.editor/Editor/Examples/WhatsNew/DefaultCS.aspx">
What's new example</a><br/>Go to the <a href="/r.a.d.editor/Editor/Examples/ServersideAPI/DefaultCS.aspx">
Server-side API example</a><br/><img src="../../Img/UserDir/Marketing/ad_tables.gif">
</radE:RadEditor><br/>
<table border="0" class="module" width="90%">
<tr>
<td><asp:CheckBox Runat="server" Checked="true" ID="cbStripAbsoluteAnchorPaths"></asp:CheckBox>StripAbsoluteAnchorPaths</td>
<td>AnchorPathToStrip:
<asp:TextBox Runat="server" id="txtAnchorPathToStrip" Width="150" />
</td>
</tr>
<tr>
<td><asp:CheckBox Runat="server" Checked="true" ID="cbStripAbsoluteImagesPaths" />StripAbsoluteImagesPaths</td>
<td>ImagesPathToStrip:<asp:TextBox Runat="server" id="txtImagesPathToStrip" Width="150" />
</td>
</tr>
<tr>
<td><asp:CheckBox Runat="server" ID="cbConvertTagToLower" />ConvertTagToLower</td>
<td></td>
</tr>
<tr>
<td><asp:checkbox runat="server" id="cbConvertFontToSpan" />ConvertFontToSpan</td>
<td></td>
</tr>
<tr>
<td><asp:checkbox runat="server" id="cbConvertToXhtml" />ConvertToXhtml</td>
<td></td>
</tr>
<tr>
<td valign="top"><asp:CheckBox Runat="server" ID="cbAllowScripts" />AllowScripts</td>
<td valign="top"><input type="checkbox" id="CustomFilterCheckbox"/> Enable Custom Filter <br/>(makes all content uppercase in HTML mode, lowercase in Design mode)</td>
</tr>
<tr>
<td colspan="2"><asp:Button ID="btnApply" Text="Apply" Runat="server" CssClass="button" /></td>
</tr>
</table>
<telerik:Footer runat="server" ID="Footer1"></telerik:Footer>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -