FCKeditor is currently the best online editor on the Internet. It has powerful functions and supports IE 5.5 + (Windows), Firefox 1.0 +, Mozilla 1.3 + and Netscape 7.1 +. browser, without platform restrictions, can run properly on Windows, Mac and Linux, can be integrated with a variety of Web languages, such as ASP. net, ASP, ColdFusion, PHP, Java, active-FoxPro, lasso, Perl, Python, and multi-language support. It provides more than 50 language packs and is an open-source software. The latest version is 2.4.3 ,:
Http://www.fckeditor.net/download
As a multi-platform and multi-language editor, FCKeditor can be directly used in programs or webpages after being downloaded. Sometimes because the system does not need so many features, you still need to make some simple modifications to make the configuration more suitable for your website's personalized editor.
I. Optimized FCKeditor folders and files:
After downloading and decompressing FCKeditor, two folders, _ samples and editor, and several files, are generated. Delete all folders and files starting with _, because these are examples of FCKeditor, you can learn about it, but you don't need to delete it when uploading it to the website server. There are several FCKeditor files in the root directory. ASP, FCKeditor. PHP, FCKeditor. JS ...... for other files, it depends on the programming languages required for your website server and website, including PHP, ASP, Perl ,. net. I chose the script configuration file FCKeditor. JS, there are three files fckconfig. JS, fckstyles. XML, fcktemplates. XML is a required file, and other files can be deleted.
Open the Editor folder and enter the Lang folder. The FCKeditor Language Pack appears. Generally, select en in China. JS and Zh. the JS and zh-cn.js files are fine, plus the required file fck1_agemanager. JS (this file is required for versions earlier than 2.4), and other files can be completely deleted.
Open the editor/filemanager folder. If you do not need to display the content on the server when uploading images or files, you can delete the Brower folder in the filemanager folder. Then go to the upload folder, which contains files uploaded in various programming languages. Select the program language folder you need and delete other files.
Go to the editor/plugins folder. If you do not need these extra FCKeditor plug-ins, delete all the folders.
Go to the editor/skins folder, which contains the editor's skin file. The default file is the default gray panel editor, and office2003 and silver are loaded separately. choose which one is nice, and then delete the other files.
In addition, there are some editor dialog boxes in the editor/dialog folder. If you select some basic functions, you can select the corresponding files and delete others.
At this point, the folder optimization of the editor is basically OK, which is much simpler and easier to upload and use on the server.
Ii. Modify the basic configuration of FCKeditor:
Fckconfig. JS is the configuration file of the FCKeditor editor. If you do not need to add tool buttons, you can modify the configuration here.
The configuration options in fckconfig. js are listed below:
Autodetectlanguage = true/false automatic language Detection
Basehref = "" _ fcksavedurl = ": The base address of the Relative Link
Contentlangdirection = "LTR/RTL" default text direction
Contextmenu = string array, right-click the menu content
Customconfigurationspath = "" custom configuration file path and name
DEBUG = true/false whether to enable debugging. In this way, when fckdebug. Output () is called, the content is output in the debugging window.
Defaultlanguage = "" default language
Editorareacss = "" style table file in the editing area
When enablesourcexhtml = true/false is true, when the code page is switched from the visual interface to the code page, the HTML is processed as XHTML.
Enablexhtml = true/false: Can I use XHTML to replace HTML?
Fillemptyblocks = true/false use this function to replace empty block-level elements with spaces.
Fontcolors = "" sets the text color list when the color picker is displayed
Fontformats = "" set the name displayed in the text format list
Fontnames = "" fontnames
Fontsizes = "" font size in the font size list
Forcepasteasplaintext = true/false force paste to plain text
Forcesimpleampersand = true/false do not convert & symbol to XML Entity
Formatindentator = "" specifies the characters used to indent the code in the source code format.
Formatoutput = true/false: whether to automatically format the code when output content
Formatsource = true/false whether to automatically format the code when switching to the Code view
Fullpage = true/false: whether to allow editing of the entire HTML file or only the content between the bodies
Geckousespan = true/false: whether to allow the span flag to replace the B, I, u flag
Iespelldownloadurl = "" download the spelling checker URL
Imagebrowser = true/false: whether to allow browsing of server functions
Imagebrowserurl = "" the URL that runs when browsing the server
Imagebrowserwindowheight = "" image browser window height
Imagebrowser1_wwidth = "" image browser window width
Linkbrowser = true/false: whether to allow browsing the server when a link is inserted
Linkbrowserurl = "" browsing the server URL when inserting a link
Linkbrowserwindowheight = "" link target browser window height
Linkbrowserdomainwwidth = "" link target browser window width
Plugins = Object Registration plug-in
Pluginspath = "" plug-in folder
Showborders = true/false merge border
Skinpath = "" skin folder location
Smileycolumns = 12 Number of columns in the graphic operator window
Smileyimages = String Array array of image file names in the graphic character window
Smileypath = "" folder path
Smileywindowheight tumbler window height
Smiley1_wwidth tumbler window width
Spellchecker = "iespell/spellerpages" set the spelling checker
When startupfocus = true/false is enabled, focus to the editor.
Stylesxmlpath = "" set the location of the XML file that defines the CSS style list
Tabspaces = 4 Number of space characters generated by the tab key
Toolbarcancollapse = true/false: whether to enable or disable the toolbar.
Toolbarsets = the toolbar set can be used for objects.
Toolbarstartexpanded = true/false enable indicates whether to expand a toolbar.
Usebroncarriagereturn = true/false when you press enter, whether to generate a br mark or a P or Div mark
The following describes some common configuration options in detail:
Fckconfig. defaultlanguage = 'en'; // select the language of the editor. The editor/lang/folder contains the corresponding language script file.
Fckconfig. toolbarstartexpanded = true; // expand or contract the tool button when loading the editor.
Fckconfig. toolbarsets ["default"] And fckconfig. toolbarsets ["Basic"] indicate whether all tool buttons or some basic buttons are displayed during loading. You can set it in files such as FCKeditor. js or FCKeditor. asp/PHP.
Fckconfig. contextmenu: Right-click the configuration file of the editor. You can add or remove the corresponding buttons by yourself.
Fckconfig. linkbrowser = false; // browse the files on the server. If false is selected, comment out the following lines. Fckconfig. imagebrowser = false; fckconfig. flashbrowser = false. If you select allow, remove the comments of the corresponding program language.
Fckconfig. linkupload = true; fckconfig. imageupload = true; fckconfig. flashupload = true; these three configuration options are used to set file upload. If users are not allowed to upload files, modify true to false. If yes, select the corresponding program language, that is, remove the corresponding comment line.
After the modification, open the FCKeditor file of the corresponding program language to continue.
3. modify the configuration when the editor is loaded:
Open files such as FCKeditor. js or FCKeditor. asp/PHP/PL. The configuration of these files is similar. Here we will illustrate FCKeditor. js.
Width: The editor width.
Height: Editor height.
Toolbarset: Editor tool button: default or basic.
Basepath: directory of the editor. The root directory is recommended.
You can set the default value for others.
4. Use the FCKeditor Editor:
1. ASP language loading Editor:
Include the FCKeditor. asp file, and add the following code in the corresponding place:
Code:
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/"
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "400"
oFCKeditor.Value = rs("Content")
oFCKeditor.Create "Content"
%>
2. js language loading Editor:
Reference the script FCKeditor. js file and add the following code in the corresponding place:
Code:
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'Content' ) ;
oFCKeditor.BasePath = '/' ;
oFCKeditor.ToolbarSet = 'Basic' ;
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '400' ;
oFCKeditor.Value = '' ;
oFCKeditor.Create() ;
</script>
The JS language version also contains a file that replaces the text box to speed up the page display. Here I select to click the edit box to display the editor, reference the FCKeditor. js file, and add the following code:
Code:
<script type="text/javascript">
<!--
function ShowEditor() {
var oFCKeditor = new FCKeditor( 'Content' ) ;
oFCKeditor.BasePath = "../FCKeditor/" ;
oFCKeditor.Value = '' ;
oFCKeditor.ReplaceTextarea() ;
}
//-->
</script><div id="preContent"><textarea id="Content" onclick="javascript:ShowEditor();"></textarea></div>
3. php program language loading Editor:
Include the FCKeditor. php file and add the following code in the corresponding area:
Code:
<?php
$oFCKeditor = new FCKeditor('Content') ;
$oFCKeditor->BasePath = "../FCKeditor/" ;
$oFCKeditor->Value = '' ;
$oFCKeditor->Create() ;
?>
We will not give an example of other languages. For more information, visit the official website:Http://www.fckeditor.com