FCKEDITOR

FCKEDITOR

FCKeditor是一個專門使用在網頁上屬於開放原始碼的所見即所得文字編輯器。它志於輕量化,不需要太複雜的安裝步驟即可使用。它可和PHP、JavaScript、ASP、ASP.NET、ColdFusion、Java、以及ABAP等不同的程式語言相結合。“FCKeditor”名稱中的“FCK”是這個編輯器的作者的名字Frederico Caldeira Knabben的縮寫。FCKeditor 相容於絕大部分的網頁瀏覽器,像是 : Internet Explorer 5.5+ (Windows)、Mozilla Firefox 1.0+、Mozilla 1.3+ 和 Netscape 7+。在未來的版本也將會加入對 Opera 的支援。

FCKeditor是一個專門使用在網頁上屬於開放原始碼的所見即所得文字編輯器。它志於輕量化,不需要太複雜的安裝步驟即可使用。它可和PHP、JavaScript、ASP、ASP.NET、ColdFusion、Java、以及ABAP等不同的程式語言相結合。“FCKeditor”名稱中的“FCK” 是這個編輯器的作者的名字Frederico Caldeira Knabben的縮寫。FCKeditor 相容於絕大部分的網頁瀏覽器,像是 : InternetExplorer 5.5+ (Windows)、Mozilla Firefox 1.0+、Mozilla 1.3+ 和 Netscape7+。在未來的版本也將會加入對 Opera 的支援。

配置中文解釋

AutoDetectLanguage=true/false 自動檢測語言
BaseHref="" 相對連結的基地址
ContentLangDirection="ltr/rtl" 默認文字方向
ContextMenu=字元串數組,右鍵選單的內容
CustomConfigurationsPath="" 自定義配置檔案路徑和名稱
Debug=true/false 是否開啟調試功能,這樣,當調用FCKDebug.Output()時,會在調試窗中輸出內容
DefaultLanguage="" 預設語言
EditorAreaCss="" 編輯區的樣式表檔案
EnableSourceXHTML=true/false 為TRUE時,當由可視化界面切換到代碼頁時,把HTML處理成XHTML
EnableXHTML=true/false 是否允許使用XHTML取代HTML
FillEmptyBlocks=true/false 使用這個功能,可以將空的塊級元素用空格來替代
FontColors="" 設定顯示顏色拾取器時文字顏色列表
FontFormats="" 設定顯示在文字格式列表中的命名
FontNames="" 字型列表中的字型名
FontSizes="" 字型大小中的字號列表
ForcePasteAsPlainText=true/false 強制貼上為純文本
ForceSimpleAmpersand=true/false 是否不把&符號轉換為XML實體
FormatIndentator="" 當在源碼格式下縮進代碼使用的字元
FormatOutput=true/false 當輸出內容時是否自動格式化代碼
FormatSource=true/false 在切換到代碼視圖時是否自動格式化代碼
FullPage=true/false 是否允許編輯整個HTML檔案,還是僅允許編輯BODY間的內容
GeckoUseSPAN=true/false 是否允許SPAN標記代替B,I,U標記
IeSpellDownloadUrl=""下載拼寫檢查器的網址
ImageBrowser=true/false 是否允許瀏覽伺服器功能
ImageBrowserURL="" 瀏覽伺服器時運行的URL
ImageBrowserWindowHeight="" 圖像瀏覽器視窗高度
ImageBrowserWindowWidth="" 圖像瀏覽器視窗寬度
LinkBrowser=true/false 是否允許在插入鏈接時瀏覽伺服器
LinkBrowserURL="" 插入連結時瀏覽伺服器的URL
LinkBrowserWindowHeight=""連結目標瀏覽器視窗高度
LinkBrowserWindowWidth=""連結目標瀏覽器視窗寬度
Plugins=object 註冊外掛程式
PluginsPath="" 外掛程式資料夾
ShowBorders=true/false 合並邊
SkinPath="" 皮膚資料夾位置
SmileyColumns=12 圖符窗列數
SmileyImages=字元數組 圖符窗中圖片檔案名稱數組
SmileyPath="" 圖符資料夾路徑
SmileyWindowHeight 圖符視窗高度
SmileyWindowWidth 圖符視窗寬度
SpellChecker="ieSpell/Spellerpages" 設定拼寫檢查
StartupFocus=true/false 開啟時FOCUS到編輯器
StylesXmlPath="" 設定定義CSS樣式列表的XML檔案的位置
TabSpaces=4 TAB鍵產生的空格字元數
ToolBarCanCollapse=true/false 是否允許展開/摺疊工具列
ToolbarSets=object 允許使用TOOLBAR集合
ToolbarStartExpanded=true/false 開啟是TOOLBAR是否展開
UseBROnCarriageReturn=true/false 當回車時是產生BR標記還是P或者DIV標記

在Asp中調用

首先在檔案頂部包含主檔案
<!--#include file="../fckeditor.asp"-->
在適當的地方插入文本區域內容:
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.ToolbarSet = "A" ’使用工具條
oFCKeditor.Width = "100%" ’寬度
oFCKeditor.Height = "400" ’高度
oFCKeditor.Value = ’源檔案
oFCKeditor.Create "content" ’文本框名稱
%>

