資源簡(jiǎn)介
FCKeditor文本編輯器 簡(jiǎn)單強(qiáng)大
FCKeditor.Net編輯器在.net環(huán)境的配置方法:
先下載FCKeditor_2.6.5.zip和FCKeditor.Net_2.6.3.zip兩個(gè)文件
此包為FCKeditor_2.6.5.zip,本站FCKeditor.Net_2.6.3.zip的下載地址為/download-89.html
官網(wǎng)下載地址:http://www.fckeditor.net/
第一步:解壓縮FCKeditor_2.6.3.zip文件,并將解壓縮得到的fckeditor文件夾復(fù)制到你想使用這個(gè)編輯器的網(wǎng)站的根目錄下面。
第二步:把下載的FCKeditor.Net.zip隨便解壓縮到你硬盤的一個(gè)空目錄,里面是FCKeditor.Net的源代碼,可以對(duì)它進(jìn)行再度開發(fā),我這里講直接應(yīng)用,我們要使用到是其目錄下的\bin\Debug目錄中的FredCK.FCKeditorV2.dll文件。在你的網(wǎng)站里面把這個(gè)FredCK.FCKeditorV2.dll添加到bin目錄下。
第三步:進(jìn)入FCKeditor文件夾,編輯 fckconfig.js 文件,如下:
1、指定編輯器應(yīng)用的編程環(huán)境,修改
var _FileBrowserLanguage = 'asp' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'asp' ; // asp | aspx | cfm | lasso | php
改為
var _FileBrowserLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'aspx' ; // asp | aspx | cfm | lasso | php
2、配置語言包。有英文、繁體中文等,這里我們使用簡(jiǎn)體中文。
修改
FCKConfig.DefaultLanguage = 'en' ;
為
FCKConfig.DefaultLanguage = 'zh-cn' ;
3、配置皮膚。有default、office2003、silver風(fēng)格等,這里我們可以使用默認(rèn)。
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
4、在編輯器域內(nèi)可以使用Tab鍵。(1為是,0為否)
FCKConfig.TabSpaces = 0 ; 改為FCKConfig.TabSpaces = 1 ;
5、加上幾種我們常用的字體的方法,例如:
修改
FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
為
FCKConfig.FontNames = '宋體;黑體;隸書;楷體_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana'
6、編輯器域內(nèi)默認(rèn)的顯示字體為12px,想要修改可以通過修改樣式表來達(dá)到要求,打開/editor/css/fck_editorarea.css,修改font-size屬性即可。如font-size: 14px;
7、關(guān)于安全性。
如果你的編輯器用在網(wǎng)站前臺(tái)的話,那就不得不考慮安全了,在前臺(tái)千萬不要使用Default的toolbar,要么自定義一下功能,要么就用系統(tǒng)已經(jīng)定義好的Basic,也就是基本的toolbar,
修改
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
為
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Unlink','-','Style','FontSize','TextColor','BGColor','-','Smiley','SpecialChar','Replace','Preview']
] ;
第四步:在Web.Config文件里面添加,如下所示
1、配置WebConfig,在<appSettings>節(jié)點(diǎn)添加,如下所示:
如果你用的是默認(rèn)的上傳功能,則
<add key="FCKeditor:BasePath" value="~/fckeditor/"/>
<add key="FCKeditor:UserFilesPath" value="/網(wǎng)站名稱/UploadFiles/"/>
第五步:在頁面里應(yīng)用FCKeditor編輯器
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" validateRequest="false" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
// 這里要主要兩個(gè)參數(shù)
// 默認(rèn)為<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
// 我們要添加一個(gè)參數(shù) validateRequest=false,否則提交帶html代碼的內(nèi)容會(huì)報(bào)錯(cuò)
// 從客戶端(...)中檢測(cè)到有潛在危險(xiǎn)的 Request.Form 值。
<!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>無標(biāo)題頁</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server">
</FCKeditorV2:FCKeditor>
</div>
</form>
</body>
</html>
如何獲取其內(nèi)容呢?讀取FCKeditor1控件的Value屬性值即可。
到這里基本OK了,但是我發(fā)現(xiàn)在使用圖片上傳功能的時(shí)候,會(huì)彈出一個(gè)阻止框,顯示"this connector is disabled Please check the"editor/filemanager/connectors/aspx/config.aspx",解決這個(gè)錯(cuò)誤的方法是打開editor/filemanager/connectors/aspx/config.ascx修改CheckAuthentication()方法,返回true
C# code
private bool CheckAuthentication()
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of 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.Net編輯器在.net環(huán)境的配置方法:
先下載FCKeditor_2.6.5.zip和FCKeditor.Net_2.6.3.zip兩個(gè)文件
此包為FCKeditor_2.6.5.zip,本站FCKeditor.Net_2.6.3.zip的下載地址為/download-89.html
官網(wǎng)下載地址:http://www.fckeditor.net/
第一步:解壓縮FCKeditor_2.6.3.zip文件,并將解壓縮得到的fckeditor文件夾復(fù)制到你想使用這個(gè)編輯器的網(wǎng)站的根目錄下面。
第二步:把下載的FCKeditor.Net.zip隨便解壓縮到你硬盤的一個(gè)空目錄,里面是FCKeditor.Net的源代碼,可以對(duì)它進(jìn)行再度開發(fā),我這里講直接應(yīng)用,我們要使用到是其目錄下的\bin\Debug目錄中的FredCK.FCKeditorV2.dll文件。在你的網(wǎng)站里面把這個(gè)FredCK.FCKeditorV2.dll添加到bin目錄下。
第三步:進(jìn)入FCKeditor文件夾,編輯 fckconfig.js 文件,如下:
1、指定編輯器應(yīng)用的編程環(huán)境,修改
var _FileBrowserLanguage = 'asp' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'asp' ; // asp | aspx | cfm | lasso | php
改為
var _FileBrowserLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'aspx' ; // asp | aspx | cfm | lasso | php
2、配置語言包。有英文、繁體中文等,這里我們使用簡(jiǎn)體中文。
修改
FCKConfig.DefaultLanguage = 'en' ;
為
FCKConfig.DefaultLanguage = 'zh-cn' ;
3、配置皮膚。有default、office2003、silver風(fēng)格等,這里我們可以使用默認(rèn)。
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
4、在編輯器域內(nèi)可以使用Tab鍵。(1為是,0為否)
FCKConfig.TabSpaces = 0 ; 改為FCKConfig.TabSpaces = 1 ;
5、加上幾種我們常用的字體的方法,例如:
修改
FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
為
FCKConfig.FontNames = '宋體;黑體;隸書;楷體_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana'
6、編輯器域內(nèi)默認(rèn)的顯示字體為12px,想要修改可以通過修改樣式表來達(dá)到要求,打開/editor/css/fck_editorarea.css,修改font-size屬性即可。如font-size: 14px;
7、關(guān)于安全性。
如果你的編輯器用在網(wǎng)站前臺(tái)的話,那就不得不考慮安全了,在前臺(tái)千萬不要使用Default的toolbar,要么自定義一下功能,要么就用系統(tǒng)已經(jīng)定義好的Basic,也就是基本的toolbar,
修改
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
為
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Unlink','-','Style','FontSize','TextColor','BGColor','-','Smiley','SpecialChar','Replace','Preview']
] ;
第四步:在Web.Config文件里面添加,如下所示
1、配置WebConfig,在<appSettings>節(jié)點(diǎn)添加,如下所示:
如果你用的是默認(rèn)的上傳功能,則
<add key="FCKeditor:BasePath" value="~/fckeditor/"/>
<add key="FCKeditor:UserFilesPath" value="/網(wǎng)站名稱/UploadFiles/"/>
第五步:在頁面里應(yīng)用FCKeditor編輯器
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" validateRequest="false" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
// 這里要主要兩個(gè)參數(shù)
// 默認(rèn)為<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
// 我們要添加一個(gè)參數(shù) validateRequest=false,否則提交帶html代碼的內(nèi)容會(huì)報(bào)錯(cuò)
// 從客戶端(...)中檢測(cè)到有潛在危險(xiǎn)的 Request.Form 值。
<!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>無標(biāo)題頁</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server">
</FCKeditorV2:FCKeditor>
</div>
</form>
</body>
</html>
如何獲取其內(nèi)容呢?讀取FCKeditor1控件的Value屬性值即可。
到這里基本OK了,但是我發(fā)現(xiàn)在使用圖片上傳功能的時(shí)候,會(huì)彈出一個(gè)阻止框,顯示"this connector is disabled Please check the"editor/filemanager/connectors/aspx/config.aspx",解決這個(gè)錯(cuò)誤的方法是打開editor/filemanager/connectors/aspx/config.ascx修改CheckAuthentication()方法,返回true
C# code
private bool CheckAuthentication()
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of 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?-?The?text?editor?for?Internet?-?http://www.fckeditor.net
?*?Copyright?(C)?2003-2009?Frederico?Caldeira?Knabben
?*
?*?==?BEGIN?LICENSE?==
?*
?*?Licensed?under?the?terms?of?any?of?the?following?licenses?at?your
?*?choice:
?*
?*??-?GNU?General?Public?License?Version?2?or?later?(the?“GPL“)
?*????http://www.gnu.org/licenses/gpl.html
?*
?*??-?GNU?Lesser?General?Public?License?Version?2.1?or?later?(the?“LGPL“)
?*????http://www.gnu.org/licenses/lgpl.html
?*
?*??-?Mozilla?Public?License?Version?1.1?or?later?(the?“MPL“)
?*????http://www.mozilla.org/MPL/MPL-1.1.html
?*
?*?==?END?LICENSE?==
?*
?*?This?is?the?integration?file?for?PHP?(All?versions).
?*
?*?It?loads?the?correct?integration?file?based?on?the?PHP?version?(avoiding
?*?strict?error?messages?with
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2009-09-21?18:56??fckeditor\
?????目錄???????????0??2009-09-21?18:56??fckeditor\editor\
?????目錄???????????0??2009-09-21?18:56??fckeditor\editor\css\
?????目錄???????????0??2009-09-21?18:56??fckeditor\editor\css\behaviors\
?????文件?????????236??2009-09-21?18:56??fckeditor\editor\css\behaviors\disablehandles.htc
?????文件?????????822??2009-09-21?18:56??fckeditor\editor\css\behaviors\showtableborders.htc
?????文件????????2648??2009-01-15?17:18??fckeditor\editor\css\fck_editorarea.css
?????文件????????4145??2009-01-15?17:18??fckeditor\editor\css\fck_internal.css
?????文件????????1696??2009-01-15?17:18??fckeditor\editor\css\fck_showtableborders_gecko.css
?????目錄???????????0??2009-09-21?18:56??fckeditor\editor\css\images\
?????文件?????????288??2009-09-21?18:56??fckeditor\editor\css\images\block_address.png
?????文件?????????293??2009-09-21?18:56??fckeditor\editor\css\images\block_blockquote.png
?????文件?????????229??2009-09-21?18:56??fckeditor\editor\css\images\block_div.png
?????文件?????????218??2009-09-21?18:56??fckeditor\editor\css\images\block_h1.png
?????文件?????????220??2009-09-21?18:56??fckeditor\editor\css\images\block_h2.png
?????文件?????????219??2009-09-21?18:56??fckeditor\editor\css\images\block_h3.png
?????文件?????????229??2009-09-21?18:56??fckeditor\editor\css\images\block_h4.png
?????文件?????????236??2009-09-21?18:56??fckeditor\editor\css\images\block_h5.png
?????文件?????????216??2009-09-21?18:56??fckeditor\editor\css\images\block_h6.png
?????文件?????????205??2009-09-21?18:56??fckeditor\editor\css\images\block_p.png
?????文件?????????223??2009-09-21?18:56??fckeditor\editor\css\images\block_pre.png
?????文件?????????184??2009-09-21?18:56??fckeditor\editor\css\images\fck_anchor.gif
?????文件?????????599??2009-09-21?18:56??fckeditor\editor\css\images\fck_flashlogo.gif
?????文件?????????105??2009-09-21?18:56??fckeditor\editor\css\images\fck_hiddenfield.gif
?????文件??????????54??2009-09-21?18:56??fckeditor\editor\css\images\fck_pagebreak.gif
?????文件????????1709??2009-09-21?18:56??fckeditor\editor\css\images\fck_plugin.gif
?????目錄???????????0??2009-09-21?18:56??fckeditor\editor\dialog\
?????目錄???????????0??2009-09-21?18:56??fckeditor\editor\dialog\common\
?????文件????????1773??2009-01-15?17:18??fckeditor\editor\dialog\common\fck_dialog_common.css
?????文件???????10481??2009-01-15?17:18??fckeditor\editor\dialog\common\fck_dialog_common.js
?????目錄???????????0??2009-09-21?18:56??fckeditor\editor\dialog\common\images\
............此處省略617個(gè)文件信息
評(píng)論
共有 條評(píng)論