bookmarks in dropdownlist

Last post 07-20-2006, 4:47 AM by the4bs. 2 replies.
Sort Posts: Previous Next
  •  07-19-2006, 11:08 AM 21065

    bookmarks in dropdownlist

     
    I would like to open a popup window from the editor toolbar which displays a list of bookmarks from the current editor.
    See picture:
     
    Thank you for the reply to my previous post.
     
    Unfortunately I am not able to use the solution you offered - due to the way that the website I am working on is meant to function.
    I have been trying this code inside the popup window, but not had success yet.
     
    function anchorOptions()
    {
    var Editor1 = window.opener.document.getElementById('CE_ctl00_maincontent_Editor1_ID');
    var count;
    for(count = 0; count < Editor1 .anchors.length; count++){
    var oAnchor = Editor1 .anchors[count];
    document.write("<option value=' + oAnchor.name + '>" + oAnchor.name + "</option>");

    }
    }
     
     
    <select name="hash_2">
    <option value="top">Top of page</option>
    <script type="text/javascript">
    anchorOptions();
    </script>
    </select>

    Any suggestions?

    Thank you.
     
  •  07-19-2006, 12:47 PM 21073 in reply to 21065

    Re: bookmarks in dropdownlist

    the4bs,
     
    OK.
     
    First please check this example:
     
     
    This example shows you how to pass the editor object to the pop-up window.
     
    Second after you get the editor object, you should be able to get the editor document object.
     
    // get the active editor document
    var editdoc = editor1.GetDocument();
     
    Then loop all anchors in this document object:
     
    for(var i=0;i<editdoc.anchors.length;i++)
    {  
    .........
    }
     
     

     
     

    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

  •  07-20-2006, 4:47 AM 21123 in reply to 21073

    Re: bookmarks in dropdownlist

    Thank you very much! - that worked.
     
    For the benefit of anyone else who would like to do this, I used this code:
     
    var editor1 = window.opener.document.getElementById('CE_ctl00_maincontent_Editor1_ID');
       var editdoc = editor1.GetDocument();
       var count;
        for(count = 0; count < editdoc.anchors.length; count++){
         var oAnchor = editdoc.anchors[count];
       document.write("<option value=' + oAnchor.name + '>" + oAnchor.name + "</option>");
     
        }
      }
     
     
    <select name="hash_2">
         <option value="top">Top of page</option>
         <script type="text/javascript">
           anchorOptions();
         </script>
       </select>
View as RSS news feed in XML