r56527 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56526‎ | r56527 | r56528 >
Date:15:35, 17 September 2009
Author:dale
Status:ok
Tags:
Comment:
* adds $wgEnableJS2system check for $wgUseAJAXCategories (since it uses some js2 calls loadGM)
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -199,7 +199,7 @@
200200 */
201201 function addScriptClass( $js_class ){
202202 global $wgDebugJavaScript, $wgJSAutoloadLocalClasses, $wgJSAutoloadClasses,
203 - $wgEnableScriptLoader, $wgStyleVersion, $wgScriptPath;
 203+ $wgEnableScriptLoader, $wgStyleVersion, $wgScriptPath, $wgEnableJS2system;
204204
205205 $path = jsScriptLoader::getJsPathFromClass( $js_class );
206206 if( $path !== false ){
@@ -214,10 +214,12 @@
215215 $urlAppend = ( $wgDebugJavaScript ) ? time() : $this->getURIDparam( $js_class );
216216 $this->addScript( Html::linkedScript( "$path?$urlAppend" ) );
217217
218 - //merge in language text:
219 - $inlineMsg = jsScriptLoader::getLocalizedMsgsFromClass( $js_class );
220 - if( $inlineMsg != '' )
221 - $this->addScript( Html::inlineScript( $inlineMsg ));
 218+ //merge in language text (if js2 is on and we have loadGM function)
 219+ if( $wgEnableJS2system == true ){
 220+ $inlineMsg = jsScriptLoader::getLocalizedMsgsFromClass( $js_class );
 221+ if( $inlineMsg != '' )
 222+ $this->addScript( Html::inlineScript( $inlineMsg ));
 223+ }
222224 }
223225 return true;
224226 }
@@ -1158,8 +1160,8 @@
11591161 $this->addScriptFile( 'rightclickedit.js' );
11601162 }
11611163
1162 - global $wgUseAJAXCategories;
1163 - if ($wgUseAJAXCategories) {
 1164+ global $wgUseAJAXCategories, $wgEnableJS2system;
 1165+ if ($wgUseAJAXCategories && $wgEnableJS2system) {
11641166 global $wgAJAXCategoriesNamespaces;
11651167
11661168 $title = $this->getTitle();

Status & tagging log