StripAbsoluteAnchorPaths

9 posts, 2 answers
  1. Jason Brownhill
    Jason Brownhill avatar
    55 posts
    Member since:
    Jun 2009

    Posted 16 Jun 2010 Link to this post

    Hi,
     Can you give me the solution or article to using the StripAbsoluteAnchorPaths and also the image property please? I've done a search on the forums and it's not easy to find the latest information on how this should be configured within the full featured rad editor - or whether it should be the one solution I've found which talks about editing the MOSSEditorTools.js file - which I've tried and haven't seen work at the moment either...

    Thanks,
    Jason.
  2. Answer
    Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 17 Jun 2010 Link to this post

    Hello Jason,

    StripAbsoluteAnchorPaths property is obsolete in the Full RadEditor for MOSS 5.x.

    I assume that the problem is that the MOSSLinkMnager always adds absolute URLs. If this is the case you have two options.

    1. Replace the out of the box MOSSLinkManger with the one provided by Telerik. In order to do this modify the respective ToolsFile.xml and ListToolsFile.xml, which are located in the /Program Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/5.x.x.0__1f131a624888eeed/Resources/ folder. Replace <tool name="MOSSLinkManager" shortcut="CTRL+K" /> with <tool name="LinkManager" shortcut="CTRL+K" />

    2. Create custom content filter, which will strip the problem paths:\
    First set the OnClientLoad property of the RadEditor to attach a handler. Add the following line in the ConfigFile.xml:
    <property name="OnClientLoad">OnClientLoad</property>

    Second you can use MOSSEditorTools.js to add custom java script code to RadEditor. There you should define the OnClientLoad handler and your custom content filter.
    Here is an example that you may find useful:
    function OnClientLoad(editor, args)
    {   
        editor.get_filtersManager().add(new MyFilter());
    }
       
    MyFilter = function()
    {
        MyFilter.initializeBase(this);
        this.set_isDom(false);
        this.set_enabled(true);
        this.set_name("RadEditor filter");
        this.set_description("RadEditor filter description");
    }
    MyFilter.prototype =
    {
        getHtmlContent : function(content)
        {                     
            var newContent = content;
               
            //here you replace absolute URL
            newContent = newContent.replace(/http:\/\/mossrtm\//g, "");
            return newContent;
        },
       
        getDesignContent : function(content)
        {                     
            var newContent = content;
            return newContent;
        }      
    }
                   
    MyFilter.registerClass('MyFilter', Telerik.Web.UI.Editor.Filter);


    Best wishes,
    Stanimir
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  3. Jason Brownhill
    Jason Brownhill avatar
    55 posts
    Member since:
    Jun 2009

    Posted 17 Jun 2010 Link to this post

    Hi Stanimir,

     Thanks for the response back - thats most of the solution I found, except for the part relating to the line in the toolsfile.xml.

     Anyway - I've replaced this and am getting another error :-

    Parser Error Message: The server tag 'telerik:RadTabStrip' is ambiguous. Please modify the associated registration that is causing ambiguity and pick a new tag prefix.

    Source Error:

    [No relevant source lines]

    Source File: /_wpresources/RadEditorSharePoint/5.6.2.0__1f131a624888eeed/Resources/Telerik.Web.UI.DialogHandler.aspx    Line:

     Any thoughts?

     What we are trying to achieve is when a user puts an absolute URL we want to remove it when rendering within a SharePoint page. The main point to this is because of SharePoint Alternate Access Mapping - currently the in built SharePoint Content Editor Web Part and the Lite version of the Telerik tools do not allow for the correct transposing of the URL for external users. We've purchased the full client version of ASP.Net controls which includes the full version of the editor, so are undergoing some testing to see if this full version will overcome this issue.

    Thanks,
    Jason.
  4. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 17 Jun 2010 Link to this post

    Hello Jason,

    Regarding the javascript error: Could you provide me with your ConfigFile.xml, ToolsFile.xml and MOSSEditorTools.js. I will check them out and advise you further.

    Regarding the functionality, which you are trying to achieve, could you provide me with the regular explosion, which will modify the absolute URLs so it will fit your scenario? In my example the regular expression is:
    /http:\/\/mossrtm\//g

    A couple of sample URLs and expected result ones will be helpful as well.


    All the best,
    Stanimir
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Jason Brownhill
    Jason Brownhill avatar
    55 posts
    Member since:
    Jun 2009

    Posted 17 Jun 2010 Link to this post

    Stanimir,
     
     Not sure how to get the code samples to you - the thread only allows image file types? Do I put these in a code block?

    This is the regular expression I'm using.
            //here you replace absolute URL    
            newContent = newContent.replace(/http:\/\/irisdev.interserve\//g, "");     
            return newContent;  
  6. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 17 Jun 2010 Link to this post

    Hi Jason,

    Send me the files to stanimir.patarinski@telerik.com just add the ID of the forum thread for reference.


    Regards,
    Stanimir
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Jason Brownhill
    Jason Brownhill avatar
    55 posts
    Member since:
    Jun 2009

    Posted 18 Jun 2010 Link to this post

    Hi Stanimir,
     I've emailed the files yesterday - can you confirm you received? I can't see the forum thread ID when looking at all the posts, so I wasn't sure what that was.

    Thanks,
    Jason.
  8. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 21 Jun 2010 Link to this post

    Hi Jason,

    I received your files. Unfortunately I was not able to reproduce the problem. For your convenience I attached a small video with my test. Please inform me if I am doing anything wrong in it.

    I tested the issue in webpart scenario. Please tell me if you are experiencing the problem in other scenario. WCM or List.



    Greetings,
    Stanimir
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Answer
    Richelle Dubif
    Richelle Dubif avatar
    12 posts
    Member since:
    Mar 2010

    Posted 22 Jun 2010 Link to this post

    Hi Stanimir,
     Although the solution didn't work to begin with on another environment I've been able to resolve the issue.

     I simply cleared down my internet cache on my machine and refreshed the page. I was then able to see an alert I'd created within the 'MOSSEditorTools.js' file to ensure that the function was actually being called.

     Thanks for your help and for the video which really helped see how and where this function works.

    Best Regards,
    Jason.
Back to Top