'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}',
'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}',
'{@$__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'}
// 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
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');
if (image.classList.contains('woltlabAttachment')) {
elRemove(elById('redactor-image-source-container'));
}
- };
+ }).bind(this);
var mpUpdate = this.image.update;
this.image.update = (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>'
+ '<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 */
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) {
<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>
<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">
<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>
<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>
<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">