Updated util functions names after refactoring

jquery.uls.js is just updated from GitHub.

Change-Id: I506ab810d7136ba5d96dfdd469394a843110f8de
This commit is contained in:
Amir E. Aharoni
2012-10-08 00:13:34 +02:00
parent 93ced2526e
commit 8d31bf8c07
4 changed files with 29 additions and 20 deletions

View File

@@ -728,37 +728,42 @@
},
listen: function () {
var that = this;
var lcd = this;
if ( this.options.clickhandler ) {
this.$element.on( 'click', 'div.row li', function() {
that.options.clickhandler.call( this, $( this ).data( 'code' ) );
lcd.options.clickhandler.call( this, $( this ).data( 'code' ) );
} );
}
// The region section need to be in sync with the map filter.
that.$element.scroll( function () {
var scrollTop = $( this ).position().top;
var scrollBottom = $( this ).height();
lcd.$element.scroll( function () {
var $ulsLanguageList = $( this ),
scrollTop = $ulsLanguageList.position().top,
scrollBottom = $ulsLanguageList.height();
if ( this.offsetHeight + this.scrollTop >= this.scrollHeight / 2 ) {
that.$element.trigger( 'scrollend' );
lcd.$element.trigger( 'scrollend' );
}
// The region section need to be in sync with the map filter.
var inviewRegion = 'WW';
that.$element.find( 'div.uls-lcd-region-section' ).each( function () {
var top = $( this ).position().top;
var height = $( this ).height();
lcd.$element.find( 'div.uls-lcd-region-section' ).each( function () {
var $lcdRegionSection = $( this ),
top = $lcdRegionSection.position().top,
height = $lcdRegionSection.height();
if ( top < scrollTop && height > scrollBottom ) {
inviewRegion = $( this ).attr( 'id' );
inviewRegion = $lcdRegionSection.attr( 'id' );
return true;
}
} );
var inview = $.uls.data.regiongroups[inviewRegion];
$( '.regionselector' ).removeClass( 'active' );
$( '#uls-region-' + inview ).addClass( 'active' );
} );
}
};
$.fn.lcd = function( option ) {

View File

@@ -129,7 +129,7 @@
var language = languages[i];
var $button = $( '<button>' )
.addClass( 'button uls-language-button' )
.text( $.uls.data.autonym( language ) );
.text( $.uls.data.getAutonym( language ) );
if ( language === this.uiLanguage ) {
$button.addClass( 'down' );
}
@@ -244,7 +244,7 @@
$systemFont.attr( 'selected', savedFont === 'system' || !savedFont );
var $fontLabel = this.$template.find( 'label#ui-font-selector-label' );
$fontLabel.html( '<strong>'
+ $.i18n( 'ext-uls-webfonts-select-for', $.uls.data.autonym( this.uiLanguage ) )
+ $.i18n( 'ext-uls-webfonts-select-for', $.uls.data.getAutonym( this.uiLanguage ) )
+ '</strong>'
+ '<div>'
+ $.i18n( 'ext-uls-webfonts-select-for-ui-info' )
@@ -279,7 +279,7 @@
var $fontLabel = this.$template.find( '#content-font-selector-label' );
$fontLabel.html( '<strong>'
+ $.i18n( 'ext-uls-webfonts-select-for',
$.uls.data.autonym( this.contentLanguage ) )
$.uls.data.getAutonym( this.contentLanguage ) )
+ '</strong>'
+ '<div>'
+ $.i18n( 'ext-uls-webfonts-select-for-content-info' )

View File

@@ -71,18 +71,22 @@
]
.concat( mw.uls.getPreviousLanguages() )
.concat( mw.uls.getAcceptLanguageList() );
if ( window.GEO ) {
list = list.concat( $.uls.data.languagesInTerritory( window.GEO.country_code ) );
list = list.concat( $.uls.data.getLanguagesInTerritory( window.GEO.country_code ) );
}
$.each( list, function ( i, v ) {
if ( $.inArray( v, unique ) === -1 ) {
unique.push( v );
}
} );
// Filter out unknown and unsupported languages
unique = $.grep( unique, function ( langCode, index ) {
return $.fn.uls.defaults.languages[langCode];
} );
return unique;
};
@@ -170,7 +174,7 @@
fade: true,
trigger: 'manual',
title: function () {
var prevLangName = $.uls.data.autonym( previousLang );
var prevLangName = $.uls.data.getAutonym( previousLang );
var linkClass = 'uls-prevlang-link';
var prevLangLink = "<a href='#' lang = '" +
previousLang + "' class = '" + linkClass + "' >" +

View File

@@ -37,7 +37,7 @@
$.each( languages, function ( lang, language ) {
$langselector.append( $( "<option></option>" )
.attr( "value", language )
.text( language + " - " + $.uls.data.autonym( language ) ) );
.text( language + " - " + $.uls.data.getAutonym( language ) ) );
} );
$fontSelector.on( 'change', function () {
var font = $fontSelector.find( 'option:selected' ).val();
@@ -46,7 +46,7 @@
$langselector.on( 'change', function () {
var language = $langselector.find( 'option:selected' ).val();
listFonts( $webfonts.list( language ) );
$( '#webfonts-preview-area' ).text( $.uls.data.autonym( language ) );
$( '#webfonts-preview-area' ).text( $.uls.data.getAutonym( language ) );
} );
} )
</script>