Remove disabling of max-len rule and fix violations
Change-Id: I39ec2e572e569a05c11929dd17241653abf954ef
This commit is contained in:
committed by
jenkins-bot
parent
4dc988f6b9
commit
e93e1bc845
@@ -6,8 +6,5 @@
|
|||||||
"globals": {
|
"globals": {
|
||||||
"mw": false,
|
"mw": false,
|
||||||
"OO": false
|
"OO": false
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"max-len": 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -655,19 +655,17 @@
|
|||||||
* modules.
|
* modules.
|
||||||
*/
|
*/
|
||||||
apply: function () {
|
apply: function () {
|
||||||
var displaySettings = this;
|
if ( !this.dirty ) {
|
||||||
|
|
||||||
if ( !displaySettings.dirty ) {
|
|
||||||
// No changes to save in this module.
|
// No changes to save in this module.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
displaySettings.$parent.setBusy( true );
|
this.$parent.setBusy( true );
|
||||||
// Save the preferences
|
// Save the preferences
|
||||||
mw.webfonts.preferences.save( function ( result ) {
|
mw.webfonts.preferences.save( function ( result ) {
|
||||||
var newWebfontsEnable, oldWebfontsEnable, webfontsEvent,
|
var newWebfontsEnable, oldWebfontsEnable, webfontsEvent,
|
||||||
newRegistry = mw.webfonts.preferences.registry,
|
newRegistry = mw.webfonts.preferences.registry,
|
||||||
oldRegistry = displaySettings.savedRegistry.registry,
|
oldRegistry = this.savedRegistry.registry,
|
||||||
newFonts = newRegistry.fonts || {},
|
newFonts = newRegistry.fonts || {},
|
||||||
oldFonts = oldRegistry.fonts || {};
|
oldFonts = oldRegistry.fonts || {};
|
||||||
|
|
||||||
@@ -684,25 +682,25 @@
|
|||||||
mw.hook( webfontsEvent ).fire( 'displaysettings' );
|
mw.hook( webfontsEvent ).fire( 'displaysettings' );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( newFonts[ displaySettings.uiLanguage ] !== oldFonts[ displaySettings.uiLanguage ] ) {
|
if ( newFonts[ this.uiLanguage ] !== oldFonts[ this.uiLanguage ] ) {
|
||||||
mw.hook( 'mw.uls.font.change' ).fire(
|
mw.hook( 'mw.uls.font.change' ).fire(
|
||||||
'interface', displaySettings.uiLanguage, newFonts[ displaySettings.uiLanguage ]
|
'interface', this.uiLanguage, newFonts[ this.uiLanguage ]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( newFonts[ displaySettings.contentLanguage ] !== oldFonts[ displaySettings.contentLanguage ] ) {
|
if ( newFonts[ this.contentLanguage ] !== oldFonts[ this.contentLanguage ] ) {
|
||||||
mw.hook( 'mw.uls.font.change' ).fire(
|
mw.hook( 'mw.uls.font.change' ).fire(
|
||||||
'content', displaySettings.contentLanguage, newFonts[ displaySettings.contentLanguage ]
|
'content', this.contentLanguage, newFonts[ this.contentLanguage ]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// closure for not losing the scope
|
// closure for not losing the scope
|
||||||
displaySettings.onSave( result );
|
this.onSave( result );
|
||||||
displaySettings.dirty = false;
|
this.dirty = false;
|
||||||
// Update the back-up preferences for the case of canceling
|
// Update the back-up preferences for the case of canceling
|
||||||
displaySettings.savedRegistry = $.extend( true, {}, mw.webfonts.preferences );
|
this.savedRegistry = $.extend( true, {}, mw.webfonts.preferences );
|
||||||
displaySettings.$parent.setBusy( false );
|
this.$parent.setBusy( false );
|
||||||
} );
|
}.bind( this ) );
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -272,47 +272,49 @@
|
|||||||
if ( !languagesettings.shown ) {
|
if ( !languagesettings.shown ) {
|
||||||
mw.hook( 'mw.uls.settings.open' ).fire( eventParams && eventParams.source || 'interlanguage' );
|
mw.hook( 'mw.uls.settings.open' ).fire( eventParams && eventParams.source || 'interlanguage' );
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Initialize the Language settings window
|
|
||||||
languageSettingsOptions = {
|
|
||||||
defaultModule: 'display',
|
|
||||||
onVisible: function () {
|
|
||||||
var caretRadius,
|
|
||||||
ulsTriggerHeight = this.$element.height(),
|
|
||||||
ulsTriggerWidth = this.$element[ 0 ].offsetWidth,
|
|
||||||
ulsTriggerOffset = this.$element.offset();
|
|
||||||
|
|
||||||
this.$window.addClass( 'callout' );
|
return;
|
||||||
|
|
||||||
// Same as border width in mixins.less, or near enough
|
|
||||||
caretRadius = 12;
|
|
||||||
|
|
||||||
if ( ulsTriggerOffset.left > $( window ).width() / 2 ) {
|
|
||||||
this.left = ulsTriggerOffset.left - this.$window.width() - caretRadius;
|
|
||||||
this.$window.removeClass( 'selector-left' ).addClass( 'selector-right' );
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.left = ulsTriggerOffset.left + ulsTriggerWidth + caretRadius;
|
|
||||||
this.$window.removeClass( 'selector-right' ).addClass( 'selector-left' );
|
|
||||||
}
|
|
||||||
|
|
||||||
// The top of the dialog is aligned in relation to
|
|
||||||
// the middle of the trigger, so that middle of the
|
|
||||||
// caret aligns with it. 16 is trigger icon height in pixels
|
|
||||||
this.top = ulsTriggerOffset.top +
|
|
||||||
( ulsTriggerHeight / 2 ) -
|
|
||||||
( caretRadius + 16 );
|
|
||||||
|
|
||||||
this.position();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
mw.loader.using( mw.uls.languageSettingsModules, function () {
|
|
||||||
$ulsTrigger.languagesettings( languageSettingsOptions ).click();
|
|
||||||
} );
|
|
||||||
|
|
||||||
e.stopPropagation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize the Language settings window
|
||||||
|
languageSettingsOptions = {
|
||||||
|
defaultModule: 'display',
|
||||||
|
onVisible: function () {
|
||||||
|
var caretRadius,
|
||||||
|
ulsTriggerHeight = this.$element.height(),
|
||||||
|
ulsTriggerWidth = this.$element[ 0 ].offsetWidth,
|
||||||
|
ulsTriggerOffset = this.$element.offset();
|
||||||
|
|
||||||
|
this.$window.addClass( 'callout' );
|
||||||
|
|
||||||
|
// Same as border width in mixins.less, or near enough
|
||||||
|
caretRadius = 12;
|
||||||
|
|
||||||
|
if ( ulsTriggerOffset.left > $( window ).width() / 2 ) {
|
||||||
|
this.left = ulsTriggerOffset.left - this.$window.width() - caretRadius;
|
||||||
|
this.$window.removeClass( 'selector-left' ).addClass( 'selector-right' );
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.left = ulsTriggerOffset.left + ulsTriggerWidth + caretRadius;
|
||||||
|
this.$window.removeClass( 'selector-right' ).addClass( 'selector-left' );
|
||||||
|
}
|
||||||
|
|
||||||
|
// The top of the dialog is aligned in relation to
|
||||||
|
// the middle of the trigger, so that middle of the
|
||||||
|
// caret aligns with it. 16 is trigger icon height in pixels
|
||||||
|
this.top = ulsTriggerOffset.top +
|
||||||
|
( ulsTriggerHeight / 2 ) -
|
||||||
|
( caretRadius + 16 );
|
||||||
|
|
||||||
|
this.position();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mw.loader.using( mw.uls.languageSettingsModules, function () {
|
||||||
|
$ulsTrigger.languagesettings( languageSettingsOptions ).click();
|
||||||
|
} );
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
};
|
};
|
||||||
} else if ( anonMode ) {
|
} else if ( anonMode ) {
|
||||||
clickHandler = function ( e, eventParams ) {
|
clickHandler = function ( e, eventParams ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user