WYSIWYG template sync
authorAlexander Ebert <ebert@woltlab.com>
Wed, 8 Jun 2016 11:41:39 +0000 (13:41 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 8 Jun 2016 11:41:48 +0000 (13:41 +0200)
wcfsetup/install/files/acp/templates/header.tpl
wcfsetup/install/files/acp/templates/wysiwyg.tpl
wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl

index dac2e7efe6346596cdd2942786186a363b531795..9c1f60367910e51a5472f93cdb428c08e708d0a3 100644 (file)
@@ -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}',
index d7fbcb59fbf764c3f8c3a19f60ce1ff8912d95cd..1d058ab78287e7f4c6aff44f75802429676b3c71 100644 (file)
                        '{@$__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
                                }
                        };
                        
index ddd7aaa58270245ac21d473af99da0e4252ac518..0a934062dc6854f6e65081e528396a348edbef2b 100644 (file)
@@ -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}