* Fixed mistake made in r74271 where some functions were moved from core jquery.wikiE...
authorTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 5 Oct 2010 20:54:38 +0000 (20:54 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 5 Oct 2010 20:54:38 +0000 (20:54 +0000)
* Also fixed IE bug, where "delete window.myThing;" fails but "delete myThing;" succeeds.

includes/ResourceLoaderModule.php
resources/mediawiki/mediawiki.js
resources/startup.js

index a87f83a..22ab727 100644 (file)
@@ -1123,11 +1123,11 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        // Startup function
                        $configuration = FormatJson::encode( $this->getConfig( $context ) );
                        $registrations = self::getModuleRegistrations( $context );
-                       $out .= "window.startUp = function() {\n\t$registrations\n\tmediaWiki.config.set( $configuration );\n};";
+                       $out .= "var startUp = function() {\n\t$registrations\n\tmediaWiki.config.set( $configuration );\n};";
                        
                        // Conditional script injection
                        $scriptTag = Xml::escapeJsString( Html::linkedScript( $wgLoadScript . '?' . wfArrayToCGI( $query ) ) );
-                       $out .= "if ( isCompatible() ) {\n\tdocument.write( '$scriptTag' );\n}\ndelete window['isCompatible'];";
+                       $out .= "if ( isCompatible() ) {\n\tdocument.write( '$scriptTag' );\n}\ndelete isCompatible;";
                }
 
                return $out;
index 0c4422a..8d4e03a 100644 (file)
@@ -758,10 +758,9 @@ window.mediaWiki = new ( function( $ ) {
        
 } )( jQuery );
 
-
 /* Auto-register from pre-loaded startup scripts */
 
-if ( typeof window['startUp'] === 'function' ) {
-       window['startUp']();
-       delete window['startUp'];
+if ( typeof startUp === 'function' ) {
+       startUp();
+       delete startUp;
 }
\ No newline at end of file
index 93dd75e..4ae8791 100644 (file)
@@ -14,7 +14,7 @@
  * * Opera 9+
  * * Chrome 1+
  */
-window.isCompatible = function() {
+var isCompatible = function() {
        // IE < 6
        if ( navigator.appVersion.indexOf( 'MSIE' ) !== -1 && parseFloat( navigator.appVersion.split( 'MSIE' )[1] ) < 6 ) {
                return false;