FCKeditor rich file editing configuration, use, tips

Source: Internet
Author: User

The FCKeditor File Upload configuration is completed today, mainly including <add key = "FCKeditor: basepath" value = "/project name/FCKeditor/"/>. The project name has not been added before.

The reference content is as follows:

1 Introduction
FCKeditor is a powerful open-source online text editor (DHTML Editor). It enables you to use many powerful functions on the web like Microsoft Word desktop text editor. It is lightweight and does not have to be installed on the client in any way. FCKeditor is compatible with Firefox, Mozilla, Netscape, and IE.

Ii. install, configure, and use FCKeditor
Installation:
1. Prepare is an ASP. NET control DLL file.
2. Enable vs2005 to create a C # web site project named fckpro.
3. decompress the downloaded fckeditor2.4.2.zip package to the root directory of fckpro. In this way, the FCKeditor folder contains all the core files of FCKeditor.
4. decompress the downloaded fckeditor.net.zip file to an empty directory on your hard disk, which is from FCKeditor. net. Source code You can re-develop it. This article does not cover this content. We just use the fredck. fckeditorv2.dll file in the \ bin \ DEBUG directory.
5. Add a reference to fredck. fckeditorv2.dll in vs2005:
(1) Right-click the fckpro project browser and choose add reference ...), Find the Browse tab, locate the extracted fredck. fckeditorv2.dll, and click OK. In this case, a bin folder is added to the fckpro project directory, which contains the fredck. fckeditorv2.dll file. Of course, you can also manually copy fredck. fckeditorv2.dll directly to fckpro \ bin \. vs2005 will automatically compile it during compilation.
(2) To facilitate rad development, we also add the FCKeditor Control to the toolbox of Vs to expand the common label group (general) of the Toolbox ), right-click the component (choose items ...), Find the Browse button in the dialog box, locate fredck. fckeditorv2.dll, and then confirm. In this case, the toolbox will save a lot of declarations to be added when the FCKeditor Control is used during development. Code .
FCKeditor detailed settings:
6. Go to the FCKeditor folder and edit the fckconfig. js file. This step is required and the most important step.
(1) modify
VaR _ filebrowserlanguage = 'asp '; // ASP | aspx | CFM | lasso | Perl | PHP | py
VaR _ quickuploadlanguage = 'asp '; // ASP | aspx | CFM | lasso | PHP
Change
VaR _ filebrowserlanguage = 'aspx '; // ASP | aspx | CFM | lasso | Perl | PHP | py
VaR _ quickuploadlanguage = 'aspx '; // ASP | aspx | CFM | lasso | PHP
(2) configure the Language Pack. English and Traditional Chinese are available. Here we use simplified Chinese.
Modify
Fckconfig. defaultlanguage = 'en ';
Is
Fckconfig. defaultlanguage = 'zh-cn ';
(3) configure the skin. There are default, office2003, silver style, etc. here we can use the default.
Fckconfig. skinpath = fckconfig. basepath + 'Skins/default /';
(4) You can use the tab key in the editor. (1 is yes, 0 is no)
Change fckconfig. tabspaces = 0; To fckconfig. tabspaces = 1;
(5) add several common font methods, such:
Modify
Fckconfig. fontnames = 'arial; Comic Sans MS; Courier New; tahoma; Times New Roman; verdana ';
Is
Fckconfig. fontnames = '; _ gb2312; Arial; Comic Sans MS; Courier New; tahoma; Times New Roman; verdana'
(6) The default font in the editor is 12px. You can modify the style sheet to meet the requirements. Open/Editor/CSS/fck_editorarea.css and modify the font-size attribute. Such as font-size: 14px;
(7) Security.
If your editor is used on the website's front-end, you have to consider security. Do not use the default
Toolbar, either a custom function or a basic, that is, the basic toolbar, which has been defined by the system,
Modify
Fckconfig. toolbarsets ["Basic"] = [
['Bold ', 'italic', '-', 'orderedlist', 'unorderedlist', '-', 'link', 'unlink ','-', 'about']
Is
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 ready?
Of course, you can also configure webconfig to ensure security. Next we will talk about it.
7. fckpro Project Settings:
(1) Configure webconfig and add it to the <etettings> node as follows:
<Deleetask>
<Add key = "FCKeditor: basepath" value = "/project name/FCKeditor/"/>
<Add key = "FCKeditor: userfilespath" value = "/project name/files/"/>
</Appsettings>
Note: basepath is the path where FCKeditor is located. FCKeditor can be written in this way directly under the website directory. If your website has more layers, make appropriate adjustments. Userfilespath is the directory of all uploaded files. We have created a new file folder and placed it in the project as the directory where the file to be uploaded is located. For convenience, it is recommended that files be separately used as a site under the wwwroot Directory, which is parallel to our site FCKeditor. Don't put it in FCKeditor. Why? Because files requires the user to have the write permission, it is dangerous to put the files in FCKeditor. The files directory must have the write permission. You can set the account based on your website requirements. This document makes it more reasonable to use an ASP. NET account to set the user conveniently.
(2) Compile a simple page in the fckpro Project
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default. aspx. cs"
Inherits = "_ default" validaterequest = "false" %>
<% @ Register Assembly = "fredck. fckeditorv2" namespace = "fredck. fckeditorv2"
Tagprefix = "fckeditorv2" %>
// There are two main parameters
// The default value is <% @ page Language = "C #" autoeventwireup = "true" codefile = "default. aspx. cs"
// Inherits = "_ default" %>
// We need to add the parameter validaterequest = false. Otherwise, an error is returned when HTML code is submitted.
// The request. form value that is potentially dangerous is detected from the client.
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en"
Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> No title page </title>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Div>
<Fckeditorv2: FCKeditor id = "fckeditor1" runat = "server">
</Fckeditorv2: FCKeditor>
</Div>
</Form>
</Body>
</Html>
How to get its content? Read the Value Attribute Value of the fckeditor1 control.
8. Conclusion: There are a lot of text editors. FCKeditor is a hard-to-use tool, and a similar control freetextbox is also very useful. However, the latest version of FCKeditor seems to be charged.
How to create the FCKeditor Lite version
Go to the FCKeditor folder and delete all files and folders starting with "_". These are examples. Only the Editor folder and fckconfig are retained. JS, FCKeditor. JS, fckstyles. XML, fcktemplates. XML is enough;
Go to the Editor folder and delete the "_ source" folder, which also contains the source file;
Go back to the upper-level directory and enter the filemanager folder. There are two folders: browser and upload. Go to browser \ Default \ connectors. Only the aspx folder is retained, and the rest are deleted. The mcpuk directory can also be deleted. The same is true for upload, and only the aspx folder is retained;
Return to the editor and enter the images folder. The smiley folder contains emoticon icons, including MSN and fun. If you want to use your own emoticon icons, you can delete them; if you want to use the emojis here, do not delete them;
Lang contains a Language Pack. If only simplified Chinese characters are used, only fck1_agemanager is retained. JS, zh-cn.js two files on the line, it is recommended to keep en. JS (English), Zh. JS (Traditional Chinese) files, fck1_agemanager. JS is a language configuration file. With it, it can be used with fckconfig. JS settings are paired, corresponding to the corresponding language file, must be retained!
Exit the Lang folder and enter the skins folder. If you want to use the default FCKeditor milk yellow, delete the other two folders except the default folder. If you want to use other folders, it depends on your preferences.
So far, the file has been streamlined, from the original 2.55m to the current 797k. Then modify the settings.
4. websites related to FCKeditor
1. http://www.fckeditor.net
The fceditor project has the following website management and maintenance services:
2. http://sourceforge.net/
Open source website with this project

However, there are still some unsatisfactory things after the installation. When displaying Chinese, the display is traditional Chinese rather than simplified Chinese. Go to the official website of FCKeditor and find that it supports Simplified Chinese. Let's take a look at the provider.ProgramYou can make the following modifications to support simplified Chinese.
In the dsfckeditorprovider folder
Cntlfck. defaultlanguage = left (system. Threading. thread. currentthread. currentuiculture. Name, 2)
Changed to: cntlfck. defaultlanguage = system. Threading. thread. currentthread. currentuiculture. Name. tolower ()

 

When you use FCKeditor to upload images, Flash files, and other files, Chinese characters in the file names are displayed as garbled characters. I searched the internet for a solution provided by our predecessors and did not find a good solution. It seems that there are more than N people who are as confused as me, but the solution is so simple:

Change the encoding of the editor \ filemanager \ browser \ Default \ frmupload.html file to the UTF-8.

Operation Method:

Open this File> Save As> click the drop-down arrow on the right of the "save" button> Save encoding...> replace the original file> Unicode-code page 1200

 

 

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.