diff --git a/js/components.js b/js/components.js index 5ff0aafc09..fc16eb71f6 100644 --- a/js/components.js +++ b/js/components.js @@ -23351,7 +23351,7 @@ goog.exportSymbol("libphonenumber.isValidNumber",libphonenumber.isValidNumber);g goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.PhoneNumberFormat.NATIONAL);goog.exportSymbol("libphonenumber.PhoneNumberFormat.RFC3966",libphonenumber.PhoneNumberFormat.RFC3966);goog.exportSymbol("libphonenumber.format",libphonenumber.format);})(); //! moment.js -//! version : 2.8.3 +//! version : 2.8.4 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com @@ -23362,7 +23362,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho ************************************/ var moment, - VERSION = '2.8.3', + VERSION = '2.8.4', // the global-scope this is NOT the global object in Node.js globalScope = typeof global !== 'undefined' ? global : this, oldGlobalMoment, @@ -23385,7 +23385,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho momentProperties = [], // check for nodeJS - hasModule = (typeof module !== 'undefined' && module.exports), + hasModule = (typeof module !== 'undefined' && module && module.exports), // ASP.NET json date format regex aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, @@ -23396,8 +23396,8 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/, // format tokens - formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g, - localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g, + formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g, + localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, // parsing token regexes parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 @@ -23408,8 +23408,8 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic. parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z parseTokenT = /T/i, // T (ISO separator) + parseTokenOffsetMs = /[\+\-]?\d+/, // 1234567890123 parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 - parseTokenOrdinal = /\d{1,2}/, //strict parsing regexes parseTokenOneDigit = /\d/, // 0 - 9 @@ -23624,6 +23624,9 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho zz : function () { return this.zoneName(); }, + x : function () { + return this.valueOf(); + }, X : function () { return this.unix(); }, @@ -24050,7 +24053,10 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho overflow = m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE : - m._a[HOUR] < 0 || m._a[HOUR] > 23 ? HOUR : + m._a[HOUR] < 0 || m._a[HOUR] > 24 || + (m._a[HOUR] === 24 && (m._a[MINUTE] !== 0 || + m._a[SECOND] !== 0 || + m._a[MILLISECOND] !== 0)) ? HOUR : m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE : m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND : m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND : @@ -24077,7 +24083,8 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho if (m._strict) { m._isValid = m._isValid && m._pf.charsLeftOver === 0 && - m._pf.unusedTokens.length === 0; + m._pf.unusedTokens.length === 0 && + m._pf.bigHour === undefined; } } return m._isValid; @@ -24129,8 +24136,18 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho // Return a moment from input, that is local/utc/zone equivalent to model. function makeAs(input, model) { - return model._isUTC ? moment(input).zone(model._offset || 0) : - moment(input).local(); + var res, diff; + if (model._isUTC) { + res = model.clone(); + diff = (moment.isMoment(input) || isDate(input) ? + +input : +moment(input)) - (+res); + // Use low-level api, because this fn is low-level api. + res._d.setTime(+res._d + diff); + moment.updateOffset(res, false); + return res; + } else { + return moment(input).local(); + } } /************************************ @@ -24150,6 +24167,9 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho this['_' + i] = prop; } } + // Lenient ordinal parsing accepts just a number in addition to + // number + (possibly) stuff coming from _ordinalParseLenient. + this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + /\d{1,2}/.source); }, _months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), @@ -24162,22 +24182,32 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho return this._monthsShort[m.month()]; }, - monthsParse : function (monthName) { + monthsParse : function (monthName, format, strict) { var i, mom, regex; if (!this._monthsParse) { this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; } for (i = 0; i < 12; i++) { // make the regex if we don't have it already - if (!this._monthsParse[i]) { - mom = moment.utc([2000, i]); + mom = moment.utc([2000, i]); + if (strict && !this._longMonthsParse[i]) { + this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); + this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); + } + if (!strict && !this._monthsParse[i]) { regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex - if (this._monthsParse[i].test(monthName)) { + if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { + return i; + } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { + return i; + } else if (!strict && this._monthsParse[i].test(monthName)) { return i; } } @@ -24220,6 +24250,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho }, _longDateFormat : { + LTS : 'h:mm:ss A', LT : 'h:mm A', L : 'MM/DD/YYYY', LL : 'MMMM D, YYYY', @@ -24260,9 +24291,9 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho lastWeek : '[Last] dddd [at] LT', sameElse : 'L' }, - calendar : function (key, mom) { + calendar : function (key, mom, now) { var output = this._calendar[key]; - return typeof output === 'function' ? output.apply(mom) : output; + return typeof output === 'function' ? output.apply(mom, [now]) : output; }, _relativeTime : { @@ -24297,6 +24328,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho return this._ordinal.replace('%d', number); }, _ordinal : '%d', + _ordinalParse : /\d{1,2}/, preparse : function (string) { return string; @@ -24438,6 +24470,8 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho case 'a': case 'A': return config._locale._meridiemParse; + case 'x': + return parseTokenOffsetMs; case 'X': return parseTokenTimestampMs; case 'Z': @@ -24472,7 +24506,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho case 'E': return parseTokenOneOrTwoDigits; case 'Do': - return parseTokenOrdinal; + return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient; default : a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), 'i')); return a; @@ -24509,7 +24543,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho break; case 'MMM' : // fall through to MMMM case 'MMMM' : - a = config._locale.monthsParse(input); + a = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid. if (a != null) { datePartArray[MONTH] = a; @@ -24526,7 +24560,8 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho break; case 'Do' : if (input != null) { - datePartArray[DATE] = toInt(parseInt(input, 10)); + datePartArray[DATE] = toInt(parseInt( + input.match(/\d{1,2}/)[0], 10)); } break; // DAY OF YEAR @@ -24551,11 +24586,13 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho case 'A' : config._isPm = config._locale.isPM(input); break; - // 24 HOUR - case 'H' : // fall through to hh - case 'HH' : // fall through to hh + // HOUR case 'h' : // fall through to hh case 'hh' : + config._pf.bigHour = true; + /* falls through */ + case 'H' : // fall through to HH + case 'HH' : datePartArray[HOUR] = toInt(input); break; // MINUTE @@ -24575,6 +24612,10 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho case 'SSSS' : datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000); break; + // UNIX OFFSET (MILLISECONDS) + case 'x': + config._d = new Date(toInt(input)); + break; // UNIX TIMESTAMP WITH MS case 'X': config._d = new Date(parseFloat(input) * 1000); @@ -24711,12 +24752,25 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; } + // Check for 24:00:00.000 + if (config._a[HOUR] === 24 && + config._a[MINUTE] === 0 && + config._a[SECOND] === 0 && + config._a[MILLISECOND] === 0) { + config._nextDay = true; + config._a[HOUR] = 0; + } + config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input); // Apply timezone offset from input. The actual zone can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() + config._tzm); } + + if (config._nextDay) { + config._a[HOUR] = 24; + } } function dateFromObject(config) { @@ -24730,7 +24784,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho config._a = [ normalizedInput.year, normalizedInput.month, - normalizedInput.day, + normalizedInput.day || normalizedInput.date, normalizedInput.hour, normalizedInput.minute, normalizedInput.second, @@ -24803,6 +24857,10 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho config._pf.unusedInput.push(string); } + // clear _12h flag if hour is <= 12 + if (config._pf.bigHour === true && config._a[HOUR] <= 12) { + config._pf.bigHour = undefined; + } // handle am pm if (config._isPm && config._a[HOUR] < 12) { config._a[HOUR] += 12; @@ -24811,7 +24869,6 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho if (config._isPm === false && config._a[HOUR] === 12) { config._a[HOUR] = 0; } - dateFromConfig(config); checkOverflow(config); } @@ -25071,7 +25128,8 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho function makeMoment(config) { var input = config._i, - format = config._f; + format = config._f, + res; config._locale = config._locale || moment.localeData(config._l); @@ -25095,7 +25153,14 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho makeDateFromInput(config); } - return new Moment(config); + res = new Moment(config); + if (res._nextDay) { + // Adding is smart enough around DST + res.add(1, 'd'); + res._nextDay = undefined; + } + + return res; } moment = function (input, format, locale, strict) { @@ -25127,7 +25192,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho 'release. Please refer to ' + 'https://github.com/moment/moment/issues/1407 for more info.', function (config) { - config._d = new Date(config._i); + config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); } ); @@ -25439,7 +25504,12 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho toISOString : function () { var m = moment(this).utc(); if (0 < m.year() && m.year() <= 9999) { - return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + if ('function' === typeof Date.prototype.toISOString) { + // native implementation is ~50x faster, use it when we can + return this.toDate().toISOString(); + } else { + return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + } } else { return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); } @@ -25558,7 +25628,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(this.localeData().calendar(format, this)); + return this.format(this.localeData().calendar(format, this, moment(now))); }, isLeapYear : function () { @@ -25627,36 +25697,45 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho endOf: function (units) { units = normalizeUnits(units); + if (units === undefined || units === 'millisecond') { + return this; + } return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); }, isAfter: function (input, units) { + var inputMs; units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); if (units === 'millisecond') { input = moment.isMoment(input) ? input : moment(input); return +this > +input; } else { - return +this.clone().startOf(units) > +moment(input).startOf(units); + inputMs = moment.isMoment(input) ? +input : +moment(input); + return inputMs < +this.clone().startOf(units); } }, isBefore: function (input, units) { + var inputMs; units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); if (units === 'millisecond') { input = moment.isMoment(input) ? input : moment(input); return +this < +input; } else { - return +this.clone().startOf(units) < +moment(input).startOf(units); + inputMs = moment.isMoment(input) ? +input : +moment(input); + return +this.clone().endOf(units) < inputMs; } }, isSame: function (input, units) { + var inputMs; units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { input = moment.isMoment(input) ? input : moment(input); return +this === +input; } else { - return +this.clone().startOf(units) === +makeAs(input, this).startOf(units); + inputMs = +moment(input); + return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); } }, @@ -25833,7 +25912,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho }, lang : deprecate( - 'moment().lang() is deprecated. Use moment().localeData() instead.', + 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) { if (key === undefined) { return this.localeData(); @@ -26054,7 +26133,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho return units === 'month' ? months : months / 12; } else { // handle milliseconds separately because of floating point math errors (issue #1867) - days = this._days + yearsToDays(this._months / 12); + days = this._days + Math.round(yearsToDays(this._months / 12)); switch (units) { case 'week': return days / 7 + this._milliseconds / 6048e5; case 'day': return days + this._milliseconds / 864e5; @@ -26156,6 +26235,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho // Set default locale, other locale will inherit from English. moment.locale('en', { + ordinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal : function (number) { var b = number % 10, output = (toInt(number % 100 / 10) === 1) ? 'th' : @@ -27215,292 +27295,6 @@ JSON.stringify(result); } }); -// Generated by CoffeeScript 1.8.0 -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __slice = [].slice; - - Backbone.TypeaheadCollection = (function(_super) { - __extends(TypeaheadCollection, _super); - - function TypeaheadCollection() { - return TypeaheadCollection.__super__.constructor.apply(this, arguments); - } - - TypeaheadCollection.prototype._tokenize = function(s) { - s = $.trim(s); - if (s.length === 0) { - return null; - } - return s.toLowerCase().split(/[\s\-_]+/); - }; - - - /* - Recursive method for walking an object as defined by an - array. Returns the value of the last key in the array - sequence. - @private - @method _deepObjectMap - @param {Object} Object to walk - @param {Array} Keys to walk the object with - @return {Value} Last value from the object by array walk - - @example - _deepObjectMap - key: - key2: - key3: "val" - , ['key', 'key2', 'key3'] - * Returns "val" - */ - - TypeaheadCollection.prototype._deepObjectMap = function(obj, attrs) { - if (!(attrs.length > 0 && _.isObject(obj))) { - return obj; - } - if (attrs.length === 1) { - return obj[attrs[0]]; - } - return this._deepObjectMap(obj[attrs[0]], attrs.slice(1, attrs.length)); - }; - - - /* - Split each typeaheadAttribute into an array of nested methods - and return an array map the returned values from deepObjectMap. - @private - @method _getAttributeValues - @param {Backbone.Model} Model to fetch and map values from - @return {Array} Values from model retrieved by _deepObjectMap - */ - - TypeaheadCollection.prototype._getAttributeValues = function(model) { - return _.map(this.typeaheadAttributes, (function(_this) { - return function(att) { - var attArray; - attArray = att.split('.'); - return _this._deepObjectMap(model.get(attArray[0]), attArray.slice(1)); - }; - })(this)); - }; - - TypeaheadCollection.prototype._extractValues = function(model) { - if (this.typeaheadAttributes != null) { - return this._getAttributeValues(model); - } else { - return _.values(model.attributes); - } - }; - - TypeaheadCollection.prototype._tokenizeModel = function(model) { - return _.uniq(this._tokenize(_.flatten(this._extractValues(model)).join(' '))); - }; - - TypeaheadCollection.prototype._addToIndex = function(models) { - var adjacency, character, id, model, t, tokens, _i, _len, _results; - if (!_.isArray(models)) { - models = [models]; - } - _results = []; - for (_i = 0, _len = models.length; _i < _len; _i++) { - model = models[_i]; - tokens = this._tokenizeModel(model); - id = model.id != null ? model.id : model.cid; - this._tokens[id] = tokens; - _results.push((function() { - var _base, _j, _len1, _results1; - _results1 = []; - for (_j = 0, _len1 = tokens.length; _j < _len1; _j++) { - t = tokens[_j]; - character = t.charAt(0); - adjacency = (_base = this._adjacency)[character] || (_base[character] = [id]); - if (!~_.indexOf(adjacency, id)) { - _results1.push(adjacency.push(id)); - } else { - _results1.push(void 0); - } - } - return _results1; - }).call(this)); - } - return _results; - }; - - TypeaheadCollection.prototype._removeFromIndex = function(models) { - var id, ids, k, v, _i, _len, _ref, _results; - if (!_.isArray(models)) { - models = [models]; - } - ids = _.map(models, function(m) { - if (m.id != null) { - return m.id; - } else { - return m.cid; - } - }); - for (_i = 0, _len = ids.length; _i < _len; _i++) { - id = ids[_i]; - delete this._tokens[id]; - } - _ref = this._adjacency; - _results = []; - for (k in _ref) { - v = _ref[k]; - _results.push(this._adjacency[k] = _.without.apply(_, [v].concat(__slice.call(ids)))); - } - return _results; - }; - - TypeaheadCollection.prototype._rebuildIndex = function() { - this._adjacency = {}; - this._tokens = {}; - return this._addToIndex(this.models); - }; - - TypeaheadCollection.prototype.typeaheadIndexer = function(facets) { - if (!((facets != null) && _.keys(facets).length > 0)) { - return null; - } - return _.map(this.where(facets), function(m) { - if (m.id != null) { - return m.id; - } else { - return m.cid; - } - }); - }; - - TypeaheadCollection.prototype.typeahead = function(query, facets) { - var checkIfShortestList, facetList, firstChars, id, isCandidate, isMatch, item, lists, queryTokens, shortestList, suggestions, _i, _len; - if (this._adjacency == null) { - throw new Error('Index is not built'); - } - queryTokens = this._tokenize(query); - lists = []; - shortestList = null; - firstChars = _(queryTokens).chain().map(function(t) { - return t.charAt(0); - }).uniq().value(); - checkIfShortestList = (function(_this) { - return function(list) { - if (list.length < ((shortestList != null ? shortestList.length : void 0) || _this.length)) { - return shortestList = list; - } - }; - })(this); - _.all(firstChars, (function(_this) { - return function(firstChar) { - var list; - list = _this._adjacency[firstChar]; - if (list == null) { - return false; - } - lists.push(list); - checkIfShortestList(list); - return true; - }; - })(this)); - if (lists.length < firstChars.length) { - return []; - } - facetList = this.typeaheadIndexer(facets); - if (facetList != null) { - lists.push(facetList); - checkIfShortestList(facetList); - } - if (shortestList == null) { - return this.models; - } - if (shortestList.length === 0) { - return []; - } - suggestions = []; - for (_i = 0, _len = shortestList.length; _i < _len; _i++) { - id = shortestList[_i]; - isCandidate = _.every(lists, function(list) { - return ~_.indexOf(list, id); - }); - isMatch = isCandidate && _.every(queryTokens, (function(_this) { - return function(qt) { - return _.some(_this._tokens[id], function(t) { - return t.indexOf(qt) === 0; - }); - }; - })(this)); - if (isMatch) { - item = this.get(id); - if (this.typeaheadPreserveOrder) { - suggestions[this.indexOf(item)] = item; - } else { - suggestions.push(item); - } - } - } - if (this.typeaheadPreserveOrder) { - return _.compact(suggestions); - } else { - return suggestions; - } - }; - - TypeaheadCollection.prototype._reset = function() { - this._tokens = {}; - this._adjacency = {}; - return TypeaheadCollection.__super__._reset.apply(this, arguments); - }; - - TypeaheadCollection.prototype.set = function() { - var models; - models = TypeaheadCollection.__super__.set.apply(this, arguments); - if (!_.isArray(models)) { - models = [models]; - } - this._rebuildIndex(models); - return models; - }; - - TypeaheadCollection.prototype.remove = function() { - var models; - models = TypeaheadCollection.__super__.remove.apply(this, arguments); - if (!_.isArray(models)) { - models = [models]; - } - this._removeFromIndex(models); - return models; - }; - - TypeaheadCollection.prototype._onModelEvent = function(event, model, collection, options) { - var add; - add = false; - if (event === ("change:" + model.idAttribute)) { - add = true; - this._removeFromIndex({ - id: model.previous(model.idAttribute) - }); - } else if (event.indexOf('change:') === 0) { - if ((this.typeaheadAttributes == null) || _.indexOf(_.map(this.typeaheadAttributes, function(att) { - return 'change:' + att; - }), event) >= 0) { - add = true; - this._removeFromIndex(model); - } - } - if (add) { - this._addToIndex(model); - } - return TypeaheadCollection.__super__._onModelEvent.apply(this, arguments); - }; - - return TypeaheadCollection; - - })(Backbone.Collection); - -}).call(this); - -//# sourceMappingURL=backbone.typeahead.js.map - /* * JavaScript Load Image 1.10.0 * https://github.com/blueimp/JavaScript-Load-Image @@ -28419,94 +28213,21 @@ var twemoji = (function ( }()); ;(function() { -/** - * @global - * @namespace - */ function emoji(){} - /** - * The set of images to use got graphical emoji. - * - * @memberof emoji - * @type {string} - */ - emoji.img_set = 'apple'; + // settings + emoji.img_path = 'emoji/'; + emoji.sheet_path = 'sheet_64.png'; - /** - * Configuration details for different image sets. This includes a path to a directory containing the - * individual images (`path`( and a URL to sprite sheets (`sheet`). All of these images can be found - * in the [emoji-data repository]{@link https://github.com/iamcal/emoji-data}. Using a CDN for these - * is not a bad idea. - * - * @memberof emoji - * @type { - */ - emoji.img_sets = { - 'apple' : {'path' : '/emoji-data/img-apple-64/' , 'sheet' : '/emoji-data/sheet_apple_64.png' }, - 'google' : {'path' : '/emoji-data/img-google-64/' , 'sheet' : '/emoji-data/sheet_google_64.png' }, - 'twitter' : {'path' : '/emoji-data/img-twitter-64/' , 'sheet' : '/emoji-data/sheet_twitter_64.png' }, - 'emojione' : {'path' : '/emoji-data/img-emojione-64/', 'sheet' : '/emoji-data/sheet_emojione_64.png' } - }; - - /** - * Use a CSS class instead of specifying a sprite or background image for - * the span representing the emoticon. This requires a CSS sheet with - * emoticon data-uris. - * - * @memberof emoji - * @type bool - * @todo document how to build the CSS stylesheet this requires. - */ emoji.use_css_imgs = false; - - /** - * Instead of replacing emoticons with the appropriate representations, - * replace them with their colon string representation. - * @memberof emoji - * @type bool - */ emoji.colons_mode = false; emoji.text_mode = false; - - /** - * If true, sets the "title" property on the span or image that gets - * inserted for the emoticon. - * @memberof emoji - * @type bool - */ emoji.include_title = false; - - /** - * If the platform supports native emoticons, use those instead - * of the fallbacks. - * @memberof emoji - * @type bool - */ emoji.allow_native = true; - - /** - * Set to true to use CSS sprites instead of individual images on - * platforms that support it. - * - * @memberof emoji - * @type bool - */ emoji.use_sheet = false; - // Keeps track of what has been initialized. - /** @private */ emoji.inits = {}; emoji.map = {}; - /** - * @memberof emoji - * @param {string} str A string potentially containing ascii emoticons - * (ie. `:)`) - * - * @returns {string} A new string with all emoticons in `str` - * replaced by a representatation that's supported by the current - * environtment. - */ emoji.replace_emoticons = function(str){ emoji.init_emoticons(); return str.replace(emoji.rx_emoticons, function(m, $1, $2){ @@ -28514,15 +28235,6 @@ function emoji(){} return val ? $1+emoji.replacement(val, $2) : m; }); }; - - /** - * @memberof emoji - * @param {string} str A string potentially containing ascii emoticons - * (ie. `:)`) - * - * @returns {string} A new string with all emoticons in `str` - * replaced by their colon string representations (ie. `:smile:`) - */ emoji.replace_emoticons_with_colons = function(str){ emoji.init_emoticons(); return str.replace(emoji.rx_emoticons, function(m, $1, $2){ @@ -28530,15 +28242,6 @@ function emoji(){} return val ? $1+':'+val+':' : m; }); }; - - /** - * @memberof emoji - * @param {string} str A string potentially containing colon string - * representations of emoticons (ie. `:smile:`) - * - * @returns {string} A new string with all colon string emoticons replaced - * with the appropriate representation. - */ emoji.replace_colons = function(str){ emoji.init_colons(); return str.replace(emoji.rx_colons, function(m){ @@ -28547,15 +28250,6 @@ function emoji(){} return val ? emoji.replacement(val, idx, ':') : m; }); }; - - /** - * @memberof emoji - * @param {string} str A string potentially containing unified unicode - * emoticons. (ie. 😄) - * - * @returns {string} A new string with all unicode emoticons replaced with - * the appropriate representation for the current environment. - */ emoji.replace_unified = function(str){ emoji.init_unified(); return str.replace(emoji.rx_unified, function(m){ @@ -28564,18 +28258,16 @@ function emoji(){} }); }; - // Does the actual replacement of a character with the appropriate - /** @private */ emoji.replacement = function(idx, actual, wrapper){ wrapper = wrapper || ''; if (emoji.colons_mode) return ':'+emoji.data[idx][3][0]+':'; - var text_name = (actual) ? wrapper+actual+wrapper : emoji.data[idx][8] || wrapper+emoji.data[idx][3][0]+wrapper; + var text_name = (actual) ? wrapper+actual+wrapper : emoji.data[idx][6] || wrapper+emoji.data[idx][3][0]+wrapper; if (emoji.text_mode) return text_name; emoji.init_env(); if (emoji.replace_mode == 'unified' && emoji.allow_native && emoji.data[idx][0][0]) return emoji.data[idx][0][0]; if (emoji.replace_mode == 'softbank' && emoji.allow_native && emoji.data[idx][1]) return emoji.data[idx][1]; if (emoji.replace_mode == 'google' && emoji.allow_native && emoji.data[idx][2]) return emoji.data[idx][2]; - var img = emoji.data[idx][9] || emoji.img_sets[emoji.img_set].path+idx+'.png'; + var img = emoji.data[idx][7] || emoji.img_path+idx+'.png'; var title = emoji.include_title ? ' title="'+(actual || emoji.data[idx][3][0])+'"' : ''; var text = emoji.include_text ? wrapper+(actual || emoji.data[idx][3][0])+wrapper : ''; if (emoji.supports_css) { @@ -28583,7 +28275,7 @@ function emoji(){} var py = emoji.data[idx][5]; if (emoji.use_sheet && px != null && py != null){ var mul = 100 / (emoji.sheet_size - 1); - var style = 'background: url('+emoji.img_sets[emoji.img_set].sheet+');background-position:'+(mul*px)+'% '+(mul*py)+'%;background-size:'+emoji.sheet_size+'00%'; + var style = 'background: url('+emoji.sheet_path+');background-position:'+(mul*px)+'% '+(mul*py)+'%;background-size:'+emoji.sheet_size+'00%'; return ''+text+''; }else if (emoji.use_css_imgs){ return ''+text+''; @@ -28594,19 +28286,17 @@ function emoji(){} return ''; }; - // Initializes the text emoticon data - /** @private */ emoji.init_emoticons = function(){ if (emoji.inits.emoticons) return; emoji.init_colons(); // we require this for the emoticons map emoji.inits.emoticons = 1; - + var a = []; emoji.map.emoticons = {}; for (var i in emoji.emoticons_data){ // because we never see some characters in our text except as entities, we must do some replacing var emoticon = i.replace(/\&/g, '&').replace(/\/g, '>'); - + if (!emoji.map.colons[emoji.emoticons_data[i]]) continue; emoji.map.emoticons[emoticon] = emoji.map.colons[emoji.emoticons_data[i]]; @@ -28614,13 +28304,10 @@ function emoji(){} } emoji.rx_emoticons = new RegExp(('(^|\\s)('+a.join('|')+')(?=$|[\\s|\\?\\.,!])'), 'g'); }; - - // Initializes the colon string data - /** @private */ emoji.init_colons = function(){ if (emoji.inits.colons) return; emoji.inits.colons = 1; - emoji.rx_colons = new RegExp('\:[a-zA-Z0-9-_+]+\:', 'g'); + emoji.rx_colons = new RegExp('\:[^\\s:]+\:', 'g'); emoji.map.colons = {}; for (var i in emoji.data){ for (var j=0; j":"laughing", - ":->":"laughing", ";)":"wink", ";-)":"wink", - ":)":"blush", - "(:":"blush", - ":-)":"blush", + "):":"disappointed", + ":(":"disappointed", + ":-(":"disappointed", + ":'(":"cry", + "=)":"smiley", + "=-)":"smiley", + ":*":"kiss", + ":-*":"kiss", + ":>":"laughing", + ":->":"laughing", "8)":"sunglasses", - ":|":"neutral_face", - ":-|":"neutral_face", ":\\\\":"confused", ":-\\\\":"confused", ":\/":"confused", ":-\/":"confused", + ":|":"neutral_face", + ":-|":"neutral_face", + ":o":"open_mouth", + ":-o":"open_mouth", + ">:(":"angry", + ">:-(":"angry", ":p":"stuck_out_tongue", ":-p":"stuck_out_tongue", ":P":"stuck_out_tongue", @@ -29643,27 +29272,20 @@ function emoji(){} ";-b":"stuck_out_tongue_winking_eye", ";P":"stuck_out_tongue_winking_eye", ";-P":"stuck_out_tongue_winking_eye", - "):":"disappointed", - ":(":"disappointed", - ":-(":"disappointed", - ">:(":"angry", - ">:-(":"angry", - ":'(":"cry", - "D:":"anguished", - ":o":"open_mouth", - ":-o":"open_mouth" + ":o)":"monkey_face", + "D:":"anguished" }; - if (typeof exports === 'object'){ - module.exports = emoji; - }else if (typeof define === 'function' && define.amd){ - define(function() { return emoji; }); - }else{ - this.emoji = emoji; - } +if (typeof exports === 'object') { + module.exports = emoji; +} else if (typeof define === 'function' && define.amd) { + define(function() { return emoji; }); +} else { + this.emoji = emoji; +} -}).call(function(){ - return this || (typeof window !== 'undefined' ? window : global); +}).call(function() { + return this || (typeof window !== 'undefined' ? window : global); }()); /*!