Home > php教程 > php手册 > body text

为ckeditor编辑器修改添加一键排版功能

WBOY
Release: 2016-06-13 09:19:50
Original
1497 people have browsed it

为ckeditor编辑器修改添加一键排版功能

   使用PHPCMS V9的朋友都知道,V9内置使用ckeditor编辑器,但是默认编辑器的排版功能不是很强大,下面绿茶小编教大家修改一下编辑器,改动几个地方,让Ckeditor编辑更加实用一些。

  1、批量去除超链接:

  打开 statics/js/ckeditor/ckeditor.js

  找到:

  $.execCommand('unlink',false,null);

  修改为:

  $.execCommand('unlink',false,true);

  2、上传图片自动添加ALT参数

  修改 statics/js/ckeditor/plugins/image/dialogs/image.js

  找到:

  accessKey:'T','default':''

  替换成:

  accessKey:'T','default':$('#title').val()

  3、修改编辑器回车换行

or

  打开文件 \statics\js\ckeditor\config.js 把里面的:

  config.enterMode = CKEDITOR.ENTER_BR;

  config.shiftEnterMode = CKEDITOR.ENTER_P;

  修改为:

  config.enterMode = CKEDITOR.ENTER_P;

  config.shiftEnterMode = CKEDITOR.ENTER_BR;

  4、给编辑器添加一键排版功能

  修改phpcms\libs\classes栏目下的 form.class.php 找到['Maximize'],在它下面添加['autoformat'],保存即可。

  找到statics\js\ckeditor文件夹下的 config.js 文件,找到:

  config.extraPlugins = 'capture';

  修改为:

  config.extraPlugins = 'capture,autoformat';

  保存即可,修改后记得更新缓存,清除cookies。

  其实上面的内容主要就是给ckeditor编辑器添加一键排版功能的方法。有需要的朋友可以试下哦~非常实用的哈!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template