r72169 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72168‎ | r72169 | r72170 >
Date:22:28, 1 September 2010
Author:tparscal
Status:ok
Tags:
Comment:
Switched to using OutputPage to add script to document, rather than embedding arbitrarily within the body.
Modified paths:
  • /branches/resourceloader/phase3/includes/ProtectionForm.php (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/includes/ProtectionForm.php
@@ -508,8 +508,8 @@
509509 }
510510
511511 if ( !$this->disabled ) {
512 - $out .= Xml::closeElement( 'form' ) .
513 - $this->buildCleanupScript();
 512+ $out .= Xml::closeElement( 'form' );
 513+ $wgOut->addScript( $this->buildCleanupScript() );
514514 }
515515
516516 return $out;
@@ -592,7 +592,7 @@
593593 $encOptions = Xml::encodeJsVar( $options );
594594
595595 $script .= "ProtectionForm.init($encOptions)";
596 - return Html::inlineScript( $script );
 596+ return Html::inlineScript( "mediaWiki.loader.using( 'mediawiki.legacy.protect', function() { {$script} } );" );
597597 }
598598
599599 /**

Status & tagging log