CKEditor 添加一键排版插件实例,
大家都知道 phpcms 也是 ckeditor 编辑器,那么如果增加这个一键排版这个牛逼功能呢
增加好了后,效果图是这样的
废话不多说,直接说步骤
第一步:config.js 中 statics\js\ckeditor\config.js 中注册 autoformat 控件
- config.extraPlugins = 'capture,
- videoforpc,
- flashplayer,
- autoformat';
第二步,在 statics\js\ckeditor\plugins 新建文件夹 autoformat
第三步,在 statics\js\ckeditor\plugins\autoformat 新建文件 plugin.js
写入如下内容
写到这里,就完成啦,完成了 CKEditor 添加一键排版插件
但是,到这里再 phpcms 里面,还是不能直接用的,在别的系统里面是可以的。因为 phpcms 的编辑器控件是需要单独选择的,还需要修改 phpcms 文件
打开 phpcms/libs/classes/form.class.php
搜索 ['Maximize'] 在它的后面加上 ['autoformat'], 就可以了。
转自:http://www.wfuyu.com/biji/25066.html
原文是程序员人生。
来源: