Update jquery.uls from upstream

Upstream: https://github.com/wikimedia/jquery.uls
Changes:
* Reduce data size of uls language data a bit by using unescaped unicode
* Move the autonym font to example instead of making part of jquery.uls
* Use attr and prop consistently in jquery.uls.lcd.js
* Remove unnecessary object instance from jquery.uls.lcd.js
* Avoid 'recalculate style' by changing classes conditionally while
scrolling the language list
* Remove non-existing "-ms-linear-gradient"
* Localisation updates

Change-Id: I10b8658e29c03b136b4475c4c69ace33e5628a98
This commit is contained in:
Santhosh Thottingal
2013-11-01 15:01:51 +05:30
committed by Nikerabbit
parent 1114384c19
commit c197309810
4 changed files with 24 additions and 27 deletions

File diff suppressed because one or more lines are too long

View File

@@ -77,8 +77,7 @@
*/
addToRegion: function ( langCode, region ) {
var i, regionCode, $li, $column, lastLanguage, lastScriptGroup, currentScriptGroup,
lcd = this,
language = lcd.options.languages[langCode],
language = this.options.languages[langCode],
langName = $.uls.data.getAutonym( langCode ) || language || langCode,
regions = [];
@@ -103,11 +102,11 @@
dir: $.uls.data.getDir( langCode )
} )
.append(
$( '<a>' ).prop( 'title', language ).html( langName )
$( '<a>' ).attr( 'title', language ).text( langName )
);
// Append the element to the column in the list
$column = lcd.getColumn( regionCode );
$column = this.getColumn( regionCode );
lastLanguage = $column.find( 'li:last' ).data( 'code' );
if ( lastLanguage ) {
@@ -117,7 +116,7 @@
if ( lastScriptGroup !== currentScriptGroup ) {
if ( $column.find( 'li' ).length > 2 ) {
// If column already has 2 or more languages, add a new column
$column = lcd.getColumn( regionCode, true );
$column = this.getColumn( regionCode, true );
}
}
}
@@ -176,7 +175,7 @@
};
$.each( $.uls.data.regiongroups, function ( regionCode ) {
$section = $( '<div>' ).addClass( 'twelve columns uls-lcd-region-section' ).prop( 'id', regionCode );
$section = $( '<div>' ).addClass( 'twelve columns uls-lcd-region-section' ).attr( 'id', regionCode );
$sectionTitle = $( '<h3>' )
.attr( 'data-i18n', 'uls-region-' + regionCode )
@@ -214,7 +213,7 @@
quickList = quickList.slice( 0, 16 );
quickList.sort( $.uls.data.sortByAutonym );
$quickListSection = $( '<div>' ).addClass( 'twelve columns uls-lcd-region-section' ).prop( 'id', 'uls-lcd-quicklist' );
$quickListSection = $( '<div>' ).addClass( 'twelve columns uls-lcd-region-section' ).attr( 'id', 'uls-lcd-quicklist' );
$quickListSectionTitle = $( '<h3>' )
.attr( 'data-i18n', 'uls-common-languages' )
.addClass( 'eleven columns uls-lcd-region-section uls-lcd-region-title offset-by-one' )
@@ -235,7 +234,7 @@
dir: $.uls.data.getDir( langCode )
} )
.append(
$( '<a>' ).prop( 'title', language ).html( langName )
$( '<a>' ).attr( 'title', language ).text( langName )
);
$column.append( $li );
}
@@ -302,9 +301,12 @@
}
} );
// highlight the region visible while scrolling in the map.
inview = $.uls.data.regiongroups[inviewRegion];
$( '.regionselector' ).removeClass( 'active' );
$( '#uls-region-' + inview ).addClass( 'active' );
if ( !$( '#uls-region-' + inview ).hasClass( 'active' ) ) {
$( '.regionselector' ).removeClass( 'active' );
$( '#uls-region-' + inview ).addClass( 'active' );
}
} );
}
};