Remove Link

Last post 09-16-2009, 4:46 AM by goh6613. 3 replies.
Sort Posts: Previous Next
  •  09-15-2009, 8:48 PM 55667

    Remove Link

    hi all
     
    how can i set my cute editor so that do not accept any link, my solution right now is the user need to click on "Remove Link" in order to remove the link website url .....
     
    but my problem here is i would like to set 'No link is available for my cute editor panel' which mean my cute editor will treat the url as normal words (apply 'Remove Link' automatically)
     
    how can i do that ?
     
    thanks
     
  •  09-16-2009, 12:28 AM 55669 in reply to 55667

    Re: Remove Link

    Hi goh6613,
     
    Try this example
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Register Namespace="CuteEditor" Assembly="CuteEditor" TagPrefix="CE" %>   
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    5. <html xmlns="http://www.w3.org/1999/xhtml">   
    6. <head id="Head1" runat="server">   
    7.     <title>Untitled Page</title>   
    8. </head>   
    9. <body>   
    10.     <form id="form1" runat="server">   
    11.         <CE:Editor ID="editor1" runat="server">   
    12.         </CE:Editor>   
    13.     </form>   
    14. </body>   
    15. </html>   
    16.   
    17. <script type="text/javascript">   
    18.   
    19. function CuteEditor_FilterHTML(editor,code)   
    20. {   
    21.  return code.replace(/(<a[^\>]*\>)([\s\S]*)(\<\/a\>)/i, "$2");   
    22. }   
    23. function CuteEditor_FilterCode(editor,code)   
    24. {   
    25.  return code.replace(/(<a[^\>]*\>)([\s\S]*)(\<\/a\>)/i, "$2");   
    26. }   
    27.   
    28. </script>  
    Regards,
     
    Ken
  •  09-16-2009, 4:36 AM 55676 in reply to 55669

    Re: Remove Link

    hi kenneth
     
    Your solution can help me remove the link, but it only remove it when i change the cute editor mode,
     
    is it possible for me to remove the link without changing the mode (eg. onkeypress,onkeyup) ?
     
    thanks
  •  09-16-2009, 4:46 AM 55677 in reply to 55676

    Re: Remove Link

    hi
     
    i try to make some modification to the function
     

    function CuteEditor_FilterHTML(editor,code)

    {

    var sHTML;

    sHTML=code.replace(/(<a[^\>]*\>)([\s\S]*)(\<\/a\>)/i, "$2");

    editor.setHTML(sHTML);

    }

    function CuteEditor_FilterCode(editor,code)

    {

    var sHTML;

    sHTML=code.replace(/(<a[^\>]*\>)([\s\S]*)(\<\/a\>)/i, "$2");

    editor.setHTML(sHTML);

    }
     
    but everytime i add/select a layer, it will lost focus to that layer.....it unable me to change the text inside the layer (maybe is cause by i reset the HTML)
     
    thanks
     
View as RSS news feed in XML