This article describes the method of canceling pop-up window when fckeditor pastes Word. Share it for your reference. The specific methods are as follows:
Use fckeditor as the edit box published by the user, allowing users to publish Word. By default, when sticking into word, it prompts whether to clear the word style. Select "Yes" to pop up a box and need to paste it again to clear the word style. This operation is very troublesome, so it needs to be cancelled.
The method to start finding is to put fckeditorcode_ie.js under ckeditor/" target="_blank">fckeditoreditorjs, search PasteFromWord to find the following content:
The code copy is as follows: PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');}
Change it to
The code copy is as follows: PasteFromWord:function(){FCK.InsertHtml( clipboardData.getData("Text") );}
But in this way, it will become plain text, no!
Later, some solutions were found:
Since JS and other things are automatically cached, every time you test, you have to clear the temporary files and refresh the page. It's really troublesome!
The specific operations are as follows:
Open fckeditorcode_ie.js under fckeditoreditorjs,
turn up
Copy the code code as follows: if (confirm(FCKLang.PasteWordConfirm))
That one, changed to:
The code copy is as follows: if (confirm(FCKLang.PasteWordConfirm)){var D=A;D=CleanWord(D,true,true);FCK.InsertHtml(D); return false;}
Open dialogfck_paste.html and paste the CleanWord function inside to the head.
When pasting Word again, after selecting Yes, the format will be directly cleared. If you don't have a prompt, just remove the judgment of confirm (FCKLang.PasteWordConfirm).
I hope this article will be helpful to everyone's JavaScript programming.