Custom Embed Object

Last post 01-11-2011, 6:10 PM by Gerudo. 8 replies.
Sort Posts: Previous Next
  •  01-03-2011, 7:03 PM 65585

    Custom Embed Object

    I am trying to create a cusomt button that will allow you to embed a selected file rather then just display a link to it.
     
    This is my code so far...
     

    <%
    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=""/images/embed.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/documents/cmf-hostingplanform-25off.pdf" width="100%" height="100%">');   
                    return true;   
                }   
            }    
       </script>
     
    which works 100%. However, looking throught the documentation i didnt see a way i can access the file select screen.
     
    Is there anyway i can access a file select screen and have that selected file be the src of my embed?
     
    Thanks in advanced
  •  01-04-2011, 11:45 AM 65589 in reply to 65585

    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
  •  01-05-2011, 12:36 PM 65597 in reply to 65589

    Re: Custom Embed Object

    I feel that this answer is incomplete, and doesnt address what I asked.
     
    After I click on the 'Properties' menu what do i do? There is no embed option for selected text.
     
    Also my main question was if i could have access to a file select screen. E.g. when you go to insert an image it brings up a window that you can select a file to insert. I want that ability to embed a selected file, since one is not created already i was going to create one for my clients.
     
    Thank you.
  •  01-05-2011, 2:27 PM 65600 in reply to 65597

    Re: Custom Embed Object

    Dear Gerudo,
     
    After you click the "Properties", the properties dialog will be displayed, you can click button "Browse"  in the tab "LINK" and select different file.
     
    Regards,
    Eric
  •  01-05-2011, 2:39 PM 65601 in reply to 65600

    Re: Custom Embed Object

    That way will work since its in an <a> tag, however i need to be able to do that with an <embed> tag. Where there is no "Browse" for the embed properities.
  •  01-06-2011, 9:39 AM 65616 in reply to 65601

    Re: Custom Embed Object

    Dear Gerudo,
     
    You can click "Insert Flash" or "Insert Media", it will embed flash or media file to edit area, the generated html code are as follows:
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="280" height="220" xcodebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
    <param name="Movie" value="/CuteSoft_Client/CuteEditor/flashplayer.swf?videoUrl=http://cutesoft.net/uploads/barsandtone.flv&playerMode=simple&autoPlay=true"   />
    <param name="Quality" value="high"  />
    <param name="wmode" value="transparent"  />
    <param name="allowFullScreen" value="true"  /><embed src="http://cutesoft.net/CuteSoft_Client/CuteEditor/flashplayer.swf?videoUrl=http://cutesoft.net/uploads/barsandtone.flv&playerMode=simple&autoPlay=true" width="280" height="220" quality="high" wmode="transparent" allowfullscreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  ></embed>
    </object></p>
     
    You don't have to create customization button to embed a file.
    When you click "Properties" for the embedded file, the file selection dialog is not supported. If you'd like to change the embedded file, you can remove current one, and click "Insert Flash" or "Insert Media", add a new one.
     
    Thank you for asking
  •  01-06-2011, 11:17 AM 65618 in reply to 65616

    Re: Custom Embed Object

    Hi Eric,
     
       Yes i know you can use the insert flash or media. However, I wish to embed documents, i.e. pdf, word etc. Right now there is only a button to link to the document. I need to embed the document so that it will show on a page.
     
    So the end result will be...
     
    <embed src="flyer.pdf"/>
     
    Now i can create a button to put a static embed on but i would like the ability to choose a different document to embed.
     
    Thanks
  •  01-10-2011, 9:58 AM 65657 in reply to 65618

    Re: Custom Embed Object

    Dear Gerudo,
     
    When you use tag <embed>, Choosing different document to embed is not supported.
     
    Thank you for asking
  •  01-11-2011, 6:10 PM 65682 in reply to 65657

    Re: Custom Embed Object

    Hi Eric,
     
       I know it's not supported, thats why i wanted to create a custom button.
     
       My question is if i can access a document screen using a custom buttom
View as RSS news feed in XML