先给出FCKeditor的下载页面 http://ckeditor.com/download
下载FCKeditor_2.6.6.zip fckeditor-java-2.6-bin.zip fckeditor-java-demo-2.6.war 这3个文件
分别解压后备用
FCKeditor的相关配置文件都可以在fckconfig.js修改,也可以自定义文件修改.
本文中使用自定配置修改
在WebRoot下新建/js/myfckconfig.js文件,内容如下
//自动检查语言 FCKConfig.AutoDetectLanguage = false ; //默认语言 FCKConfig.DefaultLanguage = 'zh-cn' ; //自定义工具集 FCKConfig.ToolbarSets["Custom"] = [ ['Source','DocProps','-','Save','NewPage','Preview','-','Templates'], ['Cut','Copy','Paste'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], '/', ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'], ['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['Anchor'], ['Image','Flash','Table','Rule','Smiley'], '/', ['Style','FontFormat','FontName','FontSize'], '/', ['TextColor','BGColor'], ['FitWindow','ShowBlocks'] // No comma for the last row. ] ; //字体 FCKConfig.FontNames = '宋体;黑体;隶书;楷体_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana'; //字号 FCKConfig.FontSizes = '8px;10px;11px;12px;13px;14px;16px;18px;20px;22px;24px;26px;28px;36px;48px;72px' ; //回车 FCKConfig.EnterMode = 'br' ; //SHIFT+回车 FCKConfig.ShiftEnterMode = 'p' ; //表情图片路径 FCKConfig.SmileyPath = FCKConfig.BasePath + 'images/smiley/msn/' ; //所显示的图片名 FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ; FCKConfig.SmileyColumns = 8 ; //表情窗口的宽度 FCKConfig.SmileyWindowWidth = 320 ; //表情窗口的高度 FCKConfig.SmileyWindowHeight = 210 ;
更改页面
<SCRIPT type="text/javascript"> var oFCKeditor = new FCKeditor('content','100%','400px'); oFCKeditor.BasePath="<%=request.getScheme()+ "://" +request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/fckeditor/"%>";
//指定自定义配置文件路径 oFCKeditor.Config["CustomConfigurationsPath"]="/FCK/js/myfckconfig.js";
//选择工具集 oFCKeditor.ToolbarSet="Custom"; oFCKeditor.Create(); </SCRIPT>