From fb9414b9aea7372f9cc01cdb1baa2bf84bcb14d8 Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 25 Nov 2014 14:27:16 +0100 Subject: [PATCH] ckeditor extend more for serendipity This hides the ckeditor image widget button by CSS in all supported Serendipity toolbars, but keeps it internal functionality enabled which is needed for MediaLibrary inserts. This forces the user to use the specialized ML button for image inserts only, but will still be supported by CKE toolbar. An Image double click will still use the image widget like before. Best checked place was to put this in admin/style.css. References 148 --- .../ckeditor/plugins/mediaembed/plugin.js | 4 +-- htmlarea/ckeditor_s9y_config.js | 10 ++++--- templates/2k11/admin/style.css | 26 +++++++++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/htmlarea/ckeditor/ckeditor/plugins/mediaembed/plugin.js b/htmlarea/ckeditor/ckeditor/plugins/mediaembed/plugin.js index 29230c05..9186d4ec 100644 --- a/htmlarea/ckeditor/ckeditor/plugins/mediaembed/plugin.js +++ b/htmlarea/ckeditor/ckeditor/plugins/mediaembed/plugin.js @@ -21,7 +21,7 @@ CKEDITOR.dialog.add( 'MediaEmbedDialog', function (instance) { return { - title : 'Embed Media', + title : 'Embed Video Media', minWidth : 550, minHeight : 200, contents : @@ -53,7 +53,7 @@ editor.ui.addButton( 'MediaEmbed', { - label: 'Embed Media', + label: 'Embed Video Media', command: 'MediaEmbed', toolbar: 'mediaembed' } ); diff --git a/htmlarea/ckeditor_s9y_config.js b/htmlarea/ckeditor_s9y_config.js index ca390ce6..5ddb7d0c 100644 --- a/htmlarea/ckeditor_s9y_config.js +++ b/htmlarea/ckeditor_s9y_config.js @@ -1,6 +1,6 @@ /** * @fileOverview The Serendipity CKEDITOR custom config file: - * ckeditor_s9y_config.js, v. 1.7, last modified 2014-11-19 by Ian + * ckeditor_s9y_config.js, v. 1.8, last modified 2014-11-25 by Ian */ /** @@ -143,12 +143,13 @@ CKEDITOR.editorConfig = function( config ) { config.toolbar_Standard = [ { name: 'basicstyles', items : [ 'Format','-','Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] }, { name: 'clipboard', items : [ 'Cut', 'Copy', 'Paste', 'PasteText', '-', 'Undo', 'Redo'] }, + { name: 's9yml', items : s9ymediabuttons }, { name: 'insert', items : [ 'Image', '-', 'Table', 'HorizontalRule', 'SpecialChar'] }, { name: 'paragraph', groups : [ 'list', 'blocks', 'align' ], items: [ 'NumberedList', 'BulletedList', '-', 'Blockquote' ] }, { name: 'links', items : [ 'Link','Unlink','Anchor' ] }, { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Scayt' ] }, { name: 'mediaembed', items : [ 'MediaEmbed' ] }, - { name: 'others', items : s9ypluginbuttonsAll }, + { name: 'others', items : s9ypluginbuttons }, { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] }, { name: 'about', items : [ 'About', ] }, { name: 'cheatsheet', items : ['CheatSheet'] } @@ -156,6 +157,7 @@ CKEDITOR.editorConfig = function( config ) { // console.log(JSON.stringify(config.toolbar_Standard)); // in case of toolbar : Full (moved 'Source' and removed 'Font' buttons. 'Styles' and 'Preview' disabled overall. ) + // With the css hidden fix for cke image button, it is not possible to move the s9ymediabuttons in this toolbar up. Leave it in others! config.toolbar_Full = [ { name: 'styles', items : [ 'Styles','Format',/*'Font',*/'FontSize' ] }, { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] }, @@ -202,12 +204,12 @@ CKEDITOR.editorConfig = function( config ) { { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] }, { name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] }, - '/', +// '/', { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ] }, { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] }, { name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] }, - '/', +// '/', { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] }, { name: 'colors', items: [ 'TextColor', 'BGColor' ] }, { name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] }, diff --git a/templates/2k11/admin/style.css b/templates/2k11/admin/style.css index 9840e34a..1fb3d060 100644 --- a/templates/2k11/admin/style.css +++ b/templates/2k11/admin/style.css @@ -2344,6 +2344,32 @@ input[name="serendipity[filter][fileCategory]"] { } /* end TEMP fixes */ +/* CKEDITOR Toolbar */ +/* hide cke-image button to support the internal functionality needed for MediaLibrary inserts, but disables the button to eyes, if not in CKE PRESET Toolbar (#65) */ +.cke_toolgroup a.cke_button__image:not(#cke_65) { + display: none !important; + visibility: hidden; + height: 0 !important; + padding: 0 !important; + border-radius: 0 !important; +} +/* hide next sibling separator */ +.cke_toolgroup a.cke_button__image:not(#cke_65)~.cke_toolbar_separator { + display: none; + visibility: hidden; + margin: 0px; + height: 0px; + width: 0px; + border-radius: 0 !important; +} +/* hide empty image toolgroup in toolbar BASIC (do not remove the span tag!) */ +span#cke_27 { + display: none; + visibility: hidden; + width: 0 !important; +} +/* end CKEDITOR fixes */ + /* MAGNIFIC POPUP */ .mfp-bg { top: 0;