View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0013285 | mantisbt | performance | public | 2011-09-01 19:05 | 2015-09-11 11:29 |
Reporter | carpii | Assigned To | syncguru | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.3.0-beta.1 | ||||
Target Version | 1.3.0-beta.3 | Fixed in Version | 1.3.0-beta.3 | ||
Summary | 0013285: Move script inclusions from HEAD to document footer | ||||
Description | Since mantis imports jquery and jquery.ui in via HEAD, this causes the browser to block until both scripts have been downloaded and parsed By moving all scripts from the HEAD tag into the document footer, this creates a dramatic improvement on the perceived rendering time of all mantis pages. I have done testing with this, and believe it causes no side effects since $document.ready() takes care of it I have attached a git patch, sorry Im unable to submit a proper pull request | ||||
Tags | patch | ||||
Attached Files | head_to_toe.txt (2,105 bytes)
From 2eb0e00209bed4960a29ca2bf66aa7b063f6354e Mon Sep 17 00:00:00 2001 From: Carpii <p.chapman.uk@gmail.com> Date: Thu, 1 Sep 2011 23:34:12 +0100 Subject: [PATCH] Move scripts to document footer instead of head, dramatically improves percieved rendering time --- core/html_api.php | 27 ++++++++++++++++----------- 1 files changed, 16 insertions(+), 11 deletions(-) diff --git a/core/html_api.php b/core/html_api.php index 66a946d..152c88f 100644 --- a/core/html_api.php +++ b/core/html_api.php @@ -419,17 +419,8 @@ function require_js( $p_script_path ) { * @return null */ function html_head_javascript() { - if ( config_get( 'use_javascript' ) ) { - global $g_scripts_included; - echo "\t<script type=\"text/javascript\" src=\"" . helper_mantis_url( 'javascript_config.php' ) . '"></script>' . "\n"; - echo "\t<script type=\"text/javascript\" src=\"" . helper_mantis_url( 'javascript_translations.php' ) . '"></script>' . "\n"; - html_javascript_link( 'jquery.js' ); - html_javascript_link( 'jquery-ui.js' ); - html_javascript_link( 'common.js' ); - foreach ( $g_scripts_included as $t_script_path ) { - html_javascript_link( $t_script_path ); - } - } + // 2011/09/01.CARP - Move javascript inclusions into html_body_end() + return; } /** @@ -690,6 +681,20 @@ function html_footer( $p_file = null ) { * @return null */ function html_body_end() { + + // 2011/09/01.CARP - move selected javascripts out of HEAD and into bottom of document + if ( config_get( 'use_javascript' ) ) { + global $g_scripts_included; + echo "\t<script type=\"text/javascript\" src=\"" . helper_mantis_url( 'javascript_config.php' ) . '"></script>' . "\n"; + echo "\t<script type=\"text/javascript\" src=\"" . helper_mantis_url( 'javascript_translations.php' ) . '"></script>' . "\n"; + html_javascript_link( 'jquery.js' ); + html_javascript_link( 'jquery-ui.js' ); + html_javascript_link( 'common.js' ); + foreach ( $g_scripts_included as $t_script_path ) { + html_javascript_link( $t_script_path ); + } + } + event_signal( 'EVENT_LAYOUT_BODY_END' ); echo '</div>', "\n"; -- 1.7.6 | ||||
MantisBT: master 4a81ef15 2015-05-03 17:22 Committer: dregad Details Diff |
Move script inclusions from HEAD to document footer Fixes 0013285: Move script inclusions from HEAD to document footer |
Affected Issues 0013285 |
|
mod - core/html_api.php | Diff File | ||
MantisBT: master 8d7ea37e 2015-09-11 06:03 Details Diff |
Revert move-js-to-footer This change (see issue 0013282) introduced several regressions. This reverts commit 2dbc86b10d10495f1312b781fe0a3519a0d7152a, reversing changes made to aa9b4f8ad7908325633542840805c4c854adb1f1. Fixes 0020081, 0020088 |
Affected Issues 0013285, 0020081, 0020088 |
|
mod - core/html_api.php | Diff File |