Home >Backend Development >PHP Tutorial >Add one-click typesetting function to ckeditor editor modification_PHP tutorial

Add one-click typesetting function to ckeditor editor modification_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:12:451190browse

Add one-click typesetting function for ckeditor editor modification

Friends who use PHPCMS V9 know that V9 has built-in ckeditor editor, but the typesetting function of the default editor is not very powerful. , the editor of Green Tea below will teach you how to modify the editor and change several places to make Ckeditor editing more practical.

1. Remove hyperlinks in batches:

Open statics/js/ckeditor/ckeditor.js

Found:

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

Modified to:

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

2. Automatically add ALT parameters when uploading images

Modify statics/js/ckeditor/plugins/image/dialogs/image.js

Found:

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

Replace with:

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

3. Modify the editor and press enter and line feed

or

Open the file staticsjsckeditorconfig.js and put the following:

 config.enterMode = CKEDITOR.ENTER_BR;

 config.shiftEnterMode = CKEDITOR.ENTER_P;

Modified to:

 config.enterMode = CKEDITOR.ENTER_P;

 config.shiftEnterMode = CKEDITOR.ENTER_BR;

4. Add one-click typesetting function to the editor

Modify form.class.php under the phpcmslibsclasses column to find ['Maximize'], add ['autoformat'] under it, and save it.

Find the config.js file in the staticsjsckeditor folder and find:

 config.extraPlugins = 'capture';

Modified to:

 config.extraPlugins = 'capture,autoformat';

Just save it. Remember to update the cache and clear cookies after modification.

In fact, the above content is mainly about adding one-click typesetting function to the ckeditor editor. Friends in need can give it a try~ It’s very practical!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/919974.htmlTechArticleAdd one-click typesetting function for ckeditor editor modification Friends who use PHPCMS V9 know that V9 uses the ckeditor editor built-in , but the typesetting function of the default editor is not very powerful. The green below...
Statement:
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