Fix indentation and tweak comments a bit
Bug: 50859 Change-Id: Ic827e200674fb72b8b88e362bab30662cc13e304
This commit is contained in:
@@ -137,6 +137,7 @@
|
|||||||
|
|
||||||
if ( previousLang === currentLang ) {
|
if ( previousLang === currentLang ) {
|
||||||
$ulsTrigger.tipsy( { gravity: rtlPage ? 'e' : 'w' } );
|
$ulsTrigger.tipsy( { gravity: rtlPage ? 'e' : 'w' } );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,10 +225,10 @@
|
|||||||
|
|
||||||
$( document ).ready( function () {
|
$( document ).ready( function () {
|
||||||
mw.uls.init( function () {
|
mw.uls.init( function () {
|
||||||
var $ulsTrigger = $( '.uls-trigger' ),
|
var $ulsSettingsTrigger,
|
||||||
$ulsSettingsTrigger,
|
|
||||||
$pLang,
|
$pLang,
|
||||||
ulsOptions,
|
ulsOptions,
|
||||||
|
$ulsTrigger = $( '.uls-trigger' ),
|
||||||
rtlPage = $( 'body' ).hasClass( 'rtl' ),
|
rtlPage = $( 'body' ).hasClass( 'rtl' ),
|
||||||
anonMode = ( mw.user.isAnon() &&
|
anonMode = ( mw.user.isAnon() &&
|
||||||
!mw.config.get( 'wgULSAnonCanChangeLanguage' ) ),
|
!mw.config.get( 'wgULSAnonCanChangeLanguage' ) ),
|
||||||
@@ -240,15 +241,15 @@
|
|||||||
$ulsSettingsTrigger = $( '<span>' )
|
$ulsSettingsTrigger = $( '<span>' )
|
||||||
.addClass( 'uls-settings-trigger' )
|
.addClass( 'uls-settings-trigger' )
|
||||||
.attr( 'title', $.i18n( 'ext-uls-language-settings-title' ) );
|
.attr( 'title', $.i18n( 'ext-uls-language-settings-title' ) );
|
||||||
// Append ULS cog to languages section. But make sure it is visible.
|
// Append ULS cog to languages section, but make sure it is visible.
|
||||||
$pLang.show().prepend( $ulsSettingsTrigger );
|
$pLang.show().prepend( $ulsSettingsTrigger );
|
||||||
|
|
||||||
// Remove the dummy link that was added to make sure that the section appears
|
// Remove the dummy link, which was added to make sure that the section appears
|
||||||
$pLang.find( '.uls-p-lang-dummy' ).remove();
|
$pLang.find( '.uls-p-lang-dummy' ).remove();
|
||||||
|
|
||||||
if ( !$pLang.find( 'div ul' ).children().length ) {
|
if ( !$pLang.find( 'div ul' ).children().length ) {
|
||||||
// Replace the title of the interlanguage links
|
// Replace the title of the interlanguage links area
|
||||||
// area if there are no interlanguage links
|
// if there are no interlanguage links
|
||||||
$pLang.find( 'h3' )
|
$pLang.find( 'h3' )
|
||||||
.text( mw.msg( 'uls-plang-title-languages' ) );
|
.text( mw.msg( 'uls-plang-title-languages' ) );
|
||||||
|
|
||||||
@@ -278,7 +279,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
if ( ulsPosition === 'interlanguage' ) {
|
if ( ulsPosition === 'interlanguage' ) {
|
||||||
$ulsSettingsTrigger.attr( 'title', $.i18n( 'ext-uls-select-language-settings-icon-tooltip' ) );
|
$ulsSettingsTrigger.attr( {
|
||||||
|
title: $.i18n( 'ext-uls-select-language-settings-icon-tooltip' )
|
||||||
|
} );
|
||||||
|
|
||||||
$ulsSettingsTrigger.languagesettings( {
|
$ulsSettingsTrigger.languagesettings( {
|
||||||
defaultModule: 'display',
|
defaultModule: 'display',
|
||||||
@@ -289,9 +292,13 @@
|
|||||||
ulsTriggerWidth = $ulsSettingsTrigger.width(),
|
ulsTriggerWidth = $ulsSettingsTrigger.width(),
|
||||||
ulsTriggerOffset = $ulsSettingsTrigger.offset();
|
ulsTriggerOffset = $ulsSettingsTrigger.offset();
|
||||||
|
|
||||||
|
// Add the callout caret triangle
|
||||||
|
// pointing to the trigger icon
|
||||||
this.$window.addClass( 'callout' );
|
this.$window.addClass( 'callout' );
|
||||||
this.$window.prepend( $caretBefore, $caretAfter );
|
this.$window.prepend( $caretBefore, $caretAfter );
|
||||||
|
|
||||||
|
// Calculate the positioning of the panel
|
||||||
|
// according to the position of the trigger icon
|
||||||
if ( rtlPage ) {
|
if ( rtlPage ) {
|
||||||
caretWidth = parseInt( $caretBefore.css( 'border-left-width' ), '10' );
|
caretWidth = parseInt( $caretBefore.css( 'border-left-width' ), '10' );
|
||||||
this.left = ulsTriggerOffset.left - this.$window.width() - caretWidth;
|
this.left = ulsTriggerOffset.left - this.$window.width() - caretWidth;
|
||||||
@@ -322,6 +329,7 @@
|
|||||||
} else {
|
} else {
|
||||||
$( '.uls-settings-trigger' ).click();
|
$( '.uls-settings-trigger' ).click();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user