]> BookStack Code Mirror - bookstack/blobdiff - resources/assets/js/directives.js
Updated ldap so extension not required in testing
[bookstack] / resources / assets / js / directives.js
index de87950dc6662fa55dfdc88a17e51b655fd21885..97d8a89e293fe9055b6ba843b342ba860b34383b 100644 (file)
@@ -15,7 +15,7 @@ module.exports = function (ngApp, events) {
      */
     ngApp.directive('toggleSwitch', function () {
         return {
-            restrict: 'E',
+            restrict: 'A',
             template: toggleSwitchTemplate,
             scope: true,
             link: function (scope, element, attrs) {
@@ -198,6 +198,30 @@ module.exports = function (ngApp, events) {
                 }
 
                 scope.tinymce.extraSetups.push(tinyMceSetup);
+
+                // Custom tinyMCE plugins
+                tinymce.PluginManager.add('customhr', function(editor) {
+                    editor.addCommand('InsertHorizontalRule', function() {
+                        var hrElem = document.createElement('hr');
+                        var cNode = editor.selection.getNode();
+                        var parentNode = cNode.parentNode;
+                        parentNode.insertBefore(hrElem, cNode);
+                    });
+
+                    editor.addButton('hr', {
+                        icon: 'hr',
+                        tooltip: 'Horizontal line',
+                        cmd: 'InsertHorizontalRule'
+                    });
+
+                    editor.addMenuItem('hr', {
+                        icon: 'hr',
+                        text: 'Horizontal line',
+                        cmd: 'InsertHorizontalRule',
+                        context: 'insert'
+                    });
+                });
+
                 tinymce.init(scope.tinymce);
             }
         }