Indent text is done with blockquote

5 posts, 0 answers
  1. Xavier
    Xavier avatar
    8 posts
    Member since:
    Aug 2010

    Posted 07 Jan 2011 Link to this post

    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.
  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 12 Jan 2011 Link to this post

    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
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Neil
    Neil avatar
    50 posts
    Member since:
    Mar 2009

    Posted 01 Mar 2011 Link to this post

    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
  5. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 03 Mar 2011 Link to this post

    Hi Neil,

    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!
  6. Neil
    Neil avatar
    50 posts
    Member since:
    Mar 2009

    Posted 03 Mar 2011 Link to this post

    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.  

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017