edit/page: replace format selection by style options
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 16 Dec 2020 12:54:24 +0000 (13:54 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 21 Dec 2020 16:46:33 +0000 (17:46 +0100)
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

index b21a0386519ca07d4c03880b31a533b5a0f5dc49..f927c1fd248c2d746996e791ed51e1676432b8d5 100644 (file)
@@ -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'],