Added undo/redo buttons
authorAlexander Ebert <ebert@woltlab.com>
Mon, 2 Mar 2015 14:47:17 +0000 (15:47 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 2 Mar 2015 14:47:17 +0000 (15:47 +0100)
com.woltlab.wcf/templates/wysiwygToolbar.tpl
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js

index 5e9de08d8daccd79bf0a44001a2ce5b5bd348edb..6c2f63e17861f32114bfaa52160bf1dea6915971 100644 (file)
@@ -1,4 +1,5 @@
 $buttons.push('html');
+
 $buttons.push('separator');
 
 {if $__wcf->getBBCodeHandler()->isAvailableBBCode('b')}
index d4be6fbb2b07e6c84d84b779d1906da375962b67..a598ef99c127102879b59b7a5574fe30288eb100 100644 (file)
@@ -87,6 +87,14 @@ RedactorPlugins.wbutton = function() {
                        
                        // handle image insert
                        this.button.addCallback(this.button.get('image'), $.proxy(this.wbutton.insertImage, this));
+                       
+                       // handle redo/undo buttons
+                       var $undoButton = this.button.addAfter('html', 'undo', this.lang.get('undo'));
+                       var $redoButton = this.button.addAfter('undo', 'redo', this.lang.get('redo'));
+                       this.button.addCallback($undoButton, this.buffer.undo);
+                       this.button.addCallback($redoButton, this.buffer.redo);
+                       
+                       $redoButton.parent().addClass('separator');
                },
                
                /**