Changing Image URL while Draging on the Editor

Last post 03-30-2010, 10:54 PM by Kenneth. 3 replies.
Sort Posts: Previous Next
  •  03-26-2010, 11:55 PM 59678

    Changing Image URL while Draging on the Editor

    Hello,
    I am using cutesoft  editor  in my .net application.
    I have my own image list (with thumbnail images) on  my page and able to drag the images from my own image list to cutesoft  editor.
    Now we are showing thumbnail images in the image list and so while dragging the image to editor , editor displays the dragged thumbnail image.  But I want to display the actual image on the editor.
    Is there any way/event/method to change the image url while dragging the image to editor?
     
    We got stuck for this point. Please help for this.
     
    Thanks.
  •  03-29-2010, 2:22 AM 59702 in reply to 59678

    Re: Changing Image URL while Draging on the Editor

    Hi nisha@promactinfo.co.in,
     
    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
  •  03-29-2010, 4:16 AM 59704 in reply to 59702

    Re: Changing Image URL while Draging on the Editor

    Hello Ken,
     
    Thanks for replying and help.
    It worked but partially... only after once we switch to Normal to HTML mode after dragging the image and user does not know about this while dragging the image.
    Is there any way to resolve this in Normal mode itself without switching to HTML mode ?

    Thanks
  •  03-30-2010, 10:54 PM 59756 in reply to 59704

    Re: Changing Image URL while Draging on the Editor

    Hi nisha@promactinfo.co.in,
     
    Try
     
    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 t=code.replace(".thumbnail""");      
    23. }      
    24. function CuteEditor_OnChange(editor)=function test()    
    25. {   
    26.  editor.ExecCommand("TabCode");   
    27.  editor.ExecCommand("TabEdit");   
    28. }   
    29. </script>   
    Regards,
     
    Ken
View as RSS news feed in XML