From: Alexander Ebert Date: Mon, 20 Jun 2016 15:43:34 +0000 (+0200) Subject: Synchronized wysiwyg templates X-Git-Tag: 3.0.0_Beta_1~1384^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eb104f975813ec8de84cbcf3525d3ab86aedb243;p=GitHub%2FWoltLab%2FWCF.git Synchronized wysiwyg templates --- diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index 1d058ab782..9204e05974 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -19,18 +19,22 @@ {* WoltLab *} '{@$__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}', + '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabCode.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabColor.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabDropdown.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabEvent.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabImage.js?v={@LAST_UPDATE_TIME}', + '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabInlineCode.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabLink.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabMedia.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabMention.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabModal.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabQuote.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSize.js?v={@LAST_UPDATE_TIME}', - '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSmiley.js?v={@LAST_UPDATE_TIME}' + '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSmiley.js?v={@LAST_UPDATE_TIME}', + '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSpoiler.js?v={@LAST_UPDATE_TIME}' {else} '{@$__wcf->getPath()}js/3rdParty/redactor2/redactor.min.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/combined.min.js?v={@LAST_UPDATE_TIME}' @@ -38,6 +42,16 @@ ], function () { require(['Language', 'WoltLab/WCF/Ui/Redactor/Metacode'], function(Language, UiRedactorMetacode) { Language.addObject({ + 'wcf.editor.code.edit': '{lang}wcf.editor.code.edit{/lang}', + 'wcf.editor.code.file': '{lang}wcf.editor.code.file{/lang}', + 'wcf.editor.code.file.description': '{lang}wcf.editor.code.file.description{/lang}', + 'wcf.editor.code.highlighter': '{lang}wcf.editor.code.highlighter{/lang}', + 'wcf.editor.code.highlighter.description': '{lang}wcf.editor.code.highlighter.description{/lang}', + 'wcf.editor.code.highlighter.detect': '{lang}wcf.editor.code.highlighter.detect{/lang}', + 'wcf.editor.code.line': '{lang}wcf.editor.code.line{/lang}', + 'wcf.editor.code.line.description': '{lang}wcf.editor.code.line.description{/lang}', + 'wcf.editor.code.title': '{lang __literal=true}wcf.editor.code.title{/lang}', + '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}', @@ -46,12 +60,30 @@ '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}' + 'wcf.editor.image.source.error.invalid': '{lang}wcf.editor.image.source.error.invalid{/lang}', + + 'wcf.editor.link.add': '{lang}wcf.editor.link.add{/lang}', + 'wcf.editor.link.edit': '{lang}wcf.editor.link.edit{/lang}', + 'wcf.editor.link.url': '{lang}wcf.editor.link.url{/lang}', + 'wcf.editor.link.text': '{lang}wcf.editor.link.text{/lang}', + + 'wcf.editor.quote.author': '{lang}wcf.editor.quote.author{/lang}', + 'wcf.editor.quote.edit': '{lang}wcf.editor.quote.edit{/lang}', + 'wcf.editor.quote.title': '{lang __literal=true}wcf.editor.quote.title{/lang}', + 'wcf.editor.quote.url': '{lang}wcf.editor.quote.url{/lang}', + 'wcf.editor.quote.url.description': '{lang}wcf.editor.quote.url.description{/lang}', + + 'wcf.editor.spoiler.label': '{lang}wcf.editor.spoiler.label{/lang}', + 'wcf.editor.spoiler.label.description': '{lang}wcf.editor.spoiler.label.description{/lang}', + 'wcf.editor.spoiler.edit': '{lang}wcf.editor.spoiler.edit{/lang}', + 'wcf.editor.spoiler.title': '{lang __literal=true}wcf.editor.spoiler.title{/lang}' }); var buttons = [], buttonOptions = [], customButtons = []; {include file='wysiwygToolbar'} + var highlighters = { {implode from=$__wcf->getBBCodeHandler()->getHighlighters() item=__highlighter}'{$__highlighter}': '{lang}wcf.bbcode.code.{@$__highlighter}.title{/lang}'{/implode} }; + // TODO: Should the media stuff be here? {include file='mediaJavaScript'} @@ -65,28 +97,56 @@ var config = { buttons: buttons, + formatting: ['p', 'h2', 'h3', 'h4'], imageCaption: false, + lang: 'wsc', // fake language to offload phrases + langs: { + wsc: { + // formatting dropdown + heading2: '{lang}wcf.editor.format.heading2{/lang}', + heading3: '{lang}wcf.editor.format.heading3{/lang}', + heading4: '{lang}wcf.editor.format.heading4{/lang}', + paragraph: '{lang}wcf.editor.format.paragraph{/lang}', + + // table plugin + 'add-head': '{lang}wcf.editor.table.addHead{/lang}', + 'delete-column': '{lang}wcf.editor.table.deleteColumn{/lang}', + 'delete-head': '{lang}wcf.editor.table.deleteHead{/lang}', + 'delete-row': '{lang}wcf.editor.table.deleteRow{/lang}', + 'delete-table': '{lang}wcf.editor.table.deleteTable{/lang}', + 'insert-table': '{lang}wcf.editor.table.insertTable{/lang}', + 'insert-column-left': '{lang}wcf.editor.table.insertColumnLeft{/lang}', + 'insert-column-right': '{lang}wcf.editor.table.insertColumnRight{/lang}', + 'insert-row-above': '{lang}wcf.editor.table.insertRowAbove{/lang}', + 'insert-row-below': '{lang}wcf.editor.table.insertRowBelow{/lang}' + } + }, minHeight: 200, plugins: [ 'alignment', 'source', 'table', 'WoltLabAttachment', + 'WoltLabBlock', + 'WoltLabCode', 'WoltLabColor', 'WoltLabDropdown', 'WoltLabEvent', 'WoltLabImage', + 'WoltLabInlineCode', 'WoltLabLink', 'WoltLabModal', 'WoltLabQuote', 'WoltLabSize', - 'WoltLabSmiley' + 'WoltLabSmiley', + 'WoltLabSpoiler' ], toolbarFixed: false, woltlab: { autosave: autosave, buttons: buttonOptions, - customButtons: customButtons + customButtons: customButtons, + highlighters: highlighters } }; diff --git a/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl b/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl index 0a934062dc..d0f180fcbe 100644 --- a/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl @@ -2,6 +2,7 @@ buttonOptions = { alignment: { icon: 'fa-align-left', title: '{lang}wcf.editor.button.alignment{/lang}' }, bold: { icon: 'fa-bold', title: '{lang}wcf.editor.button.bold{/lang}' }, deleted: { icon: 'fa-strikethrough', title: '{lang}wcf.editor.button.strikethrough{/lang}' }, + format: { icon: 'fa-paragraph', title: '{lang}wcf.editor.button.format{/lang}' }, html: { icon: 'fa-code', title: '{lang}wcf.editor.button.html{/lang}' }, italic: { icon: 'fa-italic', title: '{lang}wcf.editor.button.italic{/lang}' }, link: { icon: 'fa-link', title: '{lang}wcf.editor.button.link{/lang}' }, @@ -21,6 +22,10 @@ buttons.push('html'); buttons.push('wcfSeparator'); +buttons.push('format'); + +buttons.push('wcfSeparator'); + buttons.push('bold'); buttons.push('italic'); buttons.push('underline');