From: Michael Dale Date: Wed, 30 Sep 2009 14:00:56 +0000 (+0000) Subject: * restored script order per r56746#c4198 X-Git-Tag: 1.31.0-rc.0~39465 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=f7354fdb37011212855357d2b3af202822003d8f;p=lhc%2Fweb%2Fwiklou.git * restored script order per r56746#c4198 --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 99724de59b..6811a3c486 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -172,8 +172,8 @@ class OutputPage { */ function addCoreScripts2Top(){ global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, $wgScriptPath, $wgEnableJS2system; - global $wgUseSiteJs, $wgUser, $wgJsMimeType; - // @todo We should deprecate wikibits in favor of mv_embed and jQuery + global $wgUser, $wgJsMimeType; + // @todo We should deprecate wikibits in favor of some mv_embed pieces and jQuery if( $wgEnableJS2system ){ $core_classes = array( 'window.jQuery', 'mv_embed', 'wikibits' ); @@ -195,17 +195,6 @@ class OutputPage { $this->addScriptClass( $js_class ); } } - - $sk = $wgUser->getSkin(); - //add site js: - if( $wgUseSiteJs ) { - $jsCache = $wgUser->isLoggedIn() ? '&smaxage=0' : ''; - $this->addScriptFile( Skin::makeUrl( '-', - "action=raw$jsCache&gen=js&useskin=" . - urlencode( $sk->getSkinName() ) - ) - ); - } //now re-append any scripts that got added prior to the addCoreScripts2Top call $this->mScripts = $this->mScripts . $postScripts; } @@ -1787,10 +1776,21 @@ class OutputPage { * also adds userjs to the end if enabled: */ function getHeadScripts( Skin $sk ) { - global $wgUser, $wgRequest, $wgJsMimeType; + global $wgUser, $wgRequest, $wgJsMimeType, $wgUseSiteJs; $vars = Skin::makeGlobalVariablesScript( $sk->getSkinName() ); + //add site JS if enabled: + if( $wgUseSiteJs ) { + $sk = $wgUser->getSkin(); + $jsCache = $wgUser->isLoggedIn() ? '&smaxage=0' : ''; + $this->addScriptFile( Skin::makeUrl( '-', + "action=raw$jsCache&gen=js&useskin=" . + urlencode( $sk->getSkinName() ) + ) + ); + } + //add user js if enabled: if( $this->isUserJsAllowed() && $wgUser->isLoggedIn() ) { $action = $wgRequest->getVal( 'action', 'view' );