The method to cancel the window is displayed when the fckeditor is pasted with the Word, fckeditorword

Source: Internet
Author: User

The method to cancel the window is displayed when the fckeditor is pasted with the Word, fckeditorword

This example describes how to cancel the pop-up window when fckeditor pasted Word. Share it with you for your reference. The specific method is as follows:

Fckeditor is used as the editing box for user Publishing, allowing users to publish Word. By default, the system prompts whether to clear the word style when sticking to the word. If "yes" is selected, a box is displayed, and you need to paste it again to clear the word style. This operation is troublesome, so you need to cancel it.

The method to be found is to search for PasteFromWord in fckeditorcode_ie.js under ckeditor/"target =" _ blank "> fckeditoreditorjs and find the following content:

Copy codeThe Code is as follows: PasteFromWord: function () {FCKDialog. OpenDialog ('fckdiste _ Paste ', FCKLang. PasteFromWord, 'Dialog/fck_paste.html', 400,330, 'word ');}
Change it

Copy codeThe Code is as follows: PasteFromWord: function () {FCK. InsertHtml (clipboardData. getData ("Text "));}
But in this way, it becomes plain text, no!

Later, I found some solutions:

Because JS or something will be automatically cached, you have to clear the temporary files and refresh the page each time you test it. This is really troublesome!
The procedure is as follows:
Open fckeditorcode_ie.js under fckeditoreditorjs,
Find

Copy codeThe Code is as follows: if (confirm (FCKLang. PasteWordConfirm ))
Then, change:

Copy codeThe Code 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 in the header.

Then, when you paste the Word, if you select Yes, the format will be cleared directly. If you do not need a prompt, remove the confirm (FCKLang. PasteWordConfirm) judgment.

I hope this article will help you design javascript programs.


How can fckeditor not change the size of Text pasted from Word?

Not clear, come back

Select paste from word in the paste tool. When the paste dialog box appears, clear the Undo <font> label

How can I keep the table in Word when pasting it in the Web editor?

Solution: The FCKeditor editor is provided in SiteFactory, which removes unnecessary Word code and retains some styles in Word by using the "paste from MS Word" button in the editor, such as tables. Operation Method: 1, enter the SiteFactory system background, in the management interface to add information, you can see the "paste from MS Word" function button: 2, copy the relevant content from the Word, click the paste from MS Word function button and press Ctrl + V in the displayed window to paste the copied content in Word into the window content box, after selecting the "ignore Font Tag" and "Clear CSS style" check boxes, click "OK". 3. In the editor content box, you can see that the table format has been retained: 4. Click the "source code" button at the bottom of the editor to view the source code after the "paste from MS Word" function button is simple: directly paste the content in Word to the source code in the editor. Note: If you paste the content in Word format for the first time in the editor, the system will automatically display the dialog box, click "yes". The preceding clear format window is displayed automatically to facilitate direct operations: foreground effect: the mobile technology center uses SiteWeaver and SiteWeaver. You can paste buttons from Word, but you cannot retain styles such as tables. We can use this function in SiteFactory to get the relevant code, and then copy the code to SiteWeaver. The technology center SiteFactory CMS instruction manual> the articles in the built-in label instruction are all like this: tip: in the above-mentioned page effects of the mobile technology center, the table is displayed as a thin line, different from what you see in the editor. This is because the table in the document content page is defined separately in the CSS style of the mobile technology center :. tech_Article dd. articlecontent table {border-collapse: collapse ;}. tech_Article dd. articlecontent td {border: 1px solid #5E93B9; padding: 2px; font: normal 12px/150% Arial, "Al", Helvetica, sans-serif;} where: border-collapse: collapse;: defines the combination of row and cell edge of the table (if not defined, the standard HTML style is separated by default ). Border: 1px solid #5E93B9;: defines the edge of a cell as a pixel blue solid line border. Padding: 2px;: defines the cell padding. This method can be used to remove a large amount of useless code generated by directly pasting from the Word and reduce the amount of code on the web page, on the other hand, you can avoid text separation due to the format when directly pasting from the Word, and avoid searching related phrases when searching in the site.

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.