Fix indentation and tweak comments a bit

Bug: 50859
Change-Id: Ic827e200674fb72b8b88e362bab30662cc13e304
This commit is contained in:
Amir E. Aharoni
2013-07-06 14:00:35 +03:00
parent 70d6a7febc
commit 6fdc9241e6

View File

@@ -137,6 +137,7 @@
if ( previousLang === currentLang ) {
$ulsTrigger.tipsy( { gravity: rtlPage ? 'e' : 'w' } );
return true;
}
@@ -224,10 +225,10 @@
$( document ).ready( function () {
mw.uls.init( function () {
var $ulsTrigger = $( '.uls-trigger' ),
$ulsSettingsTrigger,
var $ulsSettingsTrigger,
$pLang,
ulsOptions,
$ulsTrigger = $( '.uls-trigger' ),
rtlPage = $( 'body' ).hasClass( 'rtl' ),
anonMode = ( mw.user.isAnon() &&
!mw.config.get( 'wgULSAnonCanChangeLanguage' ) ),
@@ -240,15 +241,15 @@
$ulsSettingsTrigger = $( '<span>' )
.addClass( 'uls-settings-trigger' )
.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 );
// 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();
if ( !$pLang.find( 'div ul' ).children().length ) {
// Replace the title of the interlanguage links
// area if there are no interlanguage links
// Replace the title of the interlanguage links area
// if there are no interlanguage links
$pLang.find( 'h3' )
.text( mw.msg( 'uls-plang-title-languages' ) );
@@ -278,7 +279,9 @@
};
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( {
defaultModule: 'display',
@@ -289,9 +292,13 @@
ulsTriggerWidth = $ulsSettingsTrigger.width(),
ulsTriggerOffset = $ulsSettingsTrigger.offset();
// Add the callout caret triangle
// pointing to the trigger icon
this.$window.addClass( 'callout' );
this.$window.prepend( $caretBefore, $caretAfter );
// Calculate the positioning of the panel
// according to the position of the trigger icon
if ( rtlPage ) {
caretWidth = parseInt( $caretBefore.css( 'border-left-width' ), '10' );
this.left = ulsTriggerOffset.left - this.$window.width() - caretWidth;
@@ -322,6 +329,7 @@
} else {
$( '.uls-settings-trigger' ).click();
}
return false;
} );