Synchronized wysiwyg templates
authorAlexander Ebert <ebert@woltlab.com>
Mon, 20 Jun 2016 15:43:34 +0000 (17:43 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 20 Jun 2016 15:43:34 +0000 (17:43 +0200)
wcfsetup/install/files/acp/templates/wysiwyg.tpl
wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl

index 1d058ab78287e7f4c6aff44f75802429676b3c71..9204e05974a5a9015a551cbc4cc1b387e6eb17a7 100644 (file)
                        
                        {* 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}'
        ], 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}',
                                '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'}
                        
                        
                        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
                                }
                        };
                        
index 0a934062dc6854f6e65081e528396a348edbef2b..d0f180fcbe51ec04214ad843bf7415e4e590588a 100644 (file)
@@ -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');