r106204 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106203‎ | r106204 | r106205 >
Date:15:24, 14 December 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/WebFonts/resources/ext.webfonts.fontlist.js (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/WebFonts/resources/ext.webfonts.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/WebFonts/resources/ext.webfonts.js
@@ -167,6 +167,18 @@
168168 * It also apply the font from cookie, if any.
169169 */
170170 setup: function() {
 171+ // Blacklist some browsers that are known to have issues with font rendering
 172+ if ( navigator.appName === 'Microsoft Internet Explorer' ) {
 173+ var ua = navigator.userAgent;
 174+ if ( /MSIE 6/i.test( ua ) ) {
 175+ // IE6 has not font fallbacks
 176+ return;
 177+ } else if ( /MSIE 8/i.test( ua ) && /Windows NT 5.1/i.test( ua ) ) {
 178+ // IE8 on XP has occasional gibberish bug
 179+ return;
 180+ }
 181+ }
 182+
171183 var config = [];
172184 var languages = mw.webfonts.config.languages;
173185 var requested = [mw.config.get( 'wgUserVariant' ), mw.config.get( 'wgContentLanguage' ), mw.config.get( 'wgUserLanguage' )];
@@ -262,12 +274,11 @@
263275 var haveSchemes = false;
264276 // Build font dropdown
265277 var $fontsMenu = $( '<ul>' ).attr( 'id', 'webfonts-fontsmenu' );
266 - $fontsMenu.delegate( 'input:radio', 'change', function( e ) {
 278+ $fontsMenu.delegate( 'input:radio', 'click', function( ) {
267279 mw.webfonts.set( $(this).val() );
268280 } );
269281 for ( var scheme in config ) {
270 - var $fontLink = $( '<input type="radio" />' )
271 - .attr( 'name', 'font' )
 282+ var $fontLink = $( '<input type="radio" name="font" />' )
272283 .attr( 'id', fontID( config[scheme] ) )
273284 .val( config[scheme] );
274285
@@ -292,8 +303,7 @@
293304 return null;
294305 }
295306
296 - var $resetLink = $( '<input type="radio" />' )
297 - .attr( 'name', 'font' )
 307+ var $resetLink = $( '<input type="radio" name="font"/>' )
298308 .attr( 'value', 'webfont-none' )
299309 .attr( 'id', 'webfont-none' )
300310 .click( function( e ) {
Index: branches/wmf/1.18wmf1/extensions/WebFonts/resources/ext.webfonts.fontlist.js
@@ -358,10 +358,10 @@
359359 bpy: [ "Lohit Bengali" ],
360360 cdo: [ "Charis SIL" ],
361361 fa: [ "Iranian Sans" ],
362 - gu: [ "Lohit Gujarati", "Samyak Gujarati" ],
 362+ gu: [ "Lohit Gujarati" ],
363363 hbo: [ "Taamey Frank CLM" ],
364364 he: [ "Miriam CLM", "Taamey Frank CLM" ],
365 - hi: [ "Lohit Devanagari", "Samyak Devanagari" ],
 365+ hi: [ "Lohit Devanagari" ],
366366 km: [ "KhmerOSbattambang", "KhmerOSsiemreap", "KhmerOS", "KhmerOSbokor",
367367 "KhmerOSmuollight", "KhmerOSmuol", "KhmerOSmuolpali",
368368 "KhmerOSfreehand", "KhmerOSfasthand" ],
@@ -370,12 +370,12 @@
371371 gom: [ "Lohit Devanagari" ],
372372 mai: [ "Lohit Devanagari" ],
373373 ml: [ "AnjaliOldLipi", "Meera", "RaghuMalayalam" ],
374 - mr: [ "Lohit Devanagari", "Samyak Devanagari" ],
 374+ mr: [ "Lohit Devanagari" ],
375375 my: [ "Masterpiece Uni Sans", "Padauk-Regular", "Myanmar3", "Yunghkio" ],
376376 ne: [ "Lohit Devanagari", "Madan" ],
377377 or: [ "Lohit Oriya" , "Utkal" ],
378378 pa: [ "Lohit Punjabi", "Saab" ],
379 - sa: [ "Lohit Devanagari", "Samyak Devanagari" ],
 379+ sa: [ "Lohit Devanagari" ],
380380 saz: [ "Pagul" ],
381381 ta: [ "Lohit Tamil", "Thendral", "Thenee" ],
382382 te: [ "Lohit Telugu", "Pothana2000", "Vemana2000" ],

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106172Blacklist IE6 and IE8&XP combos because of known issues with font renderingnikerabbit11:38, 14 December 2011
r106175Fixes: IE 6,7 does not allow name change of input:radio after it is created....santhosh11:53, 14 December 2011
r106179Samyak and Madan has problems, don't show them in the listnikerabbit12:29, 14 December 2011
r106191Correct r106179. Madan wasn't supposed to be hidden.siebrand13:37, 14 December 2011

Status & tagging log