Latest FCKeditor simplified configuration (used for FCKeditor configuration)

Source: Internet
Author: User

Set the upload directory in fckeditoreditorfilemanagerconnectorsaspconfig. asp.

 

Dim configuserfilespath

Configuserfilespath = "/userfiles /"

 

Chinese configuration instructions:

This is because the downloaded package contains many files that we cannot use when using them. You can do this without deleting them. Let's look at my personal preferences. The following uses PHP as an example to program slimming.

 

Delete all files and folders starting "_"

Delete the FCKeditor directory:

FCKeditor. AFP

FCKeditor. asp phpchina

FCKeditor. CFC

FCKeditor. cfm phpchina

FCKeditor. lasso

FCKeditor. pl phpchina

FCKeditor. py

Access.txt

License.txt

Delete languages other than Chinese and English in the Language Pack editorlang

Delete a folder except the default skin in the skin directory

Filemanager/Browser/default/connectors/Files other than PhP under the directory (the latest 2.6.4.1 version seems to be under/filemanager/connectors)

Files other than PhP in the filemanager/upload/directory

If you do not want to delete the MSN folder and emoticons under editorimagessmiley

All done. simplified.

 

We usually store the editor in a folder. Normally we can understand it as FCKeditor or editor.

 

Find the two key files fckeditor_php4.php fckeditor_php5.php. The codes of these two files are not much different. It is obviously related to the PHP version.

 

Open these two files

 

XML/html code

Function FCKeditor ($ InstanceName)

{

$ This-> InstanceName = $ InstanceName;

$ This-> basepath = './Editor/'; default file location of the Editor

$ This-> width = '000000'; default editor width

$ This-> Height = '000000'; default editor height

$ This-> toolbarset = 'default'; default editor skin

$ This-> value = "; Initial Value

 

$ This-> Config = array ();

}

FCKeditor setting file "fckconfig. js"

 

 

XML/html code

Fckconfig. customconfigurationspath = "; // customize the path and name of the configuration file

Fckconfigfckconfig. editorareacss = fckconfig. basepath + 'css/fck_editorarea.css '; // The style table file in the editing area

Fckconfig. editorareastyles = "; // the style of the style sheet in the editing area

Fckconfig. toolbarcombopreviewcss = "; // You can preview CSS in the toolbar.

Fckconfig. doctype = "; // Document Type

Fckconfig. basehref = "; // The base address of the Relative Link

Fckconfig. fullpage = false; // whether to allow editing of the entire HTML file or only the content between the bodies

Fckconfig. startupshowblocks = false; // determines whether to enable the "display module"

Fckconfig. DEBUG = false; // whether debugging is enabled

Fckconfigfckconfig. skinpath = fckconfig. basepath + 'Skins/default/'; // skin path

Fckconfig. preloadimages =... // Pre-installed Image

Fckconfigfckconfig. pluginspath = fckconfig. basepath + 'ins INS/'; // Plug-In Path

Fckconfig. autodetectlanguage = true; // whether to automatically detect the language

Fckconfig. defaultlanguage = 'zh-cn'; // default language

Fckconfig. contentlangdirection = 'ltr'; // The default text direction. Optional, "LTR/RTL", that is, left-to-right or right-to-left.

Fckconfig. processhtmlentities = true; // process HTML Objects

Fckconfig. includelatinentities = true; // including Latin

Fckconfig. includegreekentities = true; // includes Greek

Fckconfig. processnumericentities = false; // process numeric entities

Fckconfig. additionalnumericentities = "; // additional numeric entity

Fckconfig. fillemptyblocks = true; // whether to fill an empty Block

Fckconfig. formatsource = true; // whether to automatically format the code when switching to the Code view

Fckconfig. formatoutput = true; // whether to automatically format the code when outputting the content

Fckconfig. formatindentator = ''; // The characters used to indent the code in the source code format

