最详细的步骤教你配置fck

fck的工程实例,完整配置,在myeclipse8.1调试通过
一:配置web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<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>
</web-app>

二:在网页中使用时:
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>
<FCK:editor instanceName="test" width="600" height="300" toolbarSet=""/>
通过以上两步你就可以在你的jsp网页中使用了
三:下面来介绍fck的简单的几种样式:
样式配置是通过:/fckeditor/fckconfig.js中的
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/silver/' ;

这一句来配置的
1:像office2003的配置为:
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/office2003/' ;

显示如图:
[img]http://dl.iteye.com/upload/picture/pic/68402/90b1fabf-0f18-3ef1-91b6-a8ae2a07d5ab.gif[/img]
2:default的样式为
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;

显示图像为:
[img]http://dl.iteye.com/upload/picture/pic/68404/5861968d-aab1-3c64-a4cb-e28b553b10e8.gif[/img]
3:sliver的配置为:
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/sliver/' ;

图像为:
[img]http://dl.iteye.com/upload/picture/pic/68406/d30d27a4-53b3-3c8e-9570-d8a75a909983.gif[/img]
四:编辑器上的控件也是可以自己定制的:
在fckconfig中一般默认的是这个:
FCKConfig.ToolbarSets["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','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks','-','About'] // No comma for the last row.
] ;

控件个数也是像上面图像上一样.
自己定制就要另外在fckconfig中定制:
如:
FCKConfig.ToolbarSets["Blog"] = [
['Bold','Image','Smiley','Style','UnorderedList','TextColor','Link','Unlink','-','About']
] ;

在页面引用时就这样:
 <FCK:editor instanceName="test" width="600" height="300" toolbarSet="Blog"/>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值