FCKeidtor 配置工具栏 toolbarset的样式
来源:互联网 发布:四川版小学英语软件 编辑:程序博客网 时间:2024/06/01 09:43
FCKeitor默认提供了两种方式 Default,Basic.
Default:
Basic:
而他的配置文件fckconfig.js里的代码是这样的
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'],
['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.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;
从代码中不难看出我们可以自己手动修改要显示的内容。
我们可以把最常用的放在一起,去掉那些不常用的。我们可以有两种方法修改。
1.直接在原来的基础上增加或删除
例如我们可以在Basic里添加 ['Style','FontFormat','FontName','FontSize'],
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About'] ,
['Style','FontFormat','FontName','FontSize']
]
这样在使用时就显示样式,字体,字体大小等。
2.新建一个自己的类型。
FCKConfig.ToolbarSets["My"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','Image','Flash','Table','Rule','Smiley']
] ;
这样你在fckeditor的属性toolbarset里设成My就可以使用了。
所以你可以自己设置自己喜欢的工具栏。
附:仿百度空间工具栏
要仿照(关键在于看看fck的可变性)这样一个比较简洁的功能界面 可以做如下改变 基础的改变是fckconfig.js和editor/fckeditor.html文件 可以新建两个工具界面配置 FCKConfig.ToolbarSets["Mybasic"] = [ 然后在fckeditor.html中script中加入 function chang(ToobarStyle){ var a = document.getElementById("sptool"); 表格中改成 <td id="xToolbar" class="TB_ToolbarSet"></td>
['Bold','Italic','-','Link','Unlink','Image','-','FontSize','TextColor','-']
] ;
FCKConfig.ToolbarSets["Myall"] = [
['Bold','Italic','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','Link','Unlink','Image','-','FontName','FontSize','TextColor','BGColor','-']
] ;
var b = document.getElementById("alltool");
if(ToobarStyle == 'Mybasic'){
ToobarStyle = 'Mybasic';
a.style.display = "none";
b.style.display = "inline";
}else{
ToobarStyle = 'Myall';
a.style.display = "inline";
b.style.display = "none";
}
FCK.ToolbarSet.Load(ToobarStyle || 'Mybasic');
}
<td align="right" class="TB_ToolbarSet" width="60px"> <a href="javascript:void(0);" id="sptool" onClick="chang('Mybasic');" style="font-size:12px;display:none;">简单功能</a><a id="alltool" href="javascript:void(0);" onClick="chang('Myall');" style="font-size:12px;">全部功能</a></td>
<td class="TB_SideBorder" style="width: 1px"></td>
- FCKeidtor 配置工具栏 toolbarset的样式
- FCKeidtor的toolbarset的设置
- FCKeidtor的toolbarset的设置
- FCKeidtor部分配置的记录
- Fckeditor增加自定义工具栏(ToolbarSet)及FCKeditor对象在页面的使用
- FCKEidtor 和 Ruby On Rails 的整合
- dojo4 中的 edit2 的工具栏使用 FCKeditor 的样式
- web developer tips (2):样式应用工具栏的工作模式
- 自定义样式实现菜单和工具栏的分割线
- navigationController中添加toolbarItems工具栏____UIBarButtonSystemItem的样式解析
- DotNetBar 快速访问工具栏的配置代码
- ckeditor3.3工具栏配置
- ckeditor工具栏配置
- ckeditor 工具栏配置
- ckeditor 工具栏配置
- CKEditor工具栏自定义配置
- 用Ultraedit编写Java程序(UE工具栏的配置)
- 自定义配置UEditor 工具栏上的按钮列表
- Clucene索引建立剖析
- 树和二叉树-层序遍历二叉树
- Clucene索引合并剖析
- 海量(大量)数据GridView显示高效率分页实现方法
- 回来了
- FCKeidtor 配置工具栏 toolbarset的样式
- 。net 调用迅雷
- 数字转英文货币
- 没人把程序员当回事儿
- Android Recovery模式
- 【Linux】redhat enterprise 5 如何正确安装gcc
- 用QueryString传中文值错误
- visual 2008 调试silverlight 出现 silverlight managed debugging package
- 双击EXCEL 文件打不开,要先打开EXCEL才能打开EXCEL文件