From: Alexander Ebert Date: Tue, 21 Jun 2016 10:49:43 +0000 (+0200) Subject: Added support for text alignment justify X-Git-Tag: 3.0.0_Beta_1~1384^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=903a86239879adcbba370bb655e3cb77a0bd5960;p=GitHub%2FWoltLab%2FWCF.git Added support for text alignment justify --- diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 9204e05974..13d069435a 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -18,6 +18,7 @@ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/table.js?v={@LAST_UPDATE_TIME}', {* WoltLab *} + '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabAlignment.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabAttachment.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabBlock.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabButton.js?v={@LAST_UPDATE_TIME}', @@ -108,6 +109,11 @@ heading4: '{lang}wcf.editor.format.heading4{/lang}', paragraph: '{lang}wcf.editor.format.paragraph{/lang}', + 'align-center': '{lang}wcf.editor.alignment.center{/lang}', + 'align-justify': '{lang}wcf.editor.alignment.justify{/lang}', + 'align-left': '{lang}wcf.editor.alignment.left{/lang}', + 'align-right': '{lang}wcf.editor.alignment.right{/lang}', + // table plugin 'add-head': '{lang}wcf.editor.table.addHead{/lang}', 'delete-column': '{lang}wcf.editor.table.deleteColumn{/lang}', @@ -126,6 +132,7 @@ 'alignment', 'source', 'table', + 'WoltLabAlignment', 'WoltLabAttachment', 'WoltLabBlock', 'WoltLabCode', diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabAlignment.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabAlignment.js new file mode 100644 index 0000000000..ee709f0ecd --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabAlignment.js @@ -0,0 +1,25 @@ +$.Redactor.prototype.WoltLabAlignment = function() { + "use strict"; + + return { + init: function() { + var mpRemoveAlign = this.alignment.removeAlign; + this.alignment.removeAlign = (function() { + mpRemoveAlign.call(this); + + this.block.removeClass('text-justify'); + }).bind(this); + + var listItem = this.dropdown.buildItem('justify', { + title: this.lang.get('align-justify'), + func: (function () { + this.buffer.set(); + this.alignment.removeAlign(); + this.block.addClass('text-justify'); + }).bind(this) + }); + + listItem.appendTo(this.button.get('alignment').data('dropdown')); + } + } +}; diff --git a/wcfsetup/install/files/style/ui/redactor.scss b/wcfsetup/install/files/style/ui/redactor.scss index c00c63be94..1be821152e 100644 --- a/wcfsetup/install/files/style/ui/redactor.scss +++ b/wcfsetup/install/files/style/ui/redactor.scss @@ -388,6 +388,16 @@ text-align: right; } +/* alignment plugin / custom value */ +.text-justify { + text-align: justify; + + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; +} + /* text color */ .woltlab-color-000000 { color: #000000 !important; } .woltlab-color-000080 { color: #000080 !important; } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 26bba11465..9b4e9d7c68 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2116,6 +2116,11 @@ Fehler sind beispielsweise: + + + + + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 416500b49f..e6984fef66 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2127,6 +2127,11 @@ Errors are: + + + + +