Adding Javascript in RadEditor 4.4.1.0

4 posts, 0 answers
  1. Muhammad
    Muhammad avatar
    1 posts
    Member since:
    Apr 2009

    Posted 01 Apr 2009 Link to this post

    In my scenario I want to add javascript to anchor tag. I have done following steps by reading other threads but still can make it work.
    1. Added AllowScripts property in ConfigFile.xml located at C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\4.4.1.0__1f131a624888eeed\RadControls\Editor
    2. Then add AllowSpecialTags="true" e.g. <radE:RadHtmlField runat="server" FieldName="RelatedLinks" AllowSpecialTags="true"></radE:RadHtmlField>
    3. After that when I add id to my anchor tag and add the javascript editor is not stipping out the javascript, but it looks as javascript is no executed after page is loaded. Instead it shows some thing like this just after anchor tag 

    <PRE id="RadEditorEncodedTag" style="DISPLAY:none"> NjcmlwdD5kb2N1bWVudC5nZXRFbGVtZW50QnlJZCgndGVzdDEnKS5vbmNsaWNrPWZ1bmN0aW9uKCl7YWxlcnQoIjEiKX08L3NjcmlwdD4=

    </PRE>

    I have also added javascript code below in MOSSEditorTool.js located at C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\4.4.1.0__1f131a624888eeed\RadControls\Editor\Scripts\7_2_1

    Telerik.Web.UI.Editor.EncodeScriptsFilter.prototype.getHtmlContent = function(content)  

    {  

            return content;  

    };  

     

    Telerik.Web.UI.Editor.EncodeScriptsFilter.prototype.getDesignContent = function(content)  

    {  

            return content;  

    };


    Kindly can you identify the problem or is there any version issue as I am using 4.4.1.0
  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 03 Apr 2009 Link to this post

    Hi Muhammad,

    Could you please tell us in what scenario are you using the RadEditor for MOSS? Is it a web part or a forms (wiki, list, blog ...) scenario? You should know  that you can see the content edited in the RadEditor  by toggling between Design and Html mode of the RadEditor. Unfortunately after it is sent to the server some content filters are applied on it and RadEditor has no control over them. These filters are responsible for stripping the javascript.


    Sincerely yours,
    Stanimir
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.

  3. David
    David avatar
    2 posts
    Member since:
    Apr 2008

    Posted 28 Jul 2009 Link to this post

    Ok, I am in a similiar situation. I am using the RadHtmlField Control in a Publishing Page Layout. That works fine as far as entering and rendering code. However, when pulling that coulmn in a DataView webpart, the column render this;

    <pre style="display:none" id=RadEditorEncodedTag>PGVtYmVkIHNyYz0iaHR0cDovL3d3dy55b3V0dWJlLmNvbS92L1M4YkxqSU1YM2JFJmFtcDtobD1lbiZhbXA7ZnM9MSZhbXA7IiB3aWR0aD0iMzIwIiBoZWlnaHQ9IjI2MCIgdHlwZT0iYXBwbGljYXRpb24veC1zaG9ja3dhdmUtZmxhc2giIGFsbG93c2NyaXB0YWNjZXNzPSJhbHdheXMiIGFsbG93ZnVsbHNjcmVlbj0idHJ1ZSIgLz4

    In my xsl I use the  disable-output-escaping="yes" and nothing is rendered. Now, I realize this is most likely encoded content, but is there a way to decode this when after the page is loaded?
  4. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 30 Jul 2009 Link to this post

    Hi David,

    In order to pull the data of the rad editor correctly you need to use the following static method.
    Telerik.SharePoint.EditorTools.UnEscapeSpecialTags(string).

    I hope this helps.


    All the best,
    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