http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72169

Revision: 72169
Author:   tparscal
Date:     2010-09-01 22:28:34 +0000 (Wed, 01 Sep 2010)

Log Message:
-----------
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: branches/resourceloader/phase3/includes/ProtectionForm.php
===================================================================
--- branches/resourceloader/phase3/includes/ProtectionForm.php  2010-09-01 
22:21:43 UTC (rev 72168)
+++ branches/resourceloader/phase3/includes/ProtectionForm.php  2010-09-01 
22:28:34 UTC (rev 72169)
@@ -508,8 +508,8 @@
                }
 
                if ( !$this->disabled ) {
-                       $out .= Xml::closeElement( 'form' ) .
-                               $this->buildCleanupScript();
+                       $out .= Xml::closeElement( 'form' );
+                       $wgOut->addScript( $this->buildCleanupScript() );
                }
 
                return $out;
@@ -592,7 +592,7 @@
                $encOptions = Xml::encodeJsVar( $options );
 
                $script .= "ProtectionForm.init($encOptions)";
-               return Html::inlineScript( $script );
+               return Html::inlineScript( "mediaWiki.loader.using( 
'mediawiki.legacy.protect', function() { {$script} } );" );
        }
 
        /**



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to