Index: openacs-4/packages/xowiki/www/resources/jquery/jquery.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/jquery/jquery.js,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/xowiki/www/resources/jquery/jquery.js 27 Oct 2014 16:42:08 -0000 1.7 +++ openacs-4/packages/xowiki/www/resources/jquery/jquery.js 27 Apr 2015 15:29:04 -0000 1.8 @@ -1,5 +1,5 @@ /*! - * jQuery JavaScript Library v1.11.0 + * jQuery JavaScript Library v1.11.2 * http://jquery.com/ * * Includes Sizzle.js @@ -9,7 +9,7 @@ * Released under the MIT license * http://jquery.org/license * - * Date: 2014-01-23T21:02Z + * Date: 2014-12-17T15:27Z */ (function( global, factory ) { @@ -59,14 +59,12 @@ var hasOwn = class2type.hasOwnProperty; -var trim = "".trim; - var support = {}; var - version = "1.11.0", + version = "1.11.2", // Define a local copy of jQuery jQuery = function( selector, context ) { @@ -75,7 +73,8 @@ return new jQuery.fn.init( selector, context ); }, - // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) + // Support: Android<4.1, IE<9 + // Make sure we trim BOM and NBSP rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // Matches dashed string for camelizing @@ -108,10 +107,10 @@ get: function( num ) { return num != null ? - // Return a 'clean' array + // Return just the one element from the set ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - // Return just the object + // Return all the elements in a clean array slice.call( this ); }, @@ -270,7 +269,8 @@ // parseFloat NaNs numeric-cast false positives (null|true|false|"") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN - return obj - parseFloat( obj ) >= 0; + // adding 1 corrects loss of precision from parseFloat (#15100) + return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; }, isEmptyObject: function( obj ) { @@ -401,21 +401,13 @@ return obj; }, - // Use native String.trim function wherever possible - trim: trim && !trim.call("\uFEFF\xA0") ? - function( text ) { - return text == null ? - "" : - trim.call( text ); - } : + // Support: Android<4.1, IE<9 + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; @@ -593,14 +585,14 @@ } var Sizzle = /*! - * Sizzle CSS Selector Engine v1.10.16 + * Sizzle CSS Selector Engine v2.2.0-pre * http://sizzlejs.com/ * - * Copyright 2013 jQuery Foundation, Inc. and other contributors + * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * - * Date: 2014-01-13 + * Date: 2014-12-16 */ (function( window ) { @@ -609,7 +601,9 @@ Expr, getText, isXML, + tokenize, compile, + select, outermostContext, sortInput, hasDuplicate, @@ -625,7 +619,7 @@ contains, // Instance-specific data - expando = "sizzle" + -(new Date()), + expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, @@ -640,7 +634,6 @@ }, // General-purpose constants - strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods @@ -650,12 +643,13 @@ push_native = arr.push, push = arr.push, slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { + // Use a stripped-down indexOf as it's faster than native + // http://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { var i = 0, - len = this.length; + len = list.length; for ( ; i < len; i++ ) { - if ( this[i] === elem ) { + if ( list[i] === elem ) { return i; } } @@ -676,19 +670,26 @@ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), - // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + - "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", - // Prefer arguments quoted, - // then not containing pseudos/brackets, - // then attribute selectors/non-parenthetical expressions, - // then anything else - // These preferences are here to reduce the number of selectors - // needing tokenize in the PSEUDO preFilter - pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", + pseudos = ":(" + characterEncoding + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), @@ -731,7 +732,7 @@ funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint - // Support: Firefox + // Support: Firefox<24 // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : @@ -740,6 +741,14 @@ String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); }; // Optimize for push.apply( _, NodeList ) @@ -782,19 +791,18 @@ context = context || document; results = results || []; + nodeType = context.nodeType; - if ( !selector || typeof selector !== "string" ) { + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + return results; } - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } + if ( !seed && documentIsHTML ) { - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { + // Try to shortcut find operations when possible (e.g., not under DocumentFragment) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { @@ -826,7 +834,7 @@ return results; // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { + } else if ( (m = match[3]) && support.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } @@ -836,7 +844,7 @@ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; - newSelector = nodeType === 9 && selector; + newSelector = nodeType !== 1 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root @@ -1023,7 +1031,7 @@ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ function testContext( context ) { - return context && typeof context.getElementsByTagName !== strundefined && context; + return context && typeof context.getElementsByTagName !== "undefined" && context; } // Expose support vars for convenience @@ -1047,9 +1055,8 @@ * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, - doc = node ? node.ownerDocument || node : preferredDoc, - parent = doc.defaultView; + var hasCompare, parent, + doc = node ? node.ownerDocument || node : preferredDoc; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { @@ -1059,32 +1066,31 @@ // Set our document document = doc; docElem = doc.documentElement; + parent = doc.defaultView; - // Support tests - documentIsHTML = !isXML( doc ); - // 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 // IE6-8 do not support the defaultView property so parent will be undefined if ( parent && parent !== parent.top ) { // IE11 does not have attachEvent, so all must suffer if ( parent.addEventListener ) { - parent.addEventListener( "unload", function() { - setDocument(); - }, false ); + parent.addEventListener( "unload", unloadHandler, false ); } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", function() { - setDocument(); - }); + parent.attachEvent( "onunload", unloadHandler ); } } + /* Support tests + ---------------------------------------------------------------------- */ + documentIsHTML = !isXML( doc ); + /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); @@ -1099,18 +1105,9 @@ return !div.getElementsByTagName("*").length; }); - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { - div.innerHTML = "
"; + // Support: IE<9 + support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); - // Support: Safari<4 - // Catch class over-caching - div.firstChild.className = "i"; - // Support: Opera<10 - // Catch gEBCN failure to find non-leading classes - return div.getElementsByClassName("i").length === 2; - }); - // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, @@ -1123,11 +1120,11 @@ // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; + return m && m.parentNode ? [ m ] : []; } }; Expr.filter["ID"] = function( id ) { @@ -1144,7 +1141,7 @@ Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; @@ -1153,14 +1150,20 @@ // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); } } : + function( tag, context ) { var elem, tmp = [], i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too results = context.getElementsByTagName( tag ); // Filter out possible comments @@ -1178,7 +1181,7 @@ // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { + if ( documentIsHTML ) { return context.getElementsByClassName( className ); } }; @@ -1207,11 +1210,15 @@ // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; + docElem.appendChild( div ).innerHTML = "" + + ""; - // Support: IE8, Opera 10-12 + // Support: IE8, Opera 11-12.16 // Nothing should be selected when empty strings follow ^= or $= or *= - if ( div.querySelectorAll("[t^='']").length ) { + // The test attribute must be unknown in Opera but "safe" for WinRT + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( div.querySelectorAll("[msallowcapture^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } @@ -1221,12 +1228,24 @@ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } + // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+ + if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibing-combinator selector` fails + if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } }); assert(function( div ) { @@ -1254,7 +1273,8 @@ }); } - if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { @@ -1342,7 +1362,7 @@ // Maintain original order return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; } @@ -1369,7 +1389,7 @@ aup ? -1 : bup ? 1 : sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check @@ -1432,10 +1452,10 @@ elem.document && elem.document.nodeType !== 11 ) { return ret; } - } catch(e) {} + } catch (e) {} } - return Sizzle( expr, document, null, [elem] ).length > 0; + return Sizzle( expr, document, null, [ elem ] ).length > 0; }; Sizzle.contains = function( context, elem ) { @@ -1564,7 +1584,7 @@ match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; @@ -1607,15 +1627,15 @@ "PSEUDO": function( match ) { var excess, - unquoted = !match[5] && match[2]; + unquoted = !match[6] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is - if ( match[3] && match[4] !== undefined ) { - match[2] = match[4]; + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && @@ -1651,7 +1671,7 @@ return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); }); }, @@ -1673,7 +1693,7 @@ operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; @@ -1793,7 +1813,7 @@ matched = fn( seed, argument ), i = matched.length; while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); + idx = indexOf( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : @@ -1832,6 +1852,8 @@ function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; return !results.pop(); }; }), @@ -1843,6 +1865,7 @@ }), "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; @@ -2020,7 +2043,7 @@ setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); -function tokenize( selector, parseOnly ) { +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; @@ -2085,7 +2108,7 @@ Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); -} +}; function toSelector( tokens ) { var i = 0, @@ -2164,6 +2187,15 @@ matchers[0]; } +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], @@ -2255,7 +2287,7 @@ i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } @@ -2290,13 +2322,16 @@ return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; + return indexOf( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; } ]; for ( ; i < len; i++ ) { @@ -2432,20 +2467,20 @@ superMatcher; } -compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element - if ( !group ) { - group = tokenize( selector ); + if ( !match ) { + match = tokenize( selector ); } - i = group.length; + i = match.length; while ( i-- ) { - cached = matcherFromTokens( group[i] ); + cached = matcherFromTokens( match[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { @@ -2455,89 +2490,98 @@ // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; } return cached; }; -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function select( selector, context, results, seed ) { +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { var i, tokens, token, type, find, - match = tokenize( selector ); + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); - if ( !seed ) { - // Try to minimize operations if there is only one group - if ( match.length === 1 ) { + results = results || []; - // 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" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { + // Try to minimize operations if there is no seed and only one group + if ( match.length === 1 ) { - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - } - selector = selector.slice( tokens.shift().value.length ); + // 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" && + 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; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; } - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; + selector = selector.slice( tokens.shift().value.length ); + } - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { - break; + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; } + + break; } } } } - // Compile and execute a filtering function + // Compile and execute a filtering function if one is not provided // Provide `match` to avoid retokenization if we modified the selector above - compile( selector, match )( + ( compiled || compile( selector, match ) )( seed, context, !documentIsHTML, results, rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; -} +}; // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; -// Support: Chrome<14 +// Support: Chrome 14-35+ // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = !!hasDuplicate; @@ -3423,8 +3467,9 @@ readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger("ready").off("ready"); + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + jQuery( document ).off( "ready" ); } } }); @@ -3532,33 +3577,32 @@ // false until the test is run support.inlineBlockNeedsLayout = false; +// Execute ASAP in case we need to set body.style.zoom jQuery(function() { - // We need to execute this one support test ASAP because we need to know - // if body.style.zoom needs to be set. + // Minified: var a,b,c,d + var val, div, body, container; - var container, div, - body = document.getElementsByTagName("body")[0]; - - if ( !body ) { + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { // Return for frameset docs that don't have a body return; } // Setup - container = document.createElement( "div" ); - container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; - div = document.createElement( "div" ); + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); if ( typeof div.style.zoom !== strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout - div.style.cssText = "border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1"; + div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; - if ( (support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 )) ) { + support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; + if ( val ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 @@ -3567,9 +3611,6 @@ } body.removeChild( container ); - - // Null elements to avoid leaks in IE - container = div = null; }); @@ -3892,12 +3933,15 @@ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { i = attrs.length; while ( i-- ) { - name = attrs[i].name; - if ( name.indexOf("data-") === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - - dataAttr( elem, name, data[ name ] ); + // Support: IE11+ + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.slice(5) ); + dataAttr( elem, name, data[ name ] ); + } } } jQuery._data( elem, "parsedAttrs", true ); @@ -4137,13 +4181,13 @@ (function() { - var fragment = document.createDocumentFragment(), - div = document.createElement("div"), - input = document.createElement("input"); + // Minified: var a,b,c + var input = document.createElement( "input" ), + div = document.createElement( "div" ), + fragment = document.createDocumentFragment(); // Setup - div.setAttribute( "className", "t" ); - div.innerHTML = "
a"; + div.innerHTML = "
a"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; @@ -4203,9 +4247,6 @@ support.deleteExpando = false; } } - - // Null elements to avoid leaks in IE. - fragment = div = input = null; })(); @@ -4231,7 +4272,7 @@ var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, + rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; @@ -4834,8 +4875,9 @@ beforeunload: { postDispatch: function( event ) { - // Even when returnValue equals to undefined Firefox will still show alert - if ( event.result !== undefined ) { + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { event.originalEvent.returnValue = event.result; } } @@ -4901,11 +4943,9 @@ // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && ( - // Support: IE < 9 - src.returnValue === false || - // Support: Android < 4.0 - src.getPreventDefault && src.getPreventDefault() ) ? + src.defaultPrevented === undefined && + // Support: IE < 9, Android < 4.0 + src.returnValue === false ? returnTrue : returnFalse; @@ -4968,15 +5008,24 @@ e.cancelBubble = true; }, stopImmediatePropagation: function() { + var e = this.originalEvent; + this.isImmediatePropagationStopped = returnTrue; + + if ( e && e.stopImmediatePropagation ) { + e.stopImmediatePropagation(); + } + this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", - mouseleave: "mouseout" + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, @@ -5980,14 +6029,15 @@ */ // Called only from within defaultDisplay function actualDisplay( name, doc ) { - var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + var style, + elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle ? + display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? // Use of this method is a temporary fix (more like optmization) until something better comes along, // since it was removed from specification and supported only in FF - window.getDefaultComputedStyle( elem[ 0 ] ).display : jQuery.css( elem[ 0 ], "display" ); + style.display : jQuery.css( elem[ 0 ], "display" ); // We don't have any data stored on the element, // so use "detach" method as fast way to get rid of the element @@ -6033,68 +6083,47 @@ (function() { - var a, shrinkWrapBlocksVal, - div = document.createElement( "div" ), - divReset = - "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" + - "display:block;padding:0;margin:0;border:0"; + var shrinkWrapBlocksVal; - // Setup - div.innerHTML = "
a"; - a = div.getElementsByTagName( "a" )[ 0 ]; - - a.style.cssText = "float:left;opacity:.5"; - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - support.opacity = /^0.5/.test( a.style.opacity ); - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - support.cssFloat = !!a.style.cssFloat; - - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - // Null elements to avoid leaks in IE. - a = div = null; - support.shrinkWrapBlocks = function() { - var body, container, div, containerStyles; + if ( shrinkWrapBlocksVal != null ) { + return shrinkWrapBlocksVal; + } - if ( shrinkWrapBlocksVal == null ) { - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body ) { - // Test fired too early or in an unsupported environment, exit. - return; - } + // Will be changed later if needed. + shrinkWrapBlocksVal = false; - containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px"; - container = document.createElement( "div" ); - div = document.createElement( "div" ); + // Minified: var b,c,d + var div, body, container; - body.appendChild( container ).appendChild( div ); + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { + // Test fired too early or in an unsupported environment, exit. + return; + } - // Will be changed later if needed. - shrinkWrapBlocksVal = false; + // Setup + div = document.createElement( "div" ); + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + body.appendChild( container ).appendChild( div ); - if ( typeof div.style.zoom !== strundefined ) { - // Support: IE6 - // Check if elements with layout shrink-wrap their children - div.style.cssText = divReset + ";width:1px;padding:1px;zoom:1"; - div.innerHTML = "
"; - div.firstChild.style.width = "5px"; - shrinkWrapBlocksVal = div.offsetWidth !== 3; - } - - body.removeChild( container ); - - // Null elements to avoid leaks in IE. - body = container = div = null; + // Support: IE6 + // Check if elements with layout shrink-wrap their children + if ( typeof div.style.zoom !== strundefined ) { + // Reset CSS: box-sizing; display; margin; border + div.style.cssText = + // Support: Firefox<29, Android 2.3 + // Vendor-prefix box-sizing + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + + "box-sizing:content-box;display:block;margin:0;border:0;" + + "padding:1px;width:1px;zoom:1"; + div.appendChild( document.createElement( "div" ) ).style.width = "5px"; + shrinkWrapBlocksVal = div.offsetWidth !== 3; } + body.removeChild( container ); + return shrinkWrapBlocksVal; }; @@ -6110,7 +6139,14 @@ if ( window.getComputedStyle ) { getStyles = function( elem ) { - return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); + // Support: IE<=11+, Firefox<=30+ (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + if ( elem.ownerDocument.defaultView.opener ) { + return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); + } + + return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, computed ) { @@ -6242,94 +6278,48 @@ (function() { - var a, reliableHiddenOffsetsVal, boxSizingVal, boxSizingReliableVal, - pixelPositionVal, reliableMarginRightVal, - div = document.createElement( "div" ), - containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px", - divReset = - "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" + - "display:block;padding:0;margin:0;border:0"; + // Minified: var b,c,d,e,f,g, h,i + var div, style, a, pixelPositionVal, boxSizingReliableVal, + reliableHiddenOffsetsVal, reliableMarginRightVal; // Setup + div = document.createElement( "div" ); div.innerHTML = "
a"; a = div.getElementsByTagName( "a" )[ 0 ]; + style = a && a.style; - a.style.cssText = "float:left;opacity:.5"; + // Finish early in limited (non-browser) environments + if ( !style ) { + return; + } - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - support.opacity = /^0.5/.test( a.style.opacity ); + style.cssText = "float:left;opacity:.5"; + // Support: IE<9 + // Make sure that element opacity exists (as opposed to filter) + support.opacity = style.opacity === "0.5"; + // Verify style float existence // (IE uses styleFloat instead of cssFloat) - support.cssFloat = !!a.style.cssFloat; + support.cssFloat = !!style.cssFloat; div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; - // Null elements to avoid leaks in IE. - a = div = null; + // Support: Firefox<29, Android 2.3 + // Vendor-prefix box-sizing + support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" || + style.WebkitBoxSizing === ""; jQuery.extend(support, { reliableHiddenOffsets: function() { - if ( reliableHiddenOffsetsVal != null ) { - return reliableHiddenOffsetsVal; + if ( reliableHiddenOffsetsVal == null ) { + computeStyleTests(); } - - var container, tds, isSupported, - div = document.createElement( "div" ), - body = document.getElementsByTagName( "body" )[ 0 ]; - - if ( !body ) { - // Return for frameset docs that don't have a body - return; - } - - // Setup - div.setAttribute( "className", "t" ); - div.innerHTML = "
a"; - - container = document.createElement( "div" ); - container.style.cssText = containerStyles; - - body.appendChild( container ).appendChild( div ); - - // Support: IE8 - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - div.innerHTML = "
t
"; - tds = div.getElementsByTagName( "td" ); - tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Support: IE8 - // Check if empty table cells still have offsetWidth/Height - reliableHiddenOffsetsVal = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - - body.removeChild( container ); - - // Null elements to avoid leaks in IE. - div = body = null; - return reliableHiddenOffsetsVal; }, - boxSizing: function() { - if ( boxSizingVal == null ) { - computeStyleTests(); - } - return boxSizingVal; - }, - boxSizingReliable: function() { if ( boxSizingReliableVal == null ) { computeStyleTests(); @@ -6344,84 +6334,88 @@ return pixelPositionVal; }, + // Support: Android 2.3 reliableMarginRight: function() { - var body, container, div, marginDiv; - - // Use window.getComputedStyle because jsdom on node.js will break without it. - if ( reliableMarginRightVal == null && window.getComputedStyle ) { - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body ) { - // Test fired too early or in an unsupported environment, exit. - return; - } - - container = document.createElement( "div" ); - div = document.createElement( "div" ); - container.style.cssText = containerStyles; - - body.appendChild( container ).appendChild( div ); - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. (#3333) - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - marginDiv = div.appendChild( document.createElement( "div" ) ); - marginDiv.style.cssText = div.style.cssText = divReset; - marginDiv.style.marginRight = marginDiv.style.width = "0"; - div.style.width = "1px"; - - reliableMarginRightVal = - !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); - - body.removeChild( container ); + if ( reliableMarginRightVal == null ) { + computeStyleTests(); } - return reliableMarginRightVal; } }); function computeStyleTests() { - var container, div, - body = document.getElementsByTagName( "body" )[ 0 ]; + // Minified: var b,c,d,j + var div, body, container, contents; - if ( !body ) { + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { // Test fired too early or in an unsupported environment, exit. return; } - container = document.createElement( "div" ); + // Setup div = document.createElement( "div" ); - container.style.cssText = containerStyles; - + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); div.style.cssText = - "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" + - "position:absolute;display:block;padding:1px;border:1px;width:4px;" + - "margin-top:1%;top:1%"; + // Support: Firefox<29, Android 2.3 + // Vendor-prefix box-sizing + "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + + "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + + "border:1px;padding:1px;width:4px;position:absolute"; - // Workaround failing boxSizing test due to offsetWidth returning wrong value - // with some non-1 values of body zoom, ticket #13543 - jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { - boxSizingVal = div.offsetWidth === 4; - }); - - // Will be changed later if needed. - boxSizingReliableVal = true; - pixelPositionVal = false; + // Support: IE<9 + // Assume reasonable values in the absence of getComputedStyle + pixelPositionVal = boxSizingReliableVal = false; reliableMarginRightVal = true; - // Use window.getComputedStyle because jsdom on node.js will break without it. + // Check for getComputedStyle so that this code is not run in IE<9. if ( window.getComputedStyle ) { pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; boxSizingReliableVal = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; + + // Support: Android 2.3 + // Div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container (#3333) + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + contents = div.appendChild( document.createElement( "div" ) ); + + // Reset CSS: box-sizing; display; margin; border; padding + contents.style.cssText = div.style.cssText = + // Support: Firefox<29, Android 2.3 + // Vendor-prefix box-sizing + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + + "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; + contents.style.marginRight = contents.style.width = "0"; + div.style.width = "1px"; + + reliableMarginRightVal = + !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight ); + + div.removeChild( contents ); } - body.removeChild( container ); + // Support: IE8 + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + div.innerHTML = "
t
"; + contents = div.getElementsByTagName( "td" ); + contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; + reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; + if ( reliableHiddenOffsetsVal ) { + contents[ 0 ].style.display = ""; + contents[ 1 ].style.display = "none"; + reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; + } - // Null elements to avoid leaks in IE. - div = body = null; + body.removeChild( container ); } })(); @@ -6461,8 +6455,8 @@ cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { - letterSpacing: 0, - fontWeight: 400 + letterSpacing: "0", + fontWeight: "400" }, cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; @@ -6519,13 +6513,10 @@ values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); } } else { + hidden = isHidden( elem ); - if ( !values[ index ] ) { - hidden = isHidden( elem ); - - if ( display && display !== "none" || !hidden ) { - jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); - } + if ( display && display !== "none" || !hidden ) { + jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } @@ -6598,7 +6589,7 @@ var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), - isBorderBox = support.boxSizing() && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 @@ -6654,6 +6645,8 @@ cssNumber: { "columnCount": true, "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, "fontWeight": true, "lineHeight": true, "opacity": true, @@ -6722,9 +6715,6 @@ // Support: IE // Swallow errors from 'invalid' CSS values (#5509) try { - // Support: Chrome, Safari - // Setting style to blank string required to delete "style: x !important;" - style[ name ] = ""; style[ name ] = value; } catch(e) {} } @@ -6781,7 +6771,7 @@ if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this - return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : @@ -6796,7 +6786,7 @@ elem, name, extra, - support.boxSizing() && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); @@ -7145,7 +7135,7 @@ function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ - var prop, value, toggle, tween, hooks, oldfire, display, dDisplay, + var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, anim = this, orig = {}, style = elem.style, @@ -7189,16 +7179,16 @@ // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated display = jQuery.css( elem, "display" ); - dDisplay = defaultDisplay( elem.nodeName ); - if ( display === "none" ) { - display = dDisplay; - } - if ( display === "inline" && - jQuery.css( elem, "float" ) === "none" ) { + // Test default display if display is currently "none" + checkDisplay = display === "none" ? + jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; + + if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { + // inline-level elements accept inline-block; // block-level elements need to be inline with layout - if ( !support.inlineBlockNeedsLayout || dDisplay === "inline" ) { + if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; @@ -7233,6 +7223,10 @@ } } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + + // Any non-fx value stops us from restoring the original display value + } else { + display = undefined; } } @@ -7274,6 +7268,10 @@ } } } + + // If this is a noop like .hide().hide(), restore an overwritten display value + } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) { + style.display = display; } } @@ -7690,10 +7688,11 @@ (function() { - var a, input, select, opt, - div = document.createElement("div" ); + // Minified: var a,b,c,d,e + var input, div, select, a, opt; // Setup + div = document.createElement( "div" ); div.setAttribute( "className", "t" ); div.innerHTML = "
a"; a = div.getElementsByTagName("a")[ 0 ]; @@ -7741,9 +7740,6 @@ input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; - - // Null elements to avoid leaks in IE. - a = input = select = opt = div = null; })(); @@ -7817,7 +7813,9 @@ var val = jQuery.find.attr( elem, "value" ); return val != null ? val : - jQuery.text( elem ); + // Support: IE10-11+ + // option.text throws exceptions (#14686, #14858) + jQuery.trim( jQuery.text( elem ) ); } }, select: { @@ -9105,7 +9103,8 @@ } // We can fire global events as of now if asked to - fireGlobals = s.global; + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { @@ -9364,14 +9363,7 @@ }; }); -// Attach a bunch of functions for handling common AJAX events -jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { - jQuery.fn[ type ] = function( fn ) { - return this.on( type, fn ); - }; -}); - jQuery._evalUrl = function( url ) { return jQuery.ajax({ url: url, @@ -9596,8 +9588,9 @@ // Support: IE<10 // Open requests must be manually aborted on unload (#5280) -if ( window.ActiveXObject ) { - jQuery( window ).on( "unload", function() { +// See https://support.microsoft.com/kb/2856746 for more info +if ( window.attachEvent ) { + window.attachEvent( "onunload", function() { for ( var key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } @@ -9981,7 +9974,7 @@ off = url.indexOf(" "); if ( off >= 0 ) { - selector = url.slice( off, url.length ); + selector = jQuery.trim( url.slice( off, url.length ) ); url = url.slice( 0, off ); } @@ -10031,6 +10024,16 @@ +// Attach a bunch of functions for handling common AJAX events +jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { + jQuery.fn[ type ] = function( fn ) { + return this.on( type, fn ); + }; +}); + + + + jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; @@ -10294,6 +10297,12 @@ // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. + +// Note that for maximum portability, libraries that are not jQuery should +// declare themselves as anonymous modules, and avoid setting a global if an +// AMD loader is present. jQuery is a special case. For more information, see +// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon + if ( typeof define === "function" && define.amd ) { define( "jquery", [], function() { return jQuery;