Fckconfig. startupfocus = false; // whether the focus is in the editor when it is enabled, that is, whether the time mark on the page is stuck on FCKeditor

Fckconfig. forcepasteasplaintext = false; // whether to forcibly paste the File Content

Fckconfig. autodetectpastefromword = true; // whether to automatically detect file pasting from word. Only Internet Explorer is supported.

Fckconfig. showdropdialog = true; // whether the drop-down menu is displayed

Fckconfig. forcesimpleampersand = false; // do not convert & into XML entities

Fckconfig. tabspaces = 0; // press the tab key. The default value is zero.

Fckconfig. showborders = true; // merge borders

Fckconfig. sourcepopup = false; // pop-up

Fckconfig. toolbarstartexpanded = true; // start the FCKeditor toolbar to show whether to expand by default.

Fckconfig. toolbarcancollapse = true; // whether to collapse or expand the toolbar

Fckconfig. ignoreemptyparagraphvalue = true; // whether to ignore empty paragraph values

Fckconfig. floatingpanelszindex = 10000; // floating panel Index

Fckconfig. htmlencodeoutput = false; // whether to output HTML Encoding

Fckconfig. templatereplaceall = true; // whether to replace all templates

Fckconfig. toolbarlocation = 'in'; // toolbar location,

Fckconfig. customconfigurationspath = "; // customize the path and name of the configuration file

Fckconfigfckconfig. editorareacss = fckconfig. basepath + 'css/fck_editorarea.css '; // The style table file in the editing area

Fckconfig. basehref = "; // The base address of the Relative Link

Fckconfig. DEBUG = true/false; // whether to enable the debugging function. When you call fckdebug. Output (), the content is output in the debugging window.

Fckconfigfckconfig. skinpath = fckconfig. basepath + 'Skins/default/'; // set skin

Fckconfig. autodetectlanguage = true/false; // whether to automatically detect the language

Fckconfig. defaultlanguage = 'zh-cn'; // set the default language

Fckconfig. contentlangdirection = 'ltr/rtr'; // default text direction, left for LTr, right for RTR

Fckconfig. fillemptyblocks = true/false; // this function can be used to replace empty block-level elements with spaces.

Fckconfig. formatsource = true/false; // whether to automatically format the code when switching to the Code view

Fckconfig. formatoutput = true/false; // whether the code is automatically formatted when the content is output

Fckconfig. formatindentator = ""; // specifies the characters used to indent the code in the "Source code format ".

Fckconfig. geckousespan = true/false; // whether to allow the span flag to replace the B, I, u flag

Fckconfig. startupfocus = true/false; // whether to focus to the editor when enabled

Fckconfig. forcepasteasplaintext = true/false; // force the paste to plain text

Fckconfig. forcesimpleampersand = true/false; // do not convert & into XML entities

Fckconfig. tabspaces = 0/1; // whether the tab is valid

Fckconfig. tabspaces = 4; // number of spaces generated by the tab key

Fckconfig. showborders = true/false; // whether to merge borders

Fckconfig. toolbarstartexpanded = true/false; // whether to expand the toolbar when loading the page. It appears only when you click "Expand toolbar ".

Fckconfig. toolbarcancollapse = true/false; // whether to show and collapse the toolbar

Fckconfig. toolbarsets = object; // The toolbar of the editor, which can be customized and deleted. For details, refer to the existing toolbar.

Fckconfig. entermode = 'P'; // press enter in the editor to generate the file in the Code. Optional values: p | Div | br

Fckconfig. shiftentermode = 'br '; // SHIFT + press enter in the editor, which is generated in the Code. Optional values: p | Div | br

Fckconfig. contextmenu = string array; // context menu content

Fckconfig. fontcolors = ""; // text color list

Fckconfig. fontnames = ""; // font list

Fckconfig. fontsizes = ""; // font size list

Fckconfig. fontformats = ""; // text format list

Fckconfig. stylesxmlpath = ""; // location of the XML file in the CSS style list

