由于FCKeditor功能强大,所以我们可以通过一些简单的设置使FCKeditor更加符合您的项目需求。
设置工具栏很简单,只需打开fckeditor目录下面的fckconfig.js文件,按CTRL+F搜索FCKConfig.ToolbarSets["Default"]代码,找到如下代码。
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']
]
在默认情况下,FCKeditor会调用上面定义的所有工具栏按钮。可以根据自己的需求进行设置。对上面的配置选项功能说明进行汇总。
代码名称 功能 代码名称 功能
Source 源代码 DocProps 页面属性
- |分隔符 Save 保存
NewPage 新建 Preview 预览
Templates 模板 Cut 剪切
Copy 复制 Paste 粘贴
PasteText 粘贴为无格式文本 PasteWord 从MS 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 增加缩进 Blockquote 块引用
CreateDiv 创建DIV JustifyLeft 左对齐
JustifyCenter 居中对齐 JustifyRight 右对齐
JustifyFull 两端对齐 Link 插入/编辑链接
Unlink 取消链接 Anchor 插入/编辑锚点链接
Image 插入编辑图像 Flash 插入/编辑Flash
Table 插入/编辑表格 Rule 插入水平线
Smiley 插入表情 SpecialChar 插入特殊符号
PageBreak 插入分页 Style 样式
FontFormat 格式 FontName 字体
FontSize 大小 TextColor 文本颜色
BGColor 背景颜色 FitWindow 全屏编辑
ShowBlocks 显示区域 About 关于Fuckeditor
工具栏配置选项功能进行汇总
你也可以创建一个非默认的工具栏按钮设置,您可以从FCKConfig.ToolbarSets["Default"]当中的代码重新复制一份,然后将Default改成您想要的名字。
注意:fckconfig.js配置选项采用JavaScript语法,如果您不懂JavaScript的话,请在配置之前进行备份。
如果你的编辑器还用在网站前台的话,比如说用于留言本或是日记回复时,那就不得不考虑安全了,在前台千万不要使用Default的toolbar,要么自定义一下功能,要么就用系统已经定义好的Basic,也就是基本的toolbar,这里配置了一个适合于大部份网站使用的工栏目按钮
FCKConfig.ToolbarSets["MyDesign"] = [
['Source','DocProps','-','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Style','FontFormat','FontName','FontSize'],
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks']] ;
要想使用自定义的工具栏按钮,必须在创建FCKeditor实例后设置使用的工具栏选项。
oFCKeditor.ToolbarSet = "MyDesign"; //JavaScript
设置工具栏很简单,只需打开fckeditor目录下面的fckconfig.js文件,按CTRL+F搜索FCKConfig.ToolbarSets["Default"]代码,找到如下代码。
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']
]
在默认情况下,FCKeditor会调用上面定义的所有工具栏按钮。可以根据自己的需求进行设置。对上面的配置选项功能说明进行汇总。
代码名称 功能 代码名称 功能
Source 源代码 DocProps 页面属性
- |分隔符 Save 保存
NewPage 新建 Preview 预览
Templates 模板 Cut 剪切
Copy 复制 Paste 粘贴
PasteText 粘贴为无格式文本 PasteWord 从MS 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 增加缩进 Blockquote 块引用
CreateDiv 创建DIV JustifyLeft 左对齐
JustifyCenter 居中对齐 JustifyRight 右对齐
JustifyFull 两端对齐 Link 插入/编辑链接
Unlink 取消链接 Anchor 插入/编辑锚点链接
Image 插入编辑图像 Flash 插入/编辑Flash
Table 插入/编辑表格 Rule 插入水平线
Smiley 插入表情 SpecialChar 插入特殊符号
PageBreak 插入分页 Style 样式
FontFormat 格式 FontName 字体
FontSize 大小 TextColor 文本颜色
BGColor 背景颜色 FitWindow 全屏编辑
ShowBlocks 显示区域 About 关于Fuckeditor
工具栏配置选项功能进行汇总
你也可以创建一个非默认的工具栏按钮设置,您可以从FCKConfig.ToolbarSets["Default"]当中的代码重新复制一份,然后将Default改成您想要的名字。
注意:fckconfig.js配置选项采用JavaScript语法,如果您不懂JavaScript的话,请在配置之前进行备份。
如果你的编辑器还用在网站前台的话,比如说用于留言本或是日记回复时,那就不得不考虑安全了,在前台千万不要使用Default的toolbar,要么自定义一下功能,要么就用系统已经定义好的Basic,也就是基本的toolbar,这里配置了一个适合于大部份网站使用的工栏目按钮
FCKConfig.ToolbarSets["MyDesign"] = [
['Source','DocProps','-','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Style','FontFormat','FontName','FontSize'],
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks']] ;
要想使用自定义的工具栏按钮,必须在创建FCKeditor实例后设置使用的工具栏选项。
oFCKeditor.ToolbarSet = "MyDesign"; //JavaScript