Re: Custom Embed Object

  •  01-04-2011, 11:45 AM

    Re: Custom Embed Object

    Dear Gerudo,
     
    Please follow steps:
    1.  Save the folling code to test.asp

    <!-- #include file = "cuteeditor_files/include_CuteEditor.asp" -->
    <html> 
        <head>
      <link rel="stylesheet" href="asp.css"  type="text/css" />
     </head>
        <body>
      
      <form name="theForm" action="Get_HtmlContent.asp" method="post">
    <%
    Set editor = New CuteEditor
    editor.ID = "Content"
    editor.Text = content
    editor.Height = "600"
    editor.Width = "900"
    editor.CustomAddons = "<img class=""CuteEditorButton"" onmouseover=""CuteEditor_ButtonCommandOver(this)"" onmouseout=""CuteEditor_ButtonCommandOut(this)"" onmousedown=""CuteEditor_ButtonCommandDown(this)"" onmouseup=""CuteEditor_ButtonCommandUp(this)"" Command=""Embed"" src=""/sampleimage/hp_logo.gif"" />"  
    editor.Draw()
    %>    
        <script type="text/javascript" >
            vareditor1 = document.getElementById("<%= editor.ClientID %>");

            function CuteEditor_OnCommand(editor, command, ui, value) {
                //handle the command by yourself   
                if (command == "Embed") {
                    //editor.ExecCommand("InsertTable");   
                    //editor.PasteHTML('<embed src="http://cutesoft.net/uploads/armadillo.jpg" width="100%" height="100%">');
                    // I updated this line
                    editor.PasteHTML('<p><a href="http://cutesoft.net/uploads/Guest/i-9.pdf">/uploads/Guest/i-9.pdf</a></p>');
                    return true;
                }
            }   
       </script>
        </form>
     </body>
    </html>
    2. Run test.asp
    3. Click this customization button
    4. The html code will be pasted to CuteEditor, please select the text in CuteEditor, and then click the property menu item:
     
     
     
    Thank you for asking
View Complete Thread