Options for FCKeditor controls in the JSP select retention, font type Add, carriage return, and paragraph replacement __jsp

Source: Internet
Author: User

(i) Options for FCKeditor controls Select retention

This is the case by default.


By modifying this, here is what I want, and of course you can choose according to your needs.


Specific documents you can go to read http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide

Here, just will fckconfig.js in the
fckconfig.toolbarsets["Default"] = [    [' Source ', ' docprops ', '-', ' Save ', ' NewPage ', ' Preview ', '-', ' Templates '],     [' cut ', ' Copy ', ' Paste ', ' pastetext ', ' Pasteword ', '-', ' Print ', ' spellcheck '],     [' Undo ', ' Redo ', '-', ' find ', ' Replace ', '-', ' SelectAll ', ' Removeformat '],     [' Form ', ' Checkbox ', ' Radio ', ' TextField ', ' Textarea ', ' Select ', ' Button ', ' ImageButton ', ' HiddenField '],      '/',     [' Bold ', ' italic ', ' underline ', ' Strikethrough ', '-', ' subscript ', ' superscript ',     [' orderedlist ', ' unorderedlist ', '-', ' Outdent ', ' Indent ', ' Blockquote ', ' creatediv ',     [' justifyleft ', ' justifycenter ', ' Justifyright ', ' justifyfull '],     [' Link ', ' Unlink ', ' Anchor ',     [' Image ', ' Flash ', ' Table ', ' rule ', ' smiley ', ' Specialchar ', ' pagebreak ',      ',      [' Style ', ' Fontformat ', ' FontName ', ' fontsize '],     [' textcolor ', ' bgcolor ',     [' Fitwindow ', ' Showblocks ', '-', ' about '] ] ; Copy to our own definition of JS file Myconfig.js, and make simple modifications to remove unwanted controls. Note that the original style is retained.
fckconfig.toolbarsets["myTest"] = [[' Source ', ' docprops '], [' Bold ', ' italic ', ' underline ', ' strikethrough ', '-', '] Subscript ', ' superscript '], [' orderedlist ', ' unorderedlist ', '-', ' outdent ', ' Indent ', ' Blockquote '], [' Justifyleft ', '] Justifycenter ', ' justifyright ', ' justifyfull '], [' Link ', ' Unlink ', ' Anchor '], [' Image ', ' Flash ', ' Table ', ' rule ', ' Smiley ', ' Specialchar ', ' pagebreak ', '/', [' Style ', ' Fontformat ', ' fontname ', ' fontsize '], [' TextColor ', ' bgcolor '], [' Fitwindow ', ' showblocks ', '-', ' about ']//No comma for the last row. ] ; At this point, the function has been modified and refreshed.

(ii) Font type additions to the FCKeditor control
Attributes can be found from the Fckconfig.js
Fckconfig.fontnames = ' Arial; Comic Sans MS; Courier New; Tahoma; Times New Roman; Verdana ';
Note The default is only these styles, you can place the Fckconfig.fontnames property to Myconfig.jsIn
fckconfig.fontnames= "XXFarEastFont-Arial _gb2312; italics; bold; official script; Arial; Comic Sans MS; Courier New; Tahoma; Times New Roman; Verdana ' ";

This allows you to add the fonts we need to the editor.

(iii) switch of carriage return to line and paragraph
If we need a carriage return-enter; paragraph-shift+enter; this is more convenient and suitable for people's habits.
Only need to go to the fckconfig.js to find
Fckconfig.entermode = ' P ';
Fckconfig.shiftentermode = ' BR ';

Change into

Fckconfig.entermode = ' BR ';
Fckconfig.shiftentermode = ' P ';

To complete, and if you need additional functionality, you can read the official documentation.

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.