edit: button to create div containers v3.2
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 18 Jun 2018 16:54:37 +0000 (18:54 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 18 Jun 2018 16:54:37 +0000 (18:54 +0200)
Commonly used for columns and right-aligned blocks.

edit.js

diff --git a/edit.js b/edit.js
index b331cf7d86d887fa4229db566189a60946c4dc36..f6df1e546060bc9b040380807162b8e5cd342bc8 100644 (file)
--- a/edit.js
+++ b/edit.js
@@ -80,14 +80,18 @@ CKEDITOR.on('instanceCreated', function (event) {
                config.uploadUrl = '/edit?output=ckjson';
                config.image2_alignClasses = ['left', 'center', 'right'];
                config.image2_disableResizer = true;
+               config.stylesSet = [
+                       { name: 'Kolom', element: 'div', attributes: { 'class': 'col' } },
+                       { name: 'Rechts', element: 'div', attributes: { 'class': 'right' } },
+               ];
                config.pasteFilter = pastefilter;
                config.contentsCss = document.styleSheets[0].href;
                config.toolbar = [
                        ['Inlinesave', '-', 'Undo', 'Redo'],
-                       ['Format', 'BulletedList', 'NumberedList', 'Blockquote'],
+                       ['Format', 'BulletedList', 'NumberedList', 'CreateDiv', 'Table', 'Blockquote'],
+                       ['HorizontalRule', 'CreatePlaceholder', 'Image'],
                        ['Bold', 'Italic', 'Link'],
-                       ['HorizontalRule', 'Table', 'Image'],
-                       ['CreatePlaceholder', 'Sourcedialog'],
+                       ['Sourcedialog'],
                ];
                config.toolbarCanCollapse = true;
                config.floatSpacePreferRight = true;