mirror of https://github.com/lidarr/Lidarr
updated jQuery, Require, lodash, messenger.
This commit is contained in:
parent
cf9ebe9f8e
commit
3e70c462e3
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* jQuery JavaScript Library v1.10.1
|
||||
* jQuery JavaScript Library v1.10.2
|
||||
* http://jquery.com/
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
|
@ -9,7 +9,7 @@
|
|||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2013-05-30T21:49Z
|
||||
* Date: 2013-07-03T13:48Z
|
||||
*/
|
||||
(function( window, undefined ) {
|
||||
|
||||
|
@ -46,7 +46,7 @@ var
|
|||
// List of deleted data cache ids, so we can reuse them
|
||||
core_deletedIds = [],
|
||||
|
||||
core_version = "1.10.1",
|
||||
core_version = "1.10.2",
|
||||
|
||||
// Save a reference to some core methods
|
||||
core_concat = core_deletedIds.concat,
|
||||
|
@ -1000,14 +1000,14 @@ function isArraylike( obj ) {
|
|||
// All jQuery objects should point back to these
|
||||
rootjQuery = jQuery(document);
|
||||
/*!
|
||||
* Sizzle CSS Selector Engine v1.9.4-pre
|
||||
* Sizzle CSS Selector Engine v1.10.2
|
||||
* http://sizzlejs.com/
|
||||
*
|
||||
* Copyright 2013 jQuery Foundation, Inc. and other contributors
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2013-05-27
|
||||
* Date: 2013-07-03
|
||||
*/
|
||||
(function( window, undefined ) {
|
||||
|
||||
|
@ -1040,7 +1040,13 @@ var i,
|
|||
tokenCache = createCache(),
|
||||
compilerCache = createCache(),
|
||||
hasDuplicate = false,
|
||||
sortOrder = function() { return 0; },
|
||||
sortOrder = function( a, b ) {
|
||||
if ( a === b ) {
|
||||
hasDuplicate = true;
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
|
||||
// General-purpose constants
|
||||
strundefined = typeof undefined,
|
||||
|
@ -1283,14 +1289,6 @@ function Sizzle( selector, context, results, seed ) {
|
|||
return select( selector.replace( rtrim, "$1" ), context, results, seed );
|
||||
}
|
||||
|
||||
/**
|
||||
* For feature detection
|
||||
* @param {Function} fn The function to test for native support
|
||||
*/
|
||||
function isNative( fn ) {
|
||||
return rnative.test( fn + "" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Create key-value caches of limited size
|
||||
* @returns {Function(string, Object)} Returns the Object data after storing it on itself with
|
||||
|
@ -1344,58 +1342,14 @@ function assert( fn ) {
|
|||
/**
|
||||
* Adds the same handler for all of the specified attrs
|
||||
* @param {String} attrs Pipe-separated list of attributes
|
||||
* @param {Function} handler The method that will be applied if the test fails
|
||||
* @param {Boolean} test The result of a test. If true, null will be set as the handler in leiu of the specified handler
|
||||
* @param {Function} handler The method that will be applied
|
||||
*/
|
||||
function addHandle( attrs, handler, test ) {
|
||||
attrs = attrs.split("|");
|
||||
var current,
|
||||
i = attrs.length,
|
||||
setHandle = test ? null : handler;
|
||||
function addHandle( attrs, handler ) {
|
||||
var arr = attrs.split("|"),
|
||||
i = attrs.length;
|
||||
|
||||
while ( i-- ) {
|
||||
// Don't override a user's handler
|
||||
if ( !(current = Expr.attrHandle[ attrs[i] ]) || current === handler ) {
|
||||
Expr.attrHandle[ attrs[i] ] = setHandle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches boolean attributes by node
|
||||
* @param {Element} elem
|
||||
* @param {String} name
|
||||
*/
|
||||
function boolHandler( elem, name ) {
|
||||
// XML does not need to be checked as this will not be assigned for XML documents
|
||||
var val = elem.getAttributeNode( name );
|
||||
return val && val.specified ?
|
||||
val.value :
|
||||
elem[ name ] === true ? name.toLowerCase() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches attributes without interpolation
|
||||
* http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
|
||||
* @param {Element} elem
|
||||
* @param {String} name
|
||||
*/
|
||||
function interpolationHandler( elem, name ) {
|
||||
// XML does not need to be checked as this will not be assigned for XML documents
|
||||
return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses defaultValue to retrieve value in IE6/7
|
||||
* @param {Element} elem
|
||||
* @param {String} name
|
||||
*/
|
||||
function valueHandler( elem ) {
|
||||
// Ignore the value *property* on inputs by using defaultValue
|
||||
// Fallback to Sizzle.attr by returning undefined where appropriate
|
||||
// XML does not need to be checked as this will not be assigned for XML documents
|
||||
if ( elem.nodeName.toLowerCase() === "input" ) {
|
||||
return elem.defaultValue;
|
||||
Expr.attrHandle[ arr[i] ] = handler;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1403,7 +1357,7 @@ function valueHandler( elem ) {
|
|||
* Checks document order of two siblings
|
||||
* @param {Element} a
|
||||
* @param {Element} b
|
||||
* @returns Returns -1 if a precedes b, 1 if a follows b
|
||||
* @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
|
||||
*/
|
||||
function siblingCheck( a, b ) {
|
||||
var cur = b && a,
|
||||
|
@ -1493,7 +1447,7 @@ support = Sizzle.support = {};
|
|||
*/
|
||||
setDocument = Sizzle.setDocument = function( node ) {
|
||||
var doc = node ? node.ownerDocument || node : preferredDoc,
|
||||
parent = doc.parentWindow;
|
||||
parent = doc.defaultView;
|
||||
|
||||
// If no document and documentElement is available, return
|
||||
if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
|
||||
|
@ -1510,7 +1464,8 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|||
// Support: IE>8
|
||||
// If iframe document is assigned to "document" variable and if iframe has been reloaded,
|
||||
// IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
|
||||
if ( parent && parent.frameElement ) {
|
||||
// IE6-8 do not support the defaultView property so parent will be undefined
|
||||
if ( parent && parent.attachEvent && parent !== parent.top ) {
|
||||
parent.attachEvent( "onbeforeunload", function() {
|
||||
setDocument();
|
||||
});
|
||||
|
@ -1522,32 +1477,10 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|||
// Support: IE<8
|
||||
// Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
|
||||
support.attributes = assert(function( div ) {
|
||||
|
||||
// Support: IE<8
|
||||
// Prevent attribute/property "interpolation"
|
||||
div.innerHTML = "<a href='#'></a>";
|
||||
addHandle( "type|href|height|width", interpolationHandler, div.firstChild.getAttribute("href") === "#" );
|
||||
|
||||
// Support: IE<9
|
||||
// Use getAttributeNode to fetch booleans when getAttribute lies
|
||||
addHandle( booleans, boolHandler, div.getAttribute("disabled") == null );
|
||||
|
||||
div.className = "i";
|
||||
return !div.getAttribute("className");
|
||||
});
|
||||
|
||||
// Support: IE<9
|
||||
// Retrieving value should defer to defaultValue
|
||||
support.input = assert(function( div ) {
|
||||
div.innerHTML = "<input>";
|
||||
div.firstChild.setAttribute( "value", "" );
|
||||
return div.firstChild.getAttribute( "value" ) === "";
|
||||
});
|
||||
|
||||
// IE6/7 still return empty string for value,
|
||||
// but are actually retrieving the property
|
||||
addHandle( "value", valueHandler, support.attributes && support.input );
|
||||
|
||||
/* getElement(s)By*
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
|
@ -1656,7 +1589,7 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|||
// See http://bugs.jquery.com/ticket/13378
|
||||
rbuggyQSA = [];
|
||||
|
||||
if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
|
||||
if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
|
||||
// Build QSA regex
|
||||
// Regex strategy adopted from Diego Perini
|
||||
assert(function( div ) {
|
||||
|
@ -1708,7 +1641,7 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|||
});
|
||||
}
|
||||
|
||||
if ( (support.matchesSelector = isNative( (matches = docElem.webkitMatchesSelector ||
|
||||
if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
|
||||
docElem.mozMatchesSelector ||
|
||||
docElem.oMatchesSelector ||
|
||||
docElem.msMatchesSelector) )) ) {
|
||||
|
@ -1734,7 +1667,7 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|||
// Element contains another
|
||||
// Purposefully does not implement inclusive descendent
|
||||
// As in, an element does not contain itself
|
||||
contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
|
||||
contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?
|
||||
function( a, b ) {
|
||||
var adown = a.nodeType === 9 ? a.documentElement : a,
|
||||
bup = b && b.parentNode;
|
||||
|
@ -1758,13 +1691,6 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|||
/* Sorting
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
|
||||
// Detached nodes confoundingly follow *each other*
|
||||
support.sortDetached = assert(function( div1 ) {
|
||||
// Should return 1, but returns 4 (following)
|
||||
return div1.compareDocumentPosition( doc.createElement("div") ) & 1;
|
||||
});
|
||||
|
||||
// Document order sorting
|
||||
sortOrder = docElem.compareDocumentPosition ?
|
||||
function( a, b ) {
|
||||
|
@ -1907,9 +1833,9 @@ Sizzle.attr = function( elem, name ) {
|
|||
|
||||
var fn = Expr.attrHandle[ name.toLowerCase() ],
|
||||
// Don't get fooled by Object.prototype properties (jQuery #13807)
|
||||
val = ( fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
|
||||
val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
|
||||
fn( elem, name, !documentIsHTML ) :
|
||||
undefined );
|
||||
undefined;
|
||||
|
||||
return val === undefined ?
|
||||
support.attributes || !documentIsHTML ?
|
||||
|
@ -2454,6 +2380,8 @@ Expr = Sizzle.selectors = {
|
|||
}
|
||||
};
|
||||
|
||||
Expr.pseudos["nth"] = Expr.pseudos["eq"];
|
||||
|
||||
// Add button/input type pseudos
|
||||
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
|
||||
Expr.pseudos[ i ] = createInputPseudo( i );
|
||||
|
@ -2462,6 +2390,11 @@ for ( i in { submit: true, reset: true } ) {
|
|||
Expr.pseudos[ i ] = createButtonPseudo( i );
|
||||
}
|
||||
|
||||
// Easy API for creating new setFilters
|
||||
function setFilters() {}
|
||||
setFilters.prototype = Expr.filters = Expr.pseudos;
|
||||
Expr.setFilters = new setFilters();
|
||||
|
||||
function tokenize( selector, parseOnly ) {
|
||||
var matched, match, tokens, type,
|
||||
soFar, groups, preFilters,
|
||||
|
@ -2973,26 +2906,67 @@ function select( selector, context, results, seed ) {
|
|||
return results;
|
||||
}
|
||||
|
||||
// Deprecated
|
||||
Expr.pseudos["nth"] = Expr.pseudos["eq"];
|
||||
|
||||
// Easy API for creating new setFilters
|
||||
function setFilters() {}
|
||||
setFilters.prototype = Expr.filters = Expr.pseudos;
|
||||
Expr.setFilters = new setFilters();
|
||||
|
||||
// One-time assignments
|
||||
|
||||
// Sort stability
|
||||
support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
|
||||
|
||||
// Support: Chrome<14
|
||||
// Always assume duplicates if they aren't passed to the comparison function
|
||||
support.detectDuplicates = hasDuplicate;
|
||||
|
||||
// Initialize against the default document
|
||||
setDocument();
|
||||
|
||||
// Support: Chrome<<14
|
||||
// Always assume duplicates if they aren't passed to the comparison function
|
||||
[0, 0].sort( sortOrder );
|
||||
support.detectDuplicates = hasDuplicate;
|
||||
// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
|
||||
// Detached nodes confoundingly follow *each other*
|
||||
support.sortDetached = assert(function( div1 ) {
|
||||
// Should return 1, but returns 4 (following)
|
||||
return div1.compareDocumentPosition( document.createElement("div") ) & 1;
|
||||
});
|
||||
|
||||
// Support: IE<8
|
||||
// Prevent attribute/property "interpolation"
|
||||
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
|
||||
if ( !assert(function( div ) {
|
||||
div.innerHTML = "<a href='#'></a>";
|
||||
return div.firstChild.getAttribute("href") === "#" ;
|
||||
}) ) {
|
||||
addHandle( "type|href|height|width", function( elem, name, isXML ) {
|
||||
if ( !isXML ) {
|
||||
return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Support: IE<9
|
||||
// Use defaultValue in place of getAttribute("value")
|
||||
if ( !support.attributes || !assert(function( div ) {
|
||||
div.innerHTML = "<input/>";
|
||||
div.firstChild.setAttribute( "value", "" );
|
||||
return div.firstChild.getAttribute( "value" ) === "";
|
||||
}) ) {
|
||||
addHandle( "value", function( elem, name, isXML ) {
|
||||
if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
|
||||
return elem.defaultValue;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Support: IE<9
|
||||
// Use getAttributeNode to fetch booleans when getAttribute lies
|
||||
if ( !assert(function( div ) {
|
||||
return div.getAttribute("disabled") == null;
|
||||
}) ) {
|
||||
addHandle( booleans, function( elem, name, isXML ) {
|
||||
var val;
|
||||
if ( !isXML ) {
|
||||
return (val = elem.getAttributeNode( name )) && val.specified ?
|
||||
val.value :
|
||||
elem[ name ] === true ? name.toLowerCase() : null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
jQuery.find = Sizzle;
|
||||
jQuery.expr = Sizzle.selectors;
|
||||
|
@ -3177,9 +3151,9 @@ jQuery.Callbacks = function( options ) {
|
|||
},
|
||||
// Call all callbacks with the given context and arguments
|
||||
fireWith: function( context, args ) {
|
||||
args = args || [];
|
||||
args = [ context, args.slice ? args.slice() : args ];
|
||||
if ( list && ( !fired || stack ) ) {
|
||||
args = args || [];
|
||||
args = [ context, args.slice ? args.slice() : args ];
|
||||
if ( firing ) {
|
||||
stack.push( args );
|
||||
} else {
|
||||
|
@ -4183,8 +4157,11 @@ jQuery.fn.extend({
|
|||
},
|
||||
|
||||
toggleClass: function( value, stateVal ) {
|
||||
var type = typeof value,
|
||||
isBool = typeof stateVal === "boolean";
|
||||
var type = typeof value;
|
||||
|
||||
if ( typeof stateVal === "boolean" && type === "string" ) {
|
||||
return stateVal ? this.addClass( value ) : this.removeClass( value );
|
||||
}
|
||||
|
||||
if ( jQuery.isFunction( value ) ) {
|
||||
return this.each(function( i ) {
|
||||
|
@ -4198,13 +4175,15 @@ jQuery.fn.extend({
|
|||
var className,
|
||||
i = 0,
|
||||
self = jQuery( this ),
|
||||
state = stateVal,
|
||||
classNames = value.match( core_rnotwhite ) || [];
|
||||
|
||||
while ( (className = classNames[ i++ ]) ) {
|
||||
// check each className given, space separated list
|
||||
state = isBool ? state : !self.hasClass( className );
|
||||
self[ state ? "addClass" : "removeClass" ]( className );
|
||||
if ( self.hasClass( className ) ) {
|
||||
self.removeClass( className );
|
||||
} else {
|
||||
self.addClass( className );
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle whole class name
|
||||
|
@ -6948,10 +6927,12 @@ jQuery.fn.extend({
|
|||
return showHide( this );
|
||||
},
|
||||
toggle: function( state ) {
|
||||
var bool = typeof state === "boolean";
|
||||
if ( typeof state === "boolean" ) {
|
||||
return state ? this.show() : this.hide();
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
if ( bool ? state : isHidden( this ) ) {
|
||||
if ( isHidden( this ) ) {
|
||||
jQuery( this ).show();
|
||||
} else {
|
||||
jQuery( this ).hide();
|
||||
|
@ -6982,6 +6963,7 @@ jQuery.extend({
|
|||
"fontWeight": true,
|
||||
"lineHeight": true,
|
||||
"opacity": true,
|
||||
"order": true,
|
||||
"orphans": true,
|
||||
"widows": true,
|
||||
"zIndex": true,
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* Lo-Dash 1.3.1 (Custom Build) <http://lodash.com/>
|
||||
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
|
||||
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.4.4 <http://underscorejs.org/>
|
||||
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
|
||||
* Based on Underscore.js 1.5.1 <http://underscorejs.org/>
|
||||
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
* Available under MIT license <http://lodash.com/license>
|
||||
*/
|
||||
;(function(window) {
|
||||
|
@ -24,18 +24,12 @@
|
|||
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
|
||||
var keyPrefix = +new Date + '';
|
||||
|
||||
/** Used to match HTML entities */
|
||||
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g;
|
||||
|
||||
/** Used to match "interpolate" template delimiters */
|
||||
var reInterpolate = /<%=([\s\S]+?)%>/g;
|
||||
|
||||
/** Used to ensure capturing order of template delimiters */
|
||||
var reNoMatch = /($^)/;
|
||||
|
||||
/** Used to match HTML characters */
|
||||
var reUnescapedHtml = /[&<>"']/g;
|
||||
|
||||
/** Used to match unescaped characters in compiled string literals */
|
||||
var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g;
|
||||
|
||||
|
@ -501,12 +495,12 @@
|
|||
* // => false
|
||||
*/
|
||||
function isArguments(value) {
|
||||
return toString.call(value) == argsClass;
|
||||
return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
|
||||
}
|
||||
// fallback for browsers that can't detect `arguments` objects by [[Class]]
|
||||
if (!isArguments(arguments)) {
|
||||
isArguments = function(value) {
|
||||
return value ? hasOwnProperty.call(value, 'callee') : false;
|
||||
return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -527,7 +521,7 @@
|
|||
* // => true
|
||||
*/
|
||||
var isArray = nativeIsArray || function(value) {
|
||||
return value ? (typeof value == 'object' && toString.call(value) == arrayClass) : false;
|
||||
return (value && typeof value == 'object') ? toString.call(value) == arrayClass : false;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -584,12 +578,17 @@
|
|||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": '''
|
||||
"'": ''',
|
||||
'/': '/'
|
||||
};
|
||||
|
||||
/** Used to convert HTML entities to characters */
|
||||
var htmlUnescapes = invert(htmlEscapes);
|
||||
|
||||
/** Used to match HTML entities and HTML characters */
|
||||
var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'),
|
||||
reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g');
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
@ -713,7 +712,7 @@
|
|||
var iterable = arguments[argsIndex];
|
||||
if (iterable) {
|
||||
for (var key in iterable) {
|
||||
if (object[key] == null) {
|
||||
if (typeof object[key] == 'undefined') {
|
||||
object[key] = iterable[key];
|
||||
}
|
||||
}
|
||||
|
@ -1254,7 +1253,7 @@
|
|||
* // => true
|
||||
*/
|
||||
function isRegExp(value) {
|
||||
return !!(value && objectTypes[typeof value]) && toString.call(value) == regexpClass;
|
||||
return (value && objectTypes[typeof value]) ? toString.call(value) == regexpClass : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2624,7 +2623,7 @@
|
|||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (isArray(value)) {
|
||||
if (value && typeof value == 'object' && (isArray(value) || isArguments(value))) {
|
||||
push.apply(result, isShallow ? value : flatten(value));
|
||||
} else {
|
||||
result.push(value);
|
||||
|
@ -3097,10 +3096,10 @@
|
|||
* // => [1, 2, 3, 101, 10]
|
||||
*/
|
||||
function union(array) {
|
||||
if (!isArray(array)) {
|
||||
arguments[0] = array ? nativeSlice.call(array) : arrayRef;
|
||||
if (!array) {
|
||||
arguments[0] = arrayRef;
|
||||
}
|
||||
return uniq(concat.apply(arrayRef, arguments));
|
||||
return uniq(flatten(arguments, true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3179,31 +3178,6 @@
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The inverse of `_.zip`, this method splits groups of elements into arrays
|
||||
* composed of elements from each group at their corresponding indexes.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to process.
|
||||
* @returns {Array} Returns a new array of the composed arrays.
|
||||
* @example
|
||||
*
|
||||
* _.unzip([['moe', 30, true], ['larry', 40, false]]);
|
||||
* // => [['moe', 'larry'], [30, 40], [true, false]];
|
||||
*/
|
||||
function unzip(array) {
|
||||
var index = -1,
|
||||
length = array ? max(pluck(array, 'length')) : 0,
|
||||
result = Array(length < 0 ? 0 : length);
|
||||
|
||||
while (++index < length) {
|
||||
result[index] = pluck(array, index);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array with all occurrences of the passed values removed using
|
||||
* strict equality for comparisons, i.e. `===`.
|
||||
|
@ -3224,13 +3198,13 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* Groups the elements of each array at their corresponding indexes. Useful for
|
||||
* separate data sources that are coordinated through matching array indexes.
|
||||
* For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix
|
||||
* in a similar fashion.
|
||||
* Creates an array of grouped elements, the first of which contains the first
|
||||
* elements of the given arrays, the second of which contains the second
|
||||
* elements of the given arrays, and so on.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias unzip
|
||||
* @category Arrays
|
||||
* @param {Array} [array1, array2, ...] Arrays to process.
|
||||
* @returns {Array} Returns a new array of grouped elements.
|
||||
|
@ -3239,9 +3213,9 @@
|
|||
* _.zip(['moe', 'larry'], [30, 40], [true, false]);
|
||||
* // => [['moe', 30, true], ['larry', 40, false]]
|
||||
*/
|
||||
function zip(array) {
|
||||
function zip() {
|
||||
var index = -1,
|
||||
length = array ? max(pluck(arguments, 'length')) : 0,
|
||||
length = max(pluck(arguments, 'length')),
|
||||
result = Array(length < 0 ? 0 : length);
|
||||
|
||||
while (++index < length) {
|
||||
|
@ -3287,17 +3261,14 @@
|
|||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* If `n` is greater than `0`, a function is created that is restricted to
|
||||
* executing `func`, with the `this` binding and arguments of the created
|
||||
* function, only after it is called `n` times. If `n` is less than `1`,
|
||||
* `func` is executed immediately, without a `this` binding or additional
|
||||
* arguments, and its result is returned.
|
||||
* Creates a function this is restricted to executing `func`, with the `this`
|
||||
* binding and arguments of the created function, only after it is called `n` times.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Number} n The number of times the function must be called before
|
||||
* it is executed.
|
||||
* `func` is executed.
|
||||
* @param {Function} func The function to restrict.
|
||||
* @returns {Function} Returns the new restricted function.
|
||||
* @example
|
||||
|
@ -3309,9 +3280,6 @@
|
|||
* // `renderNotes` is run once, after all notes have saved
|
||||
*/
|
||||
function after(n, func) {
|
||||
if (n < 1) {
|
||||
return func();
|
||||
}
|
||||
return function() {
|
||||
if (--n < 1) {
|
||||
return func.apply(this, arguments);
|
||||
|
@ -3547,28 +3515,83 @@
|
|||
* 'maxWait': 1000
|
||||
* }, false);
|
||||
*/
|
||||
function debounce(func, wait, immediate) {
|
||||
function debounce(func, wait, options) {
|
||||
var args,
|
||||
result,
|
||||
thisArg,
|
||||
timeoutId = null;
|
||||
callCount = 0,
|
||||
lastCalled = 0,
|
||||
maxWait = false,
|
||||
maxTimeoutId = null,
|
||||
timeoutId = null,
|
||||
trailing = true;
|
||||
|
||||
function clear() {
|
||||
clearTimeout(maxTimeoutId);
|
||||
clearTimeout(timeoutId);
|
||||
callCount = 0;
|
||||
maxTimeoutId = timeoutId = null;
|
||||
}
|
||||
|
||||
function delayed() {
|
||||
timeoutId = null;
|
||||
if (!immediate) {
|
||||
var isCalled = trailing && (!leading || callCount > 1);
|
||||
clear();
|
||||
if (isCalled) {
|
||||
if (maxWait !== false) {
|
||||
lastCalled = new Date;
|
||||
}
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
}
|
||||
|
||||
function maxDelayed() {
|
||||
clear();
|
||||
if (trailing || (maxWait !== wait)) {
|
||||
lastCalled = new Date;
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
}
|
||||
|
||||
wait = nativeMax(0, wait || 0);
|
||||
if (options === true) {
|
||||
var leading = true;
|
||||
trailing = false;
|
||||
} else if (isObject(options)) {
|
||||
leading = options.leading;
|
||||
maxWait = 'maxWait' in options && nativeMax(wait, options.maxWait || 0);
|
||||
trailing = 'trailing' in options ? options.trailing : trailing;
|
||||
}
|
||||
return function() {
|
||||
var isImmediate = immediate && !timeoutId;
|
||||
args = arguments;
|
||||
thisArg = this;
|
||||
callCount++;
|
||||
|
||||
// avoid issues with Titanium and `undefined` timeout ids
|
||||
// https://github.com/appcelerator/titanium_mobile/blob/3_1_0_GA/android/titanium/src/java/ti/modules/titanium/TitaniumModule.java#L185-L192
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = setTimeout(delayed, wait);
|
||||
|
||||
if (isImmediate) {
|
||||
result = func.apply(thisArg, args);
|
||||
if (maxWait === false) {
|
||||
if (leading && callCount < 2) {
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
} else {
|
||||
var now = new Date;
|
||||
if (!maxTimeoutId && !leading) {
|
||||
lastCalled = now;
|
||||
}
|
||||
var remaining = maxWait - (now - lastCalled);
|
||||
if (remaining <= 0) {
|
||||
clearTimeout(maxTimeoutId);
|
||||
maxTimeoutId = null;
|
||||
lastCalled = now;
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
else if (!maxTimeoutId) {
|
||||
maxTimeoutId = setTimeout(maxDelayed, remaining);
|
||||
}
|
||||
}
|
||||
if (wait !== maxWait) {
|
||||
timeoutId = setTimeout(delayed, wait);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
@ -3733,36 +3756,22 @@
|
|||
* 'trailing': false
|
||||
* }));
|
||||
*/
|
||||
function throttle(func, wait) {
|
||||
var args,
|
||||
result,
|
||||
thisArg,
|
||||
lastCalled = 0,
|
||||
timeoutId = null;
|
||||
function throttle(func, wait, options) {
|
||||
var leading = true,
|
||||
trailing = true;
|
||||
|
||||
function trailingCall() {
|
||||
lastCalled = new Date;
|
||||
timeoutId = null;
|
||||
result = func.apply(thisArg, args);
|
||||
if (options === false) {
|
||||
leading = false;
|
||||
} else if (isObject(options)) {
|
||||
leading = 'leading' in options ? options.leading : leading;
|
||||
trailing = 'trailing' in options ? options.trailing : trailing;
|
||||
}
|
||||
return function() {
|
||||
var now = new Date,
|
||||
remaining = wait - (now - lastCalled);
|
||||
options = {};
|
||||
options.leading = leading;
|
||||
options.maxWait = wait;
|
||||
options.trailing = trailing;
|
||||
|
||||
args = arguments;
|
||||
thisArg = this;
|
||||
|
||||
if (remaining <= 0) {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = null;
|
||||
lastCalled = now;
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
else if (!timeoutId) {
|
||||
timeoutId = setTimeout(trailingCall, remaining);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
return debounce(func, wait, options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3952,7 +3961,7 @@
|
|||
* // => 'nonsense'
|
||||
*/
|
||||
function result(object, property) {
|
||||
var value = object ? object[property] : null;
|
||||
var value = object ? object[property] : undefined;
|
||||
return isFunction(value) ? object[property]() : value;
|
||||
}
|
||||
|
||||
|
@ -4332,6 +4341,7 @@
|
|||
lodash.select = filter;
|
||||
lodash.tail = rest;
|
||||
lodash.unique = uniq;
|
||||
lodash.unzip = zip;
|
||||
|
||||
// add Underscore compat
|
||||
lodash.chain = chain;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*! messenger 1.3.5 */
|
||||
/*! messenger 1.3.6 */
|
||||
/*
|
||||
* This file begins the output concatenated into messenger.js
|
||||
*
|
||||
|
@ -351,16 +351,43 @@ window.Messenger.Events = (function() {
|
|||
method = _.bind(method, this);
|
||||
eventName += ".delegateEvents" + this.cid;
|
||||
if (selector === '') {
|
||||
_results.push(this.$el.on(eventName, method));
|
||||
_results.push(this.jqon(eventName, method));
|
||||
} else {
|
||||
_results.push(this.$el.on(eventName, selector, method));
|
||||
_results.push(this.jqon(eventName, selector, method));
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
BaseView.prototype.jqon = function(eventName, selector, method) {
|
||||
var _ref2;
|
||||
if (this.$el.on != null) {
|
||||
return (_ref2 = this.$el).on.apply(_ref2, arguments);
|
||||
} else {
|
||||
if (!(method != null)) {
|
||||
method = selector;
|
||||
selector = void 0;
|
||||
}
|
||||
if (selector != null) {
|
||||
return this.$el.delegate(selector, eventName, method);
|
||||
} else {
|
||||
return this.$el.bind(eventName, method);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
BaseView.prototype.jqoff = function(eventName) {
|
||||
var _ref2;
|
||||
if (this.$el.off != null) {
|
||||
return (_ref2 = this.$el).off.apply(_ref2, arguments);
|
||||
} else {
|
||||
this.$el.undelegate();
|
||||
return this.$el.unbind(eventName);
|
||||
}
|
||||
};
|
||||
|
||||
BaseView.prototype.undelegateEvents = function() {
|
||||
return this.$el.off(".delegateEvents" + this.cid);
|
||||
return this.jqoff(".delegateEvents" + this.cid);
|
||||
};
|
||||
|
||||
BaseView.prototype.remove = function() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/** vim: et:ts=4:sw=4:sts=4
|
||||
* @license RequireJS 2.1.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
|
||||
* @license RequireJS 2.1.8 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
|
||||
* Available via the MIT or new BSD license.
|
||||
* see: http://github.com/jrburke/requirejs for details
|
||||
*/
|
||||
|
@ -12,7 +12,7 @@ var requirejs, require, define;
|
|||
(function (global) {
|
||||
var req, s, head, baseElement, dataMain, src,
|
||||
interactiveScript, currentlyAddingScript, mainScript, subPath,
|
||||
version = '2.1.6',
|
||||
version = '2.1.8',
|
||||
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
|
||||
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
|
||||
jsSuffixRegExp = /\.js$/,
|
||||
|
@ -1794,6 +1794,19 @@ var requirejs, require, define;
|
|||
*/
|
||||
req.onError = defaultOnError;
|
||||
|
||||
/**
|
||||
* Creates the node for the load command. Only used in browser envs.
|
||||
*/
|
||||
req.createNode = function (config, moduleName, url) {
|
||||
var node = config.xhtml ?
|
||||
document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
|
||||
document.createElement('script');
|
||||
node.type = config.scriptType || 'text/javascript';
|
||||
node.charset = 'utf-8';
|
||||
node.async = true;
|
||||
return node;
|
||||
};
|
||||
|
||||
/**
|
||||
* Does the request to load a module for the browser case.
|
||||
* Make this a separate function to allow other environments
|
||||
|
@ -1808,12 +1821,7 @@ var requirejs, require, define;
|
|||
node;
|
||||
if (isBrowser) {
|
||||
//In the browser so use a script tag
|
||||
node = config.xhtml ?
|
||||
document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
|
||||
document.createElement('script');
|
||||
node.type = config.scriptType || 'text/javascript';
|
||||
node.charset = 'utf-8';
|
||||
node.async = true;
|
||||
node = req.createNode(config, moduleName, url);
|
||||
|
||||
node.setAttribute('data-requirecontext', context.contextName);
|
||||
node.setAttribute('data-requiremodule', moduleName);
|
||||
|
|
Loading…
Reference in New Issue