Cleanup for jslint and coding conventions
Change-Id: I6884759d9622220721840f44220648dce7838ff6
This commit is contained in:
@@ -314,7 +314,8 @@
|
|||||||
* @param target String 'ui' or 'content'
|
* @param target String 'ui' or 'content'
|
||||||
*/
|
*/
|
||||||
prepareFontSelector: function ( target ) {
|
prepareFontSelector: function ( target ) {
|
||||||
var language, fonts, $fontSelector, savedFont, $systemFont, $fontLabel, $fontsSection;
|
var language, fonts, $fontSelector, savedFont,
|
||||||
|
$systemFont, $fontLabel, $fontsSection;
|
||||||
|
|
||||||
// Get the language code from the right property -
|
// Get the language code from the right property -
|
||||||
// uiLanguage or contentLanguage
|
// uiLanguage or contentLanguage
|
||||||
@@ -347,8 +348,10 @@
|
|||||||
|
|
||||||
savedFont = mw.webfonts.preferences.getFont( this.uiLanguage );
|
savedFont = mw.webfonts.preferences.getFont( this.uiLanguage );
|
||||||
$.each( fonts, function ( key, font ) {
|
$.each( fonts, function ( key, font ) {
|
||||||
|
var $fontOption;
|
||||||
|
|
||||||
if ( font !== 'system' ) {
|
if ( font !== 'system' ) {
|
||||||
var $fontOption = $( '<option>' ).attr( 'value', font ).text( font );
|
$fontOption = $( '<option>' ).attr( 'value', font ).text( font );
|
||||||
$fontSelector.append( $fontOption );
|
$fontSelector.append( $fontOption );
|
||||||
$fontOption.attr( 'selected', savedFont === font );
|
$fontOption.attr( 'selected', savedFont === font );
|
||||||
}
|
}
|
||||||
@@ -477,21 +480,24 @@
|
|||||||
|
|
||||||
$uiFontSelector.on( 'change', function () {
|
$uiFontSelector.on( 'change', function () {
|
||||||
displaySettings.enableApplyButton();
|
displaySettings.enableApplyButton();
|
||||||
var font = $( this ).find( 'option:selected' ).val();
|
|
||||||
mw.webfonts.preferences.setFont( displaySettings.uiLanguage, font );
|
mw.webfonts.preferences.setFont( displaySettings.uiLanguage,
|
||||||
|
$( this ).find( 'option:selected' ).val()
|
||||||
|
);
|
||||||
displaySettings.$webfonts.refresh();
|
displaySettings.$webfonts.refresh();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$contentFontSelector.on( 'change', function () {
|
$contentFontSelector.on( 'change', function () {
|
||||||
displaySettings.enableApplyButton();
|
displaySettings.enableApplyButton();
|
||||||
var font = $( this ).find( 'option:selected' ).val();
|
|
||||||
mw.webfonts.preferences.setFont( displaySettings.contentLanguage, font );
|
mw.webfonts.preferences.setFont( displaySettings.contentLanguage,
|
||||||
|
$( this ).find( 'option:selected' ).val()
|
||||||
|
);
|
||||||
displaySettings.$webfonts.refresh();
|
displaySettings.$webfonts.refresh();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$tabButtons.on( 'click', function () {
|
$tabButtons.on( 'click', function () {
|
||||||
var $subPanels,
|
var $button = $( this );
|
||||||
$button = $( this );
|
|
||||||
|
|
||||||
if ( $button.hasClass( 'down' ) ) {
|
if ( $button.hasClass( 'down' ) ) {
|
||||||
return;
|
return;
|
||||||
@@ -547,9 +553,7 @@
|
|||||||
if ( this.uiLanguage !== this.getUILanguage() ) {
|
if ( this.uiLanguage !== this.getUILanguage() ) {
|
||||||
mw.uls.changeLanguage( this.uiLanguage );
|
mw.uls.changeLanguage( this.uiLanguage );
|
||||||
}
|
}
|
||||||
} else {
|
} // @todo What to do in case of failure?
|
||||||
// FIXME failure. what to do?!
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user