From 0833c990e75fcc657de0b34d1e09a65a150a9e59 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Sat, 7 Feb 2015 19:34:21 +0000 Subject: [PATCH] Apply coding conventions for JavaScript Change-Id: Id158ac08d32cc7421e47ae6abdd2bd80879f04d9 --- resources/js/ext.uls.compactlinks.js | 2 +- resources/js/ext.uls.displaysettings.js | 2 +- resources/js/ext.uls.webfonts.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/js/ext.uls.compactlinks.js b/resources/js/ext.uls.compactlinks.js index fe06882e..20364f88 100644 --- a/resources/js/ext.uls.compactlinks.js +++ b/resources/js/ext.uls.compactlinks.js @@ -239,7 +239,7 @@ var assistantLanguages = mw.user.options.get( 'translate-editlangs' ); if ( assistantLanguages && assistantLanguages !== 'default' ) { - return $.grep( assistantLanguages.split(/,\s*/), function ( language ) { + return $.grep( assistantLanguages.split( /,\s*/ ), function ( language ) { return $.inArray( language, languages ) >= 0; } ); } diff --git a/resources/js/ext.uls.displaysettings.js b/resources/js/ext.uls.displaysettings.js index bf57aed4..3d90e05a 100644 --- a/resources/js/ext.uls.displaysettings.js +++ b/resources/js/ext.uls.displaysettings.js @@ -533,7 +533,7 @@ mw.webfonts.setup(); // Allow the webfonts library to finish loading - setTimeout( function() { + setTimeout( function () { displaySettings.$webfonts = $( 'body' ).data( 'webfonts' ); mw.webfonts.preferences.enable(); diff --git a/resources/js/ext.uls.webfonts.js b/resources/js/ext.uls.webfonts.js index 745549ae..f905f745 100644 --- a/resources/js/ext.uls.webfonts.js +++ b/resources/js/ext.uls.webfonts.js @@ -98,10 +98,10 @@ for ( index = 0; index < length; index++ ) { $fixture.text( text[index] ); - width[index] = $fixture.width() || width[index-1]; + width[index] = $fixture.width() || width[index - 1]; height[index] = $fixture.height(); - if( index > 0 && + if ( index > 0 && ( width[index] !== width[index - 1] || height[index] !== height[index - 1] ) ) { @@ -206,7 +206,7 @@ // Execute after task queue is processed so that the rendering is complete. // This is important because webfonts behavior depends on the font-family // property values set by stylesheets. - setTimeout( function() { + setTimeout( function () { $( 'body' ).webfonts(); // Load the CSS required for the Autonym font. Note that this won't download the font.