trap paste command --urgent

  •  01-14-2009, 10:18 AM

    trap paste command --urgent

       
     
    Hi Adam,
     
    The requirement is something like when user click on the paste button and try to paste some content which contains some string say "Position:absolute" then need to prompt some message saying the "this containspositionas absolute".
     
    Now for this I can trap the Paste command with
    CuteEditor_OnCommand(editor,command,ui,value).
     
    but how to get the content which user is about to paste.
     
    in above on debug I found value and ui is comming as null
     
     
     
    I'm using followin code to trap the command.
     

    <script language="JavaScript" type="text/javascript" >

    var editor1=document.getElementById("<%=Editor1.ClientID%>");

    if(editor1.IsReady)CuteEditor_OnInitialized(editor);

     

     

    function CuteEditor_OnCommand(editor,command,ui,value)

    {

    //handle the command by yourself

    if(command=="Paste")

    {
    //Some code--- IsContainsAbsoluteposition(Contentstring)???? how to get this Contentstring

    var answer = confirm("Click OK to stop this command.")

    if (answer){

    return true;

    }

    else{

    return false;

    }

    }

    }

     

     

    </script>
     
    Thanks
View Complete Thread