1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Toolbox for Richtext property editor

Toolbox for Richtext property editor

19 posts, 1 answered
  1. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    21 Sep 2009
    Link to this post
    Hi,
    I created a user control to give the ability for the user to insert some conent. I followed the following article to enable rich text editor to set the text. How can I limit the toolbar to give only the basic options like Bold,Italic, lists etc. Right now it is displaying all the tools in the tool box.

    http://www.sitefinity.com/support/kb/sitefinity-3-x/implementing-rich-text-property-editor.aspx

    Thanks in advance,
    Gopal
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    21 Sep 2009
    Link to this post
    Hi Gopal Vemulapalli,

    You can control the tools that are visible by using ToolsFile.xml. In your custom class call "this" and specify the path to this file.

    this.ToolsFile = "path to your tools file"


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  3. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    21 Sep 2009
    Link to this post
    Hi Ivan,

    Thank you for the quick reply. It worked like a gem. I override the onLoad and set the ToolsFile property as follows. Let me know if this is the correct approach?

     

    protected override void OnLoad(EventArgs e)

     

    {

     

    this.ToolsFile = "~/custom/touchcontrols/Toolsfile.xml";

     

     

    base.OnLoad(e);

     

    }

    Thanks again
    Gopal

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    21 Sep 2009
    Link to this post
    Hi Gopal Vemulapalli,

    OnLoad event seems to be ok. If there is additional logic you can move it to CreateChildControls().

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    25 Sep 2009
    Link to this post
    Hi Ivan,

    I have an other issue with the rich text editor that is used for editing properties of the control.
    Toolbox shows options for Bulleted list. When I apply this bulleted list for my content, the style not visible in the design window but HTML window shows correct HTML with <ul><li>s.

    Is there any css that I need to modify to view the styled content while editing?

    Thanks & regards

    Gopal
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    28 Sep 2009
    Link to this post
    Hello Gopal Vemulapalli,

    Can you try to use the ContentAreaCssFile property of the RadEditor, and set it to point to the CSS file that contains your styles that get applied to pages. You can do this as with the ToolsFile property in the above posts:
    protected override void OnLoad(EventArgs e) 
         this.ContentAreaCssFile = "~/path to your styles CSS file"
         base.OnLoad(e); 

    This property loads css classes from the specified file to the content area of the editor. In this case the file should contain the same styling rules as your pages do.

    Regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    05 Feb 2010
    Link to this post
    Hi,
    I have a small problem related to this one. Whenever I'm clicking on any of the tools (eg: Image manager, Hyperlink manager etc.) on the RAD editor, the popup window is hiding on the background and because of which I'm not able to use those tools.
    I observe this behavior even before I change ContentAreaCssFile file property as you suggested in this thread.
    Can you please suggest me the workaround/solution for this

    Thanks & regards
    GV
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    05 Feb 2010
    Link to this post
    Hi GV,

    The problem seems to be in the z-index. Please take a look at Z-index demystified

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  9. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    09 Feb 2010
    Link to this post
    Thank you for the quick reply and it worked.

    I have another question. I enabled the tools in the RAD editor to insert images and documents. I set the ViewPaths peroperty for Imagemanager and DocumentManager to my folders. How can I select the images/documents from those already uploaded to Images and Documents module as we do in Generic content control.

    Thanks again for the great support that you are providing.
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    09 Feb 2010
    Link to this post
    Hello GV,

    You can use the RadEditor files manager that looks in the file system or our custom LibraryDocumentManager and LibraryImageManager. You can register the last two in EditorToolsFile.xml that your control uses. Then open the external template for GenericContent control (GenericContentDesigner) and copy the scripts for LibraryDocumentManager and LibraryImageManager.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  11. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    09 Feb 2010
    Link to this post
    Thanks Ivan for the quick reply.
    How can I link the scripts with the editor as my editor is derived from RadEditor (as in http://www.sitefinity.com/support/kb/sitefinity-3-x/implementing-rich-text-property-editor.aspx). I hope I'm not doing anything silly.
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    09 Feb 2010
    Link to this post
    Hello GV,

    You have to create a template for the WebUITypeEditor and not directly inheriting from RadEditor control.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  13. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    09 Feb 2010
    Link to this post
    Thanks Ivan,
    Can you plz give me some example code?

  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    09 Feb 2010
    Link to this post
    Hello GV,

    You can take a look at this post - Creating a custom WebUITypeEditor .

    All the best,
    Ivan Dimitrov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  15. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    09 Feb 2010
    Link to this post
    Hi Ivan,

    Thanks for the example.

    I followed the instructions on the given example. I'm able to open the editor, but it is not retaining the content that I entered. Also I'm getting the "sf_Approot is undefined" javascript error when I click on the any of the tools on the editor. Plz suggest me what i'm doing wrong here.

    Here is my code for the editor.cs:

    public class SKEPEditor : WebUITypeEditor<string>
        {
            public SKEPEditor()
            {
                //
                // TODO: Add constructor logic here
                //
            }
            public string Template
            {
                get
                {
                    string strpath = (string)this.ViewState["Template"];
                    if (strpath == null)
                    {
                        return "~/Resources/Backend/SKEPEditorTemplate.ascx";
                    }
                    else
                        return strpath;
                }
                set
                {
                    this.ViewState["Template"] = value;
                }
            }

            public override string Value
            {
                get
                {
                    string str = this.ViewState["Content"].ToString();
                    if (str == null)
                        return "";
                    else
                    {

                        return str;
                    }
                }
                set
                {
                    this.ViewState["Content"] = value;
                }
            }

            protected virtual RadEditor editor
            {
                get
                {
                    return this.Controls[0].FindControl("textEditor") as RadEditor;
                }
            }

            protected override void CreateChildControls()
            {
                base.CreateChildControls();
                this.template = Telerik.Framework.Web.ControlUtils.GetTemplate<DefaultSelectorTemplate>(this.Template);
                this.template.InstantiateIn(this);
                this.Value = editor.Content;
            }

            public class DefaultSelectorTemplate : ITemplate
            {
                public void InstantiateIn(Control container)
                {

                }
            }
            private ITemplate template;

        }

    Here is my template
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="SKEPEditorTemplate.ascx.cs" Inherits="Resources_Backend_SKEPEditorTemplate" %>
    <telerik:JsFileLink id="jsLink" runat="server" ScriptType="jQuery" />
    <telerik:RadEditor
        runat="server"
        ID="textEditor"
        ContentAreaCssFile="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorContentArea.css"
        ToolsFile="~/Sitefinity/Admin/ControlTemplates/EditorToolsFile.xml"    
        Skin="WebBlue"    
        NewLineBr="False"
        Height="360px"
        Width="98%"
        ContentFilters="FixUlBoldItalic,FixEnclosingP,IECleanAnchors,MozEmStrong,ConvertFontToSpan,ConvertToXhtml,IndentHTMLContent">
        <ImageManager ViewPaths="~/Images" UploadPaths="~/Images" DeletePaths="~/Images" />
        <MediaManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
        <FlashManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
        <DocumentManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
        <CssFiles>
            <telerik:EditorCssFile Value="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorCssFile.css" />
        </CssFiles>
    </telerik:RadEditor>
    <script type="text/javascript">
        Telerik.Web.UI.Editor.CommandList["LibraryImageManager"] = function(commandName, editor, args) {
            var editorArgs = editor.getSelectedElement();
            if (!editorArgs.nodeName || typeof (editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                editorArgs = editor.getSelection();

            var myCallbackFunction = function(sender, args) {
                if (typeof (editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "IMG")
                    args.parentNode.replaceChild(editorArgs, args);
                else {
                    var cloned = args.cloneNode(true);
                    var div = args.ownerDocument.createElement("DIV");
                    div.appendChild(cloned);
                    editorArgs.pasteHtml(div.innerHTML);
                }
            }
            var path = sf_AppRoot + 'Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx';
            editor.showExternalDialog(
       path,
       editorArgs,
       750,
       515,
       myCallbackFunction,
       null,
       'ImageLibraryDialog',
       true,
       Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
       false,
       true)
        };

        Telerik.Web.UI.Editor.CommandList["LibraryDocumentManager"] = function(commandName, editor, args) {
            var editorArgs = editor.getSelectedElement();
            if (!editorArgs.nodeName || typeof (editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                editorArgs = editor.getSelection();

            var myCallbackFunction = function(sender, args) {
                if (typeof (editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "A")
                    args.parentNode.replaceChild(editorArgs, args);
                else {
                    var cloned = args.cloneNode(true);
                    var div = args.ownerDocument.createElement("DIV");
                    div.appendChild(cloned);
                    editorArgs.pasteHtml(div.innerHTML);
                }
            }
            var path = sf_AppRoot + 'Sitefinity/UserControls/Dialogs/DocumentEditorDialog.aspx';
            editor.showExternalDialog(
       path,
       editorArgs,
       750,
       515,
       myCallbackFunction,
       null,
       'ImageLibraryDialog',
       false,
       Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
       false,
       true)
        };

        Telerik.Web.UI.Editor.CommandList["LinkManager"] = function(commandName, editor, args) {
            var editorArgs = editor.getSelectedElement();
            if (!editorArgs.nodeName || typeof (editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A") {
                var sel = editor.getSelection();
                editorArgs = sel;
                editorArgs.Html = sel.getHtml();
                editorArgs.Text = sel.getText();
            }

            var myCallbackFunction = function(sender, args) {
                if (typeof (editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "A")
                    args.parentNode.replaceChild(editorArgs, args);
                else {
                    var cloned = args.cloneNode(true);
                    var div = args.ownerDocument.createElement("DIV");
                    div.appendChild(cloned);
                    editorArgs.pasteHtml(div.innerHTML);
                }
            }
            var path = sf_AppRoot + 'Sitefinity/UserControls/Dialogs/LinksDialog.aspx';
            editor.showExternalDialog(
       path,
       editorArgs,
       750,
       515,
       myCallbackFunction,
       null,
       'ImageLibraryDialog',
       false,
       Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
       false,
       true)
        };

        Telerik.Web.UI.Editor.CommandList["SetLinkProperties"] = function(commandName, editor, args) {
            var editorArgs = editor.getSelectedElement();
            if (!editorArgs.nodeName || typeof (editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                editorArgs = editor.getSelection();

            var myCallbackFunction = function(sender, args) {
                if (typeof (editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "A")
                    args.parentNode.replaceChild(editorArgs, args);
                else {
                    var cloned = args.cloneNode(true);
                    var div = args.ownerDocument.createElement("DIV");
                    div.appendChild(cloned);
                    editorArgs.pasteHtml(div.innerHTML);
                }
            }
            var path = sf_AppRoot + 'Sitefinity/UserControls/Dialogs/LinksDialog.aspx';
            editor.showExternalDialog(
       path,
       editorArgs,
       750,
       515,
       myCallbackFunction,
       null,
       'ImageLibraryDialog',
       false,
       Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
       false,
       true)
        };

        RadEditorCommandList["IncreaseSize"] = function(commandName, editor, oTool) {
            var currentWidth = editor.get_element().style.width; //get the width of Telerik RadEditor
            var currentHeight = editor.get_element().style.height; //get the heigh of Telerik RadEditor

            editor.SetSize(currentWidth, currentHeight + 30); //set the height size of the editor to increase with 30px
        };

        RadEditorCommandList["DecreaseSize"] = function(commandName, editor, oTool) {
            var currentWidth = editor.get_element().style.width;
            var currentHeight = editor.get_element().style.height;

            editor.SetSize(currentWidth, currentHeight - 30); //set the height size of the editor to decrease with 30px
        };
        var oldFunction = Telerik.Web.UI.Editor.CommandList["ToggleScreenMode"]; //save the original Paste function

        Telerik.Web.UI.Editor.CommandList["ToggleScreenMode"] = function(commandName, editor, args) {
            oldFunction(commandName, editor, args);
            var bd = document.getElementsByTagName("body")[0];

            if (/fullScreenMode/.test(bd.className)) {
                var rep = bd.className.match(' ' + 'fullScreenMode') ? ' ' + 'fullScreenMode' : 'fullScreenMode';
                bd.className = bd.className.replace(rep, '');

            } else {
                bd.className += bd.className ? ' ' + 'fullScreenMode' : 'fullScreenMode';
            }
        }
    </script>


    <script type="text/javascript">

         $(document).ready(function() {
        
            var windowDiffConst = 174;
            var textEditorWrapperDiffIEConst = -57;
            
            $(window).bind('load', function() {
                
                $(".ToggleScreenMode").parent().hide();
                if($(".rwMaximizedWindow", parent.document.body).length > 0)
                {
                    var $textEditor = $("#<%= textEditor.ClientID %>");
                    var $textEditorWrapper = $textEditor.children().eq(1);

                    var editorDiff = $textEditor.height() - $textEditorWrapper.height();
                    var newHeight = $(window).height() - windowDiffConst;
                    
                    $(".ctrlPropsGeneric").eq(0).css("height",newHeight+"px");
                    
                    $textEditor.css("height",parseInt(newHeight-2)+"px");
                    $textEditorWrapper.css("height",parseInt(newHeight-4+editorDiff)+"px");
                }
            });
            if($.browser.msie && jQuery.browser.version == "6.0")
            {
                $(".RadWindow", parent.document.body).find(".rwMaximizeButton").hide();
            }
            else
            {
                var $textEditor = $("#<%= textEditor.ClientID %>");
                var $textEditorWrapper = $textEditor.children().eq(1);
                
                var editorDiff = $textEditor.height() - $textEditorWrapper.height();
                
                $(window).bind('resize', function() {
                    var newHeight = $(window).height() - windowDiffConst;
                    if($.browser.msie && (jQuery.browser.version == "7.0" || jQuery.browser.version == "8.0"))
                    {
                        editorDiff = textEditorWrapperDiffIEConst;
                    }
                    $(".ctrlPropsGeneric").eq(0).css({"height":newHeight+"px"});
                    
                    $textEditor.css({"height":parseInt(newHeight-2)+"px","min-width":"0","min-height":"0"});
                    $textEditorWrapper.css("height",parseInt(newHeight-4+editorDiff)+"px");

                });
            }
        });
        
    </script>

    Thanks & regards
    GV
  16. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    09 Feb 2010
    Link to this post
    Hi GV,

    Try adding the following code

    protected override void OnPreRender(EventArgs e)
     {
         base.OnPreRender(e);
         if (this.Page != null)
         {
             string appRoot = VirtualPathUtility.AppendTrailingSlash(this.Context.Request.ApplicationPath);
             this.Page.ClientScript.RegisterClientScriptBlock(typeof(SKEPEditor), "appRoot", String.Format("var sf_AppRoot = \"{0}\";", appRoot), true);
         }
     }

    If this does not help try using the following managers

    <script type="text/javascript">
     
                               Telerik.Web.UI.Editor.CommandList["LibraryImageManager"] = function(commandName, editor, args)
                               {
                                  var editorArgs = editor.getSelectedElement();
                                  if (!editorArgs.nodeName || typeof(editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                                       editorArgs = editor.getSelection();
                                   
                                  var myCallbackFunction = function(sender, args)
                                  {
                                       if (typeof(editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "IMG")
                                           args.parentNode.replaceChild(editorArgs, args);
                                       else
                                       {
                                           var cloned = args.cloneNode(true);
                                           var div = args.ownerDocument.createElement("DIV");
                                           div.appendChild(cloned);
                                           editorArgs.pasteHtml(div.innerHTML);
                                       }
                                  }
                                  editor.showExternalDialog(
                                  '<%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx") %>',
                                  editorArgs,
                                  750,
                                  600,
                                  myCallbackFunction,
                                  null,
                                  'ImageLibraryDialog',
                                  true,
                                  Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                                  false,
                                  true)
                               };
                                
                               Telerik.Web.UI.Editor.CommandList["LibraryDocumentManager"] = function(commandName, editor, args)
                               {
                                  var editorArgs = editor.getSelectedElement();
                                  if (!editorArgs.nodeName || typeof(editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                                       editorArgs = editor.getSelection();
                                   
                                  var myCallbackFunction = function(sender, args)
                                  {
                                   if (typeof (editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "A") {
                                       args.parentNode.replaceChild(editorArgs, args);
                                   }
                                       else
                                       {
                                           var cloned = args.cloneNode(true);
                                           var div = args.ownerDocument.createElement("DIV");
                                           div.appendChild(cloned);
                                           editorArgs.pasteHtml(div.innerHTML);
                                       }
                                  }
                                  editor.showExternalDialog(
                                  '<%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/DocumentEditorDialog.aspx") %>',
                                  editorArgs,
                                  750,
                                  600,
                                  myCallbackFunction,
                                  null,
                                  'ImageLibraryDialog',
                                  false,
                                  Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                                  false,
                                  true)
                               };
     
                               Telerik.Web.UI.Editor.CommandList["LinkManager"] = function(commandName, editor, args)
                               {
                                  var editorArgs = editor.getSelectedElement();
                                  if (!editorArgs.nodeName || typeof(editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                                  {                                                                  
                                       var sel = editor.getSelection(); 
                                       editorArgs = sel;
                                       editorArgs.Html = sel.getHtml();
                                       editorArgs.Text = sel.getText();                                   
                                  }
                                   
                                  var myCallbackFunction = function(sender, args)
                                  {
                                   if (typeof (editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "A") {
                                       args.parentNode.replaceChild(editorArgs, args);
                                   }
                                       else
                                       {
                                           var cloned = args.cloneNode(true);
                                           var div = args.ownerDocument.createElement("DIV");
                                           div.appendChild(cloned);
                                           editorArgs.pasteHtml(div.innerHTML);
                                       }
                                  }
                                  editor.showExternalDialog(
                                  '<%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/LinksDialog.aspx") %>',
                                  editorArgs,
                                  750,
                                  600,
                                  myCallbackFunction,
                                  null,
                                  'ImageLibraryDialog',
                                  false,
                                  Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                                  false,
                                  true)
                               };
                                
                               Telerik.Web.UI.Editor.CommandList["SetLinkProperties"] = function(commandName, editor, args)
                               {
                                  var editorArgs = editor.getSelectedElement();
                                  if (!editorArgs.nodeName || typeof(editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                                       editorArgs = editor.getSelection();
                                   
                                  var myCallbackFunction = function(sender, args)
                                  {
                                   if (typeof (editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "A") {
                                       args.parentNode.replaceChild(editorArgs, args);
                                   }
                                       else
                                       {
                                           var cloned = args.cloneNode(true);
                                           var div = args.ownerDocument.createElement("DIV");
                                           div.appendChild(cloned);
                                           editorArgs.pasteHtml(div.innerHTML);
                                       }
                                  }
                                  editor.showExternalDialog(
                                  '<%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/LinksDialog.aspx") %>',
                                  editorArgs,
                                  750,
                                  600,
                                  myCallbackFunction,
                                  null,
                                  'ImageLibraryDialog',
                                  false,
                                  Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                                  false,
                                  true)
                               };
                               var oldFunction = Telerik.Web.UI.Editor.CommandList["ToggleScreenMode"]; //save the original Paste function
     
                               Telerik.Web.UI.Editor.CommandList["ToggleScreenMode"] = function(commandName, editor, args)
                               {
                                   oldFunction(commandName, editor, args);
                                   var bd = document.getElementsByTagName("body")[0];
                                    
                                   if(/fullScreenMode/.test(bd.className)) {
                                       var rep = bd.className.match(' '+'fullScreenMode')?' '+'fullScreenMode':'fullScreenMode';
                                       bd.className=bd.className.replace(rep,'');
     
                                   } else {
                                       bd.className += bd.className?' '+'fullScreenMode':'fullScreenMode';
                                   }
                               };
                                
                               // automated tests helper function
                               function InsertTextArea()
                               {
                                   var editor = $find('<%=Editor.ClientID%>');
                                   editor.set_html('<textarea id="myTableToFind" style="overflow:hidden; height: 300px; width: 500px;" border="none"></textarea>');
                               }
                                
                               </script>


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  17. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    09 Feb 2010
    Link to this post
    Hi Ivan,
    The PreRender method worked perfectly for the javascript error. Still, my content is not saving. The moment I closed the editor, the text box shows blank. I might be doing something silly here.

    Thanks for the excellent support
  18. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    09 Feb 2010
    Link to this post
    Hi Ivan,
     I managed to persist the content in the editor. Now the only problem is hyperlinks. When I insert any hyperlink by picking from the existing pages, the url is not resolving. i.e it is pointing to the GUID of the page. Do i explicitly resolve the url? If yes, how can I find all the urls in the content?

    Thanks for your support
  19. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    09 Feb 2010
    Link to this post
    Hi GV,

    You should take a look at the following blog post: Resolving the url of dynamic links

    All the best,
    Radoslav Georgiev
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
Register for webinar
19 posts, 1 answered