ASP FCKeditor Online Editor Using Method _ Web page Editor

Source: Internet
Author: User
This article is using the latest version of FCKeditor 2.3.1
Official website Download: http://ckeditor.com/download[recommended to download the latest version directly on the official website]

The following starts with:

The first task is to streamline this powerful editor, which is of course file simplification rather than functional streamlining. Here I take the ASP version of the FCKeditor as an example, into the FCKeditor folder, first to "_" as the beginning of the folder all deleted, these folders are placed in the example or some other tools. In fact, just keep the editor folder, Fckconfig.js, fckeditor.asp, Fckeditor.js, Fckstyles.xml, Fcktemplates.xml on it, the outermost of the streamlined finish, into the editor folder, the first "_source" folder deleted, here are some source files, for the use of useless.

Enter the images folder, delete the smiley folder, some files are put emoticons, you want to use the expression here icon that do not delete, want to change their own to delete it, but I think still with their own expression good, now have a lot of personality map. Exit images and then enter the Lang folder, where the things can be a large cleaning, Fcklanguagemanager.js (the latest version does not have this file), Zh-cn.js, En.js, Zh.js these four files, the first file is a language configuration file, with its ability and fckconfig.js set in pairs corresponding to the corresponding language files, Zh-cn.js is a simplified Chinese language pack, En.js is English, zh.js is traditional Chinese.

Then exit the Lang folder and go to the Skin folder, which is the default for this milk yellow. Silver is silver, that is, gray and any color matching will not be ugly, that office2003 skin is not very good-looking, not recommended to use, If you want to change the simplest way is to copy the folder of the Favorite Folders under the default folder ...

The final step of streamlining, exit the skin folder, and then enter the FileManager, if you are not using the latest version of the FCKeditor, then here is a folder browser, the new version also has a upload folder. First into the filemanager/browser/default/connectors/, in addition to the ASP folder (if your page is other such as PHP to leave the corresponding PHP folder, analogy), delete all. And then into the filemanager/upload/, again, only the ASP folder, so that the editor's streamlining is over, next, we set the editor to modify.

The first modified file, the FCKeditor general configuration file, is located in the root directory of the Fckconfig.js file. Configuration options:

Autodetectlanguage=true/false Automatic Detection language
basehref= "" relative to the base address of the link
contentlangdirection= "Ltr/rtl" Default text direction
contextmenu= string array, right-click the contents of the menu
Customconfigurationspath= "" Custom profile path and name
Debug=true/false whether debugging is turned on, so that when Fckdebug.output () is invoked, the contents are output in the debug window
Defaultlanguage= "" Default language
editorareacss= the style sheet file in the edit area
When Enablesourcexhtml=true/false is true, HTML is processed as XHTML when switched from a visual interface to a code page
Enablexhtml=true/false whether to allow XHTML to be used instead of HTML
Fillemptyblocks=true/false uses this feature to replace empty block-level elements with empty cells
fontcolors= Set the text color list when the color picker is displayed
Fontformats= the name of the display in a list of text formats
fontnames= the font name in the Font list
fontsizes= a list of font sizes in the font size
Forcepasteasplaintext=true/false forced Paste as plain text
Forcesimpleampersand=true/false whether to convert & symbols to XML entities
Formatindentator= "" When you indent code in source format using characters
Formatoutput=true/false whether the code is automatically formatted when the content is output
Formatsource=true/false automatically format code when switching to Code view
Fullpage=true/false whether to allow editing of the entire HTML file, or only to edit the content between the body
Geckousespan=true/false whether span markers are allowed instead of b,i,u tags
Iespelldownloadurl= "" Download the address of the spelling checker
Imagebrowser=true/false whether to allow browsing of server features
Imagebrowserurl= the URL to run when browsing the server
imagebrowserwindowheight= "" Image browser window height
Imagebrowserwindowwidth= "" Image browser window width
Linkbrowser=true/false whether the server is allowed to browse when the link is inserted
Linkbrowserurl= the URL of the server when inserting a link
linkbrowserwindowheight= "" Link target browser window height
Linkbrowserwindowwidth= "" Link target browser window width
Plugins=object Registration Plugin
Pluginspath= "" Plug-in folder
Showborders=true/false merge borders
Skinpath= "" Skin folder location
smileycolumns=12 Number of Chart window columns
Array of picture filenames in smileyimages= character array
Smileypath= "" "" "" "" "" "
Smileywindowheight Picture Window Height
Smileywindowwidth Picture Window width
Spellchecker= "Iespell/spellerpages" to set the spelling checker
Focus to editor when Startupfocus=true/false Open
Stylesxmlpath= "" Setting the location of the XML file that defines the list of CSS styles
Number of space characters produced by the Tabspaces=4 tab key
Toolbarcancollapse=true/false whether to allow expansion/collapse of toolbars
Toolbarsets=object allow use of toolbar collection
Toolbarstartexpanded=true/false Open is toolbar whether to unfold
Usebroncarriagereturn=true/false whether to generate a BR mark or a P or div tag when carriage return

If you don't know where to start, look at the following process that might be useful to you:

Find fckconfig.defaultlanguage = ' en '; change to Fckconfig.defaultlanguage = ' ZH-CN '; set the default language to Simplified Chinese
Find fckconfig.tabspaces = 0; Changed to Fckconfig.tabspaces = 1; That is, you can use the TAB key in the Editor field.

