From 6b24bc150df47aabbe35238cab0c07eab8a93d49 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 5 Feb 2015 09:39:06 +0000 Subject: [PATCH] revert jQuery back to 1.11.0 from previous upgrade to 1.11.2, as it broke to many things, specially calendar day-view with multiple participants --- phpgwapi/js/jquery/jquery.js | 845 +++++++++++++++++------------------ 1 file changed, 418 insertions(+), 427 deletions(-) diff --git a/phpgwapi/js/jquery/jquery.js b/phpgwapi/js/jquery/jquery.js index ff14994b48..ca8d52dd10 100644 --- a/phpgwapi/js/jquery/jquery.js +++ b/phpgwapi/js/jquery/jquery.js @@ -1,5 +1,5 @@ /*! - * jQuery JavaScript Library v1.11.2 + * jQuery JavaScript Library v1.11.0 * http://jquery.com/ * * Includes Sizzle.js @@ -9,7 +9,7 @@ * Released under the MIT license * http://jquery.org/license * - * Date: 2014-12-17T15:27Z + * Date: 2014-01-23T21:02Z */ (function( global, factory ) { @@ -59,12 +59,14 @@ var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; +var trim = "".trim; + var support = {}; var - version = "1.11.2", + version = "1.11.0", // Define a local copy of jQuery jQuery = function( selector, context ) { @@ -73,8 +75,7 @@ var return new jQuery.fn.init( selector, context ); }, - // Support: Android<4.1, IE<9 - // Make sure we trim BOM and NBSP + // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // Matches dashed string for camelizing @@ -107,10 +108,10 @@ jQuery.fn = jQuery.prototype = { get: function( num ) { return num != null ? - // Return just the one element from the set + // Return a 'clean' array ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - // Return all the elements in a clean array + // Return just the object slice.call( this ); }, @@ -269,8 +270,7 @@ jQuery.extend({ // parseFloat NaNs numeric-cast false positives (null|true|false|"") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN - // adding 1 corrects loss of precision from parseFloat (#15100) - return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; + return obj - parseFloat( obj ) >= 0; }, isEmptyObject: function( obj ) { @@ -401,12 +401,20 @@ jQuery.extend({ return obj; }, - // Support: Android<4.1, IE<9 - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, + // Use native String.trim function wherever possible + trim: trim && !trim.call("\uFEFF\xA0") ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, // results is for internal usage only makeArray: function( arr, results ) { @@ -585,14 +593,14 @@ function isArraylike( obj ) { } var Sizzle = /*! - * Sizzle CSS Selector Engine v2.2.0-pre + * Sizzle CSS Selector Engine v1.10.16 * http://sizzlejs.com/ * - * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors + * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * - * Date: 2014-12-16 + * Date: 2014-01-13 */ (function( window ) { @@ -601,9 +609,7 @@ var i, Expr, getText, isXML, - tokenize, compile, - select, outermostContext, sortInput, hasDuplicate, @@ -619,7 +625,7 @@ var i, contains, // Instance-specific data - expando = "sizzle" + 1 * new Date(), + expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, @@ -634,6 +640,7 @@ var i, }, // General-purpose constants + strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods @@ -643,13 +650,12 @@ var i, push_native = arr.push, push = arr.push, slice = arr.slice, - // Use a stripped-down indexOf as it's faster than native - // http://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { + // Use a stripped-down indexOf if we can't use a native one + indexOf = arr.indexOf || function( elem ) { var i = 0, - len = list.length; + len = this.length; for ( ; i < len; i++ ) { - if ( list[i] === elem ) { + if ( this[i] === elem ) { return i; } } @@ -670,26 +676,19 @@ var i, // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), - // 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 + - "*\\]", + // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", - 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) - ".*" + - ")\\)|)", + // 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 ) + ")*)|.*)\\)|)", // 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 + "*" ), @@ -732,7 +731,7 @@ var i, funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint - // Support: Firefox<24 + // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : @@ -741,14 +740,6 @@ var i, 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 ) @@ -791,18 +782,19 @@ function Sizzle( selector, context, results, seed ) { context = context || document; results = results || []; - nodeType = context.nodeType; - - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + if ( !selector || typeof selector !== "string" ) { return results; } - if ( !seed && documentIsHTML ) { + if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { + return []; + } - // Try to shortcut find operations when possible (e.g., not under DocumentFragment) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + if ( documentIsHTML && !seed ) { + + // Shortcuts + if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { @@ -834,7 +826,7 @@ function Sizzle( selector, context, results, seed ) { return results; // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName ) { + } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } @@ -844,7 +836,7 @@ function Sizzle( selector, context, results, seed ) { if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; - newSelector = nodeType !== 1 && selector; + newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root @@ -1031,7 +1023,7 @@ function createPositionalPseudo( fn ) { * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; + return context && typeof context.getElementsByTagName !== strundefined && context; } // Expose support vars for convenience @@ -1055,8 +1047,9 @@ isXML = Sizzle.isXML = function( elem ) { * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, parent, - doc = node ? node.ownerDocument || node : preferredDoc; + var hasCompare, + doc = node ? node.ownerDocument || node : preferredDoc, + parent = doc.defaultView; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { @@ -1066,7 +1059,9 @@ setDocument = Sizzle.setDocument = function( node ) { // 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, @@ -1075,22 +1070,21 @@ setDocument = Sizzle.setDocument = function( node ) { if ( parent && parent !== parent.top ) { // IE11 does not have attachEvent, so all must suffer if ( parent.addEventListener ) { - parent.addEventListener( "unload", unloadHandler, false ); + parent.addEventListener( "unload", function() { + setDocument(); + }, false ); } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", unloadHandler ); + parent.attachEvent( "onunload", function() { + setDocument(); + }); } } - /* 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"); @@ -1105,8 +1099,17 @@ setDocument = Sizzle.setDocument = function( node ) { return !div.getElementsByTagName("*").length; }); - // Support: IE<9 - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); + // Check if getElementsByClassName can be trusted + support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { + div.innerHTML = "
"; + + // 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 @@ -1120,11 +1123,11 @@ setDocument = Sizzle.setDocument = function( node ) { // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + if ( typeof context.getElementById !== strundefined && 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 ) { @@ -1141,7 +1144,7 @@ setDocument = Sizzle.setDocument = function( node ) { Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; @@ -1150,20 +1153,14 @@ setDocument = Sizzle.setDocument = function( node ) { // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { + if ( typeof context.getElementsByTagName !== strundefined ) { 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 @@ -1181,7 +1178,7 @@ setDocument = Sizzle.setDocument = function( node ) { // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( documentIsHTML ) { + if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; @@ -1210,15 +1207,11 @@ setDocument = Sizzle.setDocument = function( node ) { // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 - docElem.appendChild( div ).innerHTML = "" + - ""; + div.innerHTML = ""; - // Support: IE8, Opera 11-12.16 + // Support: IE8, Opera 10-12 // Nothing should be selected when empty strings follow ^= or $= or *= - // 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 ) { + if ( div.querySelectorAll("[t^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } @@ -1228,24 +1221,12 @@ setDocument = Sizzle.setDocument = function( node ) { 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 ) { @@ -1273,8 +1254,7 @@ setDocument = Sizzle.setDocument = function( node ) { }); } - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || + if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { @@ -1362,7 +1342,7 @@ setDocument = Sizzle.setDocument = function( node ) { // Maintain original order return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } @@ -1389,7 +1369,7 @@ setDocument = Sizzle.setDocument = function( node ) { aup ? -1 : bup ? 1 : sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check @@ -1452,10 +1432,10 @@ Sizzle.matchesSelector = function( elem, expr ) { 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 ) { @@ -1584,7 +1564,7 @@ Expr = Sizzle.selectors = { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; @@ -1627,15 +1607,15 @@ Expr = Sizzle.selectors = { "PSEUDO": function( match ) { var excess, - unquoted = !match[6] && match[2]; + unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; + if ( match[3] && match[4] !== undefined ) { + match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && @@ -1671,7 +1651,7 @@ Expr = Sizzle.selectors = { return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, @@ -1693,7 +1673,7 @@ Expr = Sizzle.selectors = { operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; @@ -1813,7 +1793,7 @@ Expr = Sizzle.selectors = { matched = fn( seed, argument ), i = matched.length; while ( i-- ) { - idx = indexOf( seed, matched[i] ); + idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : @@ -1852,8 +1832,6 @@ Expr = Sizzle.selectors = { 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(); }; }), @@ -1865,7 +1843,6 @@ Expr = Sizzle.selectors = { }), "contains": markFunction(function( text ) { - text = text.replace( runescape, funescape ); return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; @@ -2043,7 +2020,7 @@ function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { +function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; @@ -2108,7 +2085,7 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) { Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); -}; +} function toSelector( tokens ) { var i = 0, @@ -2187,15 +2164,6 @@ function elementMatcher( matchers ) { 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 = [], @@ -2287,7 +2255,7 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } @@ -2322,16 +2290,13 @@ function matcherFromTokens( tokens ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; + return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + return ( !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++ ) { @@ -2467,7 +2432,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { superMatcher; } -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { +compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], @@ -2475,12 +2440,12 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { if ( !cached ) { // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); + if ( !group ) { + group = tokenize( selector ); } - i = match.length; + i = group.length; while ( i-- ) { - cached = matcherFromTokens( match[i] ); + cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { @@ -2490,83 +2455,74 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; } return cached; }; -/** - * 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 ) { +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 ) { var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); + match = tokenize( selector ); - results = results || []; + if ( !seed ) { + // Try to minimize operations if there is only one group + if ( match.length === 1 ) { - // Try to minimize operations if there is no seed and only one group - if ( match.length === 1 ) { + // 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 ] ) { - // 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; + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + } + selector = selector.slice( tokens.shift().value.length ); } - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // 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 - )) ) { - - // 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; - } + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + // 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 + )) ) { + + // 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 if one is not provided + // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( + compile( selector, match )( seed, context, !documentIsHTML, @@ -2574,14 +2530,14 @@ select = Sizzle.select = function( selector, context, results, seed ) { 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-35+ +// Support: Chrome<14 // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = !!hasDuplicate; @@ -3467,9 +3423,8 @@ jQuery.extend({ readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - jQuery( document ).off( "ready" ); + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger("ready").off("ready"); } } }); @@ -3577,21 +3532,23 @@ support.ownLast = i !== "0"; // false until the test is run support.inlineBlockNeedsLayout = false; -// Execute ASAP in case we need to set body.style.zoom jQuery(function() { - // Minified: var a,b,c,d - var val, div, body, container; + // We need to execute this one support test ASAP because we need to know + // if body.style.zoom needs to be set. - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body || !body.style ) { + var container, div, + body = document.getElementsByTagName("body")[0]; + + if ( !body ) { // Return for frameset docs that don't have a body return; } // Setup - div = document.createElement( "div" ); container = document.createElement( "div" ); - container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; + + div = document.createElement( "div" ); body.appendChild( container ).appendChild( div ); if ( typeof div.style.zoom !== strundefined ) { @@ -3599,10 +3556,9 @@ jQuery(function() { // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout - div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; + div.style.cssText = "border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1"; - support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; - if ( val ) { + if ( (support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 )) ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 @@ -3611,6 +3567,9 @@ jQuery(function() { } body.removeChild( container ); + + // Null elements to avoid leaks in IE + container = div = null; }); @@ -3933,15 +3892,12 @@ jQuery.fn.extend({ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { i = attrs.length; while ( i-- ) { + name = attrs[i].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 ] ); - } + if ( name.indexOf("data-") === 0 ) { + name = jQuery.camelCase( name.slice(5) ); + + dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); @@ -4181,13 +4137,13 @@ var rcheckableType = (/^(?:checkbox|radio)$/i); (function() { - // Minified: var a,b,c - var input = document.createElement( "input" ), - div = document.createElement( "div" ), - fragment = document.createDocumentFragment(); + var fragment = document.createDocumentFragment(), + div = document.createElement("div"), + input = document.createElement("input"); // Setup - div.innerHTML = "
a"; + div.setAttribute( "className", "t" ); + div.innerHTML = "
a"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; @@ -4247,6 +4203,9 @@ var rcheckableType = (/^(?:checkbox|radio)$/i); support.deleteExpando = false; } } + + // Null elements to avoid leaks in IE. + fragment = div = input = null; })(); @@ -4272,7 +4231,7 @@ var rcheckableType = (/^(?:checkbox|radio)$/i); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, + rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; @@ -4875,9 +4834,8 @@ jQuery.event = { beforeunload: { postDispatch: function( event ) { - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { + // Even when returnValue equals to undefined Firefox will still show alert + if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } @@ -4943,9 +4901,11 @@ jQuery.Event = function( src, props ) { // 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, Android < 4.0 - src.returnValue === false ? + src.defaultPrevented === undefined && ( + // Support: IE < 9 + src.returnValue === false || + // Support: Android < 4.0 + src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; @@ -5008,14 +4968,7 @@ jQuery.Event.prototype = { e.cancelBubble = true; }, stopImmediatePropagation: function() { - var e = this.originalEvent; - this.isImmediatePropagationStopped = returnTrue; - - if ( e && e.stopImmediatePropagation ) { - e.stopImmediatePropagation(); - } - this.stopPropagation(); } }; @@ -5023,9 +4976,7 @@ jQuery.Event.prototype = { // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" + mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, @@ -6029,15 +5980,14 @@ var iframe, */ // Called only from within defaultDisplay function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? + display = window.getDefaultComputedStyle ? // 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 - style.display : jQuery.css( elem[ 0 ], "display" ); + window.getDefaultComputedStyle( elem[ 0 ] ).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 @@ -6083,47 +6033,68 @@ function defaultDisplay( nodeName ) { (function() { - var shrinkWrapBlocksVal; + 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"; + + // 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() { - if ( shrinkWrapBlocksVal != null ) { - return shrinkWrapBlocksVal; + var body, container, div, containerStyles; + + if ( shrinkWrapBlocksVal == null ) { + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body ) { + // Test fired too early or in an unsupported environment, exit. + return; + } + + containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px"; + container = document.createElement( "div" ); + div = document.createElement( "div" ); + + body.appendChild( container ).appendChild( div ); + + // Will be changed later if needed. + shrinkWrapBlocksVal = false; + + 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; } - // Will be changed later if needed. - shrinkWrapBlocksVal = false; - - // Minified: var b,c,d - var div, body, container; - - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body || !body.style ) { - // Test fired too early or in an unsupported environment, exit. - return; - } - - // 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 ); - - // 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; }; @@ -6139,14 +6110,7 @@ var getStyles, curCSS, if ( window.getComputedStyle ) { getStyles = function( elem ) { - // 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 ); + return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); }; curCSS = function( elem, name, computed ) { @@ -6278,46 +6242,92 @@ function addGetHookIf( conditionFn, hookFn ) { (function() { - // Minified: var b,c,d,e,f,g, h,i - var div, style, a, pixelPositionVal, boxSizingReliableVal, - reliableHiddenOffsetsVal, reliableMarginRightVal; + 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"; // Setup - div = document.createElement( "div" ); div.innerHTML = "
a"; a = div.getElementsByTagName( "a" )[ 0 ]; - style = a && a.style; - // Finish early in limited (non-browser) environments - if ( !style ) { - return; - } + a.style.cssText = "float:left;opacity:.5"; - 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"; + // 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 = !!style.cssFloat; + support.cssFloat = !!a.style.cssFloat; div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; - // Support: Firefox<29, Android 2.3 - // Vendor-prefix box-sizing - support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" || - style.WebkitBoxSizing === ""; + // Null elements to avoid leaks in IE. + a = div = null; jQuery.extend(support, { reliableHiddenOffsets: function() { - if ( reliableHiddenOffsetsVal == null ) { + if ( reliableHiddenOffsetsVal != null ) { + return reliableHiddenOffsetsVal; + } + + 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 reliableHiddenOffsetsVal; + return boxSizingVal; }, boxSizingReliable: function() { @@ -6334,88 +6344,84 @@ function addGetHookIf( conditionFn, hookFn ) { return pixelPositionVal; }, - // Support: Android 2.3 reliableMarginRight: function() { - if ( reliableMarginRightVal == null ) { - computeStyleTests(); + 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 ); } + return reliableMarginRightVal; } }); function computeStyleTests() { - // Minified: var b,c,d,j - var div, body, container, contents; + var container, div, + body = document.getElementsByTagName( "body" )[ 0 ]; - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body || !body.style ) { + if ( !body ) { // Test fired too early or in an unsupported environment, exit. return; } - // Setup - div = document.createElement( "div" ); container = document.createElement( "div" ); - container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + div = document.createElement( "div" ); + container.style.cssText = containerStyles; + body.appendChild( container ).appendChild( div ); div.style.cssText = - // 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"; + "-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: IE<9 - // Assume reasonable values in the absence of getComputedStyle - pixelPositionVal = boxSizingReliableVal = false; + // 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; reliableMarginRightVal = true; - // Check for getComputedStyle so that this code is not run in IE<9. + // Use window.getComputedStyle because jsdom on node.js will break without it. 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 ); - } - - // 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; } body.removeChild( container ); + + // Null elements to avoid leaks in IE. + div = body = null; } })(); @@ -6455,8 +6461,8 @@ var cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" + letterSpacing: 0, + fontWeight: 400 }, cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; @@ -6513,10 +6519,13 @@ function showHide( elements, show ) { values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); } } else { - hidden = isHidden( elem ); - if ( display && display !== "none" || !hidden ) { - jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); + if ( !values[ index ] ) { + hidden = isHidden( elem ); + + if ( display && display !== "none" || !hidden ) { + jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); + } } } } @@ -6589,7 +6598,7 @@ function getWidthOrHeight( elem, name, extra ) { 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 @@ -6645,8 +6654,6 @@ jQuery.extend({ cssNumber: { "columnCount": true, "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, "fontWeight": true, "lineHeight": true, "opacity": true, @@ -6715,6 +6722,9 @@ jQuery.extend({ // 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) {} } @@ -6771,7 +6781,7 @@ jQuery.each([ "height", "width" ], function( i, name ) { 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 rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? + return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : @@ -6786,7 +6796,7 @@ jQuery.each([ "height", "width" ], function( i, name ) { 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 ); @@ -7135,7 +7145,7 @@ function createTween( value, prop, animation ) { function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ - var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, + var prop, value, toggle, tween, hooks, oldfire, display, dDisplay, anim = this, orig = {}, style = elem.style, @@ -7179,16 +7189,16 @@ function defaultPrefilter( elem, props, opts ) { // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated display = jQuery.css( elem, "display" ); - - // 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" ) { + dDisplay = defaultDisplay( elem.nodeName ); + if ( display === "none" ) { + display = dDisplay; + } + if ( display === "inline" && + jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout - if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { + if ( !support.inlineBlockNeedsLayout || dDisplay === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; @@ -7223,10 +7233,6 @@ function defaultPrefilter( elem, props, opts ) { } } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - - // Any non-fx value stops us from restoring the original display value - } else { - display = undefined; } } @@ -7268,10 +7274,6 @@ function defaultPrefilter( elem, props, opts ) { } } } - - // 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; } } @@ -7688,11 +7690,10 @@ jQuery.fn.delay = function( time, type ) { (function() { - // Minified: var a,b,c,d,e - var input, div, select, a, opt; + var a, input, select, opt, + div = document.createElement("div" ); // Setup - div = document.createElement( "div" ); div.setAttribute( "className", "t" ); div.innerHTML = "
a"; a = div.getElementsByTagName("a")[ 0 ]; @@ -7740,6 +7741,9 @@ jQuery.fn.delay = function( time, type ) { 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; })(); @@ -7813,9 +7817,7 @@ jQuery.extend({ var val = jQuery.find.attr( elem, "value" ); return val != null ? val : - // Support: IE10-11+ - // option.text throws exceptions (#14686, #14858) - jQuery.trim( jQuery.text( elem ) ); + jQuery.text( elem ); } }, select: { @@ -9103,8 +9105,7 @@ jQuery.extend({ } // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; + fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { @@ -9363,6 +9364,13 @@ jQuery.each( [ "get", "post" ], function( i, method ) { }; }); +// 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({ @@ -9588,9 +9596,8 @@ var xhrId = 0, // Support: IE<10 // Open requests must be manually aborted on unload (#5280) -// See https://support.microsoft.com/kb/2856746 for more info -if ( window.attachEvent ) { - window.attachEvent( "onunload", function() { +if ( window.ActiveXObject ) { + jQuery( window ).on( "unload", function() { for ( var key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } @@ -9974,7 +9981,7 @@ jQuery.fn.load = function( url, params, callback ) { off = url.indexOf(" "); if ( off >= 0 ) { - selector = jQuery.trim( url.slice( off, url.length ) ); + selector = url.slice( off, url.length ); url = url.slice( 0, off ); } @@ -10024,16 +10031,6 @@ jQuery.fn.load = function( url, params, callback ) { -// 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; @@ -10297,12 +10294,6 @@ jQuery.fn.andSelf = jQuery.fn.addBack; // 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;