FCKeditor 2.3 settings. Modify. Use (1)

Source: Internet
Author: User

FCKeditor is absolutely powerful, open-source, constantly updated, and supported in multiple languages. Therefore, there are many users, such as Baidu and csdn.

Now we will give a brief introduction to the setting and use of the latest version (2.3). We hope it will be helpful to you. Based on the time-most valuable principle, we will talk little about it.

[1] simplified

Go to fckeditor_2.3.2/FCKeditor and delete the folders starting with "_". These folders contain examples or other tools. In fact, only the Editor folder and fckconfig are retained. JS, FCKeditor. JS, fckstyles. XML, fcktemplates. XML is enough. The outermost layer is simplified. after entering the Editor folder, delete the "_ source" folder first. Here are some source files, which are useless for use.

Enter the editorimages/smiley folder. Some files are placed with emoticon icons. As I will use my own emoticon icons, delete them first. Of course, if you want to use the emojis here, do not delete them.

Exit images and enter the Lang folder, leaving only the zh-cn.js, en. JS, Zh. JS and fckconfig. JS settings correspond to the corresponding language files, zh-cn.js is a simplified Chinese Language Pack, en. JS is not required, Zh. JS is in Traditional Chinese. A few hundred K is missing.

Then exit the Lang folder and enter the skin folder. If you want to use the default FCKeditor milk yellow, delete the other two folders except the default folder, silver and office2003.

In the last step of streamlining, exit the skin folder and go to filemanager. If you are not using the latest FCKeditor version, a folder browser is used. The new version also has an upload folder. First, go to filemanager/Browser/default/connectors. Next, go to filemanager/upload/to simplify the process. Next, modify the settings of the editor.

[2] modify

The first modified file is the FCKeditor configuration file, which is located in the fckconfig. js file under the root directory. Please follow the list below

Find fckconfig. defaultlanguage = 'en'; change to fckconfig. defaultlanguage = 'zh-cn'; set the default language to simplified Chinese.
Find fckconfig. tabspaces = 0; change to fckconfig. tabspaces = 1; that is, you can use the tab key in the editor.

If your editor is still used on the front-end of a website, such as a blog, consider security. Do not use the default toolbar on the front-end, either customize the function or use the basic defined by the system, that is, the basic toolbar,
Find row 64th:

Fckconfig. toolbarsets ["Basic"] = [
['Bold ', 'italic', '-', 'orderedlist', 'unorderedlist', '-',/* 'link', */'unlink ', '-', 'style', 'fontsize', 'textcolor', 'bgcolor', '-', 'smiley ', 'specialchar', 'replace ', 'preview']
];

This is the basic I changed. I removed the image function and removed the Add link function, because the image and link and flash and image button adding functions allow the front-end page to directly access and upload files, if I don't change it here, I will upload a Trojan to you. Isn't it enough?

Find: fckconfig. fontnames = 'arial; Comic Sans MS; Courier New; tahoma; Times New Roman; verdana ';

Add several common fonts fckconfig. fontnames = '; _ gb2312; Arial; Comic Sans MS; Courier New; tahoma; Times New Roman; verdana ';

If you want to use your own emoticon icon, change the folder address of the emoticon icon and the file name of the emoticon icon below, the three numbers below are the number of emotices displayed on each line and the width and height of the pop-up window. The size depends on the size of the window arranged by the emoticon icon. OK. The change to the total configuration file is complete.

Fckconfig. smileypath = fckconfig. basepath + 'images/smiley/MSN /';
Fckconfig. smileyimages = comment '];
Fckconfig. smileycolumns = 8;
Fckconfig. smiley+wwidth = 320;
Fckconfig. smiley1_wheight = 240;

Next, set the editor location. You need to modify the following:

[3] Use

Add the following content to your file:

<SCRIPT type = "text/JavaScript">
<! --
VaR sbasepath = Document. Location. pathname. substring (0, document. Location. pathname. lastindexof ('_ testcases '));

VaR ofckeditor = new FCKeditor ('model. content ');
Ofckeditor. basepath = sbasepath;
Ofckeditor. width = 700;
Ofckeditor. Height = 500;
Ofckeditor. value = '';
Ofckeditor. Create ();
// -->
</SCRIPT>

Change sbasepath = "/FCKeditor/" to sbasepath = "/"
Open the FCKeditor. js file and find this. basepath = '/FCKeditor/'; change this. basepath = '/';

Modify the default font in the editor and open/Editor/CSS/fck_editorarea.css.

 

[Obtain the value of 'model. content]

JS uses alert (fckeditorapi. getinstance ('model. content'). getxhtml (true) to get the value of 'model. content;


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.