If your editor is also used in front of the site, for example, for message book or journal reply, then you have to consider security, in the foreground do not use the default toolbar, or customize the function, or use the system has been defined by basic, that is, fundamental toolbar ,

fckconfig.toolbarsets["Basic"] = [
[' Bold ', ' Italic ', '-', ' orderedlist ', ' unorderedlist ', '-', * ' Link ', ' Unlink ', '-', ' Style ', ' fontsize ', ' TextColor ', ' bgcolor ', '-', ' smiley ', ' Specialchar ', ' Replace ', ' Preview '
] ;

This is I changed basic, the image function is removed, add link function to remove, because the image and link and flash and image button Add function can let the front page directly access and upload files, if here do not change directly to you upload a Trojan not immediately finished? But that's not going to work, FCKeditor also supports editing the right mouse button function within a domain.

Fckconfig.fontnames = ' Arial; Comic Sans MS; Courier New; Tahoma; Times New Roman; Verdana ';

Add a few of our commonly used fonts Fckconfig.fontnames = ' XXFarEastFont-Arial _gb2312; Arial; Comic Sans MS; Courier New; Tahoma; Times New Roman; Verdana ';

Next set up the upload function, or ASP as an example, in fact, FCK default is the ASP, the 100 lines below all the comments out of the code all deleted on the line, and then put all the following about the browser.html and upload.asp behind? Type=xx are changed to Type=yy, which YY for you want to save the folder name of the file.

And if you want to use your own facial icons, jump to 131 lines, change the icon of the folder address, and the following icon of the file name, and then the following three numbers are each line shows the number of expressions and the width and height of the pop-up window, which depends on the size of your expression icon arranged by the size of the window. OK, the total profile modification is complete.

Next is the editor location setting, my custom is to put editor in the root directory, the first five files are also placed in the root directory (tips: recommended in the root directory, and recommended to use when the set path also takes an absolute path, such as "/fckeditor/", and my Custom setting is "/" , this facilitates fckeditor update upgrades, and all folders under the Web site can be invoked arbitrarily, without the problem of other folder names being changed and the editor not available elsewhere.

Open fckeditor.asp file, find Sbasepath = "/fckeditor/" to Sbasepath = "/"
Open the Fckeditor.js file and find this. BasePath = '/fckeditor/'; BasePath = '/';

The default display font in the editor field is 12px, and my home page default font is 14PX, so it's very uncomfortable to look at it and want to modify it to meet your requirements by modifying the stylesheet, opening the/editor/css/fck_editorarea.css, and changing the 4th line to Font-size : 14px;

The next is the upload file settings, this is more trouble, please carefully operation.

Open \editor\filemanager\browser\default\frmresourcetype.html, find line 15th, insert "[' uploadfile ', ' UploadFile ']," With the settings just in the fckconfig.js, then my upload file path is/uploadfile, of course, you can also change to the folder you want, but the name here must and Fckconfig.js in the "Type=yy" in the YY consistent only line.

Not finished, continue to enter the editor\filemanager\browser\default\connectors\asp, open config.asp, first put configisenabled = False to become configisenabled = True, if it is not possible to upload files, then Configuserfilespath = "/userfile" to the configuserfilespath I want = "/".
Then add after "Set configdeniedextensions = CreateObject (" Scripting.Dictionary ")"
Configallowedextensions.add "UploadFile", "" "
Configdeniedextensions.add "UploadFile", "" "

Similarly, the setting here is to correspond to the above and fckconfig.js.

There is also a upload, is a quick upload, this function is in the FCKeditor 2.0, the previous version does not have this function. Enter the \editor\filemanager\upload\asp, also open the config.asp, the same configisenabled = False set to configisenabled = True, I'm here to change Configuserfilespath = "/userfiles/" to what I want Configuserfilespath = "/uploadfile/" & Year (Date ()) & "-" & Month (Date ()) & "/", because my upload file is placed under the UploadFile folder, and is placed separately by month. Fast upload, will not let you choose the folder, but through the settings here directly uploaded, here Set if and the previous settings with bad, your file will be uploaded to a mess, very inconvenient management. Repeat the previous operation in the config.asp, and then add the following

Configallowedextensions.add "UploadFile", "" "
Configdeniedextensions.add "UploadFile", "" "
Next, let's talk about how to create your own online editor, and here's an example of asp:

Test environment: xpsp2,iis5.1,fckeditor2.0

To create a new site on IIS, I'll just name it fckeditor.
Create a corresponding site in DW, test server is native, support VBScript
In the site root, create a new index.asp page,<body> paragraph with the following code (invoke editor):

<%
Dim Ofckeditor
Set ofckeditor = New FCKeditor
Ofckeditor.basepath = "/fckeditor/"//Set editor path, a directory under the root directory of my Site
Ofckeditor.toolbarset = "Default"
Ofckeditor.width = "100%"
Ofckeditor.height = "600″

Ofckeditor.value = ""//This is the initial value to the editor
Ofckeditor.create "Logbody"//after the contents of the editor are made by this logbody, named by you

%>

Add this section don't forget the first line in front of index.asp plus <!– #include file= "fckeditor/fckeditor.asp" –> include fckeditor.asp.

Now all you have to do is use this editor as a control to extract its data: request ("Logbody")

Here we recommend an example, you can refer to the following changes to the latest version
Http://www.jb51.net/codes/23160.html
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.