1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| CKEDITOR.editorConfig = function( config ) {
// CKEDITOR TOOLBAR CUSTOMIZATION
// I only set the needed buttons, so feel frey to add those you want in the array
config.toolbarGroups = [
{ name: 'pbckcode' } ,
// you other buttons here
];
// CKEDITOR PLUGINS LOADING
config.extraPlugins = 'pbckcode'; // add other plugins here (comma separated)
// ADVANCED CONTENT FILTER (ACF)
// ACF protects your CKEditor instance of adding unofficial tags
// however it strips out the pre tag of pbckcode plugin
// add this rule to enable it, useful when you want to re edit a post
config.allowedContent= 'pre[*]{*}(*)'; // add other rules here
// PBCKCODE CUSTOMIZATION
config.pbckcode = {
// An optional class to your pre tag.
cls : '',
// The syntax highlighter you will use in the output view
highlighter : 'PRETTIFY',
// An array of the available modes for you plugin.
// The key corresponds to the string shown in the select tag.
// The value correspond to the loaded file for ACE Editor.
modes : [ ['HTML', 'html'], ['CSS', 'css'], ['PHP', 'php'], ['JS', 'javascript'] ],
// The theme of the ACE Editor of the plugin.
theme : 'textmate',
// Tab indentation (in spaces)
tab_size : '4'
};
}; |
Partager