Fckconfig. templatesxmlpath = ""; // The XML file location of the template

Fckconfig. spellchecker = "iespell/spellerpages"; // spell checker

Fckconfig. iespelldownloadurl = ""; // download the spelling checker URL

Fckconfigfckconfig. smileypath = fckconfig. basepath + 'images/smiley/MSN/'; // storage path of the emoticon File

Fckconfig. smileyimages = "; // list of emoticon file names. For details, refer to the default settings.

Fckconfig. smileycolumns = 8; // Number of columns displayed in the emoticons window

Fckconfig. smiley1_wwidth = 320; // display width of the emoticon window. This window will be adjusted due to changes in the emoticon file.

Fckconfig. smiley1_wheight = 240; // The height of the emoticons window. This window will be adjusted due to changes in the emoticons file.

Fckconfig. fullpage = true/false; // whether to allow editing of the entire HTML file or only the content between the bodies

 

 

Upload settings

 

VaR _ filebrowserlanguage = 'php'; // ASP | aspx | CFM | lasso | Perl | PHP | py

VaR _ quickuploadlanguage = 'php'; // ASP | aspx | CFM | lasso | PHP [/Code]

// The first is the language used by the file browser, and the second is the language used for fast upload.

Fckconfig. linkuploadallowedextensions = ""; // empty for all

Fckconfig. linkuploaddeniedextensions = ". (PhP | php3 | PhP5 | phtml | ASP | aspx | ascx | JSP | CFM | CFC | PL | bat | exe | DLL | Reg | CGI) $"

// This is a list of two file types that allow and reject upload.

Fckconfig. imagebrowser = false; Whether to enable the Server File browsing function in the image inserting Function

Fckconfigfckconfig. imagebrowserurl = fckconfig. basepath + 'filemanager/Browser/default/browser.html? Type = imageconnector = connectors/'+ _ filebrowserlanguage +'/connector. '+ _ filebrowserextension;

Type = image indicates that the file type is image, which causes the file browser to locate the File Upload path/image/folder.

Fckconfig. flashbrowser = false; Whether to enable Server File browsing in the Flash insertion function

Fckconfig. linkupload = false; Whether to enable the quick upload function of the inserted Link

Fckconfig. imageupload = false; Whether to enable the image quick upload function

Fckconfig. flashupload = false; Whether to enable the flash upload function

 

 

Server File Settings

 

File browser settings:

Fckeditoreditorfilemanagerconnectorsaspconfig. asp

 

Configisenabled = true determines whether to enable the file browser. This is executed on the server.

Configuserfilespath = "/test/upload/" File Upload path (relative)

Configallowedextensions. Add "file ",""

Configdeniedextensions. add "file ", "php | PhP2 | php3 | PhP4 | PhP5 | phtml | pwml | Inc | ASP | aspx | ascx | JSP | CFM | CFC | PL | bat | exe | com | DLL | vbs | JS | Reg | cgi"

Configallowedextensions. Add "image", "JPG | GIF | JPEG | PNG | BMP"

Configdeniedextensions. Add "image ",""

Configallowedextensions. Add "Flash", "SWF | FLA"

Configdeniedextensions. Add "Flash ",""

Configallowedextensions. add "Media", "SWF | FLA | JPG | GIF | JPEG | PNG | Avi | MPG | MPEG | MP (1-4) | WMA | WMV | WAV | mid | MIDI | RMI | RM | Ram | rmvb | mov | QT"

Configdeniedextensions. Add "Media ",""

Four different filetypes correspond to the insert link of the front-end Editor, insert an image, insert Flash, and insert media.

 

 

The file type here is the same as the two file types mentioned above.

Quick upload:

 

XML/html code

Configisenabled = false // whether to enable quick upload

Configuserfilespath = "/userfiles /"

 

// If You Want to upload the file to the/test/upload/yyymmdd/folder

