From fffbbc144ddeb3c3be4d37baa9211132e66e2b4d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 4 Jun 2014 14:59:55 +0200 Subject: [PATCH] Changed JavaScript execution order This way we ensure that specific JavaScript modifications to the DOM (e.g. relative time or TabMenus) are executed as early as possible. Tests have shown that there is no more flicker caused by the time conversion or building the TabMenu, in general the related JavaScript is executed earlier (reduction by ~20%) The impact on mobile devices is low and the small delay due to earlier loading of certain JavaScript files trades for a better user-experience, especially on small screens the "jumping" of content due to initial DOM manipulations was pretty lame. Affected DOM manipulations: - Relative Timestamps - Dropdowns (e.g. mobile navigation) - Tab Menus - Flexible Tab Menus (hiding tabs in a dropdown to prevent scrolling/overflow, depends on Dropdowns) --- com.woltlab.wcf/templates/headInclude.tpl | 203 +++++++++++----------- 1 file changed, 104 insertions(+), 99 deletions(-) diff --git a/com.woltlab.wcf/templates/headInclude.tpl b/com.woltlab.wcf/templates/headInclude.tpl index ef500d988d..556cd39168 100644 --- a/com.woltlab.wcf/templates/headInclude.tpl +++ b/com.woltlab.wcf/templates/headInclude.tpl @@ -6,7 +6,7 @@ {implode from=$__wcf->getMetaTagHandler() item=__metaTag glue="\n"}{@$__metaTag}{/implode} {event name='metaTags'} - {if JQUERY_SOURCE == 'google'} - - + + {elseif JQUERY_SOURCE == 'microsoft'} - - + + {elseif JQUERY_SOURCE == 'cloudflare'} - - + + {else} - - + + {/if} {if JQUERY_SOURCE != 'local'} - {/if} - - + + + + +{if ENABLE_DEBUG_MODE} + +{else} + +{/if} + + {if ENABLE_DEBUG_MODE} - @@ -57,16 +146,8 @@ -{else} - {/if} - - {event name='javascriptInclude'} @@ -92,81 +173,6 @@