Update jquery.uls from upstream
* Localisation updates for many languages.
* Don't cut-off language names vertically (by Volker Eckl).
* Fix eslint issues (by Kartik Mistry).
Updating to
d9fece1a15
Change-Id: I186fa19c91323a20d86c7881191022f48b2deb7f
This commit is contained in:
@@ -302,7 +302,8 @@
|
||||
* @param {Event} e
|
||||
*/
|
||||
cancel: function ( e ) {
|
||||
if ( e && ( this.$element.is( e.target ) || $.contains( this.$element[ 0 ], e.target ) ) ) {
|
||||
if ( e && ( this.$element.is( e.target ) ||
|
||||
$.contains( this.$element[ 0 ], e.target ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -427,7 +428,7 @@
|
||||
* since the last time it was invoked.
|
||||
*
|
||||
* @param {Function} fn Function to be debounced.
|
||||
* @param {Number} wait Wait interval in milliseconds.
|
||||
* @param {number} wait Wait interval in milliseconds.
|
||||
* @param {boolean} [immediate] Trigger the function on the leading edge of the wait interval,
|
||||
* instead of the trailing edge.
|
||||
* @return {Function} Debounced function.
|
||||
|
||||
@@ -655,6 +655,23 @@ module.exports=( function ( $ ) {
|
||||
],
|
||||
"Lai holh"
|
||||
],
|
||||
"cnr": [
|
||||
"cnr-latn"
|
||||
],
|
||||
"cnr-cyrl": [
|
||||
"Cyrl",
|
||||
[
|
||||
"EU"
|
||||
],
|
||||
"црногорски"
|
||||
],
|
||||
"cnr-latn": [
|
||||
"Latn",
|
||||
[
|
||||
"EU"
|
||||
],
|
||||
"crnogorski"
|
||||
],
|
||||
"co": [
|
||||
"Latn",
|
||||
[
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
*/
|
||||
$.uls.data.isRedirect = function ( language ) {
|
||||
return ( $.uls.data.languages[ language ] !== undefined &&
|
||||
$.uls.data.languages[ language ].length === 1 ) ? $.uls.data.languages[ language ][ 0 ] : false;
|
||||
$.uls.data.languages[ language ].length === 1 ) ?
|
||||
$.uls.data.languages[ language ][ 0 ] : false;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -77,7 +78,8 @@
|
||||
return $.uls.data.getAutonym( target );
|
||||
}
|
||||
|
||||
return ( $.uls.data.languages[ language ] && $.uls.data.languages[ language ][ 2 ] ) || language;
|
||||
return ( $.uls.data.languages[ language ] &&
|
||||
$.uls.data.languages[ language ][ 2 ] ) || language;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -137,7 +139,7 @@
|
||||
* Returns an associative array of languages in a region,
|
||||
* grouped by script group.
|
||||
* @param {string} region Region code
|
||||
* @return {object}
|
||||
* @return {Object}
|
||||
*/
|
||||
$.uls.data.getLanguagesByScriptGroupInRegion = function ( region ) {
|
||||
return $.uls.data.getLanguagesByScriptGroupInRegions( [ region ] );
|
||||
|
||||
@@ -268,7 +268,8 @@
|
||||
}
|
||||
|
||||
userInput = this.$element.val();
|
||||
suggestion = userInput + languageName.substring( userInput.length, languageName.length );
|
||||
suggestion = userInput +
|
||||
languageName.substring( userInput.length, languageName.length );
|
||||
|
||||
if ( suggestion.toLowerCase() !== languageName.toLowerCase() ) {
|
||||
// see if it was autonym match
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
* @cfg {number} [columns] Number of columns for languages. Default is 4.
|
||||
* @cfg {Function} [languageDecorator] Callback function to be called when a language
|
||||
* link is prepared - for custom decoration.
|
||||
* @cfg {Function|string[]} [quickList] The languages to display as suggestions for quick selection.
|
||||
* @cfg {Function|string[]} [quickList] The languages to display as suggestions for quick
|
||||
* selection.
|
||||
* @cfg {Function} [clickhandler] Callback when language is selected.
|
||||
* @cfg {jQuery|Function} [noResultsTemplate]
|
||||
*/
|
||||
@@ -127,7 +128,8 @@
|
||||
* Override the default region grouping setting.
|
||||
* This is to allow LanguageFilter to disable grouping when displaying search results.
|
||||
*
|
||||
* @param {boolean|null} val True to force grouping, false to disable, null to undo override.
|
||||
* @param {boolean|null} val True to force grouping, false to disable, null
|
||||
* to undo override.
|
||||
*/
|
||||
setGroupByRegionOverride: function ( val ) {
|
||||
this.groupByRegionOverride = val;
|
||||
@@ -218,7 +220,7 @@
|
||||
/**
|
||||
* Adds given languages sorted into rows and columns into given element.
|
||||
* @param {jQuery} $region Element to add language list.
|
||||
* @param {array} languages List of language codes.
|
||||
* @param {Array} languages List of language codes.
|
||||
* @param {number} itemsPerColumn How many languages fit in a column.
|
||||
* @param {number} columnsPerRow How many columns fit in a row.
|
||||
*/
|
||||
@@ -257,8 +259,8 @@
|
||||
nextScript = $.uls.data.getScriptGroupOfLanguage( languages[ i + 1 ] );
|
||||
|
||||
lastItem = languagesCount - i === 1;
|
||||
// Force column break if script changes and column has more than one row already,
|
||||
// but only if grouping by region
|
||||
// Force column break if script changes and column has more than one
|
||||
// row already, but only if grouping by region
|
||||
if ( i === 0 || !this.isGroupingByRegionEnabled() ) {
|
||||
currentScript = $.uls.data.getScriptGroupOfLanguage( languages[ i ] );
|
||||
} else if ( currentScript !== nextScript && items.length > 1 ) {
|
||||
|
||||
Reference in New Issue
Block a user