Index: branches/resourceloader/phase3/includes/ProtectionForm.php |
— | — | @@ -508,8 +508,8 @@ |
509 | 509 | } |
510 | 510 | |
511 | 511 | if ( !$this->disabled ) { |
512 | | - $out .= Xml::closeElement( 'form' ) . |
513 | | - $this->buildCleanupScript(); |
| 512 | + $out .= Xml::closeElement( 'form' ); |
| 513 | + $wgOut->addScript( $this->buildCleanupScript() ); |
514 | 514 | } |
515 | 515 | |
516 | 516 | return $out; |
— | — | @@ -592,7 +592,7 @@ |
593 | 593 | $encOptions = Xml::encodeJsVar( $options ); |
594 | 594 | |
595 | 595 | $script .= "ProtectionForm.init($encOptions)"; |
596 | | - return Html::inlineScript( $script ); |
| 596 | + return Html::inlineScript( "mediaWiki.loader.using( 'mediawiki.legacy.protect', function() { {$script} } );" ); |
597 | 597 | } |
598 | 598 | |
599 | 599 | /** |