在JSP中調用

web.xml配置:
FckEditor for java 2.4版本
<servlet>
<servlet-name>Connector</servlet-name>
<servlet-class>
net.fckeditor.connector.ConnectorServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Connector</servlet-name>
<url-pattern>
/fckeditor/editor/filemanager/connectors/*
</url-pattern>
</servlet-mapping>
在JSP中使用標籤調用demo:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>
<html>
<head>
<title>FckEditor測試</title>
</head>
<body style="text-align: center;">
FckEditor測試
<hr>
<form action="ShowData.jsp" method="post">
<FCK:editor instanceName="test" height="400pt">
<jsp:attribute name="value"> 這裡是http://baike.baidu.com/">數據測試
</jsp:attribute>
</FCK:editor>
<input type="submit" value="提交"/>
<input type="reset" value="重置"/>
</form>
</body>
</html>

自定義工具條

/* Source="頁面源碼"
DocProps="頁面屬性"
Save="保存"
NewPage="新建"
Preview="預覽"
Templates="模版"
Cut="剪下"
Copy="拷貝"
Paste="貼上"
PasteText="貼上為無格式的文本"
PasteWord="貼上Word格式"
Print="列印"
SpellCheck="拼寫檢查,要裝外掛程式"
Undo="撤消"
Redo="重做"
Find="查找"
Replace="替換"
SelectAll="全選"
RemoveFormat="清除格式(清除現在文本的格式)"
Form="表單域"
Checkbox="複選"
Radio="單選"
TextField="單行文本"
Textarea="多行文本"
Select="列表"
Button="按鈕"
ImageButton="圖像區域"
HiddenField="隱藏域"
Bold="加粗"
italic="傾斜"
Underline="下劃線"
StrikeThrough="刪除線"
subscript="下標"
Superscript="上標"
OrderedList="刪除/插入項目列表"
UnorderedList="刪除/插入項目符號"
Outdent="減少縮進"
Indent="增加縮進"
JustifyLeft="左對齊"
JustifyCenter="居中對齊"
JustifyRight="右對齊"
JustifyFull="分散對齊"
Link="連結"
unlink="刪除連結"
Anchor="插入/刪除錨點"
Image="上傳圖片"
Flash="上傳動畫"
Table="插入表格"
Rule="插入水平線"
Smiley="插入表情"
SpecialChar="插入特殊字元"
PageBreak="插入分頁符"
Style="樣式"
FontFormat="格式"
FontName="字型"
FontSize="大小"
textcolor="字型顏色"
BGColor="背景色"
FitWindow="全螢幕編輯"
About="關於我們"
*/
示例:
FCKConfig.ToolbarSets["Default"] = [//Default工具條的名稱
[’Source’,’DocProps’,’-’,’Save’,’NewPage’,’Preview’,’-’,’Templates’],
[’Cut’,’Copy’,’Paste’,’PasteText’,’PasteWord’,’-’,’Print’,’SpellCheck’],
[’Undo’,’Redo’,’-’,’Find’,’Replace’,’-’,’SelectAll’,’RemoveFormat’],
[’Form’,’Checkbox’,’Radio’,’TextField’,’Textarea’,’Select’,’Button’,’ImageButton’,’HiddenField’],
’/’,
[’Bold’,’Italic’,’Underline’,’StrikeThrough’,’-’,’Subscript’,’Superscript’],
[’OrderedList’,’UnorderedList’,’-’,’Outdent’,’Indent’],
[’JustifyLeft’,’JustifyCenter’,’JustifyRight’,’JustifyFull’],
[’Link’,’Unlink’,’Anchor’],
[’Image’,’Flash’,’Table’,’Rule’,’Smiley’,’SpecialChar’,’PageBreak’],
’/’,
[’Style’,’FontFormat’,’FontName’,’FontSize’],
[’TextColor’,’BGColor’],
[’FitWindow’,’-’,’About’]
] ;

最新版本

最新版本為2.6.3
fckeditor for java最新版本為2.4
相對於2.3有如下改變:
◆The integration pack is now managed by Maven 2 with complete Documentation and reports.
◆Automatic creation of release distribution files (Assemblies).
◆The library runs now from Servlet 2.4/JSP 2.0 and above.
◆A complete structure and package review has been done. Base package moved from com.fredck.FCKeditor to net.fckeditor.
◆The Server Side Integration requirements are completely fulfilled.
◆The SimpleUploaderServlet functionality has been merged into the ConnectorServlet.
◆The JSP tag library has been completely restructured.
◆A more complete and reliable browser detection code.
◆New configuration handling:
★No configuration settings in the web.xml anymore.
★The configuration properties can be set in a common properties file or programmatically.
★'Convention over conversion', just reset the properties which don't meet your requirements.
◆Introduced the state-of-the-art slf4j logging facade.
◆Pluggable interfaces have been introducedto extend the ConnectorServlet. This system provides session orrequest-based functionality.
◆JUnit test coverage on viable classes.
◆Clean and safe parameter handling and abstraction.
◆A lot of code performance improvements and tweaks.

相關搜尋

熱門詞條

聯絡我們