edit: omit type input from link dialog
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 15 Jun 2018 11:20:16 +0000 (13:20 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 16 Jun 2018 03:29:33 +0000 (05:29 +0200)
Simplify common usage by hiding unneeded options; specifically email
(prefer forms) and page references (rare).
Can still be entered manually if needed, but should not be advertised.

edit.js

diff --git a/edit.js b/edit.js
index fcc8d5f3cb7c9ce3193079f92d597bbc9659f642..b331cf7d86d887fa4229db566189a60946c4dc36 100644 (file)
--- a/edit.js
+++ b/edit.js
@@ -35,13 +35,20 @@ CKEDITOR.plugins.add('inlinesave', {
 });
 
 CKEDITOR.on('dialogDefinition', function (event) {
-       if (event.data.name === 'table') {
+       switch (event.data.name) {
+       case 'table':
                // override initial attribute values
                var infoTab = event.data.definition.getContents('info');
                infoTab.get('txtWidth').default = '';
                infoTab.get('txtBorder').default = '0';
                infoTab.get('txtCellSpace').default = '';
                infoTab.get('txtCellPad').default = '';
+               break;
+       case 'link':
+               // remove unneeded widgets from the Link Info tab
+               var infotab = event.data.definition.getContents('info');
+               infotab.remove('linkType');
+               break;
        }
 });