CKEditor 插件开发:工具栏按钮快速入门
来源:互联网 发布:linux查看登录用户清单 编辑:程序博客网 时间:2024/05/10 01:46
转自:http://mjxy.cn/a-CKEditor-plug-in-development-a-toolbar-button-Quick-Start.aspx
介绍
这是一个CKEditor3.4插件开发的简易教程,介绍如何为工具栏toolbar增加例如 p,h1,h2,h3,h4,h5,h6,pre,div的按钮。
按如下目录结构创建文件夹和文件
plugin.js 插件配置脚本ckeditor/
config.js
plugins/
button-pre/
button-pre.png
plugin.js
下载Button图片 button-pre.png:(function(){
var a= {
exec:function(editor){
var format = {
element : "pre"
};
var style = new CKEDITOR.style(format);
style.apply(editor.document);
}
},
b="button-pre";
CKEDITOR.plugins.add(b,{
init:function(editor){
editor.addCommand(b,a);
editor.ui.addButton("button-pre",{
label:"Button PRE",
icon: this.path + "button-pre.png",
command:b
});
}
});
})();
注册插件
修改config.js文件
结果如下图:CKEDITOR.editorConfig = function( config )
{
CKEDITOR.config.toolbar_Basic = [['button-pre', 'Bold', 'Italic', 'Underline' ]];
config.toolbar = 'Basic';
config.startupOutlineBlocks = true;
config.extraPlugins = "button-pre";
};
- CKEditor 插件开发:工具栏按钮快速入门
- CKEditor工具栏全部按钮名称
- django ckeditor插件按钮
- CKEditor插件开发
- CKeditor插件开发流程
- K3插件增加工具栏按钮
- Eclipse插件开发快速入门
- Eclipse插件开发快速入门
- Eclipse插件开发快速入门
- Eclipse插件开发快速入门
- ckeditor插件开发简单范例
- Eclipse插件开发快速入门(一)
- Eclipse插件开发快速入门(二)
- 页面文本编辑器CKEDITOR快速入门
- ckeditor工具栏配置
- ckeditor 工具栏配置
- 自定义ckeditor工具栏
- ckeditor 工具栏配置
- Ubuntu给Firfox安装Flash插件
- Android状态栏通知Status Bar Notification
- Samba使用简介
- 经典的机器学习方面源代码库
- soj 1796. Max's kingdom
- CKEditor 插件开发:工具栏按钮快速入门
- 蜜果私塾:http协议学习和总结系列——协议详解篇
- 浅谈MySQL表类型
- VC获取系统时间、程序运行时间.
- 蜜果私塾:http协议学习和总结系列--基础概念篇
- 增加新模块错误
- 三星uboot1.1.6源码分析——start.s(1)
- 用“分区助手”(PartAssist)给C盘扩容
- File 写unicode码问题 换行问题