Go How to use the FCKeditor text editor

Source: Internet
Author: User

FCKeditor is a powerful text editor that supports WYSIWYG functionality and provides users with the same online document editing services as Microsoft Office software.

It does not need to install any form of client, compatible with the vast majority of mainstream browsers, support ASP, ASP, ColdFusion, PHP, JSP, Active-foxpro, Lasso, Perl, Ython and other programming environments.

Official website http://www.fckeditor.net/

Official Document http://wiki.fckeditor.net/

http://www.fckeditor.net/download/default.html

FCKeditor Installation and Configuration

Download Fckeditor2.63.zip and version 2 Zip packages for fckeditor.net2.63

(a) fckeditor_2.6.3 is a resource file such as HTML files, JavaScript files, and pictures

(b) Fckeditor.net_2.6.3.zip is an ASP. NET Control DLL file

Adding a reference to FCKeditor in an ASP.

1. Select Add Reference on the project find FredCK.FCKeditorV2.dll or copy the FredCK.FCKeditorV2.dll directly into the project's Bin directory

2. To facilitate development, the FredCK.FCKeditorV2.dll control can be added to the VS Toolbox

3. Configure Web. config, add the <appSettings> node as follows:

<appSettings>

<!--fckeditor text edit control configuration-

<add key= "Fckeditor.basepath" value= "~/fckeditor/"/>

<add key= "Fckeditor.userfilespath" value= "/Solution name/uploads"/>//userfilespath The text path can be in fckeditor/editor/ Change in Filemanager/connectors/aspx/config.ascx

</appSettings>
4. Use in Web pages
<%@ Register assembly= "Fredck.fckeditorv2" namespace= "Fredck.fckeditorv2" tagprefix= "FCKeditorV2"%>
<body>
<fckeditorv2:fckeditor id= "FCKeditor" runat= "Server" basepath= "~/fckeditor/" >//basepath specified to FCKeditor root directory < /fckeditorv2:fckeditor>
</body>

Configuration of the FCKeditor:

Go to the FCKeditor folder, edit the Fckconfig.js file

1. Modify (change to the language you are currently using)

var _filebrowserlanguage= ' aspx '; ASP | aspx | CFM | Lasso | Perl | php | PY

var _quickuploadlanguage= ' aspx '; ASP | aspx | CFM | Lasso | Perl | php | PY

2. Modify the configuration language

fckconfig.defaultlanguage = ' en ' instead: fckconfig.defaultlanguage = ' ZH-CN ';//Simplified Chinese

3, configure the skin, have default, office2003, silver style and so on.

Fckconfig.skinpath = Fckconfig.basepath + ' skins/default/';

4. You can use the TAB key within the editor domain. (1 for Yes, 0 for No)

fckconfig.tabspaces = 0; Change to fckconfig.tabspaces = 1;

5, plus a few commonly used fonts:

Fckconfig.fontnames = ' song body; blackbody; script; italics _gb2312; Arial; Comic Sans MS; Courier New; Tahoma; Times New Roman; Verdana ';

6, the default display font in the editor domain is 12px, want to modify can be modified by modifying the style sheet to meet the requirements, open/editor/css/fck_editorarea.css, modify the Font-size property can be

7. About Security

If your editor is using a non-certified front desk, it is recommended to use Basic toolbar

fckconfig.toolbarsets["Basic"] = [
[' Bold ', ' Italic ', '-', ' orderedlist ', ' unorderedlist ', '-', ' Link ', ' Unlink ', ' Image ', '-', ' about ']

] ;

8, in the Upload File window Click Browse Server, may appear the server didn ' t send back a proper XML ..... The error is because fckeditor requires different types of files to be uploaded to different directories, including directories such as File,image,falsh,media, which can be set up to try first.

Security Configuration for Fckeditor.net 2.6

File Upload, Error: (This connector is disabled.please check the "editor/filemanager/connectors/aspx/config.ascx" file.)

