Trouble duplicating insert hyperlink functionality

  •  10-28-2005, 7:41 AM

    Trouble duplicating insert hyperlink functionality

    Hi There
     
    I'm trying to create something very similar to the "insert hyperlink" functionality of the cute editor.
     
    Unfortunately I just can't seem to get the JavaScript function in the modal window correct.
     
    I have the following in the modal so far.
     
    function button_click(){
     var editor=window.dialogArguments;
     //_Format(editorID,'Cut');
     var sel = editor.document.selection.createRange();
     if (editor.document.selection.type == 'Control') {
      return;
     }
     sel.pasteHTML("test");
    }
     
    This is the latest version I've tried after looking through the other posts.
    The problem is that it works just fine, and long as nothing is selected.
    As soon as I select something and trigger the click I get a JavaScript error saying "incompatible markup pointers for this operation"
     
    Could you please give me the function you use for the "insert hyperlink" dialog, so I can alter it to suit my needs?
    I've taken a look at that dialog - and I really have no idea what you guys are doing :(
     
    Thank you
View Complete Thread