From: Alexander Ebert Date: Fri, 26 Jun 2015 15:56:10 +0000 (+0200) Subject: Some minor fixes and optimizations X-Git-Tag: 3.0.0_Beta_1~2237 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a8160b8d39bda6c466a3be33e6d25de81e94cded;p=GitHub%2FWoltLab%2FWCF.git Some minor fixes and optimizations --- diff --git a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl index c600cd8de3..1d7e9be560 100644 --- a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl +++ b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl @@ -194,7 +194,7 @@ requirejs.config({ {/if} {* invoke background queue roughly every 10th request *} - if (Math.random().toString()[2] === '0') { + if (Math.random() < 0.1) { require(['Ajax'], function(Ajax) { // fire and forget background queue perform task Ajax.apiOnce({ diff --git a/wcfsetup/install/files/acp/templates/header.tpl b/wcfsetup/install/files/acp/templates/header.tpl index cf908d1528..679a5d61be 100644 --- a/wcfsetup/install/files/acp/templates/header.tpl +++ b/wcfsetup/install/files/acp/templates/header.tpl @@ -98,6 +98,12 @@ }); {js application='wcf' lib='jquery'} + + {js application='wcf' lib='jquery-ui'} {js application='wcf' lib='jquery-ui' file='touchPunch' bundle='WCF.Combined'} {js application='wcf' lib='jquery-ui' file='nestedSortable' bundle='WCF.Combined'} @@ -105,6 +111,7 @@ {js application='wcf' file='WCF' bundle='WCF.Combined'} {js application='wcf' acp='true' file='WCF.ACP'} diff --git a/wcfsetup/install/files/lib/system/template/plugin/JsFunctionTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/JsFunctionTemplatePlugin.class.php index 6091ac5cb2..3c1cd1a380 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/JsFunctionTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/JsFunctionTemplatePlugin.class.php @@ -73,11 +73,11 @@ class JsFunctionTemplatePlugin implements IFunctionTemplatePlugin { $src .= $tagArgs['file']; } - if (in_array($src, $this->includedFiles)) { + if (isset($this->includedFiles[$src])) { return ''; } - $this->includedFiles[] = $src; + $this->includedFiles[$src] = true; $src .= (!ENABLE_DEBUG_MODE ? '.min' : '') . '.js?v=' . LAST_UPDATE_TIME; $relocate = !RequestHandler::getInstance()->isACPRequest() && (!isset($tagArgs['core']) || $tagArgs['core'] !== 'true');