Use eslint and stylelint, fix all errors (#282)
* Use eslint and stylelint, fix all errors * Remove jshint, jsbeautify * Use Object.keys directly since that is available in all major browsers * Fixes for eslint, stylelint errors * stylelint is not included in grunt test yet because jquery.uls.mobile.css has so many !important and need to figure out whether they are really needed
This commit is contained in:
committed by
Niklas Laxström
parent
ddadf086c5
commit
2a77df6c41
@@ -24,7 +24,7 @@
|
||||
var template, ULS;
|
||||
|
||||
// Region numbers in id attributes also appear in the langdb.
|
||||
/*jshint multistr:true */
|
||||
// eslint-disable-next-line no-multi-str
|
||||
template = '<div class="grid uls-menu"> \
|
||||
<div id="search" class="row uls-search"> \
|
||||
<div class="uls-search-wrapper"> \
|
||||
@@ -43,42 +43,20 @@
|
||||
<div class="row uls-language-list"></div>\
|
||||
<div class="row" id="uls-settings-block"></div>\
|
||||
</div>';
|
||||
/*jshint multistr:false */
|
||||
|
||||
/**
|
||||
* Count the number of keys in an object.
|
||||
* Works in a cross-browser way.
|
||||
* @param {Object} The object.
|
||||
*/
|
||||
function objectLength ( obj ) {
|
||||
var count, key;
|
||||
|
||||
// Some old browsers don't support Object.keys
|
||||
if ( Object.keys ) {
|
||||
return Object.keys( obj ).length;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
|
||||
for ( key in obj ) {
|
||||
if ( Object.prototype.hasOwnProperty.call( obj, key ) ) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* ULS Public class definition
|
||||
* @param {Element} element
|
||||
* @param {Object} options
|
||||
*/
|
||||
ULS = function ( element, options ) {
|
||||
var code;
|
||||
this.$element = $( element );
|
||||
this.options = $.extend( {}, $.fn.uls.defaults, options );
|
||||
this.$menu = $( template );
|
||||
this.languages = this.options.languages;
|
||||
|
||||
for ( var code in this.languages ) {
|
||||
for ( code in this.languages ) {
|
||||
if ( $.uls.data.languages[ code ] === undefined ) {
|
||||
// Language is unknown to ULS.
|
||||
delete this.languages[ code ];
|
||||
@@ -131,7 +109,7 @@
|
||||
/**
|
||||
* Calculate the position of ULS
|
||||
* Returns an object with top and left properties.
|
||||
* @returns {Object}
|
||||
* @return {Object}
|
||||
*/
|
||||
position: function () {
|
||||
var pos,
|
||||
@@ -142,14 +120,13 @@
|
||||
pos = $.extend( {}, this.$element.offset(), {
|
||||
height: this.$element[ 0 ].offsetHeight
|
||||
} );
|
||||
top = pos.top + pos.height;
|
||||
top = pos.top + pos.height;
|
||||
}
|
||||
|
||||
if ( left === undefined ) {
|
||||
left = $( window ).width() / 2 - this.$menu.outerWidth() / 2;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
top: top,
|
||||
left: left
|
||||
@@ -166,7 +143,7 @@
|
||||
narrow: 'uls-narrow'
|
||||
};
|
||||
|
||||
this.$menu.addClass( widthClasses[this.getMenuWidth()] );
|
||||
this.$menu.addClass( widthClasses[ this.getMenuWidth() ] );
|
||||
|
||||
if ( !this.initialized ) {
|
||||
$( 'body' ).prepend( this.$menu );
|
||||
@@ -255,7 +232,7 @@
|
||||
this.$menu.on( 'keydown', $.proxy( this.keypress, this ) );
|
||||
}
|
||||
|
||||
languagesCount = objectLength( this.options.languages );
|
||||
languagesCount = Object.keys( this.options.languages ).length;
|
||||
lcd = this.$resultsView.lcd( {
|
||||
languages: this.languages,
|
||||
columns: columnsOptions[ this.getMenuWidth() ],
|
||||
@@ -282,7 +259,7 @@
|
||||
|
||||
/**
|
||||
* On select handler for search results
|
||||
* @param langCode
|
||||
* @param {string} langCode
|
||||
*/
|
||||
select: function ( langCode ) {
|
||||
this.hide();
|
||||
@@ -293,9 +270,10 @@
|
||||
|
||||
/**
|
||||
* On cancel handler for the uls menu
|
||||
* @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;
|
||||
}
|
||||
|
||||
@@ -347,7 +325,7 @@
|
||||
|
||||
/**
|
||||
* Get the panel menu width parameter
|
||||
* @return string
|
||||
* @return {string}
|
||||
*/
|
||||
getMenuWidth: function () {
|
||||
var languagesCount;
|
||||
@@ -356,7 +334,7 @@
|
||||
return this.options.menuWidth;
|
||||
}
|
||||
|
||||
languagesCount = objectLength( this.options.languages );
|
||||
languagesCount = Object.keys( this.options.languages ).length;
|
||||
|
||||
if ( languagesCount < 25 ) {
|
||||
return 'narrow';
|
||||
|
||||
@@ -22,18 +22,18 @@
|
||||
|
||||
/**
|
||||
* Is this language a redirect to another language?
|
||||
* @param language string Language code
|
||||
* @return Target language code if it's a redirect or false if it's not
|
||||
* @param {string} language Language code
|
||||
* @return {string|boolean} Target language code if it's a redirect or false if it's not
|
||||
*/
|
||||
$.uls.data.isRedirect = function ( language ) {
|
||||
return ( $.uls.data.languages[language] !== undefined &&
|
||||
$.uls.data.languages[language].length === 1 ) ? $.uls.data.languages[language][0] : false;
|
||||
return ( $.uls.data.languages[ language ] !== undefined &&
|
||||
$.uls.data.languages[ language ].length === 1 ) ? $.uls.data.languages[ language ][ 0 ] : false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the script of the language.
|
||||
* @param language string Language code
|
||||
* @return string
|
||||
* @param {string} language Language code
|
||||
* @return {string}
|
||||
*/
|
||||
$.uls.data.getScript = function ( language ) {
|
||||
var target = $.uls.data.isRedirect( language );
|
||||
@@ -42,18 +42,18 @@
|
||||
return $.uls.data.getScript( target );
|
||||
}
|
||||
|
||||
if ( !$.uls.data.languages[language] ) {
|
||||
if ( !$.uls.data.languages[ language ] ) {
|
||||
// Undetermined
|
||||
return 'Zyyy';
|
||||
}
|
||||
|
||||
return $.uls.data.languages[language][0];
|
||||
return $.uls.data.languages[ language ][ 0 ];
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the regions in which a language is spoken.
|
||||
* @param language string Language code
|
||||
* @return array|string 'UNKNOWN'
|
||||
* @param {string} language Language code
|
||||
* @return {string|string[]}
|
||||
*/
|
||||
$.uls.data.getRegions = function ( language ) {
|
||||
var target = $.uls.data.isRedirect( language );
|
||||
@@ -62,13 +62,13 @@
|
||||
return $.uls.data.getRegions( target );
|
||||
}
|
||||
|
||||
return ( $.uls.data.languages[language] && $.uls.data.languages[language][1] ) || 'UNKNOWN';
|
||||
return ( $.uls.data.languages[ language ] && $.uls.data.languages[ language ][ 1 ] ) || 'UNKNOWN';
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the autonym of the language.
|
||||
* @param language string Language code
|
||||
* @return string
|
||||
* @param {string} language Language code
|
||||
* @return {string}
|
||||
*/
|
||||
$.uls.data.getAutonym = function ( language ) {
|
||||
var target = $.uls.data.isRedirect( language );
|
||||
@@ -77,12 +77,12 @@
|
||||
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;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns all language codes and corresponding autonyms
|
||||
* @return array
|
||||
* @return {string[]}
|
||||
*/
|
||||
$.uls.data.getAutonyms = function () {
|
||||
var language,
|
||||
@@ -93,7 +93,7 @@
|
||||
continue;
|
||||
}
|
||||
|
||||
autonymsByCode[language] = $.uls.data.getAutonym( language );
|
||||
autonymsByCode[ language ] = $.uls.data.getAutonym( language );
|
||||
}
|
||||
|
||||
return autonymsByCode;
|
||||
@@ -101,8 +101,8 @@
|
||||
|
||||
/**
|
||||
* Returns all languages written in script.
|
||||
* @param script string
|
||||
* @return array of strings (languages codes)
|
||||
* @param {string} script string
|
||||
* @return {string[]} languages codes
|
||||
*/
|
||||
$.uls.data.getLanguagesInScript = function ( script ) {
|
||||
return $.uls.data.getLanguagesInScripts( [ script ] );
|
||||
@@ -110,8 +110,8 @@
|
||||
|
||||
/**
|
||||
* Returns all languages written in the given scripts.
|
||||
* @param scripts array of strings
|
||||
* @return array of strings (languages codes)
|
||||
* @param {string[]} scripts
|
||||
* @return {string[]} languages codes
|
||||
*/
|
||||
$.uls.data.getLanguagesInScripts = function ( scripts ) {
|
||||
var language, i,
|
||||
@@ -123,7 +123,7 @@
|
||||
}
|
||||
|
||||
for ( i = 0; i < scripts.length; i++ ) {
|
||||
if ( scripts[i] === $.uls.data.getScript( language ) ) {
|
||||
if ( scripts[ i ] === $.uls.data.getScript( language ) ) {
|
||||
languagesInScripts.push( language );
|
||||
break;
|
||||
}
|
||||
@@ -136,8 +136,8 @@
|
||||
/**
|
||||
* Returns an associative array of languages in a region,
|
||||
* grouped by script group.
|
||||
* @param region string Region code
|
||||
* @return associative array
|
||||
* @param {string} region Region code
|
||||
* @return {object}
|
||||
*/
|
||||
$.uls.data.getLanguagesByScriptGroupInRegion = function ( region ) {
|
||||
return $.uls.data.getLanguagesByScriptGroupInRegions( [ region ] );
|
||||
@@ -145,7 +145,7 @@
|
||||
|
||||
/**
|
||||
* Get the given list of languages grouped by script.
|
||||
* @param languages Array of language codes
|
||||
* @param {string} languages Array of language codes
|
||||
* @return {Object} Array of languages indexed by script codes
|
||||
*/
|
||||
$.uls.data.getLanguagesByScriptGroup = function ( languages ) {
|
||||
@@ -157,11 +157,11 @@
|
||||
|
||||
langScriptGroup = $.uls.data.getScriptGroupOfLanguage( resolvedRedirect );
|
||||
|
||||
if ( !languagesByScriptGroup[langScriptGroup] ) {
|
||||
languagesByScriptGroup[langScriptGroup] = [];
|
||||
if ( !languagesByScriptGroup[ langScriptGroup ] ) {
|
||||
languagesByScriptGroup[ langScriptGroup ] = [];
|
||||
}
|
||||
|
||||
languagesByScriptGroup[langScriptGroup].push( language );
|
||||
languagesByScriptGroup[ langScriptGroup ].push( language );
|
||||
}
|
||||
|
||||
return languagesByScriptGroup;
|
||||
@@ -170,8 +170,8 @@
|
||||
/**
|
||||
* Returns an associative array of languages in several regions,
|
||||
* grouped by script group.
|
||||
* @param regions array of strings - region codes
|
||||
* @return associative array
|
||||
* @param {string[]} regions region codes
|
||||
* @return {Object}
|
||||
*/
|
||||
$.uls.data.getLanguagesByScriptGroupInRegions = function ( regions ) {
|
||||
var language, i, scriptGroup,
|
||||
@@ -183,14 +183,14 @@
|
||||
}
|
||||
|
||||
for ( i = 0; i < regions.length; i++ ) {
|
||||
if ( $.inArray( regions[i], $.uls.data.getRegions( language ) ) !== -1 ) {
|
||||
if ( $.inArray( regions[ i ], $.uls.data.getRegions( language ) ) !== -1 ) {
|
||||
scriptGroup = $.uls.data.getScriptGroupOfLanguage( language );
|
||||
|
||||
if ( languagesByScriptGroupInRegions[scriptGroup] === undefined ) {
|
||||
languagesByScriptGroupInRegions[scriptGroup] = [];
|
||||
if ( languagesByScriptGroupInRegions[ scriptGroup ] === undefined ) {
|
||||
languagesByScriptGroupInRegions[ scriptGroup ] = [];
|
||||
}
|
||||
|
||||
languagesByScriptGroupInRegions[scriptGroup].push( language );
|
||||
languagesByScriptGroupInRegions[ scriptGroup ].push( language );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -202,14 +202,14 @@
|
||||
/**
|
||||
* Returns the script group of a script or 'Other' if it doesn't
|
||||
* belong to any group.
|
||||
* @param script string Script code
|
||||
* @return string script group name
|
||||
* @param {string} script Script code
|
||||
* @return {string} script group name
|
||||
*/
|
||||
$.uls.data.getGroupOfScript = function ( script ) {
|
||||
var scriptGroup;
|
||||
|
||||
for ( scriptGroup in $.uls.data.scriptgroups ) {
|
||||
if ( $.inArray( script, $.uls.data.scriptgroups[scriptGroup] ) !== -1 ) {
|
||||
if ( $.inArray( script, $.uls.data.scriptgroups[ scriptGroup ] ) !== -1 ) {
|
||||
return scriptGroup;
|
||||
}
|
||||
}
|
||||
@@ -219,8 +219,8 @@
|
||||
|
||||
/**
|
||||
* Returns the script group of a language.
|
||||
* @param language string Language code
|
||||
* @return string script group name
|
||||
* @param {string} language Language code
|
||||
* @return {string} script group name
|
||||
*/
|
||||
$.uls.data.getScriptGroupOfLanguage = function ( language ) {
|
||||
return $.uls.data.getGroupOfScript( $.uls.data.getScript( language ) );
|
||||
@@ -229,8 +229,9 @@
|
||||
/**
|
||||
* A callback for sorting languages by autonym.
|
||||
* Can be used as an argument to a sort function.
|
||||
* @param a string Language code
|
||||
* @param b string Language code
|
||||
* @param {string} a Language code
|
||||
* @param {string} b Language code
|
||||
* @return {number}
|
||||
*/
|
||||
$.uls.data.sortByAutonym = function ( a, b ) {
|
||||
var autonymA = $.uls.data.getAutonym( a ) || a,
|
||||
@@ -241,8 +242,8 @@
|
||||
|
||||
/**
|
||||
* Check if a language is right-to-left.
|
||||
* @param language string Language code
|
||||
* @return boolean
|
||||
* @param {string} language Language code
|
||||
* @return {boolean}
|
||||
*/
|
||||
$.uls.data.isRtl = function ( language ) {
|
||||
return $.inArray( $.uls.data.getScript( language ), $.uls.data.rtlscripts ) !== -1;
|
||||
@@ -250,8 +251,8 @@
|
||||
|
||||
/**
|
||||
* Return the direction of the language
|
||||
* @param language string Language code
|
||||
* @return string
|
||||
* @param {string} language Language code
|
||||
* @return {string}
|
||||
*/
|
||||
$.uls.data.getDir = function ( language ) {
|
||||
return $.uls.data.isRtl( language ) ? 'rtl' : 'ltr';
|
||||
@@ -259,11 +260,11 @@
|
||||
|
||||
/**
|
||||
* Returns the languages spoken in a territory.
|
||||
* @param territory string Territory code
|
||||
* @return list of language codes
|
||||
* @param {string} territory Territory code
|
||||
* @return {string[]} list of language codes
|
||||
*/
|
||||
$.uls.data.getLanguagesInTerritory = function ( territory ) {
|
||||
return $.uls.data.territories[territory];
|
||||
return $.uls.data.territories[ territory ];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -271,30 +272,30 @@
|
||||
* If the target option is provided, the language is defined as a redirect.
|
||||
* Other possible options are script, regions and autonym.
|
||||
*
|
||||
* @param code string New language code.
|
||||
* @param options Object Language properties.
|
||||
* @param {string} code New language code.
|
||||
* @param {Object} options Language properties.
|
||||
*/
|
||||
$.uls.data.addLanguage = function( code, options ) {
|
||||
$.uls.data.addLanguage = function ( code, options ) {
|
||||
if ( options.target ) {
|
||||
$.uls.data.languages[code] = [options.target];
|
||||
$.uls.data.languages[ code ] = [ options.target ];
|
||||
} else {
|
||||
$.uls.data.languages[code] = [options.script, options.regions, options.autonym];
|
||||
$.uls.data.languages[ code ] = [ options.script, options.regions, options.autonym ];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes a language from the langdb in run time.
|
||||
*
|
||||
* @param code string Language code to delete.
|
||||
* @return true if the language was removed, false otherwise.
|
||||
* @param {string} code Language code to delete.
|
||||
* @return {boolean} true if the language was removed, false otherwise.
|
||||
*/
|
||||
$.uls.data.deleteLanguage = function( code ) {
|
||||
if ( $.uls.data.languages[code] ) {
|
||||
delete $.uls.data.languages[code];
|
||||
$.uls.data.deleteLanguage = function ( code ) {
|
||||
if ( $.uls.data.languages[ code ] ) {
|
||||
delete $.uls.data.languages[ code ];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
} ( jQuery ) );
|
||||
}( jQuery ) );
|
||||
|
||||
@@ -27,6 +27,20 @@
|
||||
|
||||
var LanguageFilter, delay;
|
||||
|
||||
/**
|
||||
* Check if a prefix is visually prefix of a string
|
||||
*
|
||||
* @param {string} prefix
|
||||
* @param {string} string
|
||||
* @return {boolean}
|
||||
*/
|
||||
function isVisualPrefix( prefix, string ) {
|
||||
// Pre-base vowel signs of Indic languages. A vowel sign is called pre-base if
|
||||
// consonant + vowel becomes [vowel][consonant] when rendered. Eg: ക + െ => കെ
|
||||
var prebases = 'െേൈൊോൌெேைொோௌେୈୋୌિਿिিেৈোৌෙේෛොෝෞ';
|
||||
return prebases.indexOf( string[ prefix.length ] ) <= 0;
|
||||
}
|
||||
|
||||
LanguageFilter = function ( element, options ) {
|
||||
this.$element = $( element );
|
||||
this.options = $.extend( {}, $.fn.languagefilter.defaults, options );
|
||||
@@ -72,58 +86,58 @@
|
||||
var suggestion, query, languageFilter;
|
||||
|
||||
switch ( e.keyCode ) {
|
||||
case 9: // Tab -> Autocomplete
|
||||
suggestion = this.$suggestion.val();
|
||||
case 9: // Tab -> Autocomplete
|
||||
suggestion = this.$suggestion.val();
|
||||
|
||||
if ( suggestion && suggestion !== this.$element.val() ) {
|
||||
this.$element.val( suggestion );
|
||||
if ( suggestion && suggestion !== this.$element.val() ) {
|
||||
this.$element.val( suggestion );
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
break;
|
||||
case 13: // Enter
|
||||
if ( !this.options.onSelect ) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Avoid bubbling this 'enter' to background page elements
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
break;
|
||||
case 13: // Enter
|
||||
if ( !this.options.onSelect ) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Avoid bubbling this 'enter' to background page elements
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
query = $.trim( this.$element.val() ).toLowerCase();
|
||||
|
||||
query = $.trim( this.$element.val() ).toLowerCase();
|
||||
|
||||
if ( this.selectedLanguage ) {
|
||||
if ( this.selectedLanguage ) {
|
||||
// this.selectLanguage will be populated from a matching search
|
||||
this.options.onSelect( this.selectedLanguage );
|
||||
} else if ( this.options.languages[ query ] ) {
|
||||
this.options.onSelect( this.selectedLanguage );
|
||||
} else if ( this.options.languages[ query ] ) {
|
||||
// Search is yet to happen (in timeout delay),
|
||||
// but we have a matching language code.
|
||||
this.options.onSelect( query );
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
languageFilter = this;
|
||||
|
||||
if ( e.which < 32 &&
|
||||
e.which !== 8 // Backspace
|
||||
) {
|
||||
// ignore any ASCII control characters
|
||||
break;
|
||||
}
|
||||
|
||||
this.selectedLanguage = null;
|
||||
|
||||
delay( function () {
|
||||
if ( !languageFilter.$element.val() ) {
|
||||
languageFilter.clear();
|
||||
} else {
|
||||
languageFilter.options.$target.empty();
|
||||
languageFilter.search();
|
||||
this.options.onSelect( query );
|
||||
}
|
||||
}, 300 );
|
||||
|
||||
this.toggleClear();
|
||||
break;
|
||||
default:
|
||||
languageFilter = this;
|
||||
|
||||
if ( e.which < 32 &&
|
||||
e.which !== 8 // Backspace
|
||||
) {
|
||||
// ignore any ASCII control characters
|
||||
break;
|
||||
}
|
||||
|
||||
this.selectedLanguage = null;
|
||||
|
||||
delay( function () {
|
||||
if ( !languageFilter.$element.val() ) {
|
||||
languageFilter.clear();
|
||||
} else {
|
||||
languageFilter.options.$target.empty();
|
||||
languageFilter.search();
|
||||
}
|
||||
}, 300 );
|
||||
|
||||
this.toggleClear();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -213,7 +227,7 @@
|
||||
* Handler method to be called once search is over.
|
||||
* Based on search result triggers resultsfound or noresults events
|
||||
* @param {string} query
|
||||
* @param {number} resultCount
|
||||
* @param {string[]} results
|
||||
* @param {string} [autofillLabel]
|
||||
*/
|
||||
resultHandler: function ( query, results, autofillLabel ) {
|
||||
@@ -284,7 +298,7 @@
|
||||
},
|
||||
|
||||
escapeRegex: function ( value ) {
|
||||
return value.replace( /[\-\[\]{}()*+?.,\\\^$\|#\s]/g, '\\$&' );
|
||||
return value.replace( /[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&' );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -294,6 +308,9 @@
|
||||
* b) Language autonym 'starts with' search string.
|
||||
* c) ISO 639 code match with search string.
|
||||
* d) ISO 15924 code for the script match the search string.
|
||||
* @param {string} langCode
|
||||
* @param {string} searchTerm
|
||||
* @return {boolean}
|
||||
*/
|
||||
filter: function ( langCode, searchTerm ) {
|
||||
// FIXME script is ISO 15924 code. We might need actual name of script.
|
||||
@@ -343,16 +360,4 @@
|
||||
|
||||
$.fn.languagefilter.Constructor = LanguageFilter;
|
||||
|
||||
/**
|
||||
* Check if a prefix is visually prefix of a string
|
||||
*
|
||||
* @param {string} prefix
|
||||
* @param {string} string
|
||||
*/
|
||||
function isVisualPrefix( prefix, string ) {
|
||||
// Pre-base vowel signs of Indic languages. A vowel sign is called pre-base if
|
||||
// consonant + vowel becomes [vowel][consonant] when rendered. Eg: ക + െ => കെ
|
||||
var prebases = 'െേൈൊോൌெேைொோௌେୈୋୌિਿिিেৈোৌෙේෛොෝෞ';
|
||||
return prebases.indexOf( string[ prefix.length ] ) <= 0;
|
||||
}
|
||||
}( jQuery ) );
|
||||
|
||||
@@ -287,7 +287,6 @@
|
||||
a.lang = code;
|
||||
a.dir = $.uls.data.getDir( code );
|
||||
|
||||
|
||||
li.appendChild( a );
|
||||
if ( this.options.languageDecorator ) {
|
||||
this.options.languageDecorator( $( a ), code );
|
||||
@@ -365,6 +364,7 @@
|
||||
},
|
||||
|
||||
noResults: function () {
|
||||
var $suggestions;
|
||||
this.$noResults.removeClass( 'hide' );
|
||||
this.$noResults.siblings( '.uls-lcd-region-section' ).addClass( 'hide' );
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var $suggestions = this.buildQuicklist().clone();
|
||||
$suggestions = this.buildQuicklist().clone();
|
||||
$suggestions.removeClass( 'hide' ).removeAttr( 'id' );
|
||||
$suggestions.find( 'h3' )
|
||||
.data( 'i18n', 'uls-no-results-suggestion-title' )
|
||||
|
||||
Reference in New Issue
Block a user