Re: Creating editor with HTML and JS

  •  04-29-2008, 12:36 PM

    Re: Creating editor with HTML and JS

    That example is what I've based my solution on, actually.
     
    With JS it changes the style of the DIV the editor is in.
     
    In my example I need to be able to move the editor from one DIV into another.
     
    <!--#include virtual= "/CuteEditor_Files/include_CuteEditor.asp" -->

    <html>
        <head>
            <script language="javascript">
          
          var d=document;
          
          function dge(s) {
              return d.getElementById(s);
          }
            function hide()
            {
                dge("div1").style.display="none";
            }
            function show()
            {
                dge("div1").style.display="block";
            }
            function xmove()
            {  
                var ee = dge("Container");
                if (dge("div2").innerHTML=="") {
                    dge("div2").appendChild(dge("Container"));
                }
                else
                {
                    dge("div1").appendChild(dge("Container"));
                }
            }
            </script>
        </head>
        <body>
    <DIV id="title">DIV1</DIV>
                <div id="div1" style="border:1px solid black;margin:3px;padding:2px;">
    <div id=Container>
     <!-- CuteEditor Editor1 Begin -->
    <%
      Set editor = New CuteEditor
      editor.ID = "Editor1"
      editor.Text = "Type text here!"
      editor.FilesPath = "CuteEditor_Files"
      editor.ShowBottomBar = true
      editor.ThemeType = "Office2003"
      editor.ShowHtmlMode = true
      editor.TemplateItemList="G_start,FontName,FontSize,Separator,Bold,Italic,Underline,G_end, " &_
                              "G_Start,JustifyLeft,JustifyCenter,JustifyRight,Separator,InsertOrderedList,InsertUnorderedList,"&_
                              "Separator,InsertLink,Unlink,Separator,InsertEmotion,G_end"
      editor.Height = 240
      editor.Width = "100%"
     editor.Draw()
    %>
     <!-- CuteEditor Editor1 End -->

    </div>
                </div>
                <hr>
                <a onclick="hide()" href="#">Hide</a> |
                <a onclick="show()" href="#">Show</a> |
                <a onclick="xmove()" href="#">Move</a> |
                <a href="editortest5.asp">Use a Form</a>
    <DIV id="title">DIV1</DIV>            
    <div id="div2" style="border:1px solid black;margin:3px;padding:2px;"></div>

    </body>
        
    </html>

    For any content I've tried, other than the CE, it works in both IE and FF; but with the CE in "div1", it works in IE, but not FF.
     

View Complete Thread