From 6adf9d299fe0f6079b1caab7bc461d59ca4898ca Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 16 Dec 2020 13:54:24 +0100 Subject: [PATCH] edit/page: replace format selection by style options Save one button (fitting in 2 rows on 420px width) by getting rid of the arbitrary distinction between formatting and styles, the latter having equally semantic elements and capable of toggling headers. --- edit/page.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/edit/page.js b/edit/page.js index b21a038..f927c1f 100644 --- a/edit/page.js +++ b/edit/page.js @@ -115,7 +115,6 @@ CKEDITOR.on('instanceCreated', function (event) { var config = editor.config; config.language = 'nl'; config.extraPlugins = 'inlinesave,placeholder,image2,uploadimage'; - config.format_tags = 'h2;h3;h4;p'; config.allowedContent = true; config.entities = false; // keep unicode config.filebrowserImageUploadUrl = '/edit/page?output=ckescript'; @@ -123,6 +122,10 @@ CKEDITOR.on('instanceCreated', function (event) { config.image2_alignClasses = ['left', 'center', 'right']; config.image2_disableResizer = true; config.stylesSet = [ + { name: 'Paginakop', element: 'h2' }, + { name: 'Paragraafkop', element: 'h3' }, + { name: 'Alineakop', element: 'h4' }, + { name: 'Gerelateerd', element: 'aside' }, { name: 'Voetnoot', element: 'div', attributes: { 'class': 'right' } }, { name: 'Kolom', element: 'div', attributes: { 'class': 'col' } }, @@ -142,8 +145,7 @@ CKEDITOR.on('instanceCreated', function (event) { config.contentsCss = document.styleSheets[0].href; config.toolbar = [ ['Inlinesave', '-', 'Undo', 'Redo'], - ['Format', 'Styles'], - ['Bold', 'Italic', 'Link'], + ['Styles', 'Bold', 'Italic', 'Link'], ['BulletedList', 'NumberedList', 'Blockquote'], ['Table', 'CreateDiv'], ['Image', 'HorizontalRule', 'CreatePlaceholder'], -- 2.30.0