Hello,
In your StripFormattingOnPaste property documentation it says that the CSS member removes style attributes, but does it in fact clean out more? From what i can tell it also cleans out classes. Can you please give a more detailed description of what the CSS member cleans?
Thanks.
Espen G
In your StripFormattingOnPaste property documentation it says that the CSS member removes style attributes, but does it in fact clean out more? From what i can tell it also cleans out classes. Can you please give a more detailed description of what the CSS member cleans?
Thanks.
Espen G
6 Answers, 1 is accepted
0
Accepted
Hi Espen,
The StripFormattingOnPaste="Css" setting cleans not only the style attributes, but also the class attributes. You can see how the Css property setting works in the attached video.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
The StripFormattingOnPaste="Css" setting cleans not only the style attributes, but also the class attributes. You can see how the Css property setting works in the attached video.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Espen
Top achievements
Rank 1
answered on 27 Feb 2008, 09:53 AM
Ok, thank you for your answer.
Have you considered including an option that just cleans out inline css styles?
Espen G.
Have you considered including an option that just cleans out inline css styles?
Espen G.
0
Hi Espen,
Could you please tell me under which MOSS scenario you are using RadEditor: Web Part, WCM or Lists, Wikis, Blogs, etc?
Once we receive this info, we will try to provide a code solution based on your requirement.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Could you please tell me under which MOSS scenario you are using RadEditor: Web Part, WCM or Lists, Wikis, Blogs, etc?
Once we receive this info, we will try to provide a code solution based on your requirement.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Espen
Top achievements
Rank 1
answered on 27 Feb 2008, 02:30 PM
That would be great.
We use RadEditor for WCM. We want it to strip down everything pasted except non-empty html tags and their classes, plus plain text.
Espen G.
We use RadEditor for WCM. We want it to strip down everything pasted except non-empty html tags and their classes, plus plain text.
Espen G.
0
Hi Espen,
To achieve your goal you should override the Paste command of the editor and implement your own stripping functionality that will remove the desired attributes.
The example below demonstrates how to override the Paste command by attaching a function to the OnClientCommandExecuted property event of RadEditor. In the \Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\4.5.0.0__1f131a624888eeed\RadControls\Editor\ConfigFile.xml file you should put the following two tag declarations:
<property name="OnClientCommandExecuted">OnClientCommandExecuted</property>
<property name="StripFormattingOnPaste">NoneSupressCleanMessage</property>
After that in the page with the editor ( <rade:RadHtmlField...) put the following JavaScript code above the editor's declaration:
<script type="text/javascript">
function OnClientCommandExecuted(editor, commandName, oTool)
{
if(commandName == "Paste")
{
window.setTimeout(
function()
{
var elems = editor.Document.getElementsByTagName("*"); //reference to all elements in the content area
for (var i = 0; i < elems.length; i++)
{
var elem = elems[i];
//write your code here to strip the non-desired attributes
}
}, 150);
}
}
</script>
<rade:RadHtmlField id="Content" FieldName="PublishingPageContent" runat="server"/>
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
To achieve your goal you should override the Paste command of the editor and implement your own stripping functionality that will remove the desired attributes.
The example below demonstrates how to override the Paste command by attaching a function to the OnClientCommandExecuted property event of RadEditor. In the \Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\4.5.0.0__1f131a624888eeed\RadControls\Editor\ConfigFile.xml file you should put the following two tag declarations:
<property name="OnClientCommandExecuted">OnClientCommandExecuted</property>
<property name="StripFormattingOnPaste">NoneSupressCleanMessage</property>
After that in the page with the editor ( <rade:RadHtmlField...) put the following JavaScript code above the editor's declaration:
<script type="text/javascript">
function OnClientCommandExecuted(editor, commandName, oTool)
{
if(commandName == "Paste")
{
window.setTimeout(
function()
{
var elems = editor.Document.getElementsByTagName("*"); //reference to all elements in the content area
for (var i = 0; i < elems.length; i++)
{
var elem = elems[i];
//write your code here to strip the non-desired attributes
}
}, 150);
}
}
</script>
<rade:RadHtmlField id="Content" FieldName="PublishingPageContent" runat="server"/>
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Espen
Top achievements
Rank 1
answered on 05 Mar 2008, 01:55 PM
Thank you very much for your help!
Espen G.
Espen G.