Re: Changing Image URL while Draging on the Editor

  •  03-29-2010, 2:22 AM

    Re: Changing Image URL while Draging on the Editor

    Hi [email protected],
     
    Assume that the thumbnails and Original in the same directory.
     
    you can use html filter to achieve that change file name/url.
     
    In the example below, I have the original photo name "photo.jpg" and thumbnail name "photo.thumbnail.jpg" in the same folder "Uploads".
     
    when you drag image <img src="Uploads/photo.thumbnail.jpg" /> into editor ,it will change to
     
    <img alt="" src="http://localhost:60546/Editor/Uploads/photo.jpg" />(in my case)
    1. <%@ Page Language="C#" Debug="true" %>   
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>   
    4. <html>   
    5. <head>   
    6. </head>   
    7. <body>   
    8.     <form id="Form1" runat="server">   
    9.         <CE:Editor ID="editor1" runat="server" />   
    10.         <img src="Uploads/photo.thumbnail.jpg" />   
    11.     </form>   
    12. </body>   
    13. </html>   
    14.   
    15. <script>   
    16. function CuteEditor_FilterHTML(editor,code)   
    17. {   
    18.  return code.replace(".thumbnail""");   
    19. }   
    20. function CuteEditor_FilterCode(editor,code)   
    21. {   
    22.  return code.replace(".thumbnail""");   
    23. }   
    24. </script>  

    Regards,
     
    Ken
View Complete Thread