bug 28413: Fix IE problems with self-closing link-elements in .innerHTML. Using ...
authorKrinkle <krinkle@users.mediawiki.org>
Wed, 20 Apr 2011 20:45:01 +0000 (20:45 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Wed, 20 Apr 2011 20:45:01 +0000 (20:45 +0000)
resources/mediawiki/mediawiki.js

index bf81dd7..a1b3261 100644 (file)
@@ -1028,9 +1028,11 @@ window.mediaWiki = new ( function( $ ) {
                                // Support adding arbitrary external scripts
                                if ( modules.substr( 0, 7 ) == 'http://' || modules.substr( 0, 8 ) == 'https://' ) {
                                        if ( type === 'text/css' ) {
-                                               $( 'head' )
-                                                       .append( $( '<link rel="stylesheet" type="text/css" />' )
-                                                       .attr( 'href', modules ) );
+                                               $( 'head' ).append( $( '<link />', {
+                                                       rel: 'stylesheet',
+                                                       type: 'text/css',
+                                                       href: modules
+                                               } ) );
                                                return true;
                                        } else if ( type === 'text/javascript' || typeof type === 'undefined' ) {
                                                var script = mediaWiki.html.element( 'script',
@@ -1206,6 +1208,10 @@ window.mediaWiki = new ( function( $ ) {
 
 } )( jQuery );
 
+// Alias $j to jQuery for backwards compatibility
+window.$j = jQuery;
+window.mw = mediaWiki;
+
 /* Auto-register from pre-loaded startup scripts */
 
 if ( $.isFunction( startUp ) ) {
@@ -1214,8 +1220,4 @@ if ( $.isFunction( startUp ) ) {
 }
 
 // Add jQuery Cookie to initial payload (used in mediaWiki.user)
-mediaWiki.loader.load( 'jquery.cookie' );
-
-// Alias $j to jQuery for backwards compatibility
-window.$j = jQuery;
-window.mw = mediaWiki;
+mw.loader.load( 'jquery.cookie' );