package CKEDITOR UI configurable Toolbar
References #148 The js and css config files are directly placed in /htmlarea directory. The old ones downunder are not reset with this commit, until we give OK to go. The lang constant will be placed to addlang.txt in a 2cd commit, since this may change and there is already a pending constant. I have not added another option by now to explicitly choose the s9y configs in htmlarea, if someone has custom ones in 2k11/admin and wants to switch back to the origins. Is this really a real and valid user case?
This commit is contained in:
htmlarea
ckeditor
ckeditor
plugins
include
templates/2k11/admin
@ -1,26 +1,29 @@
|
||||
{if $init == false}
|
||||
<script src="{$serendipityHTTPPath}htmlarea/ckeditor/ckeditor/ckeditor.js"></script>
|
||||
<script src="{$wysiwyg_customPlugin}"></script>
|
||||
{/if}
|
||||
|
||||
<script>
|
||||
$('document').ready(function() {
|
||||
CKEDITOR.plugins.add('s9y_medialibrary{$item}', {
|
||||
CKEDITOR.plugins.add('s9y_medialibrary_{$item}', {
|
||||
init: function( editor ) {
|
||||
editor.addCommand( 'openML', {
|
||||
exec : function( editor ) {
|
||||
serendipity.openPopup('serendipity_admin.php?serendipity[adminModule]=media&serendipity[noBanner]=true&serendipity[noSidebar]=true&serendipity[noFooter]=true&serendipity[showMediaToolbar]=false&serendipity[showUpload]=true&serendipity[textarea]={$item}');
|
||||
}
|
||||
});
|
||||
editor.ui.addButton('s9y_medialibrary{$item}', {
|
||||
editor.ui.addButton('s9y_medialibrary_{$item}', {
|
||||
label: '{$CONST.MEDIA_LIBRARY}',
|
||||
command: 'openML',
|
||||
icon: '{serendipity_getFile file="admin/img/thumbnail.png"}',
|
||||
toolbar: 'insert'
|
||||
icon: '{serendipity_getFile file="admin/img/thumbnail.png"}'
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
s9ymediabuttons.push('s9y_medialibrary_{$item}');
|
||||
|
||||
{foreach $buttons as $button}
|
||||
|
||||
CKEDITOR.plugins.add('{$button.id}', {
|
||||
init: function( editor ) {
|
||||
editor.addCommand( '{$button.name}', {
|
||||
@ -36,20 +39,24 @@
|
||||
icon: '{$button.img_url}',
|
||||
iconName: '{$button.id}_icon'
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
s9ypluginbuttons.push('{$button.id}');
|
||||
|
||||
{/foreach}
|
||||
|
||||
|
||||
ckeitem = '{$item}';
|
||||
CKEDITOR.replace($('#'+serendipity.escapeBrackets(ckeitem)).get(0), {
|
||||
customConfig : '{$serendipityHTTPPath}htmlarea/ckeditor/serendipity_config.js',
|
||||
extraPlugins : 's9y_medialibrary{$item}{foreach $buttons as $button},{$button.id}{/foreach}',
|
||||
|
||||
|
||||
var s9yplugins = customplugins.concat('s9y_medialibrary_{$item}{foreach $buttons as $button},{$button.id}{/foreach}');
|
||||
|
||||
CKEDITOR.replace($('#'+serendipity.escapeBrackets('{$item}')).get(0), {
|
||||
extraPlugins : s9yplugins,
|
||||
toolbar : '{$wysiwygToolbar}',
|
||||
customConfig : '{$wysiwyg_customConfig}',
|
||||
{if $use_autosave == 'true'}
|
||||
|
||||
on: {
|
||||
instanceReady: function( evt ) {
|
||||
if(Modernizr.indexeddb && {$use_autosave}) {
|
||||
if(Modernizr.indexeddb) {
|
||||
CKEDITOR.instances["{$item}"].document.once('keyup', function() {
|
||||
setInterval(function() {
|
||||
serendipity.cache("{$item}", CKEDITOR.instances["{$item}"].getData());
|
||||
@ -58,6 +65,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
{/if}
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user