Re: Customizing the "Insert Image" Button

  •  06-19-2006, 9:57 PM

    Re: Customizing the "Insert Image" Button

    dmears1,
     
    If you don't need the other options, you can modify the dialog to meet your own requirement.
     
    For example, copying/pasting the following code into insertimage.frame.aspx.
     
    <HTML>
     <head>  
      <link rel="stylesheet" href='style.css'>
     </head>
     <body bottomMargin="0" topMargin="10" leftmargin="3" marginwidth="0" marginheight="0"> 
      <input type="text" id="TargetUrl" size="43" name="TargetUrl">  
      <input class="inputbuttoninsert" type="button" value="[[Insert]]" onclick="do_insert()">&nbsp;&nbsp;&nbsp;
      <input class="inputbuttoncancel" type="button" value="[[Cancel]]" onclick="do_cancel()">
           
      <script>
      
       var obj=top.dialogArguments;
       var element=obj.img;
       var editor=obj.editor;
         
       if(!top.frameloaded)
       {
        top.frameloaded=true; 
        var src;
        src = element.getAttribute("src") + '' ;
        if(element.getAttribute("src_cetemp"))
         src = element.getAttribute("src_cetemp") + '' ;  
              
        TargetUrl.value=src; 
       }
       
       function do_insert()
       {
        var img=element;
        img.src = TargetUrl.value; 
        if(editor.GetActiveTab()=="Edit")
         img.setAttribute("src_cetemp",TargetUrl.value);
         
        if(editor.GetActiveTab()=="Code")
         editor.PasteHTML(img.outerHTML);
        else
         editor.InsertElement(img,obj.img);
         
        top.close();
       }  
       
       
       function do_cancel()
       {
        top.close();
       }
      
      </script>
     </body>
    </HTML>


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View Complete Thread