r87978 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87977‎ | r87978 | r87979 >
Date:14:30, 13 May 2011
Author:tparscal
Status:ok
Tags:
Comment:
Expanded the contents of a function that was immediately called.
Modified paths:
  • /trunk/phase3/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki/mediawiki.js
@@ -979,22 +979,19 @@
980980 // include modules which are already loaded
981981 batch = [];
982982 // Asynchronously append a script tag to the end of the body
983 - var getScriptTag = function() {
984 - var html = '';
985 - for ( var r = 0; r < requests.length; r++ ) {
986 - requests[r] = sortQuery( requests[r] );
987 - // Build out the HTML
988 - var src = mw.config.get( 'wgLoadScript' ) + '?' + $.param( requests[r] );
989 - html += mw.html.element( 'script',
990 - { type: 'text/javascript', src: src }, '' );
991 - }
992 - return html;
993 - };
 983+ var html = '';
 984+ for ( var r = 0; r < requests.length; r++ ) {
 985+ requests[r] = sortQuery( requests[r] );
 986+ // Build out the HTML
 987+ var src = mw.config.get( 'wgLoadScript' ) + '?' + $.param( requests[r] );
 988+ html += mw.html.element( 'script',
 989+ { 'type': 'text/javascript', 'src': src }, '' );
 990+ }
994991 // Load asynchronously after documument ready
995992 if ( ready ) {
996 - setTimeout( function() { $( 'body' ).append( getScriptTag() ); }, 0 );
 993+ setTimeout( function() { $( 'body' ).append( html ); }, 0 );
997994 } else {
998 - document.write( getScriptTag() );
 995+ document.write( html );
999996 }
1000997 }
1001998 };

Status & tagging log