惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
腾讯CDC
D
Docker
G
Google Developers Blog
D
DataBreaches.Net
雷峰网
雷峰网
Blog — PlanetScale
Blog — PlanetScale
S
SegmentFault 最新的问题
The Cloudflare Blog
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Stack Overflow Blog
Stack Overflow Blog
大猫的无限游戏
大猫的无限游戏
量子位
美团技术团队
aimingoo的专栏
aimingoo的专栏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Engineering at Meta
Engineering at Meta
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - antistone

GoogleEarth截图技巧(转) Windows 7 中更改用户主目录 Sybase ASE ADO.NET驱动 乱码问题解决 C#开发Windows服务入门摘要 WinForm中使用Log4NET C# 中用信号量实现读者写者问题 测试Google文件的发布功能 Linux下OpenGL开发 -- 准备篇 FCKEditor的使用-asp 石头汤的故事 在JAVA中读取文件乱码的解决办法 Struts 内容简介(转) Xvid技术中的精彩部分[转] Marshal GetCurrentImage的MSND说明,暂记 C#中数据类型与其他语言中的数据类型之间的对应关系 神州数码网络无线校园网整体解决方案及特点 关于web应用程序安全的思考(序)(转) NHibernate快速指南
FCKEditor工具条定制
antistone · 2008-03-16 · via 博客园 - antistone

FCkEditor确实是一个非常优秀的HTML在线编辑器,它的功能确实很强大,而且也非常的灵活,具有很强的定制性。

FCKEditor默认的工具栏项目很多,我们完全可以对其进行自定制,以满足自己的需求。

网上也有很多介绍定制工具栏的方法。下面就是其中的一种:

在fckconfig.js中找到

FCKConfig.ToolbarSets 段,默认有两个工具条样式,一个是Default,一个是Basic(我的版本是2.5)。

增加如下一段:

 1FCKConfig.ToolbarSets["Custom"= [
 2    ['FontFormat','FontName','FontSize'],
 3    ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
 4    ['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
 5    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
 6    ['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
 7    ['Link','Unlink','Anchor'],
 8    ['TextColor','BGColor'],'/'
 9    ['Cut','Copy','Paste','PasteText','PasteWord'],
10    ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
11    ['FitWindow','ShowBlocks','-','Source','About']        // No comma for the last row.
12] ;

然后再调用代码中做如下更改

注意第7行是新增的,指定所要使用的工具栏

 1<%
 2    Dim oFCKeditor
 3    Set oFCKeditor = New FCKeditor
 4    oFCKeditor.BasePath    = "edit/"
 5    oFCKeditor.Value    = ""
 6    oFCKeditor.Config("SkinPath")="/website/manage/edit/editor/skins/silver/"
 7    oFCKeditor.ToolbarSet = "Custom"
 8    oFCKeditor.Create "txtcontent"
 9%>
10

其定制语法很简单
[]  表示一个工具条,
[]  中的短横线'-'表示一个垂直分割线
''  两个单引号中间加一个标识符表示一个工具栏按钮,具体的对应关系可以自己找。
'/' 作用类似于一个回车。使该符号后面的工具栏新起一行排列。

我最终的定制效果如下: