Index: trunk/extensions/WebFonts/resources/ext.webfonts.js |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | config: { fonts: {}, languages: {} }, |
15 | 15 | version: '0.1.2', |
16 | 16 | fonts : [], |
| 17 | + |
17 | 18 | set: function( font ) { |
18 | 19 | if ( !font || font === 'none' ) { |
19 | 20 | mw.webfonts.reset(); |
— | — | @@ -48,7 +49,7 @@ |
49 | 50 | mw.webfonts.normalize( config.normalization ); |
50 | 51 | } ); |
51 | 52 | } |
52 | | - // Store the font choise in cookie |
| 53 | + // Store the font choice in cookie |
53 | 54 | $.cookie( 'webfonts-font', font, { 'path': '/', 'expires': 30 } ); |
54 | 55 | |
55 | 56 | // If we had reset the fonts for tags with lang attribute, apply the fonts again. |
— | — | @@ -167,6 +168,7 @@ |
168 | 169 | return false; |
169 | 170 | } |
170 | 171 | } |
| 172 | + |
171 | 173 | return true; |
172 | 174 | }, |
173 | 175 | |
— | — | @@ -179,7 +181,7 @@ |
180 | 182 | if ( navigator.appName === 'Microsoft Internet Explorer' ) { |
181 | 183 | var ua = navigator.userAgent; |
182 | 184 | if ( /MSIE 6/i.test( ua ) ) { |
183 | | - // IE6 has not font fallbacks |
| 185 | + // IE6 doesn't have font fallbacks |
184 | 186 | return; |
185 | 187 | } else if ( /MSIE 8/i.test( ua ) && /Windows NT 5.1/i.test( ua ) ) { |
186 | 188 | // IE8 on XP has occasional gibberish bug |
— | — | @@ -189,8 +191,8 @@ |
190 | 192 | |
191 | 193 | var fonts = [], |
192 | 194 | 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' ) ], |
195 | 197 | i, j; |
196 | 198 | |
197 | 199 | for ( i = 0; i < requested.length; i++ ) { |
— | — | @@ -246,7 +248,7 @@ |
247 | 249 | mw.config.get( 'wgUserLanguage' ), mw.config.get( 'wgPageContentLanguage' )]; |
248 | 250 | var fontFamily = false; |
249 | 251 | // Find elements with the lang attribute. |
250 | | - $( 'body' ).find( '*[lang]' ).each( function( i, el) { |
| 252 | + $( 'body' ).find( '*[lang]' ).each( function( i, el ) { |
251 | 253 | // If the lang attribute value is same as one of |
252 | 254 | // contentLang,useLang, variant, no need to do this. |
253 | 255 | if( $.inArray( el.lang , requested ) === -1 ) { |