How can I set control to make insert image no width and height tag info?

Last post 09-04-2012, 9:56 PM by oksummer. 4 replies.
Sort Posts: Previous Next
  •  08-29-2012, 10:19 PM 74517

    How can I set control to make insert image no width and height tag info?

    when i insert image,control will auto generate the  width and height message, like following"><img border="0" src="/websites/Global/products/Cot4XBiVyYsLxcL5/p_150.jpg" width="150" height="150" alt="" />
    How can I set to cancel them
    "
  •  08-30-2012, 7:43 AM 74518 in reply to 74517

    Re: How can I set control to make insert image no width and height tag info?

    Hi oksummer,

     

    Please try the way below

     

    1. Open file "\CuteSoft_Client\CuteEditor\Dialogs\InsertImage.aspx "

     

    2. Find section below

     

    <input class="formbutton" type="button" value="[[Insert]]" onclick="do_insert()"
    id="Button1" />


    3. Change it to

     

    <input class="formbutton" type="button" value="[[Insert]]" onclick="customInsert()"
    id="Button1" />
     

    4. Add the code below to the bottom of the page

     

    <script>
    function customInsert()
    {
        var inp_width=document.getElementById("inp_width");
        var inp_height=document.getElementById("inp_height");
        inp_width.value="";
        inp_height.value="";
        do_insert();
    }
    </script>

     

    Regards,

     

    Ken 

  •  09-03-2012, 2:26 AM 74538 in reply to 74518

    Re: How can I set control to make insert image no width and height tag info?

     Yeah,that is in [Insert Image],but have another section in [Image Gallery],How can i do?

    thank you friend.

  •  09-04-2012, 8:37 AM 74559 in reply to 74538

    Re: How can I set control to make insert image no width and height tag info?

    Hi oksummer,

     

    if you do not need the widht and height property of the img target anymore, please try the example below. the HTMLfilter code will remove the widht/height property for all images.

     

    1. <%@ Page Language="C#" AutoEventWireup="true" %>  
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>  
    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></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. function CuteEditor_FilterHTML(editor,code)     
    19. {     
    20.     var editdoc = editor.GetDocument();  
    21.     for(var i=0;i<editdoc.images.length;i++)  
    22.     {  
    23.            editdoc.images.item(i).removeAttribute("width");  
    24.            editdoc.images.item(i).removeAttribute("height");  
    25.     }  
    26.     return code;     
    27. }     
    28. function CuteEditor_FilterCode(editor,code)     
    29. {     
    30.     var editdoc = editor.GetDocument();  
    31.     for(var i=0;i<editdoc.images.length;i++)  
    32.     {  
    33.            editdoc.images.item(i).removeAttribute("width");  
    34.            editdoc.images.item(i).removeAttribute("height");  
    35.     }  
    36.     return code;     
    37. }     
    38. </script>  
    Regards,

     

    Ken 

  •  09-04-2012, 9:56 PM 74571 in reply to 74559

    Re: How can I set control to make insert image no width and height tag info?

    I have try it,it run perfect!, thank you very much.
View as RSS news feed in XML