FCKeditor how pop-up windows are canceled when you paste word _javascript tips

Source: Internet
Author: User

The example in this article describes the way that pop-up windows are canceled when FCKeditor paste word. Share to everyone for your reference. The specific methods are as follows:

Use FCKeditor as a user-published edit box to allow users to publish word. By default, when you glue to Word, you are prompted to clear the word style, select Yes to pop up a box, and you need to paste it again to clear the word style. This operation is cumbersome, so cancel.

The first way to find it is to put the fckeditorcode_ie.js under the ckeditor/"target=" _blank >fckeditoreditorjs, and find the following pastefromword:

Copy Code code as follows:
Pastefromword:function () {fckdialog.opendialog (' fckdialog_paste ', Fcklang.pastefromword, ' dialog/fck_paste.html '), 400,330, ' Word ');

Change it to

Copy Code code as follows:
Pastefromword:function () {FCK. Inserthtml (Clipboarddata.getdata ("Text"));}

But in this way, it becomes plain text, no!

Then we found some solutions:

Because JS what will automatically cache, each test, but also to clear the temporary files and then refresh the page to do, really trouble ah!
The specific actions are as follows:
Open the Fckeditorcode_ie.js under the Fckeditoreditorjs,
Found it

Copy Code code as follows:
if (Confirm (fcklang.pastewordconfirm))

The article, instead:

Copy Code code as follows:
if (Confirm (fcklang.pastewordconfirm)) {var d=a;d=cleanword (d,true,true); FCK. Inserthtml (D); return false;}

Open the dialogfck_paste.html and paste the Cleanword function inside the head.

When you paste word again, when you select Yes, it clears the formatting directly. If not to whether the hint, the confirm (fcklang.pastewordconfirm) of the judgment can be removed.

I hope this article will help you with your JavaScript programming.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.