From: Alexander Ebert Date: Wed, 8 Jun 2016 11:41:39 +0000 (+0200) Subject: WYSIWYG template sync X-Git-Tag: 3.0.0_Beta_1~1485 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7d753078b3c2b8386c668e047396d51e77b97e89;p=GitHub%2FWoltLab%2FWCF.git WYSIWYG template sync --- diff --git a/wcfsetup/install/files/acp/templates/header.tpl b/wcfsetup/install/files/acp/templates/header.tpl index dac2e7efe6..9c1f603679 100644 --- a/wcfsetup/install/files/acp/templates/header.tpl +++ b/wcfsetup/install/files/acp/templates/header.tpl @@ -65,6 +65,7 @@ '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}', @@ -82,6 +83,7 @@ 'wcf.global.form.error.greaterThan': '{lang __literal=true}wcf.global.form.error.greaterThan{/lang}', 'wcf.global.form.error.lessThan': '{lang __literal=true}wcf.global.form.error.lessThan{/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}', diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index d7fbcb59fb..1d058ab782 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -36,8 +36,20 @@ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/combined.min.js?v={@LAST_UPDATE_TIME}' {/if} ], function () { - require(['WoltLab/WCF/Ui/Redactor/Metacode'], function(UiRedactorMetacode) { - var buttons = [], buttonOptions = []; + 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 = [], customButtons = []; {include file='wysiwygToolbar'} // TODO: Should the media stuff be here? @@ -73,7 +85,8 @@ toolbarFixed: false, woltlab: { autosave: autosave, - buttons: buttonOptions + buttons: buttonOptions, + customButtons: customButtons } }; diff --git a/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl b/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl index ddd7aaa582..0a934062dc 100644 --- a/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl @@ -11,12 +11,11 @@ buttonOptions = { table: { icon: 'fa-table', title: '{lang}wcf.editor.button.table{/lang}' }, underline: { icon: 'fa-underline', title: '{lang}wcf.editor.button.underline{/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}' }, woltlabQuote: { icon: 'fa-comment', title: '{lang}wcf.editor.button.quote{/lang}' }, woltlabSize: { icon: 'fa-text-height', title: '{lang}wcf.editor.button.size{/lang}' } }; - -buttons = []; buttons.push('html'); @@ -46,11 +45,9 @@ buttons.push('alignment'); {if $__wcf->getBBCodeHandler()->isAvailableBBCode('url')} buttons.push('link'); {/if} -{* {if $__wcf->getBBCodeHandler()->isAvailableBBCode('img')} - buttons.push('image'); + buttons.push('woltlabImage'); {/if} -*} {if $__wcf->getBBCodeHandler()->isAvailableBBCode('table')} buttons.push('table'); {/if} @@ -59,3 +56,9 @@ buttons.push('wcfSeparator'); buttons.push('woltlabMedia'); buttons.push('woltlabQuote'); + +{foreach from=$__wcf->getBBCodeHandler()->getButtonBBCodes(true) item=__bbcode} + buttonOptions['{$__bbcode->bbcodeTag}'] = { icon: '{$__bbcode->wysiwygIcon}', title: '{lang}{$__bbcode->buttonLabel}{/lang}' }; + buttons.push('{$__bbcode->bbcodeTag}'); + customButtons.push('{$__bbcode->bbcodeTag}'); +{/foreach}