Updating to jquery version 2.0.2.
[live-systems.org.git] / stuff / jquery / jquery.js
index f389a3e..280083f 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * jQuery JavaScript Library v2.0.0
+ * jQuery JavaScript Library v2.0.2
  * http://jquery.com/
  *
  * Includes Sizzle.js
@@ -9,7 +9,7 @@
  * Released under the MIT license
  * http://jquery.org/license
  *
- * Date: 2013-04-18
+ * Date: 2013-05-30T21:25Z
  */
 (function( window, undefined ) {
 
@@ -46,7 +46,7 @@ var
        // List of deleted data cache ids, so we can reuse them
        core_deletedIds = [],
 
-       core_version = "2.0.0",
+       core_version = "2.0.2",
 
        // Save a reference to some core methods
        core_concat = core_deletedIds.concat,
@@ -72,7 +72,7 @@ var
        // A simple way to check for HTML strings
        // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
        // Strict HTML recognition (#11290: must start with <)
-       rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+       rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
 
        // Match a standalone tag
        rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
@@ -865,18 +865,19 @@ function isArraylike( obj ) {
 // All jQuery objects should point back to these
 rootjQuery = jQuery(document);
 /*!
- * Sizzle CSS Selector Engine v1.9.2-pre
+ * Sizzle CSS Selector Engine v1.9.4-pre
  * http://sizzlejs.com/
  *
  * Copyright 2013 jQuery Foundation, Inc. and other contributors
  * Released under the MIT license
  * http://jquery.org/license
  *
- * Date: 2013-04-16
+ * Date: 2013-05-27
  */
 (function( window, undefined ) {
 
 var i,
+       support,
        cachedruns,
        Expr,
        getText,
@@ -898,7 +899,6 @@ var i,
        // Instance-specific data
        expando = "sizzle" + -(new Date()),
        preferredDoc = window.document,
-       support = {},
        dirruns = 0,
        done = 0,
        classCache = createCache(),
@@ -911,7 +911,8 @@ var i,
        strundefined = typeof undefined,
        MAX_NEGATIVE = 1 << 31,
 
-       // Array methods
+       // Instance methods
+       hasOwn = ({}).hasOwnProperty,
        arr = [],
        pop = arr.pop,
        push_native = arr.push,
@@ -976,7 +977,7 @@ var i,
                "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
                        "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
                        "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
-               "boolean": new RegExp( "^(?:" + booleans + ")$", "i" ),
+               "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
                // For use in libraries implementing .is()
                // We use this for POS matching in `select`
                "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
@@ -994,11 +995,13 @@ var i,
        rescape = /'|\\/g,
 
        // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
-       runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
-       funescape = function( _, escaped ) {
+       runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+       funescape = function( _, escaped, escapedWhitespace ) {
                var high = "0x" + escaped - 0x10000;
                // NaN means non-codepoint
-               return high !== high ?
+               // Support: Firefox
+               // Workaround erroneous numeric interpretation of +"0x"
+               return high !== high || escapedWhitespace ?
                        escaped :
                        // BMP codepoint
                        high < 0 ?
@@ -1036,63 +1039,6 @@ try {
        };
 }
 
-/**
- * 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
- *     property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- *     deleting the oldest entry
- */
-function createCache() {
-       var cache,
-               keys = [];
-
-       return (cache = function( key, value ) {
-               // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
-               if ( keys.push( key += " " ) > Expr.cacheLength ) {
-                       // Only keep the most recent entries
-                       delete cache[ keys.shift() ];
-               }
-               return (cache[ key ] = value);
-       });
-}
-
-/**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
-function markFunction( fn ) {
-       fn[ expando ] = true;
-       return fn;
-}
-
-/**
- * Support testing using an element
- * @param {Function} fn Passed the created div and expects a boolean result
- */
-function assert( fn ) {
-       var div = document.createElement("div");
-
-       try {
-               return !!fn( div );
-       } catch (e) {
-               return false;
-       } finally {
-               if ( div.parentNode ) {
-                       div.parentNode.removeChild( div );
-               }
-               // release memory in IE
-               div = null;
-       }
-}
-
 function Sizzle( selector, context, results, seed ) {
        var match, elem, m, nodeType,
                // QSA vars
@@ -1203,6 +1149,195 @@ function Sizzle( selector, 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
+ *     property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ *     deleting the oldest entry
+ */
+function createCache() {
+       var keys = [];
+
+       function cache( key, value ) {
+               // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+               if ( keys.push( key += " " ) > Expr.cacheLength ) {
+                       // Only keep the most recent entries
+                       delete cache[ keys.shift() ];
+               }
+               return (cache[ key ] = value);
+       }
+       return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+       fn[ expando ] = true;
+       return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+       var div = document.createElement("div");
+
+       try {
+               return !!fn( div );
+       } catch (e) {
+               return false;
+       } finally {
+               // Remove from its parent by default
+               if ( div.parentNode ) {
+                       div.parentNode.removeChild( div );
+               }
+               // release memory in IE
+               div = null;
+       }
+}
+
+/**
+ * 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
+ */
+function addHandle( attrs, handler, test ) {
+       attrs = attrs.split("|");
+       var current,
+               i = attrs.length,
+               setHandle = test ? null : handler;
+
+       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;
+       }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns Returns -1 if a precedes b, 1 if a follows b
+ */
+function siblingCheck( a, b ) {
+       var cur = b && a,
+               diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+                       ( ~b.sourceIndex || MAX_NEGATIVE ) -
+                       ( ~a.sourceIndex || MAX_NEGATIVE );
+
+       // Use IE sourceIndex if available on both nodes
+       if ( diff ) {
+               return diff;
+       }
+
+       // Check if b follows a
+       if ( cur ) {
+               while ( (cur = cur.nextSibling) ) {
+                       if ( cur === b ) {
+                               return -1;
+                       }
+               }
+       }
+
+       return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+       return function( elem ) {
+               var name = elem.nodeName.toLowerCase();
+               return name === "input" && elem.type === type;
+       };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+       return function( elem ) {
+               var name = elem.nodeName.toLowerCase();
+               return (name === "input" || name === "button") && elem.type === type;
+       };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+       return markFunction(function( argument ) {
+               argument = +argument;
+               return markFunction(function( seed, matches ) {
+                       var j,
+                               matchIndexes = fn( [], seed.length, argument ),
+                               i = matchIndexes.length;
+
+                       // Match elements found at the specified indexes
+                       while ( i-- ) {
+                               if ( seed[ (j = matchIndexes[i]) ] ) {
+                                       seed[j] = !(matches[j] = seed[j]);
+                               }
+                       }
+               });
+       });
+}
+
+/**
  * Detect xml
  * @param {Element|Object} elem An element or a document
  */
@@ -1213,13 +1348,17 @@ isXML = Sizzle.isXML = function( elem ) {
        return documentElement ? documentElement.nodeName !== "HTML" : false;
 };
 
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
 /**
  * Sets document-related variables once based on the current document
  * @param {Element|Object} [doc] An element or document object to use to set the document
  * @returns {Object} Returns the current document
  */
 setDocument = Sizzle.setDocument = function( node ) {
-       var doc = node ? node.ownerDocument || node : preferredDoc;
+       var doc = node ? node.ownerDocument || node : preferredDoc,
+               parent = doc.parentWindow;
 
        // If no document and documentElement is available, return
        if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
@@ -1233,19 +1372,56 @@ setDocument = Sizzle.setDocument = function( node ) {
        // Support tests
        documentIsHTML = !isXML( doc );
 
-       // Check if getElementsByTagName("*") returns only elements
-       support.getElementsByTagName = assert(function( div ) {
-               div.appendChild( doc.createComment("") );
-               return !div.getElementsByTagName("*").length;
-       });
+       // 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 ) {
+               parent.attachEvent( "onbeforeunload", function() {
+                       setDocument();
+               });
+       }
+
+       /* Attributes
+       ---------------------------------------------------------------------- */
 
        // 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*
+       ---------------------------------------------------------------------- */
+
+       // Check if getElementsByTagName("*") returns only elements
+       support.getElementsByTagName = assert(function( div ) {
+               div.appendChild( doc.createComment("") );
+               return !div.getElementsByTagName("*").length;
+       });
+
        // Check if getElementsByClassName can be trusted
        support.getElementsByClassName = assert(function( div ) {
                div.innerHTML = "<div class='a'></div><div class='a i'></div>";
@@ -1258,19 +1434,9 @@ setDocument = Sizzle.setDocument = function( node ) {
                return div.getElementsByClassName("i").length === 2;
        });
 
-       // 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<10
        // Check if getElementById returns elements by name
-       // Support: Windows 8 Native Apps
-       // Assigning innerHTML with "name" attributes throws uncatchable exceptions
-       // (http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx)
-       // and the broken getElementById methods don't pick up programatically-set names,
+       // The broken getElementById methods don't pick up programatically-set names,
        // so use a roundabout getElementsByName test
        support.getById = assert(function( div ) {
                docElem.appendChild( div ).id = expando;
@@ -1294,17 +1460,10 @@ setDocument = Sizzle.setDocument = function( node ) {
                        };
                };
        } else {
-               Expr.find["ID"] = function( id, context ) {
-                       if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
-                               var m = context.getElementById( id );
+               // Support: IE6/7
+               // getElementById is not reliable as a find shortcut
+               delete Expr.find["ID"];
 
-                               return m ?
-                                       m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
-                                               [m] :
-                                               undefined :
-                                       [];
-                       }
-               };
                Expr.filter["ID"] =  function( id ) {
                        var attrId = id.replace( runescape, funescape );
                        return function( elem ) {
@@ -1347,6 +1506,9 @@ setDocument = Sizzle.setDocument = function( node ) {
                }
        };
 
+       /* QSA/matchesSelector
+       ---------------------------------------------------------------------- */
+
        // QSA and matchesSelector support
 
        // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
@@ -1391,7 +1553,7 @@ setDocument = Sizzle.setDocument = function( node ) {
                        // Should not select anything
                        // Support: Windows 8 Native Apps
                        // The type attribute is restricted during .innerHTML assignment
-                       var input = document.createElement("input");
+                       var input = doc.createElement("input");
                        input.setAttribute( "type", "hidden" );
                        div.appendChild( input ).setAttribute( "t", "" );
 
@@ -1431,6 +1593,9 @@ setDocument = Sizzle.setDocument = function( node ) {
        rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
        rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
 
+       /* Contains
+       ---------------------------------------------------------------------- */
+
        // Element contains another
        // Purposefully does not implement inclusive descendent
        // As in, an element does not contain itself
@@ -1455,6 +1620,16 @@ setDocument = Sizzle.setDocument = function( node ) {
                        return false;
                };
 
+       /* 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 ) {
@@ -1545,7 +1720,7 @@ setDocument = Sizzle.setDocument = function( node ) {
                        0;
        };
 
-       return document;
+       return doc;
 };
 
 Sizzle.matches = function( expr, elements ) {
@@ -1561,10 +1736,9 @@ Sizzle.matchesSelector = function( elem, expr ) {
        // Make sure that attribute selectors are quoted
        expr = expr.replace( rattributeQuotes, "='$1']" );
 
-       // rbuggyQSA always contains :focus, so no need for an existence check
        if ( support.matchesSelector && documentIsHTML &&
-               (!rbuggyMatches || !rbuggyMatches.test(expr)) &&
-               (!rbuggyQSA     || !rbuggyQSA.test(expr)) ) {
+               ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+               ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
 
                try {
                        var ret = matches.call( elem, expr );
@@ -1597,7 +1771,10 @@ Sizzle.attr = function( elem, name ) {
        }
 
        var fn = Expr.attrHandle[ name.toLowerCase() ],
-               val = fn && fn( elem, name, !documentIsHTML );
+               // Don't get fooled by Object.prototype properties (jQuery #13807)
+               val = ( fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+                       fn( elem, name, !documentIsHTML ) :
+                       undefined );
 
        return val === undefined ?
                support.attributes || !documentIsHTML ?
@@ -1612,7 +1789,10 @@ Sizzle.error = function( msg ) {
        throw new Error( "Syntax error, unrecognized expression: " + msg );
 };
 
-// Document sorting and removing duplicates
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
 Sizzle.uniqueSort = function( results ) {
        var elem,
                duplicates = [],
@@ -1639,87 +1819,6 @@ Sizzle.uniqueSort = function( results ) {
 };
 
 /**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns Returns -1 if a precedes b, 1 if a follows b
- */
-function siblingCheck( a, b ) {
-       var cur = b && a,
-               diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
-
-       // Use IE sourceIndex if available on both nodes
-       if ( diff ) {
-               return diff;
-       }
-
-       // Check if b follows a
-       if ( cur ) {
-               while ( (cur = cur.nextSibling) ) {
-                       if ( cur === b ) {
-                               return -1;
-                       }
-               }
-       }
-
-       return a ? 1 : -1;
-}
-
-// Fetches boolean attributes by node
-function boolHandler( elem, name, isXML ) {
-       var val;
-       return isXML ?
-               undefined :
-               (val = elem.getAttributeNode( name )) && 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
-function interpolationHandler( elem, name, isXML ) {
-       var val;
-       return isXML ?
-               undefined :
-               (val = elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ));
-}
-
-// Returns a function to use in pseudos for input types
-function createInputPseudo( type ) {
-       return function( elem ) {
-               var name = elem.nodeName.toLowerCase();
-               return name === "input" && elem.type === type;
-       };
-}
-
-// Returns a function to use in pseudos for buttons
-function createButtonPseudo( type ) {
-       return function( elem ) {
-               var name = elem.nodeName.toLowerCase();
-               return (name === "input" || name === "button") && elem.type === type;
-       };
-}
-
-// Returns a function to use in pseudos for positionals
-function createPositionalPseudo( fn ) {
-       return markFunction(function( argument ) {
-               argument = +argument;
-               return markFunction(function( seed, matches ) {
-                       var j,
-                               matchIndexes = fn( [], seed.length, argument ),
-                               i = matchIndexes.length;
-
-                       // Match elements found at the specified indexes
-                       while ( i-- ) {
-                               if ( seed[ (j = matchIndexes[i]) ] ) {
-                                       seed[j] = !(matches[j] = seed[j]);
-                               }
-                       }
-               });
-       });
-}
-
-/**
  * Utility function for retrieving the text value of an array of DOM nodes
  * @param {Array|Element} elem
  */
@@ -1829,7 +1928,7 @@ Expr = Sizzle.selectors = {
                        }
 
                        // Accept quoted arguments as-is
-                       if ( match[4] ) {
+                       if ( match[3] && match[4] !== undefined ) {
                                match[2] = match[4];
 
                        // Strip excess characters from unquoted arguments
@@ -2257,11 +2356,11 @@ function tokenize( selector, parseOnly ) {
                // Combinators
                if ( (match = rcombinators.exec( soFar )) ) {
                        matched = match.shift();
-                       tokens.push( {
+                       tokens.push({
                                value: matched,
                                // Cast descendant combinators to space
                                type: match[0].replace( rtrim, " " )
-                       } );
+                       });
                        soFar = soFar.slice( matched.length );
                }
 
@@ -2270,11 +2369,11 @@ function tokenize( selector, parseOnly ) {
                        if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
                                (match = preFilters[ type ]( match ))) ) {
                                matched = match.shift();
-                               tokens.push( {
+                               tokens.push({
                                        value: matched,
                                        type: type,
                                        matches: match
-                               } );
+                               });
                                soFar = soFar.slice( matched.length );
                        }
                }
@@ -2521,7 +2620,10 @@ function matcherFromTokens( tokens ) {
                                }
                                return setMatcher(
                                        i > 1 && elementMatcher( matchers ),
-                                       i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
+                                       i > 1 && toSelector(
+                                               // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+                                               tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+                                       ).replace( rtrim, "$1" ),
                                        matcher,
                                        i < j && matcherFromTokens( tokens.slice( i, j ) ),
                                        j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
@@ -2683,14 +2785,13 @@ function select( selector, context, results, seed ) {
                        // Take a shortcut and set the context if the root selector is an ID
                        tokens = match[0] = match[0].slice( 0 );
                        if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
-                                       context.nodeType === 9 && documentIsHTML &&
+                                       support.getById && context.nodeType === 9 && documentIsHTML &&
                                        Expr.relative[ tokens[1].type ] ) {
 
                                context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
                                if ( !context ) {
                                        return results;
                                }
-
                                selector = selector.slice( tokens.shift().value.length );
                        }
 
@@ -2758,31 +2859,6 @@ setDocument();
 [0, 0].sort( sortOrder );
 support.detectDuplicates = hasDuplicate;
 
-// Support: IE<8
-// Prevent attribute/property "interpolation"
-assert(function( div ) {
-       div.innerHTML = "<a href='#'></a>";
-       if ( div.firstChild.getAttribute("href") !== "#" ) {
-               var attrs = "type|href|height|width".split("|"),
-                       i = attrs.length;
-               while ( i-- ) {
-                       Expr.attrHandle[ attrs[i] ] = interpolationHandler;
-               }
-       }
-});
-
-// Support: IE<9
-// Use getAttributeNode to fetch booleans when getAttribute lies
-assert(function( div ) {
-       if ( div.getAttribute("disabled") != null ) {
-               var attrs = booleans.split("|"),
-                       i = attrs.length;
-               while ( i-- ) {
-                       Expr.attrHandle[ attrs[i] ] = boolHandler;
-               }
-       }
-});
-
 jQuery.find = Sizzle;
 jQuery.expr = Sizzle.selectors;
 jQuery.expr[":"] = jQuery.expr.pseudos;
@@ -3336,13 +3412,9 @@ Data.prototype = {
 
                // Handle: [ owner, { properties } ] args
                } else {
-                       // Support an expectation from the old data system where plain
-                       // objects used to initialize would be set to the cache by
-                       // reference, instead of having properties and values copied.
-                       // Note, this will kill the connection between
-                       // "this.cache[ unlock ]" and "cache"
+                       // Fresh assignments by object are shallow copied
                        if ( jQuery.isEmptyObject( cache ) ) {
-                               this.cache[ unlock ] = data;
+                               jQuery.extend( this.cache[ unlock ], data );
                        // Otherwise, copy the properties one-by-one to the cache object
                        } else {
                                for ( prop in data ) {
@@ -3350,6 +3422,7 @@ Data.prototype = {
                                }
                        }
                }
+               return cache;
        },
        get: function( owner, key ) {
                // Either a valid cache is found, or will be created.
@@ -3391,7 +3464,7 @@ Data.prototype = {
                return value !== undefined ? value : key;
        },
        remove: function( owner, key ) {
-               var i, name,
+               var i, name, camel,
                        unlock = this.key( owner ),
                        cache = this.cache[ unlock ];
 
@@ -3409,13 +3482,14 @@ Data.prototype = {
                                // This will only penalize the array argument path.
                                name = key.concat( key.map( jQuery.camelCase ) );
                        } else {
+                               camel = jQuery.camelCase( key );
                                // Try the string as a key before any manipulation
                                if ( key in cache ) {
-                                       name = [ key ];
+                                       name = [ key, camel ];
                                } else {
                                        // If a key with the spaces exists, use it.
                                        // Otherwise, create an array by matching non-whitespace
-                                       name = jQuery.camelCase( key );
+                                       name = camel;
                                        name = name in cache ?
                                                [ name ] : ( name.match( core_rnotwhite ) || [] );
                                }
@@ -3433,7 +3507,9 @@ Data.prototype = {
                );
        },
        discard: function( owner ) {
-               delete this.cache[ this.key( owner ) ];
+               if ( owner[ this.expando ] ) {
+                       delete this.cache[ owner[ this.expando ] ];
+               }
        }
 };
 
@@ -3486,7 +3562,7 @@ jQuery.fn.extend({
                                                name = attrs[ i ].name;
 
                                                if ( name.indexOf( "data-" ) === 0 ) {
-                                                       name = jQuery.camelCase( name.substring(5) );
+                                                       name = jQuery.camelCase( name.slice(5) );
                                                        dataAttr( elem, name, data[ name ] );
                                                }
                                        }
@@ -3632,7 +3708,6 @@ jQuery.extend({
                        startLength--;
                }
 
-               hooks.cur = fn;
                if ( fn ) {
 
                        // Add a progress sentinel to prevent the fx queue from being
@@ -3742,7 +3817,7 @@ jQuery.fn.extend({
        }
 });
 var nodeHook, boolHook,
-       rclass = /[\t\r\n]/g,
+       rclass = /[\t\r\n\f]/g,
        rreturn = /\r/g,
        rfocusable = /^(?:input|select|textarea|button)$/i;
 
@@ -3925,15 +4000,14 @@ jQuery.fn.extend({
                isFunction = jQuery.isFunction( value );
 
                return this.each(function( i ) {
-                       var val,
-                               self = jQuery(this);
+                       var val;
 
                        if ( this.nodeType !== 1 ) {
                                return;
                        }
 
                        if ( isFunction ) {
-                               val = value.call( this, i, self.val() );
+                               val = value.call( this, i, jQuery( this ).val() );
                        } else {
                                val = value;
                        }
@@ -4048,7 +4122,7 @@ jQuery.extend({
                if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
                        name = name.toLowerCase();
                        hooks = jQuery.attrHooks[ name ] ||
-                               ( jQuery.expr.match.boolean.test( name ) ? boolHook : nodeHook );
+                               ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
                }
 
                if ( value !== undefined ) {
@@ -4087,7 +4161,7 @@ jQuery.extend({
                                propName = jQuery.propFix[ name ] || name;
 
                                // Boolean attributes get special treatment (#10870)
-                               if ( jQuery.expr.match.boolean.test( name ) ) {
+                               if ( jQuery.expr.match.bool.test( name ) ) {
                                        // Set corresponding property to false
                                        elem[ propName ] = false;
                                }
@@ -4171,7 +4245,7 @@ boolHook = {
                return name;
        }
 };
-jQuery.each( jQuery.expr.match.boolean.source.match( /\w+/g ), function( i, name ) {
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
        var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
 
        jQuery.expr.attrHandle[ name ] = function( elem, name, isXML ) {
@@ -4752,6 +4826,12 @@ jQuery.event = {
                        event[ prop ] = originalEvent[ prop ];
                }
 
+               // Support: Cordova 2.5 (WebKit) (#13255)
+               // All events should have a target; Cordova deviceready doesn't
+               if ( !event.target ) {
+                       event.target = document;
+               }
+
                // Support: Safari 6.0+, Chrome < 28
                // Target should not be a text node (#504, #13143)
                if ( event.target.nodeType === 3 ) {
@@ -5063,6 +5143,7 @@ jQuery.fn.extend({
        }
 });
 var isSimple = /^.[^:#\[\.,]*$/,
+       rparentsprev = /^(?:parents|prev(?:Until|All))/,
        rneedsContext = jQuery.expr.match.needsContext,
        // methods guaranteed to produce a unique set when starting from a unique set
        guaranteedUnique = {
@@ -5074,13 +5155,14 @@ var isSimple = /^.[^:#\[\.,]*$/,
 
 jQuery.fn.extend({
        find: function( selector ) {
-               var self, matched, i,
-                       l = this.length;
+               var i,
+                       ret = [],
+                       self = this,
+                       len = self.length;
 
                if ( typeof selector !== "string" ) {
-                       self = this;
                        return this.pushStack( jQuery( selector ).filter(function() {
-                               for ( i = 0; i < l; i++ ) {
+                               for ( i = 0; i < len; i++ ) {
                                        if ( jQuery.contains( self[ i ], this ) ) {
                                                return true;
                                        }
@@ -5088,15 +5170,14 @@ jQuery.fn.extend({
                        }) );
                }
 
-               matched = [];
-               for ( i = 0; i < l; i++ ) {
-                       jQuery.find( selector, this[ i ], matched );
+               for ( i = 0; i < len; i++ ) {
+                       jQuery.find( selector, self[ i ], ret );
                }
 
                // Needed because $( selector, context ) becomes $( context ).find( selector )
-               matched = this.pushStack( l > 1 ? jQuery.unique( matched ) : matched );
-               matched.selector = ( this.selector ? this.selector + " " : "" ) + selector;
-               return matched;
+               ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
+               ret.selector = this.selector ? this.selector + " " + selector : selector;
+               return ret;
        },
 
        has: function( target ) {
@@ -5122,14 +5203,16 @@ jQuery.fn.extend({
        },
 
        is: function( selector ) {
-               return !!selector && (
-                       typeof selector === "string" ?
-                               // If this is a positional/relative selector, check membership in the returned set
-                               // so $("p:first").is("p:last") won't return true for a doc with two "p".
-                               rneedsContext.test( selector ) ?
-                                       jQuery( selector, this.context ).index( this[ 0 ] ) >= 0 :
-                                       jQuery.filter( selector, this ).length > 0 :
-                               this.filter( selector ).length > 0 );
+               return !!winnow(
+                       this,
+
+                       // If this is a positional/relative selector, check membership in the returned set
+                       // so $("p:first").is("p:last") won't return true for a doc with two "p".
+                       typeof selector === "string" && rneedsContext.test( selector ) ?
+                               jQuery( selector ) :
+                               selector || [],
+                       false
+               ).length;
        },
 
        closest: function( selectors, context ) {
@@ -5240,9 +5323,7 @@ jQuery.each({
                return jQuery.sibling( elem.firstChild );
        },
        contents: function( elem ) {
-               return jQuery.nodeName( elem, "iframe" ) ?
-                       elem.contentDocument || elem.contentWindow.document :
-                       jQuery.merge( [], elem.childNodes );
+               return elem.contentDocument || jQuery.merge( [], elem.childNodes );
        }
 }, function( name, fn ) {
        jQuery.fn[ name ] = function( until, selector ) {
@@ -5262,8 +5343,8 @@ jQuery.each({
                                jQuery.unique( matched );
                        }
 
-                       // Reverse order for parents* and prev*
-                       if ( name[ 0 ] === "p" ) {
+                       // Reverse order for parents* and prev-derivatives
+                       if ( rparentsprev.test( name ) ) {
                                matched.reverse();
                        }
                }
@@ -5362,6 +5443,7 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
                option: [ 1, "<select multiple='multiple'>", "</select>" ],
 
                thead: [ 1, "<table>", "</table>" ],
+               col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
                tr: [ 2, "<table><tbody>", "</tbody></table>" ],
                td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
 
@@ -5371,7 +5453,7 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
 // Support: IE 9
 wrapMap.optgroup = wrapMap.option;
 
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.col = wrapMap.thead;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
 wrapMap.th = wrapMap.td;
 
 jQuery.fn.extend({
@@ -5519,6 +5601,10 @@ jQuery.fn.extend({
                                parent = args[ i++ ];
 
                        if ( parent ) {
+                               // Don't use the snapshot next if it has moved (#13810)
+                               if ( next && next.parentNode !== parent ) {
+                                       next = this.nextSibling;
+                               }
                                jQuery( this ).remove();
                                parent.insertBefore( elem, next );
                        }
@@ -5774,35 +5860,35 @@ jQuery.extend({
        },
 
        cleanData: function( elems ) {
-               var data, elem, type,
-                       l = elems.length,
-                       i = 0,
-                       special = jQuery.event.special;
-
-               for ( ; i < l; i++ ) {
-                       elem = elems[ i ];
-
-                       if ( jQuery.acceptData( elem ) ) {
+               var data, elem, events, type, key, j,
+                       special = jQuery.event.special,
+                       i = 0;
 
-                               data = data_priv.access( elem );
+               for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
+                       if ( Data.accepts( elem ) ) {
+                               key = elem[ data_priv.expando ];
 
-                               if ( data ) {
-                                       for ( type in data.events ) {
-                                               if ( special[ type ] ) {
-                                                       jQuery.event.remove( elem, type );
+                               if ( key && (data = data_priv.cache[ key ]) ) {
+                                       events = Object.keys( data.events || {} );
+                                       if ( events.length ) {
+                                               for ( j = 0; (type = events[j]) !== undefined; j++ ) {
+                                                       if ( special[ type ] ) {
+                                                               jQuery.event.remove( elem, type );
 
-                                               // This is a shortcut to avoid jQuery.event.remove's overhead
-                                               } else {
-                                                       jQuery.removeEvent( elem, type, data.handle );
+                                                       // This is a shortcut to avoid jQuery.event.remove's overhead
+                                                       } else {
+                                                               jQuery.removeEvent( elem, type, data.handle );
+                                                       }
                                                }
                                        }
+                                       if ( data_priv.cache[ key ] ) {
+                                               // Discard any remaining `private` data
+                                               delete data_priv.cache[ key ];
+                                       }
                                }
                        }
-                       // Discard any remaining `private` and `user` data
-                       // One day we'll replace the dual arrays with a WeakMap and this won't be an issue.
-                       // (Splices the data objects out of the internal cache arrays)
-                       data_user.discard( elem );
-                       data_priv.discard( elem );
+                       // Discard any remaining `user` data
+                       delete data_user.cache[ elem[ data_user.expando ] ];
                }
        },
 
@@ -5810,10 +5896,10 @@ jQuery.extend({
                return jQuery.ajax({
                        url: url,
                        type: "GET",
-                       dataType: "text",
+                       dataType: "script",
                        async: false,
                        global: false,
-                       success: jQuery.globalEval
+                       "throws": true
                });
        }
 });
@@ -5868,11 +5954,9 @@ function cloneCopyEvent( src, dest ) {
        // 1. Copy private data: events, handlers, etc.
        if ( data_priv.hasData( src ) ) {
                pdataOld = data_priv.access( src );
-               pdataCur = jQuery.extend( {}, pdataOld );
+               pdataCur = data_priv.set( dest, pdataOld );
                events = pdataOld.events;
 
-               data_priv.set( dest, pdataCur );
-
                if ( events ) {
                        delete pdataCur.handle;
                        pdataCur.events = {};
@@ -6153,7 +6237,7 @@ jQuery.extend({
                }
        },
 
-       // Exclude the following css properties to add px
+       // Don't automatically add "px" to these possibly-unitless properties
        cssNumber: {
                "columnCount": true,
                "fillOpacity": true,
@@ -7294,7 +7378,7 @@ jQuery.extend({
                                }
 
                                // if no content
-                               if ( status === 204 ) {
+                               if ( status === 204 || s.type === "HEAD" ) {
                                        statusText = "nocontent";
 
                                // if not modified
@@ -7788,44 +7872,51 @@ var fxNow, timerId,
        animationPrefilters = [ defaultPrefilter ],
        tweeners = {
                "*": [function( prop, value ) {
-                       var end, unit,
-                               tween = this.createTween( prop, value ),
-                               parts = rfxnum.exec( value ),
+                       var tween = this.createTween( prop, value ),
                                target = tween.cur(),
-                               start = +target || 0,
+                               parts = rfxnum.exec( value ),
+                               unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+                               // Starting value computation is required for potential unit mismatches
+                               start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
+                                       rfxnum.exec( jQuery.css( tween.elem, prop ) ),
                                scale = 1,
                                maxIterations = 20;
 
-                       if ( parts ) {
-                               end = +parts[2];
-                               unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+                       if ( start && start[ 3 ] !== unit ) {
+                               // Trust units reported by jQuery.css
+                               unit = unit || start[ 3 ];
 
-                               // We need to compute starting value
-                               if ( unit !== "px" && start ) {
-                                       // Iteratively approximate from a nonzero starting point
-                                       // Prefer the current property, because this process will be trivial if it uses the same units
-                                       // Fallback to end or a simple constant
-                                       start = jQuery.css( tween.elem, prop, true ) || end || 1;
+                               // Make sure we update the tween properties later on
+                               parts = parts || [];
 
-                                       do {
-                                               // If previous iteration zeroed out, double until we get *something*
-                                               // Use a string for doubling factor so we don't accidentally see scale as unchanged below
-                                               scale = scale || ".5";
+                               // Iteratively approximate from a nonzero starting point
+                               start = +target || 1;
 
-                                               // Adjust and apply
-                                               start = start / scale;
-                                               jQuery.style( tween.elem, prop, start + unit );
+                               do {
+                                       // If previous iteration zeroed out, double until we get *something*
+                                       // Use a string for doubling factor so we don't accidentally see scale as unchanged below
+                                       scale = scale || ".5";
 
-                                       // Update scale, tolerating zero or NaN from tween.cur()
-                                       // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
-                                       } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
-                               }
+                                       // Adjust and apply
+                                       start = start / scale;
+                                       jQuery.style( tween.elem, prop, start + unit );
 
+                               // Update scale, tolerating zero or NaN from tween.cur()
+                               // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+                               } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+                       }
+
+                       // Update tween properties
+                       if ( parts ) {
+                               start = tween.start = +start || +target || 0;
                                tween.unit = unit;
-                               tween.start = start;
                                // If a +=/-= token was provided, we're doing a relative animation
-                               tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
+                               tween.end = parts[ 1 ] ?
+                                       start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
+                                       +parts[ 2 ];
                        }
+
                        return tween;
                }]
        };
@@ -7838,19 +7929,18 @@ function createFxNow() {
        return ( fxNow = jQuery.now() );
 }
 
-function createTweens( animation, props ) {
-       jQuery.each( props, function( prop, value ) {
-               var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
-                       index = 0,
-                       length = collection.length;
-               for ( ; index < length; index++ ) {
-                       if ( collection[ index ].call( animation, prop, value ) ) {
+function createTween( value, prop, animation ) {
+       var tween,
+               collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+               index = 0,
+               length = collection.length;
+       for ( ; index < length; index++ ) {
+               if ( (tween = collection[ index ].call( animation, prop, value )) ) {
 
-                               // we're done with this property
-                               return;
-                       }
+                       // we're done with this property
+                       return tween;
                }
-       });
+       }
 }
 
 function Animation( elem, properties, options ) {
@@ -7936,7 +8026,7 @@ function Animation( elem, properties, options ) {
                }
        }
 
-       createTweens( animation, props );
+       jQuery.map( props, createTween, animation );
 
        if ( jQuery.isFunction( animation.opts.start ) ) {
                animation.opts.start.call( elem, animation );
@@ -8026,12 +8116,12 @@ jQuery.Animation = jQuery.extend( Animation, {
 
 function defaultPrefilter( elem, props, opts ) {
        /* jshint validthis: true */
-       var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
+       var prop, value, toggle, tween, hooks, oldfire,
                anim = this,
-               style = elem.style,
                orig = {},
-               handled = [],
-               hidden = elem.nodeType && isHidden( elem );
+               style = elem.style,
+               hidden = elem.nodeType && isHidden( elem ),
+               dataShow = data_priv.get( elem, "fxshow" );
 
        // handle queue: false promises
        if ( !opts.queue ) {
@@ -8087,30 +8177,31 @@ function defaultPrefilter( elem, props, opts ) {
 
 
        // show/hide pass
-       dataShow = data_priv.get( elem, "fxshow" );
-       for ( index in props ) {
-               value = props[ index ];
+       for ( prop in props ) {
+               value = props[ prop ];
                if ( rfxtypes.exec( value ) ) {
-                       delete props[ index ];
+                       delete props[ prop ];
                        toggle = toggle || value === "toggle";
                        if ( value === ( hidden ? "hide" : "show" ) ) {
 
                                // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
-                               if( value === "show" && dataShow !== undefined && dataShow[ index ] !== undefined ) {
+                               if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
                                        hidden = true;
                                } else {
                                        continue;
                                }
                        }
-                       handled.push( index );
+                       orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
                }
        }
 
-       length = handled.length;
-       if ( length ) {
-               dataShow = data_priv.get( elem, "fxshow" ) || data_priv.access( elem, "fxshow", {} );
-               if ( "hidden" in dataShow ) {
-                       hidden = dataShow.hidden;
+       if ( !jQuery.isEmptyObject( orig ) ) {
+               if ( dataShow ) {
+                       if ( "hidden" in dataShow ) {
+                               hidden = dataShow.hidden;
+                       }
+               } else {
+                       dataShow = data_priv.access( elem, "fxshow", {} );
                }
 
                // store state if its toggle - enables .stop().toggle() to "reverse"
@@ -8132,10 +8223,8 @@ function defaultPrefilter( elem, props, opts ) {
                                jQuery.style( elem, prop, orig[ prop ] );
                        }
                });
-               for ( index = 0 ; index < length ; index++ ) {
-                       prop = handled[ index ];
-                       tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
-                       orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
+               for ( prop in orig ) {
+                       tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
 
                        if ( !( prop in dataShow ) ) {
                                dataShow[ prop ] = tween.start;
@@ -8266,9 +8355,7 @@ jQuery.fn.extend({
                        doAnimation = function() {
                                // Operate on a copy of prop so per-property easing won't be lost
                                var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-                               doAnimation.finish = function() {
-                                       anim.stop( true );
-                               };
+
                                // Empty animations, or finishing resolves immediately
                                if ( empty || data_priv.get( this, "finish" ) ) {
                                        anim.stop( true );
@@ -8348,8 +8435,8 @@ jQuery.fn.extend({
                        // empty the queue first
                        jQuery.queue( this, type, [] );
 
-                       if ( hooks && hooks.cur && hooks.cur.finish ) {
-                               hooks.cur.finish.call( this );
+                       if ( hooks && hooks.stop ) {
+                               hooks.stop.call( this, true );
                        }
 
                        // look for any active animations, and finish them
@@ -8727,7 +8814,7 @@ jQuery.fn.size = function() {
 jQuery.fn.andSelf = jQuery.fn.addBack;
 
 // })();
-if ( typeof module === "object" && typeof module.exports === "object" ) {
+if ( typeof module === "object" && module && typeof module.exports === "object" ) {
        // Expose jQuery as module.exports in loaders that implement the Node
        // module pattern (including browserify). Do not create the global, since
        // the user will be storing it themselves locally, and globals are frowned