Fixed table plugin being always loaded
authorAlexander Ebert <ebert@woltlab.com>
Wed, 13 May 2015 14:58:13 +0000 (16:58 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 13 May 2015 14:58:13 +0000 (16:58 +0200)
com.woltlab.wcf/templates/wysiwyg.tpl

index 13e4297eb27785b737883edf17fda627368e960c..371ffbc7455d7d1638c942960b506f52087020b6 100644 (file)
@@ -71,7 +71,7 @@ $(function() {
                        lang: '{@$__wcf->getLanguage()->getFixedLanguageCode()}',
                        maxHeight: 500,
                        minHeight: 200,
-                       plugins: [ 'wutil', 'wmonkeypatch', 'table', 'wbutton', 'wbbcode', 'wfontcolor', 'wfontfamily', 'wfontsize' ],
+                       plugins: [ 'wutil', 'wmonkeypatch', 'wbutton', 'wbbcode', 'wfontcolor', 'wfontfamily', 'wfontsize' ],
                        removeEmpty: false,
                        replaceDivs: false,
                        source: true,
@@ -90,6 +90,10 @@ $(function() {
                        }
                };
                
+               {if $__wcf->getBBCodeHandler()->isAvailableBBCode('table')}
+                       $config.plugins.splice(2, 0, 'table');
+               {/if}
+               
                if ($.browser.iOS) {
                        // using a zero-width space breaks iOS' detection of the start of a sentence, causing the first word to be lowercased
                        $config.emptyHtml = '<p><br></p>';