r86548 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86547‎ | r86548 | r86549 >
Date:20:45, 20 April 2011
Author:krinkle
Status:ok (Comments)
Tags:
Comment:
bug 28413: Fix IE problems with self-closing link-elements in .innerHTML. Using { attributes } instead so jQuery will use document.createElement instead of innerHTML. See also bug 28413 comments
Modified paths:
  • /trunk/phase3/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki/mediawiki.js
@@ -1028,9 +1028,11 @@
10291029 // Support adding arbitrary external scripts
10301030 if ( modules.substr( 0, 7 ) == 'http://' || modules.substr( 0, 8 ) == 'https://' ) {
10311031 if ( type === 'text/css' ) {
1032 - $( 'head' )
1033 - .append( $( '<link rel="stylesheet" type="text/css" />' )
1034 - .attr( 'href', modules ) );
 1032+ $( 'head' ).append( $( '<link />', {
 1033+ rel: 'stylesheet',
 1034+ type: 'text/css',
 1035+ href: modules
 1036+ } ) );
10351037 return true;
10361038 } else if ( type === 'text/javascript' || typeof type === 'undefined' ) {
10371039 var script = mediaWiki.html.element( 'script',
@@ -1206,6 +1208,10 @@
12071209
12081210 } )( jQuery );
12091211
 1212+// Alias $j to jQuery for backwards compatibility
 1213+window.$j = jQuery;
 1214+window.mw = mediaWiki;
 1215+
12101216 /* Auto-register from pre-loaded startup scripts */
12111217
12121218 if ( $.isFunction( startUp ) ) {
@@ -1214,8 +1220,4 @@
12151221 }
12161222
12171223 // Add jQuery Cookie to initial payload (used in mediaWiki.user)
1218 -mediaWiki.loader.load( 'jquery.cookie' );
1219 -
1220 -// Alias $j to jQuery for backwards compatibility
1221 -window.$j = jQuery;
1222 -window.mw = mediaWiki;
 1224+mw.loader.load( 'jquery.cookie' );

Comments

#Comment by Krinkle (talk | contribs)   20:48, 20 April 2011

Not in the summary:

Moved definition of alias higher up. (intented for a seperate commit). During debugging locally and hacking stuff in the startup function I noticed these aliases weren't always available. Fixed now.

Status & tagging log