Opens the Editor/filemanager/connectors/aspx/config.ascx file, which returns TRUE.

private bool Checkauthentication ()
{
Warning:do not simply return "true". By doing so, you are allowing
"Anyone" to upload and lists the files in your server. You must implement
Some kind of the session validation here. Even something very simple as ...
//
Return (session["isauthorized"]! = NULL && (BOOL) session["isauthorized"] = = true);
//
... where session["isauthorized"] is set to "true" as soon as the
User logs in your system.

return true;
}

FCKeditor Streamlining and cleanup

Go to the FCKeditor folder, delete all files and folders beginning with "_", remove the FCKeditor folder suffix named:. AFP,. CFC,. CFM,. Lasso,. pl,. py,. txt files, Only keep FCKeditor folder under Fckconfig.js, Fckeditor.js, Fckstyles.xml, fcktemplates.xml on it;

Enter the Editor folder, delete the "_source" folder, the same is the source file;

Lang inside is a language pack, if only in Simplified Chinese, then only keep fcklanguagemanager.js, zh-cn.js Two files is OK, recommended to retain En.js (English), Zh.js (Traditional Chinese) two files, Fcklanguagemanager.js is a language configuration file, with it can and fckconfig.js settings in pairs, corresponding to the corresponding language files, be sure to keep!

A brief introduction to the configuration file Fckconfig.js Chinese comments. If you understand the wrong place, please comment.

Fckconfig.customconfigurationspath = "; Custom configuration file path and name

Fckconfig.editorareacss = Fckconfig.basepath + ' css/fck_editorarea.css '; Style sheet file path for text editing area

Fckconfig.editorareastyles = "; Style sheet style for text editing areas
Fckconfig.toolbarcombopreviewcss = "; Toolbar Preview CSS
Fckconfig.doctype = "; Document type

Fckconfig.basehref = "; Relative link to base address


Fckconfig.fullpage = false; Whether to allow editing of the entire HTML file, or only allow editing of the contents of the body


Fckconfig.startupshowblocks = false; Whether to enable the display module


Fckconfig.debug = false; Whether to turn on the Debug window function


Fckconfig.allowquerystringdebug = true; Whether to enable the Web query debugging feature


Fckconfig.skinpath = Fckconfig.basepath + ' skins/default/'; FCKeditor Skin Path


Fckconfig.skineditorcss = "; The skin CSS path of the editor


Fckconfig.skindialogcss = "; Skin CSS Path for dialog window


Fckconfig.preloadimages = [Fckconfig.skinpath + ' images/toolbar.start.gif ', Fckconfig.skinpath + ' images/ Toolbar.buttonarrow.gif '];

