Fixed button titles for non-core buttons
authorAlexander Ebert <ebert@woltlab.com>
Tue, 14 Oct 2014 19:36:15 +0000 (21:36 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 14 Oct 2014 19:36:15 +0000 (21:36 +0200)
com.woltlab.wcf/templates/wysiwyg.tpl
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 1281dd3d01e153585ab7551e29f83ab7eb46ce0a..5375c3d4c70793959f4623592dc830d9e25acf09 100644 (file)
@@ -9,8 +9,11 @@ $(function() {
        WCF.Language.addObject({
                'wcf.attachment.dragAndDrop.dropHere': '{lang}wcf.attachment.dragAndDrop.dropHere{/lang}',
                'wcf.attachment.dragAndDrop.dropNow': '{lang}wcf.attachment.dragAndDrop.dropNow{/lang}',
+               'wcf.bbcode.button.fontColor': '{lang}wcf.bbcode.button.fontColor{/lang}',
                'wcf.bbcode.button.fontFamily': '{lang}wcf.bbcode.button.fontFamily{/lang}',
                'wcf.bbcode.button.fontSize': '{lang}wcf.bbcode.button.fontSize{/lang}',
+               'wcf.bbcode.button.subscript': '{lang}wcf.bbcode.button.subscript{/lang}',
+               'wcf.bbcode.button.superscript': '{lang}wcf.bbcode.button.superscript{/lang}',
                'wcf.bbcode.quote.edit': '{lang}wcf.bbcode.quote.edit{/lang}',
                'wcf.bbcode.quote.edit.author': '{lang}wcf.bbcode.quote.edit.author{/lang}',
                'wcf.bbcode.quote.edit.link': '{lang}wcf.bbcode.quote.edit.link{/lang}',
index 15f8a98389f60a543d9f3aa3e6f41fe9cf624954..d15d772d5808eceb98fdb75921fa90298c891481 100644 (file)
@@ -47,6 +47,14 @@ RedactorPlugins.wbutton = function() {
                                'table': 'fa-table'
                        };
                        
+                       var $buttonTitles = {
+                               'fontcolor': WCF.Language.get('wcf.bbcode.button.fontColor'),
+                               'fontfamily': WCF.Language.get('wcf.bbcode.button.fontFamily'),
+                               'fontsize': WCF.Language.get('wcf.bbcode.button.fontSize'),
+                               'subscript': WCF.Language.get('wcf.bbcode.button.subscript'),
+                               'superscript': WCF.Language.get('wcf.bbcode.button.superscript')
+                       };
+                       
                        var $buttons = this.wutil.getOption('buttons');
                        var $lastButton = '';
                        for (var $i = 0, $length = $buttons.length; $i < $length; $i++) {
@@ -65,7 +73,7 @@ RedactorPlugins.wbutton = function() {
                                        }
                                }
                                else {
-                                       this.wbutton._addCoreButton($button, ($faIcons[$button] ? $faIcons[$button] : null), $lastButton);
+                                       this.wbutton._addCoreButton($button, ($buttonTitles[$button] ? $buttonTitles[$button] : null), ($faIcons[$button] ? $faIcons[$button] : null), $lastButton);
                                }
                                
                                $lastButton = $button;
@@ -75,8 +83,8 @@ RedactorPlugins.wbutton = function() {
                        this.button.addCallback(this.button.get('image'), $.proxy(this.wbutton.insertImage, this));
                },
                
-               _addCoreButton: function(buttonName, faIcon, insertAfter) {
-                       var $buttonObj = { title: buttonName };
+               _addCoreButton: function(buttonName, buttonTitle, faIcon, insertAfter) {
+                       var $buttonObj = { title: (buttonTitle === null ? buttonName : buttonTitle) };
                        if (buttonName === 'subscript' || buttonName === 'superscript') {
                                $buttonObj.command = buttonName;
                        }
index 1c000e04ebfacc09e0db2e2b2f232674eae7fed6..ec0339cd840e0d77f40370c5c488eef70d40ae15 100644 (file)
@@ -1738,12 +1738,15 @@ Erlaubte Dateiendungen: {', '|implode:$attachmentHandler->getFormattedAllowedExt
        
        <category name="wcf.bbcode">
                <item name="wcf.bbcode.button.code"><![CDATA[Code]]></item>
+               <item name="wcf.bbcode.button.fontColor"><![CDATA[Schriftfarbe]]></item>
                <item name="wcf.bbcode.button.fontFamily"><![CDATA[Schriftart]]></item>
                <item name="wcf.bbcode.button.fontSize"><![CDATA[Schriftgröße]]></item>
                <item name="wcf.bbcode.button.inlineCode"><![CDATA[Inline-Code]]></item>
                <item name="wcf.bbcode.button.quote"><![CDATA[Zitat]]></item>
                <item name="wcf.bbcode.button.showAll"><![CDATA[Alles anzeigen]]></item>
                <item name="wcf.bbcode.button.spoiler"><![CDATA[Spoiler]]></item>
+               <item name="wcf.bbcode.button.subscript"><![CDATA[Tiefgestellt]]></item>
+               <item name="wcf.bbcode.button.superscript"><![CDATA[Hochgestellt]]></item>
                <item name="wcf.bbcode.code.text"><![CDATA[{@$highlighterTitle} ({#$lines} Zeile{if $lines != 1}n{/if})]]></item>
                <item name="wcf.bbcode.code.bash.title"><![CDATA[Shell-Script]]></item>
                <item name="wcf.bbcode.code.brainfuck.title"><![CDATA[Brainfuck-Quellcode]]></item>
index f63a4e5837293adb6c80238c1dbeb066010faa38..a9601ba75a365dfcf76fd1ed07046bcefc7ccaaf 100644 (file)
@@ -1736,12 +1736,15 @@ Allowed extensions: {', '|implode:$attachmentHandler->getFormattedAllowedExtensi
        
        <category name="wcf.bbcode">
                <item name="wcf.bbcode.button.code"><![CDATA[Code]]></item>
+               <item name="wcf.bbcode.button.fontColor"><![CDATA[Font Color]]></item>
                <item name="wcf.bbcode.button.fontFamily"><![CDATA[Font Family]]></item>
                <item name="wcf.bbcode.button.fontSize"><![CDATA[Font Size]]></item>
                <item name="wcf.bbcode.button.inlineCode"><![CDATA[Inline-Code]]></item>
                <item name="wcf.bbcode.button.quote"><![CDATA[Quote]]></item>
                <item name="wcf.bbcode.button.showAll"><![CDATA[Show All]]></item>
                <item name="wcf.bbcode.button.spoiler"><![CDATA[Spoiler]]></item>
+               <item name="wcf.bbcode.button.subscript"><![CDATA[Subscript]]></item>
+               <item name="wcf.bbcode.button.superscript"><![CDATA[Superscript]]></item>
                <item name="wcf.bbcode.code.text"><![CDATA[{@$highlighterTitle} ({#$lines} line{if $lines != 1}s{/if})]]></item>
                <item name="wcf.bbcode.code.bash.title"><![CDATA[Shell-Script]]></item>
                <item name="wcf.bbcode.code.brainfuck.title"><![CDATA[Brainfuck Source Code]]></item>