r73550 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73549‎ | r73550 | r73551 >
Date:18:03, 22 September 2010
Author:tparscal
Status:ok
Tags:
Comment:
Fixed check for mediaWiki existance and removed additional unneeded wrapping in mediaWiki.loader.using calls as per comments on r73499.
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/ProtectionForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ProtectionForm.php
@@ -592,7 +592,7 @@
593593 $encOptions = Xml::encodeJsVar( $options );
594594
595595 $script .= "ProtectionForm.init($encOptions)";
596 - return Html::inlineScript( "if ( mediaWiki !== undefined ) { mediaWiki.loader.using( 'mediawiki.legacy.protect', function() { {$script} } ); }" );
 596+ return Html::inlineScript( "if ( window.mediaWiki ) { $script }" );
597597 }
598598
599599 /**
Index: trunk/phase3/includes/EditPage.php
@@ -2246,7 +2246,7 @@
22472247 }
22482248
22492249 $wgOut->addScript( Html::inlineScript(
2250 - "if ( mediaWiki !== undefined ) { $script }"
 2250+ "if ( window.mediaWiki ) { $script }"
22512251 ) );
22522252
22532253 $toolbar .= "\n</div>";
Index: trunk/phase3/includes/OutputPage.php
@@ -2381,7 +2381,7 @@
23822382 if ( $this->getModules() ) {
23832383 $modules = FormatJson::encode( $this->getModules() );
23842384 $scripts .= Html::inlineScript(
2385 - "if ( mediaWiki !== undefined ) { mediaWiki.loader.load( {$modules} ); mediaWiki.loader.go(); }"
 2385+ "if ( window.mediaWiki ) { mediaWiki.loader.load( {$modules} ); mediaWiki.loader.go(); }"
23862386 ) . "\n";
23872387 }
23882388

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r73499Removed unneeded mediaWiki.loader.using wrapper which got the old toolbar wor...tparscal00:05, 22 September 2010

Status & tagging log