Re: EditorOnPaste="PasteWord" differences from your sample

  •  07-19-2008, 2:50 AM

    Re: EditorOnPaste="PasteWord" differences from your sample

    Hi zaggle,
     
    In which case you'll need to execute the paste command yourself then tell cuteeditor that you have done this. e.g.
     
    function CuteEditor_OnCommand(editor,command,ui,value) {
      if (command=="Paste") {   
        var oEditor = document.getElementById(editor.id);
        var oSelection = oEditor.GetSelection();
        var oRange = oSelection.createRange();
     
        //DHTML Paste Command.
        oRange.execCommand("Paste");
     
        var sHTML = oEditor.getHTML();
     
        //Parse HTML and Clean
        sHTML = sHTML.replace('<br />', '</p><p>');
     
        oEditor.setHTML(sHTML);
     
        //Tell CuteEditor Paste handled
        return true;
      }              
    }
     
    BTW, this code only works for IE, firefox needs different code (I think).
     
    Many Thanks,
    Ady
View Complete Thread