Expanded the contents of a function that was immediately called.
authorTrevor Parscal <tparscal@users.mediawiki.org>
Fri, 13 May 2011 14:30:53 +0000 (14:30 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Fri, 13 May 2011 14:30:53 +0000 (14:30 +0000)
resources/mediawiki/mediawiki.js

index 3ceafc2..939fdc6 100644 (file)
@@ -979,22 +979,19 @@ window.mediaWiki = new ( function( $ ) {
                                // include modules which are already loaded
                                batch = [];
                                // Asynchronously append a script tag to the end of the body
-                               var getScriptTag = function() {
-                                       var html = '';
-                                       for ( var r = 0; r < requests.length; r++ ) {
-                                               requests[r] = sortQuery( requests[r] );
-                                               // Build out the HTML
-                                               var src = mw.config.get( 'wgLoadScript' ) + '?' + $.param( requests[r] );
-                                               html += mw.html.element( 'script',
-                                                       { type: 'text/javascript', src: src }, '' );
-                                       }
-                                       return html;
-                               };
+                               var html = '';
+                               for ( var r = 0; r < requests.length; r++ ) {
+                                       requests[r] = sortQuery( requests[r] );
+                                       // Build out the HTML
+                                       var src = mw.config.get( 'wgLoadScript' ) + '?' + $.param( requests[r] );
+                                       html += mw.html.element( 'script',
+                                               { 'type': 'text/javascript', 'src': src }, '' );
+                               }
                                // Load asynchronously after documument ready
                                if ( ready ) {
-                                       setTimeout( function() { $( 'body' ).append( getScriptTag() ); }, 0 );
+                                       setTimeout( function() { $( 'body' ).append( html ); }, 0 );
                                } else {
-                                       document.write( getScriptTag() );
+                                       document.write( html );
                                }
                        }
                };