r109453 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109452‎ | r109453 | r109454 >
Date:23:16, 18 January 2012
Author:amire80
Status:ok
Tags:
Comment:
Whitespace and comments.
Modified paths:
  • /trunk/extensions/WebFonts/resources/ext.webfonts.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WebFonts/resources/ext.webfonts.js
@@ -13,6 +13,7 @@
1414 config: { fonts: {}, languages: {} },
1515 version: '0.1.2',
1616 fonts : [],
 17+
1718 set: function( font ) {
1819 if ( !font || font === 'none' ) {
1920 mw.webfonts.reset();
@@ -48,7 +49,7 @@
4950 mw.webfonts.normalize( config.normalization );
5051 } );
5152 }
52 - // Store the font choise in cookie
 53+ // Store the font choice in cookie
5354 $.cookie( 'webfonts-font', font, { 'path': '/', 'expires': 30 } );
5455
5556 // If we had reset the fonts for tags with lang attribute, apply the fonts again.
@@ -167,6 +168,7 @@
168169 return false;
169170 }
170171 }
 172+
171173 return true;
172174 },
173175
@@ -179,7 +181,7 @@
180182 if ( navigator.appName === 'Microsoft Internet Explorer' ) {
181183 var ua = navigator.userAgent;
182184 if ( /MSIE 6/i.test( ua ) ) {
183 - // IE6 has not font fallbacks
 185+ // IE6 doesn't have font fallbacks
184186 return;
185187 } else if ( /MSIE 8/i.test( ua ) && /Windows NT 5.1/i.test( ua ) ) {
186188 // IE8 on XP has occasional gibberish bug
@@ -189,8 +191,8 @@
190192
191193 var fonts = [],
192194 languages = mw.webfonts.config.languages,
193 - requested = [mw.config.get( 'wgUserVariant' ), mw.config.get( 'wgContentLanguage' ),
194 - mw.config.get( 'wgUserLanguage' ), mw.config.get( 'wgPageContentLanguage' )],
 195+ requested = [ mw.config.get( 'wgUserVariant' ), mw.config.get( 'wgContentLanguage' ),
 196+ mw.config.get( 'wgUserLanguage' ), mw.config.get( 'wgPageContentLanguage' ) ],
195197 i, j;
196198
197199 for ( i = 0; i < requested.length; i++ ) {
@@ -246,7 +248,7 @@
247249 mw.config.get( 'wgUserLanguage' ), mw.config.get( 'wgPageContentLanguage' )];
248250 var fontFamily = false;
249251 // Find elements with the lang attribute.
250 - $( 'body' ).find( '*[lang]' ).each( function( i, el) {
 252+ $( 'body' ).find( '*[lang]' ).each( function( i, el ) {
251253 // If the lang attribute value is same as one of
252254 // contentLang,useLang, variant, no need to do this.
253255 if( $.inArray( el.lang , requested ) === -1 ) {

Sign-offs

UserFlagDate
Nikerabbitinspected09:23, 19 January 2012
Nikerabbittested09:23, 19 January 2012

Status & tagging log