Added button to remove a code box during editing
authorAlexander Ebert <ebert@woltlab.com>
Mon, 5 Jan 2015 14:32:54 +0000 (15:32 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 5 Jan 2015 14:32:54 +0000 (15:32 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index 228522a13cc9fa0c04c2ba69ed93c482d48efd6e..e406a761da636debb24d5973d26dbcb346759e21 100644 (file)
@@ -1790,7 +1790,7 @@ RedactorPlugins.wbbcode = function() {
                _handleInsertCode: function(codeBox, isInsert) {
                        this.modal.load('code', WCF.Language.get('wcf.bbcode.code.' + (isInsert ? 'insert' : 'edit')), 400);
                        
-                       var $button = this.modal.createActionButton(this.lang.get('save'));
+                       var $button = this.modal.createActionButton(this.lang.get('save')).addClass('buttonPrimary');
                        
                        if (isInsert) {
                                this.selection.get();
@@ -1843,6 +1843,15 @@ RedactorPlugins.wbbcode = function() {
                                }, this));
                        }
                        else {
+                               var $deleteButton = this.modal.createActionButton(WCF.Language.get('wcf.global.button.delete'));
+                               $deleteButton.click((function() {
+                                       this.buffer.set();
+                                       
+                                       codeBox.remove();
+                                       
+                                       this.modal.close();
+                               }).bind(this));
+                               
                                this.modal.show();
                                
                                var $codeBox = $('#redactorCodeBox').focus();