From: Alexander Ebert Date: Sun, 28 Aug 2016 16:19:44 +0000 (+0200) Subject: Added undo/redo buttons X-Git-Tag: 3.0.0_Beta_1~431 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2f322a963556e24eaf43aa4ba4621355fdbe4b0c;p=GitHub%2FWoltLab%2FWCF.git Added undo/redo buttons --- diff --git a/com.woltlab.wcf/templates/wysiwygToolbar.tpl b/com.woltlab.wcf/templates/wysiwygToolbar.tpl index 1df0449ed0..b091b8b734 100644 --- a/com.woltlab.wcf/templates/wysiwygToolbar.tpl +++ b/com.woltlab.wcf/templates/wysiwygToolbar.tpl @@ -7,10 +7,12 @@ buttonOptions = { italic: { icon: 'fa-italic', title: '{lang}wcf.editor.button.italic{/lang}' }, link: { icon: 'fa-link', title: '{lang}wcf.editor.button.link{/lang}' }, lists: { icon: 'fa-list', title: '{lang}wcf.editor.button.lists{/lang}' }, + redo: { icon: 'fa-repeat', title: '{lang}wcf.editor.button.redo{/lang}' }, subscript: { icon: 'fa-subscript', title: '{lang}wcf.editor.button.subscript{/lang}' }, superscript: { icon: 'fa-superscript', title: '{lang}wcf.editor.button.superscript{/lang}' }, table: { icon: 'fa-table', title: '{lang}wcf.editor.button.table{/lang}' }, underline: { icon: 'fa-underline', title: '{lang}wcf.editor.button.underline{/lang}' }, + undo: { icon: 'fa-undo', title: '{lang}wcf.editor.button.undo{/lang}' }, woltlabColor: { icon: 'fa-paint-brush', title: '{lang}wcf.editor.button.color{/lang}' }, woltlabImage: { icon: 'fa-picture-o', title: '{lang}wcf.editor.button.image{/lang}' }, woltlabMedia: { icon: 'fa-file-o', title: '{lang}wcf.editor.button.media{/lang}' }, @@ -21,6 +23,8 @@ buttonOptions = { buttonMobile = ['format', 'bold', 'italic', 'underline', 'alignment', 'link', 'woltlabImage', 'woltlabMedia']; buttons.push('html'); +buttons.push('undo'); +buttons.push('redo'); buttons.push('wcfSeparator'); diff --git a/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl b/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl index 1df0449ed0..b091b8b734 100644 --- a/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl @@ -7,10 +7,12 @@ buttonOptions = { italic: { icon: 'fa-italic', title: '{lang}wcf.editor.button.italic{/lang}' }, link: { icon: 'fa-link', title: '{lang}wcf.editor.button.link{/lang}' }, lists: { icon: 'fa-list', title: '{lang}wcf.editor.button.lists{/lang}' }, + redo: { icon: 'fa-repeat', title: '{lang}wcf.editor.button.redo{/lang}' }, subscript: { icon: 'fa-subscript', title: '{lang}wcf.editor.button.subscript{/lang}' }, superscript: { icon: 'fa-superscript', title: '{lang}wcf.editor.button.superscript{/lang}' }, table: { icon: 'fa-table', title: '{lang}wcf.editor.button.table{/lang}' }, underline: { icon: 'fa-underline', title: '{lang}wcf.editor.button.underline{/lang}' }, + undo: { icon: 'fa-undo', title: '{lang}wcf.editor.button.undo{/lang}' }, woltlabColor: { icon: 'fa-paint-brush', title: '{lang}wcf.editor.button.color{/lang}' }, woltlabImage: { icon: 'fa-picture-o', title: '{lang}wcf.editor.button.image{/lang}' }, woltlabMedia: { icon: 'fa-file-o', title: '{lang}wcf.editor.button.media{/lang}' }, @@ -21,6 +23,8 @@ buttonOptions = { buttonMobile = ['format', 'bold', 'italic', 'underline', 'alignment', 'link', 'woltlabImage', 'woltlabMedia']; buttons.push('html'); +buttons.push('undo'); +buttons.push('redo'); buttons.push('wcfSeparator'); diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js index 11ad487a0b..27aca9d697 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js @@ -32,12 +32,22 @@ $.Redactor.prototype.WoltLabButton = function() { //noinspection JSUnresolvedVariable buttonData = this.opts.woltlab.buttons[buttonName]; - if (buttonName === 'subscript' || buttonName === 'superscript') { - button = this.button.addAfter(this.opts.buttons[i - 1], buttonName, ''); - this.button.setEvent(button, buttonName, { func: 'inline.format' }); - } - else { - button = this.button.get(buttonName); + switch (buttonName) { + case 'subscript': + case 'superscript': + button = this.button.addAfter(this.opts.buttons[i - 1], buttonName, ''); + this.button.setEvent(button, buttonName, { func: 'inline.format' }); + break; + + case 'redo': + case 'undo': + button = this.button.addAfter(this.opts.buttons[i - 1], buttonName, ''); + this.button.addCallback(button, this.buffer[buttonName]); + break; + + default: + button = this.button.get(buttonName); + break; } // set icon diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index c2f4fb42e5..3e30596f94 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2278,6 +2278,7 @@ Fehler sind beispielsweise: + @@ -2286,6 +2287,7 @@ Fehler sind beispielsweise: + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 92e39fec06..4b67625772 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2245,6 +2245,7 @@ Errors are: + @@ -2253,6 +2254,7 @@ Errors are: +