Paste Special Characters onto Desing View

7 posts, 0 answers
  1. Rana
    Rana avatar
    14 posts
    Member since:
    Mar 2009

    Posted 15 May 2009 Link to this post

    I have a modal dialog box where iam allowing the user to choose special characters like "≅*≈ ♣♥ "and pasting them back onto RADEditor for moss.
    Iam using RADEditorSharepoint version 5.4.0.0

    my code in .js file goes as follows...
    <code>

    var

    params = editor._dialogParameters;

     

     

    var SelectedChar = window.showModalDialog(params["CurrentWebBaseUrl"] + "/_layouts/MySpecialCharacters.aspx", "XYZchars", "center:yes;dialogWidth:600px;dialogHeight:600px;resizable:1");

     

     

    if (SelectedChar && SelectedChar.length > 0) {

     

    editor.pasteHtml(SelectedChar);

    }

    </code>

    Things are working fine and iam able to see the special characters are getting pasted onto editor without fail. But the issue is as follows.

    When i paste ♣♥ symbols onto Design view, it should be converting them as &clubs; &hearts; but, when  you switch between design view, neither of the views has got the HTML equivalants like  "&clubs; &hearts;". rather it has got "♣♥" symbols in both the views.

    What am i missing here to see "&clubs;" in my html view when i pasted the symbol "♣" onto design view.


    Thanks
    Prat
  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 16 May 2009 Link to this post

    Hello Rana,

    This is the default behavior of the RadEditor.

    If you want to convert the ♣♥ symbols to &clubs; &hearts;, you need to create your own content filter. More information on the matter you can find in the following help article http://www.telerik.com/help/aspnet-ajax/contentfilters.html. Review the Custom Filter Example part.

    What you should know is that since you are using the RadEditor for MOSS in order to set the OnClientLoad property you need to modify the respective ConfigFile.xml or ListConfigFile.xml (for forms such as list, wiki, blog), which are located in the /Program Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/4.x.x.x__1f131a624888eeed/RadControls/Editor/ folder. Also place your javascript code in the MOSSEditorTools.js file , which is located in the /Program Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/4.x.x.x__1f131a624888eeed/RadControls/Editor/Scripts/7_3_6 folder.

    The provided folders are relative to 4.x version of the control. If you are using the 5.x version both the config files and MOSSEditorTools.js are located in \Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.4.0.0__1f131a624888eeed\Resources folder.

    I hope this helps.




    Sincerely yours,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

  3. Rana
    Rana avatar
    14 posts
    Member since:
    Mar 2009

    Posted 18 May 2009 Link to this post

    Stanimir,

    I am seeing something weird scenario when i am using RADEditor for moss.
    "Please wait while scripts are loaded..." status message is always shown in my browser.
    due to this, i cant debug/trigger any of my custom content filter scripts.
    I have done AJAX integration (in web.config) as per microsoft/telerik support.
    Am i missing something here...?


    Thanks,
    Rana
  4. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 20 May 2009 Link to this post

    Hi Rana,

    You can find information on extending your MOSS site with Microsoft ASP.NET AJAX in the following help articles.
    1. Extending your MOSS site with Microsoft ASP.NET AJAX 1.0 - for .NET 2.0
    2. Extending your MOSS site with Microsoft ASP.NET AJAX 3.5 - for .NET 3.5. In addition to the article make sure that you add the following code to the web.config <runtime><assemblyBinding> section.

    <dependentAssembly>  
      <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>  
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>  
    </dependentAssembly>  
    <dependentAssembly>  
      <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>  
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>  
    </dependentAssembly>  
     


    I hope this helps.



    Kind regards,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Rana
    Rana avatar
    14 posts
    Member since:
    Mar 2009

    Posted 20 May 2009 Link to this post

    Stanimir,
    Thanks for your reply.
    The problem was something else and was resolved, as i was using JQuery and was not properly referenced in my masterpage.

    Thanks again,
    Prat
  6. Rana
    Rana avatar
    14 posts
    Member since:
    Mar 2009

    Posted 04 Jun 2009 Link to this post

    Hi,
    Understandt he default behavior of RADEditor when it comes to special characters.

    Appreciate if you have any examples on Custom CONTENT FILTERs, that handles inserted/pasted special characters onto RADEditor.
    In my view, i have to take the content as soon as it gets pasted and find the special characters using javascript REGEX and replace all the inserted special Characters with the html encoded values like &clubs; &hearts...

    Any thoughts would be appreciated.


    Thanks,
    Prat
  7. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 04 Jun 2009 Link to this post

    Hi Rana,

    In order to create a custom content filter you need to add the following javascript in the page where the RadEditor is loaded.
    function RadEditorCustomFilter() 
            { 
                this.GetDesignContent = function (content) 
                { 
                    var newContent = content; 
                    return newContent; 
                }; 
                 
                this.GetHtmlContent = function (content) 
                { 
                    var newContent = content; 
                    newContent = newContent.replace("♣""&clubs;"); 
                    newContent = newContent.replace("♥""&hearts;"); 
                    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); 
            } 
     

    Then modify the respective ConfigFile.xml or ListConfigFile.xml, which are located in the Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\4.5.6.0__1f131a624888eeed\RadControls\Editor folder. Just add the following line.
    <property name="OnClientLoad">OnClientLoad</property> 


    I hope this helps.


    Best wishes,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top