Re: EditorOnPaste="PasteWord" differences from your sample

  •  07-17-2008, 9:18 PM

    Re: EditorOnPaste="PasteWord" differences from your sample

    Do not know I can tell which EditorOnPaste setting it is set to, anyhow it doesn't really matter. As you can see from my other posts I have been struggling with issue and none of the EditorOnPaste settings are gonna meet my needs.
     
    The problem is mainly that none of the options handles the mismash of word versions and word options and settings that I have to deal with for my clients. So as I have said in other posts I have my own function which I would like to run on EditorOnPaste, so it would be great if I could run a custom function instead of having to mess around with the options that nearly but don't do the specific job I need. It would make your life easier as well but this is a common topic in the forum.
     
    But at the moment I cannot run a custom function, so I have to look at other options like running the function on paste, which as you might know from my other posts, I am finding impossible to implement.
     
    1. I tried a custom button on the tool bar, but it doesn't display in Firefox, I can't figure out why yet.... see  http://cutesoft.net/forums/thread/42223.aspx

    2. I would not need a button if I could clean the clipboard data on paste, so as I said above, the best would be to allow a custom function in EditorOnPaste, see http://cutesoft.net/forums/thread/42172.aspx,
    but it seems I keep getting half answers, which are coveralls taken from the documentation, which I have already tried and which for some reason or other are not adequate...
     
    as in your reply to that thread....
     
     
    /**********************
    You need to Retrieve Data from the Clipboard first then use the editor1.PasteHTML function.
     
    PasteHTML()

     

    This method is used for pasting the specified HTML into a range within an editor document. If anything is selected, the selection is replaced with the new HTML and text.

    Example:

    // get the cute editor instance
    var editor1 = document.getElementById('<% = Editor1.ClientID%>');

    // pasting the specified HTML into a range within a editor document
    editor1.PasteHTML("Hello World");

    ***********************/ 
     
    this is fine, but...
     
    I have already been there and could not get it to work...
    First question, how do I retrieve Data from the clipboard (Data as in html), if I use clipboardData.getData('Text­ ') I can get the text, but it's just text there is no html to clean, so by the time it's pasted the html is just the same. Is there some way that you know to do this?
     
    Second, using Ctrl + V does not work with method, which alienates at least 90% of my clients.

    This is what I am doing...
     
    function CuteEditor_OnCommand(editor,command,ui,value)
                {
                    //handle the command by yourself
                    
                    flagFormChanged('<%=formChanged.ClientID%>');   
                    
                    if (command=="Paste")
                    {   
                     
                        var editor1 = document.getElementById(editor.id);
                        var selectedHtml = clipboardData.getData('Text');
                       
                        editor1.PasteHTML(cleanWordPaste(selectedHtml));
                    
                    }              
                }
     
    This all works fine, except the clipboardData.getData('Text'); only provides text not html and it does not work with Ctrl+V in IE, in firefox it does not work with Ctrl+V or the context menu, only edit paste from the firefox main menu.... it's one issue after another...@#$% and a lot of time wasted
     
    So I would appreciate it if you could show me how to implement a complete solution which allows me to run my cleanWordPaste() function on paste, before it hits the screen using both Ctrl+V and the context menu (or if Ctrl+V cannot be used then a solution on how to disable the Ctrl+V). You must know how to do it because you are doing exactly that with your EditorOnPaste functionality.
     
     
     
    Cheers
     

View Complete Thread