Make ckeditor configurable via config (#148)
Before this, ckeditor was configurable by editing the wysiwyg_init.tpl in 2k11/admin. Now, the flow is like this: 1. wysiwyg_init.tpl is responsible for initializing the editor and the plugins 2. we provide a htmlare/ckeditor/serendipity_config.js where we specify a sane default configuration, including a small toolbar without harmful elements 3. if the user wants to overwrite our configuration upgrade-safely, he can do this in htmlare/ckeditor/userconf.js
This commit is contained in:
parent
9b63c41c2a
commit
f7da64165d
@ -1,9 +1,6 @@
|
||||
/**
|
||||
* @fileOverview A Serendipity CKEDITOR custom config file: ckeditor_custom_config.js, v. 1.1, 2014-04-24, Ian
|
||||
*/
|
||||
|
||||
/**
|
||||
* Substitute every config option to CKEDITOR in here
|
||||
* This is the configuration of ckeditor provided by the s9y-team. Make your
|
||||
* custom changes in htmlarea/ckeditor/userconf.js so they won't get overwritten
|
||||
*/
|
||||
CKEDITOR.editorConfig = function( config ) {
|
||||
|
||||
@ -82,6 +79,28 @@ CKEDITOR.editorConfig = function( config ) {
|
||||
//config.uiColor = '#FF8040'; // mango
|
||||
//config.uiColor = '#FF2400'; // scarlet red
|
||||
//config.uiColor = '#14B8C4'; // light turquoise
|
||||
config['skin'] = 'moono';
|
||||
config['height'] = 400;
|
||||
config.skin = 'moono';
|
||||
config.height = 400;
|
||||
|
||||
config.removePlugins = 'showblocks, font, div, liststyle, flash, iframe, pagebreak, smiley, specialchar, horizontalrule, indentblock, justify, pastefromword, save, newpage, preview, print, stylescombo';
|
||||
|
||||
config.removeButtons = 'Underline,Subscript,Superscript';
|
||||
|
||||
config.toolbarGroups = [
|
||||
{ name: 'tools' },
|
||||
{ name: 'styles' },
|
||||
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
|
||||
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ] },
|
||||
{ name: 'links' },
|
||||
{ name: 'insert' },
|
||||
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
|
||||
{ name: 'editing', groups: [ 'spellchecker' ]},
|
||||
{ name: 'others' },
|
||||
{ name: 'document', groups: [ 'mode' ] },
|
||||
{ name: 'about' }
|
||||
];
|
||||
|
||||
|
||||
|
||||
config['customConfig'] = '../userconf.js';
|
||||
};
|
@ -1,7 +1,7 @@
|
||||
{if $init == false}
|
||||
<script src="{$serendipityHTTPPath}htmlarea/ckeditor/ckeditor/ckeditor.js"></script>
|
||||
<script src="{$serendipityHTTPPath}htmlarea/ckeditor/ckeditor_custom_plugin.js"></script>
|
||||
{/if}
|
||||
|
||||
<script>
|
||||
$('document').ready(function() {
|
||||
CKEDITOR.plugins.add('s9y_medialibrary{$item}', {
|
||||
@ -14,7 +14,8 @@
|
||||
editor.ui.addButton('s9y_medialibrary{$item}', {
|
||||
label: '{$CONST.MEDIA_LIBRARY}',
|
||||
command: 'openML',
|
||||
icon: '{serendipity_getFile file="admin/img/thumbnail.png"}'
|
||||
icon: '{serendipity_getFile file="admin/img/thumbnail.png"}',
|
||||
toolbar: 'insert'
|
||||
});
|
||||
|
||||
}
|
||||
@ -43,7 +44,7 @@
|
||||
|
||||
ckeitem = '{$item}';
|
||||
CKEDITOR.replace($('#'+serendipity.escapeBrackets(ckeitem)).get(0), {
|
||||
customConfig : '{$serendipityHTTPPath}htmlarea/ckeditor/ckeditor_custom_config.js',
|
||||
customConfig : '{$serendipityHTTPPath}htmlarea/ckeditor/serendipity_config.js',
|
||||
extraPlugins : 's9y_medialibrary{$item}{foreach $buttons as $button},{$button.id}{/foreach}',
|
||||
|
||||
on: {
|
||||
@ -56,21 +57,7 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
toolbar: [
|
||||
{ name: 'tools', items: [ 'Maximize' ] },
|
||||
{ name: 'styles', items: [ 'Format' ] },
|
||||
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'RemoveFormat' ] },
|
||||
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] },
|
||||
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
|
||||
{ name: 'insert', items: [ 'Image', 's9y_medialibrary{$item}', 'Table', 'HorizontalRule', 'SpecialChar' ] },
|
||||
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', '-', 'Undo', 'Redo' ] },
|
||||
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Scayt' ] },
|
||||
{ name: 'others', items: [ '-' {foreach $buttons as $button}, '{$button.id}'{/foreach} ] },
|
||||
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] },
|
||||
{ name: 'about', items: [ 'About' ] }
|
||||
]
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user