Pre-loaded pictures
Fckconfig.pluginspath = Fckconfig.basepath + ' plugins/'; Plugin path
Fckconfig.autogrowmax = 400; The text editing area allows the maximum height limit for autogrow, and setting this property should also be
FCKCONFIG.PLUGINS.ADD (' autogrow '); annotation removal of attributes, working with
Fckconfig.autodetectlanguage = true; Whether the language is automatically detected
fckconfig.defaultlanguage = ' en '; Default language
fckconfig.contentlangdirection = ' ltr '; Default text direction, optional "Ltr/rtl", i.e. left-to-right or right-to-left
Fckconfig.processhtmlentities = true; Working with HTML entities
Fckconfig.includelatinentities = true; including Latin
Fckconfig.includegreekentities = true; including Greek
Fckconfig.processnumericentities = false; Working with numeric entities
Fckconfig.additionalnumericentities = "; Additional numeric entities
Fckconfig.fillemptyblocks = true; Whether to fill empty blocks
Fckconfig.formatsource = true; Whether to automatically format code when switching to Code view
Fckconfig.formatoutput = true; Whether the code is automatically formatted when the content is output
Fckconfig.formatindentator = "; When indenting code uses characters in the source format
Fckconfig.emailprotection = ' None '; Detect e-Mail links
Fckconfig.emailprotectionfunction = ' MT (name,domain,subject,body) '; Detect e-Mail links
Fckconfig.startupfocus = false; Whether the focus is to the editor when it is turned on, or whether the cursor stays on FCKeditor when the page is opened
Fckconfig.forcepasteasplaintext = false; Whether to force paste as plain text content
Fckconfig.autodetectpastefromword = true; Whether to automatically detect pasting files from Word, only IE is supported
Fckconfig.showdropdialog = true; Whether the drop-down menu is displayed
Fckconfig.forcesimpleampersand = false; Do not convert the & symbol to an XML entity
fckconfig.tabspaces = 0; The cursor jumps when you press the TAB key, and the default value is zero for no jump
Fckconfig.showborders = true; Whether to merge borders
Fckconfig.sourcepopup = false; Whether to eject
Fckconfig.toolbarstartexpanded = true; Launches the FCKeditor toolbar by default if expanded
Fckconfig.toolbarcancollapse = true; Whether the toolbar is allowed to collapse or expand
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.templatereplacecheckbox = true; Whether to display the actual content in the template window
fckconfig.toolbarlocation = ' in '; Toolbar position
fckconfig.toolbarsets["Default"//Configure the buttons in the default toolbar for background editing
fckconfig.toolbarsets["Basic"//Configure basic toolbar buttons for foreground editing
Fckconfig.entermode = ' P '; Press ENTER to automatically generate <P></P> label when editing text
Fckconfig.shiftentermode = ' BR '; Press shift+ enter when editing text to automatically generate <br/> Labels
Fckconfig.keystrokes//Custom keyboard shortcuts
Fckconfig.contextmenu//Define the contents of the right-click menu
Fckconfig.browsercontextmenuonctrl = false; Allows you to click the right mouse button to display the browser's context menu when you press the CTRL key in the edit area
Fckconfig.browsercontextmenu = false; Allows you to click the right mouse button in the edit area to display the browser's context menu
Fckconfig.enablemorefontcolors = true; Whether to suppress more color options
Fckconfig.fontcolors//Text color list
Fckconfig.fontformats//Text Format list
Fckconfig.fontnames//Font list
fckconfig.fontsizes//Font Size list
Fckconfig.stylesxmlpath = Fckconfig.editorpath + ' fckstyles.xml '; The location of the XML file for the CSS style list
Fckconfig.templatesxmlpath = Fckconfig.editorpath + ' fcktemplates.xml '; XML file location for templates
Fckconfig.spellchecker = ' WSC '; Spell checker
Fckconfig.iespelldownloadurl = ' http://www.iespell.com/download.php '; Download the spelling checker URL
Fckconfig.spellerpagesserverscript = ' server-scripts/spellchecker.php '; Spelling checker Script Path
Fckconfig.firefoxspellchecker = false; Firefox browser spell checker
Fckconfig.maxundolevels = 15; Maximum number of times that can be revoked
Fckconfig.disableobjectresizing = false; Whether users are prevented from resizing images and tables
Fckconfig.disablefftablehandles = true; Whether to disable the table tool
Fckconfig.linkdlghidetarget = false; Whether to hide the target label of the link window
fckconfig.linkdlghideadvanced = false; Whether to hide the Advanced tab of the link window
Fckconfig.imagedlghidelink = false; Whether to hide the link label of the image window
fckconfig.imagedlghideadvanced = false; Whether to hide the Advanced tab of the image window
fckconfig.flashdlghideadvanced = false; Whether to hide the Advanced tab of the Flash window
Fckconfig.protectedtags = "; Add HTML formatting
Fckconfig.bodyid = "; Set the ID of the editor
Fckconfig.bodyclass = "; Set the editor's class
Fckconfig.defaultstylelabel = "; Set the style of the text editor, which defaults to a blank document
Fckconfig.defaultfontformatlabel = "; Set default format
Fckconfig.defaultfontlabel = "; Set Default font
Fckconfig.defaultfontsizelabel = "; Set Default font Size
Fckconfig.defaultlinktarget = "; Set the default link target (_blank, _self _parent, _top)
Fckconfig.cleanwordkeepsstructure = false; Whether to set direct paste as Word format
Fckconfig.removeformattags//Delete text when the corresponding format is deleted
Fckconfig.removeattributes//Delete text when the corresponding style is deleted
Fckconfig.customstyles//Style menu
Fckconfig.corestyles//Set FCKeditor core style
Fckconfig.indentlength = 40; The length of the indent amount in the editor
Fckconfig.indentunit = ' px '; The units of the indent amount in the editor
Fckconfig.indentclasses = []; FCKeditor allows the use of CSS indentation
Fckconfig.justifyclasses = []; FCKeditor allows CSS class text to be used
var _filebrowserlanguage = ' php '; Language used by the file browser
var _quickuploadlanguage = ' php '; Quickly upload the language you use
var _filebrowserextension = _filebrowserlanguage = = = ' Perl '? ' CGI ': _filebrowserlanguage; File browser extensions
var _quickuploadextension = _quickuploadlanguage = = = ' Perl '? ' CGI ': _quickuploadlanguage; Fast upload Extension
Fckconfig.linkbrowser = true; Whether to allow browsing the server while inserting links
Fckconfig.linkbrowserurl//The URL of the browse server when the link is inserted
Fckconfig.linkbrowserwindowwidth//Link target browser window width
Fckconfig.linkbrowserwindowheight//Link target browser window height
Fckconfig.imagebrowser = true; Whether to turn off the image File browsing Server feature
Fckconfig.imagebrowserurl//image file Browse Server URL
Fckconfig.imagebrowserwindowwidth//Image browser window width
Fckconfig.imagebrowserwindowheight//Image browser window height
Fckconfig.flashbrowser = true; Whether to turn off the functionality of the Flash browsing server
Fckconfig.flashbrowserurl//flash The URL of the browse server
Fckconfig.flashbrowserwindowwidth//flash browser window width
Fckconfig.flashbrowserwindowheight//flash browser window height
Fckconfig.linkupload = true; Whether to turn on the file upload function
Fckconfig.linkuploadurl//Specify the address of the default upload file
Fckconfig.linkuploadallowedextensions//Set extensions to allow uploading of files
Fckconfig.linkuploaddeniedextensions = ""; Set the extension that allows the script file to be uploaded
Fckconfig.imageupload = true; Whether to turn on the image upload function
Fckconfig.imageuploadurl//Specify the address of the default upload picture file
Fckconfig.imageuploadallowedextensions//Set extensions to allow uploading of picture files
Fckconfig.imageuploaddeniedextensions = ""; Set extensions to allow upload of picture script files
Fckconfig.flashupload = true; Whether to turn on the Flash upload feature
Fckconfig.flashuploadurl//flash The address of the uploaded file
Fckconfig.flashuploadallowedextensions//Set extensions that allow Flash files to be uploaded
Fckconfig.flashuploaddeniedextensions = ""; Set the extension that allows Flash script files to be uploaded
Fckconfig.smileypath//Insert the path of the emoticon icon
Fckconfig.smileyimages//The file name of the emoticon icon
Fckconfig.smileycolumns = 8; Expression window display expression column number
Fckconfig.smileywindowwidth = 320; The expression window displays the width, and this window will be adjusted for changes to the emoticon file.
Fckconfig.smileywindowheight = 210; The expression window displays the height, and this window will be adjusted for changes to the emoticon file.
Fckconfig.backgroundblockercolor = ' #ffffff '; Color when the background is shaded when the editor pops up
Fckconfig.backgroundblockeropacity = 0.50; Transparency of background shading when the editor pops up
Fckconfig.mswebbrowsercontrolcompat = false;
Fckconfig.preventsubmithandler = false;

Go How to use the FCKeditor text editor

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.