{/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({
});
</script>
{js application='wcf' lib='jquery'}
+
+ <script>
+ // prevent jQuery and other libraries from utilizing define()
+ __require_define_amd = define.amd;
+ define.amd = undefined;
+ </script>
{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'}
{js application='wcf' file='WCF' bundle='WCF.Combined'}
{js application='wcf' acp='true' file='WCF.ACP'}
<script>
+ define.amd = __require_define_amd;
$.holdReady(true);
WCF.User.init({$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}');
</script>
$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');