From 7d753078b3c2b8386c668e047396d51e77b97e89 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 8 Jun 2016 13:41:39 +0200 Subject: [PATCH] WYSIWYG template sync --- .../install/files/acp/templates/header.tpl | 2 ++ .../install/files/acp/templates/wysiwyg.tpl | 19 ++++++++++++++++--- .../files/acp/templates/wysiwygToolbar.tpl | 13 ++++++++----- 3 files changed, 26 insertions(+), 8 deletions(-) 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} -- 2.20.1