diff --git a/UniversalLanguageSelector.php b/UniversalLanguageSelector.php index 7966bff4..b9f9c060 100644 --- a/UniversalLanguageSelector.php +++ b/UniversalLanguageSelector.php @@ -90,6 +90,7 @@ $wgResourceModules['ext.uls.init'] = array( 'mediawiki.Uri', 'jquery.tipsy', 'jquery.uls', + 'jquery.i18n', 'ext.uls.displaysettings', ), 'position' => 'top', @@ -138,40 +139,27 @@ $wgResourceModules['ext.uls.displaysettings'] = array( 'localBasePath' => $dir, 'dependencies' => array( 'ext.uls.languagesettings', - 'ext.uls.webfonts' + 'ext.uls.webfonts', + 'jquery.i18n', ), 'remoteExtPath' => 'UniversalLanguageSelector', ); $wgResourceModules['jquery.uls'] = array( 'scripts' => array( - 'lib/jquery.uls/src/jquery.uls.core.js', - 'lib/jquery.uls/src/jquery.uls.languagefilter.js', - 'lib/jquery.uls/src/jquery.uls.regionfilter.js', - 'lib/jquery.uls/src/jquery.uls.lcd.js', + 'lib/jquery.uls/jquery.uls.js', ), 'styles' => array( 'lib/jquery.uls/css/jquery.uls.css', - 'lib/jquery.uls/css/jquery.uls.grid.css', - 'lib/jquery.uls/css/jquery.uls.lcd.css', ), 'localBasePath' => $dir, 'remoteExtPath' => 'UniversalLanguageSelector', 'dependencies' => array( - 'jquery.uls.data', + 'jquery.i18n', ), 'position' => 'top', ); -$wgResourceModules['jquery.uls.data'] = array( - 'scripts' => array( - 'lib/jquery.uls/src/jquery.uls.data.js', - 'lib/jquery.uls/src/jquery.uls.data.utils.js', - ), - 'localBasePath' => $dir, - 'remoteExtPath' => 'UniversalLanguageSelector', -); - $wgResourceModules['jquery.webfonts'] = array( 'scripts' => 'lib/jquery.webfonts.js', 'localBasePath' => $dir, @@ -183,3 +171,9 @@ $wgResourceModules['ext.uls.webfonts.repository'] = array( 'localBasePath' => $dir, 'remoteExtPath' => 'UniversalLanguageSelector', ); + +$wgResourceModules['jquery.i18n'] = array( + 'scripts' => 'lib/jquery.i18n.js', + 'localBasePath' => $dir, + 'remoteExtPath' => 'UniversalLanguageSelector', +); \ No newline at end of file diff --git a/lib/jquery.i18n.js b/lib/jquery.i18n.js new file mode 100644 index 00000000..860f2f4d --- /dev/null +++ b/lib/jquery.i18n.js @@ -0,0 +1,2467 @@ +/** + * jQuery Internationalization library + * + * Copyright (C) 2012 Santhosh Thottingal + * + * jquery.i18n is dual licensed GPLv2 or later and MIT. You don't have to do + * anything special to choose one license or the other and you don't have to + * notify anyone which license you are using. You are free to use + * UniversalLanguageSelector in commercial projects as long as the copyright + * header is left intact. See files GPL-LICENSE and MIT-LICENSE for details. + * + * @licence GNU General Public Licence 2.0 or later + * @licence MIT License + */ + +( function ( $, window, undefined ) { + "use strict"; + + var I18N = function ( options ) { + // Load defaults + this.options = $.extend( {}, $.i18n.defaults, options ); + this.parser = this.options.parser; + this.messageStore = this.options.messageStore; + this.languages = {}; + this.locale = this.options.locale; + this.init(); + }; + + I18N.prototype = { + /** + * Initialize by loading locales and setting up toLocaleString + */ + init: function () { + var that = this; + this.messageStore.init( this.locale ); + // Override String.localeString method + String.prototype.toLocaleString = function () { + var value = this.valueOf(); + var locale = that.locale; + var fallbackIndex = 0; + while ( locale ) { + // Iterate through locales starting at most-specific until + // localization is found. As in fi-Latn-FI, fi-Latn and fi. + var localeParts = locale.toLowerCase().split( "-" ); + var localePartIndex = localeParts.length; + do { + var _locale = localeParts.slice( 0, localePartIndex ).join( "-" ); + if ( !that.messageStore.messages[_locale] && that.options.messageLocationResolver ) { + // FIXME If messageloading gives 404, it keep on trying to + // load the file again and again + that.messageStore.load( + that.options.messageLocationResolver( _locale ), _locale ); + } + var message = that.messageStore.get( _locale, value ); + if ( message ) { + return message; + } + localePartIndex--; + } while (localePartIndex); + if ( locale === "en" ) { + break; + } + locale = ( $.i18n.fallbacks[that.locale] && $.i18n.fallbacks[that.locale][fallbackIndex] ) + || that.options.fallbackLocale; + that.log( "Trying fallback locale for " + that.locale + ": " + locale ); + fallbackIndex++; + } + return value; // fallback the original string value + }; + String.locale = this.locale; + }, + + destroy: function () { + $( 'body' ).data( 'i18n', null ); + }, + + /** + * General message loading API This can take a URL string for the json formatted messages. + * Eg: load('path/to/all_localizations.json'); + * + * This can also load a localization file for a locale Eg: load('path/to/de-messages.json', + * 'de' ); + * + * A data object containing message key- message translation mappings can also be passed Eg: + * load( { 'hello' : 'Hello' }, optionalLocale ); If the data argument is + * null/undefined/false, all cached messages for the i18n instance will get reset. + * + * @param {String|Object|null} data + * @param {String} locale Language tag + */ + load: function ( data, locale ) { + this.messageStore.load( data, locale ); + }, + + log: function (/* arguments */) { + var hasConsole = window.console !== undefined; + if ( hasConsole && $.i18n.debug ) { + window.console.log.apply( window.console, arguments ); + } + }, + + /** + * Does parameter and magic word substitution. + * + * @param {String} + * key Message key + * @param {Array} + * parameters Message parameters + * @return + * @string + */ + parse: function ( key, parameters ) { + var message = key.toLocaleString(); + this.parser.language = $.i18n.languages[$.i18n().locale] || $.i18n.languages['default']; + return this.parser.parse( message, parameters ); + } + }; + + + String.locale = String.locale || $( 'html' ).attr( 'lang' ); + if ( !String.locale ) { + if ( typeof window.navigator !== undefined ) { + var nav = window.navigator; + String.locale = nav.language || nav.userLanguage || ""; + } else { + String.locale = ""; + } + } + + $.i18n = function ( key, parameter_1 /* [, parameter_2] */) { + var parameters = [], i18n = $( 'body' ).data( 'i18n' ); + var options = typeof key === 'object' && key; + + if ( options && options.locale && i18n && i18n.locale !== options.locale ) { + String.locale = i18n.locale = options.locale; + } + + if ( !i18n ) { + $( 'body' ).data( 'i18n', ( i18n = new I18N( options ) ) ); + $( '[data-i18n]' ).each( function ( e ) { + var $this = $( this ); + if ( $this.data( 'i18n' ) ) { + var messageKey = $this.data( 'i18n' ); + var message = $.i18n( messageKey ); + if ( message !== messageKey ) { + $this.text( message ); + } + } + } ); + } + + if ( !key ) { + return i18n; + } + + // Support variadic arguments + if ( parameter_1 !== undefined ) { + parameters = $.makeArray( arguments ); + parameters.shift(); + } + + if ( typeof key === 'string' ) { + return i18n.parse( key, parameters ); + } else { + return i18n; + } + }; + + + $.fn.i18n = function ( option ) { + return this.each( function () { + var $this = $( this ); + if ( $this.data( 'i18n' ) ) { + var messageKey = $this.data( 'i18n' ); + var message = $.i18n( messageKey ); + if ( message !== messageKey ) { + $this.text( message ); + } + } else { + $this.find( '[data-i18n]' ).i18n(); + } + } ); + }; + + // The default parser only handles variable substitution + var defaultParser = { + parse: function ( message, parameters ) { + return message.replace( /\$(\d+)/g, function ( str, match ) { + var index = parseInt( match, 10 ) - 1; + return parameters[index] !== undefined ? parameters[index] : '$' + match; + } ); + } + }; + + $.i18n.languages = {}; + $.i18n.messageStore = $.i18n.messageStore || {}; + $.i18n.parser = defaultParser; + $.i18n.parser.emitter = {}; + $.i18n.debug = false; + $.i18n.defaults = { + locale: String.locale, + fallbackLocale: "en", + parser: $.i18n.parser, + messageStore: $.i18n.messageStore, + /* messageLocationResolver - should be a function taking language code as argument and + * returning absolute/ relative path to the localization file + */ + messageLocationResolver: null + }; + + $.i18n.Constructor = I18N; + + /** + * Convenient alias + */ + window._ = window._ || $.i18n; + +}( jQuery, window ) ); + +/** + * jQuery Internationalization library Message loading , parsing, retrieving utilities + * + * Copyright (C) 2012 Santhosh Thottingal + * + * jquery.i18n is dual licensed GPLv2 or later and MIT. You don't have to do anything special to + * choose one license or the other and you don't have to notify anyone which license you are using. + * You are free to use UniversalLanguageSelector in commercial projects as long as the copyright + * header is left intact. See files GPL-LICENSE and MIT-LICENSE for details. + * + * @licence GNU General Public Licence 2.0 or later + * @licence MIT License + */ + +( function ( $, window, undefined ) { + "use strict"; + + var MessageStore = function () { + this.messages = {}; + this.sources = {}; + this.locale = String.locale; + }; + + MessageStore.prototype = { + + /** + * See https://github.com/wikimedia/jquery.i18n/wiki/Specification#wiki-Message_File_Loading + * + * @param locale + */ + init: function ( locale ) { + this.locale = locale; + var that = this; + var $links = $( "link" ); + var linksCount = $links.length; + this.log( "initializing for " + locale ); + // Check for load('path/to/all_localizations.json'); + * + * This can also load a localization file for a locale + * load('path/to/de-messages.json', 'de' ); + * + * A data object containing message key- message translation mappings can also be passed Eg: + * + * load( { 'hello' : 'Hello' }, optionalLocale ); + * If the data argument is + * null/undefined/false, all cached messages for the i18n instance will get reset. + * + * @param {String|Object|null} data + * @param {String} locale Language tag + */ + load: function ( data, locale ) { + var that = this; + var hasOwn = Object.prototype.hasOwnProperty; + if ( !data ) { + // reset all localizations + this.log( "Resetting for locale" + locale ); + that.messages = {}; + return; + } + var dataType = typeof data; + if ( locale && this.locale !== locale ) { + // queue loading locale if not needed + if ( ! ( locale in this.sources ) ) { + this.sources[locale] = []; + } + this.log( "Queueing: " + locale + " Current locale " + this.locale ); + this.sources[locale].push( data ); + return; + } + if ( arguments.length > 0 && dataType !== "number" ) { + if ( dataType === "string" ) { + // This is a URL to the messages file. + this.log( "Loading messages from: " + data ); + this.jsonMessageLoader( data ).done( function ( localization, textStatus ) { + that.load( localization, locale ); + delete that.sources[locale]; + } ); + } else { + // data is Object + // Extend current localizations instead of completely + // overwriting them + var localization = data; + for ( var messageKey in localization ) { + if ( !hasOwn.call( localization, messageKey ) ) { + continue; + } + var messageKeyType = typeof messageKey; + if ( messageKeyType === "string" && locale ) { + that.log( "[" + locale + "][" + messageKey + "] : " + + localization[messageKey] ); + that.messages[locale] = that.messages[locale] || []; + that.messages[locale][messageKey] = localization[messageKey]; + } else { + var passedLocale = messageKey; + this.log( "Loading locale: " + passedLocale ); + that.load( localization[passedLocale], passedLocale ); + } + } + } + } + }, + + log: function (/* arguments */) { + var hasConsole = window.console !== undefined; + if ( hasConsole && $.i18n.debug ) { + window.console.log.apply( window.console, arguments ); + } + }, + + /** + * Load the messages from the source queue for the locale + * + * @param {String} locale + */ + loadFromQueue: function ( locale ) { + var that = this; + var queue = that.sources[locale]; + for ( var i = 0; i < queue.length; i++ ) { + that.load( queue[i], locale ); + } + delete that.sources[locale]; + }, + + jsonMessageLoader: function ( url ) { + var that = this; + return $.ajax( { + url: url, + dataType: "json", + async: false + // that is unfortunate + } ).fail( function ( jqxhr, settings, exception ) { + that.log( "Error in loading messages from " + url + " Exception: " + exception ); + } ); + }, + + /** + * + * @param locale + * @param messageKey + * @returns {Boolean} + */ + get: function ( locale, messageKey ) { + // load locale if not loaded + if ( this.sources[locale] ) { + // We need to switch to this locale + this.locale = locale; + this.loadFromQueue( locale ); + } + return this.messages[locale] && this.messages[locale][messageKey]; + } + }; + + $.extend( $.i18n.messageStore, new MessageStore() ); + +}( jQuery, window ) ); + +/** + * jQuery Internationalization library + * + * Copyright (C) 2012 Santhosh Thottingal + * + * jquery.i18n is dual licensed GPLv2 or later and MIT. You don't have to do anything special to + * choose one license or the other and you don't have to notify anyone which license you are using. + * You are free to use UniversalLanguageSelector in commercial projects as long as the copyright + * header is left intact. See files GPL-LICENSE and MIT-LICENSE for details. + * + * @licence GNU General Public Licence 2.0 or later + * @licence MIT License + */ +( function ( $, undefined ) { + $.i18n = $.i18n || {}; + $.i18n.fallbacks = { + "ab": ["ru"], + "ace": ["id"], + "aln": ["sq"], + "als": ["gsw", "de"], + "an": ["es"], + "anp": ["hi"], + "arn": ["es"], + "arz": ["ar"], + "av": ["ru"], + "ay": ["es"], + "ba": ["ru"], + "bar": ["de"], + "bat-smg": ["sgs", "lt"], + "bcc": ["fa"], + "be-x-old": ["be-tarask"], + "bh": ["bho"], + "bjn": ["id"], + "bm": ["fr"], + "bpy": ["bn"], + "bqi": ["fa"], + "bug": ["id"], + "cbk-zam": ["es"], + "ce": ["ru"], + "crh": ["crh-latn"], + "crh-cyrl": ["ru"], + "csb": ["pl"], + "cv": ["ru"], + "de-at": ["de"], + "de-ch": ["de"], + "de-formal": ["de"], + "dsb": ["de"], + "dtp": ["ms"], + "egl": ["it"], + "eml": ["it"], + "ff": ["fr"], + "fit": ["fi"], + "fiu-vro": ["vro", "et"], + "frc": ["fr"], + "frp": ["fr"], + "frr": ["de"], + "fur": ["it"], + "gag": ["tr"], + "gan": ["gan-hant", "zh-hant", "zh-hans"], + "gan-hans": ["zh-hans"], + "gan-hant": ["zh-hant", "zh-hans"], + "gl": ["pt"], + "glk": ["fa"], + "gn": ["es"], + "gsw": ["de"], + "hif": ["hif-latn"], + "hsb": ["de"], + "ht": ["fr"], + "ii": ["zh-cn", "zh-hans"], + "inh": ["ru"], + "iu": ["ike-cans"], + "jut": ["da"], + "jv": ["id"], + "kaa": ["kk-latn", "kk-cyrl"], + "kbd": ["kbd-cyrl"], + "khw": ["ur"], + "kiu": ["tr"], + "kk": ["kk-cyrl"], + "kk-arab": ["kk-cyrl"], + "kk-latn": ["kk-cyrl"], + "kk-cn": ["kk-arab", "kk-cyrl"], + "kk-kz": ["kk-cyrl"], + "kk-tr": ["kk-latn", "kk-cyrl"], + "kl": ["da"], + "ko-kp": ["ko"], + "koi": ["ru"], + "krc": ["ru"], + "ks": ["ks-arab"], + "ksh": ["de"], + "ku": ["ku-latn"], + "ku-arab": ["ckb"], + "kv": ["ru"], + "lad": ["es"], + "lb": ["de"], + "lbe": ["ru"], + "lez": ["ru"], + "li": ["nl"], + "lij": ["it"], + "liv": ["et"], + "lmo": ["it"], + "ln": ["fr"], + "ltg": ["lv"], + "lzz": ["tr"], + "mai": ["hi"], + "map-bms": ["jv", "id"], + "mg": ["fr"], + "mhr": ["ru"], + "min": ["id"], + "mo": ["ro"], + "mrj": ["ru"], + "mwl": ["pt"], + "myv": ["ru"], + "mzn": ["fa"], + "nah": ["es"], + "nap": ["it"], + "nds": ["de"], + "nds-nl": ["nl"], + "nl-informal": ["nl"], + "no": ["nb"], + "os": ["ru"], + "pcd": ["fr"], + "pdc": ["de"], + "pdt": ["de"], + "pfl": ["de"], + "pms": ["it"], + "pt": ["pt-br"], + "pt-br": ["pt"], + "qu": ["es"], + "qug": ["qu", "es"], + "rgn": ["it"], + "rmy": ["ro"], + "roa-rup": ["rup"], + "rue": ["uk", "ru"], + "ruq": ["ruq-latn", "ro"], + "ruq-cyrl": ["mk"], + "ruq-latn": ["ro"], + "sa": ["hi"], + "sah": ["ru"], + "scn": ["it"], + "sg": ["fr"], + "sgs": ["lt"], + "sli": ["de"], + "sr": ["sr-ec"], + "srn": ["nl"], + "stq": ["de"], + "su": ["id"], + "szl": ["pl"], + "tcy": ["kn"], + "tg": ["tg-cyrl"], + "tt": ["tt-cyrl", "ru"], + "tt-cyrl": ["ru"], + "ty": ["fr"], + "udm": ["ru"], + "ug": ["ug-arab"], + "uk": ["ru"], + "vec": ["it"], + "vep": ["et"], + "vls": ["nl"], + "vmf": ["de"], + "vot": ["fi"], + "vro": ["et"], + "wa": ["fr"], + "wo": ["fr"], + "wuu": ["zh-hans"], + "xal": ["ru"], + "xmf": ["ka"], + "yi": ["he"], + "za": ["zh-hans"], + "zea": ["nl"], + "zh": ["zh-hans"], + "zh-classical": ["lzh"], + "zh-cn": ["zh-hans"], + "zh-hant": ["zh-hans"], + "zh-hk": ["zh-hant", "zh-hans"], + "zh-min-nan": ["nan"], + "zh-mo": ["zh-hk", "zh-hant", "zh-hans"], + "zh-my": ["zh-sg", "zh-hans"], + "zh-sg": ["zh-hans"], + "zh-tw": ["zh-hant", "zh-hans"], + "zh-yue": ["yue"] + }; +}( jQuery ) ); + +/** + * jQuery Internationalization library + * + * Copyright (C) 2012 Santhosh Thottingal + * + * jquery.i18n is dual licensed GPLv2 or later and MIT. You don't have to do + * anything special to choose one license or the other and you don't have to + * notify anyone which license you are using. You are free to use + * UniversalLanguageSelector in commercial projects as long as the copyright + * header is left intact. See files GPL-LICENSE and MIT-LICENSE for details. + * + * @licence GNU General Public Licence 2.0 or later + * @licence MIT License + */ + +( function ( $ ) { + "use strict"; + + var MessageParser = function ( options ) { + this.options = $.extend( {}, $.i18n.parser.defaults, options ); + this.language = $.i18n.languages[$.i18n().locale]; + this.emitter = $.i18n.parser.emitter; + }; + + MessageParser.prototype = { + + constructor: MessageParser, + + simpleParse: function ( message, parameters ) { + return message.replace( /\$(\d+)/g, function ( str, match ) { + var index = parseInt( match, 10 ) - 1; + return parameters[index] !== undefined ? parameters[index] : '$' + match; + } ); + }, + + parse: function ( message, replacements ) { + if ( message.indexOf( '{{' ) < 0 ) { + return this.simpleParse( message, replacements ); + } + this.emitter.language = $.i18n.languages[$.i18n().locale] + || $.i18n.languages['default']; + return this.emitter.emit( this.ast( message ), replacements ); + }, + + ast: function ( message ) { + var pos = 0; + + // Try parsers until one works, if none work return null + function choice ( parserSyntax ) { + return function () { + for ( var i = 0; i < parserSyntax.length; i++) { + var result = parserSyntax[i](); + if ( result !== null ) { + return result; + } + } + return null; + }; + } + + // Try several parserSyntax-es in a row. + // All must succeed; otherwise, return null. + // This is the only eager one. + function sequence ( parserSyntax ) { + var originalPos = pos; + var result = []; + for ( var i = 0; i < parserSyntax.length; i++) { + var res = parserSyntax[i](); + if ( res === null ) { + pos = originalPos; + return null; + } + result.push( res ); + } + return result; + } + + // Run the same parser over and over until it fails. + // Must succeed a minimum of n times; otherwise, return null. + function nOrMore ( n, p ) { + return function () { + var originalPos = pos; + var result = []; + var parsed = p(); + while (parsed !== null) { + result.push( parsed ); + parsed = p(); + } + if ( result.length < n ) { + pos = originalPos; + return null; + } + return result; + }; + } + + // Helpers -- just make parserSyntax out of simpler JS builtin types + + function makeStringParser ( s ) { + var len = s.length; + return function () { + var result = null; + if ( message.substr( pos, len ) === s ) { + result = s; + pos += len; + } + return result; + }; + } + + function makeRegexParser ( regex ) { + return function () { + var matches = message.substr( pos ).match( regex ); + if ( matches === null ) { + return null; + } + pos += matches[0].length; + return matches[0]; + }; + } + + var pipe = makeStringParser( '|' ); + var colon = makeStringParser( ':' ); + var backslash = makeStringParser( "\\" ); + var anyCharacter = makeRegexParser( /^./ ); + var dollar = makeStringParser( '$' ); + var digits = makeRegexParser( /^\d+/ ); + var regularLiteral = makeRegexParser( /^[^{}\[\]$\\]/ ); + var regularLiteralWithoutBar = makeRegexParser( /^[^{}\[\]$\\|]/ ); + var regularLiteralWithoutSpace = makeRegexParser( /^[^{}\[\]$\s]/ ); + + // There is a general pattern -- parse a thing, if that worked, + // apply transform, otherwise return null. + // But using this as a combinator seems to cause problems when + // combined with nOrMore(). + // May be some scoping issue + function transform ( p, fn ) { + return function () { + var result = p(); + return result === null ? null : fn( result ); + }; + } + + // Used to define "literals" without spaces, in space-delimited + // situations + function literalWithoutSpace () { + var result = nOrMore( 1, escapedOrLiteralWithoutSpace )(); + return result === null ? null : result.join( '' ); + } + + // Used to define "literals" within template parameters. The pipe + // character is the parameter delimeter, so by default + // it is not a literal in the parameter + function literalWithoutBar () { + var result = nOrMore( 1, escapedOrLiteralWithoutBar )(); + return result === null ? null : result.join( '' ); + } + + function literal () { + var result = nOrMore( 1, escapedOrRegularLiteral )(); + return result === null ? null : result.join( '' ); + } + + function escapedLiteral () { + var result = sequence( [ backslash, anyCharacter ] ); + return result === null ? null : result[1]; + } + + var escapedOrLiteralWithoutSpace = choice( [ escapedLiteral, regularLiteralWithoutSpace ] ); + var escapedOrLiteralWithoutBar = choice( [ escapedLiteral, regularLiteralWithoutBar ] ); + var escapedOrRegularLiteral = choice( [ escapedLiteral, regularLiteral ] ); + + function replacement () { + var result = sequence( [ dollar, digits ] ); + if ( result === null ) { + return null; + } + return [ 'REPLACE', parseInt( result[1], 10 ) - 1 ]; + } + + var templateName = transform( + // see $wgLegalTitleChars + // not allowing : due to the need to catch "PLURAL:$1" + makeRegexParser( /^[ !"$&'()*,.\/0-9;=?@A-Z\^_`a-z~\x80-\xFF+\-]+/ ), + function ( result ) { + return result.toString(); + } ); + + function templateParam () { + var result = sequence( [ pipe, nOrMore( 0, paramExpression ) ] ); + if ( result === null ) { + return null; + } + var expr = result[1]; + // use a "CONCAT" operator if there are multiple nodes, + // otherwise return the first node, raw. + return expr.length > 1 ? [ "CONCAT" ].concat( expr ) : expr[0]; + } + + function templateWithReplacement () { + var result = sequence( [ templateName, colon, replacement ] ); + return result === null ? null : [ result[0], result[2] ]; + } + + function templateWithOutReplacement () { + var result = sequence( [ templateName, colon, paramExpression ] ); + return result === null ? null : [ result[0], result[2] ]; + } + + var templateContents = choice( [ + function () { + var res = sequence( [ + // templates can have placeholders for dynamic + // replacement eg: {{PLURAL:$1|one car|$1 cars}} + // or no placeholders eg: + // {{GRAMMAR:genitive|{{SITENAME}}} + choice( [ templateWithReplacement, templateWithOutReplacement ] ), + nOrMore( 0, templateParam ) ] ); + + return res === null ? null : res[0].concat( res[1] ); + }, function () { + var res = sequence( [ templateName, nOrMore( 0, templateParam ) ] ); + + if ( res === null ) { + return null; + } + + return [ res[0] ].concat( res[1] ); + } ] ); + + var openTemplate = makeStringParser( '{{' ); + + var closeTemplate = makeStringParser( '}}' ); + + function template () { + var result = sequence( [ openTemplate, templateContents, closeTemplate ] ); + return result === null ? null : result[1]; + } + + var expression = choice( [ template, replacement, literal ] ); + var paramExpression = choice( [ template, replacement, literalWithoutBar ] ); + + function start () { + var result = nOrMore( 0, expression )(); + + if ( result === null ) { + return null; + } + + return [ "CONCAT" ].concat( result ); + } + + var result = start(); + return result; + } + + }; + + $.extend( $.i18n.parser, new MessageParser() ); + +}( jQuery ) ); + +/** + * jQuery Internationalization library + * + * Copyright (C) 2012 Santhosh Thottingal + * + * jquery.i18n is dual licensed GPLv2 or later and MIT. You don't have to do + * anything special to choose one license or the other and you don't have to + * notify anyone which license you are using. You are free to use + * UniversalLanguageSelector in commercial projects as long as the copyright + * header is left intact. See files GPL-LICENSE and MIT-LICENSE for details. + * + * @licence GNU General Public Licence 2.0 or later + * @licence MIT License + */ + +( function ( $ ) { + "use strict"; + + var MessageParserEmitter = function () { + this.language = $.i18n.languages[$.i18n().locale] || $.i18n.languages['default']; + }; + + MessageParserEmitter.prototype = { + constructor: MessageParserEmitter, + /** + * (We put this method definition here, and not in prototype, to make + * sure it's not overwritten by any magic.) Walk entire node structure, + * applying replacements and template functions when appropriate + * + * @param {Mixed} + * abstract syntax tree (top node or subnode) + * @param {Array} + * replacements for $1, $2, ... $n + * @return {Mixed} single-string node or array of nodes suitable for + * jQuery appending + */ + emit: function ( node, replacements ) { + var ret = null; + var that = this; + + switch (typeof node) { + case 'string': + case 'number': + ret = node; + break; + case 'object': + // node is an array of nodes + var subnodes = $.map( node.slice( 1 ), function ( n ) { + return that.emit( n, replacements ); + } ); + var operation = node[0].toLowerCase(); + if ( typeof that[operation] === 'function' ) { + ret = that[operation]( subnodes, replacements ); + } else { + throw new Error( 'unknown operation "' + operation + '"' ); + } + break; + case 'undefined': + // Parsing the empty string (as an entire expression, or as a + // paramExpression in a template) results in undefined + // Perhaps a more clever parser can detect this, and return the + // empty string? Or is that useful information? + // The logical thing is probably to return the empty string here + // when we encounter undefined. + ret = ''; + break; + default: + throw new Error( 'unexpected type in AST: ' + typeof node ); + } + return ret; + }, + + /** + * Parsing has been applied depth-first we can assume that all nodes + * here are single nodes Must return a single node to parents -- a + * jQuery with synthetic span However, unwrap any other synthetic spans + * in our children and pass them upwards + * + * @param {Array} + * nodes - mixed, some single nodes, some arrays of nodes + * @return String + */ + concat: function ( nodes ) { + var result = ""; + $.each( nodes, function ( i, node ) { + // strings, integers, anything else + result += node; + } ); + return result; + }, + + /** + * Return escaped replacement of correct index, or string if + * unavailable. Note that we expect the parsed parameter to be + * zero-based. i.e. $1 should have become [ 0 ]. if the specified + * parameter is not found return the same string (e.g. "$99" -> + * parameter 98 -> not found -> return "$99" ) TODO throw error if + * nodes.length > 1 ? + * + * @param {Array} + * of one element, integer, n >= 0 + * @return {String} replacement + */ + replace: function ( nodes, replacements ) { + var index = parseInt( nodes[0], 10 ); + + if ( index < replacements.length ) { + // replacement is not a string, don't touch! + return replacements[index]; + } else { + // index not found, fallback to displaying variable + return '$' + ( index + 1 ); + } + }, + + /** + * Transform parsed structure into pluralization n.b. The first node may + * be a non-integer (for instance, a string representing an Arabic + * number). So convert it back with the current language's + * convertNumber. + * + * @param {Array} + * of nodes, [ {String|Number}, {String}, {String} ... ] + * @return {String} selected pluralized form according to current + * language + */ + plural: function ( nodes ) { + var count = parseFloat( this.language.convertNumber( nodes[0], 10 ) ); + var forms = nodes.slice( 1 ); + return forms.length ? this.language.convertPlural( count, forms ) : ''; + }, + + /** + * Transform parsed structure into gender Usage + * {{gender:gender|masculine|feminine|neutral}}. + * + * @param {Array} + * of nodes, [ {String}, {String}, {String} , {String} ] + * @return {String} selected gender form according to current language + */ + gender: function ( nodes ) { + var gender = nodes[0]; + var forms = nodes.slice( 1 ); + return this.language.gender( gender, forms ); + }, + + /** + * Transform parsed structure into grammar conversion. Invoked by + * putting {{grammar:form|word}} in a message + * + * @param {Array} + * of nodes [{Grammar case eg: genitive}, {String word}] + * @return {String} selected grammatical form according to current + * language + */ + grammar: function ( nodes ) { + var form = nodes[0]; + var word = nodes[1]; + return word && form && this.language.convertGrammar( word, form ); + } + }; + + $.extend( $.i18n.parser.emitter, new MessageParserEmitter() ); + +}( jQuery ) ); +/* global pluralRuleParser */ +( function ( $ ) { + "use strict"; + var language = { + + // CLDR plural rules generated using + // http://i18ndata.appspot.com/cldr/tags/unconfirmed/supplemental/plurals?action=browse&depth=-1 + // and compressed + pluralRules: { + gv: { + one: "n mod 10 in 1..2 or n mod 20 is 0" + }, + gu: { + one: "n is 1" + }, + rof: { + one: "n is 1" + }, + ga: { + few: "n in 3..6", + many: "n in 7..10", + two: "n is 2", + one: "n is 1" + }, + gl: { + one: "n is 1" + }, + lg: { + one: "n is 1" + }, + lb: { + one: "n is 1" + }, + xog: { + one: "n is 1" + }, + ln: { + one: "n in 0..1" + }, + lo: "", + brx: { + one: "n is 1" + }, + tr: "", + ts: { + one: "n is 1" + }, + tn: { + one: "n is 1" + }, + to: "", + lt: { + few: "n mod 10 in 2..9 and n mod 100 not in 11..19", + one: "n mod 10 is 1 and n mod 100 not in 11..19" + }, + tk: { + one: "n is 1" + }, + th: "", + ksb: { + one: "n is 1" + }, + te: { + one: "n is 1" + }, + ksh: { + zero: "n is 0", + one: "n is 1" + }, + fil: { + one: "n in 0..1" + }, + haw: { + one: "n is 1" + }, + kcg: { + one: "n is 1" + }, + ssy: { + one: "n is 1" + }, + yo: "", + de: { + one: "n is 1" + }, + ko: "", + da: { + one: "n is 1" + }, + dz: "", + dv: { + one: "n is 1" + }, + guw: { + one: "n in 0..1" + }, + shi: { + few: "n in 2..10", + one: "n within 0..1" + }, + el: { + one: "n is 1" + }, + eo: { + one: "n is 1" + }, + en: { + one: "n is 1" + }, + ses: "", + teo: { + one: "n is 1" + }, + ee: { + one: "n is 1" + }, + kde: "", + fr: { + one: "n within 0..2 and n is not 2" + }, + eu: { + one: "n is 1" + }, + et: { + one: "n is 1" + }, + es: { + one: "n is 1" + }, + seh: { + one: "n is 1" + }, + ru: { + few: "n mod 10 in 2..4 and n mod 100 not in 12..14", + many: "n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14", + one: "n mod 10 is 1 and n mod 100 is not 11" + }, + kl: { + one: "n is 1" + }, + sms: { + two: "n is 2", + one: "n is 1" + }, + smn: { + two: "n is 2", + one: "n is 1" + }, + smj: { + two: "n is 2", + one: "n is 1" + }, + smi: { + two: "n is 2", + one: "n is 1" + }, + fy: { + one: "n is 1" + }, + rm: { + one: "n is 1" + }, + ro: { + few: "n is 0 OR n is not 1 AND n mod 100 in 1..19", + one: "n is 1" + }, + bn: { + one: "n is 1" + }, + sma: { + two: "n is 2", + one: "n is 1" + }, + be: { + few: "n mod 10 in 2..4 and n mod 100 not in 12..14", + many: "n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14", + one: "n mod 10 is 1 and n mod 100 is not 11" + }, + bg: { + one: "n is 1" + }, + ms: "", + wa: { + one: "n in 0..1" + }, + ps: { + one: "n is 1" + }, + wo: "", + bm: "", + jv: "", + bo: "", + bh: { + one: "n in 0..1" + }, + kea: "", + asa: { + one: "n is 1" + }, + cgg: { + one: "n is 1" + }, + br: { + few: "n mod 10 in 3..4,9 and n mod 100 not in 10..19,70..79,90..99", + many: "n mod 1000000 is 0 and n is not 0", + two: "n mod 10 is 2 and n mod 100 not in 12,72,92", + one: "n mod 10 is 1 and n mod 100 not in 11,71,91" + }, + bs: { + few: "n mod 10 in 2..4 and n mod 100 not in 12..14", + many: "n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14", + one: "n mod 10 is 1 and n mod 100 is not 11" + }, + ja: "", + om: { + one: "n is 1" + }, + fa: "", + vun: { + one: "n is 1" + }, + or: { + one: "n is 1" + }, + xh: { + one: "n is 1" + }, + nso: { + one: "n in 0..1" + }, + ca: { + one: "n is 1" + }, + cy: { + few: "n is 3", + zero: "n is 0", + many: "n is 6", + two: "n is 2", + one: "n is 1" + }, + cs: { + few: "n in 2..4", + one: "n is 1" + }, + zh: "", + lv: { + zero: "n is 0", + one: "n mod 10 is 1 and n mod 100 is not 11" + }, + pt: { + one: "n is 1" + }, + wae: { + one: "n is 1" + }, + tl: { + one: "n in 0..1" + }, + chr: { + one: "n is 1" + }, + pa: { + one: "n is 1" + }, + ak: { + one: "n in 0..1" + }, + pl: { + few: "n mod 10 in 2..4 and n mod 100 not in 12..14", + many: "n is not 1 and n mod 10 in 0..1 or n mod 10 in 5..9 or n mod 100 in 12..14", + one: "n is 1" + }, + hr: { + few: "n mod 10 in 2..4 and n mod 100 not in 12..14", + many: "n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14", + one: "n mod 10 is 1 and n mod 100 is not 11" + }, + am: { + one: "n in 0..1" + }, + ti: { + one: "n in 0..1" + }, + hu: "", + hi: { + one: "n in 0..1" + }, + jmc: { + one: "n is 1" + }, + ha: { + one: "n is 1" + }, + he: { + one: "n is 1" + }, + mg: { + one: "n in 0..1" + }, + fur: { + one: "n is 1" + }, + bem: { + one: "n is 1" + }, + ml: { + one: "n is 1" + }, + mo: { + few: "n is 0 OR n is not 1 AND n mod 100 in 1..19", + one: "n is 1" + }, + mn: { + one: "n is 1" + }, + mk: { + one: "n mod 10 is 1 and n is not 11" + }, + ur: { + one: "n is 1" + }, + bez: { + one: "n is 1" + }, + mt: { + few: "n is 0 or n mod 100 in 2..10", + many: "n mod 100 in 11..19", + one: "n is 1" + }, + uk: { + few: "n mod 10 in 2..4 and n mod 100 not in 12..14", + many: "n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14", + one: "n mod 10 is 1 and n mod 100 is not 11" + }, + mr: { + one: "n is 1" + }, + ta: { + one: "n is 1" + }, + my: "", + sah: "", + ve: { + one: "n is 1" + }, + af: { + one: "n is 1" + }, + vi: "", + is: { + one: "n is 1" + }, + iu: { + two: "n is 2", + one: "n is 1" + }, + it: { + one: "n is 1" + }, + kn: "", + ii: "", + ar: { + few: "n mod 100 in 3..10", + zero: "n is 0", + many: "n mod 100 in 11..99", + two: "n is 2", + one: "n is 1" + }, + zu: { + one: "n is 1" + }, + saq: { + one: "n is 1" + }, + az: "", + tzm: { + one: "n in 0..1 or n in 11..99" + }, + id: "", + ig: "", + pap: { + one: "n is 1" + }, + nl: { + one: "n is 1" + }, + nn: { + one: "n is 1" + }, + no: { + one: "n is 1" + }, + nah: { + one: "n is 1" + }, + nd: { + one: "n is 1" + }, + ne: { + one: "n is 1" + }, + ny: { + one: "n is 1" + }, + naq: { + two: "n is 2", + one: "n is 1" + }, + nyn: { + one: "n is 1" + }, + kw: { + two: "n is 2", + one: "n is 1" + }, + nr: { + one: "n is 1" + }, + tig: { + one: "n is 1" + }, + kab: { + one: "n within 0..2 and n is not 2" + }, + mas: { + one: "n is 1" + }, + rwk: { + one: "n is 1" + }, + kaj: { + one: "n is 1" + }, + lag: { + zero: "n is 0", + one: "n within 0..2 and n is not 0 and n is not 2" + }, + syr: { + one: "n is 1" + }, + kk: { + one: "n is 1" + }, + ff: { + one: "n within 0..2 and n is not 2" + }, + fi: { + one: "n is 1" + }, + fo: { + one: "n is 1" + }, + ka: "", + gsw: { + one: "n is 1" + }, + ckb: { + one: "n is 1" + }, + ss: { + one: "n is 1" + }, + sr: { + few: "n mod 10 in 2..4 and n mod 100 not in 12..14", + many: "n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14", + one: "n mod 10 is 1 and n mod 100 is not 11" + }, + sq: { + one: "n is 1" + }, + sw: { + one: "n is 1" + }, + sv: { + one: "n is 1" + }, + km: "", + st: { + one: "n is 1" + }, + sk: { + few: "n in 2..4", + one: "n is 1" + }, + sh: { + few: "n mod 10 in 2..4 and n mod 100 not in 12..14", + many: "n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14", + one: "n mod 10 is 1 and n mod 100 is not 11" + }, + so: { + one: "n is 1" + }, + sn: { + one: "n is 1" + }, + ku: { + one: "n is 1" + }, + sl: { + few: "n mod 100 in 3..4", + two: "n mod 100 is 2", + one: "n mod 100 is 1" + }, + sg: "", + nb: { + one: "n is 1" + }, + se: { + two: "n is 2", + one: "n is 1" + } + }, + + /** + * Plural form transformations, needed for some languages. + * + * @param count + * integer Non-localized quantifier + * @param forms + * array List of plural forms + * @return string Correct form for quantifier in this language + */ + convertPlural: function ( count, forms ) { + var pluralFormIndex = 0; + if ( !forms || forms.length === 0 ) { + return ''; + } + var pluralRules = this.pluralRules[$.i18n().locale]; + if ( !pluralRules ) { + // default fallback. + return ( count === 1 ) ? forms[0] : forms[1]; + } + pluralFormIndex = this.getPluralForm( count, pluralRules ); + pluralFormIndex = Math.min( pluralFormIndex, forms.length - 1 ); + return forms[pluralFormIndex]; + }, + + /** + * For the number, get the plural for index + * + * @param number + * @param pluralRules + * @return plural form index + */ + getPluralForm: function ( number, pluralRules ) { + var pluralForms = [ 'zero', 'one', 'two', 'few', 'many', 'other' ]; + var pluralFormIndex = 0; + for ( var i = 0; i < pluralForms.length; i++) { + if ( pluralRules[pluralForms[i]] ) { + if ( pluralRuleParser( pluralRules[pluralForms[i]], number ) ) { + return pluralFormIndex; + } + pluralFormIndex++; + } + } + return pluralFormIndex; + }, + + /** + * Converts a number using digitTransformTable. + * + * @param {num} + * number Value to be converted + * @param {boolean} + * integer Convert the return value to an integer + */ + 'convertNumber': function ( num, integer ) { + // Set the target Transform table: + var transformTable = this.digitTransformTable( $.i18n().locale ), numberString = '' + + num, convertedNumber = ''; + if ( !transformTable ) { + return num; + } + // Check if the "restore" to Latin number flag is set: + if ( integer ) { + if ( parseFloat( num, 10 ) === num ) { + return num; + } + var tmp = []; + for ( var item in transformTable) { + tmp[transformTable[item]] = item; + } + transformTable = tmp; + } + for ( var i = 0; i < numberString.length; i++) { + if ( transformTable[numberString[i]] ) { + convertedNumber += transformTable[numberString[i]]; + } else { + convertedNumber += numberString[i]; + } + } + + return integer ? parseFloat( convertedNumber, 10 ) : convertedNumber; + }, + + /** + * Grammatical transformations, needed for inflected languages. + * Invoked by putting {{grammar:form|word}} in a message. + * forms can be computed dynamically by overriding this method per language + * + * @param word {String} + * @param form {String} + * @return {String} + */ + convertGrammar: function ( word, form ) { + return word + form; + }, + + /** + * Provides an alternative text depending on specified gender. Usage + * {{gender:[gender|user object]|masculine|feminine|neutral}}. If second + * or third parameter are not specified, masculine is used. + * + * These details may be overriden per language. + * + * @param gender + * string male, female, or anything else for neutral. + * @param forms + * array List of gender forms + * + * @return string + */ + 'gender': function ( gender, forms ) { + if ( !forms || forms.length === 0 ) { + return ''; + } + while (forms.length < 2) { + forms.push( forms[forms.length - 1] ); + } + if ( gender === 'male' ) { + return forms[0]; + } + if ( gender === 'female' ) { + return forms[1]; + } + return ( forms.length === 3 ) ? forms[2] : forms[0]; + }, + + /** + * Get the digit transform table for the given language + * See http://cldr.unicode.org/translation/numbering-systems + * @param language + * @returns Array of digits in the passed language representation + */ + digitTransformTable: function ( language ) { + var tables = { + ar: "۰۱۲۳۴۵۶۷۸۹", + ml: "൦൧൨൩൪൫൬൭൮൯", + kn: "೦೧೨೩೪೫೬೭೮೯", + lo: "໐໑໒໓໔໕໖໗໘໙", + or: "୦୧୨୩୪୫୬୭୮୯", + kh: "០១២៣៤៥៦៧៨៩", + pa: "੦੧੨੩੪੫੬੭੮੯", + gu: "૦૧૨૩૪૫૬૭૮૯", + hi: "०१२३४५६७८९", + my: "၀၁၂၃၄၅၆၇၈၉", + ta: "௦௧௨௩௪௫௬௭௮௯", + te: "౦౧౨౩౪౫౬౭౮౯", + th: "๐๑๒๓๔๕๖๗๘๙", //FIXME use iso 639 codes + bo: "༠༡༢༣༤༥༦༧༨༩" //FIXME use iso 639 codes + }; + if ( !tables[language] ) { + return null; + } + return tables[language].split( "" ); + } + }; + + $.extend( $.i18n.languages, { + 'default': language + } ); + +}( jQuery ) ); + +/** + * Bosnian (bosanski) language functions + */ +( function ( $ ) { + "use strict"; + var bosanski = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + switch (form) { + case 'instrumental': // instrumental + word = 's ' + word; + break; + case 'lokativ': // locative + word = 'o ' + word; + break; + } + return word; + } + } ); + $.extend( $.i18n.languages, { + 'bs': bosanski + } ); +}( jQuery ) ); + +/** + * Lower Sorbian (Dolnoserbski) language functions + */ + +( function ( $ ) { + "use strict"; + var dsb = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + switch (form) { + case 'instrumental': // instrumental + word = 'z ' + word; + break; + case 'lokatiw': // lokatiw + word = 'wo ' + word; + break; + } + return word; + } + } ); + $.extend( $.i18n.languages, { + 'dsb': dsb + } ); +}( jQuery ) ); + +/** + * Finnish (Suomi) language functions + * + * @author Santhosh Thottingal + */ + +( function ( $ ) { + "use strict"; + var finnish = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + // vowel harmony flag + var aou = word.match( /[aou][^äöy]*$/i ); + var origWord = word; + if ( word.match( /wiki$/i ) ) { + aou = false; + } + // append i after final consonant + if ( word.match( /[bcdfghjklmnpqrstvwxz]$/i ) ) { + word += 'i'; + } + + switch (form) { + case 'genitive': + word += 'n'; + break; + case 'elative': + word += ( aou ? 'sta' : 'stä' ); + break; + case 'partitive': + word += ( aou ? 'a' : 'ä' ); + break; + case 'illative': + // Double the last letter and add 'n' + word += word.substr( word.length - 1 ) + 'n'; + break; + case 'inessive': + word += ( aou ? 'ssa' : 'ssä' ); + break; + default: + word = origWord; + break; + } + return word; + } + } ); + $.extend( $.i18n.languages, { + 'fi': finnish + } ); +}( jQuery ) ); + +/** + * Irish (Gaeilge) language functions + */ + +( function ( $ ) { + "use strict"; + var ga = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + if ( form === 'ainmlae' ) { + switch (word) { + case 'an Domhnach': + word = 'Dé Domhnaigh'; + break; + case 'an Luan': + word = 'Dé Luain'; + break; + case 'an Mháirt': + word = 'Dé Mháirt'; + break; + case 'an Chéadaoin': + word = 'Dé Chéadaoin'; + break; + case 'an Déardaoin': + word = 'Déardaoin'; + break; + case 'an Aoine': + word = 'Dé hAoine'; + break; + case 'an Satharn': + word = 'Dé Sathairn'; + break; + } + } + return word; + } + } ); + $.extend( $.i18n.languages, { + 'ga': ga + } ); +}( jQuery ) ); + +/** + * Hebrew (עברית) language functions + */ + +( function ( $ ) { + "use strict"; + var hebrew = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + switch (form) { + case 'prefixed': + case 'תחילית': // the same word in Hebrew + // Duplicate prefixed "Waw", but only if it's not already double + if ( word.substr( 0, 1 ) === "ו" && word.substr( 0, 2 ) !== "וו" ) { + word = "ו" + word; + } + + // Remove the "He" if prefixed + if ( word.substr( 0, 1 ) === "ה" ) { + word = word.substr( 1, word.length ); + } + + // Add a hyphen (maqaf) before numbers and non-Hebrew letters + if ( word.substr( 0, 1 ) < "א" || word.substr( 0, 1 ) > "ת" ) { + word = "־" + word; + } + } + return word; + } + } ); + $.extend( $.i18n.languages, { + 'he': hebrew + } ); +}( jQuery ) ); + +/** + * Upper Sorbian (Hornjoserbsce) language functions + */ + +( function ( $ ) { + "use strict"; + var hsb = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + switch (form) { + case 'instrumental': // instrumental + word = 'z ' + word; + break; + case 'lokatiw': // lokatiw + word = 'wo ' + word; + break; + } + return word; + } + } ); + $.extend( $.i18n.languages, { + 'hsb': hsb + } ); +}( jQuery ) ); + +/** + * Hungarian language functions + * + * @author Santhosh Thottingal + */ + +( function ( $ ) { + "use strict"; + var hu = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + switch (form) { + case 'rol': + word += 'ról'; + break; + case 'ba': + word += 'ba'; + break; + case 'k': + word += 'k'; + break; + } + return word; + } + } ); + $.extend( $.i18n.languages, { + 'hu': hu + } ); +}( jQuery ) ); + +/** + * Armenian (Հայերեն) language functions + */ + +( function ( $ ) { + "use strict"; + var hy = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + if ( form === 'genitive' ) {// սեռական հոլով + if ( word.substr( -1 ) === 'ա' ) { + word = word.substr( 0, word.length - 1 ) + 'այի'; + } else if ( word.substr( -1 ) === 'ո' ) { + word = word.substr( 0, word.length - 1 ) + 'ոյի'; + } else if ( word.substr( -4 ) === 'գիրք' ) { + word = word.substr( 0, word.length - 4 ) + 'գրքի'; + } else { + word = word + 'ի'; + } + } + return word; + } + } ); + $.extend( $.i18n.languages, { + 'hy': hy + } ); +}( jQuery ) ); + +/** + * Latin (lingua Latina) language functions + * + * @author Santhosh Thottingal + */ + +( function ( $ ) { + "use strict"; + var la = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + switch (form) { + case 'genitive': + // only a few declensions, and even for those mostly the singular only + word = word.replace( /u[ms]$/i, 'i' ); // 2nd declension singular + word = word.replace( /ommunia$/i, 'ommunium' ); // 3rd declension neuter plural (partly) + word = word.replace( /a$/i, 'ae' ); // 1st declension singular + word = word.replace( /libri$/i, 'librorum' ); // 2nd declension plural (partly) + word = word.replace( /nuntii$/i, 'nuntiorum' ); // 2nd declension plural (partly) + word = word.replace( /tio$/i, 'tionis' ); // 3rd declension singular (partly) + word = word.replace( /ns$/i, 'ntis' ); + word = word.replace( /as$/i, 'atis' ); + word = word.replace( /es$/i, 'ei' ); // 5th declension singular + break; + case 'accusative': + // only a few declensions, and even for those mostly the singular only + word = word.replace( /u[ms]$/i, 'um' ); // 2nd declension singular + word = word.replace( /ommunia$/i, 'am' ); // 3rd declension neuter plural (partly) + word = word.replace( /a$/i, 'ommunia' ); // 1st declension singular + word = word.replace( /libri$/i, 'libros' ); // 2nd declension plural (partly) + word = word.replace( /nuntii$/i, 'nuntios' );// 2nd declension plural (partly) + word = word.replace( /tio$/i, 'tionem' ); // 3rd declension singular (partly) + word = word.replace( /ns$/i, 'ntem' ); + word = word.replace( /as$/i, 'atem' ); + word = word.replace( /es$/i, 'em' ); // 5th declension singular + break; + case 'ablative': + // only a few declensions, and even for those mostly the singular only + word = word.replace( /u[ms]$/i, 'o' ); // 2nd declension singular + word = word.replace( /ommunia$/i, 'ommunibus' ); // 3rd declension neuter plural (partly) + word = word.replace( /a$/i, 'a' ); // 1st declension singular + word = word.replace( /libri$/i, 'libris' ); // 2nd declension plural (partly) + word = word.replace( /nuntii$/i, 'nuntiis' ); // 2nd declension plural (partly) + word = word.replace( /tio$/i, 'tione' ); // 3rd declension singular (partly) + word = word.replace( /ns$/i, 'nte' ); + word = word.replace( /as$/i, 'ate' ); + word = word.replace( /es$/i, 'e' ); // 5th declension singular + break; + } + return word; + } + } ); + $.extend( $.i18n.languages, { + 'la': la + } ); +}( jQuery ) ); + +/** + * Ossetian (Ирон) language functions + * + * @author Santhosh Thottingal + */ + +( function ( $ ) { + "use strict"; + var os = $.extend( {}, $.i18n.languages['default'], + { + convertGrammar: function ( word, form ) { + // Ending for allative case + var end_allative = 'мæ'; + // Variable for 'j' beetwen vowels + var jot = ''; + // Variable for "-" for not Ossetic words + var hyphen = ''; + // Variable for ending + var ending = ''; + // Checking if the $word is in plural form + if ( word.match( /тæ$/i ) ) { + word = word.substring( 0, word.length - 1 ); + end_allative = 'æм'; + } + // Works if word is in singular form. + // Checking if word ends on one of the vowels: е, ё, и, о, ы, э, ю, + // я. + else if ( word.match( /[аæеёиоыэюя]$/i ) ) { + jot = 'й'; + } + // Checking if word ends on 'у'. 'У' can be either consonant 'W' or + // vowel 'U' in cyrillic Ossetic. + // Examples: {{grammar:genitive|аунеу}} = аунеуы, + // {{grammar:genitive|лæппу}} = лæппуйы. + else if ( word.match( /у$/i ) ) { + if ( !word.substring( word.length - 2, word.length - 1 ).match( + /[аæеёиоыэюя]$/i ) ) { + jot = 'й'; + } + } else if ( !word.match( /[бвгджзйклмнопрстфхцчшщьъ]$/i ) ) { + hyphen = '-'; + } + + switch (form) { + case 'genitive': + ending = hyphen + jot + 'ы'; + break; + case 'dative': + ending = hyphen + jot + 'æн'; + break; + case 'allative': + ending = hyphen + end_allative; + break; + case 'ablative': + if ( jot === 'й' ) { + ending = hyphen + jot + 'æ'; + } else { + ending = hyphen + jot + 'æй'; + } + break; + case 'superessive': + ending = hyphen + jot + 'ыл'; + break; + case 'equative': + ending = hyphen + jot + 'ау'; + break; + case 'comitative': + ending = hyphen + 'имæ'; + break; + } + return word + ending; + } + } ); + $.extend( $.i18n.languages, { + 'os': os + } ); +}( jQuery ) ); + +/** + * Russian (Русский) language functions + */ + +( function ( $ ) { + "use strict"; + var ru = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + if ( form === 'genitive' ) { // родительный падеж + if ( ( word.substr( word.length - 4 ) === 'вики' ) + || ( word.substr( word.length - 4 ) === 'Вики' ) ) { + } else if ( word.substr( word.length - 1 ) === 'ь' ) { + word = word.substr( 0, word.length - 1 ) + 'я'; + } else if ( word.substr( word.length - 2 ) === 'ия' ) { + word = word.substr( 0, word.length - 2 ) + 'ии'; + } else if ( word.substr( word.length - 2 ) === 'ка' ) { + word = word.substr( 0, word.length - 2 ) + 'ки'; + } else if ( word.substr( word.length - 2 ) === 'ти' ) { + word = word.substr( 0, word.length - 2 ) + 'тей'; + } else if ( word.substr( word.length - 2 ) === 'ды' ) { + word = word.substr( 0, word.length - 2 ) + 'дов'; + } else if ( word.substr( word.length - 3 ) === 'ник' ) { + word = word.substr( 0, word.length - 3 ) + 'ника'; + } + } + return word; + } + } ); + $.extend( $.i18n.languages, { + 'ru': ru + } ); +}( jQuery ) ); +/** + * Slovenian (Slovenščina) language functions + */ + +( function ( $ ) { + "use strict"; + var sl = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + switch (form) { + case 'mestnik': // locative + word = 'o ' + word; + break; + case 'orodnik': // instrumental + word = 'z ' + word; + break; + } + return word; + } + + } ); + $.extend( $.i18n.languages, { + 'sl': sl + } ); +}( jQuery ) ); +/** + * Ukrainian (Українська) language functions + */ + +( function ( $ ) { + "use strict"; + var uk = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + switch (form) { + case 'genitive': // родовий відмінок + if ( ( word.substr( word.length - 4 ) === 'вікі' ) + || ( word.substr( word.length - 4 ) === 'Вікі' ) ) { + } else if ( word.substr( word.length - 1 ) === 'ь' ) { + word = word.substr( 0, word.length - 1 ) + 'я'; + } else if ( word.substr( word.length - 2 ) === 'ія' ) { + word = word.substr( 0, word.length - 2 ) + 'ії'; + } else if ( word.substr( word.length - 2 ) === 'ка' ) { + word = word.substr( 0, word.length - 2 ) + 'ки'; + } else if ( word.substr( word.length - 2 ) === 'ти' ) { + word = word.substr( 0, word.length - 2 ) + 'тей'; + } else if ( word.substr( word.length - 2 ) === 'ды' ) { + word = word.substr( 0, word.length - 2 ) + 'дов'; + } else if ( word.substr( word.length - 3 ) === 'ник' ) { + word = word.substr( 0, word.length - 3 ) + 'ника'; + } + break; + case 'accusative': // знахідний відмінок + if ( ( word.substr( word.length - 4 ) === 'вікі' ) + || ( word.substr( word.length - 4 ) === 'Вікі' ) ) { + } else if ( word.substr( word.length - 2 ) === 'ія' ) { + word = word.substr( 0, word.length - 2 ) + 'ію'; + } + break; + } + return word; + } + } ); + $.extend( $.i18n.languages, { + 'uk': uk + } ); +}( jQuery ) ); +/** + * cldrpluralparser.js + * A parser engine for CLDR plural rules. + * + * Copyright 2012 GPLV3+, Santhosh Thottingal + * + * @version 0.1.0-alpha + * @source https://github.com/santhoshtr/CLDRPluralRuleParser + * @author Santhosh Thottingal + * @author Timo Tijhof + * @author Amir Aharoni + */ + +/** + * Evaluates a plural rule in CLDR syntax for a number + * @param rule + * @param number + * @return true|false|null + */ +function pluralRuleParser(rule, number) { + /* + Syntax: see http://unicode.org/reports/tr35/#Language_Plural_Rules + ----------------------------------------------------------------- + + condition = and_condition ('or' and_condition)* + and_condition = relation ('and' relation)* + relation = is_relation | in_relation | within_relation | 'n' + is_relation = expr 'is' ('not')? value + in_relation = expr ('not')? 'in' range_list + within_relation = expr ('not')? 'within' range_list + expr = 'n' ('mod' value)? + range_list = (range | value) (',' range_list)* + value = digit+ + digit = 0|1|2|3|4|5|6|7|8|9 + range = value'..'value + + */ + // Indicates current position in the rule as we parse through it. + // Shared among all parsing functions below. + var pos = 0; + + var whitespace = makeRegexParser(/^\s+/); + var digits = makeRegexParser(/^\d+/); + + var _n_ = makeStringParser('n'); + var _is_ = makeStringParser('is'); + var _mod_ = makeStringParser('mod'); + var _not_ = makeStringParser('not'); + var _in_ = makeStringParser('in'); + var _within_ = makeStringParser('within'); + var _range_ = makeStringParser('..'); + var _comma_ = makeStringParser(','); + var _or_ = makeStringParser('or'); + var _and_ = makeStringParser('and'); + + function debug() { + /* console.log.apply(console, arguments);*/ + } + + debug('pluralRuleParser', rule, number); + + // Try parsers until one works, if none work return null + function choice(parserSyntax) { + return function () { + for (var i = 0; i < parserSyntax.length; i++) { + var result = parserSyntax[i](); + if (result !== null) { + return result; + } + } + return null; + }; + } + + // Try several parserSyntax-es in a row. + // All must succeed; otherwise, return null. + // This is the only eager one. + function sequence(parserSyntax) { + var originalPos = pos; + var result = []; + for (var i = 0; i < parserSyntax.length; i++) { + var res = parserSyntax[i](); + if (res === null) { + pos = originalPos; + return null; + } + result.push(res); + } + return result; + } + + // Run the same parser over and over until it fails. + // Must succeed a minimum of n times; otherwise, return null. + function nOrMore(n, p) { + return function () { + var originalPos = pos; + var result = []; + var parsed = p(); + while (parsed !== null) { + result.push(parsed); + parsed = p(); + } + if (result.length < n) { + pos = originalPos; + return null; + } + return result; + }; + } + + // Helpers -- just make parserSyntax out of simpler JS builtin types + + function makeStringParser(s) { + var len = s.length; + return function () { + var result = null; + if (rule.substr(pos, len) === s) { + result = s; + pos += len; + } + return result; + }; + } + + function makeRegexParser(regex) { + return function () { + var matches = rule.substr(pos).match(regex); + if (matches === null) { + return null; + } + pos += matches[0].length; + return matches[0]; + }; + } + + function n() { + var result = _n_(); + if (result === null) { + debug(" -- failed n"); + return result; + } + result = parseInt(number, 10); + debug(" -- passed n ", result); + return result; + } + + var expression = choice([mod, n]); + + function mod() { + var result = sequence([n, whitespace, _mod_, whitespace, digits]); + if (result === null) { + debug(" -- failed mod"); + return null; + } + debug(" -- passed mod"); + return parseInt(result[0], 10) % parseInt(result[4], 10); + } + + function not() { + var result = sequence([whitespace, _not_]); + if (result === null) { + debug(" -- failed not"); + return null; + } else { + return result[1]; + } + } + + function is() { + var result = sequence([expression, whitespace, _is_, nOrMore(0, not), whitespace, digits]); + if (result !== null) { + debug(" -- passed is"); + if (result[3][0] === 'not') { + return result[0] !== parseInt(result[5], 10); + } else { + return result[0] === parseInt(result[5], 10); + } + } + debug(" -- failed is"); + return null; + } + + function rangeList() { + // range_list = (range | value) (',' range_list)* + var result = sequence([choice([range, digits]), nOrMore(0, rangeTail)]); + var resultList = []; + if (result !== null) { + resultList = resultList.concat(result[0], result[1][0]); + return resultList; + } + debug(" -- failed rangeList"); + return null; + } + + function rangeTail() { + // ',' range_list + var result = sequence([_comma_, rangeList]); + if (result !== null) { + return result[1]; + } + debug(" -- failed rangeTail"); + return null; + } + + function range() { + var result = sequence([digits, _range_, digits]); + if (result !== null) { + debug(" -- passed range"); + var array = []; + var left = parseInt(result[0], 10); + var right = parseInt(result[2], 10); + for ( i = left; i <= right; i++) { + array.push(i); + } + return array; + } + debug(" -- failed range"); + return null; + } + + function _in() { + // in_relation = expr ('not')? 'in' range_list + var result = sequence([expression, nOrMore(0, not), whitespace, _in_, whitespace, rangeList]); + if (result !== null) { + debug(" -- passed _in"); + var range_list = result[5]; + for (var i = 0; i < range_list.length; i++) { + if (parseInt(range_list[i], 10) === result[0]) { + return (result[1][0] !== 'not'); + } + } + return (result[1][0] === 'not'); + } + debug(" -- failed _in "); + return null; + } + + function within() { + var result = sequence([expression, whitespace, _within_, whitespace, rangeList]); + if (result !== null) { + debug(" -- passed within "); + var range_list = result[4]; + return (parseInt( range_list[0],10 )<= result[0] && result[0] <= parseInt( range_list[1], 10)); + } + debug(" -- failed within "); + return null; + } + + + var relation = choice([is, _in, within]); + + function and() { + var result = sequence([relation, whitespace, _and_, whitespace, condition]); + if (result) { + debug(" -- passed and"); + return result[0] && result[4]; + } + debug(" -- failed and"); + return null; + } + + function or() { + var result = sequence([relation, whitespace, _or_, whitespace, condition]); + if (result) { + debug(" -- passed or"); + return result[0] || result[4]; + } + debug(" -- failed or"); + return null; + } + + var condition = choice([and, or, relation]); + + function isInt(n) { + return parseFloat(n) % 1 === 0; + } + + + function start() { + if (!isInt(number)) { + return false; + } + var result = condition(); + return result; + } + + + var result = start(); + + /* + * For success, the pos must have gotten to the end of the rule + * and returned a non-null. + * n.b. This is part of language infrastructure, so we do not throw an internationalizable message. + */ + if (result === null || pos !== rule.length) { + // throw new Error("Parse error at position " + pos.toString() + " in input: " + rule + " result is " + result); + } + + return result; +} + +/* For module loaders, e.g. NodeJS, NPM */ +if (typeof module !== 'undefined' && module.exports) { + module.exports = pluralRuleParser; +} + diff --git a/lib/jquery.uls/.gitignore b/lib/jquery.uls/.gitignore deleted file mode 100644 index 07e6e472..00000000 --- a/lib/jquery.uls/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/lib/jquery.uls/README.md b/lib/jquery.uls/README.md deleted file mode 100644 index d3f76ede..00000000 --- a/lib/jquery.uls/README.md +++ /dev/null @@ -1,19 +0,0 @@ -jQuery Universal Language Selector -================================== -Universal Language Selector - -Introduction -------------- - - - -Preparing language data ------------------------- - -The language names, autonyms, region informations are present in src/jquery.uls.data.js. -But this file is auto generated from data/langdb.yaml. If you want to make any changes to the -language data, edit data/langdb.yaml and generate the src/jquery.uls.data.js using - -```bash -php ulsdata2json.php -``` diff --git a/lib/jquery.uls/css/jquery.uls.css b/lib/jquery.uls/css/jquery.uls.css index 4fd45754..67274dd0 100644 --- a/lib/jquery.uls/css/jquery.uls.css +++ b/lib/jquery.uls/css/jquery.uls.css @@ -214,3 +214,395 @@ span#languagefilter-clear { #search-input-block { position: relative; } + +/* Generated using Foundation http://foundation.zurb.com/docs/grid.php */ +/* Global Reset & Standards ---------------------- */ +.uls-menu * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +/* Misc ---------------------- */ +.left { + float: left; +} + +.right { + float: right; +} + +.text-left { + text-align: left; +} + +.text-right { + text-align: right; +} + +.text-center { + text-align: center; +} + +.hide { + display: none; +} + +.highlight { + background: #ffff99; +} + +/* The Grid ---------------------- */ +.row { + width: 100%; + max-width: none; + min-width: 600px; + margin: 0 auto; +} +.row .row { + width: auto; + max-width: none; + min-width: 0; + margin: 0 -5px; +} +.row.collapse .column, .row.collapse .columns { + padding: 0; +} +.row .row { + width: auto; + max-width: none; + min-width: 0; + margin: 0 -5px; +} +.row .row.collapse { + margin: 0; +} + +.column, .columns { + float: left; + min-height: 1px; + padding: 0 5px; + position: relative; +} +.column.centered, .columns.centered { + float: none; + margin: 0 auto; +} + +.row .one { + width: 8.333%; +} + +.row .two { + width: 16.667%; +} + +.row .three { + width: 25%; +} + +.row .four { + width: 33.333%; +} + +.row .five { + width: 41.667%; +} + +.row .six { + width: 50%; +} + +.row .seven { + width: 58.333%; +} + +.row .eight { + width: 66.667%; +} + +.row .nine { + width: 75%; +} + +.row .ten { + width: 83.333%; +} + +.row .eleven { + width: 91.667%; +} + +.row .twelve { + width: 100%; +} + +.row .offset-by-one { + margin-left: 8.333%; +} + +.row .offset-by-two { + margin-left: 16.667%; +} + +.row .offset-by-three { + margin-left: 25%; +} + +.row .offset-by-four { + margin-left: 33.333%; +} + +.row .offset-by-five { + margin-left: 41.667%; +} + +.row .offset-by-six { + margin-left: 50%; +} + +.row .offset-by-seven { + margin-left: 58.333%; +} + +.row .offset-by-eight { + margin-left: 66.667%; +} + +.row .offset-by-nine { + margin-left: 75%; +} + +.row .offset-by-ten { + margin-left: 83.333%; +} + +.push-two { + left: 16.667%; +} + +.pull-two { + right: 16.667%; +} + +.push-three { + left: 25%; +} + +.pull-three { + right: 25%; +} + +.push-four { + left: 33.333%; +} + +.pull-four { + right: 33.333%; +} + +.push-five { + left: 41.667%; +} + +.pull-five { + right: 41.667%; +} + +.push-six { + left: 50%; +} + +.pull-six { + right: 50%; +} + +.push-seven { + left: 58.333%; +} + +.pull-seven { + right: 58.333%; +} + +.push-eight { + left: 66.667%; +} + +.pull-eight { + right: 66.667%; +} + +.push-nine { + left: 75%; +} + +.pull-nine { + right: 75%; +} + +.push-ten { + left: 83.333%; +} + +.pull-ten { + right: 83.333%; +} + +img, object, embed { + max-width: 100%; + height: auto; +} + +img { + -ms-interpolation-mode: bicubic; +} + +#map_canvas img, .map_canvas img { + max-width: none !important; +} + +/* Nicolas Gallagher's micro clearfix */ +.row { + *zoom: 1; +} +.row:before, .row:after { + content: ""; + display: table; +} +.row:after { + clear: both; +} + +/* Block Grids ---------------------- */ +/* These are 2-up, 3-up, 4-up and 5-up ULs, suited + for repeating blocks of content. Add 'mobile' to + them to switch them just like the layout grid + (one item per line) on phones + + For IE7/8 compatibility block-grid items need to be + the same height. You can optionally uncomment the + lines below to support arbitrary height, but know + that IE7/8 do not support :nth-child. + -------------------------------------------------- */ +.block-grid { + display: block; + overflow: hidden; + padding: 0; +} +.block-grid > li { + display: block; + height: auto; + float: left; +} + +.block-grid.two-up { + margin: 0 -15px; +} + +.block-grid.two-up > li { + width: 50%; + padding: 0 15px 15px; +} + +/* .block-grid.two-up>li:nth-child(2n+1) {clear: left;} */ +.block-grid.three-up { + margin: 0 -12px; +} + +.block-grid.three-up > li { + width: 33.33%; + padding: 0 12px 12px; +} + +/* .block-grid.three-up>li:nth-child(3n+1) {clear: left;} */ +.block-grid.four-up { + margin: 0 -10px; +} + +.block-grid.four-up > li { + width: 25%; + padding: 0 10px 10px; +} + +/* .block-grid.four-up>li:nth-child(4n+1) {clear: left;} */ +.block-grid.five-up { + margin: 0 -8px; +} + +.block-grid.five-up > li { + width: 20%; + padding: 0 8px 8px; +} + + +.uls-lcd-region-section h3 { + color: #777; +} + +.uls-lcd-region-section ul li:hover { + background-color: #eaeff7; +} +/* Language list */ +.uls-language-list { + height: 22em; + overflow: auto; + margin: 10px; + width: auto; +} + +.uls-language-block ul { + margin: 0px 0px 1.6em; +} + +.uls-language-list ul li { + cursor: pointer; + font-weight: normal; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.uls-language-list strong { + text-decoration: underline; +} + +.uls-language-list a { + font-weight: normal; + text-decoration: none; + color: #3366bb; + font-size: 14px; + line-height: 1.6em; +} + +.uls-language-block .three.columns { + width: 22%; +} + +.uls-language-block { + width: 100%; +} + +.uls-no-results-view { + color: #555; + height: 100%; +} + +.uls-no-results-view h2{ + font-weight: bold; +} + +#uls-no-found-more { + font-size: 0.9em; + background: #F8F8F8; + width: 100%; + margin-top: 1.6em; + line-height: 1.6em; + position:absolute; + bottom:0; + left:0; +} + +.uls-lcd-region-section ul li.uls-column-break:hover { + background: none; +} \ No newline at end of file diff --git a/lib/jquery.uls/css/jquery.uls.grid.css b/lib/jquery.uls/css/jquery.uls.grid.css deleted file mode 100644 index d7783253..00000000 --- a/lib/jquery.uls/css/jquery.uls.grid.css +++ /dev/null @@ -1,320 +0,0 @@ -/* Generated using Foundation http://foundation.zurb.com/docs/grid.php */ -/* Global Reset & Standards ---------------------- */ -.uls-menu * { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -/* Misc ---------------------- */ -.left { - float: left; -} - -.right { - float: right; -} - -.text-left { - text-align: left; -} - -.text-right { - text-align: right; -} - -.text-center { - text-align: center; -} - -.hide { - display: none; -} - -.highlight { - background: #ffff99; -} - -/* The Grid ---------------------- */ -.row { - width: 100%; - max-width: none; - min-width: 600px; - margin: 0 auto; -} -.row .row { - width: auto; - max-width: none; - min-width: 0; - margin: 0 -5px; -} -.row.collapse .column, .row.collapse .columns { - padding: 0; -} -.row .row { - width: auto; - max-width: none; - min-width: 0; - margin: 0 -5px; -} -.row .row.collapse { - margin: 0; -} - -.column, .columns { - float: left; - min-height: 1px; - padding: 0 5px; - position: relative; -} -.column.centered, .columns.centered { - float: none; - margin: 0 auto; -} - -.row .one { - width: 8.333%; -} - -.row .two { - width: 16.667%; -} - -.row .three { - width: 25%; -} - -.row .four { - width: 33.333%; -} - -.row .five { - width: 41.667%; -} - -.row .six { - width: 50%; -} - -.row .seven { - width: 58.333%; -} - -.row .eight { - width: 66.667%; -} - -.row .nine { - width: 75%; -} - -.row .ten { - width: 83.333%; -} - -.row .eleven { - width: 91.667%; -} - -.row .twelve { - width: 100%; -} - -.row .offset-by-one { - margin-left: 8.333%; -} - -.row .offset-by-two { - margin-left: 16.667%; -} - -.row .offset-by-three { - margin-left: 25%; -} - -.row .offset-by-four { - margin-left: 33.333%; -} - -.row .offset-by-five { - margin-left: 41.667%; -} - -.row .offset-by-six { - margin-left: 50%; -} - -.row .offset-by-seven { - margin-left: 58.333%; -} - -.row .offset-by-eight { - margin-left: 66.667%; -} - -.row .offset-by-nine { - margin-left: 75%; -} - -.row .offset-by-ten { - margin-left: 83.333%; -} - -.push-two { - left: 16.667%; -} - -.pull-two { - right: 16.667%; -} - -.push-three { - left: 25%; -} - -.pull-three { - right: 25%; -} - -.push-four { - left: 33.333%; -} - -.pull-four { - right: 33.333%; -} - -.push-five { - left: 41.667%; -} - -.pull-five { - right: 41.667%; -} - -.push-six { - left: 50%; -} - -.pull-six { - right: 50%; -} - -.push-seven { - left: 58.333%; -} - -.pull-seven { - right: 58.333%; -} - -.push-eight { - left: 66.667%; -} - -.pull-eight { - right: 66.667%; -} - -.push-nine { - left: 75%; -} - -.pull-nine { - right: 75%; -} - -.push-ten { - left: 83.333%; -} - -.pull-ten { - right: 83.333%; -} - -img, object, embed { - max-width: 100%; - height: auto; -} - -img { - -ms-interpolation-mode: bicubic; -} - -#map_canvas img, .map_canvas img { - max-width: none !important; -} - -/* Nicolas Gallagher's micro clearfix */ -.row { - *zoom: 1; -} -.row:before, .row:after { - content: ""; - display: table; -} -.row:after { - clear: both; -} - -/* Block Grids ---------------------- */ -/* These are 2-up, 3-up, 4-up and 5-up ULs, suited - for repeating blocks of content. Add 'mobile' to - them to switch them just like the layout grid - (one item per line) on phones - - For IE7/8 compatibility block-grid items need to be - the same height. You can optionally uncomment the - lines below to support arbitrary height, but know - that IE7/8 do not support :nth-child. - -------------------------------------------------- */ -.block-grid { - display: block; - overflow: hidden; - padding: 0; -} -.block-grid > li { - display: block; - height: auto; - float: left; -} - -.block-grid.two-up { - margin: 0 -15px; -} - -.block-grid.two-up > li { - width: 50%; - padding: 0 15px 15px; -} - -/* .block-grid.two-up>li:nth-child(2n+1) {clear: left;} */ -.block-grid.three-up { - margin: 0 -12px; -} - -.block-grid.three-up > li { - width: 33.33%; - padding: 0 12px 12px; -} - -/* .block-grid.three-up>li:nth-child(3n+1) {clear: left;} */ -.block-grid.four-up { - margin: 0 -10px; -} - -.block-grid.four-up > li { - width: 25%; - padding: 0 10px 10px; -} - -/* .block-grid.four-up>li:nth-child(4n+1) {clear: left;} */ -.block-grid.five-up { - margin: 0 -8px; -} - -.block-grid.five-up > li { - width: 20%; - padding: 0 8px 8px; -} - diff --git a/lib/jquery.uls/css/jquery.uls.lcd.css b/lib/jquery.uls/css/jquery.uls.lcd.css deleted file mode 100644 index 50f236c6..00000000 --- a/lib/jquery.uls/css/jquery.uls.lcd.css +++ /dev/null @@ -1,70 +0,0 @@ -.uls-lcd-region-section h3 { - color: #777; -} - -.uls-lcd-region-section ul li:hover { - background-color: #eaeff7; -} -/* Language list */ -.uls-language-list { - height: 22em; - overflow: auto; - margin: 10px; - width: auto; -} - -.uls-language-block ul { - margin: 0px 0px 1.6em; -} - -.uls-language-list ul li { - cursor: pointer; - font-weight: normal; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} - -.uls-language-list strong { - text-decoration: underline; -} - -.uls-language-list a { - font-weight: normal; - text-decoration: none; - color: #3366bb; - font-size: 14px; - line-height: 1.6em; -} - -.uls-language-block .three.columns { - width: 22%; -} - -.uls-language-block { - width: 100%; -} - -.uls-no-results-view { - color: #555; - height: 100%; -} - -.uls-no-results-view h2{ - font-weight: bold; -} - -#uls-no-found-more { - font-size: 0.9em; - background: #F8F8F8; - width: 100%; - margin-top: 1.6em; - line-height: 1.6em; - position:absolute; - bottom:0; - left:0; -} - -.uls-lcd-region-section ul li.uls-column-break:hover { - background: none; -} \ No newline at end of file diff --git a/lib/jquery.uls/data/langdb.yaml b/lib/jquery.uls/data/langdb.yaml deleted file mode 100644 index 68b61a38..00000000 --- a/lib/jquery.uls/data/langdb.yaml +++ /dev/null @@ -1,578 +0,0 @@ -languages: - aa: [Latn, [AF], Qafár af] - ab: [Cyrl, [EU], Аҧсшәа] - ace: [Latn, [AS, PA], Acèh] - ady-cyrl: [Cyrl, [EU], Адыгэбзэ] - ady-latn: [Latn, [EU], Adygabze] - # XXX multiple script - # ady: [[Cyrl, Latn], [EU], [Адыгэбзэ, Adygabze]] - ady: [Cyrl, [EU], Адыгэбзэ] - aeb: [Arab, [AF], زَوُن] - af: [Latn, [AF], Afrikaans] - ahr: [Deva, [AS], अहिराणी] - ak: [Latn, [AF], Akan] - akz: [Latn, [AM], Albaamo innaaɬiilka] - aln: [Latn, [EU], Gegë] - am: [Ethi, [AF], አማርኛ] - an: [Latn, [EU], aragonés] - ang: [Latn, [EU], Ænglisc] - anp: [Deva, [AS], अङ्गिका] - ar: [Arab, [ME], العربية] - arc: [Syrc, [ME], ܐܪܡܝܐ] - arn: [Latn, [AM], mapudungun] - aro: [Latn, [AM], Araona] - arq: [Latn, [AF], Dziri] - ary: [Latn, [ME], Maġribi] - arz: [Arab, [ME], مصرى] - as: [Beng, [AS], অসমীয়া] - ase: [Sgnw, [AM], American sign language] - ast: [Latn, [EU], asturianu] - av: [Cyrl, [EU], авар] - avk: [Latn, [WW], Kotava] - ay: [Latn, [AM], Aymar aru] - # also Arab, and in the past - Cyrl - az: [Latn, [EU, ME], azərbaycanca] - ba: [Cyrl, [EU], башҡортса] - bar: [Latn, [EU], Boarisch] - bbc-latn: [Latn, [AS], Batak Toba] - # FIXME - bbc: [Batk, [AS], Batak Toba/Batak autonym unknown] - bcc: [Arab, [AS, ME], بلوچی مکرانی] - bcl: [Latn, [AS], Bikol Central] -# FIXME: which is the correct code? - be-tarask: [Cyrl, [EU], беларуская (тарашкевіца)] - be-x-old: [Cyrl, [EU], беларуская (тарашкевіца)] - be: [Cyrl, [EU], беларуская] - bew: [Latn, [AS], Bahasa Betawi] - bfq: [Taml, [AS], படகா] - bg: [Cyrl, [EU], български] - bh: [Deva, [AS], भोजपुरी] - bho: [Deva, [AS], भोजपुरी] - bi: [Latn, [PA], Bislama] - bjn: [Latn, [AS], Bahasa Banjar] - bm: [Latn, [AF], bamanankan] - bn: [Beng, [AS], বাংলা] - bo: [Tibt, [AS], བོད་ཡིག] - bpy: [Beng, [AS], বিষ্ণুপ্রিয়া মণিপুরী] - bqi: [Arab, [ME], بختياري] - br: [Latn, [EU], brezhoneg] - brh: [Latn, [ME, AS], Bráhuí] - bs: [Latn, [EU], bosanski] - bto: [Latn, [AS], Iriga Bicolano] - bug: [Bugi, [AS], ᨅᨔ ᨕᨘᨁᨗ] - bxr: [Cyrl, [AS], буряад] - ca: [Latn, [EU], català] - cbk-zam: [Latn, [AS], Chavacano de Zamboanga] - cdo: [Latn, [AS], Mìng-dĕ̤ng-ngṳ̄] - ce: [Cyrl, [EU], нохчийн] - ceb: [Latn, [AS], Cebuano] - ch: [Latn, [PA], Chamoru] - cho: [Latn, [AM], Choctaw] - chr: [Cher, [AM], ᏣᎳᎩ] - chy: [Latn, [AM], Tsetsêhestâhese] - ckb: [Arab, [ME], کوردی] - co: [Latn, [EU], corsu] - cps: [Latn, [AS], Capiceño] - cr-cans: [Cans, [AM], ᓀᐦᐃᔭᐍᐏᐣ] - cr-latn: [Latn, [AM], Nēhiyawēwin] - # XXX multiple script - # cr: [[Latn, Cans], [AM], [Nēhiyawēwin, ᓀᐦᐃᔭᐍᐏᐣ]] - cr: [Cans, [AM], Nēhiyawēwin / ᓀᐦᐃᔭᐍᐏᐣ] - crh-cyrl: [Cyrl, [EU], къырымтатарджа (Кирилл)] - crh-latn: [Latn, [EU], qırımtatarca (Latin)] - # XXX multiple script - # Latn is default in Wikipedia, Cyrl is common IRL - # crh: [[Cyrl, Latn], [EU], [къырымтатарджа, qırımtatarca]] - crh: [Latn, [EU], къырымтатарджа / qırımtatarca] - cs: [Latn, [EU], česky] - csb: [Latn, [EU], kaszëbsczi] - # FIXME: what script? - cu: [Cyrl, [EU], словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ] - cv: [Cyrl, [EU], Чӑвашла] - cy: [Latn, [EU], Cymraeg] - da: [Latn, [EU], dansk] - de-at: [Latn, [EU], Österreichisches Deutsch] - de-ch: [Latn, [EU], Schweizer Hochdeutsch] - de-formal: [Latn, [EU], Deutsch (Sie-Form)] - de: [Latn, [EU], Deutsch] - diq: [Latn, [EU, AS], Zazaki] - dsb: [Latn, [EU], dolnoserbski] - dtp: [Latn, [AS], Dusun Bundu-liwan] - dv: [Thaa, [AS], ދިވެހިބަސް] - dz: [Tibt, [AS], ཇོང་ཁ] - ee: [Latn, [AF], eʋegbe] - egl: [Latn, [EU], Emiliàn] - el: [Grek, [EU], Ελληνικά] - eml: [Latn, [EU], emiliàn e rumagnòl] - en-ca: [Latn, [AM], Canadian English] - en-gb: [Latn, [EU, AS, PA], British English] - # world? - en: [Latn, [EU, AM, AF, ME, AS, PA, WW], English] - eo: [Latn, [WW], Esperanto] - es-419: [Latn, [AM], espanol de America Latina] - # world? - es-formal: [Latn, [EU, AM, AF, WW], Español (formal)] - # world? - es: [Latn, [EU, AM, AF, WW], español] - esu: [Latn, [AM], "Yup'ik"] - et: [Latn, [EU], eesti] - eu: [Latn, [EU], euskara] - ext: [Latn, [EU], estremeñu] - fa: [Arab, [ME], فارسی] - ff: [Latn, [AF], Fulfulde] - fi: [Latn, [EU], suomi] - fit: [Latn, [EU], meänkieli] - fj: [Latn, [PA], Na Vosa Vakaviti] - fo: [Latn, [EU], føroyskt] - fr: [Latn, [EU, AM, WW], français] - frc: [Latn, [EU], français cadien] - frp: [Latn, [EU], arpetan] - frr: [Latn, [EU], Nordfriisk] - fur: [Latn, [EU], furlan] - fy: [Latn, [EU], Frysk] - ga: [Latn, [EU], Gaeilge] - gag: [Latn, [EU], Gagauz] - gah: [Latn, [AS], Alekano] - gan-hans: [Hans, [AS], 赣语(简体)] - gan-hant: [Hant, [AS], 贛語(繁體)] - gan: [Hant, [AS], 贛語] - gbz: [Latn, [AS], Dari] - gcf: [Latn, [AM], Guadeloupean Creole French] - gd: [Latn, [EU], Gàidhlig] - gl: [Latn, [EU], galego] - glk: [Arab, [ME], گیلکی] - gn: [Latn, [AM], "Avañe'ẽ"] - gom-deva: [Deva, [AS], कोंकणी] - gom-latn: [Latn, [AS], Konknni] - # XXX multiple script - # gom: [[Deva, Latn], [AS], [कोंकणी, Konknni]] - gom: [Deva, [AS], कोंकणी / Konknni] - # hmph?.. - got: [Goth, [EU], 𐌲𐌿𐍄𐌹𐍃𐌺] - grc: [Grek, [EU], Ἀρχαία ἑλληνικὴ] - gsw: [Latn, [EU], Alemannisch] - gu: [Gujr, [AS], ગુજરાતી] - guc: [Latn, [AM], Wayúu] - gur: [Latn, [AF], Gurenɛ] - gv: [Latn, [EU], Gaelg] - # The name in Names.php is Arabic, but everything else is Latn - ha: [Latn, [AF], هَوُسَ] - hak: [Latn, [AS], Hak-kâ-fa] - haw: [Latn, [AM, PA], Hawai`i] - he: [Hebr, [ME], עברית] - # Or maybe world? - hi: [Deva, [AS], हिन्दी] - hif-deva: [Deva, [AS], फ़ीजी हिन्दी] - hif-latn: [Latn, [PA, AS], Fiji Hindi] - # XXX multiple script - # hif: [[Deva, Latn], [PA, AS], [फ़ीजी हिन्दी, Fiji Hindi]] - hif: [Latn, [PA, AS], फ़ीजी हिन्दी / Fiji Hindi] - hil: [Latn, [AS], Ilonggo] - hne: [Deva, [AS], छत्तीसगढ़ी] - ho: [Latn, [PA], Hiri Motu] - hr: [Latn, [EU], hrvatski] - hsb: [Latn, [EU], hornjoserbsce] - hsn: [Hans, [AS], 湘语] - # Haitian Creole. North America, right? - ht: [Latn, [AM], Kreyòl ayisyen] - hu-formal: [Latn, [EU], Magyar (magázó)] - hu: [Latn, [EU], magyar] - hy: [Armn, [EU, ME], Հայերեն] - hz: [Latn, [AF], Otsiherero] - ia: [Latn, [WW], interlingua] - id: [Latn, [AS], Bahasa Indonesia] - ie: [Latn, [WW], Interlingue] - ig: [Latn, [AF], Igbo] - ii: [Yiii, [AS], ꆇꉙ] - ik: [Latn, [AM], Iñupiak] - ike-cans: [Cans, [AM], ᐃᓄᒃᑎᑐᑦ] - ike-latn: [Latn, [AM], inuktitut] - ilo: [Latn, [AS], Ilokano] - inh: [Cyrl, [EU], ГӀалгӀай] - io: [Latn, [WW], Ido] - is: [Latn, [EU], íslenska] - it: [Latn, [EU], italiano] - # For variants ike-* is used - iu: [Cans, [AM], ᐃᓄᒃᑎᑐᑦ/inuktitut] - ja: [Jpan, [AS], 日本語] - jam: [Latn, [AM], Patois] - jbo: [Latn, [WW], Lojban] - jut: [Latn, [EU], jysk] - # also in the Javanese script (Java), but the Wikipedia is in Latn - jv: [Latn, [AS, PA], Basa Jawa] - ka: [Geor, [EU], ქართული] - kaa: [Latn, [AS], Qaraqalpaqsha] - # Can also be Tfng, but the Wikipedia is mostly Latn - kab: [Latn, [AF, EU], Taqbaylit] - kbd-cyrl: [Cyrl, [EU, ME], Адыгэбзэ] - kbd-latn: [Latn, [EU], Qabardjajəbza] - kbd: [Cyrl, [EU, ME], Адыгэбзэ] - kea: [Latn, [AF], Kabuverdianu] - kg: [Latn, [AF], Kongo] - kgp: [Latn, [AM], Kaingáng] - khw: [Arab, [ME, AS], کھوار] - ki: [Latn, [AF], Gĩkũyũ] - kiu: [Latn, [EU, ME], Kırmancki] - kj: [Latn, [AF], Kwanyama] - kk-arab: [Arab, [EU, AS], قازاقشا (تٴوتە)] - kk-cn: [Arab, [EU, AS, ME], قازاقشا (جۇنگو)] - kk-cyrl: [Cyrl, [EU, AS], қазақша (кирил)] - kk-kz: [Cyrl, [EU, AS], қазақша (Қазақстан)] - kk-latn: [Latn, [EU, AS, ME], qazaqşa (latın)] - kk-tr: [Latn, [EU, AS, ME], qazaqşa (Türkïya)] - # XXX multiple script - # kk: [[Arab, Cyrl, Latn] [EU, AS], [قازاقشا, қазақша, qazaqşa]] - kk: [Cyrl, [EU, AS], қазақша / قازاقشا / qazaqşa] - kl: [Latn, [AM, EU], kalaallisut] - km: [Khmr, [AS], ភាសាខ្មែរ] - kn: [Knda, [AS], ಕನ್ನಡ] - # Here Hang may be even more appropriate, because kp has more resistance to Han - ko-kp: [Kore, [AS], 한국어 (조선)] - # Kore is an alias for Hangul+Han. Maybe Hang is more appropriate? - ko: [Kore, [AS], 한국어] - koi: [Cyrl, [EU], Перем Коми] - kr: [Latn, [AF], Kanuri] - krc: [Cyrl, [EU], къарачай-малкъар] - kri: [Latn, [AF], Krio] - krj: [Latn, [ME, EU], Kinaray-a] - krl: [Latn, [EU], Karjala] - ks-arab: [Arab, [AS], کٲشُر] - ks-deva: [Deva, [AS], कॉशुर] - # XXX multiple script - # Arab is first here just because it's the current default in the Wikipedia. Deva may be needed, too. - # ks: [[Deva, Arab], [AS], [कॉशुर, کٲشُر]] - ks: [Arab, [AS], कॉशुर / کٲشُر] - ksf: [Latn, [AF], Bafia] - ksh: [Latn, [EU], Ripoarisch] - ku-arab: [Arab, [EU, ME], كوردي (عەرەبی)] - ku-latn: [Latn, [EU, ME], Kurdî (latînî)] - # XXX multiple script - # ku: [[Arab, Latn], [EU, ME], [كوردي , Kurdî]] - ku: [Latn, [EU, ME], كوردي / Kurdî] - kv: [Cyrl, [EU], коми] - kw: [Latn, [EU], kernowek] - ky: [Cyrl, [AS], Кыргызча] - la: [Latn, [EU], Latina] - # Most identified with Turkey, Bulgaria, Greece, Spain and Israel, - # but also spoken in Latin America and elsewhere. - # Wikipedia is mostly in Latn, but also in Hebr. (Comparable to az.) - lad: [Latn, [ME, EU, AM], Ladino] - lb: [Latn, [EU], Lëtzebuergesch] - lbe: [Cyrl, [EU], лакку] - lez: [Cyrl, [EU], лезги] - lfn: [Latn, [WW], Lingua Franca Nova] - lg: [Latn, [AF], Luganda] - li: [Latn, [EU], Limburgs] - lij: [Latn, [EU], Ligure] - liv: [Latn, [EU], Līvõ kēļ] - lld: [Latn, [EU], Ladin] - lmo: [Latn, [EU], lumbaart] - ln: [Latn, [AF], lingála] - lo: [Laoo, [AS], ລາວ] - loz: [Latn, [AF], Silozi] - lt: [Latn, [EU], lietuvių] - ltg: [Latn, [EU], latgaļu] - lus: [Latn, [AS], Mizo ţawng] - lv: [Latn, [EU], latviešu] - lzh: [Hant, [AS], 文言] - # Also Geor, but the incubator is in Latn - lzz: [Latn, [EU, ME], Lazuri] - mai: [Deva, [AS], मैथिली] - map-bms: [Latn, [AS], Basa Banyumasan] - mdf: [Cyrl, [EU], мокшень] - mfe: [Latn, [AM], Morisyen] - mg: [Latn, [AF], Malagasy] - mh: [Latn, [PA], Ebon] - mhr: [Cyrl, [EU], олык марий] - mi: [Latn, [PA], Māori] - mic: [Latn, [AM], "Mi'kmaq"] - min: [Latn, [AS], Baso Minangkabau] - mk: [Cyrl, [EU], македонски] - ml: [Mlym, [AS, ME], മലയാളം] - # Hmm, can also have Mong some day in some way - mn: [Cyrl, [AS], монгол] - mnc: [Mong, [AS], ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ] - mni: [Beng, [AS], মেইতেই লোন্] - mnw: [Mymr, [AS], ဘာသာ မန်] - mo: [Cyrl, [EU], молдовеняскэ] - mr: [Deva, [AS, ME], मराठी] - mrj: [Cyrl, [EU], кырык мары] - ms: [Latn, [AS], Bahasa Melayu] - mt: [Latn, [EU], Malti] - mui: [Latn, [AS], Musi] - mus: [Latn, [AM], Mvskoke] - mwl: [Latn, [EU], Mirandés] - mwv: [Latn, [AS], Behase Mentawei] - my: [Mymr, [AS], မြန်မာဘာသာ] - myv: [Cyrl, [EU], эрзянь] - mzn: [Arab, [ME, AS], مازِرونی] - na: [Latn, [PA], Dorerin Naoero] - nah: [Latn, [AM], Nāhuatl] - nan: [Latn, [AS], Bân-lâm-gú] - nap: [Latn, [EU], Nnapulitano] - nb: [Latn, [EU], norsk (bokmål)] - nds-nl: [Latn, [EU], Nedersaksisch] - nds: [Latn, [EU], Plattdüütsch] - ne: [Deva, [AS], नेपाली] - new: [Deva, [AS], नेपाल भाषा] - ng: [Latn, [AF], Oshiwambo] - niu: [Latn, [PA], ko e vagahau Niuē] - njo: [Latn, [AS], Ao] - nl-informal: [Latn, [EU, AM], Nederlands (informeel)] - nl: [Latn, [EU, AM], Nederlands] - nn: [Latn, [EU], norsk (nynorsk)] - "no": [Latn, [EU]] - nov: [Latn, [WW], Novial] - nqo: [Nkoo, [AF], ߒߞߏ] - nrm: [Latn, [EU], Nouormand] - nso: [Latn, [AF], Sesotho sa Leboa] - nv: [Latn, [AM], Diné bizaad] - ny: [Latn, [AF], Chi-Chewa] - oc: [Latn, [EU], occitan] - om: [Latn, [AF], Oromoo] - or: [Orya, [AS], ଓଡ଼ିଆ] - os: [Cyrl, [EU], Ирон] - pa: [Guru, [AS], ਪੰਜਾਬੀ] - pag: [Latn, [AS], Pangasinan] - pam: [Latn, [AS], Kapampangan] - pap: [Latn, [AM], Papiamentu] - pcd: [Latn, [EU], Picard] - pdc: [Latn, [EU, AM], Deitsch] - pdt: [Latn, [EU, AM], Plautdietsch] - pfl: [Latn, [EU], Pälzisch] - pi: [Deva, [AS], पाळि] - pih: [Latn, [PA], Norfuk / Pitkern] - pis: [Latn, [PA], Pijin] - pko: [Latn, [AF], Pökoot] - pl: [Latn, [EU], polski] - pms: [Latn, [EU], Piemontèis] - pnb: [Arab, [AS, ME], پنجابی] - pnt: [Grek, [EU], Ποντιακά] - ppl: [Latn, [AM], Nawat] - prg: [Latn, [EU], Prūsiskan] - pru: [Latn, [EU], Prūsiskan] - ps: [Arab, [AS, ME], پښتو] - pt-br: [Latn, [AM], português do Brasil] - # world? - pt: [Latn, [EU, AM, AS, PA, AF, WW], português] - qu: [Latn, [AM], Runa Simi] - qug: [Latn, [AM], Runa shimi] - rap: [Latn, [AM], arero rapa nui] - rgn: [Latn, [EU], Rumagnôl] - rif: [Latn, [AF], Tarifit] - rki: [Mymr, [AS], ရခိုင်] - rm: [Latn, [EU], rumantsch] - rmy: [Latn, [EU], Romani] - rn: [Latn, [AF], Kirundi] - ro: [Latn, [EU], română] - roa-rup: [Latn, [EU], Armãneashce] - roa-tara: [Latn, [EU], tarandíne] - rtm: [Latn, [PA], Faeag Rotuma] - # world? - ru: [Cyrl, [EU, AS, ME], русский] - rue: [Cyrl, [EU], русиньскый] - rup: [Latn, [EU], Armãneashce] - ruq: [Latn, [EU], Vlăheşte] - ruq-cyrl: [Cyrl, [EU], Влахесте] - # FIXME: broken autonym - ruq-grek: [Grek, [EU], Megleno-Romanian (Greek script)] - ruq-latn: [Latn, [EU], Vlăheşte] - rw: [Latn, [AF], Kinyarwanda] - ryu: [Kana, [AS], ʔucināguci] - sa: [Deva, [AS], संस्कृतम्] - # Russian Far East - Europe, Asia, or both? - sah: [Cyrl, [EU, AS], саха тыла] - # Currently Latn, potentially Olck - sat: [Latn, [AS], Santali] - saz: [Saur, [AS], ꢱꣃꢬꢵꢯ꣄ꢡ꣄ꢬꢵ] - sc: [Latn, [EU], sardu] - scn: [Latn, [EU], sicilianu] - sco: [Latn, [EU], Scots] - sd: [Arab, [AS], سنڌي] - sdc: [Latn, [EU], Sassaresu] - se: [Latn, [EU], sámegiella] - sei: [Latn, [AM], Cmique Itom] - sg: [Latn, [AF], Sängö] - sgs: [Latn, [EU], žemaitėška] - sh-cyrl: [Cyrl, [EU], српскохрватски] - sh-latn: [Latn, [EU], srpskohrvatski] - # XXX multiple script - # sh: [[Latn, Cyrl], [EU], [srpskohrvatski, српскохрватски]] - sh: [Latn, [EU], srpskohrvatski / српскохрватски] - shi-latn: [Latn, [AF], Tašlḥiyt] - shi-tfng: [Tfng, [AF], ⵜⴰⵛⵍⵃⵉⵜ] - # XXX multiple script - # shi: [[Latn, Tfng], [AF], [Tašlḥiyt, ⵜⴰⵛⵍⵃⵉⵜ]] - shi: [Latn, [AF], Tašlḥiyt / ⵜⴰⵛⵍⵃⵉⵜ] - shn: [Mymr, [AS], လိၵ်ႈတႆး] - si: [Sinh, [AS], සිංහල] - simple: [Latn, [WW], Simple English] - sk: [Latn, [EU], slovenčina] - sl: [Latn, [EU], slovenščina] - sli: [Latn, [EU], Schläsch] - slr: [Latn, [AS], Salırça] - sly: [Latn, [AS], Bahasa Selayar] - sm: [Latn, [PA], Gagana Samoa] - sma: [Latn, [EU], åarjelsaemien] - smj: [Latn, [EU], julevsámegiella] - smn: [Latn, [EU], anarâškielâ] - sms: [Latn, [EU], sää´mǩiõll] - sn: [Latn, [AF], chiShona] - so: [Latn, [AF], Soomaaliga] - sq: [Latn, [EU], shqip] - sr-ec: [Cyrl, [EU], српски (ћирилица)] - sr-el: [Latn, [EU], srpski (latinica)] - # XXX multiple script - # sr: [[Cyrl, Latn], [EU], [српски, srpski]] - sr: [Cyrl, [EU], српски / srpski] - srn: [Latn, [AM, EU], Sranantongo] - ss: [Latn, [AF], SiSwati] - st: [Latn, [AF], Sesotho] - stq: [Latn, [EU], Seeltersk] - su: [Latn, [AS], Basa Sunda] - sv: [Latn, [EU], svenska] - sw: [Latn, [AF], Kiswahili] - swb: [Latn, [AF], Shikomoro] - sxu: [Latn, [EU], Säggssch] - szl: [Latn, [EU], ślůnski] - ta: [Taml, [AS], தமிழ்] - tcy: [Knda, [AS], ತುಳು] - te: [Telu, [AS], తెలుగు] - tet: [Latn, [AS, PA], tetun] - tg-cyrl: [Cyrl, [AS], тоҷикӣ] - tg-latn: [Latn, [AS], tojikī] - tg: [Cyrl, [AS], тоҷикӣ] - th: [Thai, [AS], ไทย] - ti: [Ethi, [AF], ትግርኛ] - tk: [Latn, [AS], Türkmençe] - tkr: [Cyrl, [AS], ЦӀаьхна миз] - tl: [Latn, [AS], Tagalog] - # A very complicated case. Names.php is Cyrl. In TWN they argue about Cyrl, Latn, and Arab. I can't find reliable external sources. --Amir - tly: [Cyrl, [EU, AS, ME], толышә зывон] - tn: [Latn, [AF], Setswana] - to: [Latn, [PA], lea faka-Tonga] - tokipona: [Latn, [WW], Toki Pona] - tpi: [Latn, [PA, AS], Tok Pisin] - tr: [Latn, [EU, ME], Türkçe] - trp: [Latn, [AS], Kokborok (Tripuri)] - tru: [Latn, [AS], Ṫuroyo] - ts: [Latn, [AF], Xitsonga] - tsd: [Grek, [EU], Τσακωνικά] - tt-cyrl: [Cyrl, [EU], татарча] - tt-latn: [Latn, [EU], tatarça] - # XXX multiple script - # tt: [[Cyrl, Latn] [EU], [татарча, tatarça]] - tt: [Cyrl, [EU], татарча / tatarça] - ttt: [Cyrl, [AS], Tati] - tum: [Latn, [AF], chiTumbuka] - tw: [Latn, [AF], Twi] - twd: [Latn, [EU], Tweants] - ty: [Latn, [PA], Reo Mā`ohi] - tyv: [Cyrl, [AS], тыва дыл] - tzm: [Tfng, [AF], ⵜⴰⵎⴰⵣⵉⵖⵜ] - udm: [Cyrl, [EU], удмурт] - ug-arab: [Arab, [AS], ئۇيغۇرچە] - ug-latn: [Latn, [AS], Uyghurche] - # XXX multiple script - # ug: [[Arab, Latn], [AS], [ئۇيغۇرچە, Uyghurche]] - ug: [Arab, [AS], ئۇيغۇرچە / Uyghurche ] - uk: [Cyrl, [EU], українська] - ur: [Arab, [AS, ME], اردو] - uz: [Latn, [AS], oʻzbekcha] - ve: [Latn, [AF], Tshivenda] - vec: [Latn, [EU], vèneto] - vep: [Latn, [EU], vepsän kel’] - vi: [Latn, [AS], Tiếng Việt] - vls: [Latn, [EU], West-Vlams] - vmf: [Latn, [EU], Mainfränkisch] - vo: [Latn, [WW], Volapük] - vot: [Latn, [EU], Vaďďa] - vro: [Latn, [EU], Võro] - wa: [Latn, [EU], walon] - war: [Latn, [AS], Winaray] - wls: [Latn, [PA], "Faka'uvea"] - wo: [Latn, [AF], Wolof] - wuu: [Hans, [EU], 吴语] - xal: [Cyrl, [EU], хальмг] - xh: [Latn, [AF], isiXhosa] - xmf: [Geor, [EU], მარგალური] - ydd: [Hebr, [AS, EU], Eastern Yiddish] - yi: [Hebr, [ME, EU, AM], ייִדיש] - yo: [Latn, [AF], Yorùbá] - yrk: [Cyrl, [AS], Ненэцяʼ вада] - yrl: [Latn, [AM], "ñe'engatú"] - yua: [Latn, [AM], "Maaya T'aan"] - # world? - yue: [Hant, [AS], 粵語] - za: [Latn, [AS], Vahcuengh] - zea: [Latn, [EU], Zeêuws] - zh-classical: [Hant, [AS], 文言] - zh-cn: [Hans, [AS], 中文(中国大陆)] - zh-hans: [Hans, [AS], 中文(简体)] - zh-hant: [Hant, [AS], 中文(繁體)] - zh-hk: [Hant, [AS], 中文(香港)] - zh-min-nan: [Latn, [AS], Bân-lâm-gú] - zh-mo: [Hant, [AS], 中文(澳門)] - zh-my: [Hans, [AS], 中文(马来西亚)] - zh-sg: [Hans, [AS], 中文(新加坡)] - zh-tw: [Hant, [AS], 中文(台灣)] - zh-yue: [Hans, [AS], 粵語] - zh: [Hans, [AS], 中文] - zu: [Latn, [AF], isiZulu] - - # The codes are taken from http://unicode.org/iso15924/iso15924-codes.html . - # - # The classification is roughly based on http://www.unicode.org/charts/ - # with some practical corrections. - # The order of the groups affects display. It was suggested by Pau to distance - # the largest groups from one another to improve discoverability. -scriptgroups: - # The group name "Other" is reserved. - # It's hard to find a better place for Goth except the Latin group. - Latin: [Latn, Goth] - # Greek is probalby different enough from Latin and Cyrillic, but user testing - # may prove otherwise. - Greek: [Grek] - WestCaucasian: [Armn, Geor] - Arabic: [Arab] - # Maybe MiddleEastern can be unified with Arabic. - # Maybe Thaana can be moved here from SouthAsian. - # Maybe it can be unified with African. - MiddleEastern: [Hebr, Syrc] - African: [Ethi, Nkoo, Tfng] - # India, Nepal, Bangladesh, Sri-Lanka, Bhutan, Maldives. - # - # Thaana (Thaa, the script of Maldives) is here, even though it's RTL, - # because it's closer geographically to India. Maybe it should be moved - # to MiddleEastern or to Arabic, if that would be easier to users. - # - # Tibetan (Tibt) is here, even though it's classified as "Central Asian" by - # Unicode, because linguistically and geographically it's closely related to - # the Brahmic family. - SouthAsian: [Beng, Deva, Gujr, Guru, Knda, Mlym, Orya, Saur, Sinh, Taml, Telu, Tibt, Thaa] - Cyrillic: [Cyrl] - CJK: [Hans, Hant, Kana, Kore, Jpan, Yiii] - SouthEastAsian: [Batk, Bugi, Java, Khmr, Laoo, Mymr, Thai] - Mongolian: [Mong] - SignWriting: [Sgnw] - NativeAmerican: [Cher, Cans] - -rtlscripts: - [Arab, Hebr, Syrc, Nkoo, Thaa] - - # The numbers are also used in HTML id attributes -regiongroups: - # Worldwide, international - WW: 1 - # America - AM: 2 - # Europe - EU: 3 - # Middle East - ME: 3 - # Africa - AF: 3 - # Asia - AS: 4 - # Pacific - PA: 4 diff --git a/lib/jquery.uls/data/spyc.php b/lib/jquery.uls/data/spyc.php deleted file mode 100644 index 47d58770..00000000 --- a/lib/jquery.uls/data/spyc.php +++ /dev/null @@ -1,1046 +0,0 @@ - - * @author Chris Wanstrath - * @link http://code.google.com/p/spyc/ - * @copyright Copyright 2005-2006 Chris Wanstrath, 2006-2011 Vlad Andersen - * @license http://www.opensource.org/licenses/mit-license.php MIT License - * @package Spyc - */ - -if (!function_exists('spyc_load')) { - /** - * Parses YAML to array. - * @param string $string YAML string. - * @return array - */ - function spyc_load ($string) { - return Spyc::YAMLLoadString($string); - } -} - -if (!function_exists('spyc_load_file')) { - /** - * Parses YAML to array. - * @param string $file Path to YAML file. - * @return array - */ - function spyc_load_file ($file) { - return Spyc::YAMLLoad($file); - } -} - -/** - * The Simple PHP YAML Class. - * - * This class can be used to read a YAML file and convert its contents - * into a PHP array. It currently supports a very limited subsection of - * the YAML spec. - * - * Usage: - * - * $Spyc = new Spyc; - * $array = $Spyc->load($file); - * - * or: - * - * $array = Spyc::YAMLLoad($file); - * - * or: - * - * $array = spyc_load_file($file); - * - * @package Spyc - */ -class Spyc { - - // SETTINGS - - const REMPTY = "\0\0\0\0\0"; - - /** - * Setting this to true will force YAMLDump to enclose any string value in - * quotes. False by default. - * - * @var bool - */ - public $setting_dump_force_quotes = false; - - /** - * Setting this to true will forse YAMLLoad to use syck_load function when - * possible. False by default. - * @var bool - */ - public $setting_use_syck_is_possible = false; - - - - /**#@+ - * @access private - * @var mixed - */ - private $_dumpIndent; - private $_dumpWordWrap; - private $_containsGroupAnchor = false; - private $_containsGroupAlias = false; - private $path; - private $result; - private $LiteralPlaceHolder = '___YAML_Literal_Block___'; - private $SavedGroups = array(); - private $indent; - /** - * Path modifier that should be applied after adding current element. - * @var array - */ - private $delayedPath = array(); - - /**#@+ - * @access public - * @var mixed - */ - public $_nodeId; - -/** - * Load a valid YAML string to Spyc. - * @param string $input - * @return array - */ - public function load ($input) { - return $this->__loadString($input); - } - - /** - * Load a valid YAML file to Spyc. - * @param string $file - * @return array - */ - public function loadFile ($file) { - return $this->__load($file); - } - - /** - * Load YAML into a PHP array statically - * - * The load method, when supplied with a YAML stream (string or file), - * will do its best to convert YAML in a file into a PHP array. Pretty - * simple. - * Usage: - * - * $array = Spyc::YAMLLoad('lucky.yaml'); - * print_r($array); - * - * @access public - * @return array - * @param string $input Path of YAML file or string containing YAML - */ - public static function YAMLLoad($input) { - $Spyc = new Spyc; - return $Spyc->__load($input); - } - - /** - * Load a string of YAML into a PHP array statically - * - * The load method, when supplied with a YAML string, will do its best - * to convert YAML in a string into a PHP array. Pretty simple. - * - * Note: use this function if you don't want files from the file system - * loaded and processed as YAML. This is of interest to people concerned - * about security whose input is from a string. - * - * Usage: - * - * $array = Spyc::YAMLLoadString("---\n0: hello world\n"); - * print_r($array); - * - * @access public - * @return array - * @param string $input String containing YAML - */ - public static function YAMLLoadString($input) { - $Spyc = new Spyc; - return $Spyc->__loadString($input); - } - - /** - * Dump YAML from PHP array statically - * - * The dump method, when supplied with an array, will do its best - * to convert the array into friendly YAML. Pretty simple. Feel free to - * save the returned string as nothing.yaml and pass it around. - * - * Oh, and you can decide how big the indent is and what the wordwrap - * for folding is. Pretty cool -- just pass in 'false' for either if - * you want to use the default. - * - * Indent's default is 2 spaces, wordwrap's default is 40 characters. And - * you can turn off wordwrap by passing in 0. - * - * @access public - * @return string - * @param array $array PHP array - * @param int $indent Pass in false to use the default, which is 2 - * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40) - */ - public static function YAMLDump($array,$indent = false,$wordwrap = false) { - $spyc = new Spyc; - return $spyc->dump($array,$indent,$wordwrap); - } - - - /** - * Dump PHP array to YAML - * - * The dump method, when supplied with an array, will do its best - * to convert the array into friendly YAML. Pretty simple. Feel free to - * save the returned string as tasteful.yaml and pass it around. - * - * Oh, and you can decide how big the indent is and what the wordwrap - * for folding is. Pretty cool -- just pass in 'false' for either if - * you want to use the default. - * - * Indent's default is 2 spaces, wordwrap's default is 40 characters. And - * you can turn off wordwrap by passing in 0. - * - * @access public - * @return string - * @param array $array PHP array - * @param int $indent Pass in false to use the default, which is 2 - * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40) - */ - public function dump($array,$indent = false,$wordwrap = false) { - // Dumps to some very clean YAML. We'll have to add some more features - // and options soon. And better support for folding. - - // New features and options. - if ($indent === false or !is_numeric($indent)) { - $this->_dumpIndent = 2; - } else { - $this->_dumpIndent = $indent; - } - - if ($wordwrap === false or !is_numeric($wordwrap)) { - $this->_dumpWordWrap = 40; - } else { - $this->_dumpWordWrap = $wordwrap; - } - - // New YAML document - $string = "---\n"; - - // Start at the base of the array and move through it. - if ($array) { - $array = (array)$array; - $previous_key = -1; - foreach ($array as $key => $value) { - if (!isset($first_key)) $first_key = $key; - $string .= $this->_yamlize($key,$value,0,$previous_key, $first_key, $array); - $previous_key = $key; - } - } - return $string; - } - - /** - * Attempts to convert a key / value array item to YAML - * @access private - * @return string - * @param $key The name of the key - * @param $value The value of the item - * @param $indent The indent of the current node - */ - private function _yamlize($key,$value,$indent, $previous_key = -1, $first_key = 0, $source_array = null) { - if (is_array($value)) { - if (empty ($value)) - return $this->_dumpNode($key, array(), $indent, $previous_key, $first_key, $source_array); - // It has children. What to do? - // Make it the right kind of item - $string = $this->_dumpNode($key, self::REMPTY, $indent, $previous_key, $first_key, $source_array); - // Add the indent - $indent += $this->_dumpIndent; - // Yamlize the array - $string .= $this->_yamlizeArray($value,$indent); - } elseif (!is_array($value)) { - // It doesn't have children. Yip. - $string = $this->_dumpNode($key, $value, $indent, $previous_key, $first_key, $source_array); - } - return $string; - } - - /** - * Attempts to convert an array to YAML - * @access private - * @return string - * @param $array The array you want to convert - * @param $indent The indent of the current level - */ - private function _yamlizeArray($array,$indent) { - if (is_array($array)) { - $string = ''; - $previous_key = -1; - foreach ($array as $key => $value) { - if (!isset($first_key)) $first_key = $key; - $string .= $this->_yamlize($key, $value, $indent, $previous_key, $first_key, $array); - $previous_key = $key; - } - return $string; - } else { - return false; - } - } - - /** - * Returns YAML from a key and a value - * @access private - * @return string - * @param $key The name of the key - * @param $value The value of the item - * @param $indent The indent of the current node - */ - private function _dumpNode($key, $value, $indent, $previous_key = -1, $first_key = 0, $source_array = null) { - // do some folding here, for blocks - if (is_string ($value) && ((strpos($value,"\n") !== false || strpos($value,": ") !== false || strpos($value,"- ") !== false || - strpos($value,"*") !== false || strpos($value,"#") !== false || strpos($value,"<") !== false || strpos($value,">") !== false || strpos ($value, ' ') !== false || - strpos($value,"[") !== false || strpos($value,"]") !== false || strpos($value,"{") !== false || strpos($value,"}") !== false) || strpos($value,"&") !== false || strpos($value, "'") !== false || strpos($value, "!") === 0 || - substr ($value, -1, 1) == ':') - ) { - $value = $this->_doLiteralBlock($value,$indent); - } else { - $value = $this->_doFolding($value,$indent); - } - - if ($value === array()) $value = '[ ]'; - if (in_array ($value, array ('true', 'TRUE', 'false', 'FALSE', 'y', 'Y', 'n', 'N', 'null', 'NULL'), true)) { - $value = $this->_doLiteralBlock($value,$indent); - } - if (trim ($value) != $value) - $value = $this->_doLiteralBlock($value,$indent); - - if (is_bool($value)) { - $value = ($value) ? "true" : "false"; - } - - if ($value === null) $value = 'null'; - if ($value === "'" . self::REMPTY . "'") $value = null; - - $spaces = str_repeat(' ',$indent); - - //if (is_int($key) && $key - 1 == $previous_key && $first_key===0) { - if (is_array ($source_array) && array_keys($source_array) === range(0, count($source_array) - 1)) { - // It's a sequence - $string = $spaces.'- '.$value."\n"; - } else { - // if ($first_key===0) throw new Exception('Keys are all screwy. The first one was zero, now it\'s "'. $key .'"'); - // It's mapped - if (strpos($key, ":") !== false || strpos($key, "#") !== false) { $key = '"' . $key . '"'; } - $string = rtrim ($spaces.$key.': '.$value)."\n"; - } - return $string; - } - - /** - * Creates a literal block for dumping - * @access private - * @return string - * @param $value - * @param $indent int The value of the indent - */ - private function _doLiteralBlock($value,$indent) { - if ($value === "\n") return '\n'; - if (strpos($value, "\n") === false && strpos($value, "'") === false) { - return sprintf ("'%s'", $value); - } - if (strpos($value, "\n") === false && strpos($value, '"') === false) { - return sprintf ('"%s"', $value); - } - $exploded = explode("\n",$value); - $newValue = '|'; - $indent += $this->_dumpIndent; - $spaces = str_repeat(' ',$indent); - foreach ($exploded as $line) { - $newValue .= "\n" . $spaces . ($line); - } - return $newValue; - } - - /** - * Folds a string of text, if necessary - * @access private - * @return string - * @param $value The string you wish to fold - */ - private function _doFolding($value,$indent) { - // Don't do anything if wordwrap is set to 0 - - if ($this->_dumpWordWrap !== 0 && is_string ($value) && strlen($value) > $this->_dumpWordWrap) { - $indent += $this->_dumpIndent; - $indent = str_repeat(' ',$indent); - $wrapped = wordwrap($value,$this->_dumpWordWrap,"\n$indent"); - $value = ">\n".$indent.$wrapped; - } else { - if ($this->setting_dump_force_quotes && is_string ($value) && $value !== self::REMPTY) - $value = '"' . $value . '"'; - } - - - return $value; - } - -// LOADING FUNCTIONS - - private function __load($input) { - $Source = $this->loadFromSource($input); - return $this->loadWithSource($Source); - } - - private function __loadString($input) { - $Source = $this->loadFromString($input); - return $this->loadWithSource($Source); - } - - private function loadWithSource($Source) { - if (empty ($Source)) return array(); - if ($this->setting_use_syck_is_possible && function_exists ('syck_load')) { - $array = syck_load (implode ('', $Source)); - return is_array($array) ? $array : array(); - } - - $this->path = array(); - $this->result = array(); - - $cnt = count($Source); - for ($i = 0; $i < $cnt; $i++) { - $line = $Source[$i]; - - $this->indent = strlen($line) - strlen(ltrim($line)); - $tempPath = $this->getParentPathByIndent($this->indent); - $line = self::stripIndent($line, $this->indent); - if (self::isComment($line)) continue; - if (self::isEmpty($line)) continue; - $this->path = $tempPath; - - $literalBlockStyle = self::startsLiteralBlock($line); - if ($literalBlockStyle) { - $line = rtrim ($line, $literalBlockStyle . " \n"); - $literalBlock = ''; - $line .= $this->LiteralPlaceHolder; - $literal_block_indent = strlen($Source[$i+1]) - strlen(ltrim($Source[$i+1])); - while (++$i < $cnt && $this->literalBlockContinues($Source[$i], $this->indent)) { - $literalBlock = $this->addLiteralLine($literalBlock, $Source[$i], $literalBlockStyle, $literal_block_indent); - } - $i--; - } - - while (++$i < $cnt && self::greedilyNeedNextLine($line)) { - $line = rtrim ($line, " \n\t\r") . ' ' . ltrim ($Source[$i], " \t"); - } - $i--; - - - - if (strpos ($line, '#')) { - if (strpos ($line, '"') === false && strpos ($line, "'") === false) - $line = preg_replace('/\s+#(.+)$/','',$line); - } - - $lineArray = $this->_parseLine($line); - - if ($literalBlockStyle) - $lineArray = $this->revertLiteralPlaceHolder ($lineArray, $literalBlock); - - $this->addArray($lineArray, $this->indent); - - foreach ($this->delayedPath as $indent => $delayedPath) - $this->path[$indent] = $delayedPath; - - $this->delayedPath = array(); - - } - return $this->result; - } - - private function loadFromSource ($input) { - if (!empty($input) && strpos($input, "\n") === false && file_exists($input)) - return file($input); - - return $this->loadFromString($input); - } - - private function loadFromString ($input) { - $lines = explode("\n",$input); - foreach ($lines as $k => $_) { - $lines[$k] = rtrim ($_, "\r"); - } - return $lines; - } - - /** - * Parses YAML code and returns an array for a node - * @access private - * @return array - * @param string $line A line from the YAML file - */ - private function _parseLine($line) { - if (!$line) return array(); - $line = trim($line); - if (!$line) return array(); - - $array = array(); - - $group = $this->nodeContainsGroup($line); - if ($group) { - $this->addGroup($line, $group); - $line = $this->stripGroup ($line, $group); - } - - if ($this->startsMappedSequence($line)) - return $this->returnMappedSequence($line); - - if ($this->startsMappedValue($line)) - return $this->returnMappedValue($line); - - if ($this->isArrayElement($line)) - return $this->returnArrayElement($line); - - if ($this->isPlainArray($line)) - return $this->returnPlainArray($line); - - - return $this->returnKeyValuePair($line); - - } - - /** - * Finds the type of the passed value, returns the value as the new type. - * @access private - * @param string $value - * @return mixed - */ - private function _toType($value) { - if ($value === '') return null; - $first_character = $value[0]; - $last_character = substr($value, -1, 1); - - $is_quoted = false; - do { - if (!$value) break; - if ($first_character != '"' && $first_character != "'") break; - if ($last_character != '"' && $last_character != "'") break; - $is_quoted = true; - } while (0); - - if ($is_quoted) - return strtr(substr ($value, 1, -1), array ('\\"' => '"', '\'\'' => '\'', '\\\'' => '\'')); - - if (strpos($value, ' #') !== false && !$is_quoted) - $value = preg_replace('/\s+#(.+)$/','',$value); - - if (!$is_quoted) $value = str_replace('\n', "\n", $value); - - if ($first_character == '[' && $last_character == ']') { - // Take out strings sequences and mappings - $innerValue = trim(substr ($value, 1, -1)); - if ($innerValue === '') return array(); - $explode = $this->_inlineEscape($innerValue); - // Propagate value array - $value = array(); - foreach ($explode as $v) { - $value[] = $this->_toType($v); - } - return $value; - } - - if (strpos($value,': ')!==false && $first_character != '{') { - $array = explode(': ',$value); - $key = trim($array[0]); - array_shift($array); - $value = trim(implode(': ',$array)); - $value = $this->_toType($value); - return array($key => $value); - } - - if ($first_character == '{' && $last_character == '}') { - $innerValue = trim(substr ($value, 1, -1)); - if ($innerValue === '') return array(); - // Inline Mapping - // Take out strings sequences and mappings - $explode = $this->_inlineEscape($innerValue); - // Propagate value array - $array = array(); - foreach ($explode as $v) { - $SubArr = $this->_toType($v); - if (empty($SubArr)) continue; - if (is_array ($SubArr)) { - $array[key($SubArr)] = $SubArr[key($SubArr)]; continue; - } - $array[] = $SubArr; - } - return $array; - } - - if ($value == 'null' || $value == 'NULL' || $value == 'Null' || $value == '' || $value == '~') { - return null; - } - - if ( is_numeric($value) && preg_match ('/^(-|)[1-9]+[0-9]*$/', $value) ){ - $intvalue = (int)$value; - if ($intvalue != PHP_INT_MAX) - $value = $intvalue; - return $value; - } - - if (in_array($value, - array('true', 'on', '+', 'yes', 'y', 'True', 'TRUE', 'On', 'ON', 'YES', 'Yes', 'Y'))) { - return true; - } - - if (in_array(strtolower($value), - array('false', 'off', '-', 'no', 'n'))) { - return false; - } - - if (is_numeric($value)) { - if ($value === '0') return 0; - if (rtrim ($value, 0) === $value) - $value = (float)$value; - return $value; - } - - return $value; - } - - /** - * Used in inlines to check for more inlines or quoted strings - * @access private - * @return array - */ - private function _inlineEscape($inline) { - // There's gotta be a cleaner way to do this... - // While pure sequences seem to be nesting just fine, - // pure mappings and mappings with sequences inside can't go very - // deep. This needs to be fixed. - - $seqs = array(); - $maps = array(); - $saved_strings = array(); - - // Check for strings - $regex = '/(?:(")|(?:\'))((?(1)[^"]+|[^\']+))(?(1)"|\')/'; - if (preg_match_all($regex,$inline,$strings)) { - $saved_strings = $strings[0]; - $inline = preg_replace($regex,'YAMLString',$inline); - } - unset($regex); - - $i = 0; - do { - - // Check for sequences - while (preg_match('/\[([^{}\[\]]+)\]/U',$inline,$matchseqs)) { - $seqs[] = $matchseqs[0]; - $inline = preg_replace('/\[([^{}\[\]]+)\]/U', ('YAMLSeq' . (count($seqs) - 1) . 's'), $inline, 1); - } - - // Check for mappings - while (preg_match('/{([^\[\]{}]+)}/U',$inline,$matchmaps)) { - $maps[] = $matchmaps[0]; - $inline = preg_replace('/{([^\[\]{}]+)}/U', ('YAMLMap' . (count($maps) - 1) . 's'), $inline, 1); - } - - if ($i++ >= 10) break; - - } while (strpos ($inline, '[') !== false || strpos ($inline, '{') !== false); - - $explode = explode(', ',$inline); - $stringi = 0; $i = 0; - - while (1) { - - // Re-add the sequences - if (!empty($seqs)) { - foreach ($explode as $key => $value) { - if (strpos($value,'YAMLSeq') !== false) { - foreach ($seqs as $seqk => $seq) { - $explode[$key] = str_replace(('YAMLSeq'.$seqk.'s'),$seq,$value); - $value = $explode[$key]; - } - } - } - } - - // Re-add the mappings - if (!empty($maps)) { - foreach ($explode as $key => $value) { - if (strpos($value,'YAMLMap') !== false) { - foreach ($maps as $mapk => $map) { - $explode[$key] = str_replace(('YAMLMap'.$mapk.'s'), $map, $value); - $value = $explode[$key]; - } - } - } - } - - - // Re-add the strings - if (!empty($saved_strings)) { - foreach ($explode as $key => $value) { - while (strpos($value,'YAMLString') !== false) { - $explode[$key] = preg_replace('/YAMLString/',$saved_strings[$stringi],$value, 1); - unset($saved_strings[$stringi]); - ++$stringi; - $value = $explode[$key]; - } - } - } - - $finished = true; - foreach ($explode as $key => $value) { - if (strpos($value,'YAMLSeq') !== false) { - $finished = false; break; - } - if (strpos($value,'YAMLMap') !== false) { - $finished = false; break; - } - if (strpos($value,'YAMLString') !== false) { - $finished = false; break; - } - } - if ($finished) break; - - $i++; - if ($i > 10) - break; // Prevent infinite loops. - } - - return $explode; - } - - private function literalBlockContinues ($line, $lineIndent) { - if (!trim($line)) return true; - if (strlen($line) - strlen(ltrim($line)) > $lineIndent) return true; - return false; - } - - private function referenceContentsByAlias ($alias) { - do { - if (!isset($this->SavedGroups[$alias])) { echo "Bad group name: $alias."; break; } - $groupPath = $this->SavedGroups[$alias]; - $value = $this->result; - foreach ($groupPath as $k) { - $value = $value[$k]; - } - } while (false); - return $value; - } - - private function addArrayInline ($array, $indent) { - $CommonGroupPath = $this->path; - if (empty ($array)) return false; - - foreach ($array as $k => $_) { - $this->addArray(array($k => $_), $indent); - $this->path = $CommonGroupPath; - } - return true; - } - - private function addArray ($incoming_data, $incoming_indent) { - - // print_r ($incoming_data); - - if (count ($incoming_data) > 1) - return $this->addArrayInline ($incoming_data, $incoming_indent); - - $key = key ($incoming_data); - $value = isset($incoming_data[$key]) ? $incoming_data[$key] : null; - if ($key === '__!YAMLZero') $key = '0'; - - if ($incoming_indent == 0 && !$this->_containsGroupAlias && !$this->_containsGroupAnchor) { // Shortcut for root-level values. - if ($key || $key === '' || $key === '0') { - $this->result[$key] = $value; - } else { - $this->result[] = $value; end ($this->result); $key = key ($this->result); - } - $this->path[$incoming_indent] = $key; - return; - } - - - - $history = array(); - // Unfolding inner array tree. - $history[] = $_arr = $this->result; - foreach ($this->path as $k) { - $history[] = $_arr = $_arr[$k]; - } - - if ($this->_containsGroupAlias) { - $value = $this->referenceContentsByAlias($this->_containsGroupAlias); - $this->_containsGroupAlias = false; - } - - - // Adding string or numeric key to the innermost level or $this->arr. - if (is_string($key) && $key == '<<') { - if (!is_array ($_arr)) { $_arr = array (); } - - $_arr = array_merge ($_arr, $value); - } elseif ($key || $key === '' || $key === '0') { - if (!is_array ($_arr)) - $_arr = array ($key=>$value); - else - $_arr[$key] = $value; - } else { - if (!is_array ($_arr)) { $_arr = array ($value); $key = 0; } - else { $_arr[] = $value; end ($_arr); $key = key ($_arr); } - } - - $reverse_path = array_reverse($this->path); - $reverse_history = array_reverse ($history); - $reverse_history[0] = $_arr; - $cnt = count($reverse_history) - 1; - for ($i = 0; $i < $cnt; $i++) { - $reverse_history[$i+1][$reverse_path[$i]] = $reverse_history[$i]; - } - $this->result = $reverse_history[$cnt]; - - $this->path[$incoming_indent] = $key; - - if ($this->_containsGroupAnchor) { - $this->SavedGroups[$this->_containsGroupAnchor] = $this->path; - if (is_array ($value)) { - $k = key ($value); - if (!is_int ($k)) { - $this->SavedGroups[$this->_containsGroupAnchor][$incoming_indent + 2] = $k; - } - } - $this->_containsGroupAnchor = false; - } - - } - - private static function startsLiteralBlock ($line) { - $lastChar = substr (trim($line), -1); - if ($lastChar != '>' && $lastChar != '|') return false; - if ($lastChar == '|') return $lastChar; - // HTML tags should not be counted as literal blocks. - if (preg_match ('#<.*?>$#', $line)) return false; - return $lastChar; - } - - private static function greedilyNeedNextLine($line) { - $line = trim ($line); - if (!strlen($line)) return false; - if (substr ($line, -1, 1) == ']') return false; - if ($line[0] == '[') return true; - if (preg_match ('#^[^:]+?:\s*\[#', $line)) return true; - return false; - } - - private function addLiteralLine ($literalBlock, $line, $literalBlockStyle, $indent = -1) { - $line = self::stripIndent($line, $indent); - if ($literalBlockStyle !== '|') { - $line = self::stripIndent($line); - } - $line = rtrim ($line, "\r\n\t ") . "\n"; - if ($literalBlockStyle == '|') { - return $literalBlock . $line; - } - if (strlen($line) == 0) - return rtrim($literalBlock, ' ') . "\n"; - if ($line == "\n" && $literalBlockStyle == '>') { - return rtrim ($literalBlock, " \t") . "\n"; - } - if ($line != "\n") - $line = trim ($line, "\r\n ") . " "; - return $literalBlock . $line; - } - - function revertLiteralPlaceHolder ($lineArray, $literalBlock) { - foreach ($lineArray as $k => $_) { - if (is_array($_)) - $lineArray[$k] = $this->revertLiteralPlaceHolder ($_, $literalBlock); - elseif (substr($_, -1 * strlen ($this->LiteralPlaceHolder)) == $this->LiteralPlaceHolder) - $lineArray[$k] = rtrim ($literalBlock, " \r\n"); - } - return $lineArray; - } - - private static function stripIndent ($line, $indent = -1) { - if ($indent == -1) $indent = strlen($line) - strlen(ltrim($line)); - return substr ($line, $indent); - } - - private function getParentPathByIndent ($indent) { - if ($indent == 0) return array(); - $linePath = $this->path; - do { - end($linePath); $lastIndentInParentPath = key($linePath); - if ($indent <= $lastIndentInParentPath) array_pop ($linePath); - } while ($indent <= $lastIndentInParentPath); - return $linePath; - } - - - private function clearBiggerPathValues ($indent) { - - - if ($indent == 0) $this->path = array(); - if (empty ($this->path)) return true; - - foreach ($this->path as $k => $_) { - if ($k > $indent) unset ($this->path[$k]); - } - - return true; - } - - - private static function isComment ($line) { - if (!$line) return false; - if ($line[0] == '#') return true; - if (trim($line, " \r\n\t") == '---') return true; - return false; - } - - private static function isEmpty ($line) { - return (trim ($line) === ''); - } - - - private function isArrayElement ($line) { - if (!$line) return false; - if ($line[0] != '-') return false; - if (strlen ($line) > 3) - if (substr($line,0,3) == '---') return false; - - return true; - } - - private function isHashElement ($line) { - return strpos($line, ':'); - } - - private function isLiteral ($line) { - if ($this->isArrayElement($line)) return false; - if ($this->isHashElement($line)) return false; - return true; - } - - - private static function unquote ($value) { - if (!$value) return $value; - if (!is_string($value)) return $value; - if ($value[0] == '\'') return trim ($value, '\''); - if ($value[0] == '"') return trim ($value, '"'); - return $value; - } - - private function startsMappedSequence ($line) { - return ($line[0] == '-' && substr ($line, -1, 1) == ':'); - } - - private function returnMappedSequence ($line) { - $array = array(); - $key = self::unquote(trim(substr($line,1,-1))); - $array[$key] = array(); - $this->delayedPath = array(strpos ($line, $key) + $this->indent => $key); - return array($array); - } - - private function returnMappedValue ($line) { - $array = array(); - $key = self::unquote (trim(substr($line,0,-1))); - $array[$key] = ''; - return $array; - } - - private function startsMappedValue ($line) { - return (substr ($line, -1, 1) == ':'); - } - - private function isPlainArray ($line) { - return ($line[0] == '[' && substr ($line, -1, 1) == ']'); - } - - private function returnPlainArray ($line) { - return $this->_toType($line); - } - - private function returnKeyValuePair ($line) { - $array = array(); - $key = ''; - if (strpos ($line, ':')) { - // It's a key/value pair most likely - // If the key is in double quotes pull it out - if (($line[0] == '"' || $line[0] == "'") && preg_match('/^(["\'](.*)["\'](\s)*:)/',$line,$matches)) { - $value = trim(str_replace($matches[1],'',$line)); - $key = $matches[2]; - } else { - // Do some guesswork as to the key and the value - $explode = explode(':',$line); - $key = trim($explode[0]); - array_shift($explode); - $value = trim(implode(':',$explode)); - } - // Set the type of the value. Int, string, etc - $value = $this->_toType($value); - if ($key === '0') $key = '__!YAMLZero'; - $array[$key] = $value; - } else { - $array = array ($line); - } - return $array; - - } - - - private function returnArrayElement ($line) { - if (strlen($line) <= 1) return array(array()); // Weird %) - $array = array(); - $value = trim(substr($line,1)); - $value = $this->_toType($value); - $array[] = $value; - return $array; - } - - - private function nodeContainsGroup ($line) { - $symbolsForReference = 'A-z0-9_\-'; - if (strpos($line, '&') === false && strpos($line, '*') === false) return false; // Please die fast ;-) - if ($line[0] == '&' && preg_match('/^(&['.$symbolsForReference.']+)/', $line, $matches)) return $matches[1]; - if ($line[0] == '*' && preg_match('/^(\*['.$symbolsForReference.']+)/', $line, $matches)) return $matches[1]; - if (preg_match('/(&['.$symbolsForReference.']+)$/', $line, $matches)) return $matches[1]; - if (preg_match('/(\*['.$symbolsForReference.']+$)/', $line, $matches)) return $matches[1]; - if (preg_match ('#^\s*<<\s*:\s*(\*[^\s]+).*$#', $line, $matches)) return $matches[1]; - return false; - - } - - private function addGroup ($line, $group) { - if ($group[0] == '&') $this->_containsGroupAnchor = substr ($group, 1); - if ($group[0] == '*') $this->_containsGroupAlias = substr ($group, 1); - //print_r ($this->path); - } - - private function stripGroup ($line, $group) { - $line = trim(str_replace($group, '', $line)); - return $line; - } -} - -// Enable use of Spyc from command line -// The syntax is the following: php spyc.php spyc.yaml - -define ('SPYC_FROM_COMMAND_LINE', false); - -do { - if (!SPYC_FROM_COMMAND_LINE) break; - if (empty ($_SERVER['argc']) || $_SERVER['argc'] < 2) break; - if (empty ($_SERVER['PHP_SELF']) || $_SERVER['PHP_SELF'] != 'spyc.php') break; - $file = $argv[1]; - printf ("Spyc loading file: %s\n", $file); - print_r (spyc_load_file ($file)); -} while (0); \ No newline at end of file diff --git a/lib/jquery.uls/data/ulsdata2json.php b/lib/jquery.uls/data/ulsdata2json.php deleted file mode 100644 index b11d8297..00000000 --- a/lib/jquery.uls/data/ulsdata2json.php +++ /dev/null @@ -1,80 +0,0 @@ -territoryInfo->territory as $territoryRecord ) { - $territoryAtributes = $territoryRecord->attributes(); - $territoryCodeAttr = $territoryAtributes['type']; - $territoryCode = "$territoryCodeAttr[0]"; - $parsedLangdb['territories'][$territoryCode] = array(); - - foreach ( $territoryRecord->languagePopulation as $languageRecord ) { - $languageAttributes = $languageRecord->attributes(); - $languageCodeAttr = $languageAttributes['type']; - $parsedLangdb['territories'][$territoryCode][] = "$languageCodeAttr[0]"; - } -} - -print( "Writing JSON langdb...\n" ); -$json = json_encode( $parsedLangdb ); -$js = << - - - - - - - - Universal Language Selector - - - - - - - - - - - - - - - - - - - - - - - -
- - diff --git a/lib/jquery.uls/examples/resources/demo.css b/lib/jquery.uls/examples/resources/demo.css deleted file mode 100644 index f1350578..00000000 --- a/lib/jquery.uls/examples/resources/demo.css +++ /dev/null @@ -1,20 +0,0 @@ -body { - padding-left: 10%; - padding-right: 10%; - font-family: Arial, Helvetica, sans-serif; -} -a { - text-decoration: none; -} -div.navbar { - background-color: #333; - color: #FFFFFF; - padding: 20px; -} -span.uls-trigger { - float: right; -} -span.uls-trigger a { - color: #FFFFFF; - font-weight: bold; -} \ No newline at end of file diff --git a/lib/jquery.uls/examples/resources/jquery.js b/lib/jquery.uls/examples/resources/jquery.js deleted file mode 100644 index 198b3ff0..00000000 --- a/lib/jquery.uls/examples/resources/jquery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/lib/jquery.uls/grunt.js b/lib/jquery.uls/grunt.js deleted file mode 100644 index b200ae80..00000000 --- a/lib/jquery.uls/grunt.js +++ /dev/null @@ -1,85 +0,0 @@ -/*global module:false*/ -module.exports = function(grunt) { - grunt.loadNpmTasks('grunt-css'); - // Project configuration. - grunt - .initConfig({ - pkg : '', - meta : { - banner : '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' - + '<%= grunt.template.today("yyyy-mm-dd") %>\n' - + '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' - + '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' - + ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' - }, - concat : { - js : { - src: [ '','src/jquery.uls.data.js', - 'src/jquery.uls.data.utils.js', 'src/jquery.uls.lcd.js', - 'src/jquery.uls.languagefilter.js', 'src/jquery.uls.regionfilter.js', - 'src/jquery.uls.core.js'], - dest : 'dist/<%= pkg.name %>.js' - }, - css: { - src: [ 'css/jquery.uls.css', 'css/jquery.uls.grid.css', - 'css/jquery.uls.lcd.css' ], - dest : 'dist/<%= pkg.name %>.css' - } - }, - min : { - dist : { - src : [ '', - '' ], - dest : 'dist/<%= pkg.name %>.min.js' - } - }, - cssmin : { - dist: { - src : '', - dest : 'dist/<%= pkg.name %>.min.css' - } - }, - lint : { - files : [ 'src/**/*.js', 'test/**/*.js' ] - }, - csslint : { - file: [ 'css/**/*.css' ] - }, - watch : { - files : '', - tasks : 'lint' - }, - jshint : { - options : { - curly : true, - eqeqeq : true, - immed : true, - latedef : true, - newcap : true, - noarg : true, - sub : true, - undef : true, - boss : true, - eqnull : true, - browser : true, - smarttabs : true, - laxbreak : true, - multistr: true - }, - globals : { - jQuery : true, - QUnit : true, - pluralRuleParser : true, - _ : true, - module : true, - test : true - } - }, - uglify : { - src : [ '', '' ], - dest : 'dist/<%= pkg.name %>.min.js' - } - }); - // Default task. - grunt.registerTask('default', 'lint cssmin concat min csslint'); -}; diff --git a/lib/jquery.uls/i18n/de.json b/lib/jquery.uls/i18n/de.json new file mode 100644 index 00000000..3941a669 --- /dev/null +++ b/lib/jquery.uls/i18n/de.json @@ -0,0 +1,3 @@ +{ +"uls-select-language": "Wählen Sie eine Sprache" +} diff --git a/lib/jquery.uls/i18n/en.json b/lib/jquery.uls/i18n/en.json new file mode 100644 index 00000000..f411347b --- /dev/null +++ b/lib/jquery.uls/i18n/en.json @@ -0,0 +1,20 @@ +{ +"@metadata": { + "author": "Santhosh Thottingal ", + "last-updated": "2012-09-21", + "locale": "en", + "message-documentation": "qqq" +}, +"uls-select-language": "Select Language", +"uls-region-WW": "Worldwide", +"uls-region-AM": "America", +"uls-region-AF": "Africa", +"uls-region-EU": "Europe", +"uls-region-AS": "Asia", +"uls-region-ME": "Middle East", +"uls-region-PA": "Pacific", +"uls-no-results-found": "No results found", +"uls-common-languages": "Common languages", +"uls-no-results-suggestion-title": "You may be interested in:", +"uls-search-help": "You can search by language name, script name, ISO code of language or you can browse by region:" +} diff --git a/lib/jquery.uls/i18n/es.json b/lib/jquery.uls/i18n/es.json new file mode 100644 index 00000000..1fa4fa8f --- /dev/null +++ b/lib/jquery.uls/i18n/es.json @@ -0,0 +1,3 @@ +{ +"uls-select-language": "Seleccione el idioma" +} \ No newline at end of file diff --git a/lib/jquery.uls/i18n/fi.json b/lib/jquery.uls/i18n/fi.json new file mode 100644 index 00000000..0df63757 --- /dev/null +++ b/lib/jquery.uls/i18n/fi.json @@ -0,0 +1,3 @@ +{ +"uls-select-language": "Valitse kieli" +} \ No newline at end of file diff --git a/lib/jquery.uls/i18n/he.json b/lib/jquery.uls/i18n/he.json new file mode 100644 index 00000000..63e4563a --- /dev/null +++ b/lib/jquery.uls/i18n/he.json @@ -0,0 +1,20 @@ +{ +"@metadata": { + "author": "Amire80", + "last-updated": "2012-09-21", + "locale": "he", + "message-documentation": "qqq" +}, +"uls-select-language": "בחירת שפה", +"uls-region-WW": "עולמי", +"uls-region-AM": "אמריקה", +"uls-region-AF": "אפריקה", +"uls-region-EU": "אירופה", +"uls-region-AS": "אסיה", +"uls-region-ME": "המזרח התיכון", +"uls-region-PA": "האוקיינוס השקט", +"uls-no-results-found": "לא נמצאו שפות", +"uls-common-languages": "שפות נפוצות", +"uls-no-results-suggestion-title": "אולי זה יעזור:", +"uls-search-help": "אפשר לחפש לפי שם שפה, שם שיטת הכתב וקוד ISO של השפה, או לעיין לפי אזור:" +} diff --git a/lib/jquery.uls/i18n/hi.json b/lib/jquery.uls/i18n/hi.json new file mode 100644 index 00000000..20aa0198 --- /dev/null +++ b/lib/jquery.uls/i18n/hi.json @@ -0,0 +1,3 @@ +{ +"uls-select-language": "भाषा चुनें" +} diff --git a/lib/jquery.uls/i18n/ja.json b/lib/jquery.uls/i18n/ja.json new file mode 100644 index 00000000..0abd83b8 --- /dev/null +++ b/lib/jquery.uls/i18n/ja.json @@ -0,0 +1,3 @@ +{ +"uls-select-language": "言語を選択する" +} diff --git a/lib/jquery.uls/i18n/ml.json b/lib/jquery.uls/i18n/ml.json new file mode 100644 index 00000000..ef41817a --- /dev/null +++ b/lib/jquery.uls/i18n/ml.json @@ -0,0 +1,14 @@ +{ +"uls-select-language": "ഭാഷ തിരഞ്ഞെടുക്കുക", +"uls-region-WW": "ആഗോള ഭാഷകൾ", +"uls-region-AM": "അമേരിക്ക", +"uls-region-AF": "ആഫ്രിക്ക", +"uls-region-EU": "യൂറോപ്പ്", +"uls-region-AS": "ഏഷ്യ", +"uls-region-ME": "മദ്ധ്യപൂർവേഷ്യ", +"uls-region-PA": "പസഫിക്", +"uls-no-results-found": "ഒന്നും കണ്ടെത്താനായില്ല", +"uls-common-languages": "സാധാരണ ഭാഷകൾ", +"uls-no-results-suggestion-title": "ഒരു പക്ഷേ ഇതായിരിക്കും നിങ്ങൾ തിരഞ്ഞത്:", +"uls-search-help": "നിങ്ങൾക്ക് ഭാഷയുടെ പേര്, ISO 639 കോഡ്, ലിപിയുടെ പേര് എന്നിവ ഉപയോഗിച്ച് തിരയാം. അല്ലെങ്കിൽ ഈ മേഖലകളിൽ തിരയാം:" +} \ No newline at end of file diff --git a/lib/jquery.uls/i18n/nl.json b/lib/jquery.uls/i18n/nl.json new file mode 100644 index 00000000..e834702e --- /dev/null +++ b/lib/jquery.uls/i18n/nl.json @@ -0,0 +1,3 @@ +{ +"uls-select-language": "Selecteer taal" +} diff --git a/lib/jquery.uls/i18n/qqq.json b/lib/jquery.uls/i18n/qqq.json new file mode 100644 index 00000000..01758b6c --- /dev/null +++ b/lib/jquery.uls/i18n/qqq.json @@ -0,0 +1,19 @@ +{ +"@metadata": { + "author": "Santhosh Thottingal ", + "last-updated": "2012-09-21", + "locale": "qqq" +}, +"uls-select-language": "Language Selector Title", +"uls-region-WW": "Label for worldwide languages. They are languages spoken in multiple countries. Eg: English, French, Spanish etc. This lable is used in the map region of ULS and as the title of section showing worldwide languages. Translation should not be descriptive.", +"uls-region-AM": "Label for America", +"uls-region-AF": "Label for Africa", +"uls-region-EU": "Label for Europe", +"uls-region-AS": "Label for Asia", +"uls-region-ME": "Label for Middle East", +"uls-region-PA": "Label for Pacific", +"uls-no-results-found": "Title text for 'No results found' section", +"uls-common-languages": "Title for languages listed based on GeoIP, previously used languaguage, browser accept-language etc.", +"uls-no-results-suggestion-title": "Title for language suggestion in 'no results found' screen", +"uls-search-help": "Help text for searching. After this text, there will be a set of links for regions" +} diff --git a/lib/jquery.uls/i18n/ta.json b/lib/jquery.uls/i18n/ta.json new file mode 100644 index 00000000..e2fa8a54 --- /dev/null +++ b/lib/jquery.uls/i18n/ta.json @@ -0,0 +1,3 @@ +{ +"uls-select-language": "மொழி தேர்வு" +} \ No newline at end of file diff --git a/lib/jquery.uls/jquery.uls.js b/lib/jquery.uls/jquery.uls.js new file mode 100644 index 00000000..a25640f0 --- /dev/null +++ b/lib/jquery.uls/jquery.uls.js @@ -0,0 +1,1460 @@ +/*! jquery.uls - v0.1.0 - 2012-09-21 +* https://github.com/wikimedia/jquery.uls +* Copyright (c) 2012 Santhosh Thottingal; Licensed GPL, MIT */ + +// Please do not edit. This file is generated from data/langdb.yaml by ulsdata2json.php +( function ( $ ) { + $.uls = $.uls || {}; + $.uls.data = {"languages":{"aa":["Latn",["AF"],"Qaf\u00e1r af"],"ab":["Cyrl",["EU"],"\u0410\u04a7\u0441\u0448\u04d9\u0430"],"ace":["Latn",["AS","PA"],"Ac\u00e8h"],"ady-cyrl":["Cyrl",["EU"],"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d"],"ady-latn":["Latn",["EU"],"Adygabze"],"ady":["Cyrl",["EU"],"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d"],"aeb":["Arab",["AF"],"\u0632\u064e\u0648\u064f\u0646"],"af":["Latn",["AF"],"Afrikaans"],"ahr":["Deva",["AS"],"\u0905\u0939\u093f\u0930\u093e\u0923\u0940"],"ak":["Latn",["AF"],"Akan"],"akz":["Latn",["AM"],"Albaamo innaa\u026ciilka"],"aln":["Latn",["EU"],"Geg\u00eb"],"am":["Ethi",["AF"],"\u12a0\u121b\u122d\u129b"],"an":["Latn",["EU"],"aragon\u00e9s"],"ang":["Latn",["EU"],"\u00c6nglisc"],"anp":["Deva",["AS"],"\u0905\u0919\u094d\u0917\u093f\u0915\u093e"],"ar":["Arab",["ME"],"\u0627\u0644\u0639\u0631\u0628\u064a\u0629"],"arc":["Syrc",["ME"],"\u0710\u072a\u0721\u071d\u0710"],"arn":["Latn",["AM"],"mapudungun"],"aro":["Latn",["AM"],"Araona"],"arq":["Latn",["AF"],"Dziri"],"ary":["Latn",["ME"],"Ma\u0121ribi"],"arz":["Arab",["ME"],"\u0645\u0635\u0631\u0649"],"as":["Beng",["AS"],"\u0985\u09b8\u09ae\u09c0\u09df\u09be"],"ase":["Sgnw",["AM"],"American sign language"],"ast":["Latn",["EU"],"asturianu"],"av":["Cyrl",["EU"],"\u0430\u0432\u0430\u0440"],"avk":["Latn",["WW"],"Kotava"],"ay":["Latn",["AM"],"Aymar aru"],"az":["Latn",["EU","ME"],"az\u0259rbaycanca"],"ba":["Cyrl",["EU"],"\u0431\u0430\u0448\u04a1\u043e\u0440\u0442\u0441\u0430"],"bar":["Latn",["EU"],"Boarisch"],"bbc-latn":["Latn",["AS"],"Batak Toba"],"bbc":["Batk",["AS"],"Batak Toba\/Batak autonym unknown"],"bcc":["Arab",["AS","ME"],"\u0628\u0644\u0648\u0686\u06cc \u0645\u06a9\u0631\u0627\u0646\u06cc"],"bcl":["Latn",["AS"],"Bikol Central"],"be-tarask":["Cyrl",["EU"],"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f (\u0442\u0430\u0440\u0430\u0448\u043a\u0435\u0432\u0456\u0446\u0430)"],"be-x-old":["Cyrl",["EU"],"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f (\u0442\u0430\u0440\u0430\u0448\u043a\u0435\u0432\u0456\u0446\u0430)"],"be":["Cyrl",["EU"],"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f"],"bew":["Latn",["AS"],"Bahasa Betawi"],"bfq":["Taml",["AS"],"\u0baa\u0b9f\u0b95\u0bbe"],"bg":["Cyrl",["EU"],"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438"],"bh":["Deva",["AS"],"\u092d\u094b\u091c\u092a\u0941\u0930\u0940"],"bho":["Deva",["AS"],"\u092d\u094b\u091c\u092a\u0941\u0930\u0940"],"bi":["Latn",["PA"],"Bislama"],"bjn":["Latn",["AS"],"Bahasa Banjar"],"bm":["Latn",["AF"],"bamanankan"],"bn":["Beng",["AS"],"\u09ac\u09be\u0982\u09b2\u09be"],"bo":["Tibt",["AS"],"\u0f56\u0f7c\u0f51\u0f0b\u0f61\u0f72\u0f42"],"bpy":["Beng",["AS"],"\u09ac\u09bf\u09b7\u09cd\u09a3\u09c1\u09aa\u09cd\u09b0\u09bf\u09af\u09bc\u09be \u09ae\u09a3\u09bf\u09aa\u09c1\u09b0\u09c0"],"bqi":["Arab",["ME"],"\u0628\u062e\u062a\u064a\u0627\u0631\u064a"],"br":["Latn",["EU"],"brezhoneg"],"brh":["Latn",["ME","AS"],"Br\u00e1hu\u00ed"],"bs":["Latn",["EU"],"bosanski"],"bto":["Latn",["AS"],"Iriga Bicolano"],"bug":["Bugi",["AS"],"\u1a05\u1a14 \u1a15\u1a18\u1a01\u1a17"],"bxr":["Cyrl",["AS"],"\u0431\u0443\u0440\u044f\u0430\u0434"],"ca":["Latn",["EU"],"catal\u00e0"],"cbk-zam":["Latn",["AS"],"Chavacano de Zamboanga"],"cdo":["Latn",["AS"],"M\u00ecng-d\u0115\u0324ng-ng\u1e73\u0304"],"ce":["Cyrl",["EU"],"\u043d\u043e\u0445\u0447\u0438\u0439\u043d"],"ceb":["Latn",["AS"],"Cebuano"],"ch":["Latn",["PA"],"Chamoru"],"cho":["Latn",["AM"],"Choctaw"],"chr":["Cher",["AM"],"\u13e3\u13b3\u13a9"],"chy":["Latn",["AM"],"Tsets\u00eahest\u00e2hese"],"ckb":["Arab",["ME"],"\u06a9\u0648\u0631\u062f\u06cc"],"co":["Latn",["EU"],"corsu"],"cps":["Latn",["AS"],"Capice\u00f1o"],"cr-cans":["Cans",["AM"],"\u14c0\u1426\u1403\u152d\u140d\u140f\u1423"],"cr-latn":["Latn",["AM"],"N\u0113hiyaw\u0113win"],"cr":["Cans",["AM"],"N\u0113hiyaw\u0113win \/ \u14c0\u1426\u1403\u152d\u140d\u140f\u1423"],"crh-cyrl":["Cyrl",["EU"],"\u043a\u044a\u044b\u0440\u044b\u043c\u0442\u0430\u0442\u0430\u0440\u0434\u0436\u0430 (\u041a\u0438\u0440\u0438\u043b\u043b)"],"crh-latn":["Latn",["EU"],"q\u0131r\u0131mtatarca (Latin)"],"crh":["Latn",["EU"],"\u043a\u044a\u044b\u0440\u044b\u043c\u0442\u0430\u0442\u0430\u0440\u0434\u0436\u0430 \/ q\u0131r\u0131mtatarca"],"cs":["Latn",["EU"],"\u010desky"],"csb":["Latn",["EU"],"kasz\u00ebbsczi"],"cu":["Cyrl",["EU"],"\u0441\u043b\u043e\u0432\u0463\u0301\u043d\u044c\u0441\u043a\u044a \/ \u2c14\u2c0e\u2c11\u2c02\u2c21\u2c10\u2c20\u2c14\u2c0d\u2c1f"],"cv":["Cyrl",["EU"],"\u0427\u04d1\u0432\u0430\u0448\u043b\u0430"],"cy":["Latn",["EU"],"Cymraeg"],"da":["Latn",["EU"],"dansk"],"de-at":["Latn",["EU"],"\u00d6sterreichisches Deutsch"],"de-ch":["Latn",["EU"],"Schweizer Hochdeutsch"],"de-formal":["Latn",["EU"],"Deutsch (Sie-Form)"],"de":["Latn",["EU"],"Deutsch"],"diq":["Latn",["EU","AS"],"Zazaki"],"dsb":["Latn",["EU"],"dolnoserbski"],"dtp":["Latn",["AS"],"Dusun Bundu-liwan"],"dv":["Thaa",["AS"],"\u078b\u07a8\u0788\u07ac\u0780\u07a8\u0784\u07a6\u0790\u07b0"],"dz":["Tibt",["AS"],"\u0f47\u0f7c\u0f44\u0f0b\u0f41"],"ee":["Latn",["AF"],"e\u028begbe"],"egl":["Latn",["EU"],"Emili\u00e0n"],"el":["Grek",["EU"],"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"],"eml":["Latn",["EU"],"emili\u00e0n e rumagn\u00f2l"],"en-ca":["Latn",["AM"],"Canadian English"],"en-gb":["Latn",["EU","AS","PA"],"British English"],"en":["Latn",["EU","AM","AF","ME","AS","PA","WW"],"English"],"eo":["Latn",["WW"],"Esperanto"],"es-419":["Latn",["AM"],"espanol de America Latina"],"es-formal":["Latn",["EU","AM","AF","WW"],"Espa\u00f1ol (formal)"],"es":["Latn",["EU","AM","AF","WW"],"espa\u00f1ol"],"esu":["Latn",["AM"],"Yup'ik"],"et":["Latn",["EU"],"eesti"],"eu":["Latn",["EU"],"euskara"],"ext":["Latn",["EU"],"estreme\u00f1u"],"fa":["Arab",["ME"],"\u0641\u0627\u0631\u0633\u06cc"],"ff":["Latn",["AF"],"Fulfulde"],"fi":["Latn",["EU"],"suomi"],"fit":["Latn",["EU"],"me\u00e4nkieli"],"fj":["Latn",["PA"],"Na Vosa Vakaviti"],"fo":["Latn",["EU"],"f\u00f8royskt"],"fr":["Latn",["EU","AM","WW"],"fran\u00e7ais"],"frc":["Latn",["EU"],"fran\u00e7ais cadien"],"frp":["Latn",["EU"],"arpetan"],"frr":["Latn",["EU"],"Nordfriisk"],"fur":["Latn",["EU"],"furlan"],"fy":["Latn",["EU"],"Frysk"],"ga":["Latn",["EU"],"Gaeilge"],"gag":["Latn",["EU"],"Gagauz"],"gah":["Latn",["AS"],"Alekano"],"gan-hans":["Hans",["AS"],"\u8d63\u8bed\uff08\u7b80\u4f53\uff09"],"gan-hant":["Hant",["AS"],"\u8d1b\u8a9e\uff08\u7e41\u9ad4\uff09"],"gan":["Hant",["AS"],"\u8d1b\u8a9e"],"gbz":["Latn",["AS"],"Dari"],"gcf":["Latn",["AM"],"Guadeloupean Creole French"],"gd":["Latn",["EU"],"G\u00e0idhlig"],"gl":["Latn",["EU"],"galego"],"glk":["Arab",["ME"],"\u06af\u06cc\u0644\u06a9\u06cc"],"gn":["Latn",["AM"],"Ava\u00f1e'\u1ebd"],"gom-deva":["Deva",["AS"],"\u0915\u094b\u0902\u0915\u0923\u0940"],"gom-latn":["Latn",["AS"],"Konknni"],"gom":["Deva",["AS"],"\u0915\u094b\u0902\u0915\u0923\u0940 \/ Konknni"],"got":["Goth",["EU"],"\ud800\udf32\ud800\udf3f\ud800\udf44\ud800\udf39\ud800\udf43\ud800\udf3a"],"grc":["Grek",["EU"],"\u1f08\u03c1\u03c7\u03b1\u03af\u03b1 \u1f11\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u1f74"],"gsw":["Latn",["EU"],"Alemannisch"],"gu":["Gujr",["AS"],"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0"],"guc":["Latn",["AM"],"Way\u00fau"],"gur":["Latn",["AF"],"Guren\u025b"],"gv":["Latn",["EU"],"Gaelg"],"ha":["Latn",["AF"],"\u0647\u064e\u0648\u064f\u0633\u064e"],"hak":["Latn",["AS"],"Hak-k\u00e2-fa"],"haw":["Latn",["AM","PA"],"Hawai`i"],"he":["Hebr",["ME"],"\u05e2\u05d1\u05e8\u05d9\u05ea"],"hi":["Deva",["AS"],"\u0939\u093f\u0928\u094d\u0926\u0940"],"hif-deva":["Deva",["AS"],"\u092b\u093c\u0940\u091c\u0940 \u0939\u093f\u0928\u094d\u0926\u0940"],"hif-latn":["Latn",["PA","AS"],"Fiji Hindi"],"hif":["Latn",["PA","AS"],"\u092b\u093c\u0940\u091c\u0940 \u0939\u093f\u0928\u094d\u0926\u0940 \/ Fiji Hindi"],"hil":["Latn",["AS"],"Ilonggo"],"hne":["Deva",["AS"],"\u091b\u0924\u094d\u0924\u0940\u0938\u0917\u0922\u093c\u0940"],"ho":["Latn",["PA"],"Hiri Motu"],"hr":["Latn",["EU"],"hrvatski"],"hsb":["Latn",["EU"],"hornjoserbsce"],"hsn":["Hans",["AS"],"\u6e58\u8bed"],"ht":["Latn",["AM"],"Krey\u00f2l ayisyen"],"hu-formal":["Latn",["EU"],"Magyar (mag\u00e1z\u00f3)"],"hu":["Latn",["EU"],"magyar"],"hy":["Armn",["EU","ME"],"\u0540\u0561\u0575\u0565\u0580\u0565\u0576"],"hz":["Latn",["AF"],"Otsiherero"],"ia":["Latn",["WW"],"interlingua"],"id":["Latn",["AS"],"Bahasa Indonesia"],"ie":["Latn",["WW"],"Interlingue"],"ig":["Latn",["AF"],"Igbo"],"ii":["Yiii",["AS"],"\ua187\ua259"],"ik":["Latn",["AM"],"I\u00f1upiak"],"ike-cans":["Cans",["AM"],"\u1403\u14c4\u1483\u144e\u1450\u1466"],"ike-latn":["Latn",["AM"],"inuktitut"],"ilo":["Latn",["AS"],"Ilokano"],"inh":["Cyrl",["EU"],"\u0413\u04c0\u0430\u043b\u0433\u04c0\u0430\u0439"],"io":["Latn",["WW"],"Ido"],"is":["Latn",["EU"],"\u00edslenska"],"it":["Latn",["EU"],"italiano"],"iu":["Cans",["AM"],"\u1403\u14c4\u1483\u144e\u1450\u1466\/inuktitut"],"ja":["Jpan",["AS"],"\u65e5\u672c\u8a9e"],"jam":["Latn",["AM"],"Patois"],"jbo":["Latn",["WW"],"Lojban"],"jut":["Latn",["EU"],"jysk"],"jv":["Latn",["AS","PA"],"Basa Jawa"],"ka":["Geor",["EU"],"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8"],"kaa":["Latn",["AS"],"Qaraqalpaqsha"],"kab":["Latn",["AF","EU"],"Taqbaylit"],"kbd-cyrl":["Cyrl",["EU","ME"],"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d"],"kbd-latn":["Latn",["EU"],"Qabardjaj\u0259bza"],"kbd":["Cyrl",["EU","ME"],"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d"],"kea":["Latn",["AF"],"Kabuverdianu"],"kg":["Latn",["AF"],"Kongo"],"kgp":["Latn",["AM"],"Kaing\u00e1ng"],"khw":["Arab",["ME","AS"],"\u06a9\u06be\u0648\u0627\u0631"],"ki":["Latn",["AF"],"G\u0129k\u0169y\u0169"],"kiu":["Latn",["EU","ME"],"K\u0131rmancki"],"kj":["Latn",["AF"],"Kwanyama"],"kk-arab":["Arab",["EU","AS"],"\u0642\u0627\u0632\u0627\u0642\u0634\u0627 (\u062a\u0674\u0648\u062a\u06d5)"],"kk-cn":["Arab",["EU","AS","ME"],"\u0642\u0627\u0632\u0627\u0642\u0634\u0627 (\u062c\u06c7\u0646\u06af\u0648)"],"kk-cyrl":["Cyrl",["EU","AS"],"\u049b\u0430\u0437\u0430\u049b\u0448\u0430 (\u043a\u0438\u0440\u0438\u043b)"],"kk-kz":["Cyrl",["EU","AS"],"\u049b\u0430\u0437\u0430\u049b\u0448\u0430 (\u049a\u0430\u0437\u0430\u049b\u0441\u0442\u0430\u043d)"],"kk-latn":["Latn",["EU","AS","ME"],"qazaq\u015fa (lat\u0131n)"],"kk-tr":["Latn",["EU","AS","ME"],"qazaq\u015fa (T\u00fcrk\u00efya)"],"kk":["Cyrl",["EU","AS"],"\u049b\u0430\u0437\u0430\u049b\u0448\u0430 \/ \u0642\u0627\u0632\u0627\u0642\u0634\u0627 \/ qazaq\u015fa"],"kl":["Latn",["AM","EU"],"kalaallisut"],"km":["Khmr",["AS"],"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a"],"kn":["Knda",["AS"],"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1"],"ko-kp":["Kore",["AS"],"\ud55c\uad6d\uc5b4 (\uc870\uc120)"],"ko":["Kore",["AS"],"\ud55c\uad6d\uc5b4"],"koi":["Cyrl",["EU"],"\u041f\u0435\u0440\u0435\u043c \u041a\u043e\u043c\u0438"],"kr":["Latn",["AF"],"Kanuri"],"krc":["Cyrl",["EU"],"\u043a\u044a\u0430\u0440\u0430\u0447\u0430\u0439-\u043c\u0430\u043b\u043a\u044a\u0430\u0440"],"kri":["Latn",["AF"],"Krio"],"krj":["Latn",["ME","EU"],"Kinaray-a"],"krl":["Latn",["EU"],"Karjala"],"ks-arab":["Arab",["AS"],"\u06a9\u0672\u0634\u064f\u0631"],"ks-deva":["Deva",["AS"],"\u0915\u0949\u0936\u0941\u0930"],"ks":["Arab",["AS"],"\u0915\u0949\u0936\u0941\u0930 \/ \u06a9\u0672\u0634\u064f\u0631"],"ksf":["Latn",["AF"],"Bafia"],"ksh":["Latn",["EU"],"Ripoarisch"],"ku-arab":["Arab",["EU","ME"],"\u0643\u0648\u0631\u062f\u064a (\u0639\u06d5\u0631\u06d5\u0628\u06cc)"],"ku-latn":["Latn",["EU","ME"],"Kurd\u00ee (lat\u00een\u00ee)"],"ku":["Latn",["EU","ME"],"\u0643\u0648\u0631\u062f\u064a \/ Kurd\u00ee"],"kv":["Cyrl",["EU"],"\u043a\u043e\u043c\u0438"],"kw":["Latn",["EU"],"kernowek"],"ky":["Cyrl",["AS"],"\u041a\u044b\u0440\u0433\u044b\u0437\u0447\u0430"],"la":["Latn",["EU"],"Latina"],"lad":["Latn",["ME","EU","AM"],"Ladino"],"lb":["Latn",["EU"],"L\u00ebtzebuergesch"],"lbe":["Cyrl",["EU"],"\u043b\u0430\u043a\u043a\u0443"],"lez":["Cyrl",["EU"],"\u043b\u0435\u0437\u0433\u0438"],"lfn":["Latn",["WW"],"Lingua Franca Nova"],"lg":["Latn",["AF"],"Luganda"],"li":["Latn",["EU"],"Limburgs"],"lij":["Latn",["EU"],"Ligure"],"liv":["Latn",["EU"],"L\u012bv\u00f5 k\u0113\u013c"],"lld":["Latn",["EU"],"Ladin"],"lmo":["Latn",["EU"],"lumbaart"],"ln":["Latn",["AF"],"ling\u00e1la"],"lo":["Laoo",["AS"],"\u0ea5\u0eb2\u0ea7"],"loz":["Latn",["AF"],"Silozi"],"lt":["Latn",["EU"],"lietuvi\u0173"],"ltg":["Latn",["EU"],"latga\u013cu"],"lus":["Latn",["AS"],"Mizo \u0163awng"],"lv":["Latn",["EU"],"latvie\u0161u"],"lzh":["Hant",["AS"],"\u6587\u8a00"],"lzz":["Latn",["EU","ME"],"Lazuri"],"mai":["Deva",["AS"],"\u092e\u0948\u0925\u093f\u0932\u0940"],"map-bms":["Latn",["AS"],"Basa Banyumasan"],"mdf":["Cyrl",["EU"],"\u043c\u043e\u043a\u0448\u0435\u043d\u044c"],"mfe":["Latn",["AM"],"Morisyen"],"mg":["Latn",["AF"],"Malagasy"],"mh":["Latn",["PA"],"Ebon"],"mhr":["Cyrl",["EU"],"\u043e\u043b\u044b\u043a \u043c\u0430\u0440\u0438\u0439"],"mi":["Latn",["PA"],"M\u0101ori"],"mic":["Latn",["AM"],"Mi'kmaq"],"min":["Latn",["AS"],"Baso Minangkabau"],"mk":["Cyrl",["EU"],"\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438"],"ml":["Mlym",["AS","ME"],"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02"],"mn":["Cyrl",["AS"],"\u043c\u043e\u043d\u0433\u043e\u043b"],"mnc":["Mong",["AS"],"\u182e\u1820\u1828\u1835\u1860 \u1864\u1873\u1830\u1860\u1828"],"mni":["Beng",["AS"],"\u09ae\u09c7\u0987\u09a4\u09c7\u0987 \u09b2\u09cb\u09a8\u09cd"],"mnw":["Mymr",["AS"],"\u1018\u102c\u101e\u102c \u1019\u1014\u103a"],"mo":["Cyrl",["EU"],"\u043c\u043e\u043b\u0434\u043e\u0432\u0435\u043d\u044f\u0441\u043a\u044d"],"mr":["Deva",["AS","ME"],"\u092e\u0930\u093e\u0920\u0940"],"mrj":["Cyrl",["EU"],"\u043a\u044b\u0440\u044b\u043a \u043c\u0430\u0440\u044b"],"ms":["Latn",["AS"],"Bahasa Melayu"],"mt":["Latn",["EU"],"Malti"],"mui":["Latn",["AS"],"Musi"],"mus":["Latn",["AM"],"Mvskoke"],"mwl":["Latn",["EU"],"Mirand\u00e9s"],"mwv":["Latn",["AS"],"Behase Mentawei"],"my":["Mymr",["AS"],"\u1019\u103c\u1014\u103a\u1019\u102c\u1018\u102c\u101e\u102c"],"myv":["Cyrl",["EU"],"\u044d\u0440\u0437\u044f\u043d\u044c"],"mzn":["Arab",["ME","AS"],"\u0645\u0627\u0632\u0650\u0631\u0648\u0646\u06cc"],"na":["Latn",["PA"],"Dorerin Naoero"],"nah":["Latn",["AM"],"N\u0101huatl"],"nan":["Latn",["AS"],"B\u00e2n-l\u00e2m-g\u00fa"],"nap":["Latn",["EU"],"Nnapulitano"],"nb":["Latn",["EU"],"norsk (bokm\u00e5l)"],"nds-nl":["Latn",["EU"],"Nedersaksisch"],"nds":["Latn",["EU"],"Plattd\u00fc\u00fctsch"],"ne":["Deva",["AS"],"\u0928\u0947\u092a\u093e\u0932\u0940"],"new":["Deva",["AS"],"\u0928\u0947\u092a\u093e\u0932 \u092d\u093e\u0937\u093e"],"ng":["Latn",["AF"],"Oshiwambo"],"niu":["Latn",["PA"],"ko e vagahau Niu\u0113"],"njo":["Latn",["AS"],"Ao"],"nl-informal":["Latn",["EU","AM"],"Nederlands (informeel)"],"nl":["Latn",["EU","AM"],"Nederlands"],"nn":["Latn",["EU"],"norsk (nynorsk)"],"no":["Latn",["EU"]],"nov":["Latn",["WW"],"Novial"],"nqo":["Nkoo",["AF"],"\u07d2\u07de\u07cf"],"nrm":["Latn",["EU"],"Nouormand"],"nso":["Latn",["AF"],"Sesotho sa Leboa"],"nv":["Latn",["AM"],"Din\u00e9 bizaad"],"ny":["Latn",["AF"],"Chi-Chewa"],"oc":["Latn",["EU"],"occitan"],"om":["Latn",["AF"],"Oromoo"],"or":["Orya",["AS"],"\u0b13\u0b5c\u0b3f\u0b06"],"os":["Cyrl",["EU"],"\u0418\u0440\u043e\u043d"],"pa":["Guru",["AS"],"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40"],"pag":["Latn",["AS"],"Pangasinan"],"pam":["Latn",["AS"],"Kapampangan"],"pap":["Latn",["AM"],"Papiamentu"],"pcd":["Latn",["EU"],"Picard"],"pdc":["Latn",["EU","AM"],"Deitsch"],"pdt":["Latn",["EU","AM"],"Plautdietsch"],"pfl":["Latn",["EU"],"P\u00e4lzisch"],"pi":["Deva",["AS"],"\u092a\u093e\u0933\u093f"],"pih":["Latn",["PA"],"Norfuk \/ Pitkern"],"pis":["Latn",["PA"],"Pijin"],"pko":["Latn",["AF"],"P\u00f6koot"],"pl":["Latn",["EU"],"polski"],"pms":["Latn",["EU"],"Piemont\u00e8is"],"pnb":["Arab",["AS","ME"],"\u067e\u0646\u062c\u0627\u0628\u06cc"],"pnt":["Grek",["EU"],"\u03a0\u03bf\u03bd\u03c4\u03b9\u03b1\u03ba\u03ac"],"ppl":["Latn",["AM"],"Nawat"],"prg":["Latn",["EU"],"Pr\u016bsiskan"],"pru":["Latn",["EU"],"Pr\u016bsiskan"],"ps":["Arab",["AS","ME"],"\u067e\u069a\u062a\u0648"],"pt-br":["Latn",["AM"],"portugu\u00eas do Brasil"],"pt":["Latn",["EU","AM","AS","PA","AF","WW"],"portugu\u00eas"],"qu":["Latn",["AM"],"Runa Simi"],"qug":["Latn",["AM"],"Runa shimi"],"rap":["Latn",["AM"],"arero rapa nui"],"rgn":["Latn",["EU"],"Rumagn\u00f4l"],"rif":["Latn",["AF"],"Tarifit"],"rki":["Mymr",["AS"],"\u101b\u1001\u102d\u102f\u1004\u103a"],"rm":["Latn",["EU"],"rumantsch"],"rmy":["Latn",["EU"],"Romani"],"rn":["Latn",["AF"],"Kirundi"],"ro":["Latn",["EU"],"rom\u00e2n\u0103"],"roa-rup":["Latn",["EU"],"Arm\u00e3neashce"],"roa-tara":["Latn",["EU"],"tarand\u00edne"],"rtm":["Latn",["PA"],"Faeag Rotuma"],"ru":["Cyrl",["EU","AS","ME"],"\u0440\u0443\u0441\u0441\u043a\u0438\u0439"],"rue":["Cyrl",["EU"],"\u0440\u0443\u0441\u0438\u043d\u044c\u0441\u043a\u044b\u0439"],"rup":["Latn",["EU"],"Arm\u00e3neashce"],"ruq":["Latn",["EU"],"Vl\u0103he\u015fte"],"ruq-cyrl":["Cyrl",["EU"],"\u0412\u043b\u0430\u0445\u0435\u0441\u0442\u0435"],"ruq-grek":["Grek",["EU"],"Megleno-Romanian (Greek script)"],"ruq-latn":["Latn",["EU"],"Vl\u0103he\u015fte"],"rw":["Latn",["AF"],"Kinyarwanda"],"ryu":["Kana",["AS"],"\u0294ucin\u0101guci"],"sa":["Deva",["AS"],"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d"],"sah":["Cyrl",["EU","AS"],"\u0441\u0430\u0445\u0430 \u0442\u044b\u043b\u0430"],"sat":["Latn",["AS"],"Santali"],"saz":["Saur",["AS"],"\ua8b1\ua8c3\ua8ac\ua8b5\ua8af\ua8c4\ua8a1\ua8c4\ua8ac\ua8b5"],"sc":["Latn",["EU"],"sardu"],"scn":["Latn",["EU"],"sicilianu"],"sco":["Latn",["EU"],"Scots"],"sd":["Arab",["AS"],"\u0633\u0646\u068c\u064a"],"sdc":["Latn",["EU"],"Sassaresu"],"se":["Latn",["EU"],"s\u00e1megiella"],"sei":["Latn",["AM"],"Cmique Itom"],"sg":["Latn",["AF"],"S\u00e4ng\u00f6"],"sgs":["Latn",["EU"],"\u017eemait\u0117\u0161ka"],"sh-cyrl":["Cyrl",["EU"],"\u0441\u0440\u043f\u0441\u043a\u043e\u0445\u0440\u0432\u0430\u0442\u0441\u043a\u0438"],"sh-latn":["Latn",["EU"],"srpskohrvatski"],"sh":["Latn",["EU"],"srpskohrvatski \/ \u0441\u0440\u043f\u0441\u043a\u043e\u0445\u0440\u0432\u0430\u0442\u0441\u043a\u0438"],"shi-latn":["Latn",["AF"],"Ta\u0161l\u1e25iyt"],"shi-tfng":["Tfng",["AF"],"\u2d5c\u2d30\u2d5b\u2d4d\u2d43\u2d49\u2d5c"],"shi":["Latn",["AF"],"Ta\u0161l\u1e25iyt \/ \u2d5c\u2d30\u2d5b\u2d4d\u2d43\u2d49\u2d5c"],"shn":["Mymr",["AS"],"\u101c\u102d\u1075\u103a\u1088\u1010\u1086\u1038"],"si":["Sinh",["AS"],"\u0dc3\u0dd2\u0d82\u0dc4\u0dbd"],"simple":["Latn",["WW"],"Simple English"],"sk":["Latn",["EU"],"sloven\u010dina"],"sl":["Latn",["EU"],"sloven\u0161\u010dina"],"sli":["Latn",["EU"],"Schl\u00e4sch"],"slr":["Latn",["AS"],"Sal\u0131r\u00e7a"],"sly":["Latn",["AS"],"Bahasa Selayar"],"sm":["Latn",["PA"],"Gagana Samoa"],"sma":["Latn",["EU"],"\u00e5arjelsaemien"],"smj":["Latn",["EU"],"julevs\u00e1megiella"],"smn":["Latn",["EU"],"anar\u00e2\u0161kiel\u00e2"],"sms":["Latn",["EU"],"s\u00e4\u00e4\u00b4m\u01e9i\u00f5ll"],"sn":["Latn",["AF"],"chiShona"],"so":["Latn",["AF"],"Soomaaliga"],"sq":["Latn",["EU"],"shqip"],"sr-ec":["Cyrl",["EU"],"\u0441\u0440\u043f\u0441\u043a\u0438 (\u045b\u0438\u0440\u0438\u043b\u0438\u0446\u0430)"],"sr-el":["Latn",["EU"],"srpski (latinica)"],"sr":["Cyrl",["EU"],"\u0441\u0440\u043f\u0441\u043a\u0438 \/ srpski"],"srn":["Latn",["AM","EU"],"Sranantongo"],"ss":["Latn",["AF"],"SiSwati"],"st":["Latn",["AF"],"Sesotho"],"stq":["Latn",["EU"],"Seeltersk"],"su":["Latn",["AS"],"Basa Sunda"],"sv":["Latn",["EU"],"svenska"],"sw":["Latn",["AF"],"Kiswahili"],"swb":["Latn",["AF"],"Shikomoro"],"sxu":["Latn",["EU"],"S\u00e4ggssch"],"szl":["Latn",["EU"],"\u015bl\u016fnski"],"ta":["Taml",["AS"],"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd"],"tcy":["Knda",["AS"],"\u0ca4\u0cc1\u0cb3\u0cc1"],"te":["Telu",["AS"],"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41"],"tet":["Latn",["AS","PA"],"tetun"],"tg-cyrl":["Cyrl",["AS"],"\u0442\u043e\u04b7\u0438\u043a\u04e3"],"tg-latn":["Latn",["AS"],"tojik\u012b"],"tg":["Cyrl",["AS"],"\u0442\u043e\u04b7\u0438\u043a\u04e3"],"th":["Thai",["AS"],"\u0e44\u0e17\u0e22"],"ti":["Ethi",["AF"],"\u1275\u130d\u122d\u129b"],"tk":["Latn",["AS"],"T\u00fcrkmen\u00e7e"],"tkr":["Cyrl",["AS"],"\u0426\u04c0\u0430\u044c\u0445\u043d\u0430 \u043c\u0438\u0437"],"tl":["Latn",["AS"],"Tagalog"],"tly":["Cyrl",["EU","AS","ME"],"\u0442\u043e\u043b\u044b\u0448\u04d9 \u0437\u044b\u0432\u043e\u043d"],"tn":["Latn",["AF"],"Setswana"],"to":["Latn",["PA"],"lea faka-Tonga"],"tokipona":["Latn",["WW"],"Toki Pona"],"tpi":["Latn",["PA","AS"],"Tok Pisin"],"tr":["Latn",["EU","ME"],"T\u00fcrk\u00e7e"],"trp":["Latn",["AS"],"Kokborok (Tripuri)"],"tru":["Latn",["AS"],"\u1e6auroyo"],"ts":["Latn",["AF"],"Xitsonga"],"tsd":["Grek",["EU"],"\u03a4\u03c3\u03b1\u03ba\u03c9\u03bd\u03b9\u03ba\u03ac"],"tt-cyrl":["Cyrl",["EU"],"\u0442\u0430\u0442\u0430\u0440\u0447\u0430"],"tt-latn":["Latn",["EU"],"tatar\u00e7a"],"tt":["Cyrl",["EU"],"\u0442\u0430\u0442\u0430\u0440\u0447\u0430 \/ tatar\u00e7a"],"ttt":["Cyrl",["AS"],"Tati"],"tum":["Latn",["AF"],"chiTumbuka"],"tw":["Latn",["AF"],"Twi"],"twd":["Latn",["EU"],"Tweants"],"ty":["Latn",["PA"],"Reo M\u0101`ohi"],"tyv":["Cyrl",["AS"],"\u0442\u044b\u0432\u0430 \u0434\u044b\u043b"],"tzm":["Tfng",["AF"],"\u2d5c\u2d30\u2d4e\u2d30\u2d63\u2d49\u2d56\u2d5c"],"udm":["Cyrl",["EU"],"\u0443\u0434\u043c\u0443\u0440\u0442"],"ug-arab":["Arab",["AS"],"\u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u06d5"],"ug-latn":["Latn",["AS"],"Uyghurche"],"ug":["Arab",["AS"],"\u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u06d5 \/ Uyghurche"],"uk":["Cyrl",["EU"],"\u0443\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"],"ur":["Arab",["AS","ME"],"\u0627\u0631\u062f\u0648"],"uz":["Latn",["AS"],"o\u02bbzbekcha"],"ve":["Latn",["AF"],"Tshivenda"],"vec":["Latn",["EU"],"v\u00e8neto"],"vep":["Latn",["EU"],"veps\u00e4n kel\u2019"],"vi":["Latn",["AS"],"Ti\u1ebfng Vi\u1ec7t"],"vls":["Latn",["EU"],"West-Vlams"],"vmf":["Latn",["EU"],"Mainfr\u00e4nkisch"],"vo":["Latn",["WW"],"Volap\u00fck"],"vot":["Latn",["EU"],"Va\u010f\u010fa"],"vro":["Latn",["EU"],"V\u00f5ro"],"wa":["Latn",["EU"],"walon"],"war":["Latn",["AS"],"Winaray"],"wls":["Latn",["PA"],"Faka'uvea"],"wo":["Latn",["AF"],"Wolof"],"wuu":["Hans",["EU"],"\u5434\u8bed"],"xal":["Cyrl",["EU"],"\u0445\u0430\u043b\u044c\u043c\u0433"],"xh":["Latn",["AF"],"isiXhosa"],"xmf":["Geor",["EU"],"\u10db\u10d0\u10e0\u10d2\u10d0\u10da\u10e3\u10e0\u10d8"],"ydd":["Hebr",["AS","EU"],"Eastern Yiddish"],"yi":["Hebr",["ME","EU","AM"],"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9"],"yo":["Latn",["AF"],"Yor\u00f9b\u00e1"],"yrk":["Cyrl",["AS"],"\u041d\u0435\u043d\u044d\u0446\u044f\u02bc \u0432\u0430\u0434\u0430"],"yrl":["Latn",["AM"],"\u00f1e'engat\u00fa"],"yua":["Latn",["AM"],"Maaya T'aan"],"yue":["Hant",["AS"],"\u7cb5\u8a9e"],"za":["Latn",["AS"],"Vahcuengh"],"zea":["Latn",["EU"],"Ze\u00eauws"],"zh-classical":["Hant",["AS"],"\u6587\u8a00"],"zh-cn":["Hans",["AS"],"\u4e2d\u6587\uff08\u4e2d\u56fd\u5927\u9646\uff09"],"zh-hans":["Hans",["AS"],"\u4e2d\u6587\uff08\u7b80\u4f53\uff09"],"zh-hant":["Hant",["AS"],"\u4e2d\u6587\uff08\u7e41\u9ad4\uff09"],"zh-hk":["Hant",["AS"],"\u4e2d\u6587\uff08\u9999\u6e2f\uff09"],"zh-min-nan":["Latn",["AS"],"B\u00e2n-l\u00e2m-g\u00fa"],"zh-mo":["Hant",["AS"],"\u4e2d\u6587\uff08\u6fb3\u9580\uff09"],"zh-my":["Hans",["AS"],"\u4e2d\u6587\uff08\u9a6c\u6765\u897f\u4e9a\uff09"],"zh-sg":["Hans",["AS"],"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09"],"zh-tw":["Hant",["AS"],"\u4e2d\u6587\uff08\u53f0\u7063\uff09"],"zh-yue":["Hans",["AS"],"\u7cb5\u8a9e"],"zh":["Hans",["AS"],"\u4e2d\u6587"],"zu":["Latn",["AF"],"isiZulu"]},"scriptgroups":{"Latin":["Latn","Goth"],"Greek":["Grek"],"WestCaucasian":["Armn","Geor"],"Arabic":["Arab"],"MiddleEastern":["Hebr","Syrc"],"African":["Ethi","Nkoo","Tfng"],"SouthAsian":["Beng","Deva","Gujr","Guru","Knda","Mlym","Orya","Saur","Sinh","Taml","Telu","Tibt","Thaa"],"Cyrillic":["Cyrl"],"CJK":["Hans","Hant","Kana","Kore","Jpan","Yiii"],"SouthEastAsian":["Batk","Bugi","Java","Khmr","Laoo","Mymr","Thai"],"Mongolian":["Mong"],"SignWriting":["Sgnw"],"NativeAmerican":["Cher","Cans"]},"rtlscripts":["Arab","Hebr","Syrc","Nkoo","Thaa"],"regiongroups":{"WW":1,"AM":2,"EU":3,"ME":3,"AF":3,"AS":4,"PA":4},"territories":{"AC":["en"],"AD":["ca","es","fr"],"AE":["ar","ml","ps","bal","fa"],"AF":["fa","ps","haz","uz_Arab","tk","prd","bal","ug_Arab","kk_Arab"],"AG":["en","pt"],"AI":["en"],"AL":["sq","el","mk"],"AM":["hy","az_Latn","ku_Latn"],"AO":["pt","umb","kmb"],"AQ":["und"],"AR":["es","cy","gn"],"AS":["sm","en"],"AT":["de","hr","sl","hu"],"AU":["en","zh_Hant","it"],"AW":["nl","pap","en"],"AX":["sv"],"AZ":["az_Latn","az_Cyrl","ku_Latn"],"BA":["bs","hr","sr_Cyrl","sr_Latn"],"BB":["en"],"BD":["bn","syl","ccp","my","grt","mni"],"BE":["nl","en","fr","wa","de"],"BF":["mos","dyu","fr"],"BG":["bg","tr"],"BH":["ar","ml"],"BI":["rn","fr","sw"],"BJ":["fr","fon","yo"],"BL":["fr"],"BM":["en"],"BN":["ms","zh_Hant","en"],"BO":["es","qu","ay","gn"],"BQ":[],"BR":["pt","de","it","ja","ko","kgp","gub","xav"],"BS":["en"],"BT":["dz","ne","tsj","lep"],"BV":["und"],"BW":["en","tn","af"],"BY":["be","ru"],"BZ":["en","es"],"CA":["en","fr","it","de","cwd","crk","ike","moe","crj","atj","crl","csw","crm","ikt","dgr","xsl","scs","nsk","chp","iku","gwi"],"CC":["ms","en"],"CD":["sw","lua","fr","ln","lu","kg","lol","rw"],"CF":["fr","sg"],"CG":["fr","ln"],"CH":["de","fr","gsw","it","lmo","rm","rmo","wae"],"CI":["fr","bci","sef","daf","kfo","bqv"],"CK":["en"],"CL":["es"],"CM":["fr","en","ar","ha_Arab"],"CN":["zh_Hans","ii","ug_Arab","za","mn_Mong","bo","ko","kk_Arab","lis","ky_Arab","nbf","khb","tdd","lcp","en","ru","vi","uz_Cyrl"],"CO":["es"],"CP":["fr"],"CR":["es"],"CU":["es"],"CV":["kea","pt"],"CW":[],"CX":["en"],"CY":["el","tr","hy","ar"],"CZ":["cs","de","pl"],"DE":["de","en","nds","tr","hr","it","ku_Latn","ru","el","ksh","pl","es","nl","da"],"DG":["en"],"DJ":["aa","so","ar","fr"],"DK":["da","de","kl"],"DM":["en"],"DO":["es","en"],"DZ":["ar","fr","kab"],"EA":["es"],"EC":["es"],"EE":["et","ru"],"EG":["ar","el"],"EH":["ar"],"ER":["ti","tig","ar","ssy","aa","byn"],"ES":["es","en","ca","gl","eu","ast"],"ET":["en","am","om","so","ti","sid","wal","aa"],"FI":["fi","sv","ru","en","et","rmf","se","smn","sms"],"FJ":["en","hi","fj"],"FK":["en"],"FM":["chk","pon","kos","yap","en","uli"],"FO":["fo"],"FR":["fr","en","oc","it","pt","gsw","br","co","ca","nl","eu"],"GA":["fr","puu","mdt"],"GB":["en","sco","cy","pa_Guru","bn","zh_Hant","syl","el","it","ks","gd","ml","ga","fr","kw"],"GD":["en"],"GE":["ka","ru","hy","ab","os","ku_Latn"],"GF":["fr","gcr","zh_Hant"],"GG":["en"],"GH":["ak","ee","abr","en","gaa","ha_Latn"],"GI":["en"],"GL":["iu","kl","da"],"GM":["en"],"GN":["fr","ff","emk","sus","kpe"],"GP":["fr"],"GQ":["es","fan","fr","bvb","syi"],"GR":["el","mk","tr","bg","sq"],"GS":["und"],"GT":["es"],"GU":["en","ch"],"GW":["pt"],"GY":["en"],"HK":["zh_Hant","en","zh_Hans"],"HM":["und"],"HN":["es","en"],"HR":["hr","it"],"HT":["ht","fr"],"HU":["hu","de","ro","hr","sk","sl"],"IC":["es"],"ID":["id","jv","su","mad","ms","min","bya","bjn","ban","bug","ace","bew","sas","bbc","zh_Hant","mak","ljp","rej","gor","nij","kge","aoz","mgy","kvr","lbw","rob","mdr","sxn"],"IE":["en","ga"],"IL":["he","ar","ru","ro","en","pl","hu","am","ti","ml"],"IM":["en","gv"],"IN":["hi","en","bn","te","mr","ta","ur","gu","kn","ml","or","pa_Guru","bho","awa","as","bgc","mag","mwr","mai","hne","dcc","dhd","bjj","ne","sat","wtm","ks","kok","swv","gbm","lmn","sd_Arab","gon","kfy","doi","kru","sck","gno","tcy","wbq","xnr","wbr","khn","brx","noe","bhb","mni","mup","hoc","mtr","unr","bhi","hoj","kha","kfr","grt","unx","bfy","srx","saz","ccp","sd_Deva","bfq","ria","bo","bft","bra","lep","btv","lif","lah","sa","kht","dv","dz"],"IO":["en"],"IQ":["ar","ku_Arab","fa"],"IR":["fa","az_Arab","glk","ckb","tk","sdh","lrc","ar","bal","rmt","bqi","luz","ku_Arab","lki","prd","hy","ps","ka","kk_Arab"],"IS":["is","da"],"IT":["it","en","nap","scn","fur","de","fr","sl","ca","el","hr"],"JE":["en"],"JM":["en"],"JO":["ar"],"JP":["ja","ryu","ko"],"KE":["en","sw","ki","luy","luo","kam","kln","guz","mer","mas","ebu","so","dav","teo","pko","om","saq","ar","pa_Guru","gu"],"KG":["ky_Cyrl","ru"],"KH":["km","cja","kdt"],"KI":["en","gil"],"KM":["ar","fr","zdj"],"KN":["en"],"KP":["ko"],"KR":["ko"],"KW":["ar"],"KY":["en"],"KZ":["ru","kk_Cyrl","de","ug_Cyrl"],"LA":["lo","kdt"],"LB":["ar","hy","ku_Arab","fr","en"],"LC":["en"],"LI":["de","gsw","wae"],"LK":["si","ta","en"],"LR":["en","kpe","vai","men"],"LS":["st","zu","ss","en","xh"],"LT":["lt","ru"],"LU":["fr","lb","de"],"LV":["lv","ru"],"LY":["ar"],"MA":["ar","fr","tzm","shi","shi_Latn","rif","es"],"MC":["fr"],"MD":["ro","bg","gag","ru"],"ME":["sr_Latn","sq"],"MF":["fr"],"MG":["mg","fr","en"],"MH":["en","mh"],"MK":["mk","sq","tr"],"ML":["bm","fr","ffm","snk","mwk","ses","tmh","khq","dtm","kao","bzx","ar","bmq","bze"],"MM":["my","shn","mnw","kht"],"MN":["mn_Cyrl","kk_Arab","zh_Hans","ru","ug_Cyrl"],"MO":["zh_Hant","pt","zh_Hans"],"MP":["en","ch"],"MQ":["fr"],"MR":["ar","fr","ff","wo"],"MS":["en"],"MT":["mt","en"],"MU":["mfe","en","bho","ur","fr","ta"],"MV":["dv"],"MW":["en","ny","tum","zu"],"MX":["es","yua","nhe","nhw","maz","nch"],"MY":["ms","en","zh_Hant","ta","bjn","jv","zmi","ml","bug"],"MZ":["pt","vmw","ndc","ts","ngl","seh","rng","ny","yao","sw","zu"],"NA":["kj","ng","naq","en","af","de","tn"],"NC":["fr"],"NE":["ha_Latn","fr","dje","fuq","tmh","ar","twq"],"NF":["en"],"NG":["en","ha_Latn","ig","yo","fuv","tiv","efi","ibb","ha_Arab","bin","kaj","kcg","ar","cch","amo"],"NI":["es"],"NL":["nl","en","li","fy","gos","id","zea","rif","tr"],"NO":["nb","nn","se"],"NP":["ne","mai","bho","new","jml","taj","awa","thl","bap","lif","tdg","thr","mgp","thq","mrd","bfy","rjb","xsr","tsf","hi","ggn","gvr","bo","tkt","tdh","bn","unr","lep"],"NR":["en","na"],"NU":["en","niu"],"NZ":["en","mi"],"OM":["ar","bal","fa"],"PA":["es","en","zh_Hant"],"PE":["es","qu","ay"],"PF":["fr","ty","zh_Hant"],"PG":["tpi","en","ho"],"PH":["tl","en","fil","es","ceb","ilo","hil","bcl","war","bhk","pam","pag","mdh","tsg","zh_Hant","bto","hnn","tbw","bku"],"PK":["ur","pa_Arab","en","lah","ps","sd_Arab","skr","bal","brh","hno","fa","hnd","tg_Arab","gju","bft","kvx","khw","mvy","kxp","gjk","ks","btv"],"PL":["pl","de","be","uk","csb"],"PM":["fr","en"],"PN":["en"],"PR":["es","en"],"PS":["ar"],"PT":["pt","gl"],"PW":["pau","en"],"PY":["gn","es","de"],"QA":["ar","fa","ml"],"RE":["fr","rcf","ta"],"RO":["ro","hu","de","tr","sr_Latn","bg","el","pl"],"RS":["sr_Cyrl","sr_Latn","sq","hu","ro","sk"],"RU":["ru","tt","ba","cv","ce","av","udm","chm","mhr","sah","kbd","myv","dar","bxr","mdf","kum","kpv","lez","krc","inh","tyv","ady","krl","koi","lbe","mrj","alt","fi","sr_Latn","mn_Cyrl"],"RW":["rw","fr","en"],"SA":["ar"],"SB":["en"],"SC":["crs","fr","en"],"SD":["ar","ha_Arab"],"SE":["sv","fi","se","smj","sma","ia"],"SG":["en","zh_Hans","ms","ta","ml","pa_Guru"],"SH":["en"],"SI":["sl","hu","it"],"SJ":["nb","ru"],"SK":["sk","hu","uk","pl","de"],"SL":["kri","en","men","tem"],"SM":["it","eo"],"SN":["fr","wo","ff","srr"],"SO":["so","sw","om"],"SR":["nl","srn","zh_Hant"],"SS":["ar","en"],"ST":["pt"],"SV":["es"],"SX":[],"SY":["ar","ku_Latn","fr","hy","syr"],"SZ":["en","ss","zu","ts"],"TA":["en"],"TC":["en"],"TD":["fr","ar"],"TF":["fr"],"TG":["fr","ee"],"TH":["th","tts","nod","sou","mfa","zh_Hant","kxm","kdt","mnw","shn","lcp","lwl"],"TJ":["tg_Cyrl","fa","ar"],"TK":["tkl","en"],"TL":["pt","tet"],"TM":["tk","ru","uz_Latn","ku_Latn"],"TN":["ar","fr"],"TO":["to","en"],"TR":["tr","ku_Latn","diq","kbd","az_Latn","ar","bgx","bg","ady","hy","ka","sr_Latn","sq","ab","el","uz_Latn","ky_Latn","kk_Cyrl"],"TT":["en","es"],"TV":["tvl","en"],"TW":["zh_Hant","trv"],"TZ":["sw","en","suk","nym","kde","bez","ksb","mas","asa","lag","jmc","rof","vun","rwk"],"UA":["uk","ru","pl","yi","rue","be","ro","bg","tr","hu","el"],"UG":["sw","lg","nyn","cgg","xog","en","teo","laj","myx","rw","ttj","hi"],"UM":["en"],"US":["en","es","zh_Hant","fr","de","tl","it","vi","ko","ru","nv","haw","chr","ik"],"UY":["es"],"UZ":["uz_Cyrl","uz_Latn","ru","kaa","tr"],"VA":["it","la"],"VC":["en"],"VE":["es"],"VG":["en"],"VI":["en"],"VN":["vi","zh_Hant","cjm"],"VU":["bi","en","fr"],"WF":["wls","fr","fud"],"WS":["sm","en"],"YE":["ar"],"YT":["swb","fr","buc","sw"],"ZA":["en","zu","xh","af","nso","tn","st","ts","ss","hi","ve","nr","sw"],"ZM":["en","bem","ny"],"ZW":["en","sn","nd","mxc","ndc","kck","ny","ve","tn"],"ZZ":[]}}; +} ( jQuery ) ); + +/** + * Utility functions for querying language data. + * + * Copyright (C) 2012 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris, + * Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other + * contributors. See CREDITS for a list. + * + * UniversalLanguageSelector is dual licensed GPLv2 or later and MIT. You don't + * have to do anything special to choose one license or the other and you don't + * have to notify anyone which license you are using. You are free to use + * UniversalLanguageSelector in commercial projects as long as the copyright + * header is left intact. See files GPL-LICENSE and MIT-LICENSE for details. + * + * @file + * @ingroup Extensions + * @licence GNU General Public Licence 2.0 or later + * @licence MIT License + */ + +(function ( $ ) { + "use strict"; + + /** + * Returns the script of the language. + * @param string language code + * @return string + */ + $.uls.data.script = function( language ) { + return $.uls.data.languages[language][0]; + }; + + /** + * Returns the regions in which a language is spoken. + * @param string language code + * @return array of strings + */ + $.uls.data.regions = function( language ) { + return ( $.uls.data.languages[language] && $.uls.data.languages[language][1] ) || 'UNKNOWN'; + }; + + /** + * Returns the autonym of the language. + * @param string language code + * @return string + */ + $.uls.data.autonym = function( language ) { + return ( $.uls.data.languages[language] && $.uls.data.languages[language][2] ) || language; + }; + + /** + * Returns all language codes and corresponding autonyms + * @return array + */ + $.uls.data.autonyms = function() { + var autonymsByCode = {}; + + for ( var language in $.uls.data.languages ) { + autonymsByCode[language] = $.uls.data.autonym( language ); + } + + return autonymsByCode; + }; + + /** + * Returns an array of all region codes. + * @return array + */ + $.uls.data.allRegions = function() { + var allRegions = []; + + for( var region in $.uls.data.regiongroups ) { + allRegions.push( region ); + } + + return allRegions; + }; + + /** + * Returns all languages written in script. + * @param script string + * @return array of strings (languages codes) + */ + $.uls.data.languagesInScript = function( script ) { + return $.uls.data.languagesInScripts( [ script ] ); + }; + + /** + * Returns all languages written in the given scripts. + * @param scripts array of strings + * @return array of strings (languages codes) + */ + $.uls.data.languagesInScripts = function( scripts ) { + var languagesInScripts = []; + + for ( var language in $.uls.data.languages ) { + for ( var i = 0; i < scripts.length; i++ ) { + if ( scripts[i] === $.uls.data.script(language) ) { + languagesInScripts.push( language ); + break; + } + } + } + + return languagesInScripts; + }; + + /** + * Returns all languages in a given region. + * @param region string + * @return array of strings (languages codes) + */ + $.uls.data.languagesInRegion = function( region ) { + return $.uls.data.languagesInRegions( [ region ] ); + }; + + /** + * Returns all languages in given regions. + * @param region array of strings. + * @return array of strings (languages codes) + */ + $.uls.data.languagesInRegions = function( regions ) { + var languagesInRegions = []; + + for ( var language in $.uls.data.languages ) { + for ( var i = 0; i < regions.length; i++ ) { + if ( $.inArray( regions[i], $.uls.data.regions( language ) ) !== -1 ) { + languagesInRegions.push( language ); + break; + } + } + } + + return languagesInRegions; + }; + + /** + * Returns all languages in a region group. + * @param groupNum number. + * @return array of strings (languages codes) + */ + $.uls.data.languagesInRegionGroup = function( groupNum ) { + return $.uls.data.languagesInRegions( $.uls.data.regionsInGroup( groupNum ) ); + }; + + /** + * Returns an associative array of languages in a region, + * grouped by script. + * @param string region code + * @return associative array + */ + $.uls.data.languagesByScriptInRegion = function( region ) { + var languagesByScriptInRegion = {}; + + for ( var language in $.uls.data.languages ) { + if ( $.inArray( region, $.uls.data.regions( language ) ) !== -1 ) { + var script = $.uls.data.script( language ); + if ( languagesByScriptInRegion[script] === undefined ) { + languagesByScriptInRegion[script] = []; + } + languagesByScriptInRegion[script].push( language ); + } + } + + return languagesByScriptInRegion; + }; + + /** + * Returns an associative array of languages in a region, + * grouped by script group. + * @param string region code + * @return associative array + */ + $.uls.data.languagesByScriptGroupInRegion = function( region ) { + return $.uls.data.languagesByScriptGroupInRegions( [ region ] ); + }; + + /** + * Returns an associative array of all languages, + * grouped by script group. + * @return associative array + */ + $.uls.data.allLanguagesByScriptGroup = function() { + return $.uls.data.languagesByScriptGroupInRegions( $.uls.data.allRegions() ); + }; + + /** + * Get the given list of languages grouped by script. + * @param languages Array of language codes + * @return {Object} Array of languages indexed by script codes + */ + $.uls.data.languagesByScriptGroup = function( languages ) { + var languagesByScriptGroup = {}, + scriptGroup, + language, + langScriptGroup; + + for ( scriptGroup in $.uls.data.scriptgroups ) { + for ( language in languages ) { + langScriptGroup = $.uls.data.scriptGroupOfLanguage( language ); + if( langScriptGroup !== scriptGroup ) { + continue; + } + if ( !languagesByScriptGroup[scriptGroup] ) { + languagesByScriptGroup[scriptGroup] = []; + } + languagesByScriptGroup[scriptGroup].push( language ); + } + } + + return languagesByScriptGroup; + }; + + /** + * Returns an associative array of languages in several regions, + * grouped by script group. + * @param array of strings - region codes + * @return associative array + */ + $.uls.data.languagesByScriptGroupInRegions = function( regions ) { + var languagesByScriptGroupInRegions = {}; + + for ( var language in $.uls.data.languages ) { + for ( var i = 0; i < regions.length; i++ ) { + if ( $.inArray( regions[i], $.uls.data.regions( language ) ) !== -1 ) { + var scriptGroup = $.uls.data.scriptGroupOfLanguage( language ); + if ( languagesByScriptGroupInRegions[scriptGroup] === undefined ) { + languagesByScriptGroupInRegions[scriptGroup] = []; + } + languagesByScriptGroupInRegions[scriptGroup].push( language ); + break; + } + } + } + + return languagesByScriptGroupInRegions; + }; + + /** + * Returns an array of languages grouped by region group, + * region, script group and script. + * @return associative array + */ + $.uls.data.allLanguagesByRegionAndScript = function() { + var allLanguagesByRegionAndScript = {}, + region, + regionGroup; + + for ( region in $.uls.data.regiongroups ) { + regionGroup = $.uls.data.regiongroups[region]; + if ( allLanguagesByRegionAndScript[regionGroup] === undefined ) { + allLanguagesByRegionAndScript[regionGroup] = {}; + } + allLanguagesByRegionAndScript[regionGroup][region] = {}; + } + + for ( var language in $.uls.data.languages ) { + var script = $.uls.data.script( language ); + var scriptGroup = $.uls.data.groupOfScript( script ); + var regions = $.uls.data.regions( language ); + + for ( var regionNum = 0; regionNum < regions.length; regionNum++ ) { + region = regions[regionNum]; + regionGroup = $.uls.data.regiongroups[region]; + + if ( allLanguagesByRegionAndScript[regionGroup][region][scriptGroup] === undefined ) { + allLanguagesByRegionAndScript[regionGroup][region][scriptGroup] = {}; + } + + if ( allLanguagesByRegionAndScript[regionGroup][region][scriptGroup][script] === undefined ) { + allLanguagesByRegionAndScript[regionGroup][region][scriptGroup][script] = []; + } + + allLanguagesByRegionAndScript[regionGroup][region][scriptGroup][script].push( language ); + } + } + + return allLanguagesByRegionAndScript; + }; + + /** + * Returns all regions in a region group. + * @param number groupNum + * @return array of strings + */ + $.uls.data.regionsInGroup = function( groupNum ) { + var regionsInGroup = []; + + for ( var region in $.uls.data.regiongroups ) { + if ( $.uls.data.regiongroups[region] === groupNum ) { + regionsInGroup.push( region ); + } + } + + return regionsInGroup; + }; + + /** + * Returns the script group of a script or 'Other' if it doesn't + * belong to any group. + * @param string script code + * @return string script group name + */ + $.uls.data.groupOfScript = function( script ) { + for ( var group in $.uls.data.scriptgroups ) { + if ( $.inArray( script, $.uls.data.scriptgroups[group] ) !== -1 ) { + return group; + } + } + + return 'Other'; + }; + + /** + * Returns the script group of a language. + * @param string language code + * @return string script group name + */ + $.uls.data.scriptGroupOfLanguage = function( language ) { + return $.uls.data.groupOfScript( $.uls.data.script( language ) ); + }; + + /** + * A callback for sorting languages by autonym. + * Can be used as an argument to a sort function. + * @param two language codes + */ + $.uls.data.sortByAutonym = function( a, b ) { + var autonymA = $.uls.data.autonym( a ) || a, + autonymB = $.uls.data.autonym( b ) || b; + return ( autonymA.toLowerCase() < autonymB.toLowerCase() ) ? -1 : 1; + }; + + /** + * Check if a language is right-to-left. + * @param string language code + * @return boolean + */ + $.uls.data.isRtl = function( language ) { + return $.inArray( $.uls.data.script( language ), $.uls.data.rtlscripts ) !== -1; + }; + + /** + * Returns the languages spoken in a territory. + * @param string Territory code + * @return list of language codes + */ + $.uls.data.languagesInTerritory = function( territory ) { + return $.uls.data.territories[territory]; + }; +} ( jQuery ) ); + +/** + * Universal Language Selector + * Language category display component - Used for showing the search results, + * grouped by regions, scripts + * + * Copyright (C) 2012 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris, + * Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other + * contributors. See CREDITS for a list. + * + * UniversalLanguageSelector is dual licensed GPLv2 or later and MIT. You don't + * have to do anything special to choose one license or the other and you don't + * have to notify anyone which license you are using. You are free to use + * UniversalLanguageSelector in commercial projects as long as the copyright + * header is left intact. See files GPL-LICENSE and MIT-LICENSE for details. + * + * @file + * @ingroup Extensions + * @licence GNU General Public Licence 2.0 or later + * @licence MIT License + */ + +(function( $ ) { + "use strict"; + + + var noResultsTemplate = '\ +
\ +

\ + No results found\ +

\ +
\ +
\ +

\ + You can search by language name, \ + script name, ISO code of language or \ + you can browse by region:\ + America, \ + Europe, \ + Middle East, \ + Africa, \ + Asia, \ + Pacific, \ + Worldwide.\ +

\ +
\ +
\ +
'; + + var LanguageCategoryDisplay = function( element, options ) { + this.$element = $( element ); + this.options = $.extend( {}, $.fn.lcd.defaults, options ); + this.$element.addClass( 'lcd' ); + this.regionDivs = {}; + this.$element.append( $(noResultsTemplate) ); + this.$noResults = this.$element.find( 'div.uls-no-results-view' ); + this.render(); + this.listen(); + }; + + LanguageCategoryDisplay.prototype = { + constructor: LanguageCategoryDisplay, + + append: function( langCode, regionCode ) { + this.addToRegion( langCode, regionCode ); + this.$noResults.hide(); + }, + + /** + * Add the language to a region. + * If the region parameter is given, add to that region alone + * Otherwise to all regions that this language belongs. + * @param langCode + * @param region Optional region + */ + addToRegion: function( langCode, region ) { + var that = this; + var language = that.options.languages[langCode], + langName = $.uls.data.autonym( langCode ) || language || langCode, + regions = []; + + if ( region ) { + regions.push( region ); + } else { + regions = $.uls.data.regions( langCode ); + } + + // World wide languages need not be repeated in all regions. + if ( $.inArray( 'WW', regions ) > -1 ) { + regions = [ 'WW' ]; + } + + for ( var i = 0; i < regions.length; i++ ) { + var regionCode = regions[i]; + + var $li = $( '
  • ' ) + .data( 'code', langCode ) + .append( + $( '' ).prop( 'href', '#' ).prop( 'title', language ).html( langName ) + ); + + // Append the element to the column in the list + var $column = that.getColumn( regionCode ); + var lastLanguage = $column.find( 'li:last' ).data( 'code' ); + + if ( lastLanguage ) { + var lastScriptGroup = $.uls.data.scriptGroupOfLanguage( lastLanguage ), + currentScriptGroup = $.uls.data.scriptGroupOfLanguage( langCode ); + + if ( lastScriptGroup !== currentScriptGroup ) { + if ( $column.find( 'li' ).length > 2 ) { + // If column already has 2 or more languages, add a new column + $column = that.getColumn( regionCode, true ); + } + } + } + + $column.append( $li ); + } + }, + /** + * Get a column to add language. + * @param String regionCode The region code + * @param boolean forceNew whether a new column must be created or not + */ + getColumn: function( regionCode, forceNew ) { + var $divRegionCode, $rowDiv, $ul; + + forceNew = forceNew || false; + $divRegionCode = this.regionDivs[regionCode]; + $rowDiv = $divRegionCode.find( 'div.row:last' ); + $ul = $rowDiv.find( 'ul:last' ); + + // Each column can have maximum 8 languages. + if ( $ul.length === 0 || $ul.find( 'li' ).length >= 8 || forceNew ) { + $ul = $( '