Change to configuserfilespath = "/test/upload/" & year (now () & right ("0" & month (now (), 2) & right ("0" & Day (now (), 2)

 

 

FCKeditor sets multiple toolbar styles

 

FCKeditor comes with two toolbar styles, default and base. But now I want to add a toolbar style. I tried it. Copy the settings of the default style to fckconfig. toolbarsets ["blogedit"]. I will not write the individual toolbar items in it. However, when I call this toolbar, I am prompted that the toolbar blogedit settings are not found. What is the problem? Can FCKeditor only use the def Ault and base styles? Find the fckconfig. js file and set it here. When I add the DDD toolbar style, I only need

 

When referencing $ this-> toolbarset = 'ddd '; then OK

 

 

XML/html code

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', 'textta', 'select', 'click', 'imagebutton ', 'hiddenfield'],

'/',

['Bold ', 'italic', 'underline', 'strikethangout', '-', 'subscr limit pt', 'superscr limit pt'],

['Orderedlist', 'unorderedlist', '-', 'outdent ', 'indent', 'blockquote'],

['Justifyleft', 'justifycenter', 'justifyright', 'justifyfull'],

['Link', 'unlink', 'anchor '],

['Image', 'flash', 'table', 'rule', 'smilil', 'specialchar ', 'pagebreak'],

'/',

['Style', 'fontformat', 'fontname', 'fontsize'],

['Textcolor', 'bgcolor'],

['Fitwindow', 'showbuckets', '-', 'about'] // No comma for the last row.

];

Fckconfig. toolbarsets ["Basic"] = [

['Bold ', 'italic', '-', 'orderedlist', 'unorderedlist', '-', 'link', 'unlink ','-', 'about']

];

Fckconfig. toolbarsets ["DDD"] = [

['Orderedlist', 'unorderedlist', '-', 'link', 'unlink', '-', 'about', 'bold ', 'italic ', 'underline', 'strikethroug

H', '-', 'subscr limit pt', 'superscr limit pt']

];

I have time! Write the Application Section in ADODB + smarty

Integrate FCKeditor into my page

 

The FCKeditor provided in the current version only provides javascr ī PT integration. Therefore, Here we only describe how to apply javascr ī pt to integrate FCKeditor into the site. Of course, you can integrate other languages

Refer to the example in the _ samples folder to complete

1. If the editor has been installed in the/FCKeditor/folder of your site. so, the first step we need to do is to add the SCR platinum PT mark in the head segment of the page to introduce the javascr platinum PT integration module. for example:

<SCR limit PT Type = "text/javascr limit PT" src = "/FCKeditor. js"> </scr limit Pt>

 

The path is changeable.

 

2. Now, the FCKeditor class can be used. There are two ways to create a FCKeditor editor on the page:

Method 1: inline (recommended): Insert the following code to the place where the editor needs to be inserted in the form tag of the page:

<SCR limit PT Type = "text/merge Cr limit PT">

VaR ofckeditor = new FCKeditor ('fckeditor1 ');

Ofckeditor. Create ();

</Scr platinum Pt>

 

Method 2: textarea tag replacement method (not recommended): In the onload event on the page, add the following code to replace an existing textarea tag.

 

<HTML>

<Head>

<SCR limit PT Type = "text/merge Cr limit PT">

Window. onload = function ()

{

VaR ofckeditor = new FCKeditor ('mytextarea ');

Ofckeditor. replacetextarea ();

}

</Scr platinum Pt>

</Head>

<Body>

<Textarea id = "mytextarea" name = "mytextarea"> This is <B> the </B> initial value. </textarea>

</Body>

</Html>

 

Now the editor can be used.

 

 

FCKeditor class reference:

The following describes the FCKeditor class used to create an editor on the page.

 

Constructor:

FCKeditor (InstanceName [, width, height, toolbarset, value])

InstanceName: Unique name of the Editor (equivalent to ID)

Width: width

Height: Height

Toolbarset: name of the toolbar set

Value: the initialization content of the editor.

 

Attribute:

InstanceName: Editor Instance name

Width: width. The default value is 100%.

Height: height. The default value is 200.

Toolbarset: tool set name. For details, refer to fckconfig. js. The default value is default.

Value: Initialize the HTML code of the editor. The default value is null.

Basepath: The base path of the editor. The default path is/FCKeditor/folder. Be sure not to use the relative path. It is best to use the Representation Method Relative to the root path of the site and end /.

Checkbrowser: whether to check the browser compatibility before the editor is displayed. The default value is true.

Displayerrors: Indicates whether an error is displayed. The default value is true;

Set:

Config [Key] = value;

This set is used to change the value of a configuration item, as shown in figure

Ofckeditor. config ["defaultlanguage"] = "Pt-Br ";

 

Method:

Create ()

Create and output an editor

 

Repacetextarea (textareaname)

Replace the text box with the editor

 

How to configure FCKeditor?

FCKeditor provides a set of settings for customizing its appearance, characteristics, and behavior. The main configuration file name is fckconfig. js.

You can either edit the master configuration file or define a separate configuration file. The configuration file uses the javascr into pT syntax.

 

After modification, you can use the following syntax when creating an Editor:

VaR export FCKeditor = new FCKeditor ('fckeditor1 ');

Ofckeditor. config ['customconfigurationspath'] = '/myconfig. js ';

Ofckeditor. Create ();

 

Reminder: After you modify the configuration, clear the browser cache to view the effect.

 

Custom style list

The FCKeditor style toolbar provides predefined styles defined by the XML file. The default XML style file exists in the fckstyls. xml file in the FCKeditor root folder.

The structure of the XML file is analyzed as follows:

<? XML version = "1.0" encoding = "UTF-8"?>

<Styles>

<Style name = "my image" element = "IMG">

<Attribute name = "style" value = "padding: 5px"/>

<Attribute name = "border" value = "2"/>

</Style>

<Style name = "italic" element = "em"/>

<Style name = "title" element = "span">

<Attribute name = "class" value = "title"/>

</Style>

<Style name = "title H3" element = "H3"/>

</Styles>

 

 

Each STYLE tag defines a style. Name is the style name displayed in the drop-down list. The element attribute specifies the objects applicable to this style, because the style in FCKeditor is context sensitive, that is, select different objects. Only the styles defined for these objects are displayed.

 

 

Spelling check

 

 

FCKeditor comes with two spell checking tools, iespell, which is used by default. This method requires the customer to download and install the small software iespell. In addition, spellpager is also provided for spelling checks. However, since spellpager is a server-side script compiled by PHP, your web server must support the PHP scripting language.

K m d (for how the R-l0 changes the spell checker, see detailed instructions on configuration files

 

 

Compression script

 

 

To improve the efficiency of Script Loading, FCKeditor uses the following methods to compress the script as much as possible to reduce the script size:

1. Remove the comments from the script.

2. Remove the meaningless blank in the script.

In addition, FCKeditor provides a tool specifically used to compress scripts so that you can reduce the file size during release,

You can copy fckeditor.packager.exe in the _packagerfolder to the FCKeditor root folder to run and compress the script.

 

Localized FCKeditor

If FCKeditor does not provide all the languages you need (actually all of them are available), you can create a new language by yourself.

, You only need to copy the en. JS. in addition, the language name and the corresponding script file name must follow the RFC 3066 standard, but must be in lower case, for example, the script corresponding to Portuguess Language

The file name must be Pt. js.

If you want to target a certain country, you can add a horizontal line and a country abbreviation after the abbreviation.

During use, the system automatically detects the client language and country and uses the appropriate interface language.

After creating a new language, you must create an entry for it in "Edit/lang/fcklanguagemanager. js", as shown below:

Fck1_agemanager. availablelanguages =

{

 

En: 'English ',

PT: 'portranges'

}

 

Note that the file must be saved in UTF-8 format

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.