From fd5ad32869773a71f641e30f4633765699403eaf Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Wed, 22 Sep 2010 18:03:29 +0000 Subject: [PATCH] Fixed check for mediaWiki existance and removed additional unneeded wrapping in mediaWiki.loader.using calls as per comments on r73499. --- includes/EditPage.php | 2 +- includes/OutputPage.php | 2 +- includes/ProtectionForm.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index f027ba6bdf..50d97fde5b 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2246,7 +2246,7 @@ HTML } $wgOut->addScript( Html::inlineScript( - "if ( mediaWiki !== undefined ) { $script }" + "if ( window.mediaWiki ) { $script }" ) ); $toolbar .= "\n"; diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 9dc9baffdd..4a9c25e21f 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2381,7 +2381,7 @@ class OutputPage { if ( $this->getModules() ) { $modules = FormatJson::encode( $this->getModules() ); $scripts .= Html::inlineScript( - "if ( mediaWiki !== undefined ) { mediaWiki.loader.load( {$modules} ); mediaWiki.loader.go(); }" + "if ( window.mediaWiki ) { mediaWiki.loader.load( {$modules} ); mediaWiki.loader.go(); }" ) . "\n"; } diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 807cdc2f71..3272cfef13 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -592,7 +592,7 @@ class ProtectionForm { $encOptions = Xml::encodeJsVar( $options ); $script .= "ProtectionForm.init($encOptions)"; - return Html::inlineScript( "if ( mediaWiki !== undefined ) { mediaWiki.loader.using( 'mediawiki.legacy.protect', function() { {$script} } ); }" ); + return Html::inlineScript( "if ( window.mediaWiki ) { $script }" ); } /** -- 2.20.1