15 (
function( global, factory ) {
17 if ( typeof module ===
"object" && typeof module.exports ===
"object" ) {
25 module.exports = global.document ?
26 factory( global,
true ) :
29 throw new Error(
"jQuery requires a window with a document" );
38 }(typeof window !==
"undefined" ? window :
this,
function( window, noGlobal ) {
47 var document = window.document;
49 var slice = arr.slice;
51 var concat = arr.concat;
55 var indexOf = arr.indexOf;
59 var toString = class2type.toString;
61 var hasOwn = class2type.hasOwnProperty;
71 jQuery =
function( selector, context ) {
75 return new jQuery.fn.init( selector, context );
80 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
84 rdashAlpha = /-([\da-z])/gi,
87 fcamelCase =
function( all, letter ) {
88 return letter.toUpperCase();
91 jQuery.fn = jQuery.prototype = {
104 toArray:
function() {
105 return slice.call(
this );
110 get:
function( num ) {
114 ( num < 0 ?
this[ num + this.length ] :
this[ num ] ) :
122 pushStack:
function( elems ) {
125 var ret = jQuery.merge( this.constructor(), elems );
128 ret.prevObject =
this;
129 ret.context = this.context;
136 each:
function( callback ) {
137 return jQuery.each(
this, callback );
140 map:
function( callback ) {
141 return this.pushStack( jQuery.map(
this,
function( elem, i ) {
142 return callback.call( elem, i, elem );
147 return this.pushStack( slice.apply(
this, arguments ) );
155 return this.eq( -1 );
159 var len = this.length,
160 j = +i + ( i < 0 ? len : 0 );
161 return this.pushStack( j >= 0 && j < len ? [
this[ j ] ] : [] );
165 return this.prevObject || this.constructor();
175 jQuery.extend = jQuery.fn.extend =
function() {
176 var options, name, src, copy, copyIsArray, clone,
177 target = arguments[ 0 ] || {},
179 length = arguments.length,
183 if ( typeof target ===
"boolean" ) {
187 target = arguments[ i ] || {};
192 if ( typeof target !==
"object" && !jQuery.isFunction( target ) ) {
197 if ( i === length ) {
202 for ( ; i < length; i++ ) {
205 if ( ( options = arguments[ i ] ) != null ) {
208 for ( name in options ) {
209 src = target[ name ];
210 copy = options[ name ];
213 if ( target === copy ) {
218 if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
219 ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
223 clone = src && jQuery.isArray( src ) ? src : [];
226 clone = src && jQuery.isPlainObject( src ) ? src : {};
230 target[ name ] = jQuery.extend( deep, clone, copy );
233 }
else if ( copy !== undefined ) {
234 target[ name ] = copy;
247 expando:
"jQuery" + ( version + Math.random() ).replace( /\D/g,
"" ),
252 error:
function( msg ) {
253 throw new Error( msg );
258 isFunction:
function( obj ) {
259 return jQuery.type( obj ) ===
"function";
262 isArray: Array.isArray,
264 isWindow:
function( obj ) {
265 return obj != null && obj === obj.window;
268 isNumeric:
function( obj ) {
274 var realStringObj = obj && obj.toString();
275 return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
278 isPlainObject:
function( obj ) {
285 if ( jQuery.type( obj ) !==
"object" || obj.nodeType || jQuery.isWindow( obj ) ) {
290 if ( obj.constructor &&
291 !hasOwn.call( obj,
"constructor" ) &&
292 !hasOwn.call( obj.constructor.prototype || {},
"isPrototypeOf" ) ) {
298 for ( key in obj ) {}
300 return key === undefined || hasOwn.call( obj, key );
303 isEmptyObject:
function( obj ) {
305 for ( name in obj ) {
311 type:
function( obj ) {
317 return typeof obj ===
"object" || typeof obj ===
"function" ?
318 class2type[ toString.call( obj ) ] ||
"object" :
323 globalEval:
function( code ) {
327 code = jQuery.trim( code );
334 if ( code.indexOf(
"use strict" ) === 1 ) {
335 script = document.createElement(
"script" );
337 document.head.appendChild( script ).parentNode.removeChild( script );
351 camelCase:
function( string ) {
352 return string.replace( rmsPrefix,
"ms-" ).replace( rdashAlpha, fcamelCase );
355 nodeName:
function( elem, name ) {
356 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
359 each:
function( obj, callback ) {
362 if ( isArrayLike( obj ) ) {
364 for ( ; i < length; i++ ) {
365 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
371 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
381 trim:
function( text ) {
382 return text == null ?
384 ( text +
"" ).replace( rtrim,
"" );
388 makeArray:
function( arr, results ) {
389 var ret = results || [];
392 if ( isArrayLike( Object( arr ) ) ) {
394 typeof arr ===
"string" ?
398 push.call( ret, arr );
405 inArray:
function( elem, arr, i ) {
406 return arr == null ? -1 : indexOf.call( arr, elem, i );
409 merge:
function( first, second ) {
410 var len = +second.length,
414 for ( ; j < len; j++ ) {
415 first[ i++ ] = second[ j ];
423 grep:
function( elems, callback, invert ) {
427 length = elems.length,
428 callbackExpect = !invert;
432 for ( ; i < length; i++ ) {
433 callbackInverse = !callback( elems[ i ], i );
434 if ( callbackInverse !== callbackExpect ) {
435 matches.push( elems[ i ] );
443 map:
function( elems, callback, arg ) {
449 if ( isArrayLike( elems ) ) {
450 length = elems.length;
451 for ( ; i < length; i++ ) {
452 value = callback( elems[ i ], i, arg );
454 if ( value != null ) {
462 value = callback( elems[ i ], i, arg );
464 if ( value != null ) {
471 return concat.apply( [], ret );
479 proxy:
function( fn, context ) {
480 var tmp, args, proxy;
482 if ( typeof context ===
"string" ) {
490 if ( !jQuery.isFunction( fn ) ) {
495 args = slice.call( arguments, 2 );
497 return fn.apply( context ||
this, args.concat( slice.call( arguments ) ) );
501 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
518 if ( typeof Symbol ===
"function" ) {
519 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
524 jQuery.each(
"Boolean Number String Function Array Date RegExp Object Error Symbol".split(
" " ),
525 function( i, name ) {
526 class2type[
"[object " + name +
"]" ] = name.toLowerCase();
529 function isArrayLike( obj ) {
535 var length = !!obj &&
"length" in obj && obj.length,
536 type = jQuery.type( obj );
538 if ( type ===
"function" || jQuery.isWindow( obj ) ) {
542 return type ===
"array" || length === 0 ||
543 typeof length ===
"number" && length > 0 && ( length - 1 ) in obj;
556 (
function( window ) {
581 expando =
"sizzle" + 1 *
new Date(),
582 preferredDoc = window.document,
585 classCache = createCache(),
586 tokenCache = createCache(),
587 compilerCache = createCache(),
588 sortOrder =
function( a, b ) {
596 MAX_NEGATIVE = 1 << 31,
599 hasOwn = ({}).hasOwnProperty,
602 push_native = arr.push,
607 indexOf =
function( list, elem ) {
610 for ( ; i < len; i++ ) {
611 if ( list[i] === elem ) {
618 booleans =
"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
623 whitespace =
"[\\x20\\t\\r\\n\\f]",
626 identifier =
"(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
629 attributes =
"\\[" + whitespace +
"*(" + identifier +
")(?:" + whitespace +
631 "*([*^$|!~]?=)" + whitespace +
633 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier +
"))|)" + whitespace +
636 pseudos =
":(" + identifier +
")(?:\\((" +
639 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
641 "((?:\\\\.|[^\\\\()[\\]]|" + attributes +
")*)|" +
647 rwhitespace =
new RegExp( whitespace +
"+",
"g" ),
648 rtrim =
new RegExp(
"^" + whitespace +
"+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace +
"+$",
"g" ),
650 rcomma =
new RegExp(
"^" + whitespace +
"*," + whitespace +
"*" ),
651 rcombinators =
new RegExp(
"^" + whitespace +
"*([>+~]|" + whitespace +
")" + whitespace +
"*" ),
653 rattributeQuotes =
new RegExp(
"=" + whitespace +
"*([^\\]'\"]*?)" + whitespace +
"*\\]",
"g" ),
655 rpseudo =
new RegExp( pseudos ),
656 ridentifier =
new RegExp(
"^" + identifier +
"$" ),
659 "ID":
new RegExp(
"^#(" + identifier +
")" ),
660 "CLASS":
new RegExp(
"^\\.(" + identifier +
")" ),
661 "TAG":
new RegExp(
"^(" + identifier +
"|[*])" ),
662 "ATTR":
new RegExp(
"^" + attributes ),
663 "PSEUDO":
new RegExp(
"^" + pseudos ),
664 "CHILD":
new RegExp(
"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
665 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace +
"*(?:([+-]|)" + whitespace +
666 "*(\\d+)|))" + whitespace +
"*\\)|)",
"i" ),
667 "bool":
new RegExp(
"^(?:" + booleans +
")$",
"i" ),
670 "needsContext":
new RegExp(
"^" + whitespace +
"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
671 whitespace +
"*((?:-\\d)?\\d*)" + whitespace +
"*\\)|)(?=[^-]|$)",
"i" )
674 rinputs = /^(?:input|select|textarea|button)$/i,
677 rnative = /^[^{]+\{\s*\[native \w/,
680 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
685 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
686 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
687 funescape = function( _, escaped, escapedWhitespace ) {
688 var high = "0x" + escaped - 0x10000;
689 // NaN means non-codepoint
690 // Support: Firefox<24
691 // Workaround erroneous numeric interpretation of +"0x"
692 return high !== high || escapedWhitespace ?
696 String.fromCharCode( high + 0x10000 ) :
697 // Supplemental Plane codepoint (surrogate pair)
698 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
703 // Removing the function wrapper causes a "Permission Denied"
705 unloadHandler = function() {
709 // Optimize for push.apply( _, NodeList )
712 (arr = slice.call( preferredDoc.childNodes )),
713 preferredDoc.childNodes
715 // Support: Android<4.0
716 // Detect silently failing push.apply
717 arr[ preferredDoc.childNodes.length ].nodeType;
719 push = { apply: arr.length ?
721 // Leverage slice if possible
722 function( target, els ) {
723 push_native.apply( target, slice.call(els) );
727 // Otherwise append directly
728 function( target, els ) {
729 var j = target.length,
731 // Can't trust NodeList.length
732 while ( (target[j++] = els[i++]) ) {}
733 target.length = j - 1;
738 function Sizzle( selector, context, results, seed ) {
739 var m, i, elem, nid, nidselect, match, groups, newSelector,
740 newContext = context && context.ownerDocument,
743 nodeType = context ? context.nodeType : 9;
745 results = results || [];
748 if ( typeof selector !==
"string" || !selector ||
749 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
757 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
758 setDocument( context );
760 context = context || document;
762 if ( documentIsHTML ) {
766 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
769 if ( (m = match[1]) ) {
772 if ( nodeType === 9 ) {
773 if ( (elem = context.getElementById( m )) ) {
778 if ( elem.id === m ) {
779 results.push( elem );
792 if ( newContext && (elem = newContext.getElementById( m )) &&
793 contains( context, elem ) &&
796 results.push( elem );
802 }
else if ( match[2] ) {
803 push.apply( results, context.getElementsByTagName( selector ) );
807 }
else if ( (m = match[3]) && support.getElementsByClassName &&
808 context.getElementsByClassName ) {
810 push.apply( results, context.getElementsByClassName( m ) );
817 !compilerCache[ selector +
" " ] &&
818 (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
820 if ( nodeType !== 1 ) {
821 newContext = context;
822 newSelector = selector;
828 }
else if ( context.nodeName.toLowerCase() !==
"object" ) {
831 if ( (nid = context.getAttribute(
"id" )) ) {
832 nid = nid.replace( rescape,
"\\$&" );
834 context.setAttribute(
"id", (nid = expando) );
838 groups = tokenize( selector );
840 nidselect = ridentifier.test( nid ) ?
"#" + nid :
"[id='" + nid +
"']";
842 groups[i] = nidselect +
" " + toSelector( groups[i] );
844 newSelector = groups.join(
"," );
847 newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
854 newContext.querySelectorAll( newSelector )
857 }
catch ( qsaError ) {
859 if ( nid === expando ) {
860 context.removeAttribute(
"id" );
869 return select( selector.replace( rtrim,
"$1" ), context, results, seed );
878 function createCache() {
881 function cache( key, value ) {
883 if ( keys.push( key +
" " ) > Expr.cacheLength ) {
885 delete cache[ keys.shift() ];
887 return (cache[ key +
" " ] = value);
896 function markFunction( fn ) {
897 fn[ expando ] =
true;
905 function assert( fn ) {
906 var div = document.createElement(
"div");
914 if ( div.parentNode ) {
915 div.parentNode.removeChild( div );
927 function addHandle( attrs, handler ) {
928 var arr = attrs.split(
"|"),
932 Expr.attrHandle[ arr[i] ] = handler;
942 function siblingCheck( a, b ) {
944 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
945 ( ~b.sourceIndex || MAX_NEGATIVE ) -
946 ( ~a.sourceIndex || MAX_NEGATIVE );
955 while ( (cur = cur.nextSibling) ) {
969 function createInputPseudo( type ) {
970 return function( elem ) {
971 var name = elem.nodeName.toLowerCase();
972 return name ===
"input" && elem.type === type;
980 function createButtonPseudo( type ) {
981 return function( elem ) {
982 var name = elem.nodeName.toLowerCase();
983 return (name ===
"input" || name ===
"button") && elem.type === type;
991 function createPositionalPseudo( fn ) {
992 return markFunction(
function( argument ) {
993 argument = +argument;
994 return markFunction(
function( seed, matches ) {
996 matchIndexes = fn( [], seed.length, argument ),
997 i = matchIndexes.length;
1001 if ( seed[ (j = matchIndexes[i]) ] ) {
1002 seed[j] = !(matches[j] = seed[j]);
1014 function testContext( context ) {
1015 return context && typeof context.getElementsByTagName !==
"undefined" && context;
1019 support = Sizzle.support = {};
1026 isXML = Sizzle.isXML =
function( elem ) {
1029 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1030 return documentElement ? documentElement.nodeName !==
"HTML" :
false;
1038 setDocument = Sizzle.setDocument =
function( node ) {
1039 var hasCompare, parent,
1040 doc = node ? node.ownerDocument || node : preferredDoc;
1043 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1049 docElem = document.documentElement;
1050 documentIsHTML = !isXML( document );
1054 if ( (parent = document.defaultView) && parent.top !== parent ) {
1056 if ( parent.addEventListener ) {
1057 parent.addEventListener(
"unload", unloadHandler,
false );
1060 }
else if ( parent.attachEvent ) {
1061 parent.attachEvent(
"onunload", unloadHandler );
1071 support.attributes = assert(
function( div ) {
1072 div.className =
"i";
1073 return !div.getAttribute(
"className");
1080 support.getElementsByTagName = assert(
function( div ) {
1081 div.appendChild( document.createComment(
"") );
1082 return !div.getElementsByTagName(
"*").length;
1086 support.getElementsByClassName = rnative.test( document.getElementsByClassName );
1092 support.getById = assert(
function( div ) {
1093 docElem.appendChild( div ).id = expando;
1094 return !document.getElementsByName || !document.getElementsByName( expando ).length;
1098 if ( support.getById ) {
1099 Expr.find[
"ID"] =
function( id, context ) {
1100 if ( typeof context.getElementById !==
"undefined" && documentIsHTML ) {
1101 var m = context.getElementById(
id );
1102 return m ? [ m ] : [];
1105 Expr.filter[
"ID"] =
function( id ) {
1106 var attrId =
id.replace( runescape, funescape );
1107 return function( elem ) {
1108 return elem.getAttribute(
"id") === attrId;
1114 delete Expr.find[
"ID"];
1116 Expr.filter[
"ID"] =
function( id ) {
1117 var attrId =
id.replace( runescape, funescape );
1118 return function( elem ) {
1119 var node = typeof elem.getAttributeNode !==
"undefined" &&
1120 elem.getAttributeNode(
"id");
1121 return node && node.value === attrId;
1127 Expr.find[
"TAG"] = support.getElementsByTagName ?
1128 function( tag, context ) {
1129 if ( typeof context.getElementsByTagName !==
"undefined" ) {
1130 return context.getElementsByTagName( tag );
1133 }
else if ( support.qsa ) {
1134 return context.querySelectorAll( tag );
1138 function( tag, context ) {
1143 results = context.getElementsByTagName( tag );
1146 if ( tag ===
"*" ) {
1147 while ( (elem = results[i++]) ) {
1148 if ( elem.nodeType === 1 ) {
1159 Expr.find[
"CLASS"] = support.getElementsByClassName &&
function( className, context ) {
1160 if ( typeof context.getElementsByClassName !==
"undefined" && documentIsHTML ) {
1161 return context.getElementsByClassName( className );
1180 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
1183 assert(
function( div ) {
1189 docElem.appendChild( div ).innerHTML =
"<a id='" + expando +
"'></a>" +
1190 "<select id='" + expando +
"-\r\\' msallowcapture=''>" +
1191 "<option selected=''></option></select>";
1197 if ( div.querySelectorAll(
"[msallowcapture^='']").length ) {
1198 rbuggyQSA.push(
"[*^$]=" + whitespace +
"*(?:''|\"\")" );
1203 if ( !div.querySelectorAll(
"[selected]").length ) {
1204 rbuggyQSA.push(
"\\[" + whitespace +
"*(?:value|" + booleans +
")" );
1208 if ( !div.querySelectorAll(
"[id~=" + expando +
"-]" ).length ) {
1209 rbuggyQSA.push(
"~=");
1215 if ( !div.querySelectorAll(
":checked").length ) {
1216 rbuggyQSA.push(
":checked");
1222 if ( !div.querySelectorAll(
"a#" + expando +
"+*" ).length ) {
1223 rbuggyQSA.push(
".#.+[+~]");
1227 assert(
function( div ) {
1230 var input = document.createElement(
"input");
1231 input.setAttribute(
"type",
"hidden" );
1232 div.appendChild( input ).setAttribute(
"name",
"D" );
1236 if ( div.querySelectorAll(
"[name=d]").length ) {
1237 rbuggyQSA.push(
"name" + whitespace +
"*[*^$|!~]?=" );
1242 if ( !div.querySelectorAll(
":enabled").length ) {
1243 rbuggyQSA.push(
":enabled",
":disabled" );
1247 div.querySelectorAll(
"*,:x");
1248 rbuggyQSA.push(
",.*:");
1252 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1253 docElem.webkitMatchesSelector ||
1254 docElem.mozMatchesSelector ||
1255 docElem.oMatchesSelector ||
1256 docElem.msMatchesSelector) )) ) {
1258 assert(
function( div ) {
1261 support.disconnectedMatch = matches.call( div,
"div" );
1265 matches.call( div,
"[s!='']:x" );
1266 rbuggyMatches.push(
"!=", pseudos );
1270 rbuggyQSA = rbuggyQSA.length &&
new RegExp( rbuggyQSA.join(
"|") );
1271 rbuggyMatches = rbuggyMatches.length &&
new RegExp( rbuggyMatches.join(
"|") );
1275 hasCompare = rnative.test( docElem.compareDocumentPosition );
1280 contains = hasCompare || rnative.test( docElem.contains ) ?
1282 var adown = a.nodeType === 9 ? a.documentElement : a,
1283 bup = b && b.parentNode;
1284 return a === bup || !!( bup && bup.nodeType === 1 && (
1286 adown.contains( bup ) :
1287 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1292 while ( (b = b.parentNode) ) {
1305 sortOrder = hasCompare ?
1310 hasDuplicate =
true;
1315 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1321 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1322 a.compareDocumentPosition( b ) :
1329 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1332 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1335 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1341 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1345 return compare & 4 ? -1 : 1;
1350 hasDuplicate =
true;
1362 if ( !aup || !bup ) {
1363 return a === document ? -1 :
1364 b === document ? 1 :
1368 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1372 }
else if ( aup === bup ) {
1373 return siblingCheck( a, b );
1378 while ( (cur = cur.parentNode) ) {
1382 while ( (cur = cur.parentNode) ) {
1387 while ( ap[i] === bp[i] ) {
1393 siblingCheck( ap[i], bp[i] ) :
1396 ap[i] === preferredDoc ? -1 :
1397 bp[i] === preferredDoc ? 1 :
1404 Sizzle.matches =
function( expr, elements ) {
1405 return Sizzle( expr, null, null, elements );
1408 Sizzle.matchesSelector =
function( elem, expr ) {
1410 if ( ( elem.ownerDocument || elem ) !== document ) {
1411 setDocument( elem );
1415 expr = expr.replace( rattributeQuotes,
"='$1']" );
1417 if ( support.matchesSelector && documentIsHTML &&
1418 !compilerCache[ expr +
" " ] &&
1419 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1420 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1423 var ret = matches.call( elem, expr );
1426 if ( ret || support.disconnectedMatch ||
1429 elem.document && elem.document.nodeType !== 11 ) {
1435 return Sizzle( expr, document, null, [ elem ] ).length > 0;
1438 Sizzle.contains =
function( context, elem ) {
1440 if ( ( context.ownerDocument || context ) !== document ) {
1441 setDocument( context );
1443 return contains( context, elem );
1446 Sizzle.attr =
function( elem, name ) {
1448 if ( ( elem.ownerDocument || elem ) !== document ) {
1449 setDocument( elem );
1452 var fn = Expr.attrHandle[ name.toLowerCase() ],
1454 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1455 fn( elem, name, !documentIsHTML ) :
1458 return val !== undefined ?
1460 support.attributes || !documentIsHTML ?
1461 elem.getAttribute( name ) :
1462 (val = elem.getAttributeNode(name)) && val.specified ?
1467 Sizzle.error =
function( msg ) {
1468 throw new Error(
"Syntax error, unrecognized expression: " + msg );
1475 Sizzle.uniqueSort =
function( results ) {
1482 hasDuplicate = !support.detectDuplicates;
1483 sortInput = !support.sortStable && results.slice( 0 );
1484 results.sort( sortOrder );
1486 if ( hasDuplicate ) {
1487 while ( (elem = results[i++]) ) {
1488 if ( elem === results[ i ] ) {
1489 j = duplicates.push( i );
1493 results.splice( duplicates[ j ], 1 );
1508 getText = Sizzle.getText =
function( elem ) {
1512 nodeType = elem.nodeType;
1516 while ( (node = elem[i++]) ) {
1518 ret += getText( node );
1520 }
else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1523 if ( typeof elem.textContent ===
"string" ) {
1524 return elem.textContent;
1527 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1528 ret += getText( elem );
1531 }
else if ( nodeType === 3 || nodeType === 4 ) {
1532 return elem.nodeValue;
1539 Expr = Sizzle.selectors = {
1544 createPseudo: markFunction,
1553 ">": { dir:
"parentNode", first:
true },
1554 " ": { dir:
"parentNode" },
1555 "+": { dir:
"previousSibling", first:
true },
1556 "~": { dir:
"previousSibling" }
1560 "ATTR":
function( match ) {
1561 match[1] = match[1].replace( runescape, funescape );
1564 match[3] = ( match[3] || match[4] || match[5] ||
"" ).replace( runescape, funescape );
1566 if ( match[2] ===
"~=" ) {
1567 match[3] =
" " + match[3] +
" ";
1570 return match.slice( 0, 4 );
1573 "CHILD":
function( match ) {
1584 match[1] = match[1].toLowerCase();
1586 if ( match[1].slice( 0, 3 ) ===
"nth" ) {
1589 Sizzle.error( match[0] );
1594 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] ===
"even" || match[3] ===
"odd" ) );
1595 match[5] = +( ( match[7] + match[8] ) || match[3] ===
"odd" );
1598 }
else if ( match[3] ) {
1599 Sizzle.error( match[0] );
1605 "PSEUDO":
function( match ) {
1607 unquoted = !match[6] && match[2];
1609 if ( matchExpr[
"CHILD"].test( match[0] ) ) {
1615 match[2] = match[4] || match[5] ||
"";
1618 }
else if ( unquoted && rpseudo.test( unquoted ) &&
1620 (excess = tokenize( unquoted,
true )) &&
1622 (excess = unquoted.indexOf(
")", unquoted.length - excess ) - unquoted.length) ) {
1625 match[0] = match[0].slice( 0, excess );
1626 match[2] = unquoted.slice( 0, excess );
1630 return match.slice( 0, 3 );
1636 "TAG":
function( nodeNameSelector ) {
1637 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1638 return nodeNameSelector ===
"*" ?
1639 function() {
return true; } :
1641 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1645 "CLASS":
function( className ) {
1646 var pattern = classCache[ className +
" " ];
1649 (pattern =
new RegExp(
"(^|" + whitespace +
")" + className +
"(" + whitespace +
"|$)" )) &&
1650 classCache( className,
function( elem ) {
1651 return pattern.test( typeof elem.className ===
"string" && elem.className || typeof elem.getAttribute !==
"undefined" && elem.getAttribute(
"class") ||
"" );
1655 "ATTR":
function( name,
operator, check ) {
1656 return function( elem ) {
1657 var result = Sizzle.attr( elem, name );
1659 if ( result == null ) {
1660 return operator ===
"!=";
1668 return operator ===
"=" ? result === check :
1669 operator ===
"!=" ? result !== check :
1670 operator ===
"^=" ? check && result.indexOf( check ) === 0 :
1671 operator ===
"*=" ? check && result.indexOf( check ) > -1 :
1672 operator ===
"$=" ? check && result.slice( -check.length ) === check :
1673 operator === "~=" ? (
" " + result.replace( rwhitespace,
" " ) +
" " ).indexOf( check ) > -1 :
1674 operator ===
"|=" ? result === check || result.slice( 0, check.length + 1 ) === check +
"-" :
1679 "CHILD":
function( type, what, argument, first, last ) {
1680 var simple = type.slice( 0, 3 ) !==
"nth",
1681 forward = type.slice( -4 ) !==
"last",
1682 ofType = what ===
"of-type";
1684 return first === 1 && last === 0 ?
1688 return !!elem.parentNode;
1691 function( elem, context, xml ) {
1692 var cache, uniqueCache, outerCache, node, nodeIndex, start,
1693 dir = simple !== forward ?
"nextSibling" :
"previousSibling",
1694 parent = elem.parentNode,
1695 name = ofType && elem.nodeName.toLowerCase(),
1696 useCache = !xml && !ofType,
1705 while ( (node = node[ dir ]) ) {
1707 node.nodeName.toLowerCase() === name :
1708 node.nodeType === 1 ) {
1714 start = dir = type ===
"only" && !start &&
"nextSibling";
1719 start = [ forward ? parent.firstChild : parent.lastChild ];
1722 if ( forward && useCache ) {
1728 outerCache = node[ expando ] || (node[ expando ] = {});
1732 uniqueCache = outerCache[ node.uniqueID ] ||
1733 (outerCache[ node.uniqueID ] = {});
1735 cache = uniqueCache[ type ] || [];
1736 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1737 diff = nodeIndex && cache[ 2 ];
1738 node = nodeIndex && parent.childNodes[ nodeIndex ];
1740 while ( (node = ++nodeIndex && node && node[ dir ] ||
1743 (diff = nodeIndex = 0) || start.pop()) ) {
1746 if ( node.nodeType === 1 && ++diff && node === elem ) {
1747 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
1757 outerCache = node[ expando ] || (node[ expando ] = {});
1761 uniqueCache = outerCache[ node.uniqueID ] ||
1762 (outerCache[ node.uniqueID ] = {});
1764 cache = uniqueCache[ type ] || [];
1765 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1771 if ( diff ===
false ) {
1773 while ( (node = ++nodeIndex && node && node[ dir ] ||
1774 (diff = nodeIndex = 0) || start.pop()) ) {
1777 node.nodeName.toLowerCase() === name :
1778 node.nodeType === 1 ) &&
1783 outerCache = node[ expando ] || (node[ expando ] = {});
1787 uniqueCache = outerCache[ node.uniqueID ] ||
1788 (outerCache[ node.uniqueID ] = {});
1790 uniqueCache[ type ] = [ dirruns, diff ];
1793 if ( node === elem ) {
1803 return diff === first || ( diff % first === 0 && diff / first >= 0 );
1808 "PSEUDO":
function( pseudo, argument ) {
1814 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1815 Sizzle.error(
"unsupported pseudo: " + pseudo );
1820 if ( fn[ expando ] ) {
1821 return fn( argument );
1825 if ( fn.length > 1 ) {
1826 args = [ pseudo, pseudo,
"", argument ];
1827 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1828 markFunction(
function( seed, matches ) {
1830 matched = fn( seed, argument ),
1833 idx = indexOf( seed, matched[i] );
1834 seed[ idx ] = !( matches[ idx ] = matched[i] );
1838 return fn( elem, 0, args );
1848 "not": markFunction(
function( selector ) {
1854 matcher = compile( selector.replace( rtrim,
"$1" ) );
1856 return matcher[ expando ] ?
1857 markFunction(
function( seed, matches, context, xml ) {
1859 unmatched = matcher( seed, null, xml, [] ),
1864 if ( (elem = unmatched[i]) ) {
1865 seed[i] = !(matches[i] = elem);
1869 function( elem, context, xml ) {
1871 matcher( input, null, xml, results );
1874 return !results.pop();
1878 "has": markFunction(
function( selector ) {
1879 return function( elem ) {
1880 return Sizzle( selector, elem ).length > 0;
1884 "contains": markFunction(
function( text ) {
1885 text = text.replace( runescape, funescape );
1886 return function( elem ) {
1887 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1898 "lang": markFunction(
function( lang ) {
1900 if ( !ridentifier.test(lang ||
"") ) {
1901 Sizzle.error(
"unsupported lang: " + lang );
1903 lang = lang.replace( runescape, funescape ).toLowerCase();
1904 return function( elem ) {
1907 if ( (elemLang = documentIsHTML ?
1909 elem.getAttribute(
"xml:lang") || elem.getAttribute(
"lang")) ) {
1911 elemLang = elemLang.toLowerCase();
1912 return elemLang === lang || elemLang.indexOf( lang +
"-" ) === 0;
1914 }
while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1920 "target":
function( elem ) {
1921 var hash = window.location && window.location.hash;
1922 return hash && hash.slice( 1 ) === elem.id;
1925 "root":
function( elem ) {
1926 return elem === docElem;
1929 "focus":
function( elem ) {
1930 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1934 "enabled":
function( elem ) {
1935 return elem.disabled ===
false;
1938 "disabled":
function( elem ) {
1939 return elem.disabled ===
true;
1942 "checked":
function( elem ) {
1945 var nodeName = elem.nodeName.toLowerCase();
1946 return (nodeName ===
"input" && !!elem.checked) || (nodeName ===
"option" && !!elem.selected);
1949 "selected":
function( elem ) {
1952 if ( elem.parentNode ) {
1953 elem.parentNode.selectedIndex;
1956 return elem.selected ===
true;
1960 "empty":
function( elem ) {
1965 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1966 if ( elem.nodeType < 6 ) {
1973 "parent":
function( elem ) {
1974 return !Expr.pseudos[
"empty"]( elem );
1978 "header":
function( elem ) {
1979 return rheader.test( elem.nodeName );
1982 "input":
function( elem ) {
1983 return rinputs.test( elem.nodeName );
1986 "button":
function( elem ) {
1987 var name = elem.nodeName.toLowerCase();
1988 return name ===
"input" && elem.type ===
"button" || name ===
"button";
1991 "text":
function( elem ) {
1993 return elem.nodeName.toLowerCase() ===
"input" &&
1994 elem.type ===
"text" &&
1998 ( (attr = elem.getAttribute(
"type")) == null || attr.toLowerCase() ===
"text" );
2002 "first": createPositionalPseudo(
function() {
2006 "last": createPositionalPseudo(
function( matchIndexes, length ) {
2007 return [ length - 1 ];
2010 "eq": createPositionalPseudo(
function( matchIndexes, length, argument ) {
2011 return [ argument < 0 ? argument + length : argument ];
2014 "even": createPositionalPseudo(
function( matchIndexes, length ) {
2016 for ( ; i < length; i += 2 ) {
2017 matchIndexes.push( i );
2019 return matchIndexes;
2022 "odd": createPositionalPseudo(
function( matchIndexes, length ) {
2024 for ( ; i < length; i += 2 ) {
2025 matchIndexes.push( i );
2027 return matchIndexes;
2030 "lt": createPositionalPseudo(
function( matchIndexes, length, argument ) {
2031 var i = argument < 0 ? argument + length : argument;
2032 for ( ; --i >= 0; ) {
2033 matchIndexes.push( i );
2035 return matchIndexes;
2038 "gt": createPositionalPseudo(
function( matchIndexes, length, argument ) {
2039 var i = argument < 0 ? argument + length : argument;
2040 for ( ; ++i < length; ) {
2041 matchIndexes.push( i );
2043 return matchIndexes;
2048 Expr.pseudos[
"nth"] = Expr.pseudos[
"eq"];
2051 for ( i in { radio:
true, checkbox:
true, file:
true, password:
true, image:
true } ) {
2052 Expr.pseudos[ i ] = createInputPseudo( i );
2054 for ( i in { submit:
true, reset:
true } ) {
2055 Expr.pseudos[ i ] = createButtonPseudo( i );
2059 function setFilters() {}
2060 setFilters.prototype = Expr.filters = Expr.pseudos;
2061 Expr.setFilters =
new setFilters();
2063 tokenize = Sizzle.tokenize =
function( selector, parseOnly ) {
2064 var matched, match, tokens, type,
2065 soFar, groups, preFilters,
2066 cached = tokenCache[ selector +
" " ];
2069 return parseOnly ? 0 : cached.slice( 0 );
2074 preFilters = Expr.preFilter;
2079 if ( !matched || (match = rcomma.exec( soFar )) ) {
2082 soFar = soFar.slice( match[0].length ) || soFar;
2084 groups.push( (tokens = []) );
2090 if ( (match = rcombinators.exec( soFar )) ) {
2091 matched = match.shift();
2095 type: match[0].replace( rtrim,
" " )
2097 soFar = soFar.slice( matched.length );
2101 for ( type in Expr.filter ) {
2102 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2103 (match = preFilters[ type ]( match ))) ) {
2104 matched = match.shift();
2110 soFar = soFar.slice( matched.length );
2125 Sizzle.error( selector ) :
2127 tokenCache( selector, groups ).slice( 0 );
2130 function toSelector( tokens ) {
2132 len = tokens.length,
2134 for ( ; i < len; i++ ) {
2135 selector += tokens[i].value;
2140 function addCombinator( matcher, combinator, base ) {
2141 var dir = combinator.dir,
2142 checkNonElements = base && dir ===
"parentNode",
2145 return combinator.first ?
2147 function( elem, context, xml ) {
2148 while ( (elem = elem[ dir ]) ) {
2149 if ( elem.nodeType === 1 || checkNonElements ) {
2150 return matcher( elem, context, xml );
2156 function( elem, context, xml ) {
2157 var oldCache, uniqueCache, outerCache,
2158 newCache = [ dirruns, doneName ];
2162 while ( (elem = elem[ dir ]) ) {
2163 if ( elem.nodeType === 1 || checkNonElements ) {
2164 if ( matcher( elem, context, xml ) ) {
2170 while ( (elem = elem[ dir ]) ) {
2171 if ( elem.nodeType === 1 || checkNonElements ) {
2172 outerCache = elem[ expando ] || (elem[ expando ] = {});
2176 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
2178 if ( (oldCache = uniqueCache[ dir ]) &&
2179 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2182 return (newCache[ 2 ] = oldCache[ 2 ]);
2185 uniqueCache[ dir ] = newCache;
2188 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2198 function elementMatcher( matchers ) {
2199 return matchers.length > 1 ?
2200 function( elem, context, xml ) {
2201 var i = matchers.length;
2203 if ( !matchers[i]( elem, context, xml ) ) {
2212 function multipleContexts( selector, contexts, results ) {
2214 len = contexts.length;
2215 for ( ; i < len; i++ ) {
2216 Sizzle( selector, contexts[i], results );
2221 function condense( unmatched, map, filter, context, xml ) {
2225 len = unmatched.length,
2226 mapped = map != null;
2228 for ( ; i < len; i++ ) {
2229 if ( (elem = unmatched[i]) ) {
2230 if ( !filter || filter( elem, context, xml ) ) {
2231 newUnmatched.push( elem );
2239 return newUnmatched;
2242 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2243 if ( postFilter && !postFilter[ expando ] ) {
2244 postFilter = setMatcher( postFilter );
2246 if ( postFinder && !postFinder[ expando ] ) {
2247 postFinder = setMatcher( postFinder, postSelector );
2249 return markFunction(
function( seed, results, context, xml ) {
2253 preexisting = results.length,
2256 elems = seed || multipleContexts( selector ||
"*", context.nodeType ? [ context ] : context, [] ),
2259 matcherIn = preFilter && ( seed || !selector ) ?
2260 condense( elems, preMap, preFilter, context, xml ) :
2263 matcherOut = matcher ?
2265 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2276 matcher( matcherIn, matcherOut, context, xml );
2281 temp = condense( matcherOut, postMap );
2282 postFilter( temp, [], context, xml );
2287 if ( (elem = temp[i]) ) {
2288 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2294 if ( postFinder || preFilter ) {
2298 i = matcherOut.length;
2300 if ( (elem = matcherOut[i]) ) {
2302 temp.push( (matcherIn[i] = elem) );
2305 postFinder( null, (matcherOut = []), temp, xml );
2309 i = matcherOut.length;
2311 if ( (elem = matcherOut[i]) &&
2312 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
2314 seed[temp] = !(results[temp] = elem);
2321 matcherOut = condense(
2322 matcherOut === results ?
2323 matcherOut.splice( preexisting, matcherOut.length ) :
2327 postFinder( null, results, matcherOut, xml );
2329 push.apply( results, matcherOut );
2335 function matcherFromTokens( tokens ) {
2336 var checkContext, matcher, j,
2337 len = tokens.length,
2338 leadingRelative = Expr.relative[ tokens[0].type ],
2339 implicitRelative = leadingRelative || Expr.relative[
" "],
2340 i = leadingRelative ? 1 : 0,
2343 matchContext = addCombinator(
function( elem ) {
2344 return elem === checkContext;
2345 }, implicitRelative, true ),
2346 matchAnyContext = addCombinator(
function( elem ) {
2347 return indexOf( checkContext, elem ) > -1;
2348 }, implicitRelative, true ),
2349 matchers = [
function( elem, context, xml ) {
2350 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2351 (checkContext = context).nodeType ?
2352 matchContext( elem, context, xml ) :
2353 matchAnyContext( elem, context, xml ) );
2355 checkContext = null;
2359 for ( ; i < len; i++ ) {
2360 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2361 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2363 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2366 if ( matcher[ expando ] ) {
2369 for ( ; j < len; j++ ) {
2370 if ( Expr.relative[ tokens[j].type ] ) {
2375 i > 1 && elementMatcher( matchers ),
2376 i > 1 && toSelector(
2378 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type ===
" " ?
"*" :
"" })
2379 ).replace( rtrim,
"$1" ),
2381 i < j && matcherFromTokens( tokens.slice( i, j ) ),
2382 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2383 j < len && toSelector( tokens )
2386 matchers.push( matcher );
2390 return elementMatcher( matchers );
2393 function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2394 var bySet = setMatchers.length > 0,
2395 byElement = elementMatchers.length > 0,
2396 superMatcher =
function( seed, context, xml, results, outermost ) {
2397 var elem, j, matcher,
2400 unmatched = seed && [],
2402 contextBackup = outermostContext,
2404 elems = seed || byElement && Expr.find[
"TAG"](
"*", outermost ),
2406 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2410 outermostContext = context === document || context || outermost;
2416 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2417 if ( byElement && elem ) {
2419 if ( !context && elem.ownerDocument !== document ) {
2420 setDocument( elem );
2421 xml = !documentIsHTML;
2423 while ( (matcher = elementMatchers[j++]) ) {
2424 if ( matcher( elem, context || document, xml) ) {
2425 results.push( elem );
2430 dirruns = dirrunsUnique;
2437 if ( (elem = !matcher && elem) ) {
2443 unmatched.push( elem );
2459 if ( bySet && i !== matchedCount ) {
2461 while ( (matcher = setMatchers[j++]) ) {
2462 matcher( unmatched, setMatched, context, xml );
2467 if ( matchedCount > 0 ) {
2469 if ( !(unmatched[i] || setMatched[i]) ) {
2470 setMatched[i] = pop.call( results );
2476 setMatched = condense( setMatched );
2480 push.apply( results, setMatched );
2483 if ( outermost && !seed && setMatched.length > 0 &&
2484 ( matchedCount + setMatchers.length ) > 1 ) {
2486 Sizzle.uniqueSort( results );
2492 dirruns = dirrunsUnique;
2493 outermostContext = contextBackup;
2500 markFunction( superMatcher ) :
2504 compile = Sizzle.compile =
function( selector, match ) {
2507 elementMatchers = [],
2508 cached = compilerCache[ selector +
" " ];
2513 match = tokenize( selector );
2517 cached = matcherFromTokens( match[i] );
2518 if ( cached[ expando ] ) {
2519 setMatchers.push( cached );
2521 elementMatchers.push( cached );
2526 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2529 cached.selector = selector;
2543 select = Sizzle.select =
function( selector, context, results, seed ) {
2544 var i, tokens, token, type, find,
2545 compiled = typeof selector ===
"function" && selector,
2546 match = !seed && tokenize( (selector = compiled.selector || selector) );
2548 results = results || [];
2552 if ( match.length === 1 ) {
2555 tokens = match[0] = match[0].slice( 0 );
2556 if ( tokens.length > 2 && (token = tokens[0]).type ===
"ID" &&
2557 support.getById && context.nodeType === 9 && documentIsHTML &&
2558 Expr.relative[ tokens[1].type ] ) {
2560 context = ( Expr.find[
"ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2565 }
else if ( compiled ) {
2566 context = context.parentNode;
2569 selector = selector.slice( tokens.shift().value.length );
2573 i = matchExpr[
"needsContext"].test( selector ) ? 0 : tokens.length;
2578 if ( Expr.relative[ (type = token.type) ] ) {
2581 if ( (find = Expr.find[ type ]) ) {
2584 token.matches[0].replace( runescape, funescape ),
2585 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2589 tokens.splice( i, 1 );
2590 selector = seed.length && toSelector( tokens );
2592 push.apply( results, seed );
2604 ( compiled || compile( selector, match ) )(
2609 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
2617 support.sortStable = expando.split(
"").sort( sortOrder ).join(
"") === expando;
2621 support.detectDuplicates = !!hasDuplicate;
2628 support.sortDetached = assert(
function( div1 ) {
2630 return div1.compareDocumentPosition( document.createElement(
"div") ) & 1;
2636 if ( !assert(
function( div ) {
2637 div.innerHTML =
"<a href='#'></a>";
2638 return div.firstChild.getAttribute(
"href") ===
"#" ;
2640 addHandle(
"type|href|height|width",
function( elem, name, isXML ) {
2642 return elem.getAttribute( name, name.toLowerCase() ===
"type" ? 1 : 2 );
2649 if ( !support.attributes || !assert(
function( div ) {
2650 div.innerHTML =
"<input/>";
2651 div.firstChild.setAttribute(
"value",
"" );
2652 return div.firstChild.getAttribute(
"value" ) ===
"";
2654 addHandle(
"value",
function( elem, name, isXML ) {
2655 if ( !isXML && elem.nodeName.toLowerCase() ===
"input" ) {
2656 return elem.defaultValue;
2663 if ( !assert(
function( div ) {
2664 return div.getAttribute(
"disabled") == null;
2666 addHandle( booleans,
function( elem, name, isXML ) {
2669 return elem[ name ] ===
true ? name.toLowerCase() :
2670 (val = elem.getAttributeNode( name )) && val.specified ?
2683 jQuery.find = Sizzle;
2684 jQuery.expr = Sizzle.selectors;
2685 jQuery.expr[
":" ] = jQuery.expr.pseudos;
2686 jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
2687 jQuery.text = Sizzle.getText;
2688 jQuery.isXMLDoc = Sizzle.isXML;
2689 jQuery.contains = Sizzle.contains;
2693 var dir =
function( elem, dir, until ) {
2695 truncate = until !== undefined;
2697 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
2698 if ( elem.nodeType === 1 ) {
2699 if ( truncate && jQuery( elem ).is( until ) ) {
2702 matched.push( elem );
2709 var siblings =
function( n, elem ) {
2712 for ( ; n; n = n.nextSibling ) {
2713 if ( n.nodeType === 1 && n !== elem ) {
2722 var rneedsContext = jQuery.expr.match.needsContext;
2724 var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
2728 var risSimple = /^.[^:#\[\.,]*$/;
2731 function winnow( elements, qualifier, not ) {
2732 if ( jQuery.isFunction( qualifier ) ) {
2733 return jQuery.grep( elements,
function( elem, i ) {
2735 return !!qualifier.call( elem, i, elem ) !== not;
2740 if ( qualifier.nodeType ) {
2741 return jQuery.grep( elements,
function( elem ) {
2742 return ( elem === qualifier ) !== not;
2747 if ( typeof qualifier ===
"string" ) {
2748 if ( risSimple.test( qualifier ) ) {
2749 return jQuery.filter( qualifier, elements, not );
2752 qualifier = jQuery.filter( qualifier, elements );
2755 return jQuery.grep( elements,
function( elem ) {
2756 return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
2760 jQuery.filter =
function( expr, elems, not ) {
2761 var elem = elems[ 0 ];
2764 expr =
":not(" + expr +
")";
2767 return elems.length === 1 && elem.nodeType === 1 ?
2768 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
2769 jQuery.find.matches( expr, jQuery.grep( elems,
function( elem ) {
2770 return elem.nodeType === 1;
2775 find:
function( selector ) {
2781 if ( typeof selector !==
"string" ) {
2782 return this.pushStack( jQuery( selector ).filter(
function() {
2783 for ( i = 0; i < len; i++ ) {
2784 if ( jQuery.contains(
self[ i ],
this ) ) {
2791 for ( i = 0; i < len; i++ ) {
2792 jQuery.find( selector,
self[ i ], ret );
2796 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
2797 ret.selector = this.selector ? this.selector +
" " + selector : selector;
2800 filter:
function( selector ) {
2801 return this.pushStack( winnow(
this, selector || [],
false ) );
2803 not:
function( selector ) {
2804 return this.pushStack( winnow(
this, selector || [],
true ) );
2806 is:
function( selector ) {
2812 typeof selector ===
"string" && rneedsContext.test( selector ) ?
2813 jQuery( selector ) :
2830 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
2832 init = jQuery.fn.init =
function( selector, context, root ) {
2842 root = root || rootjQuery;
2845 if ( typeof selector ===
"string" ) {
2846 if ( selector[ 0 ] ===
"<" &&
2847 selector[ selector.length - 1 ] ===
">" &&
2848 selector.length >= 3 ) {
2851 match = [ null, selector, null ];
2854 match = rquickExpr.exec( selector );
2858 if ( match && ( match[ 1 ] || !context ) ) {
2862 context = context instanceof jQuery ? context[ 0 ] : context;
2866 jQuery.merge(
this, jQuery.parseHTML(
2868 context && context.nodeType ? context.ownerDocument || context : document,
2873 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
2874 for ( match in context ) {
2877 if ( jQuery.isFunction(
this[ match ] ) ) {
2878 this[ match ]( context[ match ] );
2882 this.attr( match, context[ match ] );
2891 elem = document.getElementById( match[ 2 ] );
2895 if ( elem && elem.parentNode ) {
2902 this.context = document;
2903 this.selector = selector;
2908 }
else if ( !context || context.jquery ) {
2909 return ( context || root ).find( selector );
2914 return this.constructor( context ).find( selector );
2918 }
else if ( selector.nodeType ) {
2919 this.context =
this[ 0 ] = selector;
2925 }
else if ( jQuery.isFunction( selector ) ) {
2926 return root.ready !== undefined ?
2927 root.ready( selector ) :
2933 if ( selector.selector !== undefined ) {
2934 this.selector = selector.selector;
2935 this.context = selector.context;
2938 return jQuery.makeArray( selector,
this );
2942 init.prototype = jQuery.fn;
2945 rootjQuery = jQuery( document );
2948 var rparentsprev = /^(?:parents|prev(?:Until|All))/,
2951 guaranteedUnique = {
2959 has:
function( target ) {
2960 var targets = jQuery( target,
this ),
2963 return this.filter(
function() {
2965 for ( ; i < l; i++ ) {
2966 if ( jQuery.contains(
this, targets[ i ] ) ) {
2973 closest:
function( selectors, context ) {
2978 pos = rneedsContext.test( selectors ) || typeof selectors !==
"string" ?
2979 jQuery( selectors, context || this.context ) :
2982 for ( ; i < l; i++ ) {
2983 for ( cur =
this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
2986 if ( cur.nodeType < 11 && ( pos ?
2987 pos.index( cur ) > -1 :
2990 cur.nodeType === 1 &&
2991 jQuery.find.matchesSelector( cur, selectors ) ) ) {
2993 matched.push( cur );
2999 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
3003 index:
function( elem ) {
3007 return (
this[ 0 ] &&
this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
3011 if ( typeof elem ===
"string" ) {
3012 return indexOf.call( jQuery( elem ),
this[ 0 ] );
3016 return indexOf.call(
this,
3019 elem.jquery ? elem[ 0 ] : elem
3023 add:
function( selector, context ) {
3024 return this.pushStack(
3026 jQuery.merge(
this.get(), jQuery( selector, context ) )
3031 addBack:
function( selector ) {
3032 return this.add( selector == null ?
3033 this.prevObject : this.prevObject.filter( selector )
3038 function sibling( cur, dir ) {
3039 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
3044 parent:
function( elem ) {
3045 var parent = elem.parentNode;
3046 return parent && parent.nodeType !== 11 ? parent : null;
3048 parents:
function( elem ) {
3049 return dir( elem,
"parentNode" );
3051 parentsUntil:
function( elem, i, until ) {
3052 return dir( elem,
"parentNode", until );
3054 next:
function( elem ) {
3055 return sibling( elem,
"nextSibling" );
3057 prev:
function( elem ) {
3058 return sibling( elem,
"previousSibling" );
3060 nextAll:
function( elem ) {
3061 return dir( elem,
"nextSibling" );
3063 prevAll:
function( elem ) {
3064 return dir( elem,
"previousSibling" );
3066 nextUntil:
function( elem, i, until ) {
3067 return dir( elem,
"nextSibling", until );
3069 prevUntil:
function( elem, i, until ) {
3070 return dir( elem,
"previousSibling", until );
3072 siblings:
function( elem ) {
3073 return siblings( ( elem.parentNode || {} ).firstChild, elem );
3075 children:
function( elem ) {
3076 return siblings( elem.firstChild );
3078 contents:
function( elem ) {
3079 return elem.contentDocument || jQuery.merge( [], elem.childNodes );
3081 },
function( name, fn ) {
3082 jQuery.fn[ name ] =
function( until, selector ) {
3083 var matched = jQuery.map(
this, fn, until );
3085 if ( name.slice( -5 ) !==
"Until" ) {
3089 if ( selector && typeof selector ===
"string" ) {
3090 matched = jQuery.filter( selector, matched );
3093 if ( this.length > 1 ) {
3096 if ( !guaranteedUnique[ name ] ) {
3097 jQuery.uniqueSort( matched );
3101 if ( rparentsprev.test( name ) ) {
3106 return this.pushStack( matched );
3109 var rnotwhite = ( /\S+/g );
3114 function createOptions( options ) {
3116 jQuery.each( options.match( rnotwhite ) || [],
function( _, flag ) {
3117 object[ flag ] =
true;
3144 jQuery.Callbacks =
function( options ) {
3148 options = typeof options ===
"string" ?
3149 createOptions( options ) :
3150 jQuery.extend( {}, options );
3177 locked = options.once;
3181 fired = firing =
true;
3182 for ( ; queue.length; firingIndex = -1 ) {
3183 memory = queue.shift();
3184 while ( ++firingIndex < list.length ) {
3187 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) ===
false &&
3188 options.stopOnFalse ) {
3191 firingIndex = list.length;
3198 if ( !options.memory ) {
3226 if ( memory && !firing ) {
3227 firingIndex = list.length - 1;
3228 queue.push( memory );
3231 (
function add( args ) {
3232 jQuery.each( args,
function( _, arg ) {
3233 if ( jQuery.isFunction( arg ) ) {
3234 if ( !options.unique || !
self.has( arg ) ) {
3237 }
else if ( arg && arg.length && jQuery.type( arg ) !==
"string" ) {
3245 if ( memory && !firing ) {
3253 remove:
function() {
3254 jQuery.each( arguments,
function( _, arg ) {
3256 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3257 list.splice( index, 1 );
3260 if ( index <= firingIndex ) {
3270 has:
function( fn ) {
3272 jQuery.inArray( fn, list ) > -1 :
3287 disable:
function() {
3288 locked = queue = [];
3292 disabled:
function() {
3300 locked = queue = [];
3306 locked:
function() {
3311 fireWith:
function( context, args ) {
3314 args = [ context, args.slice ? args.slice() : args ];
3325 self.fireWith(
this, arguments );
3341 Deferred:
function( func ) {
3345 [
"resolve",
"done", jQuery.Callbacks(
"once memory" ),
"resolved" ],
3346 [
"reject",
"fail", jQuery.Callbacks(
"once memory" ),
"rejected" ],
3347 [
"notify",
"progress", jQuery.Callbacks(
"memory" ) ]
3354 always:
function() {
3355 deferred.done( arguments ).fail( arguments );
3359 var fns = arguments;
3360 return jQuery.Deferred(
function( newDefer ) {
3361 jQuery.each( tuples,
function( i, tuple ) {
3362 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
3365 deferred[ tuple[ 1 ] ](
function() {
3366 var returned = fn && fn.apply(
this, arguments );
3367 if ( returned && jQuery.isFunction( returned.promise ) ) {
3369 .progress( newDefer.notify )
3370 .done( newDefer.resolve )
3371 .fail( newDefer.reject );
3373 newDefer[ tuple[ 0 ] +
"With" ](
3374 this === promise ? newDefer.promise() :
this,
3375 fn ? [ returned ] : arguments
3386 promise:
function( obj ) {
3387 return obj != null ? jQuery.extend( obj, promise ) : promise;
3393 promise.pipe = promise.then;
3396 jQuery.each( tuples,
function( i, tuple ) {
3397 var list = tuple[ 2 ],
3398 stateString = tuple[ 3 ];
3401 promise[ tuple[ 1 ] ] = list.add;
3404 if ( stateString ) {
3405 list.add(
function() {
3408 state = stateString;
3411 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
3415 deferred[ tuple[ 0 ] ] =
function() {
3416 deferred[ tuple[ 0 ] +
"With" ](
this === deferred ? promise :
this, arguments );
3419 deferred[ tuple[ 0 ] +
"With" ] = list.fireWith;
3423 promise.promise( deferred );
3427 func.call( deferred, deferred );
3435 when:
function( subordinate ) {
3437 resolveValues = slice.call( arguments ),
3438 length = resolveValues.length,
3441 remaining = length !== 1 ||
3442 ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
3446 deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
3449 updateFunc =
function( i, contexts, values ) {
3450 return function( value ) {
3451 contexts[ i ] =
this;
3452 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3453 if ( values === progressValues ) {
3454 deferred.notifyWith( contexts, values );
3455 }
else if ( !( --remaining ) ) {
3456 deferred.resolveWith( contexts, values );
3461 progressValues, progressContexts, resolveContexts;
3465 progressValues =
new Array( length );
3466 progressContexts =
new Array( length );
3467 resolveContexts =
new Array( length );
3468 for ( ; i < length; i++ ) {
3469 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
3470 resolveValues[ i ].promise()
3471 .progress( updateFunc( i, progressContexts, progressValues ) )
3472 .done( updateFunc( i, resolveContexts, resolveValues ) )
3473 .fail( deferred.reject );
3482 deferred.resolveWith( resolveContexts, resolveValues );
3485 return deferred.promise();
3493 jQuery.fn.ready =
function( fn ) {
3496 jQuery.ready.promise().done( fn );
3511 holdReady:
function( hold ) {
3515 jQuery.ready(
true );
3520 ready:
function( wait ) {
3523 if ( wait ===
true ? --jQuery.readyWait : jQuery.isReady ) {
3528 jQuery.isReady =
true;
3531 if ( wait !==
true && --jQuery.readyWait > 0 ) {
3536 readyList.resolveWith( document, [ jQuery ] );
3539 if ( jQuery.fn.triggerHandler ) {
3540 jQuery( document ).triggerHandler(
"ready" );
3541 jQuery( document ).off(
"ready" );
3549 function completed() {
3550 document.removeEventListener(
"DOMContentLoaded", completed );
3551 window.removeEventListener(
"load", completed );
3555 jQuery.ready.promise =
function( obj ) {
3558 readyList = jQuery.Deferred();
3564 if ( document.readyState ===
"complete" ||
3565 ( document.readyState !==
"loading" && !document.documentElement.doScroll ) ) {
3568 window.setTimeout( jQuery.ready );
3573 document.addEventListener(
"DOMContentLoaded", completed );
3576 window.addEventListener(
"load", completed );
3579 return readyList.promise( obj );
3583 jQuery.ready.promise();
3590 var access =
function( elems, fn, key, value, chainable, emptyGet, raw ) {
3596 if ( jQuery.type( key ) ===
"object" ) {
3599 access( elems, fn, i, key[ i ],
true, emptyGet, raw );
3603 }
else if ( value !== undefined ) {
3606 if ( !jQuery.isFunction( value ) ) {
3614 fn.call( elems, value );
3620 fn =
function( elem, key, value ) {
3621 return bulk.call( jQuery( elem ), value );
3627 for ( ; i < len; i++ ) {
3629 elems[ i ], key, raw ?
3631 value.call( elems[ i ], i, fn( elems[ i ], key ) )
3643 len ? fn( elems[ 0 ], key ) : emptyGet;
3645 var acceptData =
function( owner ) {
3654 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
3661 this.expando = jQuery.expando + Data.uid++;
3668 register:
function( owner, initial ) {
3669 var value = initial || {};
3673 if ( owner.nodeType ) {
3674 owner[ this.expando ] = value;
3680 Object.defineProperty( owner, this.expando, {
3686 return owner[ this.expando ];
3688 cache:
function( owner ) {
3693 if ( !acceptData( owner ) ) {
3698 var value = owner[ this.expando ];
3707 if ( acceptData( owner ) ) {
3711 if ( owner.nodeType ) {
3712 owner[ this.expando ] = value;
3718 Object.defineProperty( owner, this.expando, {
3728 set:
function( owner, data, value ) {
3730 cache = this.cache( owner );
3733 if ( typeof data ===
"string" ) {
3734 cache[ data ] = value;
3740 for ( prop in data ) {
3741 cache[ prop ] = data[ prop ];
3746 get:
function( owner, key ) {
3747 return key === undefined ?
3748 this.cache( owner ) :
3749 owner[ this.expando ] && owner[ this.expando ][ key ];
3751 access:
function( owner, key, value ) {
3765 if ( key === undefined ||
3766 ( ( key && typeof key ===
"string" ) && value === undefined ) ) {
3768 stored = this.
get( owner, key );
3770 return stored !== undefined ?
3771 stored : this.
get( owner, jQuery.camelCase( key ) );
3780 this.set( owner, key, value );
3784 return value !== undefined ? value : key;
3786 remove:
function( owner, key ) {
3788 cache = owner[ this.expando ];
3790 if ( cache === undefined ) {
3794 if ( key === undefined ) {
3795 this.
register( owner );
3800 if ( jQuery.isArray( key ) ) {
3808 name = key.concat( key.map( jQuery.camelCase ) );
3810 camel = jQuery.camelCase( key );
3813 if ( key in cache ) {
3814 name = [ key, camel ];
3820 name = name in cache ?
3821 [ name ] : ( name.match( rnotwhite ) || [] );
3828 delete cache[ name[ i ] ];
3833 if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
3839 if ( owner.nodeType ) {
3840 owner[ this.expando ] = undefined;
3842 delete owner[ this.expando ];
3846 hasData:
function( owner ) {
3847 var cache = owner[ this.expando ];
3848 return cache !== undefined && !jQuery.isEmptyObject( cache );
3851 var dataPriv =
new Data();
3853 var dataUser =
new Data();
3867 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
3868 rmultiDash = /[A-Z]/g;
3870 function dataAttr( elem, key, data ) {
3875 if ( data === undefined && elem.nodeType === 1 ) {
3876 name =
"data-" + key.replace( rmultiDash,
"-$&" ).toLowerCase();
3877 data = elem.getAttribute( name );
3879 if ( typeof data ===
"string" ) {
3881 data = data ===
"true" ?
true :
3882 data ===
"false" ?
false :
3883 data ===
"null" ? null :
3886 +data +
"" === data ? +data :
3887 rbrace.test( data ) ? jQuery.parseJSON( data ) :
3892 dataUser.set( elem, key, data );
3901 hasData:
function( elem ) {
3902 return dataUser.hasData( elem ) || dataPriv.hasData( elem );
3905 data:
function( elem, name, data ) {
3906 return dataUser.access( elem, name, data );
3909 removeData:
function( elem, name ) {
3910 dataUser.remove( elem, name );
3915 _data:
function( elem, name, data ) {
3916 return dataPriv.access( elem, name, data );
3919 _removeData:
function( elem, name ) {
3920 dataPriv.remove( elem, name );
3925 data:
function( key, value ) {
3928 attrs = elem && elem.attributes;
3931 if ( key === undefined ) {
3932 if ( this.length ) {
3933 data = dataUser.get( elem );
3935 if ( elem.nodeType === 1 && !dataPriv.get( elem,
"hasDataAttrs" ) ) {
3942 name = attrs[ i ].name;
3943 if ( name.indexOf(
"data-" ) === 0 ) {
3944 name = jQuery.camelCase( name.slice( 5 ) );
3945 dataAttr( elem, name, data[ name ] );
3949 dataPriv.set( elem,
"hasDataAttrs",
true );
3957 if ( typeof key ===
"object" ) {
3958 return this.each(
function() {
3959 dataUser.set(
this, key );
3963 return access(
this,
function( value ) {
3971 if ( elem && value === undefined ) {
3975 data = dataUser.get( elem, key ) ||
3979 dataUser.get( elem, key.replace( rmultiDash,
"-$&" ).toLowerCase() );
3981 if ( data !== undefined ) {
3985 camelKey = jQuery.camelCase( key );
3989 data = dataUser.get( elem, camelKey );
3990 if ( data !== undefined ) {
3996 data = dataAttr( elem, camelKey, undefined );
3997 if ( data !== undefined ) {
4006 camelKey = jQuery.camelCase( key );
4007 this.each(
function() {
4011 var data = dataUser.get(
this, camelKey );
4016 dataUser.set(
this, camelKey, value );
4021 if ( key.indexOf(
"-" ) > -1 && data !== undefined ) {
4022 dataUser.set(
this, key, value );
4025 }, null, value, arguments.length > 1, null, true );
4028 removeData:
function( key ) {
4029 return this.each(
function() {
4030 dataUser.remove(
this, key );
4037 queue:
function( elem, type, data ) {
4041 type = ( type ||
"fx" ) +
"queue";
4042 queue = dataPriv.get( elem, type );
4046 if ( !queue || jQuery.isArray( data ) ) {
4047 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
4056 dequeue:
function( elem, type ) {
4057 type = type ||
"fx";
4059 var queue = jQuery.queue( elem, type ),
4060 startLength = queue.length,
4062 hooks = jQuery._queueHooks( elem, type ),
4064 jQuery.dequeue( elem, type );
4068 if ( fn ===
"inprogress" ) {
4077 if ( type ===
"fx" ) {
4078 queue.unshift(
"inprogress" );
4083 fn.call( elem, next, hooks );
4086 if ( !startLength && hooks ) {
4092 _queueHooks:
function( elem, type ) {
4093 var key = type +
"queueHooks";
4094 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
4095 empty: jQuery.Callbacks(
"once memory" ).add(
function() {
4096 dataPriv.remove( elem, [ type +
"queue", key ] );
4103 queue:
function( type, data ) {
4106 if ( typeof type !==
"string" ) {
4112 if ( arguments.length < setter ) {
4113 return jQuery.queue(
this[ 0 ], type );
4116 return data === undefined ?
4118 this.each(
function() {
4119 var queue = jQuery.queue(
this, type, data );
4122 jQuery._queueHooks(
this, type );
4124 if ( type ===
"fx" && queue[ 0 ] !==
"inprogress" ) {
4125 jQuery.dequeue(
this, type );
4129 dequeue:
function( type ) {
4130 return this.each(
function() {
4131 jQuery.dequeue(
this, type );
4134 clearQueue:
function( type ) {
4135 return this.queue( type ||
"fx", [] );
4140 promise:
function( type, obj ) {
4143 defer = jQuery.Deferred(),
4146 resolve =
function() {
4147 if ( !( --count ) ) {
4148 defer.resolveWith( elements, [ elements ] );
4152 if ( typeof type !==
"string" ) {
4156 type = type ||
"fx";
4159 tmp = dataPriv.get( elements[ i ], type +
"queueHooks" );
4160 if ( tmp && tmp.empty ) {
4162 tmp.empty.add( resolve );
4166 return defer.promise( obj );
4169 var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
4171 var rcssNum =
new RegExp(
"^(?:([+-])=|)(" + pnum +
")([a-z%]*)$",
"i" );
4174 var cssExpand = [
"Top",
"Right",
"Bottom",
"Left" ];
4176 var isHidden =
function( elem, el ) {
4181 return jQuery.css( elem,
"display" ) ===
"none" ||
4182 !jQuery.contains( elem.ownerDocument, elem );
4187 function adjustCSS( elem, prop, valueParts, tween ) {
4191 currentValue = tween ?
4192 function() {
return tween.cur(); } :
4193 function() {
return jQuery.css( elem, prop,
"" ); },
4194 initial = currentValue(),
4195 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ?
"" :
"px" ),
4198 initialInUnit = ( jQuery.cssNumber[ prop ] || unit !==
"px" && +initial ) &&
4199 rcssNum.exec( jQuery.css( elem, prop ) );
4201 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
4204 unit = unit || initialInUnit[ 3 ];
4207 valueParts = valueParts || [];
4210 initialInUnit = +initial || 1;
4216 scale = scale ||
".5";
4219 initialInUnit = initialInUnit / scale;
4220 jQuery.style( elem, prop, initialInUnit + unit );
4225 scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
4230 initialInUnit = +initialInUnit || +initial || 0;
4233 adjusted = valueParts[ 1 ] ?
4234 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
4238 tween.start = initialInUnit;
4239 tween.end = adjusted;
4244 var rcheckableType = ( /^(?:checkbox|radio)$/i );
4246 var rtagName = ( /<([\w:-]+)/ );
4248 var rscriptType = ( /^$|\/(?:java|ecma)script/i );
4256 option: [ 1,
"<select multiple='multiple'>",
"</select>" ],
4261 thead: [ 1,
"<table>",
"</table>" ],
4262 col: [ 2,
"<table><colgroup>",
"</colgroup></table>" ],
4263 tr: [ 2,
"<table><tbody>",
"</tbody></table>" ],
4264 td: [ 3,
"<table><tbody><tr>",
"</tr></tbody></table>" ],
4266 _default: [ 0,
"",
"" ]
4270 wrapMap.optgroup = wrapMap.option;
4272 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4273 wrapMap.th = wrapMap.td;
4276 function getAll( context, tag ) {
4280 var ret = typeof context.getElementsByTagName !==
"undefined" ?
4281 context.getElementsByTagName( tag ||
"*" ) :
4282 typeof context.querySelectorAll !==
"undefined" ?
4283 context.querySelectorAll( tag ||
"*" ) :
4286 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
4287 jQuery.merge( [ context ], ret ) :
4293 function setGlobalEval( elems, refElements ) {
4297 for ( ; i < l; i++ ) {
4301 !refElements || dataPriv.get( refElements[ i ],
"globalEval" )
4307 var rhtml = /<|&#?\w+;/;
4309 function buildFragment( elems, context, scripts, selection, ignored ) {
4310 var elem, tmp, tag, wrap, contains, j,
4311 fragment = context.createDocumentFragment(),
4316 for ( ; i < l; i++ ) {
4319 if ( elem || elem === 0 ) {
4322 if ( jQuery.type( elem ) ===
"object" ) {
4326 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
4329 }
else if ( !rhtml.test( elem ) ) {
4330 nodes.push( context.createTextNode( elem ) );
4334 tmp = tmp || fragment.appendChild( context.createElement(
"div" ) );
4337 tag = ( rtagName.exec( elem ) || [
"",
"" ] )[ 1 ].toLowerCase();
4338 wrap = wrapMap[ tag ] || wrapMap._default;
4339 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
4344 tmp = tmp.lastChild;
4349 jQuery.merge( nodes, tmp.childNodes );
4352 tmp = fragment.firstChild;
4355 tmp.textContent =
"";
4361 fragment.textContent =
"";
4364 while ( ( elem = nodes[ i++ ] ) ) {
4367 if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
4369 ignored.push( elem );
4374 contains = jQuery.contains( elem.ownerDocument, elem );
4377 tmp = getAll( fragment.appendChild( elem ),
"script" );
4381 setGlobalEval( tmp );
4387 while ( ( elem = tmp[ j++ ] ) ) {
4388 if ( rscriptType.test( elem.type ||
"" ) ) {
4389 scripts.push( elem );
4400 var fragment = document.createDocumentFragment(),
4401 div = fragment.appendChild( document.createElement(
"div" ) ),
4402 input = document.createElement(
"input" );
4408 input.setAttribute(
"type",
"radio" );
4409 input.setAttribute(
"checked",
"checked" );
4410 input.setAttribute(
"name",
"t" );
4412 div.appendChild( input );
4416 support.checkClone = div.cloneNode(
true ).cloneNode(
true ).lastChild.checked;
4420 div.innerHTML =
"<textarea>x</textarea>";
4421 support.noCloneChecked = !!div.cloneNode(
true ).lastChild.defaultValue;
4427 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
4428 rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
4430 function returnTrue() {
4434 function returnFalse() {
4440 function safeActiveElement() {
4442 return document.activeElement;
4446 function on( elem, types, selector, data, fn, one ) {
4450 if ( typeof types ===
"object" ) {
4453 if ( typeof selector !==
"string" ) {
4456 data = data || selector;
4457 selector = undefined;
4459 for ( type in types ) {
4460 on( elem, type, selector, data, types[ type ], one );
4465 if ( data == null && fn == null ) {
4469 data = selector = undefined;
4470 }
else if ( fn == null ) {
4471 if ( typeof selector ===
"string" ) {
4481 selector = undefined;
4484 if ( fn ===
false ) {
4492 fn =
function( event ) {
4495 jQuery().off( event );
4496 return origFn.apply(
this, arguments );
4500 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
4502 return elem.each(
function() {
4503 jQuery.event.add(
this, types, fn, data, selector );
4515 add:
function( elem, types, handler, data, selector ) {
4517 var handleObjIn, eventHandle, tmp,
4518 events, t, handleObj,
4519 special, handlers, type, namespaces, origType,
4520 elemData = dataPriv.get( elem );
4528 if ( handler.handler ) {
4529 handleObjIn = handler;
4530 handler = handleObjIn.handler;
4531 selector = handleObjIn.selector;
4535 if ( !handler.guid ) {
4536 handler.guid = jQuery.guid++;
4540 if ( !( events = elemData.events ) ) {
4541 events = elemData.events = {};
4543 if ( !( eventHandle = elemData.handle ) ) {
4544 eventHandle = elemData.handle =
function( e ) {
4548 return typeof jQuery !==
"undefined" && jQuery.event.triggered !== e.type ?
4549 jQuery.event.dispatch.apply( elem, arguments ) : undefined;
4554 types = ( types ||
"" ).match( rnotwhite ) || [
"" ];
4557 tmp = rtypenamespace.exec( types[ t ] ) || [];
4558 type = origType = tmp[ 1 ];
4559 namespaces = ( tmp[ 2 ] ||
"" ).split(
"." ).sort();
4567 special = jQuery.event.special[ type ] || {};
4570 type = ( selector ? special.delegateType : special.bindType ) || type;
4573 special = jQuery.event.special[ type ] || {};
4576 handleObj = jQuery.extend( {
4583 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4584 namespace: namespaces.join(
"." )
4588 if ( !( handlers = events[ type ] ) ) {
4589 handlers = events[ type ] = [];
4590 handlers.delegateCount = 0;
4593 if ( !special.setup ||
4594 special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4596 if ( elem.addEventListener ) {
4597 elem.addEventListener( type, eventHandle );
4602 if ( special.add ) {
4603 special.add.call( elem, handleObj );
4605 if ( !handleObj.handler.guid ) {
4606 handleObj.handler.guid = handler.guid;
4612 handlers.splice( handlers.delegateCount++, 0, handleObj );
4614 handlers.push( handleObj );
4618 jQuery.event.global[ type ] =
true;
4624 remove:
function( elem, types, handler, selector, mappedTypes ) {
4626 var j, origCount, tmp,
4627 events, t, handleObj,
4628 special, handlers, type, namespaces, origType,
4629 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
4631 if ( !elemData || !( events = elemData.events ) ) {
4636 types = ( types ||
"" ).match( rnotwhite ) || [
"" ];
4639 tmp = rtypenamespace.exec( types[ t ] ) || [];
4640 type = origType = tmp[ 1 ];
4641 namespaces = ( tmp[ 2 ] ||
"" ).split(
"." ).sort();
4645 for ( type in events ) {
4646 jQuery.event.remove( elem, type + types[ t ], handler, selector,
true );
4651 special = jQuery.event.special[ type ] || {};
4652 type = ( selector ? special.delegateType : special.bindType ) || type;
4653 handlers = events[ type ] || [];
4655 new RegExp(
"(^|\\.)" + namespaces.join(
"\\.(?:.*\\.|)" ) +
"(\\.|$)" );
4658 origCount = j = handlers.length;
4660 handleObj = handlers[ j ];
4662 if ( ( mappedTypes || origType === handleObj.origType ) &&
4663 ( !handler || handler.guid === handleObj.guid ) &&
4664 ( !tmp || tmp.test( handleObj.namespace ) ) &&
4665 ( !selector || selector === handleObj.selector ||
4666 selector ===
"**" && handleObj.selector ) ) {
4667 handlers.splice( j, 1 );
4669 if ( handleObj.selector ) {
4670 handlers.delegateCount--;
4672 if ( special.remove ) {
4673 special.remove.call( elem, handleObj );
4680 if ( origCount && !handlers.length ) {
4681 if ( !special.teardown ||
4682 special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
4684 jQuery.removeEvent( elem, type, elemData.handle );
4687 delete events[ type ];
4692 if ( jQuery.isEmptyObject( events ) ) {
4693 dataPriv.remove( elem,
"handle events" );
4697 dispatch:
function( event ) {
4700 event = jQuery.event.fix( event );
4702 var i, j, ret, matched, handleObj,
4704 args = slice.call( arguments ),
4705 handlers = ( dataPriv.get(
this,
"events" ) || {} )[ event.type ] || [],
4706 special = jQuery.event.special[ event.type ] || {};
4710 event.delegateTarget =
this;
4713 if ( special.preDispatch && special.preDispatch.call(
this, event ) === false ) {
4718 handlerQueue = jQuery.event.handlers.call(
this, event, handlers );
4722 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
4723 event.currentTarget = matched.elem;
4726 while ( ( handleObj = matched.handlers[ j++ ] ) &&
4727 !
event.isImmediatePropagationStopped() ) {
4731 if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
4733 event.handleObj = handleObj;
4734 event.data = handleObj.data;
4736 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
4737 handleObj.handler ).apply( matched.elem, args );
4739 if ( ret !== undefined ) {
4740 if ( ( event.result = ret ) ===
false ) {
4741 event.preventDefault();
4742 event.stopPropagation();
4750 if ( special.postDispatch ) {
4751 special.postDispatch.call(
this, event );
4754 return event.result;
4757 handlers:
function( event, handlers ) {
4758 var i, matches, sel, handleObj,
4760 delegateCount = handlers.delegateCount,
4769 if ( delegateCount && cur.nodeType &&
4770 ( event.type !==
"click" || isNaN( event.button ) || event.button < 1 ) ) {
4772 for ( ; cur !==
this; cur = cur.parentNode || this ) {
4776 if ( cur.nodeType === 1 && ( cur.disabled !==
true || event.type !==
"click" ) ) {
4778 for ( i = 0; i < delegateCount; i++ ) {
4779 handleObj = handlers[ i ];
4782 sel = handleObj.selector +
" ";
4784 if ( matches[ sel ] === undefined ) {
4785 matches[ sel ] = handleObj.needsContext ?
4786 jQuery( sel,
this ).index( cur ) > -1 :
4787 jQuery.find( sel,
this, null, [ cur ] ).length;
4789 if ( matches[ sel ] ) {
4790 matches.push( handleObj );
4793 if ( matches.length ) {
4794 handlerQueue.push( { elem: cur, handlers: matches } );
4801 if ( delegateCount < handlers.length ) {
4802 handlerQueue.push( { elem:
this, handlers: handlers.slice( delegateCount ) } );
4805 return handlerQueue;
4809 props: (
"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " +
4810 "metaKey relatedTarget shiftKey target timeStamp view which" ).split(
" " ),
4815 props:
"char charCode key keyCode".split(
" " ),
4816 filter:
function( event, original ) {
4819 if ( event.which == null ) {
4820 event.which = original.charCode != null ? original.charCode : original.keyCode;
4828 props: (
"button buttons clientX clientY offsetX offsetY pageX pageY " +
4829 "screenX screenY toElement" ).split(
" " ),
4830 filter:
function( event, original ) {
4831 var eventDoc, doc, body,
4832 button = original.button;
4835 if ( event.pageX == null && original.clientX != null ) {
4836 eventDoc =
event.target.ownerDocument || document;
4837 doc = eventDoc.documentElement;
4838 body = eventDoc.body;
4840 event.pageX = original.clientX +
4841 ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
4842 ( doc && doc.clientLeft || body && body.clientLeft || 0 );
4843 event.pageY = original.clientY +
4844 ( doc && doc.scrollTop || body && body.scrollTop || 0 ) -
4845 ( doc && doc.clientTop || body && body.clientTop || 0 );
4850 if ( !event.which && button !== undefined ) {
4851 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
4858 fix:
function( event ) {
4859 if ( event[ jQuery.expando ] ) {
4866 originalEvent = event,
4867 fixHook = this.fixHooks[ type ];
4870 this.fixHooks[ type ] = fixHook =
4871 rmouseEvent.test( type ) ? this.mouseHooks :
4872 rkeyEvent.test( type ) ? this.keyHooks :
4875 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
4877 event =
new jQuery.Event( originalEvent );
4882 event[ prop ] = originalEvent[ prop ];
4887 if ( !event.target ) {
4888 event.target = document;
4893 if ( event.target.nodeType === 3 ) {
4894 event.target =
event.target.parentNode;
4897 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
4909 trigger:
function() {
4910 if (
this !== safeActiveElement() && this.focus ) {
4915 delegateType:
"focusin"
4918 trigger:
function() {
4919 if (
this === safeActiveElement() && this.blur ) {
4924 delegateType:
"focusout"
4929 trigger:
function() {
4930 if ( this.type ===
"checkbox" && this.click && jQuery.nodeName(
this,
"input" ) ) {
4937 _default:
function( event ) {
4938 return jQuery.nodeName( event.target,
"a" );
4943 postDispatch:
function( event ) {
4947 if ( event.result !== undefined && event.originalEvent ) {
4948 event.originalEvent.returnValue =
event.result;
4955 jQuery.removeEvent =
function( elem, type, handle ) {
4958 if ( elem.removeEventListener ) {
4959 elem.removeEventListener( type, handle );
4963 jQuery.Event =
function( src, props ) {
4966 if ( !(
this instanceof jQuery.Event ) ) {
4967 return new jQuery.Event( src, props );
4971 if ( src && src.type ) {
4972 this.originalEvent = src;
4973 this.type = src.type;
4977 this.isDefaultPrevented = src.defaultPrevented ||
4978 src.defaultPrevented === undefined &&
4981 src.returnValue ===
false ?
4992 jQuery.extend(
this, props );
4996 this.timeStamp = src && src.timeStamp || jQuery.now();
4999 this[ jQuery.expando ] =
true;
5004 jQuery.Event.prototype = {
5005 constructor: jQuery.Event,
5006 isDefaultPrevented: returnFalse,
5007 isPropagationStopped: returnFalse,
5008 isImmediatePropagationStopped: returnFalse,
5010 preventDefault:
function() {
5011 var e = this.originalEvent;
5013 this.isDefaultPrevented = returnTrue;
5019 stopPropagation:
function() {
5020 var e = this.originalEvent;
5022 this.isPropagationStopped = returnTrue;
5025 e.stopPropagation();
5028 stopImmediatePropagation:
function() {
5029 var e = this.originalEvent;
5031 this.isImmediatePropagationStopped = returnTrue;
5034 e.stopImmediatePropagation();
5037 this.stopPropagation();
5050 mouseenter:
"mouseover",
5051 mouseleave:
"mouseout",
5052 pointerenter:
"pointerover",
5053 pointerleave:
"pointerout"
5054 },
function( orig, fix ) {
5055 jQuery.event.special[ orig ] = {
5059 handle:
function( event ) {
5062 related =
event.relatedTarget,
5063 handleObj =
event.handleObj;
5067 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
5068 event.type = handleObj.origType;
5069 ret = handleObj.handler.apply(
this, arguments );
5078 on:
function( types, selector, data, fn ) {
5079 return on(
this, types, selector, data, fn );
5081 one:
function( types, selector, data, fn ) {
5082 return on(
this, types, selector, data, fn, 1 );
5084 off:
function( types, selector, fn ) {
5085 var handleObj, type;
5086 if ( types && types.preventDefault && types.handleObj ) {
5089 handleObj = types.handleObj;
5090 jQuery( types.delegateTarget ).off(
5091 handleObj.namespace ?
5092 handleObj.origType +
"." + handleObj.namespace :
5099 if ( typeof types ===
"object" ) {
5102 for ( type in types ) {
5103 this.off( type, selector, types[ type ] );
5107 if ( selector ===
false || typeof selector ===
"function" ) {
5111 selector = undefined;
5113 if ( fn ===
false ) {
5116 return this.each(
function() {
5117 jQuery.event.remove(
this, types, fn, selector );
5124 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
5129 rnoInnerhtml = /<script|<style|<link/i,
5132 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5133 rscriptTypeMasked = /^
true\/(.*)/,
5134 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
5137 function manipulationTarget( elem, content ) {
5138 return jQuery.nodeName( elem,
"table" ) &&
5139 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild,
"tr" ) ?
5141 elem.getElementsByTagName(
"tbody" )[ 0 ] ||
5142 elem.appendChild( elem.ownerDocument.createElement(
"tbody" ) ) :
5147 function disableScript( elem ) {
5148 elem.type = ( elem.getAttribute(
"type" ) !== null ) +
"/" + elem.type;
5151 function restoreScript( elem ) {
5152 var match = rscriptTypeMasked.exec( elem.type );
5155 elem.type = match[ 1 ];
5157 elem.removeAttribute(
"type" );
5163 function cloneCopyEvent( src, dest ) {
5164 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
5166 if ( dest.nodeType !== 1 ) {
5171 if ( dataPriv.hasData( src ) ) {
5172 pdataOld = dataPriv.access( src );
5173 pdataCur = dataPriv.set( dest, pdataOld );
5174 events = pdataOld.events;
5177 delete pdataCur.handle;
5178 pdataCur.events = {};
5180 for ( type in events ) {
5181 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5182 jQuery.event.add( dest, type, events[ type ][ i ] );
5189 if ( dataUser.hasData( src ) ) {
5190 udataOld = dataUser.access( src );
5191 udataCur = jQuery.extend( {}, udataOld );
5193 dataUser.set( dest, udataCur );
5198 function fixInput( src, dest ) {
5199 var nodeName = dest.nodeName.toLowerCase();
5202 if ( nodeName ===
"input" && rcheckableType.test( src.type ) ) {
5203 dest.checked = src.checked;
5206 }
else if ( nodeName ===
"input" || nodeName ===
"textarea" ) {
5207 dest.defaultValue = src.defaultValue;
5211 function domManip( collection, args, callback, ignored ) {
5214 args = concat.apply( [], args );
5216 var fragment, first, scripts, hasScripts, node, doc,
5218 l = collection.length,
5221 isFunction = jQuery.isFunction( value );
5225 ( l > 1 && typeof value ===
"string" &&
5226 !support.checkClone && rchecked.test( value ) ) ) {
5227 return collection.each(
function( index ) {
5228 var
self = collection.eq( index );
5230 args[ 0 ] = value.call(
this, index,
self.html() );
5232 domManip(
self, args, callback, ignored );
5237 fragment = buildFragment( args, collection[ 0 ].ownerDocument,
false, collection, ignored );
5238 first = fragment.firstChild;
5240 if ( fragment.childNodes.length === 1 ) {
5245 if ( first || ignored ) {
5246 scripts = jQuery.map( getAll( fragment,
"script" ), disableScript );
5247 hasScripts = scripts.length;
5252 for ( ; i < l; i++ ) {
5255 if ( i !== iNoClone ) {
5256 node = jQuery.clone( node,
true,
true );
5263 jQuery.merge( scripts, getAll( node,
"script" ) );
5267 callback.call( collection[ i ], node, i );
5271 doc = scripts[ scripts.length - 1 ].ownerDocument;
5274 jQuery.map( scripts, restoreScript );
5277 for ( i = 0; i < hasScripts; i++ ) {
5278 node = scripts[ i ];
5279 if ( rscriptType.test( node.type ||
"" ) &&
5280 !dataPriv.access( node,
"globalEval" ) &&
5281 jQuery.contains( doc, node ) ) {
5286 if ( jQuery._evalUrl ) {
5287 jQuery._evalUrl( node.src );
5290 jQuery.globalEval( node.textContent.replace( rcleanScript,
"" ) );
5301 function remove( elem, selector, keepData ) {
5303 nodes = selector ? jQuery.filter( selector, elem ) : elem,
5306 for ( ; ( node = nodes[ i ] ) != null; i++ ) {
5307 if ( !keepData && node.nodeType === 1 ) {
5308 jQuery.cleanData( getAll( node ) );
5311 if ( node.parentNode ) {
5312 if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
5313 setGlobalEval( getAll( node,
"script" ) );
5315 node.parentNode.removeChild( node );
5323 htmlPrefilter:
function( html ) {
5324 return html.replace( rxhtmlTag,
"<$1></$2>" );
5327 clone:
function( elem, dataAndEvents, deepDataAndEvents ) {
5328 var i, l, srcElements, destElements,
5329 clone = elem.cloneNode(
true ),
5330 inPage = jQuery.contains( elem.ownerDocument, elem );
5333 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
5334 !jQuery.isXMLDoc( elem ) ) {
5337 destElements = getAll( clone );
5338 srcElements = getAll( elem );
5340 for ( i = 0, l = srcElements.length; i < l; i++ ) {
5341 fixInput( srcElements[ i ], destElements[ i ] );
5346 if ( dataAndEvents ) {
5347 if ( deepDataAndEvents ) {
5348 srcElements = srcElements || getAll( elem );
5349 destElements = destElements || getAll( clone );
5351 for ( i = 0, l = srcElements.length; i < l; i++ ) {
5352 cloneCopyEvent( srcElements[ i ], destElements[ i ] );
5355 cloneCopyEvent( elem, clone );
5360 destElements = getAll( clone,
"script" );
5361 if ( destElements.length > 0 ) {
5362 setGlobalEval( destElements, !inPage && getAll( elem,
"script" ) );
5369 cleanData:
function( elems ) {
5370 var data, elem, type,
5371 special = jQuery.event.special,
5374 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
5375 if ( acceptData( elem ) ) {
5376 if ( ( data = elem[ dataPriv.expando ] ) ) {
5377 if ( data.events ) {
5378 for ( type in data.events ) {
5379 if ( special[ type ] ) {
5380 jQuery.event.remove( elem, type );
5384 jQuery.removeEvent( elem, type, data.handle );
5391 elem[ dataPriv.expando ] = undefined;
5393 if ( elem[ dataUser.expando ] ) {
5397 elem[ dataUser.expando ] = undefined;
5409 detach:
function( selector ) {
5410 return remove(
this, selector, true );
5413 remove:
function( selector ) {
5414 return remove(
this, selector );
5417 text:
function( value ) {
5418 return access(
this,
function( value ) {
5419 return value === undefined ?
5420 jQuery.text(
this ) :
5421 this.empty().each(
function() {
5422 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5423 this.textContent = value;
5426 }, null, value, arguments.length );
5429 append:
function() {
5430 return domManip(
this, arguments,
function( elem ) {
5431 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5432 var target = manipulationTarget(
this, elem );
5433 target.appendChild( elem );
5438 prepend:
function() {
5439 return domManip(
this, arguments,
function( elem ) {
5440 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5441 var target = manipulationTarget(
this, elem );
5442 target.insertBefore( elem, target.firstChild );
5447 before:
function() {
5448 return domManip(
this, arguments,
function( elem ) {
5449 if ( this.parentNode ) {
5450 this.parentNode.insertBefore( elem,
this );
5456 return domManip(
this, arguments,
function( elem ) {
5457 if ( this.parentNode ) {
5458 this.parentNode.insertBefore( elem, this.nextSibling );
5467 for ( ; ( elem =
this[ i ] ) != null; i++ ) {
5468 if ( elem.nodeType === 1 ) {
5471 jQuery.cleanData( getAll( elem,
false ) );
5474 elem.textContent =
"";
5481 clone:
function( dataAndEvents, deepDataAndEvents ) {
5482 dataAndEvents = dataAndEvents == null ?
false : dataAndEvents;
5483 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5485 return this.map(
function() {
5486 return jQuery.clone(
this, dataAndEvents, deepDataAndEvents );
5490 html:
function( value ) {
5491 return access(
this,
function( value ) {
5492 var elem =
this[ 0 ] || {},
5496 if ( value === undefined && elem.nodeType === 1 ) {
5497 return elem.innerHTML;
5501 if ( typeof value ===
"string" && !rnoInnerhtml.test( value ) &&
5502 !wrapMap[ ( rtagName.exec( value ) || [
"",
"" ] )[ 1 ].toLowerCase() ] ) {
5504 value = jQuery.htmlPrefilter( value );
5507 for ( ; i < l; i++ ) {
5508 elem =
this[ i ] || {};
5511 if ( elem.nodeType === 1 ) {
5512 jQuery.cleanData( getAll( elem,
false ) );
5513 elem.innerHTML = value;
5524 this.empty().append( value );
5526 }, null, value, arguments.length );
5529 replaceWith:
function() {
5533 return domManip(
this, arguments,
function( elem ) {
5534 var parent = this.parentNode;
5536 if ( jQuery.inArray(
this, ignored ) < 0 ) {
5537 jQuery.cleanData( getAll(
this ) );
5539 parent.replaceChild( elem,
this );
5550 prependTo:
"prepend",
5551 insertBefore:
"before",
5552 insertAfter:
"after",
5553 replaceAll:
"replaceWith"
5554 },
function( name, original ) {
5555 jQuery.fn[ name ] =
function( selector ) {
5558 insert = jQuery( selector ),
5559 last = insert.length - 1,
5562 for ( ; i <= last; i++ ) {
5563 elems = i === last ?
this : this.clone(
true );
5564 jQuery( insert[ i ] )[ original ]( elems );
5568 push.apply( ret, elems.get() );
5571 return this.pushStack( ret );
5592 function actualDisplay( name, doc ) {
5593 var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
5595 display = jQuery.css( elem[ 0 ],
"display" );
5608 function defaultDisplay( nodeName ) {
5610 display = elemdisplay[ nodeName ];
5613 display = actualDisplay( nodeName, doc );
5616 if ( display ===
"none" || !display ) {
5619 iframe = ( iframe || jQuery(
"<iframe frameborder='0' width='0' height='0'/>" ) )
5620 .appendTo( doc.documentElement );
5623 doc = iframe[ 0 ].contentDocument;
5629 display = actualDisplay( nodeName, doc );
5634 elemdisplay[ nodeName ] = display;
5639 var rmargin = ( /^margin/ );
5641 var rnumnonpx =
new RegExp(
"^(" + pnum +
")(?!px)[a-z%]+$",
"i" );
5643 var getStyles =
function( elem ) {
5648 var view = elem.ownerDocument.defaultView;
5650 if ( !view || !view.opener ) {
5654 return view.getComputedStyle( elem );
5657 var swap =
function( elem, options, callback, args ) {
5662 for ( name in options ) {
5663 old[ name ] = elem.style[ name ];
5664 elem.style[ name ] = options[ name ];
5667 ret = callback.apply( elem, args || [] );
5670 for ( name in options ) {
5671 elem.style[ name ] = old[ name ];
5678 var documentElement = document.documentElement;
5683 var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
5684 container = document.createElement(
"div" ),
5685 div = document.createElement(
"div" );
5694 div.style.backgroundClip =
"content-box";
5695 div.cloneNode(
true ).style.backgroundClip =
"";
5696 support.clearCloneStyle = div.style.backgroundClip ===
"content-box";
5698 container.style.cssText =
"border:0;width:8px;height:0;top:0;left:-9999px;" +
5699 "padding:0;margin-top:1px;position:absolute";
5700 container.appendChild( div );
5704 function computeStyleTests() {
5709 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +
5710 "position:relative;display:block;" +
5711 "margin:auto;border:1px;padding:1px;" +
5714 documentElement.appendChild( container );
5716 var divStyle = window.getComputedStyle( div );
5717 pixelPositionVal = divStyle.top !==
"1%";
5718 reliableMarginLeftVal = divStyle.marginLeft ===
"2px";
5719 boxSizingReliableVal = divStyle.width ===
"4px";
5723 div.style.marginRight =
"50%";
5724 pixelMarginRightVal = divStyle.marginRight ===
"4px";
5726 documentElement.removeChild( container );
5729 jQuery.extend( support, {
5730 pixelPosition:
function() {
5735 computeStyleTests();
5736 return pixelPositionVal;
5738 boxSizingReliable:
function() {
5739 if ( boxSizingReliableVal == null ) {
5740 computeStyleTests();
5742 return boxSizingReliableVal;
5744 pixelMarginRight:
function() {
5749 if ( boxSizingReliableVal == null ) {
5750 computeStyleTests();
5752 return pixelMarginRightVal;
5754 reliableMarginLeft:
function() {
5757 if ( boxSizingReliableVal == null ) {
5758 computeStyleTests();
5760 return reliableMarginLeftVal;
5762 reliableMarginRight:
function() {
5770 marginDiv = div.appendChild( document.createElement(
"div" ) );
5773 marginDiv.style.cssText = div.style.cssText =
5777 "-webkit-box-sizing:content-box;box-sizing:content-box;" +
5778 "display:block;margin:0;border:0;padding:0";
5779 marginDiv.style.marginRight = marginDiv.style.width =
"0";
5780 div.style.width =
"1px";
5781 documentElement.appendChild( container );
5783 ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight );
5785 documentElement.removeChild( container );
5786 div.removeChild( marginDiv );
5794 function curCSS( elem, name, computed ) {
5795 var width, minWidth, maxWidth, ret,
5798 computed = computed || getStyles( elem );
5799 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
5804 if ( ( ret ===
"" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
5805 ret = jQuery.style( elem, name );
5817 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
5820 width = style.width;
5821 minWidth = style.minWidth;
5822 maxWidth = style.maxWidth;
5825 style.minWidth = style.maxWidth = style.width = ret;
5826 ret = computed.width;
5829 style.width = width;
5830 style.minWidth = minWidth;
5831 style.maxWidth = maxWidth;
5835 return ret !== undefined ?
5844 function addGetHookIf( conditionFn, hookFn ) {
5849 if ( conditionFn() ) {
5858 return ( this.
get = hookFn ).apply(
this, arguments );
5869 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
5871 cssShow = { position:
"absolute", visibility:
"hidden", display:
"block" },
5872 cssNormalTransform = {
5877 cssPrefixes = [
"Webkit",
"O",
"Moz",
"ms" ],
5878 emptyStyle = document.createElement(
"div" ).style;
5881 function vendorPropName( name ) {
5884 if ( name in emptyStyle ) {
5889 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
5890 i = cssPrefixes.length;
5893 name = cssPrefixes[ i ] + capName;
5894 if ( name in emptyStyle ) {
5900 function setPositiveNumber( elem, value, subtract ) {
5904 var matches = rcssNum.exec( value );
5908 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] ||
"px" ) :
5912 function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
5913 var i = extra === ( isBorderBox ?
"border" :
"content" ) ?
5919 name ===
"width" ? 1 : 0,
5923 for ( ; i < 4; i += 2 ) {
5926 if ( extra ===
"margin" ) {
5927 val += jQuery.css( elem, extra + cssExpand[ i ],
true, styles );
5930 if ( isBorderBox ) {
5933 if ( extra ===
"content" ) {
5934 val -= jQuery.css( elem,
"padding" + cssExpand[ i ],
true, styles );
5938 if ( extra !==
"margin" ) {
5939 val -= jQuery.css( elem,
"border" + cssExpand[ i ] +
"Width",
true, styles );
5944 val += jQuery.css( elem,
"padding" + cssExpand[ i ],
true, styles );
5947 if ( extra !==
"padding" ) {
5948 val += jQuery.css( elem,
"border" + cssExpand[ i ] +
"Width",
true, styles );
5956 function getWidthOrHeight( elem, name, extra ) {
5959 var valueIsBorderBox =
true,
5960 val = name ===
"width" ? elem.offsetWidth : elem.offsetHeight,
5961 styles = getStyles( elem ),
5962 isBorderBox = jQuery.css( elem,
"boxSizing",
false, styles ) ===
"border-box";
5967 if ( document.msFullscreenElement && window.top !== window ) {
5972 if ( elem.getClientRects().length ) {
5973 val = Math.round( elem.getBoundingClientRect()[ name ] * 100 );
5980 if ( val <= 0 || val == null ) {
5983 val = curCSS( elem, name, styles );
5984 if ( val < 0 || val == null ) {
5985 val = elem.style[ name ];
5989 if ( rnumnonpx.test( val ) ) {
5995 valueIsBorderBox = isBorderBox &&
5996 ( support.boxSizingReliable() || val === elem.style[ name ] );
5999 val = parseFloat( val ) || 0;
6004 augmentWidthOrHeight(
6007 extra || ( isBorderBox ?
"border" :
"content" ),
6014 function showHide( elements, show ) {
6015 var display, elem, hidden,
6018 length = elements.length;
6020 for ( ; index < length; index++ ) {
6021 elem = elements[ index ];
6022 if ( !elem.style ) {
6026 values[ index ] = dataPriv.get( elem,
"olddisplay" );
6027 display = elem.style.display;
6032 if ( !values[ index ] && display ===
"none" ) {
6033 elem.style.display =
"";
6039 if ( elem.style.display ===
"" && isHidden( elem ) ) {
6040 values[ index ] = dataPriv.access(
6043 defaultDisplay( elem.nodeName )
6047 hidden = isHidden( elem );
6049 if ( display !==
"none" || !hidden ) {
6053 hidden ? display : jQuery.css( elem,
"display" )
6061 for ( index = 0; index < length; index++ ) {
6062 elem = elements[ index ];
6063 if ( !elem.style ) {
6066 if ( !show || elem.style.display ===
"none" || elem.style.display ===
"" ) {
6067 elem.style.display = show ? values[ index ] ||
"" :
"none";
6080 get:
function( elem, computed ) {
6084 var ret = curCSS( elem,
"opacity" );
6085 return ret ===
"" ?
"1" : ret;
6093 "animationIterationCount":
true,
6094 "columnCount":
true,
6095 "fillOpacity":
true,
6115 style:
function( elem, name, value, extra ) {
6118 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6123 var ret, type, hooks,
6124 origName = jQuery.camelCase( name ),
6127 name = jQuery.cssProps[ origName ] ||
6128 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
6131 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6134 if ( value !== undefined ) {
6135 type = typeof value;
6138 if ( type ===
"string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
6139 value = adjustCSS( elem, name, ret );
6146 if ( value == null || value !== value ) {
6151 if ( type ===
"number" ) {
6152 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ?
"" :
"px" );
6157 if ( !support.clearCloneStyle && value ===
"" && name.indexOf(
"background" ) === 0 ) {
6158 style[ name ] =
"inherit";
6162 if ( !hooks || !(
"set" in hooks ) ||
6163 ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
6165 style[ name ] = value;
6171 if ( hooks &&
"get" in hooks &&
6172 ( ret = hooks.get( elem,
false, extra ) ) !== undefined ) {
6178 return style[ name ];
6182 css:
function( elem, name, extra, styles ) {
6183 var val, num, hooks,
6184 origName = jQuery.camelCase( name );
6187 name = jQuery.cssProps[ origName ] ||
6188 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
6191 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6194 if ( hooks &&
"get" in hooks ) {
6195 val = hooks.get( elem,
true, extra );
6199 if ( val === undefined ) {
6200 val = curCSS( elem, name, styles );
6204 if ( val ===
"normal" && name in cssNormalTransform ) {
6205 val = cssNormalTransform[ name ];
6209 if ( extra ===
"" || extra ) {
6210 num = parseFloat( val );
6211 return extra ===
true || isFinite( num ) ? num || 0 : val;
6217 jQuery.each( [
"height",
"width" ],
function( i, name ) {
6218 jQuery.cssHooks[ name ] = {
6219 get:
function( elem, computed, extra ) {
6224 return rdisplayswap.test( jQuery.css( elem,
"display" ) ) &&
6225 elem.offsetWidth === 0 ?
6226 swap( elem, cssShow,
function() {
6227 return getWidthOrHeight( elem, name, extra );
6229 getWidthOrHeight( elem, name, extra );
6233 set:
function( elem, value, extra ) {
6235 styles = extra && getStyles( elem ),
6236 subtract = extra && augmentWidthOrHeight(
6240 jQuery.css( elem,
"boxSizing",
false, styles ) ===
"border-box",
6245 if ( subtract && ( matches = rcssNum.exec( value ) ) &&
6246 ( matches[ 3 ] ||
"px" ) !==
"px" ) {
6248 elem.style[ name ] = value;
6249 value = jQuery.css( elem, name );
6252 return setPositiveNumber( elem, value, subtract );
6257 jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
6258 function( elem, computed ) {
6260 return ( parseFloat( curCSS( elem,
"marginLeft" ) ) ||
6261 elem.getBoundingClientRect().left -
6262 swap( elem, { marginLeft: 0 },
function() {
6263 return elem.getBoundingClientRect().left;
6271 jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
6272 function( elem, computed ) {
6274 return swap( elem, {
"display":
"inline-block" },
6275 curCSS, [ elem,
"marginRight" ] );
6285 },
function( prefix, suffix ) {
6286 jQuery.cssHooks[ prefix + suffix ] = {
6287 expand:
function( value ) {
6292 parts = typeof value ===
"string" ? value.split(
" " ) : [ value ];
6294 for ( ; i < 4; i++ ) {
6295 expanded[ prefix + cssExpand[ i ] + suffix ] =
6296 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6303 if ( !rmargin.test( prefix ) ) {
6304 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6309 css:
function( name, value ) {
6310 return access(
this,
function( elem, name, value ) {
6315 if ( jQuery.isArray( name ) ) {
6316 styles = getStyles( elem );
6319 for ( ; i < len; i++ ) {
6320 map[ name[ i ] ] = jQuery.css( elem, name[ i ],
false, styles );
6326 return value !== undefined ?
6327 jQuery.style( elem, name, value ) :
6328 jQuery.css( elem, name );
6329 }, name, value, arguments.length > 1 );
6332 return showHide(
this,
true );
6335 return showHide(
this );
6337 toggle:
function( state ) {
6338 if ( typeof state ===
"boolean" ) {
6339 return state ? this.show() : this.hide();
6342 return this.each(
function() {
6343 if ( isHidden(
this ) ) {
6344 jQuery(
this ).show();
6346 jQuery(
this ).hide();
6353 function Tween( elem, options, prop, end, easing ) {
6354 return new Tween.prototype.init( elem, options, prop, end, easing );
6356 jQuery.Tween = Tween;
6360 init:
function( elem, options, prop, end, easing, unit ) {
6363 this.easing = easing || jQuery.easing._default;
6364 this.options = options;
6365 this.start = this.now = this.cur();
6367 this.unit = unit || ( jQuery.cssNumber[ prop ] ?
"" :
"px" );
6370 var hooks = Tween.propHooks[ this.prop ];
6372 return hooks && hooks.get ?
6374 Tween.propHooks._default.get(
this );
6376 run:
function( percent ) {
6378 hooks = Tween.propHooks[ this.prop ];
6380 if ( this.options.duration ) {
6381 this.pos = eased = jQuery.easing[ this.easing ](
6382 percent, this.options.duration * percent, 0, 1, this.options.duration
6385 this.pos = eased = percent;
6387 this.now = ( this.end - this.start ) * eased + this.start;
6389 if ( this.options.step ) {
6390 this.options.step.call( this.elem, this.now,
this );
6393 if ( hooks && hooks.set ) {
6396 Tween.propHooks._default.set(
this );
6402 Tween.prototype.init.prototype = Tween.prototype;
6406 get:
function( tween ) {
6411 if ( tween.elem.nodeType !== 1 ||
6412 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
6413 return tween.elem[ tween.prop ];
6420 result = jQuery.css( tween.elem, tween.prop,
"" );
6423 return !result || result ===
"auto" ? 0 : result;
6425 set:
function( tween ) {
6430 if ( jQuery.fx.step[ tween.prop ] ) {
6431 jQuery.fx.step[ tween.prop ]( tween );
6432 }
else if ( tween.elem.nodeType === 1 &&
6433 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
6434 jQuery.cssHooks[ tween.prop ] ) ) {
6435 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
6437 tween.elem[ tween.prop ] = tween.now;
6445 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
6446 set:
function( tween ) {
6447 if ( tween.elem.nodeType && tween.elem.parentNode ) {
6448 tween.elem[ tween.prop ] = tween.now;
6454 linear:
function( p ) {
6457 swing:
function( p ) {
6458 return 0.5 - Math.cos( p * Math.PI ) / 2;
6463 jQuery.fx = Tween.prototype.init;
6466 jQuery.fx.step = {};
6473 rfxtypes = /^(?:toggle|show|hide)$/,
6474 rrun = /queueHooks$/;
6477 function createFxNow() {
6478 window.setTimeout(
function() {
6481 return ( fxNow = jQuery.now() );
6485 function genFx( type, includeWidth ) {
6488 attrs = { height: type };
6492 includeWidth = includeWidth ? 1 : 0;
6493 for ( ; i < 4 ; i += 2 - includeWidth ) {
6494 which = cssExpand[ i ];
6495 attrs[
"margin" + which ] = attrs[
"padding" + which ] = type;
6498 if ( includeWidth ) {
6499 attrs.opacity = attrs.width = type;
6505 function createTween( value, prop, animation ) {
6507 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[
"*" ] ),
6509 length = collection.length;
6510 for ( ; index < length; index++ ) {
6511 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
6519 function defaultPrefilter( elem, props, opts ) {
6521 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
6525 hidden = elem.nodeType && isHidden( elem ),
6526 dataShow = dataPriv.get( elem,
"fxshow" );
6529 if ( !opts.queue ) {
6530 hooks = jQuery._queueHooks( elem,
"fx" );
6531 if ( hooks.unqueued == null ) {
6533 oldfire = hooks.empty.fire;
6534 hooks.empty.fire =
function() {
6535 if ( !hooks.unqueued ) {
6542 anim.always(
function() {
6545 anim.always(
function() {
6547 if ( !jQuery.queue( elem,
"fx" ).length ) {
6555 if ( elem.nodeType === 1 && (
"height" in props ||
"width" in props ) ) {
6561 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
6565 display = jQuery.css( elem,
"display" );
6568 checkDisplay = display ===
"none" ?
6569 dataPriv.get( elem,
"olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
6571 if ( checkDisplay ===
"inline" && jQuery.css( elem,
"float" ) ===
"none" ) {
6572 style.display =
"inline-block";
6576 if ( opts.overflow ) {
6577 style.overflow =
"hidden";
6578 anim.always(
function() {
6579 style.overflow = opts.overflow[ 0 ];
6580 style.overflowX = opts.overflow[ 1 ];
6581 style.overflowY = opts.overflow[ 2 ];
6586 for ( prop in props ) {
6587 value = props[ prop ];
6588 if ( rfxtypes.exec( value ) ) {
6589 delete props[ prop ];
6590 toggle = toggle || value ===
"toggle";
6591 if ( value === ( hidden ?
"hide" :
"show" ) ) {
6595 if ( value ===
"show" && dataShow && dataShow[ prop ] !== undefined ) {
6601 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
6605 display = undefined;
6609 if ( !jQuery.isEmptyObject( orig ) ) {
6611 if (
"hidden" in dataShow ) {
6612 hidden = dataShow.hidden;
6615 dataShow = dataPriv.access( elem,
"fxshow", {} );
6620 dataShow.hidden = !hidden;
6623 jQuery( elem ).show();
6625 anim.done(
function() {
6626 jQuery( elem ).hide();
6629 anim.done(
function() {
6632 dataPriv.remove( elem,
"fxshow" );
6633 for ( prop in orig ) {
6634 jQuery.style( elem, prop, orig[ prop ] );
6637 for ( prop in orig ) {
6638 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
6640 if ( !( prop in dataShow ) ) {
6641 dataShow[ prop ] = tween.start;
6643 tween.end = tween.start;
6644 tween.start = prop ===
"width" || prop ===
"height" ? 1 : 0;
6650 }
else if ( ( display ===
"none" ? defaultDisplay( elem.nodeName ) : display ) ===
"inline" ) {
6651 style.display = display;
6655 function propFilter( props, specialEasing ) {
6656 var index, name, easing, value, hooks;
6659 for ( index in props ) {
6660 name = jQuery.camelCase( index );
6661 easing = specialEasing[ name ];
6662 value = props[ index ];
6663 if ( jQuery.isArray( value ) ) {
6664 easing = value[ 1 ];
6665 value = props[ index ] = value[ 0 ];
6668 if ( index !== name ) {
6669 props[ name ] = value;
6670 delete props[ index ];
6673 hooks = jQuery.cssHooks[ name ];
6674 if ( hooks &&
"expand" in hooks ) {
6675 value = hooks.expand( value );
6676 delete props[ name ];
6680 for ( index in value ) {
6681 if ( !( index in props ) ) {
6682 props[ index ] = value[ index ];
6683 specialEasing[ index ] = easing;
6687 specialEasing[ name ] = easing;
6692 function Animation( elem, properties, options ) {
6696 length = Animation.prefilters.length,
6697 deferred = jQuery.Deferred().always(
function() {
6706 var currentTime = fxNow || createFxNow(),
6707 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
6711 temp = remaining / animation.duration || 0,
6714 length = animation.tweens.length;
6716 for ( ; index < length ; index++ ) {
6717 animation.tweens[ index ].run( percent );
6720 deferred.notifyWith( elem, [ animation, percent, remaining ] );
6722 if ( percent < 1 && length ) {
6725 deferred.resolveWith( elem, [ animation ] );
6729 animation = deferred.promise( {
6731 props: jQuery.extend( {}, properties ),
6732 opts: jQuery.extend(
true, {
6734 easing: jQuery.easing._default
6736 originalProperties: properties,
6737 originalOptions: options,
6738 startTime: fxNow || createFxNow(),
6739 duration: options.duration,
6741 createTween:
function( prop, end ) {
6742 var tween = jQuery.Tween( elem, animation.opts, prop, end,
6743 animation.opts.specialEasing[ prop ] || animation.opts.easing );
6744 animation.tweens.push( tween );
6747 stop:
function( gotoEnd ) {
6752 length = gotoEnd ? animation.tweens.length : 0;
6757 for ( ; index < length ; index++ ) {
6758 animation.tweens[ index ].run( 1 );
6763 deferred.notifyWith( elem, [ animation, 1, 0 ] );
6764 deferred.resolveWith( elem, [ animation, gotoEnd ] );
6766 deferred.rejectWith( elem, [ animation, gotoEnd ] );
6771 props = animation.props;
6773 propFilter( props, animation.opts.specialEasing );
6775 for ( ; index < length ; index++ ) {
6776 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
6778 if ( jQuery.isFunction( result.stop ) ) {
6779 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
6780 jQuery.proxy( result.stop, result );
6786 jQuery.map( props, createTween, animation );
6788 if ( jQuery.isFunction( animation.opts.start ) ) {
6789 animation.opts.start.call( elem, animation );
6793 jQuery.extend( tick, {
6796 queue: animation.opts.queue
6801 return animation.progress( animation.opts.progress )
6802 .done( animation.opts.done, animation.opts.complete )
6803 .fail( animation.opts.fail )
6804 .always( animation.opts.always );
6807 jQuery.Animation = jQuery.extend( Animation, {
6809 "*": [
function( prop, value ) {
6810 var tween = this.createTween( prop, value );
6811 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
6816 tweener:
function( props, callback ) {
6817 if ( jQuery.isFunction( props ) ) {
6821 props = props.match( rnotwhite );
6826 length = props.length;
6828 for ( ; index < length ; index++ ) {
6829 prop = props[ index ];
6830 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
6831 Animation.tweeners[ prop ].unshift( callback );
6835 prefilters: [ defaultPrefilter ],
6837 prefilter:
function( callback, prepend ) {
6839 Animation.prefilters.unshift( callback );
6841 Animation.prefilters.push( callback );
6846 jQuery.speed =
function( speed, easing, fn ) {
6847 var opt = speed && typeof speed ===
"object" ? jQuery.extend( {}, speed ) : {
6848 complete: fn || !fn && easing ||
6849 jQuery.isFunction( speed ) && speed,
6851 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
6854 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration ===
"number" ?
6855 opt.duration : opt.duration in jQuery.fx.speeds ?
6856 jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
6859 if ( opt.queue == null || opt.queue ===
true ) {
6864 opt.old = opt.complete;
6866 opt.complete =
function() {
6867 if ( jQuery.isFunction( opt.old ) ) {
6868 opt.old.call(
this );
6872 jQuery.dequeue(
this, opt.queue );
6880 fadeTo:
function( speed, to, easing, callback ) {
6883 return this.filter( isHidden ).css(
"opacity", 0 ).show()
6886 .end().animate( { opacity: to }, speed, easing, callback );
6888 animate:
function( prop, speed, easing, callback ) {
6889 var empty = jQuery.isEmptyObject( prop ),
6890 optall = jQuery.speed( speed, easing, callback ),
6891 doAnimation =
function() {
6894 var anim = Animation(
this, jQuery.extend( {}, prop ), optall );
6897 if ( empty || dataPriv.get(
this,
"finish" ) ) {
6901 doAnimation.finish = doAnimation;
6903 return empty || optall.queue ===
false ?
6904 this.each( doAnimation ) :
6905 this.queue( optall.queue, doAnimation );
6907 stop:
function( type, clearQueue, gotoEnd ) {
6908 var stopQueue =
function( hooks ) {
6909 var stop = hooks.stop;
6914 if ( typeof type !==
"string" ) {
6915 gotoEnd = clearQueue;
6919 if ( clearQueue && type !==
false ) {
6920 this.queue( type ||
"fx", [] );
6923 return this.each(
function() {
6925 index = type != null && type +
"queueHooks",
6926 timers = jQuery.timers,
6927 data = dataPriv.get(
this );
6930 if ( data[ index ] && data[ index ].stop ) {
6931 stopQueue( data[ index ] );
6934 for ( index in data ) {
6935 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
6936 stopQueue( data[ index ] );
6941 for ( index = timers.length; index--; ) {
6942 if ( timers[ index ].elem ===
this &&
6943 ( type == null || timers[ index ].queue === type ) ) {
6945 timers[ index ].anim.stop( gotoEnd );
6947 timers.splice( index, 1 );
6954 if ( dequeue || !gotoEnd ) {
6955 jQuery.dequeue(
this, type );
6959 finish:
function( type ) {
6960 if ( type !==
false ) {
6961 type = type ||
"fx";
6963 return this.each(
function() {
6965 data = dataPriv.get(
this ),
6966 queue = data[ type +
"queue" ],
6967 hooks = data[ type +
"queueHooks" ],
6968 timers = jQuery.timers,
6969 length = queue ? queue.length : 0;
6975 jQuery.queue(
this, type, [] );
6977 if ( hooks && hooks.stop ) {
6978 hooks.stop.call(
this,
true );
6982 for ( index = timers.length; index--; ) {
6983 if ( timers[ index ].elem ===
this && timers[ index ].queue === type ) {
6984 timers[ index ].anim.stop(
true );
6985 timers.splice( index, 1 );
6990 for ( index = 0; index < length; index++ ) {
6991 if ( queue[ index ] && queue[ index ].finish ) {
6992 queue[ index ].finish.call(
this );
7002 jQuery.each( [
"toggle",
"show",
"hide" ],
function( i, name ) {
7003 var cssFn = jQuery.fn[ name ];
7004 jQuery.fn[ name ] =
function( speed, easing, callback ) {
7005 return speed == null || typeof speed ===
"boolean" ?
7006 cssFn.apply(
this, arguments ) :
7007 this.animate( genFx( name,
true ), speed, easing, callback );
7013 slideDown: genFx(
"show" ),
7014 slideUp: genFx(
"hide" ),
7015 slideToggle: genFx(
"toggle" ),
7016 fadeIn: { opacity:
"show" },
7017 fadeOut: { opacity:
"hide" },
7018 fadeToggle: { opacity:
"toggle" }
7019 },
function( name, props ) {
7020 jQuery.fn[ name ] =
function( speed, easing, callback ) {
7021 return this.animate( props, speed, easing, callback );
7026 jQuery.fx.tick =
function() {
7029 timers = jQuery.timers;
7031 fxNow = jQuery.now();
7033 for ( ; i < timers.length; i++ ) {
7034 timer = timers[ i ];
7037 if ( !timer() && timers[ i ] === timer ) {
7038 timers.splice( i--, 1 );
7042 if ( !timers.length ) {
7048 jQuery.fx.timer =
function( timer ) {
7049 jQuery.timers.push( timer );
7053 jQuery.timers.pop();
7057 jQuery.fx.interval = 13;
7058 jQuery.fx.start =
function() {
7060 timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
7064 jQuery.fx.stop =
function() {
7065 window.clearInterval( timerId );
7070 jQuery.fx.speeds = {
7081 jQuery.fn.delay =
function( time, type ) {
7082 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7083 type = type ||
"fx";
7085 return this.queue( type,
function( next, hooks ) {
7086 var timeout = window.setTimeout( next, time );
7087 hooks.stop =
function() {
7088 window.clearTimeout( timeout );
7095 var input = document.createElement(
"input" ),
7096 select = document.createElement(
"select" ),
7097 opt = select.appendChild( document.createElement(
"option" ) );
7099 input.type =
"checkbox";
7103 support.checkOn = input.value !==
"";
7107 support.optSelected = opt.selected;
7111 select.disabled =
true;
7112 support.optDisabled = !opt.disabled;
7116 input = document.createElement(
"input" );
7118 input.type =
"radio";
7119 support.radioValue = input.value ===
"t";
7124 attrHandle = jQuery.expr.attrHandle;
7127 attr:
function( name, value ) {
7128 return access(
this, jQuery.attr, name, value, arguments.length > 1 );
7131 removeAttr:
function( name ) {
7132 return this.each(
function() {
7133 jQuery.removeAttr(
this, name );
7139 attr:
function( elem, name, value ) {
7141 nType = elem.nodeType;
7144 if ( nType === 3 || nType === 8 || nType === 2 ) {
7149 if ( typeof elem.getAttribute ===
"undefined" ) {
7150 return jQuery.prop( elem, name, value );
7155 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7156 name = name.toLowerCase();
7157 hooks = jQuery.attrHooks[ name ] ||
7158 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
7161 if ( value !== undefined ) {
7162 if ( value === null ) {
7163 jQuery.removeAttr( elem, name );
7167 if ( hooks &&
"set" in hooks &&
7168 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7172 elem.setAttribute( name, value +
"" );
7176 if ( hooks &&
"get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7180 ret = jQuery.find.attr( elem, name );
7183 return ret == null ? undefined : ret;
7188 set:
function( elem, value ) {
7189 if ( !support.radioValue && value ===
"radio" &&
7190 jQuery.nodeName( elem,
"input" ) ) {
7191 var val = elem.value;
7192 elem.setAttribute(
"type", value );
7202 removeAttr:
function( elem, value ) {
7205 attrNames = value && value.match( rnotwhite );
7207 if ( attrNames && elem.nodeType === 1 ) {
7208 while ( ( name = attrNames[ i++ ] ) ) {
7209 propName = jQuery.propFix[ name ] || name;
7212 if ( jQuery.expr.match.bool.test( name ) ) {
7215 elem[ propName ] =
false;
7218 elem.removeAttribute( name );
7226 set:
function( elem, value, name ) {
7227 if ( value ===
false ) {
7230 jQuery.removeAttr( elem, name );
7232 elem.setAttribute( name, name );
7237 jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ),
function( i, name ) {
7238 var getter = attrHandle[ name ] || jQuery.find.attr;
7240 attrHandle[ name ] =
function( elem, name, isXML ) {
7245 handle = attrHandle[ name ];
7246 attrHandle[ name ] = ret;
7247 ret = getter( elem, name, isXML ) != null ?
7248 name.toLowerCase() :
7250 attrHandle[ name ] = handle;
7259 var rfocusable = /^(?:input|select|textarea|button)$/i,
7260 rclickable = /^(?:a|area)$/i;
7263 prop:
function( name, value ) {
7264 return access(
this, jQuery.prop, name, value, arguments.length > 1 );
7267 removeProp:
function( name ) {
7268 return this.each(
function() {
7269 delete this[ jQuery.propFix[ name ] || name ];
7275 prop:
function( elem, name, value ) {
7277 nType = elem.nodeType;
7280 if ( nType === 3 || nType === 8 || nType === 2 ) {
7284 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7287 name = jQuery.propFix[ name ] || name;
7288 hooks = jQuery.propHooks[ name ];
7291 if ( value !== undefined ) {
7292 if ( hooks &&
"set" in hooks &&
7293 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7297 return ( elem[ name ] = value );
7300 if ( hooks &&
"get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7304 return elem[ name ];
7309 get:
function( elem ) {
7315 var tabindex = jQuery.find.attr( elem,
"tabindex" );
7318 parseInt( tabindex, 10 ) :
7319 rfocusable.test( elem.nodeName ) ||
7320 rclickable.test( elem.nodeName ) && elem.href ?
7329 "class":
"className"
7339 if ( !support.optSelected ) {
7340 jQuery.propHooks.selected = {
7341 get:
function( elem ) {
7342 var parent = elem.parentNode;
7343 if ( parent && parent.parentNode ) {
7344 parent.parentNode.selectedIndex;
7348 set:
function( elem ) {
7349 var parent = elem.parentNode;
7351 parent.selectedIndex;
7353 if ( parent.parentNode ) {
7354 parent.parentNode.selectedIndex;
7373 jQuery.propFix[ this.toLowerCase() ] =
this;
7379 var rclass = /[\t\r\n\f]/g;
7381 function getClass( elem ) {
7382 return elem.getAttribute && elem.getAttribute(
"class" ) ||
"";
7386 addClass:
function( value ) {
7387 var classes, elem, cur, curValue, clazz, j, finalValue,
7390 if ( jQuery.isFunction( value ) ) {
7391 return this.each(
function( j ) {
7392 jQuery(
this ).addClass( value.call(
this, j, getClass(
this ) ) );
7396 if ( typeof value ===
"string" && value ) {
7397 classes = value.match( rnotwhite ) || [];
7399 while ( ( elem =
this[ i++ ] ) ) {
7400 curValue = getClass( elem );
7401 cur = elem.nodeType === 1 &&
7402 (
" " + curValue +
" " ).replace( rclass,
" " );
7406 while ( ( clazz = classes[ j++ ] ) ) {
7407 if ( cur.indexOf(
" " + clazz +
" " ) < 0 ) {
7413 finalValue = jQuery.trim( cur );
7414 if ( curValue !== finalValue ) {
7415 elem.setAttribute(
"class", finalValue );
7424 removeClass:
function( value ) {
7425 var classes, elem, cur, curValue, clazz, j, finalValue,
7428 if ( jQuery.isFunction( value ) ) {
7429 return this.each(
function( j ) {
7430 jQuery(
this ).removeClass( value.call(
this, j, getClass(
this ) ) );
7434 if ( !arguments.length ) {
7435 return this.attr(
"class",
"" );
7438 if ( typeof value ===
"string" && value ) {
7439 classes = value.match( rnotwhite ) || [];
7441 while ( ( elem =
this[ i++ ] ) ) {
7442 curValue = getClass( elem );
7445 cur = elem.nodeType === 1 &&
7446 (
" " + curValue +
" " ).replace( rclass,
" " );
7450 while ( ( clazz = classes[ j++ ] ) ) {
7453 while ( cur.indexOf(
" " + clazz +
" " ) > -1 ) {
7454 cur = cur.replace(
" " + clazz +
" ",
" " );
7459 finalValue = jQuery.trim( cur );
7460 if ( curValue !== finalValue ) {
7461 elem.setAttribute(
"class", finalValue );
7470 toggleClass:
function( value, stateVal ) {
7471 var type = typeof value;
7473 if ( typeof stateVal ===
"boolean" && type ===
"string" ) {
7474 return stateVal ? this.addClass( value ) : this.removeClass( value );
7477 if ( jQuery.isFunction( value ) ) {
7478 return this.each(
function( i ) {
7479 jQuery(
this ).toggleClass(
7480 value.call(
this, i, getClass(
this ), stateVal ),
7486 return this.each(
function() {
7487 var className, i,
self, classNames;
7489 if ( type ===
"string" ) {
7493 self = jQuery(
this );
7494 classNames = value.match( rnotwhite ) || [];
7496 while ( ( className = classNames[ i++ ] ) ) {
7499 if (
self.hasClass( className ) ) {
7500 self.removeClass( className );
7502 self.addClass( className );
7507 }
else if ( value === undefined || type ===
"boolean" ) {
7508 className = getClass(
this );
7512 dataPriv.set(
this,
"__className__", className );
7519 if ( this.setAttribute ) {
7520 this.setAttribute(
"class",
7521 className || value ===
false ?
7523 dataPriv.get(
this,
"__className__" ) ||
""
7530 hasClass:
function( selector ) {
7531 var className, elem,
7534 className =
" " + selector +
" ";
7535 while ( ( elem =
this[ i++ ] ) ) {
7536 if ( elem.nodeType === 1 &&
7537 (
" " + getClass( elem ) +
" " ).replace( rclass,
" " )
7538 .indexOf( className ) > -1
7551 var rreturn = /\r/g,
7552 rspaces = /[\x20\t\r\n\f]+/g;
7555 val:
function( value ) {
7556 var hooks, ret, isFunction,
7559 if ( !arguments.length ) {
7561 hooks = jQuery.valHooks[ elem.type ] ||
7562 jQuery.valHooks[ elem.nodeName.toLowerCase() ];
7566 ( ret = hooks.get( elem,
"value" ) ) !== undefined
7573 return typeof ret ===
"string" ?
7576 ret.replace( rreturn,
"" ) :
7579 ret == null ?
"" : ret;
7585 isFunction = jQuery.isFunction( value );
7587 return this.each(
function( i ) {
7590 if ( this.nodeType !== 1 ) {
7595 val = value.call(
this, i, jQuery(
this ).val() );
7601 if ( val == null ) {
7604 }
else if ( typeof val ===
"number" ) {
7607 }
else if ( jQuery.isArray( val ) ) {
7608 val = jQuery.map( val,
function( value ) {
7609 return value == null ?
"" : value +
"";
7613 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
7616 if ( !hooks || !(
"set" in hooks ) || hooks.set(
this, val,
"value" ) === undefined ) {
7626 get:
function( elem ) {
7628 var val = jQuery.find.attr( elem,
"value" );
7629 return val != null ?
7636 jQuery.trim( jQuery.text( elem ) ).replace( rspaces,
" " );
7640 get:
function( elem ) {
7642 options = elem.options,
7643 index = elem.selectedIndex,
7644 one = elem.type ===
"select-one" || index < 0,
7645 values = one ? null : [],
7646 max = one ? index + 1 : options.length,
7652 for ( ; i < max; i++ ) {
7653 option = options[ i ];
7656 if ( ( option.selected || i === index ) &&
7659 ( support.optDisabled ?
7660 !option.disabled : option.getAttribute(
"disabled" ) === null ) &&
7661 ( !option.parentNode.disabled ||
7662 !jQuery.nodeName( option.parentNode,
"optgroup" ) ) ) {
7665 value = jQuery( option ).val();
7673 values.push( value );
7680 set:
function( elem, value ) {
7681 var optionSet, option,
7682 options = elem.options,
7683 values = jQuery.makeArray( value ),
7687 option = options[ i ];
7688 if ( option.selected =
7689 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
7697 elem.selectedIndex = -1;
7706 jQuery.each( [
"radio",
"checkbox" ],
function() {
7707 jQuery.valHooks[ this ] = {
7708 set:
function( elem, value ) {
7709 if ( jQuery.isArray( value ) ) {
7710 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
7714 if ( !support.checkOn ) {
7715 jQuery.valHooks[ this ].get =
function( elem ) {
7716 return elem.getAttribute(
"value" ) === null ?
"on" : elem.value;
7727 var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
7729 jQuery.extend( jQuery.event, {
7731 trigger:
function( event, data, elem, onlyHandlers ) {
7733 var i, cur, tmp, bubbleType, ontype, handle, special,
7734 eventPath = [ elem || document ],
7735 type = hasOwn.call( event,
"type" ) ?
event.type : event,
7736 namespaces = hasOwn.call( event,
"namespace" ) ?
event.namespace.split(
"." ) : [];
7738 cur = tmp = elem = elem || document;
7741 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
7746 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
7750 if ( type.indexOf(
"." ) > -1 ) {
7753 namespaces = type.split(
"." );
7754 type = namespaces.shift();
7757 ontype = type.indexOf(
":" ) < 0 &&
"on" + type;
7760 event =
event[ jQuery.expando ] ?
7762 new jQuery.Event( type, typeof event ===
"object" && event );
7765 event.isTrigger = onlyHandlers ? 2 : 3;
7766 event.namespace = namespaces.join(
"." );
7767 event.rnamespace =
event.namespace ?
7768 new RegExp(
"(^|\\.)" + namespaces.join(
"\\.(?:.*\\.|)" ) +
"(\\.|$)" ) :
7772 event.result = undefined;
7773 if ( !event.target ) {
7774 event.target = elem;
7778 data = data == null ?
7780 jQuery.makeArray( data, [ event ] );
7783 special = jQuery.event.special[ type ] || {};
7784 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
7790 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
7792 bubbleType = special.delegateType || type;
7793 if ( !rfocusMorph.test( bubbleType + type ) ) {
7794 cur = cur.parentNode;
7796 for ( ; cur; cur = cur.parentNode ) {
7797 eventPath.push( cur );
7802 if ( tmp === ( elem.ownerDocument || document ) ) {
7803 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
7809 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
7811 event.type = i > 1 ?
7813 special.bindType || type;
7816 handle = ( dataPriv.get( cur,
"events" ) || {} )[ event.type ] &&
7817 dataPriv.get( cur,
"handle" );
7819 handle.apply( cur, data );
7823 handle = ontype && cur[ ontype ];
7824 if ( handle && handle.apply && acceptData( cur ) ) {
7825 event.result = handle.apply( cur, data );
7826 if ( event.result ===
false ) {
7827 event.preventDefault();
7834 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
7836 if ( ( !special._default ||
7837 special._default.apply( eventPath.pop(), data ) ===
false ) &&
7838 acceptData( elem ) ) {
7842 if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
7845 tmp = elem[ ontype ];
7848 elem[ ontype ] = null;
7852 jQuery.event.triggered = type;
7854 jQuery.event.triggered = undefined;
7857 elem[ ontype ] = tmp;
7863 return event.result;
7867 simulate:
function( type, elem, event ) {
7868 var e = jQuery.extend(
7890 jQuery.event.trigger( e, null, elem );
7892 if ( e.isDefaultPrevented() ) {
7893 event.preventDefault();
7901 trigger:
function( type, data ) {
7902 return this.each(
function() {
7903 jQuery.event.trigger( type, data,
this );
7906 triggerHandler:
function( type, data ) {
7907 var elem =
this[ 0 ];
7909 return jQuery.event.trigger( type, data, elem,
true );
7915 jQuery.each( (
"blur focus focusin focusout load resize scroll unload click dblclick " +
7916 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
7917 "change select submit keydown keypress keyup error contextmenu" ).split(
" " ),
7918 function( i, name ) {
7921 jQuery.fn[ name ] =
function( data, fn ) {
7922 return arguments.length > 0 ?
7923 this.on( name, null, data, fn ) :
7924 this.trigger( name );
7929 hover:
function( fnOver, fnOut ) {
7930 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
7937 support.focusin =
"onfocusin" in window;
7948 if ( !support.focusin ) {
7949 jQuery.each( { focus:
"focusin", blur:
"focusout" },
function( orig, fix ) {
7952 var handler =
function( event ) {
7953 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
7956 jQuery.event.special[ fix ] = {
7958 var doc = this.ownerDocument ||
this,
7959 attaches = dataPriv.access( doc, fix );
7962 doc.addEventListener( orig, handler,
true );
7964 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
7966 teardown:
function() {
7967 var doc = this.ownerDocument ||
this,
7968 attaches = dataPriv.access( doc, fix ) - 1;
7971 doc.removeEventListener( orig, handler,
true );
7972 dataPriv.remove( doc, fix );
7975 dataPriv.access( doc, fix, attaches );
7981 var location = window.location;
7983 var nonce = jQuery.now();
7985 var rquery = ( /\?/ );
7991 jQuery.parseJSON =
function( data ) {
7992 return JSON.parse( data +
"" );
7997 jQuery.parseXML =
function( data ) {
7999 if ( !data || typeof data !==
"string" ) {
8005 xml = (
new window.DOMParser() ).parseFromString( data,
"text/xml" );
8010 if ( !xml || xml.getElementsByTagName(
"parsererror" ).length ) {
8011 jQuery.error(
"Invalid XML: " + data );
8019 rts = /([?&])_=[^&]*/,
8020 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
8023 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8024 rnoContent = /^(?:GET|HEAD)$/,
8046 allTypes =
"*/".concat(
"*" ),
8049 originAnchor = document.createElement(
"a" );
8050 originAnchor.href = location.href;
8053 function addToPrefiltersOrTransports( structure ) {
8056 return function( dataTypeExpression, func ) {
8058 if ( typeof dataTypeExpression !==
"string" ) {
8059 func = dataTypeExpression;
8060 dataTypeExpression =
"*";
8065 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
8067 if ( jQuery.isFunction( func ) ) {
8070 while ( ( dataType = dataTypes[ i++ ] ) ) {
8073 if ( dataType[ 0 ] ===
"+" ) {
8074 dataType = dataType.slice( 1 ) ||
"*";
8075 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
8079 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
8087 function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
8090 seekingTransport = ( structure === transports );
8092 function inspect( dataType ) {
8094 inspected[ dataType ] =
true;
8095 jQuery.each( structure[ dataType ] || [],
function( _, prefilterOrFactory ) {
8096 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
8097 if ( typeof dataTypeOrTransport ===
"string" &&
8098 !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
8100 options.dataTypes.unshift( dataTypeOrTransport );
8101 inspect( dataTypeOrTransport );
8103 }
else if ( seekingTransport ) {
8104 return !( selected = dataTypeOrTransport );
8110 return inspect( options.dataTypes[ 0 ] ) || !inspected[
"*" ] && inspect(
"*" );
8116 function ajaxExtend( target, src ) {
8118 flatOptions = jQuery.ajaxSettings.flatOptions || {};
8120 for ( key in src ) {
8121 if ( src[ key ] !== undefined ) {
8122 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
8126 jQuery.extend(
true, target, deep );
8136 function ajaxHandleResponses( s, jqXHR, responses ) {
8138 var ct, type, finalDataType, firstDataType,
8139 contents = s.contents,
8140 dataTypes = s.dataTypes;
8143 while ( dataTypes[ 0 ] ===
"*" ) {
8145 if ( ct === undefined ) {
8146 ct = s.mimeType || jqXHR.getResponseHeader(
"Content-Type" );
8152 for ( type in contents ) {
8153 if ( contents[ type ] && contents[ type ].test( ct ) ) {
8154 dataTypes.unshift( type );
8161 if ( dataTypes[ 0 ] in responses ) {
8162 finalDataType = dataTypes[ 0 ];
8166 for ( type in responses ) {
8167 if ( !dataTypes[ 0 ] || s.converters[ type +
" " + dataTypes[ 0 ] ] ) {
8168 finalDataType = type;
8171 if ( !firstDataType ) {
8172 firstDataType = type;
8177 finalDataType = finalDataType || firstDataType;
8183 if ( finalDataType ) {
8184 if ( finalDataType !== dataTypes[ 0 ] ) {
8185 dataTypes.unshift( finalDataType );
8187 return responses[ finalDataType ];
8194 function ajaxConvert( s, response, jqXHR, isSuccess ) {
8195 var conv2, current, conv, tmp, prev,
8199 dataTypes = s.dataTypes.slice();
8202 if ( dataTypes[ 1 ] ) {
8203 for ( conv in s.converters ) {
8204 converters[ conv.toLowerCase() ] = s.converters[ conv ];
8208 current = dataTypes.shift();
8213 if ( s.responseFields[ current ] ) {
8214 jqXHR[ s.responseFields[ current ] ] = response;
8218 if ( !prev && isSuccess && s.dataFilter ) {
8219 response = s.dataFilter( response, s.dataType );
8223 current = dataTypes.shift();
8228 if ( current ===
"*" ) {
8233 }
else if ( prev !==
"*" && prev !== current ) {
8236 conv = converters[ prev +
" " + current ] || converters[
"* " + current ];
8240 for ( conv2 in converters ) {
8243 tmp = conv2.split(
" " );
8244 if ( tmp[ 1 ] === current ) {
8247 conv = converters[ prev +
" " + tmp[ 0 ] ] ||
8248 converters[
"* " + tmp[ 0 ] ];
8252 if ( conv ===
true ) {
8253 conv = converters[ conv2 ];
8256 }
else if ( converters[ conv2 ] !==
true ) {
8258 dataTypes.unshift( tmp[ 1 ] );
8267 if ( conv !==
true ) {
8270 if ( conv && s.throws ) {
8271 response = conv( response );
8274 response = conv( response );
8277 state:
"parsererror",
8278 error: conv ? e :
"No conversion from " + prev +
" to " + current
8287 return { state:
"success", data: response };
8302 isLocal: rlocalProtocol.test( location.protocol ),
8306 contentType:
"application/x-www-form-urlencoded; charset=UTF-8",
8323 xml:
"application/xml, text/xml",
8324 json:
"application/json, text/javascript"
8335 text:
"responseText",
8336 json:
"responseJSON"
8350 "text json": jQuery.parseJSON,
8353 "text xml": jQuery.parseXML
8369 ajaxSetup:
function( target, settings ) {
8373 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
8376 ajaxExtend( jQuery.ajaxSettings, target );
8379 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
8380 ajaxTransport: addToPrefiltersOrTransports( transports ),
8383 ajax:
function( url, options ) {
8386 if ( typeof url ===
"object" ) {
8392 options = options || {};
8400 responseHeadersString,
8416 s = jQuery.ajaxSetup( {}, options ),
8419 callbackContext = s.context || s,
8422 globalEventContext = s.context &&
8423 ( callbackContext.nodeType || callbackContext.jquery ) ?
8424 jQuery( callbackContext ) :
8428 deferred = jQuery.Deferred(),
8429 completeDeferred = jQuery.Callbacks(
"once memory" ),
8432 statusCode = s.statusCode || {},
8435 requestHeaders = {},
8436 requestHeadersNames = {},
8442 strAbort =
"canceled",
8449 getResponseHeader:
function( key ) {
8451 if ( state === 2 ) {
8452 if ( !responseHeaders ) {
8453 responseHeaders = {};
8454 while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
8455 responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
8458 match = responseHeaders[ key.toLowerCase() ];
8460 return match == null ? null : match;
8464 getAllResponseHeaders:
function() {
8465 return state === 2 ? responseHeadersString : null;
8469 setRequestHeader:
function( name, value ) {
8470 var lname = name.toLowerCase();
8472 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
8473 requestHeaders[ name ] = value;
8479 overrideMimeType:
function( type ) {
8487 statusCode:
function( map ) {
8491 for ( code in map ) {
8494 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
8499 jqXHR.always( map[ jqXHR.status ] );
8506 abort:
function( statusText ) {
8507 var finalText = statusText || strAbort;
8509 transport.abort( finalText );
8511 done( 0, finalText );
8517 deferred.promise( jqXHR ).complete = completeDeferred.add;
8518 jqXHR.success = jqXHR.done;
8519 jqXHR.error = jqXHR.fail;
8525 s.url = ( ( url || s.url || location.href ) +
"" ).replace( rhash,
"" )
8526 .replace( rprotocol, location.protocol +
"//" );
8529 s.type = options.method || options.type || s.method || s.type;
8532 s.dataTypes = jQuery.trim( s.dataType ||
"*" ).toLowerCase().match( rnotwhite ) || [
"" ];
8535 if ( s.crossDomain == null ) {
8536 urlAnchor = document.createElement(
"a" );
8541 urlAnchor.href = s.url;
8545 urlAnchor.href = urlAnchor.href;
8546 s.crossDomain = originAnchor.protocol +
"//" + originAnchor.host !==
8547 urlAnchor.protocol +
"//" + urlAnchor.host;
8552 s.crossDomain =
true;
8557 if ( s.data && s.processData && typeof s.data !==
"string" ) {
8558 s.data = jQuery.param( s.data, s.traditional );
8562 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
8565 if ( state === 2 ) {
8571 fireGlobals = jQuery.event && s.global;
8574 if ( fireGlobals && jQuery.active++ === 0 ) {
8575 jQuery.event.trigger(
"ajaxStart" );
8579 s.type = s.type.toUpperCase();
8582 s.hasContent = !rnoContent.test( s.type );
8589 if ( !s.hasContent ) {
8593 cacheURL = ( s.url += ( rquery.test( cacheURL ) ?
"&" :
"?" ) + s.data );
8600 if ( s.cache ===
false ) {
8601 s.url = rts.test( cacheURL ) ?
8604 cacheURL.replace( rts,
"$1_=" + nonce++ ) :
8607 cacheURL + ( rquery.test( cacheURL ) ?
"&" :
"?" ) +
"_=" + nonce++;
8612 if ( s.ifModified ) {
8613 if ( jQuery.lastModified[ cacheURL ] ) {
8614 jqXHR.setRequestHeader(
"If-Modified-Since", jQuery.lastModified[ cacheURL ] );
8616 if ( jQuery.etag[ cacheURL ] ) {
8617 jqXHR.setRequestHeader(
"If-None-Match", jQuery.etag[ cacheURL ] );
8622 if ( s.data && s.hasContent && s.contentType !==
false || options.contentType ) {
8623 jqXHR.setRequestHeader(
"Content-Type", s.contentType );
8627 jqXHR.setRequestHeader(
8629 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
8630 s.accepts[ s.dataTypes[ 0 ] ] +
8631 ( s.dataTypes[ 0 ] !==
"*" ?
", " + allTypes +
"; q=0.01" :
"" ) :
8636 for ( i in s.headers ) {
8637 jqXHR.setRequestHeader( i, s.headers[ i ] );
8641 if ( s.beforeSend &&
8642 ( s.beforeSend.call( callbackContext, jqXHR, s ) ===
false || state === 2 ) ) {
8645 return jqXHR.abort();
8652 for ( i in { success: 1, error: 1, complete: 1 } ) {
8653 jqXHR[ i ]( s[ i ] );
8657 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
8661 done( -1,
"No Transport" );
8663 jqXHR.readyState = 1;
8666 if ( fireGlobals ) {
8667 globalEventContext.trigger(
"ajaxSend", [ jqXHR, s ] );
8671 if ( state === 2 ) {
8676 if ( s.async && s.timeout > 0 ) {
8677 timeoutTimer = window.setTimeout(
function() {
8678 jqXHR.abort(
"timeout" );
8684 transport.send( requestHeaders, done );
8699 function done( status, nativeStatusText, responses, headers ) {
8700 var isSuccess, success, error, response, modified,
8701 statusText = nativeStatusText;
8704 if ( state === 2 ) {
8712 if ( timeoutTimer ) {
8713 window.clearTimeout( timeoutTimer );
8718 transport = undefined;
8721 responseHeadersString = headers ||
"";
8724 jqXHR.readyState = status > 0 ? 4 : 0;
8727 isSuccess = status >= 200 && status < 300 || status === 304;
8731 response = ajaxHandleResponses( s, jqXHR, responses );
8735 response = ajaxConvert( s, response, jqXHR, isSuccess );
8741 if ( s.ifModified ) {
8742 modified = jqXHR.getResponseHeader(
"Last-Modified" );
8744 jQuery.lastModified[ cacheURL ] = modified;
8746 modified = jqXHR.getResponseHeader(
"etag" );
8748 jQuery.etag[ cacheURL ] = modified;
8753 if ( status === 204 || s.type ===
"HEAD" ) {
8754 statusText =
"nocontent";
8757 }
else if ( status === 304 ) {
8758 statusText =
"notmodified";
8762 statusText = response.state;
8763 success = response.data;
8764 error = response.error;
8771 if ( status || !statusText ) {
8772 statusText =
"error";
8780 jqXHR.status = status;
8781 jqXHR.statusText = ( nativeStatusText || statusText ) +
"";
8785 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
8787 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
8791 jqXHR.statusCode( statusCode );
8792 statusCode = undefined;
8794 if ( fireGlobals ) {
8795 globalEventContext.trigger( isSuccess ?
"ajaxSuccess" :
"ajaxError",
8796 [ jqXHR, s, isSuccess ? success : error ] );
8800 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
8802 if ( fireGlobals ) {
8803 globalEventContext.trigger(
"ajaxComplete", [ jqXHR, s ] );
8806 if ( !( --jQuery.active ) ) {
8807 jQuery.event.trigger(
"ajaxStop" );
8815 getJSON:
function( url, data, callback ) {
8816 return jQuery.get( url, data, callback,
"json" );
8819 getScript:
function( url, callback ) {
8820 return jQuery.get( url, undefined, callback,
"script" );
8824 jQuery.each( [
"get",
"post" ],
function( i, method ) {
8825 jQuery[ method ] =
function( url, data, callback, type ) {
8828 if ( jQuery.isFunction( data ) ) {
8829 type = type || callback;
8835 return jQuery.ajax( jQuery.extend( {
8841 }, jQuery.isPlainObject( url ) && url ) );
8846 jQuery._evalUrl =
function( url ) {
8847 return jQuery.ajax( {
8861 wrapAll:
function( html ) {
8864 if ( jQuery.isFunction( html ) ) {
8865 return this.each(
function( i ) {
8866 jQuery(
this ).wrapAll( html.call(
this, i ) );
8873 wrap = jQuery( html,
this[ 0 ].ownerDocument ).eq( 0 ).clone(
true );
8875 if (
this[ 0 ].parentNode ) {
8876 wrap.insertBefore(
this[ 0 ] );
8879 wrap.map(
function() {
8882 while ( elem.firstElementChild ) {
8883 elem = elem.firstElementChild;
8893 wrapInner:
function( html ) {
8894 if ( jQuery.isFunction( html ) ) {
8895 return this.each(
function( i ) {
8896 jQuery(
this ).wrapInner( html.call(
this, i ) );
8900 return this.each(
function() {
8901 var
self = jQuery(
this ),
8902 contents =
self.contents();
8904 if ( contents.length ) {
8905 contents.wrapAll( html );
8908 self.append( html );
8913 wrap:
function( html ) {
8914 var isFunction = jQuery.isFunction( html );
8916 return this.each(
function( i ) {
8917 jQuery(
this ).wrapAll( isFunction ? html.call(
this, i ) : html );
8921 unwrap:
function() {
8922 return this.parent().each(
function() {
8923 if ( !jQuery.nodeName(
this,
"body" ) ) {
8924 jQuery(
this ).replaceWith( this.childNodes );
8931 jQuery.expr.filters.hidden =
function( elem ) {
8932 return !jQuery.expr.filters.visible( elem );
8934 jQuery.expr.filters.visible =
function( elem ) {
8940 return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0;
8949 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
8950 rsubmittable = /^(?:input|select|textarea|keygen)/i;
8952 function buildParams( prefix, obj, traditional, add ) {
8955 if ( jQuery.isArray( obj ) ) {
8958 jQuery.each( obj,
function( i, v ) {
8959 if ( traditional || rbracket.test( prefix ) ) {
8968 prefix +
"[" + ( typeof v ===
"object" && v != null ? i :
"" ) +
"]",
8976 }
else if ( !traditional && jQuery.type( obj ) ===
"object" ) {
8979 for ( name in obj ) {
8980 buildParams( prefix +
"[" + name +
"]", obj[ name ], traditional, add );
8992 jQuery.param =
function( a, traditional ) {
8995 add =
function( key, value ) {
8998 value = jQuery.isFunction( value ) ? value() : ( value == null ?
"" : value );
8999 s[ s.length ] = encodeURIComponent( key ) +
"=" + encodeURIComponent( value );
9003 if ( traditional === undefined ) {
9004 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
9008 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
9011 jQuery.each( a,
function() {
9012 add( this.name, this.value );
9019 for ( prefix in a ) {
9020 buildParams( prefix, a[ prefix ], traditional, add );
9025 return s.join(
"&" ).replace( r20,
"+" );
9029 serialize:
function() {
9030 return jQuery.param( this.serializeArray() );
9032 serializeArray:
function() {
9033 return this.map(
function() {
9036 var elements = jQuery.prop(
this,
"elements" );
9037 return elements ? jQuery.makeArray( elements ) :
this;
9039 .filter(
function() {
9040 var type = this.type;
9043 return this.name && !jQuery(
this ).is(
":disabled" ) &&
9044 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
9045 ( this.checked || !rcheckableType.test( type ) );
9047 .map(
function( i, elem ) {
9048 var val = jQuery(
this ).val();
9050 return val == null ?
9052 jQuery.isArray( val ) ?
9053 jQuery.map( val,
function( val ) {
9054 return { name: elem.name, value: val.replace( rCRLF,
"\r\n" ) };
9056 { name: elem.name, value: val.replace( rCRLF,
"\r\n" ) };
9062 jQuery.ajaxSettings.xhr =
function() {
9064 return new window.XMLHttpRequest();
9068 var xhrSuccessStatus = {
9077 xhrSupported = jQuery.ajaxSettings.xhr();
9079 support.cors = !!xhrSupported && (
"withCredentials" in xhrSupported );
9080 support.ajax = xhrSupported = !!xhrSupported;
9082 jQuery.ajaxTransport(
function( options ) {
9083 var callback, errorCallback;
9086 if ( support.cors || xhrSupported && !options.crossDomain ) {
9088 send:
function( headers, complete ) {
9090 xhr = options.xhr();
9101 if ( options.xhrFields ) {
9102 for ( i in options.xhrFields ) {
9103 xhr[ i ] = options.xhrFields[ i ];
9108 if ( options.mimeType && xhr.overrideMimeType ) {
9109 xhr.overrideMimeType( options.mimeType );
9117 if ( !options.crossDomain && !headers[
"X-Requested-With" ] ) {
9118 headers[
"X-Requested-With" ] =
"XMLHttpRequest";
9122 for ( i in headers ) {
9123 xhr.setRequestHeader( i, headers[ i ] );
9127 callback =
function( type ) {
9130 callback = errorCallback = xhr.onload =
9131 xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
9133 if ( type ===
"abort" ) {
9135 }
else if ( type ===
"error" ) {
9140 if ( typeof xhr.status !==
"number" ) {
9141 complete( 0,
"error" );
9152 xhrSuccessStatus[ xhr.status ] || xhr.status,
9158 ( xhr.responseType ||
"text" ) !==
"text" ||
9159 typeof xhr.responseText !==
"string" ?
9160 { binary: xhr.response } :
9161 { text: xhr.responseText },
9162 xhr.getAllResponseHeaders()
9170 xhr.onload = callback();
9171 errorCallback = xhr.onerror = callback(
"error" );
9176 if ( xhr.onabort !== undefined ) {
9177 xhr.onabort = errorCallback;
9179 xhr.onreadystatechange =
function() {
9182 if ( xhr.readyState === 4 ) {
9188 window.setTimeout(
function() {
9198 callback = callback(
"abort" );
9203 xhr.send( options.hasContent && options.data || null );
9228 script:
"text/javascript, application/javascript, " +
9229 "application/ecmascript, application/x-ecmascript"
9232 script: /\b(?:java|ecma)script\b/
9235 "text script":
function( text ) {
9236 jQuery.globalEval( text );
9243 jQuery.ajaxPrefilter(
"script",
function( s ) {
9244 if ( s.cache === undefined ) {
9247 if ( s.crossDomain ) {
9253 jQuery.ajaxTransport(
"script",
function( s ) {
9256 if ( s.crossDomain ) {
9257 var script, callback;
9259 send:
function( _, complete ) {
9260 script = jQuery(
"<script>" ).prop( {
9261 charset: s.scriptCharset,
9265 callback =
function( evt ) {
9269 complete( evt.type ===
"error" ? 404 : 200, evt.type );
9275 document.head.appendChild( script[ 0 ] );
9289 var oldCallbacks = [],
9290 rjsonp = /(=)\?(?=&|$)|\?\?/;
9295 jsonpCallback:
function() {
9296 var callback = oldCallbacks.pop() || ( jQuery.expando +
"_" + ( nonce++ ) );
9297 this[ callback ] =
true;
9303 jQuery.ajaxPrefilter(
"json jsonp",
function( s, originalSettings, jqXHR ) {
9305 var callbackName, overwritten, responseContainer,
9306 jsonProp = s.jsonp !==
false && ( rjsonp.test( s.url ) ?
9308 typeof s.data ===
"string" &&
9309 ( s.contentType ||
"" )
9310 .indexOf(
"application/x-www-form-urlencoded" ) === 0 &&
9311 rjsonp.test( s.data ) &&
"data"
9315 if ( jsonProp || s.dataTypes[ 0 ] ===
"jsonp" ) {
9318 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
9324 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp,
"$1" + callbackName );
9325 }
else if ( s.jsonp !==
false ) {
9326 s.url += ( rquery.test( s.url ) ?
"&" :
"?" ) + s.jsonp +
"=" + callbackName;
9330 s.converters[
"script json" ] =
function() {
9331 if ( !responseContainer ) {
9332 jQuery.error( callbackName +
" was not called" );
9334 return responseContainer[ 0 ];
9338 s.dataTypes[ 0 ] =
"json";
9341 overwritten = window[ callbackName ];
9342 window[ callbackName ] =
function() {
9343 responseContainer = arguments;
9347 jqXHR.always(
function() {
9350 if ( overwritten === undefined ) {
9351 jQuery( window ).removeProp( callbackName );
9355 window[ callbackName ] = overwritten;
9359 if ( s[ callbackName ] ) {
9362 s.jsonpCallback = originalSettings.jsonpCallback;
9365 oldCallbacks.push( callbackName );
9369 if ( responseContainer && jQuery.isFunction( overwritten ) ) {
9370 overwritten( responseContainer[ 0 ] );
9373 responseContainer = overwritten = undefined;
9388 jQuery.parseHTML =
function( data, context, keepScripts ) {
9389 if ( !data || typeof data !==
"string" ) {
9392 if ( typeof context ===
"boolean" ) {
9393 keepScripts = context;
9396 context = context || document;
9398 var parsed = rsingleTag.exec( data ),
9399 scripts = !keepScripts && [];
9403 return [ context.createElement( parsed[ 1 ] ) ];
9406 parsed = buildFragment( [ data ], context, scripts );
9408 if ( scripts && scripts.length ) {
9409 jQuery( scripts ).remove();
9412 return jQuery.merge( [], parsed.childNodes );
9417 var _load = jQuery.fn.load;
9422 jQuery.fn.load =
function( url, params, callback ) {
9423 if ( typeof url !==
"string" && _load ) {
9424 return _load.apply(
this, arguments );
9427 var selector, type, response,
9429 off = url.indexOf(
" " );
9432 selector = jQuery.trim( url.slice( off ) );
9433 url = url.slice( 0, off );
9437 if ( jQuery.isFunction( params ) ) {
9444 }
else if ( params && typeof params ===
"object" ) {
9449 if (
self.length > 0 ) {
9456 type: type ||
"GET",
9459 } ).done(
function( responseText ) {
9462 response = arguments;
9464 self.html( selector ?
9468 jQuery(
"<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
9476 } ).always( callback &&
function( jqXHR, status ) {
9477 self.each(
function() {
9478 callback.apply(
this, response || [ jqXHR.responseText, status, jqXHR ] );
9497 ],
function( i, type ) {
9498 jQuery.fn[ type ] =
function( fn ) {
9499 return this.on( type, fn );
9506 jQuery.expr.filters.animated =
function( elem ) {
9507 return jQuery.grep( jQuery.timers,
function( fn ) {
9508 return elem === fn.elem;
9518 function getWindow( elem ) {
9519 return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
9523 setOffset:
function( elem, options, i ) {
9524 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
9525 position = jQuery.css( elem,
"position" ),
9526 curElem = jQuery( elem ),
9530 if ( position ===
"static" ) {
9531 elem.style.position =
"relative";
9534 curOffset = curElem.offset();
9535 curCSSTop = jQuery.css( elem,
"top" );
9536 curCSSLeft = jQuery.css( elem,
"left" );
9537 calculatePosition = ( position ===
"absolute" || position ===
"fixed" ) &&
9538 ( curCSSTop + curCSSLeft ).indexOf(
"auto" ) > -1;
9542 if ( calculatePosition ) {
9543 curPosition = curElem.position();
9544 curTop = curPosition.top;
9545 curLeft = curPosition.left;
9548 curTop = parseFloat( curCSSTop ) || 0;
9549 curLeft = parseFloat( curCSSLeft ) || 0;
9552 if ( jQuery.isFunction( options ) ) {
9555 options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
9558 if ( options.top != null ) {
9559 props.top = ( options.top - curOffset.top ) + curTop;
9561 if ( options.left != null ) {
9562 props.left = ( options.left - curOffset.left ) + curLeft;
9565 if (
"using" in options ) {
9566 options.using.call( elem, props );
9569 curElem.css( props );
9575 offset:
function( options ) {
9576 if ( arguments.length ) {
9577 return options === undefined ?
9579 this.each(
function( i ) {
9580 jQuery.offset.setOffset(
this, options, i );
9586 box = { top: 0, left: 0 },
9587 doc = elem && elem.ownerDocument;
9593 docElem = doc.documentElement;
9596 if ( !jQuery.contains( docElem, elem ) ) {
9600 box = elem.getBoundingClientRect();
9601 win = getWindow( doc );
9603 top: box.top + win.pageYOffset - docElem.clientTop,
9604 left: box.left + win.pageXOffset - docElem.clientLeft
9608 position:
function() {
9613 var offsetParent, offset,
9615 parentOffset = { top: 0, left: 0 };
9619 if ( jQuery.css( elem,
"position" ) ===
"fixed" ) {
9622 offset = elem.getBoundingClientRect();
9627 offsetParent = this.offsetParent();
9630 offset = this.offset();
9631 if ( !jQuery.nodeName( offsetParent[ 0 ],
"html" ) ) {
9632 parentOffset = offsetParent.offset();
9636 parentOffset.top += jQuery.css( offsetParent[ 0 ],
"borderTopWidth",
true );
9637 parentOffset.left += jQuery.css( offsetParent[ 0 ],
"borderLeftWidth",
true );
9642 top: offset.top - parentOffset.top - jQuery.css( elem,
"marginTop",
true ),
9643 left: offset.left - parentOffset.left - jQuery.css( elem,
"marginLeft",
true )
9657 offsetParent:
function() {
9658 return this.map(
function() {
9659 var offsetParent = this.offsetParent;
9661 while ( offsetParent && jQuery.css( offsetParent,
"position" ) ===
"static" ) {
9662 offsetParent = offsetParent.offsetParent;
9665 return offsetParent || documentElement;
9671 jQuery.each( { scrollLeft:
"pageXOffset", scrollTop:
"pageYOffset" },
function( method, prop ) {
9672 var top =
"pageYOffset" === prop;
9674 jQuery.fn[ method ] =
function( val ) {
9675 return access(
this,
function( elem, method, val ) {
9676 var win = getWindow( elem );
9678 if ( val === undefined ) {
9679 return win ? win[ prop ] : elem[ method ];
9684 !top ? val : win.pageXOffset,
9685 top ? val : win.pageYOffset
9689 elem[ method ] = val;
9691 }, method, val, arguments.length );
9701 jQuery.each( [
"top",
"left" ],
function( i, prop ) {
9702 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
9703 function( elem, computed ) {
9705 computed = curCSS( elem, prop );
9708 return rnumnonpx.test( computed ) ?
9709 jQuery( elem ).position()[ prop ] +
"px" :
9718 jQuery.each( { Height:
"height", Width:
"width" },
function( name, type ) {
9719 jQuery.each( { padding:
"inner" + name, content: type,
"":
"outer" + name },
9720 function( defaultExtra, funcName ) {
9723 jQuery.fn[ funcName ] =
function( margin, value ) {
9724 var chainable = arguments.length && ( defaultExtra || typeof margin !==
"boolean" ),
9725 extra = defaultExtra || ( margin ===
true || value ===
true ?
"margin" :
"border" );
9727 return access(
this,
function( elem, type, value ) {
9730 if ( jQuery.isWindow( elem ) ) {
9735 return elem.document.documentElement[
"client" + name ];
9739 if ( elem.nodeType === 9 ) {
9740 doc = elem.documentElement;
9745 elem.body[
"scroll" + name ], doc[
"scroll" + name ],
9746 elem.body[
"offset" + name ], doc[
"offset" + name ],
9747 doc[
"client" + name ]
9751 return value === undefined ?
9754 jQuery.css( elem, type, extra ) :
9757 jQuery.style( elem, type, value, extra );
9758 }, type, chainable ? margin : undefined, chainable, null );
9766 bind:
function( types, data, fn ) {
9767 return this.on( types, null, data, fn );
9769 unbind:
function( types, fn ) {
9770 return this.off( types, null, fn );
9773 delegate:
function( selector, types, data, fn ) {
9774 return this.on( types, selector, data, fn );
9776 undelegate:
function( selector, types, fn ) {
9779 return arguments.length === 1 ?
9780 this.off( selector,
"**" ) :
9781 this.off( types, selector ||
"**", fn );
9788 jQuery.fn.andSelf = jQuery.fn.addBack;
9806 if ( typeof define ===
"function" && define.amd ) {
9807 define(
"jquery", [],
function() {
9817 _jQuery = window.jQuery,
9822 jQuery.noConflict =
function( deep ) {
9823 if ( window.$ === jQuery ) {
9827 if ( deep && window.jQuery === jQuery ) {
9828 window.jQuery = _jQuery;
9838 window.jQuery = window.$ = jQuery;