Hi,
We're using Telerik RadEditor for MOSS version 5.7.3.0. We use the editor with IE8.
When we add indent in a paragraph, the editor wraps the P tag in a blockquote tag. We don't want this behaviour because we use blockquotes tags for other purpose (i.e. quoted text).
For example, it would be better to simply add a padding-left to the p tag. Is it possible?
Thanks in advance.
Xavier Stévenne.
We're using Telerik RadEditor for MOSS version 5.7.3.0. We use the editor with IE8.
When we add indent in a paragraph, the editor wraps the P tag in a blockquote tag. We don't want this behaviour because we use blockquotes tags for other purpose (i.e. quoted text).
For example, it would be better to simply add a padding-left to the p tag. Is it possible?
Thanks in advance.
Xavier Stévenne.
4 Answers, 1 is accepted
0
Hello Xavier,
Please, note that RadEditor uses the execCommand method of the browser under which it operates to execute the Indent / Outdent commands. Each browser has its own implementation of these commands and they behave differently under the different browsers. IE wraps the whole paragraph in <blockquote style="margin-right: 0px;" dir="ltr"> tags, but Firefox wraps the selected line in <blockquote>selection</blockquote> tags.
You can find more information about the execCommand method and its commands in the following MSDN and Mozilla articles:
execCommand Method,
Command Identifiers,
Rich-Text Editing in Mozilla
If you would like I can tell you how to override the Indent and Outdent commands of RadEditor and you can try to implement your own custom commands.
Best regards,
Rumen
the Telerik team
Please, note that RadEditor uses the execCommand method of the browser under which it operates to execute the Indent / Outdent commands. Each browser has its own implementation of these commands and they behave differently under the different browsers. IE wraps the whole paragraph in <blockquote style="margin-right: 0px;" dir="ltr"> tags, but Firefox wraps the selected line in <blockquote>selection</blockquote> tags.
You can find more information about the execCommand method and its commands in the following MSDN and Mozilla articles:
execCommand Method,
Command Identifiers,
Rich-Text Editing in Mozilla
If you would like I can tell you how to override the Indent and Outdent commands of RadEditor and you can try to implement your own custom commands.
Best regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Neil
Top achievements
Rank 1
answered on 01 Mar 2011, 03:09 PM
Rumen,
Could you explain how we can create custom command that can override the commands so we can use padded div's or p's instead of blockquote's?
Thanks!
Neil
Could you explain how we can create custom command that can override the commands so we can use padded div's or p's instead of blockquote's?
Thanks!
Neil
0
Hi Neil,
You can use the following syntax to override the Indent or another command:
More information is available in this article: http://www.telerik.com/community/forums/aspnet-ajax/editor/radeditor-problem-in-ie-browser.aspx.
Best regards,
Rumen
the Telerik team
You can use the following syntax to override the Indent or another command:
<script type=
"text/javascript"
>
function
OnClientCommandExecuting(editor, args) {
//The command name
var
commandName = args.get_commandName();
if
(
"Indent"
== commandName) {
alert(
"add your custom code that will be executed when executing the Indent command"
)
args.set_cancel(
true
);
}
}
</script>
<telerik:radeditor runat=
"server"
ID=
"RadEditor1"
OnClientCommandExecuting=
"OnClientCommandExecuting"
>
</telerik:radeditor>
More information is available in this article: http://www.telerik.com/community/forums/aspnet-ajax/editor/radeditor-problem-in-ie-browser.aspx.
Best regards,
Rumen
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Neil
Top achievements
Rank 1
answered on 03 Mar 2011, 03:00 PM
Hi Rumen,
I actually got that far via a different route, my trouble is the logic to perform the indenting. The following works great for Chrome/Safari and Internet Explorer, but unfortunately not for Firefox.
Regards,
Neil
I actually got that far via a different route, my trouble is the logic to perform the indenting. The following works great for Chrome/Safari and Internet Explorer, but unfortunately not for Firefox.
if
(
"Indent"
== commandName) {<br>
var
editorParentSelection = editor.getSelection().getParentElement();<br> editorParentSelection.outerHTML =
"<div style='margin-left: 30px'>"
+ editorParentSelection.outerHTML +
"</div>"
;<br> args.set_cancel(
true
);<br> }
Regards,
Neil