Added missing phrases for image editing
authorAlexander Ebert <ebert@woltlab.com>
Wed, 8 Jun 2016 09:52:00 +0000 (11:52 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 8 Jun 2016 09:52:07 +0000 (11:52 +0200)
com.woltlab.wcf/templates/headIncludeJavaScript.tpl
com.woltlab.wcf/templates/wysiwyg.tpl
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabImage.js
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index d116a23805f0ce23fe6c34347af5a19f63aeabd2..148c700d93c56d2c06d92ac991ed1edc65b24856 100644 (file)
@@ -50,6 +50,7 @@ requirejs.config({
                        'wcf.global.button.edit': '{lang}wcf.global.button.edit{/lang}',
                        'wcf.global.button.enable': '{lang}wcf.global.button.enable{/lang}',
                        'wcf.global.button.hide': '{lang}wcf.global.button.hide{/lang}',
+                       'wcf.global.button.insert': '{lang}wcf.global.button.insert{/lang}',
                        'wcf.global.button.next': '{lang}wcf.global.button.next{/lang}',
                        'wcf.global.button.preview': '{lang}wcf.global.button.preview{/lang}',
                        'wcf.global.button.reset': '{lang}wcf.global.button.reset{/lang}',
@@ -69,6 +70,7 @@ requirejs.config({
                        'wcf.global.form.error.multilingual': '{lang}wcf.global.form.error.multilingual{/lang}',
                        'wcf.global.language.noSelection': '{lang}wcf.global.language.noSelection{/lang}',
                        'wcf.global.loading': '{lang}wcf.global.loading{/lang}',
+                       'wcf.global.noSelection': '{lang}wcf.global.noSelection{/lang}',
                        'wcf.global.page.jumpTo': '{lang}wcf.global.page.jumpTo{/lang}',
                        'wcf.global.page.jumpTo.description': '{lang}wcf.global.page.jumpTo.description{/lang}',
                        'wcf.global.page.pagination': '{lang}wcf.global.page.pagination{/lang}',
index d7fbcb59fbf764c3f8c3a19f60ce1ff8912d95cd..9b58e60cfc278cd50e7b524abedbef5d14078692 100644 (file)
                        '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/combined.min.js?v={@LAST_UPDATE_TIME}'
                {/if}
        ], function () {
-               require(['WoltLab/WCF/Ui/Redactor/Metacode'], function(UiRedactorMetacode) {
+               require(['Language', 'WoltLab/WCF/Ui/Redactor/Metacode'], function(Language, UiRedactorMetacode) {
+                       Language.addObject({
+                               'wcf.editor.image.edit': '{lang}wcf.editor.image.edit{/lang}',
+                               'wcf.editor.image.insert': '{lang}wcf.editor.image.insert{/lang}',
+                               'wcf.editor.image.link': '{lang}wcf.editor.image.link{/lang}',
+                               'wcf.editor.image.link.error.invalid': '{lang}wcf.editor.image.link.error.invalid{/lang}',
+                               'wcf.editor.image.float': '{lang}wcf.editor.image.float{/lang}',
+                               'wcf.editor.image.float.left': '{lang}wcf.editor.image.float.left{/lang}',
+                               'wcf.editor.image.float.right': '{lang}wcf.editor.image.float.right{/lang}',
+                               'wcf.editor.image.source': '{lang}wcf.editor.image.source{/lang}',
+                               'wcf.editor.image.source.error.invalid': '{lang}wcf.editor.image.source.error.invalid{/lang}'
+                       });
+                       
                        var buttons = [], buttonOptions = [];
                        {include file='wysiwygToolbar'}
                        
index c9001d31bb96c5090f407a3c7bf42fdcb89d0865..1e537f65fde65428be16d9d3000851be3261fd02 100644 (file)
@@ -9,7 +9,7 @@ $.Redactor.prototype.WoltLabImage = function() {
                        // add support for image source when editing
                        // TODO: float
                        var mpShowEdit = this.image.showEdit;
-                       this.image.showEdit = function($image) {
+                       this.image.showEdit = (function($image) {
                                var image = $image[0];
                                if (image.classList.contains('smiley')) {
                                        // smilies cannot be edited
@@ -18,6 +18,11 @@ $.Redactor.prototype.WoltLabImage = function() {
                                
                                mpShowEdit($image);
                                
+                               // enforce title and button labels
+                               this.modal.setTitle(WCF.Language.get('wcf.editor.image.edit'));
+                               this.modal.getActionButton().text(WCF.Language.get('wcf.global.button.save'));
+                               this.modal.getDeleteButton().text(WCF.Language.get('wcf.global.button.delete'));
+                               
                                elById('redactor-image-source').value = image.src;
                                
                                var float = elById('redactor-image-float');
@@ -28,7 +33,7 @@ $.Redactor.prototype.WoltLabImage = function() {
                                if (image.classList.contains('woltlabAttachment')) {
                                        elRemove(elById('redactor-image-source-container'));
                                }
-                       };
+                       }).bind(this);
                        
                        var mpUpdate = this.image.update;
                        this.image.update = (function() {
@@ -74,17 +79,11 @@ $.Redactor.prototype.WoltLabImage = function() {
                        this.opts.modal['image-edit'] = '<div class="section">'
                                        + '<dl id="redactor-image-source-container">'
                                                + '<dt><label for="redactor-image-source">' + WCF.Language.get('wcf.editor.image.source') + '</label></dt>'
-                                               + '<dd>'
-                                                       + '<input type="text" id="redactor-image-source" class="long">'
-                                                       + '<small>' + WCF.Language.get('wcf.editor.image.source.description') + '</small>'
-                                               + '</dd>'
+                                               + '<dd><input type="text" id="redactor-image-source" class="long"></dd>'
                                        + '</dl>'
                                        + '<dl>'
                                                + '<dt><label for="redactor-image-link">' + WCF.Language.get('wcf.editor.image.link') + '</label></dt>'
-                                               + '<dd>'
-                                                       + '<input type="text" id="redactor-image-link" class="long">'
-                                                       + '<small>' + WCF.Language.get('wcf.editor.image.link.description') + '</small>'
-                                               + '</dd>'
+                                               + '<dd><input type="text" id="redactor-image-link" class="long"></dd>'
                                        + '</dl>'
                                        + '<dl>'
                                                + '<dt><label for="redactor-image-float">' + WCF.Language.get('wcf.editor.image.float') + '</label></dt>'
@@ -94,7 +93,6 @@ $.Redactor.prototype.WoltLabImage = function() {
                                                                + '<option value="left">' + WCF.Language.get('wcf.editor.image.float.left') + '</option>'
                                                                + '<option value="right">' + WCF.Language.get('wcf.editor.image.float.right') + '</option>'
                                                        + '</select>'
-                                                       + '<small>' + WCF.Language.get('wcf.editor.image.float.description') + '</small>'
                                                + '</dd>'
                                        + '</dl>'
                                        + '<input id="redactor-image-title" style="display: none">' /* dummy because redactor expects it to be present */
@@ -111,8 +109,9 @@ $.Redactor.prototype.WoltLabImage = function() {
                        this.modal.show();
                        
                        this.modal.getDeleteButton().hide();
-                       var button = this.modal.getActionButton();
-                       button[0].addEventListener(WCF_CLICK_EVENT, this.WoltLabImage.insert);
+                       var button = this.modal.getActionButton()[0];
+                       button.addEventListener(WCF_CLICK_EVENT, this.WoltLabImage.insert);
+                       button.textContent = WCF.Language.get('wcf.global.button.insert');
                },
                
                insert: function(event) {
index 8b1f50a184f7c219d643d65919c505c826b6d097..149a61656880d955a5e73393f98dc641b748e454 100644 (file)
@@ -2116,6 +2116,7 @@ Fehler sind beispielsweise:
                <item name="wcf.editor.button.bold"><![CDATA[Fett]]></item>
                <item name="wcf.editor.button.color"><![CDATA[Schriftfarbe]]></item>
                <item name="wcf.editor.button.html"><![CDATA[HTML]]></item>
+               <item name="wcf.editor.button.image"><![CDATA[Bild]]></item>
                <item name="wcf.editor.button.italic"><![CDATA[Kursiv]]></item>
                <item name="wcf.editor.button.link"><![CDATA[Link]]></item>
                <item name="wcf.editor.button.lists"><![CDATA[Liste]]></item>
@@ -2127,6 +2128,16 @@ Fehler sind beispielsweise:
                <item name="wcf.editor.button.superscript"><![CDATA[Hochgestellt]]></item>
                <item name="wcf.editor.button.table"><![CDATA[Tabelle]]></item>
                <item name="wcf.editor.button.underline"><![CDATA[Unterstrichen]]></item>
+               
+               <item name="wcf.editor.image.edit"><![CDATA[Bild bearbeiten]]></item>
+               <item name="wcf.editor.image.insert"><![CDATA[Bild einfügen]]></item>
+               <item name="wcf.editor.image.link"><![CDATA[Verlinkung]]></item>
+               <item name="wcf.editor.image.link.error.invalid"><![CDATA[Der eingegebene Link ist ungültig.]]></item>
+               <item name="wcf.editor.image.float"><![CDATA[Textumfluss]]></item>
+               <item name="wcf.editor.image.float.left"><![CDATA[Links]]></item>
+               <item name="wcf.editor.image.float.right"><![CDATA[Rechts]]></item>
+               <item name="wcf.editor.image.source"><![CDATA[Quelle]]></item>
+               <item name="wcf.editor.image.source.error.invalid"><![CDATA[Der eingegebene Link ist ungültig.]]></item>
        </category>
        
        <category name="wcf.global">
@@ -2143,6 +2154,7 @@ Fehler sind beispielsweise:
                <item name="wcf.global.button.enable"><![CDATA[Aktivieren]]></item>
                <item name="wcf.global.button.fullscreen"><![CDATA[Vollbildmodus]]></item>
                <item name="wcf.global.button.hide"><![CDATA[Ausblenden]]></item>
+               <item name="wcf.global.button.insert"><![CDATA[Einfügen]]></item>
                <item name="wcf.global.button.next"><![CDATA[Weiter »]]></item>
                <item name="wcf.global.button.preview"><![CDATA[Vorschau]]></item>
                <item name="wcf.global.button.refresh"><![CDATA[Aktualisieren]]></item>
index a95ecf5d853b3f74efcbf300dcb3b8c72b061399..c6dd700b31a64e49dbffd3e435e3a25cf28ee8a4 100644 (file)
@@ -2127,6 +2127,7 @@ Errors are:
                <item name="wcf.editor.button.bold"><![CDATA[Bold]]></item>
                <item name="wcf.editor.button.color"><![CDATA[Font Color]]></item>
                <item name="wcf.editor.button.html"><![CDATA[HTML]]></item>
+               <item name="wcf.editor.button.image"><![CDATA[Image]]></item>
                <item name="wcf.editor.button.italic"><![CDATA[Italic]]></item>
                <item name="wcf.editor.button.link"><![CDATA[Link]]></item>
                <item name="wcf.editor.button.lists"><![CDATA[List]]></item>
@@ -2138,6 +2139,16 @@ Errors are:
                <item name="wcf.editor.button.superscript"><![CDATA[Superscript]]></item>
                <item name="wcf.editor.button.table"><![CDATA[Table]]></item>
                <item name="wcf.editor.button.underline"><![CDATA[Underline]]></item>
+               
+               <item name="wcf.editor.image.edit"><![CDATA[Edit Image]]></item>
+               <item name="wcf.editor.image.insert"><![CDATA[Insert Image]]></item>
+               <item name="wcf.editor.image.link"><![CDATA[Link]]></item>
+               <item name="wcf.editor.image.link.error.invalid"><![CDATA[You have entered an invalid link.]]></item>
+               <item name="wcf.editor.image.float"><![CDATA[Float]]></item>
+               <item name="wcf.editor.image.float.left"><![CDATA[Left]]></item>
+               <item name="wcf.editor.image.float.right"><![CDATA[Right]]></item>
+               <item name="wcf.editor.image.source"><![CDATA[Source]]></item>
+               <item name="wcf.editor.image.source.error.invalid"><![CDATA[You have entered an invalid link.]]></item>
        </category>
        
        <category name="wcf.global">