From e3cbf45f1742cfafb4a97465de6c6727e3ca369f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 17 Apr 2014 16:03:32 +0200 Subject: [PATCH] Combining redactor plugins into a single, compressed file Right now there are 8 plugins so far, this would normally cause 8 HTTP requests just to fetch them or check if the cached file is still up-to-date. Since it does not matter in which order these plugins are fetched (the editor executes them at a later point in the correct order), we can safely combine them into a single, compressed file. This saves us 7 requests. Glorious! --- com.woltlab.wcf/templates/wysiwyg.tpl | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index c721a908b8..84705c8af2 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -74,15 +74,19 @@ $(function() { head.load([ '{@$__wcf->getPath()}js/WCF.Attachment{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}', - '{@$__wcf->getPath()}js/3rdParty/redactor/redactor.js', - '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wbbcode.js', - '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wbutton.js', - '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wfontcolor.js', - '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wfontfamily.js', - '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wfontsize.js', - '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wmonkeypatch.js', - '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wutil.js', - '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wupload.js' + '{@$__wcf->getPath()}js/3rdParty/redactor/redactor{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}', + {if !ENABLE_DEBUG_MODE} + '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wcombined.min.js?v={@$__wcfVersion}', + {else} + '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wbbcode.js?v={@$__wcfVersion}', + '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wbutton.js?v={@$__wcfVersion}', + '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wfontcolor.js?v={@$__wcfVersion}', + '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wfontfamily.js?v={@$__wcfVersion}', + '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wfontsize.js?v={@$__wcfVersion}', + '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wmonkeypatch.js?v={@$__wcfVersion}', + '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wutil.js?v={@$__wcfVersion}', + '{@$__wcf->getPath()}js/3rdParty/redactor/plugins/wupload.js?v={@$__wcfVersion}' + {/if} {event name='javascriptFiles'} ], function() { WCF.System.Dependency.Manager.invoke($callbackIdentifier); -- 2.20.1