Best JavaScript code snippet using cypress
jquery-1.10.2.js
Source:jquery-1.10.2.js
1/*!2 * jquery javascript library v1.10.23 * http://jquery.com/4 *5 * includes sizzle.js6 * http://sizzlejs.com/7 *8 * copyright 2005, 2013 jquery foundation, inc. and other contributors9 * released under the mit license10 * http://jquery.org/license11 *12 * date: 2013-07-03t13:48z13 */14(function( window, undefined ) {15// can't do this because several apps including asp.net trace16// the stack via arguments.caller.callee and firefox dies if17// you try to trace through "use strict" call chains. (#13335)18// support: firefox 18+19//"use strict";20 var21 // the deferred used on dom ready22 readylist,23 // a central reference to the root jquery(document)24 rootjquery,25 // support: ie<1026 // for `typeof xmlnode.method` instead of `xmlnode.method !== undefined`27 core_strundefined = typeof undefined,28 // use the correct document accordingly with window argument (sandbox)29 location = window.location,30 document = window.document,31 docelem = document.documentelement,32 // map over jquery in case of overwrite33 _jquery = window.jquery,34 // map over the $ in case of overwrite35 _$ = window.$,36 // [[class]] -> type pairs37 class2type = {},38 // list of deleted data cache ids, so we can reuse them39 core_deletedids = [],40 core_version = "1.10.2",41 // save a reference to some core methods42 core_concat = core_deletedids.concat,43 core_push = core_deletedids.push,44 core_slice = core_deletedids.slice,45 core_indexof = core_deletedids.indexof,46 core_tostring = class2type.tostring,47 core_hasown = class2type.hasownproperty,48 core_trim = core_version.trim,49 // define a local copy of jquery50 jquery = function( selector, context ) {51 // the jquery object is actually just the init constructor 'enhanced'52 return new jquery.fn.init( selector, context, rootjquery );53 },54 // used for matching numbers55 core_pnum = /[+-]?(?:\d*\.|)\d+(?:[ee][+-]?\d+|)/.source,56 // used for splitting on whitespace57 core_rnotwhite = /\s+/g,58 // make sure we trim bom and nbsp (here's looking at you, safari 5.0 and ie)59 rtrim = /^[\s\ufeff\xa0]+|[\s\ufeff\xa0]+$/g,60 // a simple way to check for html strings61 // prioritize #id over <tag> to avoid xss via location.hash (#9521)62 // strict html recognition (#11290: must start with <)63 rquickexpr = /^(?:\s*(<[\w\w]+>)[^>]*|#([\w-]*))$/,64 // match a standalone tag65 rsingletag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,66 // json regexp67 rvalidchars = /^[\],:{}\s]*$/,68 rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,69 rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fa-f]{4})/g,70 rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[ee][+-]?\d+|)/g,71 // matches dashed string for camelizing72 rmsprefix = /^-ms-/,73 rdashalpha = /-([\da-z])/gi,74 // used by jquery.camelcase as callback to replace()75 fcamelcase = function( all, letter ) {76 return letter.touppercase();77 },78 // the ready event handler79 completed = function( event ) {80 // readystate === "complete" is good enough for us to call the dom ready in oldie81 if ( document.addeventlistener || event.type === "load" || document.readystate === "complete" ) {82 detach();83 jquery.ready();84 }85 },86 // clean-up method for dom ready events87 detach = function() {88 if ( document.addeventlistener ) {89 document.removeeventlistener( "domcontentloaded", completed, false );90 window.removeeventlistener( "load", completed, false );91 } else {92 document.detachevent( "onreadystatechange", completed );93 window.detachevent( "onload", completed );94 }95 };96 jquery.fn = jquery.prototype = {97 // the current version of jquery being used98 jquery: core_version,99 constructor: jquery,100 init: function( selector, context, rootjquery ) {101 var match, elem;102 // handle: $(""), $(null), $(undefined), $(false)103 if ( !selector ) {104 return this;105 }106 // handle html strings107 if ( typeof selector === "string" ) {108 if ( selector.charat(0) === "<" && selector.charat( selector.length - 1 ) === ">" && selector.length >= 3 ) {109 // assume that strings that start and end with <> are html and skip the regex check110 match = [ null, selector, null ];111 } else {112 match = rquickexpr.exec( selector );113 }114 // match html or make sure no context is specified for #id115 if ( match && (match[1] || !context) ) {116 // handle: $(html) -> $(array)117 if ( match[1] ) {118 context = context instanceof jquery ? context[0] : context;119 // scripts is true for back-compat120 jquery.merge( this, jquery.parsehtml(121 match[1],122 context && context.nodetype ? context.ownerdocument || context : document,123 true124 ) );125 // handle: $(html, props)126 if ( rsingletag.test( match[1] ) && jquery.isplainobject( context ) ) {127 for ( match in context ) {128 // properties of context are called as methods if possible129 if ( jquery.isfunction( this[ match ] ) ) {130 this[ match ]( context[ match ] );131 // ...and otherwise set as attributes132 } else {133 this.attr( match, context[ match ] );134 }135 }136 }137 return this;138 // handle: $(#id)139 } else {140 elem = document.getelementbyid( match[2] );141 // check parentnode to catch when blackberry 4.6 returns142 // nodes that are no longer in the document #6963143 if ( elem && elem.parentnode ) {144 // handle the case where ie and opera return items145 // by name instead of id146 if ( elem.id !== match[2] ) {147 return rootjquery.find( selector );148 }149 // otherwise, we inject the element directly into the jquery object150 this.length = 1;151 this[0] = elem;152 }153 this.context = document;154 this.selector = selector;155 return this;156 }157 // handle: $(expr, $(...))158 } else if ( !context || context.jquery ) {159 return ( context || rootjquery ).find( selector );160 // handle: $(expr, context)161 // (which is just equivalent to: $(context).find(expr)162 } else {163 return this.constructor( context ).find( selector );164 }165 // handle: $(domelement)166 } else if ( selector.nodetype ) {167 this.context = this[0] = selector;168 this.length = 1;169 return this;170 // handle: $(function)171 // shortcut for document ready172 } else if ( jquery.isfunction( selector ) ) {173 return rootjquery.ready( selector );174 }175 if ( selector.selector !== undefined ) {176 this.selector = selector.selector;177 this.context = selector.context;178 }179 return jquery.makearray( selector, this );180 },181 // start with an empty selector182 selector: "",183 // the default length of a jquery object is 0184 length: 0,185 toarray: function() {186 return core_slice.call( this );187 },188 // get the nth element in the matched element set or189 // get the whole matched element set as a clean array190 get: function( num ) {191 return num == null ?192 // return a 'clean' array193 this.toarray() :194 // return just the object195 ( num < 0 ? this[ this.length + num ] : this[ num ] );196 },197 // take an array of elements and push it onto the stack198 // (returning the new matched element set)199 pushstack: function( elems ) {200 // build a new jquery matched element set201 var ret = jquery.merge( this.constructor(), elems );202 // add the old object onto the stack (as a reference)203 ret.prevobject = this;204 ret.context = this.context;205 // return the newly-formed element set206 return ret;207 },208 // execute a callback for every element in the matched set.209 // (you can seed the arguments with an array of args, but this is210 // only used internally.)211 each: function( callback, args ) {212 return jquery.each( this, callback, args );213 },214 ready: function( fn ) {215 // add the callback216 jquery.ready.promise().done( fn );217 return this;218 },219 slice: function() {220 return this.pushstack( core_slice.apply( this, arguments ) );221 },222 first: function() {223 return this.eq( 0 );224 },225 last: function() {226 return this.eq( -1 );227 },228 eq: function( i ) {229 var len = this.length,230 j = +i + ( i < 0 ? len : 0 );231 return this.pushstack( j >= 0 && j < len ? [ this[j] ] : [] );232 },233 map: function( callback ) {234 return this.pushstack( jquery.map(this, function( elem, i ) {235 return callback.call( elem, i, elem );236 }));237 },238 end: function() {239 return this.prevobject || this.constructor(null);240 },241 // for internal use only.242 // behaves like an array's method, not like a jquery method.243 push: core_push,244 sort: [].sort,245 splice: [].splice246 };247// give the init function the jquery prototype for later instantiation248 jquery.fn.init.prototype = jquery.fn;249 jquery.extend = jquery.fn.extend = function() {250 var src, copyisarray, copy, name, options, clone,251 target = arguments[0] || {},252 i = 1,253 length = arguments.length,254 deep = false;255 // handle a deep copy situation256 if ( typeof target === "boolean" ) {257 deep = target;258 target = arguments[1] || {};259 // skip the boolean and the target260 i = 2;261 }262 // handle case when target is a string or something (possible in deep copy)263 if ( typeof target !== "object" && !jquery.isfunction(target) ) {264 target = {};265 }266 // extend jquery itself if only one argument is passed267 if ( length === i ) {268 target = this;269 --i;270 }271 for ( ; i < length; i++ ) {272 // only deal with non-null/undefined values273 if ( (options = arguments[ i ]) != null ) {274 // extend the base object275 for ( name in options ) {276 src = target[ name ];277 copy = options[ name ];278 // prevent never-ending loop279 if ( target === copy ) {280 continue;281 }282 // recurse if we're merging plain objects or arrays283 if ( deep && copy && ( jquery.isplainobject(copy) || (copyisarray = jquery.isarray(copy)) ) ) {284 if ( copyisarray ) {285 copyisarray = false;286 clone = src && jquery.isarray(src) ? src : [];287 } else {288 clone = src && jquery.isplainobject(src) ? src : {};289 }290 // never move original objects, clone them291 target[ name ] = jquery.extend( deep, clone, copy );292 // don't bring in undefined values293 } else if ( copy !== undefined ) {294 target[ name ] = copy;295 }296 }297 }298 }299 // return the modified object300 return target;301 };302 jquery.extend({303 // unique for each copy of jquery on the page304 // non-digits removed to match rinlinejquery305 expando: "jquery" + ( core_version + math.random() ).replace( /\d/g, "" ),306 noconflict: function( deep ) {307 if ( window.$ === jquery ) {308 window.$ = _$;309 }310 if ( deep && window.jquery === jquery ) {311 window.jquery = _jquery;312 }313 return jquery;314 },315 // is the dom ready to be used? set to true once it occurs.316 isready: false,317 // a counter to track how many items to wait for before318 // the ready event fires. see #6781319 readywait: 1,320 // hold (or release) the ready event321 holdready: function( hold ) {322 if ( hold ) {323 jquery.readywait++;324 } else {325 jquery.ready( true );326 }327 },328 // handle when the dom is ready329 ready: function( wait ) {330 // abort if there are pending holds or we're already ready331 if ( wait === true ? --jquery.readywait : jquery.isready ) {332 return;333 }334 // make sure body exists, at least, in case ie gets a little overzealous (ticket #5443).335 if ( !document.body ) {336 return settimeout( jquery.ready );337 }338 // remember that the dom is ready339 jquery.isready = true;340 // if a normal dom ready event fired, decrement, and wait if need be341 if ( wait !== true && --jquery.readywait > 0 ) {342 return;343 }344 // if there are functions bound, to execute345 readylist.resolvewith( document, [ jquery ] );346 // trigger any bound ready events347 if ( jquery.fn.trigger ) {348 jquery( document ).trigger("ready").off("ready");349 }350 },351 // see test/unit/core.js for details concerning isfunction.352 // since version 1.3, dom methods and functions like alert353 // aren't supported. they return false on ie (#2968).354 isfunction: function( obj ) {355 return jquery.type(obj) === "function";356 },357 isarray: array.isarray || function( obj ) {358 return jquery.type(obj) === "array";359 },360 iswindow: function( obj ) {361 /* jshint eqeqeq: false */362 return obj != null && obj == obj.window;363 },364 isnumeric: function( obj ) {365 return !isnan( parsefloat(obj) ) && isfinite( obj );366 },367 type: function( obj ) {368 if ( obj == null ) {369 return string( obj );370 }371 return typeof obj === "object" || typeof obj === "function" ?372 class2type[ core_tostring.call(obj) ] || "object" :373 typeof obj;374 },375 isplainobject: function( obj ) {376 var key;377 // must be an object.378 // because of ie, we also have to check the presence of the constructor property.379 // make sure that dom nodes and window objects don't pass through, as well380 if ( !obj || jquery.type(obj) !== "object" || obj.nodetype || jquery.iswindow( obj ) ) {381 return false;382 }383 try {384 // not own constructor property must be object385 if ( obj.constructor &&386 !core_hasown.call(obj, "constructor") &&387 !core_hasown.call(obj.constructor.prototype, "isprototypeof") ) {388 return false;389 }390 } catch ( e ) {391 // ie8,9 will throw exceptions on certain host objects #9897392 return false;393 }394 // support: ie<9395 // handle iteration over inherited properties before own properties.396 if ( jquery.support.ownlast ) {397 for ( key in obj ) {398 return core_hasown.call( obj, key );399 }400 }401 // own properties are enumerated firstly, so to speed up,402 // if last one is own, then all properties are own.403 for ( key in obj ) {}404 return key === undefined || core_hasown.call( obj, key );405 },406 isemptyobject: function( obj ) {407 var name;408 for ( name in obj ) {409 return false;410 }411 return true;412 },413 error: function( msg ) {414 throw new error( msg );415 },416 // data: string of html417 // context (optional): if specified, the fragment will be created in this context, defaults to document418 // keepscripts (optional): if true, will include scripts passed in the html string419 parsehtml: function( data, context, keepscripts ) {420 if ( !data || typeof data !== "string" ) {421 return null;422 }423 if ( typeof context === "boolean" ) {424 keepscripts = context;425 context = false;426 }427 context = context || document;428 var parsed = rsingletag.exec( data ),429 scripts = !keepscripts && [];430 // single tag431 if ( parsed ) {432 return [ context.createelement( parsed[1] ) ];433 }434 parsed = jquery.buildfragment( [ data ], context, scripts );435 if ( scripts ) {436 jquery( scripts ).remove();437 }438 return jquery.merge( [], parsed.childnodes );439 },440 parsejson: function( data ) {441 // attempt to parse using the native json parser first442 if ( window.json && window.json.parse ) {443 return window.json.parse( data );444 }445 if ( data === null ) {446 return data;447 }448 if ( typeof data === "string" ) {449 // make sure leading/trailing whitespace is removed (ie can't handle it)450 data = jquery.trim( data );451 if ( data ) {452 // make sure the incoming data is actual json453 // logic borrowed from http://json.org/json2.js454 if ( rvalidchars.test( data.replace( rvalidescape, "@" )455 .replace( rvalidtokens, "]" )456 .replace( rvalidbraces, "")) ) {457 return ( new function( "return " + data ) )();458 }459 }460 }461 jquery.error( "invalid json: " + data );462 },463 // cross-browser xml parsing464 parsexml: function( data ) {465 var xml, tmp;466 if ( !data || typeof data !== "string" ) {467 return null;468 }469 try {470 if ( window.domparser ) { // standard471 tmp = new domparser();472 xml = tmp.parsefromstring( data , "text/xml" );473 } else { // ie474 xml = new activexobject( "microsoft.xmldom" );475 xml.async = "false";476 xml.loadxml( data );477 }478 } catch( e ) {479 xml = undefined;480 }481 if ( !xml || !xml.documentelement || xml.getelementsbytagname( "parsererror" ).length ) {482 jquery.error( "invalid xml: " + data );483 }484 return xml;485 },486 noop: function() {},487 // evaluates a script in a global context488 // workarounds based on findings by jim driscoll489 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context490 globaleval: function( data ) {491 if ( data && jquery.trim( data ) ) {492 // we use execscript on internet explorer493 // we use an anonymous function so that context is window494 // rather than jquery in firefox495 ( window.execscript || function( data ) {496 window[ "eval" ].call( window, data );497 } )( data );498 }499 },500 // convert dashed to camelcase; used by the css and data modules501 // microsoft forgot to hump their vendor prefix (#9572)502 camelcase: function( string ) {503 return string.replace( rmsprefix, "ms-" ).replace( rdashalpha, fcamelcase );504 },505 nodename: function( elem, name ) {506 return elem.nodename && elem.nodename.tolowercase() === name.tolowercase();507 },508 // args is for internal usage only509 each: function( obj, callback, args ) {510 var value,511 i = 0,512 length = obj.length,513 isarray = isarraylike( obj );514 if ( args ) {515 if ( isarray ) {516 for ( ; i < length; i++ ) {517 value = callback.apply( obj[ i ], args );518 if ( value === false ) {519 break;520 }521 }522 } else {523 for ( i in obj ) {524 value = callback.apply( obj[ i ], args );525 if ( value === false ) {526 break;527 }528 }529 }530 // a special, fast, case for the most common use of each531 } else {532 if ( isarray ) {533 for ( ; i < length; i++ ) {534 value = callback.call( obj[ i ], i, obj[ i ] );535 if ( value === false ) {536 break;537 }538 }539 } else {540 for ( i in obj ) {541 value = callback.call( obj[ i ], i, obj[ i ] );542 if ( value === false ) {543 break;544 }545 }546 }547 }548 return obj;549 },550 // use native string.trim function wherever possible551 trim: core_trim && !core_trim.call("\ufeff\xa0") ?552 function( text ) {553 return text == null ?554 "" :555 core_trim.call( text );556 } :557 // otherwise use our own trimming functionality558 function( text ) {559 return text == null ?560 "" :561 ( text + "" ).replace( rtrim, "" );562 },563 // results is for internal usage only564 makearray: function( arr, results ) {565 var ret = results || [];566 if ( arr != null ) {567 if ( isarraylike( object(arr) ) ) {568 jquery.merge( ret,569 typeof arr === "string" ?570 [ arr ] : arr571 );572 } else {573 core_push.call( ret, arr );574 }575 }576 return ret;577 },578 inarray: function( elem, arr, i ) {579 var len;580 if ( arr ) {581 if ( core_indexof ) {582 return core_indexof.call( arr, elem, i );583 }584 len = arr.length;585 i = i ? i < 0 ? math.max( 0, len + i ) : i : 0;586 for ( ; i < len; i++ ) {587 // skip accessing in sparse arrays588 if ( i in arr && arr[ i ] === elem ) {589 return i;590 }591 }592 }593 return -1;594 },595 merge: function( first, second ) {596 var l = second.length,597 i = first.length,598 j = 0;599 if ( typeof l === "number" ) {600 for ( ; j < l; j++ ) {601 first[ i++ ] = second[ j ];602 }603 } else {604 while ( second[j] !== undefined ) {605 first[ i++ ] = second[ j++ ];606 }607 }608 first.length = i;609 return first;610 },611 grep: function( elems, callback, inv ) {612 var retval,613 ret = [],614 i = 0,615 length = elems.length;616 inv = !!inv;617 // go through the array, only saving the items618 // that pass the validator function619 for ( ; i < length; i++ ) {620 retval = !!callback( elems[ i ], i );621 if ( inv !== retval ) {622 ret.push( elems[ i ] );623 }624 }625 return ret;626 },627 // arg is for internal usage only628 map: function( elems, callback, arg ) {629 var value,630 i = 0,631 length = elems.length,632 isarray = isarraylike( elems ),633 ret = [];634 // go through the array, translating each of the items to their635 if ( isarray ) {636 for ( ; i < length; i++ ) {637 value = callback( elems[ i ], i, arg );638 if ( value != null ) {639 ret[ ret.length ] = value;640 }641 }642 // go through every key on the object,643 } else {644 for ( i in elems ) {645 value = callback( elems[ i ], i, arg );646 if ( value != null ) {647 ret[ ret.length ] = value;648 }649 }650 }651 // flatten any nested arrays652 return core_concat.apply( [], ret );653 },654 // a global guid counter for objects655 guid: 1,656 // bind a function to a context, optionally partially applying any657 // arguments.658 proxy: function( fn, context ) {659 var args, proxy, tmp;660 if ( typeof context === "string" ) {661 tmp = fn[ context ];662 context = fn;663 fn = tmp;664 }665 // quick check to determine if target is callable, in the spec666 // this throws a typeerror, but we will just return undefined.667 if ( !jquery.isfunction( fn ) ) {668 return undefined;669 }670 // simulated bind671 args = core_slice.call( arguments, 2 );672 proxy = function() {673 return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );674 };675 // set the guid of unique handler to the same of original handler, so it can be removed676 proxy.guid = fn.guid = fn.guid || jquery.guid++;677 return proxy;678 },679 // multifunctional method to get and set values of a collection680 // the value/s can optionally be executed if it's a function681 access: function( elems, fn, key, value, chainable, emptyget, raw ) {682 var i = 0,683 length = elems.length,684 bulk = key == null;685 // sets many values686 if ( jquery.type( key ) === "object" ) {687 chainable = true;688 for ( i in key ) {689 jquery.access( elems, fn, i, key[i], true, emptyget, raw );690 }691 // sets one value692 } else if ( value !== undefined ) {693 chainable = true;694 if ( !jquery.isfunction( value ) ) {695 raw = true;696 }697 if ( bulk ) {698 // bulk operations run against the entire set699 if ( raw ) {700 fn.call( elems, value );701 fn = null;702 // ...except when executing function values703 } else {704 bulk = fn;705 fn = function( elem, key, value ) {706 return bulk.call( jquery( elem ), value );707 };708 }709 }710 if ( fn ) {711 for ( ; i < length; i++ ) {712 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );713 }714 }715 }716 return chainable ?717 elems :718 // gets719 bulk ?720 fn.call( elems ) :721 length ? fn( elems[0], key ) : emptyget;722 },723 now: function() {724 return ( new date() ).gettime();725 },726 // a method for quickly swapping in/out css properties to get correct calculations.727 // note: this method belongs to the css module but it's needed here for the support module.728 // if support gets modularized, this method should be moved back to the css module.729 swap: function( elem, options, callback, args ) {730 var ret, name,731 old = {};732 // remember the old values, and insert the new ones733 for ( name in options ) {734 old[ name ] = elem.style[ name ];735 elem.style[ name ] = options[ name ];736 }737 ret = callback.apply( elem, args || [] );738 // revert the old values739 for ( name in options ) {740 elem.style[ name ] = old[ name ];741 }742 return ret;743 }744 });745 jquery.ready.promise = function( obj ) {746 if ( !readylist ) {747 readylist = jquery.deferred();748 // catch cases where $(document).ready() is called after the browser event has already occurred.749 // we once tried to use readystate "interactive" here, but it caused issues like the one750 // discovered by chriss here: http://bugs.jquery.com/ticket/12282#comment:15751 if ( document.readystate === "complete" ) {752 // handle it asynchronously to allow scripts the opportunity to delay ready753 settimeout( jquery.ready );754 // standards-based browsers support domcontentloaded755 } else if ( document.addeventlistener ) {756 // use the handy event callback757 document.addeventlistener( "domcontentloaded", completed, false );758 // a fallback to window.onload, that will always work759 window.addeventlistener( "load", completed, false );760 // if ie event model is used761 } else {762 // ensure firing before onload, maybe late but safe also for iframes763 document.attachevent( "onreadystatechange", completed );764 // a fallback to window.onload, that will always work765 window.attachevent( "onload", completed );766 // if ie and not a frame767 // continually check to see if the document is ready768 var top = false;769 try {770 top = window.frameelement == null && document.documentelement;771 } catch(e) {}772 if ( top && top.doscroll ) {773 (function doscrollcheck() {774 if ( !jquery.isready ) {775 try {776 // use the trick by diego perini777 // http://javascript.nwbox.com/iecontentloaded/778 top.doscroll("left");779 } catch(e) {780 return settimeout( doscrollcheck, 50 );781 }782 // detach all dom ready events783 detach();784 // and execute any waiting functions785 jquery.ready();786 }787 })();788 }789 }790 }791 return readylist.promise( obj );792 };793// populate the class2type map794 jquery.each("boolean number string function array date regexp object error".split(" "), function(i, name) {795 class2type[ "[object " + name + "]" ] = name.tolowercase();796 });797 function isarraylike( obj ) {798 var length = obj.length,799 type = jquery.type( obj );800 if ( jquery.iswindow( obj ) ) {801 return false;802 }803 if ( obj.nodetype === 1 && length ) {804 return true;805 }806 return type === "array" || type !== "function" &&807 ( length === 0 ||808 typeof length === "number" && length > 0 && ( length - 1 ) in obj );809 }810// all jquery objects should point back to these811 rootjquery = jquery(document);812 /*!813 * sizzle css selector engine v1.10.2814 * http://sizzlejs.com/815 *816 * copyright 2013 jquery foundation, inc. and other contributors817 * released under the mit license818 * http://jquery.org/license819 *820 * date: 2013-07-03821 */822 (function( window, undefined ) {823 var i,824 support,825 cachedruns,826 expr,827 gettext,828 isxml,829 compile,830 outermostcontext,831 sortinput,832 // local document vars833 setdocument,834 document,835 docelem,836 documentishtml,837 rbuggyqsa,838 rbuggymatches,839 matches,840 contains,841 // instance-specific data842 expando = "sizzle" + -(new date()),843 preferreddoc = window.document,844 dirruns = 0,845 done = 0,846 classcache = createcache(),847 tokencache = createcache(),848 compilercache = createcache(),849 hasduplicate = false,850 sortorder = function( a, b ) {851 if ( a === b ) {852 hasduplicate = true;853 return 0;854 }855 return 0;856 },857 // general-purpose constants858 strundefined = typeof undefined,859 max_negative = 1 << 31,860 // instance methods861 hasown = ({}).hasownproperty,862 arr = [],863 pop = arr.pop,864 push_native = arr.push,865 push = arr.push,866 slice = arr.slice,867 // use a stripped-down indexof if we can't use a native one868 indexof = arr.indexof || function( elem ) {869 var i = 0,870 len = this.length;871 for ( ; i < len; i++ ) {872 if ( this[i] === elem ) {873 return i;874 }875 }876 return -1;877 },878 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",879 // regular expressions880 // whitespace characters http://www.w3.org/tr/css3-selectors/#whitespace881 whitespace = "[\\x20\\t\\r\\n\\f]",882 // http://www.w3.org/tr/css3-syntax/#characters883 characterencoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",884 // loosely modeled on css identifier characters885 // an unquoted value should be a css identifier http://www.w3.org/tr/css3-selectors/#attribute-selectors886 // proper syntax: http://www.w3.org/tr/css21/syndata.html#value-def-identifier887 identifier = characterencoding.replace( "w", "w#" ),888 // acceptable operators http://www.w3.org/tr/selectors/#attribute-selectors889 attributes = "\\[" + whitespace + "*(" + characterencoding + ")" + whitespace +890 "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",891 // prefer arguments quoted,892 // then not containing pseudos/brackets,893 // then attribute selectors/non-parenthetical expressions,894 // then anything else895 // these preferences are here to reduce the number of selectors896 // needing tokenize in the pseudo prefilter897 pseudos = ":(" + characterencoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",898 // leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter899 rtrim = new regexp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),900 rcomma = new regexp( "^" + whitespace + "*," + whitespace + "*" ),901 rcombinators = new regexp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),902 rsibling = new regexp( whitespace + "*[+~]" ),903 rattributequotes = new regexp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),904 rpseudo = new regexp( pseudos ),905 ridentifier = new regexp( "^" + identifier + "$" ),906 matchexpr = {907 "id": new regexp( "^#(" + characterencoding + ")" ),908 "class": new regexp( "^\\.(" + characterencoding + ")" ),909 "tag": new regexp( "^(" + characterencoding.replace( "w", "w*" ) + ")" ),910 "attr": new regexp( "^" + attributes ),911 "pseudo": new regexp( "^" + pseudos ),912 "child": new regexp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +913 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +914 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),915 "bool": new regexp( "^(?:" + booleans + ")$", "i" ),916 // for use in libraries implementing .is()917 // we use this for pos matching in `select`918 "needscontext": new regexp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +919 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )920 },921 rnative = /^[^{]+\{\s*\[native \w/,922 // easily-parseable/retrievable id or tag or class selectors923 rquickexpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,924 rinputs = /^(?:input|select|textarea|button)$/i,925 rheader = /^h\d$/i,926 rescape = /'|\\/g,927 // css escapes http://www.w3.org/tr/css21/syndata.html#escaped-characters928 runescape = new regexp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),929 funescape = function( _, escaped, escapedwhitespace ) {930 var high = "0x" + escaped - 0x10000;931 // nan means non-codepoint932 // support: firefox933 // workaround erroneous numeric interpretation of +"0x"934 return high !== high || escapedwhitespace ?935 escaped :936 // bmp codepoint937 high < 0 ?938 string.fromcharcode( high + 0x10000 ) :939 // supplemental plane codepoint (surrogate pair)940 string.fromcharcode( high >> 10 | 0xd800, high & 0x3ff | 0xdc00 );941 };942// optimize for push.apply( _, nodelist )943 try {944 push.apply(945 (arr = slice.call( preferreddoc.childnodes )),946 preferreddoc.childnodes947 );948 // support: android<4.0949 // detect silently failing push.apply950 arr[ preferreddoc.childnodes.length ].nodetype;951 } catch ( e ) {952 push = { apply: arr.length ?953 // leverage slice if possible954 function( target, els ) {955 push_native.apply( target, slice.call(els) );956 } :957 // support: ie<9958 // otherwise append directly959 function( target, els ) {960 var j = target.length,961 i = 0;962 // can't trust nodelist.length963 while ( (target[j++] = els[i++]) ) {}964 target.length = j - 1;965 }966 };967 }968 function sizzle( selector, context, results, seed ) {969 var match, elem, m, nodetype,970 // qsa vars971 i, groups, old, nid, newcontext, newselector;972 if ( ( context ? context.ownerdocument || context : preferreddoc ) !== document ) {973 setdocument( context );974 }975 context = context || document;976 results = results || [];977 if ( !selector || typeof selector !== "string" ) {978 return results;979 }980 if ( (nodetype = context.nodetype) !== 1 && nodetype !== 9 ) {981 return [];982 }983 if ( documentishtml && !seed ) {984 // shortcuts985 if ( (match = rquickexpr.exec( selector )) ) {986 // speed-up: sizzle("#id")987 if ( (m = match[1]) ) {988 if ( nodetype === 9 ) {989 elem = context.getelementbyid( m );990 // check parentnode to catch when blackberry 4.6 returns991 // nodes that are no longer in the document #6963992 if ( elem && elem.parentnode ) {993 // handle the case where ie, opera, and webkit return items994 // by name instead of id995 if ( elem.id === m ) {996 results.push( elem );997 return results;998 }999 } else {1000 return results;1001 }1002 } else {1003 // context is not a document1004 if ( context.ownerdocument && (elem = context.ownerdocument.getelementbyid( m )) &&1005 contains( context, elem ) && elem.id === m ) {1006 results.push( elem );1007 return results;1008 }1009 }1010 // speed-up: sizzle("tag")1011 } else if ( match[2] ) {1012 push.apply( results, context.getelementsbytagname( selector ) );1013 return results;1014 // speed-up: sizzle(".class")1015 } else if ( (m = match[3]) && support.getelementsbyclassname && context.getelementsbyclassname ) {1016 push.apply( results, context.getelementsbyclassname( m ) );1017 return results;1018 }1019 }1020 // qsa path1021 if ( support.qsa && (!rbuggyqsa || !rbuggyqsa.test( selector )) ) {1022 nid = old = expando;1023 newcontext = context;1024 newselector = nodetype === 9 && selector;1025 // qsa works strangely on element-rooted queries1026 // we can work around this by specifying an extra id on the root1027 // and working up from there (thanks to andrew dupont for the technique)1028 // ie 8 doesn't work on object elements1029 if ( nodetype === 1 && context.nodename.tolowercase() !== "object" ) {1030 groups = tokenize( selector );1031 if ( (old = context.getattribute("id")) ) {1032 nid = old.replace( rescape, "\\$&" );1033 } else {1034 context.setattribute( "id", nid );1035 }1036 nid = "[id='" + nid + "'] ";1037 i = groups.length;1038 while ( i-- ) {1039 groups[i] = nid + toselector( groups[i] );1040 }1041 newcontext = rsibling.test( selector ) && context.parentnode || context;1042 newselector = groups.join(",");1043 }1044 if ( newselector ) {1045 try {1046 push.apply( results,1047 newcontext.queryselectorall( newselector )1048 );1049 return results;1050 } catch(qsaerror) {1051 } finally {1052 if ( !old ) {1053 context.removeattribute("id");1054 }1055 }1056 }1057 }1058 }1059 // all others1060 return select( selector.replace( rtrim, "$1" ), context, results, seed );1061 }1062 /**1063 * create key-value caches of limited size1064 * @returns {function(string, object)} returns the object data after storing it on itself with1065 * property name the (space-suffixed) string and (if the cache is larger than expr.cachelength)1066 * deleting the oldest entry1067 */1068 function createcache() {1069 var keys = [];1070 function cache( key, value ) {1071 // use (key + " ") to avoid collision with native prototype properties (see issue #157)1072 if ( keys.push( key += " " ) > expr.cachelength ) {1073 // only keep the most recent entries1074 delete cache[ keys.shift() ];1075 }1076 return (cache[ key ] = value);1077 }1078 return cache;1079 }1080 /**1081 * mark a function for special use by sizzle1082 * @param {function} fn the function to mark1083 */1084 function markfunction( fn ) {1085 fn[ expando ] = true;1086 return fn;1087 }1088 /**1089 * support testing using an element1090 * @param {function} fn passed the created div and expects a boolean result1091 */1092 function assert( fn ) {1093 var div = document.createelement("div");1094 try {1095 return !!fn( div );1096 } catch (e) {1097 return false;1098 } finally {1099 // remove from its parent by default1100 if ( div.parentnode ) {1101 div.parentnode.removechild( div );1102 }1103 // release memory in ie1104 div = null;1105 }1106 }1107 /**1108 * adds the same handler for all of the specified attrs1109 * @param {string} attrs pipe-separated list of attributes1110 * @param {function} handler the method that will be applied1111 */1112 function addhandle( attrs, handler ) {1113 var arr = attrs.split("|"),1114 i = attrs.length;1115 while ( i-- ) {1116 expr.attrhandle[ arr[i] ] = handler;1117 }1118 }1119 /**1120 * checks document order of two siblings1121 * @param {element} a1122 * @param {element} b1123 * @returns {number} returns less than 0 if a precedes b, greater than 0 if a follows b1124 */1125 function siblingcheck( a, b ) {1126 var cur = b && a,1127 diff = cur && a.nodetype === 1 && b.nodetype === 1 &&1128 ( ~b.sourceindex || max_negative ) -1129 ( ~a.sourceindex || max_negative );1130 // use ie sourceindex if available on both nodes1131 if ( diff ) {1132 return diff;1133 }1134 // check if b follows a1135 if ( cur ) {1136 while ( (cur = cur.nextsibling) ) {1137 if ( cur === b ) {1138 return -1;1139 }1140 }1141 }1142 return a ? 1 : -1;1143 }1144 /**1145 * returns a function to use in pseudos for input types1146 * @param {string} type1147 */1148 function createinputpseudo( type ) {1149 return function( elem ) {1150 var name = elem.nodename.tolowercase();1151 return name === "input" && elem.type === type;1152 };1153 }1154 /**1155 * returns a function to use in pseudos for buttons1156 * @param {string} type1157 */1158 function createbuttonpseudo( type ) {1159 return function( elem ) {1160 var name = elem.nodename.tolowercase();1161 return (name === "input" || name === "button") && elem.type === type;1162 };1163 }1164 /**1165 * returns a function to use in pseudos for positionals1166 * @param {function} fn1167 */1168 function createpositionalpseudo( fn ) {1169 return markfunction(function( argument ) {1170 argument = +argument;1171 return markfunction(function( seed, matches ) {1172 var j,1173 matchindexes = fn( [], seed.length, argument ),1174 i = matchindexes.length;1175 // match elements found at the specified indexes1176 while ( i-- ) {1177 if ( seed[ (j = matchindexes[i]) ] ) {1178 seed[j] = !(matches[j] = seed[j]);1179 }1180 }1181 });1182 });1183 }1184 /**1185 * detect xml1186 * @param {element|object} elem an element or a document1187 */1188 isxml = sizzle.isxml = function( elem ) {1189 // documentelement is verified for cases where it doesn't yet exist1190 // (such as loading iframes in ie - #4833)1191 var documentelement = elem && (elem.ownerdocument || elem).documentelement;1192 return documentelement ? documentelement.nodename !== "html" : false;1193 };1194// expose support vars for convenience1195 support = sizzle.support = {};1196 /**1197 * sets document-related variables once based on the current document1198 * @param {element|object} [doc] an element or document object to use to set the document1199 * @returns {object} returns the current document1200 */1201 setdocument = sizzle.setdocument = function( node ) {1202 var doc = node ? node.ownerdocument || node : preferreddoc,1203 parent = doc.defaultview;1204 // if no document and documentelement is available, return1205 if ( doc === document || doc.nodetype !== 9 || !doc.documentelement ) {1206 return document;1207 }1208 // set our document1209 document = doc;1210 docelem = doc.documentelement;1211 // support tests1212 documentishtml = !isxml( doc );1213 // support: ie>81214 // if iframe document is assigned to "document" variable and if iframe has been reloaded,1215 // ie will throw "permission denied" error when accessing "document" variable, see jquery #139361216 // ie6-8 do not support the defaultview property so parent will be undefined1217 if ( parent && parent.attachevent && parent !== parent.top ) {1218 parent.attachevent( "onbeforeunload", function() {1219 setdocument();1220 });1221 }1222 /* attributes1223 ---------------------------------------------------------------------- */1224 // support: ie<81225 // verify that getattribute really returns attributes and not properties (excepting ie8 booleans)1226 support.attributes = assert(function( div ) {1227 div.classname = "i";1228 return !div.getattribute("classname");1229 });1230 /* getelement(s)by*1231 ---------------------------------------------------------------------- */1232 // check if getelementsbytagname("*") returns only elements1233 support.getelementsbytagname = assert(function( div ) {1234 div.appendchild( doc.createcomment("") );1235 return !div.getelementsbytagname("*").length;1236 });1237 // check if getelementsbyclassname can be trusted1238 support.getelementsbyclassname = assert(function( div ) {1239 div.innerhtml = "<div class='a'></div><div class='a i'></div>";1240 // support: safari<41241 // catch class over-caching1242 div.firstchild.classname = "i";1243 // support: opera<101244 // catch gebcn failure to find non-leading classes1245 return div.getelementsbyclassname("i").length === 2;1246 });1247 // support: ie<101248 // check if getelementbyid returns elements by name1249 // the broken getelementbyid methods don't pick up programatically-set names,1250 // so use a roundabout getelementsbyname test1251 support.getbyid = assert(function( div ) {1252 docelem.appendchild( div ).id = expando;1253 return !doc.getelementsbyname || !doc.getelementsbyname( expando ).length;1254 });1255 // id find and filter1256 if ( support.getbyid ) {1257 expr.find["id"] = function( id, context ) {1258 if ( typeof context.getelementbyid !== strundefined && documentishtml ) {1259 var m = context.getelementbyid( id );1260 // check parentnode to catch when blackberry 4.6 returns1261 // nodes that are no longer in the document #69631262 return m && m.parentnode ? [m] : [];1263 }1264 };1265 expr.filter["id"] = function( id ) {1266 var attrid = id.replace( runescape, funescape );1267 return function( elem ) {1268 return elem.getattribute("id") === attrid;1269 };1270 };1271 } else {1272 // support: ie6/71273 // getelementbyid is not reliable as a find shortcut1274 delete expr.find["id"];1275 expr.filter["id"] = function( id ) {1276 var attrid = id.replace( runescape, funescape );1277 return function( elem ) {1278 var node = typeof elem.getattributenode !== strundefined && elem.getattributenode("id");1279 return node && node.value === attrid;1280 };1281 };1282 }1283 // tag1284 expr.find["tag"] = support.getelementsbytagname ?1285 function( tag, context ) {1286 if ( typeof context.getelementsbytagname !== strundefined ) {1287 return context.getelementsbytagname( tag );1288 }1289 } :1290 function( tag, context ) {1291 var elem,1292 tmp = [],1293 i = 0,1294 results = context.getelementsbytagname( tag );1295 // filter out possible comments1296 if ( tag === "*" ) {1297 while ( (elem = results[i++]) ) {1298 if ( elem.nodetype === 1 ) {1299 tmp.push( elem );1300 }1301 }1302 return tmp;1303 }1304 return results;1305 };1306 // class1307 expr.find["class"] = support.getelementsbyclassname && function( classname, context ) {1308 if ( typeof context.getelementsbyclassname !== strundefined && documentishtml ) {1309 return context.getelementsbyclassname( classname );1310 }1311 };1312 /* qsa/matchesselector1313 ---------------------------------------------------------------------- */1314 // qsa and matchesselector support1315 // matchesselector(:active) reports false when true (ie9/opera 11.5)1316 rbuggymatches = [];1317 // qsa(:focus) reports false when true (chrome 21)1318 // we allow this because of a bug in ie8/9 that throws an error1319 // whenever `document.activeelement` is accessed on an iframe1320 // so, we allow :focus to pass through qsa all the time to avoid the ie error1321 // see http://bugs.jquery.com/ticket/133781322 rbuggyqsa = [];1323 if ( (support.qsa = rnative.test( doc.queryselectorall )) ) {1324 // build qsa regex1325 // regex strategy adopted from diego perini1326 assert(function( div ) {1327 // select is set to empty string on purpose1328 // this is to test ie's treatment of not explicitly1329 // setting a boolean content attribute,1330 // since its presence should be enough1331 // http://bugs.jquery.com/ticket/123591332 div.innerhtml = "<select><option selected=''></option></select>";1333 // support: ie81334 // boolean attributes and "value" are not treated correctly1335 if ( !div.queryselectorall("[selected]").length ) {1336 rbuggyqsa.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );1337 }1338 // webkit/opera - :checked should return selected option elements1339 // http://www.w3.org/tr/2011/rec-css3-selectors-20110929/#checked1340 // ie8 throws error here and will not see later tests1341 if ( !div.queryselectorall(":checked").length ) {1342 rbuggyqsa.push(":checked");1343 }1344 });1345 assert(function( div ) {1346 // support: opera 10-12/ie81347 // ^= $= *= and empty values1348 // should not select anything1349 // support: windows 8 native apps1350 // the type attribute is restricted during .innerhtml assignment1351 var input = doc.createelement("input");1352 input.setattribute( "type", "hidden" );1353 div.appendchild( input ).setattribute( "t", "" );1354 if ( div.queryselectorall("[t^='']").length ) {1355 rbuggyqsa.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );1356 }1357 // ff 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)1358 // ie8 throws error here and will not see later tests1359 if ( !div.queryselectorall(":enabled").length ) {1360 rbuggyqsa.push( ":enabled", ":disabled" );1361 }1362 // opera 10-11 does not throw on post-comma invalid pseudos1363 div.queryselectorall("*,:x");1364 rbuggyqsa.push(",.*:");1365 });1366 }1367 if ( (support.matchesselector = rnative.test( (matches = docelem.webkitmatchesselector ||1368 docelem.mozmatchesselector ||1369 docelem.omatchesselector ||1370 docelem.msmatchesselector) )) ) {1371 assert(function( div ) {1372 // check to see if it's possible to do matchesselector1373 // on a disconnected node (ie 9)1374 support.disconnectedmatch = matches.call( div, "div" );1375 // this should fail with an exception1376 // gecko does not error, returns false instead1377 matches.call( div, "[s!='']:x" );1378 rbuggymatches.push( "!=", pseudos );1379 });1380 }1381 rbuggyqsa = rbuggyqsa.length && new regexp( rbuggyqsa.join("|") );1382 rbuggymatches = rbuggymatches.length && new regexp( rbuggymatches.join("|") );1383 /* contains1384 ---------------------------------------------------------------------- */1385 // element contains another1386 // purposefully does not implement inclusive descendent1387 // as in, an element does not contain itself1388 contains = rnative.test( docelem.contains ) || docelem.comparedocumentposition ?1389 function( a, b ) {1390 var adown = a.nodetype === 9 ? a.documentelement : a,1391 bup = b && b.parentnode;1392 return a === bup || !!( bup && bup.nodetype === 1 && (1393 adown.contains ?1394 adown.contains( bup ) :1395 a.comparedocumentposition && a.comparedocumentposition( bup ) & 161396 ));1397 } :1398 function( a, b ) {1399 if ( b ) {1400 while ( (b = b.parentnode) ) {1401 if ( b === a ) {1402 return true;1403 }1404 }1405 }1406 return false;1407 };1408 /* sorting1409 ---------------------------------------------------------------------- */1410 // document order sorting1411 sortorder = docelem.comparedocumentposition ?1412 function( a, b ) {1413 // flag for duplicate removal1414 if ( a === b ) {1415 hasduplicate = true;1416 return 0;1417 }1418 var compare = b.comparedocumentposition && a.comparedocumentposition && a.comparedocumentposition( b );1419 if ( compare ) {1420 // disconnected nodes1421 if ( compare & 1 ||1422 (!support.sortdetached && b.comparedocumentposition( a ) === compare) ) {1423 // choose the first element that is related to our preferred document1424 if ( a === doc || contains(preferreddoc, a) ) {1425 return -1;1426 }1427 if ( b === doc || contains(preferreddoc, b) ) {1428 return 1;1429 }1430 // maintain original order1431 return sortinput ?1432 ( indexof.call( sortinput, a ) - indexof.call( sortinput, b ) ) :1433 0;1434 }1435 return compare & 4 ? -1 : 1;1436 }1437 // not directly comparable, sort on existence of method1438 return a.comparedocumentposition ? -1 : 1;1439 } :1440 function( a, b ) {1441 var cur,1442 i = 0,1443 aup = a.parentnode,1444 bup = b.parentnode,1445 ap = [ a ],1446 bp = [ b ];1447 // exit early if the nodes are identical1448 if ( a === b ) {1449 hasduplicate = true;1450 return 0;1451 // parentless nodes are either documents or disconnected1452 } else if ( !aup || !bup ) {1453 return a === doc ? -1 :1454 b === doc ? 1 :1455 aup ? -1 :1456 bup ? 1 :1457 sortinput ?1458 ( indexof.call( sortinput, a ) - indexof.call( sortinput, b ) ) :1459 0;1460 // if the nodes are siblings, we can do a quick check1461 } else if ( aup === bup ) {1462 return siblingcheck( a, b );1463 }1464 // otherwise we need full lists of their ancestors for comparison1465 cur = a;1466 while ( (cur = cur.parentnode) ) {1467 ap.unshift( cur );1468 }1469 cur = b;1470 while ( (cur = cur.parentnode) ) {1471 bp.unshift( cur );1472 }1473 // walk down the tree looking for a discrepancy1474 while ( ap[i] === bp[i] ) {1475 i++;1476 }1477 return i ?1478 // do a sibling check if the nodes have a common ancestor1479 siblingcheck( ap[i], bp[i] ) :1480 // otherwise nodes in our document sort first1481 ap[i] === preferreddoc ? -1 :1482 bp[i] === preferreddoc ? 1 :1483 0;1484 };1485 return doc;1486 };1487 sizzle.matches = function( expr, elements ) {1488 return sizzle( expr, null, null, elements );1489 };1490 sizzle.matchesselector = function( elem, expr ) {1491 // set document vars if needed1492 if ( ( elem.ownerdocument || elem ) !== document ) {1493 setdocument( elem );1494 }1495 // make sure that attribute selectors are quoted1496 expr = expr.replace( rattributequotes, "='$1']" );1497 if ( support.matchesselector && documentishtml &&1498 ( !rbuggymatches || !rbuggymatches.test( expr ) ) &&1499 ( !rbuggyqsa || !rbuggyqsa.test( expr ) ) ) {1500 try {1501 var ret = matches.call( elem, expr );1502 // ie 9's matchesselector returns false on disconnected nodes1503 if ( ret || support.disconnectedmatch ||1504 // as well, disconnected nodes are said to be in a document1505 // fragment in ie 91506 elem.document && elem.document.nodetype !== 11 ) {1507 return ret;1508 }1509 } catch(e) {}1510 }1511 return sizzle( expr, document, null, [elem] ).length > 0;1512 };1513 sizzle.contains = function( context, elem ) {1514 // set document vars if needed1515 if ( ( context.ownerdocument || context ) !== document ) {1516 setdocument( context );1517 }1518 return contains( context, elem );1519 };1520 sizzle.attr = function( elem, name ) {1521 // set document vars if needed1522 if ( ( elem.ownerdocument || elem ) !== document ) {1523 setdocument( elem );1524 }1525 var fn = expr.attrhandle[ name.tolowercase() ],1526 // don't get fooled by object.prototype properties (jquery #13807)1527 val = fn && hasown.call( expr.attrhandle, name.tolowercase() ) ?1528 fn( elem, name, !documentishtml ) :1529 undefined;1530 return val === undefined ?1531 support.attributes || !documentishtml ?1532 elem.getattribute( name ) :1533 (val = elem.getattributenode(name)) && val.specified ?1534 val.value :1535 null :1536 val;1537 };1538 sizzle.error = function( msg ) {1539 throw new error( "syntax error, unrecognized expression: " + msg );1540 };1541 /**1542 * document sorting and removing duplicates1543 * @param {arraylike} results1544 */1545 sizzle.uniquesort = function( results ) {1546 var elem,1547 duplicates = [],1548 j = 0,1549 i = 0;1550 // unless we *know* we can detect duplicates, assume their presence1551 hasduplicate = !support.detectduplicates;1552 sortinput = !support.sortstable && results.slice( 0 );1553 results.sort( sortorder );1554 if ( hasduplicate ) {1555 while ( (elem = results[i++]) ) {1556 if ( elem === results[ i ] ) {1557 j = duplicates.push( i );1558 }1559 }1560 while ( j-- ) {1561 results.splice( duplicates[ j ], 1 );1562 }1563 }1564 return results;1565 };1566 /**1567 * utility function for retrieving the text value of an array of dom nodes1568 * @param {array|element} elem1569 */1570 gettext = sizzle.gettext = function( elem ) {1571 var node,1572 ret = "",1573 i = 0,1574 nodetype = elem.nodetype;1575 if ( !nodetype ) {1576 // if no nodetype, this is expected to be an array1577 for ( ; (node = elem[i]); i++ ) {1578 // do not traverse comment nodes1579 ret += gettext( node );1580 }1581 } else if ( nodetype === 1 || nodetype === 9 || nodetype === 11 ) {1582 // use textcontent for elements1583 // innertext usage removed for consistency of new lines (see #11153)1584 if ( typeof elem.textcontent === "string" ) {1585 return elem.textcontent;1586 } else {1587 // traverse its children1588 for ( elem = elem.firstchild; elem; elem = elem.nextsibling ) {1589 ret += gettext( elem );1590 }1591 }1592 } else if ( nodetype === 3 || nodetype === 4 ) {1593 return elem.nodevalue;1594 }1595 // do not include comment or processing instruction nodes1596 return ret;1597 };1598 expr = sizzle.selectors = {1599 // can be adjusted by the user1600 cachelength: 50,1601 createpseudo: markfunction,1602 match: matchexpr,1603 attrhandle: {},1604 find: {},1605 relative: {1606 ">": { dir: "parentnode", first: true },1607 " ": { dir: "parentnode" },1608 "+": { dir: "previoussibling", first: true },1609 "~": { dir: "previoussibling" }1610 },1611 prefilter: {1612 "attr": function( match ) {1613 match[1] = match[1].replace( runescape, funescape );1614 // move the given value to match[3] whether quoted or unquoted1615 match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );1616 if ( match[2] === "~=" ) {1617 match[3] = " " + match[3] + " ";1618 }1619 return match.slice( 0, 4 );1620 },1621 "child": function( match ) {1622 /* matches from matchexpr["child"]1623 1 type (only|nth|...)1624 2 what (child|of-type)1625 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)1626 4 xn-component of xn+y argument ([+-]?\d*n|)1627 5 sign of xn-component1628 6 x of xn-component1629 7 sign of y-component1630 8 y of y-component1631 */1632 match[1] = match[1].tolowercase();1633 if ( match[1].slice( 0, 3 ) === "nth" ) {1634 // nth-* requires argument1635 if ( !match[3] ) {1636 sizzle.error( match[0] );1637 }1638 // numeric x and y parameters for expr.filter.child1639 // remember that false/true cast respectively to 0/11640 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );1641 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );1642 // other types prohibit arguments1643 } else if ( match[3] ) {1644 sizzle.error( match[0] );1645 }1646 return match;1647 },1648 "pseudo": function( match ) {1649 var excess,1650 unquoted = !match[5] && match[2];1651 if ( matchexpr["child"].test( match[0] ) ) {1652 return null;1653 }1654 // accept quoted arguments as-is1655 if ( match[3] && match[4] !== undefined ) {1656 match[2] = match[4];1657 // strip excess characters from unquoted arguments1658 } else if ( unquoted && rpseudo.test( unquoted ) &&1659 // get excess from tokenize (recursively)1660 (excess = tokenize( unquoted, true )) &&1661 // advance to the next closing parenthesis1662 (excess = unquoted.indexof( ")", unquoted.length - excess ) - unquoted.length) ) {1663 // excess is a negative index1664 match[0] = match[0].slice( 0, excess );1665 match[2] = unquoted.slice( 0, excess );1666 }1667 // return only captures needed by the pseudo filter method (type and argument)1668 return match.slice( 0, 3 );1669 }1670 },1671 filter: {1672 "tag": function( nodenameselector ) {1673 var nodename = nodenameselector.replace( runescape, funescape ).tolowercase();1674 return nodenameselector === "*" ?1675 function() { return true; } :1676 function( elem ) {1677 return elem.nodename && elem.nodename.tolowercase() === nodename;1678 };1679 },1680 "class": function( classname ) {1681 var pattern = classcache[ classname + " " ];1682 return pattern ||1683 (pattern = new regexp( "(^|" + whitespace + ")" + classname + "(" + whitespace + "|$)" )) &&1684 classcache( classname, function( elem ) {1685 return pattern.test( typeof elem.classname === "string" && elem.classname || typeof elem.getattribute !== strundefined && elem.getattribute("class") || "" );1686 });1687 },1688 "attr": function( name, operator, check ) {1689 return function( elem ) {1690 var result = sizzle.attr( elem, name );1691 if ( result == null ) {1692 return operator === "!=";1693 }1694 if ( !operator ) {1695 return true;1696 }1697 result += "";1698 return operator === "=" ? result === check :1699 operator === "!=" ? result !== check :1700 operator === "^=" ? check && result.indexof( check ) === 0 :1701 operator === "*=" ? check && result.indexof( check ) > -1 :1702 operator === "$=" ? check && result.slice( -check.length ) === check :1703 operator === "~=" ? ( " " + result + " " ).indexof( check ) > -1 :1704 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :1705 false;1706 };1707 },1708 "child": function( type, what, argument, first, last ) {1709 var simple = type.slice( 0, 3 ) !== "nth",1710 forward = type.slice( -4 ) !== "last",1711 oftype = what === "of-type";1712 return first === 1 && last === 0 ?1713 // shortcut for :nth-*(n)1714 function( elem ) {1715 return !!elem.parentnode;1716 } :1717 function( elem, context, xml ) {1718 var cache, outercache, node, diff, nodeindex, start,1719 dir = simple !== forward ? "nextsibling" : "previoussibling",1720 parent = elem.parentnode,1721 name = oftype && elem.nodename.tolowercase(),1722 usecache = !xml && !oftype;1723 if ( parent ) {1724 // :(first|last|only)-(child|of-type)1725 if ( simple ) {1726 while ( dir ) {1727 node = elem;1728 while ( (node = node[ dir ]) ) {1729 if ( oftype ? node.nodename.tolowercase() === name : node.nodetype === 1 ) {1730 return false;1731 }1732 }1733 // reverse direction for :only-* (if we haven't yet done so)1734 start = dir = type === "only" && !start && "nextsibling";1735 }1736 return true;1737 }1738 start = [ forward ? parent.firstchild : parent.lastchild ];1739 // non-xml :nth-child(...) stores cache data on `parent`1740 if ( forward && usecache ) {1741 // seek `elem` from a previously-cached index1742 outercache = parent[ expando ] || (parent[ expando ] = {});1743 cache = outercache[ type ] || [];1744 nodeindex = cache[0] === dirruns && cache[1];1745 diff = cache[0] === dirruns && cache[2];1746 node = nodeindex && parent.childnodes[ nodeindex ];1747 while ( (node = ++nodeindex && node && node[ dir ] ||1748 // fallback to seeking `elem` from the start1749 (diff = nodeindex = 0) || start.pop()) ) {1750 // when found, cache indexes on `parent` and break1751 if ( node.nodetype === 1 && ++diff && node === elem ) {1752 outercache[ type ] = [ dirruns, nodeindex, diff ];1753 break;1754 }1755 }1756 // use previously-cached element index if available1757 } else if ( usecache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {1758 diff = cache[1];1759 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)1760 } else {1761 // use the same loop as above to seek `elem` from the start1762 while ( (node = ++nodeindex && node && node[ dir ] ||1763 (diff = nodeindex = 0) || start.pop()) ) {1764 if ( ( oftype ? node.nodename.tolowercase() === name : node.nodetype === 1 ) && ++diff ) {1765 // cache the index of each encountered element1766 if ( usecache ) {1767 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];1768 }1769 if ( node === elem ) {1770 break;1771 }1772 }1773 }1774 }1775 // incorporate the offset, then check against cycle size1776 diff -= last;1777 return diff === first || ( diff % first === 0 && diff / first >= 0 );1778 }1779 };1780 },1781 "pseudo": function( pseudo, argument ) {1782 // pseudo-class names are case-insensitive1783 // http://www.w3.org/tr/selectors/#pseudo-classes1784 // prioritize by case sensitivity in case custom pseudos are added with uppercase letters1785 // remember that setfilters inherits from pseudos1786 var args,1787 fn = expr.pseudos[ pseudo ] || expr.setfilters[ pseudo.tolowercase() ] ||1788 sizzle.error( "unsupported pseudo: " + pseudo );1789 // the user may use createpseudo to indicate that1790 // arguments are needed to create the filter function1791 // just as sizzle does1792 if ( fn[ expando ] ) {1793 return fn( argument );1794 }1795 // but maintain support for old signatures1796 if ( fn.length > 1 ) {1797 args = [ pseudo, pseudo, "", argument ];1798 return expr.setfilters.hasownproperty( pseudo.tolowercase() ) ?1799 markfunction(function( seed, matches ) {1800 var idx,1801 matched = fn( seed, argument ),1802 i = matched.length;1803 while ( i-- ) {1804 idx = indexof.call( seed, matched[i] );1805 seed[ idx ] = !( matches[ idx ] = matched[i] );1806 }1807 }) :1808 function( elem ) {1809 return fn( elem, 0, args );1810 };1811 }1812 return fn;1813 }1814 },1815 pseudos: {1816 // potentially complex pseudos1817 "not": markfunction(function( selector ) {1818 // trim the selector passed to compile1819 // to avoid treating leading and trailing1820 // spaces as combinators1821 var input = [],1822 results = [],1823 matcher = compile( selector.replace( rtrim, "$1" ) );1824 return matcher[ expando ] ?1825 markfunction(function( seed, matches, context, xml ) {1826 var elem,1827 unmatched = matcher( seed, null, xml, [] ),1828 i = seed.length;1829 // match elements unmatched by `matcher`1830 while ( i-- ) {1831 if ( (elem = unmatched[i]) ) {1832 seed[i] = !(matches[i] = elem);1833 }1834 }1835 }) :1836 function( elem, context, xml ) {1837 input[0] = elem;1838 matcher( input, null, xml, results );1839 return !results.pop();1840 };1841 }),1842 "has": markfunction(function( selector ) {1843 return function( elem ) {1844 return sizzle( selector, elem ).length > 0;1845 };1846 }),1847 "contains": markfunction(function( text ) {1848 return function( elem ) {1849 return ( elem.textcontent || elem.innertext || gettext( elem ) ).indexof( text ) > -1;1850 };1851 }),1852 // "whether an element is represented by a :lang() selector1853 // is based solely on the element's language value1854 // being equal to the identifier c,1855 // or beginning with the identifier c immediately followed by "-".1856 // the matching of c against the element's language value is performed case-insensitively.1857 // the identifier c does not have to be a valid language name."1858 // http://www.w3.org/tr/selectors/#lang-pseudo1859 "lang": markfunction( function( lang ) {1860 // lang value must be a valid identifier1861 if ( !ridentifier.test(lang || "") ) {1862 sizzle.error( "unsupported lang: " + lang );1863 }1864 lang = lang.replace( runescape, funescape ).tolowercase();1865 return function( elem ) {1866 var elemlang;1867 do {1868 if ( (elemlang = documentishtml ?1869 elem.lang :1870 elem.getattribute("xml:lang") || elem.getattribute("lang")) ) {1871 elemlang = elemlang.tolowercase();1872 return elemlang === lang || elemlang.indexof( lang + "-" ) === 0;1873 }1874 } while ( (elem = elem.parentnode) && elem.nodetype === 1 );1875 return false;1876 };1877 }),1878 // miscellaneous1879 "target": function( elem ) {1880 var hash = window.location && window.location.hash;1881 return hash && hash.slice( 1 ) === elem.id;1882 },1883 "root": function( elem ) {1884 return elem === docelem;1885 },1886 "focus": function( elem ) {1887 return elem === document.activeelement && (!document.hasfocus || document.hasfocus()) && !!(elem.type || elem.href || ~elem.tabindex);1888 },1889 // boolean properties1890 "enabled": function( elem ) {1891 return elem.disabled === false;1892 },1893 "disabled": function( elem ) {1894 return elem.disabled === true;1895 },1896 "checked": function( elem ) {1897 // in css3, :checked should return both checked and selected elements1898 // http://www.w3.org/tr/2011/rec-css3-selectors-20110929/#checked1899 var nodename = elem.nodename.tolowercase();1900 return (nodename === "input" && !!elem.checked) || (nodename === "option" && !!elem.selected);1901 },1902 "selected": function( elem ) {1903 // accessing this property makes selected-by-default1904 // options in safari work properly1905 if ( elem.parentnode ) {1906 elem.parentnode.selectedindex;1907 }1908 return elem.selected === true;1909 },1910 // contents1911 "empty": function( elem ) {1912 // http://www.w3.org/tr/selectors/#empty-pseudo1913 // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),1914 // not comment, processing instructions, or others1915 // thanks to diego perini for the nodename shortcut1916 // greater than "@" means alpha characters (specifically not starting with "#" or "?")1917 for ( elem = elem.firstchild; elem; elem = elem.nextsibling ) {1918 if ( elem.nodename > "@" || elem.nodetype === 3 || elem.nodetype === 4 ) {1919 return false;1920 }1921 }1922 return true;1923 },1924 "parent": function( elem ) {1925 return !expr.pseudos["empty"]( elem );1926 },1927 // element/input types1928 "header": function( elem ) {1929 return rheader.test( elem.nodename );1930 },1931 "input": function( elem ) {1932 return rinputs.test( elem.nodename );1933 },1934 "button": function( elem ) {1935 var name = elem.nodename.tolowercase();1936 return name === "input" && elem.type === "button" || name === "button";1937 },1938 "text": function( elem ) {1939 var attr;1940 // ie6 and 7 will map elem.type to 'text' for new html5 types (search, etc)1941 // use getattribute instead to test this case1942 return elem.nodename.tolowercase() === "input" &&1943 elem.type === "text" &&1944 ( (attr = elem.getattribute("type")) == null || attr.tolowercase() === elem.type );1945 },1946 // position-in-collection1947 "first": createpositionalpseudo(function() {1948 return [ 0 ];1949 }),1950 "last": createpositionalpseudo(function( matchindexes, length ) {1951 return [ length - 1 ];1952 }),1953 "eq": createpositionalpseudo(function( matchindexes, length, argument ) {1954 return [ argument < 0 ? argument + length : argument ];1955 }),1956 "even": createpositionalpseudo(function( matchindexes, length ) {1957 var i = 0;1958 for ( ; i < length; i += 2 ) {1959 matchindexes.push( i );1960 }1961 return matchindexes;1962 }),1963 "odd": createpositionalpseudo(function( matchindexes, length ) {1964 var i = 1;1965 for ( ; i < length; i += 2 ) {1966 matchindexes.push( i );1967 }1968 return matchindexes;1969 }),1970 "lt": createpositionalpseudo(function( matchindexes, length, argument ) {1971 var i = argument < 0 ? argument + length : argument;1972 for ( ; --i >= 0; ) {1973 matchindexes.push( i );1974 }1975 return matchindexes;1976 }),1977 "gt": createpositionalpseudo(function( matchindexes, length, argument ) {1978 var i = argument < 0 ? argument + length : argument;1979 for ( ; ++i < length; ) {1980 matchindexes.push( i );1981 }1982 return matchindexes;1983 })1984 }1985 };1986 expr.pseudos["nth"] = expr.pseudos["eq"];1987// add button/input type pseudos1988 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {1989 expr.pseudos[ i ] = createinputpseudo( i );1990 }1991 for ( i in { submit: true, reset: true } ) {1992 expr.pseudos[ i ] = createbuttonpseudo( i );1993 }1994// easy api for creating new setfilters1995 function setfilters() {}1996 setfilters.prototype = expr.filters = expr.pseudos;1997 expr.setfilters = new setfilters();1998 function tokenize( selector, parseonly ) {1999 var matched, match, tokens, type,2000 sofar, groups, prefilters,2001 cached = tokencache[ selector + " " ];2002 if ( cached ) {2003 return parseonly ? 0 : cached.slice( 0 );2004 }2005 sofar = selector;2006 groups = [];2007 prefilters = expr.prefilter;2008 while ( sofar ) {2009 // comma and first run2010 if ( !matched || (match = rcomma.exec( sofar )) ) {2011 if ( match ) {2012 // don't consume trailing commas as valid2013 sofar = sofar.slice( match[0].length ) || sofar;2014 }2015 groups.push( tokens = [] );2016 }2017 matched = false;2018 // combinators2019 if ( (match = rcombinators.exec( sofar )) ) {2020 matched = match.shift();2021 tokens.push({2022 value: matched,2023 // cast descendant combinators to space2024 type: match[0].replace( rtrim, " " )2025 });2026 sofar = sofar.slice( matched.length );2027 }2028 // filters2029 for ( type in expr.filter ) {2030 if ( (match = matchexpr[ type ].exec( sofar )) && (!prefilters[ type ] ||2031 (match = prefilters[ type ]( match ))) ) {2032 matched = match.shift();2033 tokens.push({2034 value: matched,2035 type: type,2036 matches: match2037 });2038 sofar = sofar.slice( matched.length );2039 }2040 }2041 if ( !matched ) {2042 break;2043 }2044 }2045 // return the length of the invalid excess2046 // if we're just parsing2047 // otherwise, throw an error or return tokens2048 return parseonly ?2049 sofar.length :2050 sofar ?2051 sizzle.error( selector ) :2052 // cache the tokens2053 tokencache( selector, groups ).slice( 0 );2054 }2055 function toselector( tokens ) {2056 var i = 0,2057 len = tokens.length,2058 selector = "";2059 for ( ; i < len; i++ ) {2060 selector += tokens[i].value;2061 }2062 return selector;2063 }2064 function addcombinator( matcher, combinator, base ) {2065 var dir = combinator.dir,2066 checknonelements = base && dir === "parentnode",2067 donename = done++;2068 return combinator.first ?2069 // check against closest ancestor/preceding element2070 function( elem, context, xml ) {2071 while ( (elem = elem[ dir ]) ) {2072 if ( elem.nodetype === 1 || checknonelements ) {2073 return matcher( elem, context, xml );2074 }2075 }2076 } :2077 // check against all ancestor/preceding elements2078 function( elem, context, xml ) {2079 var data, cache, outercache,2080 dirkey = dirruns + " " + donename;2081 // we can't set arbitrary data on xml nodes, so they don't benefit from dir caching2082 if ( xml ) {2083 while ( (elem = elem[ dir ]) ) {2084 if ( elem.nodetype === 1 || checknonelements ) {2085 if ( matcher( elem, context, xml ) ) {2086 return true;2087 }2088 }2089 }2090 } else {2091 while ( (elem = elem[ dir ]) ) {2092 if ( elem.nodetype === 1 || checknonelements ) {2093 outercache = elem[ expando ] || (elem[ expando ] = {});2094 if ( (cache = outercache[ dir ]) && cache[0] === dirkey ) {2095 if ( (data = cache[1]) === true || data === cachedruns ) {2096 return data === true;2097 }2098 } else {2099 cache = outercache[ dir ] = [ dirkey ];2100 cache[1] = matcher( elem, context, xml ) || cachedruns;2101 if ( cache[1] === true ) {2102 return true;2103 }2104 }2105 }2106 }2107 }2108 };2109 }2110 function elementmatcher( matchers ) {2111 return matchers.length > 1 ?2112 function( elem, context, xml ) {2113 var i = matchers.length;2114 while ( i-- ) {2115 if ( !matchers[i]( elem, context, xml ) ) {2116 return false;2117 }2118 }2119 return true;2120 } :2121 matchers[0];2122 }2123 function condense( unmatched, map, filter, context, xml ) {2124 var elem,2125 newunmatched = [],2126 i = 0,2127 len = unmatched.length,2128 mapped = map != null;2129 for ( ; i < len; i++ ) {2130 if ( (elem = unmatched[i]) ) {2131 if ( !filter || filter( elem, context, xml ) ) {2132 newunmatched.push( elem );2133 if ( mapped ) {2134 map.push( i );2135 }2136 }2137 }2138 }2139 return newunmatched;2140 }2141 function setmatcher( prefilter, selector, matcher, postfilter, postfinder, postselector ) {2142 if ( postfilter && !postfilter[ expando ] ) {2143 postfilter = setmatcher( postfilter );2144 }2145 if ( postfinder && !postfinder[ expando ] ) {2146 postfinder = setmatcher( postfinder, postselector );2147 }2148 return markfunction(function( seed, results, context, xml ) {2149 var temp, i, elem,2150 premap = [],2151 postmap = [],2152 preexisting = results.length,2153 // get initial elements from seed or context2154 elems = seed || multiplecontexts( selector || "*", context.nodetype ? [ context ] : context, [] ),2155 // prefilter to get matcher input, preserving a map for seed-results synchronization2156 matcherin = prefilter && ( seed || !selector ) ?2157 condense( elems, premap, prefilter, context, xml ) :2158 elems,2159 matcherout = matcher ?2160 // if we have a postfinder, or filtered seed, or non-seed postfilter or preexisting results,2161 postfinder || ( seed ? prefilter : preexisting || postfilter ) ?2162 // ...intermediate processing is necessary2163 [] :2164 // ...otherwise use results directly2165 results :2166 matcherin;2167 // find primary matches2168 if ( matcher ) {2169 matcher( matcherin, matcherout, context, xml );2170 }2171 // apply postfilter2172 if ( postfilter ) {2173 temp = condense( matcherout, postmap );2174 postfilter( temp, [], context, xml );2175 // un-match failing elements by moving them back to matcherin2176 i = temp.length;2177 while ( i-- ) {2178 if ( (elem = temp[i]) ) {2179 matcherout[ postmap[i] ] = !(matcherin[ postmap[i] ] = elem);2180 }2181 }2182 }2183 if ( seed ) {2184 if ( postfinder || prefilter ) {2185 if ( postfinder ) {2186 // get the final matcherout by condensing this intermediate into postfinder contexts2187 temp = [];2188 i = matcherout.length;2189 while ( i-- ) {2190 if ( (elem = matcherout[i]) ) {2191 // restore matcherin since elem is not yet a final match2192 temp.push( (matcherin[i] = elem) );2193 }2194 }2195 postfinder( null, (matcherout = []), temp, xml );2196 }2197 // move matched elements from seed to results to keep them synchronized2198 i = matcherout.length;2199 while ( i-- ) {2200 if ( (elem = matcherout[i]) &&2201 (temp = postfinder ? indexof.call( seed, elem ) : premap[i]) > -1 ) {2202 seed[temp] = !(results[temp] = elem);2203 }2204 }2205 }2206 // add elements to results, through postfinder if defined2207 } else {2208 matcherout = condense(2209 matcherout === results ?2210 matcherout.splice( preexisting, matcherout.length ) :2211 matcherout2212 );2213 if ( postfinder ) {2214 postfinder( null, results, matcherout, xml );2215 } else {2216 push.apply( results, matcherout );2217 }2218 }2219 });2220 }2221 function matcherfromtokens( tokens ) {2222 var checkcontext, matcher, j,2223 len = tokens.length,2224 leadingrelative = expr.relative[ tokens[0].type ],2225 implicitrelative = leadingrelative || expr.relative[" "],2226 i = leadingrelative ? 1 : 0,2227 // the foundational matcher ensures that elements are reachable from top-level context(s)2228 matchcontext = addcombinator( function( elem ) {2229 return elem === checkcontext;2230 }, implicitrelative, true ),2231 matchanycontext = addcombinator( function( elem ) {2232 return indexof.call( checkcontext, elem ) > -1;2233 }, implicitrelative, true ),2234 matchers = [ function( elem, context, xml ) {2235 return ( !leadingrelative && ( xml || context !== outermostcontext ) ) || (2236 (checkcontext = context).nodetype ?2237 matchcontext( elem, context, xml ) :2238 matchanycontext( elem, context, xml ) );2239 } ];2240 for ( ; i < len; i++ ) {2241 if ( (matcher = expr.relative[ tokens[i].type ]) ) {2242 matchers = [ addcombinator(elementmatcher( matchers ), matcher) ];2243 } else {2244 matcher = expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );2245 // return special upon seeing a positional matcher2246 if ( matcher[ expando ] ) {2247 // find the next relative operator (if any) for proper handling2248 j = ++i;2249 for ( ; j < len; j++ ) {2250 if ( expr.relative[ tokens[j].type ] ) {2251 break;2252 }2253 }2254 return setmatcher(2255 i > 1 && elementmatcher( matchers ),2256 i > 1 && toselector(2257 // if the preceding token was a descendant combinator, insert an implicit any-element `*`2258 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })2259 ).replace( rtrim, "$1" ),2260 matcher,2261 i < j && matcherfromtokens( tokens.slice( i, j ) ),2262 j < len && matcherfromtokens( (tokens = tokens.slice( j )) ),2263 j < len && toselector( tokens )2264 );2265 }2266 matchers.push( matcher );2267 }2268 }2269 return elementmatcher( matchers );2270 }2271 function matcherfromgroupmatchers( elementmatchers, setmatchers ) {2272 // a counter to specify which element is currently being matched2273 var matchercachedruns = 0,2274 byset = setmatchers.length > 0,2275 byelement = elementmatchers.length > 0,2276 supermatcher = function( seed, context, xml, results, expandcontext ) {2277 var elem, j, matcher,2278 setmatched = [],2279 matchedcount = 0,2280 i = "0",2281 unmatched = seed && [],2282 outermost = expandcontext != null,2283 contextbackup = outermostcontext,2284 // we must always have either seed elements or context2285 elems = seed || byelement && expr.find["tag"]( "*", expandcontext && context.parentnode || context ),2286 // use integer dirruns iff this is the outermost matcher2287 dirrunsunique = (dirruns += contextbackup == null ? 1 : math.random() || 0.1);2288 if ( outermost ) {2289 outermostcontext = context !== document && context;2290 cachedruns = matchercachedruns;2291 }2292 // add elements passing elementmatchers directly to results2293 // keep `i` a string if there are no elements so `matchedcount` will be "00" below2294 for ( ; (elem = elems[i]) != null; i++ ) {2295 if ( byelement && elem ) {2296 j = 0;2297 while ( (matcher = elementmatchers[j++]) ) {2298 if ( matcher( elem, context, xml ) ) {2299 results.push( elem );2300 break;2301 }2302 }2303 if ( outermost ) {2304 dirruns = dirrunsunique;2305 cachedruns = ++matchercachedruns;2306 }2307 }2308 // track unmatched elements for set filters2309 if ( byset ) {2310 // they will have gone through all possible matchers2311 if ( (elem = !matcher && elem) ) {2312 matchedcount--;2313 }2314 // lengthen the array for every element, matched or not2315 if ( seed ) {2316 unmatched.push( elem );2317 }2318 }2319 }2320 // apply set filters to unmatched elements2321 matchedcount += i;2322 if ( byset && i !== matchedcount ) {2323 j = 0;2324 while ( (matcher = setmatchers[j++]) ) {2325 matcher( unmatched, setmatched, context, xml );2326 }2327 if ( seed ) {2328 // reintegrate element matches to eliminate the need for sorting2329 if ( matchedcount > 0 ) {2330 while ( i-- ) {2331 if ( !(unmatched[i] || setmatched[i]) ) {2332 setmatched[i] = pop.call( results );2333 }2334 }2335 }2336 // discard index placeholder values to get only actual matches2337 setmatched = condense( setmatched );2338 }2339 // add matches to results2340 push.apply( results, setmatched );2341 // seedless set matches succeeding multiple successful matchers stipulate sorting2342 if ( outermost && !seed && setmatched.length > 0 &&2343 ( matchedcount + setmatchers.length ) > 1 ) {2344 sizzle.uniquesort( results );2345 }2346 }2347 // override manipulation of globals by nested matchers2348 if ( outermost ) {2349 dirruns = dirrunsunique;2350 outermostcontext = contextbackup;2351 }2352 return unmatched;2353 };2354 return byset ?2355 markfunction( supermatcher ) :2356 supermatcher;2357 }2358 compile = sizzle.compile = function( selector, group /* internal use only */ ) {2359 var i,2360 setmatchers = [],2361 elementmatchers = [],2362 cached = compilercache[ selector + " " ];2363 if ( !cached ) {2364 // generate a function of recursive functions that can be used to check each element2365 if ( !group ) {2366 group = tokenize( selector );2367 }2368 i = group.length;2369 while ( i-- ) {2370 cached = matcherfromtokens( group[i] );2371 if ( cached[ expando ] ) {2372 setmatchers.push( cached );2373 } else {2374 elementmatchers.push( cached );2375 }2376 }2377 // cache the compiled function2378 cached = compilercache( selector, matcherfromgroupmatchers( elementmatchers, setmatchers ) );2379 }2380 return cached;2381 };2382 function multiplecontexts( selector, contexts, results ) {2383 var i = 0,2384 len = contexts.length;2385 for ( ; i < len; i++ ) {2386 sizzle( selector, contexts[i], results );2387 }2388 return results;2389 }2390 function select( selector, context, results, seed ) {2391 var i, tokens, token, type, find,2392 match = tokenize( selector );2393 if ( !seed ) {2394 // try to minimize operations if there is only one group2395 if ( match.length === 1 ) {2396 // take a shortcut and set the context if the root selector is an id2397 tokens = match[0] = match[0].slice( 0 );2398 if ( tokens.length > 2 && (token = tokens[0]).type === "id" &&2399 support.getbyid && context.nodetype === 9 && documentishtml &&2400 expr.relative[ tokens[1].type ] ) {2401 context = ( expr.find["id"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];2402 if ( !context ) {2403 return results;2404 }2405 selector = selector.slice( tokens.shift().value.length );2406 }2407 // fetch a seed set for right-to-left matching2408 i = matchexpr["needscontext"].test( selector ) ? 0 : tokens.length;2409 while ( i-- ) {2410 token = tokens[i];2411 // abort if we hit a combinator2412 if ( expr.relative[ (type = token.type) ] ) {2413 break;2414 }2415 if ( (find = expr.find[ type ]) ) {2416 // search, expanding context for leading sibling combinators2417 if ( (seed = find(2418 token.matches[0].replace( runescape, funescape ),2419 rsibling.test( tokens[0].type ) && context.parentnode || context2420 )) ) {2421 // if seed is empty or no tokens remain, we can return early2422 tokens.splice( i, 1 );2423 selector = seed.length && toselector( tokens );2424 if ( !selector ) {2425 push.apply( results, seed );2426 return results;2427 }2428 break;2429 }2430 }2431 }2432 }2433 }2434 // compile and execute a filtering function2435 // provide `match` to avoid retokenization if we modified the selector above2436 compile( selector, match )(2437 seed,2438 context,2439 !documentishtml,2440 results,2441 rsibling.test( selector )2442 );2443 return results;2444 }2445// one-time assignments2446// sort stability2447 support.sortstable = expando.split("").sort( sortorder ).join("") === expando;2448// support: chrome<142449// always assume duplicates if they aren't passed to the comparison function2450 support.detectduplicates = hasduplicate;2451// initialize against the default document2452 setdocument();2453// support: webkit<537.32 - safari 6.0.3/chrome 25 (fixed in chrome 27)2454// detached nodes confoundingly follow *each other*2455 support.sortdetached = assert(function( div1 ) {2456 // should return 1, but returns 4 (following)2457 return div1.comparedocumentposition( document.createelement("div") ) & 1;2458 });2459// support: ie<82460// prevent attribute/property "interpolation"2461// http://msdn.microsoft.com/en-us/library/ms536429%28vs.85%29.aspx2462 if ( !assert(function( div ) {2463 div.innerhtml = "<a href='#'></a>";2464 return div.firstchild.getattribute("href") === "#" ;2465 }) ) {2466 addhandle( "type|href|height|width", function( elem, name, isxml ) {2467 if ( !isxml ) {2468 return elem.getattribute( name, name.tolowercase() === "type" ? 1 : 2 );2469 }2470 });2471 }2472// support: ie<92473// use defaultvalue in place of getattribute("value")2474 if ( !support.attributes || !assert(function( div ) {2475 div.innerhtml = "<input/>";2476 div.firstchild.setattribute( "value", "" );2477 return div.firstchild.getattribute( "value" ) === "";2478 }) ) {2479 addhandle( "value", function( elem, name, isxml ) {2480 if ( !isxml && elem.nodename.tolowercase() === "input" ) {2481 return elem.defaultvalue;2482 }2483 });2484 }2485// support: ie<92486// use getattributenode to fetch booleans when getattribute lies2487 if ( !assert(function( div ) {2488 return div.getattribute("disabled") == null;2489 }) ) {2490 addhandle( booleans, function( elem, name, isxml ) {2491 var val;2492 if ( !isxml ) {2493 return (val = elem.getattributenode( name )) && val.specified ?2494 val.value :2495 elem[ name ] === true ? name.tolowercase() : null;2496 }2497 });2498 }2499 jquery.find = sizzle;2500 jquery.expr = sizzle.selectors;2501 jquery.expr[":"] = jquery.expr.pseudos;2502 jquery.unique = sizzle.uniquesort;2503 jquery.text = sizzle.gettext;2504 jquery.isxmldoc = sizzle.isxml;2505 jquery.contains = sizzle.contains;2506 })( window );2507// string to object options format cache2508 var optionscache = {};2509// convert string-formatted options into object-formatted ones and store in cache2510 function createoptions( options ) {2511 var object = optionscache[ options ] = {};2512 jquery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {2513 object[ flag ] = true;2514 });2515 return object;2516 }2517 /*2518 * create a callback list using the following parameters:2519 *2520 * options: an optional list of space-separated options that will change how2521 * the callback list behaves or a more traditional option object2522 *2523 * by default a callback list will act like an event callback list and can be2524 * "fired" multiple times.2525 *2526 * possible options:2527 *2528 * once: will ensure the callback list can only be fired once (like a deferred)2529 *2530 * memory: will keep track of previous values and will call any callback added2531 * after the list has been fired right away with the latest "memorized"2532 * values (like a deferred)2533 *2534 * unique: will ensure a callback can only be added once (no duplicate in the list)2535 *2536 * stoponfalse: interrupt callings when a callback returns false2537 *2538 */2539 jquery.callbacks = function( options ) {2540 // convert options from string-formatted to object-formatted if needed2541 // (we check in cache first)2542 options = typeof options === "string" ?2543 ( optionscache[ options ] || createoptions( options ) ) :2544 jquery.extend( {}, options );2545 var // flag to know if list is currently firing2546 firing,2547 // last fire value (for non-forgettable lists)2548 memory,2549 // flag to know if list was already fired2550 fired,2551 // end of the loop when firing2552 firinglength,2553 // index of currently firing callback (modified by remove if needed)2554 firingindex,2555 // first callback to fire (used internally by add and firewith)2556 firingstart,2557 // actual callback list2558 list = [],2559 // stack of fire calls for repeatable lists2560 stack = !options.once && [],2561 // fire callbacks2562 fire = function( data ) {2563 memory = options.memory && data;2564 fired = true;2565 firingindex = firingstart || 0;2566 firingstart = 0;2567 firinglength = list.length;2568 firing = true;2569 for ( ; list && firingindex < firinglength; firingindex++ ) {2570 if ( list[ firingindex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stoponfalse ) {2571 memory = false; // to prevent further calls using add2572 break;2573 }2574 }2575 firing = false;2576 if ( list ) {2577 if ( stack ) {2578 if ( stack.length ) {2579 fire( stack.shift() );2580 }2581 } else if ( memory ) {2582 list = [];2583 } else {2584 self.disable();2585 }2586 }2587 },2588 // actual callbacks object2589 self = {2590 // add a callback or a collection of callbacks to the list2591 add: function() {2592 if ( list ) {2593 // first, we save the current length2594 var start = list.length;2595 (function add( args ) {2596 jquery.each( args, function( _, arg ) {2597 var type = jquery.type( arg );2598 if ( type === "function" ) {2599 if ( !options.unique || !self.has( arg ) ) {2600 list.push( arg );2601 }2602 } else if ( arg && arg.length && type !== "string" ) {2603 // inspect recursively2604 add( arg );2605 }2606 });2607 })( arguments );2608 // do we need to add the callbacks to the2609 // current firing batch?2610 if ( firing ) {2611 firinglength = list.length;2612 // with memory, if we're not firing then2613 // we should call right away2614 } else if ( memory ) {2615 firingstart = start;2616 fire( memory );2617 }2618 }2619 return this;2620 },2621 // remove a callback from the list2622 remove: function() {2623 if ( list ) {2624 jquery.each( arguments, function( _, arg ) {2625 var index;2626 while( ( index = jquery.inarray( arg, list, index ) ) > -1 ) {2627 list.splice( index, 1 );2628 // handle firing indexes2629 if ( firing ) {2630 if ( index <= firinglength ) {2631 firinglength--;2632 }2633 if ( index <= firingindex ) {2634 firingindex--;2635 }2636 }2637 }2638 });2639 }2640 return this;2641 },2642 // check if a given callback is in the list.2643 // if no argument is given, return whether or not list has callbacks attached.2644 has: function( fn ) {2645 return fn ? jquery.inarray( fn, list ) > -1 : !!( list && list.length );2646 },2647 // remove all callbacks from the list2648 empty: function() {2649 list = [];2650 firinglength = 0;2651 return this;2652 },2653 // have the list do nothing anymore2654 disable: function() {2655 list = stack = memory = undefined;2656 return this;2657 },2658 // is it disabled?2659 disabled: function() {2660 return !list;2661 },2662 // lock the list in its current state2663 lock: function() {2664 stack = undefined;2665 if ( !memory ) {2666 self.disable();2667 }2668 return this;2669 },2670 // is it locked?2671 locked: function() {2672 return !stack;2673 },2674 // call all callbacks with the given context and arguments2675 firewith: function( context, args ) {2676 if ( list && ( !fired || stack ) ) {2677 args = args || [];2678 args = [ context, args.slice ? args.slice() : args ];2679 if ( firing ) {2680 stack.push( args );2681 } else {2682 fire( args );2683 }2684 }2685 return this;2686 },2687 // call all the callbacks with the given arguments2688 fire: function() {2689 self.firewith( this, arguments );2690 return this;2691 },2692 // to know if the callbacks have already been called at least once2693 fired: function() {2694 return !!fired;2695 }2696 };2697 return self;2698 };2699 jquery.extend({2700 deferred: function( func ) {2701 var tuples = [2702 // action, add listener, listener list, final state2703 [ "resolve", "done", jquery.callbacks("once memory"), "resolved" ],2704 [ "reject", "fail", jquery.callbacks("once memory"), "rejected" ],2705 [ "notify", "progress", jquery.callbacks("memory") ]2706 ],2707 state = "pending",2708 promise = {2709 state: function() {2710 return state;2711 },2712 always: function() {2713 deferred.done( arguments ).fail( arguments );2714 return this;2715 },2716 then: function( /* fndone, fnfail, fnprogress */ ) {2717 var fns = arguments;2718 return jquery.deferred(function( newdefer ) {2719 jquery.each( tuples, function( i, tuple ) {2720 var action = tuple[ 0 ],2721 fn = jquery.isfunction( fns[ i ] ) && fns[ i ];2722 // deferred[ done | fail | progress ] for forwarding actions to newdefer2723 deferred[ tuple[1] ](function() {2724 var returned = fn && fn.apply( this, arguments );2725 if ( returned && jquery.isfunction( returned.promise ) ) {2726 returned.promise()2727 .done( newdefer.resolve )2728 .fail( newdefer.reject )2729 .progress( newdefer.notify );2730 } else {2731 newdefer[ action + "with" ]( this === promise ? newdefer.promise() : this, fn ? [ returned ] : arguments );2732 }2733 });2734 });2735 fns = null;2736 }).promise();2737 },2738 // get a promise for this deferred2739 // if obj is provided, the promise aspect is added to the object2740 promise: function( obj ) {2741 return obj != null ? jquery.extend( obj, promise ) : promise;2742 }2743 },2744 deferred = {};2745 // keep pipe for back-compat2746 promise.pipe = promise.then;2747 // add list-specific methods2748 jquery.each( tuples, function( i, tuple ) {2749 var list = tuple[ 2 ],2750 statestring = tuple[ 3 ];2751 // promise[ done | fail | progress ] = list.add2752 promise[ tuple[1] ] = list.add;2753 // handle state2754 if ( statestring ) {2755 list.add(function() {2756 // state = [ resolved | rejected ]2757 state = statestring;2758 // [ reject_list | resolve_list ].disable; progress_list.lock2759 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );2760 }2761 // deferred[ resolve | reject | notify ]2762 deferred[ tuple[0] ] = function() {2763 deferred[ tuple[0] + "with" ]( this === deferred ? promise : this, arguments );2764 return this;2765 };2766 deferred[ tuple[0] + "with" ] = list.firewith;2767 });2768 // make the deferred a promise2769 promise.promise( deferred );2770 // call given func if any2771 if ( func ) {2772 func.call( deferred, deferred );2773 }2774 // all done!2775 return deferred;2776 },2777 // deferred helper2778 when: function( subordinate /* , ..., subordinaten */ ) {2779 var i = 0,2780 resolvevalues = core_slice.call( arguments ),2781 length = resolvevalues.length,2782 // the count of uncompleted subordinates2783 remaining = length !== 1 || ( subordinate && jquery.isfunction( subordinate.promise ) ) ? length : 0,2784 // the master deferred. if resolvevalues consist of only a single deferred, just use that.2785 deferred = remaining === 1 ? subordinate : jquery.deferred(),2786 // update function for both resolve and progress values2787 updatefunc = function( i, contexts, values ) {2788 return function( value ) {2789 contexts[ i ] = this;2790 values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;2791 if( values === progressvalues ) {2792 deferred.notifywith( contexts, values );2793 } else if ( !( --remaining ) ) {2794 deferred.resolvewith( contexts, values );2795 }2796 };2797 },2798 progressvalues, progresscontexts, resolvecontexts;2799 // add listeners to deferred subordinates; treat others as resolved2800 if ( length > 1 ) {2801 progressvalues = new array( length );2802 progresscontexts = new array( length );2803 resolvecontexts = new array( length );2804 for ( ; i < length; i++ ) {2805 if ( resolvevalues[ i ] && jquery.isfunction( resolvevalues[ i ].promise ) ) {2806 resolvevalues[ i ].promise()2807 .done( updatefunc( i, resolvecontexts, resolvevalues ) )2808 .fail( deferred.reject )2809 .progress( updatefunc( i, progresscontexts, progressvalues ) );2810 } else {2811 --remaining;2812 }2813 }2814 }2815 // if we're not waiting on anything, resolve the master2816 if ( !remaining ) {2817 deferred.resolvewith( resolvecontexts, resolvevalues );2818 }2819 return deferred.promise();2820 }2821 });2822 jquery.support = (function( support ) {2823 var all, a, input, select, fragment, opt, eventname, issupported, i,2824 div = document.createelement("div");2825 // setup2826 div.setattribute( "classname", "t" );2827 div.innerhtml = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";2828 // finish early in limited (non-browser) environments2829 all = div.getelementsbytagname("*") || [];2830 a = div.getelementsbytagname("a")[ 0 ];2831 if ( !a || !a.style || !all.length ) {2832 return support;2833 }2834 // first batch of tests2835 select = document.createelement("select");2836 opt = select.appendchild( document.createelement("option") );2837 input = div.getelementsbytagname("input")[ 0 ];2838 a.style.csstext = "top:1px;float:left;opacity:.5";2839 // test setattribute on camelcase class. if it works, we need attrfixes when doing get/setattribute (ie6/7)2840 support.getsetattribute = div.classname !== "t";2841 // ie strips leading whitespace when .innerhtml is used2842 support.leadingwhitespace = div.firstchild.nodetype === 3;2843 // make sure that tbody elements aren't automatically inserted2844 // ie will insert them into empty tables2845 support.tbody = !div.getelementsbytagname("tbody").length;2846 // make sure that link elements get serialized correctly by innerhtml2847 // this requires a wrapper element in ie2848 support.htmlserialize = !!div.getelementsbytagname("link").length;2849 // get the style information from getattribute2850 // (ie uses .csstext instead)2851 support.style = /top/.test( a.getattribute("style") );2852 // make sure that urls aren't manipulated2853 // (ie normalizes it by default)2854 support.hrefnormalized = a.getattribute("href") === "/a";2855 // make sure that element opacity exists2856 // (ie uses filter instead)2857 // use a regex to work around a webkit issue. see #51452858 support.opacity = /^0.5/.test( a.style.opacity );2859 // verify style float existence2860 // (ie uses stylefloat instead of cssfloat)2861 support.cssfloat = !!a.style.cssfloat;2862 // check the default checkbox/radio value ("" on webkit; "on" elsewhere)2863 support.checkon = !!input.value;2864 // make sure that a selected-by-default option has a working selected property.2865 // (webkit defaults to false instead of true, ie too, if it's in an optgroup)2866 support.optselected = opt.selected;2867 // tests for enctype support on a form (#6743)2868 support.enctype = !!document.createelement("form").enctype;2869 // makes sure cloning an html5 element does not cause problems2870 // where outerhtml is undefined, this still works2871 support.html5clone = document.createelement("nav").clonenode( true ).outerhtml !== "<:nav></:nav>";2872 // will be defined later2873 support.inlineblockneedslayout = false;2874 support.shrinkwrapblocks = false;2875 support.pixelposition = false;2876 support.deleteexpando = true;2877 support.nocloneevent = true;2878 support.reliablemarginright = true;2879 support.boxsizingreliable = true;2880 // make sure checked status is properly cloned2881 input.checked = true;2882 support.noclonechecked = input.clonenode( true ).checked;2883 // make sure that the options inside disabled selects aren't marked as disabled2884 // (webkit marks them as disabled)2885 select.disabled = true;2886 support.optdisabled = !opt.disabled;2887 // support: ie<92888 try {2889 delete div.test;2890 } catch( e ) {2891 support.deleteexpando = false;2892 }2893 // check if we can trust getattribute("value")2894 input = document.createelement("input");2895 input.setattribute( "value", "" );2896 support.input = input.getattribute( "value" ) === "";2897 // check if an input maintains its value after becoming a radio2898 input.value = "t";2899 input.setattribute( "type", "radio" );2900 support.radiovalue = input.value === "t";2901 // #11217 - webkit loses check when the name is after the checked attribute2902 input.setattribute( "checked", "t" );2903 input.setattribute( "name", "t" );2904 fragment = document.createdocumentfragment();2905 fragment.appendchild( input );2906 // check if a disconnected checkbox will retain its checked2907 // value of true after appended to the dom (ie6/7)2908 support.appendchecked = input.checked;2909 // webkit doesn't clone checked state correctly in fragments2910 support.checkclone = fragment.clonenode( true ).clonenode( true ).lastchild.checked;2911 // support: ie<92912 // opera does not clone events (and typeof div.attachevent === undefined).2913 // ie9-10 clones events bound via attachevent, but they don't trigger with .click()2914 if ( div.attachevent ) {2915 div.attachevent( "onclick", function() {2916 support.nocloneevent = false;2917 });2918 div.clonenode( true ).click();2919 }2920 // support: ie<9 (lack submit/change bubble), firefox 17+ (lack focusin event)2921 // beware of csp restrictions (https://developer.mozilla.org/en/security/csp)2922 for ( i in { submit: true, change: true, focusin: true }) {2923 div.setattribute( eventname = "on" + i, "t" );2924 support[ i + "bubbles" ] = eventname in window || div.attributes[ eventname ].expando === false;2925 }2926 div.style.backgroundclip = "content-box";2927 div.clonenode( true ).style.backgroundclip = "";2928 support.clearclonestyle = div.style.backgroundclip === "content-box";2929 // support: ie<92930 // iteration over object's inherited properties before its own.2931 for ( i in jquery( support ) ) {2932 break;2933 }2934 support.ownlast = i !== "0";2935 // run tests that need a body at doc ready2936 jquery(function() {2937 var container, margindiv, tds,2938 divreset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",2939 body = document.getelementsbytagname("body")[0];2940 if ( !body ) {2941 // return for frameset docs that don't have a body2942 return;2943 }2944 container = document.createelement("div");2945 container.style.csstext = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";2946 body.appendchild( container ).appendchild( div );2947 // support: ie82948 // check if table cells still have offsetwidth/height when they are set2949 // to display:none and there are still other visible table cells in a2950 // table row; if so, offsetwidth/height are not reliable for use when2951 // determining if an element has been hidden directly using2952 // display:none (it is still safe to use offsets if a parent element is2953 // hidden; don safety goggles and see bug #4512 for more information).2954 div.innerhtml = "<table><tr><td></td><td>t</td></tr></table>";2955 tds = div.getelementsbytagname("td");2956 tds[ 0 ].style.csstext = "padding:0;margin:0;border:0;display:none";2957 issupported = ( tds[ 0 ].offsetheight === 0 );2958 tds[ 0 ].style.display = "";2959 tds[ 1 ].style.display = "none";2960 // support: ie82961 // check if empty table cells still have offsetwidth/height2962 support.reliablehiddenoffsets = issupported && ( tds[ 0 ].offsetheight === 0 );2963 // check box-sizing and margin behavior.2964 div.innerhtml = "";2965 div.style.csstext = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";2966 // workaround failing boxsizing test due to offsetwidth returning wrong value2967 // with some non-1 values of body zoom, ticket #135432968 jquery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {2969 support.boxsizing = div.offsetwidth === 4;2970 });2971 // use window.getcomputedstyle because jsdom on node.js will break without it.2972 if ( window.getcomputedstyle ) {2973 support.pixelposition = ( window.getcomputedstyle( div, null ) || {} ).top !== "1%";2974 support.boxsizingreliable = ( window.getcomputedstyle( div, null ) || { width: "4px" } ).width === "4px";2975 // check if div with explicit width and no margin-right incorrectly2976 // gets computed margin-right based on width of container. (#3333)2977 // fails in webkit before feb 2011 nightlies2978 // webkit bug 13343 - getcomputedstyle returns wrong value for margin-right2979 margindiv = div.appendchild( document.createelement("div") );2980 margindiv.style.csstext = div.style.csstext = divreset;2981 margindiv.style.marginright = margindiv.style.width = "0";2982 div.style.width = "1px";2983 support.reliablemarginright =2984 !parsefloat( ( window.getcomputedstyle( margindiv, null ) || {} ).marginright );2985 }2986 if ( typeof div.style.zoom !== core_strundefined ) {2987 // support: ie<82988 // check if natively block-level elements act like inline-block2989 // elements when setting their display to 'inline' and giving2990 // them layout2991 div.innerhtml = "";2992 div.style.csstext = divreset + "width:1px;padding:1px;display:inline;zoom:1";2993 support.inlineblockneedslayout = ( div.offsetwidth === 3 );2994 // support: ie62995 // check if elements with layout shrink-wrap their children2996 div.style.display = "block";2997 div.innerhtml = "<div></div>";2998 div.firstchild.style.width = "5px";2999 support.shrinkwrapblocks = ( div.offsetwidth !== 3 );3000 if ( support.inlineblockneedslayout ) {3001 // prevent ie 6 from affecting layout for positioned elements #110483002 // prevent ie from shrinking the body in ie 7 mode #128693003 // support: ie<83004 body.style.zoom = 1;3005 }3006 }3007 body.removechild( container );3008 // null elements to avoid leaks in ie3009 container = div = tds = margindiv = null;3010 });3011 // null elements to avoid leaks in ie3012 all = select = fragment = opt = a = input = null;3013 return support;3014 })({});3015 var rbrace = /(?:\{[\s\s]*\}|\[[\s\s]*\])$/,3016 rmultidash = /([a-z])/g;3017 function internaldata( elem, name, data, pvt /* internal use only */ ){3018 if ( !jquery.acceptdata( elem ) ) {3019 return;3020 }3021 var ret, thiscache,3022 internalkey = jquery.expando,3023 // we have to handle dom nodes and js objects differently because ie6-73024 // can't gc object references properly across the dom-js boundary3025 isnode = elem.nodetype,3026 // only dom nodes need the global jquery cache; js object data is3027 // attached directly to the object so gc can occur automatically3028 cache = isnode ? jquery.cache : elem,3029 // only defining an id for js objects if its cache already exists allows3030 // the code to shortcut on the same path as a dom node with no cache3031 id = isnode ? elem[ internalkey ] : elem[ internalkey ] && internalkey;3032 // avoid doing any more work than we need to when trying to get data on an3033 // object that has no data at all3034 if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {3035 return;3036 }3037 if ( !id ) {3038 // only dom nodes need a new unique id for each element since their data3039 // ends up in the global cache3040 if ( isnode ) {3041 id = elem[ internalkey ] = core_deletedids.pop() || jquery.guid++;3042 } else {3043 id = internalkey;3044 }3045 }3046 if ( !cache[ id ] ) {3047 // avoid exposing jquery metadata on plain js objects when the object3048 // is serialized using json.stringify3049 cache[ id ] = isnode ? {} : { tojson: jquery.noop };3050 }3051 // an object can be passed to jquery.data instead of a key/value pair; this gets3052 // shallow copied over onto the existing cache3053 if ( typeof name === "object" || typeof name === "function" ) {3054 if ( pvt ) {3055 cache[ id ] = jquery.extend( cache[ id ], name );3056 } else {3057 cache[ id ].data = jquery.extend( cache[ id ].data, name );3058 }3059 }3060 thiscache = cache[ id ];3061 // jquery data() is stored in a separate object inside the object's internal data3062 // cache in order to avoid key collisions between internal data and user-defined3063 // data.3064 if ( !pvt ) {3065 if ( !thiscache.data ) {3066 thiscache.data = {};3067 }3068 thiscache = thiscache.data;3069 }3070 if ( data !== undefined ) {3071 thiscache[ jquery.camelcase( name ) ] = data;3072 }3073 // check for both converted-to-camel and non-converted data property names3074 // if a data property was specified3075 if ( typeof name === "string" ) {3076 // first try to find as-is property data3077 ret = thiscache[ name ];3078 // test for null|undefined property data3079 if ( ret == null ) {3080 // try to find the camelcased property3081 ret = thiscache[ jquery.camelcase( name ) ];3082 }3083 } else {3084 ret = thiscache;3085 }3086 return ret;3087 }3088 function internalremovedata( elem, name, pvt ) {3089 if ( !jquery.acceptdata( elem ) ) {3090 return;3091 }3092 var thiscache, i,3093 isnode = elem.nodetype,3094 // see jquery.data for more information3095 cache = isnode ? jquery.cache : elem,3096 id = isnode ? elem[ jquery.expando ] : jquery.expando;3097 // if there is already no cache entry for this object, there is no3098 // purpose in continuing3099 if ( !cache[ id ] ) {3100 return;3101 }3102 if ( name ) {3103 thiscache = pvt ? cache[ id ] : cache[ id ].data;3104 if ( thiscache ) {3105 // support array or space separated string names for data keys3106 if ( !jquery.isarray( name ) ) {3107 // try the string as a key before any manipulation3108 if ( name in thiscache ) {3109 name = [ name ];3110 } else {3111 // split the camel cased version by spaces unless a key with the spaces exists3112 name = jquery.camelcase( name );3113 if ( name in thiscache ) {3114 name = [ name ];3115 } else {3116 name = name.split(" ");3117 }3118 }3119 } else {3120 // if "name" is an array of keys...3121 // when data is initially created, via ("key", "val") signature,3122 // keys will be converted to camelcase.3123 // since there is no way to tell _how_ a key was added, remove3124 // both plain key and camelcase key. #127863125 // this will only penalize the array argument path.3126 name = name.concat( jquery.map( name, jquery.camelcase ) );3127 }3128 i = name.length;3129 while ( i-- ) {3130 delete thiscache[ name[i] ];3131 }3132 // if there is no data left in the cache, we want to continue3133 // and let the cache object itself get destroyed3134 if ( pvt ? !isemptydataobject(thiscache) : !jquery.isemptyobject(thiscache) ) {3135 return;3136 }3137 }3138 }3139 // see jquery.data for more information3140 if ( !pvt ) {3141 delete cache[ id ].data;3142 // don't destroy the parent cache unless the internal data object3143 // had been the only thing left in it3144 if ( !isemptydataobject( cache[ id ] ) ) {3145 return;3146 }3147 }3148 // destroy the cache3149 if ( isnode ) {3150 jquery.cleandata( [ elem ], true );3151 // use delete when supported for expandos or `cache` is not a window per iswindow (#10080)3152 /* jshint eqeqeq: false */3153 } else if ( jquery.support.deleteexpando || cache != cache.window ) {3154 /* jshint eqeqeq: true */3155 delete cache[ id ];3156 // when all else fails, null3157 } else {3158 cache[ id ] = null;3159 }3160 }3161 jquery.extend({3162 cache: {},3163 // the following elements throw uncatchable exceptions if you3164 // attempt to add expando properties to them.3165 nodata: {3166 "applet": true,3167 "embed": true,3168 // ban all objects except for flash (which handle expandos)3169 "object": "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"3170 },3171 hasdata: function( elem ) {3172 elem = elem.nodetype ? jquery.cache[ elem[jquery.expando] ] : elem[ jquery.expando ];3173 return !!elem && !isemptydataobject( elem );3174 },3175 data: function( elem, name, data ) {3176 return internaldata( elem, name, data );3177 },3178 removedata: function( elem, name ) {3179 return internalremovedata( elem, name );3180 },3181 // for internal use only.3182 _data: function( elem, name, data ) {3183 return internaldata( elem, name, data, true );3184 },3185 _removedata: function( elem, name ) {3186 return internalremovedata( elem, name, true );3187 },3188 // a method for determining if a dom node can handle the data expando3189 acceptdata: function( elem ) {3190 // do not set data on non-element because it will not be cleared (#8335).3191 if ( elem.nodetype && elem.nodetype !== 1 && elem.nodetype !== 9 ) {3192 return false;3193 }3194 var nodata = elem.nodename && jquery.nodata[ elem.nodename.tolowercase() ];3195 // nodes accept data unless otherwise specified; rejection can be conditional3196 return !nodata || nodata !== true && elem.getattribute("classid") === nodata;3197 }3198 });3199 jquery.fn.extend({3200 data: function( key, value ) {3201 var attrs, name,3202 data = null,3203 i = 0,3204 elem = this[0];3205 // special expections of .data basically thwart jquery.access,3206 // so implement the relevant behavior ourselves3207 // gets all values3208 if ( key === undefined ) {3209 if ( this.length ) {3210 data = jquery.data( elem );3211 if ( elem.nodetype === 1 && !jquery._data( elem, "parsedattrs" ) ) {3212 attrs = elem.attributes;3213 for ( ; i < attrs.length; i++ ) {3214 name = attrs[i].name;3215 if ( name.indexof("data-") === 0 ) {3216 name = jquery.camelcase( name.slice(5) );3217 dataattr( elem, name, data[ name ] );3218 }3219 }3220 jquery._data( elem, "parsedattrs", true );3221 }3222 }3223 return data;3224 }3225 // sets multiple values3226 if ( typeof key === "object" ) {3227 return this.each(function() {3228 jquery.data( this, key );3229 });3230 }3231 return arguments.length > 1 ?3232 // sets one value3233 this.each(function() {3234 jquery.data( this, key, value );3235 }) :3236 // gets one value3237 // try to fetch any internally stored data first3238 elem ? dataattr( elem, key, jquery.data( elem, key ) ) : null;3239 },3240 removedata: function( key ) {3241 return this.each(function() {3242 jquery.removedata( this, key );3243 });3244 }3245 });3246 function dataattr( elem, key, data ) {3247 // if nothing was found internally, try to fetch any3248 // data from the html5 data-* attribute3249 if ( data === undefined && elem.nodetype === 1 ) {3250 var name = "data-" + key.replace( rmultidash, "-$1" ).tolowercase();3251 data = elem.getattribute( name );3252 if ( typeof data === "string" ) {3253 try {3254 data = data === "true" ? true :3255 data === "false" ? false :3256 data === "null" ? null :3257 // only convert to a number if it doesn't change the string3258 +data + "" === data ? +data :3259 rbrace.test( data ) ? jquery.parsejson( data ) :3260 data;3261 } catch( e ) {}3262 // make sure we set the data so it isn't changed later3263 jquery.data( elem, key, data );3264 } else {3265 data = undefined;3266 }3267 }3268 return data;3269 }3270// checks a cache object for emptiness3271 function isemptydataobject( obj ) {3272 var name;3273 for ( name in obj ) {3274 // if the public data object is empty, the private is still empty3275 if ( name === "data" && jquery.isemptyobject( obj[name] ) ) {3276 continue;3277 }3278 if ( name !== "tojson" ) {3279 return false;3280 }3281 }3282 return true;3283 }3284 jquery.extend({3285 queue: function( elem, type, data ) {3286 var queue;3287 if ( elem ) {3288 type = ( type || "fx" ) + "queue";3289 queue = jquery._data( elem, type );3290 // speed up dequeue by getting out quickly if this is just a lookup3291 if ( data ) {3292 if ( !queue || jquery.isarray(data) ) {3293 queue = jquery._data( elem, type, jquery.makearray(data) );3294 } else {3295 queue.push( data );3296 }3297 }3298 return queue || [];3299 }3300 },3301 dequeue: function( elem, type ) {3302 type = type || "fx";3303 var queue = jquery.queue( elem, type ),3304 startlength = queue.length,3305 fn = queue.shift(),3306 hooks = jquery._queuehooks( elem, type ),3307 next = function() {3308 jquery.dequeue( elem, type );3309 };3310 // if the fx queue is dequeued, always remove the progress sentinel3311 if ( fn === "inprogress" ) {3312 fn = queue.shift();3313 startlength--;3314 }3315 if ( fn ) {3316 // add a progress sentinel to prevent the fx queue from being3317 // automatically dequeued3318 if ( type === "fx" ) {3319 queue.unshift( "inprogress" );3320 }3321 // clear up the last queue stop function3322 delete hooks.stop;3323 fn.call( elem, next, hooks );3324 }3325 if ( !startlength && hooks ) {3326 hooks.empty.fire();3327 }3328 },3329 // not intended for public consumption - generates a queuehooks object, or returns the current one3330 _queuehooks: function( elem, type ) {3331 var key = type + "queuehooks";3332 return jquery._data( elem, key ) || jquery._data( elem, key, {3333 empty: jquery.callbacks("once memory").add(function() {3334 jquery._removedata( elem, type + "queue" );3335 jquery._removedata( elem, key );3336 })3337 });3338 }3339 });3340 jquery.fn.extend({3341 queue: function( type, data ) {3342 var setter = 2;3343 if ( typeof type !== "string" ) {3344 data = type;3345 type = "fx";3346 setter--;3347 }3348 if ( arguments.length < setter ) {3349 return jquery.queue( this[0], type );3350 }3351 return data === undefined ?3352 this :3353 this.each(function() {3354 var queue = jquery.queue( this, type, data );3355 // ensure a hooks for this queue3356 jquery._queuehooks( this, type );3357 if ( type === "fx" && queue[0] !== "inprogress" ) {3358 jquery.dequeue( this, type );3359 }3360 });3361 },3362 dequeue: function( type ) {3363 return this.each(function() {3364 jquery.dequeue( this, type );3365 });3366 },3367 // based off of the plugin by clint helfers, with permission.3368 // http://blindsignals.com/index.php/2009/07/jquery-delay/3369 delay: function( time, type ) {3370 time = jquery.fx ? jquery.fx.speeds[ time ] || time : time;3371 type = type || "fx";3372 return this.queue( type, function( next, hooks ) {3373 var timeout = settimeout( next, time );3374 hooks.stop = function() {3375 cleartimeout( timeout );3376 };3377 });3378 },3379 clearqueue: function( type ) {3380 return this.queue( type || "fx", [] );3381 },3382 // get a promise resolved when queues of a certain type3383 // are emptied (fx is the type by default)3384 promise: function( type, obj ) {3385 var tmp,3386 count = 1,3387 defer = jquery.deferred(),3388 elements = this,3389 i = this.length,3390 resolve = function() {3391 if ( !( --count ) ) {3392 defer.resolvewith( elements, [ elements ] );3393 }3394 };3395 if ( typeof type !== "string" ) {3396 obj = type;3397 type = undefined;3398 }3399 type = type || "fx";3400 while( i-- ) {3401 tmp = jquery._data( elements[ i ], type + "queuehooks" );3402 if ( tmp && tmp.empty ) {3403 count++;3404 tmp.empty.add( resolve );3405 }3406 }3407 resolve();3408 return defer.promise( obj );3409 }3410 });3411 var nodehook, boolhook,3412 rclass = /[\t\r\n\f]/g,3413 rreturn = /\r/g,3414 rfocusable = /^(?:input|select|textarea|button|object)$/i,3415 rclickable = /^(?:a|area)$/i,3416 rusedefault = /^(?:checked|selected)$/i,3417 getsetattribute = jquery.support.getsetattribute,3418 getsetinput = jquery.support.input;3419 jquery.fn.extend({3420 attr: function( name, value ) {3421 return jquery.access( this, jquery.attr, name, value, arguments.length > 1 );3422 },3423 removeattr: function( name ) {3424 return this.each(function() {3425 jquery.removeattr( this, name );3426 });3427 },3428 prop: function( name, value ) {3429 return jquery.access( this, jquery.prop, name, value, arguments.length > 1 );3430 },3431 removeprop: function( name ) {3432 name = jquery.propfix[ name ] || name;3433 return this.each(function() {3434 // try/catch handles cases where ie balks (such as removing a property on window)3435 try {3436 this[ name ] = undefined;3437 delete this[ name ];3438 } catch( e ) {}3439 });3440 },3441 addclass: function( value ) {3442 var classes, elem, cur, clazz, j,3443 i = 0,3444 len = this.length,3445 proceed = typeof value === "string" && value;3446 if ( jquery.isfunction( value ) ) {3447 return this.each(function( j ) {3448 jquery( this ).addclass( value.call( this, j, this.classname ) );3449 });3450 }3451 if ( proceed ) {3452 // the disjunction here is for better compressibility (see removeclass)3453 classes = ( value || "" ).match( core_rnotwhite ) || [];3454 for ( ; i < len; i++ ) {3455 elem = this[ i ];3456 cur = elem.nodetype === 1 && ( elem.classname ?3457 ( " " + elem.classname + " " ).replace( rclass, " " ) :3458 " "3459 );3460 if ( cur ) {3461 j = 0;3462 while ( (clazz = classes[j++]) ) {3463 if ( cur.indexof( " " + clazz + " " ) < 0 ) {3464 cur += clazz + " ";3465 }3466 }3467 elem.classname = jquery.trim( cur );3468 }3469 }3470 }3471 return this;3472 },3473 removeclass: function( value ) {3474 var classes, elem, cur, clazz, j,3475 i = 0,3476 len = this.length,3477 proceed = arguments.length === 0 || typeof value === "string" && value;3478 if ( jquery.isfunction( value ) ) {3479 return this.each(function( j ) {3480 jquery( this ).removeclass( value.call( this, j, this.classname ) );3481 });3482 }3483 if ( proceed ) {3484 classes = ( value || "" ).match( core_rnotwhite ) || [];3485 for ( ; i < len; i++ ) {3486 elem = this[ i ];3487 // this expression is here for better compressibility (see addclass)3488 cur = elem.nodetype === 1 && ( elem.classname ?3489 ( " " + elem.classname + " " ).replace( rclass, " " ) :3490 ""3491 );3492 if ( cur ) {3493 j = 0;3494 while ( (clazz = classes[j++]) ) {3495 // remove *all* instances3496 while ( cur.indexof( " " + clazz + " " ) >= 0 ) {3497 cur = cur.replace( " " + clazz + " ", " " );3498 }3499 }3500 elem.classname = value ? jquery.trim( cur ) : "";3501 }3502 }3503 }3504 return this;3505 },3506 toggleclass: function( value, stateval ) {3507 var type = typeof value;3508 if ( typeof stateval === "boolean" && type === "string" ) {3509 return stateval ? this.addclass( value ) : this.removeclass( value );3510 }3511 if ( jquery.isfunction( value ) ) {3512 return this.each(function( i ) {3513 jquery( this ).toggleclass( value.call(this, i, this.classname, stateval), stateval );3514 });3515 }3516 return this.each(function() {3517 if ( type === "string" ) {3518 // toggle individual class names3519 var classname,3520 i = 0,3521 self = jquery( this ),3522 classnames = value.match( core_rnotwhite ) || [];3523 while ( (classname = classnames[ i++ ]) ) {3524 // check each classname given, space separated list3525 if ( self.hasclass( classname ) ) {3526 self.removeclass( classname );3527 } else {3528 self.addclass( classname );3529 }3530 }3531 // toggle whole class name3532 } else if ( type === core_strundefined || type === "boolean" ) {3533 if ( this.classname ) {3534 // store classname if set3535 jquery._data( this, "__classname__", this.classname );3536 }3537 // if the element has a class name or if we're passed "false",3538 // then remove the whole classname (if there was one, the above saved it).3539 // otherwise bring back whatever was previously saved (if anything),3540 // falling back to the empty string if nothing was stored.3541 this.classname = this.classname || value === false ? "" : jquery._data( this, "__classname__" ) || "";3542 }3543 });3544 },3545 hasclass: function( selector ) {3546 var classname = " " + selector + " ",3547 i = 0,3548 l = this.length;3549 for ( ; i < l; i++ ) {3550 if ( this[i].nodetype === 1 && (" " + this[i].classname + " ").replace(rclass, " ").indexof( classname ) >= 0 ) {3551 return true;3552 }3553 }3554 return false;3555 },3556 val: function( value ) {3557 var ret, hooks, isfunction,3558 elem = this[0];3559 if ( !arguments.length ) {3560 if ( elem ) {3561 hooks = jquery.valhooks[ elem.type ] || jquery.valhooks[ elem.nodename.tolowercase() ];3562 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {3563 return ret;3564 }3565 ret = elem.value;3566 return typeof ret === "string" ?3567 // handle most common string cases3568 ret.replace(rreturn, "") :3569 // handle cases where value is null/undef or number3570 ret == null ? "" : ret;3571 }3572 return;3573 }3574 isfunction = jquery.isfunction( value );3575 return this.each(function( i ) {3576 var val;3577 if ( this.nodetype !== 1 ) {3578 return;3579 }3580 if ( isfunction ) {3581 val = value.call( this, i, jquery( this ).val() );3582 } else {3583 val = value;3584 }3585 // treat null/undefined as ""; convert numbers to string3586 if ( val == null ) {3587 val = "";3588 } else if ( typeof val === "number" ) {3589 val += "";3590 } else if ( jquery.isarray( val ) ) {3591 val = jquery.map(val, function ( value ) {3592 return value == null ? "" : value + "";3593 });3594 }3595 hooks = jquery.valhooks[ this.type ] || jquery.valhooks[ this.nodename.tolowercase() ];3596 // if set returns undefined, fall back to normal setting3597 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {3598 this.value = val;3599 }3600 });3601 }3602 });3603 jquery.extend({3604 valhooks: {3605 option: {3606 get: function( elem ) {3607 // use proper attribute retrieval(#6932, #12072)3608 var val = jquery.find.attr( elem, "value" );3609 return val != null ?3610 val :3611 elem.text;3612 }3613 },3614 select: {3615 get: function( elem ) {3616 var value, option,3617 options = elem.options,3618 index = elem.selectedindex,3619 one = elem.type === "select-one" || index < 0,3620 values = one ? null : [],3621 max = one ? index + 1 : options.length,3622 i = index < 0 ?3623 max :3624 one ? index : 0;3625 // loop through all the selected options3626 for ( ; i < max; i++ ) {3627 option = options[ i ];3628 // oldie doesn't update selected after form reset (#2551)3629 if ( ( option.selected || i === index ) &&3630 // don't return options that are disabled or in a disabled optgroup3631 ( jquery.support.optdisabled ? !option.disabled : option.getattribute("disabled") === null ) &&3632 ( !option.parentnode.disabled || !jquery.nodename( option.parentnode, "optgroup" ) ) ) {3633 // get the specific value for the option3634 value = jquery( option ).val();3635 // we don't need an array for one selects3636 if ( one ) {3637 return value;3638 }3639 // multi-selects return an array3640 values.push( value );3641 }3642 }3643 return values;3644 },3645 set: function( elem, value ) {3646 var optionset, option,3647 options = elem.options,3648 values = jquery.makearray( value ),3649 i = options.length;3650 while ( i-- ) {3651 option = options[ i ];3652 if ( (option.selected = jquery.inarray( jquery(option).val(), values ) >= 0) ) {3653 optionset = true;3654 }3655 }3656 // force browsers to behave consistently when non-matching value is set3657 if ( !optionset ) {3658 elem.selectedindex = -1;3659 }3660 return values;3661 }3662 }3663 },3664 attr: function( elem, name, value ) {3665 var hooks, ret,3666 ntype = elem.nodetype;3667 // don't get/set attributes on text, comment and attribute nodes3668 if ( !elem || ntype === 3 || ntype === 8 || ntype === 2 ) {3669 return;3670 }3671 // fallback to prop when attributes are not supported3672 if ( typeof elem.getattribute === core_strundefined ) {3673 return jquery.prop( elem, name, value );3674 }3675 // all attributes are lowercase3676 // grab necessary hook if one is defined3677 if ( ntype !== 1 || !jquery.isxmldoc( elem ) ) {3678 name = name.tolowercase();3679 hooks = jquery.attrhooks[ name ] ||3680 ( jquery.expr.match.bool.test( name ) ? boolhook : nodehook );3681 }3682 if ( value !== undefined ) {3683 if ( value === null ) {3684 jquery.removeattr( elem, name );3685 } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {3686 return ret;3687 } else {3688 elem.setattribute( name, value + "" );3689 return value;3690 }3691 } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {3692 return ret;3693 } else {3694 ret = jquery.find.attr( elem, name );3695 // non-existent attributes return null, we normalize to undefined3696 return ret == null ?3697 undefined :3698 ret;3699 }3700 },3701 removeattr: function( elem, value ) {3702 var name, propname,3703 i = 0,3704 attrnames = value && value.match( core_rnotwhite );3705 if ( attrnames && elem.nodetype === 1 ) {3706 while ( (name = attrnames[i++]) ) {3707 propname = jquery.propfix[ name ] || name;3708 // boolean attributes get special treatment (#10870)3709 if ( jquery.expr.match.bool.test( name ) ) {3710 // set corresponding property to false3711 if ( getsetinput && getsetattribute || !rusedefault.test( name ) ) {3712 elem[ propname ] = false;3713 // support: ie<93714 // also clear defaultchecked/defaultselected (if appropriate)3715 } else {3716 elem[ jquery.camelcase( "default-" + name ) ] =3717 elem[ propname ] = false;3718 }3719 // see #9699 for explanation of this approach (setting first, then removal)3720 } else {3721 jquery.attr( elem, name, "" );3722 }3723 elem.removeattribute( getsetattribute ? name : propname );3724 }3725 }3726 },3727 attrhooks: {3728 type: {3729 set: function( elem, value ) {3730 if ( !jquery.support.radiovalue && value === "radio" && jquery.nodename(elem, "input") ) {3731 // setting the type on a radio button after the value resets the value in ie6-93732 // reset value to default in case type is set after value during creation3733 var val = elem.value;3734 elem.setattribute( "type", value );3735 if ( val ) {3736 elem.value = val;3737 }3738 return value;3739 }3740 }3741 }3742 },3743 propfix: {3744 "for": "htmlfor",3745 "class": "classname"3746 },3747 prop: function( elem, name, value ) {3748 var ret, hooks, notxml,3749 ntype = elem.nodetype;3750 // don't get/set properties on text, comment and attribute nodes3751 if ( !elem || ntype === 3 || ntype === 8 || ntype === 2 ) {3752 return;3753 }3754 notxml = ntype !== 1 || !jquery.isxmldoc( elem );3755 if ( notxml ) {3756 // fix name and attach hooks3757 name = jquery.propfix[ name ] || name;3758 hooks = jquery.prophooks[ name ];3759 }3760 if ( value !== undefined ) {3761 return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?3762 ret :3763 ( elem[ name ] = value );3764 } else {3765 return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?3766 ret :3767 elem[ name ];3768 }3769 },3770 prophooks: {3771 tabindex: {3772 get: function( elem ) {3773 // elem.tabindex doesn't always return the correct value when it hasn't been explicitly set3774 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/3775 // use proper attribute retrieval(#12072)3776 var tabindex = jquery.find.attr( elem, "tabindex" );3777 return tabindex ?3778 parseint( tabindex, 10 ) :3779 rfocusable.test( elem.nodename ) || rclickable.test( elem.nodename ) && elem.href ?3780 0 :3781 -1;3782 }3783 }3784 }3785 });3786// hooks for boolean attributes3787 boolhook = {3788 set: function( elem, value, name ) {3789 if ( value === false ) {3790 // remove boolean attributes when set to false3791 jquery.removeattr( elem, name );3792 } else if ( getsetinput && getsetattribute || !rusedefault.test( name ) ) {3793 // ie<8 needs the *property* name3794 elem.setattribute( !getsetattribute && jquery.propfix[ name ] || name, name );3795 // use defaultchecked and defaultselected for oldie3796 } else {3797 elem[ jquery.camelcase( "default-" + name ) ] = elem[ name ] = true;3798 }3799 return name;3800 }3801 };3802 jquery.each( jquery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {3803 var getter = jquery.expr.attrhandle[ name ] || jquery.find.attr;3804 jquery.expr.attrhandle[ name ] = getsetinput && getsetattribute || !rusedefault.test( name ) ?3805 function( elem, name, isxml ) {3806 var fn = jquery.expr.attrhandle[ name ],3807 ret = isxml ?3808 undefined :3809 /* jshint eqeqeq: false */3810 (jquery.expr.attrhandle[ name ] = undefined) !=3811 getter( elem, name, isxml ) ?3812 name.tolowercase() :3813 null;3814 jquery.expr.attrhandle[ name ] = fn;3815 return ret;3816 } :3817 function( elem, name, isxml ) {3818 return isxml ?3819 undefined :3820 elem[ jquery.camelcase( "default-" + name ) ] ?3821 name.tolowercase() :3822 null;3823 };3824 });3825// fix oldie attroperties3826 if ( !getsetinput || !getsetattribute ) {3827 jquery.attrhooks.value = {3828 set: function( elem, value, name ) {3829 if ( jquery.nodename( elem, "input" ) ) {3830 // does not return so that setattribute is also used3831 elem.defaultvalue = value;3832 } else {3833 // use nodehook if defined (#1954); otherwise setattribute is fine3834 return nodehook && nodehook.set( elem, value, name );3835 }3836 }3837 };3838 }3839// ie6/7 do not support getting/setting some attributes with get/setattribute3840 if ( !getsetattribute ) {3841 // use this for any attribute in ie6/73842 // this fixes almost every ie6/7 issue3843 nodehook = {3844 set: function( elem, value, name ) {3845 // set the existing or create a new attribute node3846 var ret = elem.getattributenode( name );3847 if ( !ret ) {3848 elem.setattributenode(3849 (ret = elem.ownerdocument.createattribute( name ))3850 );3851 }3852 ret.value = value += "";3853 // break association with cloned elements by also using setattribute (#9646)3854 return name === "value" || value === elem.getattribute( name ) ?3855 value :3856 undefined;3857 }3858 };3859 jquery.expr.attrhandle.id = jquery.expr.attrhandle.name = jquery.expr.attrhandle.coords =3860 // some attributes are constructed with empty-string values when not defined3861 function( elem, name, isxml ) {3862 var ret;3863 return isxml ?3864 undefined :3865 (ret = elem.getattributenode( name )) && ret.value !== "" ?3866 ret.value :3867 null;3868 };3869 jquery.valhooks.button = {3870 get: function( elem, name ) {3871 var ret = elem.getattributenode( name );3872 return ret && ret.specified ?3873 ret.value :3874 undefined;3875 },3876 set: nodehook.set3877 };3878 // set contenteditable to false on removals(#10429)3879 // setting to empty string throws an error as an invalid value3880 jquery.attrhooks.contenteditable = {3881 set: function( elem, value, name ) {3882 nodehook.set( elem, value === "" ? false : value, name );3883 }3884 };3885 // set width and height to auto instead of 0 on empty string( bug #8150 )3886 // this is for removals3887 jquery.each([ "width", "height" ], function( i, name ) {3888 jquery.attrhooks[ name ] = {3889 set: function( elem, value ) {3890 if ( value === "" ) {3891 elem.setattribute( name, "auto" );3892 return value;3893 }3894 }3895 };3896 });3897 }3898// some attributes require a special call on ie3899// http://msdn.microsoft.com/en-us/library/ms536429%28vs.85%29.aspx3900 if ( !jquery.support.hrefnormalized ) {3901 // href/src property should get the full normalized url (#10299/#12915)3902 jquery.each([ "href", "src" ], function( i, name ) {3903 jquery.prophooks[ name ] = {3904 get: function( elem ) {3905 return elem.getattribute( name, 4 );3906 }3907 };3908 });3909 }3910 if ( !jquery.support.style ) {3911 jquery.attrhooks.style = {3912 get: function( elem ) {3913 // return undefined in the case of empty string3914 // note: ie uppercases css property names, but if we were to .tolowercase()3915 // .csstext, that would destroy case senstitivity in url's, like in "background"3916 return elem.style.csstext || undefined;3917 },3918 set: function( elem, value ) {3919 return ( elem.style.csstext = value + "" );3920 }3921 };3922 }3923// safari mis-reports the default selected property of an option3924// accessing the parent's selectedindex property fixes it3925 if ( !jquery.support.optselected ) {3926 jquery.prophooks.selected = {3927 get: function( elem ) {3928 var parent = elem.parentnode;3929 if ( parent ) {3930 parent.selectedindex;3931 // make sure that it also works with optgroups, see #57013932 if ( parent.parentnode ) {3933 parent.parentnode.selectedindex;3934 }3935 }3936 return null;3937 }3938 };3939 }3940 jquery.each([3941 "tabindex",3942 "readonly",3943 "maxlength",3944 "cellspacing",3945 "cellpadding",3946 "rowspan",3947 "colspan",3948 "usemap",3949 "frameborder",3950 "contenteditable"3951 ], function() {3952 jquery.propfix[ this.tolowercase() ] = this;3953 });3954// ie6/7 call enctype encoding3955 if ( !jquery.support.enctype ) {3956 jquery.propfix.enctype = "encoding";3957 }3958// radios and checkboxes getter/setter3959 jquery.each([ "radio", "checkbox" ], function() {3960 jquery.valhooks[ this ] = {3961 set: function( elem, value ) {3962 if ( jquery.isarray( value ) ) {3963 return ( elem.checked = jquery.inarray( jquery(elem).val(), value ) >= 0 );3964 }3965 }3966 };3967 if ( !jquery.support.checkon ) {3968 jquery.valhooks[ this ].get = function( elem ) {3969 // support: webkit3970 // "" is returned instead of "on" if a value isn't specified3971 return elem.getattribute("value") === null ? "on" : elem.value;3972 };3973 }3974 });3975 var rformelems = /^(?:input|select|textarea)$/i,3976 rkeyevent = /^key/,3977 rmouseevent = /^(?:mouse|contextmenu)|click/,3978 rfocusmorph = /^(?:focusinfocus|focusoutblur)$/,3979 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;3980 function returntrue() {3981 return true;3982 }3983 function returnfalse() {3984 return false;3985 }3986 function safeactiveelement() {3987 try {3988 return document.activeelement;3989 } catch ( err ) { }3990 }3991 /*3992 * helper functions for managing events -- not part of the public interface.3993 * props to dean edwards' addevent library for many of the ideas.3994 */3995 jquery.event = {3996 global: {},3997 add: function( elem, types, handler, data, selector ) {3998 var tmp, events, t, handleobjin,3999 special, eventhandle, handleobj,4000 handlers, type, namespaces, origtype,4001 elemdata = jquery._data( elem );4002 // don't attach events to nodata or text/comment nodes (but allow plain objects)4003 if ( !elemdata ) {4004 return;4005 }4006 // caller can pass in an object of custom data in lieu of the handler4007 if ( handler.handler ) {4008 handleobjin = handler;4009 handler = handleobjin.handler;4010 selector = handleobjin.selector;4011 }4012 // make sure that the handler has a unique id, used to find/remove it later4013 if ( !handler.guid ) {4014 handler.guid = jquery.guid++;4015 }4016 // init the element's event structure and main handler, if this is the first4017 if ( !(events = elemdata.events) ) {4018 events = elemdata.events = {};4019 }4020 if ( !(eventhandle = elemdata.handle) ) {4021 eventhandle = elemdata.handle = function( e ) {4022 // discard the second event of a jquery.event.trigger() and4023 // when an event is called after a page has unloaded4024 return typeof jquery !== core_strundefined && (!e || jquery.event.triggered !== e.type) ?4025 jquery.event.dispatch.apply( eventhandle.elem, arguments ) :4026 undefined;4027 };4028 // add elem as a property of the handle fn to prevent a memory leak with ie non-native events4029 eventhandle.elem = elem;4030 }4031 // handle multiple events separated by a space4032 types = ( types || "" ).match( core_rnotwhite ) || [""];4033 t = types.length;4034 while ( t-- ) {4035 tmp = rtypenamespace.exec( types[t] ) || [];4036 type = origtype = tmp[1];4037 namespaces = ( tmp[2] || "" ).split( "." ).sort();4038 // there *must* be a type, no attaching namespace-only handlers4039 if ( !type ) {4040 continue;4041 }4042 // if event changes its type, use the special event handlers for the changed type4043 special = jquery.event.special[ type ] || {};4044 // if selector defined, determine special event api type, otherwise given type4045 type = ( selector ? special.delegatetype : special.bindtype ) || type;4046 // update special based on newly reset type4047 special = jquery.event.special[ type ] || {};4048 // handleobj is passed to all event handlers4049 handleobj = jquery.extend({4050 type: type,4051 origtype: origtype,4052 data: data,4053 handler: handler,4054 guid: handler.guid,4055 selector: selector,4056 needscontext: selector && jquery.expr.match.needscontext.test( selector ),4057 namespace: namespaces.join(".")4058 }, handleobjin );4059 // init the event handler queue if we're the first4060 if ( !(handlers = events[ type ]) ) {4061 handlers = events[ type ] = [];4062 handlers.delegatecount = 0;4063 // only use addeventlistener/attachevent if the special events handler returns false4064 if ( !special.setup || special.setup.call( elem, data, namespaces, eventhandle ) === false ) {4065 // bind the global event handler to the element4066 if ( elem.addeventlistener ) {4067 elem.addeventlistener( type, eventhandle, false );4068 } else if ( elem.attachevent ) {4069 elem.attachevent( "on" + type, eventhandle );4070 }4071 }4072 }4073 if ( special.add ) {4074 special.add.call( elem, handleobj );4075 if ( !handleobj.handler.guid ) {4076 handleobj.handler.guid = handler.guid;4077 }4078 }4079 // add to the element's handler list, delegates in front4080 if ( selector ) {4081 handlers.splice( handlers.delegatecount++, 0, handleobj );4082 } else {4083 handlers.push( handleobj );4084 }4085 // keep track of which events have ever been used, for event optimization4086 jquery.event.global[ type ] = true;4087 }4088 // nullify elem to prevent memory leaks in ie4089 elem = null;4090 },4091 // detach an event or set of events from an element4092 remove: function( elem, types, handler, selector, mappedtypes ) {4093 var j, handleobj, tmp,4094 origcount, t, events,4095 special, handlers, type,4096 namespaces, origtype,4097 elemdata = jquery.hasdata( elem ) && jquery._data( elem );4098 if ( !elemdata || !(events = elemdata.events) ) {4099 return;4100 }4101 // once for each type.namespace in types; type may be omitted4102 types = ( types || "" ).match( core_rnotwhite ) || [""];4103 t = types.length;4104 while ( t-- ) {4105 tmp = rtypenamespace.exec( types[t] ) || [];4106 type = origtype = tmp[1];4107 namespaces = ( tmp[2] || "" ).split( "." ).sort();4108 // unbind all events (on this namespace, if provided) for the element4109 if ( !type ) {4110 for ( type in events ) {4111 jquery.event.remove( elem, type + types[ t ], handler, selector, true );4112 }4113 continue;4114 }4115 special = jquery.event.special[ type ] || {};4116 type = ( selector ? special.delegatetype : special.bindtype ) || type;4117 handlers = events[ type ] || [];4118 tmp = tmp[2] && new regexp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );4119 // remove matching events4120 origcount = j = handlers.length;4121 while ( j-- ) {4122 handleobj = handlers[ j ];4123 if ( ( mappedtypes || origtype === handleobj.origtype ) &&4124 ( !handler || handler.guid === handleobj.guid ) &&4125 ( !tmp || tmp.test( handleobj.namespace ) ) &&4126 ( !selector || selector === handleobj.selector || selector === "**" && handleobj.selector ) ) {4127 handlers.splice( j, 1 );4128 if ( handleobj.selector ) {4129 handlers.delegatecount--;4130 }4131 if ( special.remove ) {4132 special.remove.call( elem, handleobj );4133 }4134 }4135 }4136 // remove generic event handler if we removed something and no more handlers exist4137 // (avoids potential for endless recursion during removal of special event handlers)4138 if ( origcount && !handlers.length ) {4139 if ( !special.teardown || special.teardown.call( elem, namespaces, elemdata.handle ) === false ) {4140 jquery.removeevent( elem, type, elemdata.handle );4141 }4142 delete events[ type ];4143 }4144 }4145 // remove the expando if it's no longer used4146 if ( jquery.isemptyobject( events ) ) {4147 delete elemdata.handle;4148 // removedata also checks for emptiness and clears the expando if empty4149 // so use it instead of delete4150 jquery._removedata( elem, "events" );4151 }4152 },4153 trigger: function( event, data, elem, onlyhandlers ) {4154 var handle, ontype, cur,4155 bubbletype, special, tmp, i,4156 eventpath = [ elem || document ],4157 type = core_hasown.call( event, "type" ) ? event.type : event,4158 namespaces = core_hasown.call( event, "namespace" ) ? event.namespace.split(".") : [];4159 cur = tmp = elem = elem || document;4160 // don't do events on text and comment nodes4161 if ( elem.nodetype === 3 || elem.nodetype === 8 ) {4162 return;4163 }4164 // focus/blur morphs to focusin/out; ensure we're not firing them right now4165 if ( rfocusmorph.test( type + jquery.event.triggered ) ) {4166 return;4167 }4168 if ( type.indexof(".") >= 0 ) {4169 // namespaced trigger; create a regexp to match event type in handle()4170 namespaces = type.split(".");4171 type = namespaces.shift();4172 namespaces.sort();4173 }4174 ontype = type.indexof(":") < 0 && "on" + type;4175 // caller can pass in a jquery.event object, object, or just an event type string4176 event = event[ jquery.expando ] ?4177 event :4178 new jquery.event( type, typeof event === "object" && event );4179 // trigger bitmask: & 1 for native handlers; & 2 for jquery (always true)4180 event.istrigger = onlyhandlers ? 2 : 3;4181 event.namespace = namespaces.join(".");4182 event.namespace_re = event.namespace ?4183 new regexp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :4184 null;4185 // clean up the event in case it is being reused4186 event.result = undefined;4187 if ( !event.target ) {4188 event.target = elem;4189 }4190 // clone any incoming data and prepend the event, creating the handler arg list4191 data = data == null ?4192 [ event ] :4193 jquery.makearray( data, [ event ] );4194 // allow special events to draw outside the lines4195 special = jquery.event.special[ type ] || {};4196 if ( !onlyhandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {4197 return;4198 }4199 // determine event propagation path in advance, per w3c events spec (#9951)4200 // bubble up to document, then to window; watch for a global ownerdocument var (#9724)4201 if ( !onlyhandlers && !special.nobubble && !jquery.iswindow( elem ) ) {4202 bubbletype = special.delegatetype || type;4203 if ( !rfocusmorph.test( bubbletype + type ) ) {4204 cur = cur.parentnode;4205 }4206 for ( ; cur; cur = cur.parentnode ) {4207 eventpath.push( cur );4208 tmp = cur;4209 }4210 // only add window if we got to document (e.g., not plain obj or detached dom)4211 if ( tmp === (elem.ownerdocument || document) ) {4212 eventpath.push( tmp.defaultview || tmp.parentwindow || window );4213 }4214 }4215 // fire handlers on the event path4216 i = 0;4217 while ( (cur = eventpath[i++]) && !event.ispropagationstopped() ) {4218 event.type = i > 1 ?4219 bubbletype :4220 special.bindtype || type;4221 // jquery handler4222 handle = ( jquery._data( cur, "events" ) || {} )[ event.type ] && jquery._data( cur, "handle" );4223 if ( handle ) {4224 handle.apply( cur, data );4225 }4226 // native handler4227 handle = ontype && cur[ ontype ];4228 if ( handle && jquery.acceptdata( cur ) && handle.apply && handle.apply( cur, data ) === false ) {4229 event.preventdefault();4230 }4231 }4232 event.type = type;4233 // if nobody prevented the default action, do it now4234 if ( !onlyhandlers && !event.isdefaultprevented() ) {4235 if ( (!special._default || special._default.apply( eventpath.pop(), data ) === false) &&4236 jquery.acceptdata( elem ) ) {4237 // call a native dom method on the target with the same name name as the event.4238 // can't use an .isfunction() check here because ie6/7 fails that test.4239 // don't do default actions on window, that's where global variables be (#6170)4240 if ( ontype && elem[ type ] && !jquery.iswindow( elem ) ) {4241 // don't re-trigger an onfoo event when we call its foo() method4242 tmp = elem[ ontype ];4243 if ( tmp ) {4244 elem[ ontype ] = null;4245 }4246 // prevent re-triggering of the same event, since we already bubbled it above4247 jquery.event.triggered = type;4248 try {4249 elem[ type ]();4250 } catch ( e ) {4251 // ie<9 dies on focus/blur to hidden element (#1486,#12518)4252 // only reproducible on winxp ie8 native, not ie9 in ie8 mode4253 }4254 jquery.event.triggered = undefined;4255 if ( tmp ) {4256 elem[ ontype ] = tmp;4257 }4258 }4259 }4260 }4261 return event.result;4262 },4263 dispatch: function( event ) {4264 // make a writable jquery.event from the native event object4265 event = jquery.event.fix( event );4266 var i, ret, handleobj, matched, j,4267 handlerqueue = [],4268 args = core_slice.call( arguments ),4269 handlers = ( jquery._data( this, "events" ) || {} )[ event.type ] || [],4270 special = jquery.event.special[ event.type ] || {};4271 // use the fix-ed jquery.event rather than the (read-only) native event4272 args[0] = event;4273 event.delegatetarget = this;4274 // call the predispatch hook for the mapped type, and let it bail if desired4275 if ( special.predispatch && special.predispatch.call( this, event ) === false ) {4276 return;4277 }4278 // determine handlers4279 handlerqueue = jquery.event.handlers.call( this, event, handlers );4280 // run delegates first; they may want to stop propagation beneath us4281 i = 0;4282 while ( (matched = handlerqueue[ i++ ]) && !event.ispropagationstopped() ) {4283 event.currenttarget = matched.elem;4284 j = 0;4285 while ( (handleobj = matched.handlers[ j++ ]) && !event.isimmediatepropagationstopped() ) {4286 // triggered event must either 1) have no namespace, or4287 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).4288 if ( !event.namespace_re || event.namespace_re.test( handleobj.namespace ) ) {4289 event.handleobj = handleobj;4290 event.data = handleobj.data;4291 ret = ( (jquery.event.special[ handleobj.origtype ] || {}).handle || handleobj.handler )4292 .apply( matched.elem, args );4293 if ( ret !== undefined ) {4294 if ( (event.result = ret) === false ) {4295 event.preventdefault();4296 event.stoppropagation();4297 }4298 }4299 }4300 }4301 }4302 // call the postdispatch hook for the mapped type4303 if ( special.postdispatch ) {4304 special.postdispatch.call( this, event );4305 }4306 return event.result;4307 },4308 handlers: function( event, handlers ) {4309 var sel, handleobj, matches, i,4310 handlerqueue = [],4311 delegatecount = handlers.delegatecount,4312 cur = event.target;4313 // find delegate handlers4314 // black-hole svg <use> instance trees (#13180)4315 // avoid non-left-click bubbling in firefox (#3861)4316 if ( delegatecount && cur.nodetype && (!event.button || event.type !== "click") ) {4317 /* jshint eqeqeq: false */4318 for ( ; cur != this; cur = cur.parentnode || this ) {4319 /* jshint eqeqeq: true */4320 // don't check non-elements (#13208)4321 // don't process clicks on disabled elements (#6911, #8165, #11382, #11764)4322 if ( cur.nodetype === 1 && (cur.disabled !== true || event.type !== "click") ) {4323 matches = [];4324 for ( i = 0; i < delegatecount; i++ ) {4325 handleobj = handlers[ i ];4326 // don't conflict with object.prototype properties (#13203)4327 sel = handleobj.selector + " ";4328 if ( matches[ sel ] === undefined ) {4329 matches[ sel ] = handleobj.needscontext ?4330 jquery( sel, this ).index( cur ) >= 0 :4331 jquery.find( sel, this, null, [ cur ] ).length;4332 }4333 if ( matches[ sel ] ) {4334 matches.push( handleobj );4335 }4336 }4337 if ( matches.length ) {4338 handlerqueue.push({ elem: cur, handlers: matches });4339 }4340 }4341 }4342 }4343 // add the remaining (directly-bound) handlers4344 if ( delegatecount < handlers.length ) {4345 handlerqueue.push({ elem: this, handlers: handlers.slice( delegatecount ) });4346 }4347 return handlerqueue;4348 },4349 fix: function( event ) {4350 if ( event[ jquery.expando ] ) {4351 return event;4352 }4353 // create a writable copy of the event object and normalize some properties4354 var i, prop, copy,4355 type = event.type,4356 originalevent = event,4357 fixhook = this.fixhooks[ type ];4358 if ( !fixhook ) {4359 this.fixhooks[ type ] = fixhook =4360 rmouseevent.test( type ) ? this.mousehooks :4361 rkeyevent.test( type ) ? this.keyhooks :4362 {};4363 }4364 copy = fixhook.props ? this.props.concat( fixhook.props ) : this.props;4365 event = new jquery.event( originalevent );4366 i = copy.length;4367 while ( i-- ) {4368 prop = copy[ i ];4369 event[ prop ] = originalevent[ prop ];4370 }4371 // support: ie<94372 // fix target property (#1925)4373 if ( !event.target ) {4374 event.target = originalevent.srcelement || document;4375 }4376 // support: chrome 23+, safari?4377 // target should not be a text node (#504, #13143)4378 if ( event.target.nodetype === 3 ) {4379 event.target = event.target.parentnode;4380 }4381 // support: ie<94382 // for mouse/key events, metakey==false if it's undefined (#3368, #11328)4383 event.metakey = !!event.metakey;4384 return fixhook.filter ? fixhook.filter( event, originalevent ) : event;4385 },4386 // includes some event props shared by keyevent and mouseevent4387 props: "altkey bubbles cancelable ctrlkey currenttarget eventphase metakey relatedtarget shiftkey target timestamp view which".split(" "),4388 fixhooks: {},4389 keyhooks: {4390 props: "char charcode key keycode".split(" "),4391 filter: function( event, original ) {4392 // add which for key events4393 if ( event.which == null ) {4394 event.which = original.charcode != null ? original.charcode : original.keycode;4395 }4396 return event;4397 }4398 },4399 mousehooks: {4400 props: "button buttons clientx clienty fromelement offsetx offsety pagex pagey screenx screeny toelement".split(" "),4401 filter: function( event, original ) {4402 var body, eventdoc, doc,4403 button = original.button,4404 fromelement = original.fromelement;4405 // calculate pagex/y if missing and clientx/y available4406 if ( event.pagex == null && original.clientx != null ) {4407 eventdoc = event.target.ownerdocument || document;4408 doc = eventdoc.documentelement;4409 body = eventdoc.body;4410 event.pagex = original.clientx + ( doc && doc.scrollleft || body && body.scrollleft || 0 ) - ( doc && doc.clientleft || body && body.clientleft || 0 );4411 event.pagey = original.clienty + ( doc && doc.scrolltop || body && body.scrolltop || 0 ) - ( doc && doc.clienttop || body && body.clienttop || 0 );4412 }4413 // add relatedtarget, if necessary4414 if ( !event.relatedtarget && fromelement ) {4415 event.relatedtarget = fromelement === event.target ? original.toelement : fromelement;4416 }4417 // add which for click: 1 === left; 2 === middle; 3 === right4418 // note: button is not normalized, so don't use it4419 if ( !event.which && button !== undefined ) {4420 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );4421 }4422 return event;4423 }4424 },4425 special: {4426 load: {4427 // prevent triggered image.load events from bubbling to window.load4428 nobubble: true4429 },4430 focus: {4431 // fire native event if possible so blur/focus sequence is correct4432 trigger: function() {4433 if ( this !== safeactiveelement() && this.focus ) {4434 try {4435 this.focus();4436 return false;4437 } catch ( e ) {4438 // support: ie<94439 // if we error on focus to hidden element (#1486, #12518),4440 // let .trigger() run the handlers4441 }4442 }4443 },4444 delegatetype: "focusin"4445 },4446 blur: {4447 trigger: function() {4448 if ( this === safeactiveelement() && this.blur ) {4449 this.blur();4450 return false;4451 }4452 },4453 delegatetype: "focusout"4454 },4455 click: {4456 // for checkbox, fire native event so checked state will be right4457 trigger: function() {4458 if ( jquery.nodename( this, "input" ) && this.type === "checkbox" && this.click ) {4459 this.click();4460 return false;4461 }4462 },4463 // for cross-browser consistency, don't fire native .click() on links4464 _default: function( event ) {4465 return jquery.nodename( event.target, "a" );4466 }4467 },4468 beforeunload: {4469 postdispatch: function( event ) {4470 // even when returnvalue equals to undefined firefox will still show alert4471 if ( event.result !== undefined ) {4472 event.originalevent.returnvalue = event.result;4473 }4474 }4475 }4476 },4477 simulate: function( type, elem, event, bubble ) {4478 // piggyback on a donor event to simulate a different one.4479 // fake originalevent to avoid donor's stoppropagation, but if the4480 // simulated event prevents default then we do the same on the donor.4481 var e = jquery.extend(4482 new jquery.event(),4483 event,4484 {4485 type: type,4486 issimulated: true,4487 originalevent: {}4488 }4489 );4490 if ( bubble ) {4491 jquery.event.trigger( e, null, elem );4492 } else {4493 jquery.event.dispatch.call( elem, e );4494 }4495 if ( e.isdefaultprevented() ) {4496 event.preventdefault();4497 }4498 }4499 };4500 jquery.removeevent = document.removeeventlistener ?4501 function( elem, type, handle ) {4502 if ( elem.removeeventlistener ) {4503 elem.removeeventlistener( type, handle, false );4504 }4505 } :4506 function( elem, type, handle ) {4507 var name = "on" + type;4508 if ( elem.detachevent ) {4509 // #8545, #7054, preventing memory leaks for custom events in ie6-84510 // detachevent needed property on element, by name of that event, to properly expose it to gc4511 if ( typeof elem[ name ] === core_strundefined ) {4512 elem[ name ] = null;4513 }4514 elem.detachevent( name, handle );4515 }4516 };4517 jquery.event = function( src, props ) {4518 // allow instantiation without the 'new' keyword4519 if ( !(this instanceof jquery.event) ) {4520 return new jquery.event( src, props );4521 }4522 // event object4523 if ( src && src.type ) {4524 this.originalevent = src;4525 this.type = src.type;4526 // events bubbling up the document may have been marked as prevented4527 // by a handler lower down the tree; reflect the correct value.4528 this.isdefaultprevented = ( src.defaultprevented || src.returnvalue === false ||4529 src.getpreventdefault && src.getpreventdefault() ) ? returntrue : returnfalse;4530 // event type4531 } else {4532 this.type = src;4533 }4534 // put explicitly provided properties onto the event object4535 if ( props ) {4536 jquery.extend( this, props );4537 }4538 // create a timestamp if incoming event doesn't have one4539 this.timestamp = src && src.timestamp || jquery.now();4540 // mark it as fixed4541 this[ jquery.expando ] = true;4542 };4543// jquery.event is based on dom3 events as specified by the ecmascript language binding4544// http://www.w3.org/tr/2003/wd-dom-level-3-events-20030331/ecma-script-binding.html4545 jquery.event.prototype = {4546 isdefaultprevented: returnfalse,4547 ispropagationstopped: returnfalse,4548 isimmediatepropagationstopped: returnfalse,4549 preventdefault: function() {4550 var e = this.originalevent;4551 this.isdefaultprevented = returntrue;4552 if ( !e ) {4553 return;4554 }4555 // if preventdefault exists, run it on the original event4556 if ( e.preventdefault ) {4557 e.preventdefault();4558 // support: ie4559 // otherwise set the returnvalue property of the original event to false4560 } else {4561 e.returnvalue = false;4562 }4563 },4564 stoppropagation: function() {4565 var e = this.originalevent;4566 this.ispropagationstopped = returntrue;4567 if ( !e ) {4568 return;4569 }4570 // if stoppropagation exists, run it on the original event4571 if ( e.stoppropagation ) {4572 e.stoppropagation();4573 }4574 // support: ie4575 // set the cancelbubble property of the original event to true4576 e.cancelbubble = true;4577 },4578 stopimmediatepropagation: function() {4579 this.isimmediatepropagationstopped = returntrue;4580 this.stoppropagation();4581 }4582 };4583// create mouseenter/leave events using mouseover/out and event-time checks4584 jquery.each({4585 mouseenter: "mouseover",4586 mouseleave: "mouseout"4587 }, function( orig, fix ) {4588 jquery.event.special[ orig ] = {4589 delegatetype: fix,4590 bindtype: fix,4591 handle: function( event ) {4592 var ret,4593 target = this,4594 related = event.relatedtarget,4595 handleobj = event.handleobj;4596 // for mousenter/leave call the handler if related is outside the target.4597 // nb: no relatedtarget if the mouse left/entered the browser window4598 if ( !related || (related !== target && !jquery.contains( target, related )) ) {4599 event.type = handleobj.origtype;4600 ret = handleobj.handler.apply( this, arguments );4601 event.type = fix;4602 }4603 return ret;4604 }4605 };4606 });4607// ie submit delegation4608 if ( !jquery.support.submitbubbles ) {4609 jquery.event.special.submit = {4610 setup: function() {4611 // only need this for delegated form submit events4612 if ( jquery.nodename( this, "form" ) ) {4613 return false;4614 }4615 // lazy-add a submit handler when a descendant form may potentially be submitted4616 jquery.event.add( this, "click._submit keypress._submit", function( e ) {4617 // node name check avoids a vml-related crash in ie (#9807)4618 var elem = e.target,4619 form = jquery.nodename( elem, "input" ) || jquery.nodename( elem, "button" ) ? elem.form : undefined;4620 if ( form && !jquery._data( form, "submitbubbles" ) ) {4621 jquery.event.add( form, "submit._submit", function( event ) {4622 event._submit_bubble = true;4623 });4624 jquery._data( form, "submitbubbles", true );4625 }4626 });4627 // return undefined since we don't need an event listener4628 },4629 postdispatch: function( event ) {4630 // if form was submitted by the user, bubble the event up the tree4631 if ( event._submit_bubble ) {4632 delete event._submit_bubble;4633 if ( this.parentnode && !event.istrigger ) {4634 jquery.event.simulate( "submit", this.parentnode, event, true );4635 }4636 }4637 },4638 teardown: function() {4639 // only need this for delegated form submit events4640 if ( jquery.nodename( this, "form" ) ) {4641 return false;4642 }4643 // remove delegated handlers; cleandata eventually reaps submit handlers attached above4644 jquery.event.remove( this, "._submit" );4645 }4646 };4647 }4648// ie change delegation and checkbox/radio fix4649 if ( !jquery.support.changebubbles ) {4650 jquery.event.special.change = {4651 setup: function() {4652 if ( rformelems.test( this.nodename ) ) {4653 // ie doesn't fire change on a check/radio until blur; trigger it on click4654 // after a propertychange. eat the blur-change in special.change.handle.4655 // this still fires onchange a second time for check/radio after blur.4656 if ( this.type === "checkbox" || this.type === "radio" ) {4657 jquery.event.add( this, "propertychange._change", function( event ) {4658 if ( event.originalevent.propertyname === "checked" ) {4659 this._just_changed = true;4660 }4661 });4662 jquery.event.add( this, "click._change", function( event ) {4663 if ( this._just_changed && !event.istrigger ) {4664 this._just_changed = false;4665 }4666 // allow triggered, simulated change events (#11500)4667 jquery.event.simulate( "change", this, event, true );4668 });4669 }4670 return false;4671 }4672 // delegated event; lazy-add a change handler on descendant inputs4673 jquery.event.add( this, "beforeactivate._change", function( e ) {4674 var elem = e.target;4675 if ( rformelems.test( elem.nodename ) && !jquery._data( elem, "changebubbles" ) ) {4676 jquery.event.add( elem, "change._change", function( event ) {4677 if ( this.parentnode && !event.issimulated && !event.istrigger ) {4678 jquery.event.simulate( "change", this.parentnode, event, true );4679 }4680 });4681 jquery._data( elem, "changebubbles", true );4682 }4683 });4684 },4685 handle: function( event ) {4686 var elem = event.target;4687 // swallow native change events from checkbox/radio, we already triggered them above4688 if ( this !== elem || event.issimulated || event.istrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {4689 return event.handleobj.handler.apply( this, arguments );4690 }4691 },4692 teardown: function() {4693 jquery.event.remove( this, "._change" );4694 return !rformelems.test( this.nodename );4695 }4696 };4697 }4698// create "bubbling" focus and blur events4699 if ( !jquery.support.focusinbubbles ) {4700 jquery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {4701 // attach a single capturing handler while someone wants focusin/focusout4702 var attaches = 0,4703 handler = function( event ) {4704 jquery.event.simulate( fix, event.target, jquery.event.fix( event ), true );4705 };4706 jquery.event.special[ fix ] = {4707 setup: function() {4708 if ( attaches++ === 0 ) {4709 document.addeventlistener( orig, handler, true );4710 }4711 },4712 teardown: function() {4713 if ( --attaches === 0 ) {4714 document.removeeventlistener( orig, handler, true );4715 }4716 }4717 };4718 });4719 }4720 jquery.fn.extend({4721 on: function( types, selector, data, fn, /*internal*/ one ) {4722 var type, origfn;4723 // types can be a map of types/handlers4724 if ( typeof types === "object" ) {4725 // ( types-object, selector, data )4726 if ( typeof selector !== "string" ) {4727 // ( types-object, data )4728 data = data || selector;4729 selector = undefined;4730 }4731 for ( type in types ) {4732 this.on( type, selector, data, types[ type ], one );4733 }4734 return this;4735 }4736 if ( data == null && fn == null ) {4737 // ( types, fn )4738 fn = selector;4739 data = selector = undefined;4740 } else if ( fn == null ) {4741 if ( typeof selector === "string" ) {4742 // ( types, selector, fn )4743 fn = data;4744 data = undefined;4745 } else {4746 // ( types, data, fn )4747 fn = data;4748 data = selector;4749 selector = undefined;4750 }4751 }4752 if ( fn === false ) {4753 fn = returnfalse;4754 } else if ( !fn ) {4755 return this;4756 }4757 if ( one === 1 ) {4758 origfn = fn;4759 fn = function( event ) {4760 // can use an empty set, since event contains the info4761 jquery().off( event );4762 return origfn.apply( this, arguments );4763 };4764 // use same guid so caller can remove using origfn4765 fn.guid = origfn.guid || ( origfn.guid = jquery.guid++ );4766 }4767 return this.each( function() {4768 jquery.event.add( this, types, fn, data, selector );4769 });4770 },4771 one: function( types, selector, data, fn ) {4772 return this.on( types, selector, data, fn, 1 );4773 },4774 off: function( types, selector, fn ) {4775 var handleobj, type;4776 if ( types && types.preventdefault && types.handleobj ) {4777 // ( event ) dispatched jquery.event4778 handleobj = types.handleobj;4779 jquery( types.delegatetarget ).off(4780 handleobj.namespace ? handleobj.origtype + "." + handleobj.namespace : handleobj.origtype,4781 handleobj.selector,4782 handleobj.handler4783 );4784 return this;4785 }4786 if ( typeof types === "object" ) {4787 // ( types-object [, selector] )4788 for ( type in types ) {4789 this.off( type, selector, types[ type ] );4790 }4791 return this;4792 }4793 if ( selector === false || typeof selector === "function" ) {4794 // ( types [, fn] )4795 fn = selector;4796 selector = undefined;4797 }4798 if ( fn === false ) {4799 fn = returnfalse;4800 }4801 return this.each(function() {4802 jquery.event.remove( this, types, fn, selector );4803 });4804 },4805 trigger: function( type, data ) {4806 return this.each(function() {4807 jquery.event.trigger( type, data, this );4808 });4809 },4810 triggerhandler: function( type, data ) {4811 var elem = this[0];4812 if ( elem ) {4813 return jquery.event.trigger( type, data, elem, true );4814 }4815 }4816 });4817 var issimple = /^.[^:#\[\.,]*$/,4818 rparentsprev = /^(?:parents|prev(?:until|all))/,4819 rneedscontext = jquery.expr.match.needscontext,4820 // methods guaranteed to produce a unique set when starting from a unique set4821 guaranteedunique = {4822 children: true,4823 contents: true,4824 next: true,4825 prev: true4826 };4827 jquery.fn.extend({4828 find: function( selector ) {4829 var i,4830 ret = [],4831 self = this,4832 len = self.length;4833 if ( typeof selector !== "string" ) {4834 return this.pushstack( jquery( selector ).filter(function() {4835 for ( i = 0; i < len; i++ ) {4836 if ( jquery.contains( self[ i ], this ) ) {4837 return true;4838 }4839 }4840 }) );4841 }4842 for ( i = 0; i < len; i++ ) {4843 jquery.find( selector, self[ i ], ret );4844 }4845 // needed because $( selector, context ) becomes $( context ).find( selector )4846 ret = this.pushstack( len > 1 ? jquery.unique( ret ) : ret );4847 ret.selector = this.selector ? this.selector + " " + selector : selector;4848 return ret;4849 },4850 has: function( target ) {4851 var i,4852 targets = jquery( target, this ),4853 len = targets.length;4854 return this.filter(function() {4855 for ( i = 0; i < len; i++ ) {4856 if ( jquery.contains( this, targets[i] ) ) {4857 return true;4858 }4859 }4860 });4861 },4862 not: function( selector ) {4863 return this.pushstack( winnow(this, selector || [], true) );4864 },4865 filter: function( selector ) {4866 return this.pushstack( winnow(this, selector || [], false) );4867 },4868 is: function( selector ) {4869 return !!winnow(4870 this,4871 // if this is a positional/relative selector, check membership in the returned set4872 // so $("p:first").is("p:last") won't return true for a doc with two "p".4873 typeof selector === "string" && rneedscontext.test( selector ) ?4874 jquery( selector ) :4875 selector || [],4876 false4877 ).length;4878 },4879 closest: function( selectors, context ) {4880 var cur,4881 i = 0,4882 l = this.length,4883 ret = [],4884 pos = rneedscontext.test( selectors ) || typeof selectors !== "string" ?4885 jquery( selectors, context || this.context ) :4886 0;4887 for ( ; i < l; i++ ) {4888 for ( cur = this[i]; cur && cur !== context; cur = cur.parentnode ) {4889 // always skip document fragments4890 if ( cur.nodetype < 11 && (pos ?4891 pos.index(cur) > -1 :4892 // don't pass non-elements to sizzle4893 cur.nodetype === 1 &&4894 jquery.find.matchesselector(cur, selectors)) ) {4895 cur = ret.push( cur );4896 break;4897 }4898 }4899 }4900 return this.pushstack( ret.length > 1 ? jquery.unique( ret ) : ret );4901 },4902 // determine the position of an element within4903 // the matched set of elements4904 index: function( elem ) {4905 // no argument, return index in parent4906 if ( !elem ) {4907 return ( this[0] && this[0].parentnode ) ? this.first().prevall().length : -1;4908 }4909 // index in selector4910 if ( typeof elem === "string" ) {4911 return jquery.inarray( this[0], jquery( elem ) );4912 }4913 // locate the position of the desired element4914 return jquery.inarray(4915 // if it receives a jquery object, the first element is used4916 elem.jquery ? elem[0] : elem, this );4917 },4918 add: function( selector, context ) {4919 var set = typeof selector === "string" ?4920 jquery( selector, context ) :4921 jquery.makearray( selector && selector.nodetype ? [ selector ] : selector ),4922 all = jquery.merge( this.get(), set );4923 return this.pushstack( jquery.unique(all) );4924 },4925 addback: function( selector ) {4926 return this.add( selector == null ?4927 this.prevobject : this.prevobject.filter(selector)4928 );4929 }4930 });4931 function sibling( cur, dir ) {4932 do {4933 cur = cur[ dir ];4934 } while ( cur && cur.nodetype !== 1 );4935 return cur;4936 }4937 jquery.each({4938 parent: function( elem ) {4939 var parent = elem.parentnode;4940 return parent && parent.nodetype !== 11 ? parent : null;4941 },4942 parents: function( elem ) {4943 return jquery.dir( elem, "parentnode" );4944 },4945 parentsuntil: function( elem, i, until ) {4946 return jquery.dir( elem, "parentnode", until );4947 },4948 next: function( elem ) {4949 return sibling( elem, "nextsibling" );4950 },4951 prev: function( elem ) {4952 return sibling( elem, "previoussibling" );4953 },4954 nextall: function( elem ) {4955 return jquery.dir( elem, "nextsibling" );4956 },4957 prevall: function( elem ) {4958 return jquery.dir( elem, "previoussibling" );4959 },4960 nextuntil: function( elem, i, until ) {4961 return jquery.dir( elem, "nextsibling", until );4962 },4963 prevuntil: function( elem, i, until ) {4964 return jquery.dir( elem, "previoussibling", until );4965 },4966 siblings: function( elem ) {4967 return jquery.sibling( ( elem.parentnode || {} ).firstchild, elem );4968 },4969 children: function( elem ) {4970 return jquery.sibling( elem.firstchild );4971 },4972 contents: function( elem ) {4973 return jquery.nodename( elem, "iframe" ) ?4974 elem.contentdocument || elem.contentwindow.document :4975 jquery.merge( [], elem.childnodes );4976 }4977 }, function( name, fn ) {4978 jquery.fn[ name ] = function( until, selector ) {4979 var ret = jquery.map( this, fn, until );4980 if ( name.slice( -5 ) !== "until" ) {4981 selector = until;4982 }4983 if ( selector && typeof selector === "string" ) {4984 ret = jquery.filter( selector, ret );4985 }4986 if ( this.length > 1 ) {4987 // remove duplicates4988 if ( !guaranteedunique[ name ] ) {4989 ret = jquery.unique( ret );4990 }4991 // reverse order for parents* and prev-derivatives4992 if ( rparentsprev.test( name ) ) {4993 ret = ret.reverse();4994 }4995 }4996 return this.pushstack( ret );4997 };4998 });4999 jquery.extend({5000 filter: function( expr, elems, not ) {5001 var elem = elems[ 0 ];5002 if ( not ) {5003 expr = ":not(" + expr + ")";5004 }5005 return elems.length === 1 && elem.nodetype === 1 ?5006 jquery.find.matchesselector( elem, expr ) ? [ elem ] : [] :5007 jquery.find.matches( expr, jquery.grep( elems, function( elem ) {5008 return elem.nodetype === 1;5009 }));5010 },5011 dir: function( elem, dir, until ) {5012 var matched = [],5013 cur = elem[ dir ];5014 while ( cur && cur.nodetype !== 9 && (until === undefined || cur.nodetype !== 1 || !jquery( cur ).is( until )) ) {5015 if ( cur.nodetype === 1 ) {5016 matched.push( cur );5017 }5018 cur = cur[dir];5019 }5020 return matched;5021 },5022 sibling: function( n, elem ) {5023 var r = [];5024 for ( ; n; n = n.nextsibling ) {5025 if ( n.nodetype === 1 && n !== elem ) {5026 r.push( n );5027 }5028 }5029 return r;5030 }5031 });5032// implement the identical functionality for filter and not5033 function winnow( elements, qualifier, not ) {5034 if ( jquery.isfunction( qualifier ) ) {5035 return jquery.grep( elements, function( elem, i ) {5036 /* jshint -w018 */5037 return !!qualifier.call( elem, i, elem ) !== not;5038 });5039 }5040 if ( qualifier.nodetype ) {5041 return jquery.grep( elements, function( elem ) {5042 return ( elem === qualifier ) !== not;5043 });5044 }5045 if ( typeof qualifier === "string" ) {5046 if ( issimple.test( qualifier ) ) {5047 return jquery.filter( qualifier, elements, not );5048 }5049 qualifier = jquery.filter( qualifier, elements );5050 }5051 return jquery.grep( elements, function( elem ) {5052 return ( jquery.inarray( elem, qualifier ) >= 0 ) !== not;5053 });5054 }5055 function createsafefragment( document ) {5056 var list = nodenames.split( "|" ),5057 safefrag = document.createdocumentfragment();5058 if ( safefrag.createelement ) {5059 while ( list.length ) {5060 safefrag.createelement(5061 list.pop()5062 );5063 }5064 }5065 return safefrag;5066 }5067 var nodenames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +5068 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",5069 rinlinejquery = / jquery\d+="(?:null|\d+)"/g,5070 rnoshimcache = new regexp("<(?:" + nodenames + ")[\\s/>]", "i"),5071 rleadingwhitespace = /^\s+/,5072 rxhtmltag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,5073 rtagname = /<([\w:]+)/,5074 rtbody = /<tbody/i,5075 rhtml = /<|&#?\w+;/,5076 rnoinnerhtml = /<(?:script|style|link)/i,5077 manipulation_rcheckabletype = /^(?:checkbox|radio)$/i,5078 // checked="checked" or checked5079 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,5080 rscripttype = /^$|\/(?:java|ecma)script/i,5081 rscripttypemasked = /^true\/(.*)/,5082 rcleanscript = /^\s*<!(?:\[cdata\[|--)|(?:\]\]|--)>\s*$/g,5083 // we have to close these tags to support xhtml (#13200)5084 wrapmap = {5085 option: [ 1, "<select multiple='multiple'>", "</select>" ],5086 legend: [ 1, "<fieldset>", "</fieldset>" ],5087 area: [ 1, "<map>", "</map>" ],5088 param: [ 1, "<object>", "</object>" ],5089 thead: [ 1, "<table>", "</table>" ],5090 tr: [ 2, "<table><tbody>", "</tbody></table>" ],5091 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],5092 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],5093 // ie6-8 can't serialize link, script, style, or any html5 (noscope) tags,5094 // unless wrapped in a div with non-breaking characters in front of it.5095 _default: jquery.support.htmlserialize ? [ 0, "", "" ] : [ 1, "x<div>", "</div>" ]5096 },5097 safefragment = createsafefragment( document ),5098 fragmentdiv = safefragment.appendchild( document.createelement("div") );5099 wrapmap.optgroup = wrapmap.option;5100 wrapmap.tbody = wrapmap.tfoot = wrapmap.colgroup = wrapmap.caption = wrapmap.thead;5101 wrapmap.th = wrapmap.td;5102 jquery.fn.extend({5103 text: function( value ) {5104 return jquery.access( this, function( value ) {5105 return value === undefined ?5106 jquery.text( this ) :5107 this.empty().append( ( this[0] && this[0].ownerdocument || document ).createtextnode( value ) );5108 }, null, value, arguments.length );5109 },5110 append: function() {5111 return this.dommanip( arguments, function( elem ) {5112 if ( this.nodetype === 1 || this.nodetype === 11 || this.nodetype === 9 ) {5113 var target = manipulationtarget( this, elem );5114 target.appendchild( elem );5115 }5116 });5117 },5118 prepend: function() {5119 return this.dommanip( arguments, function( elem ) {5120 if ( this.nodetype === 1 || this.nodetype === 11 || this.nodetype === 9 ) {5121 var target = manipulationtarget( this, elem );5122 target.insertbefore( elem, target.firstchild );5123 }5124 });5125 },5126 before: function() {5127 return this.dommanip( arguments, function( elem ) {5128 if ( this.parentnode ) {5129 this.parentnode.insertbefore( elem, this );5130 }5131 });5132 },5133 after: function() {5134 return this.dommanip( arguments, function( elem ) {5135 if ( this.parentnode ) {5136 this.parentnode.insertbefore( elem, this.nextsibling );5137 }5138 });5139 },5140 // keepdata is for internal use only--do not document5141 remove: function( selector, keepdata ) {5142 var elem,5143 elems = selector ? jquery.filter( selector, this ) : this,5144 i = 0;5145 for ( ; (elem = elems[i]) != null; i++ ) {5146 if ( !keepdata && elem.nodetype === 1 ) {5147 jquery.cleandata( getall( elem ) );5148 }5149 if ( elem.parentnode ) {5150 if ( keepdata && jquery.contains( elem.ownerdocument, elem ) ) {5151 setglobaleval( getall( elem, "script" ) );5152 }5153 elem.parentnode.removechild( elem );5154 }5155 }5156 return this;5157 },5158 empty: function() {5159 var elem,5160 i = 0;5161 for ( ; (elem = this[i]) != null; i++ ) {5162 // remove element nodes and prevent memory leaks5163 if ( elem.nodetype === 1 ) {5164 jquery.cleandata( getall( elem, false ) );5165 }5166 // remove any remaining nodes5167 while ( elem.firstchild ) {5168 elem.removechild( elem.firstchild );5169 }5170 // if this is a select, ensure that it displays empty (#12336)5171 // support: ie<95172 if ( elem.options && jquery.nodename( elem, "select" ) ) {5173 elem.options.length = 0;5174 }5175 }5176 return this;5177 },5178 clone: function( dataandevents, deepdataandevents ) {5179 dataandevents = dataandevents == null ? false : dataandevents;5180 deepdataandevents = deepdataandevents == null ? dataandevents : deepdataandevents;5181 return this.map( function () {5182 return jquery.clone( this, dataandevents, deepdataandevents );5183 });5184 },5185 html: function( value ) {5186 return jquery.access( this, function( value ) {5187 var elem = this[0] || {},5188 i = 0,5189 l = this.length;5190 if ( value === undefined ) {5191 return elem.nodetype === 1 ?5192 elem.innerhtml.replace( rinlinejquery, "" ) :5193 undefined;5194 }5195 // see if we can take a shortcut and just use innerhtml5196 if ( typeof value === "string" && !rnoinnerhtml.test( value ) &&5197 ( jquery.support.htmlserialize || !rnoshimcache.test( value ) ) &&5198 ( jquery.support.leadingwhitespace || !rleadingwhitespace.test( value ) ) &&5199 !wrapmap[ ( rtagname.exec( value ) || ["", ""] )[1].tolowercase() ] ) {5200 value = value.replace( rxhtmltag, "<$1></$2>" );5201 try {5202 for (; i < l; i++ ) {5203 // remove element nodes and prevent memory leaks5204 elem = this[i] || {};5205 if ( elem.nodetype === 1 ) {5206 jquery.cleandata( getall( elem, false ) );5207 elem.innerhtml = value;5208 }5209 }5210 elem = 0;5211 // if using innerhtml throws an exception, use the fallback method5212 } catch(e) {}5213 }5214 if ( elem ) {5215 this.empty().append( value );5216 }5217 }, null, value, arguments.length );5218 },5219 replacewith: function() {5220 var5221 // snapshot the dom in case .dommanip sweeps something relevant into its fragment5222 args = jquery.map( this, function( elem ) {5223 return [ elem.nextsibling, elem.parentnode ];5224 }),5225 i = 0;5226 // make the changes, replacing each context element with the new content5227 this.dommanip( arguments, function( elem ) {5228 var next = args[ i++ ],5229 parent = args[ i++ ];5230 if ( parent ) {5231 // don't use the snapshot next if it has moved (#13810)5232 if ( next && next.parentnode !== parent ) {5233 next = this.nextsibling;5234 }5235 jquery( this ).remove();5236 parent.insertbefore( elem, next );5237 }5238 // allow new content to include elements from the context set5239 }, true );5240 // force removal if there was no new content (e.g., from empty arguments)5241 return i ? this : this.remove();5242 },5243 detach: function( selector ) {5244 return this.remove( selector, true );5245 },5246 dommanip: function( args, callback, allowintersection ) {5247 // flatten any nested arrays5248 args = core_concat.apply( [], args );5249 var first, node, hasscripts,5250 scripts, doc, fragment,5251 i = 0,5252 l = this.length,5253 set = this,5254 inoclone = l - 1,5255 value = args[0],5256 isfunction = jquery.isfunction( value );5257 // we can't clonenode fragments that contain checked, in webkit5258 if ( isfunction || !( l <= 1 || typeof value !== "string" || jquery.support.checkclone || !rchecked.test( value ) ) ) {5259 return this.each(function( index ) {5260 var self = set.eq( index );5261 if ( isfunction ) {5262 args[0] = value.call( this, index, self.html() );5263 }5264 self.dommanip( args, callback, allowintersection );5265 });5266 }5267 if ( l ) {5268 fragment = jquery.buildfragment( args, this[ 0 ].ownerdocument, false, !allowintersection && this );5269 first = fragment.firstchild;5270 if ( fragment.childnodes.length === 1 ) {5271 fragment = first;5272 }5273 if ( first ) {5274 scripts = jquery.map( getall( fragment, "script" ), disablescript );5275 hasscripts = scripts.length;5276 // use the original fragment for the last item instead of the first because it can end up5277 // being emptied incorrectly in certain situations (#8070).5278 for ( ; i < l; i++ ) {5279 node = fragment;5280 if ( i !== inoclone ) {5281 node = jquery.clone( node, true, true );5282 // keep references to cloned scripts for later restoration5283 if ( hasscripts ) {5284 jquery.merge( scripts, getall( node, "script" ) );5285 }5286 }5287 callback.call( this[i], node, i );5288 }5289 if ( hasscripts ) {5290 doc = scripts[ scripts.length - 1 ].ownerdocument;5291 // reenable scripts5292 jquery.map( scripts, restorescript );5293 // evaluate executable scripts on first document insertion5294 for ( i = 0; i < hasscripts; i++ ) {5295 node = scripts[ i ];5296 if ( rscripttype.test( node.type || "" ) &&5297 !jquery._data( node, "globaleval" ) && jquery.contains( doc, node ) ) {5298 if ( node.src ) {5299 // hope ajax is available...5300 jquery._evalurl( node.src );5301 } else {5302 jquery.globaleval( ( node.text || node.textcontent || node.innerhtml || "" ).replace( rcleanscript, "" ) );5303 }5304 }5305 }5306 }5307 // fix #11809: avoid leaking memory5308 fragment = first = null;5309 }5310 }5311 return this;5312 }5313 });5314// support: ie<85315// manipulating tables requires a tbody5316 function manipulationtarget( elem, content ) {5317 return jquery.nodename( elem, "table" ) &&5318 jquery.nodename( content.nodetype === 1 ? content : content.firstchild, "tr" ) ?5319 elem.getelementsbytagname("tbody")[0] ||5320 elem.appendchild( elem.ownerdocument.createelement("tbody") ) :5321 elem;5322 }5323// replace/restore the type attribute of script elements for safe dom manipulation5324 function disablescript( elem ) {5325 elem.type = (jquery.find.attr( elem, "type" ) !== null) + "/" + elem.type;5326 return elem;5327 }5328 function restorescript( elem ) {5329 var match = rscripttypemasked.exec( elem.type );5330 if ( match ) {5331 elem.type = match[1];5332 } else {5333 elem.removeattribute("type");5334 }5335 return elem;5336 }5337// mark scripts as having already been evaluated5338 function setglobaleval( elems, refelements ) {5339 var elem,5340 i = 0;5341 for ( ; (elem = elems[i]) != null; i++ ) {5342 jquery._data( elem, "globaleval", !refelements || jquery._data( refelements[i], "globaleval" ) );5343 }5344 }5345 function clonecopyevent( src, dest ) {5346 if ( dest.nodetype !== 1 || !jquery.hasdata( src ) ) {5347 return;5348 }5349 var type, i, l,5350 olddata = jquery._data( src ),5351 curdata = jquery._data( dest, olddata ),5352 events = olddata.events;5353 if ( events ) {5354 delete curdata.handle;5355 curdata.events = {};5356 for ( type in events ) {5357 for ( i = 0, l = events[ type ].length; i < l; i++ ) {5358 jquery.event.add( dest, type, events[ type ][ i ] );5359 }5360 }5361 }5362 // make the cloned public data object a copy from the original5363 if ( curdata.data ) {5364 curdata.data = jquery.extend( {}, curdata.data );5365 }5366 }5367 function fixclonenodeissues( src, dest ) {5368 var nodename, e, data;5369 // we do not need to do anything for non-elements5370 if ( dest.nodetype !== 1 ) {5371 return;5372 }5373 nodename = dest.nodename.tolowercase();5374 // ie6-8 copies events bound via attachevent when using clonenode.5375 if ( !jquery.support.nocloneevent && dest[ jquery.expando ] ) {5376 data = jquery._data( dest );5377 for ( e in data.events ) {5378 jquery.removeevent( dest, e, data.handle );5379 }5380 // event data gets referenced instead of copied if the expando gets copied too5381 dest.removeattribute( jquery.expando );5382 }5383 // ie blanks contents when cloning scripts, and tries to evaluate newly-set text5384 if ( nodename === "script" && dest.text !== src.text ) {5385 disablescript( dest ).text = src.text;5386 restorescript( dest );5387 // ie6-10 improperly clones children of object elements using classid.5388 // ie10 throws nomodificationallowederror if parent is null, #12132.5389 } else if ( nodename === "object" ) {5390 if ( dest.parentnode ) {5391 dest.outerhtml = src.outerhtml;5392 }5393 // this path appears unavoidable for ie9. when cloning an object5394 // element in ie9, the outerhtml strategy above is not sufficient.5395 // if the src has innerhtml and the destination does not,5396 // copy the src.innerhtml into the dest.innerhtml. #103245397 if ( jquery.support.html5clone && ( src.innerhtml && !jquery.trim(dest.innerhtml) ) ) {5398 dest.innerhtml = src.innerhtml;5399 }5400 } else if ( nodename === "input" && manipulation_rcheckabletype.test( src.type ) ) {5401 // ie6-8 fails to persist the checked state of a cloned checkbox5402 // or radio button. worse, ie6-7 fail to give the cloned element5403 // a checked appearance if the defaultchecked value isn't also set5404 dest.defaultchecked = dest.checked = src.checked;5405 // ie6-7 get confused and end up setting the value of a cloned5406 // checkbox/radio button to an empty string instead of "on"5407 if ( dest.value !== src.value ) {5408 dest.value = src.value;5409 }5410 // ie6-8 fails to return the selected option to the default selected5411 // state when cloning options5412 } else if ( nodename === "option" ) {5413 dest.defaultselected = dest.selected = src.defaultselected;5414 // ie6-8 fails to set the defaultvalue to the correct value when5415 // cloning other types of input fields5416 } else if ( nodename === "input" || nodename === "textarea" ) {5417 dest.defaultvalue = src.defaultvalue;5418 }5419 }5420 jquery.each({5421 appendto: "append",5422 prependto: "prepend",5423 insertbefore: "before",5424 insertafter: "after",5425 replaceall: "replacewith"5426 }, function( name, original ) {5427 jquery.fn[ name ] = function( selector ) {5428 var elems,5429 i = 0,5430 ret = [],5431 insert = jquery( selector ),5432 last = insert.length - 1;5433 for ( ; i <= last; i++ ) {5434 elems = i === last ? this : this.clone(true);5435 jquery( insert[i] )[ original ]( elems );5436 // modern browsers can apply jquery collections as arrays, but oldie needs a .get()5437 core_push.apply( ret, elems.get() );5438 }5439 return this.pushstack( ret );5440 };5441 });5442 function getall( context, tag ) {5443 var elems, elem,5444 i = 0,5445 found = typeof context.getelementsbytagname !== core_strundefined ? context.getelementsbytagname( tag || "*" ) :5446 typeof context.queryselectorall !== core_strundefined ? context.queryselectorall( tag || "*" ) :5447 undefined;5448 if ( !found ) {5449 for ( found = [], elems = context.childnodes || context; (elem = elems[i]) != null; i++ ) {5450 if ( !tag || jquery.nodename( elem, tag ) ) {5451 found.push( elem );5452 } else {5453 jquery.merge( found, getall( elem, tag ) );5454 }5455 }5456 }5457 return tag === undefined || tag && jquery.nodename( context, tag ) ?5458 jquery.merge( [ context ], found ) :5459 found;5460 }5461// used in buildfragment, fixes the defaultchecked property5462 function fixdefaultchecked( elem ) {5463 if ( manipulation_rcheckabletype.test( elem.type ) ) {5464 elem.defaultchecked = elem.checked;5465 }5466 }5467 jquery.extend({5468 clone: function( elem, dataandevents, deepdataandevents ) {5469 var destelements, node, clone, i, srcelements,5470 inpage = jquery.contains( elem.ownerdocument, elem );5471 if ( jquery.support.html5clone || jquery.isxmldoc(elem) || !rnoshimcache.test( "<" + elem.nodename + ">" ) ) {5472 clone = elem.clonenode( true );5473 // ie<=8 does not properly clone detached, unknown element nodes5474 } else {5475 fragmentdiv.innerhtml = elem.outerhtml;5476 fragmentdiv.removechild( clone = fragmentdiv.firstchild );5477 }5478 if ( (!jquery.support.nocloneevent || !jquery.support.noclonechecked) &&5479 (elem.nodetype === 1 || elem.nodetype === 11) && !jquery.isxmldoc(elem) ) {5480 // we eschew sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/25481 destelements = getall( clone );5482 srcelements = getall( elem );5483 // fix all ie cloning issues5484 for ( i = 0; (node = srcelements[i]) != null; ++i ) {5485 // ensure that the destination node is not null; fixes #95875486 if ( destelements[i] ) {5487 fixclonenodeissues( node, destelements[i] );5488 }5489 }5490 }5491 // copy the events from the original to the clone5492 if ( dataandevents ) {5493 if ( deepdataandevents ) {5494 srcelements = srcelements || getall( elem );5495 destelements = destelements || getall( clone );5496 for ( i = 0; (node = srcelements[i]) != null; i++ ) {5497 clonecopyevent( node, destelements[i] );5498 }5499 } else {5500 clonecopyevent( elem, clone );5501 }5502 }5503 // preserve script evaluation history5504 destelements = getall( clone, "script" );5505 if ( destelements.length > 0 ) {5506 setglobaleval( destelements, !inpage && getall( elem, "script" ) );5507 }5508 destelements = srcelements = node = null;5509 // return the cloned set5510 return clone;5511 },5512 buildfragment: function( elems, context, scripts, selection ) {5513 var j, elem, contains,5514 tmp, tag, tbody, wrap,5515 l = elems.length,5516 // ensure a safe fragment5517 safe = createsafefragment( context ),5518 nodes = [],5519 i = 0;5520 for ( ; i < l; i++ ) {5521 elem = elems[ i ];5522 if ( elem || elem === 0 ) {5523 // add nodes directly5524 if ( jquery.type( elem ) === "object" ) {5525 jquery.merge( nodes, elem.nodetype ? [ elem ] : elem );5526 // convert non-html into a text node5527 } else if ( !rhtml.test( elem ) ) {5528 nodes.push( context.createtextnode( elem ) );5529 // convert html into dom nodes5530 } else {5531 tmp = tmp || safe.appendchild( context.createelement("div") );5532 // deserialize a standard representation5533 tag = ( rtagname.exec( elem ) || ["", ""] )[1].tolowercase();5534 wrap = wrapmap[ tag ] || wrapmap._default;5535 tmp.innerhtml = wrap[1] + elem.replace( rxhtmltag, "<$1></$2>" ) + wrap[2];5536 // descend through wrappers to the right content5537 j = wrap[0];5538 while ( j-- ) {5539 tmp = tmp.lastchild;5540 }5541 // manually add leading whitespace removed by ie5542 if ( !jquery.support.leadingwhitespace && rleadingwhitespace.test( elem ) ) {5543 nodes.push( context.createtextnode( rleadingwhitespace.exec( elem )[0] ) );5544 }5545 // remove ie's autoinserted <tbody> from table fragments5546 if ( !jquery.support.tbody ) {5547 // string was a <table>, *may* have spurious <tbody>5548 elem = tag === "table" && !rtbody.test( elem ) ?5549 tmp.firstchild :5550 // string was a bare <thead> or <tfoot>5551 wrap[1] === "<table>" && !rtbody.test( elem ) ?5552 tmp :5553 0;5554 j = elem && elem.childnodes.length;5555 while ( j-- ) {5556 if ( jquery.nodename( (tbody = elem.childnodes[j]), "tbody" ) && !tbody.childnodes.length ) {5557 elem.removechild( tbody );5558 }5559 }5560 }5561 jquery.merge( nodes, tmp.childnodes );5562 // fix #12392 for webkit and ie > 95563 tmp.textcontent = "";5564 // fix #12392 for oldie5565 while ( tmp.firstchild ) {5566 tmp.removechild( tmp.firstchild );5567 }5568 // remember the top-level container for proper cleanup5569 tmp = safe.lastchild;5570 }5571 }5572 }5573 // fix #11356: clear elements from fragment5574 if ( tmp ) {5575 safe.removechild( tmp );5576 }5577 // reset defaultchecked for any radios and checkboxes5578 // about to be appended to the dom in ie 6/7 (#8060)5579 if ( !jquery.support.appendchecked ) {5580 jquery.grep( getall( nodes, "input" ), fixdefaultchecked );5581 }5582 i = 0;5583 while ( (elem = nodes[ i++ ]) ) {5584 // #4087 - if origin and destination elements are the same, and this is5585 // that element, do not do anything5586 if ( selection && jquery.inarray( elem, selection ) !== -1 ) {5587 continue;5588 }5589 contains = jquery.contains( elem.ownerdocument, elem );5590 // append to fragment5591 tmp = getall( safe.appendchild( elem ), "script" );5592 // preserve script evaluation history5593 if ( contains ) {5594 setglobaleval( tmp );5595 }5596 // capture executables5597 if ( scripts ) {5598 j = 0;5599 while ( (elem = tmp[ j++ ]) ) {5600 if ( rscripttype.test( elem.type || "" ) ) {5601 scripts.push( elem );5602 }5603 }5604 }5605 }5606 tmp = null;5607 return safe;5608 },5609 cleandata: function( elems, /* internal */ acceptdata ) {5610 var elem, type, id, data,5611 i = 0,5612 internalkey = jquery.expando,5613 cache = jquery.cache,5614 deleteexpando = jquery.support.deleteexpando,5615 special = jquery.event.special;5616 for ( ; (elem = elems[i]) != null; i++ ) {5617 if ( acceptdata || jquery.acceptdata( elem ) ) {5618 id = elem[ internalkey ];5619 data = id && cache[ id ];5620 if ( data ) {5621 if ( data.events ) {5622 for ( type in data.events ) {5623 if ( special[ type ] ) {5624 jquery.event.remove( elem, type );5625 // this is a shortcut to avoid jquery.event.remove's overhead5626 } else {5627 jquery.removeevent( elem, type, data.handle );5628 }5629 }5630 }5631 // remove cache only if it was not already removed by jquery.event.remove5632 if ( cache[ id ] ) {5633 delete cache[ id ];5634 // ie does not allow us to delete expando properties from nodes,5635 // nor does it have a removeattribute function on document nodes;5636 // we must handle all of these cases5637 if ( deleteexpando ) {5638 delete elem[ internalkey ];5639 } else if ( typeof elem.removeattribute !== core_strundefined ) {5640 elem.removeattribute( internalkey );5641 } else {5642 elem[ internalkey ] = null;5643 }5644 core_deletedids.push( id );5645 }5646 }5647 }5648 }5649 },5650 _evalurl: function( url ) {5651 return jquery.ajax({5652 url: url,5653 type: "get",5654 datatype: "script",5655 async: false,5656 global: false,5657 "throws": true5658 });5659 }5660 });5661 jquery.fn.extend({5662 wrapall: function( html ) {5663 if ( jquery.isfunction( html ) ) {5664 return this.each(function(i) {5665 jquery(this).wrapall( html.call(this, i) );5666 });5667 }5668 if ( this[0] ) {5669 // the elements to wrap the target around5670 var wrap = jquery( html, this[0].ownerdocument ).eq(0).clone(true);5671 if ( this[0].parentnode ) {5672 wrap.insertbefore( this[0] );5673 }5674 wrap.map(function() {5675 var elem = this;5676 while ( elem.firstchild && elem.firstchild.nodetype === 1 ) {5677 elem = elem.firstchild;5678 }5679 return elem;5680 }).append( this );5681 }5682 return this;5683 },5684 wrapinner: function( html ) {5685 if ( jquery.isfunction( html ) ) {5686 return this.each(function(i) {5687 jquery(this).wrapinner( html.call(this, i) );5688 });5689 }5690 return this.each(function() {5691 var self = jquery( this ),5692 contents = self.contents();5693 if ( contents.length ) {5694 contents.wrapall( html );5695 } else {5696 self.append( html );5697 }5698 });5699 },5700 wrap: function( html ) {5701 var isfunction = jquery.isfunction( html );5702 return this.each(function(i) {5703 jquery( this ).wrapall( isfunction ? html.call(this, i) : html );5704 });5705 },5706 unwrap: function() {5707 return this.parent().each(function() {5708 if ( !jquery.nodename( this, "body" ) ) {5709 jquery( this ).replacewith( this.childnodes );5710 }5711 }).end();5712 }5713 });5714 var iframe, getstyles, curcss,5715 ralpha = /alpha\([^)]*\)/i,5716 ropacity = /opacity\s*=\s*([^)]*)/,5717 rposition = /^(top|right|bottom|left)$/,5718 // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"5719 // see here for display values: https://developer.mozilla.org/en-us/docs/css/display5720 rdisplayswap = /^(none|table(?!-c[ea]).+)/,5721 rmargin = /^margin/,5722 rnumsplit = new regexp( "^(" + core_pnum + ")(.*)$", "i" ),5723 rnumnonpx = new regexp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),5724 rrelnum = new regexp( "^([+-])=(" + core_pnum + ")", "i" ),5725 elemdisplay = { body: "block" },5726 cssshow = { position: "absolute", visibility: "hidden", display: "block" },5727 cssnormaltransform = {5728 letterspacing: 0,5729 fontweight: 4005730 },5731 cssexpand = [ "top", "right", "bottom", "left" ],5732 cssprefixes = [ "webkit", "o", "moz", "ms" ];5733// return a css property mapped to a potentially vendor prefixed property5734 function vendorpropname( style, name ) {5735 // shortcut for names that are not vendor prefixed5736 if ( name in style ) {5737 return name;5738 }5739 // check for vendor prefixed names5740 var capname = name.charat(0).touppercase() + name.slice(1),5741 origname = name,5742 i = cssprefixes.length;5743 while ( i-- ) {5744 name = cssprefixes[ i ] + capname;5745 if ( name in style ) {5746 return name;5747 }5748 }5749 return origname;5750 }5751 function ishidden( elem, el ) {5752 // ishidden might be called from jquery#filter function;5753 // in that case, element will be second argument5754 elem = el || elem;5755 return jquery.css( elem, "display" ) === "none" || !jquery.contains( elem.ownerdocument, elem );5756 }5757 function showhide( elements, show ) {5758 var display, elem, hidden,5759 values = [],5760 index = 0,5761 length = elements.length;5762 for ( ; index < length; index++ ) {5763 elem = elements[ index ];5764 if ( !elem.style ) {5765 continue;5766 }5767 values[ index ] = jquery._data( elem, "olddisplay" );5768 display = elem.style.display;5769 if ( show ) {5770 // reset the inline display of this element to learn if it is5771 // being hidden by cascaded rules or not5772 if ( !values[ index ] && display === "none" ) {5773 elem.style.display = "";5774 }5775 // set elements which have been overridden with display: none5776 // in a stylesheet to whatever the default browser style is5777 // for such an element5778 if ( elem.style.display === "" && ishidden( elem ) ) {5779 values[ index ] = jquery._data( elem, "olddisplay", css_defaultdisplay(elem.nodename) );5780 }5781 } else {5782 if ( !values[ index ] ) {5783 hidden = ishidden( elem );5784 if ( display && display !== "none" || !hidden ) {5785 jquery._data( elem, "olddisplay", hidden ? display : jquery.css( elem, "display" ) );5786 }5787 }5788 }5789 }5790 // set the display of most of the elements in a second loop5791 // to avoid the constant reflow5792 for ( index = 0; index < length; index++ ) {5793 elem = elements[ index ];5794 if ( !elem.style ) {5795 continue;5796 }5797 if ( !show || elem.style.display === "none" || elem.style.display === "" ) {5798 elem.style.display = show ? values[ index ] || "" : "none";5799 }5800 }5801 return elements;5802 }5803 jquery.fn.extend({5804 css: function( name, value ) {5805 return jquery.access( this, function( elem, name, value ) {5806 var len, styles,5807 map = {},5808 i = 0;5809 if ( jquery.isarray( name ) ) {5810 styles = getstyles( elem );5811 len = name.length;5812 for ( ; i < len; i++ ) {5813 map[ name[ i ] ] = jquery.css( elem, name[ i ], false, styles );5814 }5815 return map;5816 }5817 return value !== undefined ?5818 jquery.style( elem, name, value ) :5819 jquery.css( elem, name );5820 }, name, value, arguments.length > 1 );5821 },5822 show: function() {5823 return showhide( this, true );5824 },5825 hide: function() {5826 return showhide( this );5827 },5828 toggle: function( state ) {5829 if ( typeof state === "boolean" ) {5830 return state ? this.show() : this.hide();5831 }5832 return this.each(function() {5833 if ( ishidden( this ) ) {5834 jquery( this ).show();5835 } else {5836 jquery( this ).hide();5837 }5838 });5839 }5840 });5841 jquery.extend({5842 // add in style property hooks for overriding the default5843 // behavior of getting and setting a style property5844 csshooks: {5845 opacity: {5846 get: function( elem, computed ) {5847 if ( computed ) {5848 // we should always get a number back from opacity5849 var ret = curcss( elem, "opacity" );5850 return ret === "" ? "1" : ret;5851 }5852 }5853 }5854 },5855 // don't automatically add "px" to these possibly-unitless properties5856 cssnumber: {5857 "columncount": true,5858 "fillopacity": true,5859 "fontweight": true,5860 "lineheight": true,5861 "opacity": true,5862 "order": true,5863 "orphans": true,5864 "widows": true,5865 "zindex": true,5866 "zoom": true5867 },5868 // add in properties whose names you wish to fix before5869 // setting or getting the value5870 cssprops: {5871 // normalize float css property5872 "float": jquery.support.cssfloat ? "cssfloat" : "stylefloat"5873 },5874 // get and set the style property on a dom node5875 style: function( elem, name, value, extra ) {5876 // don't set styles on text and comment nodes5877 if ( !elem || elem.nodetype === 3 || elem.nodetype === 8 || !elem.style ) {5878 return;5879 }5880 // make sure that we're working with the right name5881 var ret, type, hooks,5882 origname = jquery.camelcase( name ),5883 style = elem.style;5884 name = jquery.cssprops[ origname ] || ( jquery.cssprops[ origname ] = vendorpropname( style, origname ) );5885 // gets hook for the prefixed version5886 // followed by the unprefixed version5887 hooks = jquery.csshooks[ name ] || jquery.csshooks[ origname ];5888 // check if we're setting a value5889 if ( value !== undefined ) {5890 type = typeof value;5891 // convert relative number strings (+= or -=) to relative numbers. #73455892 if ( type === "string" && (ret = rrelnum.exec( value )) ) {5893 value = ( ret[1] + 1 ) * ret[2] + parsefloat( jquery.css( elem, name ) );5894 // fixes bug #92375895 type = "number";5896 }5897 // make sure that nan and null values aren't set. see: #71165898 if ( value == null || type === "number" && isnan( value ) ) {5899 return;5900 }5901 // if a number was passed in, add 'px' to the (except for certain css properties)5902 if ( type === "number" && !jquery.cssnumber[ origname ] ) {5903 value += "px";5904 }5905 // fixes #8908, it can be done more correctly by specifing setters in csshooks,5906 // but it would mean to define eight (for every problematic property) identical functions5907 if ( !jquery.support.clearclonestyle && value === "" && name.indexof("background") === 0 ) {5908 style[ name ] = "inherit";5909 }5910 // if a hook was provided, use that value, otherwise just set the specified value5911 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {5912 // wrapped to prevent ie from throwing errors when 'invalid' values are provided5913 // fixes bug #55095914 try {5915 style[ name ] = value;5916 } catch(e) {}5917 }5918 } else {5919 // if a hook was provided get the non-computed value from there5920 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {5921 return ret;5922 }5923 // otherwise just get the value from the style object5924 return style[ name ];5925 }5926 },5927 css: function( elem, name, extra, styles ) {5928 var num, val, hooks,5929 origname = jquery.camelcase( name );5930 // make sure that we're working with the right name5931 name = jquery.cssprops[ origname ] || ( jquery.cssprops[ origname ] = vendorpropname( elem.style, origname ) );5932 // gets hook for the prefixed version5933 // followed by the unprefixed version5934 hooks = jquery.csshooks[ name ] || jquery.csshooks[ origname ];5935 // if a hook was provided get the computed value from there5936 if ( hooks && "get" in hooks ) {5937 val = hooks.get( elem, true, extra );5938 }5939 // otherwise, if a way to get the computed value exists, use that5940 if ( val === undefined ) {5941 val = curcss( elem, name, styles );5942 }5943 //convert "normal" to computed value5944 if ( val === "normal" && name in cssnormaltransform ) {5945 val = cssnormaltransform[ name ];5946 }5947 // return, converting to number if forced or a qualifier was provided and val looks numeric5948 if ( extra === "" || extra ) {5949 num = parsefloat( val );5950 return extra === true || jquery.isnumeric( num ) ? num || 0 : val;5951 }5952 return val;5953 }5954 });5955// note: we've included the "window" in window.getcomputedstyle5956// because jsdom on node.js will break without it.5957 if ( window.getcomputedstyle ) {5958 getstyles = function( elem ) {5959 return window.getcomputedstyle( elem, null );5960 };5961 curcss = function( elem, name, _computed ) {5962 var width, minwidth, maxwidth,5963 computed = _computed || getstyles( elem ),5964 // getpropertyvalue is only needed for .css('filter') in ie9, see #125375965 ret = computed ? computed.getpropertyvalue( name ) || computed[ name ] : undefined,5966 style = elem.style;5967 if ( computed ) {5968 if ( ret === "" && !jquery.contains( elem.ownerdocument, elem ) ) {5969 ret = jquery.style( elem, name );5970 }5971 // a tribute to the "awesome hack by dean edwards"5972 // chrome < 17 and safari 5.0 uses "computed value" instead of "used value" for margin-right5973 // safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels5974 // this is against the cssom draft spec: http://dev.w3.org/csswg/cssom/#resolved-values5975 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {5976 // remember the original values5977 width = style.width;5978 minwidth = style.minwidth;5979 maxwidth = style.maxwidth;5980 // put in the new values to get a computed value out5981 style.minwidth = style.maxwidth = style.width = ret;5982 ret = computed.width;5983 // revert the changed values5984 style.width = width;5985 style.minwidth = minwidth;5986 style.maxwidth = maxwidth;5987 }5988 }5989 return ret;5990 };5991 } else if ( document.documentelement.currentstyle ) {5992 getstyles = function( elem ) {5993 return elem.currentstyle;5994 };5995 curcss = function( elem, name, _computed ) {5996 var left, rs, rsleft,5997 computed = _computed || getstyles( elem ),5998 ret = computed ? computed[ name ] : undefined,5999 style = elem.style;6000 // avoid setting ret to empty string here6001 // so we don't default to auto6002 if ( ret == null && style && style[ name ] ) {6003 ret = style[ name ];6004 }6005 // from the awesome hack by dean edwards6006 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-1022916007 // if we're not dealing with a regular pixel number6008 // but a number that has a weird ending, we need to convert it to pixels6009 // but not position css attributes, as those are proportional to the parent element instead6010 // and we can't measure the parent instead because it might trigger a "stacking dolls" problem6011 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {6012 // remember the original values6013 left = style.left;6014 rs = elem.runtimestyle;6015 rsleft = rs && rs.left;6016 // put in the new values to get a computed value out6017 if ( rsleft ) {6018 rs.left = elem.currentstyle.left;6019 }6020 style.left = name === "fontsize" ? "1em" : ret;6021 ret = style.pixelleft + "px";6022 // revert the changed values6023 style.left = left;6024 if ( rsleft ) {6025 rs.left = rsleft;6026 }6027 }6028 return ret === "" ? "auto" : ret;6029 };6030 }6031 function setpositivenumber( elem, value, subtract ) {6032 var matches = rnumsplit.exec( value );6033 return matches ?6034 // guard against undefined "subtract", e.g., when used as in csshooks6035 math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :6036 value;6037 }6038 function augmentwidthorheight( elem, name, extra, isborderbox, styles ) {6039 var i = extra === ( isborderbox ? "border" : "content" ) ?6040 // if we already have the right measurement, avoid augmentation6041 4 :6042 // otherwise initialize for horizontal or vertical properties6043 name === "width" ? 1 : 0,6044 val = 0;6045 for ( ; i < 4; i += 2 ) {6046 // both box models exclude margin, so add it if we want it6047 if ( extra === "margin" ) {6048 val += jquery.css( elem, extra + cssexpand[ i ], true, styles );6049 }6050 if ( isborderbox ) {6051 // border-box includes padding, so remove it if we want content6052 if ( extra === "content" ) {6053 val -= jquery.css( elem, "padding" + cssexpand[ i ], true, styles );6054 }6055 // at this point, extra isn't border nor margin, so remove border6056 if ( extra !== "margin" ) {6057 val -= jquery.css( elem, "border" + cssexpand[ i ] + "width", true, styles );6058 }6059 } else {6060 // at this point, extra isn't content, so add padding6061 val += jquery.css( elem, "padding" + cssexpand[ i ], true, styles );6062 // at this point, extra isn't content nor padding, so add border6063 if ( extra !== "padding" ) {6064 val += jquery.css( elem, "border" + cssexpand[ i ] + "width", true, styles );6065 }6066 }6067 }6068 return val;6069 }6070 function getwidthorheight( elem, name, extra ) {6071 // start with offset property, which is equivalent to the border-box value6072 var valueisborderbox = true,6073 val = name === "width" ? elem.offsetwidth : elem.offsetheight,6074 styles = getstyles( elem ),6075 isborderbox = jquery.support.boxsizing && jquery.css( elem, "boxsizing", false, styles ) === "border-box";6076 // some non-html elements return undefined for offsetwidth, so check for null/undefined6077 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=6492856078 // mathml - https://bugzilla.mozilla.org/show_bug.cgi?id=4916686079 if ( val <= 0 || val == null ) {6080 // fall back to computed then uncomputed css if necessary6081 val = curcss( elem, name, styles );6082 if ( val < 0 || val == null ) {6083 val = elem.style[ name ];6084 }6085 // computed unit is not pixels. stop here and return.6086 if ( rnumnonpx.test(val) ) {6087 return val;6088 }6089 // we need the check for style in case a browser which returns unreliable values6090 // for getcomputedstyle silently falls back to the reliable elem.style6091 valueisborderbox = isborderbox && ( jquery.support.boxsizingreliable || val === elem.style[ name ] );6092 // normalize "", auto, and prepare for extra6093 val = parsefloat( val ) || 0;6094 }6095 // use the active box-sizing model to add/subtract irrelevant styles6096 return ( val +6097 augmentwidthorheight(6098 elem,6099 name,6100 extra || ( isborderbox ? "border" : "content" ),6101 valueisborderbox,6102 styles6103 )6104 ) + "px";6105 }6106// try to determine the default display value of an element6107 function css_defaultdisplay( nodename ) {6108 var doc = document,6109 display = elemdisplay[ nodename ];6110 if ( !display ) {6111 display = actualdisplay( nodename, doc );6112 // if the simple way fails, read from inside an iframe6113 if ( display === "none" || !display ) {6114 // use the already-created iframe if possible6115 iframe = ( iframe ||6116 jquery("<iframe frameborder='0' width='0' height='0'/>")6117 .css( "csstext", "display:block !important" )6118 ).appendto( doc.documentelement );6119 // always write a new html skeleton so webkit and firefox don't choke on reuse6120 doc = ( iframe[0].contentwindow || iframe[0].contentdocument ).document;6121 doc.write("<!doctype html><html><body>");6122 doc.close();6123 display = actualdisplay( nodename, doc );6124 iframe.detach();6125 }6126 // store the correct default display6127 elemdisplay[ nodename ] = display;6128 }6129 return display;6130 }6131// called only from within css_defaultdisplay6132 function actualdisplay( name, doc ) {6133 var elem = jquery( doc.createelement( name ) ).appendto( doc.body ),6134 display = jquery.css( elem[0], "display" );6135 elem.remove();6136 return display;6137 }6138 jquery.each([ "height", "width" ], function( i, name ) {6139 jquery.csshooks[ name ] = {6140 get: function( elem, computed, extra ) {6141 if ( computed ) {6142 // certain elements can have dimension info if we invisibly show them6143 // however, it must have a current display style that would benefit from this6144 return elem.offsetwidth === 0 && rdisplayswap.test( jquery.css( elem, "display" ) ) ?6145 jquery.swap( elem, cssshow, function() {6146 return getwidthorheight( elem, name, extra );6147 }) :6148 getwidthorheight( elem, name, extra );6149 }6150 },6151 set: function( elem, value, extra ) {6152 var styles = extra && getstyles( elem );6153 return setpositivenumber( elem, value, extra ?6154 augmentwidthorheight(6155 elem,6156 name,6157 extra,6158 jquery.support.boxsizing && jquery.css( elem, "boxsizing", false, styles ) === "border-box",6159 styles6160 ) : 06161 );6162 }6163 };6164 });6165 if ( !jquery.support.opacity ) {6166 jquery.csshooks.opacity = {6167 get: function( elem, computed ) {6168 // ie uses filters for opacity6169 return ropacity.test( (computed && elem.currentstyle ? elem.currentstyle.filter : elem.style.filter) || "" ) ?6170 ( 0.01 * parsefloat( regexp.$1 ) ) + "" :6171 computed ? "1" : "";6172 },6173 set: function( elem, value ) {6174 var style = elem.style,6175 currentstyle = elem.currentstyle,6176 opacity = jquery.isnumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",6177 filter = currentstyle && currentstyle.filter || style.filter || "";6178 // ie has trouble with opacity if it does not have layout6179 // force it by setting the zoom level6180 style.zoom = 1;6181 // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #66526182 // if value === "", then remove inline opacity #126856183 if ( ( value >= 1 || value === "" ) &&6184 jquery.trim( filter.replace( ralpha, "" ) ) === "" &&6185 style.removeattribute ) {6186 // setting style.filter to null, "" & " " still leave "filter:" in the csstext6187 // if "filter:" is present at all, cleartype is disabled, we want to avoid this6188 // style.removeattribute is ie only, but so apparently is this code path...6189 style.removeattribute( "filter" );6190 // if there is no filter style applied in a css rule or unset inline opacity, we are done6191 if ( value === "" || currentstyle && !currentstyle.filter ) {6192 return;6193 }6194 }6195 // otherwise, set new filter values6196 style.filter = ralpha.test( filter ) ?6197 filter.replace( ralpha, opacity ) :6198 filter + " " + opacity;6199 }6200 };6201 }6202// these hooks cannot be added until dom ready because the support test6203// for it is not run until after dom ready6204 jquery(function() {6205 if ( !jquery.support.reliablemarginright ) {6206 jquery.csshooks.marginright = {6207 get: function( elem, computed ) {6208 if ( computed ) {6209 // webkit bug 13343 - getcomputedstyle returns wrong value for margin-right6210 // work around by temporarily setting element display to inline-block6211 return jquery.swap( elem, { "display": "inline-block" },6212 curcss, [ elem, "marginright" ] );6213 }6214 }6215 };6216 }6217 // webkit bug: https://bugs.webkit.org/show_bug.cgi?id=290846218 // getcomputedstyle returns percent when specified for top/left/bottom/right6219 // rather than make the css module depend on the offset module, we just check for it here6220 if ( !jquery.support.pixelposition && jquery.fn.position ) {6221 jquery.each( [ "top", "left" ], function( i, prop ) {6222 jquery.csshooks[ prop ] = {6223 get: function( elem, computed ) {6224 if ( computed ) {6225 computed = curcss( elem, prop );6226 // if curcss returns percentage, fallback to offset6227 return rnumnonpx.test( computed ) ?6228 jquery( elem ).position()[ prop ] + "px" :6229 computed;6230 }6231 }6232 };6233 });6234 }6235 });6236 if ( jquery.expr && jquery.expr.filters ) {6237 jquery.expr.filters.hidden = function( elem ) {6238 // support: opera <= 12.126239 // opera reports offsetwidths and offsetheights less than zero on some elements6240 return elem.offsetwidth <= 0 && elem.offsetheight <= 0 ||6241 (!jquery.support.reliablehiddenoffsets && ((elem.style && elem.style.display) || jquery.css( elem, "display" )) === "none");6242 };6243 jquery.expr.filters.visible = function( elem ) {6244 return !jquery.expr.filters.hidden( elem );6245 };6246 }6247// these hooks are used by animate to expand properties6248 jquery.each({6249 margin: "",6250 padding: "",6251 border: "width"6252 }, function( prefix, suffix ) {6253 jquery.csshooks[ prefix + suffix ] = {6254 expand: function( value ) {6255 var i = 0,6256 expanded = {},6257 // assumes a single number if not a string6258 parts = typeof value === "string" ? value.split(" ") : [ value ];6259 for ( ; i < 4; i++ ) {6260 expanded[ prefix + cssexpand[ i ] + suffix ] =6261 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];6262 }6263 return expanded;6264 }6265 };6266 if ( !rmargin.test( prefix ) ) {6267 jquery.csshooks[ prefix + suffix ].set = setpositivenumber;6268 }6269 });6270 var r20 = /%20/g,6271 rbracket = /\[\]$/,6272 rcrlf = /\r?\n/g,6273 rsubmittertypes = /^(?:submit|button|image|reset|file)$/i,6274 rsubmittable = /^(?:input|select|textarea|keygen)/i;6275 jquery.fn.extend({6276 serialize: function() {6277 return jquery.param( this.serializearray() );6278 },6279 serializearray: function() {6280 return this.map(function(){6281 // can add prophook for "elements" to filter or add form elements6282 var elements = jquery.prop( this, "elements" );6283 return elements ? jquery.makearray( elements ) : this;6284 })6285 .filter(function(){6286 var type = this.type;6287 // use .is(":disabled") so that fieldset[disabled] works6288 return this.name && !jquery( this ).is( ":disabled" ) &&6289 rsubmittable.test( this.nodename ) && !rsubmittertypes.test( type ) &&6290 ( this.checked || !manipulation_rcheckabletype.test( type ) );6291 })6292 .map(function( i, elem ){6293 var val = jquery( this ).val();6294 return val == null ?6295 null :6296 jquery.isarray( val ) ?6297 jquery.map( val, function( val ){6298 return { name: elem.name, value: val.replace( rcrlf, "\r\n" ) };6299 }) :6300 { name: elem.name, value: val.replace( rcrlf, "\r\n" ) };6301 }).get();6302 }6303 });6304//serialize an array of form elements or a set of6305//key/values into a query string6306 jquery.param = function( a, traditional ) {6307 var prefix,6308 s = [],6309 add = function( key, value ) {6310 // if value is a function, invoke it and return its value6311 value = jquery.isfunction( value ) ? value() : ( value == null ? "" : value );6312 s[ s.length ] = encodeuricomponent( key ) + "=" + encodeuricomponent( value );6313 };6314 // set traditional to true for jquery <= 1.3.2 behavior.6315 if ( traditional === undefined ) {6316 traditional = jquery.ajaxsettings && jquery.ajaxsettings.traditional;6317 }6318 // if an array was passed in, assume that it is an array of form elements.6319 if ( jquery.isarray( a ) || ( a.jquery && !jquery.isplainobject( a ) ) ) {6320 // serialize the form elements6321 jquery.each( a, function() {6322 add( this.name, this.value );6323 });6324 } else {6325 // if traditional, encode the "old" way (the way 1.3.2 or older6326 // did it), otherwise encode params recursively.6327 for ( prefix in a ) {6328 buildparams( prefix, a[ prefix ], traditional, add );6329 }6330 }6331 // return the resulting serialization6332 return s.join( "&" ).replace( r20, "+" );6333 };6334 function buildparams( prefix, obj, traditional, add ) {6335 var name;6336 if ( jquery.isarray( obj ) ) {6337 // serialize array item.6338 jquery.each( obj, function( i, v ) {6339 if ( traditional || rbracket.test( prefix ) ) {6340 // treat each array item as a scalar.6341 add( prefix, v );6342 } else {6343 // item is non-scalar (array or object), encode its numeric index.6344 buildparams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );6345 }6346 });6347 } else if ( !traditional && jquery.type( obj ) === "object" ) {6348 // serialize object item.6349 for ( name in obj ) {6350 buildparams( prefix + "[" + name + "]", obj[ name ], traditional, add );6351 }6352 } else {6353 // serialize scalar item.6354 add( prefix, obj );6355 }6356 }6357 jquery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +6358 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +6359 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {6360 // handle event binding6361 jquery.fn[ name ] = function( data, fn ) {6362 return arguments.length > 0 ?6363 this.on( name, null, data, fn ) :6364 this.trigger( name );6365 };6366 });6367 jquery.fn.extend({6368 hover: function( fnover, fnout ) {6369 return this.mouseenter( fnover ).mouseleave( fnout || fnover );6370 },6371 bind: function( types, data, fn ) {6372 return this.on( types, null, data, fn );6373 },6374 unbind: function( types, fn ) {6375 return this.off( types, null, fn );6376 },6377 delegate: function( selector, types, data, fn ) {6378 return this.on( types, selector, data, fn );6379 },6380 undelegate: function( selector, types, fn ) {6381 // ( namespace ) or ( selector, types [, fn] )6382 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );6383 }6384 });6385 var6386 // document location6387 ajaxlocparts,6388 ajaxlocation,6389 ajax_nonce = jquery.now(),6390 ajax_rquery = /\?/,6391 rhash = /#.*$/,6392 rts = /([?&])_=[^&]*/,6393 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // ie leaves an \r character at eol6394 // #7653, #8125, #8152: local protocol detection6395 rlocalprotocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,6396 rnocontent = /^(?:get|head)$/,6397 rprotocol = /^\/\//,6398 rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,6399 // keep a copy of the old load method6400 _load = jquery.fn.load,6401 /* prefilters6402 * 1) they are useful to introduce custom datatypes (see ajax/jsonp.js for an example)6403 * 2) these are called:6404 * - before asking for a transport6405 * - after param serialization (s.data is a string if s.processdata is true)6406 * 3) key is the datatype6407 * 4) the catchall symbol "*" can be used6408 * 5) execution will start with transport datatype and then continue down to "*" if needed6409 */6410 prefilters = {},6411 /* transports bindings6412 * 1) key is the datatype6413 * 2) the catchall symbol "*" can be used6414 * 3) selection will start with transport datatype and then go to "*" if needed6415 */6416 transports = {},6417 // avoid comment-prolog char sequence (#10098); must appease lint and evade compression6418 alltypes = "*/".concat("*");6419// #8138, ie may throw an exception when accessing6420// a field from window.location if document.domain has been set6421 try {6422 ajaxlocation = location.href;6423 } catch( e ) {6424 // use the href attribute of an a element6425 // since ie will modify it given document.location6426 ajaxlocation = document.createelement( "a" );6427 ajaxlocation.href = "";6428 ajaxlocation = ajaxlocation.href;6429 }6430// segment location into parts6431 ajaxlocparts = rurl.exec( ajaxlocation.tolowercase() ) || [];6432// base "constructor" for jquery.ajaxprefilter and jquery.ajaxtransport6433 function addtoprefiltersortransports( structure ) {6434 // datatypeexpression is optional and defaults to "*"6435 return function( datatypeexpression, func ) {6436 if ( typeof datatypeexpression !== "string" ) {6437 func = datatypeexpression;6438 datatypeexpression = "*";6439 }6440 var datatype,6441 i = 0,6442 datatypes = datatypeexpression.tolowercase().match( core_rnotwhite ) || [];6443 if ( jquery.isfunction( func ) ) {6444 // for each datatype in the datatypeexpression6445 while ( (datatype = datatypes[i++]) ) {6446 // prepend if requested6447 if ( datatype[0] === "+" ) {6448 datatype = datatype.slice( 1 ) || "*";6449 (structure[ datatype ] = structure[ datatype ] || []).unshift( func );6450 // otherwise append6451 } else {6452 (structure[ datatype ] = structure[ datatype ] || []).push( func );6453 }6454 }6455 }6456 };6457 }6458// base inspection function for prefilters and transports6459 function inspectprefiltersortransports( structure, options, originaloptions, jqxhr ) {6460 var inspected = {},6461 seekingtransport = ( structure === transports );6462 function inspect( datatype ) {6463 var selected;6464 inspected[ datatype ] = true;6465 jquery.each( structure[ datatype ] || [], function( _, prefilterorfactory ) {6466 var datatypeortransport = prefilterorfactory( options, originaloptions, jqxhr );6467 if( typeof datatypeortransport === "string" && !seekingtransport && !inspected[ datatypeortransport ] ) {6468 options.datatypes.unshift( datatypeortransport );6469 inspect( datatypeortransport );6470 return false;6471 } else if ( seekingtransport ) {6472 return !( selected = datatypeortransport );6473 }6474 });6475 return selected;6476 }6477 return inspect( options.datatypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );6478 }6479// a special extend for ajax options6480// that takes "flat" options (not to be deep extended)6481// fixes #98876482 function ajaxextend( target, src ) {6483 var deep, key,6484 flatoptions = jquery.ajaxsettings.flatoptions || {};6485 for ( key in src ) {6486 if ( src[ key ] !== undefined ) {6487 ( flatoptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];6488 }6489 }6490 if ( deep ) {6491 jquery.extend( true, target, deep );6492 }6493 return target;6494 }6495 jquery.fn.load = function( url, params, callback ) {6496 if ( typeof url !== "string" && _load ) {6497 return _load.apply( this, arguments );6498 }6499 var selector, response, type,6500 self = this,6501 off = url.indexof(" ");6502 if ( off >= 0 ) {6503 selector = url.slice( off, url.length );6504 url = url.slice( 0, off );6505 }6506 // if it's a function6507 if ( jquery.isfunction( params ) ) {6508 // we assume that it's the callback6509 callback = params;6510 params = undefined;6511 // otherwise, build a param string6512 } else if ( params && typeof params === "object" ) {6513 type = "post";6514 }6515 // if we have elements to modify, make the request6516 if ( self.length > 0 ) {6517 jquery.ajax({6518 url: url,6519 // if "type" variable is undefined, then "get" method will be used6520 type: type,6521 datatype: "html",6522 data: params6523 }).done(function( responsetext ) {6524 // save response for use in complete callback6525 response = arguments;6526 self.html( selector ?6527 // if a selector was specified, locate the right elements in a dummy div6528 // exclude scripts to avoid ie 'permission denied' errors6529 jquery("<div>").append( jquery.parsehtml( responsetext ) ).find( selector ) :6530 // otherwise use the full result6531 responsetext );6532 }).complete( callback && function( jqxhr, status ) {6533 self.each( callback, response || [ jqxhr.responsetext, status, jqxhr ] );6534 });6535 }6536 return this;6537 };6538// attach a bunch of functions for handling common ajax events6539 jquery.each( [ "ajaxstart", "ajaxstop", "ajaxcomplete", "ajaxerror", "ajaxsuccess", "ajaxsend" ], function( i, type ){6540 jquery.fn[ type ] = function( fn ){6541 return this.on( type, fn );6542 };6543 });6544 jquery.extend({6545 // counter for holding the number of active queries6546 active: 0,6547 // last-modified header cache for next request6548 lastmodified: {},6549 etag: {},6550 ajaxsettings: {6551 url: ajaxlocation,6552 type: "get",6553 islocal: rlocalprotocol.test( ajaxlocparts[ 1 ] ),6554 global: true,6555 processdata: true,6556 async: true,6557 contenttype: "application/x-www-form-urlencoded; charset=utf-8",6558 /*6559 timeout: 0,6560 data: null,6561 datatype: null,6562 username: null,6563 password: null,6564 cache: null,6565 throws: false,6566 traditional: false,6567 headers: {},6568 */6569 accepts: {6570 "*": alltypes,6571 text: "text/plain",6572 html: "text/html",6573 xml: "application/xml, text/xml",6574 json: "application/json, text/javascript"6575 },6576 contents: {6577 xml: /xml/,6578 html: /html/,6579 json: /json/6580 },6581 responsefields: {6582 xml: "responsexml",6583 text: "responsetext",6584 json: "responsejson"6585 },6586 // data converters6587 // keys separate source (or catchall "*") and destination types with a single space6588 converters: {6589 // convert anything to text6590 "* text": string,6591 // text to html (true = no transformation)6592 "text html": true,6593 // evaluate text as a json expression6594 "text json": jquery.parsejson,6595 // parse text as xml6596 "text xml": jquery.parsexml6597 },6598 // for options that shouldn't be deep extended:6599 // you can add your own custom options here if6600 // and when you create one that shouldn't be6601 // deep extended (see ajaxextend)6602 flatoptions: {6603 url: true,6604 context: true6605 }6606 },6607 // creates a full fledged settings object into target6608 // with both ajaxsettings and settings fields.6609 // if target is omitted, writes into ajaxsettings.6610 ajaxsetup: function( target, settings ) {6611 return settings ?6612 // building a settings object6613 ajaxextend( ajaxextend( target, jquery.ajaxsettings ), settings ) :6614 // extending ajaxsettings6615 ajaxextend( jquery.ajaxsettings, target );6616 },6617 ajaxprefilter: addtoprefiltersortransports( prefilters ),6618 ajaxtransport: addtoprefiltersortransports( transports ),6619 // main method6620 ajax: function( url, options ) {6621 // if url is an object, simulate pre-1.5 signature6622 if ( typeof url === "object" ) {6623 options = url;6624 url = undefined;6625 }6626 // force options to be an object6627 options = options || {};6628 var // cross-domain detection vars6629 parts,6630 // loop variable6631 i,6632 // url without anti-cache param6633 cacheurl,6634 // response headers as string6635 responseheadersstring,6636 // timeout handle6637 timeouttimer,6638 // to know if global events are to be dispatched6639 fireglobals,6640 transport,6641 // response headers6642 responseheaders,6643 // create the final options object6644 s = jquery.ajaxsetup( {}, options ),6645 // callbacks context6646 callbackcontext = s.context || s,6647 // context for global events is callbackcontext if it is a dom node or jquery collection6648 globaleventcontext = s.context && ( callbackcontext.nodetype || callbackcontext.jquery ) ?6649 jquery( callbackcontext ) :6650 jquery.event,6651 // deferreds6652 deferred = jquery.deferred(),6653 completedeferred = jquery.callbacks("once memory"),6654 // status-dependent callbacks6655 statuscode = s.statuscode || {},6656 // headers (they are sent all at once)6657 requestheaders = {},6658 requestheadersnames = {},6659 // the jqxhr state6660 state = 0,6661 // default abort message6662 strabort = "canceled",6663 // fake xhr6664 jqxhr = {6665 readystate: 0,6666 // builds headers hashtable if needed6667 getresponseheader: function( key ) {6668 var match;6669 if ( state === 2 ) {6670 if ( !responseheaders ) {6671 responseheaders = {};6672 while ( (match = rheaders.exec( responseheadersstring )) ) {6673 responseheaders[ match[1].tolowercase() ] = match[ 2 ];6674 }6675 }6676 match = responseheaders[ key.tolowercase() ];6677 }6678 return match == null ? null : match;6679 },6680 // raw string6681 getallresponseheaders: function() {6682 return state === 2 ? responseheadersstring : null;6683 },6684 // caches the header6685 setrequestheader: function( name, value ) {6686 var lname = name.tolowercase();6687 if ( !state ) {6688 name = requestheadersnames[ lname ] = requestheadersnames[ lname ] || name;6689 requestheaders[ name ] = value;6690 }6691 return this;6692 },6693 // overrides response content-type header6694 overridemimetype: function( type ) {6695 if ( !state ) {6696 s.mimetype = type;6697 }6698 return this;6699 },6700 // status-dependent callbacks6701 statuscode: function( map ) {6702 var code;6703 if ( map ) {6704 if ( state < 2 ) {6705 for ( code in map ) {6706 // lazy-add the new callback in a way that preserves old ones6707 statuscode[ code ] = [ statuscode[ code ], map[ code ] ];6708 }6709 } else {6710 // execute the appropriate callbacks6711 jqxhr.always( map[ jqxhr.status ] );6712 }6713 }6714 return this;6715 },6716 // cancel the request6717 abort: function( statustext ) {6718 var finaltext = statustext || strabort;6719 if ( transport ) {6720 transport.abort( finaltext );6721 }6722 done( 0, finaltext );6723 return this;6724 }6725 };6726 // attach deferreds6727 deferred.promise( jqxhr ).complete = completedeferred.add;6728 jqxhr.success = jqxhr.done;6729 jqxhr.error = jqxhr.fail;6730 // remove hash character (#7531: and string promotion)6731 // add protocol if not provided (#5866: ie7 issue with protocol-less urls)6732 // handle falsy url in the settings object (#10093: consistency with old signature)6733 // we also use the url parameter if available6734 s.url = ( ( url || s.url || ajaxlocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxlocparts[ 1 ] + "//" );6735 // alias method option to type as per ticket #120046736 s.type = options.method || options.type || s.method || s.type;6737 // extract datatypes list6738 s.datatypes = jquery.trim( s.datatype || "*" ).tolowercase().match( core_rnotwhite ) || [""];6739 // a cross-domain request is in order when we have a protocol:host:port mismatch6740 if ( s.crossdomain == null ) {6741 parts = rurl.exec( s.url.tolowercase() );6742 s.crossdomain = !!( parts &&6743 ( parts[ 1 ] !== ajaxlocparts[ 1 ] || parts[ 2 ] !== ajaxlocparts[ 2 ] ||6744 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==6745 ( ajaxlocparts[ 3 ] || ( ajaxlocparts[ 1 ] === "http:" ? "80" : "443" ) ) )6746 );6747 }6748 // convert data if not already a string6749 if ( s.data && s.processdata && typeof s.data !== "string" ) {6750 s.data = jquery.param( s.data, s.traditional );6751 }6752 // apply prefilters6753 inspectprefiltersortransports( prefilters, s, options, jqxhr );6754 // if request was aborted inside a prefilter, stop there6755 if ( state === 2 ) {6756 return jqxhr;6757 }6758 // we can fire global events as of now if asked to6759 fireglobals = s.global;6760 // watch for a new set of requests6761 if ( fireglobals && jquery.active++ === 0 ) {6762 jquery.event.trigger("ajaxstart");6763 }6764 // uppercase the type6765 s.type = s.type.touppercase();6766 // determine if request has content6767 s.hascontent = !rnocontent.test( s.type );6768 // save the url in case we're toying with the if-modified-since6769 // and/or if-none-match header later on6770 cacheurl = s.url;6771 // more options handling for requests with no content6772 if ( !s.hascontent ) {6773 // if data is available, append data to url6774 if ( s.data ) {6775 cacheurl = ( s.url += ( ajax_rquery.test( cacheurl ) ? "&" : "?" ) + s.data );6776 // #9682: remove data so that it's not used in an eventual retry6777 delete s.data;6778 }6779 // add anti-cache in url if needed6780 if ( s.cache === false ) {6781 s.url = rts.test( cacheurl ) ?6782 // if there is already a '_' parameter, set its value6783 cacheurl.replace( rts, "$1_=" + ajax_nonce++ ) :6784 // otherwise add one to the end6785 cacheurl + ( ajax_rquery.test( cacheurl ) ? "&" : "?" ) + "_=" + ajax_nonce++;6786 }6787 }6788 // set the if-modified-since and/or if-none-match header, if in ifmodified mode.6789 if ( s.ifmodified ) {6790 if ( jquery.lastmodified[ cacheurl ] ) {6791 jqxhr.setrequestheader( "if-modified-since", jquery.lastmodified[ cacheurl ] );6792 }6793 if ( jquery.etag[ cacheurl ] ) {6794 jqxhr.setrequestheader( "if-none-match", jquery.etag[ cacheurl ] );6795 }6796 }6797 // set the correct header, if data is being sent6798 if ( s.data && s.hascontent && s.contenttype !== false || options.contenttype ) {6799 jqxhr.setrequestheader( "content-type", s.contenttype );6800 }6801 // set the accepts header for the server, depending on the datatype6802 jqxhr.setrequestheader(6803 "accept",6804 s.datatypes[ 0 ] && s.accepts[ s.datatypes[0] ] ?6805 s.accepts[ s.datatypes[0] ] + ( s.datatypes[ 0 ] !== "*" ? ", " + alltypes + "; q=0.01" : "" ) :6806 s.accepts[ "*" ]6807 );6808 // check for headers option6809 for ( i in s.headers ) {6810 jqxhr.setrequestheader( i, s.headers[ i ] );6811 }6812 // allow custom headers/mimetypes and early abort6813 if ( s.beforesend && ( s.beforesend.call( callbackcontext, jqxhr, s ) === false || state === 2 ) ) {6814 // abort if not done already and return6815 return jqxhr.abort();6816 }6817 // aborting is no longer a cancellation6818 strabort = "abort";6819 // install callbacks on deferreds6820 for ( i in { success: 1, error: 1, complete: 1 } ) {6821 jqxhr[ i ]( s[ i ] );6822 }6823 // get transport6824 transport = inspectprefiltersortransports( transports, s, options, jqxhr );6825 // if no transport, we auto-abort6826 if ( !transport ) {6827 done( -1, "no transport" );6828 } else {6829 jqxhr.readystate = 1;6830 // send global event6831 if ( fireglobals ) {6832 globaleventcontext.trigger( "ajaxsend", [ jqxhr, s ] );6833 }6834 // timeout6835 if ( s.async && s.timeout > 0 ) {6836 timeouttimer = settimeout(function() {6837 jqxhr.abort("timeout");6838 }, s.timeout );6839 }6840 try {6841 state = 1;6842 transport.send( requestheaders, done );6843 } catch ( e ) {6844 // propagate exception as error if not done6845 if ( state < 2 ) {6846 done( -1, e );6847 // simply rethrow otherwise6848 } else {6849 throw e;6850 }6851 }6852 }6853 // callback for when everything is done6854 function done( status, nativestatustext, responses, headers ) {6855 var issuccess, success, error, response, modified,6856 statustext = nativestatustext;6857 // called once6858 if ( state === 2 ) {6859 return;6860 }6861 // state is "done" now6862 state = 2;6863 // clear timeout if it exists6864 if ( timeouttimer ) {6865 cleartimeout( timeouttimer );6866 }6867 // dereference transport for early garbage collection6868 // (no matter how long the jqxhr object will be used)6869 transport = undefined;6870 // cache response headers6871 responseheadersstring = headers || "";6872 // set readystate6873 jqxhr.readystate = status > 0 ? 4 : 0;6874 // determine if successful6875 issuccess = status >= 200 && status < 300 || status === 304;6876 // get response data6877 if ( responses ) {6878 response = ajaxhandleresponses( s, jqxhr, responses );6879 }6880 // convert no matter what (that way responsexxx fields are always set)6881 response = ajaxconvert( s, response, jqxhr, issuccess );6882 // if successful, handle type chaining6883 if ( issuccess ) {6884 // set the if-modified-since and/or if-none-match header, if in ifmodified mode.6885 if ( s.ifmodified ) {6886 modified = jqxhr.getresponseheader("last-modified");6887 if ( modified ) {6888 jquery.lastmodified[ cacheurl ] = modified;6889 }6890 modified = jqxhr.getresponseheader("etag");6891 if ( modified ) {6892 jquery.etag[ cacheurl ] = modified;6893 }6894 }6895 // if no content6896 if ( status === 204 || s.type === "head" ) {6897 statustext = "nocontent";6898 // if not modified6899 } else if ( status === 304 ) {6900 statustext = "notmodified";6901 // if we have data, let's convert it6902 } else {6903 statustext = response.state;6904 success = response.data;6905 error = response.error;6906 issuccess = !error;6907 }6908 } else {6909 // we extract error from statustext6910 // then normalize statustext and status for non-aborts6911 error = statustext;6912 if ( status || !statustext ) {6913 statustext = "error";6914 if ( status < 0 ) {6915 status = 0;6916 }6917 }6918 }6919 // set data for the fake xhr object6920 jqxhr.status = status;6921 jqxhr.statustext = ( nativestatustext || statustext ) + "";6922 // success/error6923 if ( issuccess ) {6924 deferred.resolvewith( callbackcontext, [ success, statustext, jqxhr ] );6925 } else {6926 deferred.rejectwith( callbackcontext, [ jqxhr, statustext, error ] );6927 }6928 // status-dependent callbacks6929 jqxhr.statuscode( statuscode );6930 statuscode = undefined;6931 if ( fireglobals ) {6932 globaleventcontext.trigger( issuccess ? "ajaxsuccess" : "ajaxerror",6933 [ jqxhr, s, issuccess ? success : error ] );6934 }6935 // complete6936 completedeferred.firewith( callbackcontext, [ jqxhr, statustext ] );6937 if ( fireglobals ) {6938 globaleventcontext.trigger( "ajaxcomplete", [ jqxhr, s ] );6939 // handle the global ajax counter6940 if ( !( --jquery.active ) ) {6941 jquery.event.trigger("ajaxstop");6942 }6943 }6944 }6945 return jqxhr;6946 },6947 getjson: function( url, data, callback ) {6948 return jquery.get( url, data, callback, "json" );6949 },6950 getscript: function( url, callback ) {6951 return jquery.get( url, undefined, callback, "script" );6952 }6953 });6954 jquery.each( [ "get", "post" ], function( i, method ) {6955 jquery[ method ] = function( url, data, callback, type ) {6956 // shift arguments if data argument was omitted6957 if ( jquery.isfunction( data ) ) {6958 type = type || callback;6959 callback = data;6960 data = undefined;6961 }6962 return jquery.ajax({6963 url: url,6964 type: method,6965 datatype: type,6966 data: data,6967 success: callback6968 });6969 };6970 });6971 /* handles responses to an ajax request:6972 * - finds the right datatype (mediates between content-type and expected datatype)6973 * - returns the corresponding response6974 */6975 function ajaxhandleresponses( s, jqxhr, responses ) {6976 var firstdatatype, ct, finaldatatype, type,6977 contents = s.contents,6978 datatypes = s.datatypes;6979 // remove auto datatype and get content-type in the process6980 while( datatypes[ 0 ] === "*" ) {6981 datatypes.shift();6982 if ( ct === undefined ) {6983 ct = s.mimetype || jqxhr.getresponseheader("content-type");6984 }6985 }6986 // check if we're dealing with a known content-type6987 if ( ct ) {6988 for ( type in contents ) {6989 if ( contents[ type ] && contents[ type ].test( ct ) ) {6990 datatypes.unshift( type );6991 break;6992 }6993 }6994 }6995 // check to see if we have a response for the expected datatype6996 if ( datatypes[ 0 ] in responses ) {6997 finaldatatype = datatypes[ 0 ];6998 } else {6999 // try convertible datatypes7000 for ( type in responses ) {7001 if ( !datatypes[ 0 ] || s.converters[ type + " " + datatypes[0] ] ) {7002 finaldatatype = type;7003 break;7004 }7005 if ( !firstdatatype ) {7006 firstdatatype = type;7007 }7008 }7009 // or just use first one7010 finaldatatype = finaldatatype || firstdatatype;7011 }7012 // if we found a datatype7013 // we add the datatype to the list if needed7014 // and return the corresponding response7015 if ( finaldatatype ) {7016 if ( finaldatatype !== datatypes[ 0 ] ) {7017 datatypes.unshift( finaldatatype );7018 }7019 return responses[ finaldatatype ];7020 }7021 }7022 /* chain conversions given the request and the original response7023 * also sets the responsexxx fields on the jqxhr instance7024 */7025 function ajaxconvert( s, response, jqxhr, issuccess ) {7026 var conv2, current, conv, tmp, prev,7027 converters = {},7028 // work with a copy of datatypes in case we need to modify it for conversion7029 datatypes = s.datatypes.slice();7030 // create converters map with lowercased keys7031 if ( datatypes[ 1 ] ) {7032 for ( conv in s.converters ) {7033 converters[ conv.tolowercase() ] = s.converters[ conv ];7034 }7035 }7036 current = datatypes.shift();7037 // convert to each sequential datatype7038 while ( current ) {7039 if ( s.responsefields[ current ] ) {7040 jqxhr[ s.responsefields[ current ] ] = response;7041 }7042 // apply the datafilter if provided7043 if ( !prev && issuccess && s.datafilter ) {7044 response = s.datafilter( response, s.datatype );7045 }7046 prev = current;7047 current = datatypes.shift();7048 if ( current ) {7049 // there's only work to do if current datatype is non-auto7050 if ( current === "*" ) {7051 current = prev;7052 // convert response if prev datatype is non-auto and differs from current7053 } else if ( prev !== "*" && prev !== current ) {7054 // seek a direct converter7055 conv = converters[ prev + " " + current ] || converters[ "* " + current ];7056 // if none found, seek a pair7057 if ( !conv ) {7058 for ( conv2 in converters ) {7059 // if conv2 outputs current7060 tmp = conv2.split( " " );7061 if ( tmp[ 1 ] === current ) {7062 // if prev can be converted to accepted input7063 conv = converters[ prev + " " + tmp[ 0 ] ] ||7064 converters[ "* " + tmp[ 0 ] ];7065 if ( conv ) {7066 // condense equivalence converters7067 if ( conv === true ) {7068 conv = converters[ conv2 ];7069 // otherwise, insert the intermediate datatype7070 } else if ( converters[ conv2 ] !== true ) {7071 current = tmp[ 0 ];7072 datatypes.unshift( tmp[ 1 ] );7073 }7074 break;7075 }7076 }7077 }7078 }7079 // apply converter (if not an equivalence)7080 if ( conv !== true ) {7081 // unless errors are allowed to bubble, catch and return them7082 if ( conv && s[ "throws" ] ) {7083 response = conv( response );7084 } else {7085 try {7086 response = conv( response );7087 } catch ( e ) {7088 return { state: "parsererror", error: conv ? e : "no conversion from " + prev + " to " + current };7089 }7090 }7091 }7092 }7093 }7094 }7095 return { state: "success", data: response };7096 }7097// install script datatype7098 jquery.ajaxsetup({7099 accepts: {7100 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"7101 },7102 contents: {7103 script: /(?:java|ecma)script/7104 },7105 converters: {7106 "text script": function( text ) {7107 jquery.globaleval( text );7108 return text;7109 }7110 }7111 });7112// handle cache's special case and global7113 jquery.ajaxprefilter( "script", function( s ) {7114 if ( s.cache === undefined ) {7115 s.cache = false;7116 }7117 if ( s.crossdomain ) {7118 s.type = "get";7119 s.global = false;7120 }7121 });7122// bind script tag hack transport7123 jquery.ajaxtransport( "script", function(s) {7124 // this transport only deals with cross domain requests7125 if ( s.crossdomain ) {7126 var script,7127 head = document.head || jquery("head")[0] || document.documentelement;7128 return {7129 send: function( _, callback ) {7130 script = document.createelement("script");7131 script.async = true;7132 if ( s.scriptcharset ) {7133 script.charset = s.scriptcharset;7134 }7135 script.src = s.url;7136 // attach handlers for all browsers7137 script.onload = script.onreadystatechange = function( _, isabort ) {7138 if ( isabort || !script.readystate || /loaded|complete/.test( script.readystate ) ) {7139 // handle memory leak in ie7140 script.onload = script.onreadystatechange = null;7141 // remove the script7142 if ( script.parentnode ) {7143 script.parentnode.removechild( script );7144 }7145 // dereference the script7146 script = null;7147 // callback if not abort7148 if ( !isabort ) {7149 callback( 200, "success" );7150 }7151 }7152 };7153 // circumvent ie6 bugs with base elements (#2709 and #4378) by prepending7154 // use native dom manipulation to avoid our dommanip ajax trickery7155 head.insertbefore( script, head.firstchild );7156 },7157 abort: function() {7158 if ( script ) {7159 script.onload( undefined, true );7160 }7161 }7162 };7163 }7164 });7165 var oldcallbacks = [],7166 rjsonp = /(=)\?(?=&|$)|\?\?/;7167// default jsonp settings7168 jquery.ajaxsetup({7169 jsonp: "callback",7170 jsonpcallback: function() {7171 var callback = oldcallbacks.pop() || ( jquery.expando + "_" + ( ajax_nonce++ ) );7172 this[ callback ] = true;7173 return callback;7174 }7175 });7176// detect, normalize options and install callbacks for jsonp requests7177 jquery.ajaxprefilter( "json jsonp", function( s, originalsettings, jqxhr ) {7178 var callbackname, overwritten, responsecontainer,7179 jsonprop = s.jsonp !== false && ( rjsonp.test( s.url ) ?7180 "url" :7181 typeof s.data === "string" && !( s.contenttype || "" ).indexof("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"7182 );7183 // handle iff the expected data type is "jsonp" or we have a parameter to set7184 if ( jsonprop || s.datatypes[ 0 ] === "jsonp" ) {7185 // get callback name, remembering preexisting value associated with it7186 callbackname = s.jsonpcallback = jquery.isfunction( s.jsonpcallback ) ?7187 s.jsonpcallback() :7188 s.jsonpcallback;7189 // insert callback into url or form data7190 if ( jsonprop ) {7191 s[ jsonprop ] = s[ jsonprop ].replace( rjsonp, "$1" + callbackname );7192 } else if ( s.jsonp !== false ) {7193 s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackname;7194 }7195 // use data converter to retrieve json after script execution7196 s.converters["script json"] = function() {7197 if ( !responsecontainer ) {7198 jquery.error( callbackname + " was not called" );7199 }7200 return responsecontainer[ 0 ];7201 };7202 // force json datatype7203 s.datatypes[ 0 ] = "json";7204 // install callback7205 overwritten = window[ callbackname ];7206 window[ callbackname ] = function() {7207 responsecontainer = arguments;7208 };7209 // clean-up function (fires after converters)7210 jqxhr.always(function() {7211 // restore preexisting value7212 window[ callbackname ] = overwritten;7213 // save back as free7214 if ( s[ callbackname ] ) {7215 // make sure that re-using the options doesn't screw things around7216 s.jsonpcallback = originalsettings.jsonpcallback;7217 // save the callback name for future use7218 oldcallbacks.push( callbackname );7219 }7220 // call if it was a function and we have a response7221 if ( responsecontainer && jquery.isfunction( overwritten ) ) {7222 overwritten( responsecontainer[ 0 ] );7223 }7224 responsecontainer = overwritten = undefined;7225 });7226 // delegate to script7227 return "script";7228 }7229 });7230 var xhrcallbacks, xhrsupported,7231 xhrid = 0,7232 // #5280: internet explorer will keep connections alive if we don't abort on unload7233 xhronunloadabort = window.activexobject && function() {7234 // abort all pending requests7235 var key;7236 for ( key in xhrcallbacks ) {7237 xhrcallbacks[ key ]( undefined, true );7238 }7239 };7240// functions to create xhrs7241 function createstandardxhr() {7242 try {7243 return new window.xmlhttprequest();7244 } catch( e ) {}7245 }7246 function createactivexhr() {7247 try {7248 return new window.activexobject("microsoft.xmlhttp");7249 } catch( e ) {}7250 }7251// create the request object7252// (this is still attached to ajaxsettings for backward compatibility)7253 jquery.ajaxsettings.xhr = window.activexobject ?7254 /* microsoft failed to properly7255 * implement the xmlhttprequest in ie7 (can't request local files),7256 * so we use the activexobject when it is available7257 * additionally xmlhttprequest can be disabled in ie7/ie8 so7258 * we need a fallback.7259 */7260 function() {7261 return !this.islocal && createstandardxhr() || createactivexhr();7262 } :7263 // for all other browsers, use the standard xmlhttprequest object7264 createstandardxhr;7265// determine support properties7266 xhrsupported = jquery.ajaxsettings.xhr();7267 jquery.support.cors = !!xhrsupported && ( "withcredentials" in xhrsupported );7268 xhrsupported = jquery.support.ajax = !!xhrsupported;7269// create transport if the browser can provide an xhr7270 if ( xhrsupported ) {7271 jquery.ajaxtransport(function( s ) {7272 // cross domain only allowed if supported through xmlhttprequest7273 if ( !s.crossdomain || jquery.support.cors ) {7274 var callback;7275 return {7276 send: function( headers, complete ) {7277 // get a new xhr7278 var handle, i,7279 xhr = s.xhr();7280 // open the socket7281 // passing null username, generates a login popup on opera (#2865)7282 if ( s.username ) {7283 xhr.open( s.type, s.url, s.async, s.username, s.password );7284 } else {7285 xhr.open( s.type, s.url, s.async );7286 }7287 // apply custom fields if provided7288 if ( s.xhrfields ) {7289 for ( i in s.xhrfields ) {7290 xhr[ i ] = s.xhrfields[ i ];7291 }7292 }7293 // override mime type if needed7294 if ( s.mimetype && xhr.overridemimetype ) {7295 xhr.overridemimetype( s.mimetype );7296 }7297 // x-requested-with header7298 // for cross-domain requests, seeing as conditions for a preflight are7299 // akin to a jigsaw puzzle, we simply never set it to be sure.7300 // (it can always be set on a per-request basis or even using ajaxsetup)7301 // for same-domain requests, won't change header if already provided.7302 if ( !s.crossdomain && !headers["x-requested-with"] ) {7303 headers["x-requested-with"] = "xmlhttprequest";7304 }7305 // need an extra try/catch for cross domain requests in firefox 37306 try {7307 for ( i in headers ) {7308 xhr.setrequestheader( i, headers[ i ] );7309 }7310 } catch( err ) {}7311 // do send the request7312 // this may raise an exception which is actually7313 // handled in jquery.ajax (so no try/catch here)7314 xhr.send( ( s.hascontent && s.data ) || null );7315 // listener7316 callback = function( _, isabort ) {7317 var status, responseheaders, statustext, responses;7318 // firefox throws exceptions when accessing properties7319 // of an xhr when a network error occurred7320 // http://helpful.knobs-dials.com/index.php/component_returned_failure_code:_0x80040111_(ns_error_not_available)7321 try {7322 // was never called and is aborted or complete7323 if ( callback && ( isabort || xhr.readystate === 4 ) ) {7324 // only called once7325 callback = undefined;7326 // do not keep as active anymore7327 if ( handle ) {7328 xhr.onreadystatechange = jquery.noop;7329 if ( xhronunloadabort ) {7330 delete xhrcallbacks[ handle ];7331 }7332 }7333 // if it's an abort7334 if ( isabort ) {7335 // abort it manually if needed7336 if ( xhr.readystate !== 4 ) {7337 xhr.abort();7338 }7339 } else {7340 responses = {};7341 status = xhr.status;7342 responseheaders = xhr.getallresponseheaders();7343 // when requesting binary data, ie6-9 will throw an exception7344 // on any attempt to access responsetext (#11426)7345 if ( typeof xhr.responsetext === "string" ) {7346 responses.text = xhr.responsetext;7347 }7348 // firefox throws an exception when accessing7349 // statustext for faulty cross-domain requests7350 try {7351 statustext = xhr.statustext;7352 } catch( e ) {7353 // we normalize with webkit giving an empty statustext7354 statustext = "";7355 }7356 // filter status for non standard behaviors7357 // if the request is local and we have data: assume a success7358 // (success with no data won't get notified, that's the best we7359 // can do given current implementations)7360 if ( !status && s.islocal && !s.crossdomain ) {7361 status = responses.text ? 200 : 404;7362 // ie - #1450: sometimes returns 1223 when it should be 2047363 } else if ( status === 1223 ) {7364 status = 204;7365 }7366 }7367 }7368 } catch( firefoxaccessexception ) {7369 if ( !isabort ) {7370 complete( -1, firefoxaccessexception );7371 }7372 }7373 // call complete if needed7374 if ( responses ) {7375 complete( status, statustext, responses, responseheaders );7376 }7377 };7378 if ( !s.async ) {7379 // if we're in sync mode we fire the callback7380 callback();7381 } else if ( xhr.readystate === 4 ) {7382 // (ie6 & ie7) if it's in cache and has been7383 // retrieved directly we need to fire the callback7384 settimeout( callback );7385 } else {7386 handle = ++xhrid;7387 if ( xhronunloadabort ) {7388 // create the active xhrs callbacks list if needed7389 // and attach the unload handler7390 if ( !xhrcallbacks ) {7391 xhrcallbacks = {};7392 jquery( window ).unload( xhronunloadabort );7393 }7394 // add to list of active xhrs callbacks7395 xhrcallbacks[ handle ] = callback;7396 }7397 xhr.onreadystatechange = callback;7398 }7399 },7400 abort: function() {7401 if ( callback ) {7402 callback( undefined, true );7403 }7404 }7405 };7406 }7407 });7408 }7409 var fxnow, timerid,7410 rfxtypes = /^(?:toggle|show|hide)$/,7411 rfxnum = new regexp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),7412 rrun = /queuehooks$/,7413 animationprefilters = [ defaultprefilter ],7414 tweeners = {7415 "*": [function( prop, value ) {7416 var tween = this.createtween( prop, value ),7417 target = tween.cur(),7418 parts = rfxnum.exec( value ),7419 unit = parts && parts[ 3 ] || ( jquery.cssnumber[ prop ] ? "" : "px" ),7420 // starting value computation is required for potential unit mismatches7421 start = ( jquery.cssnumber[ prop ] || unit !== "px" && +target ) &&7422 rfxnum.exec( jquery.css( tween.elem, prop ) ),7423 scale = 1,7424 maxiterations = 20;7425 if ( start && start[ 3 ] !== unit ) {7426 // trust units reported by jquery.css7427 unit = unit || start[ 3 ];7428 // make sure we update the tween properties later on7429 parts = parts || [];7430 // iteratively approximate from a nonzero starting point7431 start = +target || 1;7432 do {7433 // if previous iteration zeroed out, double until we get *something*7434 // use a string for doubling factor so we don't accidentally see scale as unchanged below7435 scale = scale || ".5";7436 // adjust and apply7437 start = start / scale;7438 jquery.style( tween.elem, prop, start + unit );7439 // update scale, tolerating zero or nan from tween.cur()7440 // and breaking the loop if scale is unchanged or perfect, or if we've just had enough7441 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxiterations );7442 }7443 // update tween properties7444 if ( parts ) {7445 start = tween.start = +start || +target || 0;7446 tween.unit = unit;7447 // if a +=/-= token was provided, we're doing a relative animation7448 tween.end = parts[ 1 ] ?7449 start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :7450 +parts[ 2 ];7451 }7452 return tween;7453 }]7454 };7455// animations created synchronously will run synchronously7456 function createfxnow() {7457 settimeout(function() {7458 fxnow = undefined;7459 });7460 return ( fxnow = jquery.now() );7461 }7462 function createtween( value, prop, animation ) {7463 var tween,7464 collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),7465 index = 0,7466 length = collection.length;7467 for ( ; index < length; index++ ) {7468 if ( (tween = collection[ index ].call( animation, prop, value )) ) {7469 // we're done with this property7470 return tween;7471 }7472 }7473 }7474 function animation( elem, properties, options ) {7475 var result,7476 stopped,7477 index = 0,7478 length = animationprefilters.length,7479 deferred = jquery.deferred().always( function() {7480 // don't match elem in the :animated selector7481 delete tick.elem;7482 }),7483 tick = function() {7484 if ( stopped ) {7485 return false;7486 }7487 var currenttime = fxnow || createfxnow(),7488 remaining = math.max( 0, animation.starttime + animation.duration - currenttime ),7489 // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)7490 temp = remaining / animation.duration || 0,7491 percent = 1 - temp,7492 index = 0,7493 length = animation.tweens.length;7494 for ( ; index < length ; index++ ) {7495 animation.tweens[ index ].run( percent );7496 }7497 deferred.notifywith( elem, [ animation, percent, remaining ]);7498 if ( percent < 1 && length ) {7499 return remaining;7500 } else {7501 deferred.resolvewith( elem, [ animation ] );7502 return false;7503 }7504 },7505 animation = deferred.promise({7506 elem: elem,7507 props: jquery.extend( {}, properties ),7508 opts: jquery.extend( true, { specialeasing: {} }, options ),7509 originalproperties: properties,7510 originaloptions: options,7511 starttime: fxnow || createfxnow(),7512 duration: options.duration,7513 tweens: [],7514 createtween: function( prop, end ) {7515 var tween = jquery.tween( elem, animation.opts, prop, end,7516 animation.opts.specialeasing[ prop ] || animation.opts.easing );7517 animation.tweens.push( tween );7518 return tween;7519 },7520 stop: function( gotoend ) {7521 var index = 0,7522 // if we are going to the end, we want to run all the tweens7523 // otherwise we skip this part7524 length = gotoend ? animation.tweens.length : 0;7525 if ( stopped ) {7526 return this;7527 }7528 stopped = true;7529 for ( ; index < length ; index++ ) {7530 animation.tweens[ index ].run( 1 );7531 }7532 // resolve when we played the last frame7533 // otherwise, reject7534 if ( gotoend ) {7535 deferred.resolvewith( elem, [ animation, gotoend ] );7536 } else {7537 deferred.rejectwith( elem, [ animation, gotoend ] );7538 }7539 return this;7540 }7541 }),7542 props = animation.props;7543 propfilter( props, animation.opts.specialeasing );7544 for ( ; index < length ; index++ ) {7545 result = animationprefilters[ index ].call( animation, elem, props, animation.opts );7546 if ( result ) {7547 return result;7548 }7549 }7550 jquery.map( props, createtween, animation );7551 if ( jquery.isfunction( animation.opts.start ) ) {7552 animation.opts.start.call( elem, animation );7553 }7554 jquery.fx.timer(7555 jquery.extend( tick, {7556 elem: elem,7557 anim: animation,7558 queue: animation.opts.queue7559 })7560 );7561 // attach callbacks from options7562 return animation.progress( animation.opts.progress )7563 .done( animation.opts.done, animation.opts.complete )7564 .fail( animation.opts.fail )7565 .always( animation.opts.always );7566 }7567 function propfilter( props, specialeasing ) {7568 var index, name, easing, value, hooks;7569 // camelcase, specialeasing and expand csshook pass7570 for ( index in props ) {7571 name = jquery.camelcase( index );7572 easing = specialeasing[ name ];7573 value = props[ index ];7574 if ( jquery.isarray( value ) ) {7575 easing = value[ 1 ];7576 value = props[ index ] = value[ 0 ];7577 }7578 if ( index !== name ) {7579 props[ name ] = value;7580 delete props[ index ];7581 }7582 hooks = jquery.csshooks[ name ];7583 if ( hooks && "expand" in hooks ) {7584 value = hooks.expand( value );7585 delete props[ name ];7586 // not quite $.extend, this wont overwrite keys already present.7587 // also - reusing 'index' from above because we have the correct "name"7588 for ( index in value ) {7589 if ( !( index in props ) ) {7590 props[ index ] = value[ index ];7591 specialeasing[ index ] = easing;7592 }7593 }7594 } else {7595 specialeasing[ name ] = easing;7596 }7597 }7598 }7599 jquery.animation = jquery.extend( animation, {7600 tweener: function( props, callback ) {7601 if ( jquery.isfunction( props ) ) {7602 callback = props;7603 props = [ "*" ];7604 } else {7605 props = props.split(" ");7606 }7607 var prop,7608 index = 0,7609 length = props.length;7610 for ( ; index < length ; index++ ) {7611 prop = props[ index ];7612 tweeners[ prop ] = tweeners[ prop ] || [];7613 tweeners[ prop ].unshift( callback );7614 }7615 },7616 prefilter: function( callback, prepend ) {7617 if ( prepend ) {7618 animationprefilters.unshift( callback );7619 } else {7620 animationprefilters.push( callback );7621 }7622 }7623 });7624 function defaultprefilter( elem, props, opts ) {7625 /* jshint validthis: true */7626 var prop, value, toggle, tween, hooks, oldfire,7627 anim = this,7628 orig = {},7629 style = elem.style,7630 hidden = elem.nodetype && ishidden( elem ),7631 datashow = jquery._data( elem, "fxshow" );7632 // handle queue: false promises7633 if ( !opts.queue ) {7634 hooks = jquery._queuehooks( elem, "fx" );7635 if ( hooks.unqueued == null ) {7636 hooks.unqueued = 0;7637 oldfire = hooks.empty.fire;7638 hooks.empty.fire = function() {7639 if ( !hooks.unqueued ) {7640 oldfire();7641 }7642 };7643 }7644 hooks.unqueued++;7645 anim.always(function() {7646 // doing this makes sure that the complete handler will be called7647 // before this completes7648 anim.always(function() {7649 hooks.unqueued--;7650 if ( !jquery.queue( elem, "fx" ).length ) {7651 hooks.empty.fire();7652 }7653 });7654 });7655 }7656 // height/width overflow pass7657 if ( elem.nodetype === 1 && ( "height" in props || "width" in props ) ) {7658 // make sure that nothing sneaks out7659 // record all 3 overflow attributes because ie does not7660 // change the overflow attribute when overflowx and7661 // overflowy are set to the same value7662 opts.overflow = [ style.overflow, style.overflowx, style.overflowy ];7663 // set display property to inline-block for height/width7664 // animations on inline elements that are having width/height animated7665 if ( jquery.css( elem, "display" ) === "inline" &&7666 jquery.css( elem, "float" ) === "none" ) {7667 // inline-level elements accept inline-block;7668 // block-level elements need to be inline with layout7669 if ( !jquery.support.inlineblockneedslayout || css_defaultdisplay( elem.nodename ) === "inline" ) {7670 style.display = "inline-block";7671 } else {7672 style.zoom = 1;7673 }7674 }7675 }7676 if ( opts.overflow ) {7677 style.overflow = "hidden";7678 if ( !jquery.support.shrinkwrapblocks ) {7679 anim.always(function() {7680 style.overflow = opts.overflow[ 0 ];7681 style.overflowx = opts.overflow[ 1 ];7682 style.overflowy = opts.overflow[ 2 ];7683 });7684 }7685 }7686 // show/hide pass7687 for ( prop in props ) {7688 value = props[ prop ];7689 if ( rfxtypes.exec( value ) ) {7690 delete props[ prop ];7691 toggle = toggle || value === "toggle";7692 if ( value === ( hidden ? "hide" : "show" ) ) {7693 continue;7694 }7695 orig[ prop ] = datashow && datashow[ prop ] || jquery.style( elem, prop );7696 }7697 }7698 if ( !jquery.isemptyobject( orig ) ) {7699 if ( datashow ) {7700 if ( "hidden" in datashow ) {7701 hidden = datashow.hidden;7702 }7703 } else {7704 datashow = jquery._data( elem, "fxshow", {} );7705 }7706 // store state if its toggle - enables .stop().toggle() to "reverse"7707 if ( toggle ) {7708 datashow.hidden = !hidden;7709 }7710 if ( hidden ) {7711 jquery( elem ).show();7712 } else {7713 anim.done(function() {7714 jquery( elem ).hide();7715 });7716 }7717 anim.done(function() {7718 var prop;7719 jquery._removedata( elem, "fxshow" );7720 for ( prop in orig ) {7721 jquery.style( elem, prop, orig[ prop ] );7722 }7723 });7724 for ( prop in orig ) {7725 tween = createtween( hidden ? datashow[ prop ] : 0, prop, anim );7726 if ( !( prop in datashow ) ) {7727 datashow[ prop ] = tween.start;7728 if ( hidden ) {7729 tween.end = tween.start;7730 tween.start = prop === "width" || prop === "height" ? 1 : 0;7731 }7732 }7733 }7734 }7735 }7736 function tween( elem, options, prop, end, easing ) {7737 return new tween.prototype.init( elem, options, prop, end, easing );7738 }7739 jquery.tween = tween;7740 tween.prototype = {7741 constructor: tween,7742 init: function( elem, options, prop, end, easing, unit ) {7743 this.elem = elem;7744 this.prop = prop;7745 this.easing = easing || "swing";7746 this.options = options;7747 this.start = this.now = this.cur();7748 this.end = end;7749 this.unit = unit || ( jquery.cssnumber[ prop ] ? "" : "px" );7750 },7751 cur: function() {7752 var hooks = tween.prophooks[ this.prop ];7753 return hooks && hooks.get ?7754 hooks.get( this ) :7755 tween.prophooks._default.get( this );7756 },7757 run: function( percent ) {7758 var eased,7759 hooks = tween.prophooks[ this.prop ];7760 if ( this.options.duration ) {7761 this.pos = eased = jquery.easing[ this.easing ](7762 percent, this.options.duration * percent, 0, 1, this.options.duration7763 );7764 } else {7765 this.pos = eased = percent;7766 }7767 this.now = ( this.end - this.start ) * eased + this.start;7768 if ( this.options.step ) {7769 this.options.step.call( this.elem, this.now, this );7770 }7771 if ( hooks && hooks.set ) {7772 hooks.set( this );7773 } else {7774 tween.prophooks._default.set( this );7775 }7776 return this;7777 }7778 };7779 tween.prototype.init.prototype = tween.prototype;7780 tween.prophooks = {7781 _default: {7782 get: function( tween ) {7783 var result;7784 if ( tween.elem[ tween.prop ] != null &&7785 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {7786 return tween.elem[ tween.prop ];7787 }7788 // passing an empty string as a 3rd parameter to .css will automatically7789 // attempt a parsefloat and fallback to a string if the parse fails7790 // so, simple values such as "10px" are parsed to float.7791 // complex values such as "rotate(1rad)" are returned as is.7792 result = jquery.css( tween.elem, tween.prop, "" );7793 // empty strings, null, undefined and "auto" are converted to 0.7794 return !result || result === "auto" ? 0 : result;7795 },7796 set: function( tween ) {7797 // use step hook for back compat - use csshook if its there - use .style if its7798 // available and use plain properties where available7799 if ( jquery.fx.step[ tween.prop ] ) {7800 jquery.fx.step[ tween.prop ]( tween );7801 } else if ( tween.elem.style && ( tween.elem.style[ jquery.cssprops[ tween.prop ] ] != null || jquery.csshooks[ tween.prop ] ) ) {7802 jquery.style( tween.elem, tween.prop, tween.now + tween.unit );7803 } else {7804 tween.elem[ tween.prop ] = tween.now;7805 }7806 }7807 }7808 };7809// support: ie <=97810// panic based approach to setting things on disconnected nodes7811 tween.prophooks.scrolltop = tween.prophooks.scrollleft = {7812 set: function( tween ) {7813 if ( tween.elem.nodetype && tween.elem.parentnode ) {7814 tween.elem[ tween.prop ] = tween.now;7815 }7816 }7817 };7818 jquery.each([ "toggle", "show", "hide" ], function( i, name ) {7819 var cssfn = jquery.fn[ name ];7820 jquery.fn[ name ] = function( speed, easing, callback ) {7821 return speed == null || typeof speed === "boolean" ?7822 cssfn.apply( this, arguments ) :7823 this.animate( genfx( name, true ), speed, easing, callback );7824 };7825 });7826 jquery.fn.extend({7827 fadeto: function( speed, to, easing, callback ) {7828 // show any hidden elements after setting opacity to 07829 return this.filter( ishidden ).css( "opacity", 0 ).show()7830 // animate to the value specified7831 .end().animate({ opacity: to }, speed, easing, callback );7832 },7833 animate: function( prop, speed, easing, callback ) {7834 var empty = jquery.isemptyobject( prop ),7835 optall = jquery.speed( speed, easing, callback ),7836 doanimation = function() {7837 // operate on a copy of prop so per-property easing won't be lost7838 var anim = animation( this, jquery.extend( {}, prop ), optall );7839 // empty animations, or finishing resolves immediately7840 if ( empty || jquery._data( this, "finish" ) ) {7841 anim.stop( true );7842 }7843 };7844 doanimation.finish = doanimation;7845 return empty || optall.queue === false ?7846 this.each( doanimation ) :7847 this.queue( optall.queue, doanimation );7848 },7849 stop: function( type, clearqueue, gotoend ) {7850 var stopqueue = function( hooks ) {7851 var stop = hooks.stop;7852 delete hooks.stop;7853 stop( gotoend );7854 };7855 if ( typeof type !== "string" ) {7856 gotoend = clearqueue;7857 clearqueue = type;7858 type = undefined;7859 }7860 if ( clearqueue && type !== false ) {7861 this.queue( type || "fx", [] );7862 }7863 return this.each(function() {7864 var dequeue = true,7865 index = type != null && type + "queuehooks",7866 timers = jquery.timers,7867 data = jquery._data( this );7868 if ( index ) {7869 if ( data[ index ] && data[ index ].stop ) {7870 stopqueue( data[ index ] );7871 }7872 } else {7873 for ( index in data ) {7874 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {7875 stopqueue( data[ index ] );7876 }7877 }7878 }7879 for ( index = timers.length; index--; ) {7880 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {7881 timers[ index ].anim.stop( gotoend );7882 dequeue = false;7883 timers.splice( index, 1 );7884 }7885 }7886 // start the next in the queue if the last step wasn't forced7887 // timers currently will call their complete callbacks, which will dequeue7888 // but only if they were gotoend7889 if ( dequeue || !gotoend ) {7890 jquery.dequeue( this, type );7891 }7892 });7893 },7894 finish: function( type ) {7895 if ( type !== false ) {7896 type = type || "fx";7897 }7898 return this.each(function() {7899 var index,7900 data = jquery._data( this ),7901 queue = data[ type + "queue" ],7902 hooks = data[ type + "queuehooks" ],7903 timers = jquery.timers,7904 length = queue ? queue.length : 0;7905 // enable finishing flag on private data7906 data.finish = true;7907 // empty the queue first7908 jquery.queue( this, type, [] );7909 if ( hooks && hooks.stop ) {7910 hooks.stop.call( this, true );7911 }7912 // look for any active animations, and finish them7913 for ( index = timers.length; index--; ) {7914 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {7915 timers[ index ].anim.stop( true );7916 timers.splice( index, 1 );7917 }7918 }7919 // look for any animations in the old queue and finish them7920 for ( index = 0; index < length; index++ ) {7921 if ( queue[ index ] && queue[ index ].finish ) {7922 queue[ index ].finish.call( this );7923 }7924 }7925 // turn off finishing flag7926 delete data.finish;7927 });7928 }7929 });7930// generate parameters to create a standard animation7931 function genfx( type, includewidth ) {7932 var which,7933 attrs = { height: type },7934 i = 0;7935 // if we include width, step value is 1 to do all cssexpand values,7936 // if we don't include width, step value is 2 to skip over left and right7937 includewidth = includewidth? 1 : 0;7938 for( ; i < 4 ; i += 2 - includewidth ) {7939 which = cssexpand[ i ];7940 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;7941 }7942 if ( includewidth ) {7943 attrs.opacity = attrs.width = type;7944 }7945 return attrs;7946 }7947// generate shortcuts for custom animations7948 jquery.each({7949 slidedown: genfx("show"),7950 slideup: genfx("hide"),7951 slidetoggle: genfx("toggle"),7952 fadein: { opacity: "show" },7953 fadeout: { opacity: "hide" },7954 fadetoggle: { opacity: "toggle" }7955 }, function( name, props ) {7956 jquery.fn[ name ] = function( speed, easing, callback ) {7957 return this.animate( props, speed, easing, callback );7958 };7959 });7960 jquery.speed = function( speed, easing, fn ) {7961 var opt = speed && typeof speed === "object" ? jquery.extend( {}, speed ) : {7962 complete: fn || !fn && easing ||7963 jquery.isfunction( speed ) && speed,7964 duration: speed,7965 easing: fn && easing || easing && !jquery.isfunction( easing ) && easing7966 };7967 opt.duration = jquery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :7968 opt.duration in jquery.fx.speeds ? jquery.fx.speeds[ opt.duration ] : jquery.fx.speeds._default;7969 // normalize opt.queue - true/undefined/null -> "fx"7970 if ( opt.queue == null || opt.queue === true ) {7971 opt.queue = "fx";7972 }7973 // queueing7974 opt.old = opt.complete;7975 opt.complete = function() {7976 if ( jquery.isfunction( opt.old ) ) {7977 opt.old.call( this );7978 }7979 if ( opt.queue ) {7980 jquery.dequeue( this, opt.queue );7981 }7982 };7983 return opt;7984 };7985 jquery.easing = {7986 linear: function( p ) {7987 return p;7988 },7989 swing: function( p ) {7990 return 0.5 - math.cos( p*math.pi ) / 2;7991 }7992 };7993 jquery.timers = [];7994 jquery.fx = tween.prototype.init;7995 jquery.fx.tick = function() {7996 var timer,7997 timers = jquery.timers,7998 i = 0;7999 fxnow = jquery.now();8000 for ( ; i < timers.length; i++ ) {8001 timer = timers[ i ];8002 // checks the timer has not already been removed8003 if ( !timer() && timers[ i ] === timer ) {8004 timers.splice( i--, 1 );8005 }8006 }8007 if ( !timers.length ) {8008 jquery.fx.stop();8009 }8010 fxnow = undefined;8011 };8012 jquery.fx.timer = function( timer ) {8013 if ( timer() && jquery.timers.push( timer ) ) {8014 jquery.fx.start();8015 }8016 };8017 jquery.fx.interval = 13;8018 jquery.fx.start = function() {8019 if ( !timerid ) {8020 timerid = setinterval( jquery.fx.tick, jquery.fx.interval );8021 }8022 };8023 jquery.fx.stop = function() {8024 clearinterval( timerid );8025 timerid = null;8026 };8027 jquery.fx.speeds = {8028 slow: 600,8029 fast: 200,8030 // default speed8031 _default: 4008032 };8033// back compat <1.8 extension point8034 jquery.fx.step = {};8035 if ( jquery.expr && jquery.expr.filters ) {8036 jquery.expr.filters.animated = function( elem ) {8037 return jquery.grep(jquery.timers, function( fn ) {8038 return elem === fn.elem;8039 }).length;8040 };8041 }8042 jquery.fn.offset = function( options ) {8043 if ( arguments.length ) {8044 return options === undefined ?8045 this :8046 this.each(function( i ) {8047 jquery.offset.setoffset( this, options, i );8048 });8049 }8050 var docelem, win,8051 box = { top: 0, left: 0 },8052 elem = this[ 0 ],8053 doc = elem && elem.ownerdocument;8054 if ( !doc ) {8055 return;8056 }8057 docelem = doc.documentelement;8058 // make sure it's not a disconnected dom node8059 if ( !jquery.contains( docelem, elem ) ) {8060 return box;8061 }8062 // if we don't have gbcr, just use 0,0 rather than error8063 // blackberry 5, ios 3 (original iphone)8064 if ( typeof elem.getboundingclientrect !== core_strundefined ) {8065 box = elem.getboundingclientrect();8066 }8067 win = getwindow( doc );8068 return {8069 top: box.top + ( win.pageyoffset || docelem.scrolltop ) - ( docelem.clienttop || 0 ),8070 left: box.left + ( win.pagexoffset || docelem.scrollleft ) - ( docelem.clientleft || 0 )8071 };8072 };8073 jquery.offset = {8074 setoffset: function( elem, options, i ) {8075 var position = jquery.css( elem, "position" );8076 // set position first, in-case top/left are set even on static elem8077 if ( position === "static" ) {8078 elem.style.position = "relative";8079 }8080 var curelem = jquery( elem ),8081 curoffset = curelem.offset(),8082 curcsstop = jquery.css( elem, "top" ),8083 curcssleft = jquery.css( elem, "left" ),8084 calculateposition = ( position === "absolute" || position === "fixed" ) && jquery.inarray("auto", [curcsstop, curcssleft]) > -1,8085 props = {}, curposition = {}, curtop, curleft;8086 // need to be able to calculate position if either top or left is auto and position is either absolute or fixed8087 if ( calculateposition ) {8088 curposition = curelem.position();8089 curtop = curposition.top;8090 curleft = curposition.left;8091 } else {8092 curtop = parsefloat( curcsstop ) || 0;8093 curleft = parsefloat( curcssleft ) || 0;8094 }8095 if ( jquery.isfunction( options ) ) {8096 options = options.call( elem, i, curoffset );8097 }8098 if ( options.top != null ) {8099 props.top = ( options.top - curoffset.top ) + curtop;8100 }8101 if ( options.left != null ) {8102 props.left = ( options.left - curoffset.left ) + curleft;8103 }8104 if ( "using" in options ) {8105 options.using.call( elem, props );8106 } else {8107 curelem.css( props );8108 }8109 }8110 };8111 jquery.fn.extend({8112 position: function() {8113 if ( !this[ 0 ] ) {8114 return;8115 }8116 var offsetparent, offset,8117 parentoffset = { top: 0, left: 0 },8118 elem = this[ 0 ];8119 // fixed elements are offset from window (parentoffset = {top:0, left: 0}, because it is it's only offset parent8120 if ( jquery.css( elem, "position" ) === "fixed" ) {8121 // we assume that getboundingclientrect is available when computed position is fixed8122 offset = elem.getboundingclientrect();8123 } else {8124 // get *real* offsetparent8125 offsetparent = this.offsetparent();8126 // get correct offsets8127 offset = this.offset();8128 if ( !jquery.nodename( offsetparent[ 0 ], "html" ) ) {8129 parentoffset = offsetparent.offset();8130 }8131 // add offsetparent borders8132 parentoffset.top += jquery.css( offsetparent[ 0 ], "bordertopwidth", true );8133 parentoffset.left += jquery.css( offsetparent[ 0 ], "borderleftwidth", true );8134 }8135 // subtract parent offsets and element margins8136 // note: when an element has margin: auto the offsetleft and marginleft8137 // are the same in safari causing offset.left to incorrectly be 08138 return {8139 top: offset.top - parentoffset.top - jquery.css( elem, "margintop", true ),8140 left: offset.left - parentoffset.left - jquery.css( elem, "marginleft", true)8141 };8142 },8143 offsetparent: function() {8144 return this.map(function() {8145 var offsetparent = this.offsetparent || docelem;8146 while ( offsetparent && ( !jquery.nodename( offsetparent, "html" ) && jquery.css( offsetparent, "position") === "static" ) ) {8147 offsetparent = offsetparent.offsetparent;8148 }8149 return offsetparent || docelem;8150 });8151 }8152 });8153// create scrollleft and scrolltop methods8154 jquery.each( {scrollleft: "pagexoffset", scrolltop: "pageyoffset"}, function( method, prop ) {8155 var top = /y/.test( prop );8156 jquery.fn[ method ] = function( val ) {8157 return jquery.access( this, function( elem, method, val ) {8158 var win = getwindow( elem );8159 if ( val === undefined ) {8160 return win ? (prop in win) ? win[ prop ] :8161 win.document.documentelement[ method ] :8162 elem[ method ];8163 }8164 if ( win ) {8165 win.scrollto(8166 !top ? val : jquery( win ).scrollleft(),8167 top ? val : jquery( win ).scrolltop()8168 );8169 } else {8170 elem[ method ] = val;8171 }8172 }, method, val, arguments.length, null );8173 };8174 });8175 function getwindow( elem ) {8176 return jquery.iswindow( elem ) ?8177 elem :8178 elem.nodetype === 9 ?8179 elem.defaultview || elem.parentwindow :8180 false;8181 }8182// create innerheight, innerwidth, height, width, outerheight and outerwidth methods8183 jquery.each( { height: "height", width: "width" }, function( name, type ) {8184 jquery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultextra, funcname ) {8185 // margin is only for outerheight, outerwidth8186 jquery.fn[ funcname ] = function( margin, value ) {8187 var chainable = arguments.length && ( defaultextra || typeof margin !== "boolean" ),8188 extra = defaultextra || ( margin === true || value === true ? "margin" : "border" );8189 return jquery.access( this, function( elem, type, value ) {8190 var doc;8191 if ( jquery.iswindow( elem ) ) {8192 // as of 5/8/2012 this will yield incorrect results for mobile safari, but there8193 // isn't a whole lot we can do. see pull request at this url for discussion:8194 // https://github.com/jquery/jquery/pull/7648195 return elem.document.documentelement[ "client" + name ];8196 }8197 // get document width or height8198 if ( elem.nodetype === 9 ) {8199 doc = elem.documentelement;8200 // either scroll[width/height] or offset[width/height] or client[width/height], whichever is greatest8201 // unfortunately, this causes bug #3838 in ie6/8 only, but there is currently no good, small way to fix it.8202 return math.max(8203 elem.body[ "scroll" + name ], doc[ "scroll" + name ],8204 elem.body[ "offset" + name ], doc[ "offset" + name ],8205 doc[ "client" + name ]8206 );8207 }8208 return value === undefined ?8209 // get width or height on the element, requesting but not forcing parsefloat8210 jquery.css( elem, type, extra ) :8211 // set width or height on the element8212 jquery.style( elem, type, value, extra );8213 }, type, chainable ? margin : undefined, chainable, null );8214 };8215 });8216 });8217// limit scope pollution from any deprecated api8218// (function() {8219// the number of elements contained in the matched element set8220 jquery.fn.size = function() {8221 return this.length;8222 };8223 jquery.fn.andself = jquery.fn.addback;8224// })();8225 if ( typeof module === "object" && module && typeof module.exports === "object" ) {8226 // expose jquery as module.exports in loaders that implement the node8227 // module pattern (including browserify). do not create the global, since8228 // the user will be storing it themselves locally, and globals are frowned8229 // upon in the node module world.8230 module.exports = jquery;8231 } else {8232 // otherwise expose jquery to the global object as usual8233 window.jquery = window.$ = jquery;8234 // register as a named amd module, since jquery can be concatenated with other8235 // files that may use define, but not via a proper concatenation script that8236 // understands anonymous amd modules. a named amd is safest and most robust8237 // way to register. lowercase jquery is used because amd module names are8238 // derived from file names, and jquery is normally delivered in a lowercase8239 // file name. do this after creating the global so that if an amd module wants8240 // to call noconflict to hide this version of jquery, it will work.8241 if ( typeof define === "function" && define.amd ) {8242 define( "jquery", [], function () { return jquery; } );8243 }8244 }...
jquery-1.11.0.js
Source:jquery-1.11.0.js
...450 * @param {String} type451 */452 function createInputPseudo(type) {453 return function (elem) {454 var name = elem.nodeName.toLowerCase();455 return name === "input" && elem.type === type;456 };457 }458 /**459 * Returns a function to use in pseudos for buttons460 * @param {String} type461 */462 function createButtonPseudo(type) {463 return function (elem) {464 var name = elem.nodeName.toLowerCase();465 return (name === "input" || name === "button") && elem.type === type;466 };467 }468 /**469 * Returns a function to use in pseudos for positionals470 * @param {Function} fn471 */472 function createPositionalPseudo(fn) {473 return markFunction(function (argument) {474 argument = +argument;475 return markFunction(function (seed, matches) {476 var j,477 matchIndexes = fn([], seed.length, argument),478 i = matchIndexes.length;479 // Match elements found at the specified indexes480 while (i--) {481 if (seed[ (j = matchIndexes[i]) ]) {482 seed[j] = !(matches[j] = seed[j]);483 }484 }485 });486 });487 }488 /**489 * Checks a node for validity as a Sizzle context490 * @param {Element|Object=} context491 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value492 */493 function testContext(context) {494 return context && typeof context.getElementsByTagName !== strundefined && context;495 }496// Expose support vars for convenience497 support = Sizzle.support = {};498 /**499 * Detects XML nodes500 * @param {Element|Object} elem An element or a document501 * @returns {Boolean} True iff elem is a non-HTML XML node502 */503 isXML = Sizzle.isXML = function (elem) {504 // documentElement is verified for cases where it doesn't yet exist505 // (such as loading iframes in IE - #4833)506 var documentElement = elem && (elem.ownerDocument || elem).documentElement;507 return documentElement ? documentElement.nodeName !== "HTML" : false;508 };509 /**510 * Sets document-related variables once based on the current document511 * @param {Element|Object} [doc] An element or document object to use to set the document512 * @returns {Object} Returns the current document513 */514 setDocument = Sizzle.setDocument = function (node) {515 var hasCompare,516 doc = node ? node.ownerDocument || node : preferredDoc,517 parent = doc.defaultView;518 // If no document and documentElement is available, return519 if (doc === document || doc.nodeType !== 9 || !doc.documentElement) {520 return document;521 }522 // Set our document523 document = doc;524 docElem = doc.documentElement;525 // Support tests526 documentIsHTML = !isXML(doc);527 // Support: IE>8528 // If iframe document is assigned to "document" variable and if iframe has been reloaded,529 // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936530 // IE6-8 do not support the defaultView property so parent will be undefined531 if (parent && parent !== parent.top) {532 // IE11 does not have attachEvent, so all must suffer533 if (parent.addEventListener) {534 parent.addEventListener("unload", function () {535 setDocument();536 }, false);537 } else if (parent.attachEvent) {538 parent.attachEvent("onunload", function () {539 setDocument();540 });541 }542 }543 /* Attributes544 ---------------------------------------------------------------------- */545 // Support: IE<8 1="" 4="" 7="" 8="" 9="" 16="" 2011="" 12359="" 13378="" verify="" that="" getattribute="" really="" returns="" attributes="" and="" not="" properties="" (excepting="" ie8="" booleans)="" support.attributes="assert(function" (div)="" {="" div.classname="i" ;="" return="" !div.getattribute("classname");="" });="" *="" getelement(s)by*="" ----------------------------------------------------------------------="" check="" if="" getelementsbytagname("*")="" only="" elements="" support.getelementsbytagname="assert(function" div.appendchild(doc.createcomment(""));="" !div.getelementsbytagname("*").length;="" getelementsbyclassname="" can="" be="" trusted="" support.getelementsbyclassname="rnative.test(doc.getElementsByClassName)" &&="" assert(function="" div.innerhtml="<div class='a'></div><div class='a i'></div>" support:="" safari<4="" catch="" class="" over-caching="" div.firstchild.classname="i" opera<10="" gebcn="" failure="" to="" find="" non-leading="" classes="" div.getelementsbyclassname("i").length="==" 2;="" ie<10="" getelementbyid="" by="" name="" the="" broken="" methods="" don't="" pick="" up="" programatically-set="" names,="" so="" use="" a="" roundabout="" getelementsbyname="" test="" support.getbyid="assert(function" docelem.appendchild(div).id="expando;" !doc.getelementsbyname="" ||="" !doc.getelementsbyname(expando).length;="" id="" filter="" (support.getbyid)="" expr.find["id"]="function" (id,="" context)="" (typeof="" context.getelementbyid="" !="=" strundefined="" documentishtml)="" var="" m="context.getElementById(id);" parentnode="" when="" blackberry="" 4.6="" nodes="" are="" no="" longer="" in="" document="" #6963="" m.parentnode="" ?="" [m]="" :="" [];="" }="" };="" expr.filter["id"]="function" (id)="" attrid="id.replace(runescape," funescape);="" function="" (elem)="" elem.getattribute("id")="==" attrid;="" else="" ie6="" is="" reliable="" as="" shortcut="" delete="" expr.find["id"];="" node="typeof" elem.getattributenode="" elem.getattributenode("id");="" node.value="==" tag="" expr.find["tag"]="support.getElementsByTagName" (tag,="" context.getelementsbytagname="" strundefined)="" context.getelementsbytagname(tag);="" elem,="" tmp="[]," i="0," results="context.getElementsByTagName(tag);" out="" possible="" comments="" (tag="==" "*")="" while="" ((elem="results[i++]))" (elem.nodetype="==" 1)="" tmp.push(elem);="" tmp;="" results;="" expr.find["class"]="support.getElementsByClassName" (classname,="" context.getelementsbyclassname="" context.getelementsbyclassname(classname);="" qsa="" matchesselector="" support="" matchesselector(:active)="" reports="" false="" true="" (ie9="" opera="" 11.5)="" rbuggymatches="[];" qsa(:focus)="" (chrome="" 21)="" we="" allow="" this="" because="" of="" bug="" throws="" an="" error="" whenever="" `document.activeelement`="" accessed="" on="" iframe="" so,="" :focus="" pass="" through="" all="" time="" avoid="" ie="" see="" http:="" bugs.jquery.com="" ticket="" rbuggyqsa="[];" ((support.qsa="rnative.test(doc.querySelectorAll)))" build="" regex="" strategy="" adopted="" from="" diego="" perini="" select="" set="" empty="" string="" purpose="" ie's="" treatment="" explicitly="" setting="" boolean="" content="" attribute,="" since="" its="" presence="" should="" enough="" ie8,="" 10-12="" nothing="" selected strings="" follow="" ^="or" $="or" (div.queryselectorall("[t^="" ]").length)="" rbuggyqsa.push("[*^$]=" + whitespace + " *(?:''|\"\")");="" "value"="" treated="" correctly="" (!div.queryselectorall("[selected]").length)="" rbuggyqsa.push("\\["="" +="" whitespace="" "*(?:value|"="" booleans="" ")");="" webkit="" -="" :checked="" option="" www.w3.org="" tr="" rec-css3-selectors-20110929="" #checked="" here="" will="" later="" tests="" (!div.queryselectorall(":checked").length)="" rbuggyqsa.push(":checked");="" windows="" native="" apps="" type="" restricted="" during="" .innerhtml="" assignment="" input="doc.createElement("input");" input.setattribute("type",="" "hidden");="" div.appendchild(input).setattribute("name",="" "d");="" enforce="" case-sensitivity="" attribute="" (div.queryselectorall("[name="d]").length)" rbuggyqsa.push("name"="" "*[*^$|!~]?=");546 }547 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)548 // IE8 throws error here and will not see later tests549 if (!div.querySelectorAll(" :enabled").length)="" rbuggyqsa.push(":enabled",="" ":disabled");="" 10-11="" does="" throw="" post-comma="" invalid="" pseudos="" div.queryselectorall("*,:x");="" rbuggyqsa.push(",.*:");="" ((support.matchesselector="rnative.test((matches" =="" docelem.webkitmatchesselector="" docelem.mozmatchesselector="" docelem.omatchesselector="" docelem.msmatchesselector))))="" it's="" do="" disconnected="" (ie="" 9)="" support.disconnectedmatch="matches.call(div," "div");="" fail="" with="" exception="" gecko="" error,="" instead="" matches.call(div,="" "[s!="" ]:x");="" rbuggymatches.push("!=", pseudos);550 });551 }552 rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join(" |"));="" new="" regexp(rbuggymatches.join("|"));="" contains="" hascompare="rnative.test(docElem.compareDocumentPosition);" element="" another="" purposefully="" implement="" inclusive="" descendent="" in,="" contain="" itself="" rnative.test(docelem.contains)="" (a,="" b)="" adown="a.nodeType" a.documentelement="" a,="" bup="b" b.parentnode;="" !!(="" bup.nodetype="==" (="" adown.contains="" adown.contains(bup)="" a.comparedocumentposition="" a.comparedocumentposition(bup)="" &="" ));="" (b)="" ((b="b.parentNode))" (b="==" a)="" true;="" false;="" sorting="" order="" sortorder="hasCompare" flag="" for="" duplicate="" removal="" (a="==" hasduplicate="true;" 0;="" sort="" method="" existence="" one="" has="" comparedocumentposition="" compare="!a.compareDocumentPosition" !b.comparedocumentposition;="" (compare)="" compare;="" calculate="" position="" both="" inputs="" belong="" same="" a.ownerdocument="" )="==" b.ownerdocument="" b="" a.comparedocumentposition(b)="" otherwise="" know="" they="" 1;="" (compare="" (!support.sortdetached="" b.comparedocumentposition(a)="==" compare))="" choose="" first="" related="" our="" preferred="" doc="" preferreddoc="" contains(preferreddoc,="" a))="" -1;="" b))="" maintain="" original="" sortinput="" indexof.call(sortinput,="" -1="" exit="" early="" identical="" cur,="" aup="a.parentNode," ap="[" ],="" bp="[" ];="" parentless="" either="" documents="" or="" (!aup="" !bup)="" siblings,="" quick="" (aup="==" bup)="" siblingcheck(a,="" b);="" need="" full="" lists="" their="" ancestors="" comparison="" cur="a;" ((cur="cur.parentNode))" ap.unshift(cur);="" bp.unshift(cur);="" walk="" down="" tree="" looking="" discrepancy="" (ap[i]="==" bp[i])="" i++;="" sibling="" have="" common="" ancestor="" siblingcheck(ap[i],="" ap[i]="==" bp[i]="==" doc;="" sizzle.matches="function" (expr,="" elements)="" sizzle(expr,="" null,="" elements);="" sizzle.matchesselector="function" (elem,="" expr)="" vars="" needed="" ((="" elem.ownerdocument="" elem="" document)="" setdocument(elem);="" make="" sure="" selectors="" quoted="" expr="expr.replace(rattributeQuotes," "="$1" ]");="" (support.matchesselector="" documentishtml="" !rbuggymatches="" !rbuggymatches.test(expr)="" !rbuggyqsa="" !rbuggyqsa.test(expr)="" ))="" try="" ret="matches.call(elem," expr);="" 9's="" (ret="" well,="" said="" fragment="" elem.document="" elem.document.nodetype="" 11)="" ret;="" (e)="" document,="" [elem]).length=""> 0;553 };554 Sizzle.contains = function (context, elem) {555 // Set document vars if needed556 if (( context.ownerDocument || context ) !== document) {557 setDocument(context);558 }559 return contains(context, elem);560 };561 Sizzle.attr = function (elem, name) {562 // Set document vars if needed563 if (( elem.ownerDocument || elem ) !== document) {564 setDocument(elem);565 }566 var fn = Expr.attrHandle[ name.toLowerCase() ],567 // Don't get fooled by Object.prototype properties (jQuery #13807)568 val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ?569 fn(elem, name, !documentIsHTML) :570 undefined;571 return val !== undefined ?572 val :573 support.attributes || !documentIsHTML ?574 elem.getAttribute(name) :575 (val = elem.getAttributeNode(name)) && val.specified ?576 val.value :577 null;578 };579 Sizzle.error = function (msg) {580 throw new Error("Syntax error, unrecognized expression: " + msg);581 };582 /**583 * Document sorting and removing duplicates584 * @param {ArrayLike} results585 */586 Sizzle.uniqueSort = function (results) {587 var elem,588 duplicates = [],589 j = 0,590 i = 0;591 // Unless we *know* we can detect duplicates, assume their presence592 hasDuplicate = !support.detectDuplicates;593 sortInput = !support.sortStable && results.slice(0);594 results.sort(sortOrder);595 if (hasDuplicate) {596 while ((elem = results[i++])) {597 if (elem === results[ i ]) {598 j = duplicates.push(i);599 }600 }601 while (j--) {602 results.splice(duplicates[ j ], 1);603 }604 }605 // Clear input after sorting to release objects606 // See https://github.com/jquery/sizzle/pull/225607 sortInput = null;608 return results;609 };610 /**611 * Utility function for retrieving the text value of an array of DOM nodes612 * @param {Array|Element} elem613 */614 getText = Sizzle.getText = function (elem) {615 var node,616 ret = "",617 i = 0,618 nodeType = elem.nodeType;619 if (!nodeType) {620 // If no nodeType, this is expected to be an array621 while ((node = elem[i++])) {622 // Do not traverse comment nodes623 ret += getText(node);624 }625 } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {626 // Use textContent for elements627 // innerText usage removed for consistency of new lines (jQuery #11153)628 if (typeof elem.textContent === "string") {629 return elem.textContent;630 } else {631 // Traverse its children632 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {633 ret += getText(elem);634 }635 }636 } else if (nodeType === 3 || nodeType === 4) {637 return elem.nodeValue;638 }639 // Do not include comment or processing instruction nodes640 return ret;641 };642 Expr = Sizzle.selectors = {643 // Can be adjusted by the user644 cacheLength: 50,645 createPseudo: markFunction,646 match: matchExpr,647 attrHandle: {},648 find: {},649 relative: {650 ">": { dir: "parentNode", first: true },651 " ": { dir: "parentNode" },652 "+": { dir: "previousSibling", first: true },653 "~": { dir: "previousSibling" }654 },655 preFilter: {656 "ATTR": function (match) {657 match[1] = match[1].replace(runescape, funescape);658 // Move the given value to match[3] whether quoted or unquoted659 match[3] = ( match[4] || match[5] || "" ).replace(runescape, funescape);660 if (match[2] === "~=") {661 match[3] = " " + match[3] + " ";662 }663 return match.slice(0, 4);664 },665 "CHILD": function (match) {666 /* matches from matchExpr["CHILD"]667 1 type (only|nth|...)668 2 what (child|of-type)669 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)670 4 xn-component of xn+y argument ([+-]?\d*n|)671 5 sign of xn-component672 6 x of xn-component673 7 sign of y-component674 8 y of y-component675 */676 match[1] = match[1].toLowerCase();677 if (match[1].slice(0, 3) === "nth") {678 // nth-* requires argument679 if (!match[3]) {680 Sizzle.error(match[0]);681 }682 // numeric x and y parameters for Expr.filter.CHILD683 // remember that false/true cast respectively to 0/1684 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );685 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );686 // other types prohibit arguments687 } else if (match[3]) {688 Sizzle.error(match[0]);689 }690 return match;691 },692 "PSEUDO": function (match) {693 var excess,694 unquoted = !match[5] && match[2];695 if (matchExpr["CHILD"].test(match[0])) {696 return null;697 }698 // Accept quoted arguments as-is699 if (match[3] && match[4] !== undefined) {700 match[2] = match[4];701 // Strip excess characters from unquoted arguments702 } else if (unquoted && rpseudo.test(unquoted) &&703 // Get excess from tokenize (recursively)704 (excess = tokenize(unquoted, true)) &&705 // advance to the next closing parenthesis706 (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {707 // excess is a negative index708 match[0] = match[0].slice(0, excess);709 match[2] = unquoted.slice(0, excess);710 }711 // Return only captures needed by the pseudo filter method (type and argument)712 return match.slice(0, 3);713 }714 },715 filter: {716 "TAG": function (nodeNameSelector) {717 var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();718 return nodeNameSelector === "*" ?719 function () {720 return true;721 } :722 function (elem) {723 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;724 };725 },726 "CLASS": function (className) {727 var pattern = classCache[ className + " " ];728 return pattern ||729 (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) &&730 classCache(className, function (elem) {731 return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "");732 });733 },734 "ATTR": function (name, operator, check) {735 return function (elem) {736 var result = Sizzle.attr(elem, name);737 if (result == null) {738 return operator === "!=";739 }740 if (!operator) {741 return true;742 }743 result += "";744 return operator === "=" ? result === check :745 operator === "!=" ? result !== check :746 operator === "^=" ? check && result.indexOf(check) === 0 :747 operator === "*=" ? check && result.indexOf(check) > -1 :748 operator === "$=" ? check && result.slice(-check.length) === check :749 operator === "~=" ? ( " " + result + " " ).indexOf(check) > -1 :750 operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" :751 false;752 };753 },754 "CHILD": function (type, what, argument, first, last) {755 var simple = type.slice(0, 3) !== "nth",756 forward = type.slice(-4) !== "last",757 ofType = what === "of-type";758 return first === 1 && last === 0 ?759 // Shortcut for :nth-*(n)760 function (elem) {761 return !!elem.parentNode;762 } :763 function (elem, context, xml) {764 var cache, outerCache, node, diff, nodeIndex, start,765 dir = simple !== forward ? "nextSibling" : "previousSibling",766 parent = elem.parentNode,767 name = ofType && elem.nodeName.toLowerCase(),768 useCache = !xml && !ofType;769 if (parent) {770 // :(first|last|only)-(child|of-type)771 if (simple) {772 while (dir) {773 node = elem;774 while ((node = node[ dir ])) {775 if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {776 return false;777 }778 }779 // Reverse direction for :only-* (if we haven't yet done so)780 start = dir = type === "only" && !start && "nextSibling";781 }782 return true;783 }784 start = [ forward ? parent.firstChild : parent.lastChild ];785 // non-xml :nth-child(...) stores cache data on `parent`786 if (forward && useCache) {787 // Seek `elem` from a previously-cached index788 outerCache = parent[ expando ] || (parent[ expando ] = {});789 cache = outerCache[ type ] || [];790 nodeIndex = cache[0] === dirruns && cache[1];791 diff = cache[0] === dirruns && cache[2];792 node = nodeIndex && parent.childNodes[ nodeIndex ];793 while ((node = ++nodeIndex && node && node[ dir ] ||794 // Fallback to seeking `elem` from the start795 (diff = nodeIndex = 0) || start.pop())) {796 // When found, cache indexes on `parent` and break797 if (node.nodeType === 1 && ++diff && node === elem) {798 outerCache[ type ] = [ dirruns, nodeIndex, diff ];799 break;800 }801 }802 // Use previously-cached element index if available803 } else if (useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns) {804 diff = cache[1];805 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)806 } else {807 // Use the same loop as above to seek `elem` from the start808 while ((node = ++nodeIndex && node && node[ dir ] ||809 (diff = nodeIndex = 0) || start.pop())) {810 if (( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff) {811 // Cache the index of each encountered element812 if (useCache) {813 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];814 }815 if (node === elem) {816 break;817 }818 }819 }820 }821 // Incorporate the offset, then check against cycle size822 diff -= last;823 return diff === first || ( diff % first === 0 && diff / first >= 0 );824 }825 };826 },827 "PSEUDO": function (pseudo, argument) {828 // pseudo-class names are case-insensitive829 // http://www.w3.org/TR/selectors/#pseudo-classes830 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters831 // Remember that setFilters inherits from pseudos832 var args,833 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||834 Sizzle.error("unsupported pseudo: " + pseudo);835 // The user may use createPseudo to indicate that836 // arguments are needed to create the filter function837 // just as Sizzle does838 if (fn[ expando ]) {839 return fn(argument);840 }841 // But maintain support for old signatures842 if (fn.length > 1) {843 args = [ pseudo, pseudo, "", argument ];844 return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ?845 markFunction(function (seed, matches) {846 var idx,847 matched = fn(seed, argument),848 i = matched.length;849 while (i--) {850 idx = indexOf.call(seed, matched[i]);851 seed[ idx ] = !( matches[ idx ] = matched[i] );852 }853 }) :854 function (elem) {855 return fn(elem, 0, args);856 };857 }858 return fn;859 }860 },861 pseudos: {862 // Potentially complex pseudos863 "not": markFunction(function (selector) {864 // Trim the selector passed to compile865 // to avoid treating leading and trailing866 // spaces as combinators867 var input = [],868 results = [],869 matcher = compile(selector.replace(rtrim, "$1"));870 return matcher[ expando ] ?871 markFunction(function (seed, matches, context, xml) {872 var elem,873 unmatched = matcher(seed, null, xml, []),874 i = seed.length;875 // Match elements unmatched by `matcher`876 while (i--) {877 if ((elem = unmatched[i])) {878 seed[i] = !(matches[i] = elem);879 }880 }881 }) :882 function (elem, context, xml) {883 input[0] = elem;884 matcher(input, null, xml, results);885 return !results.pop();886 };887 }),888 "has": markFunction(function (selector) {889 return function (elem) {890 return Sizzle(selector, elem).length > 0;891 };892 }),893 "contains": markFunction(function (text) {894 return function (elem) {895 return ( elem.textContent || elem.innerText || getText(elem) ).indexOf(text) > -1;896 };897 }),898 // "Whether an element is represented by a :lang() selector899 // is based solely on the element's language value900 // being equal to the identifier C,901 // or beginning with the identifier C immediately followed by "-".902 // The matching of C against the element's language value is performed case-insensitively.903 // The identifier C does not have to be a valid language name."904 // http://www.w3.org/TR/selectors/#lang-pseudo905 "lang": markFunction(function (lang) {906 // lang value must be a valid identifier907 if (!ridentifier.test(lang || "")) {908 Sizzle.error("unsupported lang: " + lang);909 }910 lang = lang.replace(runescape, funescape).toLowerCase();911 return function (elem) {912 var elemLang;913 do {914 if ((elemLang = documentIsHTML ?915 elem.lang :916 elem.getAttribute("xml:lang") || elem.getAttribute("lang"))) {917 elemLang = elemLang.toLowerCase();918 return elemLang === lang || elemLang.indexOf(lang + "-") === 0;919 }920 } while ((elem = elem.parentNode) && elem.nodeType === 1);921 return false;922 };923 }),924 // Miscellaneous925 "target": function (elem) {926 var hash = window.location && window.location.hash;927 return hash && hash.slice(1) === elem.id;928 },929 "root": function (elem) {930 return elem === docElem;931 },932 "focus": function (elem) {933 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);934 },935 // Boolean properties936 "enabled": function (elem) {937 return elem.disabled === false;938 },939 "disabled": function (elem) {940 return elem.disabled === true;941 },942 "checked": function (elem) {943 // In CSS3, :checked should return both checked and selected elements944 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked945 var nodeName = elem.nodeName.toLowerCase();946 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);947 },948 "selected": function (elem) {949 // Accessing this property makes selected-by-default950 // options in Safari work properly951 if (elem.parentNode) {952 elem.parentNode.selectedIndex;953 }954 return elem.selected === true;955 },956 // Contents957 "empty": function (elem) {958 // http://www.w3.org/TR/selectors/#empty-pseudo959 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),960 // but not by others (comment: 8; processing instruction: 7; etc.)961 // nodeType < 6 works because attributes (2) do not appear as children962 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {963 if (elem.nodeType < 6) {964 return false;965 }966 }967 return true;968 },969 "parent": function (elem) {970 return !Expr.pseudos["empty"](elem);971 },972 // Element/input types973 "header": function (elem) {974 return rheader.test(elem.nodeName);975 },976 "input": function (elem) {977 return rinputs.test(elem.nodeName);978 },979 "button": function (elem) {980 var name = elem.nodeName.toLowerCase();981 return name === "input" && elem.type === "button" || name === "button";982 },983 "text": function (elem) {984 var attr;985 return elem.nodeName.toLowerCase() === "input" &&986 elem.type === "text" &&987 // Support: IE<8 0="" 1="" new="" html5="" attribute="" values="" (e.g.,="" "search")="" appear="" with="" elem.type="==" "text"="" (="" (attr="elem.getAttribute("type"))" =="null" ||="" attr.tolowercase()="==" );="" },="" position-in-collection="" "first":="" createpositionalpseudo(function="" ()="" {="" return="" [="" ];="" }),="" "last":="" (matchindexes,="" length)="" length="" -="" "eq":="" length,="" argument)="" argument="" <="" ?="" +="" :="" "even":="" var="" i="0;" for="" (;="" length;="" matchindexes.push(i);="" }="" matchindexes;="" "odd":="" "lt":="" argument;="" --i="">= 0;) {988 matchIndexes.push(i);989 }990 return matchIndexes;991 }),992 "gt": createPositionalPseudo(function (matchIndexes, length, argument) {993 var i = argument < 0 ? argument + length : argument;994 for (; ++i < length;) {995 matchIndexes.push(i);996 }997 return matchIndexes;998 })999 }1000 };1001 Expr.pseudos["nth"] = Expr.pseudos["eq"];1002// Add button/input type pseudos1003 for (i in { radio: true, checkbox: true, file: true, password: true, image: true }) {1004 Expr.pseudos[ i ] = createInputPseudo(i);1005 }1006 for (i in { submit: true, reset: true }) {1007 Expr.pseudos[ i ] = createButtonPseudo(i);1008 }1009// Easy API for creating new setFilters1010 function setFilters() {1011 }1012 setFilters.prototype = Expr.filters = Expr.pseudos;1013 Expr.setFilters = new setFilters();1014 function tokenize(selector, parseOnly) {1015 var matched, match, tokens, type,1016 soFar, groups, preFilters,1017 cached = tokenCache[ selector + " " ];1018 if (cached) {1019 return parseOnly ? 0 : cached.slice(0);1020 }1021 soFar = selector;1022 groups = [];1023 preFilters = Expr.preFilter;1024 while (soFar) {1025 // Comma and first run1026 if (!matched || (match = rcomma.exec(soFar))) {1027 if (match) {1028 // Don't consume trailing commas as valid1029 soFar = soFar.slice(match[0].length) || soFar;1030 }1031 groups.push((tokens = []));1032 }1033 matched = false;1034 // Combinators1035 if ((match = rcombinators.exec(soFar))) {1036 matched = match.shift();1037 tokens.push({1038 value: matched,1039 // Cast descendant combinators to space1040 type: match[0].replace(rtrim, " ")1041 });1042 soFar = soFar.slice(matched.length);1043 }1044 // Filters1045 for (type in Expr.filter) {1046 if ((match = matchExpr[ type ].exec(soFar)) && (!preFilters[ type ] ||1047 (match = preFilters[ type ](match)))) {1048 matched = match.shift();1049 tokens.push({1050 value: matched,1051 type: type,1052 matches: match1053 });1054 soFar = soFar.slice(matched.length);1055 }1056 }1057 if (!matched) {1058 break;1059 }1060 }1061 // Return the length of the invalid excess1062 // if we're just parsing1063 // Otherwise, throw an error or return tokens1064 return parseOnly ?1065 soFar.length :1066 soFar ?1067 Sizzle.error(selector) :1068 // Cache the tokens1069 tokenCache(selector, groups).slice(0);1070 }1071 function toSelector(tokens) {1072 var i = 0,1073 len = tokens.length,1074 selector = "";1075 for (; i < len; i++) {1076 selector += tokens[i].value;1077 }1078 return selector;1079 }1080 function addCombinator(matcher, combinator, base) {1081 var dir = combinator.dir,1082 checkNonElements = base && dir === "parentNode",1083 doneName = done++;1084 return combinator.first ?1085 // Check against closest ancestor/preceding element1086 function (elem, context, xml) {1087 while ((elem = elem[ dir ])) {1088 if (elem.nodeType === 1 || checkNonElements) {1089 return matcher(elem, context, xml);1090 }1091 }1092 } :1093 // Check against all ancestor/preceding elements1094 function (elem, context, xml) {1095 var oldCache, outerCache,1096 newCache = [ dirruns, doneName ];1097 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching1098 if (xml) {1099 while ((elem = elem[ dir ])) {1100 if (elem.nodeType === 1 || checkNonElements) {1101 if (matcher(elem, context, xml)) {1102 return true;1103 }1104 }1105 }1106 } else {1107 while ((elem = elem[ dir ])) {1108 if (elem.nodeType === 1 || checkNonElements) {1109 outerCache = elem[ expando ] || (elem[ expando ] = {});1110 if ((oldCache = outerCache[ dir ]) &&1111 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName) {1112 // Assign to newCache so results back-propagate to previous elements1113 return (newCache[ 2 ] = oldCache[ 2 ]);1114 } else {1115 // Reuse newcache so results back-propagate to previous elements1116 outerCache[ dir ] = newCache;1117 // A match means we're done; a fail means we have to keep checking1118 if ((newCache[ 2 ] = matcher(elem, context, xml))) {1119 return true;1120 }1121 }1122 }1123 }1124 }1125 };1126 }1127 function elementMatcher(matchers) {1128 return matchers.length > 1 ?1129 function (elem, context, xml) {1130 var i = matchers.length;1131 while (i--) {1132 if (!matchers[i](elem, context, xml)) {1133 return false;1134 }1135 }1136 return true;1137 } :1138 matchers[0];1139 }1140 function condense(unmatched, map, filter, context, xml) {1141 var elem,1142 newUnmatched = [],1143 i = 0,1144 len = unmatched.length,1145 mapped = map != null;1146 for (; i < len; i++) {1147 if ((elem = unmatched[i])) {1148 if (!filter || filter(elem, context, xml)) {1149 newUnmatched.push(elem);1150 if (mapped) {1151 map.push(i);1152 }1153 }1154 }1155 }1156 return newUnmatched;1157 }1158 function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {1159 if (postFilter && !postFilter[ expando ]) {1160 postFilter = setMatcher(postFilter);1161 }1162 if (postFinder && !postFinder[ expando ]) {1163 postFinder = setMatcher(postFinder, postSelector);1164 }1165 return markFunction(function (seed, results, context, xml) {1166 var temp, i, elem,1167 preMap = [],1168 postMap = [],1169 preexisting = results.length,1170 // Get initial elements from seed or context1171 elems = seed || multipleContexts(selector || "*", context.nodeType ? [ context ] : context, []),1172 // Prefilter to get matcher input, preserving a map for seed-results synchronization1173 matcherIn = preFilter && ( seed || !selector ) ?1174 condense(elems, preMap, preFilter, context, xml) :1175 elems,1176 matcherOut = matcher ?1177 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,1178 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?1179 // ...intermediate processing is necessary1180 [] :1181 // ...otherwise use results directly1182 results :1183 matcherIn;1184 // Find primary matches1185 if (matcher) {1186 matcher(matcherIn, matcherOut, context, xml);1187 }1188 // Apply postFilter1189 if (postFilter) {1190 temp = condense(matcherOut, postMap);1191 postFilter(temp, [], context, xml);1192 // Un-match failing elements by moving them back to matcherIn1193 i = temp.length;1194 while (i--) {1195 if ((elem = temp[i])) {1196 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);1197 }1198 }1199 }1200 if (seed) {1201 if (postFinder || preFilter) {1202 if (postFinder) {1203 // Get the final matcherOut by condensing this intermediate into postFinder contexts1204 temp = [];1205 i = matcherOut.length;1206 while (i--) {1207 if ((elem = matcherOut[i])) {1208 // Restore matcherIn since elem is not yet a final match1209 temp.push((matcherIn[i] = elem));1210 }1211 }1212 postFinder(null, (matcherOut = []), temp, xml);1213 }1214 // Move matched elements from seed to results to keep them synchronized1215 i = matcherOut.length;1216 while (i--) {1217 if ((elem = matcherOut[i]) &&1218 (temp = postFinder ? indexOf.call(seed, elem) : preMap[i]) > -1) {1219 seed[temp] = !(results[temp] = elem);1220 }1221 }1222 }1223 // Add elements to results, through postFinder if defined1224 } else {1225 matcherOut = condense(1226 matcherOut === results ?1227 matcherOut.splice(preexisting, matcherOut.length) :1228 matcherOut1229 );1230 if (postFinder) {1231 postFinder(null, results, matcherOut, xml);1232 } else {1233 push.apply(results, matcherOut);1234 }1235 }1236 });1237 }1238 function matcherFromTokens(tokens) {1239 var checkContext, matcher, j,1240 len = tokens.length,1241 leadingRelative = Expr.relative[ tokens[0].type ],1242 implicitRelative = leadingRelative || Expr.relative[" "],1243 i = leadingRelative ? 1 : 0,1244 // The foundational matcher ensures that elements are reachable from top-level context(s)1245 matchContext = addCombinator(function (elem) {1246 return elem === checkContext;1247 }, implicitRelative, true),1248 matchAnyContext = addCombinator(function (elem) {1249 return indexOf.call(checkContext, elem) > -1;1250 }, implicitRelative, true),1251 matchers = [ function (elem, context, xml) {1252 return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (1253 (checkContext = context).nodeType ?1254 matchContext(elem, context, xml) :1255 matchAnyContext(elem, context, xml) );1256 } ];1257 for (; i < len; i++) {1258 if ((matcher = Expr.relative[ tokens[i].type ])) {1259 matchers = [ addCombinator(elementMatcher(matchers), matcher) ];1260 } else {1261 matcher = Expr.filter[ tokens[i].type ].apply(null, tokens[i].matches);1262 // Return special upon seeing a positional matcher1263 if (matcher[ expando ]) {1264 // Find the next relative operator (if any) for proper handling1265 j = ++i;1266 for (; j < len; j++) {1267 if (Expr.relative[ tokens[j].type ]) {1268 break;1269 }1270 }1271 return setMatcher(1272 i > 1 && elementMatcher(matchers),1273 i > 1 && toSelector(1274 // If the preceding token was a descendant combinator, insert an implicit any-element `*`1275 tokens.slice(0, i - 1).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })1276 ).replace(rtrim, "$1"),1277 matcher,1278 i < j && matcherFromTokens(tokens.slice(i, j)),1279 j < len && matcherFromTokens((tokens = tokens.slice(j))),1280 j < len && toSelector(tokens)1281 );1282 }1283 matchers.push(matcher);1284 }1285 }1286 return elementMatcher(matchers);1287 }1288 function matcherFromGroupMatchers(elementMatchers, setMatchers) {1289 var bySet = setMatchers.length > 0,1290 byElement = elementMatchers.length > 0,1291 superMatcher = function (seed, context, xml, results, outermost) {1292 var elem, j, matcher,1293 matchedCount = 0,1294 i = "0",1295 unmatched = seed && [],1296 setMatched = [],1297 contextBackup = outermostContext,1298 // We must always have either seed elements or outermost context1299 elems = seed || byElement && Expr.find["TAG"]("*", outermost),1300 // Use integer dirruns iff this is the outermost matcher1301 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),1302 len = elems.length;1303 if (outermost) {1304 outermostContext = context !== document && context;1305 }1306 // Add elements passing elementMatchers directly to results1307 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below1308 // Support: IE<9, safari="" tolerate="" nodelist="" properties="" (ie:="" "length";="" safari:="" <number="">) matching elements by id1309 for (; i !== len && (elem = elems[i]) != null; i++) {1310 if (byElement && elem) {1311 j = 0;1312 while ((matcher = elementMatchers[j++])) {1313 if (matcher(elem, context, xml)) {1314 results.push(elem);1315 break;1316 }1317 }1318 if (outermost) {1319 dirruns = dirrunsUnique;1320 }1321 }1322 // Track unmatched elements for set filters1323 if (bySet) {1324 // They will have gone through all possible matchers1325 if ((elem = !matcher && elem)) {1326 matchedCount--;1327 }1328 // Lengthen the array for every element, matched or not1329 if (seed) {1330 unmatched.push(elem);1331 }1332 }1333 }1334 // Apply set filters to unmatched elements1335 matchedCount += i;1336 if (bySet && i !== matchedCount) {1337 j = 0;1338 while ((matcher = setMatchers[j++])) {1339 matcher(unmatched, setMatched, context, xml);1340 }1341 if (seed) {1342 // Reintegrate element matches to eliminate the need for sorting1343 if (matchedCount > 0) {1344 while (i--) {1345 if (!(unmatched[i] || setMatched[i])) {1346 setMatched[i] = pop.call(results);1347 }1348 }1349 }1350 // Discard index placeholder values to get only actual matches1351 setMatched = condense(setMatched);1352 }1353 // Add matches to results1354 push.apply(results, setMatched);1355 // Seedless set matches succeeding multiple successful matchers stipulate sorting1356 if (outermost && !seed && setMatched.length > 0 &&1357 ( matchedCount + setMatchers.length ) > 1) {1358 Sizzle.uniqueSort(results);1359 }1360 }1361 // Override manipulation of globals by nested matchers1362 if (outermost) {1363 dirruns = dirrunsUnique;1364 outermostContext = contextBackup;1365 }1366 return unmatched;1367 };1368 return bySet ?1369 markFunction(superMatcher) :1370 superMatcher;1371 }1372 compile = Sizzle.compile = function (selector, group /* Internal Use Only */) {1373 var i,1374 setMatchers = [],1375 elementMatchers = [],1376 cached = compilerCache[ selector + " " ];1377 if (!cached) {1378 // Generate a function of recursive functions that can be used to check each element1379 if (!group) {1380 group = tokenize(selector);1381 }1382 i = group.length;1383 while (i--) {1384 cached = matcherFromTokens(group[i]);1385 if (cached[ expando ]) {1386 setMatchers.push(cached);1387 } else {1388 elementMatchers.push(cached);1389 }1390 }1391 // Cache the compiled function1392 cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));1393 }1394 return cached;1395 };1396 function multipleContexts(selector, contexts, results) {1397 var i = 0,1398 len = contexts.length;1399 for (; i < len; i++) {1400 Sizzle(selector, contexts[i], results);1401 }1402 return results;1403 }1404 function select(selector, context, results, seed) {1405 var i, tokens, token, type, find,1406 match = tokenize(selector);1407 if (!seed) {1408 // Try to minimize operations if there is only one group1409 if (match.length === 1) {1410 // Take a shortcut and set the context if the root selector is an ID1411 tokens = match[0] = match[0].slice(0);1412 if (tokens.length > 2 && (token = tokens[0]).type === "ID" &&1413 support.getById && context.nodeType === 9 && documentIsHTML &&1414 Expr.relative[ tokens[1].type ]) {1415 context = ( Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [] )[0];1416 if (!context) {1417 return results;1418 }1419 selector = selector.slice(tokens.shift().value.length);1420 }1421 // Fetch a seed set for right-to-left matching1422 i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;1423 while (i--) {1424 token = tokens[i];1425 // Abort if we hit a combinator1426 if (Expr.relative[ (type = token.type) ]) {1427 break;1428 }1429 if ((find = Expr.find[ type ])) {1430 // Search, expanding context for leading sibling combinators1431 if ((seed = find(1432 token.matches[0].replace(runescape, funescape),1433 rsibling.test(tokens[0].type) && testContext(context.parentNode) || context1434 ))) {1435 // If seed is empty or no tokens remain, we can return early1436 tokens.splice(i, 1);1437 selector = seed.length && toSelector(tokens);1438 if (!selector) {1439 push.apply(results, seed);1440 return results;1441 }1442 break;1443 }1444 }1445 }1446 }1447 }1448 // Compile and execute a filtering function1449 // Provide `match` to avoid retokenization if we modified the selector above1450 compile(selector, match)(1451 seed,1452 context,1453 !documentIsHTML,1454 results,1455 rsibling.test(selector) && testContext(context.parentNode) || context1456 );1457 return results;1458 }1459// One-time assignments1460// Sort stability1461 support.sortStable = expando.split("").sort(sortOrder).join("") === expando;1462// Support: Chrome<14 1="" 4="" 25="" always="" assume="" duplicates="" if="" they="" aren't="" passed="" to="" the="" comparison="" function="" support.detectduplicates="!!hasDuplicate;" initialize="" against="" default document="" setdocument();="" support:="" webkit<537.32="" -="" safari="" 6.0.3="" chrome="" (fixed="" in="" 27)="" detached="" nodes="" confoundingly="" follow="" *each="" other*="" support.sortdetached="assert(function" (div1)="" {="" should="" return="" 1,="" but="" returns="" (following)="" div1.comparedocumentposition(document.createelement("div"))="" &="" 1;="" });="" ie<8="" prevent="" attribute="" property="" "interpolation"="" http:="" msdn.microsoft.com="" en-us="" library="" ms536429%28vs.85%29.aspx="" (!assert(function="" (div)="" div.innerhtml="<a href='#'></a>" ;="" div.firstchild.getattribute("href")="==" "#";="" }))="" addhandle("type|href|height|width",="" (elem,="" name,="" isxml)="" (!isxml)="" elem.getattribute(name,="" name.tolowercase()="==" "type"="" ?="" :="" 2);="" }="" ie<9="" use="" defaultvalue="" place="" of="" getattribute("value")="" (!support.attributes="" ||="" !assert(function="" div.firstchild.setattribute("value",="" "");="" div.firstchild.getattribute("value")="==" "";="" addhandle("value",="" (!isxml="" &&="" elem.nodename.tolowercase()="==" "input")="" elem.defaultvalue;="" getattributenode="" fetch="" booleans="" when="" getattribute="" lies="" div.getattribute("disabled")="=" null;="" addhandle(booleans,="" var="" val;="" elem[="" name="" ]="==" true="" (val="elem.getAttributeNode(name))" val.specified="" val.value="" sizzle;="" })(window);="" jquery.find="Sizzle;" jquery.expr="Sizzle.selectors;" jquery.expr[":"]="jQuery.expr.pseudos;" jquery.unique="Sizzle.uniqueSort;" jquery.text="Sizzle.getText;" jquery.isxmldoc="Sizzle.isXML;" jquery.contains="Sizzle.contains;" rneedscontext="jQuery.expr.match.needsContext;" rsingletag="(/^<(\w+)\s*\/?">(?:<\ \1="">|)$/);1463 var risSimple = /^.[^:#\[\.,]*$/;1464// Implement the identical functionality for filter and not1465 function winnow(elements, qualifier, not) {1466 if (jQuery.isFunction(qualifier)) {1467 return jQuery.grep(elements, function (elem, i) {1468 /* jshint -W018 */1469 return !!qualifier.call(elem, i, elem) !== not;1470 });1471 }1472 if (qualifier.nodeType) {1473 return jQuery.grep(elements, function (elem) {1474 return ( elem === qualifier ) !== not;1475 });1476 }1477 if (typeof qualifier === "string") {1478 if (risSimple.test(qualifier)) {1479 return jQuery.filter(qualifier, elements, not);1480 }1481 qualifier = jQuery.filter(qualifier, elements);1482 }1483 return jQuery.grep(elements, function (elem) {1484 return ( jQuery.inArray(elem, qualifier) >= 0 ) !== not;1485 });1486 }1487 jQuery.filter = function (expr, elems, not) {1488 var elem = elems[ 0 ];1489 if (not) {1490 expr = ":not(" + expr + ")";1491 }1492 return elems.length === 1 && elem.nodeType === 1 ?1493 jQuery.find.matchesSelector(elem, expr) ? [ elem ] : [] :1494 jQuery.find.matches(expr, jQuery.grep(elems, function (elem) {1495 return elem.nodeType === 1;1496 }));1497 };1498 jQuery.fn.extend({1499 find: function (selector) {1500 var i,1501 ret = [],1502 self = this,1503 len = self.length;1504 if (typeof selector !== "string") {1505 return this.pushStack(jQuery(selector).filter(function () {1506 for (i = 0; i < len; i++) {1507 if (jQuery.contains(self[ i ], this)) {1508 return true;1509 }1510 }1511 }));1512 }1513 for (i = 0; i < len; i++) {1514 jQuery.find(selector, self[ i ], ret);1515 }1516 // Needed because $( selector, context ) becomes $( context ).find( selector )1517 ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret);1518 ret.selector = this.selector ? this.selector + " " + selector : selector;1519 return ret;1520 },1521 filter: function (selector) {1522 return this.pushStack(winnow(this, selector || [], false));1523 },1524 not: function (selector) {1525 return this.pushStack(winnow(this, selector || [], true));1526 },1527 is: function (selector) {1528 return !!winnow(1529 this,1530 // If this is a positional/relative selector, check membership in the returned set1531 // so $("p:first").is("p:last") won't return true for a doc with two "p".1532 typeof selector === "string" && rneedsContext.test(selector) ?1533 jQuery(selector) :1534 selector || [],1535 false1536 ).length;1537 }1538 });1539// Initialize a jQuery object1540// A central reference to the root jQuery(document)1541 var rootjQuery,1542 // Use the correct document accordingly with window argument (sandbox)1543 document = window.document,1544 // A simple way to check for HTML strings1545 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)1546 // Strict HTML recognition (#11290: must start with <) rquickexpr="/^(?:\s*(<[\w\W]+">)[^>]*|#([\w-]*))$/,1547 init = jQuery.fn.init = function (selector, context) {1548 var match, elem;1549 // HANDLE: $(""), $(null), $(undefined), $(false)1550 if (!selector) {1551 return this;1552 }1553 // Handle HTML strings1554 if (typeof selector === "string") {1555 if (selector.charAt(0) === "<" &&="" selector.charat(selector.length="" -="" 1)="==" "="">" && selector.length >= 3) {1556 // Assume that strings that start and end with <> are HTML and skip the regex check1557 match = [ null, selector, null ];1558 } else {1559 match = rquickExpr.exec(selector);1560 }1561 // Match html or make sure no context is specified for #id1562 if (match && (match[1] || !context)) {1563 // HANDLE: $(html) -> $(array)1564 if (match[1]) {1565 context = context instanceof jQuery ? context[0] : context;1566 // scripts is true for back-compat1567 // Intentionally let the error be thrown if parseHTML is not present1568 jQuery.merge(this, jQuery.parseHTML(1569 match[1],1570 context && context.nodeType ? context.ownerDocument || context : document,1571 true1572 ));1573 // HANDLE: $(html, props)1574 if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {1575 for (match in context) {1576 // Properties of context are called as methods if possible1577 if (jQuery.isFunction(this[ match ])) {1578 this[ match ](context[ match ]);1579 // ...and otherwise set as attributes1580 } else {1581 this.attr(match, context[ match ]);1582 }1583 }1584 }1585 return this;1586 // HANDLE: $(#id)1587 } else {1588 elem = document.getElementById(match[2]);1589 // Check parentNode to catch when Blackberry 4.6 returns1590 // nodes that are no longer in the document #69631591 if (elem && elem.parentNode) {1592 // Handle the case where IE and Opera return items1593 // by name instead of ID1594 if (elem.id !== match[2]) {1595 return rootjQuery.find(selector);1596 }1597 // Otherwise, we inject the element directly into the jQuery object1598 this.length = 1;1599 this[0] = elem;1600 }1601 this.context = document;1602 this.selector = selector;1603 return this;1604 }1605 // HANDLE: $(expr, $(...))1606 } else if (!context || context.jquery) {1607 return ( context || rootjQuery ).find(selector);1608 // HANDLE: $(expr, context)1609 // (which is just equivalent to: $(context).find(expr)1610 } else {1611 return this.constructor(context).find(selector);1612 }1613 // HANDLE: $(DOMElement)1614 } else if (selector.nodeType) {1615 this.context = this[0] = selector;1616 this.length = 1;1617 return this;1618 // HANDLE: $(function)1619 // Shortcut for document ready1620 } else if (jQuery.isFunction(selector)) {1621 return typeof rootjQuery.ready !== "undefined" ?1622 rootjQuery.ready(selector) :1623 // Execute immediately if ready is not present1624 selector(jQuery);1625 }1626 if (selector.selector !== undefined) {1627 this.selector = selector.selector;1628 this.context = selector.context;1629 }1630 return jQuery.makeArray(selector, this);1631 };1632// Give the init function the jQuery prototype for later instantiation1633 init.prototype = jQuery.fn;1634// Initialize central reference1635 rootjQuery = jQuery(document);1636 var rparentsprev = /^(?:parents|prev(?:Until|All))/,1637 // methods guaranteed to produce a unique set when starting from a unique set1638 guaranteedUnique = {1639 children: true,1640 contents: true,1641 next: true,1642 prev: true1643 };1644 jQuery.extend({1645 dir: function (elem, dir, until) {1646 var matched = [],1647 cur = elem[ dir ];1648 while (cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery(cur).is(until))) {1649 if (cur.nodeType === 1) {1650 matched.push(cur);1651 }1652 cur = cur[dir];1653 }1654 return matched;1655 },1656 sibling: function (n, elem) {1657 var r = [];1658 for (; n; n = n.nextSibling) {1659 if (n.nodeType === 1 && n !== elem) {1660 r.push(n);1661 }1662 }1663 return r;1664 }1665 });1666 jQuery.fn.extend({1667 has: function (target) {1668 var i,1669 targets = jQuery(target, this),1670 len = targets.length;1671 return this.filter(function () {1672 for (i = 0; i < len; i++) {1673 if (jQuery.contains(this, targets[i])) {1674 return true;1675 }1676 }1677 });1678 },1679 closest: function (selectors, context) {1680 var cur,1681 i = 0,1682 l = this.length,1683 matched = [],1684 pos = rneedsContext.test(selectors) || typeof selectors !== "string" ?1685 jQuery(selectors, context || this.context) :1686 0;1687 for (; i < l; i++) {1688 for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {1689 // Always skip document fragments1690 if (cur.nodeType < 11 && (pos ?1691 pos.index(cur) > -1 :1692 // Don't pass non-elements to Sizzle1693 cur.nodeType === 1 &&1694 jQuery.find.matchesSelector(cur, selectors))) {1695 matched.push(cur);1696 break;1697 }1698 }1699 }1700 return this.pushStack(matched.length > 1 ? jQuery.unique(matched) : matched);1701 },1702 // Determine the position of an element within1703 // the matched set of elements1704 index: function (elem) {1705 // No argument, return index in parent1706 if (!elem) {1707 return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;1708 }1709 // index in selector1710 if (typeof elem === "string") {1711 return jQuery.inArray(this[0], jQuery(elem));1712 }1713 // Locate the position of the desired element1714 return jQuery.inArray(1715 // If it receives a jQuery object, the first element is used1716 elem.jquery ? elem[0] : elem, this);1717 },1718 add: function (selector, context) {1719 return this.pushStack(1720 jQuery.unique(1721 jQuery.merge(this.get(), jQuery(selector, context))1722 )1723 );1724 },1725 addBack: function (selector) {1726 return this.add(selector == null ?1727 this.prevObject : this.prevObject.filter(selector)1728 );1729 }1730 });1731 function sibling(cur, dir) {1732 do {1733 cur = cur[ dir ];1734 } while (cur && cur.nodeType !== 1);1735 return cur;1736 }1737 jQuery.each({1738 parent: function (elem) {1739 var parent = elem.parentNode;1740 return parent && parent.nodeType !== 11 ? parent : null;1741 },1742 parents: function (elem) {1743 return jQuery.dir(elem, "parentNode");1744 },1745 parentsUntil: function (elem, i, until) {1746 return jQuery.dir(elem, "parentNode", until);1747 },1748 next: function (elem) {1749 return sibling(elem, "nextSibling");1750 },1751 prev: function (elem) {1752 return sibling(elem, "previousSibling");1753 },1754 nextAll: function (elem) {1755 return jQuery.dir(elem, "nextSibling");1756 },1757 prevAll: function (elem) {1758 return jQuery.dir(elem, "previousSibling");1759 },1760 nextUntil: function (elem, i, until) {1761 return jQuery.dir(elem, "nextSibling", until);1762 },1763 prevUntil: function (elem, i, until) {1764 return jQuery.dir(elem, "previousSibling", until);1765 },1766 siblings: function (elem) {1767 return jQuery.sibling(( elem.parentNode || {} ).firstChild, elem);1768 },1769 children: function (elem) {1770 return jQuery.sibling(elem.firstChild);1771 },1772 contents: function (elem) {1773 return jQuery.nodeName(elem, "iframe") ?1774 elem.contentDocument || elem.contentWindow.document :1775 jQuery.merge([], elem.childNodes);1776 }1777 }, function (name, fn) {1778 jQuery.fn[ name ] = function (until, selector) {1779 var ret = jQuery.map(this, fn, until);1780 if (name.slice(-5) !== "Until") {1781 selector = until;1782 }1783 if (selector && typeof selector === "string") {1784 ret = jQuery.filter(selector, ret);1785 }1786 if (this.length > 1) {1787 // Remove duplicates1788 if (!guaranteedUnique[ name ]) {1789 ret = jQuery.unique(ret);1790 }1791 // Reverse order for parents* and prev-derivatives1792 if (rparentsprev.test(name)) {1793 ret = ret.reverse();1794 }1795 }1796 return this.pushStack(ret);1797 };1798 });1799 var rnotwhite = (/\S+/g);1800// String to Object options format cache1801 var optionsCache = {};1802// Convert String-formatted options into Object-formatted ones and store in cache1803 function createOptions(options) {1804 var object = optionsCache[ options ] = {};1805 jQuery.each(options.match(rnotwhite) || [], function (_, flag) {1806 object[ flag ] = true;1807 });1808 return object;1809 }1810 /*1811 * Create a callback list using the following parameters:1812 *1813 * options: an optional list of space-separated options that will change how1814 * the callback list behaves or a more traditional option object1815 *1816 * By default a callback list will act like an event callback list and can be1817 * "fired" multiple times.1818 *1819 * Possible options:1820 *1821 * once: will ensure the callback list can only be fired once (like a Deferred)1822 *1823 * memory: will keep track of previous values and will call any callback added1824 * after the list has been fired right away with the latest "memorized"1825 * values (like a Deferred)1826 *1827 * unique: will ensure a callback can only be added once (no duplicate in the list)1828 *1829 * stopOnFalse: interrupt callings when a callback returns false1830 *1831 */1832 jQuery.Callbacks = function (options) {1833 // Convert options from String-formatted to Object-formatted if needed1834 // (we check in cache first)1835 options = typeof options === "string" ?1836 ( optionsCache[ options ] || createOptions(options) ) :1837 jQuery.extend({}, options);1838 var // Flag to know if list is currently firing1839 firing,1840 // Last fire value (for non-forgettable lists)1841 memory,1842 // Flag to know if list was already fired1843 fired,1844 // End of the loop when firing1845 firingLength,1846 // Index of currently firing callback (modified by remove if needed)1847 firingIndex,1848 // First callback to fire (used internally by add and fireWith)1849 firingStart,1850 // Actual callback list1851 list = [],1852 // Stack of fire calls for repeatable lists1853 stack = !options.once && [],1854 // Fire callbacks1855 fire = function (data) {1856 memory = options.memory && data;1857 fired = true;1858 firingIndex = firingStart || 0;1859 firingStart = 0;1860 firingLength = list.length;1861 firing = true;1862 for (; list && firingIndex < firingLength; firingIndex++) {1863 if (list[ firingIndex ].apply(data[ 0 ], data[ 1 ]) === false && options.stopOnFalse) {1864 memory = false; // To prevent further calls using add1865 break;1866 }1867 }1868 firing = false;1869 if (list) {1870 if (stack) {1871 if (stack.length) {1872 fire(stack.shift());1873 }1874 } else if (memory) {1875 list = [];1876 } else {1877 self.disable();1878 }1879 }1880 },1881 // Actual Callbacks object1882 self = {1883 // Add a callback or a collection of callbacks to the list1884 add: function () {1885 if (list) {1886 // First, we save the current length1887 var start = list.length;1888 (function add(args) {1889 jQuery.each(args, function (_, arg) {1890 var type = jQuery.type(arg);1891 if (type === "function") {1892 if (!options.unique || !self.has(arg)) {1893 list.push(arg);1894 }1895 } else if (arg && arg.length && type !== "string") {1896 // Inspect recursively1897 add(arg);1898 }1899 });1900 })(arguments);1901 // Do we need to add the callbacks to the1902 // current firing batch?1903 if (firing) {1904 firingLength = list.length;1905 // With memory, if we're not firing then1906 // we should call right away1907 } else if (memory) {1908 firingStart = start;1909 fire(memory);1910 }1911 }1912 return this;1913 },1914 // Remove a callback from the list1915 remove: function () {1916 if (list) {1917 jQuery.each(arguments, function (_, arg) {1918 var index;1919 while (( index = jQuery.inArray(arg, list, index) ) > -1) {1920 list.splice(index, 1);1921 // Handle firing indexes1922 if (firing) {1923 if (index <= firinglength)="" {="" firinglength--;="" }="" if="" (index="" <="firingIndex)" firingindex--;="" });="" return="" this;="" },="" check="" a="" given="" callback="" is="" in="" the="" list.="" no="" argument="" given,="" whether="" or="" not="" list="" has="" callbacks="" attached.="" has:="" function="" (fn)="" fn="" ?="" jquery.inarray(fn,="" list)=""> -1 : !!( list && list.length );1924 },1925 // Remove all callbacks from the list1926 empty: function () {1927 list = [];1928 firingLength = 0;1929 return this;1930 },1931 // Have the list do nothing anymore1932 disable: function () {1933 list = stack = memory = undefined;1934 return this;1935 },1936 // Is it disabled?1937 disabled: function () {1938 return !list;1939 },1940 // Lock the list in its current state1941 lock: function () {1942 stack = undefined;1943 if (!memory) {1944 self.disable();1945 }1946 return this;1947 },1948 // Is it locked?1949 locked: function () {1950 return !stack;1951 },1952 // Call all callbacks with the given context and arguments1953 fireWith: function (context, args) {1954 if (list && ( !fired || stack )) {1955 args = args || [];1956 args = [ context, args.slice ? args.slice() : args ];1957 if (firing) {1958 stack.push(args);1959 } else {1960 fire(args);1961 }1962 }1963 return this;1964 },1965 // Call all the callbacks with the given arguments1966 fire: function () {1967 self.fireWith(this, arguments);1968 return this;1969 },1970 // To know if the callbacks have already been called at least once1971 fired: function () {1972 return !!fired;1973 }1974 };1975 return self;1976 };1977 jQuery.extend({1978 Deferred: function (func) {1979 var tuples = [1980 // action, add listener, listener list, final state1981 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],1982 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],1983 [ "notify", "progress", jQuery.Callbacks("memory") ]1984 ],1985 state = "pending",1986 promise = {1987 state: function () {1988 return state;1989 },1990 always: function () {1991 deferred.done(arguments).fail(arguments);1992 return this;1993 },1994 then: function (/* fnDone, fnFail, fnProgress */) {1995 var fns = arguments;1996 return jQuery.Deferred(function (newDefer) {1997 jQuery.each(tuples, function (i, tuple) {1998 var fn = jQuery.isFunction(fns[ i ]) && fns[ i ];1999 // deferred[ done | fail | progress ] for forwarding actions to newDefer2000 deferred[ tuple[1] ](function () {2001 var returned = fn && fn.apply(this, arguments);2002 if (returned && jQuery.isFunction(returned.promise)) {2003 returned.promise()2004 .done(newDefer.resolve)2005 .fail(newDefer.reject)2006 .progress(newDefer.notify);2007 } else {2008 newDefer[ tuple[ 0 ] + "With" ](this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments);2009 }2010 });2011 });2012 fns = null;2013 }).promise();2014 },2015 // Get a promise for this deferred2016 // If obj is provided, the promise aspect is added to the object2017 promise: function (obj) {2018 return obj != null ? jQuery.extend(obj, promise) : promise;2019 }2020 },2021 deferred = {};2022 // Keep pipe for back-compat2023 promise.pipe = promise.then;2024 // Add list-specific methods2025 jQuery.each(tuples, function (i, tuple) {2026 var list = tuple[ 2 ],2027 stateString = tuple[ 3 ];2028 // promise[ done | fail | progress ] = list.add2029 promise[ tuple[1] ] = list.add;2030 // Handle state2031 if (stateString) {2032 list.add(function () {2033 // state = [ resolved | rejected ]2034 state = stateString;2035 // [ reject_list | resolve_list ].disable; progress_list.lock2036 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock);2037 }2038 // deferred[ resolve | reject | notify ]2039 deferred[ tuple[0] ] = function () {2040 deferred[ tuple[0] + "With" ](this === deferred ? promise : this, arguments);2041 return this;2042 };2043 deferred[ tuple[0] + "With" ] = list.fireWith;2044 });2045 // Make the deferred a promise2046 promise.promise(deferred);2047 // Call given func if any2048 if (func) {2049 func.call(deferred, deferred);2050 }2051 // All done!2052 return deferred;2053 },2054 // Deferred helper2055 when: function (subordinate /* , ..., subordinateN */) {2056 var i = 0,2057 resolveValues = slice.call(arguments),2058 length = resolveValues.length,2059 // the count of uncompleted subordinates2060 remaining = length !== 1 || ( subordinate && jQuery.isFunction(subordinate.promise) ) ? length : 0,2061 // the master Deferred. If resolveValues consist of only a single Deferred, just use that.2062 deferred = remaining === 1 ? subordinate : jQuery.Deferred(),2063 // Update function for both resolve and progress values2064 updateFunc = function (i, contexts, values) {2065 return function (value) {2066 contexts[ i ] = this;2067 values[ i ] = arguments.length > 1 ? slice.call(arguments) : value;2068 if (values === progressValues) {2069 deferred.notifyWith(contexts, values);2070 } else if (!(--remaining)) {2071 deferred.resolveWith(contexts, values);2072 }2073 };2074 },2075 progressValues, progressContexts, resolveContexts;2076 // add listeners to Deferred subordinates; treat others as resolved2077 if (length > 1) {2078 progressValues = new Array(length);2079 progressContexts = new Array(length);2080 resolveContexts = new Array(length);2081 for (; i < length; i++) {2082 if (resolveValues[ i ] && jQuery.isFunction(resolveValues[ i ].promise)) {2083 resolveValues[ i ].promise()2084 .done(updateFunc(i, resolveContexts, resolveValues))2085 .fail(deferred.reject)2086 .progress(updateFunc(i, progressContexts, progressValues));2087 } else {2088 --remaining;2089 }2090 }2091 }2092 // if we're not waiting on anything, resolve the master2093 if (!remaining) {2094 deferred.resolveWith(resolveContexts, resolveValues);2095 }2096 return deferred.promise();2097 }2098 });2099// The deferred used on DOM ready2100 var readyList;2101 jQuery.fn.ready = function (fn) {2102 // Add the callback2103 jQuery.ready.promise().done(fn);2104 return this;2105 };2106 jQuery.extend({2107 // Is the DOM ready to be used? Set to true once it occurs.2108 isReady: false,2109 // A counter to track how many items to wait for before2110 // the ready event fires. See #67812111 readyWait: 1,2112 // Hold (or release) the ready event2113 holdReady: function (hold) {2114 if (hold) {2115 jQuery.readyWait++;2116 } else {2117 jQuery.ready(true);2118 }2119 },2120 // Handle when the DOM is ready2121 ready: function (wait) {2122 // Abort if there are pending holds or we're already ready2123 if (wait === true ? --jQuery.readyWait : jQuery.isReady) {2124 return;2125 }2126 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).2127 if (!document.body) {2128 return setTimeout(jQuery.ready);2129 }2130 // Remember that the DOM is ready2131 jQuery.isReady = true;2132 // If a normal DOM Ready event fired, decrement, and wait if need be2133 if (wait !== true && --jQuery.readyWait > 0) {2134 return;2135 }2136 // If there are functions bound, to execute2137 readyList.resolveWith(document, [ jQuery ]);2138 // Trigger any bound ready events2139 if (jQuery.fn.trigger) {2140 jQuery(document).trigger("ready").off("ready");2141 }2142 }2143 });2144 /**2145 * Clean-up method for dom ready events2146 */2147 function detach() {2148 if (document.addEventListener) {2149 document.removeEventListener("DOMContentLoaded", completed, false);2150 window.removeEventListener("load", completed, false);2151 } else {2152 document.detachEvent("onreadystatechange", completed);2153 window.detachEvent("onload", completed);2154 }2155 }2156 /**2157 * The ready event handler and self cleanup method2158 */2159 function completed() {2160 // readyState === "complete" is good enough for us to call the dom ready in oldIE2161 if (document.addEventListener || event.type === "load" || document.readyState === "complete") {2162 detach();2163 jQuery.ready();2164 }2165 }2166 jQuery.ready.promise = function (obj) {2167 if (!readyList) {2168 readyList = jQuery.Deferred();2169 // Catch cases where $(document).ready() is called after the browser event has already occurred.2170 // we once tried to use readyState "interactive" here, but it caused issues like the one2171 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:152172 if (document.readyState === "complete") {2173 // Handle it asynchronously to allow scripts the opportunity to delay ready2174 setTimeout(jQuery.ready);2175 // Standards-based browsers support DOMContentLoaded2176 } else if (document.addEventListener) {2177 // Use the handy event callback2178 document.addEventListener("DOMContentLoaded", completed, false);2179 // A fallback to window.onload, that will always work2180 window.addEventListener("load", completed, false);2181 // If IE event model is used2182 } else {2183 // Ensure firing before onload, maybe late but safe also for iframes2184 document.attachEvent("onreadystatechange", completed);2185 // A fallback to window.onload, that will always work2186 window.attachEvent("onload", completed);2187 // If IE and not a frame2188 // continually check to see if the document is ready2189 var top = false;2190 try {2191 top = window.frameElement == null && document.documentElement;2192 } catch (e) {2193 }2194 if (top && top.doScroll) {2195 (function doScrollCheck() {2196 if (!jQuery.isReady) {2197 try {2198 // Use the trick by Diego Perini2199 // http://javascript.nwbox.com/IEContentLoaded/2200 top.doScroll("left");2201 } catch (e) {2202 return setTimeout(doScrollCheck, 50);2203 }2204 // detach all dom ready events2205 detach();2206 // and execute any waiting functions2207 jQuery.ready();2208 }2209 })();2210 }2211 }2212 }2213 return readyList.promise(obj);2214 };2215 var strundefined = typeof undefined;2216// Support: IE<9 1="" 3="" 6="" 7="" 9="" iteration="" over="" object's="" inherited="" properties="" before="" its="" own="" var="" i;="" for="" (i="" in="" jquery(support))="" {="" break;="" }="" support.ownlast="i" !="=" "0";="" note:="" most="" support="" tests="" are="" defined="" their="" respective="" modules.="" false="" until="" the="" test="" is="" run="" support.inlineblockneedslayout="false;" jquery(function="" ()="" we="" need="" to="" execute="" this="" one="" asap="" because="" know="" if="" body.style.zoom="" needs="" be="" set.="" container,="" div,="" body="document.getElementsByTagName("body")[0];" (!body)="" return="" frameset="" docs="" that="" don't="" have="" a="" return;="" setup="" container="document.createElement("div");" container.style.csstext="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px" ;="" div="document.createElement("div");" body.appendchild(container).appendchild(div);="" (typeof="" div.style.zoom="" strundefined)="" support:="" ie<8="" check="" natively="" block-level="" elements="" act="" like="" inline-block="" when="" setting="" display="" 'inline'="" and="" giving="" them="" layout="" div.style.csstext="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1" ((support.inlineblockneedslayout="(" div.offsetwidth="==" )))="" prevent="" ie="" from="" affecting="" positioned="" #11048="" shrinking="" mode="" #12869="" body.removechild(container);="" null="" avoid="" leaks="" =="" null;="" });="" (function="" only="" not="" already="" executed="" another="" module.="" (support.deleteexpando="=" null)="" ie<9="" support.deleteexpando="true;" try="" delete="" div.test;="" catch="" (e)="" ie.="" })();="" **="" *="" determines="" whether="" an="" object="" can="" data="" jquery.acceptdata="function" (elem)="" nodata="jQuery.noData[" (elem.nodename="" +="" "="" ").tolowercase()="" ],="" nodetype="+elem.nodeType" ||="" 1;="" do="" set="" on="" non-element="" dom="" nodes="" it="" will="" cleared="" (#8335).="" &&="" ?="" :="" accept="" unless="" otherwise="" specified;="" rejection="" conditional="" !nodata="" true="" elem.getattribute("classid")="==" nodata;="" };="" rbrace="/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/," rmultidash="/([A-Z])/g;" function="" dataattr(elem,="" key,="" data)="" nothing="" was="" found="" internally,="" fetch="" any="" html5="" data-*="" attribute="" (data="==" undefined="" elem.nodetype="==" 1)="" name="data-" key.replace(rmultidash,="" "-$1").tolowercase();="" "string")="" "true"="" "false"="" "null"="" convert="" number="" doesn't="" change="" string="" +data="" ""="==" rbrace.test(data)="" jquery.parsejson(data)="" data;="" make="" sure="" so="" isn't="" changed="" later="" jquery.data(elem,="" data);="" else="" checks="" cache="" emptiness="" isemptydataobject(obj)="" name;="" (name="" obj)="" public="" empty,="" private="" still="" empty="" "data"="" jquery.isemptyobject(obj[name]))="" continue;="" "tojson")="" false;="" true;="" internaldata(elem,="" name,="" data,="" pvt="" internal="" use="" )="" (!jquery.acceptdata(elem))="" ret,="" thiscache,="" internalkey="jQuery.expando," handle="" js="" objects="" differently="" ie6-7="" can't="" gc="" references="" properly="" across="" dom-js="" boundary="" isnode="elem.nodeType," global="" jquery="" cache;="" attached="" directly="" occur="" automatically="" jquery.cache="" elem,="" defining="" id="" exists="" allows="" code="" shortcut="" same="" path="" as="" node="" with="" no="" elem[="" ]="" internalkey;="" doing="" more="" work="" than="" trying="" get="" has="" at="" all="" ((!id="" !cache[id]="" (!pvt="" !cache[id].data))="" typeof="" (!id)="" new="" unique="" each="" element="" since="" ends="" up="" (isnode)="" jquery.guid++;="" (!cache[="" ])="" exposing="" metadata="" plain="" serialized="" using="" json.stringify="" cache[="" {}="" tojson:="" jquery.noop="" passed="" jquery.data="" instead="" of="" key="" value="" pair;="" gets="" shallow="" copied="" onto="" existing="" "object"="" "function")="" (pvt)="" name);="" ].data="jQuery.extend(cache[" ].data,="" thiscache="cache[" ];="" data()="" stored="" separate="" inside="" order="" collisions="" between="" user-defined="" data.="" (!pvt)="" (!thiscache.data)="" thiscache.data="{};" undefined)="" thiscache[="" jquery.camelcase(name)="" both="" converted-to-camel="" non-converted="" property="" names="" specified="" first="" find="" as-is="" ret="thisCache[" null|undefined="" (ret="=" camelcased="" ret;="" internalremovedata(elem,="" pvt)="" i,="" see="" information="" jquery.expando="" jquery.expando;="" there="" entry="" object,="" purpose="" continuing="" (name)="" ].data;="" (thiscache)="" array="" or="" space="" separated="" keys="" (!jquery.isarray(name))="" manipulation="" thiscache)="" split="" camel="" cased="" version="" by="" spaces="" ");="" "name"="" keys...="" initially="" created,="" via="" ("key",="" "val")="" signature,="" converted="" camelcase.="" way="" tell="" _how_="" added,="" remove="" camelcase="" key.="" #12786="" penalize="" argument="" path.="" jquery.camelcase));="" i="name.length;" while="" (i--)="" name[i]="" left="" cache,="" want="" continue="" let="" itself="" destroyed="" (pvt="" !isemptydataobject(thiscache)="" !jquery.isemptyobject(thiscache))="" destroy="" parent="" had="" been="" thing="" (!isemptydataobject(cache[="" ]))="" jquery.cleandata([="" elem="" true);="" supported="" expandos="" `cache`="" window="" per="" iswindow="" (#10080)="" jshint="" eqeqeq:="" fails,="" jquery.extend({="" cache:="" {},="" following="" (space-suffixed="" object.prototype="" collisions)="" throw="" uncatchable="" exceptions="" you="" attempt="" expando="" nodata:="" "applet="" ":="" true,="" "embed="" ...but="" flash="" (which="" classid)="" *can*="" "object="" "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"="" },="" hasdata:="" jquery.cache[="" elem[jquery.expando]="" !!elem="" !isemptydataobject(elem);="" data:="" (elem,="" removedata:="" name)="" only.="" _data:="" _removedata:="" jquery.fn.extend({="" (key,="" value)="" attrs="elem" elem.attributes;="" special="" expections="" .data="" basically="" thwart="" jquery.access,="" implement="" relevant="" behavior="" ourselves="" values="" (key="==" (this.length)="" (elem.nodetype="==" !jquery._data(elem,="" "parsedattrs"))="" (name.indexof("data-")="==" 0)="" data[="" ]);="" jquery._data(elem,="" "parsedattrs",="" sets="" multiple "object")="" this.each(function="" jquery.data(this,="" key);="" arguments.length=""> 1 ?2217 // Sets one value2218 this.each(function () {2219 jQuery.data(this, key, value);2220 }) :2221 // Gets one value2222 // Try to fetch any internally stored data first2223 elem ? dataAttr(elem, key, jQuery.data(elem, key)) : undefined;2224 },2225 removeData: function (key) {2226 return this.each(function () {2227 jQuery.removeData(this, key);2228 });2229 }2230 });2231 jQuery.extend({2232 queue: function (elem, type, data) {2233 var queue;2234 if (elem) {2235 type = ( type || "fx" ) + "queue";2236 queue = jQuery._data(elem, type);2237 // Speed up dequeue by getting out quickly if this is just a lookup2238 if (data) {2239 if (!queue || jQuery.isArray(data)) {2240 queue = jQuery._data(elem, type, jQuery.makeArray(data));2241 } else {2242 queue.push(data);2243 }2244 }2245 return queue || [];2246 }2247 },2248 dequeue: function (elem, type) {2249 type = type || "fx";2250 var queue = jQuery.queue(elem, type),2251 startLength = queue.length,2252 fn = queue.shift(),2253 hooks = jQuery._queueHooks(elem, type),2254 next = function () {2255 jQuery.dequeue(elem, type);2256 };2257 // If the fx queue is dequeued, always remove the progress sentinel2258 if (fn === "inprogress") {2259 fn = queue.shift();2260 startLength--;2261 }2262 if (fn) {2263 // Add a progress sentinel to prevent the fx queue from being2264 // automatically dequeued2265 if (type === "fx") {2266 queue.unshift("inprogress");2267 }2268 // clear up the last queue stop function2269 delete hooks.stop;2270 fn.call(elem, next, hooks);2271 }2272 if (!startLength && hooks) {2273 hooks.empty.fire();2274 }2275 },2276 // not intended for public consumption - generates a queueHooks object, or returns the current one2277 _queueHooks: function (elem, type) {2278 var key = type + "queueHooks";2279 return jQuery._data(elem, key) || jQuery._data(elem, key, {2280 empty: jQuery.Callbacks("once memory").add(function () {2281 jQuery._removeData(elem, type + "queue");2282 jQuery._removeData(elem, key);2283 })2284 });2285 }2286 });2287 jQuery.fn.extend({2288 queue: function (type, data) {2289 var setter = 2;2290 if (typeof type !== "string") {2291 data = type;2292 type = "fx";2293 setter--;2294 }2295 if (arguments.length < setter) {2296 return jQuery.queue(this[0], type);2297 }2298 return data === undefined ?2299 this :2300 this.each(function () {2301 var queue = jQuery.queue(this, type, data);2302 // ensure a hooks for this queue2303 jQuery._queueHooks(this, type);2304 if (type === "fx" && queue[0] !== "inprogress") {2305 jQuery.dequeue(this, type);2306 }2307 });2308 },2309 dequeue: function (type) {2310 return this.each(function () {2311 jQuery.dequeue(this, type);2312 });2313 },2314 clearQueue: function (type) {2315 return this.queue(type || "fx", []);2316 },2317 // Get a promise resolved when queues of a certain type2318 // are emptied (fx is the type by default)2319 promise: function (type, obj) {2320 var tmp,2321 count = 1,2322 defer = jQuery.Deferred(),2323 elements = this,2324 i = this.length,2325 resolve = function () {2326 if (!( --count )) {2327 defer.resolveWith(elements, [ elements ]);2328 }2329 };2330 if (typeof type !== "string") {2331 obj = type;2332 type = undefined;2333 }2334 type = type || "fx";2335 while (i--) {2336 tmp = jQuery._data(elements[ i ], type + "queueHooks");2337 if (tmp && tmp.empty) {2338 count++;2339 tmp.empty.add(resolve);2340 }2341 }2342 resolve();2343 return defer.promise(obj);2344 }2345 });2346 var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;2347 var cssExpand = [ "Top", "Right", "Bottom", "Left" ];2348 var isHidden = function (elem, el) {2349 // isHidden might be called from jQuery#filter function;2350 // in that case, element will be second argument2351 elem = el || elem;2352 return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem);2353 };2354// Multifunctional method to get and set values of a collection2355// The value/s can optionally be executed if it's a function2356 var access = jQuery.access = function (elems, fn, key, value, chainable, emptyGet, raw) {2357 var i = 0,2358 length = elems.length,2359 bulk = key == null;2360 // Sets many values2361 if (jQuery.type(key) === "object") {2362 chainable = true;2363 for (i in key) {2364 jQuery.access(elems, fn, i, key[i], true, emptyGet, raw);2365 }2366 // Sets one value2367 } else if (value !== undefined) {2368 chainable = true;2369 if (!jQuery.isFunction(value)) {2370 raw = true;2371 }2372 if (bulk) {2373 // Bulk operations run against the entire set2374 if (raw) {2375 fn.call(elems, value);2376 fn = null;2377 // ...except when executing function values2378 } else {2379 bulk = fn;2380 fn = function (elem, key, value) {2381 return bulk.call(jQuery(elem), value);2382 };2383 }2384 }2385 if (fn) {2386 for (; i < length; i++) {2387 fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));2388 }2389 }2390 }2391 return chainable ?2392 elems :2393 // Gets2394 bulk ?2395 fn.call(elems) :2396 length ? fn(elems[0], key) : emptyGet;2397 };2398 var rcheckableType = (/^(?:checkbox|radio)$/i);2399 (function () {2400 var fragment = document.createDocumentFragment(),2401 div = document.createElement("div"),2402 input = document.createElement("input");2403 // Setup2404 div.setAttribute("className", "t");2405 div.innerHTML = " <link><table></table><a href="/a">a</a>";2406 // IE strips leading whitespace when .innerHTML is used2407 support.leadingWhitespace = div.firstChild.nodeType === 3;2408 // Make sure that tbody elements aren't automatically inserted2409 // IE will insert them into empty tables2410 support.tbody = !div.getElementsByTagName("tbody").length;2411 // Make sure that link elements get serialized correctly by innerHTML2412 // This requires a wrapper element in IE2413 support.htmlSerialize = !!div.getElementsByTagName("link").length;2414 // Makes sure cloning an html5 element does not cause problems2415 // Where outerHTML is undefined, this still works2416 support.html5Clone =2417 document.createElement("nav").cloneNode(true).outerHTML !== "<:nav></:nav>";2418 // Check if a disconnected checkbox will retain its checked2419 // value of true after appended to the DOM (IE6/7)2420 input.type = "checkbox";2421 input.checked = true;2422 fragment.appendChild(input);2423 support.appendChecked = input.checked;2424 // Make sure textarea (and checkbox) defaultValue is properly cloned2425 // Support: IE6-IE11+2426 div.innerHTML = "<textarea>x</textarea>";2427 support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;2428 // #11217 - WebKit loses check when the name is after the checked attribute2429 fragment.appendChild(div);2430 div.innerHTML = "<input type="radio" checked="checked" name="t">";2431 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.32432 // old WebKit doesn't clone checked state correctly in fragments2433 support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;2434 // Support: IE<9 3="" opera="" does="" not="" clone="" events="" (and="" typeof="" div.attachevent="==" undefined).="" ie9-10="" clones="" bound="" via="" attachevent,="" but="" they="" don't="" trigger="" with="" .click()="" support.nocloneevent="true;" if="" (div.attachevent)="" {="" div.attachevent("onclick",="" function="" ()="" });="" div.clonenode(true).click();="" }="" execute="" the="" test="" only="" already="" executed="" in="" another="" module.="" (support.deleteexpando="=" null)="" support:="" ie<9="" support.deleteexpando="true;" try="" delete="" div.test;="" catch="" (e)="" null="" elements="" to="" avoid="" leaks="" ie.="" fragment="div" =="" input="null;" })();="" (function="" var="" i,="" eventname,="" div="document.createElement("div");" (lack="" submit="" change="" bubble),="" firefox="" 23+="" focusin="" event)="" for="" (i="" submit:="" true,="" change:="" focusin:="" true="" })="" eventname="on" +="" i;="" (!(support[="" i="" "bubbles"="" ]="eventName" window))="" beware="" of="" csp="" restrictions="" (https:="" developer.mozilla.org="" en="" security="" csp)="" div.setattribute(eventname,="" "t");="" support[="" ].expando="==" false;="" rformelems="/^(?:input|select|textarea)$/i," rkeyevent="/^key/," rmouseevent="/^(?:mouse|contextmenu)|click/," rfocusmorph="/^(?:focusinfocus|focusoutblur)$/," rtypenamespace="/^([^.]*)(?:\.(.+)|)$/;" returntrue()="" return="" true;="" returnfalse()="" safeactiveelement()="" document.activeelement;="" (err)="" *="" helper="" functions="" managing="" --="" part="" public="" interface.="" props="" dean="" edwards'="" addevent="" library="" many="" ideas.="" jquery.event="{" global:="" {},="" add:="" (elem,="" types,="" handler,="" data,="" selector)="" tmp,="" events,="" t,="" handleobjin,="" special,="" eventhandle,="" handleobj,="" handlers,="" type,="" namespaces,="" origtype,="" elemdata="jQuery._data(elem);" attach="" nodata="" or="" text="" comment="" nodes="" (but="" allow="" plain="" objects)="" (!elemdata)="" return;="" caller="" can="" pass="" an="" object="" custom="" data="" lieu="" handler="" (handler.handler)="" handleobjin="handler;" selector="handleObjIn.selector;" make="" sure="" that="" has="" a="" unique="" id,="" used="" find="" remove="" it="" later="" (!handler.guid)="" handler.guid="jQuery.guid++;" init="" element's="" event="" structure="" and="" main="" this="" is="" first="" (!(events="elemData.events))" {};="" (!(eventhandle="elemData.handle))" eventhandle="elemData.handle" discard="" second="" jquery.event.trigger()="" when="" called="" after="" page="" unloaded="" jquery="" !="=" strundefined="" &&="" (!e="" ||="" jquery.event.triggered="" e.type)="" ?="" jquery.event.dispatch.apply(eventhandle.elem,="" arguments)="" :="" undefined;="" };="" add="" elem="" as="" property="" handle="" fn="" prevent="" memory="" leak="" ie="" non-native="" eventhandle.elem="elem;" multiple separated="" by="" space="" types="(" ""="" ).match(rnotwhite)="" [="" ];="" t="types.length;" while="" (t--)="" tmp="rtypenamespace.exec(types[t])" [];="" type="origType" tmp[1];="" namespaces="(" tmp[2]="" ).split(".").sort();="" there="" *must*="" be="" no="" attaching="" namespace-only="" handlers="" (!type)="" continue;="" changes="" its="" use="" special="" changed="" defined,="" determine="" api="" otherwise="" given="" special.delegatetype="" special.bindtype="" )="" type;="" update="" based="" on="" newly="" reset="" handleobj="" passed="" all="" type:="" origtype:="" data:="" handler:="" guid:="" handler.guid,="" selector:="" selector,="" needscontext:="" jquery.expr.match.needscontext.test(selector),="" namespace:="" namespaces.join(".")="" },="" handleobjin);="" queue="" we're="" (!(handlers="events[" ]))="" handlers.delegatecount="0;" addeventlistener="" attachevent="" returns="" false="" (!special.setup="" special.setup.call(elem,="" eventhandle)="==" false)="" bind="" global="" element="" (elem.addeventlistener)="" elem.addeventlistener(type,="" false);="" else="" (elem.attachevent)="" elem.attachevent("on"="" eventhandle);="" (special.add)="" special.add.call(elem,="" handleobj);="" (!handleobj.handler.guid)="" handleobj.handler.guid="handler.guid;" list,="" delegates="" front="" (selector)="" handlers.splice(handlers.delegatecount++,="" 0,="" handlers.push(handleobj);="" keep="" track="" which="" have="" ever="" been="" used,="" optimization="" jquery.event.global[="" nullify="" detach="" set="" from="" remove:="" mappedtypes)="" j,="" origcount,="" jquery._data(elem);="" (!elemdata="" !(events="elemData.events))" once="" each="" type.namespace="" types;="" may="" omitted="" unbind="" (on="" namespace,="" provided)="" (type="" events)="" jquery.event.remove(elem,="" types[="" ],="" true);="" new="" regexp("(^|\\.)"="" namespaces.join("\\.(?:.*\\.|)")="" "(\\.|$)");="" matching="" origcount="j" handlers.length;="" (j--)="" j="" ((="" mappedtypes="" origtype="==" handleobj.origtype="" (="" !handler="" handleobj.guid="" !tmp="" tmp.test(handleobj.namespace)="" !selector="" handleobj.selector="" "**"="" ))="" handlers.splice(j,="" 1);="" (handleobj.selector)="" handlers.delegatecount--;="" (special.remove)="" special.remove.call(elem,="" generic="" we="" removed="" something="" more="" exist="" (avoids="" potential="" endless="" recursion="" during="" removal="" handlers)="" (origcount="" !handlers.length)="" (!special.teardown="" special.teardown.call(elem,="" elemdata.handle)="==" jquery.removeevent(elem,="" elemdata.handle);="" events[="" expando="" it's="" longer="" (jquery.isemptyobject(events))="" elemdata.handle;="" removedata="" also="" checks="" emptiness="" clears="" empty="" so="" instead="" jquery._removedata(elem,="" "events");="" trigger:="" (event,="" elem,="" onlyhandlers)="" handle,="" ontype,="" cur,="" bubbletype,="" eventpath="[" document="" "type")="" event.type="" event,="" "namespace")="" event.namespace.split(".")="" cur="tmp" document;="" do="" (elem.nodetype="==" elem.nodetype="==" 8)="" focus="" blur="" morphs="" out;="" ensure="" firing="" them="" right="" now="" (rfocusmorph.test(type="" jquery.event.triggered))="" (type.indexof(".")="">= 0) {2435 // Namespaced trigger; create a regexp to match event type in handle()2436 namespaces = type.split(".");2437 type = namespaces.shift();2438 namespaces.sort();2439 }2440 ontype = type.indexOf(":") < 0 && "on" + type;2441 // Caller can pass in a jQuery.Event object, Object, or just an event type string2442 event = event[ jQuery.expando ] ?2443 event :2444 new jQuery.Event(type, typeof event === "object" && event);2445 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)2446 event.isTrigger = onlyHandlers ? 2 : 3;2447 event.namespace = namespaces.join(".");2448 event.namespace_re = event.namespace ?2449 new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") :2450 null;2451 // Clean up the event in case it is being reused2452 event.result = undefined;2453 if (!event.target) {2454 event.target = elem;2455 }2456 // Clone any incoming data and prepend the event, creating the handler arg list2457 data = data == null ?2458 [ event ] :2459 jQuery.makeArray(data, [ event ]);2460 // Allow special events to draw outside the lines2461 special = jQuery.event.special[ type ] || {};2462 if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {2463 return;2464 }2465 // Determine event propagation path in advance, per W3C events spec (#9951)2466 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)2467 if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {2468 bubbleType = special.delegateType || type;2469 if (!rfocusMorph.test(bubbleType + type)) {2470 cur = cur.parentNode;2471 }2472 for (; cur; cur = cur.parentNode) {2473 eventPath.push(cur);2474 tmp = cur;2475 }2476 // Only add window if we got to document (e.g., not plain obj or detached DOM)2477 if (tmp === (elem.ownerDocument || document)) {2478 eventPath.push(tmp.defaultView || tmp.parentWindow || window);2479 }2480 }2481 // Fire handlers on the event path2482 i = 0;2483 while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {2484 event.type = i > 1 ?2485 bubbleType :2486 special.bindType || type;2487 // jQuery handler2488 handle = ( jQuery._data(cur, "events") || {} )[ event.type ] && jQuery._data(cur, "handle");2489 if (handle) {2490 handle.apply(cur, data);2491 }2492 // Native handler2493 handle = ontype && cur[ ontype ];2494 if (handle && handle.apply && jQuery.acceptData(cur)) {2495 event.result = handle.apply(cur, data);2496 if (event.result === false) {2497 event.preventDefault();2498 }2499 }2500 }2501 event.type = type;2502 // If nobody prevented the default action, do it now2503 if (!onlyHandlers && !event.isDefaultPrevented()) {2504 if ((!special._default || special._default.apply(eventPath.pop(), data) === false) &&2505 jQuery.acceptData(elem)) {2506 // Call a native DOM method on the target with the same name name as the event.2507 // Can't use an .isFunction() check here because IE6/7 fails that test.2508 // Don't do default actions on window, that's where global variables be (#6170)2509 if (ontype && elem[ type ] && !jQuery.isWindow(elem)) {2510 // Don't re-trigger an onFOO event when we call its FOO() method2511 tmp = elem[ ontype ];2512 if (tmp) {2513 elem[ ontype ] = null;2514 }2515 // Prevent re-triggering of the same event, since we already bubbled it above2516 jQuery.event.triggered = type;2517 try {2518 elem[ type ]();2519 } catch (e) {2520 // IE<9 dies="" on="" focus="" blur="" to="" hidden element="" (#1486,#12518)="" only="" reproducible="" winxp="" ie8="" native,="" not="" ie9="" in="" mode="" }="" jquery.event.triggered="undefined;" if="" (tmp)="" {="" elem[="" ontype="" ]="tmp;" return="" event.result;="" },="" dispatch:="" function="" (event)="" make="" a="" writable="" jquery.event="" from="" the="" native="" event="" object="" var="" i,="" ret,="" handleobj,="" matched,="" j,="" handlerqueue="[]," args="slice.call(arguments)," handlers="(" jquery._data(this,="" "events")="" ||="" {}="" )[="" event.type="" [],="" special="jQuery.event.special[" {};="" use="" fix-ed="" rather="" than="" (read-only)="" args[0]="event;" event.delegatetarget="this;" call="" predispatch="" hook="" for="" mapped="" type,="" and="" let="" it="" bail="" desired="" (special.predispatch="" &&="" special.predispatch.call(this,="" event)="==" false)="" return;="" determine="" event,="" handlers);="" run="" delegates="" first;="" they="" may="" want="" stop="" propagation="" beneath="" us="" i="0;" while="" ((matched="handlerQueue[" i++="" ])="" !event.ispropagationstopped())="" event.currenttarget="matched.elem;" j="0;" ((handleobj="matched.handlers[" j++="" !event.isimmediatepropagationstopped())="" triggered="" must="" either="" 1)="" have="" no="" namespace,="" or="" 2)="" namespace(s)="" subset="" equal="" those="" bound="" (both="" can="" namespace).="" (!event.namespace_re="" event.namespace_re.test(handleobj.namespace))="" event.handleobj="handleObj;" event.data="handleObj.data;" ret="(" (jquery.event.special[="" handleobj.origtype="" {}).handle="" handleobj.handler="" )="" .apply(matched.elem,="" args);="" (ret="" !="=" undefined)="" ((event.result="ret)" =="=" event.preventdefault();="" event.stoppropagation();="" postdispatch="" type="" (special.postdispatch)="" special.postdispatch.call(this,="" event);="" handlers:="" (event,="" handlers)="" sel,="" matches,="" delegatecount="handlers.delegateCount," cur="event.target;" find="" delegate="" black-hole="" svg="" <use=""> instance trees (#13180)2521 // Avoid non-left-click bubbling in Firefox (#3861)2522 if (delegateCount && cur.nodeType && (!event.button || event.type !== "click")) {2523 /* jshint eqeqeq: false */2524 for (; cur != this; cur = cur.parentNode || this) {2525 /* jshint eqeqeq: true */2526 // Don't check non-elements (#13208)2527 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)2528 if (cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click")) {2529 matches = [];2530 for (i = 0; i < delegateCount; i++) {2531 handleObj = handlers[ i ];2532 // Don't conflict with Object.prototype properties (#13203)2533 sel = handleObj.selector + " ";2534 if (matches[ sel ] === undefined) {2535 matches[ sel ] = handleObj.needsContext ?2536 jQuery(sel, this).index(cur) >= 0 :2537 jQuery.find(sel, this, null, [ cur ]).length;2538 }2539 if (matches[ sel ]) {2540 matches.push(handleObj);2541 }2542 }2543 if (matches.length) {2544 handlerQueue.push({ elem: cur, handlers: matches });2545 }2546 }2547 }2548 }2549 // Add the remaining (directly-bound) handlers2550 if (delegateCount < handlers.length) {2551 handlerQueue.push({ elem: this, handlers: handlers.slice(delegateCount) });2552 }2553 return handlerQueue;2554 },2555 fix: function (event) {2556 if (event[ jQuery.expando ]) {2557 return event;2558 }2559 // Create a writable copy of the event object and normalize some properties2560 var i, prop, copy,2561 type = event.type,2562 originalEvent = event,2563 fixHook = this.fixHooks[ type ];2564 if (!fixHook) {2565 this.fixHooks[ type ] = fixHook =2566 rmouseEvent.test(type) ? this.mouseHooks :2567 rkeyEvent.test(type) ? this.keyHooks :2568 {};2569 }2570 copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;2571 event = new jQuery.Event(originalEvent);2572 i = copy.length;2573 while (i--) {2574 prop = copy[ i ];2575 event[ prop ] = originalEvent[ prop ];2576 }2577 // Support: IE<9 0="" 1="==" 2="==" 3="==" 4="" 9="" 2003="" fix="" target="" property="" (#1925)="" if="" (!event.target)="" {="" event.target="originalEvent.srcElement" ||="" document;="" }="" support:="" chrome="" 23+,="" safari?="" should="" not="" be="" a="" text="" node="" (#504,="" #13143)="" (event.target.nodetype="==" 3)="" ie<9="" for="" mouse="" key="" events,="" metakey="=false" it's="" undefined="" (#3368,="" #11328)="" event.metakey="!!event.metaKey;" return="" fixhook.filter="" ?="" fixhook.filter(event,="" originalevent)="" :="" event;="" },="" includes="" some="" event="" props="" shared="" by="" keyevent="" and="" mouseevent="" props:="" "altkey="" bubbles="" cancelable="" ctrlkey="" currenttarget="" eventphase="" relatedtarget="" shiftkey="" timestamp="" view="" which".split("="" "),="" fixhooks:="" {},="" keyhooks:="" "char="" charcode="" keycode".split("="" filter:="" function="" (event,="" original)="" add="" which="" events="" (event.which="=" null)="" event.which="original.charCode" !="null" original.charcode="" original.keycode;="" mousehooks:="" "button="" buttons="" clientx="" clienty="" fromelement="" offsetx="" offsety="" pagex="" pagey="" screenx="" screeny="" toelement".split("="" var="" body,="" eventdoc,="" doc,="" button="original.button," calculate="" y="" missing="" available="" (event.pagex="=" null="" &&="" original.clientx="" eventdoc="event.target.ownerDocument" doc="eventDoc.documentElement;" body="eventDoc.body;" event.pagex="original.clientX" +="" (="" doc.scrollleft="" body.scrollleft="" )="" -="" doc.clientleft="" body.clientleft="" );="" event.pagey="original.clientY" doc.scrolltop="" body.scrolltop="" doc.clienttop="" body.clienttop="" relatedtarget,="" necessary="" (!event.relatedtarget="" fromelement)="" event.relatedtarget="fromElement" =="=" original.toelement="" fromelement;="" click:="" left;="" middle;="" right="" note:="" is="" normalized,="" so="" don't="" use="" it="" (!event.which="" undefined)="" &="" special:="" load:="" prevent="" triggered="" image.load="" from="" bubbling="" to="" window.load="" nobubble:="" true="" focus:="" fire="" native="" possible="" blur="" focus="" sequence="" correct="" trigger:="" ()="" (this="" safeactiveelement()="" this.focus)="" try="" this.focus();="" false;="" catch="" (e)="" we="" error="" on="" hidden element="" (#1486,="" #12518),="" let="" .trigger()="" run="" the="" handlers="" delegatetype:="" "focusin"="" blur:="" this.blur)="" this.blur();="" "focusout"="" checkbox,="" checked state="" will="" (jquery.nodename(this,="" "input")="" this.type="==" "checkbox"="" this.click)="" this.click();="" cross-browser="" consistency,="" .click()="" links="" _default:="" (event)="" jquery.nodename(event.target,="" "a");="" beforeunload:="" postdispatch:="" even="" when="" returnvalue="" equals="" firefox="" still="" show="" alert="" (event.result="" event.originalevent.returnvalue="event.result;" simulate:="" (type,="" elem,="" event,="" bubble)="" piggyback="" donor="" simulate="" different="" one.="" fake="" originalevent="" avoid="" donor's="" stoppropagation,="" but="" simulated="" prevents="" default then="" do="" same="" donor.="" e="jQuery.extend(" new="" jquery.event(),="" type:="" type,="" issimulated:="" true,="" originalevent:="" {}="" (bubble)="" jquery.event.trigger(e,="" null,="" elem);="" else="" jquery.event.dispatch.call(elem,="" e);="" (e.isdefaultprevented())="" event.preventdefault();="" };="" jquery.removeevent="document.removeEventListener" (elem,="" handle)="" (elem.removeeventlistener)="" elem.removeeventlistener(type,="" handle,="" false);="" name="on" type;="" (elem.detachevent)="" #8545,="" #7054,="" preventing="" memory="" leaks="" custom="" in="" ie6-8="" detachevent="" needed="" element,="" of="" that="" properly="" expose="" gc="" (typeof="" elem[="" ]="==" strundefined)="" elem.detachevent(name,="" handle);="" jquery.event="function" (src,="" props)="" allow="" instantiation="" without="" 'new'="" keyword="" (!(this="" instanceof="" jquery.event))="" jquery.event(src,="" props);="" object="" (src="" src.type)="" this.originalevent="src;" up="" document="" may="" have="" been="" marked="" as="" prevented="" handler="" lower="" down="" tree;="" reflect="" value.="" this.isdefaultprevented="src.defaultPrevented" src.defaultprevented="==" ie="" <="" src.returnvalue="==" false="" android="" 4.0="" src.getpreventdefault="" src.getpreventdefault()="" returntrue="" returnfalse;="" type="" put="" explicitly="" provided="" properties="" onto="" (props)="" jquery.extend(this,="" create="" incoming="" doesn't="" one="" this.timestamp="src" src.timestamp="" jquery.now();="" mark="" fixed="" this[="" jquery.expando="" based="" dom3="" specified="" ecmascript="" language="" binding="" http:="" www.w3.org="" tr="" wd-dom-level-3-events-20030331="" ecma-script-binding.html="" jquery.event.prototype="{" isdefaultprevented:="" returnfalse,="" ispropagationstopped:="" isimmediatepropagationstopped:="" preventdefault:="" (!e)="" return;="" preventdefault="" exists,="" original="" (e.preventdefault)="" e.preventdefault();="" otherwise="" set="" e.returnvalue="false;" stoppropagation:="" this.ispropagationstopped="returnTrue;" stoppropagation="" (e.stoppropagation)="" e.stoppropagation();="" cancelbubble="" e.cancelbubble="true;" stopimmediatepropagation:="" this.isimmediatepropagationstopped="returnTrue;" this.stoppropagation();="" mouseenter="" leave="" using="" mouseover="" out="" event-time="" checks="" jquery.each({="" mouseenter:="" "mouseover",="" mouseleave:="" "mouseout"="" (orig,="" fix)="" jquery.event.special[="" orig="" fix,="" bindtype:="" handle:="" ret,="" related="event.relatedTarget," handleobj="event.handleObj;" mousenter="" call="" outside="" target.="" nb:="" no="" left="" entered="" browser="" window="" (!related="" (related="" !jquery.contains(target,="" related)))="" event.type="handleObj.origType;" ret="handleObj.handler.apply(this," arguments);="" ret;="" });="" submit="" delegation="" (!support.submitbubbles)="" jquery.event.special.submit="{" setup:="" only="" need="" this="" delegated="" form="" "form"))="" lazy-add="" descendant="" potentially="" submitted="" jquery.event.add(this,="" "click._submit="" keypress._submit",="" check="" avoids="" vml-related="" crash="" (#9807)="" elem="e.target," jquery.nodename(elem,="" "button")="" elem.form="" undefined;="" (form="" !jquery._data(form,="" "submitbubbles"))="" jquery.event.add(form,="" "submit._submit",="" event._submit_bubble="true;" jquery._data(form,="" "submitbubbles",="" true);="" since="" an="" listener="" was="" user,="" bubble="" tree="" (event._submit_bubble)="" delete="" event._submit_bubble;="" (this.parentnode="" !event.istrigger)="" jquery.event.simulate("submit",="" this.parentnode,="" teardown:="" remove="" handlers;="" cleandata="" eventually="" reaps="" attached="" above="" jquery.event.remove(this,="" "._submit");="" change="" checkbox="" radio="" (!support.changebubbles)="" jquery.event.special.change="{" (rformelems.test(this.nodename))="" until="" blur;="" trigger="" click="" after="" propertychange.="" eat="" blur-change="" special.change.handle.="" fires="" onchange="" second="" time="" blur.="" (this.type="==" "radio")="" "propertychange._change",="" (event.originalevent.propertyname="==" "checked")="" this._just_changed="true;" "click._change",="" (this._just_changed="" triggered,="" (#11500)="" jquery.event.simulate("change",="" this,="" inputs="" "beforeactivate._change",="" (rformelems.test(elem.nodename)="" !jquery._data(elem,="" "changebubbles"))="" jquery.event.add(elem,="" "change._change",="" !event.issimulated="" jquery._data(elem,="" "changebubbles",="" swallow="" radio,="" already="" them="" event.issimulated="" event.istrigger="" (elem.type="" "radio"="" elem.type="" "checkbox"))="" event.handleobj.handler.apply(this,="" "._change");="" !rformelems.test(this.nodename);="" "bubbling"="" (!support.focusinbubbles)="" "focusin",="" attach="" single="" capturing="" while="" someone="" wants="" focusin="" focusout="" jquery.event.simulate(fix,="" event.target,="" jquery.event.fix(event),="" attaches="jQuery._data(doc," fix);="" (!attaches)="" doc.addeventlistener(orig,="" handler,="" jquery._data(doc,="" 1);="" 1;="" doc.removeeventlistener(orig,="" jquery._removedata(doc,="" attaches);="" jquery.fn.extend({="" on:="" (types,="" selector,="" data,="" fn,="" *internal*="" one)="" origfn;="" types="" can="" map="" "object")="" types-object,="" data="" selector="" "string")="" selector;="" (type="" types)="" this.on(type,="" types[="" ],="" one);="" this;="" (data="=" fn="=" types,="" (fn="=" false)="" (!fn)="" (one="==" 1)="" origfn="fn;" empty="" set,="" contains="" info="" jquery().off(event);="" origfn.apply(this,="" guid="" caller="" fn.guid="origFn.guid" origfn.guid="jQuery.guid++" this.each(function="" selector);="" one:="" fn)="" this.on(types,="" off:="" handleobj,="" (types="" types.preventdefault="" types.handleobj)="" dispatched="" jquery(types.delegatetarget).off(="" handleobj.namespace="" handleobj.origtype="" "."="" handleobj.origtype,="" handleobj.selector,="" handleobj.handler="" types-object="" [,="" selector]="" this.off(type,="" ]);="" (selector="==" typeof="" "function")="" fn]="" data)="" jquery.event.trigger(type,="" this);="" triggerhandler:="" (elem)="" createsafefragment(document)="" list="nodeNames.split("|")," safefrag="document.createDocumentFragment();" (safefrag.createelement)="" (list.length)="" safefrag.createelement(="" list.pop()="" safefrag;="" nodenames="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",="" rinlinejquery="/" jquery\d+="(?:null|\d+)" g,="" rnoshimcache="new" regexp("<(?:"="" ")[\\s="">]", "i"),2578 rleadingWhitespace = /^\s+/,2579 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,2580 rtagName = /<([\w:]+) ,="" rtbody="/<tbody/i," rhtml="/<|&#?\w+;/," rnoinnerhtml="/<(?:script|style|link)/i," checked="checked" or="" rchecked="/checked\s*(?:[^=]|=\s*.checked.)/i," rscripttype="/^$|\/(?:java|ecma)script/i," rscripttypemasked="/^true\/(.*)/," rcleanscript="/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)">\s*$/g,2581 // We have to close these tags to support XHTML (#13200)2582 wrapMap = {2583 option: [ 1, "<select multiple="multiple">", "</select>" ],2584 legend: [ 1, "<fieldset>", "</fieldset>" ],2585 area: [ 1, "<map>", "</map>" ],2586 param: [ 1, "<object>", "</object>" ],2587 thead: [ 1, "<table>", "</table>" ],2588 tr: [ 2, "<table><tbody>", "</tbody></table>" ],2589 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],2590 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],2591 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,2592 // unless wrapped in a div with non-breaking characters in front of it.2593 _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]2594 },2595 safeFragment = createSafeFragment(document),2596 fragmentDiv = safeFragment.appendChild(document.createElement("div"));2597 wrapMap.optgroup = wrapMap.option;2598 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;2599 wrapMap.th = wrapMap.td;2600 function getAll(context, tag) {2601 var elems, elem,2602 i = 0,2603 found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName(tag || "*") :2604 typeof context.querySelectorAll !== strundefined ? context.querySelectorAll(tag || "*") :2605 undefined;2606 if (!found) {2607 for (found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++) {2608 if (!tag || jQuery.nodeName(elem, tag)) {2609 found.push(elem);2610 } else {2611 jQuery.merge(found, getAll(elem, tag));2612 }2613 }2614 }2615 return tag === undefined || tag && jQuery.nodeName(context, tag) ?2616 jQuery.merge([ context ], found) :2617 found;2618 }2619// Used in buildFragment, fixes the defaultChecked property2620 function fixDefaultChecked(elem) {2621 if (rcheckableType.test(elem.type)) {2622 elem.defaultChecked = elem.checked;2623 }2624 }2625// Support: IE<8 1="" 11="" manipulating="" tables="" requires="" a="" tbody="" function="" manipulationtarget(elem,="" content)="" {="" return="" jquery.nodename(elem,="" "table")="" &&="" jquery.nodename(content.nodetype="" !="=" ?="" content="" :="" content.firstchild,="" "tr")="" elem.getelementsbytagname("tbody")[0]="" ||="" elem.appendchild(elem.ownerdocument.createelement("tbody"))="" elem;="" }="" replace="" restore="" the="" type="" attribute="" of="" script="" elements="" for="" safe="" dom="" manipulation="" disablescript(elem)="" elem.type="(jQuery.find.attr(elem," "type")="" null)="" +="" "="" elem.type;="" restorescript(elem)="" var="" match="rscriptTypeMasked.exec(elem.type);" if="" (match)="" else="" elem.removeattribute("type");="" mark="" scripts="" as="" having="" already="" been="" evaluated="" setglobaleval(elems,="" refelements)="" elem,="" i="0;" (;="" (elem="elems[i])" i++)="" jquery._data(elem,="" "globaleval",="" !refelements="" jquery._data(refelements[i],="" "globaleval"));="" clonecopyevent(src,="" dest)="" (dest.nodetype="" !jquery.hasdata(src))="" return;="" type,="" i,="" l,="" olddata="jQuery._data(src)," curdata="jQuery._data(dest," olddata),="" events="oldData.events;" (events)="" delete="" curdata.handle;="" curdata.events="{};" (type="" in="" events)="" (i="0," l="events[" ].length;="" <="" l;="" jquery.event.add(dest,="" events[="" ][="" ]);="" make="" cloned="" public="" data="" object="" copy="" from="" original="" (curdata.data)="" curdata.data="jQuery.extend({}," curdata.data);="" fixclonenodeissues(src,="" nodename,="" e,="" data;="" we="" do="" not="" need="" to="" anything="" non-elements="" 1)="" nodename="dest.nodeName.toLowerCase();" ie6-8="" copies="" bound="" via="" attachevent="" when="" using="" clonenode.="" (!support.nocloneevent="" dest[="" jquery.expando="" ])="" (e="" data.events)="" jquery.removeevent(dest,="" data.handle);="" event="" gets="" referenced="" instead="" copied="" expando="" too="" dest.removeattribute(jquery.expando);="" ie="" blanks="" contents="" cloning="" scripts,="" and="" tries="" evaluate="" newly-set="" text="" (nodename="==" "script"="" dest.text="" src.text)="" disablescript(dest).text="src.text;" restorescript(dest);="" ie6-10="" improperly="" clones="" children="" classid.="" ie10="" throws="" nomodificationallowederror="" parent="" is="" null,="" #12132.="" "object")="" (dest.parentnode)="" dest.outerhtml="src.outerHTML;" this="" path="" appears="" unavoidable="" ie9.="" an="" element="" ie9,="" outerhtml="" strategy="" above="" sufficient.="" src="" has="" innerhtml="" destination="" does="" not,="" src.innerhtml="" into="" dest.innerhtml.="" #10324="" (support.html5clone="" (="" !jquery.trim(dest.innerhtml)="" ))="" dest.innerhtml="src.innerHTML;" "input"="" rcheckabletype.test(src.type))="" fails="" persist="" checked state="" checkbox="" or="" radio="" button.="" worse,="" ie6-7="" fail="" give="" appearance="" defaultchecked="" value="" isn't="" also="" set="" dest.defaultchecked="dest.checked" =="" src.checked;="" get="" confused="" end="" up="" setting="" button="" empty="" string="" "on"="" (dest.value="" src.value)="" dest.value="src.value;" selected option="" default options="" "option")="" dest.defaultselected="dest.selected" src.defaultselected;="" defaultvalue="" correct="" other="" types="" input="" fields="" "textarea")="" dest.defaultvalue="src.defaultValue;" jquery.extend({="" clone:="" (elem,="" dataandevents,="" deepdataandevents)="" destelements,="" node,="" clone,="" srcelements,="" inpage="jQuery.contains(elem.ownerDocument," elem);="" jquery.isxmldoc(elem)="" !rnoshimcache.test("<"="" elem.nodename="">")) {2626 clone = elem.cloneNode(true);2627 // IE<=8 1="" 2="" does="" not="" properly="" clone="" detached,="" unknown="" element="" nodes="" }="" else="" {="" fragmentdiv.innerhtml="elem.outerHTML;" fragmentdiv.removechild(clone="fragmentDiv.firstChild);" if="" ((!support.nocloneevent="" ||="" !support.noclonechecked)="" &&="" (elem.nodetype="==" elem.nodetype="==" 11)="" !jquery.isxmldoc(elem))="" we="" eschew="" sizzle="" here="" for="" performance="" reasons:="" http:="" jsperf.com="" getall-vs-sizzle="" destelements="getAll(clone);" srcelements="getAll(elem);" fix="" all="" ie="" cloning="" issues="" (i="0;" (node="srcElements[i])" !="null;" ++i)="" ensure="" that="" the="" destination="" node="" is="" null;="" fixes="" #9587="" (destelements[i])="" fixclonenodeissues(node,="" destelements[i]);="" copy="" events="" from="" original="" to="" (dataandevents)="" (deepdataandevents)="" getall(elem);="" getall(clone);="" i++)="" clonecopyevent(node,="" clonecopyevent(elem,="" clone);="" preserve="" script="" evaluation="" history="" "script");="" (destelements.length=""> 0) {2628 setGlobalEval(destElements, !inPage && getAll(elem, "script"));2629 }2630 destElements = srcElements = node = null;2631 // Return the cloned set2632 return clone;2633 },2634 buildFragment: function (elems, context, scripts, selection) {2635 var j, elem, contains,2636 tmp, tag, tbody, wrap,2637 l = elems.length,2638 // Ensure a safe fragment2639 safe = createSafeFragment(context),2640 nodes = [],2641 i = 0;2642 for (; i < l; i++) {2643 elem = elems[ i ];2644 if (elem || elem === 0) {2645 // Add nodes directly2646 if (jQuery.type(elem) === "object") {2647 jQuery.merge(nodes, elem.nodeType ? [ elem ] : elem);2648 // Convert non-html into a text node2649 } else if (!rhtml.test(elem)) {2650 nodes.push(context.createTextNode(elem));2651 // Convert html into DOM nodes2652 } else {2653 tmp = tmp || safe.appendChild(context.createElement("div"));2654 // Deserialize a standard representation2655 tag = (rtagName.exec(elem) || [ "", "" ])[ 1 ].toLowerCase();2656 wrap = wrapMap[ tag ] || wrapMap._default;2657 tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1>") + wrap[2];2658 // Descend through wrappers to the right content2659 j = wrap[0];2660 while (j--) {2661 tmp = tmp.lastChild;2662 }2663 // Manually add leading whitespace removed by IE2664 if (!support.leadingWhitespace && rleadingWhitespace.test(elem)) {2665 nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0]));2666 }2667 // Remove IE's autoinserted <tbody> from table fragments2668 if (!support.tbody) {2669 // String was a <table>, *may* have spurious <tbody>2670 elem = tag === "table" && !rtbody.test(elem) ?2671 tmp.firstChild :2672 // String was a bare <thead> or <tfoot>2673 wrap[1] === "<table>" && !rtbody.test(elem) ?2674 tmp :2675 0;2676 j = elem && elem.childNodes.length;2677 while (j--) {2678 if (jQuery.nodeName((tbody = elem.childNodes[j]), "tbody") && !tbody.childNodes.length) {2679 elem.removeChild(tbody);2680 }2681 }2682 }2683 jQuery.merge(nodes, tmp.childNodes);2684 // Fix #12392 for WebKit and IE > 92685 tmp.textContent = "";2686 // Fix #12392 for oldIE2687 while (tmp.firstChild) {2688 tmp.removeChild(tmp.firstChild);2689 }2690 // Remember the top-level container for proper cleanup2691 tmp = safe.lastChild;2692 }2693 }2694 }2695 // Fix #11356: Clear elements from fragment2696 if (tmp) {2697 safe.removeChild(tmp);2698 }2699 // Reset defaultChecked for any radios and checkboxes2700 // about to be appended to the DOM in IE 6/7 (#8060)2701 if (!support.appendChecked) {2702 jQuery.grep(getAll(nodes, "input"), fixDefaultChecked);2703 }2704 i = 0;2705 while ((elem = nodes[ i++ ])) {2706 // #4087 - If origin and destination elements are the same, and this is2707 // that element, do not do anything2708 if (selection && jQuery.inArray(elem, selection) !== -1) {2709 continue;2710 }2711 contains = jQuery.contains(elem.ownerDocument, elem);2712 // Append to fragment2713 tmp = getAll(safe.appendChild(elem), "script");2714 // Preserve script evaluation history2715 if (contains) {2716 setGlobalEval(tmp);2717 }2718 // Capture executables2719 if (scripts) {2720 j = 0;2721 while ((elem = tmp[ j++ ])) {2722 if (rscriptType.test(elem.type || "")) {2723 scripts.push(elem);2724 }2725 }2726 }2727 }2728 tmp = null;2729 return safe;2730 },2731 cleanData: function (elems, /* internal */ acceptData) {2732 var elem, type, id, data,2733 i = 0,2734 internalKey = jQuery.expando,2735 cache = jQuery.cache,2736 deleteExpando = support.deleteExpando,2737 special = jQuery.event.special;2738 for (; (elem = elems[i]) != null; i++) {2739 if (acceptData || jQuery.acceptData(elem)) {2740 id = elem[ internalKey ];2741 data = id && cache[ id ];2742 if (data) {2743 if (data.events) {2744 for (type in data.events) {2745 if (special[ type ]) {2746 jQuery.event.remove(elem, type);2747 // This is a shortcut to avoid jQuery.event.remove's overhead2748 } else {2749 jQuery.removeEvent(elem, type, data.handle);2750 }2751 }2752 }2753 // Remove cache only if it was not already removed by jQuery.event.remove2754 if (cache[ id ]) {2755 delete cache[ id ];2756 // IE does not allow us to delete expando properties from nodes,2757 // nor does it have a removeAttribute function on Document nodes;2758 // we must handle all of these cases2759 if (deleteExpando) {2760 delete elem[ internalKey ];2761 } else if (typeof elem.removeAttribute !== strundefined) {2762 elem.removeAttribute(internalKey);2763 } else {2764 elem[ internalKey ] = null;2765 }2766 deletedIds.push(id);2767 }2768 }2769 }2770 }2771 }2772 });2773 jQuery.fn.extend({2774 text: function (value) {2775 return access(this, function (value) {2776 return value === undefined ?2777 jQuery.text(this) :2778 this.empty().append(( this[0] && this[0].ownerDocument || document ).createTextNode(value));2779 }, null, value, arguments.length);2780 },2781 append: function () {2782 return this.domManip(arguments, function (elem) {2783 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {2784 var target = manipulationTarget(this, elem);2785 target.appendChild(elem);2786 }2787 });2788 },2789 prepend: function () {2790 return this.domManip(arguments, function (elem) {2791 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {2792 var target = manipulationTarget(this, elem);2793 target.insertBefore(elem, target.firstChild);2794 }2795 });2796 },2797 before: function () {2798 return this.domManip(arguments, function (elem) {2799 if (this.parentNode) {2800 this.parentNode.insertBefore(elem, this);2801 }2802 });2803 },2804 after: function () {2805 return this.domManip(arguments, function (elem) {2806 if (this.parentNode) {2807 this.parentNode.insertBefore(elem, this.nextSibling);2808 }2809 });2810 },2811 remove: function (selector, keepData /* Internal Use Only */) {2812 var elem,2813 elems = selector ? jQuery.filter(selector, this) : this,2814 i = 0;2815 for (; (elem = elems[i]) != null; i++) {2816 if (!keepData && elem.nodeType === 1) {2817 jQuery.cleanData(getAll(elem));2818 }2819 if (elem.parentNode) {2820 if (keepData && jQuery.contains(elem.ownerDocument, elem)) {2821 setGlobalEval(getAll(elem, "script"));2822 }2823 elem.parentNode.removeChild(elem);2824 }2825 }2826 return this;2827 },2828 empty: function () {2829 var elem,2830 i = 0;2831 for (; (elem = this[i]) != null; i++) {2832 // Remove element nodes and prevent memory leaks2833 if (elem.nodeType === 1) {2834 jQuery.cleanData(getAll(elem, false));2835 }2836 // Remove any remaining nodes2837 while (elem.firstChild) {2838 elem.removeChild(elem.firstChild);2839 }2840 // If this is a select, ensure that it displays empty (#12336)2841 // Support: IE<9 0="" 1="" if="" (elem.options="" &&="" jquery.nodename(elem,="" "select"))="" {="" elem.options.length="0;" }="" return="" this;="" },="" clone:="" function="" (dataandevents,="" deepdataandevents)="" dataandevents="dataAndEvents" =="null" ?="" false="" :="" dataandevents;="" deepdataandevents="deepDataAndEvents" deepdataandevents;="" this.map(function="" ()="" jquery.clone(this,="" dataandevents,="" deepdataandevents);="" });="" html:="" (value)="" access(this,="" var="" elem="this[" ]="" ||="" {},="" i="0," l="this.length;" (value="==" undefined)="" elem.nodetype="==" elem.innerhtml.replace(rinlinejquery,="" "")="" undefined;="" see="" we="" can="" take="" a="" shortcut="" and="" just="" use="" innerhtml="" (typeof="" value="==" "string"="" !rnoinnerhtml.test(value)="" (="" support.htmlserialize="" !rnoshimcache.test(value)="" )="" support.leadingwhitespace="" !rleadingwhitespace.test(value)="" !wrapmap[="" (rtagname.exec(value)="" [="" "",="" ""="" ])[="" ].tolowercase()="" ])="" "<$1="">");2842 try {2843 for (; i < l; i++) {2844 // Remove element nodes and prevent memory leaks2845 elem = this[i] || {};2846 if (elem.nodeType === 1) {2847 jQuery.cleanData(getAll(elem, false));2848 elem.innerHTML = value;2849 }2850 }2851 elem = 0;2852 // If using innerHTML throws an exception, use the fallback method2853 } catch (e) {2854 }2855 }2856 if (elem) {2857 this.empty().append(value);2858 }2859 }, null, value, arguments.length);2860 },2861 replaceWith: function () {2862 var arg = arguments[ 0 ];2863 // Make the changes, replacing each context element with the new content2864 this.domManip(arguments, function (elem) {2865 arg = this.parentNode;2866 jQuery.cleanData(getAll(this));2867 if (arg) {2868 arg.replaceChild(elem, this);2869 }2870 });2871 // Force removal if there was no new content (e.g., from empty arguments)2872 return arg && (arg.length || arg.nodeType) ? this : this.remove();2873 },2874 detach: function (selector) {2875 return this.remove(selector, true);2876 },2877 domManip: function (args, callback) {2878 // Flatten any nested arrays2879 args = concat.apply([], args);2880 var first, node, hasScripts,2881 scripts, doc, fragment,2882 i = 0,2883 l = this.length,2884 set = this,2885 iNoClone = l - 1,2886 value = args[0],2887 isFunction = jQuery.isFunction(value);2888 // We can't cloneNode fragments that contain checked, in WebKit2889 if (isFunction ||2890 ( l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value) )) {2891 return this.each(function (index) {2892 var self = set.eq(index);2893 if (isFunction) {2894 args[0] = value.call(this, index, self.html());2895 }2896 self.domManip(args, callback);2897 });2898 }2899 if (l) {2900 fragment = jQuery.buildFragment(args, this[ 0 ].ownerDocument, false, this);2901 first = fragment.firstChild;2902 if (fragment.childNodes.length === 1) {2903 fragment = first;2904 }2905 if (first) {2906 scripts = jQuery.map(getAll(fragment, "script"), disableScript);2907 hasScripts = scripts.length;2908 // Use the original fragment for the last item instead of the first because it can end up2909 // being emptied incorrectly in certain situations (#8070).2910 for (; i < l; i++) {2911 node = fragment;2912 if (i !== iNoClone) {2913 node = jQuery.clone(node, true, true);2914 // Keep references to cloned scripts for later restoration2915 if (hasScripts) {2916 jQuery.merge(scripts, getAll(node, "script"));2917 }2918 }2919 callback.call(this[i], node, i);2920 }2921 if (hasScripts) {2922 doc = scripts[ scripts.length - 1 ].ownerDocument;2923 // Reenable scripts2924 jQuery.map(scripts, restoreScript);2925 // Evaluate executable scripts on first document insertion2926 for (i = 0; i < hasScripts; i++) {2927 node = scripts[ i ];2928 if (rscriptType.test(node.type || "") && !jQuery._data(node, "globalEval") && jQuery.contains(doc, node)) {2929 if (node.src) {2930 // Optional AJAX dependency, but won't run scripts if not present2931 if (jQuery._evalUrl) {2932 jQuery._evalUrl(node.src);2933 }2934 } else {2935 jQuery.globalEval(( node.text || node.textContent || node.innerHTML || "" ).replace(rcleanScript, ""));2936 }2937 }2938 }2939 }2940 // Fix #11809: Avoid leaking memory2941 fragment = first = null;2942 }2943 }2944 return this;2945 }2946 });2947 jQuery.each({2948 appendTo: "append",2949 prependTo: "prepend",2950 insertBefore: "before",2951 insertAfter: "after",2952 replaceAll: "replaceWith"2953 }, function (name, original) {2954 jQuery.fn[ name ] = function (selector) {2955 var elems,2956 i = 0,2957 ret = [],2958 insert = jQuery(selector),2959 last = insert.length - 1;2960 for (; i <= 0="" last;="" i++)="" {="" elems="i" =="=" last="" ?="" this="" :="" this.clone(true);="" jquery(insert[i])[="" original="" ](elems);="" modern="" browsers="" can="" apply="" jquery="" collections="" as="" arrays,="" but="" oldie="" needs="" a="" .get()="" push.apply(ret,="" elems.get());="" }="" return="" this.pushstack(ret);="" };="" });="" var="" iframe,="" elemdisplay="{};" **="" *="" retrieve="" the="" actual="" display="" of="" element="" @param="" {string}="" name="" nodename="" {object}="" doc="" document="" object="" called="" only="" from="" within="" defaultdisplay="" function="" actualdisplay(name,="" doc)="" elem="jQuery(doc.createElement(name)).appendTo(doc.body)," getdefaultcomputedstyle="" might="" be="" reliably="" used="" on="" attached="" use="" method="" is="" temporary="" fix="" (more="" like="" optmization)="" until="" something="" better="" comes="" along,="" since="" it="" was="" removed="" specification="" and="" supported="" in="" ff="" window.getdefaultcomputedstyle(elem[="" ]).display="" jquery.css(elem[="" ],="" "display");="" we="" don't="" have="" any="" data="" stored="" element,="" so="" "detach"="" fast="" way="" to="" get="" rid="" elem.detach();="" display;="" try="" determine="" default value="" an="" defaultdisplay(nodename)="" ];="" if="" (!display)="" doc);="" simple="" fails,="" read="" inside="" iframe="" (display="==" "none"="" ||="" !display)="" already-created="" possible="" jquery("<iframe="" frameborder="0" width="0" height="0">")).appendTo(doc.documentElement);2961 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse2962 doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;2963 // Support: IE2964 doc.write();2965 doc.close();2966 display = actualDisplay(nodeName, doc);2967 iframe.detach();2968 }2969 // Store the correct default display2970 elemdisplay[ nodeName ] = display;2971 }2972 return display;2973 }2974 (function () {2975 var a, shrinkWrapBlocksVal,2976 div = document.createElement("div"),2977 divReset =2978 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" +2979 "display:block;padding:0;margin:0;border:0";2980 // Setup2981 div.innerHTML = " <link><table></table><a href="/a">a</a><input type="checkbox">";2982 a = div.getElementsByTagName("a")[ 0 ];2983 a.style.cssText = "float:left;opacity:.5";2984 // Make sure that element opacity exists2985 // (IE uses filter instead)2986 // Use a regex to work around a WebKit issue. See #51452987 support.opacity = /^0.5/.test(a.style.opacity);2988 // Verify style float existence2989 // (IE uses styleFloat instead of cssFloat)2990 support.cssFloat = !!a.style.cssFloat;2991 div.style.backgroundClip = "content-box";2992 div.cloneNode(true).style.backgroundClip = "";2993 support.clearCloneStyle = div.style.backgroundClip === "content-box";2994 // Null elements to avoid leaks in IE.2995 a = div = null;2996 support.shrinkWrapBlocks = function () {2997 var body, container, div, containerStyles;2998 if (shrinkWrapBlocksVal == null) {2999 body = document.getElementsByTagName("body")[ 0 ];3000 if (!body) {3001 // Test fired too early or in an unsupported environment, exit.3002 return;3003 }3004 containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px";3005 container = document.createElement("div");3006 div = document.createElement("div");3007 body.appendChild(container).appendChild(div);3008 // Will be changed later if needed.3009 shrinkWrapBlocksVal = false;3010 if (typeof div.style.zoom !== strundefined) {3011 // Support: IE63012 // Check if elements with layout shrink-wrap their children3013 div.style.cssText = divReset + ";width:1px;padding:1px;zoom:1";3014 div.innerHTML = "<div></div>";3015 div.firstChild.style.width = "5px";3016 shrinkWrapBlocksVal = div.offsetWidth !== 3;3017 }3018 body.removeChild(container);3019 // Null elements to avoid leaks in IE.3020 body = container = div = null;3021 }3022 return shrinkWrapBlocksVal;3023 };3024 })();3025 var rmargin = (/^margin/);3026 var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");3027 var getStyles, curCSS,3028 rposition = /^(top|right|bottom|left)$/;3029 if (window.getComputedStyle) {3030 getStyles = function (elem) {3031 return elem.ownerDocument.defaultView.getComputedStyle(elem, null);3032 };3033 curCSS = function (elem, name, computed) {3034 var width, minWidth, maxWidth, ret,3035 style = elem.style;3036 computed = computed || getStyles(elem);3037 // getPropertyValue is only needed for .css('filter') in IE9, see #125373038 ret = computed ? computed.getPropertyValue(name) || computed[ name ] : undefined;3039 if (computed) {3040 if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) {3041 ret = jQuery.style(elem, name);3042 }3043 // A tribute to the "awesome hack by Dean Edwards"3044 // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right3045 // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels3046 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values3047 if (rnumnonpx.test(ret) && rmargin.test(name)) {3048 // Remember the original values3049 width = style.width;3050 minWidth = style.minWidth;3051 maxWidth = style.maxWidth;3052 // Put in the new values to get a computed value out3053 style.minWidth = style.maxWidth = style.width = ret;3054 ret = computed.width;3055 // Revert the changed values3056 style.width = width;3057 style.minWidth = minWidth;3058 style.maxWidth = maxWidth;3059 }3060 }3061 // Support: IE3062 // IE returns zIndex value as an integer.3063 return ret === undefined ?3064 ret :3065 ret + "";3066 };3067 } else if (document.documentElement.currentStyle) {3068 getStyles = function (elem) {3069 return elem.currentStyle;3070 };3071 curCSS = function (elem, name, computed) {3072 var left, rs, rsLeft, ret,3073 style = elem.style;3074 computed = computed || getStyles(elem);3075 ret = computed ? computed[ name ] : undefined;3076 // Avoid setting ret to empty string here3077 // so we don't default to auto3078 if (ret == null && style && style[ name ]) {3079 ret = style[ name ];3080 }3081 // From the awesome hack by Dean Edwards3082 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-1022913083 // If we're not dealing with a regular pixel number3084 // but a number that has a weird ending, we need to convert it to pixels3085 // but not position css attributes, as those are proportional to the parent element instead3086 // and we can't measure the parent instead because it might trigger a "stacking dolls" problem3087 if (rnumnonpx.test(ret) && !rposition.test(name)) {3088 // Remember the original values3089 left = style.left;3090 rs = elem.runtimeStyle;3091 rsLeft = rs && rs.left;3092 // Put in the new values to get a computed value out3093 if (rsLeft) {3094 rs.left = elem.currentStyle.left;3095 }3096 style.left = name === "fontSize" ? "1em" : ret;3097 ret = style.pixelLeft + "px";3098 // Revert the changed values3099 style.left = left;3100 if (rsLeft) {3101 rs.left = rsLeft;3102 }3103 }3104 // Support: IE3105 // IE returns zIndex value as an integer.3106 return ret === undefined ?3107 ret :3108 ret + "" || "auto";3109 };3110 }3111 function addGetHookIf(conditionFn, hookFn) {3112 // Define the hook, we'll check on the first run if it's really needed.3113 return {3114 get: function () {3115 var condition = conditionFn();3116 if (condition == null) {3117 // The test was not ready at this point; screw the hook this time3118 // but check again when needed next time.3119 return;3120 }3121 if (condition) {3122 // Hook not needed (or it's not possible to use it due to missing dependency),3123 // remove it.3124 // Since there are no other hooks for marginRight, remove the whole object.3125 delete this.get;3126 return;3127 }3128 // Hook needed; redefine it so that the support test is not executed again.3129 return (this.get = hookFn).apply(this, arguments);3130 }3131 };3132 }3133 (function () {3134 var a, reliableHiddenOffsetsVal, boxSizingVal, boxSizingReliableVal,3135 pixelPositionVal, reliableMarginRightVal,3136 div = document.createElement("div"),3137 containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px",3138 divReset =3139 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" +3140 "display:block;padding:0;margin:0;border:0";3141 // Setup3142 div.innerHTML = " <link><table></table><a href="/a">a</a><input type="checkbox">";3143 a = div.getElementsByTagName("a")[ 0 ];3144 a.style.cssText = "float:left;opacity:.5";3145 // Make sure that element opacity exists3146 // (IE uses filter instead)3147 // Use a regex to work around a WebKit issue. See #51453148 support.opacity = /^0.5/.test(a.style.opacity);3149 // Verify style float existence3150 // (IE uses styleFloat instead of cssFloat)3151 support.cssFloat = !!a.style.cssFloat;3152 div.style.backgroundClip = "content-box";3153 div.cloneNode(true).style.backgroundClip = "";3154 support.clearCloneStyle = div.style.backgroundClip === "content-box";3155 // Null elements to avoid leaks in IE.3156 a = div = null;3157 jQuery.extend(support, {3158 reliableHiddenOffsets: function () {3159 if (reliableHiddenOffsetsVal != null) {3160 return reliableHiddenOffsetsVal;3161 }3162 var container, tds, isSupported,3163 div = document.createElement("div"),3164 body = document.getElementsByTagName("body")[ 0 ];3165 if (!body) {3166 // Return for frameset docs that don't have a body3167 return;3168 }3169 // Setup3170 div.setAttribute("className", "t");3171 div.innerHTML = " <link><table></table><a href="/a">a</a><input type="checkbox">";3172 container = document.createElement("div");3173 container.style.cssText = containerStyles;3174 body.appendChild(container).appendChild(div);3175 // Support: IE83176 // Check if table cells still have offsetWidth/Height when they are set3177 // to display:none and there are still other visible table cells in a3178 // table row; if so, offsetWidth/Height are not reliable for use when3179 // determining if an element has been hidden directly using3180 // display:none (it is still safe to use offsets if a parent element is3181 // hidden; don safety goggles and see bug #4512 for more information).3182 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";3183 tds = div.getElementsByTagName("td");3184 tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";3185 isSupported = ( tds[ 0 ].offsetHeight === 0 );3186 tds[ 0 ].style.display = "";3187 tds[ 1 ].style.display = "none";3188 // Support: IE83189 // Check if empty table cells still have offsetWidth/Height3190 reliableHiddenOffsetsVal = isSupported && ( tds[ 0 ].offsetHeight === 0 );3191 body.removeChild(container);3192 // Null elements to avoid leaks in IE.3193 div = body = null;3194 return reliableHiddenOffsetsVal;3195 },3196 boxSizing: function () {3197 if (boxSizingVal == null) {3198 computeStyleTests();3199 }3200 return boxSizingVal;3201 },3202 boxSizingReliable: function () {3203 if (boxSizingReliableVal == null) {3204 computeStyleTests();3205 }3206 return boxSizingReliableVal;3207 },3208 pixelPosition: function () {3209 if (pixelPositionVal == null) {3210 computeStyleTests();3211 }3212 return pixelPositionVal;3213 },3214 reliableMarginRight: function () {3215 var body, container, div, marginDiv;3216 // Use window.getComputedStyle because jsdom on node.js will break without it.3217 if (reliableMarginRightVal == null && window.getComputedStyle) {3218 body = document.getElementsByTagName("body")[ 0 ];3219 if (!body) {3220 // Test fired too early or in an unsupported environment, exit.3221 return;3222 }3223 container = document.createElement("div");3224 div = document.createElement("div");3225 container.style.cssText = containerStyles;3226 body.appendChild(container).appendChild(div);3227 // Check if div with explicit width and no margin-right incorrectly3228 // gets computed margin-right based on width of container. (#3333)3229 // Fails in WebKit before Feb 2011 nightlies3230 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right3231 marginDiv = div.appendChild(document.createElement("div"));3232 marginDiv.style.cssText = div.style.cssText = divReset;3233 marginDiv.style.marginRight = marginDiv.style.width = "0";3234 div.style.width = "1px";3235 reliableMarginRightVal = !parseFloat(( window.getComputedStyle(marginDiv, null) || {} ).marginRight);3236 body.removeChild(container);3237 }3238 return reliableMarginRightVal;3239 }3240 });3241 function computeStyleTests() {3242 var container, div,3243 body = document.getElementsByTagName("body")[ 0 ];3244 if (!body) {3245 // Test fired too early or in an unsupported environment, exit.3246 return;3247 }3248 container = document.createElement("div");3249 div = document.createElement("div");3250 container.style.cssText = containerStyles;3251 body.appendChild(container).appendChild(div);3252 div.style.cssText =3253 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +3254 "position:absolute;display:block;padding:1px;border:1px;width:4px;" +3255 "margin-top:1%;top:1%";3256 // Workaround failing boxSizing test due to offsetWidth returning wrong value3257 // with some non-1 values of body zoom, ticket #135433258 jQuery.swap(body, body.style.zoom != null ? { zoom: 1 } : {}, function () {3259 boxSizingVal = div.offsetWidth === 4;3260 });3261 // Will be changed later if needed.3262 boxSizingReliableVal = true;3263 pixelPositionVal = false;3264 reliableMarginRightVal = true;3265 // Use window.getComputedStyle because jsdom on node.js will break without it.3266 if (window.getComputedStyle) {3267 pixelPositionVal = ( window.getComputedStyle(div, null) || {} ).top !== "1%";3268 boxSizingReliableVal =3269 ( window.getComputedStyle(div, null) || { width: "4px" } ).width === "4px";3270 }3271 body.removeChild(container);3272 // Null elements to avoid leaks in IE.3273 div = body = null;3274 }3275 })();3276// A method for quickly swapping in/out CSS properties to get correct calculations.3277 jQuery.swap = function (elem, options, callback, args) {3278 var ret, name,3279 old = {};3280 // Remember the old values, and insert the new ones3281 for (name in options) {3282 old[ name ] = elem.style[ name ];3283 elem.style[ name ] = options[ name ];3284 }3285 ret = callback.apply(elem, args || []);3286 // Revert the old values3287 for (name in options) {3288 elem.style[ name ] = old[ name ];3289 }3290 return ret;3291 };3292 var3293 ralpha = /alpha\([^)]*\)/i,3294 ropacity = /opacity\s*=\s*([^)]*)/,3295 // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"3296 // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display3297 rdisplayswap = /^(none|table(?!-c[ea]).+)/,3298 rnumsplit = new RegExp("^(" + pnum + ")(.*)$", "i"),3299 rrelNum = new RegExp("^([+-])=(" + pnum + ")", "i"),3300 cssShow = { position: "absolute", visibility: "hidden", display: "block" },3301 cssNormalTransform = {3302 letterSpacing: 0,3303 fontWeight: 4003304 },3305 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];3306// return a css property mapped to a potentially vendor prefixed property3307 function vendorPropName(style, name) {3308 // shortcut for names that are not vendor prefixed3309 if (name in style) {3310 return name;3311 }3312 // check for vendor prefixed names3313 var capName = name.charAt(0).toUpperCase() + name.slice(1),3314 origName = name,3315 i = cssPrefixes.length;3316 while (i--) {3317 name = cssPrefixes[ i ] + capName;3318 if (name in style) {3319 return name;3320 }3321 }3322 return origName;3323 }3324 function showHide(elements, show) {3325 var display, elem, hidden,3326 values = [],3327 index = 0,3328 length = elements.length;3329 for (; index < length; index++) {3330 elem = elements[ index ];3331 if (!elem.style) {3332 continue;3333 }3334 values[ index ] = jQuery._data(elem, "olddisplay");3335 display = elem.style.display;3336 if (show) {3337 // Reset the inline display of this element to learn if it is3338 // being hidden by cascaded rules or not3339 if (!values[ index ] && display === "none") {3340 elem.style.display = "";3341 }3342 // Set elements which have been overridden with display: none3343 // in a stylesheet to whatever the default browser style is3344 // for such an element3345 if (elem.style.display === "" && isHidden(elem)) {3346 values[ index ] = jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));3347 }3348 } else {3349 if (!values[ index ]) {3350 hidden = isHidden(elem);3351 if (display && display !== "none" || !hidden) {3352 jQuery._data(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display"));3353 }3354 }3355 }3356 }3357 // Set the display of most of the elements in a second loop3358 // to avoid the constant reflow3359 for (index = 0; index < length; index++) {3360 elem = elements[ index ];3361 if (!elem.style) {3362 continue;3363 }3364 if (!show || elem.style.display === "none" || elem.style.display === "") {3365 elem.style.display = show ? values[ index ] || "" : "none";3366 }3367 }3368 return elements;3369 }3370 function setPositiveNumber(elem, value, subtract) {3371 var matches = rnumsplit.exec(value);3372 return matches ?3373 // Guard against undefined "subtract", e.g., when used as in cssHooks3374 Math.max(0, matches[ 1 ] - ( subtract || 0 )) + ( matches[ 2 ] || "px" ) :3375 value;3376 }3377 function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) {3378 var i = extra === ( isBorderBox ? "border" : "content" ) ?3379 // If we already have the right measurement, avoid augmentation3380 4 :3381 // Otherwise initialize for horizontal or vertical properties3382 name === "width" ? 1 : 0,3383 val = 0;3384 for (; i < 4; i += 2) {3385 // both box models exclude margin, so add it if we want it3386 if (extra === "margin") {3387 val += jQuery.css(elem, extra + cssExpand[ i ], true, styles);3388 }3389 if (isBorderBox) {3390 // border-box includes padding, so remove it if we want content3391 if (extra === "content") {3392 val -= jQuery.css(elem, "padding" + cssExpand[ i ], true, styles);3393 }3394 // at this point, extra isn't border nor margin, so remove border3395 if (extra !== "margin") {3396 val -= jQuery.css(elem, "border" + cssExpand[ i ] + "Width", true, styles);3397 }3398 } else {3399 // at this point, extra isn't content, so add padding3400 val += jQuery.css(elem, "padding" + cssExpand[ i ], true, styles);3401 // at this point, extra isn't content nor padding, so add border3402 if (extra !== "padding") {3403 val += jQuery.css(elem, "border" + cssExpand[ i ] + "Width", true, styles);3404 }3405 }3406 }3407 return val;3408 }3409 function getWidthOrHeight(elem, name, extra) {3410 // Start with offset property, which is equivalent to the border-box value3411 var valueIsBorderBox = true,3412 val = name === "width" ? elem.offsetWidth : elem.offsetHeight,3413 styles = getStyles(elem),3414 isBorderBox = support.boxSizing() && jQuery.css(elem, "boxSizing", false, styles) === "border-box";3415 // some non-html elements return undefined for offsetWidth, so check for null/undefined3416 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=6492853417 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=4916683418 if (val <= 0="" 1="" 3="" 8="" ||="" val="=" null)="" {="" fall="" back="" to="" computed="" then="" uncomputed="" css="" if="" necessary="" name,="" styles);="" (val="" <="" name="" ];="" }="" unit="" is="" not="" pixels.="" stop="" here="" and="" return.="" (rnumnonpx.test(val))="" return="" val;="" we="" need="" the="" check="" for="" style="" in="" case="" a="" browser="" which="" returns="" unreliable="" values="" getcomputedstyle="" silently="" falls="" reliable="" elem.style="" valueisborderbox="isBorderBox" &&="" (="" support.boxsizingreliable()="" elem.style[="" ]="" );="" normalize="" "",="" auto,="" prepare="" extra="" 0;="" use="" active="" box-sizing="" model="" add="" subtract="" irrelevant="" styles="" +="" augmentwidthorheight(="" elem,="" isborderbox="" ?="" "border"="" :="" "content"="" ),="" valueisborderbox,="" )="" "px";="" jquery.extend({="" property="" hooks="" overriding="" default behavior="" of="" getting="" setting="" csshooks:="" opacity:="" get:="" function="" (elem,="" computed)="" (computed)="" should="" always="" get="" number="" from="" opacity="" var="" ret="curCSS(elem," "opacity");="" ""="" "1"="" ret;="" },="" don't="" automatically="" "px"="" these="" possibly-unitless="" properties="" cssnumber:="" "columncount":="" true,="" "fillopacity":="" "fontweight":="" "lineheight":="" "opacity":="" "order":="" "orphans":="" "widows":="" "zindex":="" "zoom":="" true="" whose="" names="" you="" wish="" fix="" before="" or="" value="" cssprops:="" float="" "float":="" support.cssfloat="" "cssfloat"="" "stylefloat"="" set="" on="" dom="" node="" style:="" value,="" extra)="" text="" comment="" nodes="" (!elem="" elem.nodetype="==" !elem.style)="" return;="" make="" sure="" that="" we're="" working="" with="" right="" ret,="" type,="" hooks,="" origname="jQuery.camelCase(name)," jquery.cssprops[="" origname)="" gets="" hook="" prefixed="" version="" followed="" by="" unprefixed="" jquery.csshooks[="" (value="" !="=" undefined)="" type="typeof" value;="" convert="" relative="" strings="" (+="or" -=")" numbers.="" #7345="" (type="==" "string"="" (ret="rrelNum.exec(value)))" ret[1]="" *="" ret[2]="" parsefloat(jquery.css(elem,="" name));="" fixes="" bug="" #9237="" ;="" null="" nan="" aren't="" set.="" see:="" #7116="" value)="" was="" passed="" in,="" 'px'="" (except="" certain="" properties)="" "number"="" !jquery.cssnumber[="" ])="" #8908,="" it="" can="" be="" done="" more="" correctly="" specifing="" setters="" csshooks,="" but="" would="" mean="" define="" eight="" (for="" every="" problematic="" property)="" identical="" functions="" (!support.clearclonestyle="" name.indexof("background")="==" 0)="" style[="" provided,="" otherwise="" just="" specified="" (!hooks="" !("set"="" hooks)="" extra))="" support:="" ie="" swallow="" errors="" 'invalid'="" (#5509)="" try="" chrome,="" safari="" blank="" string="" required delete="" "style:="" x="" !important;"="" catch="" (e)="" else="" provided="" non-computed="" there="" (hooks="" "get"="" false,="" object="" css:="" extra,="" styles)="" num,="" val,="" extra);="" otherwise,="" way="" exists,="" "normal"="" cssnormaltransform)="" return,="" converting="" forced="" qualifier="" looks="" numeric="" (extra="==" num="parseFloat(val);" jquery.isnumeric(num)="" });="" jquery.each([="" "height",="" "width"="" ],="" (i,="" name)="" computed,="" elements="" have="" dimension="" info="" invisibly="" show="" them="" however,="" must="" current="" display="" benefit="" this="" elem.offsetwidth="==" rdisplayswap.test(jquery.css(elem,="" "display"))="" jquery.swap(elem,="" cssshow,="" ()="" getwidthorheight(elem,="" })="" set:="" getstyles(elem);="" setpositivenumber(elem,="" support.boxsizing()="" jquery.css(elem,="" "boxsizing",="" "border-box",="" };="" (!support.opacity)="" jquery.csshooks.opacity="{" uses="" filters="" ropacity.test((computed="" elem.currentstyle="" elem.currentstyle.filter="" elem.style.filter)="" "")="" 0.01="" parsefloat(regexp.$1)="" "";="" currentstyle="elem.currentStyle," "alpha(opacity=" + value * 100 + " )"="" filter="currentStyle" currentstyle.filter="" style.filter="" has="" trouble="" does="" layout="" force="" zoom="" level="" style.zoom="1;" 1,="" no="" other="" exist="" attempt="" remove="" attribute="" #6652="" inline="" #12685="" ((="">= 1 || value === "" ) &&3419 jQuery.trim(filter.replace(ralpha, "")) === "" &&3420 style.removeAttribute) {3421 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText3422 // if "filter:" is present at all, clearType is disabled, we want to avoid this3423 // style.removeAttribute is IE Only, but so apparently is this code path...3424 style.removeAttribute("filter");3425 // if there is no filter style applied in a css rule or unset inline opacity, we are done3426 if (value === "" || currentStyle && !currentStyle.filter) {3427 return;3428 }3429 }3430 // otherwise, set new filter values3431 style.filter = ralpha.test(filter) ?3432 filter.replace(ralpha, opacity) :3433 filter + " " + opacity;3434 }3435 };3436 }3437 jQuery.cssHooks.marginRight = addGetHookIf(support.reliableMarginRight,3438 function (elem, computed) {3439 if (computed) {3440 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right3441 // Work around by temporarily setting element display to inline-block3442 return jQuery.swap(elem, { "display": "inline-block" },3443 curCSS, [ elem, "marginRight" ]);3444 }3445 }3446 );3447// These hooks are used by animate to expand properties3448 jQuery.each({3449 margin: "",3450 padding: "",3451 border: "Width"3452 }, function (prefix, suffix) {3453 jQuery.cssHooks[ prefix + suffix ] = {3454 expand: function (value) {3455 var i = 0,3456 expanded = {},3457 // assumes a single number if not a string3458 parts = typeof value === "string" ? value.split(" ") : [ value ];3459 for (; i < 4; i++) {3460 expanded[ prefix + cssExpand[ i ] + suffix ] =3461 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];3462 }3463 return expanded;3464 }3465 };3466 if (!rmargin.test(prefix)) {3467 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;3468 }3469 });3470 jQuery.fn.extend({3471 css: function (name, value) {3472 return access(this, function (elem, name, value) {3473 var styles, len,3474 map = {},3475 i = 0;3476 if (jQuery.isArray(name)) {3477 styles = getStyles(elem);3478 len = name.length;3479 for (; i < len; i++) {3480 map[ name[ i ] ] = jQuery.css(elem, name[ i ], false, styles);3481 }3482 return map;3483 }3484 return value !== undefined ?3485 jQuery.style(elem, name, value) :3486 jQuery.css(elem, name);3487 }, name, value, arguments.length > 1);3488 },3489 show: function () {3490 return showHide(this, true);3491 },3492 hide: function () {3493 return showHide(this);3494 },3495 toggle: function (state) {3496 if (typeof state === "boolean") {3497 return state ? this.show() : this.hide();3498 }3499 return this.each(function () {3500 if (isHidden(this)) {3501 jQuery(this).show();3502 } else {3503 jQuery(this).hide();3504 }3505 });3506 }3507 });3508 function Tween(elem, options, prop, end, easing) {3509 return new Tween.prototype.init(elem, options, prop, end, easing);3510 }3511 jQuery.Tween = Tween;3512 Tween.prototype = {3513 constructor: Tween,3514 init: function (elem, options, prop, end, easing, unit) {3515 this.elem = elem;3516 this.prop = prop;3517 this.easing = easing || "swing";3518 this.options = options;3519 this.start = this.now = this.cur();3520 this.end = end;3521 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );3522 },3523 cur: function () {3524 var hooks = Tween.propHooks[ this.prop ];3525 return hooks && hooks.get ?3526 hooks.get(this) :3527 Tween.propHooks._default.get(this);3528 },3529 run: function (percent) {3530 var eased,3531 hooks = Tween.propHooks[ this.prop ];3532 if (this.options.duration) {3533 this.pos = eased = jQuery.easing[ this.easing ](3534 percent, this.options.duration * percent, 0, 1, this.options.duration3535 );3536 } else {3537 this.pos = eased = percent;3538 }3539 this.now = ( this.end - this.start ) * eased + this.start;3540 if (this.options.step) {3541 this.options.step.call(this.elem, this.now, this);3542 }3543 if (hooks && hooks.set) {3544 hooks.set(this);3545 } else {3546 Tween.propHooks._default.set(this);3547 }3548 return this;3549 }3550 };3551 Tween.prototype.init.prototype = Tween.prototype;3552 Tween.propHooks = {3553 _default: {3554 get: function (tween) {3555 var result;3556 if (tween.elem[ tween.prop ] != null &&3557 (!tween.elem.style || tween.elem.style[ tween.prop ] == null)) {3558 return tween.elem[ tween.prop ];3559 }3560 // passing an empty string as a 3rd parameter to .css will automatically3561 // attempt a parseFloat and fallback to a string if the parse fails3562 // so, simple values such as "10px" are parsed to Float.3563 // complex values such as "rotate(1rad)" are returned as is.3564 result = jQuery.css(tween.elem, tween.prop, "");3565 // Empty strings, null, undefined and "auto" are converted to 0.3566 return !result || result === "auto" ? 0 : result;3567 },3568 set: function (tween) {3569 // use step hook for back compat - use cssHook if its there - use .style if its3570 // available and use plain properties where available3571 if (jQuery.fx.step[ tween.prop ]) {3572 jQuery.fx.step[ tween.prop ](tween);3573 } else if (tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] )) {3574 jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);3575 } else {3576 tween.elem[ tween.prop ] = tween.now;3577 }3578 }3579 }3580 };3581// Support: IE <=9 0="" 1="" 2="" 3="" panic="" based="" approach="" to="" setting="" things="" on="" disconnected="" nodes="" tween.prophooks.scrolltop="Tween.propHooks.scrollLeft" =="" {="" set:="" function="" (tween)="" if="" (tween.elem.nodetype="" &&="" tween.elem.parentnode)="" tween.elem[="" tween.prop="" ]="tween.now;" }="" };="" jquery.easing="{" linear:="" (p)="" return="" p;="" },="" swing:="" 0.5="" -="" math.cos(p="" *="" math.pi)="" 2;="" jquery.fx="Tween.prototype.init;" back="" compat="" <1.8="" extension="" point="" jquery.fx.step="{};" var="" fxnow,="" timerid,="" rfxtypes="/^(?:toggle|show|hide)$/," rfxnum="new" regexp("^(?:([+-])="|)("" +="" pnum="" ")([a-z%]*)$",="" "i"),="" rrun="/queueHooks$/," animationprefilters="[" defaultprefilter="" ],="" tweeners="{" "*":="" [="" (prop,="" value)="" tween="this.createTween(prop," value),="" target="tween.cur()," parts="rfxnum.exec(value)," unit="parts" parts[="" ||="" (="" jquery.cssnumber[="" prop="" ?="" ""="" :="" "px"="" ),="" starting="" value="" computation="" is="" required for="" potential="" mismatches="" start="(" !="=" +target="" )="" rfxnum.exec(jquery.css(tween.elem,="" prop)),="" scale="1," maxiterations="20;" (start="" start[="" unit)="" trust="" units="" reported="" by="" jquery.css="" ];="" make="" sure="" we="" update="" the="" properties="" later="" [];="" iteratively="" approximate="" from="" a="" nonzero="" 1;="" do="" previous="" iteration="" zeroed="" out,="" double="" until="" get="" *something*="" use="" string="" doubling="" factor="" so="" don't="" accidentally="" see="" as="" unchanged="" below="" ".5";="" adjust="" and="" apply="" scale;="" jquery.style(tween.elem,="" prop,="" unit);="" scale,="" tolerating="" zero="" or="" nan="" tween.cur()="" breaking="" loop perfect,="" we've="" just="" had="" enough="" while="" (scale="" target)="" --maxiterations);="" (parts)="" +start="" 0;="" tween.unit="unit;" token="" was="" provided,="" we're="" doing="" relative="" animation="" tween.end="parts[" +parts[="" tween;="" animations="" created="" synchronously="" will="" run="" createfxnow()="" settimeout(function="" ()="" fxnow="undefined;" });="" );="" generate="" parameters="" create="" standard="" genfx(type,="" includewidth)="" which,="" attrs="{" height:="" type="" i="0;" include="" width,="" step="" all="" cssexpand="" values,="" skip="" over="" left="" right="" includewidth="includeWidth" (;="" <="" 4;="" which="cssExpand[" attrs[="" "margin"="" "padding"="" (includewidth)="" attrs.opacity="attrs.width" type;="" attrs;="" createtween(value,="" animation)="" tween,="" collection="(" tweeners[="" []="" ).concat(tweeners[="" "*"="" ]),="" index="0," length="collection.length;" length;="" index++)="" ((tween="collection[" ].call(animation,="" value)))="" done="" with="" this="" property="" defaultprefilter(elem,="" props,="" opts)="" jshint="" validthis:="" true="" value,="" toggle,="" hooks,="" oldfire,="" display,="" ddisplay,="" anim="this," orig="{}," style="elem.style," hidden="elem.nodeType" ishidden(elem),="" datashow="jQuery._data(elem," "fxshow");="" handle="" queue:="" false="" promises="" (!opts.queue)="" hooks="jQuery._queueHooks(elem," "fx");="" (hooks.unqueued="=" null)="" hooks.unqueued="0;" oldfire="hooks.empty.fire;" hooks.empty.fire="function" (!hooks.unqueued)="" oldfire();="" hooks.unqueued++;="" anim.always(function="" makes="" that="" complete="" handler="" be="" called="" before="" completes="" hooks.unqueued--;="" (!jquery.queue(elem,="" "fx").length)="" hooks.empty.fire();="" height="" width="" overflow="" pass="" (elem.nodetype="==" "height"="" in="" props="" "width"="" ))="" nothing="" sneaks="" out="" record="" attributes="" because="" ie="" does="" not="" change="" attribute="" when="" overflowx="" overflowy="" are="" set="" same="" opts.overflow="[" style.overflow,="" style.overflowx,="" style.overflowy="" display="" inline-block="" inline="" elements="" having="" animated="" "display");="" ddisplay="defaultDisplay(elem.nodeName);" (display="==" "none")="" "inline"="" jquery.css(elem,="" "float")="==" inline-level="" accept="" inline-block;="" block-level="" need="" layout="" (!support.inlineblockneedslayout="" "inline")="" style.display="inline-block" ;="" else="" style.zoom="1;" (opts.overflow)="" style.overflow="hidden" (!support.shrinkwrapblocks())="" style.overflowx="opts.overflow[" show="" hide="" (prop="" props)="" (rfxtypes.exec(value))="" delete="" props[="" toggle="toggle" "toggle";="" (value="==" "hide"="" "show"="" there="" stopped="" going="" proceed="" show,="" should="" pretend="" datashow[="" undefined)="" continue;="" orig[="" jquery.style(elem,="" prop);="" (!jquery.isemptyobject(orig))="" (datashow)="" ("hidden"="" datashow)="" "fxshow",="" {});="" store="" state="" its="" enables="" .stop().toggle()="" "reverse"="" (toggle)="" datashow.hidden="!hidden;" (hidden)="" jquery(elem).show();="" anim.done(function="" jquery(elem).hide();="" prop;="" jquery._removedata(elem,="" orig)="" ]);="" 0,="" anim);="" (!(="" tween.start="prop" propfilter(props,="" specialeasing)="" index,="" name,="" easing,="" hooks;="" camelcase,="" specialeasing="" expand="" csshook="" (index="" name="jQuery.camelCase(index);" easing="specialEasing[" (jquery.isarray(value))="" name)="" (hooks="" "expand"="" hooks)="" quite="" $.extend,="" wont="" overwrite="" keys="" already="" present.="" also="" reusing="" 'index'="" above="" have="" correct="" "name"="" specialeasing[="" animation(elem,="" properties,="" options)="" result,="" stopped,="" deferred="jQuery.Deferred().always(function" match="" elem="" :animated="" selector="" tick.elem;="" }),="" tick="function" (stopped)="" false;="" currenttime="fxNow" createfxnow(),="" remaining="Math.max(0," animation.starttime="" animation.duration="" currenttime),="" archaic="" crash="" bug="" won't="" allow="" us="" (#12497)="" temp="remaining" percent="1" temp,="" animation.tweens[="" ].run(percent);="" deferred.notifywith(elem,="" animation,="" percent,="" (percent="" length)="" remaining;="" deferred.resolvewith(elem,="" elem:="" elem,="" props:="" jquery.extend({},="" properties),="" opts:="" jquery.extend(true,="" specialeasing:="" {}="" options),="" originalproperties:="" originaloptions:="" options,="" starttime:="" duration:="" options.duration,="" tweens:="" [],="" createtween:="" end)="" animation.opts,="" end,="" animation.opts.specialeasing[="" animation.opts.easing);="" animation.tweens.push(tween);="" stop:="" (gotoend)="" want="" tweens="" otherwise="" part="" animation.tweens.length="" this;="" ].run(1);="" resolve="" played="" last="" frame="" otherwise,="" reject="" gotoend="" deferred.rejectwith(elem,="" animation.opts.specialeasing);="" result="animationPrefilters[" animation.opts);="" (result)="" result;="" jquery.map(props,="" createtween,="" animation);="" (jquery.isfunction(animation.opts.start))="" animation.opts.start.call(elem,="" jquery.fx.timer(="" jquery.extend(tick,="" anim:="" animation.opts.queue="" })="" attach="" callbacks="" options="" animation.progress(animation.opts.progress)="" .done(animation.opts.done,="" animation.opts.complete)="" .fail(animation.opts.fail)="" .always(animation.opts.always);="" jquery.animation="jQuery.extend(Animation," tweener:="" (props,="" callback)="" (jquery.isfunction(props))="" callback="props;" ");="" ].unshift(callback);="" prefilter:="" (callback,="" prepend)="" (prepend)="" animationprefilters.unshift(callback);="" animationprefilters.push(callback);="" jquery.speed="function" (speed,="" fn)="" opt="speed" typeof="" speed="==" "object"="" speed)="" complete:="" fn="" !fn="" jquery.isfunction(speed)="" speed,="" easing:="" !jquery.isfunction(easing)="" opt.duration="jQuery.fx.off" "number"="" jquery.fx.speeds="" jquery.fx.speeds[="" jquery.fx.speeds._default;="" normalize="" opt.queue="" undefined="" null=""> "fx"3582 if (opt.queue == null || opt.queue === true) {3583 opt.queue = "fx";3584 }3585 // Queueing3586 opt.old = opt.complete;3587 opt.complete = function () {3588 if (jQuery.isFunction(opt.old)) {3589 opt.old.call(this);3590 }3591 if (opt.queue) {3592 jQuery.dequeue(this, opt.queue);3593 }3594 };3595 return opt;3596 };3597 jQuery.fn.extend({3598 fadeTo: function (speed, to, easing, callback) {3599 // show any hidden elements after setting opacity to 03600 return this.filter(isHidden).css("opacity", 0).show()3601 // animate to the value specified3602 .end().animate({ opacity: to }, speed, easing, callback);3603 },3604 animate: function (prop, speed, easing, callback) {3605 var empty = jQuery.isEmptyObject(prop),3606 optall = jQuery.speed(speed, easing, callback),3607 doAnimation = function () {3608 // Operate on a copy of prop so per-property easing won't be lost3609 var anim = Animation(this, jQuery.extend({}, prop), optall);3610 // Empty animations, or finishing resolves immediately3611 if (empty || jQuery._data(this, "finish")) {3612 anim.stop(true);3613 }3614 };3615 doAnimation.finish = doAnimation;3616 return empty || optall.queue === false ?3617 this.each(doAnimation) :3618 this.queue(optall.queue, doAnimation);3619 },3620 stop: function (type, clearQueue, gotoEnd) {3621 var stopQueue = function (hooks) {3622 var stop = hooks.stop;3623 delete hooks.stop;3624 stop(gotoEnd);3625 };3626 if (typeof type !== "string") {3627 gotoEnd = clearQueue;3628 clearQueue = type;3629 type = undefined;3630 }3631 if (clearQueue && type !== false) {3632 this.queue(type || "fx", []);3633 }3634 return this.each(function () {3635 var dequeue = true,3636 index = type != null && type + "queueHooks",3637 timers = jQuery.timers,3638 data = jQuery._data(this);3639 if (index) {3640 if (data[ index ] && data[ index ].stop) {3641 stopQueue(data[ index ]);3642 }3643 } else {3644 for (index in data) {3645 if (data[ index ] && data[ index ].stop && rrun.test(index)) {3646 stopQueue(data[ index ]);3647 }3648 }3649 }3650 for (index = timers.length; index--;) {3651 if (timers[ index ].elem === this && (type == null || timers[ index ].queue === type)) {3652 timers[ index ].anim.stop(gotoEnd);3653 dequeue = false;3654 timers.splice(index, 1);3655 }3656 }3657 // start the next in the queue if the last step wasn't forced3658 // timers currently will call their complete callbacks, which will dequeue3659 // but only if they were gotoEnd3660 if (dequeue || !gotoEnd) {3661 jQuery.dequeue(this, type);3662 }3663 });3664 },3665 finish: function (type) {3666 if (type !== false) {3667 type = type || "fx";3668 }3669 return this.each(function () {3670 var index,3671 data = jQuery._data(this),3672 queue = data[ type + "queue" ],3673 hooks = data[ type + "queueHooks" ],3674 timers = jQuery.timers,3675 length = queue ? queue.length : 0;3676 // enable finishing flag on private data3677 data.finish = true;3678 // empty the queue first3679 jQuery.queue(this, type, []);3680 if (hooks && hooks.stop) {3681 hooks.stop.call(this, true);3682 }3683 // look for any active animations, and finish them3684 for (index = timers.length; index--;) {3685 if (timers[ index ].elem === this && timers[ index ].queue === type) {3686 timers[ index ].anim.stop(true);3687 timers.splice(index, 1);3688 }3689 }3690 // look for any animations in the old queue and finish them3691 for (index = 0; index < length; index++) {3692 if (queue[ index ] && queue[ index ].finish) {3693 queue[ index ].finish.call(this);3694 }3695 }3696 // turn off finishing flag3697 delete data.finish;3698 });3699 }3700 });3701 jQuery.each([ "toggle", "show", "hide" ], function (i, name) {3702 var cssFn = jQuery.fn[ name ];3703 jQuery.fn[ name ] = function (speed, easing, callback) {3704 return speed == null || typeof speed === "boolean" ?3705 cssFn.apply(this, arguments) :3706 this.animate(genFx(name, true), speed, easing, callback);3707 };3708 });3709// Generate shortcuts for custom animations3710 jQuery.each({3711 slideDown: genFx("show"),3712 slideUp: genFx("hide"),3713 slideToggle: genFx("toggle"),3714 fadeIn: { opacity: "show" },3715 fadeOut: { opacity: "hide" },3716 fadeToggle: { opacity: "toggle" }3717 }, function (name, props) {3718 jQuery.fn[ name ] = function (speed, easing, callback) {3719 return this.animate(props, speed, easing, callback);3720 };3721 });3722 jQuery.timers = [];3723 jQuery.fx.tick = function () {3724 var timer,3725 timers = jQuery.timers,3726 i = 0;3727 fxNow = jQuery.now();3728 for (; i < timers.length; i++) {3729 timer = timers[ i ];3730 // Checks the timer has not already been removed3731 if (!timer() && timers[ i ] === timer) {3732 timers.splice(i--, 1);3733 }3734 }3735 if (!timers.length) {3736 jQuery.fx.stop();3737 }3738 fxNow = undefined;3739 };3740 jQuery.fx.timer = function (timer) {3741 jQuery.timers.push(timer);3742 if (timer()) {3743 jQuery.fx.start();3744 } else {3745 jQuery.timers.pop();3746 }3747 };3748 jQuery.fx.interval = 13;3749 jQuery.fx.start = function () {3750 if (!timerId) {3751 timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval);3752 }3753 };3754 jQuery.fx.stop = function () {3755 clearInterval(timerId);3756 timerId = null;3757 };3758 jQuery.fx.speeds = {3759 slow: 600,3760 fast: 200,3761 // Default speed3762 _default: 4003763 };3764// Based off of the plugin by Clint Helfers, with permission.3765// http://blindsignals.com/index.php/2009/07/jquery-delay/3766 jQuery.fn.delay = function (time, type) {3767 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;3768 type = type || "fx";3769 return this.queue(type, function (next, hooks) {3770 var timeout = setTimeout(next, time);3771 hooks.stop = function () {3772 clearTimeout(timeout);3773 };3774 });3775 };3776 (function () {3777 var a, input, select, opt,3778 div = document.createElement("div");3779 // Setup3780 div.setAttribute("className", "t");3781 div.innerHTML = " <link><table></table><a href="/a">a</a><input type="checkbox">";3782 a = div.getElementsByTagName("a")[ 0 ];3783 // First batch of tests.3784 select = document.createElement("select");3785 opt = select.appendChild(document.createElement("option"));3786 input = div.getElementsByTagName("input")[ 0 ];3787 a.style.cssText = "top:1px";3788 // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)3789 support.getSetAttribute = div.className !== "t";3790 // Get the style information from getAttribute3791 // (IE uses .cssText instead)3792 support.style = /top/.test(a.getAttribute("style"));3793 // Make sure that URLs aren't manipulated3794 // (IE normalizes it by default)3795 support.hrefNormalized = a.getAttribute("href") === "/a";3796 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)3797 support.checkOn = !!input.value;3798 // Make sure that a selected-by-default option has a working selected property.3799 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)3800 support.optSelected = opt.selected;3801 // Tests for enctype support on a form (#6743)3802 support.enctype = !!document.createElement("form").enctype;3803 // Make sure that the options inside disabled selects aren't marked as disabled3804 // (WebKit marks them as disabled)3805 select.disabled = true;3806 support.optDisabled = !opt.disabled;3807 // Support: IE8 only3808 // Check if we can trust getAttribute("value")3809 input = document.createElement("input");3810 input.setAttribute("value", "");3811 support.input = input.getAttribute("value") === "";3812 // Check if an input maintains its value after becoming a radio3813 input.value = "t";3814 input.setAttribute("type", "radio");3815 support.radioValue = input.value === "t";3816 // Null elements to avoid leaks in IE.3817 a = input = select = opt = div = null;3818 })();3819 var rreturn = /\r/g;3820 jQuery.fn.extend({3821 val: function (value) {3822 var hooks, ret, isFunction,3823 elem = this[0];3824 if (!arguments.length) {3825 if (elem) {3826 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];3827 if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {3828 return ret;3829 }3830 ret = elem.value;3831 return typeof ret === "string" ?3832 // handle most common string cases3833 ret.replace(rreturn, "") :3834 // handle cases where value is null/undef or number3835 ret == null ? "" : ret;3836 }3837 return;3838 }3839 isFunction = jQuery.isFunction(value);3840 return this.each(function (i) {...
jquery-1.11.1.js
Source:jquery-1.11.1.js
...387 * @param {String} type388 */389function createInputPseudo( type ) {390 return function( elem ) {391 var name = elem.nodeName.toLowerCase();392 return name === "input" && elem.type === type;393 };394}395/**396 * Returns a function to use in pseudos for buttons397 * @param {String} type398 */399function createButtonPseudo( type ) {400 return function( elem ) {401 var name = elem.nodeName.toLowerCase();402 return (name === "input" || name === "button") && elem.type === type;403 };404}405/**406 * Returns a function to use in pseudos for positionals407 * @param {Function} fn408 */409function createPositionalPseudo( fn ) {410 return markFunction(function( argument ) {411 argument = +argument;412 return markFunction(function( seed, matches ) {413 var j,414 matchIndexes = fn( [], seed.length, argument ),415 i = matchIndexes.length;416 // Match elements found at the specified indexes417 while ( i-- ) {418 if ( seed[ (j = matchIndexes[i]) ] ) {419 seed[j] = !(matches[j] = seed[j]);420 }421 }422 });423 });424}425/**426 * Checks a node for validity as a Sizzle context427 * @param {Element|Object=} context428 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value429 */430function testContext( context ) {431 return context && typeof context.getElementsByTagName !== strundefined && context;432}433// Expose support vars for convenience434support = Sizzle.support = {};435/**436 * Detects XML nodes437 * @param {Element|Object} elem An element or a document438 * @returns {Boolean} True iff elem is a non-HTML XML node439 */440isXML = Sizzle.isXML = function( elem ) {441 // documentElement is verified for cases where it doesn't yet exist442 // (such as loading iframes in IE - #4833)443 var documentElement = elem && (elem.ownerDocument || elem).documentElement;444 return documentElement ? documentElement.nodeName !== "HTML" : false;445};446/**447 * Sets document-related variables once based on the current document448 * @param {Element|Object} [doc] An element or document object to use to set the document449 * @returns {Object} Returns the current document450 */451setDocument = Sizzle.setDocument = function( node ) {452 var hasCompare,453 doc = node ? node.ownerDocument || node : preferredDoc,454 parent = doc.defaultView;455 // If no document and documentElement is available, return456 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {457 return document;458 }459 // Set our document460 document = doc;461 docElem = doc.documentElement;462 // Support tests463 documentIsHTML = !isXML( doc );464 // Support: IE>8465 // If iframe document is assigned to "document" variable and if iframe has been reloaded,466 // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936467 // IE6-8 do not support the defaultView property so parent will be undefined468 if ( parent && parent !== parent.top ) {469 // IE11 does not have attachEvent, so all must suffer470 if ( parent.addEventListener ) {471 parent.addEventListener( "unload", function() {472 setDocument();473 }, false );474 } else if ( parent.attachEvent ) {475 parent.attachEvent( "onunload", function() {476 setDocument();477 });478 }479 }480 /* Attributes481 ---------------------------------------------------------------------- */482 // Support: IE<8 1="" 4="" 7="" 8="" 9="" 11="" 16="" 2011="" 12359="" 13378="" verify="" that="" getattribute="" really="" returns="" attributes="" and="" not="" properties="" (excepting="" ie8="" booleans)="" support.attributes="assert(function(" div="" )="" {="" div.classname="i" ;="" return="" !div.getattribute("classname");="" });="" *="" getelement(s)by*="" ----------------------------------------------------------------------="" check="" if="" getelementsbytagname("*")="" only="" elements="" support.getelementsbytagname="assert(function(" div.appendchild(="" doc.createcomment("")="" );="" !div.getelementsbytagname("*").length;="" getelementsbyclassname="" can="" be="" trusted="" support.getelementsbyclassname="rnative.test(" doc.getelementsbyclassname="" &&="" assert(function(="" div.innerhtml="<div class='a'></div><div class='a i'></div>" support:="" safari<4="" catch="" class="" over-caching="" div.firstchild.classname="i" opera<10="" gebcn="" failure="" to="" find="" non-leading="" classes="" div.getelementsbyclassname("i").length="==" 2;="" ie<10="" getelementbyid="" by="" name="" the="" broken="" methods="" don't="" pick="" up="" programatically-set="" names,="" so="" use="" a="" roundabout="" getelementsbyname="" test="" support.getbyid="assert(function(" docelem.appendchild(="" ).id="expando;" !doc.getelementsbyname="" ||="" !doc.getelementsbyname(="" expando="" ).length;="" id="" filter="" (="" expr.find["id"]="function(" id,="" context="" typeof="" context.getelementbyid="" !="=" strundefined="" documentishtml="" var="" m="context.getElementById(" parentnode="" when="" blackberry="" 4.6="" nodes="" are="" no="" longer="" in="" document="" #6963="" m.parentnode="" ?="" [="" ]="" :="" [];="" }="" };="" expr.filter["id"]="function(" attrid="id.replace(" runescape,="" funescape="" function(="" elem="" elem.getattribute("id")="==" attrid;="" else="" ie6="" is="" reliable="" as="" shortcut="" delete="" expr.find["id"];="" node="typeof" elem.getattributenode="" elem.getattributenode("id");="" node.value="==" tag="" expr.find["tag"]="support.getElementsByTagName" tag,="" context.getelementsbytagname="" context.getelementsbytagname(="" elem,="" tmp="[]," i="0," results="context.getElementsByTagName(" out="" possible="" comments="" "*"="" while="" (elem="results[i++])" elem.nodetype="==" tmp.push(="" tmp;="" results;="" expr.find["class"]="support.getElementsByClassName" classname,="" context.getelementsbyclassname="" context.getelementsbyclassname(="" classname="" qsa="" matchesselector="" support="" matchesselector(:active)="" reports="" false="" true="" (ie9="" opera="" 11.5)="" rbuggymatches="[];" qsa(:focus)="" (chrome="" 21)="" we="" allow="" this="" because="" of="" bug="" throws="" an="" error="" whenever="" `document.activeelement`="" accessed="" on="" iframe="" so,="" :focus="" pass="" through="" all="" time="" avoid="" ie="" see="" http:="" bugs.jquery.com="" ticket="" rbuggyqsa="[];" (support.qsa="rnative.test(" doc.queryselectorall="" ))="" build="" regex="" strategy="" adopted="" from="" diego="" perini="" select="" set="" empty="" string="" purpose="" ie's="" treatment="" explicitly="" setting="" boolean="" content="" attribute,="" since="" its="" presence="" should="" enough="" ie8,="" 11-12.16="" nothing="" selected strings="" follow="" ^="or" $="or" attribute="" must="" unknown="" but="" "safe"="" for="" winrt="" msdn.microsoft.com="" en-us="" library="" hh465388.aspx#attribute_section="" div.queryselectorall("[msallowclip^="" ]").length="" rbuggyqsa.push(="" "[*^$]=" + whitespace + " *(?:''|\"\")"="" "value"="" treated="" correctly="" !div.queryselectorall("[selected]").length="" "\\["="" +="" whitespace="" "*(?:value|"="" booleans="" ")"="" webkit="" -="" :checked="" option="" www.w3.org="" tr="" rec-css3-selectors-20110929="" #checked="" here="" will="" later="" tests="" !div.queryselectorall(":checked").length="" rbuggyqsa.push(":checked");="" windows="" native="" apps="" type="" restricted="" during="" .innerhtml="" assignment="" input="doc.createElement("input");" input.setattribute(="" "type",="" "hidden"="" ).setattribute(="" "name",="" "d"="" enforce="" case-sensitivity="" div.queryselectorall("[name="d]").length" "name"="" "*[*^$|!~]?=" );483 }484 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)485 // IE8 throws error here and will not see later tests486 if ( !div.querySelectorAll(" :enabled").length="" ":enabled",="" ":disabled"="" 10-11="" does="" throw="" post-comma="" invalid="" pseudos="" div.queryselectorall("*,:x");="" rbuggyqsa.push(",.*:");="" (support.matchesselector="rnative.test(" (matches="docElem.matches" docelem.webkitmatchesselector="" docelem.mozmatchesselector="" docelem.omatchesselector="" docelem.msmatchesselector)="" it's="" do="" disconnected="" (ie="" 9)="" support.disconnectedmatch="matches.call(" div,="" "div"="" fail="" with="" exception="" gecko="" error,="" instead="" matches.call(="" "[s!="" ]:x"="" rbuggymatches.push(="" "!=", pseudos );487 });488 }489 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join(" |")="" new="" regexp(="" rbuggymatches.join("|")="" contains="" hascompare="rnative.test(" docelem.comparedocumentposition="" element="" another="" purposefully="" implement="" inclusive="" descendent="" in,="" contain="" itself="" rnative.test(="" docelem.contains="" a,="" b="" adown="a.nodeType" =="=" a.documentelement="" bup="b" b.parentnode;="" !!(="" bup.nodetype="==" adown.contains="" adown.contains(="" a.comparedocumentposition="" a.comparedocumentposition(="" &="" ));="" (b="b.parentNode)" true;="" false;="" sorting="" order="" sortorder="hasCompare" flag="" duplicate="" removal="" hasduplicate="true;" 0;="" sort="" method="" existence="" one="" has="" comparedocumentposition="" compare="!a.compareDocumentPosition" !b.comparedocumentposition;="" compare;="" calculate="" position="" both="" inputs="" belong="" same="" a.ownerdocument="" b.ownerdocument="" otherwise="" know="" they="" 1;="" (!support.sortdetached="" b.comparedocumentposition(="" compare)="" choose="" first="" related="" our="" preferred="" doc="" preferreddoc="" contains(preferreddoc,="" a)="" -1;="" b)="" maintain="" original="" sortinput="" indexof.call(="" sortinput,="" -1="" exit="" early="" identical="" cur,="" aup="a.parentNode," ap="[" ],="" bp="[" ];="" parentless="" either="" documents="" or="" !aup="" !bup="" siblings,="" quick="" siblingcheck(="" need="" full="" lists="" their="" ancestors="" comparison="" cur="a;" (cur="cur.parentNode)" ap.unshift(="" bp.unshift(="" walk="" down="" tree="" looking="" discrepancy="" ap[i]="==" bp[i]="" i++;="" sibling="" have="" common="" ancestor="" ap[i],="" doc;="" sizzle.matches="function(" expr,="" sizzle(="" null,="" sizzle.matchesselector="function(" expr="" vars="" needed="" elem.ownerdocument="" setdocument(="" make="" sure="" selectors="" quoted="" rattributequotes,="" "="$1" ]"="" support.matchesselector="" !rbuggymatches="" !rbuggymatches.test(="" !rbuggyqsa="" !rbuggyqsa.test(="" try="" ret="matches.call(" 9's="" well,="" said="" fragment="" elem.document="" elem.document.nodetype="" ret;="" catch(e)="" {}="" document,="" ).length=""> 0;490};491Sizzle.contains = function( context, elem ) {492 // Set document vars if needed493 if ( ( context.ownerDocument || context ) !== document ) {494 setDocument( context );495 }496 return contains( context, elem );497};498Sizzle.attr = function( elem, name ) {499 // Set document vars if needed500 if ( ( elem.ownerDocument || elem ) !== document ) {501 setDocument( elem );502 }503 var fn = Expr.attrHandle[ name.toLowerCase() ],504 // Don't get fooled by Object.prototype properties (jQuery #13807)505 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?506 fn( elem, name, !documentIsHTML ) :507 undefined;508 return val !== undefined ?509 val :510 support.attributes || !documentIsHTML ?511 elem.getAttribute( name ) :512 (val = elem.getAttributeNode(name)) && val.specified ?513 val.value :514 null;515};516Sizzle.error = function( msg ) {517 throw new Error( "Syntax error, unrecognized expression: " + msg );518};519/**520 * Document sorting and removing duplicates521 * @param {ArrayLike} results522 */523Sizzle.uniqueSort = function( results ) {524 var elem,525 duplicates = [],526 j = 0,527 i = 0;528 // Unless we *know* we can detect duplicates, assume their presence529 hasDuplicate = !support.detectDuplicates;530 sortInput = !support.sortStable && results.slice( 0 );531 results.sort( sortOrder );532 if ( hasDuplicate ) {533 while ( (elem = results[i++]) ) {534 if ( elem === results[ i ] ) {535 j = duplicates.push( i );536 }537 }538 while ( j-- ) {539 results.splice( duplicates[ j ], 1 );540 }541 }542 // Clear input after sorting to release objects543 // See https://github.com/jquery/sizzle/pull/225544 sortInput = null;545 return results;546};547/**548 * Utility function for retrieving the text value of an array of DOM nodes549 * @param {Array|Element} elem550 */551getText = Sizzle.getText = function( elem ) {552 var node,553 ret = "",554 i = 0,555 nodeType = elem.nodeType;556 if ( !nodeType ) {557 // If no nodeType, this is expected to be an array558 while ( (node = elem[i++]) ) {559 // Do not traverse comment nodes560 ret += getText( node );561 }562 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {563 // Use textContent for elements564 // innerText usage removed for consistency of new lines (jQuery #11153)565 if ( typeof elem.textContent === "string" ) {566 return elem.textContent;567 } else {568 // Traverse its children569 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {570 ret += getText( elem );571 }572 }573 } else if ( nodeType === 3 || nodeType === 4 ) {574 return elem.nodeValue;575 }576 // Do not include comment or processing instruction nodes577 return ret;578};579Expr = Sizzle.selectors = {580 // Can be adjusted by the user581 cacheLength: 50,582 createPseudo: markFunction,583 match: matchExpr,584 attrHandle: {},585 find: {},586 relative: {587 ">": { dir: "parentNode", first: true },588 " ": { dir: "parentNode" },589 "+": { dir: "previousSibling", first: true },590 "~": { dir: "previousSibling" }591 },592 preFilter: {593 "ATTR": function( match ) {594 match[1] = match[1].replace( runescape, funescape );595 // Move the given value to match[3] whether quoted or unquoted596 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );597 if ( match[2] === "~=" ) {598 match[3] = " " + match[3] + " ";599 }600 return match.slice( 0, 4 );601 },602 "CHILD": function( match ) {603 /* matches from matchExpr["CHILD"]604 1 type (only|nth|...)605 2 what (child|of-type)606 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)607 4 xn-component of xn+y argument ([+-]?\d*n|)608 5 sign of xn-component609 6 x of xn-component610 7 sign of y-component611 8 y of y-component612 */613 match[1] = match[1].toLowerCase();614 if ( match[1].slice( 0, 3 ) === "nth" ) {615 // nth-* requires argument616 if ( !match[3] ) {617 Sizzle.error( match[0] );618 }619 // numeric x and y parameters for Expr.filter.CHILD620 // remember that false/true cast respectively to 0/1621 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );622 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );623 // other types prohibit arguments624 } else if ( match[3] ) {625 Sizzle.error( match[0] );626 }627 return match;628 },629 "PSEUDO": function( match ) {630 var excess,631 unquoted = !match[6] && match[2];632 if ( matchExpr["CHILD"].test( match[0] ) ) {633 return null;634 }635 // Accept quoted arguments as-is636 if ( match[3] ) {637 match[2] = match[4] || match[5] || "";638 // Strip excess characters from unquoted arguments639 } else if ( unquoted && rpseudo.test( unquoted ) &&640 // Get excess from tokenize (recursively)641 (excess = tokenize( unquoted, true )) &&642 // advance to the next closing parenthesis643 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {644 // excess is a negative index645 match[0] = match[0].slice( 0, excess );646 match[2] = unquoted.slice( 0, excess );647 }648 // Return only captures needed by the pseudo filter method (type and argument)649 return match.slice( 0, 3 );650 }651 },652 filter: {653 "TAG": function( nodeNameSelector ) {654 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();655 return nodeNameSelector === "*" ?656 function() { return true; } :657 function( elem ) {658 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;659 };660 },661 "CLASS": function( className ) {662 var pattern = classCache[ className + " " ];663 return pattern ||664 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&665 classCache( className, function( elem ) {666 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );667 });668 },669 "ATTR": function( name, operator, check ) {670 return function( elem ) {671 var result = Sizzle.attr( elem, name );672 if ( result == null ) {673 return operator === "!=";674 }675 if ( !operator ) {676 return true;677 }678 result += "";679 return operator === "=" ? result === check :680 operator === "!=" ? result !== check :681 operator === "^=" ? check && result.indexOf( check ) === 0 :682 operator === "*=" ? check && result.indexOf( check ) > -1 :683 operator === "$=" ? check && result.slice( -check.length ) === check :684 operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :685 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :686 false;687 };688 },689 "CHILD": function( type, what, argument, first, last ) {690 var simple = type.slice( 0, 3 ) !== "nth",691 forward = type.slice( -4 ) !== "last",692 ofType = what === "of-type";693 return first === 1 && last === 0 ?694 // Shortcut for :nth-*(n)695 function( elem ) {696 return !!elem.parentNode;697 } :698 function( elem, context, xml ) {699 var cache, outerCache, node, diff, nodeIndex, start,700 dir = simple !== forward ? "nextSibling" : "previousSibling",701 parent = elem.parentNode,702 name = ofType && elem.nodeName.toLowerCase(),703 useCache = !xml && !ofType;704 if ( parent ) {705 // :(first|last|only)-(child|of-type)706 if ( simple ) {707 while ( dir ) {708 node = elem;709 while ( (node = node[ dir ]) ) {710 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {711 return false;712 }713 }714 // Reverse direction for :only-* (if we haven't yet done so)715 start = dir = type === "only" && !start && "nextSibling";716 }717 return true;718 }719 start = [ forward ? parent.firstChild : parent.lastChild ];720 // non-xml :nth-child(...) stores cache data on `parent`721 if ( forward && useCache ) {722 // Seek `elem` from a previously-cached index723 outerCache = parent[ expando ] || (parent[ expando ] = {});724 cache = outerCache[ type ] || [];725 nodeIndex = cache[0] === dirruns && cache[1];726 diff = cache[0] === dirruns && cache[2];727 node = nodeIndex && parent.childNodes[ nodeIndex ];728 while ( (node = ++nodeIndex && node && node[ dir ] ||729 // Fallback to seeking `elem` from the start730 (diff = nodeIndex = 0) || start.pop()) ) {731 // When found, cache indexes on `parent` and break732 if ( node.nodeType === 1 && ++diff && node === elem ) {733 outerCache[ type ] = [ dirruns, nodeIndex, diff ];734 break;735 }736 }737 // Use previously-cached element index if available738 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {739 diff = cache[1];740 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)741 } else {742 // Use the same loop as above to seek `elem` from the start743 while ( (node = ++nodeIndex && node && node[ dir ] ||744 (diff = nodeIndex = 0) || start.pop()) ) {745 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {746 // Cache the index of each encountered element747 if ( useCache ) {748 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];749 }750 if ( node === elem ) {751 break;752 }753 }754 }755 }756 // Incorporate the offset, then check against cycle size757 diff -= last;758 return diff === first || ( diff % first === 0 && diff / first >= 0 );759 }760 };761 },762 "PSEUDO": function( pseudo, argument ) {763 // pseudo-class names are case-insensitive764 // http://www.w3.org/TR/selectors/#pseudo-classes765 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters766 // Remember that setFilters inherits from pseudos767 var args,768 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||769 Sizzle.error( "unsupported pseudo: " + pseudo );770 // The user may use createPseudo to indicate that771 // arguments are needed to create the filter function772 // just as Sizzle does773 if ( fn[ expando ] ) {774 return fn( argument );775 }776 // But maintain support for old signatures777 if ( fn.length > 1 ) {778 args = [ pseudo, pseudo, "", argument ];779 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?780 markFunction(function( seed, matches ) {781 var idx,782 matched = fn( seed, argument ),783 i = matched.length;784 while ( i-- ) {785 idx = indexOf.call( seed, matched[i] );786 seed[ idx ] = !( matches[ idx ] = matched[i] );787 }788 }) :789 function( elem ) {790 return fn( elem, 0, args );791 };792 }793 return fn;794 }795 },796 pseudos: {797 // Potentially complex pseudos798 "not": markFunction(function( selector ) {799 // Trim the selector passed to compile800 // to avoid treating leading and trailing801 // spaces as combinators802 var input = [],803 results = [],804 matcher = compile( selector.replace( rtrim, "$1" ) );805 return matcher[ expando ] ?806 markFunction(function( seed, matches, context, xml ) {807 var elem,808 unmatched = matcher( seed, null, xml, [] ),809 i = seed.length;810 // Match elements unmatched by `matcher`811 while ( i-- ) {812 if ( (elem = unmatched[i]) ) {813 seed[i] = !(matches[i] = elem);814 }815 }816 }) :817 function( elem, context, xml ) {818 input[0] = elem;819 matcher( input, null, xml, results );820 return !results.pop();821 };822 }),823 "has": markFunction(function( selector ) {824 return function( elem ) {825 return Sizzle( selector, elem ).length > 0;826 };827 }),828 "contains": markFunction(function( text ) {829 return function( elem ) {830 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;831 };832 }),833 // "Whether an element is represented by a :lang() selector834 // is based solely on the element's language value835 // being equal to the identifier C,836 // or beginning with the identifier C immediately followed by "-".837 // The matching of C against the element's language value is performed case-insensitively.838 // The identifier C does not have to be a valid language name."839 // http://www.w3.org/TR/selectors/#lang-pseudo840 "lang": markFunction( function( lang ) {841 // lang value must be a valid identifier842 if ( !ridentifier.test(lang || "") ) {843 Sizzle.error( "unsupported lang: " + lang );844 }845 lang = lang.replace( runescape, funescape ).toLowerCase();846 return function( elem ) {847 var elemLang;848 do {849 if ( (elemLang = documentIsHTML ?850 elem.lang :851 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {852 elemLang = elemLang.toLowerCase();853 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;854 }855 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );856 return false;857 };858 }),859 // Miscellaneous860 "target": function( elem ) {861 var hash = window.location && window.location.hash;862 return hash && hash.slice( 1 ) === elem.id;863 },864 "root": function( elem ) {865 return elem === docElem;866 },867 "focus": function( elem ) {868 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);869 },870 // Boolean properties871 "enabled": function( elem ) {872 return elem.disabled === false;873 },874 "disabled": function( elem ) {875 return elem.disabled === true;876 },877 "checked": function( elem ) {878 // In CSS3, :checked should return both checked and selected elements879 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked880 var nodeName = elem.nodeName.toLowerCase();881 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);882 },883 "selected": function( elem ) {884 // Accessing this property makes selected-by-default885 // options in Safari work properly886 if ( elem.parentNode ) {887 elem.parentNode.selectedIndex;888 }889 return elem.selected === true;890 },891 // Contents892 "empty": function( elem ) {893 // http://www.w3.org/TR/selectors/#empty-pseudo894 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),895 // but not by others (comment: 8; processing instruction: 7; etc.)896 // nodeType < 6 works because attributes (2) do not appear as children897 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {898 if ( elem.nodeType < 6 ) {899 return false;900 }901 }902 return true;903 },904 "parent": function( elem ) {905 return !Expr.pseudos["empty"]( elem );906 },907 // Element/input types908 "header": function( elem ) {909 return rheader.test( elem.nodeName );910 },911 "input": function( elem ) {912 return rinputs.test( elem.nodeName );913 },914 "button": function( elem ) {915 var name = elem.nodeName.toLowerCase();916 return name === "input" && elem.type === "button" || name === "button";917 },918 "text": function( elem ) {919 var attr;920 return elem.nodeName.toLowerCase() === "input" &&921 elem.type === "text" &&922 // Support: IE<8 0="" 1="" new="" html5="" attribute="" values="" (e.g.,="" "search")="" appear="" with="" elem.type="==" "text"="" (="" (attr="elem.getAttribute("type"))" =="null" ||="" attr.tolowercase()="==" );="" },="" position-in-collection="" "first":="" createpositionalpseudo(function()="" {="" return="" [="" ];="" }),="" "last":="" createpositionalpseudo(function(="" matchindexes,="" length="" )="" -="" "eq":="" length,="" argument="" <="" ?="" +="" :="" "even":="" var="" i="0;" for="" ;="" length;="" matchindexes.push(="" }="" matchindexes;="" "odd":="" "lt":="" argument;="" --i="">= 0; ) {923 matchIndexes.push( i );924 }925 return matchIndexes;926 }),927 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {928 var i = argument < 0 ? argument + length : argument;929 for ( ; ++i < length; ) {930 matchIndexes.push( i );931 }932 return matchIndexes;933 })934 }935};936Expr.pseudos["nth"] = Expr.pseudos["eq"];937// Add button/input type pseudos938for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {939 Expr.pseudos[ i ] = createInputPseudo( i );940}941for ( i in { submit: true, reset: true } ) {942 Expr.pseudos[ i ] = createButtonPseudo( i );943}944// Easy API for creating new setFilters945function setFilters() {}946setFilters.prototype = Expr.filters = Expr.pseudos;947Expr.setFilters = new setFilters();948tokenize = Sizzle.tokenize = function( selector, parseOnly ) {949 var matched, match, tokens, type,950 soFar, groups, preFilters,951 cached = tokenCache[ selector + " " ];952 if ( cached ) {953 return parseOnly ? 0 : cached.slice( 0 );954 }955 soFar = selector;956 groups = [];957 preFilters = Expr.preFilter;958 while ( soFar ) {959 // Comma and first run960 if ( !matched || (match = rcomma.exec( soFar )) ) {961 if ( match ) {962 // Don't consume trailing commas as valid963 soFar = soFar.slice( match[0].length ) || soFar;964 }965 groups.push( (tokens = []) );966 }967 matched = false;968 // Combinators969 if ( (match = rcombinators.exec( soFar )) ) {970 matched = match.shift();971 tokens.push({972 value: matched,973 // Cast descendant combinators to space974 type: match[0].replace( rtrim, " " )975 });976 soFar = soFar.slice( matched.length );977 }978 // Filters979 for ( type in Expr.filter ) {980 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||981 (match = preFilters[ type ]( match ))) ) {982 matched = match.shift();983 tokens.push({984 value: matched,985 type: type,986 matches: match987 });988 soFar = soFar.slice( matched.length );989 }990 }991 if ( !matched ) {992 break;993 }994 }995 // Return the length of the invalid excess996 // if we're just parsing997 // Otherwise, throw an error or return tokens998 return parseOnly ?999 soFar.length :1000 soFar ?1001 Sizzle.error( selector ) :1002 // Cache the tokens1003 tokenCache( selector, groups ).slice( 0 );1004};1005function toSelector( tokens ) {1006 var i = 0,1007 len = tokens.length,1008 selector = "";1009 for ( ; i < len; i++ ) {1010 selector += tokens[i].value;1011 }1012 return selector;1013}1014function addCombinator( matcher, combinator, base ) {1015 var dir = combinator.dir,1016 checkNonElements = base && dir === "parentNode",1017 doneName = done++;1018 return combinator.first ?1019 // Check against closest ancestor/preceding element1020 function( elem, context, xml ) {1021 while ( (elem = elem[ dir ]) ) {1022 if ( elem.nodeType === 1 || checkNonElements ) {1023 return matcher( elem, context, xml );1024 }1025 }1026 } :1027 // Check against all ancestor/preceding elements1028 function( elem, context, xml ) {1029 var oldCache, outerCache,1030 newCache = [ dirruns, doneName ];1031 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching1032 if ( xml ) {1033 while ( (elem = elem[ dir ]) ) {1034 if ( elem.nodeType === 1 || checkNonElements ) {1035 if ( matcher( elem, context, xml ) ) {1036 return true;1037 }1038 }1039 }1040 } else {1041 while ( (elem = elem[ dir ]) ) {1042 if ( elem.nodeType === 1 || checkNonElements ) {1043 outerCache = elem[ expando ] || (elem[ expando ] = {});1044 if ( (oldCache = outerCache[ dir ]) &&1045 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {1046 // Assign to newCache so results back-propagate to previous elements1047 return (newCache[ 2 ] = oldCache[ 2 ]);1048 } else {1049 // Reuse newcache so results back-propagate to previous elements1050 outerCache[ dir ] = newCache;1051 // A match means we're done; a fail means we have to keep checking1052 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {1053 return true;1054 }1055 }1056 }1057 }1058 }1059 };1060}1061function elementMatcher( matchers ) {1062 return matchers.length > 1 ?1063 function( elem, context, xml ) {1064 var i = matchers.length;1065 while ( i-- ) {1066 if ( !matchers[i]( elem, context, xml ) ) {1067 return false;1068 }1069 }1070 return true;1071 } :1072 matchers[0];1073}1074function multipleContexts( selector, contexts, results ) {1075 var i = 0,1076 len = contexts.length;1077 for ( ; i < len; i++ ) {1078 Sizzle( selector, contexts[i], results );1079 }1080 return results;1081}1082function condense( unmatched, map, filter, context, xml ) {1083 var elem,1084 newUnmatched = [],1085 i = 0,1086 len = unmatched.length,1087 mapped = map != null;1088 for ( ; i < len; i++ ) {1089 if ( (elem = unmatched[i]) ) {1090 if ( !filter || filter( elem, context, xml ) ) {1091 newUnmatched.push( elem );1092 if ( mapped ) {1093 map.push( i );1094 }1095 }1096 }1097 }1098 return newUnmatched;1099}1100function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {1101 if ( postFilter && !postFilter[ expando ] ) {1102 postFilter = setMatcher( postFilter );1103 }1104 if ( postFinder && !postFinder[ expando ] ) {1105 postFinder = setMatcher( postFinder, postSelector );1106 }1107 return markFunction(function( seed, results, context, xml ) {1108 var temp, i, elem,1109 preMap = [],1110 postMap = [],1111 preexisting = results.length,1112 // Get initial elements from seed or context1113 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),1114 // Prefilter to get matcher input, preserving a map for seed-results synchronization1115 matcherIn = preFilter && ( seed || !selector ) ?1116 condense( elems, preMap, preFilter, context, xml ) :1117 elems,1118 matcherOut = matcher ?1119 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,1120 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?1121 // ...intermediate processing is necessary1122 [] :1123 // ...otherwise use results directly1124 results :1125 matcherIn;1126 // Find primary matches1127 if ( matcher ) {1128 matcher( matcherIn, matcherOut, context, xml );1129 }1130 // Apply postFilter1131 if ( postFilter ) {1132 temp = condense( matcherOut, postMap );1133 postFilter( temp, [], context, xml );1134 // Un-match failing elements by moving them back to matcherIn1135 i = temp.length;1136 while ( i-- ) {1137 if ( (elem = temp[i]) ) {1138 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);1139 }1140 }1141 }1142 if ( seed ) {1143 if ( postFinder || preFilter ) {1144 if ( postFinder ) {1145 // Get the final matcherOut by condensing this intermediate into postFinder contexts1146 temp = [];1147 i = matcherOut.length;1148 while ( i-- ) {1149 if ( (elem = matcherOut[i]) ) {1150 // Restore matcherIn since elem is not yet a final match1151 temp.push( (matcherIn[i] = elem) );1152 }1153 }1154 postFinder( null, (matcherOut = []), temp, xml );1155 }1156 // Move matched elements from seed to results to keep them synchronized1157 i = matcherOut.length;1158 while ( i-- ) {1159 if ( (elem = matcherOut[i]) &&1160 (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {1161 seed[temp] = !(results[temp] = elem);1162 }1163 }1164 }1165 // Add elements to results, through postFinder if defined1166 } else {1167 matcherOut = condense(1168 matcherOut === results ?1169 matcherOut.splice( preexisting, matcherOut.length ) :1170 matcherOut1171 );1172 if ( postFinder ) {1173 postFinder( null, results, matcherOut, xml );1174 } else {1175 push.apply( results, matcherOut );1176 }1177 }1178 });1179}1180function matcherFromTokens( tokens ) {1181 var checkContext, matcher, j,1182 len = tokens.length,1183 leadingRelative = Expr.relative[ tokens[0].type ],1184 implicitRelative = leadingRelative || Expr.relative[" "],1185 i = leadingRelative ? 1 : 0,1186 // The foundational matcher ensures that elements are reachable from top-level context(s)1187 matchContext = addCombinator( function( elem ) {1188 return elem === checkContext;1189 }, implicitRelative, true ),1190 matchAnyContext = addCombinator( function( elem ) {1191 return indexOf.call( checkContext, elem ) > -1;1192 }, implicitRelative, true ),1193 matchers = [ function( elem, context, xml ) {1194 return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (1195 (checkContext = context).nodeType ?1196 matchContext( elem, context, xml ) :1197 matchAnyContext( elem, context, xml ) );1198 } ];1199 for ( ; i < len; i++ ) {1200 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {1201 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];1202 } else {1203 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );1204 // Return special upon seeing a positional matcher1205 if ( matcher[ expando ] ) {1206 // Find the next relative operator (if any) for proper handling1207 j = ++i;1208 for ( ; j < len; j++ ) {1209 if ( Expr.relative[ tokens[j].type ] ) {1210 break;1211 }1212 }1213 return setMatcher(1214 i > 1 && elementMatcher( matchers ),1215 i > 1 && toSelector(1216 // If the preceding token was a descendant combinator, insert an implicit any-element `*`1217 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })1218 ).replace( rtrim, "$1" ),1219 matcher,1220 i < j && matcherFromTokens( tokens.slice( i, j ) ),1221 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),1222 j < len && toSelector( tokens )1223 );1224 }1225 matchers.push( matcher );1226 }1227 }1228 return elementMatcher( matchers );1229}1230function matcherFromGroupMatchers( elementMatchers, setMatchers ) {1231 var bySet = setMatchers.length > 0,1232 byElement = elementMatchers.length > 0,1233 superMatcher = function( seed, context, xml, results, outermost ) {1234 var elem, j, matcher,1235 matchedCount = 0,1236 i = "0",1237 unmatched = seed && [],1238 setMatched = [],1239 contextBackup = outermostContext,1240 // We must always have either seed elements or outermost context1241 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),1242 // Use integer dirruns iff this is the outermost matcher1243 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),1244 len = elems.length;1245 if ( outermost ) {1246 outermostContext = context !== document && context;1247 }1248 // Add elements passing elementMatchers directly to results1249 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below1250 // Support: IE<9, safari="" tolerate="" nodelist="" properties="" (ie:="" "length";="" safari:="" <number="">) matching elements by id1251 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {1252 if ( byElement && elem ) {1253 j = 0;1254 while ( (matcher = elementMatchers[j++]) ) {1255 if ( matcher( elem, context, xml ) ) {1256 results.push( elem );1257 break;1258 }1259 }1260 if ( outermost ) {1261 dirruns = dirrunsUnique;1262 }1263 }1264 // Track unmatched elements for set filters1265 if ( bySet ) {1266 // They will have gone through all possible matchers1267 if ( (elem = !matcher && elem) ) {1268 matchedCount--;1269 }1270 // Lengthen the array for every element, matched or not1271 if ( seed ) {1272 unmatched.push( elem );1273 }1274 }1275 }1276 // Apply set filters to unmatched elements1277 matchedCount += i;1278 if ( bySet && i !== matchedCount ) {1279 j = 0;1280 while ( (matcher = setMatchers[j++]) ) {1281 matcher( unmatched, setMatched, context, xml );1282 }1283 if ( seed ) {1284 // Reintegrate element matches to eliminate the need for sorting1285 if ( matchedCount > 0 ) {1286 while ( i-- ) {1287 if ( !(unmatched[i] || setMatched[i]) ) {1288 setMatched[i] = pop.call( results );1289 }1290 }1291 }1292 // Discard index placeholder values to get only actual matches1293 setMatched = condense( setMatched );1294 }1295 // Add matches to results1296 push.apply( results, setMatched );1297 // Seedless set matches succeeding multiple successful matchers stipulate sorting1298 if ( outermost && !seed && setMatched.length > 0 &&1299 ( matchedCount + setMatchers.length ) > 1 ) {1300 Sizzle.uniqueSort( results );1301 }1302 }1303 // Override manipulation of globals by nested matchers1304 if ( outermost ) {1305 dirruns = dirrunsUnique;1306 outermostContext = contextBackup;1307 }1308 return unmatched;1309 };1310 return bySet ?1311 markFunction( superMatcher ) :1312 superMatcher;1313}1314compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {1315 var i,1316 setMatchers = [],1317 elementMatchers = [],1318 cached = compilerCache[ selector + " " ];1319 if ( !cached ) {1320 // Generate a function of recursive functions that can be used to check each element1321 if ( !match ) {1322 match = tokenize( selector );1323 }1324 i = match.length;1325 while ( i-- ) {1326 cached = matcherFromTokens( match[i] );1327 if ( cached[ expando ] ) {1328 setMatchers.push( cached );1329 } else {1330 elementMatchers.push( cached );1331 }1332 }1333 // Cache the compiled function1334 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );1335 // Save selector and tokenization1336 cached.selector = selector;1337 }1338 return cached;1339};1340/**1341 * A low-level selection function that works with Sizzle's compiled1342 * selector functions1343 * @param {String|Function} selector A selector or a pre-compiled1344 * selector function built with Sizzle.compile1345 * @param {Element} context1346 * @param {Array} [results]1347 * @param {Array} [seed] A set of elements to match against1348 */1349select = Sizzle.select = function( selector, context, results, seed ) {1350 var i, tokens, token, type, find,1351 compiled = typeof selector === "function" && selector,1352 match = !seed && tokenize( (selector = compiled.selector || selector) );1353 results = results || [];1354 // Try to minimize operations if there is no seed and only one group1355 if ( match.length === 1 ) {1356 // Take a shortcut and set the context if the root selector is an ID1357 tokens = match[0] = match[0].slice( 0 );1358 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&1359 support.getById && context.nodeType === 9 && documentIsHTML &&1360 Expr.relative[ tokens[1].type ] ) {1361 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];1362 if ( !context ) {1363 return results;1364 // Precompiled matchers will still verify ancestry, so step up a level1365 } else if ( compiled ) {1366 context = context.parentNode;1367 }1368 selector = selector.slice( tokens.shift().value.length );1369 }1370 // Fetch a seed set for right-to-left matching1371 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;1372 while ( i-- ) {1373 token = tokens[i];1374 // Abort if we hit a combinator1375 if ( Expr.relative[ (type = token.type) ] ) {1376 break;1377 }1378 if ( (find = Expr.find[ type ]) ) {1379 // Search, expanding context for leading sibling combinators1380 if ( (seed = find(1381 token.matches[0].replace( runescape, funescape ),1382 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context1383 )) ) {1384 // If seed is empty or no tokens remain, we can return early1385 tokens.splice( i, 1 );1386 selector = seed.length && toSelector( tokens );1387 if ( !selector ) {1388 push.apply( results, seed );1389 return results;1390 }1391 break;1392 }1393 }1394 }1395 }1396 // Compile and execute a filtering function if one is not provided1397 // Provide `match` to avoid retokenization if we modified the selector above1398 ( compiled || compile( selector, match ) )(1399 seed,1400 context,1401 !documentIsHTML,1402 results,1403 rsibling.test( selector ) && testContext( context.parentNode ) || context1404 );1405 return results;1406};1407// One-time assignments1408// Sort stability1409support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;1410// Support: Chrome<14 1="" 2="" 4="" 25="" always="" assume="" duplicates="" if="" they="" aren't="" passed="" to="" the="" comparison="" function="" support.detectduplicates="!!hasDuplicate;" initialize="" against="" default document="" setdocument();="" support:="" webkit<537.32="" -="" safari="" 6.0.3="" chrome="" (fixed="" in="" 27)="" detached="" nodes="" confoundingly="" follow="" *each="" other*="" support.sortdetached="assert(function(" div1="" )="" {="" should="" return="" 1,="" but="" returns="" (following)="" div1.comparedocumentposition(="" document.createelement("div")="" &="" 1;="" });="" ie<8="" prevent="" attribute="" property="" "interpolation"="" http:="" msdn.microsoft.com="" en-us="" library="" ms536429%28vs.85%29.aspx="" (="" !assert(function(="" div="" div.innerhtml="<a href='#'></a>" ;="" div.firstchild.getattribute("href")="==" "#"="" })="" addhandle(="" "type|href|height|width",="" function(="" elem,="" name,="" isxml="" !isxml="" elem.getattribute(="" name.tolowercase()="==" "type"="" ?="" :="" );="" }="" ie<9="" use="" defaultvalue="" place="" of="" getattribute("value")="" !support.attributes="" ||="" div.firstchild.setattribute(="" "value",="" ""="" div.firstchild.getattribute(="" "value"="" "";="" &&="" elem.nodename.tolowercase()="==" "input"="" elem.defaultvalue;="" getattributenode="" fetch="" booleans="" when="" getattribute="" lies="" div.getattribute("disabled")="=" null;="" booleans,="" var="" val;="" elem[="" name="" ]="==" true="" (val="elem.getAttributeNode(" ))="" val.specified="" val.value="" sizzle;="" })(="" window="" jquery.find="Sizzle;" jquery.expr="Sizzle.selectors;" jquery.expr[":"]="jQuery.expr.pseudos;" jquery.unique="Sizzle.uniqueSort;" jquery.text="Sizzle.getText;" jquery.isxmldoc="Sizzle.isXML;" jquery.contains="Sizzle.contains;" rneedscontext="jQuery.expr.match.needsContext;" rsingletag="(/^<(\w+)\s*\/?">(?:<\ \1="">|)$/);1411var risSimple = /^.[^:#\[\.,]*$/;1412// Implement the identical functionality for filter and not1413function winnow( elements, qualifier, not ) {1414 if ( jQuery.isFunction( qualifier ) ) {1415 return jQuery.grep( elements, function( elem, i ) {1416 /* jshint -W018 */1417 return !!qualifier.call( elem, i, elem ) !== not;1418 });1419 }1420 if ( qualifier.nodeType ) {1421 return jQuery.grep( elements, function( elem ) {1422 return ( elem === qualifier ) !== not;1423 });1424 }1425 if ( typeof qualifier === "string" ) {1426 if ( risSimple.test( qualifier ) ) {1427 return jQuery.filter( qualifier, elements, not );1428 }1429 qualifier = jQuery.filter( qualifier, elements );1430 }1431 return jQuery.grep( elements, function( elem ) {1432 return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;1433 });1434}1435jQuery.filter = function( expr, elems, not ) {1436 var elem = elems[ 0 ];1437 if ( not ) {1438 expr = ":not(" + expr + ")";1439 }1440 return elems.length === 1 && elem.nodeType === 1 ?1441 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :1442 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {1443 return elem.nodeType === 1;1444 }));1445};1446jQuery.fn.extend({1447 find: function( selector ) {1448 var i,1449 ret = [],1450 self = this,1451 len = self.length;1452 if ( typeof selector !== "string" ) {1453 return this.pushStack( jQuery( selector ).filter(function() {1454 for ( i = 0; i < len; i++ ) {1455 if ( jQuery.contains( self[ i ], this ) ) {1456 return true;1457 }1458 }1459 }) );1460 }1461 for ( i = 0; i < len; i++ ) {1462 jQuery.find( selector, self[ i ], ret );1463 }1464 // Needed because $( selector, context ) becomes $( context ).find( selector )1465 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );1466 ret.selector = this.selector ? this.selector + " " + selector : selector;1467 return ret;1468 },1469 filter: function( selector ) {1470 return this.pushStack( winnow(this, selector || [], false) );1471 },1472 not: function( selector ) {1473 return this.pushStack( winnow(this, selector || [], true) );1474 },1475 is: function( selector ) {1476 return !!winnow(1477 this,1478 // If this is a positional/relative selector, check membership in the returned set1479 // so $("p:first").is("p:last") won't return true for a doc with two "p".1480 typeof selector === "string" && rneedsContext.test( selector ) ?1481 jQuery( selector ) :1482 selector || [],1483 false1484 ).length;1485 }1486});1487// Initialize a jQuery object1488// A central reference to the root jQuery(document)1489var rootjQuery,1490 // Use the correct document accordingly with window argument (sandbox)1491 document = window.document,1492 // A simple way to check for HTML strings1493 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)1494 // Strict HTML recognition (#11290: must start with <) rquickexpr="/^(?:\s*(<[\w\W]+">)[^>]*|#([\w-]*))$/,1495 init = jQuery.fn.init = function( selector, context ) {1496 var match, elem;1497 // HANDLE: $(""), $(null), $(undefined), $(false)1498 if ( !selector ) {1499 return this;1500 }1501 // Handle HTML strings1502 if ( typeof selector === "string" ) {1503 if ( selector.charAt(0) === "<" 1="" &&="" selector.charat(="" selector.length="" -="" )="==" "="">" && selector.length >= 3 ) {1504 // Assume that strings that start and end with <> are HTML and skip the regex check1505 match = [ null, selector, null ];1506 } else {1507 match = rquickExpr.exec( selector );1508 }1509 // Match html or make sure no context is specified for #id1510 if ( match && (match[1] || !context) ) {1511 // HANDLE: $(html) -> $(array)1512 if ( match[1] ) {1513 context = context instanceof jQuery ? context[0] : context;1514 // scripts is true for back-compat1515 // Intentionally let the error be thrown if parseHTML is not present1516 jQuery.merge( this, jQuery.parseHTML(1517 match[1],1518 context && context.nodeType ? context.ownerDocument || context : document,1519 true1520 ) );1521 // HANDLE: $(html, props)1522 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {1523 for ( match in context ) {1524 // Properties of context are called as methods if possible1525 if ( jQuery.isFunction( this[ match ] ) ) {1526 this[ match ]( context[ match ] );1527 // ...and otherwise set as attributes1528 } else {1529 this.attr( match, context[ match ] );1530 }1531 }1532 }1533 return this;1534 // HANDLE: $(#id)1535 } else {1536 elem = document.getElementById( match[2] );1537 // Check parentNode to catch when Blackberry 4.6 returns1538 // nodes that are no longer in the document #69631539 if ( elem && elem.parentNode ) {1540 // Handle the case where IE and Opera return items1541 // by name instead of ID1542 if ( elem.id !== match[2] ) {1543 return rootjQuery.find( selector );1544 }1545 // Otherwise, we inject the element directly into the jQuery object1546 this.length = 1;1547 this[0] = elem;1548 }1549 this.context = document;1550 this.selector = selector;1551 return this;1552 }1553 // HANDLE: $(expr, $(...))1554 } else if ( !context || context.jquery ) {1555 return ( context || rootjQuery ).find( selector );1556 // HANDLE: $(expr, context)1557 // (which is just equivalent to: $(context).find(expr)1558 } else {1559 return this.constructor( context ).find( selector );1560 }1561 // HANDLE: $(DOMElement)1562 } else if ( selector.nodeType ) {1563 this.context = this[0] = selector;1564 this.length = 1;1565 return this;1566 // HANDLE: $(function)1567 // Shortcut for document ready1568 } else if ( jQuery.isFunction( selector ) ) {1569 return typeof rootjQuery.ready !== "undefined" ?1570 rootjQuery.ready( selector ) :1571 // Execute immediately if ready is not present1572 selector( jQuery );1573 }1574 if ( selector.selector !== undefined ) {1575 this.selector = selector.selector;1576 this.context = selector.context;1577 }1578 return jQuery.makeArray( selector, this );1579 };1580// Give the init function the jQuery prototype for later instantiation1581init.prototype = jQuery.fn;1582// Initialize central reference1583rootjQuery = jQuery( document );1584var rparentsprev = /^(?:parents|prev(?:Until|All))/,1585 // methods guaranteed to produce a unique set when starting from a unique set1586 guaranteedUnique = {1587 children: true,1588 contents: true,1589 next: true,1590 prev: true1591 };1592jQuery.extend({1593 dir: function( elem, dir, until ) {1594 var matched = [],1595 cur = elem[ dir ];1596 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {1597 if ( cur.nodeType === 1 ) {1598 matched.push( cur );1599 }1600 cur = cur[dir];1601 }1602 return matched;1603 },1604 sibling: function( n, elem ) {1605 var r = [];1606 for ( ; n; n = n.nextSibling ) {1607 if ( n.nodeType === 1 && n !== elem ) {1608 r.push( n );1609 }1610 }1611 return r;1612 }1613});1614jQuery.fn.extend({1615 has: function( target ) {1616 var i,1617 targets = jQuery( target, this ),1618 len = targets.length;1619 return this.filter(function() {1620 for ( i = 0; i < len; i++ ) {1621 if ( jQuery.contains( this, targets[i] ) ) {1622 return true;1623 }1624 }1625 });1626 },1627 closest: function( selectors, context ) {1628 var cur,1629 i = 0,1630 l = this.length,1631 matched = [],1632 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?1633 jQuery( selectors, context || this.context ) :1634 0;1635 for ( ; i < l; i++ ) {1636 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {1637 // Always skip document fragments1638 if ( cur.nodeType < 11 && (pos ?1639 pos.index(cur) > -1 :1640 // Don't pass non-elements to Sizzle1641 cur.nodeType === 1 &&1642 jQuery.find.matchesSelector(cur, selectors)) ) {1643 matched.push( cur );1644 break;1645 }1646 }1647 }1648 return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );1649 },1650 // Determine the position of an element within1651 // the matched set of elements1652 index: function( elem ) {1653 // No argument, return index in parent1654 if ( !elem ) {1655 return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;1656 }1657 // index in selector1658 if ( typeof elem === "string" ) {1659 return jQuery.inArray( this[0], jQuery( elem ) );1660 }1661 // Locate the position of the desired element1662 return jQuery.inArray(1663 // If it receives a jQuery object, the first element is used1664 elem.jquery ? elem[0] : elem, this );1665 },1666 add: function( selector, context ) {1667 return this.pushStack(1668 jQuery.unique(1669 jQuery.merge( this.get(), jQuery( selector, context ) )1670 )1671 );1672 },1673 addBack: function( selector ) {1674 return this.add( selector == null ?1675 this.prevObject : this.prevObject.filter(selector)1676 );1677 }1678});1679function sibling( cur, dir ) {1680 do {1681 cur = cur[ dir ];1682 } while ( cur && cur.nodeType !== 1 );1683 return cur;1684}1685jQuery.each({1686 parent: function( elem ) {1687 var parent = elem.parentNode;1688 return parent && parent.nodeType !== 11 ? parent : null;1689 },1690 parents: function( elem ) {1691 return jQuery.dir( elem, "parentNode" );1692 },1693 parentsUntil: function( elem, i, until ) {1694 return jQuery.dir( elem, "parentNode", until );1695 },1696 next: function( elem ) {1697 return sibling( elem, "nextSibling" );1698 },1699 prev: function( elem ) {1700 return sibling( elem, "previousSibling" );1701 },1702 nextAll: function( elem ) {1703 return jQuery.dir( elem, "nextSibling" );1704 },1705 prevAll: function( elem ) {1706 return jQuery.dir( elem, "previousSibling" );1707 },1708 nextUntil: function( elem, i, until ) {1709 return jQuery.dir( elem, "nextSibling", until );1710 },1711 prevUntil: function( elem, i, until ) {1712 return jQuery.dir( elem, "previousSibling", until );1713 },1714 siblings: function( elem ) {1715 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );1716 },1717 children: function( elem ) {1718 return jQuery.sibling( elem.firstChild );1719 },1720 contents: function( elem ) {1721 return jQuery.nodeName( elem, "iframe" ) ?1722 elem.contentDocument || elem.contentWindow.document :1723 jQuery.merge( [], elem.childNodes );1724 }1725}, function( name, fn ) {1726 jQuery.fn[ name ] = function( until, selector ) {1727 var ret = jQuery.map( this, fn, until );1728 if ( name.slice( -5 ) !== "Until" ) {1729 selector = until;1730 }1731 if ( selector && typeof selector === "string" ) {1732 ret = jQuery.filter( selector, ret );1733 }1734 if ( this.length > 1 ) {1735 // Remove duplicates1736 if ( !guaranteedUnique[ name ] ) {1737 ret = jQuery.unique( ret );1738 }1739 // Reverse order for parents* and prev-derivatives1740 if ( rparentsprev.test( name ) ) {1741 ret = ret.reverse();1742 }1743 }1744 return this.pushStack( ret );1745 };1746});1747var rnotwhite = (/\S+/g);1748// String to Object options format cache1749var optionsCache = {};1750// Convert String-formatted options into Object-formatted ones and store in cache1751function createOptions( options ) {1752 var object = optionsCache[ options ] = {};1753 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {1754 object[ flag ] = true;1755 });1756 return object;1757}1758/*1759 * Create a callback list using the following parameters:1760 *1761 * options: an optional list of space-separated options that will change how1762 * the callback list behaves or a more traditional option object1763 *1764 * By default a callback list will act like an event callback list and can be1765 * "fired" multiple times.1766 *1767 * Possible options:1768 *1769 * once: will ensure the callback list can only be fired once (like a Deferred)1770 *1771 * memory: will keep track of previous values and will call any callback added1772 * after the list has been fired right away with the latest "memorized"1773 * values (like a Deferred)1774 *1775 * unique: will ensure a callback can only be added once (no duplicate in the list)1776 *1777 * stopOnFalse: interrupt callings when a callback returns false1778 *1779 */1780jQuery.Callbacks = function( options ) {1781 // Convert options from String-formatted to Object-formatted if needed1782 // (we check in cache first)1783 options = typeof options === "string" ?1784 ( optionsCache[ options ] || createOptions( options ) ) :1785 jQuery.extend( {}, options );1786 var // Flag to know if list is currently firing1787 firing,1788 // Last fire value (for non-forgettable lists)1789 memory,1790 // Flag to know if list was already fired1791 fired,1792 // End of the loop when firing1793 firingLength,1794 // Index of currently firing callback (modified by remove if needed)1795 firingIndex,1796 // First callback to fire (used internally by add and fireWith)1797 firingStart,1798 // Actual callback list1799 list = [],1800 // Stack of fire calls for repeatable lists1801 stack = !options.once && [],1802 // Fire callbacks1803 fire = function( data ) {1804 memory = options.memory && data;1805 fired = true;1806 firingIndex = firingStart || 0;1807 firingStart = 0;1808 firingLength = list.length;1809 firing = true;1810 for ( ; list && firingIndex < firingLength; firingIndex++ ) {1811 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {1812 memory = false; // To prevent further calls using add1813 break;1814 }1815 }1816 firing = false;1817 if ( list ) {1818 if ( stack ) {1819 if ( stack.length ) {1820 fire( stack.shift() );1821 }1822 } else if ( memory ) {1823 list = [];1824 } else {1825 self.disable();1826 }1827 }1828 },1829 // Actual Callbacks object1830 self = {1831 // Add a callback or a collection of callbacks to the list1832 add: function() {1833 if ( list ) {1834 // First, we save the current length1835 var start = list.length;1836 (function add( args ) {1837 jQuery.each( args, function( _, arg ) {1838 var type = jQuery.type( arg );1839 if ( type === "function" ) {1840 if ( !options.unique || !self.has( arg ) ) {1841 list.push( arg );1842 }1843 } else if ( arg && arg.length && type !== "string" ) {1844 // Inspect recursively1845 add( arg );1846 }1847 });1848 })( arguments );1849 // Do we need to add the callbacks to the1850 // current firing batch?1851 if ( firing ) {1852 firingLength = list.length;1853 // With memory, if we're not firing then1854 // we should call right away1855 } else if ( memory ) {1856 firingStart = start;1857 fire( memory );1858 }1859 }1860 return this;1861 },1862 // Remove a callback from the list1863 remove: function() {1864 if ( list ) {1865 jQuery.each( arguments, function( _, arg ) {1866 var index;1867 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {1868 list.splice( index, 1 );1869 // Handle firing indexes1870 if ( firing ) {1871 if ( index <= firinglength="" )="" {="" firinglength--;="" }="" if="" (="" index="" <="firingIndex" firingindex--;="" });="" return="" this;="" },="" check="" a="" given="" callback="" is="" in="" the="" list.="" no="" argument="" given,="" whether="" or="" not="" list="" has="" callbacks="" attached.="" has:="" function(="" fn="" ?="" jquery.inarray(="" fn,=""> -1 : !!( list && list.length );1872 },1873 // Remove all callbacks from the list1874 empty: function() {1875 list = [];1876 firingLength = 0;1877 return this;1878 },1879 // Have the list do nothing anymore1880 disable: function() {1881 list = stack = memory = undefined;1882 return this;1883 },1884 // Is it disabled?1885 disabled: function() {1886 return !list;1887 },1888 // Lock the list in its current state1889 lock: function() {1890 stack = undefined;1891 if ( !memory ) {1892 self.disable();1893 }1894 return this;1895 },1896 // Is it locked?1897 locked: function() {1898 return !stack;1899 },1900 // Call all callbacks with the given context and arguments1901 fireWith: function( context, args ) {1902 if ( list && ( !fired || stack ) ) {1903 args = args || [];1904 args = [ context, args.slice ? args.slice() : args ];1905 if ( firing ) {1906 stack.push( args );1907 } else {1908 fire( args );1909 }1910 }1911 return this;1912 },1913 // Call all the callbacks with the given arguments1914 fire: function() {1915 self.fireWith( this, arguments );1916 return this;1917 },1918 // To know if the callbacks have already been called at least once1919 fired: function() {1920 return !!fired;1921 }1922 };1923 return self;1924};1925jQuery.extend({1926 Deferred: function( func ) {1927 var tuples = [1928 // action, add listener, listener list, final state1929 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],1930 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],1931 [ "notify", "progress", jQuery.Callbacks("memory") ]1932 ],1933 state = "pending",1934 promise = {1935 state: function() {1936 return state;1937 },1938 always: function() {1939 deferred.done( arguments ).fail( arguments );1940 return this;1941 },1942 then: function( /* fnDone, fnFail, fnProgress */ ) {1943 var fns = arguments;1944 return jQuery.Deferred(function( newDefer ) {1945 jQuery.each( tuples, function( i, tuple ) {1946 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];1947 // deferred[ done | fail | progress ] for forwarding actions to newDefer1948 deferred[ tuple[1] ](function() {1949 var returned = fn && fn.apply( this, arguments );1950 if ( returned && jQuery.isFunction( returned.promise ) ) {1951 returned.promise()1952 .done( newDefer.resolve )1953 .fail( newDefer.reject )1954 .progress( newDefer.notify );1955 } else {1956 newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );1957 }1958 });1959 });1960 fns = null;1961 }).promise();1962 },1963 // Get a promise for this deferred1964 // If obj is provided, the promise aspect is added to the object1965 promise: function( obj ) {1966 return obj != null ? jQuery.extend( obj, promise ) : promise;1967 }1968 },1969 deferred = {};1970 // Keep pipe for back-compat1971 promise.pipe = promise.then;1972 // Add list-specific methods1973 jQuery.each( tuples, function( i, tuple ) {1974 var list = tuple[ 2 ],1975 stateString = tuple[ 3 ];1976 // promise[ done | fail | progress ] = list.add1977 promise[ tuple[1] ] = list.add;1978 // Handle state1979 if ( stateString ) {1980 list.add(function() {1981 // state = [ resolved | rejected ]1982 state = stateString;1983 // [ reject_list | resolve_list ].disable; progress_list.lock1984 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );1985 }1986 // deferred[ resolve | reject | notify ]1987 deferred[ tuple[0] ] = function() {1988 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );1989 return this;1990 };1991 deferred[ tuple[0] + "With" ] = list.fireWith;1992 });1993 // Make the deferred a promise1994 promise.promise( deferred );1995 // Call given func if any1996 if ( func ) {1997 func.call( deferred, deferred );1998 }1999 // All done!2000 return deferred;2001 },2002 // Deferred helper2003 when: function( subordinate /* , ..., subordinateN */ ) {2004 var i = 0,2005 resolveValues = slice.call( arguments ),2006 length = resolveValues.length,2007 // the count of uncompleted subordinates2008 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,2009 // the master Deferred. If resolveValues consist of only a single Deferred, just use that.2010 deferred = remaining === 1 ? subordinate : jQuery.Deferred(),2011 // Update function for both resolve and progress values2012 updateFunc = function( i, contexts, values ) {2013 return function( value ) {2014 contexts[ i ] = this;2015 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;2016 if ( values === progressValues ) {2017 deferred.notifyWith( contexts, values );2018 } else if ( !(--remaining) ) {2019 deferred.resolveWith( contexts, values );2020 }2021 };2022 },2023 progressValues, progressContexts, resolveContexts;2024 // add listeners to Deferred subordinates; treat others as resolved2025 if ( length > 1 ) {2026 progressValues = new Array( length );2027 progressContexts = new Array( length );2028 resolveContexts = new Array( length );2029 for ( ; i < length; i++ ) {2030 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {2031 resolveValues[ i ].promise()2032 .done( updateFunc( i, resolveContexts, resolveValues ) )2033 .fail( deferred.reject )2034 .progress( updateFunc( i, progressContexts, progressValues ) );2035 } else {2036 --remaining;2037 }2038 }2039 }2040 // if we're not waiting on anything, resolve the master2041 if ( !remaining ) {2042 deferred.resolveWith( resolveContexts, resolveValues );2043 }2044 return deferred.promise();2045 }2046});2047// The deferred used on DOM ready2048var readyList;2049jQuery.fn.ready = function( fn ) {2050 // Add the callback2051 jQuery.ready.promise().done( fn );2052 return this;2053};2054jQuery.extend({2055 // Is the DOM ready to be used? Set to true once it occurs.2056 isReady: false,2057 // A counter to track how many items to wait for before2058 // the ready event fires. See #67812059 readyWait: 1,2060 // Hold (or release) the ready event2061 holdReady: function( hold ) {2062 if ( hold ) {2063 jQuery.readyWait++;2064 } else {2065 jQuery.ready( true );2066 }2067 },2068 // Handle when the DOM is ready2069 ready: function( wait ) {2070 // Abort if there are pending holds or we're already ready2071 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {2072 return;2073 }2074 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).2075 if ( !document.body ) {2076 return setTimeout( jQuery.ready );2077 }2078 // Remember that the DOM is ready2079 jQuery.isReady = true;2080 // If a normal DOM Ready event fired, decrement, and wait if need be2081 if ( wait !== true && --jQuery.readyWait > 0 ) {2082 return;2083 }2084 // If there are functions bound, to execute2085 readyList.resolveWith( document, [ jQuery ] );2086 // Trigger any bound ready events2087 if ( jQuery.fn.triggerHandler ) {2088 jQuery( document ).triggerHandler( "ready" );2089 jQuery( document ).off( "ready" );2090 }2091 }2092});2093/**2094 * Clean-up method for dom ready events2095 */2096function detach() {2097 if ( document.addEventListener ) {2098 document.removeEventListener( "DOMContentLoaded", completed, false );2099 window.removeEventListener( "load", completed, false );2100 } else {2101 document.detachEvent( "onreadystatechange", completed );2102 window.detachEvent( "onload", completed );2103 }2104}2105/**2106 * The ready event handler and self cleanup method2107 */2108function completed() {2109 // readyState === "complete" is good enough for us to call the dom ready in oldIE2110 if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {2111 detach();2112 jQuery.ready();2113 }2114}2115jQuery.ready.promise = function( obj ) {2116 if ( !readyList ) {2117 readyList = jQuery.Deferred();2118 // Catch cases where $(document).ready() is called after the browser event has already occurred.2119 // we once tried to use readyState "interactive" here, but it caused issues like the one2120 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:152121 if ( document.readyState === "complete" ) {2122 // Handle it asynchronously to allow scripts the opportunity to delay ready2123 setTimeout( jQuery.ready );2124 // Standards-based browsers support DOMContentLoaded2125 } else if ( document.addEventListener ) {2126 // Use the handy event callback2127 document.addEventListener( "DOMContentLoaded", completed, false );2128 // A fallback to window.onload, that will always work2129 window.addEventListener( "load", completed, false );2130 // If IE event model is used2131 } else {2132 // Ensure firing before onload, maybe late but safe also for iframes2133 document.attachEvent( "onreadystatechange", completed );2134 // A fallback to window.onload, that will always work2135 window.attachEvent( "onload", completed );2136 // If IE and not a frame2137 // continually check to see if the document is ready2138 var top = false;2139 try {2140 top = window.frameElement == null && document.documentElement;2141 } catch(e) {}2142 if ( top && top.doScroll ) {2143 (function doScrollCheck() {2144 if ( !jQuery.isReady ) {2145 try {2146 // Use the trick by Diego Perini2147 // http://javascript.nwbox.com/IEContentLoaded/2148 top.doScroll("left");2149 } catch(e) {2150 return setTimeout( doScrollCheck, 50 );2151 }2152 // detach all dom ready events2153 detach();2154 // and execute any waiting functions2155 jQuery.ready();2156 }2157 })();2158 }2159 }2160 }2161 return readyList.promise( obj );2162};2163var strundefined = typeof undefined;2164// Support: IE<9 0="" 1="" 6="" 7="" 9="" iteration="" over="" object's="" inherited="" properties="" before="" its="" own="" var="" i;="" for="" (="" i="" in="" jquery(="" support="" )="" {="" break;="" }="" support.ownlast="i" !="=" "0";="" note:="" most="" tests="" are="" defined="" their="" respective="" modules.="" false="" until="" the="" test="" is="" run="" support.inlineblockneedslayout="false;" execute="" asap="" case="" we="" need="" to="" set="" body.style.zoom="" jquery(function()="" minified:="" a,b,c,d="" val,="" div,="" body,="" container;="" body="document.getElementsByTagName(" "body"="" )[="" ];="" if="" !body="" ||="" !body.style="" return="" frameset="" docs="" that="" don't="" have="" a="" return;="" setup="" div="document.createElement(" "div"="" );="" container="document.createElement(" container.style.csstext="position:absolute;border:0;width:0;height:0;top:0;left:-9999px" ;="" body.appendchild(="" ).appendchild(="" typeof="" div.style.zoom="" strundefined="" support:="" ie<8="" check="" natively="" block-level="" elements="" act="" like="" inline-block="" when="" setting="" display="" 'inline'="" and="" giving="" them="" layout="" div.style.csstext="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1" =="" div.offsetwidth="==" 3;="" val="" prevent="" ie="" from="" affecting="" positioned="" #11048="" shrinking="" mode="" #12869="" body.removechild(="" });="" (function()="" only="" not="" already="" executed="" another="" module.="" (support.deleteexpando="=" null)="" ie<9="" support.deleteexpando="true;" try="" delete="" div.test;="" catch(="" e="" null="" avoid="" leaks="" ie.="" })();="" **="" *="" determines="" whether="" an="" object="" can="" data="" jquery.acceptdata="function(" elem="" nodata="jQuery.noData[" (elem.nodename="" +="" "="" ").tolowercase()="" ],="" nodetype="+elem.nodeType" 1;="" do="" on="" non-element="" dom="" nodes="" because="" it="" will="" be="" cleared="" (#8335).="" &&="" ?="" :="" accept="" unless="" otherwise="" specified;="" rejection="" conditional="" !nodata="" true="" elem.getattribute("classid")="==" nodata;="" };="" rbrace="/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/," rmultidash="/([A-Z])/g;" function="" dataattr(="" elem,="" key,="" nothing="" was="" found="" internally,="" fetch="" any="" html5="" data-*="" attribute="" undefined="" elem.nodetype="==" name="data-" key.replace(="" rmultidash,="" "-$1"="" ).tolowercase();="" "string"="" "true"="" "false"="" "null"="" convert="" number="" doesn't="" change="" string="" +data="" ""="==" rbrace.test(="" jquery.parsejson(="" data;="" {}="" make="" sure="" so="" isn't="" changed="" later="" jquery.data(="" else="" checks="" cache="" emptiness="" isemptydataobject(="" obj="" name;="" public="" empty,="" private="" still="" empty="" "data"="" jquery.isemptyobject(="" obj[name]="" continue;="" "tojson"="" false;="" true;="" internaldata(="" name,="" data,="" pvt="" internal="" use="" !jquery.acceptdata(="" ret,="" thiscache,="" internalkey="jQuery.expando," handle="" js="" objects="" differently="" ie6-7="" can't="" gc="" references="" properly="" across="" dom-js="" boundary="" isnode="elem.nodeType," global="" jquery="" cache;="" attached="" directly="" occur="" automatically="" jquery.cache="" defining="" id="" exists="" allows="" code="" shortcut="" same="" path="" as="" node="" with="" no="" elem[="" ]="" internalkey;="" doing="" more="" work="" than="" trying="" get="" has="" at="" all="" (!id="" !cache[id]="" (!pvt="" !cache[id].data))="" !id="" new="" unique="" each="" element="" since="" ends="" up="" jquery.guid++;="" !cache[="" exposing="" metadata="" plain="" serialized="" using="" json.stringify="" cache[="" tojson:="" jquery.noop="" passed="" jquery.data="" instead="" of="" key="" value="" pair;="" this="" gets="" shallow="" copied="" onto="" existing="" "object"="" "function"="" ].data="jQuery.extend(" ].data,="" thiscache="cache[" data()="" stored="" separate="" inside="" order="" collisions="" between="" user-defined="" data.="" !pvt="" !thiscache.data="" thiscache.data="{};" thiscache[="" jquery.camelcase(="" both="" converted-to-camel="" non-converted="" property="" names="" specified="" first="" find="" as-is="" ret="thisCache[" null|undefined="" camelcased="" ret;="" internalremovedata(="" i,="" see="" information="" jquery.expando="" jquery.expando;="" there="" entry="" object,="" purpose="" continuing="" ].data;="" array="" or="" space="" separated="" keys="" !jquery.isarray(="" manipulation="" split="" camel="" cased="" version="" by="" spaces="" ");="" "name"="" keys...="" initially="" created,="" via="" ("key",="" "val")="" signature,="" converted="" camelcase.="" way="" tell="" _how_="" added,="" remove="" camelcase="" key.="" #12786="" penalize="" argument="" path.="" jquery.map(="" jquery.camelcase="" while="" i--="" name[i]="" left="" cache,="" want="" continue="" let="" itself="" destroyed="" !isemptydataobject(thiscache)="" !jquery.isemptyobject(thiscache)="" destroy="" parent="" had="" been="" thing="" !isemptydataobject(="" jquery.cleandata(="" [="" supported="" expandos="" `cache`="" window="" per="" iswindow="" (#10080)="" jshint="" eqeqeq:="" fails,="" jquery.extend({="" cache:="" {},="" following="" (space-suffixed="" object.prototype="" collisions)="" throw="" uncatchable="" exceptions="" you="" attempt="" expando="" nodata:="" "applet="" ":="" true,="" "embed="" ...but="" flash="" (which="" classid)="" *can*="" "object="" "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"="" },="" hasdata:="" function(="" jquery.cache[="" elem[jquery.expando]="" !!elem="" data:="" removedata:="" only.="" _data:="" _removedata:="" jquery.fn.extend({="" attrs="elem" elem.attributes;="" special="" expections="" .data="" basically="" thwart="" jquery.access,="" implement="" relevant="" behavior="" ourselves="" values="" this.length="" !jquery._data(="" "parsedattrs"="" ie11+="" (#14894)="" attrs[="" ].name;="" name.indexof(="" "data-"="" name.slice(5)="" data[="" jquery._data(="" "parsedattrs",="" sets="" multiple this.each(function()="" this,="" arguments.length=""> 1 ?2165 // Sets one value2166 this.each(function() {2167 jQuery.data( this, key, value );2168 }) :2169 // Gets one value2170 // Try to fetch any internally stored data first2171 elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;2172 },2173 removeData: function( key ) {2174 return this.each(function() {2175 jQuery.removeData( this, key );2176 });2177 }2178});2179jQuery.extend({2180 queue: function( elem, type, data ) {2181 var queue;2182 if ( elem ) {2183 type = ( type || "fx" ) + "queue";2184 queue = jQuery._data( elem, type );2185 // Speed up dequeue by getting out quickly if this is just a lookup2186 if ( data ) {2187 if ( !queue || jQuery.isArray(data) ) {2188 queue = jQuery._data( elem, type, jQuery.makeArray(data) );2189 } else {2190 queue.push( data );2191 }2192 }2193 return queue || [];2194 }2195 },2196 dequeue: function( elem, type ) {2197 type = type || "fx";2198 var queue = jQuery.queue( elem, type ),2199 startLength = queue.length,2200 fn = queue.shift(),2201 hooks = jQuery._queueHooks( elem, type ),2202 next = function() {2203 jQuery.dequeue( elem, type );2204 };2205 // If the fx queue is dequeued, always remove the progress sentinel2206 if ( fn === "inprogress" ) {2207 fn = queue.shift();2208 startLength--;2209 }2210 if ( fn ) {2211 // Add a progress sentinel to prevent the fx queue from being2212 // automatically dequeued2213 if ( type === "fx" ) {2214 queue.unshift( "inprogress" );2215 }2216 // clear up the last queue stop function2217 delete hooks.stop;2218 fn.call( elem, next, hooks );2219 }2220 if ( !startLength && hooks ) {2221 hooks.empty.fire();2222 }2223 },2224 // not intended for public consumption - generates a queueHooks object, or returns the current one2225 _queueHooks: function( elem, type ) {2226 var key = type + "queueHooks";2227 return jQuery._data( elem, key ) || jQuery._data( elem, key, {2228 empty: jQuery.Callbacks("once memory").add(function() {2229 jQuery._removeData( elem, type + "queue" );2230 jQuery._removeData( elem, key );2231 })2232 });2233 }2234});2235jQuery.fn.extend({2236 queue: function( type, data ) {2237 var setter = 2;2238 if ( typeof type !== "string" ) {2239 data = type;2240 type = "fx";2241 setter--;2242 }2243 if ( arguments.length < setter ) {2244 return jQuery.queue( this[0], type );2245 }2246 return data === undefined ?2247 this :2248 this.each(function() {2249 var queue = jQuery.queue( this, type, data );2250 // ensure a hooks for this queue2251 jQuery._queueHooks( this, type );2252 if ( type === "fx" && queue[0] !== "inprogress" ) {2253 jQuery.dequeue( this, type );2254 }2255 });2256 },2257 dequeue: function( type ) {2258 return this.each(function() {2259 jQuery.dequeue( this, type );2260 });2261 },2262 clearQueue: function( type ) {2263 return this.queue( type || "fx", [] );2264 },2265 // Get a promise resolved when queues of a certain type2266 // are emptied (fx is the type by default)2267 promise: function( type, obj ) {2268 var tmp,2269 count = 1,2270 defer = jQuery.Deferred(),2271 elements = this,2272 i = this.length,2273 resolve = function() {2274 if ( !( --count ) ) {2275 defer.resolveWith( elements, [ elements ] );2276 }2277 };2278 if ( typeof type !== "string" ) {2279 obj = type;2280 type = undefined;2281 }2282 type = type || "fx";2283 while ( i-- ) {2284 tmp = jQuery._data( elements[ i ], type + "queueHooks" );2285 if ( tmp && tmp.empty ) {2286 count++;2287 tmp.empty.add( resolve );2288 }2289 }2290 resolve();2291 return defer.promise( obj );2292 }2293});2294var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;2295var cssExpand = [ "Top", "Right", "Bottom", "Left" ];2296var isHidden = function( elem, el ) {2297 // isHidden might be called from jQuery#filter function;2298 // in that case, element will be second argument2299 elem = el || elem;2300 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );2301 };2302// Multifunctional method to get and set values of a collection2303// The value/s can optionally be executed if it's a function2304var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {2305 var i = 0,2306 length = elems.length,2307 bulk = key == null;2308 // Sets many values2309 if ( jQuery.type( key ) === "object" ) {2310 chainable = true;2311 for ( i in key ) {2312 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );2313 }2314 // Sets one value2315 } else if ( value !== undefined ) {2316 chainable = true;2317 if ( !jQuery.isFunction( value ) ) {2318 raw = true;2319 }2320 if ( bulk ) {2321 // Bulk operations run against the entire set2322 if ( raw ) {2323 fn.call( elems, value );2324 fn = null;2325 // ...except when executing function values2326 } else {2327 bulk = fn;2328 fn = function( elem, key, value ) {2329 return bulk.call( jQuery( elem ), value );2330 };2331 }2332 }2333 if ( fn ) {2334 for ( ; i < length; i++ ) {2335 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );2336 }2337 }2338 }2339 return chainable ?2340 elems :2341 // Gets2342 bulk ?2343 fn.call( elems ) :2344 length ? fn( elems[0], key ) : emptyGet;2345};2346var rcheckableType = (/^(?:checkbox|radio)$/i);2347(function() {2348 // Minified: var a,b,c2349 var input = document.createElement( "input" ),2350 div = document.createElement( "div" ),2351 fragment = document.createDocumentFragment();2352 // Setup2353 div.innerHTML = " <link><table></table><a href="/a">a</a><input type="checkbox">";2354 // IE strips leading whitespace when .innerHTML is used2355 support.leadingWhitespace = div.firstChild.nodeType === 3;2356 // Make sure that tbody elements aren't automatically inserted2357 // IE will insert them into empty tables2358 support.tbody = !div.getElementsByTagName( "tbody" ).length;2359 // Make sure that link elements get serialized correctly by innerHTML2360 // This requires a wrapper element in IE2361 support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;2362 // Makes sure cloning an html5 element does not cause problems2363 // Where outerHTML is undefined, this still works2364 support.html5Clone =2365 document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";2366 // Check if a disconnected checkbox will retain its checked2367 // value of true after appended to the DOM (IE6/7)2368 input.type = "checkbox";2369 input.checked = true;2370 fragment.appendChild( input );2371 support.appendChecked = input.checked;2372 // Make sure textarea (and checkbox) defaultValue is properly cloned2373 // Support: IE6-IE11+2374 div.innerHTML = "<textarea>x</textarea>";2375 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;2376 // #11217 - WebKit loses check when the name is after the checked attribute2377 fragment.appendChild( div );2378 div.innerHTML = "<input type="radio" checked="checked" name="t">";2379 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.32380 // old WebKit doesn't clone checked state correctly in fragments2381 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;2382 // Support: IE<9 1="" 3="" 8="" opera="" does="" not="" clone="" events="" (and="" typeof="" div.attachevent="==" undefined).="" ie9-10="" clones="" bound="" via="" attachevent,="" but="" they="" don't="" trigger="" with="" .click()="" support.nocloneevent="true;" if="" (="" )="" {="" div.attachevent(="" "onclick",="" function()="" });="" div.clonenode(="" true="" ).click();="" }="" execute="" the="" test="" only="" already="" executed="" in="" another="" module.="" (support.deleteexpando="=" null)="" support:="" ie<9="" support.deleteexpando="true;" try="" delete="" div.test;="" catch(="" e="" })();="" (function()="" var="" i,="" eventname,="" div="document.createElement(" "div"="" );="" (lack="" submit="" change="" bubble),="" firefox="" 23+="" focusin="" event)="" for="" i="" submit:="" true,="" change:="" focusin:="" })="" eventname="on" +="" i;="" !(support[="" "bubbles"="" ]="eventName" window)="" beware="" of="" csp="" restrictions="" (https:="" developer.mozilla.org="" en="" security="" csp)="" div.setattribute(="" "t"="" support[="" ].expando="==" false;="" null="" elements="" to="" avoid="" leaks="" ie.="" rformelems="/^(?:input|select|textarea)$/i," rkeyevent="/^key/," rmouseevent="/^(?:mouse|pointer|contextmenu)|click/," rfocusmorph="/^(?:focusinfocus|focusoutblur)$/," rtypenamespace="/^([^.]*)(?:\.(.+)|)$/;" function="" returntrue()="" return="" true;="" returnfalse()="" safeactiveelement()="" document.activeelement;="" catch="" err="" *="" helper="" functions="" managing="" --="" part="" public="" interface.="" props="" dean="" edwards'="" addevent="" library="" many="" ideas.="" jquery.event="{" global:="" {},="" add:="" function(="" elem,="" types,="" handler,="" data,="" selector="" tmp,="" events,="" t,="" handleobjin,="" special,="" eventhandle,="" handleobj,="" handlers,="" type,="" namespaces,="" origtype,="" elemdata="jQuery._data(" elem="" attach="" nodata="" or="" text="" comment="" nodes="" (but="" allow="" plain="" objects)="" !elemdata="" return;="" caller="" can="" pass="" an="" object="" custom="" data="" lieu="" handler="" handler.handler="" handleobjin="handler;" make="" sure="" that="" has="" a="" unique="" id,="" used="" find="" remove="" it="" later="" !handler.guid="" handler.guid="jQuery.guid++;" init="" element's="" event="" structure="" and="" main="" this="" is="" first="" !(events="elemData.events)" =="" {};="" !(eventhandle="elemData.handle)" eventhandle="elemData.handle" discard="" second="" jquery.event.trigger()="" when="" called="" after="" page="" unloaded="" jquery="" !="=" strundefined="" &&="" (!e="" ||="" jquery.event.triggered="" e.type)="" ?="" jquery.event.dispatch.apply(="" eventhandle.elem,="" arguments="" :="" undefined;="" };="" add="" as="" property="" handle="" fn="" prevent="" memory="" leak="" ie="" non-native="" eventhandle.elem="elem;" multiple separated="" by="" space="" types="(" ""="" ).match(="" rnotwhite="" [="" ];="" t="types.length;" while="" t--="" tmp="rtypenamespace.exec(" types[t]="" [];="" type="origType" tmp[1];="" namespaces="(" tmp[2]="" ).split(="" "."="" ).sort();="" there="" *must*="" be="" no="" attaching="" namespace-only="" handlers="" !type="" continue;="" changes="" its="" use="" special="" changed="" defined,="" determine="" api="" otherwise="" given="" special.delegatetype="" special.bindtype="" type;="" update="" based="" on="" newly="" reset="" handleobj="" passed="" all="" type:="" origtype:="" data:="" handler:="" guid:="" handler.guid,="" selector:="" selector,="" needscontext:="" jquery.expr.match.needscontext.test(="" ),="" namespace:="" namespaces.join(".")="" },="" queue="" we're="" !(handlers="events[" ])="" handlers.delegatecount="0;" addeventlistener="" attachevent="" returns="" false="" !special.setup="" special.setup.call(="" bind="" global="" element="" elem.addeventlistener="" elem.addeventlistener(="" else="" elem.attachevent="" elem.attachevent(="" "on"="" special.add="" special.add.call(="" !handleobj.handler.guid="" handleobj.handler.guid="handler.guid;" list,="" delegates="" front="" handlers.splice(="" handlers.delegatecount++,="" 0,="" handlers.push(="" keep="" track="" which="" have="" ever="" been="" used,="" optimization="" jquery.event.global[="" nullify="" detach="" set="" from="" remove:="" mappedtypes="" j,="" origcount,="" jquery._data(="" once="" each="" type.namespace="" types;="" may="" omitted="" unbind="" (on="" namespace,="" provided)="" jquery.event.remove(="" types[="" ],="" new="" regexp(="" "(^|\\.)"="" namespaces.join("\\.(?:.*\\.|)")="" "(\\.|$)"="" matching="" origcount="j" handlers.length;="" j--="" j="" origtype="==" handleobj.origtype="" !handler="" handleobj.guid="" !tmp="" tmp.test(="" handleobj.namespace="" !selector="" handleobj.selector="" "**"="" handlers.delegatecount--;="" special.remove="" special.remove.call(="" generic="" we="" removed="" something="" more="" exist="" (avoids="" potential="" endless="" recursion="" during="" removal="" handlers)="" !handlers.length="" !special.teardown="" special.teardown.call(="" elemdata.handle="" jquery.removeevent(="" events[="" expando="" it's="" longer="" jquery.isemptyobject(="" elemdata.handle;="" removedata="" also="" checks="" emptiness="" clears="" empty="" so="" instead="" jquery._removedata(="" "events"="" trigger:="" event,="" onlyhandlers="" handle,="" ontype,="" cur,="" bubbletype,="" eventpath="[" document="" "type"="" event.type="" "namespace"="" event.namespace.split(".")="" cur="tmp" document;="" do="" elem.nodetype="==" focus="" blur="" morphs="" out;="" ensure="" firing="" them="" right="" now="" rfocusmorph.test(="" type.indexof(".")="">= 0 ) {2383 // Namespaced trigger; create a regexp to match event type in handle()2384 namespaces = type.split(".");2385 type = namespaces.shift();2386 namespaces.sort();2387 }2388 ontype = type.indexOf(":") < 0 && "on" + type;2389 // Caller can pass in a jQuery.Event object, Object, or just an event type string2390 event = event[ jQuery.expando ] ?2391 event :2392 new jQuery.Event( type, typeof event === "object" && event );2393 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)2394 event.isTrigger = onlyHandlers ? 2 : 3;2395 event.namespace = namespaces.join(".");2396 event.namespace_re = event.namespace ?2397 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :2398 null;2399 // Clean up the event in case it is being reused2400 event.result = undefined;2401 if ( !event.target ) {2402 event.target = elem;2403 }2404 // Clone any incoming data and prepend the event, creating the handler arg list2405 data = data == null ?2406 [ event ] :2407 jQuery.makeArray( data, [ event ] );2408 // Allow special events to draw outside the lines2409 special = jQuery.event.special[ type ] || {};2410 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {2411 return;2412 }2413 // Determine event propagation path in advance, per W3C events spec (#9951)2414 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)2415 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {2416 bubbleType = special.delegateType || type;2417 if ( !rfocusMorph.test( bubbleType + type ) ) {2418 cur = cur.parentNode;2419 }2420 for ( ; cur; cur = cur.parentNode ) {2421 eventPath.push( cur );2422 tmp = cur;2423 }2424 // Only add window if we got to document (e.g., not plain obj or detached DOM)2425 if ( tmp === (elem.ownerDocument || document) ) {2426 eventPath.push( tmp.defaultView || tmp.parentWindow || window );2427 }2428 }2429 // Fire handlers on the event path2430 i = 0;2431 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {2432 event.type = i > 1 ?2433 bubbleType :2434 special.bindType || type;2435 // jQuery handler2436 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );2437 if ( handle ) {2438 handle.apply( cur, data );2439 }2440 // Native handler2441 handle = ontype && cur[ ontype ];2442 if ( handle && handle.apply && jQuery.acceptData( cur ) ) {2443 event.result = handle.apply( cur, data );2444 if ( event.result === false ) {2445 event.preventDefault();2446 }2447 }2448 }2449 event.type = type;2450 // If nobody prevented the default action, do it now2451 if ( !onlyHandlers && !event.isDefaultPrevented() ) {2452 if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&2453 jQuery.acceptData( elem ) ) {2454 // Call a native DOM method on the target with the same name name as the event.2455 // Can't use an .isFunction() check here because IE6/7 fails that test.2456 // Don't do default actions on window, that's where global variables be (#6170)2457 if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {2458 // Don't re-trigger an onFOO event when we call its FOO() method2459 tmp = elem[ ontype ];2460 if ( tmp ) {2461 elem[ ontype ] = null;2462 }2463 // Prevent re-triggering of the same event, since we already bubbled it above2464 jQuery.event.triggered = type;2465 try {2466 elem[ type ]();2467 } catch ( e ) {2468 // IE<9 dies="" on="" focus="" blur="" to="" hidden element="" (#1486,#12518)="" only="" reproducible="" winxp="" ie8="" native,="" not="" ie9="" in="" mode="" }="" jquery.event.triggered="undefined;" if="" (="" tmp="" )="" {="" elem[="" ontype="" ]="tmp;" return="" event.result;="" },="" dispatch:="" function(="" event="" make="" a="" writable="" jquery.event="" from="" the="" native="" object="" );="" var="" i,="" ret,="" handleobj,="" matched,="" j,="" handlerqueue="[]," args="slice.call(" arguments="" ),="" handlers="(" jquery._data(="" this,="" "events"="" ||="" {}="" )[="" event.type="" [],="" special="jQuery.event.special[" {};="" use="" fix-ed="" rather="" than="" (read-only)="" args[0]="event;" event.delegatetarget="this;" call="" predispatch="" hook="" for="" mapped="" type,="" and="" let="" it="" bail="" desired="" special.predispatch="" &&="" special.predispatch.call(="" false="" return;="" determine="" event,="" run="" delegates="" first;="" they="" may="" want="" stop="" propagation="" beneath="" us="" i="0;" while="" (matched="handlerQueue[" i++="" ])="" !event.ispropagationstopped()="" event.currenttarget="matched.elem;" j="0;" (handleobj="matched.handlers[" j++="" !event.isimmediatepropagationstopped()="" triggered="" must="" either="" 1)="" have="" no="" namespace,="" or="" 2)="" namespace(s)="" subset="" equal="" those="" bound="" (both="" can="" namespace).="" !event.namespace_re="" event.namespace_re.test(="" handleobj.namespace="" event.handleobj="handleObj;" event.data="handleObj.data;" ret="(" (jquery.event.special[="" handleobj.origtype="" {}).handle="" handleobj.handler="" .apply(="" matched.elem,="" !="=" undefined="" (event.result="ret)" =="=" event.preventdefault();="" event.stoppropagation();="" postdispatch="" type="" special.postdispatch="" special.postdispatch.call(="" handlers:="" sel,="" matches,="" delegatecount="handlers.delegateCount," cur="event.target;" find="" delegate="" black-hole="" svg="" <use=""> instance trees (#13180)2469 // Avoid non-left-click bubbling in Firefox (#3861)2470 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {2471 /* jshint eqeqeq: false */2472 for ( ; cur != this; cur = cur.parentNode || this ) {2473 /* jshint eqeqeq: true */2474 // Don't check non-elements (#13208)2475 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)2476 if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {2477 matches = [];2478 for ( i = 0; i < delegateCount; i++ ) {2479 handleObj = handlers[ i ];2480 // Don't conflict with Object.prototype properties (#13203)2481 sel = handleObj.selector + " ";2482 if ( matches[ sel ] === undefined ) {2483 matches[ sel ] = handleObj.needsContext ?2484 jQuery( sel, this ).index( cur ) >= 0 :2485 jQuery.find( sel, this, null, [ cur ] ).length;2486 }2487 if ( matches[ sel ] ) {2488 matches.push( handleObj );2489 }2490 }2491 if ( matches.length ) {2492 handlerQueue.push({ elem: cur, handlers: matches });2493 }2494 }2495 }2496 }2497 // Add the remaining (directly-bound) handlers2498 if ( delegateCount < handlers.length ) {2499 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });2500 }2501 return handlerQueue;2502 },2503 fix: function( event ) {2504 if ( event[ jQuery.expando ] ) {2505 return event;2506 }2507 // Create a writable copy of the event object and normalize some properties2508 var i, prop, copy,2509 type = event.type,2510 originalEvent = event,2511 fixHook = this.fixHooks[ type ];2512 if ( !fixHook ) {2513 this.fixHooks[ type ] = fixHook =2514 rmouseEvent.test( type ) ? this.mouseHooks :2515 rkeyEvent.test( type ) ? this.keyHooks :2516 {};2517 }2518 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;2519 event = new jQuery.Event( originalEvent );2520 i = copy.length;2521 while ( i-- ) {2522 prop = copy[ i ];2523 event[ prop ] = originalEvent[ prop ];2524 }2525 // Support: IE<9 0="" 1="==" 2="==" 3="" 4="" 2003="" fix="" target="" property="" (#1925)="" if="" (="" !event.target="" )="" {="" event.target="originalEvent.srcElement" ||="" document;="" }="" support:="" chrome="" 23+,="" safari?="" should="" not="" be="" a="" text="" node="" (#504,="" #13143)="" event.target.nodetype="==" ie<9="" for="" mouse="" key="" events,="" metakey="=false" it's="" undefined="" (#3368,="" #11328)="" event.metakey="!!event.metaKey;" return="" fixhook.filter="" ?="" fixhook.filter(="" event,="" originalevent="" :="" event;="" },="" includes="" some="" event="" props="" shared="" by="" keyevent="" and="" mouseevent="" props:="" "altkey="" bubbles="" cancelable="" ctrlkey="" currenttarget="" eventphase="" relatedtarget="" shiftkey="" timestamp="" view="" which".split("="" "),="" fixhooks:="" {},="" keyhooks:="" "char="" charcode="" keycode".split("="" filter:="" function(="" original="" add="" which="" events="" event.which="=" null="" !="null" original.charcode="" original.keycode;="" mousehooks:="" "button="" buttons="" clientx="" clienty="" fromelement="" offsetx="" offsety="" pagex="" pagey="" screenx="" screeny="" toelement".split("="" var="" body,="" eventdoc,="" doc,="" button="original.button," calculate="" y="" missing="" available="" event.pagex="=" &&="" original.clientx="" eventdoc="event.target.ownerDocument" doc="eventDoc.documentElement;" body="eventDoc.body;" +="" doc.scrollleft="" body.scrollleft="" -="" doc.clientleft="" body.clientleft="" );="" event.pagey="original.clientY" doc.scrolltop="" body.scrolltop="" doc.clienttop="" body.clienttop="" relatedtarget,="" necessary="" !event.relatedtarget="" event.relatedtarget="fromElement" =="=" original.toelement="" fromelement;="" click:="" left;="" middle;="" right="" note:="" is="" normalized,="" so="" don't="" use="" it="" !event.which="" &="" special:="" load:="" prevent="" triggered="" image.load="" from="" bubbling="" to="" window.load="" nobubble:="" true="" focus:="" fire="" native="" possible="" blur="" focus="" sequence="" correct="" trigger:="" function()="" this="" safeactiveelement()="" this.focus="" try="" this.focus();="" false;="" catch="" e="" we="" error="" on="" hidden element="" (#1486,="" #12518),="" let="" .trigger()="" run="" the="" handlers="" delegatetype:="" "focusin"="" blur:="" this.blur="" this.blur();="" "focusout"="" checkbox,="" checked state="" will="" jquery.nodename(="" this,="" "input"="" this.type="==" "checkbox"="" this.click="" this.click();="" cross-browser="" consistency,="" .click()="" links="" _default:="" event.target,="" "a"="" beforeunload:="" postdispatch:="" firefox="" 20+="" doesn't="" alert="" returnvalue="" field="" set.="" event.result="" event.originalevent="" event.originalevent.returnvalue="event.result;" simulate:="" type,="" elem,="" bubble="" piggyback="" donor="" simulate="" different="" one.="" fake="" avoid="" donor's="" stoppropagation,="" but="" simulated="" prevents="" default then="" do="" same="" donor.="" new="" jquery.event(),="" type:="" issimulated:="" true,="" originalevent:="" {}="" jquery.event.trigger(="" e,="" null,="" elem="" else="" jquery.event.dispatch.call(="" e.isdefaultprevented()="" event.preventdefault();="" };="" jquery.removeevent="document.removeEventListener" handle="" elem.removeeventlistener="" elem.removeeventlistener(="" handle,="" false="" name="on" type;="" elem.detachevent="" #8545,="" #7054,="" preventing="" memory="" leaks="" custom="" in="" ie6-8="" detachevent="" needed="" element,="" of="" that="" properly="" expose="" gc="" typeof="" elem[="" ]="==" strundefined="" elem.detachevent(="" name,="" jquery.event="function(" src,="" allow="" instantiation="" without="" 'new'="" keyword="" !(this="" instanceof="" jquery.event)="" jquery.event(="" object="" src="" src.type="" this.originalevent="src;" up="" document="" may="" have="" been="" marked="" as="" prevented="" handler="" lower="" down="" tree;="" reflect="" value.="" this.isdefaultprevented="src.defaultPrevented" src.defaultprevented="==" ie="" <="" 9,="" android="" 4.0="" src.returnvalue="==" returntrue="" returnfalse;="" type="" put="" explicitly="" provided="" properties="" onto="" jquery.extend(="" create="" incoming="" one="" this.timestamp="src" src.timestamp="" jquery.now();="" mark="" fixed="" this[="" jquery.expando="" based="" dom3="" specified="" ecmascript="" language="" binding="" http:="" www.w3.org="" tr="" wd-dom-level-3-events-20030331="" ecma-script-binding.html="" jquery.event.prototype="{" isdefaultprevented:="" returnfalse,="" ispropagationstopped:="" isimmediatepropagationstopped:="" preventdefault:="" !e="" return;="" preventdefault="" exists,="" e.preventdefault="" e.preventdefault();="" otherwise="" set="" e.returnvalue="false;" stoppropagation:="" this.ispropagationstopped="returnTrue;" stoppropagation="" e.stoppropagation="" e.stoppropagation();="" cancelbubble="" e.cancelbubble="true;" stopimmediatepropagation:="" this.isimmediatepropagationstopped="returnTrue;" e.stopimmediatepropagation="" e.stopimmediatepropagation();="" this.stoppropagation();="" mouseenter="" leave="" using="" mouseover="" out="" event-time="" checks="" jquery.each({="" mouseenter:="" "mouseover",="" mouseleave:="" "mouseout",="" pointerenter:="" "pointerover",="" pointerleave:="" "pointerout"="" orig,="" jquery.event.special[="" orig="" fix,="" bindtype:="" handle:="" ret,="" related="event.relatedTarget," handleobj="event.handleObj;" mousenter="" call="" outside="" target.="" nb:="" no="" left="" entered="" browser="" window="" !related="" (related="" !jquery.contains(="" target,="" ))="" event.type="handleObj.origType;" ret="handleObj.handler.apply(" arguments="" ret;="" });="" submit="" delegation="" !support.submitbubbles="" jquery.event.special.submit="{" setup:="" only="" need="" delegated="" form="" "form"="" lazy-add="" when="" descendant="" potentially="" submitted="" jquery.event.add(="" "click._submit="" keypress._submit",="" check="" avoids="" vml-related="" crash="" (#9807)="" "button"="" elem.form="" undefined;="" !jquery._data(="" form,="" "submitbubbles"="" "submit._submit",="" event._submit_bubble="true;" jquery._data(="" "submitbubbles",="" since="" an="" listener="" was="" user,="" tree="" delete="" event._submit_bubble;="" this.parentnode="" !event.istrigger="" jquery.event.simulate(="" "submit",="" this.parentnode,="" teardown:="" remove="" handlers;="" cleandata="" eventually="" reaps="" attached="" above="" jquery.event.remove(="" "._submit"="" change="" checkbox="" radio="" !support.changebubbles="" jquery.event.special.change="{" rformelems.test(="" this.nodename="" until="" blur;="" trigger="" click="" after="" propertychange.="" eat="" blur-change="" special.change.handle.="" still="" fires="" onchange="" second="" time="" blur.="" "radio"="" "propertychange._change",="" event.originalevent.propertyname="==" "checked"="" this._just_changed="true;" "click._change",="" triggered,="" (#11500)="" "change",="" inputs="" "beforeactivate._change",="" elem.nodename="" "changebubbles"="" "change._change",="" !event.issimulated="" "changebubbles",="" swallow="" radio,="" already="" them="" event.issimulated="" event.istrigger="" (elem.type="" elem.type="" "checkbox")="" event.handleobj.handler.apply(="" "._change"="" !rformelems.test(="" "bubbling"="" !support.focusinbubbles="" "focusin",="" attach="" single="" capturing="" while="" someone="" wants="" focusin="" focusout="" jquery.event.fix(="" ),="" attaches="jQuery._data(" !attaches="" doc.addeventlistener(="" handler,="" 1;="" doc.removeeventlistener(="" jquery._removedata(="" jquery.fn.extend({="" on:="" types,="" selector,="" data,="" fn,="" *internal*="" origfn;="" types="" can="" map="" "object"="" types-object,="" data="" selector="" "string"="" selector;="" this.on(="" types[="" ],="" this;="" fn="=" !fn="" origfn="fn;" empty="" set,="" contains="" info="" jquery().off(="" origfn.apply(="" guid="" caller="" fn.guid="origFn.guid" origfn.guid="jQuery.guid++" this.each(="" one:="" off:="" handleobj,="" types.preventdefault="" types.handleobj="" dispatched="" jquery(="" types.delegatetarget="" ).off(="" handleobj.namespace="" handleobj.origtype="" "."="" handleobj.origtype,="" handleobj.selector,="" handleobj.handler="" types-object="" [,="" selector]="" this.off(="" "function"="" fn]="" this.each(function()="" triggerhandler:="" function="" createsafefragment(="" list="nodeNames.split(" "|"="" safefrag="document.createDocumentFragment();" safefrag.createelement="" list.length="" safefrag.createelement(="" list.pop()="" safefrag;="" nodenames="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",="" rinlinejquery="/" jquery\d+="(?:null|\d+)" g,="" rnoshimcache="new" regexp("<(?:"="" ")[\\s="">]", "i"),2526 rleadingWhitespace = /^\s+/,2527 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,2528 rtagName = /<([\w:]+) ,="" rtbody="/<tbody/i," rhtml="/<|&#?\w+;/," rnoinnerhtml="/<(?:script|style|link)/i," checked="checked" or="" rchecked="/checked\s*(?:[^=]|=\s*.checked.)/i," rscripttype="/^$|\/(?:java|ecma)script/i," rscripttypemasked="/^true\/(.*)/," rcleanscript="/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)">\s*$/g,2529 // We have to close these tags to support XHTML (#13200)2530 wrapMap = {2531 option: [ 1, "<select multiple="multiple">", "</select>" ],2532 legend: [ 1, "<fieldset>", "</fieldset>" ],2533 area: [ 1, "<map>", "</map>" ],2534 param: [ 1, "<object>", "</object>" ],2535 thead: [ 1, "<table>", "</table>" ],2536 tr: [ 2, "<table><tbody>", "</tbody></table>" ],2537 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],2538 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],2539 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,2540 // unless wrapped in a div with non-breaking characters in front of it.2541 _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]2542 },2543 safeFragment = createSafeFragment( document ),2544 fragmentDiv = safeFragment.appendChild( document.createElement("div") );2545wrapMap.optgroup = wrapMap.option;2546wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;2547wrapMap.th = wrapMap.td;2548function getAll( context, tag ) {2549 var elems, elem,2550 i = 0,2551 found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :2552 typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :2553 undefined;2554 if ( !found ) {2555 for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {2556 if ( !tag || jQuery.nodeName( elem, tag ) ) {2557 found.push( elem );2558 } else {2559 jQuery.merge( found, getAll( elem, tag ) );2560 }2561 }2562 }2563 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?2564 jQuery.merge( [ context ], found ) :2565 found;2566}2567// Used in buildFragment, fixes the defaultChecked property2568function fixDefaultChecked( elem ) {2569 if ( rcheckableType.test( elem.type ) ) {2570 elem.defaultChecked = elem.checked;2571 }2572}2573// Support: IE<8 1="" 11="" manipulating="" tables="" requires="" a="" tbody="" function="" manipulationtarget(="" elem,="" content="" )="" {="" return="" jquery.nodename(="" "table"="" &&="" content.nodetype="" !="=" ?="" :="" content.firstchild,="" "tr"="" elem.getelementsbytagname("tbody")[0]="" ||="" elem.appendchild(="" elem.ownerdocument.createelement("tbody")="" elem;="" }="" replace="" restore="" the="" type="" attribute="" of="" script="" elements="" for="" safe="" dom="" manipulation="" disablescript(="" elem="" elem.type="(jQuery.find.attr(" "type"="" null)="" +="" "="" elem.type;="" restorescript(="" var="" match="rscriptTypeMasked.exec(" );="" if="" (="" else="" elem.removeattribute("type");="" mark="" scripts="" as="" having="" already="" been="" evaluated="" setglobaleval(="" elems,="" refelements="" i="0;" ;="" (elem="elems[i])" i++="" jquery._data(="" "globaleval",="" !refelements="" refelements[i],="" "globaleval"="" clonecopyevent(="" src,="" dest="" dest.nodetype="" !jquery.hasdata(="" src="" return;="" type,="" i,="" l,="" olddata="jQuery._data(" ),="" curdata="jQuery._data(" dest,="" events="oldData.events;" delete="" curdata.handle;="" curdata.events="{};" in="" l="events[" ].length;="" <="" l;="" jquery.event.add(="" events[="" ][="" ]="" make="" cloned="" public="" data="" object="" copy="" from="" original="" curdata.data="" {},="" fixclonenodeissues(="" nodename,="" e,="" data;="" we="" do="" not="" need="" to="" anything="" non-elements="" nodename="dest.nodeName.toLowerCase();" ie6-8="" copies="" bound="" via="" attachevent="" when="" using="" clonenode.="" !support.nocloneevent="" dest[="" jquery.expando="" e="" data.events="" jquery.removeevent(="" data.handle="" event="" gets="" referenced="" instead="" copied="" expando="" too="" dest.removeattribute(="" ie="" blanks="" contents="" cloning="" scripts,="" and="" tries="" evaluate="" newly-set="" text="" "script"="" dest.text="" src.text="" ).text="src.text;" ie6-10="" improperly="" clones="" children="" classid.="" ie10="" throws="" nomodificationallowederror="" parent="" is="" null,="" #12132.="" "object"="" dest.parentnode="" dest.outerhtml="src.outerHTML;" this="" path="" appears="" unavoidable="" ie9.="" an="" element="" ie9,="" outerhtml="" strategy="" above="" sufficient.="" has="" innerhtml="" destination="" does="" not,="" src.innerhtml="" into="" dest.innerhtml.="" #10324="" support.html5clone="" !jquery.trim(dest.innerhtml)="" dest.innerhtml="src.innerHTML;" "input"="" rcheckabletype.test(="" src.type="" fails="" persist="" checked state="" checkbox="" or="" radio="" button.="" worse,="" ie6-7="" fail="" give="" appearance="" defaultchecked="" value="" isn't="" also="" set="" dest.defaultchecked="dest.checked" =="" src.checked;="" get="" confused="" end="" up="" setting="" button="" empty="" string="" "on"="" dest.value="" src.value="" selected option="" default options="" "option"="" dest.defaultselected="dest.selected" src.defaultselected;="" defaultvalue="" correct="" other="" types="" input="" fields="" "textarea"="" dest.defaultvalue="src.defaultValue;" jquery.extend({="" clone:="" function(="" dataandevents,="" deepdataandevents="" destelements,="" node,="" clone,="" srcelements,="" inpage="jQuery.contains(" elem.ownerdocument,="" jquery.isxmldoc(elem)="" !rnoshimcache.test(="" "<"="" elem.nodename="">" ) ) {2574 clone = elem.cloneNode( true );2575 // IE<=8 1="" 2="" does="" not="" properly="" clone="" detached,="" unknown="" element="" nodes="" }="" else="" {="" fragmentdiv.innerhtml="elem.outerHTML;" fragmentdiv.removechild(="" );="" if="" (="" (!support.nocloneevent="" ||="" !support.noclonechecked)="" &&="" (elem.nodetype="==" elem.nodetype="==" 11)="" !jquery.isxmldoc(elem)="" )="" we="" eschew="" sizzle="" here="" for="" performance="" reasons:="" http:="" jsperf.com="" getall-vs-sizzle="" destelements="getAll(" srcelements="getAll(" elem="" fix="" all="" ie="" cloning="" issues="" i="0;" (node="srcElements[i])" !="null;" ++i="" ensure="" that="" the="" destination="" node="" is="" null;="" fixes="" #9587="" destelements[i]="" fixclonenodeissues(="" node,="" copy="" events="" from="" original="" to="" dataandevents="" deepdataandevents="" getall(="" i++="" clonecopyevent(="" elem,="" preserve="" script="" evaluation="" history="" clone,="" "script"="" destelements.length=""> 0 ) {2576 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );2577 }2578 destElements = srcElements = node = null;2579 // Return the cloned set2580 return clone;2581 },2582 buildFragment: function( elems, context, scripts, selection ) {2583 var j, elem, contains,2584 tmp, tag, tbody, wrap,2585 l = elems.length,2586 // Ensure a safe fragment2587 safe = createSafeFragment( context ),2588 nodes = [],2589 i = 0;2590 for ( ; i < l; i++ ) {2591 elem = elems[ i ];2592 if ( elem || elem === 0 ) {2593 // Add nodes directly2594 if ( jQuery.type( elem ) === "object" ) {2595 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );2596 // Convert non-html into a text node2597 } else if ( !rhtml.test( elem ) ) {2598 nodes.push( context.createTextNode( elem ) );2599 // Convert html into DOM nodes2600 } else {2601 tmp = tmp || safe.appendChild( context.createElement("div") );2602 // Deserialize a standard representation2603 tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();2604 wrap = wrapMap[ tag ] || wrapMap._default;2605 tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2];2606 // Descend through wrappers to the right content2607 j = wrap[0];2608 while ( j-- ) {2609 tmp = tmp.lastChild;2610 }2611 // Manually add leading whitespace removed by IE2612 if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {2613 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );2614 }2615 // Remove IE's autoinserted <tbody> from table fragments2616 if ( !support.tbody ) {2617 // String was a <table>, *may* have spurious <tbody>2618 elem = tag === "table" && !rtbody.test( elem ) ?2619 tmp.firstChild :2620 // String was a bare <thead> or <tfoot>2621 wrap[1] === "<table>" && !rtbody.test( elem ) ?2622 tmp :2623 0;2624 j = elem && elem.childNodes.length;2625 while ( j-- ) {2626 if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {2627 elem.removeChild( tbody );2628 }2629 }2630 }2631 jQuery.merge( nodes, tmp.childNodes );2632 // Fix #12392 for WebKit and IE > 92633 tmp.textContent = "";2634 // Fix #12392 for oldIE2635 while ( tmp.firstChild ) {2636 tmp.removeChild( tmp.firstChild );2637 }2638 // Remember the top-level container for proper cleanup2639 tmp = safe.lastChild;2640 }2641 }2642 }2643 // Fix #11356: Clear elements from fragment2644 if ( tmp ) {2645 safe.removeChild( tmp );2646 }2647 // Reset defaultChecked for any radios and checkboxes2648 // about to be appended to the DOM in IE 6/7 (#8060)2649 if ( !support.appendChecked ) {2650 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );2651 }2652 i = 0;2653 while ( (elem = nodes[ i++ ]) ) {2654 // #4087 - If origin and destination elements are the same, and this is2655 // that element, do not do anything2656 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {2657 continue;2658 }2659 contains = jQuery.contains( elem.ownerDocument, elem );2660 // Append to fragment2661 tmp = getAll( safe.appendChild( elem ), "script" );2662 // Preserve script evaluation history2663 if ( contains ) {2664 setGlobalEval( tmp );2665 }2666 // Capture executables2667 if ( scripts ) {2668 j = 0;2669 while ( (elem = tmp[ j++ ]) ) {2670 if ( rscriptType.test( elem.type || "" ) ) {2671 scripts.push( elem );2672 }2673 }2674 }2675 }2676 tmp = null;2677 return safe;2678 },2679 cleanData: function( elems, /* internal */ acceptData ) {2680 var elem, type, id, data,2681 i = 0,2682 internalKey = jQuery.expando,2683 cache = jQuery.cache,2684 deleteExpando = support.deleteExpando,2685 special = jQuery.event.special;2686 for ( ; (elem = elems[i]) != null; i++ ) {2687 if ( acceptData || jQuery.acceptData( elem ) ) {2688 id = elem[ internalKey ];2689 data = id && cache[ id ];2690 if ( data ) {2691 if ( data.events ) {2692 for ( type in data.events ) {2693 if ( special[ type ] ) {2694 jQuery.event.remove( elem, type );2695 // This is a shortcut to avoid jQuery.event.remove's overhead2696 } else {2697 jQuery.removeEvent( elem, type, data.handle );2698 }2699 }2700 }2701 // Remove cache only if it was not already removed by jQuery.event.remove2702 if ( cache[ id ] ) {2703 delete cache[ id ];2704 // IE does not allow us to delete expando properties from nodes,2705 // nor does it have a removeAttribute function on Document nodes;2706 // we must handle all of these cases2707 if ( deleteExpando ) {2708 delete elem[ internalKey ];2709 } else if ( typeof elem.removeAttribute !== strundefined ) {2710 elem.removeAttribute( internalKey );2711 } else {2712 elem[ internalKey ] = null;2713 }2714 deletedIds.push( id );2715 }2716 }2717 }2718 }2719 }2720});2721jQuery.fn.extend({2722 text: function( value ) {2723 return access( this, function( value ) {2724 return value === undefined ?2725 jQuery.text( this ) :2726 this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );2727 }, null, value, arguments.length );2728 },2729 append: function() {2730 return this.domManip( arguments, function( elem ) {2731 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {2732 var target = manipulationTarget( this, elem );2733 target.appendChild( elem );2734 }2735 });2736 },2737 prepend: function() {2738 return this.domManip( arguments, function( elem ) {2739 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {2740 var target = manipulationTarget( this, elem );2741 target.insertBefore( elem, target.firstChild );2742 }2743 });2744 },2745 before: function() {2746 return this.domManip( arguments, function( elem ) {2747 if ( this.parentNode ) {2748 this.parentNode.insertBefore( elem, this );2749 }2750 });2751 },2752 after: function() {2753 return this.domManip( arguments, function( elem ) {2754 if ( this.parentNode ) {2755 this.parentNode.insertBefore( elem, this.nextSibling );2756 }2757 });2758 },2759 remove: function( selector, keepData /* Internal Use Only */ ) {2760 var elem,2761 elems = selector ? jQuery.filter( selector, this ) : this,2762 i = 0;2763 for ( ; (elem = elems[i]) != null; i++ ) {2764 if ( !keepData && elem.nodeType === 1 ) {2765 jQuery.cleanData( getAll( elem ) );2766 }2767 if ( elem.parentNode ) {2768 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {2769 setGlobalEval( getAll( elem, "script" ) );2770 }2771 elem.parentNode.removeChild( elem );2772 }2773 }2774 return this;2775 },2776 empty: function() {2777 var elem,2778 i = 0;2779 for ( ; (elem = this[i]) != null; i++ ) {2780 // Remove element nodes and prevent memory leaks2781 if ( elem.nodeType === 1 ) {2782 jQuery.cleanData( getAll( elem, false ) );2783 }2784 // Remove any remaining nodes2785 while ( elem.firstChild ) {2786 elem.removeChild( elem.firstChild );2787 }2788 // If this is a select, ensure that it displays empty (#12336)2789 // Support: IE<9 0="" 1="" if="" (="" elem.options="" &&="" jquery.nodename(="" elem,="" "select"="" )="" {="" elem.options.length="0;" }="" return="" this;="" },="" clone:="" function(="" dataandevents,="" deepdataandevents="" dataandevents="dataAndEvents" =="null" ?="" false="" :="" dataandevents;="" deepdataandevents;="" this.map(function()="" jquery.clone(="" this,="" );="" });="" html:="" value="" access(="" var="" elem="this[" ]="" ||="" {},="" i="0," l="this.length;" undefined="" elem.nodetype="==" elem.innerhtml.replace(="" rinlinejquery,="" ""="" undefined;="" see="" we="" can="" take="" a="" shortcut="" and="" just="" use="" innerhtml="" typeof="" "string"="" !rnoinnerhtml.test(="" support.htmlserialize="" !rnoshimcache.test(="" support.leadingwhitespace="" !rleadingwhitespace.test(="" !wrapmap[="" (rtagname.exec(="" [="" "",="" ])[="" ].tolowercase()="" rxhtmltag,="" "<$1="">" );2790 try {2791 for (; i < l; i++ ) {2792 // Remove element nodes and prevent memory leaks2793 elem = this[i] || {};2794 if ( elem.nodeType === 1 ) {2795 jQuery.cleanData( getAll( elem, false ) );2796 elem.innerHTML = value;2797 }2798 }2799 elem = 0;2800 // If using innerHTML throws an exception, use the fallback method2801 } catch(e) {}2802 }2803 if ( elem ) {2804 this.empty().append( value );2805 }2806 }, null, value, arguments.length );2807 },2808 replaceWith: function() {2809 var arg = arguments[ 0 ];2810 // Make the changes, replacing each context element with the new content2811 this.domManip( arguments, function( elem ) {2812 arg = this.parentNode;2813 jQuery.cleanData( getAll( this ) );2814 if ( arg ) {2815 arg.replaceChild( elem, this );2816 }2817 });2818 // Force removal if there was no new content (e.g., from empty arguments)2819 return arg && (arg.length || arg.nodeType) ? this : this.remove();2820 },2821 detach: function( selector ) {2822 return this.remove( selector, true );2823 },2824 domManip: function( args, callback ) {2825 // Flatten any nested arrays2826 args = concat.apply( [], args );2827 var first, node, hasScripts,2828 scripts, doc, fragment,2829 i = 0,2830 l = this.length,2831 set = this,2832 iNoClone = l - 1,2833 value = args[0],2834 isFunction = jQuery.isFunction( value );2835 // We can't cloneNode fragments that contain checked, in WebKit2836 if ( isFunction ||2837 ( l > 1 && typeof value === "string" &&2838 !support.checkClone && rchecked.test( value ) ) ) {2839 return this.each(function( index ) {2840 var self = set.eq( index );2841 if ( isFunction ) {2842 args[0] = value.call( this, index, self.html() );2843 }2844 self.domManip( args, callback );2845 });2846 }2847 if ( l ) {2848 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );2849 first = fragment.firstChild;2850 if ( fragment.childNodes.length === 1 ) {2851 fragment = first;2852 }2853 if ( first ) {2854 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );2855 hasScripts = scripts.length;2856 // Use the original fragment for the last item instead of the first because it can end up2857 // being emptied incorrectly in certain situations (#8070).2858 for ( ; i < l; i++ ) {2859 node = fragment;2860 if ( i !== iNoClone ) {2861 node = jQuery.clone( node, true, true );2862 // Keep references to cloned scripts for later restoration2863 if ( hasScripts ) {2864 jQuery.merge( scripts, getAll( node, "script" ) );2865 }2866 }2867 callback.call( this[i], node, i );2868 }2869 if ( hasScripts ) {2870 doc = scripts[ scripts.length - 1 ].ownerDocument;2871 // Reenable scripts2872 jQuery.map( scripts, restoreScript );2873 // Evaluate executable scripts on first document insertion2874 for ( i = 0; i < hasScripts; i++ ) {2875 node = scripts[ i ];2876 if ( rscriptType.test( node.type || "" ) &&2877 !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {2878 if ( node.src ) {2879 // Optional AJAX dependency, but won't run scripts if not present2880 if ( jQuery._evalUrl ) {2881 jQuery._evalUrl( node.src );2882 }2883 } else {2884 jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );2885 }2886 }2887 }2888 }2889 // Fix #11809: Avoid leaking memory2890 fragment = first = null;2891 }2892 }2893 return this;2894 }2895});2896jQuery.each({2897 appendTo: "append",2898 prependTo: "prepend",2899 insertBefore: "before",2900 insertAfter: "after",2901 replaceAll: "replaceWith"2902}, function( name, original ) {2903 jQuery.fn[ name ] = function( selector ) {2904 var elems,2905 i = 0,2906 ret = [],2907 insert = jQuery( selector ),2908 last = insert.length - 1;2909 for ( ; i <= 0="" last;="" i++="" )="" {="" elems="i" =="=" last="" ?="" this="" :="" this.clone(true);="" jquery(="" insert[i]="" )[="" original="" ](="" );="" modern="" browsers="" can="" apply="" jquery="" collections="" as="" arrays,="" but="" oldie="" needs="" a="" .get()="" push.apply(="" ret,="" elems.get()="" }="" return="" this.pushstack(="" ret="" };="" });="" var="" iframe,="" elemdisplay="{};" **="" *="" retrieve="" the="" actual="" display="" of="" element="" @param="" {string}="" name="" nodename="" {object}="" doc="" document="" object="" called="" only="" from="" within="" defaultdisplay="" function="" actualdisplay(="" name,="" style,="" elem="jQuery(" doc.createelement(="" ).appendto(="" doc.body="" ),="" getdefaultcomputedstyle="" might="" be="" reliably="" used="" on="" attached="" &&="" (="" style="window.getDefaultComputedStyle(" elem[="" ]="" use="" method="" is="" temporary="" fix="" (more="" like="" optmization)="" until="" something="" better="" comes="" along,="" since="" it="" was="" removed="" specification="" and="" supported="" in="" ff="" style.display="" jquery.css(="" ],="" "display"="" we="" don't="" have="" any="" data="" stored="" element,="" so="" "detach"="" fast="" way="" to="" get="" rid="" elem.detach();="" display;="" try="" determine="" default value="" an="" defaultdisplay(="" ];="" if="" !display="" nodename,="" simple="" fails,="" read="" inside="" iframe="" "none"="" ||="" already-created="" possible="" "<iframe="" frameborder="0" width="0" height="0">" )).appendTo( doc.documentElement );2910 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse2911 doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;2912 // Support: IE2913 doc.write();2914 doc.close();2915 display = actualDisplay( nodeName, doc );2916 iframe.detach();2917 }2918 // Store the correct default display2919 elemdisplay[ nodeName ] = display;2920 }2921 return display;2922}2923(function() {2924 var shrinkWrapBlocksVal;2925 support.shrinkWrapBlocks = function() {2926 if ( shrinkWrapBlocksVal != null ) {2927 return shrinkWrapBlocksVal;2928 }2929 // Will be changed later if needed.2930 shrinkWrapBlocksVal = false;2931 // Minified: var b,c,d2932 var div, body, container;2933 body = document.getElementsByTagName( "body" )[ 0 ];2934 if ( !body || !body.style ) {2935 // Test fired too early or in an unsupported environment, exit.2936 return;2937 }2938 // Setup2939 div = document.createElement( "div" );2940 container = document.createElement( "div" );2941 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";2942 body.appendChild( container ).appendChild( div );2943 // Support: IE62944 // Check if elements with layout shrink-wrap their children2945 if ( typeof div.style.zoom !== strundefined ) {2946 // Reset CSS: box-sizing; display; margin; border2947 div.style.cssText =2948 // Support: Firefox<29, 0="" 1="" 2="" 3="" 4="" 8="" 17="" 27="" 2007="" 13343="" android="" 2.3="" vendor-prefix="" box-sizing="" "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;"="" +="" "box-sizing:content-box;display:block;margin:0;border:0;"="" "padding:1px;width:1px;zoom:1";="" div.appendchild(="" document.createelement(="" "div"="" )="" ).style.width="5px" ;="" shrinkwrapblocksval="div.offsetWidth" !="=" 3;="" }="" body.removechild(="" container="" );="" return="" shrinkwrapblocksval;="" };="" })();="" var="" rmargin="(/^margin/);" rnumnonpx="new" regexp(="" "^("="" pnum="" ")(?!px)[a-z%]+$",="" "i"="" getstyles,="" curcss,="" rposition="/^(top|right|bottom|left)$/;" if="" (="" window.getcomputedstyle="" {="" getstyles="function(" elem="" elem.ownerdocument.defaultview.getcomputedstyle(="" elem,="" null="" curcss="function(" name,="" computed="" width,="" minwidth,="" maxwidth,="" ret,="" style="elem.style;" ||="" getstyles(="" getpropertyvalue="" is="" only="" needed="" for="" .css('filter')="" in="" ie9,="" see="" #12537="" ret="computed" ?="" computed.getpropertyvalue(="" name="" computed[="" ]="" :="" undefined;="" ""="" &&="" !jquery.contains(="" elem.ownerdocument,="" a="" tribute="" to="" the="" "awesome="" hack="" by="" dean="" edwards"="" chrome="" <="" and="" safari="" 5.0="" uses="" "computed="" value"="" instead="" of="" "used="" margin-right="" 5.1.7="" (at="" least)="" returns="" percentage="" larger="" set="" values,="" but="" width="" seems="" be="" reliably="" pixels="" this="" against="" cssom="" draft="" spec:="" http:="" dev.w3.org="" csswg="" #resolved-values="" rnumnonpx.test(="" rmargin.test(="" remember="" original="" values="" minwidth="style.minWidth;" maxwidth="style.maxWidth;" put="" new="" get="" value="" out="" style.minwidth="style.maxWidth" =="" style.width="ret;" revert="" changed="" style.maxwidth="maxWidth;" support:="" ie="" zindex="" as="" an="" integer.="" undefined="" "";="" else="" document.documentelement.currentstyle="" elem.currentstyle;="" left,="" rs,="" rsleft,="" avoid="" setting="" empty="" string="" here="" so="" we="" don't="" default auto="" style[="" ];="" from="" awesome="" edwards="" erik.eae.net="" archives="" 07="" 18.54.15="" #comment-102291="" we're="" not="" dealing="" with="" regular="" pixel="" number="" that="" has="" weird="" ending,="" need="" convert="" it="" position="" css="" attributes,="" those="" are="" proportional="" parent="" element="" can't="" measure="" because="" might="" trigger="" "stacking="" dolls"="" problem="" !rposition.test(="" left="style.left;" rs="elem.runtimeStyle;" rsleft="rs" rs.left;="" rs.left="elem.currentStyle.left;" style.left="name" "fontsize"="" "1em"="" ret;="" "px";="" "auto";="" function="" addgethookif(="" conditionfn,="" hookfn="" define="" hook,="" we'll="" check="" on="" first="" run="" it's="" really="" needed.="" get:="" function()="" condition="conditionFn();" test="" was="" ready="" at="" point;="" screw="" hook="" time="" again="" when="" next="" time.="" return;="" (or="" possible="" use="" due="" missing="" dependency),="" remove="" it.="" since="" there="" no="" other="" hooks="" marginright,="" whole="" object.="" delete="" this.get;="" needed;="" redefine="" support="" executed="" again.="" (this.get="hookFn).apply(" this,="" arguments="" (function()="" minified:="" b,c,d,e,f,g,="" h,i="" div,="" style,="" a,="" pixelpositionval,="" boxsizingreliableval,="" reliablehiddenoffsetsval,="" reliablemarginrightval;="" setup="" div="document.createElement(" div.innerhtml=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>" "a"="" )[="" a.style;="" finish="" early="" limited="" (non-browser)="" environments="" !style="" style.csstext="float:left;opacity:.5" ie<9="" make="" sure="" opacity="" exists="" (as="" opposed="" filter)="" support.opacity="style.opacity" "0.5";="" verify="" float="" existence="" (ie="" stylefloat="" cssfloat)="" support.cssfloat="!!style.cssFloat;" div.style.backgroundclip="content-box" div.clonenode(="" true="" ).style.backgroundclip="" support.clearclonestyle="div.style.backgroundClip" "content-box";="" firefox<29,="" support.boxsizing="style.boxSizing" style.mozboxsizing="==" style.webkitboxsizing="==" jquery.extend(support,="" reliablehiddenoffsets:="" reliablehiddenoffsetsval="=" computestyletests();="" reliablehiddenoffsetsval;="" },="" boxsizingreliable:="" boxsizingreliableval="=" boxsizingreliableval;="" pixelposition:="" pixelpositionval="=" pixelpositionval;="" reliablemarginright:="" reliablemarginrightval="=" });="" computestyletests()="" b,c,d,j="" body,="" container,="" contents;="" body="document.getElementsByTagName(" "body"="" !body="" !body.style="" fired="" too="" or="" unsupported="" environment,="" exit.="" container.style.csstext="position:absolute;border:0;width:0;height:0;top:0;left:-9999px" body.appendchild(="" ).appendchild(="" div.style.csstext="//" "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;"="" "box-sizing:border-box;display:block;margin-top:1%;top:1%;"="" "border:1px;padding:1px;width:4px;position:absolute";="" assume="" reasonable="" absence="" getcomputedstyle="" false;="" code="" ie<9.="" window.getcomputedstyle(="" {}="" ).top="" "1%";="" width:="" "4px"="" ).width="==" "4px";="" explicit="" incorrectly="" gets="" based="" (#3333)="" webkit="" bug="" -="" wrong="" contents="div.appendChild(" reset="" css:="" box-sizing;="" display;="" margin;="" border;="" padding="" contents.style.csstext="div.style.cssText" "box-sizing:content-box;display:block;margin:0;border:0;padding:0";="" contents.style.marginright="contents.style.width" "0";="" div.style.width="1px" contents,="" ).marginright="" ie8="" table="" cells="" still="" have="" offsetwidth="" height="" they="" display:none="" visible="" row;="" so,="" reliable="" determining="" been="" hidden directly="" using="" (it="" safe="" offsets="" hidden;="" don="" safety="" goggles="" #4512="" more="" information).="" "td"="" contents[="" ].style.csstext="margin:0;border:0;padding:0;display:none" ].offsetheight="==" 0;="" ].style.display="" method="" quickly="" swapping="" properties="" correct="" calculations.="" jquery.swap="function(" options,="" callback,="" args="" old="{};" insert="" ones="" options="" old[="" elem.style[="" []="" ralpha="/alpha\([^)]*\)/i," ropacity="/opacity\s*=\s*([^)]*)/," swappable="" display="" none="" starts="" except="" "table",="" "table-cell",="" "table-caption"="" values:="" https:="" developer.mozilla.org="" en-us="" docs="" rdisplayswap="/^(none|table(?!-c[ea]).+)/," rnumsplit="new" ")(.*)$",="" ),="" rrelnum="new" "^([+-])="("" ")",="" cssshow="{" position:="" "absolute",="" visibility:="" "hidden",="" display:="" "block"="" cssnormaltransform="{" letterspacing:="" "0",="" fontweight:="" "400"="" cssprefixes="[" "webkit",="" "o",="" "moz",="" "ms"="" property="" mapped="" potentially="" vendor="" prefixed="" vendorpropname(="" shortcut="" names="" name;="" capname="name.charAt(0).toUpperCase()" name.slice(1),="" origname="name," i="cssPrefixes.length;" while="" i--="" capname;="" origname;="" showhide(="" elements,="" show="" display,="" hidden,="" index="0," length="elements.length;" length;="" index++="" !elem.style="" continue;="" values[="" "olddisplay"="" inline="" learn="" being="" cascaded="" rules="" !values[="" "none"="" elem.style.display="" elements="" which="" overridden="" stylesheet="" whatever="" browser="" such="" ishidden(="" "olddisplay",="" defaultdisplay(elem.nodename)="" !hidden="" jquery._data(="" jquery.css(="" "display"="" most="" second="" loop constant="" reflow="" !show="" "none";="" elements;="" setpositivenumber(="" value,="" subtract="" matches="rnumsplit.exec(" guard="" "subtract",="" e.g.,="" used="" csshooks="" math.max(="" 0,="" matches[="" "px"="" value;="" augmentwidthorheight(="" extra,="" isborderbox,="" styles="" isborderbox="" "border"="" "content"="" already="" right="" measurement,="" augmentation="" otherwise="" initialize="" horizontal="" vertical="" "width"="" val="0;" 4;="" both="" box="" models="" exclude="" margin,="" add="" want="" extra="==" "margin"="" cssexpand[="" ],="" true,="" border-box="" includes="" padding,="" content="" "padding"="" point,="" isn't="" border="" nor="" "width",="" content,="" val;="" getwidthorheight(="" start="" offset="" property,="" equivalent="" valueisborderbox="true," elem.offsetwidth="" elem.offsetheight,="" "boxsizing",="" false,="" "border-box";="" some="" non-html="" offsetwidth,="" svg="" bugzilla.mozilla.org="" show_bug.cgi?id="649285" mathml="" fall="" back="" then="" uncomputed="" necessary="" unit="" pixels.="" stop="" return.="" rnumnonpx.test(val)="" case="" unreliable="" silently="" falls="" elem.style="" support.boxsizingreliable()="" normalize="" "",="" auto,="" prepare="" active="" model="" irrelevant="" valueisborderbox,="" jquery.extend({="" overriding="" behavior="" getting="" csshooks:="" opacity:="" function(="" should="" always="" "opacity"="" "1"="" automatically="" these="" possibly-unitless="" cssnumber:="" "columncount":="" "fillopacity":="" "flexgrow":="" "flexshrink":="" "fontweight":="" "lineheight":="" "opacity":="" "order":="" "orphans":="" "widows":="" "zindex":="" "zoom":="" whose="" you="" wish="" fix="" before="" cssprops:="" "float":="" "cssfloat"="" "stylefloat"="" dom="" node="" style:="" text="" comment="" nodes="" !elem="" elem.nodetype="==" working="" type,="" hooks,="" jquery.cssprops[="" version="" followed="" unprefixed="" jquery.csshooks[="" type="typeof" relative="" strings="" (+="or" numbers.="" #7345="" "string"="" (ret="rrelNum.exec(" ))="" ret[1]="" *="" ret[2]="" parsefloat(="" fixes="" #9237="" nan="" aren't="" set.="" see:="" #7116="" passed="" in,="" 'px'="" (except="" certain="" properties)="" "number"="" !jquery.cssnumber[="" #8908,="" can="" done="" correctly="" specifing="" setters="" csshooks,="" would="" mean="" eight="" (for="" every="" problematic="" property)="" identical="" functions="" !support.clearclonestyle="" name.indexof("background")="==" provided,="" just="" specified="" !hooks="" !("set"="" hooks)="" (value="hooks.set(" swallow="" errors="" 'invalid'="" (#5509)="" try="" catch(e)="" provided="" non-computed="" "get"="" object="" num,="" val,="" elem.style,="" otherwise,="" way="" exists,="" "normal"="" return,="" converting="" forced="" qualifier="" looks="" numeric="" num="parseFloat(" jquery.isnumeric(="" jquery.each([="" "height",="" i,="" computed,="" dimension="" info="" invisibly="" them="" however,="" must="" current="" benefit="" rdisplayswap.test(="" jquery.swap(="" cssshow,="" })="" set:="" "border-box",="" !support.opacity="" jquery.csshooks.opacity="{" filters="" ropacity.test(="" (computed="" elem.currentstyle="" elem.currentstyle.filter="" elem.style.filter)="" 0.01="" regexp.$1="" currentstyle="elem.currentStyle," "alpha(opacity=" + value * 100 + " )"="" filter="currentStyle" currentstyle.filter="" style.filter="" trouble="" does="" layout="" force="" zoom="" level="" style.zoom="1;" 1,="" exist="" attempt="" attribute="" #6652="" #12685="">= 1 || value === "" ) &&2949 jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&2950 style.removeAttribute ) {2951 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText2952 // if "filter:" is present at all, clearType is disabled, we want to avoid this2953 // style.removeAttribute is IE Only, but so apparently is this code path...2954 style.removeAttribute( "filter" );2955 // if there is no filter style applied in a css rule or unset inline opacity, we are done2956 if ( value === "" || currentStyle && !currentStyle.filter ) {2957 return;2958 }2959 }2960 // otherwise, set new filter values2961 style.filter = ralpha.test( filter ) ?2962 filter.replace( ralpha, opacity ) :2963 filter + " " + opacity;2964 }2965 };2966}2967jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,2968 function( elem, computed ) {2969 if ( computed ) {2970 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right2971 // Work around by temporarily setting element display to inline-block2972 return jQuery.swap( elem, { "display": "inline-block" },2973 curCSS, [ elem, "marginRight" ] );2974 }2975 }2976);2977// These hooks are used by animate to expand properties2978jQuery.each({2979 margin: "",2980 padding: "",2981 border: "Width"2982}, function( prefix, suffix ) {2983 jQuery.cssHooks[ prefix + suffix ] = {2984 expand: function( value ) {2985 var i = 0,2986 expanded = {},2987 // assumes a single number if not a string2988 parts = typeof value === "string" ? value.split(" ") : [ value ];2989 for ( ; i < 4; i++ ) {2990 expanded[ prefix + cssExpand[ i ] + suffix ] =2991 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];2992 }2993 return expanded;2994 }2995 };2996 if ( !rmargin.test( prefix ) ) {2997 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;2998 }2999});3000jQuery.fn.extend({3001 css: function( name, value ) {3002 return access( this, function( elem, name, value ) {3003 var styles, len,3004 map = {},3005 i = 0;3006 if ( jQuery.isArray( name ) ) {3007 styles = getStyles( elem );3008 len = name.length;3009 for ( ; i < len; i++ ) {3010 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );3011 }3012 return map;3013 }3014 return value !== undefined ?3015 jQuery.style( elem, name, value ) :3016 jQuery.css( elem, name );3017 }, name, value, arguments.length > 1 );3018 },3019 show: function() {3020 return showHide( this, true );3021 },3022 hide: function() {3023 return showHide( this );3024 },3025 toggle: function( state ) {3026 if ( typeof state === "boolean" ) {3027 return state ? this.show() : this.hide();3028 }3029 return this.each(function() {3030 if ( isHidden( this ) ) {3031 jQuery( this ).show();3032 } else {3033 jQuery( this ).hide();3034 }3035 });3036 }3037});3038function Tween( elem, options, prop, end, easing ) {3039 return new Tween.prototype.init( elem, options, prop, end, easing );3040}3041jQuery.Tween = Tween;3042Tween.prototype = {3043 constructor: Tween,3044 init: function( elem, options, prop, end, easing, unit ) {3045 this.elem = elem;3046 this.prop = prop;3047 this.easing = easing || "swing";3048 this.options = options;3049 this.start = this.now = this.cur();3050 this.end = end;3051 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );3052 },3053 cur: function() {3054 var hooks = Tween.propHooks[ this.prop ];3055 return hooks && hooks.get ?3056 hooks.get( this ) :3057 Tween.propHooks._default.get( this );3058 },3059 run: function( percent ) {3060 var eased,3061 hooks = Tween.propHooks[ this.prop ];3062 if ( this.options.duration ) {3063 this.pos = eased = jQuery.easing[ this.easing ](3064 percent, this.options.duration * percent, 0, 1, this.options.duration3065 );3066 } else {3067 this.pos = eased = percent;3068 }3069 this.now = ( this.end - this.start ) * eased + this.start;3070 if ( this.options.step ) {3071 this.options.step.call( this.elem, this.now, this );3072 }3073 if ( hooks && hooks.set ) {3074 hooks.set( this );3075 } else {3076 Tween.propHooks._default.set( this );3077 }3078 return this;3079 }3080};3081Tween.prototype.init.prototype = Tween.prototype;3082Tween.propHooks = {3083 _default: {3084 get: function( tween ) {3085 var result;3086 if ( tween.elem[ tween.prop ] != null &&3087 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {3088 return tween.elem[ tween.prop ];3089 }3090 // passing an empty string as a 3rd parameter to .css will automatically3091 // attempt a parseFloat and fallback to a string if the parse fails3092 // so, simple values such as "10px" are parsed to Float.3093 // complex values such as "rotate(1rad)" are returned as is.3094 result = jQuery.css( tween.elem, tween.prop, "" );3095 // Empty strings, null, undefined and "auto" are converted to 0.3096 return !result || result === "auto" ? 0 : result;3097 },3098 set: function( tween ) {3099 // use step hook for back compat - use cssHook if its there - use .style if its3100 // available and use plain properties where available3101 if ( jQuery.fx.step[ tween.prop ] ) {3102 jQuery.fx.step[ tween.prop ]( tween );3103 } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {3104 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );3105 } else {3106 tween.elem[ tween.prop ] = tween.now;3107 }3108 }3109 }3110};3111// Support: IE <=9 0="" 1="" 2="" 3="" 4="" panic="" based="" approach="" to="" setting="" things="" on="" disconnected="" nodes="" tween.prophooks.scrolltop="Tween.propHooks.scrollLeft" =="" {="" set:="" function(="" tween="" )="" if="" (="" tween.elem.nodetype="" &&="" tween.elem.parentnode="" tween.elem[="" tween.prop="" ]="tween.now;" }="" };="" jquery.easing="{" linear:="" p="" return="" p;="" },="" swing:="" 0.5="" -="" math.cos(="" *="" math.pi="" 2;="" jquery.fx="Tween.prototype.init;" back="" compat="" <1.8="" extension="" point="" jquery.fx.step="{};" var="" fxnow,="" timerid,="" rfxtypes="/^(?:toggle|show|hide)$/," rfxnum="new" regexp(="" "^(?:([+-])="|)("" +="" pnum="" ")([a-z%]*)$",="" "i"="" ),="" rrun="/queueHooks$/," animationprefilters="[" defaultprefilter="" ],="" tweeners="{" "*":="" [="" prop,="" value="" target="tween.cur()," parts="rfxnum.exec(" unit="parts" parts[="" ||="" jquery.cssnumber[="" prop="" ?="" ""="" :="" "px"="" starting="" computation="" is="" required for="" potential="" mismatches="" start="(" !="=" +target="" rfxnum.exec(="" jquery.css(="" tween.elem,="" scale="1," maxiterations="20;" start[="" trust="" units="" reported="" by="" jquery.css="" ];="" make="" sure="" we="" update="" the="" properties="" later="" [];="" iteratively="" approximate="" from="" a="" nonzero="" 1;="" do="" previous="" iteration="" zeroed="" out,="" double="" until="" get="" *something*="" use="" string="" doubling="" factor="" so="" don't="" accidentally="" see="" as="" unchanged="" below="" ".5";="" adjust="" and="" apply="" scale;="" jquery.style(="" );="" scale,="" tolerating="" zero="" or="" nan="" tween.cur()="" breaking="" loop perfect,="" we've="" just="" had="" enough="" while="" (scale="tween.cur()" target)="" --maxiterations="" +start="" 0;="" tween.unit="unit;" token="" was="" provided,="" we're="" doing="" relative="" animation="" tween.end="parts[" +parts[="" tween;="" animations="" created="" synchronously="" will="" run="" function="" createfxnow()="" settimeout(function()="" fxnow="undefined;" });="" generate="" parameters="" create="" standard="" genfx(="" type,="" includewidth="" which,="" attrs="{" height:="" type="" i="0;" include="" width,="" step="" all="" cssexpand="" values,="" skip="" over="" left="" right="" ;="" <="" which="cssExpand[" attrs[="" "margin"="" "padding"="" attrs.opacity="attrs.width" type;="" attrs;="" createtween(="" value,="" tween,="" collection="(" tweeners[="" []="" ).concat(="" "*"="" index="0," length="collection.length;" length;="" index++="" (tween="collection[" ].call(="" animation,="" ))="" done="" with="" this="" property="" defaultprefilter(="" elem,="" props,="" opts="" jshint="" validthis:="" true="" toggle,="" hooks,="" oldfire,="" display,="" checkdisplay,="" anim="this," orig="{}," style="elem.style," hidden="elem.nodeType" ishidden(="" elem="" datashow="jQuery._data(" "fxshow"="" handle="" queue:="" false="" promises="" !opts.queue="" hooks="jQuery._queueHooks(" "fx"="" hooks.unqueued="=" null="" oldfire="hooks.empty.fire;" hooks.empty.fire="function()" !hooks.unqueued="" oldfire();="" hooks.unqueued++;="" anim.always(function()="" makes="" that="" complete="" handler="" be="" called="" before="" completes="" hooks.unqueued--;="" !jquery.queue(="" ).length="" hooks.empty.fire();="" height="" width="" overflow="" pass="" elem.nodetype="==" "height"="" in="" props="" "width"="" nothing="" sneaks="" out="" record="" attributes="" because="" ie="" does="" not="" change="" attribute="" when="" overflowx="" overflowy="" are="" set="" same="" opts.overflow="[" style.overflow,="" style.overflowx,="" style.overflowy="" display="" inline-block="" inline="" elements="" having="" animated="" "display"="" test="" default currently="" "none"="" checkdisplay="display" jquery._data(="" "olddisplay"="" defaultdisplay(="" elem.nodename="" display;="" "inline"="" "float"="" inline-level="" accept="" inline-block;="" block-level="" need="" layout="" !support.inlineblockneedslayout="" style.display="inline-block" else="" style.zoom="1;" style.overflow="hidden" !support.shrinkwrapblocks()="" style.overflowx="opts.overflow[" show="" hide="" rfxtypes.exec(="" delete="" props[="" toggle="toggle" "toggle";="" "hide"="" "show"="" there="" stopped="" going="" proceed="" show,="" should="" pretend="" datashow[="" undefined="" continue;="" orig[="" any="" non-fx="" stops="" us="" restoring="" original="" !jquery.isemptyobject(="" "hidden"="" "fxshow",="" {}="" store="" state="" its="" enables="" .stop().toggle()="" "reverse"="" datashow.hidden="!hidden;" jquery(="" ).show();="" anim.done(function()="" ).hide();="" prop;="" jquery._removedata(="" 0,="" !(="" tween.start="prop" noop="" like="" .hide().hide(),="" restore="" an="" overwritten="" (display="==" display)="==" propfilter(="" specialeasing="" index,="" name,="" easing,="" hooks;="" camelcase,="" expand="" csshook="" name="jQuery.camelCase(" easing="specialEasing[" jquery.isarray(="" "expand"="" quite="" $.extend,="" wont="" overwrite="" keys="" already="" present.="" also="" reusing="" 'index'="" above="" have="" correct="" "name"="" specialeasing[="" animation(="" properties,="" options="" result,="" stopped,="" deferred="jQuery.Deferred().always(" function()="" match="" :animated="" selector="" tick.elem;="" }),="" tick="function()" false;="" currenttime="fxNow" createfxnow(),="" remaining="Math.max(" animation.starttime="" animation.duration="" archaic="" crash="" bug="" won't="" allow="" (#12497)="" temp="remaining" percent="1" temp,="" animation.tweens[="" ].run(="" deferred.notifywith(="" percent,="" ]);="" remaining;="" deferred.resolvewith(="" elem:="" props:="" jquery.extend(="" {},="" opts:="" true,="" specialeasing:="" originalproperties:="" originaloptions:="" options,="" starttime:="" duration:="" options.duration,="" tweens:="" [],="" createtween:="" end="" animation.opts,="" end,="" animation.opts.specialeasing[="" animation.opts.easing="" animation.tweens.push(="" stop:="" gotoend="" want="" tweens="" otherwise="" part="" animation.tweens.length="" this;="" resolve="" played="" last="" frame="" otherwise,="" reject="" deferred.rejectwith(="" animation.opts.specialeasing="" result="animationPrefilters[" animation.opts="" result;="" jquery.map(="" createtween,="" jquery.isfunction(="" animation.opts.start="" animation.opts.start.call(="" jquery.fx.timer(="" tick,="" anim:="" animation.opts.queue="" })="" attach="" callbacks="" animation.progress(="" animation.opts.progress="" .done(="" animation.opts.done,="" animation.opts.complete="" .fail(="" animation.opts.fail="" .always(="" animation.opts.always="" jquery.animation="jQuery.extend(" tweener:="" callback="" ");="" ].unshift(="" prefilter:="" callback,="" prepend="" animationprefilters.unshift(="" animationprefilters.push(="" jquery.speed="function(" speed,="" fn="" opt="speed" typeof="" speed="==" "object"="" complete:="" !fn="" easing:="" !jquery.isfunction(="" opt.duration="jQuery.fx.off" "number"="" jquery.fx.speeds="" jquery.fx.speeds[="" jquery.fx.speeds._default;="" normalize="" opt.queue=""> "fx"3112 if ( opt.queue == null || opt.queue === true ) {3113 opt.queue = "fx";3114 }3115 // Queueing3116 opt.old = opt.complete;3117 opt.complete = function() {3118 if ( jQuery.isFunction( opt.old ) ) {3119 opt.old.call( this );3120 }3121 if ( opt.queue ) {3122 jQuery.dequeue( this, opt.queue );3123 }3124 };3125 return opt;3126};3127jQuery.fn.extend({3128 fadeTo: function( speed, to, easing, callback ) {3129 // show any hidden elements after setting opacity to 03130 return this.filter( isHidden ).css( "opacity", 0 ).show()3131 // animate to the value specified3132 .end().animate({ opacity: to }, speed, easing, callback );3133 },3134 animate: function( prop, speed, easing, callback ) {3135 var empty = jQuery.isEmptyObject( prop ),3136 optall = jQuery.speed( speed, easing, callback ),3137 doAnimation = function() {3138 // Operate on a copy of prop so per-property easing won't be lost3139 var anim = Animation( this, jQuery.extend( {}, prop ), optall );3140 // Empty animations, or finishing resolves immediately3141 if ( empty || jQuery._data( this, "finish" ) ) {3142 anim.stop( true );3143 }3144 };3145 doAnimation.finish = doAnimation;3146 return empty || optall.queue === false ?3147 this.each( doAnimation ) :3148 this.queue( optall.queue, doAnimation );3149 },3150 stop: function( type, clearQueue, gotoEnd ) {3151 var stopQueue = function( hooks ) {3152 var stop = hooks.stop;3153 delete hooks.stop;3154 stop( gotoEnd );3155 };3156 if ( typeof type !== "string" ) {3157 gotoEnd = clearQueue;3158 clearQueue = type;3159 type = undefined;3160 }3161 if ( clearQueue && type !== false ) {3162 this.queue( type || "fx", [] );3163 }3164 return this.each(function() {3165 var dequeue = true,3166 index = type != null && type + "queueHooks",3167 timers = jQuery.timers,3168 data = jQuery._data( this );3169 if ( index ) {3170 if ( data[ index ] && data[ index ].stop ) {3171 stopQueue( data[ index ] );3172 }3173 } else {3174 for ( index in data ) {3175 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {3176 stopQueue( data[ index ] );3177 }3178 }3179 }3180 for ( index = timers.length; index--; ) {3181 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {3182 timers[ index ].anim.stop( gotoEnd );3183 dequeue = false;3184 timers.splice( index, 1 );3185 }3186 }3187 // start the next in the queue if the last step wasn't forced3188 // timers currently will call their complete callbacks, which will dequeue3189 // but only if they were gotoEnd3190 if ( dequeue || !gotoEnd ) {3191 jQuery.dequeue( this, type );3192 }3193 });3194 },3195 finish: function( type ) {3196 if ( type !== false ) {3197 type = type || "fx";3198 }3199 return this.each(function() {3200 var index,3201 data = jQuery._data( this ),3202 queue = data[ type + "queue" ],3203 hooks = data[ type + "queueHooks" ],3204 timers = jQuery.timers,3205 length = queue ? queue.length : 0;3206 // enable finishing flag on private data3207 data.finish = true;3208 // empty the queue first3209 jQuery.queue( this, type, [] );3210 if ( hooks && hooks.stop ) {3211 hooks.stop.call( this, true );3212 }3213 // look for any active animations, and finish them3214 for ( index = timers.length; index--; ) {3215 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {3216 timers[ index ].anim.stop( true );3217 timers.splice( index, 1 );3218 }3219 }3220 // look for any animations in the old queue and finish them3221 for ( index = 0; index < length; index++ ) {3222 if ( queue[ index ] && queue[ index ].finish ) {3223 queue[ index ].finish.call( this );3224 }3225 }3226 // turn off finishing flag3227 delete data.finish;3228 });3229 }3230});3231jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {3232 var cssFn = jQuery.fn[ name ];3233 jQuery.fn[ name ] = function( speed, easing, callback ) {3234 return speed == null || typeof speed === "boolean" ?3235 cssFn.apply( this, arguments ) :3236 this.animate( genFx( name, true ), speed, easing, callback );3237 };3238});3239// Generate shortcuts for custom animations3240jQuery.each({3241 slideDown: genFx("show"),3242 slideUp: genFx("hide"),3243 slideToggle: genFx("toggle"),3244 fadeIn: { opacity: "show" },3245 fadeOut: { opacity: "hide" },3246 fadeToggle: { opacity: "toggle" }3247}, function( name, props ) {3248 jQuery.fn[ name ] = function( speed, easing, callback ) {3249 return this.animate( props, speed, easing, callback );3250 };3251});3252jQuery.timers = [];3253jQuery.fx.tick = function() {3254 var timer,3255 timers = jQuery.timers,3256 i = 0;3257 fxNow = jQuery.now();3258 for ( ; i < timers.length; i++ ) {3259 timer = timers[ i ];3260 // Checks the timer has not already been removed3261 if ( !timer() && timers[ i ] === timer ) {3262 timers.splice( i--, 1 );3263 }3264 }3265 if ( !timers.length ) {3266 jQuery.fx.stop();3267 }3268 fxNow = undefined;3269};3270jQuery.fx.timer = function( timer ) {3271 jQuery.timers.push( timer );3272 if ( timer() ) {3273 jQuery.fx.start();3274 } else {3275 jQuery.timers.pop();3276 }3277};3278jQuery.fx.interval = 13;3279jQuery.fx.start = function() {3280 if ( !timerId ) {3281 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );3282 }3283};3284jQuery.fx.stop = function() {3285 clearInterval( timerId );3286 timerId = null;3287};3288jQuery.fx.speeds = {3289 slow: 600,3290 fast: 200,3291 // Default speed3292 _default: 4003293};3294// Based off of the plugin by Clint Helfers, with permission.3295// http://blindsignals.com/index.php/2009/07/jquery-delay/3296jQuery.fn.delay = function( time, type ) {3297 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;3298 type = type || "fx";3299 return this.queue( type, function( next, hooks ) {3300 var timeout = setTimeout( next, time );3301 hooks.stop = function() {3302 clearTimeout( timeout );3303 };3304 });3305};3306(function() {3307 // Minified: var a,b,c,d,e3308 var input, div, select, a, opt;3309 // Setup3310 div = document.createElement( "div" );3311 div.setAttribute( "className", "t" );3312 div.innerHTML = " <link><table></table><a href="/a">a</a><input type="checkbox">";3313 a = div.getElementsByTagName("a")[ 0 ];3314 // First batch of tests.3315 select = document.createElement("select");3316 opt = select.appendChild( document.createElement("option") );3317 input = div.getElementsByTagName("input")[ 0 ];3318 a.style.cssText = "top:1px";3319 // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)3320 support.getSetAttribute = div.className !== "t";3321 // Get the style information from getAttribute3322 // (IE uses .cssText instead)3323 support.style = /top/.test( a.getAttribute("style") );3324 // Make sure that URLs aren't manipulated3325 // (IE normalizes it by default)3326 support.hrefNormalized = a.getAttribute("href") === "/a";3327 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)3328 support.checkOn = !!input.value;3329 // Make sure that a selected-by-default option has a working selected property.3330 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)3331 support.optSelected = opt.selected;3332 // Tests for enctype support on a form (#6743)3333 support.enctype = !!document.createElement("form").enctype;3334 // Make sure that the options inside disabled selects aren't marked as disabled3335 // (WebKit marks them as disabled)3336 select.disabled = true;3337 support.optDisabled = !opt.disabled;3338 // Support: IE8 only3339 // Check if we can trust getAttribute("value")3340 input = document.createElement( "input" );3341 input.setAttribute( "value", "" );3342 support.input = input.getAttribute( "value" ) === "";3343 // Check if an input maintains its value after becoming a radio3344 input.value = "t";3345 input.setAttribute( "type", "radio" );3346 support.radioValue = input.value === "t";3347})();3348var rreturn = /\r/g;3349jQuery.fn.extend({3350 val: function( value ) {3351 var hooks, ret, isFunction,3352 elem = this[0];3353 if ( !arguments.length ) {3354 if ( elem ) {3355 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];3356 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {3357 return ret;3358 }3359 ret = elem.value;3360 return typeof ret === "string" ?3361 // handle most common string cases3362 ret.replace(rreturn, "") :3363 // handle cases where value is null/undef or number3364 ret == null ? "" : ret;3365 }3366 return;3367 }3368 isFunction = jQuery.isFunction( value );3369 return this.each(function( i ) {...
jquery-2.1.0.js
Source:jquery-2.1.0.js
...430 * @param {String} type431 */432function createInputPseudo( type ) {433 return function( elem ) {434 var name = elem.nodeName.toLowerCase();435 return name === "input" && elem.type === type;436 };437}438/**439 * Returns a function to use in pseudos for buttons440 * @param {String} type441 */442function createButtonPseudo( type ) {443 return function( elem ) {444 var name = elem.nodeName.toLowerCase();445 return (name === "input" || name === "button") && elem.type === type;446 };447}448/**449 * Returns a function to use in pseudos for positionals450 * @param {Function} fn451 */452function createPositionalPseudo( fn ) {453 return markFunction(function( argument ) {454 argument = +argument;455 return markFunction(function( seed, matches ) {456 var j,457 matchIndexes = fn( [], seed.length, argument ),458 i = matchIndexes.length;459 // Match elements found at the specified indexes460 while ( i-- ) {461 if ( seed[ (j = matchIndexes[i]) ] ) {462 seed[j] = !(matches[j] = seed[j]);463 }464 }465 });466 });467}468/**469 * Checks a node for validity as a Sizzle context470 * @param {Element|Object=} context471 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value472 */473function testContext( context ) {474 return context && typeof context.getElementsByTagName !== strundefined && context;475}476// Expose support vars for convenience477support = Sizzle.support = {};478/**479 * Detects XML nodes480 * @param {Element|Object} elem An element or a document481 * @returns {Boolean} True iff elem is a non-HTML XML node482 */483isXML = Sizzle.isXML = function( elem ) {484 // documentElement is verified for cases where it doesn't yet exist485 // (such as loading iframes in IE - #4833)486 var documentElement = elem && (elem.ownerDocument || elem).documentElement;487 return documentElement ? documentElement.nodeName !== "HTML" : false;488};489/**490 * Sets document-related variables once based on the current document491 * @param {Element|Object} [doc] An element or document object to use to set the document492 * @returns {Object} Returns the current document493 */494setDocument = Sizzle.setDocument = function( node ) {495 var hasCompare,496 doc = node ? node.ownerDocument || node : preferredDoc,497 parent = doc.defaultView;498 // If no document and documentElement is available, return499 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {500 return document;501 }502 // Set our document503 document = doc;504 docElem = doc.documentElement;505 // Support tests506 documentIsHTML = !isXML( doc );507 // Support: IE>8508 // If iframe document is assigned to "document" variable and if iframe has been reloaded,509 // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936510 // IE6-8 do not support the defaultView property so parent will be undefined511 if ( parent && parent !== parent.top ) {512 // IE11 does not have attachEvent, so all must suffer513 if ( parent.addEventListener ) {514 parent.addEventListener( "unload", function() {515 setDocument();516 }, false );517 } else if ( parent.attachEvent ) {518 parent.attachEvent( "onunload", function() {519 setDocument();520 });521 }522 }523 /* Attributes524 ---------------------------------------------------------------------- */525 // Support: IE<8 1="" 4="" 7="" 8="" 9="" 11="" 16="" 2011="" 12359="" 13378="" verify="" that="" getattribute="" really="" returns="" attributes="" and="" not="" properties="" (excepting="" ie8="" booleans)="" support.attributes="assert(function(" div="" )="" {="" div.classname="i" ;="" return="" !div.getattribute("classname");="" });="" *="" getelement(s)by*="" ----------------------------------------------------------------------="" check="" if="" getelementsbytagname("*")="" only="" elements="" support.getelementsbytagname="assert(function(" div.appendchild(="" doc.createcomment("")="" );="" !div.getelementsbytagname("*").length;="" getelementsbyclassname="" can="" be="" trusted="" support.getelementsbyclassname="rnative.test(" doc.getelementsbyclassname="" &&="" assert(function(="" div.innerhtml="<div class='a'></div><div class='a i'></div>" support:="" safari<4="" catch="" class="" over-caching="" div.firstchild.classname="i" opera<10="" gebcn="" failure="" to="" find="" non-leading="" classes="" div.getelementsbyclassname("i").length="==" 2;="" ie<10="" getelementbyid="" by="" name="" the="" broken="" methods="" don't="" pick="" up="" programatically-set="" names,="" so="" use="" a="" roundabout="" getelementsbyname="" test="" support.getbyid="assert(function(" docelem.appendchild(="" ).id="expando;" !doc.getelementsbyname="" ||="" !doc.getelementsbyname(="" expando="" ).length;="" id="" filter="" (="" expr.find["id"]="function(" id,="" context="" typeof="" context.getelementbyid="" !="=" strundefined="" documentishtml="" var="" m="context.getElementById(" parentnode="" when="" blackberry="" 4.6="" nodes="" are="" no="" longer="" in="" document="" #6963="" m.parentnode="" ?="" [m]="" :="" [];="" }="" };="" expr.filter["id"]="function(" attrid="id.replace(" runescape,="" funescape="" function(="" elem="" elem.getattribute("id")="==" attrid;="" else="" ie6="" is="" reliable="" as="" shortcut="" delete="" expr.find["id"];="" node="typeof" elem.getattributenode="" elem.getattributenode("id");="" node.value="==" tag="" expr.find["tag"]="support.getElementsByTagName" tag,="" context.getelementsbytagname="" context.getelementsbytagname(="" elem,="" tmp="[]," i="0," results="context.getElementsByTagName(" out="" possible="" comments="" "*"="" while="" (elem="results[i++])" elem.nodetype="==" tmp.push(="" tmp;="" results;="" expr.find["class"]="support.getElementsByClassName" classname,="" context.getelementsbyclassname="" context.getelementsbyclassname(="" classname="" qsa="" matchesselector="" support="" matchesselector(:active)="" reports="" false="" true="" (ie9="" opera="" 11.5)="" rbuggymatches="[];" qsa(:focus)="" (chrome="" 21)="" we="" allow="" this="" because="" of="" bug="" throws="" an="" error="" whenever="" `document.activeelement`="" accessed="" on="" iframe="" so,="" :focus="" pass="" through="" all="" time="" avoid="" ie="" see="" http:="" bugs.jquery.com="" ticket="" rbuggyqsa="[];" (support.qsa="rnative.test(" doc.queryselectorall="" ))="" build="" regex="" strategy="" adopted="" from="" diego="" perini="" select="" set="" empty="" string="" purpose="" ie's="" treatment="" explicitly="" setting="" boolean="" content="" attribute,="" since="" its="" presence="" should="" enough="" ie8,="" 10-12="" nothing="" selected strings="" follow="" ^="or" $="or" div.queryselectorall("[t^="" ]").length="" rbuggyqsa.push(="" "[*^$]=" + whitespace + " *(?:''|\"\")"="" "value"="" treated="" correctly="" !div.queryselectorall("[selected]").length="" "\\["="" +="" whitespace="" "*(?:value|"="" booleans="" ")"="" webkit="" -="" :checked="" option="" www.w3.org="" tr="" rec-css3-selectors-20110929="" #checked="" here="" will="" later="" tests="" !div.queryselectorall(":checked").length="" rbuggyqsa.push(":checked");="" windows="" native="" apps="" type="" restricted="" during="" .innerhtml="" assignment="" input="doc.createElement("input");" input.setattribute(="" "type",="" "hidden"="" ).setattribute(="" "name",="" "d"="" enforce="" case-sensitivity="" attribute="" div.queryselectorall("[name="d]").length" "name"="" "*[*^$|!~]?=" );526 }527 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)528 // IE8 throws error here and will not see later tests529 if ( !div.querySelectorAll(" :enabled").length="" ":enabled",="" ":disabled"="" 10-11="" does="" throw="" post-comma="" invalid="" pseudos="" div.queryselectorall("*,:x");="" rbuggyqsa.push(",.*:");="" (support.matchesselector="rnative.test(" (matches="docElem.webkitMatchesSelector" docelem.mozmatchesselector="" docelem.omatchesselector="" docelem.msmatchesselector)="" it's="" do="" disconnected="" (ie="" 9)="" support.disconnectedmatch="matches.call(" div,="" "div"="" fail="" with="" exception="" gecko="" error,="" instead="" matches.call(="" "[s!="" ]:x"="" rbuggymatches.push(="" "!=", pseudos );530 });531 }532 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join(" |")="" new="" regexp(="" rbuggymatches.join("|")="" contains="" hascompare="rnative.test(" docelem.comparedocumentposition="" element="" another="" purposefully="" implement="" inclusive="" descendent="" in,="" contain="" itself="" rnative.test(="" docelem.contains="" a,="" b="" adown="a.nodeType" =="=" a.documentelement="" bup="b" b.parentnode;="" !!(="" bup.nodetype="==" adown.contains="" adown.contains(="" a.comparedocumentposition="" a.comparedocumentposition(="" &="" ));="" (b="b.parentNode)" true;="" false;="" sorting="" order="" sortorder="hasCompare" flag="" for="" duplicate="" removal="" hasduplicate="true;" 0;="" sort="" method="" existence="" one="" has="" comparedocumentposition="" compare="!a.compareDocumentPosition" !b.comparedocumentposition;="" compare;="" calculate="" position="" both="" inputs="" belong="" same="" a.ownerdocument="" b.ownerdocument="" otherwise="" know="" they="" 1;="" (!support.sortdetached="" b.comparedocumentposition(="" compare)="" choose="" first="" related="" our="" preferred="" doc="" preferreddoc="" contains(preferreddoc,="" a)="" -1;="" b)="" maintain="" original="" sortinput="" indexof.call(="" sortinput,="" -1="" exit="" early="" identical="" cur,="" aup="a.parentNode," ap="[" ],="" bp="[" ];="" parentless="" either="" documents="" or="" !aup="" !bup="" siblings,="" quick="" siblingcheck(="" need="" full="" lists="" their="" ancestors="" comparison="" cur="a;" (cur="cur.parentNode)" ap.unshift(="" bp.unshift(="" walk="" down="" tree="" looking="" discrepancy="" ap[i]="==" bp[i]="" i++;="" sibling="" have="" common="" ancestor="" ap[i],="" doc;="" sizzle.matches="function(" expr,="" sizzle(="" null,="" sizzle.matchesselector="function(" expr="" vars="" needed="" elem.ownerdocument="" setdocument(="" make="" sure="" selectors="" quoted="" rattributequotes,="" "="$1" ]"="" support.matchesselector="" !rbuggymatches="" !rbuggymatches.test(="" !rbuggyqsa="" !rbuggyqsa.test(="" try="" ret="matches.call(" 9's="" well,="" said="" fragment="" elem.document="" elem.document.nodetype="" ret;="" catch(e)="" {}="" document,="" [elem]="" ).length=""> 0;533};534Sizzle.contains = function( context, elem ) {535 // Set document vars if needed536 if ( ( context.ownerDocument || context ) !== document ) {537 setDocument( context );538 }539 return contains( context, elem );540};541Sizzle.attr = function( elem, name ) {542 // Set document vars if needed543 if ( ( elem.ownerDocument || elem ) !== document ) {544 setDocument( elem );545 }546 var fn = Expr.attrHandle[ name.toLowerCase() ],547 // Don't get fooled by Object.prototype properties (jQuery #13807)548 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?549 fn( elem, name, !documentIsHTML ) :550 undefined;551 return val !== undefined ?552 val :553 support.attributes || !documentIsHTML ?554 elem.getAttribute( name ) :555 (val = elem.getAttributeNode(name)) && val.specified ?556 val.value :557 null;558};559Sizzle.error = function( msg ) {560 throw new Error( "Syntax error, unrecognized expression: " + msg );561};562/**563 * Document sorting and removing duplicates564 * @param {ArrayLike} results565 */566Sizzle.uniqueSort = function( results ) {567 var elem,568 duplicates = [],569 j = 0,570 i = 0;571 // Unless we *know* we can detect duplicates, assume their presence572 hasDuplicate = !support.detectDuplicates;573 sortInput = !support.sortStable && results.slice( 0 );574 results.sort( sortOrder );575 if ( hasDuplicate ) {576 while ( (elem = results[i++]) ) {577 if ( elem === results[ i ] ) {578 j = duplicates.push( i );579 }580 }581 while ( j-- ) {582 results.splice( duplicates[ j ], 1 );583 }584 }585 // Clear input after sorting to release objects586 // See https://github.com/jquery/sizzle/pull/225587 sortInput = null;588 return results;589};590/**591 * Utility function for retrieving the text value of an array of DOM nodes592 * @param {Array|Element} elem593 */594getText = Sizzle.getText = function( elem ) {595 var node,596 ret = "",597 i = 0,598 nodeType = elem.nodeType;599 if ( !nodeType ) {600 // If no nodeType, this is expected to be an array601 while ( (node = elem[i++]) ) {602 // Do not traverse comment nodes603 ret += getText( node );604 }605 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {606 // Use textContent for elements607 // innerText usage removed for consistency of new lines (jQuery #11153)608 if ( typeof elem.textContent === "string" ) {609 return elem.textContent;610 } else {611 // Traverse its children612 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {613 ret += getText( elem );614 }615 }616 } else if ( nodeType === 3 || nodeType === 4 ) {617 return elem.nodeValue;618 }619 // Do not include comment or processing instruction nodes620 return ret;621};622Expr = Sizzle.selectors = {623 // Can be adjusted by the user624 cacheLength: 50,625 createPseudo: markFunction,626 match: matchExpr,627 attrHandle: {},628 find: {},629 relative: {630 ">": { dir: "parentNode", first: true },631 " ": { dir: "parentNode" },632 "+": { dir: "previousSibling", first: true },633 "~": { dir: "previousSibling" }634 },635 preFilter: {636 "ATTR": function( match ) {637 match[1] = match[1].replace( runescape, funescape );638 // Move the given value to match[3] whether quoted or unquoted639 match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );640 if ( match[2] === "~=" ) {641 match[3] = " " + match[3] + " ";642 }643 return match.slice( 0, 4 );644 },645 "CHILD": function( match ) {646 /* matches from matchExpr["CHILD"]647 1 type (only|nth|...)648 2 what (child|of-type)649 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)650 4 xn-component of xn+y argument ([+-]?\d*n|)651 5 sign of xn-component652 6 x of xn-component653 7 sign of y-component654 8 y of y-component655 */656 match[1] = match[1].toLowerCase();657 if ( match[1].slice( 0, 3 ) === "nth" ) {658 // nth-* requires argument659 if ( !match[3] ) {660 Sizzle.error( match[0] );661 }662 // numeric x and y parameters for Expr.filter.CHILD663 // remember that false/true cast respectively to 0/1664 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );665 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );666 // other types prohibit arguments667 } else if ( match[3] ) {668 Sizzle.error( match[0] );669 }670 return match;671 },672 "PSEUDO": function( match ) {673 var excess,674 unquoted = !match[5] && match[2];675 if ( matchExpr["CHILD"].test( match[0] ) ) {676 return null;677 }678 // Accept quoted arguments as-is679 if ( match[3] && match[4] !== undefined ) {680 match[2] = match[4];681 // Strip excess characters from unquoted arguments682 } else if ( unquoted && rpseudo.test( unquoted ) &&683 // Get excess from tokenize (recursively)684 (excess = tokenize( unquoted, true )) &&685 // advance to the next closing parenthesis686 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {687 // excess is a negative index688 match[0] = match[0].slice( 0, excess );689 match[2] = unquoted.slice( 0, excess );690 }691 // Return only captures needed by the pseudo filter method (type and argument)692 return match.slice( 0, 3 );693 }694 },695 filter: {696 "TAG": function( nodeNameSelector ) {697 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();698 return nodeNameSelector === "*" ?699 function() { return true; } :700 function( elem ) {701 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;702 };703 },704 "CLASS": function( className ) {705 var pattern = classCache[ className + " " ];706 return pattern ||707 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&708 classCache( className, function( elem ) {709 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );710 });711 },712 "ATTR": function( name, operator, check ) {713 return function( elem ) {714 var result = Sizzle.attr( elem, name );715 if ( result == null ) {716 return operator === "!=";717 }718 if ( !operator ) {719 return true;720 }721 result += "";722 return operator === "=" ? result === check :723 operator === "!=" ? result !== check :724 operator === "^=" ? check && result.indexOf( check ) === 0 :725 operator === "*=" ? check && result.indexOf( check ) > -1 :726 operator === "$=" ? check && result.slice( -check.length ) === check :727 operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :728 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :729 false;730 };731 },732 "CHILD": function( type, what, argument, first, last ) {733 var simple = type.slice( 0, 3 ) !== "nth",734 forward = type.slice( -4 ) !== "last",735 ofType = what === "of-type";736 return first === 1 && last === 0 ?737 // Shortcut for :nth-*(n)738 function( elem ) {739 return !!elem.parentNode;740 } :741 function( elem, context, xml ) {742 var cache, outerCache, node, diff, nodeIndex, start,743 dir = simple !== forward ? "nextSibling" : "previousSibling",744 parent = elem.parentNode,745 name = ofType && elem.nodeName.toLowerCase(),746 useCache = !xml && !ofType;747 if ( parent ) {748 // :(first|last|only)-(child|of-type)749 if ( simple ) {750 while ( dir ) {751 node = elem;752 while ( (node = node[ dir ]) ) {753 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {754 return false;755 }756 }757 // Reverse direction for :only-* (if we haven't yet done so)758 start = dir = type === "only" && !start && "nextSibling";759 }760 return true;761 }762 start = [ forward ? parent.firstChild : parent.lastChild ];763 // non-xml :nth-child(...) stores cache data on `parent`764 if ( forward && useCache ) {765 // Seek `elem` from a previously-cached index766 outerCache = parent[ expando ] || (parent[ expando ] = {});767 cache = outerCache[ type ] || [];768 nodeIndex = cache[0] === dirruns && cache[1];769 diff = cache[0] === dirruns && cache[2];770 node = nodeIndex && parent.childNodes[ nodeIndex ];771 while ( (node = ++nodeIndex && node && node[ dir ] ||772 // Fallback to seeking `elem` from the start773 (diff = nodeIndex = 0) || start.pop()) ) {774 // When found, cache indexes on `parent` and break775 if ( node.nodeType === 1 && ++diff && node === elem ) {776 outerCache[ type ] = [ dirruns, nodeIndex, diff ];777 break;778 }779 }780 // Use previously-cached element index if available781 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {782 diff = cache[1];783 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)784 } else {785 // Use the same loop as above to seek `elem` from the start786 while ( (node = ++nodeIndex && node && node[ dir ] ||787 (diff = nodeIndex = 0) || start.pop()) ) {788 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {789 // Cache the index of each encountered element790 if ( useCache ) {791 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];792 }793 if ( node === elem ) {794 break;795 }796 }797 }798 }799 // Incorporate the offset, then check against cycle size800 diff -= last;801 return diff === first || ( diff % first === 0 && diff / first >= 0 );802 }803 };804 },805 "PSEUDO": function( pseudo, argument ) {806 // pseudo-class names are case-insensitive807 // http://www.w3.org/TR/selectors/#pseudo-classes808 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters809 // Remember that setFilters inherits from pseudos810 var args,811 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||812 Sizzle.error( "unsupported pseudo: " + pseudo );813 // The user may use createPseudo to indicate that814 // arguments are needed to create the filter function815 // just as Sizzle does816 if ( fn[ expando ] ) {817 return fn( argument );818 }819 // But maintain support for old signatures820 if ( fn.length > 1 ) {821 args = [ pseudo, pseudo, "", argument ];822 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?823 markFunction(function( seed, matches ) {824 var idx,825 matched = fn( seed, argument ),826 i = matched.length;827 while ( i-- ) {828 idx = indexOf.call( seed, matched[i] );829 seed[ idx ] = !( matches[ idx ] = matched[i] );830 }831 }) :832 function( elem ) {833 return fn( elem, 0, args );834 };835 }836 return fn;837 }838 },839 pseudos: {840 // Potentially complex pseudos841 "not": markFunction(function( selector ) {842 // Trim the selector passed to compile843 // to avoid treating leading and trailing844 // spaces as combinators845 var input = [],846 results = [],847 matcher = compile( selector.replace( rtrim, "$1" ) );848 return matcher[ expando ] ?849 markFunction(function( seed, matches, context, xml ) {850 var elem,851 unmatched = matcher( seed, null, xml, [] ),852 i = seed.length;853 // Match elements unmatched by `matcher`854 while ( i-- ) {855 if ( (elem = unmatched[i]) ) {856 seed[i] = !(matches[i] = elem);857 }858 }859 }) :860 function( elem, context, xml ) {861 input[0] = elem;862 matcher( input, null, xml, results );863 return !results.pop();864 };865 }),866 "has": markFunction(function( selector ) {867 return function( elem ) {868 return Sizzle( selector, elem ).length > 0;869 };870 }),871 "contains": markFunction(function( text ) {872 return function( elem ) {873 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;874 };875 }),876 // "Whether an element is represented by a :lang() selector877 // is based solely on the element's language value878 // being equal to the identifier C,879 // or beginning with the identifier C immediately followed by "-".880 // The matching of C against the element's language value is performed case-insensitively.881 // The identifier C does not have to be a valid language name."882 // http://www.w3.org/TR/selectors/#lang-pseudo883 "lang": markFunction( function( lang ) {884 // lang value must be a valid identifier885 if ( !ridentifier.test(lang || "") ) {886 Sizzle.error( "unsupported lang: " + lang );887 }888 lang = lang.replace( runescape, funescape ).toLowerCase();889 return function( elem ) {890 var elemLang;891 do {892 if ( (elemLang = documentIsHTML ?893 elem.lang :894 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {895 elemLang = elemLang.toLowerCase();896 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;897 }898 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );899 return false;900 };901 }),902 // Miscellaneous903 "target": function( elem ) {904 var hash = window.location && window.location.hash;905 return hash && hash.slice( 1 ) === elem.id;906 },907 "root": function( elem ) {908 return elem === docElem;909 },910 "focus": function( elem ) {911 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);912 },913 // Boolean properties914 "enabled": function( elem ) {915 return elem.disabled === false;916 },917 "disabled": function( elem ) {918 return elem.disabled === true;919 },920 "checked": function( elem ) {921 // In CSS3, :checked should return both checked and selected elements922 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked923 var nodeName = elem.nodeName.toLowerCase();924 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);925 },926 "selected": function( elem ) {927 // Accessing this property makes selected-by-default928 // options in Safari work properly929 if ( elem.parentNode ) {930 elem.parentNode.selectedIndex;931 }932 return elem.selected === true;933 },934 // Contents935 "empty": function( elem ) {936 // http://www.w3.org/TR/selectors/#empty-pseudo937 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),938 // but not by others (comment: 8; processing instruction: 7; etc.)939 // nodeType < 6 works because attributes (2) do not appear as children940 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {941 if ( elem.nodeType < 6 ) {942 return false;943 }944 }945 return true;946 },947 "parent": function( elem ) {948 return !Expr.pseudos["empty"]( elem );949 },950 // Element/input types951 "header": function( elem ) {952 return rheader.test( elem.nodeName );953 },954 "input": function( elem ) {955 return rinputs.test( elem.nodeName );956 },957 "button": function( elem ) {958 var name = elem.nodeName.toLowerCase();959 return name === "input" && elem.type === "button" || name === "button";960 },961 "text": function( elem ) {962 var attr;963 return elem.nodeName.toLowerCase() === "input" &&964 elem.type === "text" &&965 // Support: IE<8 0="" 1="" new="" html5="" attribute="" values="" (e.g.,="" "search")="" appear="" with="" elem.type="==" "text"="" (="" (attr="elem.getAttribute("type"))" =="null" ||="" attr.tolowercase()="==" );="" },="" position-in-collection="" "first":="" createpositionalpseudo(function()="" {="" return="" [="" ];="" }),="" "last":="" createpositionalpseudo(function(="" matchindexes,="" length="" )="" -="" "eq":="" length,="" argument="" <="" ?="" +="" :="" "even":="" var="" i="0;" for="" ;="" length;="" matchindexes.push(="" }="" matchindexes;="" "odd":="" "lt":="" argument;="" --i="">= 0; ) {966 matchIndexes.push( i );967 }968 return matchIndexes;969 }),970 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {971 var i = argument < 0 ? argument + length : argument;972 for ( ; ++i < length; ) {973 matchIndexes.push( i );974 }975 return matchIndexes;976 })977 }978};979Expr.pseudos["nth"] = Expr.pseudos["eq"];980// Add button/input type pseudos981for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {982 Expr.pseudos[ i ] = createInputPseudo( i );983}984for ( i in { submit: true, reset: true } ) {985 Expr.pseudos[ i ] = createButtonPseudo( i );986}987// Easy API for creating new setFilters988function setFilters() {}989setFilters.prototype = Expr.filters = Expr.pseudos;990Expr.setFilters = new setFilters();991function tokenize( selector, parseOnly ) {992 var matched, match, tokens, type,993 soFar, groups, preFilters,994 cached = tokenCache[ selector + " " ];995 if ( cached ) {996 return parseOnly ? 0 : cached.slice( 0 );997 }998 soFar = selector;999 groups = [];1000 preFilters = Expr.preFilter;1001 while ( soFar ) {1002 // Comma and first run1003 if ( !matched || (match = rcomma.exec( soFar )) ) {1004 if ( match ) {1005 // Don't consume trailing commas as valid1006 soFar = soFar.slice( match[0].length ) || soFar;1007 }1008 groups.push( (tokens = []) );1009 }1010 matched = false;1011 // Combinators1012 if ( (match = rcombinators.exec( soFar )) ) {1013 matched = match.shift();1014 tokens.push({1015 value: matched,1016 // Cast descendant combinators to space1017 type: match[0].replace( rtrim, " " )1018 });1019 soFar = soFar.slice( matched.length );1020 }1021 // Filters1022 for ( type in Expr.filter ) {1023 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||1024 (match = preFilters[ type ]( match ))) ) {1025 matched = match.shift();1026 tokens.push({1027 value: matched,1028 type: type,1029 matches: match1030 });1031 soFar = soFar.slice( matched.length );1032 }1033 }1034 if ( !matched ) {1035 break;1036 }1037 }1038 // Return the length of the invalid excess1039 // if we're just parsing1040 // Otherwise, throw an error or return tokens1041 return parseOnly ?1042 soFar.length :1043 soFar ?1044 Sizzle.error( selector ) :1045 // Cache the tokens1046 tokenCache( selector, groups ).slice( 0 );1047}1048function toSelector( tokens ) {1049 var i = 0,1050 len = tokens.length,1051 selector = "";1052 for ( ; i < len; i++ ) {1053 selector += tokens[i].value;1054 }1055 return selector;1056}1057function addCombinator( matcher, combinator, base ) {1058 var dir = combinator.dir,1059 checkNonElements = base && dir === "parentNode",1060 doneName = done++;1061 return combinator.first ?1062 // Check against closest ancestor/preceding element1063 function( elem, context, xml ) {1064 while ( (elem = elem[ dir ]) ) {1065 if ( elem.nodeType === 1 || checkNonElements ) {1066 return matcher( elem, context, xml );1067 }1068 }1069 } :1070 // Check against all ancestor/preceding elements1071 function( elem, context, xml ) {1072 var oldCache, outerCache,1073 newCache = [ dirruns, doneName ];1074 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching1075 if ( xml ) {1076 while ( (elem = elem[ dir ]) ) {1077 if ( elem.nodeType === 1 || checkNonElements ) {1078 if ( matcher( elem, context, xml ) ) {1079 return true;1080 }1081 }1082 }1083 } else {1084 while ( (elem = elem[ dir ]) ) {1085 if ( elem.nodeType === 1 || checkNonElements ) {1086 outerCache = elem[ expando ] || (elem[ expando ] = {});1087 if ( (oldCache = outerCache[ dir ]) &&1088 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {1089 // Assign to newCache so results back-propagate to previous elements1090 return (newCache[ 2 ] = oldCache[ 2 ]);1091 } else {1092 // Reuse newcache so results back-propagate to previous elements1093 outerCache[ dir ] = newCache;1094 // A match means we're done; a fail means we have to keep checking1095 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {1096 return true;1097 }1098 }1099 }1100 }1101 }1102 };1103}1104function elementMatcher( matchers ) {1105 return matchers.length > 1 ?1106 function( elem, context, xml ) {1107 var i = matchers.length;1108 while ( i-- ) {1109 if ( !matchers[i]( elem, context, xml ) ) {1110 return false;1111 }1112 }1113 return true;1114 } :1115 matchers[0];1116}1117function condense( unmatched, map, filter, context, xml ) {1118 var elem,1119 newUnmatched = [],1120 i = 0,1121 len = unmatched.length,1122 mapped = map != null;1123 for ( ; i < len; i++ ) {1124 if ( (elem = unmatched[i]) ) {1125 if ( !filter || filter( elem, context, xml ) ) {1126 newUnmatched.push( elem );1127 if ( mapped ) {1128 map.push( i );1129 }1130 }1131 }1132 }1133 return newUnmatched;1134}1135function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {1136 if ( postFilter && !postFilter[ expando ] ) {1137 postFilter = setMatcher( postFilter );1138 }1139 if ( postFinder && !postFinder[ expando ] ) {1140 postFinder = setMatcher( postFinder, postSelector );1141 }1142 return markFunction(function( seed, results, context, xml ) {1143 var temp, i, elem,1144 preMap = [],1145 postMap = [],1146 preexisting = results.length,1147 // Get initial elements from seed or context1148 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),1149 // Prefilter to get matcher input, preserving a map for seed-results synchronization1150 matcherIn = preFilter && ( seed || !selector ) ?1151 condense( elems, preMap, preFilter, context, xml ) :1152 elems,1153 matcherOut = matcher ?1154 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,1155 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?1156 // ...intermediate processing is necessary1157 [] :1158 // ...otherwise use results directly1159 results :1160 matcherIn;1161 // Find primary matches1162 if ( matcher ) {1163 matcher( matcherIn, matcherOut, context, xml );1164 }1165 // Apply postFilter1166 if ( postFilter ) {1167 temp = condense( matcherOut, postMap );1168 postFilter( temp, [], context, xml );1169 // Un-match failing elements by moving them back to matcherIn1170 i = temp.length;1171 while ( i-- ) {1172 if ( (elem = temp[i]) ) {1173 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);1174 }1175 }1176 }1177 if ( seed ) {1178 if ( postFinder || preFilter ) {1179 if ( postFinder ) {1180 // Get the final matcherOut by condensing this intermediate into postFinder contexts1181 temp = [];1182 i = matcherOut.length;1183 while ( i-- ) {1184 if ( (elem = matcherOut[i]) ) {1185 // Restore matcherIn since elem is not yet a final match1186 temp.push( (matcherIn[i] = elem) );1187 }1188 }1189 postFinder( null, (matcherOut = []), temp, xml );1190 }1191 // Move matched elements from seed to results to keep them synchronized1192 i = matcherOut.length;1193 while ( i-- ) {1194 if ( (elem = matcherOut[i]) &&1195 (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {1196 seed[temp] = !(results[temp] = elem);1197 }1198 }1199 }1200 // Add elements to results, through postFinder if defined1201 } else {1202 matcherOut = condense(1203 matcherOut === results ?1204 matcherOut.splice( preexisting, matcherOut.length ) :1205 matcherOut1206 );1207 if ( postFinder ) {1208 postFinder( null, results, matcherOut, xml );1209 } else {1210 push.apply( results, matcherOut );1211 }1212 }1213 });1214}1215function matcherFromTokens( tokens ) {1216 var checkContext, matcher, j,1217 len = tokens.length,1218 leadingRelative = Expr.relative[ tokens[0].type ],1219 implicitRelative = leadingRelative || Expr.relative[" "],1220 i = leadingRelative ? 1 : 0,1221 // The foundational matcher ensures that elements are reachable from top-level context(s)1222 matchContext = addCombinator( function( elem ) {1223 return elem === checkContext;1224 }, implicitRelative, true ),1225 matchAnyContext = addCombinator( function( elem ) {1226 return indexOf.call( checkContext, elem ) > -1;1227 }, implicitRelative, true ),1228 matchers = [ function( elem, context, xml ) {1229 return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (1230 (checkContext = context).nodeType ?1231 matchContext( elem, context, xml ) :1232 matchAnyContext( elem, context, xml ) );1233 } ];1234 for ( ; i < len; i++ ) {1235 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {1236 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];1237 } else {1238 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );1239 // Return special upon seeing a positional matcher1240 if ( matcher[ expando ] ) {1241 // Find the next relative operator (if any) for proper handling1242 j = ++i;1243 for ( ; j < len; j++ ) {1244 if ( Expr.relative[ tokens[j].type ] ) {1245 break;1246 }1247 }1248 return setMatcher(1249 i > 1 && elementMatcher( matchers ),1250 i > 1 && toSelector(1251 // If the preceding token was a descendant combinator, insert an implicit any-element `*`1252 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })1253 ).replace( rtrim, "$1" ),1254 matcher,1255 i < j && matcherFromTokens( tokens.slice( i, j ) ),1256 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),1257 j < len && toSelector( tokens )1258 );1259 }1260 matchers.push( matcher );1261 }1262 }1263 return elementMatcher( matchers );1264}1265function matcherFromGroupMatchers( elementMatchers, setMatchers ) {1266 var bySet = setMatchers.length > 0,1267 byElement = elementMatchers.length > 0,1268 superMatcher = function( seed, context, xml, results, outermost ) {1269 var elem, j, matcher,1270 matchedCount = 0,1271 i = "0",1272 unmatched = seed && [],1273 setMatched = [],1274 contextBackup = outermostContext,1275 // We must always have either seed elements or outermost context1276 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),1277 // Use integer dirruns iff this is the outermost matcher1278 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),1279 len = elems.length;1280 if ( outermost ) {1281 outermostContext = context !== document && context;1282 }1283 // Add elements passing elementMatchers directly to results1284 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below1285 // Support: IE<9, safari="" tolerate="" nodelist="" properties="" (ie:="" "length";="" safari:="" <number="">) matching elements by id1286 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {1287 if ( byElement && elem ) {1288 j = 0;1289 while ( (matcher = elementMatchers[j++]) ) {1290 if ( matcher( elem, context, xml ) ) {1291 results.push( elem );1292 break;1293 }1294 }1295 if ( outermost ) {1296 dirruns = dirrunsUnique;1297 }1298 }1299 // Track unmatched elements for set filters1300 if ( bySet ) {1301 // They will have gone through all possible matchers1302 if ( (elem = !matcher && elem) ) {1303 matchedCount--;1304 }1305 // Lengthen the array for every element, matched or not1306 if ( seed ) {1307 unmatched.push( elem );1308 }1309 }1310 }1311 // Apply set filters to unmatched elements1312 matchedCount += i;1313 if ( bySet && i !== matchedCount ) {1314 j = 0;1315 while ( (matcher = setMatchers[j++]) ) {1316 matcher( unmatched, setMatched, context, xml );1317 }1318 if ( seed ) {1319 // Reintegrate element matches to eliminate the need for sorting1320 if ( matchedCount > 0 ) {1321 while ( i-- ) {1322 if ( !(unmatched[i] || setMatched[i]) ) {1323 setMatched[i] = pop.call( results );1324 }1325 }1326 }1327 // Discard index placeholder values to get only actual matches1328 setMatched = condense( setMatched );1329 }1330 // Add matches to results1331 push.apply( results, setMatched );1332 // Seedless set matches succeeding multiple successful matchers stipulate sorting1333 if ( outermost && !seed && setMatched.length > 0 &&1334 ( matchedCount + setMatchers.length ) > 1 ) {1335 Sizzle.uniqueSort( results );1336 }1337 }1338 // Override manipulation of globals by nested matchers1339 if ( outermost ) {1340 dirruns = dirrunsUnique;1341 outermostContext = contextBackup;1342 }1343 return unmatched;1344 };1345 return bySet ?1346 markFunction( superMatcher ) :1347 superMatcher;1348}1349compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {1350 var i,1351 setMatchers = [],1352 elementMatchers = [],1353 cached = compilerCache[ selector + " " ];1354 if ( !cached ) {1355 // Generate a function of recursive functions that can be used to check each element1356 if ( !group ) {1357 group = tokenize( selector );1358 }1359 i = group.length;1360 while ( i-- ) {1361 cached = matcherFromTokens( group[i] );1362 if ( cached[ expando ] ) {1363 setMatchers.push( cached );1364 } else {1365 elementMatchers.push( cached );1366 }1367 }1368 // Cache the compiled function1369 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );1370 }1371 return cached;1372};1373function multipleContexts( selector, contexts, results ) {1374 var i = 0,1375 len = contexts.length;1376 for ( ; i < len; i++ ) {1377 Sizzle( selector, contexts[i], results );1378 }1379 return results;1380}1381function select( selector, context, results, seed ) {1382 var i, tokens, token, type, find,1383 match = tokenize( selector );1384 if ( !seed ) {1385 // Try to minimize operations if there is only one group1386 if ( match.length === 1 ) {1387 // Take a shortcut and set the context if the root selector is an ID1388 tokens = match[0] = match[0].slice( 0 );1389 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&1390 support.getById && context.nodeType === 9 && documentIsHTML &&1391 Expr.relative[ tokens[1].type ] ) {1392 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];1393 if ( !context ) {1394 return results;1395 }1396 selector = selector.slice( tokens.shift().value.length );1397 }1398 // Fetch a seed set for right-to-left matching1399 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;1400 while ( i-- ) {1401 token = tokens[i];1402 // Abort if we hit a combinator1403 if ( Expr.relative[ (type = token.type) ] ) {1404 break;1405 }1406 if ( (find = Expr.find[ type ]) ) {1407 // Search, expanding context for leading sibling combinators1408 if ( (seed = find(1409 token.matches[0].replace( runescape, funescape ),1410 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context1411 )) ) {1412 // If seed is empty or no tokens remain, we can return early1413 tokens.splice( i, 1 );1414 selector = seed.length && toSelector( tokens );1415 if ( !selector ) {1416 push.apply( results, seed );1417 return results;1418 }1419 break;1420 }1421 }1422 }1423 }1424 }1425 // Compile and execute a filtering function1426 // Provide `match` to avoid retokenization if we modified the selector above1427 compile( selector, match )(1428 seed,1429 context,1430 !documentIsHTML,1431 results,1432 rsibling.test( selector ) && testContext( context.parentNode ) || context1433 );1434 return results;1435}1436// One-time assignments1437// Sort stability1438support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;1439// Support: Chrome<14 1="" 2="" 4="" 25="" always="" assume="" duplicates="" if="" they="" aren't="" passed="" to="" the="" comparison="" function="" support.detectduplicates="!!hasDuplicate;" initialize="" against="" default document="" setdocument();="" support:="" webkit<537.32="" -="" safari="" 6.0.3="" chrome="" (fixed="" in="" 27)="" detached="" nodes="" confoundingly="" follow="" *each="" other*="" support.sortdetached="assert(function(" div1="" )="" {="" should="" return="" 1,="" but="" returns="" (following)="" div1.comparedocumentposition(="" document.createelement("div")="" &="" 1;="" });="" ie<8="" prevent="" attribute="" property="" "interpolation"="" http:="" msdn.microsoft.com="" en-us="" library="" ms536429%28vs.85%29.aspx="" (="" !assert(function(="" div="" div.innerhtml="<a href='#'></a>" ;="" div.firstchild.getattribute("href")="==" "#"="" })="" addhandle(="" "type|href|height|width",="" function(="" elem,="" name,="" isxml="" !isxml="" elem.getattribute(="" name.tolowercase()="==" "type"="" ?="" :="" );="" }="" ie<9="" use="" defaultvalue="" place="" of="" getattribute("value")="" !support.attributes="" ||="" div.firstchild.setattribute(="" "value",="" ""="" div.firstchild.getattribute(="" "value"="" "";="" &&="" elem.nodename.tolowercase()="==" "input"="" elem.defaultvalue;="" getattributenode="" fetch="" booleans="" when="" getattribute="" lies="" div.getattribute("disabled")="=" null;="" booleans,="" var="" val;="" elem[="" name="" ]="==" true="" (val="elem.getAttributeNode(" ))="" val.specified="" val.value="" sizzle;="" })(="" window="" jquery.find="Sizzle;" jquery.expr="Sizzle.selectors;" jquery.expr[":"]="jQuery.expr.pseudos;" jquery.unique="Sizzle.uniqueSort;" jquery.text="Sizzle.getText;" jquery.isxmldoc="Sizzle.isXML;" jquery.contains="Sizzle.contains;" rneedscontext="jQuery.expr.match.needsContext;" rsingletag="(/^<(\w+)\s*\/?">(?:<\ \1="">|)$/);1440var risSimple = /^.[^:#\[\.,]*$/;1441// Implement the identical functionality for filter and not1442function winnow( elements, qualifier, not ) {1443 if ( jQuery.isFunction( qualifier ) ) {1444 return jQuery.grep( elements, function( elem, i ) {1445 /* jshint -W018 */1446 return !!qualifier.call( elem, i, elem ) !== not;1447 });1448 }1449 if ( qualifier.nodeType ) {1450 return jQuery.grep( elements, function( elem ) {1451 return ( elem === qualifier ) !== not;1452 });1453 }1454 if ( typeof qualifier === "string" ) {1455 if ( risSimple.test( qualifier ) ) {1456 return jQuery.filter( qualifier, elements, not );1457 }1458 qualifier = jQuery.filter( qualifier, elements );1459 }1460 return jQuery.grep( elements, function( elem ) {1461 return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;1462 });1463}1464jQuery.filter = function( expr, elems, not ) {1465 var elem = elems[ 0 ];1466 if ( not ) {1467 expr = ":not(" + expr + ")";1468 }1469 return elems.length === 1 && elem.nodeType === 1 ?1470 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :1471 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {1472 return elem.nodeType === 1;1473 }));1474};1475jQuery.fn.extend({1476 find: function( selector ) {1477 var i,1478 len = this.length,1479 ret = [],1480 self = this;1481 if ( typeof selector !== "string" ) {1482 return this.pushStack( jQuery( selector ).filter(function() {1483 for ( i = 0; i < len; i++ ) {1484 if ( jQuery.contains( self[ i ], this ) ) {1485 return true;1486 }1487 }1488 }) );1489 }1490 for ( i = 0; i < len; i++ ) {1491 jQuery.find( selector, self[ i ], ret );1492 }1493 // Needed because $( selector, context ) becomes $( context ).find( selector )1494 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );1495 ret.selector = this.selector ? this.selector + " " + selector : selector;1496 return ret;1497 },1498 filter: function( selector ) {1499 return this.pushStack( winnow(this, selector || [], false) );1500 },1501 not: function( selector ) {1502 return this.pushStack( winnow(this, selector || [], true) );1503 },1504 is: function( selector ) {1505 return !!winnow(1506 this,1507 // If this is a positional/relative selector, check membership in the returned set1508 // so $("p:first").is("p:last") won't return true for a doc with two "p".1509 typeof selector === "string" && rneedsContext.test( selector ) ?1510 jQuery( selector ) :1511 selector || [],1512 false1513 ).length;1514 }1515});1516// Initialize a jQuery object1517// A central reference to the root jQuery(document)1518var rootjQuery,1519 // A simple way to check for HTML strings1520 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)1521 // Strict HTML recognition (#11290: must start with <) rquickexpr="/^(?:\s*(<[\w\W]+">)[^>]*|#([\w-]*))$/,1522 init = jQuery.fn.init = function( selector, context ) {1523 var match, elem;1524 // HANDLE: $(""), $(null), $(undefined), $(false)1525 if ( !selector ) {1526 return this;1527 }1528 // Handle HTML strings1529 if ( typeof selector === "string" ) {1530 if ( selector[0] === "<" 1="" &&="" selector[="" selector.length="" -="" ]="==" "="">" && selector.length >= 3 ) {1531 // Assume that strings that start and end with <> are HTML and skip the regex check1532 match = [ null, selector, null ];1533 } else {1534 match = rquickExpr.exec( selector );1535 }1536 // Match html or make sure no context is specified for #id1537 if ( match && (match[1] || !context) ) {1538 // HANDLE: $(html) -> $(array)1539 if ( match[1] ) {1540 context = context instanceof jQuery ? context[0] : context;1541 // scripts is true for back-compat1542 // Intentionally let the error be thrown if parseHTML is not present1543 jQuery.merge( this, jQuery.parseHTML(1544 match[1],1545 context && context.nodeType ? context.ownerDocument || context : document,1546 true1547 ) );1548 // HANDLE: $(html, props)1549 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {1550 for ( match in context ) {1551 // Properties of context are called as methods if possible1552 if ( jQuery.isFunction( this[ match ] ) ) {1553 this[ match ]( context[ match ] );1554 // ...and otherwise set as attributes1555 } else {1556 this.attr( match, context[ match ] );1557 }1558 }1559 }1560 return this;1561 // HANDLE: $(#id)1562 } else {1563 elem = document.getElementById( match[2] );1564 // Check parentNode to catch when Blackberry 4.6 returns1565 // nodes that are no longer in the document #69631566 if ( elem && elem.parentNode ) {1567 // Inject the element directly into the jQuery object1568 this.length = 1;1569 this[0] = elem;1570 }1571 this.context = document;1572 this.selector = selector;1573 return this;1574 }1575 // HANDLE: $(expr, $(...))1576 } else if ( !context || context.jquery ) {1577 return ( context || rootjQuery ).find( selector );1578 // HANDLE: $(expr, context)1579 // (which is just equivalent to: $(context).find(expr)1580 } else {1581 return this.constructor( context ).find( selector );1582 }1583 // HANDLE: $(DOMElement)1584 } else if ( selector.nodeType ) {1585 this.context = this[0] = selector;1586 this.length = 1;1587 return this;1588 // HANDLE: $(function)1589 // Shortcut for document ready1590 } else if ( jQuery.isFunction( selector ) ) {1591 return typeof rootjQuery.ready !== "undefined" ?1592 rootjQuery.ready( selector ) :1593 // Execute immediately if ready is not present1594 selector( jQuery );1595 }1596 if ( selector.selector !== undefined ) {1597 this.selector = selector.selector;1598 this.context = selector.context;1599 }1600 return jQuery.makeArray( selector, this );1601 };1602// Give the init function the jQuery prototype for later instantiation1603init.prototype = jQuery.fn;1604// Initialize central reference1605rootjQuery = jQuery( document );1606var rparentsprev = /^(?:parents|prev(?:Until|All))/,1607 // methods guaranteed to produce a unique set when starting from a unique set1608 guaranteedUnique = {1609 children: true,1610 contents: true,1611 next: true,1612 prev: true1613 };1614jQuery.extend({1615 dir: function( elem, dir, until ) {1616 var matched = [],1617 truncate = until !== undefined;1618 while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {1619 if ( elem.nodeType === 1 ) {1620 if ( truncate && jQuery( elem ).is( until ) ) {1621 break;1622 }1623 matched.push( elem );1624 }1625 }1626 return matched;1627 },1628 sibling: function( n, elem ) {1629 var matched = [];1630 for ( ; n; n = n.nextSibling ) {1631 if ( n.nodeType === 1 && n !== elem ) {1632 matched.push( n );1633 }1634 }1635 return matched;1636 }1637});1638jQuery.fn.extend({1639 has: function( target ) {1640 var targets = jQuery( target, this ),1641 l = targets.length;1642 return this.filter(function() {1643 var i = 0;1644 for ( ; i < l; i++ ) {1645 if ( jQuery.contains( this, targets[i] ) ) {1646 return true;1647 }1648 }1649 });1650 },1651 closest: function( selectors, context ) {1652 var cur,1653 i = 0,1654 l = this.length,1655 matched = [],1656 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?1657 jQuery( selectors, context || this.context ) :1658 0;1659 for ( ; i < l; i++ ) {1660 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {1661 // Always skip document fragments1662 if ( cur.nodeType < 11 && (pos ?1663 pos.index(cur) > -1 :1664 // Don't pass non-elements to Sizzle1665 cur.nodeType === 1 &&1666 jQuery.find.matchesSelector(cur, selectors)) ) {1667 matched.push( cur );1668 break;1669 }1670 }1671 }1672 return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );1673 },1674 // Determine the position of an element within1675 // the matched set of elements1676 index: function( elem ) {1677 // No argument, return index in parent1678 if ( !elem ) {1679 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;1680 }1681 // index in selector1682 if ( typeof elem === "string" ) {1683 return indexOf.call( jQuery( elem ), this[ 0 ] );1684 }1685 // Locate the position of the desired element1686 return indexOf.call( this,1687 // If it receives a jQuery object, the first element is used1688 elem.jquery ? elem[ 0 ] : elem1689 );1690 },1691 add: function( selector, context ) {1692 return this.pushStack(1693 jQuery.unique(1694 jQuery.merge( this.get(), jQuery( selector, context ) )1695 )1696 );1697 },1698 addBack: function( selector ) {1699 return this.add( selector == null ?1700 this.prevObject : this.prevObject.filter(selector)1701 );1702 }1703});1704function sibling( cur, dir ) {1705 while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}1706 return cur;1707}1708jQuery.each({1709 parent: function( elem ) {1710 var parent = elem.parentNode;1711 return parent && parent.nodeType !== 11 ? parent : null;1712 },1713 parents: function( elem ) {1714 return jQuery.dir( elem, "parentNode" );1715 },1716 parentsUntil: function( elem, i, until ) {1717 return jQuery.dir( elem, "parentNode", until );1718 },1719 next: function( elem ) {1720 return sibling( elem, "nextSibling" );1721 },1722 prev: function( elem ) {1723 return sibling( elem, "previousSibling" );1724 },1725 nextAll: function( elem ) {1726 return jQuery.dir( elem, "nextSibling" );1727 },1728 prevAll: function( elem ) {1729 return jQuery.dir( elem, "previousSibling" );1730 },1731 nextUntil: function( elem, i, until ) {1732 return jQuery.dir( elem, "nextSibling", until );1733 },1734 prevUntil: function( elem, i, until ) {1735 return jQuery.dir( elem, "previousSibling", until );1736 },1737 siblings: function( elem ) {1738 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );1739 },1740 children: function( elem ) {1741 return jQuery.sibling( elem.firstChild );1742 },1743 contents: function( elem ) {1744 return elem.contentDocument || jQuery.merge( [], elem.childNodes );1745 }1746}, function( name, fn ) {1747 jQuery.fn[ name ] = function( until, selector ) {1748 var matched = jQuery.map( this, fn, until );1749 if ( name.slice( -5 ) !== "Until" ) {1750 selector = until;1751 }1752 if ( selector && typeof selector === "string" ) {1753 matched = jQuery.filter( selector, matched );1754 }1755 if ( this.length > 1 ) {1756 // Remove duplicates1757 if ( !guaranteedUnique[ name ] ) {1758 jQuery.unique( matched );1759 }1760 // Reverse order for parents* and prev-derivatives1761 if ( rparentsprev.test( name ) ) {1762 matched.reverse();1763 }1764 }1765 return this.pushStack( matched );1766 };1767});1768var rnotwhite = (/\S+/g);1769// String to Object options format cache1770var optionsCache = {};1771// Convert String-formatted options into Object-formatted ones and store in cache1772function createOptions( options ) {1773 var object = optionsCache[ options ] = {};1774 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {1775 object[ flag ] = true;1776 });1777 return object;1778}1779/*1780 * Create a callback list using the following parameters:1781 *1782 * options: an optional list of space-separated options that will change how1783 * the callback list behaves or a more traditional option object1784 *1785 * By default a callback list will act like an event callback list and can be1786 * "fired" multiple times.1787 *1788 * Possible options:1789 *1790 * once: will ensure the callback list can only be fired once (like a Deferred)1791 *1792 * memory: will keep track of previous values and will call any callback added1793 * after the list has been fired right away with the latest "memorized"1794 * values (like a Deferred)1795 *1796 * unique: will ensure a callback can only be added once (no duplicate in the list)1797 *1798 * stopOnFalse: interrupt callings when a callback returns false1799 *1800 */1801jQuery.Callbacks = function( options ) {1802 // Convert options from String-formatted to Object-formatted if needed1803 // (we check in cache first)1804 options = typeof options === "string" ?1805 ( optionsCache[ options ] || createOptions( options ) ) :1806 jQuery.extend( {}, options );1807 var // Last fire value (for non-forgettable lists)1808 memory,1809 // Flag to know if list was already fired1810 fired,1811 // Flag to know if list is currently firing1812 firing,1813 // First callback to fire (used internally by add and fireWith)1814 firingStart,1815 // End of the loop when firing1816 firingLength,1817 // Index of currently firing callback (modified by remove if needed)1818 firingIndex,1819 // Actual callback list1820 list = [],1821 // Stack of fire calls for repeatable lists1822 stack = !options.once && [],1823 // Fire callbacks1824 fire = function( data ) {1825 memory = options.memory && data;1826 fired = true;1827 firingIndex = firingStart || 0;1828 firingStart = 0;1829 firingLength = list.length;1830 firing = true;1831 for ( ; list && firingIndex < firingLength; firingIndex++ ) {1832 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {1833 memory = false; // To prevent further calls using add1834 break;1835 }1836 }1837 firing = false;1838 if ( list ) {1839 if ( stack ) {1840 if ( stack.length ) {1841 fire( stack.shift() );1842 }1843 } else if ( memory ) {1844 list = [];1845 } else {1846 self.disable();1847 }1848 }1849 },1850 // Actual Callbacks object1851 self = {1852 // Add a callback or a collection of callbacks to the list1853 add: function() {1854 if ( list ) {1855 // First, we save the current length1856 var start = list.length;1857 (function add( args ) {1858 jQuery.each( args, function( _, arg ) {1859 var type = jQuery.type( arg );1860 if ( type === "function" ) {1861 if ( !options.unique || !self.has( arg ) ) {1862 list.push( arg );1863 }1864 } else if ( arg && arg.length && type !== "string" ) {1865 // Inspect recursively1866 add( arg );1867 }1868 });1869 })( arguments );1870 // Do we need to add the callbacks to the1871 // current firing batch?1872 if ( firing ) {1873 firingLength = list.length;1874 // With memory, if we're not firing then1875 // we should call right away1876 } else if ( memory ) {1877 firingStart = start;1878 fire( memory );1879 }1880 }1881 return this;1882 },1883 // Remove a callback from the list1884 remove: function() {1885 if ( list ) {1886 jQuery.each( arguments, function( _, arg ) {1887 var index;1888 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {1889 list.splice( index, 1 );1890 // Handle firing indexes1891 if ( firing ) {1892 if ( index <= firinglength="" )="" {="" firinglength--;="" }="" if="" (="" index="" <="firingIndex" firingindex--;="" });="" return="" this;="" },="" check="" a="" given="" callback="" is="" in="" the="" list.="" no="" argument="" given,="" whether="" or="" not="" list="" has="" callbacks="" attached.="" has:="" function(="" fn="" ?="" jquery.inarray(="" fn,=""> -1 : !!( list && list.length );1893 },1894 // Remove all callbacks from the list1895 empty: function() {1896 list = [];1897 firingLength = 0;1898 return this;1899 },1900 // Have the list do nothing anymore1901 disable: function() {1902 list = stack = memory = undefined;1903 return this;1904 },1905 // Is it disabled?1906 disabled: function() {1907 return !list;1908 },1909 // Lock the list in its current state1910 lock: function() {1911 stack = undefined;1912 if ( !memory ) {1913 self.disable();1914 }1915 return this;1916 },1917 // Is it locked?1918 locked: function() {1919 return !stack;1920 },1921 // Call all callbacks with the given context and arguments1922 fireWith: function( context, args ) {1923 if ( list && ( !fired || stack ) ) {1924 args = args || [];1925 args = [ context, args.slice ? args.slice() : args ];1926 if ( firing ) {1927 stack.push( args );1928 } else {1929 fire( args );1930 }1931 }1932 return this;1933 },1934 // Call all the callbacks with the given arguments1935 fire: function() {1936 self.fireWith( this, arguments );1937 return this;1938 },1939 // To know if the callbacks have already been called at least once1940 fired: function() {1941 return !!fired;1942 }1943 };1944 return self;1945};1946jQuery.extend({1947 Deferred: function( func ) {1948 var tuples = [1949 // action, add listener, listener list, final state1950 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],1951 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],1952 [ "notify", "progress", jQuery.Callbacks("memory") ]1953 ],1954 state = "pending",1955 promise = {1956 state: function() {1957 return state;1958 },1959 always: function() {1960 deferred.done( arguments ).fail( arguments );1961 return this;1962 },1963 then: function( /* fnDone, fnFail, fnProgress */ ) {1964 var fns = arguments;1965 return jQuery.Deferred(function( newDefer ) {1966 jQuery.each( tuples, function( i, tuple ) {1967 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];1968 // deferred[ done | fail | progress ] for forwarding actions to newDefer1969 deferred[ tuple[1] ](function() {1970 var returned = fn && fn.apply( this, arguments );1971 if ( returned && jQuery.isFunction( returned.promise ) ) {1972 returned.promise()1973 .done( newDefer.resolve )1974 .fail( newDefer.reject )1975 .progress( newDefer.notify );1976 } else {1977 newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );1978 }1979 });1980 });1981 fns = null;1982 }).promise();1983 },1984 // Get a promise for this deferred1985 // If obj is provided, the promise aspect is added to the object1986 promise: function( obj ) {1987 return obj != null ? jQuery.extend( obj, promise ) : promise;1988 }1989 },1990 deferred = {};1991 // Keep pipe for back-compat1992 promise.pipe = promise.then;1993 // Add list-specific methods1994 jQuery.each( tuples, function( i, tuple ) {1995 var list = tuple[ 2 ],1996 stateString = tuple[ 3 ];1997 // promise[ done | fail | progress ] = list.add1998 promise[ tuple[1] ] = list.add;1999 // Handle state2000 if ( stateString ) {2001 list.add(function() {2002 // state = [ resolved | rejected ]2003 state = stateString;2004 // [ reject_list | resolve_list ].disable; progress_list.lock2005 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );2006 }2007 // deferred[ resolve | reject | notify ]2008 deferred[ tuple[0] ] = function() {2009 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );2010 return this;2011 };2012 deferred[ tuple[0] + "With" ] = list.fireWith;2013 });2014 // Make the deferred a promise2015 promise.promise( deferred );2016 // Call given func if any2017 if ( func ) {2018 func.call( deferred, deferred );2019 }2020 // All done!2021 return deferred;2022 },2023 // Deferred helper2024 when: function( subordinate /* , ..., subordinateN */ ) {2025 var i = 0,2026 resolveValues = slice.call( arguments ),2027 length = resolveValues.length,2028 // the count of uncompleted subordinates2029 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,2030 // the master Deferred. If resolveValues consist of only a single Deferred, just use that.2031 deferred = remaining === 1 ? subordinate : jQuery.Deferred(),2032 // Update function for both resolve and progress values2033 updateFunc = function( i, contexts, values ) {2034 return function( value ) {2035 contexts[ i ] = this;2036 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;2037 if ( values === progressValues ) {2038 deferred.notifyWith( contexts, values );2039 } else if ( !( --remaining ) ) {2040 deferred.resolveWith( contexts, values );2041 }2042 };2043 },2044 progressValues, progressContexts, resolveContexts;2045 // add listeners to Deferred subordinates; treat others as resolved2046 if ( length > 1 ) {2047 progressValues = new Array( length );2048 progressContexts = new Array( length );2049 resolveContexts = new Array( length );2050 for ( ; i < length; i++ ) {2051 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {2052 resolveValues[ i ].promise()2053 .done( updateFunc( i, resolveContexts, resolveValues ) )2054 .fail( deferred.reject )2055 .progress( updateFunc( i, progressContexts, progressValues ) );2056 } else {2057 --remaining;2058 }2059 }2060 }2061 // if we're not waiting on anything, resolve the master2062 if ( !remaining ) {2063 deferred.resolveWith( resolveContexts, resolveValues );2064 }2065 return deferred.promise();2066 }2067});2068// The deferred used on DOM ready2069var readyList;2070jQuery.fn.ready = function( fn ) {2071 // Add the callback2072 jQuery.ready.promise().done( fn );2073 return this;2074};2075jQuery.extend({2076 // Is the DOM ready to be used? Set to true once it occurs.2077 isReady: false,2078 // A counter to track how many items to wait for before2079 // the ready event fires. See #67812080 readyWait: 1,2081 // Hold (or release) the ready event2082 holdReady: function( hold ) {2083 if ( hold ) {2084 jQuery.readyWait++;2085 } else {2086 jQuery.ready( true );2087 }2088 },2089 // Handle when the DOM is ready2090 ready: function( wait ) {2091 // Abort if there are pending holds or we're already ready2092 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {2093 return;2094 }2095 // Remember that the DOM is ready2096 jQuery.isReady = true;2097 // If a normal DOM Ready event fired, decrement, and wait if need be2098 if ( wait !== true && --jQuery.readyWait > 0 ) {2099 return;2100 }2101 // If there are functions bound, to execute2102 readyList.resolveWith( document, [ jQuery ] );2103 // Trigger any bound ready events2104 if ( jQuery.fn.trigger ) {2105 jQuery( document ).trigger("ready").off("ready");2106 }2107 }2108});2109/**2110 * The ready event handler and self cleanup method2111 */2112function completed() {2113 document.removeEventListener( "DOMContentLoaded", completed, false );2114 window.removeEventListener( "load", completed, false );2115 jQuery.ready();2116}2117jQuery.ready.promise = function( obj ) {2118 if ( !readyList ) {2119 readyList = jQuery.Deferred();2120 // Catch cases where $(document).ready() is called after the browser event has already occurred.2121 // we once tried to use readyState "interactive" here, but it caused issues like the one2122 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:152123 if ( document.readyState === "complete" ) {2124 // Handle it asynchronously to allow scripts the opportunity to delay ready2125 setTimeout( jQuery.ready );2126 } else {2127 // Use the handy event callback2128 document.addEventListener( "DOMContentLoaded", completed, false );2129 // A fallback to window.onload, that will always work2130 window.addEventListener( "load", completed, false );2131 }2132 }2133 return readyList.promise( obj );2134};2135// Kick off the DOM ready check even if the user does not2136jQuery.ready.promise();2137// Multifunctional method to get and set values of a collection2138// The value/s can optionally be executed if it's a function2139var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {2140 var i = 0,2141 len = elems.length,2142 bulk = key == null;2143 // Sets many values2144 if ( jQuery.type( key ) === "object" ) {2145 chainable = true;2146 for ( i in key ) {2147 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );2148 }2149 // Sets one value2150 } else if ( value !== undefined ) {2151 chainable = true;2152 if ( !jQuery.isFunction( value ) ) {2153 raw = true;2154 }2155 if ( bulk ) {2156 // Bulk operations run against the entire set2157 if ( raw ) {2158 fn.call( elems, value );2159 fn = null;2160 // ...except when executing function values2161 } else {2162 bulk = fn;2163 fn = function( elem, key, value ) {2164 return bulk.call( jQuery( elem ), value );2165 };2166 }2167 }2168 if ( fn ) {2169 for ( ; i < len; i++ ) {2170 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );2171 }2172 }2173 }2174 return chainable ?2175 elems :2176 // Gets2177 bulk ?2178 fn.call( elems ) :2179 len ? fn( elems[0], key ) : emptyGet;2180};2181/**2182 * Determines whether an object can have data2183 */2184jQuery.acceptData = function( owner ) {2185 // Accepts only:2186 // - Node2187 // - Node.ELEMENT_NODE2188 // - Node.DOCUMENT_NODE2189 // - Object2190 // - Any2191 /* jshint -W018 */2192 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );2193};2194function Data() {2195 // Support: Android < 4,2196 // Old WebKit does not have Object.preventExtensions/freeze method,2197 // return new empty object instead with no [[set]] accessor2198 Object.defineProperty( this.cache = {}, 0, {2199 get: function() {2200 return {};2201 }2202 });2203 this.expando = jQuery.expando + Math.random();2204}2205Data.uid = 1;2206Data.accepts = jQuery.acceptData;2207Data.prototype = {2208 key: function( owner ) {2209 // We can accept data for non-element nodes in modern browsers,2210 // but we should not, see #8335.2211 // Always return the key for a frozen object.2212 if ( !Data.accepts( owner ) ) {2213 return 0;2214 }2215 var descriptor = {},2216 // Check if the owner object already has a cache key2217 unlock = owner[ this.expando ];2218 // If not, create one2219 if ( !unlock ) {2220 unlock = Data.uid++;2221 // Secure it in a non-enumerable, non-writable property2222 try {2223 descriptor[ this.expando ] = { value: unlock };2224 Object.defineProperties( owner, descriptor );2225 // Support: Android < 42226 // Fallback to a less secure definition2227 } catch ( e ) {2228 descriptor[ this.expando ] = unlock;2229 jQuery.extend( owner, descriptor );2230 }2231 }2232 // Ensure the cache object2233 if ( !this.cache[ unlock ] ) {2234 this.cache[ unlock ] = {};2235 }2236 return unlock;2237 },2238 set: function( owner, data, value ) {2239 var prop,2240 // There may be an unlock assigned to this node,2241 // if there is no entry for this "owner", create one inline2242 // and set the unlock as though an owner entry had always existed2243 unlock = this.key( owner ),2244 cache = this.cache[ unlock ];2245 // Handle: [ owner, key, value ] args2246 if ( typeof data === "string" ) {2247 cache[ data ] = value;2248 // Handle: [ owner, { properties } ] args2249 } else {2250 // Fresh assignments by object are shallow copied2251 if ( jQuery.isEmptyObject( cache ) ) {2252 jQuery.extend( this.cache[ unlock ], data );2253 // Otherwise, copy the properties one-by-one to the cache object2254 } else {2255 for ( prop in data ) {2256 cache[ prop ] = data[ prop ];2257 }2258 }2259 }2260 return cache;2261 },2262 get: function( owner, key ) {2263 // Either a valid cache is found, or will be created.2264 // New caches will be created and the unlock returned,2265 // allowing direct access to the newly created2266 // empty data object. A valid owner object must be provided.2267 var cache = this.cache[ this.key( owner ) ];2268 return key === undefined ?2269 cache : cache[ key ];2270 },2271 access: function( owner, key, value ) {2272 var stored;2273 // In cases where either:2274 //2275 // 1. No key was specified2276 // 2. A string key was specified, but no value provided2277 //2278 // Take the "read" path and allow the get method to determine2279 // which value to return, respectively either:2280 //2281 // 1. The entire cache object2282 // 2. The data stored at the key2283 //2284 if ( key === undefined ||2285 ((key && typeof key === "string") && value === undefined) ) {2286 stored = this.get( owner, key );2287 return stored !== undefined ?2288 stored : this.get( owner, jQuery.camelCase(key) );2289 }2290 // [*]When the key is not a string, or both a key and value2291 // are specified, set or extend (existing objects) with either:2292 //2293 // 1. An object of properties2294 // 2. A key and value2295 //2296 this.set( owner, key, value );2297 // Since the "set" path can have two possible entry points2298 // return the expected data based on which path was taken[*]2299 return value !== undefined ? value : key;2300 },2301 remove: function( owner, key ) {2302 var i, name, camel,2303 unlock = this.key( owner ),2304 cache = this.cache[ unlock ];2305 if ( key === undefined ) {2306 this.cache[ unlock ] = {};2307 } else {2308 // Support array or space separated string of keys2309 if ( jQuery.isArray( key ) ) {2310 // If "name" is an array of keys...2311 // When data is initially created, via ("key", "val") signature,2312 // keys will be converted to camelCase.2313 // Since there is no way to tell _how_ a key was added, remove2314 // both plain key and camelCase key. #127862315 // This will only penalize the array argument path.2316 name = key.concat( key.map( jQuery.camelCase ) );2317 } else {2318 camel = jQuery.camelCase( key );2319 // Try the string as a key before any manipulation2320 if ( key in cache ) {2321 name = [ key, camel ];2322 } else {2323 // If a key with the spaces exists, use it.2324 // Otherwise, create an array by matching non-whitespace2325 name = camel;2326 name = name in cache ?2327 [ name ] : ( name.match( rnotwhite ) || [] );2328 }2329 }2330 i = name.length;2331 while ( i-- ) {2332 delete cache[ name[ i ] ];2333 }2334 }2335 },2336 hasData: function( owner ) {2337 return !jQuery.isEmptyObject(2338 this.cache[ owner[ this.expando ] ] || {}2339 );2340 },2341 discard: function( owner ) {2342 if ( owner[ this.expando ] ) {2343 delete this.cache[ owner[ this.expando ] ];2344 }2345 }2346};2347var data_priv = new Data();2348var data_user = new Data();2349/*2350 Implementation Summary2351 1. Enforce API surface and semantic compatibility with 1.9.x branch2352 2. Improve the module's maintainability by reducing the storage2353 paths to a single mechanism.2354 3. Use the same single mechanism to support "private" and "user" data.2355 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)2356 5. Avoid exposing implementation details on user objects (eg. expando properties)2357 6. Provide a clear path for implementation upgrade to WeakMap in 20142358*/2359var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,2360 rmultiDash = /([A-Z])/g;2361function dataAttr( elem, key, data ) {2362 var name;2363 // If nothing was found internally, try to fetch any2364 // data from the HTML5 data-* attribute2365 if ( data === undefined && elem.nodeType === 1 ) {2366 name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();2367 data = elem.getAttribute( name );2368 if ( typeof data === "string" ) {2369 try {2370 data = data === "true" ? true :2371 data === "false" ? false :2372 data === "null" ? null :2373 // Only convert to a number if it doesn't change the string2374 +data + "" === data ? +data :2375 rbrace.test( data ) ? jQuery.parseJSON( data ) :2376 data;2377 } catch( e ) {}2378 // Make sure we set the data so it isn't changed later2379 data_user.set( elem, key, data );2380 } else {2381 data = undefined;2382 }2383 }2384 return data;2385}2386jQuery.extend({2387 hasData: function( elem ) {2388 return data_user.hasData( elem ) || data_priv.hasData( elem );2389 },2390 data: function( elem, name, data ) {2391 return data_user.access( elem, name, data );2392 },2393 removeData: function( elem, name ) {2394 data_user.remove( elem, name );2395 },2396 // TODO: Now that all calls to _data and _removeData have been replaced2397 // with direct calls to data_priv methods, these can be deprecated.2398 _data: function( elem, name, data ) {2399 return data_priv.access( elem, name, data );2400 },2401 _removeData: function( elem, name ) {2402 data_priv.remove( elem, name );2403 }2404});2405jQuery.fn.extend({2406 data: function( key, value ) {2407 var i, name, data,2408 elem = this[ 0 ],2409 attrs = elem && elem.attributes;2410 // Gets all values2411 if ( key === undefined ) {2412 if ( this.length ) {2413 data = data_user.get( elem );2414 if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {2415 i = attrs.length;2416 while ( i-- ) {2417 name = attrs[ i ].name;2418 if ( name.indexOf( "data-" ) === 0 ) {2419 name = jQuery.camelCase( name.slice(5) );2420 dataAttr( elem, name, data[ name ] );2421 }2422 }2423 data_priv.set( elem, "hasDataAttrs", true );2424 }2425 }2426 return data;2427 }2428 // Sets multiple values2429 if ( typeof key === "object" ) {2430 return this.each(function() {2431 data_user.set( this, key );2432 });2433 }2434 return access( this, function( value ) {2435 var data,2436 camelKey = jQuery.camelCase( key );2437 // The calling jQuery object (element matches) is not empty2438 // (and therefore has an element appears at this[ 0 ]) and the2439 // `value` parameter was not undefined. An empty jQuery object2440 // will result in `undefined` for elem = this[ 0 ] which will2441 // throw an exception if an attempt to read a data cache is made.2442 if ( elem && value === undefined ) {2443 // Attempt to get data from the cache2444 // with the key as-is2445 data = data_user.get( elem, key );2446 if ( data !== undefined ) {2447 return data;2448 }2449 // Attempt to get data from the cache2450 // with the key camelized2451 data = data_user.get( elem, camelKey );2452 if ( data !== undefined ) {2453 return data;2454 }2455 // Attempt to "discover" the data in2456 // HTML5 custom data-* attrs2457 data = dataAttr( elem, camelKey, undefined );2458 if ( data !== undefined ) {2459 return data;2460 }2461 // We tried really hard, but the data doesn't exist.2462 return;2463 }2464 // Set the data...2465 this.each(function() {2466 // First, attempt to store a copy or reference of any2467 // data that might've been store with a camelCased key.2468 var data = data_user.get( this, camelKey );2469 // For HTML5 data-* attribute interop, we have to2470 // store property names with dashes in a camelCase form.2471 // This might not apply to all properties...*2472 data_user.set( this, camelKey, value );2473 // *... In the case of properties that might _actually_2474 // have dashes, we need to also store a copy of that2475 // unchanged property.2476 if ( key.indexOf("-") !== -1 && data !== undefined ) {2477 data_user.set( this, key, value );2478 }2479 });2480 }, null, value, arguments.length > 1, null, true );2481 },2482 removeData: function( key ) {2483 return this.each(function() {2484 data_user.remove( this, key );2485 });2486 }2487});2488jQuery.extend({2489 queue: function( elem, type, data ) {2490 var queue;2491 if ( elem ) {2492 type = ( type || "fx" ) + "queue";2493 queue = data_priv.get( elem, type );2494 // Speed up dequeue by getting out quickly if this is just a lookup2495 if ( data ) {2496 if ( !queue || jQuery.isArray( data ) ) {2497 queue = data_priv.access( elem, type, jQuery.makeArray(data) );2498 } else {2499 queue.push( data );2500 }2501 }2502 return queue || [];2503 }2504 },2505 dequeue: function( elem, type ) {2506 type = type || "fx";2507 var queue = jQuery.queue( elem, type ),2508 startLength = queue.length,2509 fn = queue.shift(),2510 hooks = jQuery._queueHooks( elem, type ),2511 next = function() {2512 jQuery.dequeue( elem, type );2513 };2514 // If the fx queue is dequeued, always remove the progress sentinel2515 if ( fn === "inprogress" ) {2516 fn = queue.shift();2517 startLength--;2518 }2519 if ( fn ) {2520 // Add a progress sentinel to prevent the fx queue from being2521 // automatically dequeued2522 if ( type === "fx" ) {2523 queue.unshift( "inprogress" );2524 }2525 // clear up the last queue stop function2526 delete hooks.stop;2527 fn.call( elem, next, hooks );2528 }2529 if ( !startLength && hooks ) {2530 hooks.empty.fire();2531 }2532 },2533 // not intended for public consumption - generates a queueHooks object, or returns the current one2534 _queueHooks: function( elem, type ) {2535 var key = type + "queueHooks";2536 return data_priv.get( elem, key ) || data_priv.access( elem, key, {2537 empty: jQuery.Callbacks("once memory").add(function() {2538 data_priv.remove( elem, [ type + "queue", key ] );2539 })2540 });2541 }2542});2543jQuery.fn.extend({2544 queue: function( type, data ) {2545 var setter = 2;2546 if ( typeof type !== "string" ) {2547 data = type;2548 type = "fx";2549 setter--;2550 }2551 if ( arguments.length < setter ) {2552 return jQuery.queue( this[0], type );2553 }2554 return data === undefined ?2555 this :2556 this.each(function() {2557 var queue = jQuery.queue( this, type, data );2558 // ensure a hooks for this queue2559 jQuery._queueHooks( this, type );2560 if ( type === "fx" && queue[0] !== "inprogress" ) {2561 jQuery.dequeue( this, type );2562 }2563 });2564 },2565 dequeue: function( type ) {2566 return this.each(function() {2567 jQuery.dequeue( this, type );2568 });2569 },2570 clearQueue: function( type ) {2571 return this.queue( type || "fx", [] );2572 },2573 // Get a promise resolved when queues of a certain type2574 // are emptied (fx is the type by default)2575 promise: function( type, obj ) {2576 var tmp,2577 count = 1,2578 defer = jQuery.Deferred(),2579 elements = this,2580 i = this.length,2581 resolve = function() {2582 if ( !( --count ) ) {2583 defer.resolveWith( elements, [ elements ] );2584 }2585 };2586 if ( typeof type !== "string" ) {2587 obj = type;2588 type = undefined;2589 }2590 type = type || "fx";2591 while ( i-- ) {2592 tmp = data_priv.get( elements[ i ], type + "queueHooks" );2593 if ( tmp && tmp.empty ) {2594 count++;2595 tmp.empty.add( resolve );2596 }2597 }2598 resolve();2599 return defer.promise( obj );2600 }2601});2602var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;2603var cssExpand = [ "Top", "Right", "Bottom", "Left" ];2604var isHidden = function( elem, el ) {2605 // isHidden might be called from jQuery#filter function;2606 // in that case, element will be second argument2607 elem = el || elem;2608 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );2609 };2610var rcheckableType = (/^(?:checkbox|radio)$/i);2611(function() {2612 var fragment = document.createDocumentFragment(),2613 div = fragment.appendChild( document.createElement( "div" ) );2614 // #11217 - WebKit loses check when the name is after the checked attribute2615 div.innerHTML = "<input type="radio" checked="checked" name="t">";2616 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.32617 // old WebKit doesn't clone checked state correctly in fragments2618 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;2619 // Make sure textarea (and checkbox) defaultValue is properly cloned2620 // Support: IE9-IE11+2621 div.innerHTML = "<textarea>x</textarea>";2622 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;2623})();2624var strundefined = typeof undefined;2625support.focusinBubbles = "onfocusin" in window;2626var2627 rkeyEvent = /^key/,2628 rmouseEvent = /^(?:mouse|contextmenu)|click/,2629 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,2630 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;2631function returnTrue() {2632 return true;2633}2634function returnFalse() {2635 return false;2636}2637function safeActiveElement() {2638 try {2639 return document.activeElement;2640 } catch ( err ) { }2641}2642/*2643 * Helper functions for managing events -- not part of the public interface.2644 * Props to Dean Edwards' addEvent library for many of the ideas.2645 */2646jQuery.event = {2647 global: {},2648 add: function( elem, types, handler, data, selector ) {2649 var handleObjIn, eventHandle, tmp,2650 events, t, handleObj,2651 special, handlers, type, namespaces, origType,2652 elemData = data_priv.get( elem );2653 // Don't attach events to noData or text/comment nodes (but allow plain objects)2654 if ( !elemData ) {2655 return;2656 }2657 // Caller can pass in an object of custom data in lieu of the handler2658 if ( handler.handler ) {2659 handleObjIn = handler;2660 handler = handleObjIn.handler;2661 selector = handleObjIn.selector;2662 }2663 // Make sure that the handler has a unique ID, used to find/remove it later2664 if ( !handler.guid ) {2665 handler.guid = jQuery.guid++;2666 }2667 // Init the element's event structure and main handler, if this is the first2668 if ( !(events = elemData.events) ) {2669 events = elemData.events = {};2670 }2671 if ( !(eventHandle = elemData.handle) ) {2672 eventHandle = elemData.handle = function( e ) {2673 // Discard the second event of a jQuery.event.trigger() and2674 // when an event is called after a page has unloaded2675 return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?2676 jQuery.event.dispatch.apply( elem, arguments ) : undefined;2677 };2678 }2679 // Handle multiple events separated by a space2680 types = ( types || "" ).match( rnotwhite ) || [ "" ];2681 t = types.length;2682 while ( t-- ) {2683 tmp = rtypenamespace.exec( types[t] ) || [];2684 type = origType = tmp[1];2685 namespaces = ( tmp[2] || "" ).split( "." ).sort();2686 // There *must* be a type, no attaching namespace-only handlers2687 if ( !type ) {2688 continue;2689 }2690 // If event changes its type, use the special event handlers for the changed type2691 special = jQuery.event.special[ type ] || {};2692 // If selector defined, determine special event api type, otherwise given type2693 type = ( selector ? special.delegateType : special.bindType ) || type;2694 // Update special based on newly reset type2695 special = jQuery.event.special[ type ] || {};2696 // handleObj is passed to all event handlers2697 handleObj = jQuery.extend({2698 type: type,2699 origType: origType,2700 data: data,2701 handler: handler,2702 guid: handler.guid,2703 selector: selector,2704 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),2705 namespace: namespaces.join(".")2706 }, handleObjIn );2707 // Init the event handler queue if we're the first2708 if ( !(handlers = events[ type ]) ) {2709 handlers = events[ type ] = [];2710 handlers.delegateCount = 0;2711 // Only use addEventListener if the special events handler returns false2712 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {2713 if ( elem.addEventListener ) {2714 elem.addEventListener( type, eventHandle, false );2715 }2716 }2717 }2718 if ( special.add ) {2719 special.add.call( elem, handleObj );2720 if ( !handleObj.handler.guid ) {2721 handleObj.handler.guid = handler.guid;2722 }2723 }2724 // Add to the element's handler list, delegates in front2725 if ( selector ) {2726 handlers.splice( handlers.delegateCount++, 0, handleObj );2727 } else {2728 handlers.push( handleObj );2729 }2730 // Keep track of which events have ever been used, for event optimization2731 jQuery.event.global[ type ] = true;2732 }2733 },2734 // Detach an event or set of events from an element2735 remove: function( elem, types, handler, selector, mappedTypes ) {2736 var j, origCount, tmp,2737 events, t, handleObj,2738 special, handlers, type, namespaces, origType,2739 elemData = data_priv.hasData( elem ) && data_priv.get( elem );2740 if ( !elemData || !(events = elemData.events) ) {2741 return;2742 }2743 // Once for each type.namespace in types; type may be omitted2744 types = ( types || "" ).match( rnotwhite ) || [ "" ];2745 t = types.length;2746 while ( t-- ) {2747 tmp = rtypenamespace.exec( types[t] ) || [];2748 type = origType = tmp[1];2749 namespaces = ( tmp[2] || "" ).split( "." ).sort();2750 // Unbind all events (on this namespace, if provided) for the element2751 if ( !type ) {2752 for ( type in events ) {2753 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );2754 }2755 continue;2756 }2757 special = jQuery.event.special[ type ] || {};2758 type = ( selector ? special.delegateType : special.bindType ) || type;2759 handlers = events[ type ] || [];2760 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );2761 // Remove matching events2762 origCount = j = handlers.length;2763 while ( j-- ) {2764 handleObj = handlers[ j ];2765 if ( ( mappedTypes || origType === handleObj.origType ) &&2766 ( !handler || handler.guid === handleObj.guid ) &&2767 ( !tmp || tmp.test( handleObj.namespace ) ) &&2768 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {2769 handlers.splice( j, 1 );2770 if ( handleObj.selector ) {2771 handlers.delegateCount--;2772 }2773 if ( special.remove ) {2774 special.remove.call( elem, handleObj );2775 }2776 }2777 }2778 // Remove generic event handler if we removed something and no more handlers exist2779 // (avoids potential for endless recursion during removal of special event handlers)2780 if ( origCount && !handlers.length ) {2781 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {2782 jQuery.removeEvent( elem, type, elemData.handle );2783 }2784 delete events[ type ];2785 }2786 }2787 // Remove the expando if it's no longer used2788 if ( jQuery.isEmptyObject( events ) ) {2789 delete elemData.handle;2790 data_priv.remove( elem, "events" );2791 }2792 },2793 trigger: function( event, data, elem, onlyHandlers ) {2794 var i, cur, tmp, bubbleType, ontype, handle, special,2795 eventPath = [ elem || document ],2796 type = hasOwn.call( event, "type" ) ? event.type : event,2797 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];2798 cur = tmp = elem = elem || document;2799 // Don't do events on text and comment nodes2800 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {2801 return;2802 }2803 // focus/blur morphs to focusin/out; ensure we're not firing them right now2804 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {2805 return;2806 }2807 if ( type.indexOf(".") >= 0 ) {2808 // Namespaced trigger; create a regexp to match event type in handle()2809 namespaces = type.split(".");2810 type = namespaces.shift();2811 namespaces.sort();2812 }2813 ontype = type.indexOf(":") < 0 && "on" + type;2814 // Caller can pass in a jQuery.Event object, Object, or just an event type string2815 event = event[ jQuery.expando ] ?2816 event :2817 new jQuery.Event( type, typeof event === "object" && event );2818 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)2819 event.isTrigger = onlyHandlers ? 2 : 3;2820 event.namespace = namespaces.join(".");2821 event.namespace_re = event.namespace ?2822 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :2823 null;2824 // Clean up the event in case it is being reused2825 event.result = undefined;2826 if ( !event.target ) {2827 event.target = elem;2828 }2829 // Clone any incoming data and prepend the event, creating the handler arg list2830 data = data == null ?2831 [ event ] :2832 jQuery.makeArray( data, [ event ] );2833 // Allow special events to draw outside the lines2834 special = jQuery.event.special[ type ] || {};2835 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {2836 return;2837 }2838 // Determine event propagation path in advance, per W3C events spec (#9951)2839 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)2840 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {2841 bubbleType = special.delegateType || type;2842 if ( !rfocusMorph.test( bubbleType + type ) ) {2843 cur = cur.parentNode;2844 }2845 for ( ; cur; cur = cur.parentNode ) {2846 eventPath.push( cur );2847 tmp = cur;2848 }2849 // Only add window if we got to document (e.g., not plain obj or detached DOM)2850 if ( tmp === (elem.ownerDocument || document) ) {2851 eventPath.push( tmp.defaultView || tmp.parentWindow || window );2852 }2853 }2854 // Fire handlers on the event path2855 i = 0;2856 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {2857 event.type = i > 1 ?2858 bubbleType :2859 special.bindType || type;2860 // jQuery handler2861 handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );2862 if ( handle ) {2863 handle.apply( cur, data );2864 }2865 // Native handler2866 handle = ontype && cur[ ontype ];2867 if ( handle && handle.apply && jQuery.acceptData( cur ) ) {2868 event.result = handle.apply( cur, data );2869 if ( event.result === false ) {2870 event.preventDefault();2871 }2872 }2873 }2874 event.type = type;2875 // If nobody prevented the default action, do it now2876 if ( !onlyHandlers && !event.isDefaultPrevented() ) {2877 if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&2878 jQuery.acceptData( elem ) ) {2879 // Call a native DOM method on the target with the same name name as the event.2880 // Don't do default actions on window, that's where global variables be (#6170)2881 if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {2882 // Don't re-trigger an onFOO event when we call its FOO() method2883 tmp = elem[ ontype ];2884 if ( tmp ) {2885 elem[ ontype ] = null;2886 }2887 // Prevent re-triggering of the same event, since we already bubbled it above2888 jQuery.event.triggered = type;2889 elem[ type ]();2890 jQuery.event.triggered = undefined;2891 if ( tmp ) {2892 elem[ ontype ] = tmp;2893 }2894 }2895 }2896 }2897 return event.result;2898 },2899 dispatch: function( event ) {2900 // Make a writable jQuery.Event from the native event object2901 event = jQuery.event.fix( event );2902 var i, j, ret, matched, handleObj,2903 handlerQueue = [],2904 args = slice.call( arguments ),2905 handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],2906 special = jQuery.event.special[ event.type ] || {};2907 // Use the fix-ed jQuery.Event rather than the (read-only) native event2908 args[0] = event;2909 event.delegateTarget = this;2910 // Call the preDispatch hook for the mapped type, and let it bail if desired2911 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {2912 return;2913 }2914 // Determine handlers2915 handlerQueue = jQuery.event.handlers.call( this, event, handlers );2916 // Run delegates first; they may want to stop propagation beneath us2917 i = 0;2918 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {2919 event.currentTarget = matched.elem;2920 j = 0;2921 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {2922 // Triggered event must either 1) have no namespace, or2923 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).2924 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {2925 event.handleObj = handleObj;2926 event.data = handleObj.data;2927 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )2928 .apply( matched.elem, args );2929 if ( ret !== undefined ) {2930 if ( (event.result = ret) === false ) {2931 event.preventDefault();2932 event.stopPropagation();2933 }2934 }2935 }2936 }2937 }2938 // Call the postDispatch hook for the mapped type2939 if ( special.postDispatch ) {2940 special.postDispatch.call( this, event );2941 }2942 return event.result;2943 },2944 handlers: function( event, handlers ) {2945 var i, matches, sel, handleObj,2946 handlerQueue = [],2947 delegateCount = handlers.delegateCount,2948 cur = event.target;2949 // Find delegate handlers2950 // Black-hole SVG <use></use> instance trees (#13180)2951 // Avoid non-left-click bubbling in Firefox (#3861)2952 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {2953 for ( ; cur !== this; cur = cur.parentNode || this ) {2954 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)2955 if ( cur.disabled !== true || event.type !== "click" ) {2956 matches = [];2957 for ( i = 0; i < delegateCount; i++ ) {2958 handleObj = handlers[ i ];2959 // Don't conflict with Object.prototype properties (#13203)2960 sel = handleObj.selector + " ";2961 if ( matches[ sel ] === undefined ) {2962 matches[ sel ] = handleObj.needsContext ?2963 jQuery( sel, this ).index( cur ) >= 0 :2964 jQuery.find( sel, this, null, [ cur ] ).length;2965 }2966 if ( matches[ sel ] ) {2967 matches.push( handleObj );2968 }2969 }2970 if ( matches.length ) {2971 handlerQueue.push({ elem: cur, handlers: matches });2972 }2973 }2974 }2975 }2976 // Add the remaining (directly-bound) handlers2977 if ( delegateCount < handlers.length ) {2978 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });2979 }2980 return handlerQueue;2981 },2982 // Includes some event props shared by KeyEvent and MouseEvent2983 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),2984 fixHooks: {},2985 keyHooks: {2986 props: "char charCode key keyCode".split(" "),2987 filter: function( event, original ) {2988 // Add which for key events2989 if ( event.which == null ) {2990 event.which = original.charCode != null ? original.charCode : original.keyCode;2991 }2992 return event;2993 }2994 },2995 mouseHooks: {2996 props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),2997 filter: function( event, original ) {2998 var eventDoc, doc, body,2999 button = original.button;3000 // Calculate pageX/Y if missing and clientX/Y available3001 if ( event.pageX == null && original.clientX != null ) {3002 eventDoc = event.target.ownerDocument || document;3003 doc = eventDoc.documentElement;3004 body = eventDoc.body;3005 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );3006 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );3007 }3008 // Add which for click: 1 === left; 2 === middle; 3 === right3009 // Note: button is not normalized, so don't use it3010 if ( !event.which && button !== undefined ) {3011 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );3012 }3013 return event;3014 }3015 },3016 fix: function( event ) {3017 if ( event[ jQuery.expando ] ) {3018 return event;3019 }3020 // Create a writable copy of the event object and normalize some properties3021 var i, prop, copy,3022 type = event.type,3023 originalEvent = event,3024 fixHook = this.fixHooks[ type ];3025 if ( !fixHook ) {3026 this.fixHooks[ type ] = fixHook =3027 rmouseEvent.test( type ) ? this.mouseHooks :3028 rkeyEvent.test( type ) ? this.keyHooks :3029 {};3030 }3031 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;3032 event = new jQuery.Event( originalEvent );3033 i = copy.length;3034 while ( i-- ) {3035 prop = copy[ i ];3036 event[ prop ] = originalEvent[ prop ];3037 }3038 // Support: Cordova 2.5 (WebKit) (#13255)3039 // All events should have a target; Cordova deviceready doesn't3040 if ( !event.target ) {3041 event.target = document;3042 }3043 // Support: Safari 6.0+, Chrome < 283044 // Target should not be a text node (#504, #13143)3045 if ( event.target.nodeType === 3 ) {3046 event.target = event.target.parentNode;3047 }3048 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;3049 },3050 special: {3051 load: {3052 // Prevent triggered image.load events from bubbling to window.load3053 noBubble: true3054 },3055 focus: {3056 // Fire native event if possible so blur/focus sequence is correct3057 trigger: function() {3058 if ( this !== safeActiveElement() && this.focus ) {3059 this.focus();3060 return false;3061 }3062 },3063 delegateType: "focusin"3064 },3065 blur: {3066 trigger: function() {3067 if ( this === safeActiveElement() && this.blur ) {3068 this.blur();3069 return false;3070 }3071 },3072 delegateType: "focusout"3073 },3074 click: {3075 // For checkbox, fire native event so checked state will be right3076 trigger: function() {3077 if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {3078 this.click();3079 return false;3080 }3081 },3082 // For cross-browser consistency, don't fire native .click() on links3083 _default: function( event ) {3084 return jQuery.nodeName( event.target, "a" );3085 }3086 },3087 beforeunload: {3088 postDispatch: function( event ) {3089 // Support: Firefox 20+3090 // Firefox doesn't alert if the returnValue field is not set.3091 if ( event.result !== undefined ) {3092 event.originalEvent.returnValue = event.result;3093 }3094 }3095 }3096 },3097 simulate: function( type, elem, event, bubble ) {3098 // Piggyback on a donor event to simulate a different one.3099 // Fake originalEvent to avoid donor's stopPropagation, but if the3100 // simulated event prevents default then we do the same on the donor.3101 var e = jQuery.extend(3102 new jQuery.Event(),3103 event,3104 {3105 type: type,3106 isSimulated: true,3107 originalEvent: {}3108 }3109 );3110 if ( bubble ) {3111 jQuery.event.trigger( e, null, elem );3112 } else {3113 jQuery.event.dispatch.call( elem, e );3114 }3115 if ( e.isDefaultPrevented() ) {3116 event.preventDefault();3117 }3118 }3119};3120jQuery.removeEvent = function( elem, type, handle ) {3121 if ( elem.removeEventListener ) {3122 elem.removeEventListener( type, handle, false );3123 }3124};3125jQuery.Event = function( src, props ) {3126 // Allow instantiation without the 'new' keyword3127 if ( !(this instanceof jQuery.Event) ) {3128 return new jQuery.Event( src, props );3129 }3130 // Event object3131 if ( src && src.type ) {3132 this.originalEvent = src;3133 this.type = src.type;3134 // Events bubbling up the document may have been marked as prevented3135 // by a handler lower down the tree; reflect the correct value.3136 this.isDefaultPrevented = src.defaultPrevented ||3137 // Support: Android < 4.03138 src.defaultPrevented === undefined &&3139 src.getPreventDefault && src.getPreventDefault() ?3140 returnTrue :3141 returnFalse;3142 // Event type3143 } else {3144 this.type = src;3145 }3146 // Put explicitly provided properties onto the event object3147 if ( props ) {3148 jQuery.extend( this, props );3149 }3150 // Create a timestamp if incoming event doesn't have one3151 this.timeStamp = src && src.timeStamp || jQuery.now();3152 // Mark it as fixed3153 this[ jQuery.expando ] = true;3154};3155// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding3156// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html3157jQuery.Event.prototype = {3158 isDefaultPrevented: returnFalse,3159 isPropagationStopped: returnFalse,3160 isImmediatePropagationStopped: returnFalse,3161 preventDefault: function() {3162 var e = this.originalEvent;3163 this.isDefaultPrevented = returnTrue;3164 if ( e && e.preventDefault ) {3165 e.preventDefault();3166 }3167 },3168 stopPropagation: function() {3169 var e = this.originalEvent;3170 this.isPropagationStopped = returnTrue;3171 if ( e && e.stopPropagation ) {3172 e.stopPropagation();3173 }3174 },3175 stopImmediatePropagation: function() {3176 this.isImmediatePropagationStopped = returnTrue;3177 this.stopPropagation();3178 }3179};3180// Create mouseenter/leave events using mouseover/out and event-time checks3181// Support: Chrome 15+3182jQuery.each({3183 mouseenter: "mouseover",3184 mouseleave: "mouseout"3185}, function( orig, fix ) {3186 jQuery.event.special[ orig ] = {3187 delegateType: fix,3188 bindType: fix,3189 handle: function( event ) {3190 var ret,3191 target = this,3192 related = event.relatedTarget,3193 handleObj = event.handleObj;3194 // For mousenter/leave call the handler if related is outside the target.3195 // NB: No relatedTarget if the mouse left/entered the browser window3196 if ( !related || (related !== target && !jQuery.contains( target, related )) ) {3197 event.type = handleObj.origType;3198 ret = handleObj.handler.apply( this, arguments );3199 event.type = fix;3200 }3201 return ret;3202 }3203 };3204});3205// Create "bubbling" focus and blur events3206// Support: Firefox, Chrome, Safari3207if ( !support.focusinBubbles ) {3208 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {3209 // Attach a single capturing handler on the document while someone wants focusin/focusout3210 var handler = function( event ) {3211 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );3212 };3213 jQuery.event.special[ fix ] = {3214 setup: function() {3215 var doc = this.ownerDocument || this,3216 attaches = data_priv.access( doc, fix );3217 if ( !attaches ) {3218 doc.addEventListener( orig, handler, true );3219 }3220 data_priv.access( doc, fix, ( attaches || 0 ) + 1 );3221 },3222 teardown: function() {3223 var doc = this.ownerDocument || this,3224 attaches = data_priv.access( doc, fix ) - 1;3225 if ( !attaches ) {3226 doc.removeEventListener( orig, handler, true );3227 data_priv.remove( doc, fix );3228 } else {3229 data_priv.access( doc, fix, attaches );3230 }3231 }3232 };3233 });3234}3235jQuery.fn.extend({3236 on: function( types, selector, data, fn, /*INTERNAL*/ one ) {3237 var origFn, type;3238 // Types can be a map of types/handlers3239 if ( typeof types === "object" ) {3240 // ( types-Object, selector, data )3241 if ( typeof selector !== "string" ) {3242 // ( types-Object, data )3243 data = data || selector;3244 selector = undefined;3245 }3246 for ( type in types ) {3247 this.on( type, selector, data, types[ type ], one );3248 }3249 return this;3250 }3251 if ( data == null && fn == null ) {3252 // ( types, fn )3253 fn = selector;3254 data = selector = undefined;3255 } else if ( fn == null ) {3256 if ( typeof selector === "string" ) {3257 // ( types, selector, fn )3258 fn = data;3259 data = undefined;3260 } else {3261 // ( types, data, fn )3262 fn = data;3263 data = selector;3264 selector = undefined;3265 }3266 }3267 if ( fn === false ) {3268 fn = returnFalse;3269 } else if ( !fn ) {3270 return this;3271 }3272 if ( one === 1 ) {3273 origFn = fn;3274 fn = function( event ) {3275 // Can use an empty set, since event contains the info3276 jQuery().off( event );3277 return origFn.apply( this, arguments );3278 };3279 // Use same guid so caller can remove using origFn3280 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );3281 }3282 return this.each( function() {3283 jQuery.event.add( this, types, fn, data, selector );3284 });3285 },3286 one: function( types, selector, data, fn ) {3287 return this.on( types, selector, data, fn, 1 );3288 },3289 off: function( types, selector, fn ) {3290 var handleObj, type;3291 if ( types && types.preventDefault && types.handleObj ) {3292 // ( event ) dispatched jQuery.Event3293 handleObj = types.handleObj;3294 jQuery( types.delegateTarget ).off(3295 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,3296 handleObj.selector,3297 handleObj.handler3298 );3299 return this;3300 }3301 if ( typeof types === "object" ) {3302 // ( types-object [, selector] )3303 for ( type in types ) {3304 this.off( type, selector, types[ type ] );3305 }3306 return this;3307 }3308 if ( selector === false || typeof selector === "function" ) {3309 // ( types [, fn] )3310 fn = selector;3311 selector = undefined;3312 }3313 if ( fn === false ) {3314 fn = returnFalse;3315 }3316 return this.each(function() {3317 jQuery.event.remove( this, types, fn, selector );3318 });3319 },3320 trigger: function( type, data ) {3321 return this.each(function() {3322 jQuery.event.trigger( type, data, this );3323 });3324 },3325 triggerHandler: function( type, data ) {3326 var elem = this[0];3327 if ( elem ) {3328 return jQuery.event.trigger( type, data, elem, true );3329 }3330 }3331});3332var3333 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,3334 rtagName = /<([\w:]+) ,="" rhtml="/<|&#?\w+;/," rnoinnerhtml="/<(?:script|style|link)/i," checked="checked" or="" rchecked="/checked\s*(?:[^=]|=\s*.checked.)/i," rscripttype="/^$|\/(?:java|ecma)script/i," rscripttypemasked="/^true\/(.*)/," rcleanscript="/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)">\s*$/g,3335 // We have to close these tags to support XHTML (#13200)3336 wrapMap = {3337 // Support: IE 93338 option: [ 1, "<select multiple="multiple">", "</select>" ],3339 thead: [ 1, "<table>", "</table>" ],3340 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],3341 tr: [ 2, "<table><tbody>", "</tbody></table>" ],3342 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],3343 _default: [ 0, "", "" ]3344 };3345// Support: IE 93346wrapMap.optgroup = wrapMap.option;3347wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;3348wrapMap.th = wrapMap.td;3349// Support: 1.x compatibility3350// Manipulating tables requires a tbody3351function manipulationTarget( elem, content ) {3352 return jQuery.nodeName( elem, "table" ) &&3353 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?3354 elem.getElementsByTagName("tbody")[0] ||3355 elem.appendChild( elem.ownerDocument.createElement("tbody") ) :3356 elem;3357}3358// Replace/restore the type attribute of script elements for safe DOM manipulation3359function disableScript( elem ) {3360 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;3361 return elem;3362}3363function restoreScript( elem ) {3364 var match = rscriptTypeMasked.exec( elem.type );3365 if ( match ) {3366 elem.type = match[ 1 ];3367 } else {3368 elem.removeAttribute("type");3369 }3370 return elem;3371}3372// Mark scripts as having already been evaluated3373function setGlobalEval( elems, refElements ) {3374 var i = 0,3375 l = elems.length;3376 for ( ; i < l; i++ ) {3377 data_priv.set(3378 elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )3379 );3380 }3381}3382function cloneCopyEvent( src, dest ) {3383 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;3384 if ( dest.nodeType !== 1 ) {3385 return;3386 }3387 // 1. Copy private data: events, handlers, etc.3388 if ( data_priv.hasData( src ) ) {3389 pdataOld = data_priv.access( src );3390 pdataCur = data_priv.set( dest, pdataOld );3391 events = pdataOld.events;3392 if ( events ) {3393 delete pdataCur.handle;3394 pdataCur.events = {};3395 for ( type in events ) {3396 for ( i = 0, l = events[ type ].length; i < l; i++ ) {3397 jQuery.event.add( dest, type, events[ type ][ i ] );3398 }3399 }3400 }3401 }3402 // 2. Copy user data3403 if ( data_user.hasData( src ) ) {3404 udataOld = data_user.access( src );3405 udataCur = jQuery.extend( {}, udataOld );3406 data_user.set( dest, udataCur );3407 }3408}3409function getAll( context, tag ) {3410 var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :3411 context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :3412 [];3413 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?3414 jQuery.merge( [ context ], ret ) :3415 ret;3416}3417// Support: IE >= 93418function fixInput( src, dest ) {3419 var nodeName = dest.nodeName.toLowerCase();3420 // Fails to persist the checked state of a cloned checkbox or radio button.3421 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {3422 dest.checked = src.checked;3423 // Fails to return the selected option to the default selected state when cloning options3424 } else if ( nodeName === "input" || nodeName === "textarea" ) {3425 dest.defaultValue = src.defaultValue;3426 }3427}3428jQuery.extend({3429 clone: function( elem, dataAndEvents, deepDataAndEvents ) {3430 var i, l, srcElements, destElements,3431 clone = elem.cloneNode( true ),3432 inPage = jQuery.contains( elem.ownerDocument, elem );3433 // Support: IE >= 93434 // Fix Cloning issues3435 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&3436 !jQuery.isXMLDoc( elem ) ) {3437 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/23438 destElements = getAll( clone );3439 srcElements = getAll( elem );3440 for ( i = 0, l = srcElements.length; i < l; i++ ) {3441 fixInput( srcElements[ i ], destElements[ i ] );3442 }3443 }3444 // Copy the events from the original to the clone3445 if ( dataAndEvents ) {3446 if ( deepDataAndEvents ) {3447 srcElements = srcElements || getAll( elem );3448 destElements = destElements || getAll( clone );3449 for ( i = 0, l = srcElements.length; i < l; i++ ) {3450 cloneCopyEvent( srcElements[ i ], destElements[ i ] );3451 }3452 } else {3453 cloneCopyEvent( elem, clone );3454 }3455 }3456 // Preserve script evaluation history3457 destElements = getAll( clone, "script" );3458 if ( destElements.length > 0 ) {3459 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );3460 }3461 // Return the cloned set3462 return clone;3463 },3464 buildFragment: function( elems, context, scripts, selection ) {3465 var elem, tmp, tag, wrap, contains, j,3466 fragment = context.createDocumentFragment(),3467 nodes = [],3468 i = 0,3469 l = elems.length;3470 for ( ; i < l; i++ ) {3471 elem = elems[ i ];3472 if ( elem || elem === 0 ) {3473 // Add nodes directly3474 if ( jQuery.type( elem ) === "object" ) {3475 // Support: QtWebKit3476 // jQuery.merge because push.apply(_, arraylike) throws3477 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );3478 // Convert non-html into a text node3479 } else if ( !rhtml.test( elem ) ) {3480 nodes.push( context.createTextNode( elem ) );3481 // Convert html into DOM nodes3482 } else {3483 tmp = tmp || fragment.appendChild( context.createElement("div") );3484 // Deserialize a standard representation3485 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();3486 wrap = wrapMap[ tag ] || wrapMap._default;3487 tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[ 2 ];3488 // Descend through wrappers to the right content3489 j = wrap[ 0 ];3490 while ( j-- ) {3491 tmp = tmp.lastChild;3492 }3493 // Support: QtWebKit3494 // jQuery.merge because push.apply(_, arraylike) throws3495 jQuery.merge( nodes, tmp.childNodes );3496 // Remember the top-level container3497 tmp = fragment.firstChild;3498 // Fixes #123463499 // Support: Webkit, IE3500 tmp.textContent = "";3501 }3502 }3503 }3504 // Remove wrapper from fragment3505 fragment.textContent = "";3506 i = 0;3507 while ( (elem = nodes[ i++ ]) ) {3508 // #4087 - If origin and destination elements are the same, and this is3509 // that element, do not do anything3510 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {3511 continue;3512 }3513 contains = jQuery.contains( elem.ownerDocument, elem );3514 // Append to fragment3515 tmp = getAll( fragment.appendChild( elem ), "script" );3516 // Preserve script evaluation history3517 if ( contains ) {3518 setGlobalEval( tmp );3519 }3520 // Capture executables3521 if ( scripts ) {3522 j = 0;3523 while ( (elem = tmp[ j++ ]) ) {3524 if ( rscriptType.test( elem.type || "" ) ) {3525 scripts.push( elem );3526 }3527 }3528 }3529 }3530 return fragment;3531 },3532 cleanData: function( elems ) {3533 var data, elem, events, type, key, j,3534 special = jQuery.event.special,3535 i = 0;3536 for ( ; (elem = elems[ i ]) !== undefined; i++ ) {3537 if ( jQuery.acceptData( elem ) ) {3538 key = elem[ data_priv.expando ];3539 if ( key && (data = data_priv.cache[ key ]) ) {3540 events = Object.keys( data.events || {} );3541 if ( events.length ) {3542 for ( j = 0; (type = events[j]) !== undefined; j++ ) {3543 if ( special[ type ] ) {3544 jQuery.event.remove( elem, type );3545 // This is a shortcut to avoid jQuery.event.remove's overhead3546 } else {3547 jQuery.removeEvent( elem, type, data.handle );3548 }3549 }3550 }3551 if ( data_priv.cache[ key ] ) {3552 // Discard any remaining `private` data3553 delete data_priv.cache[ key ];3554 }3555 }3556 }3557 // Discard any remaining `user` data3558 delete data_user.cache[ elem[ data_user.expando ] ];3559 }3560 }3561});3562jQuery.fn.extend({3563 text: function( value ) {3564 return access( this, function( value ) {3565 return value === undefined ?3566 jQuery.text( this ) :3567 this.empty().each(function() {3568 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {3569 this.textContent = value;3570 }3571 });3572 }, null, value, arguments.length );3573 },3574 append: function() {3575 return this.domManip( arguments, function( elem ) {3576 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {3577 var target = manipulationTarget( this, elem );3578 target.appendChild( elem );3579 }3580 });3581 },3582 prepend: function() {3583 return this.domManip( arguments, function( elem ) {3584 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {3585 var target = manipulationTarget( this, elem );3586 target.insertBefore( elem, target.firstChild );3587 }3588 });3589 },3590 before: function() {3591 return this.domManip( arguments, function( elem ) {3592 if ( this.parentNode ) {3593 this.parentNode.insertBefore( elem, this );3594 }3595 });3596 },3597 after: function() {3598 return this.domManip( arguments, function( elem ) {3599 if ( this.parentNode ) {3600 this.parentNode.insertBefore( elem, this.nextSibling );3601 }3602 });3603 },3604 remove: function( selector, keepData /* Internal Use Only */ ) {3605 var elem,3606 elems = selector ? jQuery.filter( selector, this ) : this,3607 i = 0;3608 for ( ; (elem = elems[i]) != null; i++ ) {3609 if ( !keepData && elem.nodeType === 1 ) {3610 jQuery.cleanData( getAll( elem ) );3611 }3612 if ( elem.parentNode ) {3613 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {3614 setGlobalEval( getAll( elem, "script" ) );3615 }3616 elem.parentNode.removeChild( elem );3617 }3618 }3619 return this;3620 },3621 empty: function() {3622 var elem,3623 i = 0;3624 for ( ; (elem = this[i]) != null; i++ ) {3625 if ( elem.nodeType === 1 ) {3626 // Prevent memory leaks3627 jQuery.cleanData( getAll( elem, false ) );3628 // Remove any remaining nodes3629 elem.textContent = "";3630 }3631 }3632 return this;3633 },3634 clone: function( dataAndEvents, deepDataAndEvents ) {3635 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;3636 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;3637 return this.map(function() {3638 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );3639 });3640 },3641 html: function( value ) {3642 return access( this, function( value ) {3643 var elem = this[ 0 ] || {},3644 i = 0,3645 l = this.length;3646 if ( value === undefined && elem.nodeType === 1 ) {3647 return elem.innerHTML;3648 }3649 // See if we can take a shortcut and just use innerHTML3650 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&3651 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {3652 value = value.replace( rxhtmlTag, "<$1>" );3653 try {3654 for ( ; i < l; i++ ) {3655 elem = this[ i ] || {};3656 // Remove element nodes and prevent memory leaks3657 if ( elem.nodeType === 1 ) {3658 jQuery.cleanData( getAll( elem, false ) );3659 elem.innerHTML = value;3660 }3661 }3662 elem = 0;3663 // If using innerHTML throws an exception, use the fallback method3664 } catch( e ) {}3665 }3666 if ( elem ) {3667 this.empty().append( value );3668 }3669 }, null, value, arguments.length );3670 },3671 replaceWith: function() {3672 var arg = arguments[ 0 ];3673 // Make the changes, replacing each context element with the new content3674 this.domManip( arguments, function( elem ) {3675 arg = this.parentNode;3676 jQuery.cleanData( getAll( this ) );3677 if ( arg ) {3678 arg.replaceChild( elem, this );3679 }3680 });3681 // Force removal if there was no new content (e.g., from empty arguments)3682 return arg && (arg.length || arg.nodeType) ? this : this.remove();3683 },3684 detach: function( selector ) {3685 return this.remove( selector, true );3686 },3687 domManip: function( args, callback ) {3688 // Flatten any nested arrays3689 args = concat.apply( [], args );3690 var fragment, first, scripts, hasScripts, node, doc,3691 i = 0,3692 l = this.length,3693 set = this,3694 iNoClone = l - 1,3695 value = args[ 0 ],3696 isFunction = jQuery.isFunction( value );3697 // We can't cloneNode fragments that contain checked, in WebKit3698 if ( isFunction ||3699 ( l > 1 && typeof value === "string" &&3700 !support.checkClone && rchecked.test( value ) ) ) {3701 return this.each(function( index ) {3702 var self = set.eq( index );3703 if ( isFunction ) {3704 args[ 0 ] = value.call( this, index, self.html() );3705 }3706 self.domManip( args, callback );3707 });3708 }3709 if ( l ) {3710 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );3711 first = fragment.firstChild;3712 if ( fragment.childNodes.length === 1 ) {3713 fragment = first;3714 }3715 if ( first ) {3716 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );3717 hasScripts = scripts.length;3718 // Use the original fragment for the last item instead of the first because it can end up3719 // being emptied incorrectly in certain situations (#8070).3720 for ( ; i < l; i++ ) {3721 node = fragment;3722 if ( i !== iNoClone ) {3723 node = jQuery.clone( node, true, true );3724 // Keep references to cloned scripts for later restoration3725 if ( hasScripts ) {3726 // Support: QtWebKit3727 // jQuery.merge because push.apply(_, arraylike) throws3728 jQuery.merge( scripts, getAll( node, "script" ) );3729 }3730 }3731 callback.call( this[ i ], node, i );3732 }3733 if ( hasScripts ) {3734 doc = scripts[ scripts.length - 1 ].ownerDocument;3735 // Reenable scripts3736 jQuery.map( scripts, restoreScript );3737 // Evaluate executable scripts on first document insertion3738 for ( i = 0; i < hasScripts; i++ ) {3739 node = scripts[ i ];3740 if ( rscriptType.test( node.type || "" ) &&3741 !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {3742 if ( node.src ) {3743 // Optional AJAX dependency, but won't run scripts if not present3744 if ( jQuery._evalUrl ) {3745 jQuery._evalUrl( node.src );3746 }3747 } else {3748 jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );3749 }3750 }3751 }3752 }3753 }3754 }3755 return this;3756 }3757});3758jQuery.each({3759 appendTo: "append",3760 prependTo: "prepend",3761 insertBefore: "before",3762 insertAfter: "after",3763 replaceAll: "replaceWith"3764}, function( name, original ) {3765 jQuery.fn[ name ] = function( selector ) {3766 var elems,3767 ret = [],3768 insert = jQuery( selector ),3769 last = insert.length - 1,3770 i = 0;3771 for ( ; i <= 0="" last;="" i++="" )="" {="" elems="i" =="=" last="" ?="" this="" :="" this.clone(="" true="" );="" jquery(="" insert[="" i="" ]="" )[="" original="" ](="" support:="" qtwebkit="" .get()="" because="" push.apply(_,="" arraylike)="" throws="" push.apply(="" ret,="" elems.get()="" }="" return="" this.pushstack(="" ret="" };="" });="" var="" iframe,="" elemdisplay="{};" **="" *="" retrieve="" the="" actual="" display="" of="" a="" element="" @param="" {string}="" name="" nodename="" {object}="" doc="" document="" object="" called="" only="" from="" within="" defaultdisplay="" function="" actualdisplay(="" name,="" elem="jQuery(" doc.createelement(="" ).appendto(="" doc.body="" ),="" getdefaultcomputedstyle="" might="" be="" reliably="" used="" on="" attached="" use="" method="" is="" temporary="" fix="" (more="" like="" optmization)="" until="" something="" better="" comes="" along,="" since="" it="" was="" removed="" specification="" and="" supported="" in="" ff="" window.getdefaultcomputedstyle(="" elem[="" ).display="" jquery.css(="" ],="" "display"="" we="" don't="" have="" any="" data="" stored="" element,="" so="" "detach"="" as="" fast="" way="" to="" get="" rid="" elem.detach();="" display;="" try="" determine="" default value="" an="" defaultdisplay(="" ];="" if="" (="" !display="" nodename,="" simple="" fails,="" read="" inside="" iframe="" "none"="" ||="" already-created="" possible="" "<iframe="" frameborder="0" width="0" height="0">" )).appendTo( doc.documentElement );3772 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse3773 doc = iframe[ 0 ].contentDocument;3774 // Support: IE3775 doc.write();3776 doc.close();3777 display = actualDisplay( nodeName, doc );3778 iframe.detach();3779 }3780 // Store the correct default display3781 elemdisplay[ nodeName ] = display;3782 }3783 return display;3784}3785var rmargin = (/^margin/);3786var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );3787var getStyles = function( elem ) {3788 return elem.ownerDocument.defaultView.getComputedStyle( elem, null );3789 };3790function curCSS( elem, name, computed ) {3791 var width, minWidth, maxWidth, ret,3792 style = elem.style;3793 computed = computed || getStyles( elem );3794 // Support: IE93795 // getPropertyValue is only needed for .css('filter') in IE9, see #125373796 if ( computed ) {3797 ret = computed.getPropertyValue( name ) || computed[ name ];3798 }3799 if ( computed ) {3800 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {3801 ret = jQuery.style( elem, name );3802 }3803 // Support: iOS < 63804 // A tribute to the "awesome hack by Dean Edwards"3805 // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels3806 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values3807 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {3808 // Remember the original values3809 width = style.width;3810 minWidth = style.minWidth;3811 maxWidth = style.maxWidth;3812 // Put in the new values to get a computed value out3813 style.minWidth = style.maxWidth = style.width = ret;3814 ret = computed.width;3815 // Revert the changed values3816 style.width = width;3817 style.minWidth = minWidth;3818 style.maxWidth = maxWidth;3819 }3820 }3821 return ret !== undefined ?3822 // Support: IE3823 // IE returns zIndex value as an integer.3824 ret + "" :3825 ret;3826}3827function addGetHookIf( conditionFn, hookFn ) {3828 // Define the hook, we'll check on the first run if it's really needed.3829 return {3830 get: function() {3831 if ( conditionFn() ) {3832 // Hook not needed (or it's not possible to use it due to missing dependency),3833 // remove it.3834 // Since there are no other hooks for marginRight, remove the whole object.3835 delete this.get;3836 return;3837 }3838 // Hook needed; redefine it so that the support test is not executed again.3839 return (this.get = hookFn).apply( this, arguments );3840 }3841 };3842}3843(function() {3844 var pixelPositionVal, boxSizingReliableVal,3845 // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).3846 divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;" +3847 "-moz-box-sizing:content-box;box-sizing:content-box",3848 docElem = document.documentElement,3849 container = document.createElement( "div" ),3850 div = document.createElement( "div" );3851 div.style.backgroundClip = "content-box";3852 div.cloneNode( true ).style.backgroundClip = "";3853 support.clearCloneStyle = div.style.backgroundClip === "content-box";3854 container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;" +3855 "margin-top:1px";3856 container.appendChild( div );3857 // Executing both pixelPosition & boxSizingReliable tests require only one layout3858 // so they're executed at the same time to save the second computation.3859 function computePixelPositionAndBoxSizingReliable() {3860 // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).3861 div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +3862 "box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;" +3863 "position:absolute;top:1%";3864 docElem.appendChild( container );3865 var divStyle = window.getComputedStyle( div, null );3866 pixelPositionVal = divStyle.top !== "1%";3867 boxSizingReliableVal = divStyle.width === "4px";3868 docElem.removeChild( container );3869 }3870 // Use window.getComputedStyle because jsdom on node.js will break without it.3871 if ( window.getComputedStyle ) {3872 jQuery.extend(support, {3873 pixelPosition: function() {3874 // This test is executed only once but we still do memoizing3875 // since we can use the boxSizingReliable pre-computing.3876 // No need to check if the test was already performed, though.3877 computePixelPositionAndBoxSizingReliable();3878 return pixelPositionVal;3879 },3880 boxSizingReliable: function() {3881 if ( boxSizingReliableVal == null ) {3882 computePixelPositionAndBoxSizingReliable();3883 }3884 return boxSizingReliableVal;3885 },3886 reliableMarginRight: function() {3887 // Support: Android 2.33888 // Check if div with explicit width and no margin-right incorrectly3889 // gets computed margin-right based on width of container. (#3333)3890 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right3891 // This support function is only executed once so no memoizing is needed.3892 var ret,3893 marginDiv = div.appendChild( document.createElement( "div" ) );3894 marginDiv.style.cssText = div.style.cssText = divReset;3895 marginDiv.style.marginRight = marginDiv.style.width = "0";3896 div.style.width = "1px";3897 docElem.appendChild( container );3898 ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );3899 docElem.removeChild( container );3900 // Clean up the div for other support tests.3901 div.innerHTML = "";3902 return ret;3903 }3904 });3905 }3906})();3907// A method for quickly swapping in/out CSS properties to get correct calculations.3908jQuery.swap = function( elem, options, callback, args ) {3909 var ret, name,3910 old = {};3911 // Remember the old values, and insert the new ones3912 for ( name in options ) {3913 old[ name ] = elem.style[ name ];3914 elem.style[ name ] = options[ name ];3915 }3916 ret = callback.apply( elem, args || [] );3917 // Revert the old values3918 for ( name in options ) {3919 elem.style[ name ] = old[ name ];3920 }3921 return ret;3922};3923var3924 // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"3925 // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display3926 rdisplayswap = /^(none|table(?!-c[ea]).+)/,3927 rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),3928 rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),3929 cssShow = { position: "absolute", visibility: "hidden", display: "block" },3930 cssNormalTransform = {3931 letterSpacing: 0,3932 fontWeight: 4003933 },3934 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];3935// return a css property mapped to a potentially vendor prefixed property3936function vendorPropName( style, name ) {3937 // shortcut for names that are not vendor prefixed3938 if ( name in style ) {3939 return name;3940 }3941 // check for vendor prefixed names3942 var capName = name[0].toUpperCase() + name.slice(1),3943 origName = name,3944 i = cssPrefixes.length;3945 while ( i-- ) {3946 name = cssPrefixes[ i ] + capName;3947 if ( name in style ) {3948 return name;3949 }3950 }3951 return origName;3952}3953function setPositiveNumber( elem, value, subtract ) {3954 var matches = rnumsplit.exec( value );3955 return matches ?3956 // Guard against undefined "subtract", e.g., when used as in cssHooks3957 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :3958 value;3959}3960function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {3961 var i = extra === ( isBorderBox ? "border" : "content" ) ?3962 // If we already have the right measurement, avoid augmentation3963 4 :3964 // Otherwise initialize for horizontal or vertical properties3965 name === "width" ? 1 : 0,3966 val = 0;3967 for ( ; i < 4; i += 2 ) {3968 // both box models exclude margin, so add it if we want it3969 if ( extra === "margin" ) {3970 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );3971 }3972 if ( isBorderBox ) {3973 // border-box includes padding, so remove it if we want content3974 if ( extra === "content" ) {3975 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );3976 }3977 // at this point, extra isn't border nor margin, so remove border3978 if ( extra !== "margin" ) {3979 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );3980 }3981 } else {3982 // at this point, extra isn't content, so add padding3983 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );3984 // at this point, extra isn't content nor padding, so add border3985 if ( extra !== "padding" ) {3986 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );3987 }3988 }3989 }3990 return val;3991}3992function getWidthOrHeight( elem, name, extra ) {3993 // Start with offset property, which is equivalent to the border-box value3994 var valueIsBorderBox = true,3995 val = name === "width" ? elem.offsetWidth : elem.offsetHeight,3996 styles = getStyles( elem ),3997 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";3998 // some non-html elements return undefined for offsetWidth, so check for null/undefined3999 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=6492854000 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=4916684001 if ( val <= 0="" 1="" 2="" 3="" 8="" 13343="" ||="" val="=" null="" )="" {="" fall="" back="" to="" computed="" then="" uncomputed="" css="" if="" necessary="" elem,="" name,="" styles="" );="" (="" <="" name="" ];="" }="" unit="" is="" not="" pixels.="" stop="" here="" and="" return.="" rnumnonpx.test(val)="" return="" val;="" we="" need="" the="" check="" for="" style="" in="" case="" a="" browser="" which="" returns="" unreliable="" values="" getcomputedstyle="" silently="" falls="" reliable="" elem.style="" valueisborderbox="isBorderBox" &&="" support.boxsizingreliable()="" elem.style[="" ]="" normalize="" "",="" auto,="" prepare="" extra="" 0;="" use="" active="" box-sizing="" model="" add="" subtract="" irrelevant="" +="" augmentwidthorheight(="" isborderbox="" ?="" "border"="" :="" "content"="" ),="" valueisborderbox,="" "px";="" function="" showhide(="" elements,="" show="" var="" display,="" hidden,="" index="0," length="elements.length;" ;="" length;="" index++="" elem="elements[" !elem.style="" continue;="" values[="" "olddisplay"="" display="elem.style.display;" reset="" inline="" of="" this="" element="" learn="" it="" being="" hidden by="" cascaded="" rules="" or="" !values[="" "none"="" elem.style.display="" set="" elements="" have="" been="" overridden="" with="" display:="" none="" stylesheet="" whatever="" default such="" an="" ""="" ishidden(="" "olddisplay",="" defaultdisplay(elem.nodename)="" else="" !="=" !hidden="" data_priv.set(="" jquery.css(elem,="" "display")="" most="" second="" loop avoid="" constant="" reflow="" !show="" "none";="" elements;="" jquery.extend({="" property="" hooks="" overriding="" behavior="" getting="" setting="" csshooks:="" opacity:="" get:="" function(="" should="" always="" get="" number="" from="" opacity="" ret="curCSS(" "opacity"="" "1"="" ret;="" },="" don't="" automatically="" "px"="" these="" possibly-unitless="" properties="" cssnumber:="" "columncount":="" true,="" "fillopacity":="" "fontweight":="" "lineheight":="" "opacity":="" "order":="" "orphans":="" "widows":="" "zindex":="" "zoom":="" true="" whose="" names="" you="" wish="" fix="" before="" value="" cssprops:="" float="" "float":="" "cssfloat"="" on="" dom="" node="" style:="" value,="" text="" comment="" nodes="" !elem="" elem.nodetype="==" return;="" make="" sure="" that="" we're="" working="" right="" ret,="" type,="" hooks,="" origname="jQuery.camelCase(" jquery.cssprops[="" style,="" gets="" hook="" prefixed="" version="" followed="" unprefixed="" jquery.csshooks[="" undefined="" type="typeof" value;="" convert="" relative="" strings="" (+="or" -=")" numbers.="" #7345="" "string"="" (ret="rrelNum.exec(" ))="" ret[1]="" *="" ret[2]="" parsefloat(="" jquery.css(="" fixes="" bug="" #9237="" nan="" aren't="" set.="" see:="" #7116="" was="" passed="" in,="" 'px'="" (except="" certain="" properties)="" "number"="" !jquery.cssnumber[="" #8908,="" can="" be="" done="" more="" correctly="" specifying="" setters="" csshooks,="" but="" would="" mean="" define="" eight="" (for="" every="" problematic="" property)="" identical="" functions="" !support.clearclonestyle="" name.indexof(="" "background"="" style[="" provided,="" otherwise="" just="" specified="" !hooks="" !("set"="" hooks)="" (value="hooks.set(" support:="" chrome,="" safari="" blank="" string="" required delete="" "style:="" x="" !important;"="" provided="" non-computed="" there="" "get"="" false,="" object="" css:="" extra,="" val,="" num,="" elem.style,="" otherwise,="" way="" exists,="" "normal"="" cssnormaltransform="" return,="" converting="" forced="" qualifier="" looks="" numeric="" num="parseFloat(" jquery.isnumeric(="" });="" jquery.each([="" "height",="" "width"="" ],="" i,="" computed,="" dimension="" info="" invisibly="" them="" however,="" must="" current="" benefit="" elem.offsetwidth="==" rdisplayswap.test(="" "display"="" jquery.swap(="" cssshow,="" function()="" getwidthorheight(="" })="" set:="" getstyles(="" setpositivenumber(="" "boxsizing",="" "border-box",="" };="" android="" 2.3="" jquery.csshooks.marginright="addGetHookIf(" support.reliablemarginright,="" webkit="" wrong="" margin-right="" work="" around="" temporarily="" inline-block="" "display":="" "inline-block"="" curcss,="" [="" "marginright"="" are="" used="" animate="" expand="" jquery.each({="" margin:="" padding:="" border:="" prefix,="" suffix="" prefix="" expand:="" i="0," expanded="{}," assumes="" single="" parts="typeof" value.split("="" ")="" 4;="" i++="" expanded[="" cssexpand[="" parts[="" expanded;="" !rmargin.test(="" ].set="setPositiveNumber;" jquery.fn.extend({="" access(="" this,="" styles,="" len,="" map="{}," jquery.isarray(="" len="name.length;" len;="" map[="" name[="" map;="" jquery.style(="" arguments.length=""> 1 );4002 },4003 show: function() {4004 return showHide( this, true );4005 },4006 hide: function() {4007 return showHide( this );4008 },4009 toggle: function( state ) {4010 if ( typeof state === "boolean" ) {4011 return state ? this.show() : this.hide();4012 }4013 return this.each(function() {4014 if ( isHidden( this ) ) {4015 jQuery( this ).show();4016 } else {4017 jQuery( this ).hide();4018 }4019 });4020 }4021});4022function Tween( elem, options, prop, end, easing ) {4023 return new Tween.prototype.init( elem, options, prop, end, easing );4024}4025jQuery.Tween = Tween;4026Tween.prototype = {4027 constructor: Tween,4028 init: function( elem, options, prop, end, easing, unit ) {4029 this.elem = elem;4030 this.prop = prop;4031 this.easing = easing || "swing";4032 this.options = options;4033 this.start = this.now = this.cur();4034 this.end = end;4035 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );4036 },4037 cur: function() {4038 var hooks = Tween.propHooks[ this.prop ];4039 return hooks && hooks.get ?4040 hooks.get( this ) :4041 Tween.propHooks._default.get( this );4042 },4043 run: function( percent ) {4044 var eased,4045 hooks = Tween.propHooks[ this.prop ];4046 if ( this.options.duration ) {4047 this.pos = eased = jQuery.easing[ this.easing ](4048 percent, this.options.duration * percent, 0, 1, this.options.duration4049 );4050 } else {4051 this.pos = eased = percent;4052 }4053 this.now = ( this.end - this.start ) * eased + this.start;4054 if ( this.options.step ) {4055 this.options.step.call( this.elem, this.now, this );4056 }4057 if ( hooks && hooks.set ) {4058 hooks.set( this );4059 } else {4060 Tween.propHooks._default.set( this );4061 }4062 return this;4063 }4064};4065Tween.prototype.init.prototype = Tween.prototype;4066Tween.propHooks = {4067 _default: {4068 get: function( tween ) {4069 var result;4070 if ( tween.elem[ tween.prop ] != null &&4071 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {4072 return tween.elem[ tween.prop ];4073 }4074 // passing an empty string as a 3rd parameter to .css will automatically4075 // attempt a parseFloat and fallback to a string if the parse fails4076 // so, simple values such as "10px" are parsed to Float.4077 // complex values such as "rotate(1rad)" are returned as is.4078 result = jQuery.css( tween.elem, tween.prop, "" );4079 // Empty strings, null, undefined and "auto" are converted to 0.4080 return !result || result === "auto" ? 0 : result;4081 },4082 set: function( tween ) {4083 // use step hook for back compat - use cssHook if its there - use .style if its4084 // available and use plain properties where available4085 if ( jQuery.fx.step[ tween.prop ] ) {4086 jQuery.fx.step[ tween.prop ]( tween );4087 } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {4088 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );4089 } else {4090 tween.elem[ tween.prop ] = tween.now;4091 }4092 }4093 }4094};4095// Support: IE94096// Panic based approach to setting things on disconnected nodes4097Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {4098 set: function( tween ) {4099 if ( tween.elem.nodeType && tween.elem.parentNode ) {4100 tween.elem[ tween.prop ] = tween.now;4101 }4102 }4103};4104jQuery.easing = {4105 linear: function( p ) {4106 return p;4107 },4108 swing: function( p ) {4109 return 0.5 - Math.cos( p * Math.PI ) / 2;4110 }4111};4112jQuery.fx = Tween.prototype.init;4113// Back Compat <1.8 0="" 1="" 2="" 3="" 4="" extension="" point="" jquery.fx.step="{};" var="" fxnow,="" timerid,="" rfxtypes="/^(?:toggle|show|hide)$/," rfxnum="new" regexp(="" "^(?:([+-])="|)("" +="" pnum="" ")([a-z%]*)$",="" "i"="" ),="" rrun="/queueHooks$/," animationprefilters="[" defaultprefilter="" ],="" tweeners="{" "*":="" [="" function(="" prop,="" value="" )="" {="" tween="this.createTween(" target="tween.cur()," parts="rfxnum.exec(" unit="parts" &&="" parts[="" ]="" ||="" (="" jquery.cssnumber[="" prop="" ?="" ""="" :="" "px"="" starting="" computation="" is="" required for="" potential="" mismatches="" start="(" !="=" +target="" rfxnum.exec(="" jquery.css(="" tween.elem,="" scale="1," maxiterations="20;" if="" start[="" trust="" units="" reported="" by="" jquery.css="" ];="" make="" sure="" we="" update="" the="" properties="" later="" on="" [];="" iteratively="" approximate="" from="" a="" nonzero="" 1;="" do="" previous="" iteration="" zeroed="" out,="" double="" until="" get="" *something*="" use="" string="" doubling="" factor="" so="" don't="" accidentally="" see="" as="" unchanged="" below="" ".5";="" adjust="" and="" apply="" scale;="" jquery.style(="" );="" scale,="" tolerating="" zero="" or="" nan="" tween.cur()="" breaking="" loop perfect,="" we've="" just="" had="" enough="" }="" while="" (scale="tween.cur()" target)="" --maxiterations="" =="" +start="" 0;="" tween.unit="unit;" token="" was="" provided,="" we're="" doing="" relative="" animation="" tween.end="parts[" *="" +parts[="" return="" tween;="" };="" animations="" created="" synchronously="" will="" run="" function="" createfxnow()="" settimeout(function()="" fxnow="undefined;" });="" generate="" parameters="" to="" create="" standard="" genfx(="" type,="" includewidth="" which,="" i="0," attrs="{" height:="" type="" include="" width,="" step="" all="" cssexpand="" values,="" skip="" over="" left="" right="" ;="" <="" -="" which="cssExpand[" attrs[="" "margin"="" "padding"="" attrs.opacity="attrs.width" type;="" attrs;="" createtween(="" value,="" tween,="" collection="(" tweeners[="" []="" ).concat(="" "*"="" index="0," length="collection.length;" length;="" index++="" (tween="collection[" ].call(="" animation,="" ))="" done="" with="" this="" property="" defaultprefilter(="" elem,="" props,="" opts="" jshint="" validthis:="" true="" toggle,="" hooks,="" oldfire,="" display,="" anim="this," orig="{}," style="elem.style," hidden="elem.nodeType" ishidden(="" elem="" datashow="data_priv.get(" "fxshow"="" handle="" queue:="" false="" promises="" !opts.queue="" hooks="jQuery._queueHooks(" "fx"="" hooks.unqueued="=" null="" oldfire="hooks.empty.fire;" hooks.empty.fire="function()" !hooks.unqueued="" oldfire();="" hooks.unqueued++;="" anim.always(function()="" makes="" that="" complete="" handler="" be="" called="" before="" completes="" hooks.unqueued--;="" !jquery.queue(="" ).length="" hooks.empty.fire();="" height="" width="" overflow="" pass="" elem.nodetype="==" "height"="" in="" props="" "width"="" nothing="" sneaks="" out="" record="" attributes="" because="" ie9-10="" not="" change="" attribute="" when="" overflowx="" overflowy="" are="" set="" same="" opts.overflow="[" style.overflow,="" style.overflowx,="" style.overflowy="" display="" inline-block="" inline="" elements="" having="" animated="" "display"="" default currently="" "none"="" elem.nodename="" "inline"="" "float"="" style.display="inline-block" style.overflow="hidden" style.overflowx="opts.overflow[" show="" hide="" rfxtypes.exec(="" delete="" props[="" toggle="toggle" "toggle";="" "hide"="" "show"="" there="" stopped="" going="" proceed="" show,="" should="" pretend="" datashow[="" undefined="" else="" continue;="" orig[="" !jquery.isemptyobject(="" "hidden"="" "fxshow",="" {}="" store="" state="" its="" enables="" .stop().toggle()="" "reverse"="" datashow.hidden="!hidden;" jquery(="" ).show();="" anim.done(function()="" ).hide();="" prop;="" data_priv.remove(="" 0,="" !(="" tween.start="prop" propfilter(="" specialeasing="" index,="" name,="" easing,="" hooks;="" camelcase,="" expand="" csshook="" name="jQuery.camelCase(" easing="specialEasing[" jquery.isarray(="" "expand"="" quite="" $.extend,="" wont="" overwrite="" keys="" already="" present.="" also="" reusing="" 'index'="" above="" have="" correct="" "name"="" specialeasing[="" animation(="" properties,="" options="" result,="" stopped,="" deferred="jQuery.Deferred().always(" function()="" match="" :animated="" selector="" tick.elem;="" }),="" tick="function()" false;="" currenttime="fxNow" createfxnow(),="" remaining="Math.max(" animation.starttime="" animation.duration="" archaic="" crash="" bug="" won't="" allow="" us="" 0.5="" (#12497)="" temp="remaining" percent="1" temp,="" animation.tweens[="" ].run(="" deferred.notifywith(="" percent,="" ]);="" remaining;="" deferred.resolvewith(="" },="" elem:="" props:="" jquery.extend(="" {},="" opts:="" true,="" specialeasing:="" originalproperties:="" originaloptions:="" options,="" starttime:="" duration:="" options.duration,="" tweens:="" [],="" createtween:="" end="" animation.opts,="" end,="" animation.opts.specialeasing[="" animation.opts.easing="" animation.tweens.push(="" stop:="" gotoend="" want="" tweens="" otherwise="" part="" animation.tweens.length="" this;="" resolve="" played="" last="" frame="" otherwise,="" reject="" deferred.rejectwith(="" animation.opts.specialeasing="" result="animationPrefilters[" animation.opts="" result;="" jquery.map(="" createtween,="" jquery.isfunction(="" animation.opts.start="" animation.opts.start.call(="" jquery.fx.timer(="" tick,="" anim:="" animation.opts.queue="" })="" attach="" callbacks="" animation.progress(="" animation.opts.progress="" .done(="" animation.opts.done,="" animation.opts.complete="" .fail(="" animation.opts.fail="" .always(="" animation.opts.always="" jquery.animation="jQuery.extend(" tweener:="" callback="" ");="" ].unshift(="" prefilter:="" callback,="" prepend="" animationprefilters.unshift(="" animationprefilters.push(="" jquery.speed="function(" speed,="" fn="" opt="speed" typeof="" speed="==" "object"="" complete:="" !fn="" easing:="" !jquery.isfunction(="" opt.duration="jQuery.fx.off" "number"="" jquery.fx.speeds="" jquery.fx.speeds[="" jquery.fx.speeds._default;="" normalize="" opt.queue=""> "fx"4114 if ( opt.queue == null || opt.queue === true ) {4115 opt.queue = "fx";4116 }4117 // Queueing4118 opt.old = opt.complete;4119 opt.complete = function() {4120 if ( jQuery.isFunction( opt.old ) ) {4121 opt.old.call( this );4122 }4123 if ( opt.queue ) {4124 jQuery.dequeue( this, opt.queue );4125 }4126 };4127 return opt;4128};4129jQuery.fn.extend({4130 fadeTo: function( speed, to, easing, callback ) {4131 // show any hidden elements after setting opacity to 04132 return this.filter( isHidden ).css( "opacity", 0 ).show()4133 // animate to the value specified4134 .end().animate({ opacity: to }, speed, easing, callback );4135 },4136 animate: function( prop, speed, easing, callback ) {4137 var empty = jQuery.isEmptyObject( prop ),4138 optall = jQuery.speed( speed, easing, callback ),4139 doAnimation = function() {4140 // Operate on a copy of prop so per-property easing won't be lost4141 var anim = Animation( this, jQuery.extend( {}, prop ), optall );4142 // Empty animations, or finishing resolves immediately4143 if ( empty || data_priv.get( this, "finish" ) ) {4144 anim.stop( true );4145 }4146 };4147 doAnimation.finish = doAnimation;4148 return empty || optall.queue === false ?4149 this.each( doAnimation ) :4150 this.queue( optall.queue, doAnimation );4151 },4152 stop: function( type, clearQueue, gotoEnd ) {4153 var stopQueue = function( hooks ) {4154 var stop = hooks.stop;4155 delete hooks.stop;4156 stop( gotoEnd );4157 };4158 if ( typeof type !== "string" ) {4159 gotoEnd = clearQueue;4160 clearQueue = type;4161 type = undefined;4162 }4163 if ( clearQueue && type !== false ) {4164 this.queue( type || "fx", [] );4165 }4166 return this.each(function() {4167 var dequeue = true,4168 index = type != null && type + "queueHooks",4169 timers = jQuery.timers,4170 data = data_priv.get( this );4171 if ( index ) {4172 if ( data[ index ] && data[ index ].stop ) {4173 stopQueue( data[ index ] );4174 }4175 } else {4176 for ( index in data ) {4177 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {4178 stopQueue( data[ index ] );4179 }4180 }4181 }4182 for ( index = timers.length; index--; ) {4183 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {4184 timers[ index ].anim.stop( gotoEnd );4185 dequeue = false;4186 timers.splice( index, 1 );4187 }4188 }4189 // start the next in the queue if the last step wasn't forced4190 // timers currently will call their complete callbacks, which will dequeue4191 // but only if they were gotoEnd4192 if ( dequeue || !gotoEnd ) {4193 jQuery.dequeue( this, type );4194 }4195 });4196 },4197 finish: function( type ) {4198 if ( type !== false ) {4199 type = type || "fx";4200 }4201 return this.each(function() {4202 var index,4203 data = data_priv.get( this ),4204 queue = data[ type + "queue" ],4205 hooks = data[ type + "queueHooks" ],4206 timers = jQuery.timers,4207 length = queue ? queue.length : 0;4208 // enable finishing flag on private data4209 data.finish = true;4210 // empty the queue first4211 jQuery.queue( this, type, [] );4212 if ( hooks && hooks.stop ) {4213 hooks.stop.call( this, true );4214 }4215 // look for any active animations, and finish them4216 for ( index = timers.length; index--; ) {4217 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {4218 timers[ index ].anim.stop( true );4219 timers.splice( index, 1 );4220 }4221 }4222 // look for any animations in the old queue and finish them4223 for ( index = 0; index < length; index++ ) {4224 if ( queue[ index ] && queue[ index ].finish ) {4225 queue[ index ].finish.call( this );4226 }4227 }4228 // turn off finishing flag4229 delete data.finish;4230 });4231 }4232});4233jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {4234 var cssFn = jQuery.fn[ name ];4235 jQuery.fn[ name ] = function( speed, easing, callback ) {4236 return speed == null || typeof speed === "boolean" ?4237 cssFn.apply( this, arguments ) :4238 this.animate( genFx( name, true ), speed, easing, callback );4239 };4240});4241// Generate shortcuts for custom animations4242jQuery.each({4243 slideDown: genFx("show"),4244 slideUp: genFx("hide"),4245 slideToggle: genFx("toggle"),4246 fadeIn: { opacity: "show" },4247 fadeOut: { opacity: "hide" },4248 fadeToggle: { opacity: "toggle" }4249}, function( name, props ) {4250 jQuery.fn[ name ] = function( speed, easing, callback ) {4251 return this.animate( props, speed, easing, callback );4252 };4253});4254jQuery.timers = [];4255jQuery.fx.tick = function() {4256 var timer,4257 i = 0,4258 timers = jQuery.timers;4259 fxNow = jQuery.now();4260 for ( ; i < timers.length; i++ ) {4261 timer = timers[ i ];4262 // Checks the timer has not already been removed4263 if ( !timer() && timers[ i ] === timer ) {4264 timers.splice( i--, 1 );4265 }4266 }4267 if ( !timers.length ) {4268 jQuery.fx.stop();4269 }4270 fxNow = undefined;4271};4272jQuery.fx.timer = function( timer ) {4273 jQuery.timers.push( timer );4274 if ( timer() ) {4275 jQuery.fx.start();4276 } else {4277 jQuery.timers.pop();4278 }4279};4280jQuery.fx.interval = 13;4281jQuery.fx.start = function() {4282 if ( !timerId ) {4283 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );4284 }4285};4286jQuery.fx.stop = function() {4287 clearInterval( timerId );4288 timerId = null;4289};4290jQuery.fx.speeds = {4291 slow: 600,4292 fast: 200,4293 // Default speed4294 _default: 4004295};4296// Based off of the plugin by Clint Helfers, with permission.4297// http://blindsignals.com/index.php/2009/07/jquery-delay/4298jQuery.fn.delay = function( time, type ) {4299 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;4300 type = type || "fx";4301 return this.queue( type, function( next, hooks ) {4302 var timeout = setTimeout( next, time );4303 hooks.stop = function() {4304 clearTimeout( timeout );4305 };4306 });4307};4308(function() {4309 var input = document.createElement( "input" ),4310 select = document.createElement( "select" ),4311 opt = select.appendChild( document.createElement( "option" ) );4312 input.type = "checkbox";4313 // Support: iOS 5.1, Android 4.x, Android 2.34314 // Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)4315 support.checkOn = input.value !== "";4316 // Must access the parent to make an option select properly4317 // Support: IE9, IE104318 support.optSelected = opt.selected;4319 // Make sure that the options inside disabled selects aren't marked as disabled4320 // (WebKit marks them as disabled)4321 select.disabled = true;4322 support.optDisabled = !opt.disabled;4323 // Check if an input maintains its value after becoming a radio4324 // Support: IE9, IE104325 input = document.createElement( "input" );4326 input.value = "t";4327 input.type = "radio";4328 support.radioValue = input.value === "t";4329})();4330var nodeHook, boolHook,4331 attrHandle = jQuery.expr.attrHandle;4332jQuery.fn.extend({4333 attr: function( name, value ) {4334 return access( this, jQuery.attr, name, value, arguments.length > 1 );4335 },4336 removeAttr: function( name ) {4337 return this.each(function() {4338 jQuery.removeAttr( this, name );4339 });4340 }4341});4342jQuery.extend({4343 attr: function( elem, name, value ) {4344 var hooks, ret,4345 nType = elem.nodeType;4346 // don't get/set attributes on text, comment and attribute nodes4347 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {4348 return;4349 }4350 // Fallback to prop when attributes are not supported4351 if ( typeof elem.getAttribute === strundefined ) {4352 return jQuery.prop( elem, name, value );4353 }4354 // All attributes are lowercase4355 // Grab necessary hook if one is defined4356 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {4357 name = name.toLowerCase();4358 hooks = jQuery.attrHooks[ name ] ||4359 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );4360 }4361 if ( value !== undefined ) {4362 if ( value === null ) {4363 jQuery.removeAttr( elem, name );4364 } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {4365 return ret;4366 } else {4367 elem.setAttribute( name, value + "" );4368 return value;4369 }4370 } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {4371 return ret;4372 } else {4373 ret = jQuery.find.attr( elem, name );4374 // Non-existent attributes return null, we normalize to undefined4375 return ret == null ?4376 undefined :4377 ret;4378 }4379 },4380 removeAttr: function( elem, value ) {4381 var name, propName,4382 i = 0,4383 attrNames = value && value.match( rnotwhite );4384 if ( attrNames && elem.nodeType === 1 ) {4385 while ( (name = attrNames[i++]) ) {4386 propName = jQuery.propFix[ name ] || name;4387 // Boolean attributes get special treatment (#10870)4388 if ( jQuery.expr.match.bool.test( name ) ) {4389 // Set corresponding property to false4390 elem[ propName ] = false;4391 }4392 elem.removeAttribute( name );4393 }4394 }4395 },4396 attrHooks: {4397 type: {4398 set: function( elem, value ) {4399 if ( !support.radioValue && value === "radio" &&4400 jQuery.nodeName( elem, "input" ) ) {4401 // Setting the type on a radio button after the value resets the value in IE6-94402 // Reset value to default in case type is set after value during creation4403 var val = elem.value;4404 elem.setAttribute( "type", value );4405 if ( val ) {4406 elem.value = val;4407 }4408 return value;4409 }4410 }4411 }4412 }4413});4414// Hooks for boolean attributes4415boolHook = {4416 set: function( elem, value, name ) {4417 if ( value === false ) {4418 // Remove boolean attributes when set to false4419 jQuery.removeAttr( elem, name );4420 } else {4421 elem.setAttribute( name, name );4422 }4423 return name;4424 }4425};4426jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {4427 var getter = attrHandle[ name ] || jQuery.find.attr;4428 attrHandle[ name ] = function( elem, name, isXML ) {4429 var ret, handle;4430 if ( !isXML ) {4431 // Avoid an infinite loop by temporarily removing this function from the getter4432 handle = attrHandle[ name ];4433 attrHandle[ name ] = ret;4434 ret = getter( elem, name, isXML ) != null ?4435 name.toLowerCase() :4436 null;4437 attrHandle[ name ] = handle;4438 }4439 return ret;4440 };4441});4442var rfocusable = /^(?:input|select|textarea|button)$/i;4443jQuery.fn.extend({4444 prop: function( name, value ) {4445 return access( this, jQuery.prop, name, value, arguments.length > 1 );4446 },4447 removeProp: function( name ) {4448 return this.each(function() {4449 delete this[ jQuery.propFix[ name ] || name ];4450 });4451 }4452});4453jQuery.extend({4454 propFix: {4455 "for": "htmlFor",4456 "class": "className"4457 },4458 prop: function( elem, name, value ) {4459 var ret, hooks, notxml,4460 nType = elem.nodeType;4461 // don't get/set properties on text, comment and attribute nodes4462 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {4463 return;4464 }4465 notxml = nType !== 1 || !jQuery.isXMLDoc( elem );4466 if ( notxml ) {4467 // Fix name and attach hooks4468 name = jQuery.propFix[ name ] || name;4469 hooks = jQuery.propHooks[ name ];4470 }4471 if ( value !== undefined ) {4472 return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?4473 ret :4474 ( elem[ name ] = value );4475 } else {4476 return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?4477 ret :4478 elem[ name ];4479 }4480 },4481 propHooks: {4482 tabIndex: {4483 get: function( elem ) {4484 return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?4485 elem.tabIndex :4486 -1;4487 }4488 }4489 }4490});4491// Support: IE9+4492// Selectedness for an option in an optgroup can be inaccurate4493if ( !support.optSelected ) {4494 jQuery.propHooks.selected = {4495 get: function( elem ) {4496 var parent = elem.parentNode;4497 if ( parent && parent.parentNode ) {4498 parent.parentNode.selectedIndex;4499 }4500 return null;4501 }4502 };4503}4504jQuery.each([4505 "tabIndex",4506 "readOnly",4507 "maxLength",4508 "cellSpacing",4509 "cellPadding",4510 "rowSpan",4511 "colSpan",4512 "useMap",4513 "frameBorder",4514 "contentEditable"4515], function() {4516 jQuery.propFix[ this.toLowerCase() ] = this;4517});4518var rclass = /[\t\r\n\f]/g;4519jQuery.fn.extend({4520 addClass: function( value ) {4521 var classes, elem, cur, clazz, j, finalValue,4522 proceed = typeof value === "string" && value,4523 i = 0,4524 len = this.length;4525 if ( jQuery.isFunction( value ) ) {4526 return this.each(function( j ) {4527 jQuery( this ).addClass( value.call( this, j, this.className ) );4528 });4529 }4530 if ( proceed ) {4531 // The disjunction here is for better compressibility (see removeClass)4532 classes = ( value || "" ).match( rnotwhite ) || [];4533 for ( ; i < len; i++ ) {4534 elem = this[ i ];4535 cur = elem.nodeType === 1 && ( elem.className ?4536 ( " " + elem.className + " " ).replace( rclass, " " ) :4537 " "4538 );4539 if ( cur ) {4540 j = 0;4541 while ( (clazz = classes[j++]) ) {4542 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {4543 cur += clazz + " ";4544 }4545 }4546 // only assign if different to avoid unneeded rendering.4547 finalValue = jQuery.trim( cur );4548 if ( elem.className !== finalValue ) {4549 elem.className = finalValue;4550 }4551 }4552 }4553 }4554 return this;4555 },4556 removeClass: function( value ) {4557 var classes, elem, cur, clazz, j, finalValue,4558 proceed = arguments.length === 0 || typeof value === "string" && value,4559 i = 0,4560 len = this.length;4561 if ( jQuery.isFunction( value ) ) {4562 return this.each(function( j ) {4563 jQuery( this ).removeClass( value.call( this, j, this.className ) );4564 });4565 }4566 if ( proceed ) {4567 classes = ( value || "" ).match( rnotwhite ) || [];4568 for ( ; i < len; i++ ) {4569 elem = this[ i ];4570 // This expression is here for better compressibility (see addClass)4571 cur = elem.nodeType === 1 && ( elem.className ?4572 ( " " + elem.className + " " ).replace( rclass, " " ) :4573 ""4574 );4575 if ( cur ) {4576 j = 0;4577 while ( (clazz = classes[j++]) ) {4578 // Remove *all* instances4579 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {4580 cur = cur.replace( " " + clazz + " ", " " );4581 }4582 }4583 // only assign if different to avoid unneeded rendering.4584 finalValue = value ? jQuery.trim( cur ) : "";4585 if ( elem.className !== finalValue ) {4586 elem.className = finalValue;4587 }4588 }4589 }4590 }4591 return this;4592 },4593 toggleClass: function( value, stateVal ) {4594 var type = typeof value;4595 if ( typeof stateVal === "boolean" && type === "string" ) {4596 return stateVal ? this.addClass( value ) : this.removeClass( value );4597 }4598 if ( jQuery.isFunction( value ) ) {4599 return this.each(function( i ) {4600 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );4601 });4602 }4603 return this.each(function() {4604 if ( type === "string" ) {4605 // toggle individual class names4606 var className,4607 i = 0,4608 self = jQuery( this ),4609 classNames = value.match( rnotwhite ) || [];4610 while ( (className = classNames[ i++ ]) ) {4611 // check each className given, space separated list4612 if ( self.hasClass( className ) ) {4613 self.removeClass( className );4614 } else {4615 self.addClass( className );4616 }4617 }4618 // Toggle whole class name4619 } else if ( type === strundefined || type === "boolean" ) {4620 if ( this.className ) {4621 // store className if set4622 data_priv.set( this, "__className__", this.className );4623 }4624 // If the element has a class name or if we're passed "false",4625 // then remove the whole classname (if there was one, the above saved it).4626 // Otherwise bring back whatever was previously saved (if anything),4627 // falling back to the empty string if nothing was stored.4628 this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";4629 }4630 });4631 },4632 hasClass: function( selector ) {4633 var className = " " + selector + " ",4634 i = 0,4635 l = this.length;4636 for ( ; i < l; i++ ) {4637 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {4638 return true;4639 }4640 }4641 return false;4642 }4643});4644var rreturn = /\r/g;4645jQuery.fn.extend({4646 val: function( value ) {4647 var hooks, ret, isFunction,4648 elem = this[0];4649 if ( !arguments.length ) {4650 if ( elem ) {4651 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];4652 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {4653 return ret;4654 }4655 ret = elem.value;4656 return typeof ret === "string" ?4657 // handle most common string cases4658 ret.replace(rreturn, "") :4659 // handle cases where value is null/undef or number4660 ret == null ? "" : ret;4661 }4662 return;4663 }4664 isFunction = jQuery.isFunction( value );4665 return this.each(function( i ) {...
jquery-3.3.1.js
Source:jquery-3.3.1.js
...422 * @param {String} type423 */424function createInputPseudo( type ) {425 return function( elem ) {426 var name = elem.nodeName.toLowerCase();427 return name === "input" && elem.type === type;428 };429}430/**431 * Returns a function to use in pseudos for buttons432 * @param {String} type433 */434function createButtonPseudo( type ) {435 return function( elem ) {436 var name = elem.nodeName.toLowerCase();437 return (name === "input" || name === "button") && elem.type === type;438 };439}440/**441 * Returns a function to use in pseudos for :enabled/:disabled442 * @param {Boolean} disabled true for :disabled; false for :enabled443 */444function createDisabledPseudo( disabled ) {445 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable446 return function( elem ) {447 // Only certain elements can match :enabled or :disabled448 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled449 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled450 if ( "form" in elem ) {451 // Check for inherited disabledness on relevant non-disabled elements:452 // * listed form-associated elements in a disabled fieldset453 // https://html.spec.whatwg.org/multipage/forms.html#category-listed454 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled455 // * option elements in a disabled optgroup456 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled457 // All such elements have a "form" property.458 if ( elem.parentNode && elem.disabled === false ) {459 // Option elements defer to a parent optgroup if present460 if ( "label" in elem ) {461 if ( "label" in elem.parentNode ) {462 return elem.parentNode.disabled === disabled;463 } else {464 return elem.disabled === disabled;465 }466 }467 // Support: IE 6 - 11468 // Use the isDisabled shortcut property to check for disabled fieldset ancestors469 return elem.isDisabled === disabled ||470 // Where there is no isDisabled, check manually471 /* jshint -W018 */472 elem.isDisabled !== !disabled &&473 disabledAncestor( elem ) === disabled;474 }475 return elem.disabled === disabled;476 // Try to winnow out elements that can't be disabled before trusting the disabled property.477 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't478 // even exist on them, let alone have a boolean value.479 } else if ( "label" in elem ) {480 return elem.disabled === disabled;481 }482 // Remaining elements are neither :enabled nor :disabled483 return false;484 };485}486/**487 * Returns a function to use in pseudos for positionals488 * @param {Function} fn489 */490function createPositionalPseudo( fn ) {491 return markFunction(function( argument ) {492 argument = +argument;493 return markFunction(function( seed, matches ) {494 var j,495 matchIndexes = fn( [], seed.length, argument ),496 i = matchIndexes.length;497 // Match elements found at the specified indexes498 while ( i-- ) {499 if ( seed[ (j = matchIndexes[i]) ] ) {500 seed[j] = !(matches[j] = seed[j]);501 }502 }503 });504 });505}506/**507 * Checks a node for validity as a Sizzle context508 * @param {Element|Object=} context509 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value510 */511function testContext( context ) {512 return context && typeof context.getElementsByTagName !== "undefined" && context;513}514// Expose support vars for convenience515support = Sizzle.support = {};516/**517 * Detects XML nodes518 * @param {Element|Object} elem An element or a document519 * @returns {Boolean} True iff elem is a non-HTML XML node520 */521isXML = Sizzle.isXML = function( elem ) {522 // documentElement is verified for cases where it doesn't yet exist523 // (such as loading iframes in IE - #4833)524 var documentElement = elem && (elem.ownerDocument || elem).documentElement;525 return documentElement ? documentElement.nodeName !== "HTML" : false;526};527/**528 * Sets document-related variables once based on the current document529 * @param {Element|Object} [doc] An element or document object to use to set the document530 * @returns {Object} Returns the current document531 */532setDocument = Sizzle.setDocument = function( node ) {533 var hasCompare, subWindow,534 doc = node ? node.ownerDocument || node : preferredDoc;535 // Return early if doc is invalid or already selected536 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {537 return document;538 }539 // Update global variables540 document = doc;541 docElem = document.documentElement;542 documentIsHTML = !isXML( document );543 // Support: IE 9-11, Edge544 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)545 if ( preferredDoc !== document &&546 (subWindow = document.defaultView) && subWindow.top !== subWindow ) {547 // Support: IE 11, Edge548 if ( subWindow.addEventListener ) {549 subWindow.addEventListener( "unload", unloadHandler, false );550 // Support: IE 9 - 10 only551 } else if ( subWindow.attachEvent ) {552 subWindow.attachEvent( "onunload", unloadHandler );553 }554 }555 /* Attributes556 ---------------------------------------------------------------------- */557 // Support: IE<8 1="" 6="" 7="" 9="" 12359="" 13378="" verify="" that="" getattribute="" really="" returns="" attributes="" and="" not="" properties="" (excepting="" ie8="" booleans)="" support.attributes="assert(function(" el="" )="" {="" el.classname="i" ;="" return="" !el.getattribute("classname");="" });="" *="" getelement(s)by*="" ----------------------------------------------------------------------="" check="" if="" getelementsbytagname("*")="" only="" elements="" support.getelementsbytagname="assert(function(" el.appendchild(="" document.createcomment("")="" );="" !el.getelementsbytagname("*").length;="" support:="" ie<9="" support.getelementsbyclassname="rnative.test(" document.getelementsbyclassname="" ie<10="" getelementbyid="" by="" name="" the="" broken="" methods="" don't="" pick="" up="" programmatically-set="" names,="" so="" use="" a="" roundabout="" getelementsbyname="" test="" support.getbyid="assert(function(" docelem.appendchild(="" ).id="expando;" !document.getelementsbyname="" ||="" !document.getelementsbyname(="" expando="" ).length;="" id="" filter="" find="" (="" expr.filter["id"]="function(" var="" attrid="id.replace(" runescape,="" funescape="" function(="" elem="" elem.getattribute("id")="==" attrid;="" };="" expr.find["id"]="function(" id,="" context="" typeof="" context.getelementbyid="" !="=" "undefined"="" &&="" documentishtml="" ?="" [="" ]="" :="" [];="" }="" else="" node="typeof" elem.getattributenode="" elem.getattributenode("id");="" node.value="==" ie="" -="" is="" reliable="" as="" shortcut="" node,="" i,="" elems,="" attribute="" ];="" fall="" back="" on="" elems="context.getElementsByName(" i="0;" while="" (elem="elems[i++])" tag="" expr.find["tag"]="support.getElementsByTagName" tag,="" context.getelementsbytagname="" context.getelementsbytagname(="" documentfragment="" nodes="" have="" gebtn="" support.qsa="" context.queryselectorall(="" elem,="" tmp="[]," happy="" coincidence,="" (broken)="" appears="" too="" results="context.getElementsByTagName(" out="" possible="" comments="" "*"="" elem.nodetype="==" tmp.push(="" tmp;="" results;="" class="" expr.find["class"]="support.getElementsByClassName" classname,="" context.getelementsbyclassname="" context.getelementsbyclassname(="" classname="" qsa="" matchesselector="" support="" matchesselector(:active)="" reports="" false="" when="" true="" (ie9="" opera="" 11.5)="" rbuggymatches="[];" qsa(:focus)="" (chrome="" 21)="" we="" allow="" this="" because="" of="" bug="" in="" throws="" an="" error="" whenever="" `document.activeelement`="" accessed="" iframe="" so,="" :focus="" to="" pass="" through="" all="" time="" avoid="" see="" https:="" bugs.jquery.com="" ticket="" rbuggyqsa="[];" (support.qsa="rnative.test(" document.queryselectorall="" ))="" build="" regex="" strategy="" adopted="" from="" diego="" perini="" assert(function(="" select="" set="" empty="" string="" purpose="" ie's="" treatment="" explicitly="" setting="" boolean="" content="" attribute,="" since="" its="" presence="" should="" be="" enough="" ).innerhtml="<a id='" +="" "'="">" +558 "<select id="" + expando + "-\r\\" msallowcapture="">" +559 "<option selected></option></select>";560 // Support: IE8, Opera 11-12.16561 // Nothing should be selected when empty strings follow ^= or $= or *=562 // The test attribute must be unknown in Opera but "safe" for WinRT563 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section564 if ( el.querySelectorAll("[msallowcapture^='']").length ) {565 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );566 }567 // Support: IE8568 // Boolean attributes and "value" are not treated correctly569 if ( !el.querySelectorAll("[selected]").length ) {570 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );571 }572 // Support: Chrome<29, android<4.4,="" safari<7.0+,="" ios<7.0+,="" phantomjs<1.9.8+="" if="" (="" !el.queryselectorall(="" "[id~=" + expando + " -]"="" ).length="" )="" {="" rbuggyqsa.push("~=");573 }574 // Webkit/Opera - :checked should return selected option elements575 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked576 // IE8 throws error here and will not see later tests577 if ( !el.querySelectorAll(" :checked").length="" rbuggyqsa.push(":checked");="" }="" support:="" safari="" 8+,="" ios="" 8+="" https:="" bugs.webkit.org="" show_bug.cgi?id="136851" in-page="" `selector#id="" sibling-combinator="" selector`="" fails="" "a#"="" +="" expando="" "+*"="" rbuggyqsa.push(".#.+[+~]");="" });="" assert(function(="" el="" el.innerhtml="<a href='' disabled='disabled'></a>" "<select="" disabled="disabled"><option>";578 // Support: Windows 8 Native Apps579 // The type and name attributes are restricted during .innerHTML assignment580 var input = document.createElement("input");581 input.setAttribute( "type", "hidden" );582 el.appendChild( input ).setAttribute( "name", "D" );583 // Support: IE8584 // Enforce case-sensitivity of name attribute585 if ( el.querySelectorAll("[name=d]").length ) {586 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );587 }588 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)589 // IE8 throws error here and will not see later tests590 if ( el.querySelectorAll(":enabled").length !== 2 ) {591 rbuggyQSA.push( ":enabled", ":disabled" );592 }593 // Support: IE9-11+594 // IE's :disabled selector does not pick up the children of disabled fieldsets595 docElem.appendChild( el ).disabled = true;596 if ( el.querySelectorAll(":disabled").length !== 2 ) {597 rbuggyQSA.push( ":enabled", ":disabled" );598 }599 // Opera 10-11 does not throw on post-comma invalid pseudos600 el.querySelectorAll("*,:x");601 rbuggyQSA.push(",.*:");602 });603 }604 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||605 docElem.webkitMatchesSelector ||606 docElem.mozMatchesSelector ||607 docElem.oMatchesSelector ||608 docElem.msMatchesSelector) )) ) {609 assert(function( el ) {610 // Check to see if it's possible to do matchesSelector611 // on a disconnected node (IE 9)612 support.disconnectedMatch = matches.call( el, "*" );613 // This should fail with an exception614 // Gecko does not error, returns false instead615 matches.call( el, "[s!='']:x" );616 rbuggyMatches.push( "!=", pseudos );617 });618 }619 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );620 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );621 /* Contains622 ---------------------------------------------------------------------- */623 hasCompare = rnative.test( docElem.compareDocumentPosition );624 // Element contains another625 // Purposefully self-exclusive626 // As in, an element does not contain itself627 contains = hasCompare || rnative.test( docElem.contains ) ?628 function( a, b ) {629 var adown = a.nodeType === 9 ? a.documentElement : a,630 bup = b && b.parentNode;631 return a === bup || !!( bup && bup.nodeType === 1 && (632 adown.contains ?633 adown.contains( bup ) :634 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16635 ));636 } :637 function( a, b ) {638 if ( b ) {639 while ( (b = b.parentNode) ) {640 if ( b === a ) {641 return true;642 }643 }644 }645 return false;646 };647 /* Sorting648 ---------------------------------------------------------------------- */649 // Document order sorting650 sortOrder = hasCompare ?651 function( a, b ) {652 // Flag for duplicate removal653 if ( a === b ) {654 hasDuplicate = true;655 return 0;656 }657 // Sort on method existence if only one input has compareDocumentPosition658 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;659 if ( compare ) {660 return compare;661 }662 // Calculate position if both inputs belong to the same document663 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?664 a.compareDocumentPosition( b ) :665 // Otherwise we know they are disconnected666 1;667 // Disconnected nodes668 if ( compare & 1 ||669 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {670 // Choose the first element that is related to our preferred document671 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {672 return -1;673 }674 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {675 return 1;676 }677 // Maintain original order678 return sortInput ?679 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :680 0;681 }682 return compare & 4 ? -1 : 1;683 } :684 function( a, b ) {685 // Exit early if the nodes are identical686 if ( a === b ) {687 hasDuplicate = true;688 return 0;689 }690 var cur,691 i = 0,692 aup = a.parentNode,693 bup = b.parentNode,694 ap = [ a ],695 bp = [ b ];696 // Parentless nodes are either documents or disconnected697 if ( !aup || !bup ) {698 return a === document ? -1 :699 b === document ? 1 :700 aup ? -1 :701 bup ? 1 :702 sortInput ?703 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :704 0;705 // If the nodes are siblings, we can do a quick check706 } else if ( aup === bup ) {707 return siblingCheck( a, b );708 }709 // Otherwise we need full lists of their ancestors for comparison710 cur = a;711 while ( (cur = cur.parentNode) ) {712 ap.unshift( cur );713 }714 cur = b;715 while ( (cur = cur.parentNode) ) {716 bp.unshift( cur );717 }718 // Walk down the tree looking for a discrepancy719 while ( ap[i] === bp[i] ) {720 i++;721 }722 return i ?723 // Do a sibling check if the nodes have a common ancestor724 siblingCheck( ap[i], bp[i] ) :725 // Otherwise nodes in our document sort first726 ap[i] === preferredDoc ? -1 :727 bp[i] === preferredDoc ? 1 :728 0;729 };730 return document;731};732Sizzle.matches = function( expr, elements ) {733 return Sizzle( expr, null, null, elements );734};735Sizzle.matchesSelector = function( elem, expr ) {736 // Set document vars if needed737 if ( ( elem.ownerDocument || elem ) !== document ) {738 setDocument( elem );739 }740 // Make sure that attribute selectors are quoted741 expr = expr.replace( rattributeQuotes, "='$1']" );742 if ( support.matchesSelector && documentIsHTML &&743 !compilerCache[ expr + " " ] &&744 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&745 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {746 try {747 var ret = matches.call( elem, expr );748 // IE 9's matchesSelector returns false on disconnected nodes749 if ( ret || support.disconnectedMatch ||750 // As well, disconnected nodes are said to be in a document751 // fragment in IE 9752 elem.document && elem.document.nodeType !== 11 ) {753 return ret;754 }755 } catch (e) {}756 }757 return Sizzle( expr, document, null, [ elem ] ).length > 0;758};759Sizzle.contains = function( context, elem ) {760 // Set document vars if needed761 if ( ( context.ownerDocument || context ) !== document ) {762 setDocument( context );763 }764 return contains( context, elem );765};766Sizzle.attr = function( elem, name ) {767 // Set document vars if needed768 if ( ( elem.ownerDocument || elem ) !== document ) {769 setDocument( elem );770 }771 var fn = Expr.attrHandle[ name.toLowerCase() ],772 // Don't get fooled by Object.prototype properties (jQuery #13807)773 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?774 fn( elem, name, !documentIsHTML ) :775 undefined;776 return val !== undefined ?777 val :778 support.attributes || !documentIsHTML ?779 elem.getAttribute( name ) :780 (val = elem.getAttributeNode(name)) && val.specified ?781 val.value :782 null;783};784Sizzle.escape = function( sel ) {785 return (sel + "").replace( rcssescape, fcssescape );786};787Sizzle.error = function( msg ) {788 throw new Error( "Syntax error, unrecognized expression: " + msg );789};790/**791 * Document sorting and removing duplicates792 * @param {ArrayLike} results793 */794Sizzle.uniqueSort = function( results ) {795 var elem,796 duplicates = [],797 j = 0,798 i = 0;799 // Unless we *know* we can detect duplicates, assume their presence800 hasDuplicate = !support.detectDuplicates;801 sortInput = !support.sortStable && results.slice( 0 );802 results.sort( sortOrder );803 if ( hasDuplicate ) {804 while ( (elem = results[i++]) ) {805 if ( elem === results[ i ] ) {806 j = duplicates.push( i );807 }808 }809 while ( j-- ) {810 results.splice( duplicates[ j ], 1 );811 }812 }813 // Clear input after sorting to release objects814 // See https://github.com/jquery/sizzle/pull/225815 sortInput = null;816 return results;817};818/**819 * Utility function for retrieving the text value of an array of DOM nodes820 * @param {Array|Element} elem821 */822getText = Sizzle.getText = function( elem ) {823 var node,824 ret = "",825 i = 0,826 nodeType = elem.nodeType;827 if ( !nodeType ) {828 // If no nodeType, this is expected to be an array829 while ( (node = elem[i++]) ) {830 // Do not traverse comment nodes831 ret += getText( node );832 }833 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {834 // Use textContent for elements835 // innerText usage removed for consistency of new lines (jQuery #11153)836 if ( typeof elem.textContent === "string" ) {837 return elem.textContent;838 } else {839 // Traverse its children840 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {841 ret += getText( elem );842 }843 }844 } else if ( nodeType === 3 || nodeType === 4 ) {845 return elem.nodeValue;846 }847 // Do not include comment or processing instruction nodes848 return ret;849};850Expr = Sizzle.selectors = {851 // Can be adjusted by the user852 cacheLength: 50,853 createPseudo: markFunction,854 match: matchExpr,855 attrHandle: {},856 find: {},857 relative: {858 ">": { dir: "parentNode", first: true },859 " ": { dir: "parentNode" },860 "+": { dir: "previousSibling", first: true },861 "~": { dir: "previousSibling" }862 },863 preFilter: {864 "ATTR": function( match ) {865 match[1] = match[1].replace( runescape, funescape );866 // Move the given value to match[3] whether quoted or unquoted867 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );868 if ( match[2] === "~=" ) {869 match[3] = " " + match[3] + " ";870 }871 return match.slice( 0, 4 );872 },873 "CHILD": function( match ) {874 /* matches from matchExpr["CHILD"]875 1 type (only|nth|...)876 2 what (child|of-type)877 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)878 4 xn-component of xn+y argument ([+-]?\d*n|)879 5 sign of xn-component880 6 x of xn-component881 7 sign of y-component882 8 y of y-component883 */884 match[1] = match[1].toLowerCase();885 if ( match[1].slice( 0, 3 ) === "nth" ) {886 // nth-* requires argument887 if ( !match[3] ) {888 Sizzle.error( match[0] );889 }890 // numeric x and y parameters for Expr.filter.CHILD891 // remember that false/true cast respectively to 0/1892 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );893 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );894 // other types prohibit arguments895 } else if ( match[3] ) {896 Sizzle.error( match[0] );897 }898 return match;899 },900 "PSEUDO": function( match ) {901 var excess,902 unquoted = !match[6] && match[2];903 if ( matchExpr["CHILD"].test( match[0] ) ) {904 return null;905 }906 // Accept quoted arguments as-is907 if ( match[3] ) {908 match[2] = match[4] || match[5] || "";909 // Strip excess characters from unquoted arguments910 } else if ( unquoted && rpseudo.test( unquoted ) &&911 // Get excess from tokenize (recursively)912 (excess = tokenize( unquoted, true )) &&913 // advance to the next closing parenthesis914 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {915 // excess is a negative index916 match[0] = match[0].slice( 0, excess );917 match[2] = unquoted.slice( 0, excess );918 }919 // Return only captures needed by the pseudo filter method (type and argument)920 return match.slice( 0, 3 );921 }922 },923 filter: {924 "TAG": function( nodeNameSelector ) {925 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();926 return nodeNameSelector === "*" ?927 function() { return true; } :928 function( elem ) {929 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;930 };931 },932 "CLASS": function( className ) {933 var pattern = classCache[ className + " " ];934 return pattern ||935 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&936 classCache( className, function( elem ) {937 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );938 });939 },940 "ATTR": function( name, operator, check ) {941 return function( elem ) {942 var result = Sizzle.attr( elem, name );943 if ( result == null ) {944 return operator === "!=";945 }946 if ( !operator ) {947 return true;948 }949 result += "";950 return operator === "=" ? result === check :951 operator === "!=" ? result !== check :952 operator === "^=" ? check && result.indexOf( check ) === 0 :953 operator === "*=" ? check && result.indexOf( check ) > -1 :954 operator === "$=" ? check && result.slice( -check.length ) === check :955 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :956 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :957 false;958 };959 },960 "CHILD": function( type, what, argument, first, last ) {961 var simple = type.slice( 0, 3 ) !== "nth",962 forward = type.slice( -4 ) !== "last",963 ofType = what === "of-type";964 return first === 1 && last === 0 ?965 // Shortcut for :nth-*(n)966 function( elem ) {967 return !!elem.parentNode;968 } :969 function( elem, context, xml ) {970 var cache, uniqueCache, outerCache, node, nodeIndex, start,971 dir = simple !== forward ? "nextSibling" : "previousSibling",972 parent = elem.parentNode,973 name = ofType && elem.nodeName.toLowerCase(),974 useCache = !xml && !ofType,975 diff = false;976 if ( parent ) {977 // :(first|last|only)-(child|of-type)978 if ( simple ) {979 while ( dir ) {980 node = elem;981 while ( (node = node[ dir ]) ) {982 if ( ofType ?983 node.nodeName.toLowerCase() === name :984 node.nodeType === 1 ) {985 return false;986 }987 }988 // Reverse direction for :only-* (if we haven't yet done so)989 start = dir = type === "only" && !start && "nextSibling";990 }991 return true;992 }993 start = [ forward ? parent.firstChild : parent.lastChild ];994 // non-xml :nth-child(...) stores cache data on `parent`995 if ( forward && useCache ) {996 // Seek `elem` from a previously-cached index997 // ...in a gzip-friendly way998 node = parent;999 outerCache = node[ expando ] || (node[ expando ] = {});1000 // Support: IE <9 0="" 1="" 2="" only="" defend="" against="" cloned="" attroperties="" (jquery="" gh-1709)="" uniquecache="outerCache[" node.uniqueid="" ]="" ||="" (outercache[="" cache="uniqueCache[" type="" [];="" nodeindex="cache[" dirruns="" &&="" cache[="" ];="" diff="nodeIndex" node="nodeIndex" parent.childnodes[="" while="" (="" (node="++nodeIndex" node[="" dir="" fallback="" to="" seeking="" `elem`="" from="" the="" start="" (diff="nodeIndex" =="" 0)="" start.pop())="" )="" {="" when="" found,="" indexes="" on="" `parent`="" and="" break="" if="" node.nodetype="==" ++diff="" elem="" uniquecache[="" dirruns,="" nodeindex,="" break;="" }="" else="" use="" previously-cached="" element="" index="" available="" usecache="" ...in="" a="" gzip-friendly="" way="" outercache="node[" expando="" (node[="" support:="" ie="" <9="" xml="" :nth-child(...)="" or="" :nth-last-child(...)="" :nth(-last)?-of-type(...)="" false="" same="" loop as="" above="" seek="" oftype="" ?="" node.nodename.tolowercase()="==" name="" :="" of="" each="" encountered="" incorporate="" offset,="" then="" check="" cycle="" size="" -="last;" return="" first="" %="">= 0 );1001 }1002 };1003 },1004 "PSEUDO": function( pseudo, argument ) {1005 // pseudo-class names are case-insensitive1006 // http://www.w3.org/TR/selectors/#pseudo-classes1007 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters1008 // Remember that setFilters inherits from pseudos1009 var args,1010 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||1011 Sizzle.error( "unsupported pseudo: " + pseudo );1012 // The user may use createPseudo to indicate that1013 // arguments are needed to create the filter function1014 // just as Sizzle does1015 if ( fn[ expando ] ) {1016 return fn( argument );1017 }1018 // But maintain support for old signatures1019 if ( fn.length > 1 ) {1020 args = [ pseudo, pseudo, "", argument ];1021 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?1022 markFunction(function( seed, matches ) {1023 var idx,1024 matched = fn( seed, argument ),1025 i = matched.length;1026 while ( i-- ) {1027 idx = indexOf( seed, matched[i] );1028 seed[ idx ] = !( matches[ idx ] = matched[i] );1029 }1030 }) :1031 function( elem ) {1032 return fn( elem, 0, args );1033 };1034 }1035 return fn;1036 }1037 },1038 pseudos: {1039 // Potentially complex pseudos1040 "not": markFunction(function( selector ) {1041 // Trim the selector passed to compile1042 // to avoid treating leading and trailing1043 // spaces as combinators1044 var input = [],1045 results = [],1046 matcher = compile( selector.replace( rtrim, "$1" ) );1047 return matcher[ expando ] ?1048 markFunction(function( seed, matches, context, xml ) {1049 var elem,1050 unmatched = matcher( seed, null, xml, [] ),1051 i = seed.length;1052 // Match elements unmatched by `matcher`1053 while ( i-- ) {1054 if ( (elem = unmatched[i]) ) {1055 seed[i] = !(matches[i] = elem);1056 }1057 }1058 }) :1059 function( elem, context, xml ) {1060 input[0] = elem;1061 matcher( input, null, xml, results );1062 // Don't keep the element (issue #299)1063 input[0] = null;1064 return !results.pop();1065 };1066 }),1067 "has": markFunction(function( selector ) {1068 return function( elem ) {1069 return Sizzle( selector, elem ).length > 0;1070 };1071 }),1072 "contains": markFunction(function( text ) {1073 text = text.replace( runescape, funescape );1074 return function( elem ) {1075 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;1076 };1077 }),1078 // "Whether an element is represented by a :lang() selector1079 // is based solely on the element's language value1080 // being equal to the identifier C,1081 // or beginning with the identifier C immediately followed by "-".1082 // The matching of C against the element's language value is performed case-insensitively.1083 // The identifier C does not have to be a valid language name."1084 // http://www.w3.org/TR/selectors/#lang-pseudo1085 "lang": markFunction( function( lang ) {1086 // lang value must be a valid identifier1087 if ( !ridentifier.test(lang || "") ) {1088 Sizzle.error( "unsupported lang: " + lang );1089 }1090 lang = lang.replace( runescape, funescape ).toLowerCase();1091 return function( elem ) {1092 var elemLang;1093 do {1094 if ( (elemLang = documentIsHTML ?1095 elem.lang :1096 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {1097 elemLang = elemLang.toLowerCase();1098 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;1099 }1100 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );1101 return false;1102 };1103 }),1104 // Miscellaneous1105 "target": function( elem ) {1106 var hash = window.location && window.location.hash;1107 return hash && hash.slice( 1 ) === elem.id;1108 },1109 "root": function( elem ) {1110 return elem === docElem;1111 },1112 "focus": function( elem ) {1113 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);1114 },1115 // Boolean properties1116 "enabled": createDisabledPseudo( false ),1117 "disabled": createDisabledPseudo( true ),1118 "checked": function( elem ) {1119 // In CSS3, :checked should return both checked and selected elements1120 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked1121 var nodeName = elem.nodeName.toLowerCase();1122 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);1123 },1124 "selected": function( elem ) {1125 // Accessing this property makes selected-by-default1126 // options in Safari work properly1127 if ( elem.parentNode ) {1128 elem.parentNode.selectedIndex;1129 }1130 return elem.selected === true;1131 },1132 // Contents1133 "empty": function( elem ) {1134 // http://www.w3.org/TR/selectors/#empty-pseudo1135 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),1136 // but not by others (comment: 8; processing instruction: 7; etc.)1137 // nodeType < 6 works because attributes (2) do not appear as children1138 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {1139 if ( elem.nodeType < 6 ) {1140 return false;1141 }1142 }1143 return true;1144 },1145 "parent": function( elem ) {1146 return !Expr.pseudos["empty"]( elem );1147 },1148 // Element/input types1149 "header": function( elem ) {1150 return rheader.test( elem.nodeName );1151 },1152 "input": function( elem ) {1153 return rinputs.test( elem.nodeName );1154 },1155 "button": function( elem ) {1156 var name = elem.nodeName.toLowerCase();1157 return name === "input" && elem.type === "button" || name === "button";1158 },1159 "text": function( elem ) {1160 var attr;1161 return elem.nodeName.toLowerCase() === "input" &&1162 elem.type === "text" &&1163 // Support: IE<8 0="" 1="" new="" html5="" attribute="" values="" (e.g.,="" "search")="" appear="" with="" elem.type="==" "text"="" (="" (attr="elem.getAttribute("type"))" =="null" ||="" attr.tolowercase()="==" );="" },="" position-in-collection="" "first":="" createpositionalpseudo(function()="" {="" return="" [="" ];="" }),="" "last":="" createpositionalpseudo(function(="" matchindexes,="" length="" )="" -="" "eq":="" length,="" argument="" <="" ?="" +="" :="" "even":="" var="" i="0;" for="" ;="" length;="" matchindexes.push(="" }="" matchindexes;="" "odd":="" "lt":="" argument;="" --i="">= 0; ) {1164 matchIndexes.push( i );1165 }1166 return matchIndexes;1167 }),1168 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {1169 var i = argument < 0 ? argument + length : argument;1170 for ( ; ++i < length; ) {1171 matchIndexes.push( i );1172 }1173 return matchIndexes;1174 })1175 }1176};1177Expr.pseudos["nth"] = Expr.pseudos["eq"];1178// Add button/input type pseudos1179for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {1180 Expr.pseudos[ i ] = createInputPseudo( i );1181}1182for ( i in { submit: true, reset: true } ) {1183 Expr.pseudos[ i ] = createButtonPseudo( i );1184}1185// Easy API for creating new setFilters1186function setFilters() {}1187setFilters.prototype = Expr.filters = Expr.pseudos;1188Expr.setFilters = new setFilters();1189tokenize = Sizzle.tokenize = function( selector, parseOnly ) {1190 var matched, match, tokens, type,1191 soFar, groups, preFilters,1192 cached = tokenCache[ selector + " " ];1193 if ( cached ) {1194 return parseOnly ? 0 : cached.slice( 0 );1195 }1196 soFar = selector;1197 groups = [];1198 preFilters = Expr.preFilter;1199 while ( soFar ) {1200 // Comma and first run1201 if ( !matched || (match = rcomma.exec( soFar )) ) {1202 if ( match ) {1203 // Don't consume trailing commas as valid1204 soFar = soFar.slice( match[0].length ) || soFar;1205 }1206 groups.push( (tokens = []) );1207 }1208 matched = false;1209 // Combinators1210 if ( (match = rcombinators.exec( soFar )) ) {1211 matched = match.shift();1212 tokens.push({1213 value: matched,1214 // Cast descendant combinators to space1215 type: match[0].replace( rtrim, " " )1216 });1217 soFar = soFar.slice( matched.length );1218 }1219 // Filters1220 for ( type in Expr.filter ) {1221 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||1222 (match = preFilters[ type ]( match ))) ) {1223 matched = match.shift();1224 tokens.push({1225 value: matched,1226 type: type,1227 matches: match1228 });1229 soFar = soFar.slice( matched.length );1230 }1231 }1232 if ( !matched ) {1233 break;1234 }1235 }1236 // Return the length of the invalid excess1237 // if we're just parsing1238 // Otherwise, throw an error or return tokens1239 return parseOnly ?1240 soFar.length :1241 soFar ?1242 Sizzle.error( selector ) :1243 // Cache the tokens1244 tokenCache( selector, groups ).slice( 0 );1245};1246function toSelector( tokens ) {1247 var i = 0,1248 len = tokens.length,1249 selector = "";1250 for ( ; i < len; i++ ) {1251 selector += tokens[i].value;1252 }1253 return selector;1254}1255function addCombinator( matcher, combinator, base ) {1256 var dir = combinator.dir,1257 skip = combinator.next,1258 key = skip || dir,1259 checkNonElements = base && key === "parentNode",1260 doneName = done++;1261 return combinator.first ?1262 // Check against closest ancestor/preceding element1263 function( elem, context, xml ) {1264 while ( (elem = elem[ dir ]) ) {1265 if ( elem.nodeType === 1 || checkNonElements ) {1266 return matcher( elem, context, xml );1267 }1268 }1269 return false;1270 } :1271 // Check against all ancestor/preceding elements1272 function( elem, context, xml ) {1273 var oldCache, uniqueCache, outerCache,1274 newCache = [ dirruns, doneName ];1275 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching1276 if ( xml ) {1277 while ( (elem = elem[ dir ]) ) {1278 if ( elem.nodeType === 1 || checkNonElements ) {1279 if ( matcher( elem, context, xml ) ) {1280 return true;1281 }1282 }1283 }1284 } else {1285 while ( (elem = elem[ dir ]) ) {1286 if ( elem.nodeType === 1 || checkNonElements ) {1287 outerCache = elem[ expando ] || (elem[ expando ] = {});1288 // Support: IE <9 0="" 1="" 2="" only="" defend="" against="" cloned="" attroperties="" (jquery="" gh-1709)="" uniquecache="outerCache[" elem.uniqueid="" ]="" ||="" (outercache[="" if="" (="" skip="" &&="" elem.nodename.tolowercase()="" )="" {="" elem="elem[" dir="" elem;="" }="" else="" (oldcache="uniqueCache[" key="" ])="" oldcache[="" dirruns="" donename="" assign="" to="" newcache="" so="" results="" back-propagate="" previous="" elements="" return="" (newcache[="" ]);="" reuse="" uniquecache[="" a="" match="" means="" we're="" done;="" fail="" we="" have="" keep="" checking="" elem,="" context,="" xml="" ))="" true;="" false;="" };="" function="" elementmatcher(="" matchers="" matchers.length=""> 1 ?1289 function( elem, context, xml ) {1290 var i = matchers.length;1291 while ( i-- ) {1292 if ( !matchers[i]( elem, context, xml ) ) {1293 return false;1294 }1295 }1296 return true;1297 } :1298 matchers[0];1299}1300function multipleContexts( selector, contexts, results ) {1301 var i = 0,1302 len = contexts.length;1303 for ( ; i < len; i++ ) {1304 Sizzle( selector, contexts[i], results );1305 }1306 return results;1307}1308function condense( unmatched, map, filter, context, xml ) {1309 var elem,1310 newUnmatched = [],1311 i = 0,1312 len = unmatched.length,1313 mapped = map != null;1314 for ( ; i < len; i++ ) {1315 if ( (elem = unmatched[i]) ) {1316 if ( !filter || filter( elem, context, xml ) ) {1317 newUnmatched.push( elem );1318 if ( mapped ) {1319 map.push( i );1320 }1321 }1322 }1323 }1324 return newUnmatched;1325}1326function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {1327 if ( postFilter && !postFilter[ expando ] ) {1328 postFilter = setMatcher( postFilter );1329 }1330 if ( postFinder && !postFinder[ expando ] ) {1331 postFinder = setMatcher( postFinder, postSelector );1332 }1333 return markFunction(function( seed, results, context, xml ) {1334 var temp, i, elem,1335 preMap = [],1336 postMap = [],1337 preexisting = results.length,1338 // Get initial elements from seed or context1339 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),1340 // Prefilter to get matcher input, preserving a map for seed-results synchronization1341 matcherIn = preFilter && ( seed || !selector ) ?1342 condense( elems, preMap, preFilter, context, xml ) :1343 elems,1344 matcherOut = matcher ?1345 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,1346 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?1347 // ...intermediate processing is necessary1348 [] :1349 // ...otherwise use results directly1350 results :1351 matcherIn;1352 // Find primary matches1353 if ( matcher ) {1354 matcher( matcherIn, matcherOut, context, xml );1355 }1356 // Apply postFilter1357 if ( postFilter ) {1358 temp = condense( matcherOut, postMap );1359 postFilter( temp, [], context, xml );1360 // Un-match failing elements by moving them back to matcherIn1361 i = temp.length;1362 while ( i-- ) {1363 if ( (elem = temp[i]) ) {1364 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);1365 }1366 }1367 }1368 if ( seed ) {1369 if ( postFinder || preFilter ) {1370 if ( postFinder ) {1371 // Get the final matcherOut by condensing this intermediate into postFinder contexts1372 temp = [];1373 i = matcherOut.length;1374 while ( i-- ) {1375 if ( (elem = matcherOut[i]) ) {1376 // Restore matcherIn since elem is not yet a final match1377 temp.push( (matcherIn[i] = elem) );1378 }1379 }1380 postFinder( null, (matcherOut = []), temp, xml );1381 }1382 // Move matched elements from seed to results to keep them synchronized1383 i = matcherOut.length;1384 while ( i-- ) {1385 if ( (elem = matcherOut[i]) &&1386 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {1387 seed[temp] = !(results[temp] = elem);1388 }1389 }1390 }1391 // Add elements to results, through postFinder if defined1392 } else {1393 matcherOut = condense(1394 matcherOut === results ?1395 matcherOut.splice( preexisting, matcherOut.length ) :1396 matcherOut1397 );1398 if ( postFinder ) {1399 postFinder( null, results, matcherOut, xml );1400 } else {1401 push.apply( results, matcherOut );1402 }1403 }1404 });1405}1406function matcherFromTokens( tokens ) {1407 var checkContext, matcher, j,1408 len = tokens.length,1409 leadingRelative = Expr.relative[ tokens[0].type ],1410 implicitRelative = leadingRelative || Expr.relative[" "],1411 i = leadingRelative ? 1 : 0,1412 // The foundational matcher ensures that elements are reachable from top-level context(s)1413 matchContext = addCombinator( function( elem ) {1414 return elem === checkContext;1415 }, implicitRelative, true ),1416 matchAnyContext = addCombinator( function( elem ) {1417 return indexOf( checkContext, elem ) > -1;1418 }, implicitRelative, true ),1419 matchers = [ function( elem, context, xml ) {1420 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (1421 (checkContext = context).nodeType ?1422 matchContext( elem, context, xml ) :1423 matchAnyContext( elem, context, xml ) );1424 // Avoid hanging onto element (issue #299)1425 checkContext = null;1426 return ret;1427 } ];1428 for ( ; i < len; i++ ) {1429 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {1430 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];1431 } else {1432 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );1433 // Return special upon seeing a positional matcher1434 if ( matcher[ expando ] ) {1435 // Find the next relative operator (if any) for proper handling1436 j = ++i;1437 for ( ; j < len; j++ ) {1438 if ( Expr.relative[ tokens[j].type ] ) {1439 break;1440 }1441 }1442 return setMatcher(1443 i > 1 && elementMatcher( matchers ),1444 i > 1 && toSelector(1445 // If the preceding token was a descendant combinator, insert an implicit any-element `*`1446 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })1447 ).replace( rtrim, "$1" ),1448 matcher,1449 i < j && matcherFromTokens( tokens.slice( i, j ) ),1450 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),1451 j < len && toSelector( tokens )1452 );1453 }1454 matchers.push( matcher );1455 }1456 }1457 return elementMatcher( matchers );1458}1459function matcherFromGroupMatchers( elementMatchers, setMatchers ) {1460 var bySet = setMatchers.length > 0,1461 byElement = elementMatchers.length > 0,1462 superMatcher = function( seed, context, xml, results, outermost ) {1463 var elem, j, matcher,1464 matchedCount = 0,1465 i = "0",1466 unmatched = seed && [],1467 setMatched = [],1468 contextBackup = outermostContext,1469 // We must always have either seed elements or outermost context1470 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),1471 // Use integer dirruns iff this is the outermost matcher1472 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),1473 len = elems.length;1474 if ( outermost ) {1475 outermostContext = context === document || context || outermost;1476 }1477 // Add elements passing elementMatchers directly to results1478 // Support: IE<9, safari="" tolerate="" nodelist="" properties="" (ie:="" "length";="" safari:="" <number="">) matching elements by id1479 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {1480 if ( byElement && elem ) {1481 j = 0;1482 if ( !context && elem.ownerDocument !== document ) {1483 setDocument( elem );1484 xml = !documentIsHTML;1485 }1486 while ( (matcher = elementMatchers[j++]) ) {1487 if ( matcher( elem, context || document, xml) ) {1488 results.push( elem );1489 break;1490 }1491 }1492 if ( outermost ) {1493 dirruns = dirrunsUnique;1494 }1495 }1496 // Track unmatched elements for set filters1497 if ( bySet ) {1498 // They will have gone through all possible matchers1499 if ( (elem = !matcher && elem) ) {1500 matchedCount--;1501 }1502 // Lengthen the array for every element, matched or not1503 if ( seed ) {1504 unmatched.push( elem );1505 }1506 }1507 }1508 // `i` is now the count of elements visited above, and adding it to `matchedCount`1509 // makes the latter nonnegative.1510 matchedCount += i;1511 // Apply set filters to unmatched elements1512 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`1513 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have1514 // no element matchers and no seed.1515 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that1516 // case, which will result in a "00" `matchedCount` that differs from `i` but is also1517 // numerically zero.1518 if ( bySet && i !== matchedCount ) {1519 j = 0;1520 while ( (matcher = setMatchers[j++]) ) {1521 matcher( unmatched, setMatched, context, xml );1522 }1523 if ( seed ) {1524 // Reintegrate element matches to eliminate the need for sorting1525 if ( matchedCount > 0 ) {1526 while ( i-- ) {1527 if ( !(unmatched[i] || setMatched[i]) ) {1528 setMatched[i] = pop.call( results );1529 }1530 }1531 }1532 // Discard index placeholder values to get only actual matches1533 setMatched = condense( setMatched );1534 }1535 // Add matches to results1536 push.apply( results, setMatched );1537 // Seedless set matches succeeding multiple successful matchers stipulate sorting1538 if ( outermost && !seed && setMatched.length > 0 &&1539 ( matchedCount + setMatchers.length ) > 1 ) {1540 Sizzle.uniqueSort( results );1541 }1542 }1543 // Override manipulation of globals by nested matchers1544 if ( outermost ) {1545 dirruns = dirrunsUnique;1546 outermostContext = contextBackup;1547 }1548 return unmatched;1549 };1550 return bySet ?1551 markFunction( superMatcher ) :1552 superMatcher;1553}1554compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {1555 var i,1556 setMatchers = [],1557 elementMatchers = [],1558 cached = compilerCache[ selector + " " ];1559 if ( !cached ) {1560 // Generate a function of recursive functions that can be used to check each element1561 if ( !match ) {1562 match = tokenize( selector );1563 }1564 i = match.length;1565 while ( i-- ) {1566 cached = matcherFromTokens( match[i] );1567 if ( cached[ expando ] ) {1568 setMatchers.push( cached );1569 } else {1570 elementMatchers.push( cached );1571 }1572 }1573 // Cache the compiled function1574 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );1575 // Save selector and tokenization1576 cached.selector = selector;1577 }1578 return cached;1579};1580/**1581 * A low-level selection function that works with Sizzle's compiled1582 * selector functions1583 * @param {String|Function} selector A selector or a pre-compiled1584 * selector function built with Sizzle.compile1585 * @param {Element} context1586 * @param {Array} [results]1587 * @param {Array} [seed] A set of elements to match against1588 */1589select = Sizzle.select = function( selector, context, results, seed ) {1590 var i, tokens, token, type, find,1591 compiled = typeof selector === "function" && selector,1592 match = !seed && tokenize( (selector = compiled.selector || selector) );1593 results = results || [];1594 // Try to minimize operations if there is only one selector in the list and no seed1595 // (the latter of which guarantees us context)1596 if ( match.length === 1 ) {1597 // Reduce context if the leading compound selector is an ID1598 tokens = match[0] = match[0].slice( 0 );1599 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&1600 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {1601 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];1602 if ( !context ) {1603 return results;1604 // Precompiled matchers will still verify ancestry, so step up a level1605 } else if ( compiled ) {1606 context = context.parentNode;1607 }1608 selector = selector.slice( tokens.shift().value.length );1609 }1610 // Fetch a seed set for right-to-left matching1611 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;1612 while ( i-- ) {1613 token = tokens[i];1614 // Abort if we hit a combinator1615 if ( Expr.relative[ (type = token.type) ] ) {1616 break;1617 }1618 if ( (find = Expr.find[ type ]) ) {1619 // Search, expanding context for leading sibling combinators1620 if ( (seed = find(1621 token.matches[0].replace( runescape, funescape ),1622 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context1623 )) ) {1624 // If seed is empty or no tokens remain, we can return early1625 tokens.splice( i, 1 );1626 selector = seed.length && toSelector( tokens );1627 if ( !selector ) {1628 push.apply( results, seed );1629 return results;1630 }1631 break;1632 }1633 }1634 }1635 }1636 // Compile and execute a filtering function if one is not provided1637 // Provide `match` to avoid retokenization if we modified the selector above1638 ( compiled || compile( selector, match ) )(1639 seed,1640 context,1641 !documentIsHTML,1642 results,1643 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context1644 );1645 return results;1646};1647// One-time assignments1648// Sort stability1649support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;1650// Support: Chrome 14-35+1651// Always assume duplicates if they aren't passed to the comparison function1652support.detectDuplicates = !!hasDuplicate;1653// Initialize against the default document1654setDocument();1655// Support: Webkit<537.32 1="" 2="" 4="" 9="" 25="" -="" safari="" 6.0.3="" chrome="" (fixed="" in="" 27)="" detached="" nodes="" confoundingly="" follow="" *each="" other*="" support.sortdetached="assert(function(" el="" )="" {="" should="" return="" 1,="" but="" returns="" (following)="" el.comparedocumentposition(="" document.createelement("fieldset")="" &="" 1;="" });="" support:="" ie<8="" prevent="" attribute="" property="" "interpolation"="" https:="" msdn.microsoft.com="" en-us="" library="" ms536429%28vs.85%29.aspx="" if="" (="" !assert(function(="" el.innerhtml="<a href='#'></a>" ;="" el.firstchild.getattribute("href")="==" "#"="" })="" addhandle(="" "type|href|height|width",="" function(="" elem,="" name,="" isxml="" !isxml="" elem.getattribute(="" name.tolowercase()="==" "type"="" ?="" :="" );="" }="" ie<9="" use="" defaultvalue="" place="" of="" getattribute("value")="" !support.attributes="" ||="" el.firstchild.setattribute(="" "value",="" ""="" el.firstchild.getattribute(="" "value"="" "";="" &&="" elem.nodename.tolowercase()="==" "input"="" elem.defaultvalue;="" getattributenode="" to="" fetch="" booleans="" when="" getattribute="" lies="" el.getattribute("disabled")="=" null;="" booleans,="" var="" val;="" elem[="" name="" ]="==" true="" (val="elem.getAttributeNode(" ))="" val.specified="" val.value="" sizzle;="" })(="" window="" jquery.find="Sizzle;" jquery.expr="Sizzle.selectors;" deprecated="" jquery.expr[="" ":"="" jquery.uniquesort="jQuery.unique" =="" sizzle.uniquesort;="" jquery.text="Sizzle.getText;" jquery.isxmldoc="Sizzle.isXML;" jquery.contains="Sizzle.contains;" jquery.escapeselector="Sizzle.escape;" dir="function(" dir,="" until="" matched="[]," truncate="until" !="=" undefined;="" while="" elem="elem[" elem.nodetype="" jquery(="" ).is(="" break;="" matched.push(="" matched;="" };="" siblings="function(" n,="" for="" n;="" n="n.nextSibling" n.nodetype="==" rneedscontext="jQuery.expr.match.needsContext;" function="" nodename(="" elem.nodename="" name.tolowercase();="" rsingletag="(" ^<([a-z][^\="" \0="">:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\ \1="">|)$/i );1656// Implement the identical functionality for filter and not1657function winnow( elements, qualifier, not ) {1658 if ( isFunction( qualifier ) ) {1659 return jQuery.grep( elements, function( elem, i ) {1660 return !!qualifier.call( elem, i, elem ) !== not;1661 } );1662 }1663 // Single element1664 if ( qualifier.nodeType ) {1665 return jQuery.grep( elements, function( elem ) {1666 return ( elem === qualifier ) !== not;1667 } );1668 }1669 // Arraylike of elements (jQuery, arguments, Array)1670 if ( typeof qualifier !== "string" ) {1671 return jQuery.grep( elements, function( elem ) {1672 return ( indexOf.call( qualifier, elem ) > -1 ) !== not;1673 } );1674 }1675 // Filtered directly for both simple and complex selectors1676 return jQuery.filter( qualifier, elements, not );1677}1678jQuery.filter = function( expr, elems, not ) {1679 var elem = elems[ 0 ];1680 if ( not ) {1681 expr = ":not(" + expr + ")";1682 }1683 if ( elems.length === 1 && elem.nodeType === 1 ) {1684 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];1685 }1686 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {1687 return elem.nodeType === 1;1688 } ) );1689};1690jQuery.fn.extend( {1691 find: function( selector ) {1692 var i, ret,1693 len = this.length,1694 self = this;1695 if ( typeof selector !== "string" ) {1696 return this.pushStack( jQuery( selector ).filter( function() {1697 for ( i = 0; i < len; i++ ) {1698 if ( jQuery.contains( self[ i ], this ) ) {1699 return true;1700 }1701 }1702 } ) );1703 }1704 ret = this.pushStack( [] );1705 for ( i = 0; i < len; i++ ) {1706 jQuery.find( selector, self[ i ], ret );1707 }1708 return len > 1 ? jQuery.uniqueSort( ret ) : ret;1709 },1710 filter: function( selector ) {1711 return this.pushStack( winnow( this, selector || [], false ) );1712 },1713 not: function( selector ) {1714 return this.pushStack( winnow( this, selector || [], true ) );1715 },1716 is: function( selector ) {1717 return !!winnow(1718 this,1719 // If this is a positional/relative selector, check membership in the returned set1720 // so $("p:first").is("p:last") won't return true for a doc with two "p".1721 typeof selector === "string" && rneedsContext.test( selector ) ?1722 jQuery( selector ) :1723 selector || [],1724 false1725 ).length;1726 }1727} );1728// Initialize a jQuery object1729// A central reference to the root jQuery(document)1730var rootjQuery,1731 // A simple way to check for HTML strings1732 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)1733 // Strict HTML recognition (#11290: must start with <) shortcut="" simple="" #id="" case="" for="" speed="" rquickexpr="/^(?:\s*(<[\w\W]+">)[^>]*|#([\w-]+))$/,1734 init = jQuery.fn.init = function( selector, context, root ) {1735 var match, elem;1736 // HANDLE: $(""), $(null), $(undefined), $(false)1737 if ( !selector ) {1738 return this;1739 }1740 // Method init() accepts an alternate rootjQuery1741 // so migrate can support jQuery.sub (gh-2101)1742 root = root || rootjQuery;1743 // Handle HTML strings1744 if ( typeof selector === "string" ) {1745 if ( selector[ 0 ] === "<" 1="" &&="" selector[="" selector.length="" -="" ]="==" "="">" &&1746 selector.length >= 3 ) {1747 // Assume that strings that start and end with <> are HTML and skip the regex check1748 match = [ null, selector, null ];1749 } else {1750 match = rquickExpr.exec( selector );1751 }1752 // Match html or make sure no context is specified for #id1753 if ( match && ( match[ 1 ] || !context ) ) {1754 // HANDLE: $(html) -> $(array)1755 if ( match[ 1 ] ) {1756 context = context instanceof jQuery ? context[ 0 ] : context;1757 // Option to run scripts is true for back-compat1758 // Intentionally let the error be thrown if parseHTML is not present1759 jQuery.merge( this, jQuery.parseHTML(1760 match[ 1 ],1761 context && context.nodeType ? context.ownerDocument || context : document,1762 true1763 ) );1764 // HANDLE: $(html, props)1765 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {1766 for ( match in context ) {1767 // Properties of context are called as methods if possible1768 if ( isFunction( this[ match ] ) ) {1769 this[ match ]( context[ match ] );1770 // ...and otherwise set as attributes1771 } else {1772 this.attr( match, context[ match ] );1773 }1774 }1775 }1776 return this;1777 // HANDLE: $(#id)1778 } else {1779 elem = document.getElementById( match[ 2 ] );1780 if ( elem ) {1781 // Inject the element directly into the jQuery object1782 this[ 0 ] = elem;1783 this.length = 1;1784 }1785 return this;1786 }1787 // HANDLE: $(expr, $(...))1788 } else if ( !context || context.jquery ) {1789 return ( context || root ).find( selector );1790 // HANDLE: $(expr, context)1791 // (which is just equivalent to: $(context).find(expr)1792 } else {1793 return this.constructor( context ).find( selector );1794 }1795 // HANDLE: $(DOMElement)1796 } else if ( selector.nodeType ) {1797 this[ 0 ] = selector;1798 this.length = 1;1799 return this;1800 // HANDLE: $(function)1801 // Shortcut for document ready1802 } else if ( isFunction( selector ) ) {1803 return root.ready !== undefined ?1804 root.ready( selector ) :1805 // Execute immediately if ready is not present1806 selector( jQuery );1807 }1808 return jQuery.makeArray( selector, this );1809 };1810// Give the init function the jQuery prototype for later instantiation1811init.prototype = jQuery.fn;1812// Initialize central reference1813rootjQuery = jQuery( document );1814var rparentsprev = /^(?:parents|prev(?:Until|All))/,1815 // Methods guaranteed to produce a unique set when starting from a unique set1816 guaranteedUnique = {1817 children: true,1818 contents: true,1819 next: true,1820 prev: true1821 };1822jQuery.fn.extend( {1823 has: function( target ) {1824 var targets = jQuery( target, this ),1825 l = targets.length;1826 return this.filter( function() {1827 var i = 0;1828 for ( ; i < l; i++ ) {1829 if ( jQuery.contains( this, targets[ i ] ) ) {1830 return true;1831 }1832 }1833 } );1834 },1835 closest: function( selectors, context ) {1836 var cur,1837 i = 0,1838 l = this.length,1839 matched = [],1840 targets = typeof selectors !== "string" && jQuery( selectors );1841 // Positional selectors never match, since there's no _selection_ context1842 if ( !rneedsContext.test( selectors ) ) {1843 for ( ; i < l; i++ ) {1844 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {1845 // Always skip document fragments1846 if ( cur.nodeType < 11 && ( targets ?1847 targets.index( cur ) > -1 :1848 // Don't pass non-elements to Sizzle1849 cur.nodeType === 1 &&1850 jQuery.find.matchesSelector( cur, selectors ) ) ) {1851 matched.push( cur );1852 break;1853 }1854 }1855 }1856 }1857 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );1858 },1859 // Determine the position of an element within the set1860 index: function( elem ) {1861 // No argument, return index in parent1862 if ( !elem ) {1863 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;1864 }1865 // Index in selector1866 if ( typeof elem === "string" ) {1867 return indexOf.call( jQuery( elem ), this[ 0 ] );1868 }1869 // Locate the position of the desired element1870 return indexOf.call( this,1871 // If it receives a jQuery object, the first element is used1872 elem.jquery ? elem[ 0 ] : elem1873 );1874 },1875 add: function( selector, context ) {1876 return this.pushStack(1877 jQuery.uniqueSort(1878 jQuery.merge( this.get(), jQuery( selector, context ) )1879 )1880 );1881 },1882 addBack: function( selector ) {1883 return this.add( selector == null ?1884 this.prevObject : this.prevObject.filter( selector )1885 );1886 }1887} );1888function sibling( cur, dir ) {1889 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}1890 return cur;1891}1892jQuery.each( {1893 parent: function( elem ) {1894 var parent = elem.parentNode;1895 return parent && parent.nodeType !== 11 ? parent : null;1896 },1897 parents: function( elem ) {1898 return dir( elem, "parentNode" );1899 },1900 parentsUntil: function( elem, i, until ) {1901 return dir( elem, "parentNode", until );1902 },1903 next: function( elem ) {1904 return sibling( elem, "nextSibling" );1905 },1906 prev: function( elem ) {1907 return sibling( elem, "previousSibling" );1908 },1909 nextAll: function( elem ) {1910 return dir( elem, "nextSibling" );1911 },1912 prevAll: function( elem ) {1913 return dir( elem, "previousSibling" );1914 },1915 nextUntil: function( elem, i, until ) {1916 return dir( elem, "nextSibling", until );1917 },1918 prevUntil: function( elem, i, until ) {1919 return dir( elem, "previousSibling", until );1920 },1921 siblings: function( elem ) {1922 return siblings( ( elem.parentNode || {} ).firstChild, elem );1923 },1924 children: function( elem ) {1925 return siblings( elem.firstChild );1926 },1927 contents: function( elem ) {1928 if ( nodeName( elem, "iframe" ) ) {1929 return elem.contentDocument;1930 }1931 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only="" treat="" the="" template="" element="" as="" a="" regular="" one="" in="" browsers="" that="" don't="" support="" it.="" if="" (="" nodename(="" elem,="" "template"="" )="" {="" elem="elem.content" ||="" elem;="" }="" return="" jquery.merge(="" [],="" elem.childnodes="" );="" },="" function(="" name,="" fn="" jquery.fn[="" name="" ]="function(" until,="" selector="" var="" matched="jQuery.map(" this,="" fn,="" until="" name.slice(="" -5="" !="=" "until"="" &&="" typeof="" "string"="" selector,="" this.length=""> 1 ) {1932 // Remove duplicates1933 if ( !guaranteedUnique[ name ] ) {1934 jQuery.uniqueSort( matched );1935 }1936 // Reverse order for parents* and prev-derivatives1937 if ( rparentsprev.test( name ) ) {1938 matched.reverse();1939 }1940 }1941 return this.pushStack( matched );1942 };1943} );1944var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );1945// Convert String-formatted options into Object-formatted ones1946function createOptions( options ) {1947 var object = {};1948 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {1949 object[ flag ] = true;1950 } );1951 return object;1952}1953/*1954 * Create a callback list using the following parameters:1955 *1956 * options: an optional list of space-separated options that will change how1957 * the callback list behaves or a more traditional option object1958 *1959 * By default a callback list will act like an event callback list and can be1960 * "fired" multiple times.1961 *1962 * Possible options:1963 *1964 * once: will ensure the callback list can only be fired once (like a Deferred)1965 *1966 * memory: will keep track of previous values and will call any callback added1967 * after the list has been fired right away with the latest "memorized"1968 * values (like a Deferred)1969 *1970 * unique: will ensure a callback can only be added once (no duplicate in the list)1971 *1972 * stopOnFalse: interrupt callings when a callback returns false1973 *1974 */1975jQuery.Callbacks = function( options ) {1976 // Convert options from String-formatted to Object-formatted if needed1977 // (we check in cache first)1978 options = typeof options === "string" ?1979 createOptions( options ) :1980 jQuery.extend( {}, options );1981 var // Flag to know if list is currently firing1982 firing,1983 // Last fire value for non-forgettable lists1984 memory,1985 // Flag to know if list was already fired1986 fired,1987 // Flag to prevent firing1988 locked,1989 // Actual callback list1990 list = [],1991 // Queue of execution data for repeatable lists1992 queue = [],1993 // Index of currently firing callback (modified by add/remove as needed)1994 firingIndex = -1,1995 // Fire callbacks1996 fire = function() {1997 // Enforce single-firing1998 locked = locked || options.once;1999 // Execute callbacks for all pending executions,2000 // respecting firingIndex overrides and runtime changes2001 fired = firing = true;2002 for ( ; queue.length; firingIndex = -1 ) {2003 memory = queue.shift();2004 while ( ++firingIndex < list.length ) {2005 // Run callback and check for early termination2006 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&2007 options.stopOnFalse ) {2008 // Jump to end and forget the data so .add doesn't re-fire2009 firingIndex = list.length;2010 memory = false;2011 }2012 }2013 }2014 // Forget the data if we're done with it2015 if ( !options.memory ) {2016 memory = false;2017 }2018 firing = false;2019 // Clean up if we're done firing for good2020 if ( locked ) {2021 // Keep an empty list if we have data for future add calls2022 if ( memory ) {2023 list = [];2024 // Otherwise, this object is spent2025 } else {2026 list = "";2027 }2028 }2029 },2030 // Actual Callbacks object2031 self = {2032 // Add a callback or a collection of callbacks to the list2033 add: function() {2034 if ( list ) {2035 // If we have memory from a past run, we should fire after adding2036 if ( memory && !firing ) {2037 firingIndex = list.length - 1;2038 queue.push( memory );2039 }2040 ( function add( args ) {2041 jQuery.each( args, function( _, arg ) {2042 if ( isFunction( arg ) ) {2043 if ( !options.unique || !self.has( arg ) ) {2044 list.push( arg );2045 }2046 } else if ( arg && arg.length && toType( arg ) !== "string" ) {2047 // Inspect recursively2048 add( arg );2049 }2050 } );2051 } )( arguments );2052 if ( memory && !firing ) {2053 fire();2054 }2055 }2056 return this;2057 },2058 // Remove a callback from the list2059 remove: function() {2060 jQuery.each( arguments, function( _, arg ) {2061 var index;2062 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {2063 list.splice( index, 1 );2064 // Handle firing indexes2065 if ( index <= firingindex="" )="" {="" firingindex--;="" }="" );="" return="" this;="" },="" check="" if="" a="" given="" callback="" is="" in="" the="" list.="" no="" argument="" given,="" whether="" or="" not="" list="" has="" callbacks="" attached.="" has:="" function(="" fn="" ?="" jquery.inarray(="" fn,=""> -1 :2066 list.length > 0;2067 },2068 // Remove all callbacks from the list2069 empty: function() {2070 if ( list ) {2071 list = [];2072 }2073 return this;2074 },2075 // Disable .fire and .add2076 // Abort any current/pending executions2077 // Clear all callbacks and values2078 disable: function() {2079 locked = queue = [];2080 list = memory = "";2081 return this;2082 },2083 disabled: function() {2084 return !list;2085 },2086 // Disable .fire2087 // Also disable .add unless we have memory (since it would have no effect)2088 // Abort any pending executions2089 lock: function() {2090 locked = queue = [];2091 if ( !memory && !firing ) {2092 list = memory = "";2093 }2094 return this;2095 },2096 locked: function() {2097 return !!locked;2098 },2099 // Call all callbacks with the given context and arguments2100 fireWith: function( context, args ) {2101 if ( !locked ) {2102 args = args || [];2103 args = [ context, args.slice ? args.slice() : args ];2104 queue.push( args );2105 if ( !firing ) {2106 fire();2107 }2108 }2109 return this;2110 },2111 // Call all the callbacks with the given arguments2112 fire: function() {2113 self.fireWith( this, arguments );2114 return this;2115 },2116 // To know if the callbacks have already been called at least once2117 fired: function() {2118 return !!fired;2119 }2120 };2121 return self;2122};2123function Identity( v ) {2124 return v;2125}2126function Thrower( ex ) {2127 throw ex;2128}2129function adoptValue( value, resolve, reject, noValue ) {2130 var method;2131 try {2132 // Check for promise aspect first to privilege synchronous behavior2133 if ( value && isFunction( ( method = value.promise ) ) ) {2134 method.call( value ).done( resolve ).fail( reject );2135 // Other thenables2136 } else if ( value && isFunction( ( method = value.then ) ) ) {2137 method.call( value, resolve, reject );2138 // Other non-thenables2139 } else {2140 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:2141 // * false: [ value ].slice( 0 ) => resolve( value )2142 // * true: [ value ].slice( 1 ) => resolve()2143 resolve.apply( undefined, [ value ].slice( noValue ) );2144 }2145 // For Promises/A+, convert exceptions into rejections2146 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in2147 // Deferred#then to conditionally suppress rejection.2148 } catch ( value ) {2149 // Support: Android 4.0 only2150 // Strict mode functions invoked without .call/.apply get global-object context2151 reject.apply( undefined, [ value ] );2152 }2153}2154jQuery.extend( {2155 Deferred: function( func ) {2156 var tuples = [2157 // action, add listener, callbacks,2158 // ... .then handlers, argument index, [final state]2159 [ "notify", "progress", jQuery.Callbacks( "memory" ),2160 jQuery.Callbacks( "memory" ), 2 ],2161 [ "resolve", "done", jQuery.Callbacks( "once memory" ),2162 jQuery.Callbacks( "once memory" ), 0, "resolved" ],2163 [ "reject", "fail", jQuery.Callbacks( "once memory" ),2164 jQuery.Callbacks( "once memory" ), 1, "rejected" ]2165 ],2166 state = "pending",2167 promise = {2168 state: function() {2169 return state;2170 },2171 always: function() {2172 deferred.done( arguments ).fail( arguments );2173 return this;2174 },2175 "catch": function( fn ) {2176 return promise.then( null, fn );2177 },2178 // Keep pipe for back-compat2179 pipe: function( /* fnDone, fnFail, fnProgress */ ) {2180 var fns = arguments;2181 return jQuery.Deferred( function( newDefer ) {2182 jQuery.each( tuples, function( i, tuple ) {2183 // Map tuples (progress, done, fail) to arguments (done, fail, progress)2184 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];2185 // deferred.progress(function() { bind to newDefer or newDefer.notify })2186 // deferred.done(function() { bind to newDefer or newDefer.resolve })2187 // deferred.fail(function() { bind to newDefer or newDefer.reject })2188 deferred[ tuple[ 1 ] ]( function() {2189 var returned = fn && fn.apply( this, arguments );2190 if ( returned && isFunction( returned.promise ) ) {2191 returned.promise()2192 .progress( newDefer.notify )2193 .done( newDefer.resolve )2194 .fail( newDefer.reject );2195 } else {2196 newDefer[ tuple[ 0 ] + "With" ](2197 this,2198 fn ? [ returned ] : arguments2199 );2200 }2201 } );2202 } );2203 fns = null;2204 } ).promise();2205 },2206 then: function( onFulfilled, onRejected, onProgress ) {2207 var maxDepth = 0;2208 function resolve( depth, deferred, handler, special ) {2209 return function() {2210 var that = this,2211 args = arguments,2212 mightThrow = function() {2213 var returned, then;2214 // Support: Promises/A+ section 2.3.3.3.32215 // https://promisesaplus.com/#point-592216 // Ignore double-resolution attempts2217 if ( depth < maxDepth ) {2218 return;2219 }2220 returned = handler.apply( that, args );2221 // Support: Promises/A+ section 2.3.12222 // https://promisesaplus.com/#point-482223 if ( returned === deferred.promise() ) {2224 throw new TypeError( "Thenable self-resolution" );2225 }2226 // Support: Promises/A+ sections 2.3.3.1, 3.52227 // https://promisesaplus.com/#point-542228 // https://promisesaplus.com/#point-752229 // Retrieve `then` only once2230 then = returned &&2231 // Support: Promises/A+ section 2.3.42232 // https://promisesaplus.com/#point-642233 // Only check objects and functions for thenability2234 ( typeof returned === "object" ||2235 typeof returned === "function" ) &&2236 returned.then;2237 // Handle a returned thenable2238 if ( isFunction( then ) ) {2239 // Special processors (notify) just wait for resolution2240 if ( special ) {2241 then.call(2242 returned,2243 resolve( maxDepth, deferred, Identity, special ),2244 resolve( maxDepth, deferred, Thrower, special )2245 );2246 // Normal processors (resolve) also hook into progress2247 } else {2248 // ...and disregard older resolution values2249 maxDepth++;2250 then.call(2251 returned,2252 resolve( maxDepth, deferred, Identity, special ),2253 resolve( maxDepth, deferred, Thrower, special ),2254 resolve( maxDepth, deferred, Identity,2255 deferred.notifyWith )2256 );2257 }2258 // Handle all other returned values2259 } else {2260 // Only substitute handlers pass on context2261 // and multiple values (non-spec behavior)2262 if ( handler !== Identity ) {2263 that = undefined;2264 args = [ returned ];2265 }2266 // Process the value(s)2267 // Default process is resolve2268 ( special || deferred.resolveWith )( that, args );2269 }2270 },2271 // Only normal processors (resolve) catch and reject exceptions2272 process = special ?2273 mightThrow :2274 function() {2275 try {2276 mightThrow();2277 } catch ( e ) {2278 if ( jQuery.Deferred.exceptionHook ) {2279 jQuery.Deferred.exceptionHook( e,2280 process.stackTrace );2281 }2282 // Support: Promises/A+ section 2.3.3.3.4.12283 // https://promisesaplus.com/#point-612284 // Ignore post-resolution exceptions2285 if ( depth + 1 >= maxDepth ) {2286 // Only substitute handlers pass on context2287 // and multiple values (non-spec behavior)2288 if ( handler !== Thrower ) {2289 that = undefined;2290 args = [ e ];2291 }2292 deferred.rejectWith( that, args );2293 }2294 }2295 };2296 // Support: Promises/A+ section 2.3.3.3.12297 // https://promisesaplus.com/#point-572298 // Re-resolve promises immediately to dodge false rejection from2299 // subsequent errors2300 if ( depth ) {2301 process();2302 } else {2303 // Call an optional hook to record the stack, in case of exception2304 // since it's otherwise lost when execution goes async2305 if ( jQuery.Deferred.getStackHook ) {2306 process.stackTrace = jQuery.Deferred.getStackHook();2307 }2308 window.setTimeout( process );2309 }2310 };2311 }2312 return jQuery.Deferred( function( newDefer ) {2313 // progress_handlers.add( ... )2314 tuples[ 0 ][ 3 ].add(2315 resolve(2316 0,2317 newDefer,2318 isFunction( onProgress ) ?2319 onProgress :2320 Identity,2321 newDefer.notifyWith2322 )2323 );2324 // fulfilled_handlers.add( ... )2325 tuples[ 1 ][ 3 ].add(2326 resolve(2327 0,2328 newDefer,2329 isFunction( onFulfilled ) ?2330 onFulfilled :2331 Identity2332 )2333 );2334 // rejected_handlers.add( ... )2335 tuples[ 2 ][ 3 ].add(2336 resolve(2337 0,2338 newDefer,2339 isFunction( onRejected ) ?2340 onRejected :2341 Thrower2342 )2343 );2344 } ).promise();2345 },2346 // Get a promise for this deferred2347 // If obj is provided, the promise aspect is added to the object2348 promise: function( obj ) {2349 return obj != null ? jQuery.extend( obj, promise ) : promise;2350 }2351 },2352 deferred = {};2353 // Add list-specific methods2354 jQuery.each( tuples, function( i, tuple ) {2355 var list = tuple[ 2 ],2356 stateString = tuple[ 5 ];2357 // promise.progress = list.add2358 // promise.done = list.add2359 // promise.fail = list.add2360 promise[ tuple[ 1 ] ] = list.add;2361 // Handle state2362 if ( stateString ) {2363 list.add(2364 function() {2365 // state = "resolved" (i.e., fulfilled)2366 // state = "rejected"2367 state = stateString;2368 },2369 // rejected_callbacks.disable2370 // fulfilled_callbacks.disable2371 tuples[ 3 - i ][ 2 ].disable,2372 // rejected_handlers.disable2373 // fulfilled_handlers.disable2374 tuples[ 3 - i ][ 3 ].disable,2375 // progress_callbacks.lock2376 tuples[ 0 ][ 2 ].lock,2377 // progress_handlers.lock2378 tuples[ 0 ][ 3 ].lock2379 );2380 }2381 // progress_handlers.fire2382 // fulfilled_handlers.fire2383 // rejected_handlers.fire2384 list.add( tuple[ 3 ].fire );2385 // deferred.notify = function() { deferred.notifyWith(...) }2386 // deferred.resolve = function() { deferred.resolveWith(...) }2387 // deferred.reject = function() { deferred.rejectWith(...) }2388 deferred[ tuple[ 0 ] ] = function() {2389 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );2390 return this;2391 };2392 // deferred.notifyWith = list.fireWith2393 // deferred.resolveWith = list.fireWith2394 // deferred.rejectWith = list.fireWith2395 deferred[ tuple[ 0 ] + "With" ] = list.fireWith;2396 } );2397 // Make the deferred a promise2398 promise.promise( deferred );2399 // Call given func if any2400 if ( func ) {2401 func.call( deferred, deferred );2402 }2403 // All done!2404 return deferred;2405 },2406 // Deferred helper2407 when: function( singleValue ) {2408 var2409 // count of uncompleted subordinates2410 remaining = arguments.length,2411 // count of unprocessed arguments2412 i = remaining,2413 // subordinate fulfillment data2414 resolveContexts = Array( i ),2415 resolveValues = slice.call( arguments ),2416 // the master Deferred2417 master = jQuery.Deferred(),2418 // subordinate callback factory2419 updateFunc = function( i ) {2420 return function( value ) {2421 resolveContexts[ i ] = this;2422 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;2423 if ( !( --remaining ) ) {2424 master.resolveWith( resolveContexts, resolveValues );2425 }2426 };2427 };2428 // Single- and empty arguments are adopted like Promise.resolve2429 if ( remaining <= 1="" 8="" 9="" )="" {="" adoptvalue(="" singlevalue,="" master.done(="" updatefunc(="" i="" ).resolve,="" master.reject,="" !remaining="" );="" use="" .then()="" to="" unwrap="" secondary="" thenables="" (cf.="" gh-3000)="" if="" (="" master.state()="==" "pending"="" ||="" isfunction(="" resolvevalues[="" ]="" &&="" ].then="" return="" master.then();="" }="" multiple arguments="" are="" aggregated="" like="" promise.all="" array="" elements="" while="" i--="" ],="" ),="" master.reject="" master.promise();="" these="" usually="" indicate="" a="" programmer="" mistake="" during="" development,="" warn="" about="" them="" asap="" rather="" than="" swallowing="" by="" default.="" var="" rerrornames="/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;" jquery.deferred.exceptionhook="function(" error,="" stack="" support:="" ie="" -="" only="" console="" exists="" when="" dev="" tools="" open,="" which="" can="" happen="" at="" any="" time="" window.console="" window.console.warn="" error="" rerrornames.test(="" error.name="" window.console.warn(="" "jquery.deferred="" exception:="" "="" +="" error.message,="" error.stack,="" };="" jquery.readyexception="function(" window.settimeout(="" function()="" throw="" error;="" the="" deferred="" used="" on="" dom="" ready="" readylist="jQuery.Deferred();" jquery.fn.ready="function(" fn="" .then(="" wrap="" in="" function="" so="" that="" lookup="" happens="" of="" handling="" instead="" callback="" registration.="" .catch(="" function(="" jquery.readyexception(="" this;="" jquery.extend(="" is="" be="" used?="" set="" true="" once="" it="" occurs.="" isready:="" false,="" counter="" track="" how="" many="" items="" wait="" for="" before="" event="" fires.="" see="" #6781="" readywait:="" 1,="" handle="" ready:="" abort="" there="" pending="" holds="" or="" we're="" already="" ?="" --jquery.readywait="" :="" jquery.isready="" return;="" remember="" normal="" fired,="" decrement,="" and="" need="" !="="> 0 ) {2430 return;2431 }2432 // If there are functions bound, to execute2433 readyList.resolveWith( document, [ jQuery ] );2434 }2435} );2436jQuery.ready.then = readyList.then;2437// The ready event handler and self cleanup method2438function completed() {2439 document.removeEventListener( "DOMContentLoaded", completed );2440 window.removeEventListener( "load", completed );2441 jQuery.ready();2442}2443// Catch cases where $(document).ready() is called2444// after the browser event has already occurred.2445// Support: IE <=9 0="" 1="" 5="" 9="" 10="" 11="" 12="" 15="" 45="" 2014="" -="" only="" older="" ie="" sometimes="" signals="" "interactive"="" too="" soon="" if="" (="" document.readystate="==" "complete"="" ||="" !="=" "loading"="" &&="" !document.documentelement.doscroll="" )="" {="" handle="" it="" asynchronously="" to="" allow="" scripts="" the="" opportunity="" delay="" ready="" window.settimeout(="" jquery.ready="" );="" }="" else="" use="" handy="" event="" callback="" document.addeventlistener(="" "domcontentloaded",="" completed="" a="" fallback="" window.onload,="" that="" will="" always="" work="" window.addeventlistener(="" "load",="" multifunctional="" method="" get="" and="" set="" values="" of="" collection="" value="" s="" can="" optionally="" be="" executed="" it's="" function="" var="" access="function(" elems,="" fn,="" key,="" value,="" chainable,="" emptyget,="" raw="" i="0," len="elems.length," bulk="key" =="null;" sets="" many="" totype(="" key="" "object"="" chainable="true;" for="" in="" access(="" i,="" key[="" ],="" true,="" one="" undefined="" !isfunction(="" operations="" run="" against="" entire="" fn.call(="" fn="null;" ...except="" when="" executing="" elem,="" return="" bulk.call(="" jquery(="" elem="" ),="" };="" ;="" <="" len;="" i++="" fn(="" elems[="" ?="" :="" value.call(="" elems;="" gets="" elems="" emptyget;="" matches="" dashed="" string="" camelizing="" rmsprefix="/^-ms-/," rdashalpha="/-([a-z])/g;" used="" by="" camelcase="" as="" replace()="" fcamelcase(="" all,="" letter="" letter.touppercase();="" convert="" camelcase;="" css="" data="" modules="" support:="" 11,="" edge="" microsoft="" forgot="" hump="" their="" vendor="" prefix="" (#9572)="" camelcase(="" string.replace(="" rmsprefix,="" "ms-"="" ).replace(="" rdashalpha,="" fcamelcase="" acceptdata="function(" owner="" accepts="" only:="" node="" node.element_node="" node.document_node="" object="" any="" owner.nodetype="==" !(="" +owner.nodetype="" data()="" this.expando="jQuery.expando" +="" data.uid++;="" data.uid="1;" data.prototype="{" cache:="" function(="" check="" already="" has="" cache="" ];="" not,="" create="" !value="" we="" accept="" non-element="" nodes="" modern="" browsers,="" but="" should="" see="" #8335.="" an="" empty="" object.="" acceptdata(="" is="" unlikely="" stringify-ed="" or="" looped="" over="" plain="" assignment="" owner[="" ]="value;" otherwise="" secure="" non-enumerable="" property="" configurable="" must="" true="" deleted="" removed="" object.defineproperty(="" owner,="" this.expando,="" value:="" configurable:="" value;="" },="" set:="" data,="" prop,="" handle:="" [="" args="" (gh-2257)="" typeof="" "string"="" cache[="" properties="" copy="" one-by-one="" prop="" cache;="" get:="" this.cache(="" ][="" access:="" cases="" where="" either:="" 1.="" no="" was="" specified="" 2.="" specified,="" provided="" take="" "read"="" path="" determine="" which="" return,="" respectively="" stored="" at="" this.get(="" not="" string,="" both="" are="" extend="" (existing="" objects)="" with="" this.set(="" since="" "set"="" have="" two="" possible="" entry="" points="" expected="" based="" on="" taken[*]="" key;="" remove:="" return;="" support="" array="" space="" separated="" keys="" array.isarray(="" keys...="" keys,="" so="" remove="" that.="" spaces="" exists,="" it.="" otherwise,="" matching="" non-whitespace="" key.match(="" rnothtmlwhite="" []="" while="" i--="" delete="" expando="" there's="" more="" jquery.isemptyobject(="" chrome="" webkit="" &="" blink="" performance="" suffers="" deleting="" from="" dom="" nodes,="" instead="" https:="" bugs.chromium.org="" p="" chromium="" issues="" detail?id="378607" (bug="" restricted)="" hasdata:="" !jquery.isemptyobject(="" datapriv="new" data();="" datauser="new" implementation="" summary="" enforce="" api="" surface="" semantic="" compatibility="" 1.9.x="" branch="" improve="" module's="" maintainability="" reducing="" storage="" paths="" single="" mechanism.="" 3.="" same="" mechanism="" "private"="" "user"="" data.="" 4.="" _never_="" expose="" user="" code="" (todo:="" drop="" _data,="" _removedata)="" 5.="" avoid="" exposing="" details="" objects="" (eg.="" properties)="" 6.="" provide="" clear="" upgrade="" weakmap="" rbrace="/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/," rmultidash="/[A-Z]/g;" getdata(="" "true"="" true;="" "false"="" false;="" "null"="" null;="" number="" doesn't="" change="" +data="" ""="" +data;="" rbrace.test(="" json.parse(="" data;="" dataattr(="" name;="" nothing="" found="" internally,="" try="" fetch="" html5="" data-*="" attribute="" elem.nodetype="==" name="data-" key.replace(="" rmultidash,="" "-$&"="" ).tolowercase();="" catch="" e="" {}="" make="" sure="" isn't="" changed="" later="" datauser.set(="" jquery.extend(="" datauser.hasdata(="" datapriv.hasdata(="" data:="" name,="" datauser.access(="" removedata:="" datauser.remove(="" todo:="" now="" all="" calls="" _data="" _removedata="" been="" replaced="" direct="" methods,="" these="" deprecated.="" _data:="" datapriv.access(="" _removedata:="" datapriv.remove(="" jquery.fn.extend(="" attrs="elem" elem.attributes;="" this.length="" !datapriv.get(="" "hasdataattrs"="" elements="" null="" (#14894)="" attrs[="" ].name;="" name.indexof(="" "data-"="" name.slice(="" data[="" datapriv.set(="" "hasdataattrs",="" multiple this.each(="" function()="" this,="" calling="" jquery="" (element="" matches)="" (and="" therefore="" element="" appears="" this[="" ])="" `value`="" parameter="" undefined.="" result="" `undefined`="" throw="" exception="" attempt="" read="" made.="" camelcased="" "discover"="" custom="" tried="" really="" hard,="" exist.="" data...="" store="" null,="" arguments.length=""> 1, null, true );2446 },2447 removeData: function( key ) {2448 return this.each( function() {2449 dataUser.remove( this, key );2450 } );2451 }2452} );2453jQuery.extend( {2454 queue: function( elem, type, data ) {2455 var queue;2456 if ( elem ) {2457 type = ( type || "fx" ) + "queue";2458 queue = dataPriv.get( elem, type );2459 // Speed up dequeue by getting out quickly if this is just a lookup2460 if ( data ) {2461 if ( !queue || Array.isArray( data ) ) {2462 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );2463 } else {2464 queue.push( data );2465 }2466 }2467 return queue || [];2468 }2469 },2470 dequeue: function( elem, type ) {2471 type = type || "fx";2472 var queue = jQuery.queue( elem, type ),2473 startLength = queue.length,2474 fn = queue.shift(),2475 hooks = jQuery._queueHooks( elem, type ),2476 next = function() {2477 jQuery.dequeue( elem, type );2478 };2479 // If the fx queue is dequeued, always remove the progress sentinel2480 if ( fn === "inprogress" ) {2481 fn = queue.shift();2482 startLength--;2483 }2484 if ( fn ) {2485 // Add a progress sentinel to prevent the fx queue from being2486 // automatically dequeued2487 if ( type === "fx" ) {2488 queue.unshift( "inprogress" );2489 }2490 // Clear up the last queue stop function2491 delete hooks.stop;2492 fn.call( elem, next, hooks );2493 }2494 if ( !startLength && hooks ) {2495 hooks.empty.fire();2496 }2497 },2498 // Not public - generate a queueHooks object, or return the current one2499 _queueHooks: function( elem, type ) {2500 var key = type + "queueHooks";2501 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {2502 empty: jQuery.Callbacks( "once memory" ).add( function() {2503 dataPriv.remove( elem, [ type + "queue", key ] );2504 } )2505 } );2506 }2507} );2508jQuery.fn.extend( {2509 queue: function( type, data ) {2510 var setter = 2;2511 if ( typeof type !== "string" ) {2512 data = type;2513 type = "fx";2514 setter--;2515 }2516 if ( arguments.length < setter ) {2517 return jQuery.queue( this[ 0 ], type );2518 }2519 return data === undefined ?2520 this :2521 this.each( function() {2522 var queue = jQuery.queue( this, type, data );2523 // Ensure a hooks for this queue2524 jQuery._queueHooks( this, type );2525 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {2526 jQuery.dequeue( this, type );2527 }2528 } );2529 },2530 dequeue: function( type ) {2531 return this.each( function() {2532 jQuery.dequeue( this, type );2533 } );2534 },2535 clearQueue: function( type ) {2536 return this.queue( type || "fx", [] );2537 },2538 // Get a promise resolved when queues of a certain type2539 // are emptied (fx is the type by default)2540 promise: function( type, obj ) {2541 var tmp,2542 count = 1,2543 defer = jQuery.Deferred(),2544 elements = this,2545 i = this.length,2546 resolve = function() {2547 if ( !( --count ) ) {2548 defer.resolveWith( elements, [ elements ] );2549 }2550 };2551 if ( typeof type !== "string" ) {2552 obj = type;2553 type = undefined;2554 }2555 type = type || "fx";2556 while ( i-- ) {2557 tmp = dataPriv.get( elements[ i ], type + "queueHooks" );2558 if ( tmp && tmp.empty ) {2559 count++;2560 tmp.empty.add( resolve );2561 }2562 }2563 resolve();2564 return defer.promise( obj );2565 }2566} );2567var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;2568var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );2569var cssExpand = [ "Top", "Right", "Bottom", "Left" ];2570var isHiddenWithinTree = function( elem, el ) {2571 // isHiddenWithinTree might be called from jQuery#filter function;2572 // in that case, element will be second argument2573 elem = el || elem;2574 // Inline style trumps all2575 return elem.style.display === "none" ||2576 elem.style.display === "" &&2577 // Otherwise, check computed style2578 // Support: Firefox <=43 1="" 2="" 3="" 45="" -="" disconnected="" elements="" can="" have="" computed="" display:="" none,="" so="" first="" confirm="" that="" elem="" is="" in="" the="" document.="" jquery.contains(="" elem.ownerdocument,="" )="" &&="" jquery.css(="" elem,="" "display"="" "none";="" };="" var="" swap="function(" options,="" callback,="" args="" {="" ret,="" name,="" old="{};" remember="" values,="" and="" insert="" new="" ones="" for="" (="" name="" options="" old[="" ]="elem.style[" ];="" elem.style[="" }="" ret="callback.apply(" ||="" []="" );="" revert="" values="" return="" ret;="" function="" adjustcss(="" prop,="" valueparts,="" tween="" adjusted,="" scale,="" maxiterations="20," currentvalue="tween" ?="" function()="" tween.cur();="" :="" ""="" },="" initial="currentValue()," unit="valueParts" valueparts[="" jquery.cssnumber[="" prop="" "px"="" ),="" starting="" value="" computation="" required potential="" mismatches="" initialinunit="(" !="=" +initial="" rcssnum.exec(="" if="" initialinunit[="" support:="" firefox="" <="54" halve="" iteration="" target="" to="" prevent="" interference="" from="" css="" upper="" bounds="" (gh-2144)="" 2;="" trust="" units="" reported="" by="" jquery.css="" iteratively="" approximate="" a="" nonzero="" point="" 1;="" while="" maxiterations--="" evaluate="" update="" our="" best="" guess="" (doubling="" guesses="" zero="" out).="" finish="" scale="" equals="" or="" crosses="" (making="" old*new="" product="" non-positive).="" jquery.style(="" +="" *="" 0.5="" scale;="" make="" sure="" we="" properties="" later="" on="" valueparts="valueParts" [];="" 0;="" apply="" relative="" offset="" (+="/-=)" specified="" adjusted="valueParts[" +valueparts[="" tween.unit="unit;" tween.start="initialInUnit;" tween.end="adjusted;" adjusted;="" defaultdisplaymap="{};" getdefaultdisplay(="" temp,="" doc="elem.ownerDocument," nodename="elem.nodeName," display="defaultDisplayMap[" display;="" temp="doc.body.appendChild(" doc.createelement(="" temp.parentnode.removechild(="" "none"="" ;="" defaultdisplaymap[="" showhide(="" elements,="" show="" display,="" index="0," length="elements.length;" determine="" need="" change="" length;="" index++="" !elem.style="" continue;="" since="" force="" visibility="" upon="" cascade-hidden="" an="" immediate="" (and="" slow)="" check="" this="" loop unless="" nonempty="" (either="" inline="" about-to-be-restored)="" values[="" null;="" !values[="" elem.style.display="" ishiddenwithintree(="" else="" what="" we're="" overwriting="" datapriv.set(="" "display",="" set="" of="" second="" avoid="" constant="" reflow="" elements[="" ].style.display="values[" elements;="" jquery.fn.extend(="" show:="" this,="" true="" hide:="" toggle:="" function(="" state="" typeof="" "boolean"="" this.show()="" this.hide();="" this.each(="" jquery(="" ).show();="" ).hide();="" rcheckabletype="(" ^(?:checkbox|radio)$="" i="" rtagname="(" <([a-z][^\="" \0="">\x20\t\r\n\f]+)/i );2579var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );2580// We have to close these tags to support XHTML (#13200)2581var wrapMap = {2582 // Support: IE <=9 only="" option:="" [="" 1,="" "<select="" multiple="multiple">", "" ],2583 // XHTML parsers do not magically insert elements in the2584 // same way that tag soup parsers do. So we cannot shorten2585 // this by omitting <tbody> or other required elements.2586 thead: [ 1, "<table>", "</table>" ],2587 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],2588 tr: [ 2, "<table><tbody>", "</tbody></table>" ],2589 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],2590 _default: [ 0, "", "" ]2591};2592// Support: IE <=9 0="" 1="" 2="" 11="" only="" wrapmap.optgroup="wrapMap.option;" wrapmap.tbody="wrapMap.tfoot" =="" wrapmap.colgroup="wrapMap.caption" wrapmap.thead;="" wrapmap.th="wrapMap.td;" function="" getall(="" context,="" tag="" )="" {="" support:="" ie="" <="9" -="" use="" typeof="" to="" avoid="" zero-argument="" method="" invocation="" on="" host="" objects="" (#15151)="" var="" ret;="" if="" (="" context.getelementsbytagname="" !="=" "undefined"="" ret="context.getElementsByTagName(" ||="" "*"="" );="" }="" else="" context.queryselectorall="" undefined="" &&="" nodename(="" return="" jquery.merge(="" [="" context="" ],="" mark="" scripts="" as="" having="" already="" been="" evaluated="" setglobaleval(="" elems,="" refelements="" i="0," l="elems.length;" for="" ;="" l;="" i++="" datapriv.set(="" elems[="" "globaleval",="" !refelements="" datapriv.get(="" refelements[="" "globaleval"="" rhtml="/<|&#?\w+;/;" buildfragment(="" scripts,="" selection,="" ignored="" elem,="" tmp,="" tag,="" wrap,="" contains,="" j,="" fragment="context.createDocumentFragment()," nodes="[]," elem="elems[" ];="" add="" directly="" totype(="" "object"="" android="" only,="" phantomjs="" push.apply(_,="" arraylike)="" throws="" ancient="" webkit="" nodes,="" elem.nodetype="" ?="" ]="" :="" convert="" non-html="" into="" a="" text="" node="" !rhtml.test(="" nodes.push(="" context.createtextnode(="" html="" dom="" tmp="tmp" fragment.appendchild(="" context.createelement(="" "div"="" deserialize="" standard="" representation="" rtagname.exec(="" "",="" ""="" )[="" ].tolowercase();="" wrap="wrapMap[" wrapmap._default;="" tmp.innerhtml="wrap[" +="" jquery.htmlprefilter(="" wrap[="" descend="" through="" wrappers="" the="" right="" content="" j="wrap[" while="" j--="" tmp.childnodes="" remember="" top-level="" container="" ensure="" created="" are="" orphaned="" (#12392)="" tmp.textcontent="" remove="" wrapper="" from="" fragment.textcontent="" skip="" elements="" in="" collection="" (trac-4087)="" selection="" jquery.inarray(=""> -1 ) {2593 if ( ignored ) {2594 ignored.push( elem );2595 }2596 continue;2597 }2598 contains = jQuery.contains( elem.ownerDocument, elem );2599 // Append to fragment2600 tmp = getAll( fragment.appendChild( elem ), "script" );2601 // Preserve script evaluation history2602 if ( contains ) {2603 setGlobalEval( tmp );2604 }2605 // Capture executables2606 if ( scripts ) {2607 j = 0;2608 while ( ( elem = tmp[ j++ ] ) ) {2609 if ( rscriptType.test( elem.type || "" ) ) {2610 scripts.push( elem );2611 }2612 }2613 }2614 }2615 return fragment;2616}2617( function() {2618 var fragment = document.createDocumentFragment(),2619 div = fragment.appendChild( document.createElement( "div" ) ),2620 input = document.createElement( "input" );2621 // Support: Android 4.0 - 4.3 only2622 // Check state lost if the name is set (#11217)2623 // Support: Windows Web Apps (WWA)2624 // `name` and `type` must use .setAttribute for WWA (#14901)2625 input.setAttribute( "type", "radio" );2626 input.setAttribute( "checked", "checked" );2627 input.setAttribute( "name", "t" );2628 div.appendChild( input );2629 // Support: Android <=4.1 0="" 1="" 2="" only="" older="" webkit="" doesn't="" clone="" checked state="" correctly="" in="" fragments="" support.checkclone="div.cloneNode(" true="" ).clonenode(="" ).lastchild.checked;="" support:="" ie="" <="11" make="" sure="" textarea="" (and="" checkbox)="" defaultvalue="" is="" properly="" cloned="" div.innerhtml="<textarea>x</textarea>" ;="" support.noclonechecked="!!div.cloneNode(" ).lastchild.defaultvalue;="" }="" )();="" var="" documentelement="document.documentElement;" rkeyevent="/^key/," rmouseevent="/^(?:mouse|pointer|contextmenu|drag|drop)|click/," rtypenamespace="/^([^.]*)(?:\.(.+)|)/;" function="" returntrue()="" {="" return="" true;="" returnfalse()="" false;="" see="" #13393="" for="" more="" info="" safeactiveelement()="" try="" document.activeelement;="" catch="" (="" err="" )="" on(="" elem,="" types,="" selector,="" data,="" fn,="" one="" origfn,="" type;="" types="" can="" be="" a="" map="" of="" handlers="" if="" typeof="" "object"="" types-object,="" data="" selector="" !="=" "string"="" ||="" selector;="" type="" type,="" types[="" ],="" );="" elem;="" null="" &&="" fn="=" =="" undefined;="" else="" false="" !fn="" origfn="fn;" event="" use="" an="" empty="" set,="" since="" contains="" the="" jquery().off(="" origfn.apply(="" this,="" arguments="" };="" same="" guid="" so="" caller="" remove="" using="" fn.guid="origFn.guid" origfn.guid="jQuery.guid++" elem.each(="" function()="" jquery.event.add(="" *="" helper="" functions="" managing="" events="" --="" not="" part="" public="" interface.="" props="" to="" dean="" edwards'="" addevent="" library="" many="" ideas.="" jquery.event="{" global:="" {},="" add:="" function(="" handler,="" handleobjin,="" eventhandle,="" tmp,="" events,="" t,="" handleobj,="" special,="" handlers,="" namespaces,="" origtype,="" elemdata="dataPriv.get(" elem="" don't="" attach="" nodata="" or="" text="" comment="" nodes="" (but="" allow="" plain="" objects)="" !elemdata="" return;="" pass="" object="" custom="" lieu="" handler="" handler.handler="" handleobjin="handler;" ensure="" that="" invalid="" selectors="" throw="" exceptions="" at="" time="" evaluate="" against="" case="" non-element="" node="" (e.g.,="" document)="" jquery.find.matchesselector(="" documentelement,="" has="" unique="" id,="" used="" find="" it="" later="" !handler.guid="" handler.guid="jQuery.guid++;" init="" element's="" structure="" and="" main="" this="" first="" !(="" {};="" eventhandle="elemData.handle" e="" discard="" second="" jquery.event.trigger()="" when="" called="" after="" page="" unloaded="" jquery="" "undefined"="" jquery.event.triggered="" e.type="" ?="" jquery.event.dispatch.apply(="" :="" handle="" multiple separated="" by="" space="" ""="" ).match(="" rnothtmlwhite="" [="" ];="" t="types.length;" while="" t--="" tmp="rtypenamespace.exec(" ]="" [];="" tmp[="" namespaces="(" ).split(="" "."="" ).sort();="" there="" *must*="" no="" attaching="" namespace-only="" !type="" continue;="" changes="" its="" special="" changed="" defined,="" determine="" api="" otherwise="" given="" special.delegatetype="" special.bindtype="" update="" based="" on="" newly="" reset="" handleobj="" passed="" all="" type:="" origtype:="" data:="" handler:="" guid:="" handler.guid,="" selector:="" needscontext:="" jquery.expr.match.needscontext.test(="" ),="" namespace:="" namespaces.join(="" },="" queue="" we're="" handlers.delegatecount="0;" addeventlistener="" returns="" !special.setup="" special.setup.call(="" elem.addeventlistener="" elem.addeventlistener(="" special.add="" special.add.call(="" !handleobj.handler.guid="" handleobj.handler.guid="handler.guid;" add="" list,="" delegates="" front="" handlers.splice(="" handlers.delegatecount++,="" 0,="" handlers.push(="" keep="" track="" which="" have="" ever="" been="" used,="" optimization="" jquery.event.global[="" detach="" set="" from="" element="" remove:="" mappedtypes="" j,="" origcount,="" datapriv.get(="" once="" each="" type.namespace="" types;="" may="" omitted="" unbind="" (on="" namespace,="" provided)="" jquery.event.remove(="" +="" new="" regexp(="" "(^|\\.)"="" "\\.(?:.*\\.|)"="" "(\\.|$)"="" matching="" origcount="j" handlers.length;="" j--="" j="" origtype="==" handleobj.origtype="" !handler="" handleobj.guid="" !tmp="" tmp.test(="" handleobj.namespace="" !selector="" handleobj.selector="" "**"="" handlers.delegatecount--;="" special.remove="" special.remove.call(="" generic="" we="" removed="" something="" exist="" (avoids="" potential="" endless="" recursion="" during="" removal="" handlers)="" !handlers.length="" !special.teardown="" special.teardown.call(="" elemdata.handle="" jquery.removeevent(="" delete="" events[="" expando="" it's="" longer="" jquery.isemptyobject(="" datapriv.remove(="" "handle="" events"="" dispatch:="" nativeevent="" writable="" native="" i,="" ret,="" matched,="" handlerqueue,="" args="new" array(="" arguments.length="" "events"="" {}="" )[="" event.type="" [],="" fix-ed="" rather="" than="" (read-only)="" args[="" i="1;" arguments.length;="" i++="" event.delegatetarget="this;" call="" predispatch="" hook="" mapped="" let="" bail="" desired="" special.predispatch="" special.predispatch.call(="" handlerqueue="jQuery.event.handlers.call(" event,="" run="" first;="" they="" want="" stop="" propagation="" beneath="" us="" matched="handlerQueue[" !event.ispropagationstopped()="" event.currenttarget="matched.elem;" j++="" !event.isimmediatepropagationstopped()="" triggered="" must="" either="" 1)="" 2)="" namespace(s)="" subset="" equal="" those="" bound="" (both="" namespace).="" !event.rnamespace="" event.rnamespace.test(="" event.handleobj="handleObj;" event.data="handleObj.data;" ret="(" jquery.event.special[="" ).handle="" handleobj.handler="" ).apply(="" matched.elem,="" undefined="" event.result="ret" event.preventdefault();="" event.stoppropagation();="" postdispatch="" special.postdispatch="" special.postdispatch.call(="" event.result;="" handlers:="" sel,="" matchedhandlers,="" matchedselectors,="" delegatecount="handlers.delegateCount," cur="event.target;" delegate="" black-hole="" svg="" <use=""> instance trees (trac-13180)2630 cur.nodeType &&2631 // Support: Firefox <=42 11="" suppress="" spec-violating="" clicks="" indicating="" a="" non-primary="" pointer="" button="" (trac-3861)="" https:="" www.w3.org="" tr="" dom-level-3-events="" #event-type-click="" support:="" ie="" only="" ...but="" not="" arrow="" key="" "clicks"="" of="" radio="" inputs,="" which="" can="" have="" `button`="" -1="" (gh-2343)="" !(="" event.type="==" "click"="" &&="" event.button="">= 1 ) ) {2632 for ( ; cur !== this; cur = cur.parentNode || this ) {2633 // Don't check non-elements (#13208)2634 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)2635 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {2636 matchedHandlers = [];2637 matchedSelectors = {};2638 for ( i = 0; i < delegateCount; i++ ) {2639 handleObj = handlers[ i ];2640 // Don't conflict with Object.prototype properties (#13203)2641 sel = handleObj.selector + " ";2642 if ( matchedSelectors[ sel ] === undefined ) {2643 matchedSelectors[ sel ] = handleObj.needsContext ?2644 jQuery( sel, this ).index( cur ) > -1 :2645 jQuery.find( sel, this, null, [ cur ] ).length;2646 }2647 if ( matchedSelectors[ sel ] ) {2648 matchedHandlers.push( handleObj );2649 }2650 }2651 if ( matchedHandlers.length ) {2652 handlerQueue.push( { elem: cur, handlers: matchedHandlers } );2653 }2654 }2655 }2656 }2657 // Add the remaining (directly-bound) handlers2658 cur = this;2659 if ( delegateCount < handlers.length ) {2660 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );2661 }2662 return handlerQueue;2663 },2664 addProp: function( name, hook ) {2665 Object.defineProperty( jQuery.Event.prototype, name, {2666 enumerable: true,2667 configurable: true,2668 get: isFunction( hook ) ?2669 function() {2670 if ( this.originalEvent ) {2671 return hook( this.originalEvent );2672 }2673 } :2674 function() {2675 if ( this.originalEvent ) {2676 return this.originalEvent[ name ];2677 }2678 },2679 set: function( value ) {2680 Object.defineProperty( this, name, {2681 enumerable: true,2682 configurable: true,2683 writable: true,2684 value: value2685 } );2686 }2687 } );2688 },2689 fix: function( originalEvent ) {2690 return originalEvent[ jQuery.expando ] ?2691 originalEvent :2692 new jQuery.Event( originalEvent );2693 },2694 special: {2695 load: {2696 // Prevent triggered image.load events from bubbling to window.load2697 noBubble: true2698 },2699 focus: {2700 // Fire native event if possible so blur/focus sequence is correct2701 trigger: function() {2702 if ( this !== safeActiveElement() && this.focus ) {2703 this.focus();2704 return false;2705 }2706 },2707 delegateType: "focusin"2708 },2709 blur: {2710 trigger: function() {2711 if ( this === safeActiveElement() && this.blur ) {2712 this.blur();2713 return false;2714 }2715 },2716 delegateType: "focusout"2717 },2718 click: {2719 // For checkbox, fire native event so checked state will be right2720 trigger: function() {2721 if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) {2722 this.click();2723 return false;2724 }2725 },2726 // For cross-browser consistency, don't fire native .click() on links2727 _default: function( event ) {2728 return nodeName( event.target, "a" );2729 }2730 },2731 beforeunload: {2732 postDispatch: function( event ) {2733 // Support: Firefox 20+2734 // Firefox doesn't alert if the returnValue field is not set.2735 if ( event.result !== undefined && event.originalEvent ) {2736 event.originalEvent.returnValue = event.result;2737 }2738 }2739 }2740 }2741};2742jQuery.removeEvent = function( elem, type, handle ) {2743 // This "if" is needed for plain objects2744 if ( elem.removeEventListener ) {2745 elem.removeEventListener( type, handle );2746 }2747};2748jQuery.Event = function( src, props ) {2749 // Allow instantiation without the 'new' keyword2750 if ( !( this instanceof jQuery.Event ) ) {2751 return new jQuery.Event( src, props );2752 }2753 // Event object2754 if ( src && src.type ) {2755 this.originalEvent = src;2756 this.type = src.type;2757 // Events bubbling up the document may have been marked as prevented2758 // by a handler lower down the tree; reflect the correct value.2759 this.isDefaultPrevented = src.defaultPrevented ||2760 src.defaultPrevented === undefined &&2761 // Support: Android <=2.3 1="==" 2="==" 3="" 4="" 7="" 2003="" 3229="" only="" src.returnvalue="==" false="" ?="" returntrue="" :="" returnfalse;="" create="" target="" properties="" support:="" safari="" <="6" -="" should="" not="" be="" a="" text="" node="" (#504,="" #13143)="" this.target="(" src.target="" &&="" src.target.nodetype="==" )="" src.target.parentnode="" src.target;="" this.currenttarget="src.currentTarget;" this.relatedtarget="src.relatedTarget;" event="" type="" }="" else="" {="" this.type="src;" put="" explicitly="" provided="" onto="" the="" object="" if="" (="" props="" jquery.extend(="" this,="" );="" timestamp="" incoming="" doesn't="" have="" one="" this.timestamp="src" src.timestamp="" ||="" date.now();="" mark="" it="" as="" fixed="" this[="" jquery.expando="" ]="true;" };="" jquery.event="" is="" based="" on="" dom3="" events="" specified="" by="" ecmascript="" language="" binding="" https:="" www.w3.org="" tr="" wd-dom-level-3-events-20030331="" ecma-script-binding.html="" jquery.event.prototype="{" constructor:="" jquery.event,="" isdefaultprevented:="" returnfalse,="" ispropagationstopped:="" isimmediatepropagationstopped:="" issimulated:="" false,="" preventdefault:="" function()="" var="" e="this.originalEvent;" this.isdefaultprevented="returnTrue;" !this.issimulated="" e.preventdefault();="" },="" stoppropagation:="" this.ispropagationstopped="returnTrue;" e.stoppropagation();="" stopimmediatepropagation:="" this.isimmediatepropagationstopped="returnTrue;" e.stopimmediatepropagation();="" this.stoppropagation();="" includes="" all="" common="" including="" keyevent="" and="" mouseevent="" specific="" jquery.each(="" altkey:="" true,="" bubbles:="" cancelable:="" changedtouches:="" ctrlkey:="" detail:="" eventphase:="" metakey:="" pagex:="" pagey:="" shiftkey:="" view:="" "char":="" charcode:="" key:="" keycode:="" button:="" buttons:="" clientx:="" clienty:="" offsetx:="" offsety:="" pointerid:="" pointertype:="" screenx:="" screeny:="" targettouches:="" toelement:="" touches:="" which:="" function(="" button="event.button;" add="" which="" for="" key="" event.which="=" null="" rkeyevent.test(="" event.type="" return="" event.charcode="" !="null" event.keycode;="" click:="" left;="" middle;="" right="" !event.which="" undefined="" rmouseevent.test(="" &="" 1;="" 3;="" 2;="" 0;="" event.which;="" jquery.event.addprop="" mouseenter="" leave="" using="" mouseover="" out="" event-time="" checks="" so="" that="" delegation="" works="" in="" jquery.="" do="" same="" pointerenter="" pointerleave="" pointerover="" pointerout="" sends="" too="" often;="" see:="" bugs.chromium.org="" p="" chromium="" issues="" detail?id="470258" description="" of="" bug="" (it="" existed="" older="" chrome="" versions="" well).="" mouseenter:="" "mouseover",="" mouseleave:="" "mouseout",="" pointerenter:="" "pointerover",="" pointerleave:="" "pointerout"="" orig,="" fix="" jquery.event.special[="" orig="" delegatetype:="" fix,="" bindtype:="" handle:="" ret,="" related="event.relatedTarget," handleobj="event.handleObj;" call="" handler="" outside="" target.="" nb:="" no="" relatedtarget="" mouse="" left="" entered="" browser="" window="" !related="" !jquery.contains(="" target,="" ret="handleObj.handler.apply(" arguments="" ret;="" jquery.fn.extend(="" on:="" types,="" selector,="" data,="" fn="" on(="" one:="" fn,="" off:="" handleobj,="" type;="" types="" types.preventdefault="" types.handleobj="" dispatched="" jquery(="" types.delegatetarget="" ).off(="" handleobj.namespace="" handleobj.origtype="" +="" "."="" handleobj.origtype,="" handleobj.selector,="" handleobj.handler="" this;="" typeof="" "object"="" types-object="" [,="" selector]="" this.off(="" type,="" types[="" selector="==" "function"="" fn]="" this.each(="" jquery.event.remove(="" *="" eslint-disable="" max-len="" see="" github.com="" eslint="" rxhtmltag="/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0">\x20\t\r\n\f]*)[^>]*)\/>/gi,2762 /* eslint-enable */2763 // Support: IE <=10 12="" 13="" 1736512="" -="" 11,="" edge="" only="" in="" ie="" using="" regex="" groups="" here="" causes="" severe="" slowdowns.="" see="" https:="" connect.microsoft.com="" feedback="" details="" rnoinnerhtml="/<script|<style|<link/i," checked="checked" or="" rchecked="/checked\s*(?:[^=]|=\s*.checked.)/i," rcleanscript="/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)">\s*$/g;2764// Prefer a tbody over its parent table for containing new rows2765function manipulationTarget( elem, content ) {2766 if ( nodeName( elem, "table" ) &&2767 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {2768 return jQuery( elem ).children( "tbody" )[ 0 ] || elem;2769 }2770 return elem;2771}2772// Replace/restore the type attribute of script elements for safe DOM manipulation2773function disableScript( elem ) {2774 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;2775 return elem;2776}2777function restoreScript( elem ) {2778 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {2779 elem.type = elem.type.slice( 5 );2780 } else {2781 elem.removeAttribute( "type" );2782 }2783 return elem;2784}2785function cloneCopyEvent( src, dest ) {2786 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;2787 if ( dest.nodeType !== 1 ) {2788 return;2789 }2790 // 1. Copy private data: events, handlers, etc.2791 if ( dataPriv.hasData( src ) ) {2792 pdataOld = dataPriv.access( src );2793 pdataCur = dataPriv.set( dest, pdataOld );2794 events = pdataOld.events;2795 if ( events ) {2796 delete pdataCur.handle;2797 pdataCur.events = {};2798 for ( type in events ) {2799 for ( i = 0, l = events[ type ].length; i < l; i++ ) {2800 jQuery.event.add( dest, type, events[ type ][ i ] );2801 }2802 }2803 }2804 }2805 // 2. Copy user data2806 if ( dataUser.hasData( src ) ) {2807 udataOld = dataUser.access( src );2808 udataCur = jQuery.extend( {}, udataOld );2809 dataUser.set( dest, udataCur );2810 }2811}2812// Fix IE bugs, see support tests2813function fixInput( src, dest ) {2814 var nodeName = dest.nodeName.toLowerCase();2815 // Fails to persist the checked state of a cloned checkbox or radio button.2816 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {2817 dest.checked = src.checked;2818 // Fails to return the selected option to the default selected state when cloning options2819 } else if ( nodeName === "input" || nodeName === "textarea" ) {2820 dest.defaultValue = src.defaultValue;2821 }2822}2823function domManip( collection, args, callback, ignored ) {2824 // Flatten any nested arrays2825 args = concat.apply( [], args );2826 var fragment, first, scripts, hasScripts, node, doc,2827 i = 0,2828 l = collection.length,2829 iNoClone = l - 1,2830 value = args[ 0 ],2831 valueIsFunction = isFunction( value );2832 // We can't cloneNode fragments that contain checked, in WebKit2833 if ( valueIsFunction ||2834 ( l > 1 && typeof value === "string" &&2835 !support.checkClone && rchecked.test( value ) ) ) {2836 return collection.each( function( index ) {2837 var self = collection.eq( index );2838 if ( valueIsFunction ) {2839 args[ 0 ] = value.call( this, index, self.html() );2840 }2841 domManip( self, args, callback, ignored );2842 } );2843 }2844 if ( l ) {2845 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );2846 first = fragment.firstChild;2847 if ( fragment.childNodes.length === 1 ) {2848 fragment = first;2849 }2850 // Require either new content or an interest in ignored elements to invoke the callback2851 if ( first || ignored ) {2852 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );2853 hasScripts = scripts.length;2854 // Use the original fragment for the last item2855 // instead of the first because it can end up2856 // being emptied incorrectly in certain situations (#8070).2857 for ( ; i < l; i++ ) {2858 node = fragment;2859 if ( i !== iNoClone ) {2860 node = jQuery.clone( node, true, true );2861 // Keep references to cloned scripts for later restoration2862 if ( hasScripts ) {2863 // Support: Android <=4.0 1="" only,="" phantomjs="" only="" push.apply(_,="" arraylike)="" throws="" on="" ancient="" webkit="" jquery.merge(="" scripts,="" getall(="" node,="" "script"="" )="" );="" }="" callback.call(="" collection[="" i="" ],="" if="" (="" hasscripts="" {="" doc="scripts[" scripts.length="" -="" ].ownerdocument;="" reenable="" scripts="" jquery.map(="" restorescript="" evaluate="" executable="" first="" document="" insertion="" for="" <="" hasscripts;="" i++="" node="scripts[" ];="" rscripttype.test(="" node.type="" ||="" ""="" &&="" !datapriv.access(="" "globaleval"="" jquery.contains(="" doc,="" node.src="" ).tolowercase()="" !="=" "module"="" optional="" ajax="" dependency,="" but="" won't="" run="" not="" present="" jquery._evalurl="" jquery._evalurl(="" else="" domeval(="" node.textcontent.replace(="" rcleanscript,="" ),="" return="" collection;="" function="" remove(="" elem,="" selector,="" keepdata="" var="" nodes="selector" ?="" jquery.filter(="" elem="" :="" ;="" ]="" !keepdata="" node.nodetype="==" jquery.cleandata(="" node.parentnode="" node.ownerdocument,="" setglobaleval(="" node.parentnode.removechild(="" elem;="" jquery.extend(="" htmlprefilter:="" function(="" html="" html.replace(="" rxhtmltag,="" "<$1="">" );2864 },2865 clone: function( elem, dataAndEvents, deepDataAndEvents ) {2866 var i, l, srcElements, destElements,2867 clone = elem.cloneNode( true ),2868 inPage = jQuery.contains( elem.ownerDocument, elem );2869 // Fix IE cloning issues2870 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&2871 !jQuery.isXMLDoc( elem ) ) {2872 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/22873 destElements = getAll( clone );2874 srcElements = getAll( elem );2875 for ( i = 0, l = srcElements.length; i < l; i++ ) {2876 fixInput( srcElements[ i ], destElements[ i ] );2877 }2878 }2879 // Copy the events from the original to the clone2880 if ( dataAndEvents ) {2881 if ( deepDataAndEvents ) {2882 srcElements = srcElements || getAll( elem );2883 destElements = destElements || getAll( clone );2884 for ( i = 0, l = srcElements.length; i < l; i++ ) {2885 cloneCopyEvent( srcElements[ i ], destElements[ i ] );2886 }2887 } else {2888 cloneCopyEvent( elem, clone );2889 }2890 }2891 // Preserve script evaluation history2892 destElements = getAll( clone, "script" );2893 if ( destElements.length > 0 ) {2894 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );2895 }2896 // Return the cloned set2897 return clone;2898 },2899 cleanData: function( elems ) {2900 var data, elem, type,2901 special = jQuery.event.special,2902 i = 0;2903 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {2904 if ( acceptData( elem ) ) {2905 if ( ( data = elem[ dataPriv.expando ] ) ) {2906 if ( data.events ) {2907 for ( type in data.events ) {2908 if ( special[ type ] ) {2909 jQuery.event.remove( elem, type );2910 // This is a shortcut to avoid jQuery.event.remove's overhead2911 } else {2912 jQuery.removeEvent( elem, type, data.handle );2913 }2914 }2915 }2916 // Support: Chrome <=35 0="" 1="" 2="" 3="" 9="" 11="" 36="" 44="" -="" 45+="" assign="" undefined="" instead="" of="" using="" delete,="" see="" data#remove="" elem[="" datapriv.expando="" ]="undefined;" }="" if="" (="" datauser.expando="" )="" {="" support:="" chrome="" <="35" );="" jquery.fn.extend(="" detach:="" function(="" selector="" return="" remove(="" this,="" selector,="" true="" },="" remove:="" text:="" value="" access(="" ?="" jquery.text(="" this="" :="" this.empty().each(="" function()="" this.nodetype="==" ||="" this.textcontent="value;" null,="" value,="" arguments.length="" append:="" dommanip(="" arguments,="" elem="" var="" target="manipulationTarget(" target.appendchild(="" prepend:="" target.insertbefore(="" elem,="" target.firstchild="" before:="" this.parentnode="" this.parentnode.insertbefore(="" after:="" this.nextsibling="" empty:="" i="0;" for="" ;="" !="null;" i++="" elem.nodetype="==" prevent="" memory="" leaks="" jquery.cleandata(="" getall(="" false="" remove="" any="" remaining="" nodes="" elem.textcontent="" this;="" clone:="" dataandevents,="" deepdataandevents="" dataandevents="dataAndEvents" =="null" dataandevents;="" deepdataandevents;="" this.map(="" jquery.clone(="" html:="" {},="" l="this.length;" &&="" elem.innerhtml;="" we="" can="" take="" a="" shortcut="" and="" just="" use="" innerhtml="" typeof="" "string"="" !rnoinnerhtml.test(="" !wrapmap[="" rtagname.exec(="" [="" "",="" ""="" )[="" ].tolowercase()="" try="" l;="" {};="" element="" elem.innerhtml="value;" throws="" an="" exception,="" the="" fallback="" method="" catch="" e="" {}="" this.empty().append(="" replacewith:="" ignored="[];" make="" changes,="" replacing="" each="" non-ignored="" context="" with="" new="" content="" parent="this.parentNode;" jquery.inarray(="" parent.replacechild(="" force="" callback="" invocation="" jquery.each(="" appendto:="" "append",="" prependto:="" "prepend",="" insertbefore:="" "before",="" insertafter:="" "after",="" replaceall:="" "replacewith"="" name,="" original="" jquery.fn[="" name="" elems,="" ret="[]," insert="jQuery(" ),="" last="insert.length" 1,="" elems="i" this.clone(="" jquery(="" insert[="" ](="" android="" only,="" phantomjs="" only="" .get()="" because="" push.apply(_,="" arraylike)="" on="" ancient="" webkit="" push.apply(="" ret,="" elems.get()="" this.pushstack(="" };="" rnumnonpx="new" regexp(="" "^("="" +="" pnum="" ")(?!px)[a-z%]+$",="" "i"="" getstyles="function(" ie="" firefox="" (#15098,="" #14150)="" elements="" created="" in="" popups="" ff="" meanwhile="" frame="" through="" "defaultview.getcomputedstyle"="" view="elem.ownerDocument.defaultView;" !view="" !view.opener="" view.getcomputedstyle(="" rboxstyle="new" cssexpand.join(="" "|"="" executing="" both="" pixelposition="" &="" boxsizingreliable="" tests="" require="" one="" layout="" so="" they're="" executed="" at="" same="" time="" to="" save="" second="" computation.="" function="" computestyletests()="" is="" singleton,="" need="" execute="" it="" once="" !div="" return;="" container.style.csstext="position:absolute;left:-11111px;width:60px;" "margin-top:1px;padding:0;border:0";="" div.style.csstext="position:relative;display:block;box-sizing:border-box;overflow:scroll;" "margin:auto;border:1px;padding:1px;"="" "width:60%;top:1%";="" documentelement.appendchild(="" container="" ).appendchild(="" div="" divstyle="window.getComputedStyle(" pixelpositionval="divStyle.top" "1%";="" 4.0="" 4.3="" reliablemarginleftval="roundPixelMeasures(" divstyle.marginleft="" 12;="" safari="" 10.1,="" ios="" 9.3="" some="" styles="" come="" back="" percentage="" values,="" even="" though="" they="" shouldn't="" div.style.right="60%" pixelboxstylesval="roundPixelMeasures(" divstyle.right="" 36;="" detect="" misreporting="" dimensions="" box-sizing:border-box="" boxsizingreliableval="roundPixelMeasures(" divstyle.width="" overflow:scroll="" screwiness="" (gh-3699)="" div.style.position="absolute" scrollboxsizeval="div.offsetWidth" "absolute";="" documentelement.removechild(="" nullify="" wouldn't="" be="" stored="" will="" also="" sign="" that="" checks="" already="" performed="" roundpixelmeasures(="" measure="" math.round(="" parsefloat(="" pixelpositionval,="" boxsizingreliableval,="" scrollboxsizeval,="" pixelboxstylesval,="" reliablemarginleftval,="" "div"="" finish="" early="" limited="" (non-browser)="" environments="" !div.style="" style="" cloned="" affects="" source="" (#8908)="" div.style.backgroundclip="content-box" div.clonenode(="" ).style.backgroundclip="" support.clearclonestyle="div.style.backgroundClip" "content-box";="" jquery.extend(="" support,="" boxsizingreliable:="" computestyletests();="" boxsizingreliableval;="" pixelboxstyles:="" pixelboxstylesval;="" pixelposition:="" pixelpositionval;="" reliablemarginleft:="" reliablemarginleftval;="" scrollboxsize:="" scrollboxsizeval;="" )();="" curcss(="" computed="" width,="" minwidth,="" maxwidth,="" 51+="" retrieving="" before="" somehow="" fixes="" issue="" getting="" wrong="" values="" detached="" getstyles(="" getpropertyvalue="" needed="" for:="" .css('filter')="" (ie="" #12537)="" .css('--customproperty)="" (#3144)="" computed[="" ];="" !jquery.contains(="" elem.ownerdocument,="" tribute="" "awesome="" hack="" by="" dean="" edwards"="" browser="" returns="" but="" width="" seems="" reliably="" pixels.="" against="" cssom="" draft="" spec:="" https:="" drafts.csswg.org="" #resolved-values="" !support.pixelboxstyles()="" rnumnonpx.test(="" rboxstyle.test(="" remember="" minwidth="style.minWidth;" maxwidth="style.maxWidth;" put="" get="" out="" style.minwidth="style.maxWidth" style.width="ret;" revert="" changed="" style.maxwidth="maxWidth;" zindex="" as="" integer.="" ret;="" addgethookif(="" conditionfn,="" hookfn="" define="" hook,="" we'll="" check="" first="" run="" it's="" really="" needed.="" get:="" conditionfn()="" hook="" not="" (or="" possible="" due="" missing="" dependency),="" it.="" delete="" this.get;="" needed;="" redefine="" support="" test="" again.="" this.get="hookFn" ).apply(="" arguments="" swappable="" display="" none="" or="" starts="" table="" except="" "table",="" "table-cell",="" "table-caption"="" here="" values:="" developer.mozilla.org="" en-us="" docs="" css="" rdisplayswap="/^(none|table(?!-c[ea]).+)/," rcustomprop="/^--/," cssshow="{" position:="" "absolute",="" visibility:="" "hidden",="" display:="" "block"="" cssnormaltransform="{" letterspacing:="" "0",="" fontweight:="" "400"="" cssprefixes="[" "webkit",="" "moz",="" "ms"="" ],="" emptystyle="document.createElement(" ).style;="" property="" mapped="" potentially="" vendor="" prefixed="" vendorpropname(="" names="" are="" name;="" capname="name[" ].touppercase()="" name.slice(="" while="" i--="" capname;="" along="" what="" jquery.cssprops="" suggests="" property.="" finalpropname(="" !ret="" setpositivenumber(="" subtract="" relative="" (+="" -)="" have="" been="" normalized="" point="" matches="rcssNum.exec(" guard="" "subtract",="" e.g.,="" when="" used="" csshooks="" math.max(="" 0,="" matches[="" "px"="" value;="" boxmodeladjustment(="" dimension,="" box,="" isborderbox,="" styles,="" computedval="" "width"="" extra="0," delta="0;" adjustment="" may="" necessary="" box="==" isborderbox="" "border"="" "content"="" 0;="" 4;="" models="" exclude="" margin="" "margin"="" cssexpand[="" true,="" content-box,="" we're="" seeking="" "padding"="" !isborderbox="" add="" padding="" "margin",="" border="" "width",="" still="" keep="" track="" otherwise="" else="" border-box="" (content="" border),="" "content",="" "padding",="" account="" positive="" content-box="" scroll="" gutter="" requested="" providing="">= 0 ) {2917 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border2918 // Assuming integer scroll gutter, subtract the rest and round down2919 delta += Math.max( 0, Math.ceil(2920 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -2921 computedVal -2922 delta -2923 extra -2924 0.52925 ) );2926 }2927 return delta;2928}2929function getWidthOrHeight( elem, dimension, extra ) {2930 // Start with computed style2931 var styles = getStyles( elem ),2932 val = curCSS( elem, dimension, styles ),2933 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box",2934 valueIsBorderBox = isBorderBox;2935 // Support: Firefox <=54 0="" 1="" 2="" 3="" 8="" return="" a="" confounding="" non-pixel="" value="" or="" feign="" ignorance,="" as="" appropriate.="" if="" (="" rnumnonpx.test(="" val="" )="" {="" !extra="" val;="" }="" ;="" check="" for="" style="" in="" case="" browser="" which="" returns="" unreliable="" values="" getcomputedstyle="" silently="" falls="" back="" to="" the="" reliable="" elem.style="" valueisborderbox="valueIsBorderBox" &&="" support.boxsizingreliable()="" ||="" elem.style[="" dimension="" ]="" );="" fall="" offsetwidth="" offsetheight="" when="" is="" "auto"="" this="" happens="" inline="" elements="" with="" no="" explicit="" setting="" (gh-3571)="" support:="" android="" <="4.1" -="" 4.3="" only="" also="" use="" misreported="" dimensions="" (gh-3602)="" !parsefloat(="" jquery.css(="" elem,="" "display",="" false,="" styles="" "inline"="" "offset"="" +="" dimension[="" ].touppercase()="" dimension.slice(="" ];="" provide="" border-box="" normalize="" ""="" and="" auto="" 0;="" adjust="" element's="" box="" model="" boxmodeladjustment(="" dimension,="" extra="" isborderbox="" ?="" "border"="" :="" "content"="" ),="" valueisborderbox,="" styles,="" current="" computed="" size="" request="" scroll="" gutter="" calculation="" (gh-3589)="" "px";="" jquery.extend(="" add="" property="" hooks="" overriding="" default behavior="" of="" getting="" csshooks:="" opacity:="" get:="" function(="" we="" should="" always="" get="" number="" from="" opacity="" var="" ret="curCSS(" "opacity"="" "1"="" ret;="" },="" don't="" automatically="" "px"="" these="" possibly-unitless="" properties="" cssnumber:="" "animationiterationcount":="" true,="" "columncount":="" "fillopacity":="" "flexgrow":="" "flexshrink":="" "fontweight":="" "lineheight":="" "opacity":="" "order":="" "orphans":="" "widows":="" "zindex":="" "zoom":="" true="" whose="" names="" you="" wish="" fix="" before="" cssprops:="" {},="" set="" on="" dom="" node="" style:="" name,="" value,="" text="" comment="" nodes="" !elem="" elem.nodetype="==" !elem.style="" return;="" make="" sure="" that="" we're="" working="" right="" name="" ret,="" type,="" hooks,="" origname="camelCase(" iscustomprop="rcustomProp.test(" name.="" want="" query="" it="" css="" custom="" since="" they="" are="" user-defined.="" !iscustomprop="" gets="" hook="" prefixed="" version,="" then="" unprefixed="" version="" jquery.csshooks[="" !="=" undefined="" type="typeof" value;="" convert="" "+=" or " string"="" ret[="" fixes="" bug="" #9237="" null="" nan="" aren't="" (#7116)="" was="" passed="" in,="" unit="" (except="" certain="" properties)="" "number"="" jquery.cssnumber[="" background-*="" props="" affect="" original="" clone's="" !support.clearclonestyle="" name.indexof(="" "background"="" style[="" provided,="" otherwise="" just="" specified="" !hooks="" !(="" "set"="" style.setproperty(="" else="" provided="" non-computed="" there="" "get"="" object="" css:="" extra,="" val,="" num,="" modify="" try="" followed="" by="" otherwise,="" way="" exists,="" "normal"="" cssnormaltransform="" numeric="" forced="" qualifier="" looks="" num="parseFloat(" isfinite(="" jquery.each(="" [="" "height",="" "width"="" ],="" i,="" computed,="" can="" have="" info="" invisibly="" show="" them="" but="" must="" display="" would="" benefit="" rdisplayswap.test(="" "display"="" safari="" 8+="" table="" columns="" non-zero="" &="" zero="" getboundingclientrect().width="" unless="" changed.="" ie="" running="" getboundingclientrect="" disconnected="" throws="" an="" error.="" !elem.getclientrects().length="" !elem.getboundingclientrect().width="" swap(="" cssshow,="" function()="" getwidthorheight(="" set:="" matches,="" elem="" "boxsizing",="" "border-box",="" subtract="extra" isborderbox,="" account="" comparing="" offset*="" faking="" content-box="" border="" padding="" (gh-3699)="" support.scrollboxsize()="==" styles.position="" elem[="" parsefloat(="" styles[="" "border",="" 0.5="" pixels="" adjustment="" needed="" matches="rcssNum.exec(" matches[="" setpositivenumber(="" };="" jquery.csshooks.marginleft="addGetHookIf(" support.reliablemarginleft,="" curcss(="" "marginleft"="" elem.getboundingclientrect().left="" marginleft:="" elem.getboundingclientrect().left;="" used="" animate="" expand="" margin:="" "",="" padding:="" border:="" prefix,="" suffix="" prefix="" expand:="" i="0," expanded="{}," assumes="" single="" not="" string="" parts="typeof" "string"="" value.split(="" "="" 4;="" i++="" expanded[="" cssexpand[="" parts[="" expanded;="" "margin"="" ].set="setPositiveNumber;" jquery.fn.extend(="" access(="" this,="" len,="" map="{}," array.isarray(="" len="name.length;" len;="" map[="" name[="" map;="" jquery.style(="" arguments.length=""> 1 );2936 }2937} );2938function Tween( elem, options, prop, end, easing ) {2939 return new Tween.prototype.init( elem, options, prop, end, easing );2940}2941jQuery.Tween = Tween;2942Tween.prototype = {2943 constructor: Tween,2944 init: function( elem, options, prop, end, easing, unit ) {2945 this.elem = elem;2946 this.prop = prop;2947 this.easing = easing || jQuery.easing._default;2948 this.options = options;2949 this.start = this.now = this.cur();2950 this.end = end;2951 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );2952 },2953 cur: function() {2954 var hooks = Tween.propHooks[ this.prop ];2955 return hooks && hooks.get ?2956 hooks.get( this ) :2957 Tween.propHooks._default.get( this );2958 },2959 run: function( percent ) {2960 var eased,2961 hooks = Tween.propHooks[ this.prop ];2962 if ( this.options.duration ) {2963 this.pos = eased = jQuery.easing[ this.easing ](2964 percent, this.options.duration * percent, 0, 1, this.options.duration2965 );2966 } else {2967 this.pos = eased = percent;2968 }2969 this.now = ( this.end - this.start ) * eased + this.start;2970 if ( this.options.step ) {2971 this.options.step.call( this.elem, this.now, this );2972 }2973 if ( hooks && hooks.set ) {2974 hooks.set( this );2975 } else {2976 Tween.propHooks._default.set( this );2977 }2978 return this;2979 }2980};2981Tween.prototype.init.prototype = Tween.prototype;2982Tween.propHooks = {2983 _default: {2984 get: function( tween ) {2985 var result;2986 // Use a property on the element directly when it is not a DOM element,2987 // or when there is no matching style property that exists.2988 if ( tween.elem.nodeType !== 1 ||2989 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {2990 return tween.elem[ tween.prop ];2991 }2992 // Passing an empty string as a 3rd parameter to .css will automatically2993 // attempt a parseFloat and fallback to a string if the parse fails.2994 // Simple values such as "10px" are parsed to Float;2995 // complex values such as "rotate(1rad)" are returned as-is.2996 result = jQuery.css( tween.elem, tween.prop, "" );2997 // Empty strings, null, undefined and "auto" are converted to 0.2998 return !result || result === "auto" ? 0 : result;2999 },3000 set: function( tween ) {3001 // Use step hook for back compat.3002 // Use cssHook if its there.3003 // Use .style if available and use plain properties where available.3004 if ( jQuery.fx.step[ tween.prop ] ) {3005 jQuery.fx.step[ tween.prop ]( tween );3006 } else if ( tween.elem.nodeType === 1 &&3007 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||3008 jQuery.cssHooks[ tween.prop ] ) ) {3009 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );3010 } else {3011 tween.elem[ tween.prop ] = tween.now;3012 }3013 }3014 }3015};3016// Support: IE <=9 0="" 1="" 2="" 3="" 12="" 15="" only="" panic="" based="" approach="" to="" setting="" things="" on="" disconnected="" nodes="" tween.prophooks.scrolltop="Tween.propHooks.scrollLeft" =="" {="" set:="" function(="" tween="" )="" if="" (="" tween.elem.nodetype="" &&="" tween.elem.parentnode="" tween.elem[="" tween.prop="" ]="tween.now;" }="" };="" jquery.easing="{" linear:="" p="" return="" p;="" },="" swing:="" 0.5="" -="" math.cos(="" *="" math.pi="" 2;="" _default:="" "swing"="" jquery.fx="Tween.prototype.init;" back="" compat="" <1.8="" extension="" point="" jquery.fx.step="{};" var="" fxnow,="" inprogress,="" rfxtypes="/^(?:toggle|show|hide)$/," rrun="/queueHooks$/;" function="" schedule()="" inprogress="" document.hidden="==" false="" window.requestanimationframe="" window.requestanimationframe(="" schedule="" );="" else="" window.settimeout(="" schedule,="" jquery.fx.interval="" jquery.fx.tick();="" animations="" created="" synchronously="" will="" run="" createfxnow()="" function()="" fxnow="undefined;" generate="" parameters="" create="" a="" standard="" animation="" genfx(="" type,="" includewidth="" which,="" i="0," attrs="{" height:="" type="" we="" include="" width,="" step="" value="" is="" do="" all="" cssexpand="" values,="" otherwise="" skip="" over="" left="" and="" right="" ?="" :="" 0;="" for="" ;="" <="" 4;="" +="2" which="cssExpand[" ];="" attrs[="" "margin"="" "padding"="" attrs.opacity="attrs.width" type;="" attrs;="" createtween(="" value,="" prop,="" tween,="" collection="(" animation.tweeners[="" prop="" ||="" []="" ).concat(="" "*"="" ),="" index="0," length="collection.length;" length;="" index++="" ].call(="" animation,="" we're="" done="" with="" this="" property="" tween;="" defaultprefilter(="" elem,="" props,="" opts="" toggle,="" hooks,="" oldfire,="" proptween,="" restoredisplay,="" display,="" isbox="width" in="" props="" "height"="" anim="this," orig="{}," style="elem.style," hidden="elem.nodeType" ishiddenwithintree(="" elem="" datashow="dataPriv.get(" "fxshow"="" queue-skipping="" hijack="" the="" fx="" hooks="" !opts.queue="" "fx"="" hooks.unqueued="=" null="" oldfire="hooks.empty.fire;" hooks.empty.fire="function()" !hooks.unqueued="" oldfire();="" hooks.unqueued++;="" anim.always(="" ensure="" complete="" handler="" called="" before="" completes="" hooks.unqueued--;="" !jquery.queue(="" ).length="" hooks.empty.fire();="" detect="" show="" hide="" rfxtypes.test(="" delete="" props[="" toggle="toggle" "toggle";="" "hide"="" "show"="" pretend="" be="" there="" still="" data="" from="" stopped="" datashow[="" !="=" undefined="" ignore="" other="" no-op="" continue;="" orig[="" jquery.style(="" bail="" out="" like="" .hide().hide()="" proptween="!jQuery.isEmptyObject(" !proptween="" jquery.isemptyobject(="" return;="" restrict="" "overflow"="" "display"="" styles="" during="" box="" elem.nodetype="==" support:="" ie="" 11,="" edge="" record="" overflow="" attributes="" because="" does="" not="" infer="" shorthand="" identically-valued="" overflowx="" overflowy="" just="" mirrors="" there.="" opts.overflow="[" style.overflow,="" style.overflowx,="" style.overflowy="" identify="" display="" preferring="" old="" css="" cascade="" restoredisplay="dataShow" datashow.display;="" "none"="" get="" nonempty="" value(s)="" by="" temporarily="" forcing="" visibility="" showhide(="" [="" ],="" true="" restoredisplay;="" animate="" inline="" elements="" as="" inline-block="" "inline"="" "inline-block"="" jquery.css(="" "float"="" restore="" original="" at="" end="" of="" pure="" anim.done(="" style.display="restoreDisplay;" ""="" display;="" style.overflow="hidden" style.overflowx="opts.overflow[" implement="" general="" setup="" element="" "hidden"="" "fxshow",="" display:="" store="" visible="" so="" `.stop().toggle()`="" "reverses"="" datashow.hidden="!hidden;" animating="" them="" eslint-disable="" no-loop-func="" eslint-enable="" final="" actually="" hiding="" !hidden="" datapriv.remove(="" per-property="" 0,="" !(="" proptween.end="propTween.start;" proptween.start="0;" propfilter(="" specialeasing="" index,="" name,="" easing,="" hooks;="" camelcase,="" expand="" csshook="" pass="" name="camelCase(" easing="specialEasing[" array.isarray(="" "expand"="" quite="" $.extend,="" won't="" overwrite="" existing="" keys.="" reusing="" 'index'="" have="" correct="" "name"="" specialeasing[="" animation(="" properties,="" options="" result,="" stopped,="" deferred="jQuery.Deferred().always(" don't="" match="" :animated="" selector="" tick.elem;="" tick="function()" false;="" currenttime="fxNow" createfxnow(),="" remaining="Math.max(" animation.starttime="" animation.duration="" android="" 2.3="" archaic="" crash="" bug="" allow="" us="" use="" `1="" )`="" (#12497)="" temp="remaining" percent="1" temp,="" animation.tweens[="" ].run(="" deferred.notifywith(="" percent,="" there's="" more="" do,="" yield="" remaining;="" was="" an="" empty="" synthesize="" progress="" notification="" !length="" 1,="" resolve="" report="" its="" conclusion="" deferred.resolvewith(="" elem:="" props:="" jquery.extend(="" {},="" properties="" opts:="" true,="" specialeasing:="" easing:="" jquery.easing._default="" originalproperties:="" originaloptions:="" options,="" starttime:="" duration:="" options.duration,="" tweens:="" [],="" createtween:="" animation.opts,="" end,="" animation.opts.specialeasing[="" animation.opts.easing="" animation.tweens.push(="" stop:="" gotoend="" are="" going="" want="" tweens="" part="" animation.tweens.length="" this;="" when="" played="" last="" frame;="" otherwise,="" reject="" deferred.rejectwith(="" animation.opts.specialeasing="" result="Animation.prefilters[" animation.opts="" isfunction(="" result.stop="" jquery._queuehooks(="" animation.elem,="" animation.opts.queue="" ).stop="result.stop.bind(" result;="" jquery.map(="" createtween,="" animation.opts.start="" animation.opts.start.call(="" attach="" callbacks="" .progress(="" animation.opts.progress="" .done(="" animation.opts.done,="" animation.opts.complete="" .fail(="" animation.opts.fail="" .always(="" animation.opts.always="" jquery.fx.timer(="" tick,="" anim:="" queue:="" animation;="" jquery.animation="jQuery.extend(" tweeners:="" "*":="" adjustcss(="" tween.elem,="" rcssnum.exec(="" tweener:="" callback="" rnothtmlwhite="" [];="" ].unshift(="" prefilters:="" defaultprefilter="" prefilter:="" callback,="" prepend="" animation.prefilters.unshift(="" animation.prefilters.push(="" jquery.speed="function(" speed,="" fn="" opt="speed" typeof="" speed="==" "object"="" complete:="" !fn="" !isfunction(="" go="" state="" off="" jquery.fx.off="" opt.duration="0;" "number"="" jquery.fx.speeds="" normalize="" opt.queue=""> "fx"3017 if ( opt.queue == null || opt.queue === true ) {3018 opt.queue = "fx";3019 }3020 // Queueing3021 opt.old = opt.complete;3022 opt.complete = function() {3023 if ( isFunction( opt.old ) ) {3024 opt.old.call( this );3025 }3026 if ( opt.queue ) {3027 jQuery.dequeue( this, opt.queue );3028 }3029 };3030 return opt;3031};3032jQuery.fn.extend( {3033 fadeTo: function( speed, to, easing, callback ) {3034 // Show any hidden elements after setting opacity to 03035 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()3036 // Animate to the value specified3037 .end().animate( { opacity: to }, speed, easing, callback );3038 },3039 animate: function( prop, speed, easing, callback ) {3040 var empty = jQuery.isEmptyObject( prop ),3041 optall = jQuery.speed( speed, easing, callback ),3042 doAnimation = function() {3043 // Operate on a copy of prop so per-property easing won't be lost3044 var anim = Animation( this, jQuery.extend( {}, prop ), optall );3045 // Empty animations, or finishing resolves immediately3046 if ( empty || dataPriv.get( this, "finish" ) ) {3047 anim.stop( true );3048 }3049 };3050 doAnimation.finish = doAnimation;3051 return empty || optall.queue === false ?3052 this.each( doAnimation ) :3053 this.queue( optall.queue, doAnimation );3054 },3055 stop: function( type, clearQueue, gotoEnd ) {3056 var stopQueue = function( hooks ) {3057 var stop = hooks.stop;3058 delete hooks.stop;3059 stop( gotoEnd );3060 };3061 if ( typeof type !== "string" ) {3062 gotoEnd = clearQueue;3063 clearQueue = type;3064 type = undefined;3065 }3066 if ( clearQueue && type !== false ) {3067 this.queue( type || "fx", [] );3068 }3069 return this.each( function() {3070 var dequeue = true,3071 index = type != null && type + "queueHooks",3072 timers = jQuery.timers,3073 data = dataPriv.get( this );3074 if ( index ) {3075 if ( data[ index ] && data[ index ].stop ) {3076 stopQueue( data[ index ] );3077 }3078 } else {3079 for ( index in data ) {3080 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {3081 stopQueue( data[ index ] );3082 }3083 }3084 }3085 for ( index = timers.length; index--; ) {3086 if ( timers[ index ].elem === this &&3087 ( type == null || timers[ index ].queue === type ) ) {3088 timers[ index ].anim.stop( gotoEnd );3089 dequeue = false;3090 timers.splice( index, 1 );3091 }3092 }3093 // Start the next in the queue if the last step wasn't forced.3094 // Timers currently will call their complete callbacks, which3095 // will dequeue but only if they were gotoEnd.3096 if ( dequeue || !gotoEnd ) {3097 jQuery.dequeue( this, type );3098 }3099 } );3100 },3101 finish: function( type ) {3102 if ( type !== false ) {3103 type = type || "fx";3104 }3105 return this.each( function() {3106 var index,3107 data = dataPriv.get( this ),3108 queue = data[ type + "queue" ],3109 hooks = data[ type + "queueHooks" ],3110 timers = jQuery.timers,3111 length = queue ? queue.length : 0;3112 // Enable finishing flag on private data3113 data.finish = true;3114 // Empty the queue first3115 jQuery.queue( this, type, [] );3116 if ( hooks && hooks.stop ) {3117 hooks.stop.call( this, true );3118 }3119 // Look for any active animations, and finish them3120 for ( index = timers.length; index--; ) {3121 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {3122 timers[ index ].anim.stop( true );3123 timers.splice( index, 1 );3124 }3125 }3126 // Look for any animations in the old queue and finish them3127 for ( index = 0; index < length; index++ ) {3128 if ( queue[ index ] && queue[ index ].finish ) {3129 queue[ index ].finish.call( this );3130 }3131 }3132 // Turn off finishing flag3133 delete data.finish;3134 } );3135 }3136} );3137jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {3138 var cssFn = jQuery.fn[ name ];3139 jQuery.fn[ name ] = function( speed, easing, callback ) {3140 return speed == null || typeof speed === "boolean" ?3141 cssFn.apply( this, arguments ) :3142 this.animate( genFx( name, true ), speed, easing, callback );3143 };3144} );3145// Generate shortcuts for custom animations3146jQuery.each( {3147 slideDown: genFx( "show" ),3148 slideUp: genFx( "hide" ),3149 slideToggle: genFx( "toggle" ),3150 fadeIn: { opacity: "show" },3151 fadeOut: { opacity: "hide" },3152 fadeToggle: { opacity: "toggle" }3153}, function( name, props ) {3154 jQuery.fn[ name ] = function( speed, easing, callback ) {3155 return this.animate( props, speed, easing, callback );3156 };3157} );3158jQuery.timers = [];3159jQuery.fx.tick = function() {3160 var timer,3161 i = 0,3162 timers = jQuery.timers;3163 fxNow = Date.now();3164 for ( ; i < timers.length; i++ ) {3165 timer = timers[ i ];3166 // Run the timer and safely remove it when done (allowing for external removal)3167 if ( !timer() && timers[ i ] === timer ) {3168 timers.splice( i--, 1 );3169 }3170 }3171 if ( !timers.length ) {3172 jQuery.fx.stop();3173 }3174 fxNow = undefined;3175};3176jQuery.fx.timer = function( timer ) {3177 jQuery.timers.push( timer );3178 jQuery.fx.start();3179};3180jQuery.fx.interval = 13;3181jQuery.fx.start = function() {3182 if ( inProgress ) {3183 return;3184 }3185 inProgress = true;3186 schedule();3187};3188jQuery.fx.stop = function() {3189 inProgress = null;3190};3191jQuery.fx.speeds = {3192 slow: 600,3193 fast: 200,3194 // Default speed3195 _default: 4003196};3197// Based off of the plugin by Clint Helfers, with permission.3198// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/3199jQuery.fn.delay = function( time, type ) {3200 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;3201 type = type || "fx";3202 return this.queue( type, function( next, hooks ) {3203 var timeout = window.setTimeout( next, time );3204 hooks.stop = function() {3205 window.clearTimeout( timeout );3206 };3207 } );3208};3209( function() {3210 var input = document.createElement( "input" ),3211 select = document.createElement( "select" ),3212 opt = select.appendChild( document.createElement( "option" ) );3213 input.type = "checkbox";3214 // Support: Android <=4.3 only="" default value="" for="" a="" checkbox="" should="" be="" "on"="" support.checkon="input.value" !="=" "";="" support:="" ie="" <="11" must="" access="" selectedindex="" to="" make="" options="" select="" support.optselected="opt.selected;" an="" input="" loses="" its="" after="" becoming="" radio="" "input"="" );="" input.value="t" ;="" input.type="radio" support.radiovalue="input.value" =="=" "t";="" }="" )();="" var="" boolhook,="" attrhandle="jQuery.expr.attrHandle;" jquery.fn.extend(="" {="" attr:="" function(="" name,="" )="" return="" access(="" this,="" jquery.attr,="" value,="" arguments.length=""> 1 );3215 },3216 removeAttr: function( name ) {3217 return this.each( function() {3218 jQuery.removeAttr( this, name );3219 } );3220 }3221} );3222jQuery.extend( {3223 attr: function( elem, name, value ) {3224 var ret, hooks,3225 nType = elem.nodeType;3226 // Don't get/set attributes on text, comment and attribute nodes3227 if ( nType === 3 || nType === 8 || nType === 2 ) {3228 return;3229 }3230 // Fallback to prop when attributes are not supported3231 if ( typeof elem.getAttribute === "undefined" ) {3232 return jQuery.prop( elem, name, value );3233 }3234 // Attribute hooks are determined by the lowercase version3235 // Grab necessary hook if one is defined3236 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {3237 hooks = jQuery.attrHooks[ name.toLowerCase() ] ||3238 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );3239 }3240 if ( value !== undefined ) {3241 if ( value === null ) {3242 jQuery.removeAttr( elem, name );3243 return;3244 }3245 if ( hooks && "set" in hooks &&3246 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {3247 return ret;3248 }3249 elem.setAttribute( name, value + "" );3250 return value;3251 }3252 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {3253 return ret;3254 }3255 ret = jQuery.find.attr( elem, name );3256 // Non-existent attributes return null, we normalize to undefined3257 return ret == null ? undefined : ret;3258 },3259 attrHooks: {3260 type: {3261 set: function( elem, value ) {3262 if ( !support.radioValue && value === "radio" &&3263 nodeName( elem, "input" ) ) {3264 var val = elem.value;3265 elem.setAttribute( "type", value );3266 if ( val ) {3267 elem.value = val;3268 }3269 return value;3270 }3271 }3272 }3273 },3274 removeAttr: function( elem, value ) {3275 var name,3276 i = 0,3277 // Attribute names can contain non-HTML whitespace characters3278 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-23279 attrNames = value && value.match( rnothtmlwhite );3280 if ( attrNames && elem.nodeType === 1 ) {3281 while ( ( name = attrNames[ i++ ] ) ) {3282 elem.removeAttribute( name );3283 }3284 }3285 }3286} );3287// Hooks for boolean attributes3288boolHook = {3289 set: function( elem, value, name ) {3290 if ( value === false ) {3291 // Remove boolean attributes when set to false3292 jQuery.removeAttr( elem, name );3293 } else {3294 elem.setAttribute( name, name );3295 }3296 return name;3297 }3298};3299jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {3300 var getter = attrHandle[ name ] || jQuery.find.attr;3301 attrHandle[ name ] = function( elem, name, isXML ) {3302 var ret, handle,3303 lowercaseName = name.toLowerCase();3304 if ( !isXML ) {3305 // Avoid an infinite loop by temporarily removing this function from the getter3306 handle = attrHandle[ lowercaseName ];3307 attrHandle[ lowercaseName ] = ret;3308 ret = getter( elem, name, isXML ) != null ?3309 lowercaseName :3310 null;3311 attrHandle[ lowercaseName ] = handle;3312 }3313 return ret;3314 };3315} );3316var rfocusable = /^(?:input|select|textarea|button)$/i,3317 rclickable = /^(?:a|area)$/i;3318jQuery.fn.extend( {3319 prop: function( name, value ) {3320 return access( this, jQuery.prop, name, value, arguments.length > 1 );3321 },3322 removeProp: function( name ) {3323 return this.each( function() {3324 delete this[ jQuery.propFix[ name ] || name ];3325 } );3326 }3327} );3328jQuery.extend( {3329 prop: function( elem, name, value ) {3330 var ret, hooks,3331 nType = elem.nodeType;3332 // Don't get/set properties on text, comment and attribute nodes3333 if ( nType === 3 || nType === 8 || nType === 2 ) {3334 return;3335 }3336 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {3337 // Fix name and attach hooks3338 name = jQuery.propFix[ name ] || name;3339 hooks = jQuery.propHooks[ name ];3340 }3341 if ( value !== undefined ) {3342 if ( hooks && "set" in hooks &&3343 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {3344 return ret;3345 }3346 return ( elem[ name ] = value );3347 }3348 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {3349 return ret;3350 }3351 return elem[ name ];3352 },3353 propHooks: {3354 tabIndex: {3355 get: function( elem ) {3356 // Support: IE <=9 0="" 1="" 10="" 11="" 2008="" -="" only="" elem.tabindex="" doesn't="" always="" return="" the="" correct="" value="" when="" it="" hasn't="" been="" explicitly="" set="" https:="" web.archive.org="" web="" 20141116233347="" http:="" fluidproject.org="" blog="" 01="" 09="" getting-setting-and-removing-tabindex-values-with-javascript="" use="" proper="" attribute="" retrieval(#12072)="" var="" tabindex="jQuery.find.attr(" elem,="" "tabindex"="" );="" if="" (="" )="" {="" parseint(="" tabindex,="" }="" rfocusable.test(="" elem.nodename="" ||="" rclickable.test(="" &&="" elem.href="" 0;="" -1;="" },="" propfix:="" "for":="" "htmlfor",="" "class":="" "classname"="" support:="" ie="" <="11" accessing="" selectedindex="" property="" forces="" browser="" to="" respect="" setting="" selected on="" option="" getter="" ensures="" a="" default is="" in="" an="" optgroup="" eslint="" rule="" "no-unused-expressions"="" disabled for="" this="" code="" since="" considers="" such="" accessions="" noop="" !support.optselected="" jquery.prophooks.selected="{" get:="" function(="" elem="" *="" no-unused-expressions:="" "off"="" parent="elem.parentNode;" parent.parentnode="" parent.parentnode.selectedindex;="" null;="" set:="" parent.selectedindex;="" };="" jquery.each(="" [="" "tabindex",="" "readonly",="" "maxlength",="" "cellspacing",="" "cellpadding",="" "rowspan",="" "colspan",="" "usemap",="" "frameborder",="" "contenteditable"="" ],="" function()="" jquery.propfix[="" this.tolowercase()="" ]="this;" strip="" and="" collapse="" whitespace="" according="" html="" spec="" infra.spec.whatwg.org="" #strip-and-collapse-ascii-whitespace="" function="" stripandcollapse(="" tokens="value.match(" rnothtmlwhite="" [];="" tokens.join(="" "="" getclass(="" elem.getattribute="" elem.getattribute(="" "class"="" "";="" classestoarray(="" array.isarray(="" value;="" typeof="" "string"="" value.match(="" jquery.fn.extend(="" addclass:="" classes,="" cur,="" curvalue,="" clazz,="" j,="" finalvalue,="" i="0;" isfunction(="" this.each(="" j="" jquery(="" ).addclass(="" value.call(="" this,="" classes="classesToArray(" classes.length="" while="" i++="" curvalue="getClass(" cur="elem.nodeType" =="=" +="" clazz="classes[" j++="" cur.indexof(="" ";="" assign="" different="" avoid="" unneeded="" rendering.="" finalvalue="stripAndCollapse(" !="=" elem.setattribute(="" "class",="" this;="" removeclass:="" ).removeclass(="" !arguments.length="" this.attr(="" ""="" expression="" here="" better="" compressibility="" (see="" addclass)="" remove="" *all*="" instances=""> -1 ) {3357 cur = cur.replace( " " + clazz + " ", " " );3358 }3359 }3360 // Only assign if different to avoid unneeded rendering.3361 finalValue = stripAndCollapse( cur );3362 if ( curValue !== finalValue ) {3363 elem.setAttribute( "class", finalValue );3364 }3365 }3366 }3367 }3368 return this;3369 },3370 toggleClass: function( value, stateVal ) {3371 var type = typeof value,3372 isValidValue = type === "string" || Array.isArray( value );3373 if ( typeof stateVal === "boolean" && isValidValue ) {3374 return stateVal ? this.addClass( value ) : this.removeClass( value );3375 }3376 if ( isFunction( value ) ) {3377 return this.each( function( i ) {3378 jQuery( this ).toggleClass(3379 value.call( this, i, getClass( this ), stateVal ),3380 stateVal3381 );3382 } );3383 }3384 return this.each( function() {3385 var className, i, self, classNames;3386 if ( isValidValue ) {3387 // Toggle individual class names3388 i = 0;3389 self = jQuery( this );3390 classNames = classesToArray( value );3391 while ( ( className = classNames[ i++ ] ) ) {3392 // Check each className given, space separated list3393 if ( self.hasClass( className ) ) {3394 self.removeClass( className );3395 } else {3396 self.addClass( className );3397 }3398 }3399 // Toggle whole class name3400 } else if ( value === undefined || type === "boolean" ) {3401 className = getClass( this );3402 if ( className ) {3403 // Store className if set3404 dataPriv.set( this, "__className__", className );3405 }3406 // If the element has a class name or if we're passed `false`,3407 // then remove the whole classname (if there was one, the above saved it).3408 // Otherwise bring back whatever was previously saved (if anything),3409 // falling back to the empty string if nothing was stored.3410 if ( this.setAttribute ) {3411 this.setAttribute( "class",3412 className || value === false ?3413 "" :3414 dataPriv.get( this, "__className__" ) || ""3415 );3416 }3417 }3418 } );3419 },3420 hasClass: function( selector ) {3421 var className, elem,3422 i = 0;3423 className = " " + selector + " ";3424 while ( ( elem = this[ i++ ] ) ) {3425 if ( elem.nodeType === 1 &&3426 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {3427 return true;3428 }3429 }3430 return false;3431 }3432} );3433var rreturn = /\r/g;3434jQuery.fn.extend( {3435 val: function( value ) {3436 var hooks, ret, valueIsFunction,3437 elem = this[ 0 ];3438 if ( !arguments.length ) {3439 if ( elem ) {3440 hooks = jQuery.valHooks[ elem.type ] ||3441 jQuery.valHooks[ elem.nodeName.toLowerCase() ];3442 if ( hooks &&3443 "get" in hooks &&3444 ( ret = hooks.get( elem, "value" ) ) !== undefined3445 ) {3446 return ret;3447 }3448 ret = elem.value;3449 // Handle most common string cases3450 if ( typeof ret === "string" ) {3451 return ret.replace( rreturn, "" );3452 }3453 // Handle cases where value is null/undef or number3454 return ret == null ? "" : ret;3455 }...
jquery.js
Source:jquery.js
1/*!2 * jquery javascript library v1.5.13 * http://jquery.com/4 *5 * copyright 2011, john resig6 * dual licensed under the mit or gpl version 2 licenses.7 * http://jquery.org/license8 *9 * includes sizzle.js10 * http://sizzlejs.com/11 * copyright 2011, the dojo foundation12 * released under the mit, bsd, and gpl licenses.13 *14 * date: wed feb 23 13:55:29 2011 -050015 */16(function( window, undefined ) {17// use the correct document accordingly with window argument (sandbox)18var document = window.document;19var jquery = (function() {20// define a local copy of jquery21var jquery = function( selector, context ) {22 // the jquery object is actually just the init constructor 'enhanced'23 return new jquery.fn.init( selector, context, rootjquery );24 },25 // map over jquery in case of overwrite26 _jquery = window.jquery,27 // map over the $ in case of overwrite28 _$ = window.$,29 // a central reference to the root jquery(document)30 rootjquery,31 // a simple way to check for html strings or id strings32 // (both of which we optimize for)33 quickexpr = /^(?:[^<]*(<[\w\w]+>)[^>]*$|#([\w\-]+)$)/,34 // check if a string has a non-whitespace character in it35 rnotwhite = /\s/,36 // used for trimming whitespace37 trimleft = /^\s+/,38 trimright = /\s+$/,39 // check for digits40 rdigit = /\d/,41 // match a standalone tag42 rsingletag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,43 // json regexp44 rvalidchars = /^[\],:{}\s]*$/,45 rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fa-f]{4})/g,46 rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[ee][+\-]?\d+)?/g,47 rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,48 // useragent regexp49 rwebkit = /(webkit)[ \/]([\w.]+)/,50 ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,51 rmsie = /(msie) ([\w.]+)/,52 rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,53 // keep a useragent string for use with jquery.browser54 useragent = navigator.useragent,55 // for matching the engine and version of the browser56 browsermatch,57 // has the ready events already been bound?58 readybound = false,59 // the deferred used on dom ready60 readylist,61 // promise methods62 promisemethods = "then done fail isresolved isrejected promise".split( " " ),63 // the ready event handler64 domcontentloaded,65 // save a reference to some core methods66 tostring = object.prototype.tostring,67 hasown = object.prototype.hasownproperty,68 push = array.prototype.push,69 slice = array.prototype.slice,70 trim = string.prototype.trim,71 indexof = array.prototype.indexof,72 // [[class]] -> type pairs73 class2type = {};74jquery.fn = jquery.prototype = {75 constructor: jquery,76 init: function( selector, context, rootjquery ) {77 var match, elem, ret, doc;78 // handle $(""), $(null), or $(undefined)79 if ( !selector ) {80 return this;81 }82 // handle $(domelement)83 if ( selector.nodetype ) {84 this.context = this[0] = selector;85 this.length = 1;86 return this;87 }88 // the body element only exists once, optimize finding it89 if ( selector === "body" && !context && document.body ) {90 this.context = document;91 this[0] = document.body;92 this.selector = "body";93 this.length = 1;94 return this;95 }96 // handle html strings97 if ( typeof selector === "string" ) {98 // are we dealing with html string or an id?99 match = quickexpr.exec( selector );100 // verify a match, and that no context was specified for #id101 if ( match && (match[1] || !context) ) {102 // handle: $(html) -> $(array)103 if ( match[1] ) {104 context = context instanceof jquery ? context[0] : context;105 doc = (context ? context.ownerdocument || context : document);106 // if a single string is passed in and it's a single tag107 // just do a createelement and skip the rest108 ret = rsingletag.exec( selector );109 if ( ret ) {110 if ( jquery.isplainobject( context ) ) {111 selector = [ document.createelement( ret[1] ) ];112 jquery.fn.attr.call( selector, context, true );113 } else {114 selector = [ doc.createelement( ret[1] ) ];115 }116 } else {117 ret = jquery.buildfragment( [ match[1] ], [ doc ] );118 selector = (ret.cacheable ? jquery.clone(ret.fragment) : ret.fragment).childnodes;119 }120 return jquery.merge( this, selector );121 // handle: $("#id")122 } else {123 elem = document.getelementbyid( match[2] );124 // check parentnode to catch when blackberry 4.6 returns125 // nodes that are no longer in the document #6963126 if ( elem && elem.parentnode ) {127 // handle the case where ie and opera return items128 // by name instead of id129 if ( elem.id !== match[2] ) {130 return rootjquery.find( selector );131 }132 // otherwise, we inject the element directly into the jquery object133 this.length = 1;134 this[0] = elem;135 }136 this.context = document;137 this.selector = selector;138 return this;139 }140 // handle: $(expr, $(...))141 } else if ( !context || context.jquery ) {142 return (context || rootjquery).find( selector );143 // handle: $(expr, context)144 // (which is just equivalent to: $(context).find(expr)145 } else {146 return this.constructor( context ).find( selector );147 }148 // handle: $(function)149 // shortcut for document ready150 } else if ( jquery.isfunction( selector ) ) {151 return rootjquery.ready( selector );152 }153 if (selector.selector !== undefined) {154 this.selector = selector.selector;155 this.context = selector.context;156 }157 return jquery.makearray( selector, this );158 },159 // start with an empty selector160 selector: "",161 // the current version of jquery being used162 jquery: "1.5.1",163 // the default length of a jquery object is 0164 length: 0,165 // the number of elements contained in the matched element set166 size: function() {167 return this.length;168 },169 toarray: function() {170 return slice.call( this, 0 );171 },172 // get the nth element in the matched element set or173 // get the whole matched element set as a clean array174 get: function( num ) {175 return num == null ?176 // return a 'clean' array177 this.toarray() :178 // return just the object179 ( num < 0 ? this[ this.length + num ] : this[ num ] );180 },181 // take an array of elements and push it onto the stack182 // (returning the new matched element set)183 pushstack: function( elems, name, selector ) {184 // build a new jquery matched element set185 var ret = this.constructor();186 if ( jquery.isarray( elems ) ) {187 push.apply( ret, elems );188 } else {189 jquery.merge( ret, elems );190 }191 // add the old object onto the stack (as a reference)192 ret.prevobject = this;193 ret.context = this.context;194 if ( name === "find" ) {195 ret.selector = this.selector + (this.selector ? " " : "") + selector;196 } else if ( name ) {197 ret.selector = this.selector + "." + name + "(" + selector + ")";198 }199 // return the newly-formed element set200 return ret;201 },202 // execute a callback for every element in the matched set.203 // (you can seed the arguments with an array of args, but this is204 // only used internally.)205 each: function( callback, args ) {206 return jquery.each( this, callback, args );207 },208 ready: function( fn ) {209 // attach the listeners210 jquery.bindready();211 // add the callback212 readylist.done( fn );213 return this;214 },215 eq: function( i ) {216 return i === -1 ?217 this.slice( i ) :218 this.slice( i, +i + 1 );219 },220 first: function() {221 return this.eq( 0 );222 },223 last: function() {224 return this.eq( -1 );225 },226 slice: function() {227 return this.pushstack( slice.apply( this, arguments ),228 "slice", slice.call(arguments).join(",") );229 },230 map: function( callback ) {231 return this.pushstack( jquery.map(this, function( elem, i ) {232 return callback.call( elem, i, elem );233 }));234 },235 end: function() {236 return this.prevobject || this.constructor(null);237 },238 // for internal use only.239 // behaves like an array's method, not like a jquery method.240 push: push,241 sort: [].sort,242 splice: [].splice243};244// give the init function the jquery prototype for later instantiation245jquery.fn.init.prototype = jquery.fn;246jquery.extend = jquery.fn.extend = function() {247 var options, name, src, copy, copyisarray, clone,248 target = arguments[0] || {},249 i = 1,250 length = arguments.length,251 deep = false;252 // handle a deep copy situation253 if ( typeof target === "boolean" ) {254 deep = target;255 target = arguments[1] || {};256 // skip the boolean and the target257 i = 2;258 }259 // handle case when target is a string or something (possible in deep copy)260 if ( typeof target !== "object" && !jquery.isfunction(target) ) {261 target = {};262 }263 // extend jquery itself if only one argument is passed264 if ( length === i ) {265 target = this;266 --i;267 }268 for ( ; i < length; i++ ) {269 // only deal with non-null/undefined values270 if ( (options = arguments[ i ]) != null ) {271 // extend the base object272 for ( name in options ) {273 src = target[ name ];274 copy = options[ name ];275 // prevent never-ending loop276 if ( target === copy ) {277 continue;278 }279 // recurse if we're merging plain objects or arrays280 if ( deep && copy && ( jquery.isplainobject(copy) || (copyisarray = jquery.isarray(copy)) ) ) {281 if ( copyisarray ) {282 copyisarray = false;283 clone = src && jquery.isarray(src) ? src : [];284 } else {285 clone = src && jquery.isplainobject(src) ? src : {};286 }287 // never move original objects, clone them288 target[ name ] = jquery.extend( deep, clone, copy );289 // don't bring in undefined values290 } else if ( copy !== undefined ) {291 target[ name ] = copy;292 }293 }294 }295 }296 // return the modified object297 return target;298};299jquery.extend({300 noconflict: function( deep ) {301 window.$ = _$;302 if ( deep ) {303 window.jquery = _jquery;304 }305 return jquery;306 },307 // is the dom ready to be used? set to true once it occurs.308 isready: false,309 // a counter to track how many items to wait for before310 // the ready event fires. see #6781311 readywait: 1,312 // handle when the dom is ready313 ready: function( wait ) {314 // a third-party is pushing the ready event forwards315 if ( wait === true ) {316 jquery.readywait--;317 }318 // make sure that the dom is not already loaded319 if ( !jquery.readywait || (wait !== true && !jquery.isready) ) {320 // make sure body exists, at least, in case ie gets a little overzealous (ticket #5443).321 if ( !document.body ) {322 return settimeout( jquery.ready, 1 );323 }324 // remember that the dom is ready325 jquery.isready = true;326 // if a normal dom ready event fired, decrement, and wait if need be327 if ( wait !== true && --jquery.readywait > 0 ) {328 return;329 }330 // if there are functions bound, to execute331 readylist.resolvewith( document, [ jquery ] );332 // trigger any bound ready events333 if ( jquery.fn.trigger ) {334 jquery( document ).trigger( "ready" ).unbind( "ready" );335 }336 }337 },338 bindready: function() {339 if ( readybound ) {340 return;341 }342 readybound = true;343 // catch cases where $(document).ready() is called after the344 // browser event has already occurred.345 if ( document.readystate === "complete" ) {346 // handle it asynchronously to allow scripts the opportunity to delay ready347 return settimeout( jquery.ready, 1 );348 }349 // mozilla, opera and webkit nightlies currently support this event350 if ( document.addeventlistener ) {351 // use the handy event callback352 document.addeventlistener( "domcontentloaded", domcontentloaded, false );353 // a fallback to window.onload, that will always work354 window.addeventlistener( "load", jquery.ready, false );355 // if ie event model is used356 } else if ( document.attachevent ) {357 // ensure firing before onload,358 // maybe late but safe also for iframes359 document.attachevent("onreadystatechange", domcontentloaded);360 // a fallback to window.onload, that will always work361 window.attachevent( "onload", jquery.ready );362 // if ie and not a frame363 // continually check to see if the document is ready364 var toplevel = false;365 try {366 toplevel = window.frameelement == null;367 } catch(e) {}368 if ( document.documentelement.doscroll && toplevel ) {369 doscrollcheck();370 }371 }372 },373 // see test/unit/core.js for details concerning isfunction.374 // since version 1.3, dom methods and functions like alert375 // aren't supported. they return false on ie (#2968).376 isfunction: function( obj ) {377 return jquery.type(obj) === "function";378 },379 isarray: array.isarray || function( obj ) {380 return jquery.type(obj) === "array";381 },382 // a crude way of determining if an object is a window383 iswindow: function( obj ) {384 return obj && typeof obj === "object" && "setinterval" in obj;385 },386 isnan: function( obj ) {387 return obj == null || !rdigit.test( obj ) || isnan( obj );388 },389 type: function( obj ) {390 return obj == null ?391 string( obj ) :392 class2type[ tostring.call(obj) ] || "object";393 },394 isplainobject: function( obj ) {395 // must be an object.396 // because of ie, we also have to check the presence of the constructor property.397 // make sure that dom nodes and window objects don't pass through, as well398 if ( !obj || jquery.type(obj) !== "object" || obj.nodetype || jquery.iswindow( obj ) ) {399 return false;400 }401 // not own constructor property must be object402 if ( obj.constructor &&403 !hasown.call(obj, "constructor") &&404 !hasown.call(obj.constructor.prototype, "isprototypeof") ) {405 return false;406 }407 // own properties are enumerated firstly, so to speed up,408 // if last one is own, then all properties are own.409 var key;410 for ( key in obj ) {}411 return key === undefined || hasown.call( obj, key );412 },413 isemptyobject: function( obj ) {414 for ( var name in obj ) {415 return false;416 }417 return true;418 },419 error: function( msg ) {420 throw msg;421 },422 parsejson: function( data ) {423 if ( typeof data !== "string" || !data ) {424 return null;425 }426 // make sure leading/trailing whitespace is removed (ie can't handle it)427 data = jquery.trim( data );428 // make sure the incoming data is actual json429 // logic borrowed from http://json.org/json2.js430 if ( rvalidchars.test(data.replace(rvalidescape, "@")431 .replace(rvalidtokens, "]")432 .replace(rvalidbraces, "")) ) {433 // try to use the native json parser first434 return window.json && window.json.parse ?435 window.json.parse( data ) :436 (new function("return " + data))();437 } else {438 jquery.error( "invalid json: " + data );439 }440 },441 // cross-browser xml parsing442 // (xml & tmp used internally)443 parsexml: function( data , xml , tmp ) {444 if ( window.domparser ) { // standard445 tmp = new domparser();446 xml = tmp.parsefromstring( data , "text/xml" );447 } else { // ie448 xml = new activexobject( "microsoft.xmldom" );449 xml.async = "false";450 xml.loadxml( data );451 }452 tmp = xml.documentelement;453 if ( ! tmp || ! tmp.nodename || tmp.nodename === "parsererror" ) {454 jquery.error( "invalid xml: " + data );455 }456 return xml;457 },458 noop: function() {},459 // evalulates a script in a global context460 globaleval: function( data ) {461 if ( data && rnotwhite.test(data) ) {462 // inspired by code by andrea giammarchi463 // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html464 var head = document.head || document.getelementsbytagname( "head" )[0] || document.documentelement,465 script = document.createelement( "script" );466 if ( jquery.support.scripteval() ) {467 script.appendchild( document.createtextnode( data ) );468 } else {469 script.text = data;470 }471 // use insertbefore instead of appendchild to circumvent an ie6 bug.472 // this arises when a base node is used (#2709).473 head.insertbefore( script, head.firstchild );474 head.removechild( script );475 }476 },477 nodename: function( elem, name ) {478 return elem.nodename && elem.nodename.touppercase() === name.touppercase();479 },480 // args is for internal usage only481 each: function( object, callback, args ) {482 var name, i = 0,483 length = object.length,484 isobj = length === undefined || jquery.isfunction(object);485 if ( args ) {486 if ( isobj ) {487 for ( name in object ) {488 if ( callback.apply( object[ name ], args ) === false ) {489 break;490 }491 }492 } else {493 for ( ; i < length; ) {494 if ( callback.apply( object[ i++ ], args ) === false ) {495 break;496 }497 }498 }499 // a special, fast, case for the most common use of each500 } else {501 if ( isobj ) {502 for ( name in object ) {503 if ( callback.call( object[ name ], name, object[ name ] ) === false ) {504 break;505 }506 }507 } else {508 for ( var value = object[0];509 i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}510 }511 }512 return object;513 },514 // use native string.trim function wherever possible515 trim: trim ?516 function( text ) {517 return text == null ?518 "" :519 trim.call( text );520 } :521 // otherwise use our own trimming functionality522 function( text ) {523 return text == null ?524 "" :525 text.tostring().replace( trimleft, "" ).replace( trimright, "" );526 },527 // results is for internal usage only528 makearray: function( array, results ) {529 var ret = results || [];530 if ( array != null ) {531 // the window, strings (and functions) also have 'length'532 // the extra typeof function check is to prevent crashes533 // in safari 2 (see: #3039)534 // tweaked logic slightly to handle blackberry 4.7 regexp issues #6930535 var type = jquery.type(array);536 if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jquery.iswindow( array ) ) {537 push.call( ret, array );538 } else {539 jquery.merge( ret, array );540 }541 }542 return ret;543 },544 inarray: function( elem, array ) {545 if ( array.indexof ) {546 return array.indexof( elem );547 }548 for ( var i = 0, length = array.length; i < length; i++ ) {549 if ( array[ i ] === elem ) {550 return i;551 }552 }553 return -1;554 },555 merge: function( first, second ) {556 var i = first.length,557 j = 0;558 if ( typeof second.length === "number" ) {559 for ( var l = second.length; j < l; j++ ) {560 first[ i++ ] = second[ j ];561 }562 } else {563 while ( second[j] !== undefined ) {564 first[ i++ ] = second[ j++ ];565 }566 }567 first.length = i;568 return first;569 },570 grep: function( elems, callback, inv ) {571 var ret = [], retval;572 inv = !!inv;573 // go through the array, only saving the items574 // that pass the validator function575 for ( var i = 0, length = elems.length; i < length; i++ ) {576 retval = !!callback( elems[ i ], i );577 if ( inv !== retval ) {578 ret.push( elems[ i ] );579 }580 }581 return ret;582 },583 // arg is for internal usage only584 map: function( elems, callback, arg ) {585 var ret = [], value;586 // go through the array, translating each of the items to their587 // new value (or values).588 for ( var i = 0, length = elems.length; i < length; i++ ) {589 value = callback( elems[ i ], i, arg );590 if ( value != null ) {591 ret[ ret.length ] = value;592 }593 }594 // flatten any nested arrays595 return ret.concat.apply( [], ret );596 },597 // a global guid counter for objects598 guid: 1,599 proxy: function( fn, proxy, thisobject ) {600 if ( arguments.length === 2 ) {601 if ( typeof proxy === "string" ) {602 thisobject = fn;603 fn = thisobject[ proxy ];604 proxy = undefined;605 } else if ( proxy && !jquery.isfunction( proxy ) ) {606 thisobject = proxy;607 proxy = undefined;608 }609 }610 if ( !proxy && fn ) {611 proxy = function() {612 return fn.apply( thisobject || this, arguments );613 };614 }615 // set the guid of unique handler to the same of original handler, so it can be removed616 if ( fn ) {617 proxy.guid = fn.guid = fn.guid || proxy.guid || jquery.guid++;618 }619 // so proxy can be declared as an argument620 return proxy;621 },622 // mutifunctional method to get and set values to a collection623 // the value/s can be optionally by executed if its a function624 access: function( elems, key, value, exec, fn, pass ) {625 var length = elems.length;626 // setting many attributes627 if ( typeof key === "object" ) {628 for ( var k in key ) {629 jquery.access( elems, k, key[k], exec, fn, value );630 }631 return elems;632 }633 // setting one attribute634 if ( value !== undefined ) {635 // optionally, function values get executed if exec is true636 exec = !pass && exec && jquery.isfunction(value);637 for ( var i = 0; i < length; i++ ) {638 fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );639 }640 return elems;641 }642 // getting an attribute643 return length ? fn( elems[0], key ) : undefined;644 },645 now: function() {646 return (new date()).gettime();647 },648 // create a simple deferred (one callbacks list)649 _deferred: function() {650 var // callbacks list651 callbacks = [],652 // stored [ context , args ]653 fired,654 // to avoid firing when already doing so655 firing,656 // flag to know if the deferred has been cancelled657 cancelled,658 // the deferred itself659 deferred = {660 // done( f1, f2, ...)661 done: function() {662 if ( !cancelled ) {663 var args = arguments,664 i,665 length,666 elem,667 type,668 _fired;669 if ( fired ) {670 _fired = fired;671 fired = 0;672 }673 for ( i = 0, length = args.length; i < length; i++ ) {674 elem = args[ i ];675 type = jquery.type( elem );676 if ( type === "array" ) {677 deferred.done.apply( deferred, elem );678 } else if ( type === "function" ) {679 callbacks.push( elem );680 }681 }682 if ( _fired ) {683 deferred.resolvewith( _fired[ 0 ], _fired[ 1 ] );684 }685 }686 return this;687 },688 // resolve with given context and args689 resolvewith: function( context, args ) {690 if ( !cancelled && !fired && !firing ) {691 firing = 1;692 try {693 while( callbacks[ 0 ] ) {694 callbacks.shift().apply( context, args );695 }696 }697 // we have to add a catch block for698 // ie prior to 8 or else the finally699 // block will never get executed700 catch (e) {701 throw e;702 }703 finally {704 fired = [ context, args ];705 firing = 0;706 }707 }708 return this;709 },710 // resolve with this as context and given arguments711 resolve: function() {712 deferred.resolvewith( jquery.isfunction( this.promise ) ? this.promise() : this, arguments );713 return this;714 },715 // has this deferred been resolved?716 isresolved: function() {717 return !!( firing || fired );718 },719 // cancel720 cancel: function() {721 cancelled = 1;722 callbacks = [];723 return this;724 }725 };726 return deferred;727 },728 // full fledged deferred (two callbacks list)729 deferred: function( func ) {730 var deferred = jquery._deferred(),731 faildeferred = jquery._deferred(),732 promise;733 // add errordeferred methods, then and promise734 jquery.extend( deferred, {735 then: function( donecallbacks, failcallbacks ) {736 deferred.done( donecallbacks ).fail( failcallbacks );737 return this;738 },739 fail: faildeferred.done,740 rejectwith: faildeferred.resolvewith,741 reject: faildeferred.resolve,742 isrejected: faildeferred.isresolved,743 // get a promise for this deferred744 // if obj is provided, the promise aspect is added to the object745 promise: function( obj ) {746 if ( obj == null ) {747 if ( promise ) {748 return promise;749 }750 promise = obj = {};751 }752 var i = promisemethods.length;753 while( i-- ) {754 obj[ promisemethods[i] ] = deferred[ promisemethods[i] ];755 }756 return obj;757 }758 } );759 // make sure only one callback list will be used760 deferred.done( faildeferred.cancel ).fail( deferred.cancel );761 // unexpose cancel762 delete deferred.cancel;763 // call given func if any764 if ( func ) {765 func.call( deferred, deferred );766 }767 return deferred;768 },769 // deferred helper770 when: function( object ) {771 var lastindex = arguments.length,772 deferred = lastindex <= 1 && object && jquery.isfunction( object.promise ) ?773 object :774 jquery.deferred(),775 promise = deferred.promise();776 if ( lastindex > 1 ) {777 var array = slice.call( arguments, 0 ),778 count = lastindex,779 icallback = function( index ) {780 return function( value ) {781 array[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value;782 if ( !( --count ) ) {783 deferred.resolvewith( promise, array );784 }785 };786 };787 while( ( lastindex-- ) ) {788 object = array[ lastindex ];789 if ( object && jquery.isfunction( object.promise ) ) {790 object.promise().then( icallback(lastindex), deferred.reject );791 } else {792 --count;793 }794 }795 if ( !count ) {796 deferred.resolvewith( promise, array );797 }798 } else if ( deferred !== object ) {799 deferred.resolve( object );800 }801 return promise;802 },803 // use of jquery.browser is frowned upon.804 // more details: http://docs.jquery.com/utilities/jquery.browser805 uamatch: function( ua ) {806 ua = ua.tolowercase();807 var match = rwebkit.exec( ua ) ||808 ropera.exec( ua ) ||809 rmsie.exec( ua ) ||810 ua.indexof("compatible") < 0 && rmozilla.exec( ua ) ||811 [];812 return { browser: match[1] || "", version: match[2] || "0" };813 },814 sub: function() {815 function jquerysubclass( selector, context ) {816 return new jquerysubclass.fn.init( selector, context );817 }818 jquery.extend( true, jquerysubclass, this );819 jquerysubclass.superclass = this;820 jquerysubclass.fn = jquerysubclass.prototype = this();821 jquerysubclass.fn.constructor = jquerysubclass;822 jquerysubclass.subclass = this.subclass;823 jquerysubclass.fn.init = function init( selector, context ) {824 if ( context && context instanceof jquery && !(context instanceof jquerysubclass) ) {825 context = jquerysubclass(context);826 }827 return jquery.fn.init.call( this, selector, context, rootjquerysubclass );828 };829 jquerysubclass.fn.init.prototype = jquerysubclass.fn;830 var rootjquerysubclass = jquerysubclass(document);831 return jquerysubclass;832 },833 browser: {}834});835// create readylist deferred836readylist = jquery._deferred();837// populate the class2type map838jquery.each("boolean number string function array date regexp object".split(" "), function(i, name) {839 class2type[ "[object " + name + "]" ] = name.tolowercase();840});841browsermatch = jquery.uamatch( useragent );842if ( browsermatch.browser ) {843 jquery.browser[ browsermatch.browser ] = true;844 jquery.browser.version = browsermatch.version;845}846// deprecated, use jquery.browser.webkit instead847if ( jquery.browser.webkit ) {848 jquery.browser.safari = true;849}850if ( indexof ) {851 jquery.inarray = function( elem, array ) {852 return indexof.call( array, elem );853 };854}855// ie doesn't match non-breaking spaces with \s856if ( rnotwhite.test( "\xa0" ) ) {857 trimleft = /^[\s\xa0]+/;858 trimright = /[\s\xa0]+$/;859}860// all jquery objects should point back to these861rootjquery = jquery(document);862// cleanup functions for the document ready method863if ( document.addeventlistener ) {864 domcontentloaded = function() {865 document.removeeventlistener( "domcontentloaded", domcontentloaded, false );866 jquery.ready();867 };868} else if ( document.attachevent ) {869 domcontentloaded = function() {870 // make sure body exists, at least, in case ie gets a little overzealous (ticket #5443).871 if ( document.readystate === "complete" ) {872 document.detachevent( "onreadystatechange", domcontentloaded );873 jquery.ready();874 }875 };876}877// the dom ready check for internet explorer878function doscrollcheck() {879 if ( jquery.isready ) {880 return;881 }882 try {883 // if ie is used, use the trick by diego perini884 // http://javascript.nwbox.com/iecontentloaded/885 document.documentelement.doscroll("left");886 } catch(e) {887 settimeout( doscrollcheck, 1 );888 return;889 }890 // and execute any waiting functions891 jquery.ready();892}893// expose jquery to the global object894return jquery;895})();896(function() {897 jquery.support = {};898 var div = document.createelement("div");899 div.style.display = "none";900 div.innerhtml = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";901 var all = div.getelementsbytagname("*"),902 a = div.getelementsbytagname("a")[0],903 select = document.createelement("select"),904 opt = select.appendchild( document.createelement("option") ),905 input = div.getelementsbytagname("input")[0];906 // can't get basic test support907 if ( !all || !all.length || !a ) {908 return;909 }910 jquery.support = {911 // ie strips leading whitespace when .innerhtml is used912 leadingwhitespace: div.firstchild.nodetype === 3,913 // make sure that tbody elements aren't automatically inserted914 // ie will insert them into empty tables915 tbody: !div.getelementsbytagname("tbody").length,916 // make sure that link elements get serialized correctly by innerhtml917 // this requires a wrapper element in ie918 htmlserialize: !!div.getelementsbytagname("link").length,919 // get the style information from getattribute920 // (ie uses .csstext insted)921 style: /red/.test( a.getattribute("style") ),922 // make sure that urls aren't manipulated923 // (ie normalizes it by default)924 hrefnormalized: a.getattribute("href") === "/a",925 // make sure that element opacity exists926 // (ie uses filter instead)927 // use a regex to work around a webkit issue. see #5145928 opacity: /^0.55$/.test( a.style.opacity ),929 // verify style float existence930 // (ie uses stylefloat instead of cssfloat)931 cssfloat: !!a.style.cssfloat,932 // make sure that if no value is specified for a checkbox933 // that it defaults to "on".934 // (webkit defaults to "" instead)935 checkon: input.value === "on",936 // make sure that a selected-by-default option has a working selected property.937 // (webkit defaults to false instead of true, ie too, if it's in an optgroup)938 optselected: opt.selected,939 // will be defined later940 deleteexpando: true,941 optdisabled: false,942 checkclone: false,943 nocloneevent: true,944 noclonechecked: true,945 boxmodel: null,946 inlineblockneedslayout: false,947 shrinkwrapblocks: false,948 reliablehiddenoffsets: true949 };950 input.checked = true;951 jquery.support.noclonechecked = input.clonenode( true ).checked;952 // make sure that the options inside disabled selects aren't marked as disabled953 // (webkit marks them as diabled)954 select.disabled = true;955 jquery.support.optdisabled = !opt.disabled;956 var _scripteval = null;957 jquery.support.scripteval = function() {958 if ( _scripteval === null ) {959 var root = document.documentelement,960 script = document.createelement("script"),961 id = "script" + jquery.now();962 try {963 script.appendchild( document.createtextnode( "window." + id + "=1;" ) );964 } catch(e) {}965 root.insertbefore( script, root.firstchild );966 // make sure that the execution of code works by injecting a script967 // tag with appendchild/createtextnode968 // (ie doesn't support this, fails, and uses .text instead)969 if ( window[ id ] ) {970 _scripteval = true;971 delete window[ id ];972 } else {973 _scripteval = false;974 }975 root.removechild( script );976 // release memory in ie977 root = script = id = null;978 }979 return _scripteval;980 };981 // test to see if it's possible to delete an expando from an element982 // fails in internet explorer983 try {984 delete div.test;985 } catch(e) {986 jquery.support.deleteexpando = false;987 }988 if ( !div.addeventlistener && div.attachevent && div.fireevent ) {989 div.attachevent("onclick", function click() {990 // cloning a node shouldn't copy over any991 // bound event handlers (ie does this)992 jquery.support.nocloneevent = false;993 div.detachevent("onclick", click);994 });995 div.clonenode(true).fireevent("onclick");996 }997 div = document.createelement("div");998 div.innerhtml = "<input type='radio' name='radiotest' checked='checked'/>";999 var fragment = document.createdocumentfragment();1000 fragment.appendchild( div.firstchild );1001 // webkit doesn't clone checked state correctly in fragments1002 jquery.support.checkclone = fragment.clonenode(true).clonenode(true).lastchild.checked;1003 // figure out if the w3c box model works as expected1004 // document.body must exist before we can do this1005 jquery(function() {1006 var div = document.createelement("div"),1007 body = document.getelementsbytagname("body")[0];1008 // frameset documents with no body should not run this code1009 if ( !body ) {1010 return;1011 }1012 div.style.width = div.style.paddingleft = "1px";1013 body.appendchild( div );1014 jquery.boxmodel = jquery.support.boxmodel = div.offsetwidth === 2;1015 if ( "zoom" in div.style ) {1016 // check if natively block-level elements act like inline-block1017 // elements when setting their display to 'inline' and giving1018 // them layout1019 // (ie < 8 does this)1020 div.style.display = "inline";1021 div.style.zoom = 1;1022 jquery.support.inlineblockneedslayout = div.offsetwidth === 2;1023 // check if elements with layout shrink-wrap their children1024 // (ie 6 does this)1025 div.style.display = "";1026 div.innerhtml = "<div style='width:4px;'></div>";1027 jquery.support.shrinkwrapblocks = div.offsetwidth !== 2;1028 }1029 div.innerhtml = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";1030 var tds = div.getelementsbytagname("td");1031 // check if table cells still have offsetwidth/height when they are set1032 // to display:none and there are still other visible table cells in a1033 // table row; if so, offsetwidth/height are not reliable for use when1034 // determining if an element has been hidden directly using1035 // display:none (it is still safe to use offsets if a parent element is1036 // hidden; don safety goggles and see bug #4512 for more information).1037 // (only ie 8 fails this test)1038 jquery.support.reliablehiddenoffsets = tds[0].offsetheight === 0;1039 tds[0].style.display = "";1040 tds[1].style.display = "none";1041 // check if empty table cells still have offsetwidth/height1042 // (ie < 8 fail this test)1043 jquery.support.reliablehiddenoffsets = jquery.support.reliablehiddenoffsets && tds[0].offsetheight === 0;1044 div.innerhtml = "";1045 body.removechild( div ).style.display = "none";1046 div = tds = null;1047 });1048 // technique from juriy zaytsev1049 // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/1050 var eventsupported = function( eventname ) {1051 var el = document.createelement("div");1052 eventname = "on" + eventname;1053 // we only care about the case where non-standard event systems1054 // are used, namely in ie. short-circuiting here helps us to1055 // avoid an eval call (in setattribute) which can cause csp1056 // to go haywire. see: https://developer.mozilla.org/en/security/csp1057 if ( !el.attachevent ) {1058 return true;1059 }1060 var issupported = (eventname in el);1061 if ( !issupported ) {1062 el.setattribute(eventname, "return;");1063 issupported = typeof el[eventname] === "function";1064 }1065 el = null;1066 return issupported;1067 };1068 jquery.support.submitbubbles = eventsupported("submit");1069 jquery.support.changebubbles = eventsupported("change");1070 // release memory in ie1071 div = all = a = null;1072})();1073var rbrace = /^(?:\{.*\}|\[.*\])$/;1074jquery.extend({1075 cache: {},1076 // please use with caution1077 uuid: 0,1078 // unique for each copy of jquery on the page1079 // non-digits removed to match rinlinejquery1080 expando: "jquery" + ( jquery.fn.jquery + math.random() ).replace( /\d/g, "" ),1081 // the following elements throw uncatchable exceptions if you1082 // attempt to add expando properties to them.1083 nodata: {1084 "embed": true,1085 // ban all objects except for flash (which handle expandos)1086 "object": "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",1087 "applet": true1088 },1089 hasdata: function( elem ) {1090 elem = elem.nodetype ? jquery.cache[ elem[jquery.expando] ] : elem[ jquery.expando ];1091 return !!elem && !isemptydataobject( elem );1092 },1093 data: function( elem, name, data, pvt /* internal use only */ ) {1094 if ( !jquery.acceptdata( elem ) ) {1095 return;1096 }1097 var internalkey = jquery.expando, getbyname = typeof name === "string", thiscache,1098 // we have to handle dom nodes and js objects differently because ie6-71099 // can't gc object references properly across the dom-js boundary1100 isnode = elem.nodetype,1101 // only dom nodes need the global jquery cache; js object data is1102 // attached directly to the object so gc can occur automatically1103 cache = isnode ? jquery.cache : elem,1104 // only defining an id for js objects if its cache already exists allows1105 // the code to shortcut on the same path as a dom node with no cache1106 id = isnode ? elem[ jquery.expando ] : elem[ jquery.expando ] && jquery.expando;1107 // avoid doing any more work than we need to when trying to get data on an1108 // object that has no data at all1109 if ( (!id || (pvt && id && !cache[ id ][ internalkey ])) && getbyname && data === undefined ) {1110 return;1111 }1112 if ( !id ) {1113 // only dom nodes need a new unique id for each element since their data1114 // ends up in the global cache1115 if ( isnode ) {1116 elem[ jquery.expando ] = id = ++jquery.uuid;1117 } else {1118 id = jquery.expando;1119 }1120 }1121 if ( !cache[ id ] ) {1122 cache[ id ] = {};1123 // todo: this is a hack for 1.5 only. avoids exposing jquery1124 // metadata on plain js objects when the object is serialized using1125 // json.stringify1126 if ( !isnode ) {1127 cache[ id ].tojson = jquery.noop;1128 }1129 }1130 // an object can be passed to jquery.data instead of a key/value pair; this gets1131 // shallow copied over onto the existing cache1132 if ( typeof name === "object" || typeof name === "function" ) {1133 if ( pvt ) {1134 cache[ id ][ internalkey ] = jquery.extend(cache[ id ][ internalkey ], name);1135 } else {1136 cache[ id ] = jquery.extend(cache[ id ], name);1137 }1138 }1139 thiscache = cache[ id ];1140 // internal jquery data is stored in a separate object inside the object's data1141 // cache in order to avoid key collisions between internal data and user-defined1142 // data1143 if ( pvt ) {1144 if ( !thiscache[ internalkey ] ) {1145 thiscache[ internalkey ] = {};1146 }1147 thiscache = thiscache[ internalkey ];1148 }1149 if ( data !== undefined ) {1150 thiscache[ name ] = data;1151 }1152 // todo: this is a hack for 1.5 only. it will be removed in 1.6. users should1153 // not attempt to inspect the internal events object using jquery.data, as this1154 // internal data object is undocumented and subject to change.1155 if ( name === "events" && !thiscache[name] ) {1156 return thiscache[ internalkey ] && thiscache[ internalkey ].events;1157 }1158 return getbyname ? thiscache[ name ] : thiscache;1159 },1160 removedata: function( elem, name, pvt /* internal use only */ ) {1161 if ( !jquery.acceptdata( elem ) ) {1162 return;1163 }1164 var internalkey = jquery.expando, isnode = elem.nodetype,1165 // see jquery.data for more information1166 cache = isnode ? jquery.cache : elem,1167 // see jquery.data for more information1168 id = isnode ? elem[ jquery.expando ] : jquery.expando;1169 // if there is already no cache entry for this object, there is no1170 // purpose in continuing1171 if ( !cache[ id ] ) {1172 return;1173 }1174 if ( name ) {1175 var thiscache = pvt ? cache[ id ][ internalkey ] : cache[ id ];1176 if ( thiscache ) {1177 delete thiscache[ name ];1178 // if there is no data left in the cache, we want to continue1179 // and let the cache object itself get destroyed1180 if ( !isemptydataobject(thiscache) ) {1181 return;1182 }1183 }1184 }1185 // see jquery.data for more information1186 if ( pvt ) {1187 delete cache[ id ][ internalkey ];1188 // don't destroy the parent cache unless the internal data object1189 // had been the only thing left in it1190 if ( !isemptydataobject(cache[ id ]) ) {1191 return;1192 }1193 }1194 var internalcache = cache[ id ][ internalkey ];1195 // browsers that fail expando deletion also refuse to delete expandos on1196 // the window, but it will allow it on all other js objects; other browsers1197 // don't care1198 if ( jquery.support.deleteexpando || cache != window ) {1199 delete cache[ id ];1200 } else {1201 cache[ id ] = null;1202 }1203 // we destroyed the entire user cache at once because it's faster than1204 // iterating through each key, but we need to continue to persist internal1205 // data if it existed1206 if ( internalcache ) {1207 cache[ id ] = {};1208 // todo: this is a hack for 1.5 only. avoids exposing jquery1209 // metadata on plain js objects when the object is serialized using1210 // json.stringify1211 if ( !isnode ) {1212 cache[ id ].tojson = jquery.noop;1213 }1214 cache[ id ][ internalkey ] = internalcache;1215 // otherwise, we need to eliminate the expando on the node to avoid1216 // false lookups in the cache for entries that no longer exist1217 } else if ( isnode ) {1218 // ie does not allow us to delete expando properties from nodes,1219 // nor does it have a removeattribute function on document nodes;1220 // we must handle all of these cases1221 if ( jquery.support.deleteexpando ) {1222 delete elem[ jquery.expando ];1223 } else if ( elem.removeattribute ) {1224 elem.removeattribute( jquery.expando );1225 } else {1226 elem[ jquery.expando ] = null;1227 }1228 }1229 },1230 // for internal use only.1231 _data: function( elem, name, data ) {1232 return jquery.data( elem, name, data, true );1233 },1234 // a method for determining if a dom node can handle the data expando1235 acceptdata: function( elem ) {1236 if ( elem.nodename ) {1237 var match = jquery.nodata[ elem.nodename.tolowercase() ];1238 if ( match ) {1239 return !(match === true || elem.getattribute("classid") !== match);1240 }1241 }1242 return true;1243 }1244});1245jquery.fn.extend({1246 data: function( key, value ) {1247 var data = null;1248 if ( typeof key === "undefined" ) {1249 if ( this.length ) {1250 data = jquery.data( this[0] );1251 if ( this[0].nodetype === 1 ) {1252 var attr = this[0].attributes, name;1253 for ( var i = 0, l = attr.length; i < l; i++ ) {1254 name = attr[i].name;1255 if ( name.indexof( "data-" ) === 0 ) {1256 name = name.substr( 5 );1257 dataattr( this[0], name, data[ name ] );1258 }1259 }1260 }1261 }1262 return data;1263 } else if ( typeof key === "object" ) {1264 return this.each(function() {1265 jquery.data( this, key );1266 });1267 }1268 var parts = key.split(".");1269 parts[1] = parts[1] ? "." + parts[1] : "";1270 if ( value === undefined ) {1271 data = this.triggerhandler("getdata" + parts[1] + "!", [parts[0]]);1272 // try to fetch any internally stored data first1273 if ( data === undefined && this.length ) {1274 data = jquery.data( this[0], key );1275 data = dataattr( this[0], key, data );1276 }1277 return data === undefined && parts[1] ?1278 this.data( parts[0] ) :1279 data;1280 } else {1281 return this.each(function() {1282 var $this = jquery( this ),1283 args = [ parts[0], value ];1284 $this.triggerhandler( "setdata" + parts[1] + "!", args );1285 jquery.data( this, key, value );1286 $this.triggerhandler( "changedata" + parts[1] + "!", args );1287 });1288 }1289 },1290 removedata: function( key ) {1291 return this.each(function() {1292 jquery.removedata( this, key );1293 });1294 }1295});1296function dataattr( elem, key, data ) {1297 // if nothing was found internally, try to fetch any1298 // data from the html5 data-* attribute1299 if ( data === undefined && elem.nodetype === 1 ) {1300 data = elem.getattribute( "data-" + key );1301 if ( typeof data === "string" ) {1302 try {1303 data = data === "true" ? true :1304 data === "false" ? false :1305 data === "null" ? null :1306 !jquery.isnan( data ) ? parsefloat( data ) :1307 rbrace.test( data ) ? jquery.parsejson( data ) :1308 data;1309 } catch( e ) {}1310 // make sure we set the data so it isn't changed later1311 jquery.data( elem, key, data );1312 } else {1313 data = undefined;1314 }1315 }1316 return data;1317}1318// todo: this is a hack for 1.5 only to allow objects with a single tojson1319// property to be considered empty objects; this property always exists in1320// order to make sure json.stringify does not expose internal metadata1321function isemptydataobject( obj ) {1322 for ( var name in obj ) {1323 if ( name !== "tojson" ) {1324 return false;1325 }1326 }1327 return true;1328}1329jquery.extend({1330 queue: function( elem, type, data ) {1331 if ( !elem ) {1332 return;1333 }1334 type = (type || "fx") + "queue";1335 var q = jquery._data( elem, type );1336 // speed up dequeue by getting out quickly if this is just a lookup1337 if ( !data ) {1338 return q || [];1339 }1340 if ( !q || jquery.isarray(data) ) {1341 q = jquery._data( elem, type, jquery.makearray(data) );1342 } else {1343 q.push( data );1344 }1345 return q;1346 },1347 dequeue: function( elem, type ) {1348 type = type || "fx";1349 var queue = jquery.queue( elem, type ),1350 fn = queue.shift();1351 // if the fx queue is dequeued, always remove the progress sentinel1352 if ( fn === "inprogress" ) {1353 fn = queue.shift();1354 }1355 if ( fn ) {1356 // add a progress sentinel to prevent the fx queue from being1357 // automatically dequeued1358 if ( type === "fx" ) {1359 queue.unshift("inprogress");1360 }1361 fn.call(elem, function() {1362 jquery.dequeue(elem, type);1363 });1364 }1365 if ( !queue.length ) {1366 jquery.removedata( elem, type + "queue", true );1367 }1368 }1369});1370jquery.fn.extend({1371 queue: function( type, data ) {1372 if ( typeof type !== "string" ) {1373 data = type;1374 type = "fx";1375 }1376 if ( data === undefined ) {1377 return jquery.queue( this[0], type );1378 }1379 return this.each(function( i ) {1380 var queue = jquery.queue( this, type, data );1381 if ( type === "fx" && queue[0] !== "inprogress" ) {1382 jquery.dequeue( this, type );1383 }1384 });1385 },1386 dequeue: function( type ) {1387 return this.each(function() {1388 jquery.dequeue( this, type );1389 });1390 },1391 // based off of the plugin by clint helfers, with permission.1392 // http://blindsignals.com/index.php/2009/07/jquery-delay/1393 delay: function( time, type ) {1394 time = jquery.fx ? jquery.fx.speeds[time] || time : time;1395 type = type || "fx";1396 return this.queue( type, function() {1397 var elem = this;1398 settimeout(function() {1399 jquery.dequeue( elem, type );1400 }, time );1401 });1402 },1403 clearqueue: function( type ) {1404 return this.queue( type || "fx", [] );1405 }1406});1407var rclass = /[\n\t\r]/g,1408 rspaces = /\s+/,1409 rreturn = /\r/g,1410 rspecialurl = /^(?:href|src|style)$/,1411 rtype = /^(?:button|input)$/i,1412 rfocusable = /^(?:button|input|object|select|textarea)$/i,1413 rclickable = /^a(?:rea)?$/i,1414 rradiocheck = /^(?:radio|checkbox)$/i;1415jquery.props = {1416 "for": "htmlfor",1417 "class": "classname",1418 readonly: "readonly",1419 maxlength: "maxlength",1420 cellspacing: "cellspacing",1421 rowspan: "rowspan",1422 colspan: "colspan",1423 tabindex: "tabindex",1424 usemap: "usemap",1425 frameborder: "frameborder"1426};1427jquery.fn.extend({1428 attr: function( name, value ) {1429 return jquery.access( this, name, value, true, jquery.attr );1430 },1431 removeattr: function( name, fn ) {1432 return this.each(function(){1433 jquery.attr( this, name, "" );1434 if ( this.nodetype === 1 ) {1435 this.removeattribute( name );1436 }1437 });1438 },1439 addclass: function( value ) {1440 if ( jquery.isfunction(value) ) {1441 return this.each(function(i) {1442 var self = jquery(this);1443 self.addclass( value.call(this, i, self.attr("class")) );1444 });1445 }1446 if ( value && typeof value === "string" ) {1447 var classnames = (value || "").split( rspaces );1448 for ( var i = 0, l = this.length; i < l; i++ ) {1449 var elem = this[i];1450 if ( elem.nodetype === 1 ) {1451 if ( !elem.classname ) {1452 elem.classname = value;1453 } else {1454 var classname = " " + elem.classname + " ",1455 setclass = elem.classname;1456 for ( var c = 0, cl = classnames.length; c < cl; c++ ) {1457 if ( classname.indexof( " " + classnames[c] + " " ) < 0 ) {1458 setclass += " " + classnames[c];1459 }1460 }1461 elem.classname = jquery.trim( setclass );1462 }1463 }1464 }1465 }1466 return this;1467 },1468 removeclass: function( value ) {1469 if ( jquery.isfunction(value) ) {1470 return this.each(function(i) {1471 var self = jquery(this);1472 self.removeclass( value.call(this, i, self.attr("class")) );1473 });1474 }1475 if ( (value && typeof value === "string") || value === undefined ) {1476 var classnames = (value || "").split( rspaces );1477 for ( var i = 0, l = this.length; i < l; i++ ) {1478 var elem = this[i];1479 if ( elem.nodetype === 1 && elem.classname ) {1480 if ( value ) {1481 var classname = (" " + elem.classname + " ").replace(rclass, " ");1482 for ( var c = 0, cl = classnames.length; c < cl; c++ ) {1483 classname = classname.replace(" " + classnames[c] + " ", " ");1484 }1485 elem.classname = jquery.trim( classname );1486 } else {1487 elem.classname = "";1488 }1489 }1490 }1491 }1492 return this;1493 },1494 toggleclass: function( value, stateval ) {1495 var type = typeof value,1496 isbool = typeof stateval === "boolean";1497 if ( jquery.isfunction( value ) ) {1498 return this.each(function(i) {1499 var self = jquery(this);1500 self.toggleclass( value.call(this, i, self.attr("class"), stateval), stateval );1501 });1502 }1503 return this.each(function() {1504 if ( type === "string" ) {1505 // toggle individual class names1506 var classname,1507 i = 0,1508 self = jquery( this ),1509 state = stateval,1510 classnames = value.split( rspaces );1511 while ( (classname = classnames[ i++ ]) ) {1512 // check each classname given, space seperated list1513 state = isbool ? state : !self.hasclass( classname );1514 self[ state ? "addclass" : "removeclass" ]( classname );1515 }1516 } else if ( type === "undefined" || type === "boolean" ) {1517 if ( this.classname ) {1518 // store classname if set1519 jquery._data( this, "__classname__", this.classname );1520 }1521 // toggle whole classname1522 this.classname = this.classname || value === false ? "" : jquery._data( this, "__classname__" ) || "";1523 }1524 });1525 },1526 hasclass: function( selector ) {1527 var classname = " " + selector + " ";1528 for ( var i = 0, l = this.length; i < l; i++ ) {1529 if ( (" " + this[i].classname + " ").replace(rclass, " ").indexof( classname ) > -1 ) {1530 return true;1531 }1532 }1533 return false;1534 },1535 val: function( value ) {1536 if ( !arguments.length ) {1537 var elem = this[0];1538 if ( elem ) {1539 if ( jquery.nodename( elem, "option" ) ) {1540 // attributes.value is undefined in blackberry 4.7 but1541 // uses .value. see #69321542 var val = elem.attributes.value;1543 return !val || val.specified ? elem.value : elem.text;1544 }1545 // we need to handle select boxes special1546 if ( jquery.nodename( elem, "select" ) ) {1547 var index = elem.selectedindex,1548 values = [],1549 options = elem.options,1550 one = elem.type === "select-one";1551 // nothing was selected1552 if ( index < 0 ) {1553 return null;1554 }1555 // loop through all the selected options1556 for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {1557 var option = options[ i ];1558 // don't return options that are disabled or in a disabled optgroup1559 if ( option.selected && (jquery.support.optdisabled ? !option.disabled : option.getattribute("disabled") === null) &&1560 (!option.parentnode.disabled || !jquery.nodename( option.parentnode, "optgroup" )) ) {1561 // get the specific value for the option1562 value = jquery(option).val();1563 // we don't need an array for one selects1564 if ( one ) {1565 return value;1566 }1567 // multi-selects return an array1568 values.push( value );1569 }1570 }1571 // fixes bug #2551 -- select.val() broken in ie after form.reset()1572 if ( one && !values.length && options.length ) {1573 return jquery( options[ index ] ).val();1574 }1575 return values;1576 }1577 // handle the case where in webkit "" is returned instead of "on" if a value isn't specified1578 if ( rradiocheck.test( elem.type ) && !jquery.support.checkon ) {1579 return elem.getattribute("value") === null ? "on" : elem.value;1580 }1581 // everything else, we just grab the value1582 return (elem.value || "").replace(rreturn, "");1583 }1584 return undefined;1585 }1586 var isfunction = jquery.isfunction(value);1587 return this.each(function(i) {1588 var self = jquery(this), val = value;1589 if ( this.nodetype !== 1 ) {1590 return;1591 }1592 if ( isfunction ) {1593 val = value.call(this, i, self.val());1594 }1595 // treat null/undefined as ""; convert numbers to string1596 if ( val == null ) {1597 val = "";1598 } else if ( typeof val === "number" ) {1599 val += "";1600 } else if ( jquery.isarray(val) ) {1601 val = jquery.map(val, function (value) {1602 return value == null ? "" : value + "";1603 });1604 }1605 if ( jquery.isarray(val) && rradiocheck.test( this.type ) ) {1606 this.checked = jquery.inarray( self.val(), val ) >= 0;1607 } else if ( jquery.nodename( this, "select" ) ) {1608 var values = jquery.makearray(val);1609 jquery( "option", this ).each(function() {1610 this.selected = jquery.inarray( jquery(this).val(), values ) >= 0;1611 });1612 if ( !values.length ) {1613 this.selectedindex = -1;1614 }1615 } else {1616 this.value = val;1617 }1618 });1619 }1620});1621jquery.extend({1622 attrfn: {1623 val: true,1624 css: true,1625 html: true,1626 text: true,1627 data: true,1628 width: true,1629 height: true,1630 offset: true1631 },1632 attr: function( elem, name, value, pass ) {1633 // don't get/set attributes on text, comment and attribute nodes1634 if ( !elem || elem.nodetype === 3 || elem.nodetype === 8 || elem.nodetype === 2 ) {1635 return undefined;1636 }1637 if ( pass && name in jquery.attrfn ) {1638 return jquery(elem)[name](value);1639 }1640 var notxml = elem.nodetype !== 1 || !jquery.isxmldoc( elem ),1641 // whether we are setting (or getting)1642 set = value !== undefined;1643 // try to normalize/fix the name1644 name = notxml && jquery.props[ name ] || name;1645 // only do all the following if this is a node (faster for style)1646 if ( elem.nodetype === 1 ) {1647 // these attributes require special treatment1648 var special = rspecialurl.test( name );1649 // safari mis-reports the default selected property of an option1650 // accessing the parent's selectedindex property fixes it1651 if ( name === "selected" && !jquery.support.optselected ) {1652 var parent = elem.parentnode;1653 if ( parent ) {1654 parent.selectedindex;1655 // make sure that it also works with optgroups, see #57011656 if ( parent.parentnode ) {1657 parent.parentnode.selectedindex;1658 }1659 }1660 }1661 // if applicable, access the attribute via the dom 0 way1662 // 'in' checks fail in blackberry 4.7 #69311663 if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {1664 if ( set ) {1665 // we can't allow the type property to be changed (since it causes problems in ie)1666 if ( name === "type" && rtype.test( elem.nodename ) && elem.parentnode ) {1667 jquery.error( "type property can't be changed" );1668 }1669 if ( value === null ) {1670 if ( elem.nodetype === 1 ) {1671 elem.removeattribute( name );1672 }1673 } else {1674 elem[ name ] = value;1675 }1676 }1677 // browsers index elements by id/name on forms, give priority to attributes.1678 if ( jquery.nodename( elem, "form" ) && elem.getattributenode(name) ) {1679 return elem.getattributenode( name ).nodevalue;1680 }1681 // elem.tabindex doesn't always return the correct value when it hasn't been explicitly set1682 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/1683 if ( name === "tabindex" ) {1684 var attributenode = elem.getattributenode( "tabindex" );1685 return attributenode && attributenode.specified ?1686 attributenode.value :1687 rfocusable.test( elem.nodename ) || rclickable.test( elem.nodename ) && elem.href ?1688 0 :1689 undefined;1690 }1691 return elem[ name ];1692 }1693 if ( !jquery.support.style && notxml && name === "style" ) {1694 if ( set ) {1695 elem.style.csstext = "" + value;1696 }1697 return elem.style.csstext;1698 }1699 if ( set ) {1700 // convert the value to a string (all browsers do this but ie) see #10701701 elem.setattribute( name, "" + value );1702 }1703 // ensure that missing attributes return undefined1704 // blackberry 4.7 returns "" from getattribute #69381705 if ( !elem.attributes[ name ] && (elem.hasattribute && !elem.hasattribute( name )) ) {1706 return undefined;1707 }1708 var attr = !jquery.support.hrefnormalized && notxml && special ?1709 // some attributes require a special call on ie1710 elem.getattribute( name, 2 ) :1711 elem.getattribute( name );1712 // non-existent attributes return null, we normalize to undefined1713 return attr === null ? undefined : attr;1714 }1715 // handle everything which isn't a dom element node1716 if ( set ) {1717 elem[ name ] = value;1718 }1719 return elem[ name ];1720 }1721});1722var rnamespaces = /\.(.*)$/,1723 rformelems = /^(?:textarea|input|select)$/i,1724 rperiod = /\./g,1725 rspace = / /g,1726 rescape = /[^\w\s.|`]/g,1727 fcleanup = function( nm ) {1728 return nm.replace(rescape, "\\$&");1729 };1730/*1731 * a number of helper functions used for managing events.1732 * many of the ideas behind this code originated from1733 * dean edwards' addevent library.1734 */1735jquery.event = {1736 // bind an event to an element1737 // original by dean edwards1738 add: function( elem, types, handler, data ) {1739 if ( elem.nodetype === 3 || elem.nodetype === 8 ) {1740 return;1741 }1742 // todo :: use a try/catch until it's safe to pull this out (likely 1.6)1743 // minor release fix for bug #80181744 try {1745 // for whatever reason, ie has trouble passing the window object1746 // around, causing it to be cloned in the process1747 if ( jquery.iswindow( elem ) && ( elem !== window && !elem.frameelement ) ) {1748 elem = window;1749 }1750 }1751 catch ( e ) {}1752 if ( handler === false ) {1753 handler = returnfalse;1754 } else if ( !handler ) {1755 // fixes bug #7229. fix recommended by jdalton1756 return;1757 }1758 var handleobjin, handleobj;1759 if ( handler.handler ) {1760 handleobjin = handler;1761 handler = handleobjin.handler;1762 }1763 // make sure that the function being executed has a unique id1764 if ( !handler.guid ) {1765 handler.guid = jquery.guid++;1766 }1767 // init the element's event structure1768 var elemdata = jquery._data( elem );1769 // if no elemdata is found then we must be trying to bind to one of the1770 // banned nodata elements1771 if ( !elemdata ) {1772 return;1773 }1774 var events = elemdata.events,1775 eventhandle = elemdata.handle;1776 if ( !events ) {1777 elemdata.events = events = {};1778 }1779 if ( !eventhandle ) {1780 elemdata.handle = eventhandle = function() {1781 // handle the second event of a trigger and when1782 // an event is called after a page has unloaded1783 return typeof jquery !== "undefined" && !jquery.event.triggered ?1784 jquery.event.handle.apply( eventhandle.elem, arguments ) :1785 undefined;1786 };1787 }1788 // add elem as a property of the handle function1789 // this is to prevent a memory leak with non-native events in ie.1790 eventhandle.elem = elem;1791 // handle multiple events separated by a space1792 // jquery(...).bind("mouseover mouseout", fn);1793 types = types.split(" ");1794 var type, i = 0, namespaces;1795 while ( (type = types[ i++ ]) ) {1796 handleobj = handleobjin ?1797 jquery.extend({}, handleobjin) :1798 { handler: handler, data: data };1799 // namespaced event handlers1800 if ( type.indexof(".") > -1 ) {1801 namespaces = type.split(".");1802 type = namespaces.shift();1803 handleobj.namespace = namespaces.slice(0).sort().join(".");1804 } else {1805 namespaces = [];1806 handleobj.namespace = "";1807 }1808 handleobj.type = type;1809 if ( !handleobj.guid ) {1810 handleobj.guid = handler.guid;1811 }1812 // get the current list of functions bound to this event1813 var handlers = events[ type ],1814 special = jquery.event.special[ type ] || {};1815 // init the event handler queue1816 if ( !handlers ) {1817 handlers = events[ type ] = [];1818 // check for a special event handler1819 // only use addeventlistener/attachevent if the special1820 // events handler returns false1821 if ( !special.setup || special.setup.call( elem, data, namespaces, eventhandle ) === false ) {1822 // bind the global event handler to the element1823 if ( elem.addeventlistener ) {1824 elem.addeventlistener( type, eventhandle, false );1825 } else if ( elem.attachevent ) {1826 elem.attachevent( "on" + type, eventhandle );1827 }1828 }1829 }1830 if ( special.add ) {1831 special.add.call( elem, handleobj );1832 if ( !handleobj.handler.guid ) {1833 handleobj.handler.guid = handler.guid;1834 }1835 }1836 // add the function to the element's handler list1837 handlers.push( handleobj );1838 // keep track of which events have been used, for global triggering1839 jquery.event.global[ type ] = true;1840 }1841 // nullify elem to prevent memory leaks in ie1842 elem = null;1843 },1844 global: {},1845 // detach an event or set of events from an element1846 remove: function( elem, types, handler, pos ) {1847 // don't do events on text and comment nodes1848 if ( elem.nodetype === 3 || elem.nodetype === 8 ) {1849 return;1850 }1851 if ( handler === false ) {1852 handler = returnfalse;1853 }1854 var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventtype, handleobj, origtype,1855 elemdata = jquery.hasdata( elem ) && jquery._data( elem ),1856 events = elemdata && elemdata.events;1857 if ( !elemdata || !events ) {1858 return;1859 }1860 // types is actually an event object here1861 if ( types && types.type ) {1862 handler = types.handler;1863 types = types.type;1864 }1865 // unbind all events for the element1866 if ( !types || typeof types === "string" && types.charat(0) === "." ) {1867 types = types || "";1868 for ( type in events ) {1869 jquery.event.remove( elem, type + types );1870 }1871 return;1872 }1873 // handle multiple events separated by a space1874 // jquery(...).unbind("mouseover mouseout", fn);1875 types = types.split(" ");1876 while ( (type = types[ i++ ]) ) {1877 origtype = type;1878 handleobj = null;1879 all = type.indexof(".") < 0;1880 namespaces = [];1881 if ( !all ) {1882 // namespaced event handlers1883 namespaces = type.split(".");1884 type = namespaces.shift();1885 namespace = new regexp("(^|\\.)" +1886 jquery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");1887 }1888 eventtype = events[ type ];1889 if ( !eventtype ) {1890 continue;1891 }1892 if ( !handler ) {1893 for ( j = 0; j < eventtype.length; j++ ) {1894 handleobj = eventtype[ j ];1895 if ( all || namespace.test( handleobj.namespace ) ) {1896 jquery.event.remove( elem, origtype, handleobj.handler, j );1897 eventtype.splice( j--, 1 );1898 }1899 }1900 continue;1901 }1902 special = jquery.event.special[ type ] || {};1903 for ( j = pos || 0; j < eventtype.length; j++ ) {1904 handleobj = eventtype[ j ];1905 if ( handler.guid === handleobj.guid ) {1906 // remove the given handler for the given type1907 if ( all || namespace.test( handleobj.namespace ) ) {1908 if ( pos == null ) {1909 eventtype.splice( j--, 1 );1910 }1911 if ( special.remove ) {1912 special.remove.call( elem, handleobj );1913 }1914 }1915 if ( pos != null ) {1916 break;1917 }1918 }1919 }1920 // remove generic event handler if no more handlers exist1921 if ( eventtype.length === 0 || pos != null && eventtype.length === 1 ) {1922 if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {1923 jquery.removeevent( elem, type, elemdata.handle );1924 }1925 ret = null;1926 delete events[ type ];1927 }1928 }1929 // remove the expando if it's no longer used1930 if ( jquery.isemptyobject( events ) ) {1931 var handle = elemdata.handle;1932 if ( handle ) {1933 handle.elem = null;1934 }1935 delete elemdata.events;1936 delete elemdata.handle;1937 if ( jquery.isemptyobject( elemdata ) ) {1938 jquery.removedata( elem, undefined, true );1939 }1940 }1941 },1942 // bubbling is internal1943 trigger: function( event, data, elem /*, bubbling */ ) {1944 // event object or event type1945 var type = event.type || event,1946 bubbling = arguments[3];1947 if ( !bubbling ) {1948 event = typeof event === "object" ?1949 // jquery.event object1950 event[ jquery.expando ] ? event :1951 // object literal1952 jquery.extend( jquery.event(type), event ) :1953 // just the event type (string)1954 jquery.event(type);1955 if ( type.indexof("!") >= 0 ) {1956 event.type = type = type.slice(0, -1);1957 event.exclusive = true;1958 }1959 // handle a global trigger1960 if ( !elem ) {1961 // don't bubble custom events when global (to avoid too much overhead)1962 event.stoppropagation();1963 // only trigger if we've ever bound an event for it1964 if ( jquery.event.global[ type ] ) {1965 // xxx this code smells terrible. event.js should not be directly1966 // inspecting the data cache1967 jquery.each( jquery.cache, function() {1968 // internalkey variable is just used to make it easier to find1969 // and potentially change this stuff later; currently it just1970 // points to jquery.expando1971 var internalkey = jquery.expando,1972 internalcache = this[ internalkey ];1973 if ( internalcache && internalcache.events && internalcache.events[ type ] ) {1974 jquery.event.trigger( event, data, internalcache.handle.elem );1975 }1976 });1977 }1978 }1979 // handle triggering a single element1980 // don't do events on text and comment nodes1981 if ( !elem || elem.nodetype === 3 || elem.nodetype === 8 ) {1982 return undefined;1983 }1984 // clean up in case it is reused1985 event.result = undefined;1986 event.target = elem;1987 // clone the incoming data, if any1988 data = jquery.makearray( data );1989 data.unshift( event );1990 }1991 event.currenttarget = elem;1992 // trigger the event, it is assumed that "handle" is a function1993 var handle = jquery._data( elem, "handle" );1994 if ( handle ) {1995 handle.apply( elem, data );1996 }1997 var parent = elem.parentnode || elem.ownerdocument;1998 // trigger an inline bound script1999 try {2000 if ( !(elem && elem.nodename && jquery.nodata[elem.nodename.tolowercase()]) ) {2001 if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {2002 event.result = false;2003 event.preventdefault();2004 }2005 }2006 // prevent ie from throwing an error for some elements with some event types, see #35332007 } catch (inlineerror) {}2008 if ( !event.ispropagationstopped() && parent ) {2009 jquery.event.trigger( event, data, parent, true );2010 } else if ( !event.isdefaultprevented() ) {2011 var old,2012 target = event.target,2013 targettype = type.replace( rnamespaces, "" ),2014 isclick = jquery.nodename( target, "a" ) && targettype === "click",2015 special = jquery.event.special[ targettype ] || {};2016 if ( (!special._default || special._default.call( elem, event ) === false) &&2017 !isclick && !(target && target.nodename && jquery.nodata[target.nodename.tolowercase()]) ) {2018 try {2019 if ( target[ targettype ] ) {2020 // make sure that we don't accidentally re-trigger the onfoo events2021 old = target[ "on" + targettype ];2022 if ( old ) {2023 target[ "on" + targettype ] = null;2024 }2025 jquery.event.triggered = true;2026 target[ targettype ]();2027 }2028 // prevent ie from throwing an error for some elements with some event types, see #35332029 } catch (triggererror) {}2030 if ( old ) {2031 target[ "on" + targettype ] = old;2032 }2033 jquery.event.triggered = false;2034 }2035 }2036 },2037 handle: function( event ) {2038 var all, handlers, namespaces, namespace_re, events,2039 namespace_sort = [],2040 args = jquery.makearray( arguments );2041 event = args[0] = jquery.event.fix( event || window.event );2042 event.currenttarget = this;2043 // namespaced event handlers2044 all = event.type.indexof(".") < 0 && !event.exclusive;2045 if ( !all ) {2046 namespaces = event.type.split(".");2047 event.type = namespaces.shift();2048 namespace_sort = namespaces.slice(0).sort();2049 namespace_re = new regexp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");2050 }2051 event.namespace = event.namespace || namespace_sort.join(".");2052 events = jquery._data(this, "events");2053 handlers = (events || {})[ event.type ];2054 if ( events && handlers ) {2055 // clone the handlers to prevent manipulation2056 handlers = handlers.slice(0);2057 for ( var j = 0, l = handlers.length; j < l; j++ ) {2058 var handleobj = handlers[ j ];2059 // filter the functions by class2060 if ( all || namespace_re.test( handleobj.namespace ) ) {2061 // pass in a reference to the handler function itself2062 // so that we can later remove it2063 event.handler = handleobj.handler;2064 event.data = handleobj.data;2065 event.handleobj = handleobj;2066 var ret = handleobj.handler.apply( this, args );2067 if ( ret !== undefined ) {2068 event.result = ret;2069 if ( ret === false ) {2070 event.preventdefault();2071 event.stoppropagation();2072 }2073 }2074 if ( event.isimmediatepropagationstopped() ) {2075 break;2076 }2077 }2078 }2079 }2080 return event.result;2081 },2082 props: "altkey attrchange attrname bubbles button cancelable charcode clientx clienty ctrlkey currenttarget data detail eventphase fromelement handler keycode layerx layery metakey newvalue offsetx offsety pagex pagey prevvalue relatednode relatedtarget screenx screeny shiftkey srcelement target toelement view wheeldelta which".split(" "),2083 fix: function( event ) {2084 if ( event[ jquery.expando ] ) {2085 return event;2086 }2087 // store a copy of the original event object2088 // and "clone" to set read-only properties2089 var originalevent = event;2090 event = jquery.event( originalevent );2091 for ( var i = this.props.length, prop; i; ) {2092 prop = this.props[ --i ];2093 event[ prop ] = originalevent[ prop ];2094 }2095 // fix target property, if necessary2096 if ( !event.target ) {2097 // fixes #1925 where srcelement might not be defined either2098 event.target = event.srcelement || document;2099 }2100 // check if target is a textnode (safari)2101 if ( event.target.nodetype === 3 ) {2102 event.target = event.target.parentnode;2103 }2104 // add relatedtarget, if necessary2105 if ( !event.relatedtarget && event.fromelement ) {2106 event.relatedtarget = event.fromelement === event.target ? event.toelement : event.fromelement;2107 }2108 // calculate pagex/y if missing and clientx/y available2109 if ( event.pagex == null && event.clientx != null ) {2110 var doc = document.documentelement,2111 body = document.body;2112 event.pagex = event.clientx + (doc && doc.scrollleft || body && body.scrollleft || 0) - (doc && doc.clientleft || body && body.clientleft || 0);2113 event.pagey = event.clienty + (doc && doc.scrolltop || body && body.scrolltop || 0) - (doc && doc.clienttop || body && body.clienttop || 0);2114 }2115 // add which for key events2116 if ( event.which == null && (event.charcode != null || event.keycode != null) ) {2117 event.which = event.charcode != null ? event.charcode : event.keycode;2118 }2119 // add metakey to non-mac browsers (use ctrl for pc's and meta for macs)2120 if ( !event.metakey && event.ctrlkey ) {2121 event.metakey = event.ctrlkey;2122 }2123 // add which for click: 1 === left; 2 === middle; 3 === right2124 // note: button is not normalized, so don't use it2125 if ( !event.which && event.button !== undefined ) {2126 event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));2127 }2128 return event;2129 },2130 // deprecated, use jquery.guid instead2131 guid: 1e8,2132 // deprecated, use jquery.proxy instead2133 proxy: jquery.proxy,2134 special: {2135 ready: {2136 // make sure the ready event is setup2137 setup: jquery.bindready,2138 teardown: jquery.noop2139 },2140 live: {2141 add: function( handleobj ) {2142 jquery.event.add( this,2143 liveconvert( handleobj.origtype, handleobj.selector ),2144 jquery.extend({}, handleobj, {handler: livehandler, guid: handleobj.handler.guid}) );2145 },2146 remove: function( handleobj ) {2147 jquery.event.remove( this, liveconvert( handleobj.origtype, handleobj.selector ), handleobj );2148 }2149 },2150 beforeunload: {2151 setup: function( data, namespaces, eventhandle ) {2152 // we only want to do this special case on windows2153 if ( jquery.iswindow( this ) ) {2154 this.onbeforeunload = eventhandle;2155 }2156 },2157 teardown: function( namespaces, eventhandle ) {2158 if ( this.onbeforeunload === eventhandle ) {2159 this.onbeforeunload = null;2160 }2161 }2162 }2163 }2164};2165jquery.removeevent = document.removeeventlistener ?2166 function( elem, type, handle ) {2167 if ( elem.removeeventlistener ) {2168 elem.removeeventlistener( type, handle, false );2169 }2170 } :2171 function( elem, type, handle ) {2172 if ( elem.detachevent ) {2173 elem.detachevent( "on" + type, handle );2174 }2175 };2176jquery.event = function( src ) {2177 // allow instantiation without the 'new' keyword2178 if ( !this.preventdefault ) {2179 return new jquery.event( src );2180 }2181 // event object2182 if ( src && src.type ) {2183 this.originalevent = src;2184 this.type = src.type;2185 // events bubbling up the document may have been marked as prevented2186 // by a handler lower down the tree; reflect the correct value.2187 this.isdefaultprevented = (src.defaultprevented || src.returnvalue === false ||2188 src.getpreventdefault && src.getpreventdefault()) ? returntrue : returnfalse;2189 // event type2190 } else {2191 this.type = src;2192 }2193 // timestamp is buggy for some events on firefox(#3843)2194 // so we won't rely on the native value2195 this.timestamp = jquery.now();2196 // mark it as fixed2197 this[ jquery.expando ] = true;2198};2199function returnfalse() {2200 return false;2201}2202function returntrue() {2203 return true;2204}2205// jquery.event is based on dom3 events as specified by the ecmascript language binding2206// http://www.w3.org/tr/2003/wd-dom-level-3-events-20030331/ecma-script-binding.html2207jquery.event.prototype = {2208 preventdefault: function() {2209 this.isdefaultprevented = returntrue;2210 var e = this.originalevent;2211 if ( !e ) {2212 return;2213 }2214 // if preventdefault exists run it on the original event2215 if ( e.preventdefault ) {2216 e.preventdefault();2217 // otherwise set the returnvalue property of the original event to false (ie)2218 } else {2219 e.returnvalue = false;2220 }2221 },2222 stoppropagation: function() {2223 this.ispropagationstopped = returntrue;2224 var e = this.originalevent;2225 if ( !e ) {2226 return;2227 }2228 // if stoppropagation exists run it on the original event2229 if ( e.stoppropagation ) {2230 e.stoppropagation();2231 }2232 // otherwise set the cancelbubble property of the original event to true (ie)2233 e.cancelbubble = true;2234 },2235 stopimmediatepropagation: function() {2236 this.isimmediatepropagationstopped = returntrue;2237 this.stoppropagation();2238 },2239 isdefaultprevented: returnfalse,2240 ispropagationstopped: returnfalse,2241 isimmediatepropagationstopped: returnfalse2242};2243// checks if an event happened on an element within another element2244// used in jquery.event.special.mouseenter and mouseleave handlers2245var withinelement = function( event ) {2246 // check if mouse(over|out) are still within the same parent element2247 var parent = event.relatedtarget;2248 // firefox sometimes assigns relatedtarget a xul element2249 // which we cannot access the parentnode property of2250 try {2251 // chrome does something similar, the parentnode property2252 // can be accessed but is null.2253 if ( parent !== document && !parent.parentnode ) {2254 return;2255 }2256 // traverse up the tree2257 while ( parent && parent !== this ) {2258 parent = parent.parentnode;2259 }2260 if ( parent !== this ) {2261 // set the correct event type2262 event.type = event.data;2263 // handle event if we actually just moused on to a non sub-element2264 jquery.event.handle.apply( this, arguments );2265 }2266 // assuming we've left the element since we most likely mousedover a xul element2267 } catch(e) { }2268},2269// in case of event delegation, we only need to rename the event.type,2270// livehandler will take care of the rest.2271delegate = function( event ) {2272 event.type = event.data;2273 jquery.event.handle.apply( this, arguments );2274};2275// create mouseenter and mouseleave events2276jquery.each({2277 mouseenter: "mouseover",2278 mouseleave: "mouseout"2279}, function( orig, fix ) {2280 jquery.event.special[ orig ] = {2281 setup: function( data ) {2282 jquery.event.add( this, fix, data && data.selector ? delegate : withinelement, orig );2283 },2284 teardown: function( data ) {2285 jquery.event.remove( this, fix, data && data.selector ? delegate : withinelement );2286 }2287 };2288});2289// submit delegation2290if ( !jquery.support.submitbubbles ) {2291 jquery.event.special.submit = {2292 setup: function( data, namespaces ) {2293 if ( this.nodename && this.nodename.tolowercase() !== "form" ) {2294 jquery.event.add(this, "click.specialsubmit", function( e ) {2295 var elem = e.target,2296 type = elem.type;2297 if ( (type === "submit" || type === "image") && jquery( elem ).closest("form").length ) {2298 trigger( "submit", this, arguments );2299 }2300 });2301 jquery.event.add(this, "keypress.specialsubmit", function( e ) {2302 var elem = e.target,2303 type = elem.type;2304 if ( (type === "text" || type === "password") && jquery( elem ).closest("form").length && e.keycode === 13 ) {2305 trigger( "submit", this, arguments );2306 }2307 });2308 } else {2309 return false;2310 }2311 },2312 teardown: function( namespaces ) {2313 jquery.event.remove( this, ".specialsubmit" );2314 }2315 };2316}2317// change delegation, happens here so we have bind.2318if ( !jquery.support.changebubbles ) {2319 var changefilters,2320 getval = function( elem ) {2321 var type = elem.type, val = elem.value;2322 if ( type === "radio" || type === "checkbox" ) {2323 val = elem.checked;2324 } else if ( type === "select-multiple" ) {2325 val = elem.selectedindex > -1 ?2326 jquery.map( elem.options, function( elem ) {2327 return elem.selected;2328 }).join("-") :2329 "";2330 } else if ( elem.nodename.tolowercase() === "select" ) {2331 val = elem.selectedindex;2332 }2333 return val;2334 },2335 testchange = function testchange( e ) {2336 var elem = e.target, data, val;2337 if ( !rformelems.test( elem.nodename ) || elem.readonly ) {2338 return;2339 }2340 data = jquery._data( elem, "_change_data" );2341 val = getval(elem);2342 // the current data will be also retrieved by beforeactivate2343 if ( e.type !== "focusout" || elem.type !== "radio" ) {2344 jquery._data( elem, "_change_data", val );2345 }2346 if ( data === undefined || val === data ) {2347 return;2348 }2349 if ( data != null || val ) {2350 e.type = "change";2351 e.livefired = undefined;2352 jquery.event.trigger( e, arguments[1], elem );2353 }2354 };2355 jquery.event.special.change = {2356 filters: {2357 focusout: testchange,2358 beforedeactivate: testchange,2359 click: function( e ) {2360 var elem = e.target, type = elem.type;2361 if ( type === "radio" || type === "checkbox" || elem.nodename.tolowercase() === "select" ) {2362 testchange.call( this, e );2363 }2364 },2365 // change has to be called before submit2366 // keydown will be called before keypress, which is used in submit-event delegation2367 keydown: function( e ) {2368 var elem = e.target, type = elem.type;2369 if ( (e.keycode === 13 && elem.nodename.tolowercase() !== "textarea") ||2370 (e.keycode === 32 && (type === "checkbox" || type === "radio")) ||2371 type === "select-multiple" ) {2372 testchange.call( this, e );2373 }2374 },2375 // beforeactivate happens also before the previous element is blurred2376 // with this event you can't trigger a change event, but you can store2377 // information2378 beforeactivate: function( e ) {2379 var elem = e.target;2380 jquery._data( elem, "_change_data", getval(elem) );2381 }2382 },2383 setup: function( data, namespaces ) {2384 if ( this.type === "file" ) {2385 return false;2386 }2387 for ( var type in changefilters ) {2388 jquery.event.add( this, type + ".specialchange", changefilters[type] );2389 }2390 return rformelems.test( this.nodename );2391 },2392 teardown: function( namespaces ) {2393 jquery.event.remove( this, ".specialchange" );2394 return rformelems.test( this.nodename );2395 }2396 };2397 changefilters = jquery.event.special.change.filters;2398 // handle when the input is .focus()'d2399 changefilters.focus = changefilters.beforeactivate;2400}2401function trigger( type, elem, args ) {2402 // piggyback on a donor event to simulate a different one.2403 // fake originalevent to avoid donor's stoppropagation, but if the2404 // simulated event prevents default then we do the same on the donor.2405 // don't pass args or remember livefired; they apply to the donor event.2406 var event = jquery.extend( {}, args[ 0 ] );2407 event.type = type;2408 event.originalevent = {};2409 event.livefired = undefined;2410 jquery.event.handle.call( elem, event );2411 if ( event.isdefaultprevented() ) {2412 args[ 0 ].preventdefault();2413 }2414}2415// create "bubbling" focus and blur events2416if ( document.addeventlistener ) {2417 jquery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {2418 jquery.event.special[ fix ] = {2419 setup: function() {2420 this.addeventlistener( orig, handler, true );2421 },2422 teardown: function() {2423 this.removeeventlistener( orig, handler, true );2424 }2425 };2426 function handler( e ) {2427 e = jquery.event.fix( e );2428 e.type = fix;2429 return jquery.event.handle.call( this, e );2430 }2431 });2432}2433jquery.each(["bind", "one"], function( i, name ) {2434 jquery.fn[ name ] = function( type, data, fn ) {2435 // handle object literals2436 if ( typeof type === "object" ) {2437 for ( var key in type ) {2438 this[ name ](key, data, type[key], fn);2439 }2440 return this;2441 }2442 if ( jquery.isfunction( data ) || data === false ) {2443 fn = data;2444 data = undefined;2445 }2446 var handler = name === "one" ? jquery.proxy( fn, function( event ) {2447 jquery( this ).unbind( event, handler );2448 return fn.apply( this, arguments );2449 }) : fn;2450 if ( type === "unload" && name !== "one" ) {2451 this.one( type, data, fn );2452 } else {2453 for ( var i = 0, l = this.length; i < l; i++ ) {2454 jquery.event.add( this[i], type, handler, data );2455 }2456 }2457 return this;2458 };2459});2460jquery.fn.extend({2461 unbind: function( type, fn ) {2462 // handle object literals2463 if ( typeof type === "object" && !type.preventdefault ) {2464 for ( var key in type ) {2465 this.unbind(key, type[key]);2466 }2467 } else {2468 for ( var i = 0, l = this.length; i < l; i++ ) {2469 jquery.event.remove( this[i], type, fn );2470 }2471 }2472 return this;2473 },2474 delegate: function( selector, types, data, fn ) {2475 return this.live( types, data, fn, selector );2476 },2477 undelegate: function( selector, types, fn ) {2478 if ( arguments.length === 0 ) {2479 return this.unbind( "live" );2480 } else {2481 return this.die( types, null, fn, selector );2482 }2483 },2484 trigger: function( type, data ) {2485 return this.each(function() {2486 jquery.event.trigger( type, data, this );2487 });2488 },2489 triggerhandler: function( type, data ) {2490 if ( this[0] ) {2491 var event = jquery.event( type );2492 event.preventdefault();2493 event.stoppropagation();2494 jquery.event.trigger( event, data, this[0] );2495 return event.result;2496 }2497 },2498 toggle: function( fn ) {2499 // save reference to arguments for access in closure2500 var args = arguments,2501 i = 1;2502 // link all the functions, so any of them can unbind this click handler2503 while ( i < args.length ) {2504 jquery.proxy( fn, args[ i++ ] );2505 }2506 return this.click( jquery.proxy( fn, function( event ) {2507 // figure out which function to execute2508 var lasttoggle = ( jquery._data( this, "lasttoggle" + fn.guid ) || 0 ) % i;2509 jquery._data( this, "lasttoggle" + fn.guid, lasttoggle + 1 );2510 // make sure that clicks stop2511 event.preventdefault();2512 // and execute the function2513 return args[ lasttoggle ].apply( this, arguments ) || false;2514 }));2515 },2516 hover: function( fnover, fnout ) {2517 return this.mouseenter( fnover ).mouseleave( fnout || fnover );2518 }2519});2520var livemap = {2521 focus: "focusin",2522 blur: "focusout",2523 mouseenter: "mouseover",2524 mouseleave: "mouseout"2525};2526jquery.each(["live", "die"], function( i, name ) {2527 jquery.fn[ name ] = function( types, data, fn, origselector /* internal use only */ ) {2528 var type, i = 0, match, namespaces, pretype,2529 selector = origselector || this.selector,2530 context = origselector ? this : jquery( this.context );2531 if ( typeof types === "object" && !types.preventdefault ) {2532 for ( var key in types ) {2533 context[ name ]( key, data, types[key], selector );2534 }2535 return this;2536 }2537 if ( jquery.isfunction( data ) ) {2538 fn = data;2539 data = undefined;2540 }2541 types = (types || "").split(" ");2542 while ( (type = types[ i++ ]) != null ) {2543 match = rnamespaces.exec( type );2544 namespaces = "";2545 if ( match ) {2546 namespaces = match[0];2547 type = type.replace( rnamespaces, "" );2548 }2549 if ( type === "hover" ) {2550 types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );2551 continue;2552 }2553 pretype = type;2554 if ( type === "focus" || type === "blur" ) {2555 types.push( livemap[ type ] + namespaces );2556 type = type + namespaces;2557 } else {2558 type = (livemap[ type ] || type) + namespaces;2559 }2560 if ( name === "live" ) {2561 // bind live handler2562 for ( var j = 0, l = context.length; j < l; j++ ) {2563 jquery.event.add( context[j], "live." + liveconvert( type, selector ),2564 { data: data, selector: selector, handler: fn, origtype: type, orighandler: fn, pretype: pretype } );2565 }2566 } else {2567 // unbind live handler2568 context.unbind( "live." + liveconvert( type, selector ), fn );2569 }2570 }2571 return this;2572 };2573});2574function livehandler( event ) {2575 var stop, maxlevel, related, match, handleobj, elem, j, i, l, data, close, namespace, ret,2576 elems = [],2577 selectors = [],2578 events = jquery._data( this, "events" );2579 // make sure we avoid non-left-click bubbling in firefox (#3861) and disabled elements in ie (#6911)2580 if ( event.livefired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {2581 return;2582 }2583 if ( event.namespace ) {2584 namespace = new regexp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");2585 }2586 event.livefired = this;2587 var live = events.live.slice(0);2588 for ( j = 0; j < live.length; j++ ) {2589 handleobj = live[j];2590 if ( handleobj.origtype.replace( rnamespaces, "" ) === event.type ) {2591 selectors.push( handleobj.selector );2592 } else {2593 live.splice( j--, 1 );2594 }2595 }2596 match = jquery( event.target ).closest( selectors, event.currenttarget );2597 for ( i = 0, l = match.length; i < l; i++ ) {2598 close = match[i];2599 for ( j = 0; j < live.length; j++ ) {2600 handleobj = live[j];2601 if ( close.selector === handleobj.selector && (!namespace || namespace.test( handleobj.namespace )) && !close.elem.disabled ) {2602 elem = close.elem;2603 related = null;2604 // those two events require additional checking2605 if ( handleobj.pretype === "mouseenter" || handleobj.pretype === "mouseleave" ) {2606 event.type = handleobj.pretype;2607 related = jquery( event.relatedtarget ).closest( handleobj.selector )[0];2608 }2609 if ( !related || related !== elem ) {2610 elems.push({ elem: elem, handleobj: handleobj, level: close.level });2611 }2612 }2613 }2614 }2615 for ( i = 0, l = elems.length; i < l; i++ ) {2616 match = elems[i];2617 if ( maxlevel && match.level > maxlevel ) {2618 break;2619 }2620 event.currenttarget = match.elem;2621 event.data = match.handleobj.data;2622 event.handleobj = match.handleobj;2623 ret = match.handleobj.orighandler.apply( match.elem, arguments );2624 if ( ret === false || event.ispropagationstopped() ) {2625 maxlevel = match.level;2626 if ( ret === false ) {2627 stop = false;2628 }2629 if ( event.isimmediatepropagationstopped() ) {2630 break;2631 }2632 }2633 }2634 return stop;2635}2636function liveconvert( type, selector ) {2637 return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");2638}2639jquery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +2640 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +2641 "change select submit keydown keypress keyup error").split(" "), function( i, name ) {2642 // handle event binding2643 jquery.fn[ name ] = function( data, fn ) {2644 if ( fn == null ) {2645 fn = data;2646 data = null;2647 }2648 return arguments.length > 0 ?2649 this.bind( name, data, fn ) :2650 this.trigger( name );2651 };2652 if ( jquery.attrfn ) {2653 jquery.attrfn[ name ] = true;2654 }2655});2656/*!2657 * sizzle css selector engine2658 * copyright 2011, the dojo foundation2659 * released under the mit, bsd, and gpl licenses.2660 * more information: http://sizzlejs.com/2661 */2662(function(){2663var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,2664 done = 0,2665 tostring = object.prototype.tostring,2666 hasduplicate = false,2667 basehasduplicate = true,2668 rbackslash = /\\/g,2669 rnonword = /\w/;2670// here we check if the javascript engine is using some sort of2671// optimization where it does not always call our comparision2672// function. if that is the case, discard the hasduplicate value.2673// thus far that includes google chrome.2674[0, 0].sort(function() {2675 basehasduplicate = false;2676 return 0;2677});2678var sizzle = function( selector, context, results, seed ) {2679 results = results || [];2680 context = context || document;2681 var origcontext = context;2682 if ( context.nodetype !== 1 && context.nodetype !== 9 ) {2683 return [];2684 }2685 2686 if ( !selector || typeof selector !== "string" ) {2687 return results;2688 }2689 var m, set, checkset, extra, ret, cur, pop, i,2690 prune = true,2691 contextxml = sizzle.isxml( context ),2692 parts = [],2693 sofar = selector;2694 2695 // reset the position of the chunker regexp (start from head)2696 do {2697 chunker.exec( "" );2698 m = chunker.exec( sofar );2699 if ( m ) {2700 sofar = m[3];2701 2702 parts.push( m[1] );2703 2704 if ( m[2] ) {2705 extra = m[3];2706 break;2707 }2708 }2709 } while ( m );2710 if ( parts.length > 1 && origpos.exec( selector ) ) {2711 if ( parts.length === 2 && expr.relative[ parts[0] ] ) {2712 set = posprocess( parts[0] + parts[1], context );2713 } else {2714 set = expr.relative[ parts[0] ] ?2715 [ context ] :2716 sizzle( parts.shift(), context );2717 while ( parts.length ) {2718 selector = parts.shift();2719 if ( expr.relative[ selector ] ) {2720 selector += parts.shift();2721 }2722 2723 set = posprocess( selector, set );2724 }2725 }2726 } else {2727 // take a shortcut and set the context if the root selector is an id2728 // (but not if it'll be faster if the inner selector is an id)2729 if ( !seed && parts.length > 1 && context.nodetype === 9 && !contextxml &&2730 expr.match.id.test(parts[0]) && !expr.match.id.test(parts[parts.length - 1]) ) {2731 ret = sizzle.find( parts.shift(), context, contextxml );2732 context = ret.expr ?2733 sizzle.filter( ret.expr, ret.set )[0] :2734 ret.set[0];2735 }2736 if ( context ) {2737 ret = seed ?2738 { expr: parts.pop(), set: makearray(seed) } :2739 sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentnode ? context.parentnode : context, contextxml );2740 set = ret.expr ?2741 sizzle.filter( ret.expr, ret.set ) :2742 ret.set;2743 if ( parts.length > 0 ) {2744 checkset = makearray( set );2745 } else {2746 prune = false;2747 }2748 while ( parts.length ) {2749 cur = parts.pop();2750 pop = cur;2751 if ( !expr.relative[ cur ] ) {2752 cur = "";2753 } else {2754 pop = parts.pop();2755 }2756 if ( pop == null ) {2757 pop = context;2758 }2759 expr.relative[ cur ]( checkset, pop, contextxml );2760 }2761 } else {2762 checkset = parts = [];2763 }2764 }2765 if ( !checkset ) {2766 checkset = set;2767 }2768 if ( !checkset ) {2769 sizzle.error( cur || selector );2770 }2771 if ( tostring.call(checkset) === "[object array]" ) {2772 if ( !prune ) {2773 results.push.apply( results, checkset );2774 } else if ( context && context.nodetype === 1 ) {2775 for ( i = 0; checkset[i] != null; i++ ) {2776 if ( checkset[i] && (checkset[i] === true || checkset[i].nodetype === 1 && sizzle.contains(context, checkset[i])) ) {2777 results.push( set[i] );2778 }2779 }2780 } else {2781 for ( i = 0; checkset[i] != null; i++ ) {2782 if ( checkset[i] && checkset[i].nodetype === 1 ) {2783 results.push( set[i] );2784 }2785 }2786 }2787 } else {2788 makearray( checkset, results );2789 }2790 if ( extra ) {2791 sizzle( extra, origcontext, results, seed );2792 sizzle.uniquesort( results );2793 }2794 return results;2795};2796sizzle.uniquesort = function( results ) {2797 if ( sortorder ) {2798 hasduplicate = basehasduplicate;2799 results.sort( sortorder );2800 if ( hasduplicate ) {2801 for ( var i = 1; i < results.length; i++ ) {2802 if ( results[i] === results[ i - 1 ] ) {2803 results.splice( i--, 1 );2804 }2805 }2806 }2807 }2808 return results;2809};2810sizzle.matches = function( expr, set ) {2811 return sizzle( expr, null, null, set );2812};2813sizzle.matchesselector = function( node, expr ) {2814 return sizzle( expr, null, null, [node] ).length > 0;2815};2816sizzle.find = function( expr, context, isxml ) {2817 var set;2818 if ( !expr ) {2819 return [];2820 }2821 for ( var i = 0, l = expr.order.length; i < l; i++ ) {2822 var match,2823 type = expr.order[i];2824 2825 if ( (match = expr.leftmatch[ type ].exec( expr )) ) {2826 var left = match[1];2827 match.splice( 1, 1 );2828 if ( left.substr( left.length - 1 ) !== "\\" ) {2829 match[1] = (match[1] || "").replace( rbackslash, "" );2830 set = expr.find[ type ]( match, context, isxml );2831 if ( set != null ) {2832 expr = expr.replace( expr.match[ type ], "" );2833 break;2834 }2835 }2836 }2837 }2838 if ( !set ) {2839 set = typeof context.getelementsbytagname !== "undefined" ?2840 context.getelementsbytagname( "*" ) :2841 [];2842 }2843 return { set: set, expr: expr };2844};2845sizzle.filter = function( expr, set, inplace, not ) {2846 var match, anyfound,2847 old = expr,2848 result = [],2849 curloop = set,2850 isxmlfilter = set && set[0] && sizzle.isxml( set[0] );2851 while ( expr && set.length ) {2852 for ( var type in expr.filter ) {2853 if ( (match = expr.leftmatch[ type ].exec( expr )) != null && match[2] ) {2854 var found, item,2855 filter = expr.filter[ type ],2856 left = match[1];2857 anyfound = false;2858 match.splice(1,1);2859 if ( left.substr( left.length - 1 ) === "\\" ) {2860 continue;2861 }2862 if ( curloop === result ) {2863 result = [];2864 }2865 if ( expr.prefilter[ type ] ) {2866 match = expr.prefilter[ type ]( match, curloop, inplace, result, not, isxmlfilter );2867 if ( !match ) {2868 anyfound = found = true;2869 } else if ( match === true ) {2870 continue;2871 }2872 }2873 if ( match ) {2874 for ( var i = 0; (item = curloop[i]) != null; i++ ) {2875 if ( item ) {2876 found = filter( item, match, i, curloop );2877 var pass = not ^ !!found;2878 if ( inplace && found != null ) {2879 if ( pass ) {2880 anyfound = true;2881 } else {2882 curloop[i] = false;2883 }2884 } else if ( pass ) {2885 result.push( item );2886 anyfound = true;2887 }2888 }2889 }2890 }2891 if ( found !== undefined ) {2892 if ( !inplace ) {2893 curloop = result;2894 }2895 expr = expr.replace( expr.match[ type ], "" );2896 if ( !anyfound ) {2897 return [];2898 }2899 break;2900 }2901 }2902 }2903 // improper expression2904 if ( expr === old ) {2905 if ( anyfound == null ) {2906 sizzle.error( expr );2907 } else {2908 break;2909 }2910 }2911 old = expr;2912 }2913 return curloop;2914};2915sizzle.error = function( msg ) {2916 throw "syntax error, unrecognized expression: " + msg;2917};2918var expr = sizzle.selectors = {2919 order: [ "id", "name", "tag" ],2920 match: {2921 id: /#((?:[\w\u00c0-\uffff\-]|\\.)+)/,2922 class: /\.((?:[\w\u00c0-\uffff\-]|\\.)+)/,2923 name: /\[name=['"]*((?:[\w\u00c0-\uffff\-]|\\.)+)['"]*\]/,2924 attr: /\[\s*((?:[\w\u00c0-\uffff\-]|\\.)+)\s*(?:(\s?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uffff\-]|\\.)*)|)|)\s*\]/,2925 tag: /^((?:[\w\u00c0-\uffff\*\-]|\\.)+)/,2926 child: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,2927 pos: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,2928 pseudo: /:((?:[\w\u00c0-\uffff\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/2929 },2930 leftmatch: {},2931 attrmap: {2932 "class": "classname",2933 "for": "htmlfor"2934 },2935 attrhandle: {2936 href: function( elem ) {2937 return elem.getattribute( "href" );2938 },2939 type: function( elem ) {2940 return elem.getattribute( "type" );2941 }2942 },2943 relative: {2944 "+": function(checkset, part){2945 var ispartstr = typeof part === "string",2946 istag = ispartstr && !rnonword.test( part ),2947 ispartstrnottag = ispartstr && !istag;2948 if ( istag ) {2949 part = part.tolowercase();2950 }2951 for ( var i = 0, l = checkset.length, elem; i < l; i++ ) {2952 if ( (elem = checkset[i]) ) {2953 while ( (elem = elem.previoussibling) && elem.nodetype !== 1 ) {}2954 checkset[i] = ispartstrnottag || elem && elem.nodename.tolowercase() === part ?2955 elem || false :2956 elem === part;2957 }2958 }2959 if ( ispartstrnottag ) {2960 sizzle.filter( part, checkset, true );2961 }2962 },2963 ">": function( checkset, part ) {2964 var elem,2965 ispartstr = typeof part === "string",2966 i = 0,2967 l = checkset.length;2968 if ( ispartstr && !rnonword.test( part ) ) {2969 part = part.tolowercase();2970 for ( ; i < l; i++ ) {2971 elem = checkset[i];2972 if ( elem ) {2973 var parent = elem.parentnode;2974 checkset[i] = parent.nodename.tolowercase() === part ? parent : false;2975 }2976 }2977 } else {2978 for ( ; i < l; i++ ) {2979 elem = checkset[i];2980 if ( elem ) {2981 checkset[i] = ispartstr ?2982 elem.parentnode :2983 elem.parentnode === part;2984 }2985 }2986 if ( ispartstr ) {2987 sizzle.filter( part, checkset, true );2988 }2989 }2990 },2991 "": function(checkset, part, isxml){2992 var nodecheck,2993 donename = done++,2994 checkfn = dircheck;2995 if ( typeof part === "string" && !rnonword.test( part ) ) {2996 part = part.tolowercase();2997 nodecheck = part;2998 checkfn = dirnodecheck;2999 }3000 checkfn( "parentnode", part, donename, checkset, nodecheck, isxml );3001 },3002 "~": function( checkset, part, isxml ) {3003 var nodecheck,3004 donename = done++,3005 checkfn = dircheck;3006 if ( typeof part === "string" && !rnonword.test( part ) ) {3007 part = part.tolowercase();3008 nodecheck = part;3009 checkfn = dirnodecheck;3010 }3011 checkfn( "previoussibling", part, donename, checkset, nodecheck, isxml );3012 }3013 },3014 find: {3015 id: function( match, context, isxml ) {3016 if ( typeof context.getelementbyid !== "undefined" && !isxml ) {3017 var m = context.getelementbyid(match[1]);3018 // check parentnode to catch when blackberry 4.6 returns3019 // nodes that are no longer in the document #69633020 return m && m.parentnode ? [m] : [];3021 }3022 },3023 name: function( match, context ) {3024 if ( typeof context.getelementsbyname !== "undefined" ) {3025 var ret = [],3026 results = context.getelementsbyname( match[1] );3027 for ( var i = 0, l = results.length; i < l; i++ ) {3028 if ( results[i].getattribute("name") === match[1] ) {3029 ret.push( results[i] );3030 }3031 }3032 return ret.length === 0 ? null : ret;3033 }3034 },3035 tag: function( match, context ) {3036 if ( typeof context.getelementsbytagname !== "undefined" ) {3037 return context.getelementsbytagname( match[1] );3038 }3039 }3040 },3041 prefilter: {3042 class: function( match, curloop, inplace, result, not, isxml ) {3043 match = " " + match[1].replace( rbackslash, "" ) + " ";3044 if ( isxml ) {3045 return match;3046 }3047 for ( var i = 0, elem; (elem = curloop[i]) != null; i++ ) {3048 if ( elem ) {3049 if ( not ^ (elem.classname && (" " + elem.classname + " ").replace(/[\t\n\r]/g, " ").indexof(match) >= 0) ) {3050 if ( !inplace ) {3051 result.push( elem );3052 }3053 } else if ( inplace ) {3054 curloop[i] = false;3055 }3056 }3057 }3058 return false;3059 },3060 id: function( match ) {3061 return match[1].replace( rbackslash, "" );3062 },3063 tag: function( match, curloop ) {3064 return match[1].replace( rbackslash, "" ).tolowercase();3065 },3066 child: function( match ) {3067 if ( match[1] === "nth" ) {3068 if ( !match[2] ) {3069 sizzle.error( match[0] );3070 }3071 match[2] = match[2].replace(/^\+|\s*/g, '');3072 // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'3073 var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(3074 match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||3075 !/\d/.test( match[2] ) && "0n+" + match[2] || match[2]);3076 // calculate the numbers (first)n+(last) including if they are negative3077 match[2] = (test[1] + (test[2] || 1)) - 0;3078 match[3] = test[3] - 0;3079 }3080 else if ( match[2] ) {3081 sizzle.error( match[0] );3082 }3083 // todo: move to normal caching system3084 match[0] = done++;3085 return match;3086 },3087 attr: function( match, curloop, inplace, result, not, isxml ) {3088 var name = match[1] = match[1].replace( rbackslash, "" );3089 3090 if ( !isxml && expr.attrmap[name] ) {3091 match[1] = expr.attrmap[name];3092 }3093 // handle if an un-quoted value was used3094 match[4] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );3095 if ( match[2] === "~=" ) {3096 match[4] = " " + match[4] + " ";3097 }3098 return match;3099 },3100 pseudo: function( match, curloop, inplace, result, not ) {3101 if ( match[1] === "not" ) {3102 // if we're dealing with a complex expression, or a simple one3103 if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {3104 match[3] = sizzle(match[3], null, null, curloop);3105 } else {3106 var ret = sizzle.filter(match[3], curloop, inplace, true ^ not);3107 if ( !inplace ) {3108 result.push.apply( result, ret );3109 }3110 return false;3111 }3112 } else if ( expr.match.pos.test( match[0] ) || expr.match.child.test( match[0] ) ) {3113 return true;3114 }3115 3116 return match;3117 },3118 pos: function( match ) {3119 match.unshift( true );3120 return match;3121 }3122 },3123 3124 filters: {3125 enabled: function( elem ) {3126 return elem.disabled === false && elem.type !== "hidden";3127 },3128 disabled: function( elem ) {3129 return elem.disabled === true;3130 },3131 checked: function( elem ) {3132 return elem.checked === true;3133 },3134 3135 selected: function( elem ) {3136 // accessing this property makes selected-by-default3137 // options in safari work properly3138 if ( elem.parentnode ) {3139 elem.parentnode.selectedindex;3140 }3141 3142 return elem.selected === true;3143 },3144 parent: function( elem ) {3145 return !!elem.firstchild;3146 },3147 empty: function( elem ) {3148 return !elem.firstchild;3149 },3150 has: function( elem, i, match ) {3151 return !!sizzle( match[3], elem ).length;3152 },3153 header: function( elem ) {3154 return (/h\d/i).test( elem.nodename );3155 },3156 text: function( elem ) {3157 // ie6 and 7 will map elem.type to 'text' for new html5 types (search, etc) 3158 // use getattribute instead to test this case3159 return "text" === elem.getattribute( 'type' );3160 },3161 radio: function( elem ) {3162 return "radio" === elem.type;3163 },3164 checkbox: function( elem ) {3165 return "checkbox" === elem.type;3166 },3167 file: function( elem ) {3168 return "file" === elem.type;3169 },3170 password: function( elem ) {3171 return "password" === elem.type;3172 },3173 submit: function( elem ) {3174 return "submit" === elem.type;3175 },3176 image: function( elem ) {3177 return "image" === elem.type;3178 },3179 reset: function( elem ) {3180 return "reset" === elem.type;3181 },3182 button: function( elem ) {3183 return "button" === elem.type || elem.nodename.tolowercase() === "button";3184 },3185 input: function( elem ) {3186 return (/input|select|textarea|button/i).test( elem.nodename );3187 }3188 },3189 setfilters: {3190 first: function( elem, i ) {3191 return i === 0;3192 },3193 last: function( elem, i, match, array ) {3194 return i === array.length - 1;3195 },3196 even: function( elem, i ) {3197 return i % 2 === 0;3198 },3199 odd: function( elem, i ) {3200 return i % 2 === 1;3201 },3202 lt: function( elem, i, match ) {3203 return i < match[3] - 0;3204 },3205 gt: function( elem, i, match ) {3206 return i > match[3] - 0;3207 },3208 nth: function( elem, i, match ) {3209 return match[3] - 0 === i;3210 },3211 eq: function( elem, i, match ) {3212 return match[3] - 0 === i;3213 }3214 },3215 filter: {3216 pseudo: function( elem, match, i, array ) {3217 var name = match[1],3218 filter = expr.filters[ name ];3219 if ( filter ) {3220 return filter( elem, i, match, array );3221 } else if ( name === "contains" ) {3222 return (elem.textcontent || elem.innertext || sizzle.gettext([ elem ]) || "").indexof(match[3]) >= 0;3223 } else if ( name === "not" ) {3224 var not = match[3];3225 for ( var j = 0, l = not.length; j < l; j++ ) {3226 if ( not[j] === elem ) {3227 return false;3228 }3229 }3230 return true;3231 } else {3232 sizzle.error( name );3233 }3234 },3235 child: function( elem, match ) {3236 var type = match[1],3237 node = elem;3238 switch ( type ) {3239 case "only":3240 case "first":3241 while ( (node = node.previoussibling) ) {3242 if ( node.nodetype === 1 ) { 3243 return false; 3244 }3245 }3246 if ( type === "first" ) { 3247 return true; 3248 }3249 node = elem;3250 case "last":3251 while ( (node = node.nextsibling) ) {3252 if ( node.nodetype === 1 ) { 3253 return false; 3254 }3255 }3256 return true;3257 case "nth":3258 var first = match[2],3259 last = match[3];3260 if ( first === 1 && last === 0 ) {3261 return true;3262 }3263 3264 var donename = match[0],3265 parent = elem.parentnode;3266 3267 if ( parent && (parent.sizcache !== donename || !elem.nodeindex) ) {3268 var count = 0;3269 3270 for ( node = parent.firstchild; node; node = node.nextsibling ) {3271 if ( node.nodetype === 1 ) {3272 node.nodeindex = ++count;3273 }3274 } 3275 parent.sizcache = donename;3276 }3277 3278 var diff = elem.nodeindex - last;3279 if ( first === 0 ) {3280 return diff === 0;3281 } else {3282 return ( diff % first === 0 && diff / first >= 0 );3283 }3284 }3285 },3286 id: function( elem, match ) {3287 return elem.nodetype === 1 && elem.getattribute("id") === match;3288 },3289 tag: function( elem, match ) {3290 return (match === "*" && elem.nodetype === 1) || elem.nodename.tolowercase() === match;3291 },3292 3293 class: function( elem, match ) {3294 return (" " + (elem.classname || elem.getattribute("class")) + " ")3295 .indexof( match ) > -1;3296 },3297 attr: function( elem, match ) {3298 var name = match[1],3299 result = expr.attrhandle[ name ] ?3300 expr.attrhandle[ name ]( elem ) :3301 elem[ name ] != null ?3302 elem[ name ] :3303 elem.getattribute( name ),3304 value = result + "",3305 type = match[2],3306 check = match[4];3307 return result == null ?3308 type === "!=" :3309 type === "=" ?3310 value === check :3311 type === "*=" ?3312 value.indexof(check) >= 0 :3313 type === "~=" ?3314 (" " + value + " ").indexof(check) >= 0 :3315 !check ?3316 value && result !== false :3317 type === "!=" ?3318 value !== check :3319 type === "^=" ?3320 value.indexof(check) === 0 :3321 type === "$=" ?3322 value.substr(value.length - check.length) === check :3323 type === "|=" ?3324 value === check || value.substr(0, check.length + 1) === check + "-" :3325 false;3326 },3327 pos: function( elem, match, i, array ) {3328 var name = match[2],3329 filter = expr.setfilters[ name ];3330 if ( filter ) {3331 return filter( elem, i, match, array );3332 }3333 }3334 }3335};3336var origpos = expr.match.pos,3337 fescape = function(all, num){3338 return "\\" + (num - 0 + 1);3339 };3340for ( var type in expr.match ) {3341 expr.match[ type ] = new regexp( expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );3342 expr.leftmatch[ type ] = new regexp( /(^(?:.|\r|\n)*?)/.source + expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );3343}3344var makearray = function( array, results ) {3345 array = array.prototype.slice.call( array, 0 );3346 if ( results ) {3347 results.push.apply( results, array );3348 return results;3349 }3350 3351 return array;3352};3353// perform a simple check to determine if the browser is capable of3354// converting a nodelist to an array using builtin methods.3355// also verifies that the returned array holds dom nodes3356// (which is not the case in the blackberry browser)3357try {3358 array.prototype.slice.call( document.documentelement.childnodes, 0 )[0].nodetype;3359// provide a fallback method if it does not work3360} catch( e ) {3361 makearray = function( array, results ) {3362 var i = 0,3363 ret = results || [];3364 if ( tostring.call(array) === "[object array]" ) {3365 array.prototype.push.apply( ret, array );3366 } else {3367 if ( typeof array.length === "number" ) {3368 for ( var l = array.length; i < l; i++ ) {3369 ret.push( array[i] );3370 }3371 } else {3372 for ( ; array[i]; i++ ) {3373 ret.push( array[i] );3374 }3375 }3376 }3377 return ret;3378 };3379}3380var sortorder, siblingcheck;3381if ( document.documentelement.comparedocumentposition ) {3382 sortorder = function( a, b ) {3383 if ( a === b ) {3384 hasduplicate = true;3385 return 0;3386 }3387 if ( !a.comparedocumentposition || !b.comparedocumentposition ) {3388 return a.comparedocumentposition ? -1 : 1;3389 }3390 return a.comparedocumentposition(b) & 4 ? -1 : 1;3391 };3392} else {3393 sortorder = function( a, b ) {3394 var al, bl,3395 ap = [],3396 bp = [],3397 aup = a.parentnode,3398 bup = b.parentnode,3399 cur = aup;3400 // the nodes are identical, we can exit early3401 if ( a === b ) {3402 hasduplicate = true;3403 return 0;3404 // if the nodes are siblings (or identical) we can do a quick check3405 } else if ( aup === bup ) {3406 return siblingcheck( a, b );3407 // if no parents were found then the nodes are disconnected3408 } else if ( !aup ) {3409 return -1;3410 } else if ( !bup ) {3411 return 1;3412 }3413 // otherwise they're somewhere else in the tree so we need3414 // to build up a full list of the parentnodes for comparison3415 while ( cur ) {3416 ap.unshift( cur );3417 cur = cur.parentnode;3418 }3419 cur = bup;3420 while ( cur ) {3421 bp.unshift( cur );3422 cur = cur.parentnode;3423 }3424 al = ap.length;3425 bl = bp.length;3426 // start walking down the tree looking for a discrepancy3427 for ( var i = 0; i < al && i < bl; i++ ) {3428 if ( ap[i] !== bp[i] ) {3429 return siblingcheck( ap[i], bp[i] );3430 }3431 }3432 // we ended someplace up the tree so do a sibling check3433 return i === al ?3434 siblingcheck( a, bp[i], -1 ) :3435 siblingcheck( ap[i], b, 1 );3436 };3437 siblingcheck = function( a, b, ret ) {3438 if ( a === b ) {3439 return ret;3440 }3441 var cur = a.nextsibling;3442 while ( cur ) {3443 if ( cur === b ) {3444 return -1;3445 }3446 cur = cur.nextsibling;3447 }3448 return 1;3449 };3450}3451// utility function for retreiving the text value of an array of dom nodes3452sizzle.gettext = function( elems ) {3453 var ret = "", elem;3454 for ( var i = 0; elems[i]; i++ ) {3455 elem = elems[i];3456 // get the text from text nodes and cdata nodes3457 if ( elem.nodetype === 3 || elem.nodetype === 4 ) {3458 ret += elem.nodevalue;3459 // traverse everything else, except comment nodes3460 } else if ( elem.nodetype !== 8 ) {3461 ret += sizzle.gettext( elem.childnodes );3462 }3463 }3464 return ret;3465};3466// check to see if the browser returns elements by name when3467// querying by getelementbyid (and provide a workaround)3468(function(){3469 // we're going to inject a fake input element with a specified name3470 var form = document.createelement("div"),3471 id = "script" + (new date()).gettime(),3472 root = document.documentelement;3473 form.innerhtml = "<a name='" + id + "'/>";3474 // inject it into the root element, check its status, and remove it quickly3475 root.insertbefore( form, root.firstchild );3476 // the workaround has to do additional checks after a getelementbyid3477 // which slows things down for other browsers (hence the branching)3478 if ( document.getelementbyid( id ) ) {3479 expr.find.id = function( match, context, isxml ) {3480 if ( typeof context.getelementbyid !== "undefined" && !isxml ) {3481 var m = context.getelementbyid(match[1]);3482 return m ?3483 m.id === match[1] || typeof m.getattributenode !== "undefined" && m.getattributenode("id").nodevalue === match[1] ?3484 [m] :3485 undefined :3486 [];3487 }3488 };3489 expr.filter.id = function( elem, match ) {3490 var node = typeof elem.getattributenode !== "undefined" && elem.getattributenode("id");3491 return elem.nodetype === 1 && node && node.nodevalue === match;3492 };3493 }3494 root.removechild( form );3495 // release memory in ie3496 root = form = null;3497})();3498(function(){3499 // check to see if the browser returns only elements3500 // when doing getelementsbytagname("*")3501 // create a fake element3502 var div = document.createelement("div");3503 div.appendchild( document.createcomment("") );3504 // make sure no comments are found3505 if ( div.getelementsbytagname("*").length > 0 ) {3506 expr.find.tag = function( match, context ) {3507 var results = context.getelementsbytagname( match[1] );3508 // filter out possible comments3509 if ( match[1] === "*" ) {3510 var tmp = [];3511 for ( var i = 0; results[i]; i++ ) {3512 if ( results[i].nodetype === 1 ) {3513 tmp.push( results[i] );3514 }3515 }3516 results = tmp;3517 }3518 return results;3519 };3520 }3521 // check to see if an attribute returns normalized href attributes3522 div.innerhtml = "<a href='#'></a>";3523 if ( div.firstchild && typeof div.firstchild.getattribute !== "undefined" &&3524 div.firstchild.getattribute("href") !== "#" ) {3525 expr.attrhandle.href = function( elem ) {3526 return elem.getattribute( "href", 2 );3527 };3528 }3529 // release memory in ie3530 div = null;3531})();3532if ( document.queryselectorall ) {3533 (function(){3534 var oldsizzle = sizzle,3535 div = document.createelement("div"),3536 id = "__sizzle__";3537 div.innerhtml = "<p class='test'></p>";3538 // safari can't handle uppercase or unicode characters when3539 // in quirks mode.3540 if ( div.queryselectorall && div.queryselectorall(".test").length === 0 ) {3541 return;3542 }3543 3544 sizzle = function( query, context, extra, seed ) {3545 context = context || document;3546 // only use queryselectorall on non-xml documents3547 // (id selectors don't work in non-html documents)3548 if ( !seed && !sizzle.isxml(context) ) {3549 // see if we find a selector to speed up3550 var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );3551 3552 if ( match && (context.nodetype === 1 || context.nodetype === 9) ) {3553 // speed-up: sizzle("tag")3554 if ( match[1] ) {3555 return makearray( context.getelementsbytagname( query ), extra );3556 3557 // speed-up: sizzle(".class")3558 } else if ( match[2] && expr.find.class && context.getelementsbyclassname ) {3559 return makearray( context.getelementsbyclassname( match[2] ), extra );3560 }3561 }3562 3563 if ( context.nodetype === 9 ) {3564 // speed-up: sizzle("body")3565 // the body element only exists once, optimize finding it3566 if ( query === "body" && context.body ) {3567 return makearray( [ context.body ], extra );3568 3569 // speed-up: sizzle("#id")3570 } else if ( match && match[3] ) {3571 var elem = context.getelementbyid( match[3] );3572 // check parentnode to catch when blackberry 4.6 returns3573 // nodes that are no longer in the document #69633574 if ( elem && elem.parentnode ) {3575 // handle the case where ie and opera return items3576 // by name instead of id3577 if ( elem.id === match[3] ) {3578 return makearray( [ elem ], extra );3579 }3580 3581 } else {3582 return makearray( [], extra );3583 }3584 }3585 3586 try {3587 return makearray( context.queryselectorall(query), extra );3588 } catch(qsaerror) {}3589 // qsa works strangely on element-rooted queries3590 // we can work around this by specifying an extra id on the root3591 // and working up from there (thanks to andrew dupont for the technique)3592 // ie 8 doesn't work on object elements3593 } else if ( context.nodetype === 1 && context.nodename.tolowercase() !== "object" ) {3594 var oldcontext = context,3595 old = context.getattribute( "id" ),3596 nid = old || id,3597 hasparent = context.parentnode,3598 relativehierarchyselector = /^\s*[+~]/.test( query );3599 if ( !old ) {3600 context.setattribute( "id", nid );3601 } else {3602 nid = nid.replace( /'/g, "\\$&" );3603 }3604 if ( relativehierarchyselector && hasparent ) {3605 context = context.parentnode;3606 }3607 try {3608 if ( !relativehierarchyselector || hasparent ) {3609 return makearray( context.queryselectorall( "[id='" + nid + "'] " + query ), extra );3610 }3611 } catch(pseudoerror) {3612 } finally {3613 if ( !old ) {3614 oldcontext.removeattribute( "id" );3615 }3616 }3617 }3618 }3619 3620 return oldsizzle(query, context, extra, seed);3621 };3622 for ( var prop in oldsizzle ) {3623 sizzle[ prop ] = oldsizzle[ prop ];3624 }3625 // release memory in ie3626 div = null;3627 })();3628}3629(function(){3630 var html = document.documentelement,3631 matches = html.matchesselector || html.mozmatchesselector || html.webkitmatchesselector || html.msmatchesselector,3632 pseudoworks = false;3633 try {3634 // this should fail with an exception3635 // gecko does not error, returns false instead3636 matches.call( document.documentelement, "[test!='']:sizzle" );3637 3638 } catch( pseudoerror ) {3639 pseudoworks = true;3640 }3641 if ( matches ) {3642 sizzle.matchesselector = function( node, expr ) {3643 // make sure that attribute selectors are quoted3644 expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");3645 if ( !sizzle.isxml( node ) ) {3646 try { 3647 if ( pseudoworks || !expr.match.pseudo.test( expr ) && !/!=/.test( expr ) ) {3648 return matches.call( node, expr );3649 }3650 } catch(e) {}3651 }3652 return sizzle(expr, null, null, [node]).length > 0;3653 };3654 }3655})();3656(function(){3657 var div = document.createelement("div");3658 div.innerhtml = "<div class='test e'></div><div class='test'></div>";3659 // opera can't find a second classname (in 9.6)3660 // also, make sure that getelementsbyclassname actually exists3661 if ( !div.getelementsbyclassname || div.getelementsbyclassname("e").length === 0 ) {3662 return;3663 }3664 // safari caches class attributes, doesn't catch changes (in 3.2)3665 div.lastchild.classname = "e";3666 if ( div.getelementsbyclassname("e").length === 1 ) {3667 return;3668 }3669 3670 expr.order.splice(1, 0, "class");3671 expr.find.class = function( match, context, isxml ) {3672 if ( typeof context.getelementsbyclassname !== "undefined" && !isxml ) {3673 return context.getelementsbyclassname(match[1]);3674 }3675 };3676 // release memory in ie3677 div = null;3678})();3679function dirnodecheck( dir, cur, donename, checkset, nodecheck, isxml ) {3680 for ( var i = 0, l = checkset.length; i < l; i++ ) {3681 var elem = checkset[i];3682 if ( elem ) {3683 var match = false;3684 elem = elem[dir];3685 while ( elem ) {3686 if ( elem.sizcache === donename ) {3687 match = checkset[elem.sizset];3688 break;3689 }3690 if ( elem.nodetype === 1 && !isxml ){3691 elem.sizcache = donename;3692 elem.sizset = i;3693 }3694 if ( elem.nodename.tolowercase() === cur ) {3695 match = elem;3696 break;3697 }3698 elem = elem[dir];3699 }3700 checkset[i] = match;3701 }3702 }3703}3704function dircheck( dir, cur, donename, checkset, nodecheck, isxml ) {3705 for ( var i = 0, l = checkset.length; i < l; i++ ) {3706 var elem = checkset[i];3707 if ( elem ) {3708 var match = false;3709 3710 elem = elem[dir];3711 while ( elem ) {3712 if ( elem.sizcache === donename ) {3713 match = checkset[elem.sizset];3714 break;3715 }3716 if ( elem.nodetype === 1 ) {3717 if ( !isxml ) {3718 elem.sizcache = donename;3719 elem.sizset = i;3720 }3721 if ( typeof cur !== "string" ) {3722 if ( elem === cur ) {3723 match = true;3724 break;3725 }3726 } else if ( sizzle.filter( cur, [elem] ).length > 0 ) {3727 match = elem;3728 break;3729 }3730 }3731 elem = elem[dir];3732 }3733 checkset[i] = match;3734 }3735 }3736}3737if ( document.documentelement.contains ) {3738 sizzle.contains = function( a, b ) {3739 return a !== b && (a.contains ? a.contains(b) : true);3740 };3741} else if ( document.documentelement.comparedocumentposition ) {3742 sizzle.contains = function( a, b ) {3743 return !!(a.comparedocumentposition(b) & 16);3744 };3745} else {3746 sizzle.contains = function() {3747 return false;3748 };3749}3750sizzle.isxml = function( elem ) {3751 // documentelement is verified for cases where it doesn't yet exist3752 // (such as loading iframes in ie - #4833) 3753 var documentelement = (elem ? elem.ownerdocument || elem : 0).documentelement;3754 return documentelement ? documentelement.nodename !== "html" : false;3755};3756var posprocess = function( selector, context ) {3757 var match,3758 tmpset = [],3759 later = "",3760 root = context.nodetype ? [context] : context;3761 // position selectors must be done after the filter3762 // and so must :not(positional) so we move all pseudos to the end3763 while ( (match = expr.match.pseudo.exec( selector )) ) {3764 later += match[0];3765 selector = selector.replace( expr.match.pseudo, "" );3766 }3767 selector = expr.relative[selector] ? selector + "*" : selector;3768 for ( var i = 0, l = root.length; i < l; i++ ) {3769 sizzle( selector, root[i], tmpset );3770 }3771 return sizzle.filter( later, tmpset );3772};3773// expose3774jquery.find = sizzle;3775jquery.expr = sizzle.selectors;3776jquery.expr[":"] = jquery.expr.filters;3777jquery.unique = sizzle.uniquesort;3778jquery.text = sizzle.gettext;3779jquery.isxmldoc = sizzle.isxml;3780jquery.contains = sizzle.contains;3781})();3782var runtil = /until$/,3783 rparentsprev = /^(?:parents|prevuntil|prevall)/,3784 // note: this regexp should be improved, or likely pulled from sizzle3785 rmultiselector = /,/,3786 issimple = /^.[^:#\[\.,]*$/,3787 slice = array.prototype.slice,3788 pos = jquery.expr.match.pos,3789 // methods guaranteed to produce a unique set when starting from a unique set3790 guaranteedunique = {3791 children: true,3792 contents: true,3793 next: true,3794 prev: true3795 };3796jquery.fn.extend({3797 find: function( selector ) {3798 var ret = this.pushstack( "", "find", selector ),3799 length = 0;3800 for ( var i = 0, l = this.length; i < l; i++ ) {3801 length = ret.length;3802 jquery.find( selector, this[i], ret );3803 if ( i > 0 ) {3804 // make sure that the results are unique3805 for ( var n = length; n < ret.length; n++ ) {3806 for ( var r = 0; r < length; r++ ) {3807 if ( ret[r] === ret[n] ) {3808 ret.splice(n--, 1);3809 break;3810 }3811 }3812 }3813 }3814 }3815 return ret;3816 },3817 has: function( target ) {3818 var targets = jquery( target );3819 return this.filter(function() {3820 for ( var i = 0, l = targets.length; i < l; i++ ) {3821 if ( jquery.contains( this, targets[i] ) ) {3822 return true;3823 }3824 }3825 });3826 },3827 not: function( selector ) {3828 return this.pushstack( winnow(this, selector, false), "not", selector);3829 },3830 filter: function( selector ) {3831 return this.pushstack( winnow(this, selector, true), "filter", selector );3832 },3833 is: function( selector ) {3834 return !!selector && jquery.filter( selector, this ).length > 0;3835 },3836 closest: function( selectors, context ) {3837 var ret = [], i, l, cur = this[0];3838 if ( jquery.isarray( selectors ) ) {3839 var match, selector,3840 matches = {},3841 level = 1;3842 if ( cur && selectors.length ) {3843 for ( i = 0, l = selectors.length; i < l; i++ ) {3844 selector = selectors[i];3845 if ( !matches[selector] ) {3846 matches[selector] = jquery.expr.match.pos.test( selector ) ?3847 jquery( selector, context || this.context ) :3848 selector;3849 }3850 }3851 while ( cur && cur.ownerdocument && cur !== context ) {3852 for ( selector in matches ) {3853 match = matches[selector];3854 if ( match.jquery ? match.index(cur) > -1 : jquery(cur).is(match) ) {3855 ret.push({ selector: selector, elem: cur, level: level });3856 }3857 }3858 cur = cur.parentnode;3859 level++;3860 }3861 }3862 return ret;3863 }3864 var pos = pos.test( selectors ) ?3865 jquery( selectors, context || this.context ) : null;3866 for ( i = 0, l = this.length; i < l; i++ ) {3867 cur = this[i];3868 while ( cur ) {3869 if ( pos ? pos.index(cur) > -1 : jquery.find.matchesselector(cur, selectors) ) {3870 ret.push( cur );3871 break;3872 } else {3873 cur = cur.parentnode;3874 if ( !cur || !cur.ownerdocument || cur === context ) {3875 break;3876 }3877 }3878 }3879 }3880 ret = ret.length > 1 ? jquery.unique(ret) : ret;3881 return this.pushstack( ret, "closest", selectors );3882 },3883 // determine the position of an element within3884 // the matched set of elements3885 index: function( elem ) {3886 if ( !elem || typeof elem === "string" ) {3887 return jquery.inarray( this[0],3888 // if it receives a string, the selector is used3889 // if it receives nothing, the siblings are used3890 elem ? jquery( elem ) : this.parent().children() );3891 }3892 // locate the position of the desired element3893 return jquery.inarray(3894 // if it receives a jquery object, the first element is used3895 elem.jquery ? elem[0] : elem, this );3896 },3897 add: function( selector, context ) {3898 var set = typeof selector === "string" ?3899 jquery( selector, context ) :3900 jquery.makearray( selector ),3901 all = jquery.merge( this.get(), set );3902 return this.pushstack( isdisconnected( set[0] ) || isdisconnected( all[0] ) ?3903 all :3904 jquery.unique( all ) );3905 },3906 andself: function() {3907 return this.add( this.prevobject );3908 }3909});3910// a painfully simple check to see if an element is disconnected3911// from a document (should be improved, where feasible).3912function isdisconnected( node ) {3913 return !node || !node.parentnode || node.parentnode.nodetype === 11;3914}3915jquery.each({3916 parent: function( elem ) {3917 var parent = elem.parentnode;3918 return parent && parent.nodetype !== 11 ? parent : null;3919 },3920 parents: function( elem ) {3921 return jquery.dir( elem, "parentnode" );3922 },3923 parentsuntil: function( elem, i, until ) {3924 return jquery.dir( elem, "parentnode", until );3925 },3926 next: function( elem ) {3927 return jquery.nth( elem, 2, "nextsibling" );3928 },3929 prev: function( elem ) {3930 return jquery.nth( elem, 2, "previoussibling" );3931 },3932 nextall: function( elem ) {3933 return jquery.dir( elem, "nextsibling" );3934 },3935 prevall: function( elem ) {3936 return jquery.dir( elem, "previoussibling" );3937 },3938 nextuntil: function( elem, i, until ) {3939 return jquery.dir( elem, "nextsibling", until );3940 },3941 prevuntil: function( elem, i, until ) {3942 return jquery.dir( elem, "previoussibling", until );3943 },3944 siblings: function( elem ) {3945 return jquery.sibling( elem.parentnode.firstchild, elem );3946 },3947 children: function( elem ) {3948 return jquery.sibling( elem.firstchild );3949 },3950 contents: function( elem ) {3951 return jquery.nodename( elem, "iframe" ) ?3952 elem.contentdocument || elem.contentwindow.document :3953 jquery.makearray( elem.childnodes );3954 }3955}, function( name, fn ) {3956 jquery.fn[ name ] = function( until, selector ) {3957 var ret = jquery.map( this, fn, until ),3958 // the variable 'args' was introduced in3959 // https://github.com/jquery/jquery/commit/52a02383960 // to work around a bug in chrome 10 (dev) and should be removed when the bug is fixed.3961 // http://code.google.com/p/v8/issues/detail?id=10503962 args = slice.call(arguments);3963 if ( !runtil.test( name ) ) {3964 selector = until;3965 }3966 if ( selector && typeof selector === "string" ) {3967 ret = jquery.filter( selector, ret );3968 }3969 ret = this.length > 1 && !guaranteedunique[ name ] ? jquery.unique( ret ) : ret;3970 if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {3971 ret = ret.reverse();3972 }3973 return this.pushstack( ret, name, args.join(",") );3974 };3975});3976jquery.extend({3977 filter: function( expr, elems, not ) {3978 if ( not ) {3979 expr = ":not(" + expr + ")";3980 }3981 return elems.length === 1 ?3982 jquery.find.matchesselector(elems[0], expr) ? [ elems[0] ] : [] :3983 jquery.find.matches(expr, elems);3984 },3985 dir: function( elem, dir, until ) {3986 var matched = [],3987 cur = elem[ dir ];3988 while ( cur && cur.nodetype !== 9 && (until === undefined || cur.nodetype !== 1 || !jquery( cur ).is( until )) ) {3989 if ( cur.nodetype === 1 ) {3990 matched.push( cur );3991 }3992 cur = cur[dir];3993 }3994 return matched;3995 },3996 nth: function( cur, result, dir, elem ) {3997 result = result || 1;3998 var num = 0;3999 for ( ; cur; cur = cur[dir] ) {4000 if ( cur.nodetype === 1 && ++num === result ) {4001 break;4002 }4003 }4004 return cur;4005 },4006 sibling: function( n, elem ) {4007 var r = [];4008 for ( ; n; n = n.nextsibling ) {4009 if ( n.nodetype === 1 && n !== elem ) {4010 r.push( n );4011 }4012 }4013 return r;4014 }4015});4016// implement the identical functionality for filter and not4017function winnow( elements, qualifier, keep ) {4018 if ( jquery.isfunction( qualifier ) ) {4019 return jquery.grep(elements, function( elem, i ) {4020 var retval = !!qualifier.call( elem, i, elem );4021 return retval === keep;4022 });4023 } else if ( qualifier.nodetype ) {4024 return jquery.grep(elements, function( elem, i ) {4025 return (elem === qualifier) === keep;4026 });4027 } else if ( typeof qualifier === "string" ) {4028 var filtered = jquery.grep(elements, function( elem ) {4029 return elem.nodetype === 1;4030 });4031 if ( issimple.test( qualifier ) ) {4032 return jquery.filter(qualifier, filtered, !keep);4033 } else {4034 qualifier = jquery.filter( qualifier, filtered );4035 }4036 }4037 return jquery.grep(elements, function( elem, i ) {4038 return (jquery.inarray( elem, qualifier ) >= 0) === keep;4039 });4040}4041var rinlinejquery = / jquery\d+="(?:\d+|null)"/g,4042 rleadingwhitespace = /^\s+/,4043 rxhtmltag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,4044 rtagname = /<([\w:]+)/,4045 rtbody = /<tbody/i,4046 rhtml = /<|&#?\w+;/,4047 rnocache = /<(?:script|object|embed|option|style)/i,4048 // checked="checked" or checked4049 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,4050 wrapmap = {4051 option: [ 1, "<select multiple='multiple'>", "</select>" ],4052 legend: [ 1, "<fieldset>", "</fieldset>" ],4053 thead: [ 1, "<table>", "</table>" ],4054 tr: [ 2, "<table><tbody>", "</tbody></table>" ],4055 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],4056 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],4057 area: [ 1, "<map>", "</map>" ],4058 _default: [ 0, "", "" ]4059 };4060wrapmap.optgroup = wrapmap.option;4061wrapmap.tbody = wrapmap.tfoot = wrapmap.colgroup = wrapmap.caption = wrapmap.thead;4062wrapmap.th = wrapmap.td;4063// ie can't serialize <link> and <script> tags normally4064if ( !jquery.support.htmlserialize ) {4065 wrapmap._default = [ 1, "div<div>", "</div>" ];4066}4067jquery.fn.extend({4068 text: function( text ) {4069 if ( jquery.isfunction(text) ) {4070 return this.each(function(i) {4071 var self = jquery( this );4072 self.text( text.call(this, i, self.text()) );4073 });4074 }4075 if ( typeof text !== "object" && text !== undefined ) {4076 return this.empty().append( (this[0] && this[0].ownerdocument || document).createtextnode( text ) );4077 }4078 return jquery.text( this );4079 },4080 wrapall: function( html ) {4081 if ( jquery.isfunction( html ) ) {4082 return this.each(function(i) {4083 jquery(this).wrapall( html.call(this, i) );4084 });4085 }4086 if ( this[0] ) {4087 // the elements to wrap the target around4088 var wrap = jquery( html, this[0].ownerdocument ).eq(0).clone(true);4089 if ( this[0].parentnode ) {4090 wrap.insertbefore( this[0] );4091 }4092 wrap.map(function() {4093 var elem = this;4094 while ( elem.firstchild && elem.firstchild.nodetype === 1 ) {4095 elem = elem.firstchild;4096 }4097 return elem;4098 }).append(this);4099 }4100 return this;4101 },4102 wrapinner: function( html ) {4103 if ( jquery.isfunction( html ) ) {4104 return this.each(function(i) {4105 jquery(this).wrapinner( html.call(this, i) );4106 });4107 }4108 return this.each(function() {4109 var self = jquery( this ),4110 contents = self.contents();4111 if ( contents.length ) {4112 contents.wrapall( html );4113 } else {4114 self.append( html );4115 }4116 });4117 },4118 wrap: function( html ) {4119 return this.each(function() {4120 jquery( this ).wrapall( html );4121 });4122 },4123 unwrap: function() {4124 return this.parent().each(function() {4125 if ( !jquery.nodename( this, "body" ) ) {4126 jquery( this ).replacewith( this.childnodes );4127 }4128 }).end();4129 },4130 append: function() {4131 return this.dommanip(arguments, true, function( elem ) {4132 if ( this.nodetype === 1 ) {4133 this.appendchild( elem );4134 }4135 });4136 },4137 prepend: function() {4138 return this.dommanip(arguments, true, function( elem ) {4139 if ( this.nodetype === 1 ) {4140 this.insertbefore( elem, this.firstchild );4141 }4142 });4143 },4144 before: function() {4145 if ( this[0] && this[0].parentnode ) {4146 return this.dommanip(arguments, false, function( elem ) {4147 this.parentnode.insertbefore( elem, this );4148 });4149 } else if ( arguments.length ) {4150 var set = jquery(arguments[0]);4151 set.push.apply( set, this.toarray() );4152 return this.pushstack( set, "before", arguments );4153 }4154 },4155 after: function() {4156 if ( this[0] && this[0].parentnode ) {4157 return this.dommanip(arguments, false, function( elem ) {4158 this.parentnode.insertbefore( elem, this.nextsibling );4159 });4160 } else if ( arguments.length ) {4161 var set = this.pushstack( this, "after", arguments );4162 set.push.apply( set, jquery(arguments[0]).toarray() );4163 return set;4164 }4165 },4166 // keepdata is for internal use only--do not document4167 remove: function( selector, keepdata ) {4168 for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {4169 if ( !selector || jquery.filter( selector, [ elem ] ).length ) {4170 if ( !keepdata && elem.nodetype === 1 ) {4171 jquery.cleandata( elem.getelementsbytagname("*") );4172 jquery.cleandata( [ elem ] );4173 }4174 if ( elem.parentnode ) {4175 elem.parentnode.removechild( elem );4176 }4177 }4178 }4179 return this;4180 },4181 empty: function() {4182 for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {4183 // remove element nodes and prevent memory leaks4184 if ( elem.nodetype === 1 ) {4185 jquery.cleandata( elem.getelementsbytagname("*") );4186 }4187 // remove any remaining nodes4188 while ( elem.firstchild ) {4189 elem.removechild( elem.firstchild );4190 }4191 }4192 return this;4193 },4194 clone: function( dataandevents, deepdataandevents ) {4195 dataandevents = dataandevents == null ? false : dataandevents;4196 deepdataandevents = deepdataandevents == null ? dataandevents : deepdataandevents;4197 return this.map( function () {4198 return jquery.clone( this, dataandevents, deepdataandevents );4199 });4200 },4201 html: function( value ) {4202 if ( value === undefined ) {4203 return this[0] && this[0].nodetype === 1 ?4204 this[0].innerhtml.replace(rinlinejquery, "") :4205 null;4206 // see if we can take a shortcut and just use innerhtml4207 } else if ( typeof value === "string" && !rnocache.test( value ) &&4208 (jquery.support.leadingwhitespace || !rleadingwhitespace.test( value )) &&4209 !wrapmap[ (rtagname.exec( value ) || ["", ""])[1].tolowercase() ] ) {4210 value = value.replace(rxhtmltag, "<$1></$2>");4211 try {4212 for ( var i = 0, l = this.length; i < l; i++ ) {4213 // remove element nodes and prevent memory leaks4214 if ( this[i].nodetype === 1 ) {4215 jquery.cleandata( this[i].getelementsbytagname("*") );4216 this[i].innerhtml = value;4217 }4218 }4219 // if using innerhtml throws an exception, use the fallback method4220 } catch(e) {4221 this.empty().append( value );4222 }4223 } else if ( jquery.isfunction( value ) ) {4224 this.each(function(i){4225 var self = jquery( this );4226 self.html( value.call(this, i, self.html()) );4227 });4228 } else {4229 this.empty().append( value );4230 }4231 return this;4232 },4233 replacewith: function( value ) {4234 if ( this[0] && this[0].parentnode ) {4235 // make sure that the elements are removed from the dom before they are inserted4236 // this can help fix replacing a parent with child elements4237 if ( jquery.isfunction( value ) ) {4238 return this.each(function(i) {4239 var self = jquery(this), old = self.html();4240 self.replacewith( value.call( this, i, old ) );4241 });4242 }4243 if ( typeof value !== "string" ) {4244 value = jquery( value ).detach();4245 }4246 return this.each(function() {4247 var next = this.nextsibling,4248 parent = this.parentnode;4249 jquery( this ).remove();4250 if ( next ) {4251 jquery(next).before( value );4252 } else {4253 jquery(parent).append( value );4254 }4255 });4256 } else {4257 return this.pushstack( jquery(jquery.isfunction(value) ? value() : value), "replacewith", value );4258 }4259 },4260 detach: function( selector ) {4261 return this.remove( selector, true );4262 },4263 dommanip: function( args, table, callback ) {4264 var results, first, fragment, parent,4265 value = args[0],4266 scripts = [];4267 // we can't clonenode fragments that contain checked, in webkit4268 if ( !jquery.support.checkclone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {4269 return this.each(function() {4270 jquery(this).dommanip( args, table, callback, true );4271 });4272 }4273 if ( jquery.isfunction(value) ) {4274 return this.each(function(i) {4275 var self = jquery(this);4276 args[0] = value.call(this, i, table ? self.html() : undefined);4277 self.dommanip( args, table, callback );4278 });4279 }4280 if ( this[0] ) {4281 parent = value && value.parentnode;4282 // if we're in a fragment, just use that instead of building a new one4283 if ( jquery.support.parentnode && parent && parent.nodetype === 11 && parent.childnodes.length === this.length ) {4284 results = { fragment: parent };4285 } else {4286 results = jquery.buildfragment( args, this, scripts );4287 }4288 fragment = results.fragment;4289 if ( fragment.childnodes.length === 1 ) {4290 first = fragment = fragment.firstchild;4291 } else {4292 first = fragment.firstchild;4293 }4294 if ( first ) {4295 table = table && jquery.nodename( first, "tr" );4296 for ( var i = 0, l = this.length, lastindex = l - 1; i < l; i++ ) {4297 callback.call(4298 table ?4299 root(this[i], first) :4300 this[i],4301 // make sure that we do not leak memory by inadvertently discarding4302 // the original fragment (which might have attached data) instead of4303 // using it; in addition, use the original fragment object for the last4304 // item instead of first because it can end up being emptied incorrectly4305 // in certain situations (bug #8070).4306 // fragments from the fragment cache must always be cloned and never used4307 // in place.4308 results.cacheable || (l > 1 && i < lastindex) ?4309 jquery.clone( fragment, true, true ) :4310 fragment4311 );4312 }4313 }4314 if ( scripts.length ) {4315 jquery.each( scripts, evalscript );4316 }4317 }4318 return this;4319 }4320});4321function root( elem, cur ) {4322 return jquery.nodename(elem, "table") ?4323 (elem.getelementsbytagname("tbody")[0] ||4324 elem.appendchild(elem.ownerdocument.createelement("tbody"))) :4325 elem;4326}4327function clonecopyevent( src, dest ) {4328 if ( dest.nodetype !== 1 || !jquery.hasdata( src ) ) {4329 return;4330 }4331 var internalkey = jquery.expando,4332 olddata = jquery.data( src ),4333 curdata = jquery.data( dest, olddata );4334 // switch to use the internal data object, if it exists, for the next4335 // stage of data copying4336 if ( (olddata = olddata[ internalkey ]) ) {4337 var events = olddata.events;4338 curdata = curdata[ internalkey ] = jquery.extend({}, olddata);4339 if ( events ) {4340 delete curdata.handle;4341 curdata.events = {};4342 for ( var type in events ) {4343 for ( var i = 0, l = events[ type ].length; i < l; i++ ) {4344 jquery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );4345 }4346 }4347 }4348 }4349}4350function clonefixattributes(src, dest) {4351 // we do not need to do anything for non-elements4352 if ( dest.nodetype !== 1 ) {4353 return;4354 }4355 var nodename = dest.nodename.tolowercase();4356 // clearattributes removes the attributes, which we don't want,4357 // but also removes the attachevent events, which we *do* want4358 dest.clearattributes();4359 // mergeattributes, in contrast, only merges back on the4360 // original attributes, not the events4361 dest.mergeattributes(src);4362 // ie6-8 fail to clone children inside object elements that use4363 // the proprietary classid attribute value (rather than the type4364 // attribute) to identify the type of content to display4365 if ( nodename === "object" ) {4366 dest.outerhtml = src.outerhtml;4367 } else if ( nodename === "input" && (src.type === "checkbox" || src.type === "radio") ) {4368 // ie6-8 fails to persist the checked state of a cloned checkbox4369 // or radio button. worse, ie6-7 fail to give the cloned element4370 // a checked appearance if the defaultchecked value isn't also set4371 if ( src.checked ) {4372 dest.defaultchecked = dest.checked = src.checked;4373 }4374 // ie6-7 get confused and end up setting the value of a cloned4375 // checkbox/radio button to an empty string instead of "on"4376 if ( dest.value !== src.value ) {4377 dest.value = src.value;4378 }4379 // ie6-8 fails to return the selected option to the default selected4380 // state when cloning options4381 } else if ( nodename === "option" ) {4382 dest.selected = src.defaultselected;4383 // ie6-8 fails to set the defaultvalue to the correct value when4384 // cloning other types of input fields4385 } else if ( nodename === "input" || nodename === "textarea" ) {4386 dest.defaultvalue = src.defaultvalue;4387 }4388 // event data gets referenced instead of copied if the expando4389 // gets copied too4390 dest.removeattribute( jquery.expando );4391}4392jquery.buildfragment = function( args, nodes, scripts ) {4393 var fragment, cacheable, cacheresults,4394 doc = (nodes && nodes[0] ? nodes[0].ownerdocument || nodes[0] : document);4395 // only cache "small" (1/2 kb) html strings that are associated with the main document4396 // cloning options loses the selected state, so don't cache them4397 // ie 6 doesn't like it when you put <object> or <embed> elements in a fragment4398 // also, webkit does not clone 'checked' attributes on clonenode, so don't cache4399 if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&4400 args[0].charat(0) === "<" && !rnocache.test( args[0] ) && (jquery.support.checkclone || !rchecked.test( args[0] )) ) {4401 cacheable = true;4402 cacheresults = jquery.fragments[ args[0] ];4403 if ( cacheresults ) {4404 if ( cacheresults !== 1 ) {4405 fragment = cacheresults;4406 }4407 }4408 }4409 if ( !fragment ) {4410 fragment = doc.createdocumentfragment();4411 jquery.clean( args, doc, fragment, scripts );4412 }4413 if ( cacheable ) {4414 jquery.fragments[ args[0] ] = cacheresults ? fragment : 1;4415 }4416 return { fragment: fragment, cacheable: cacheable };4417};4418jquery.fragments = {};4419jquery.each({4420 appendto: "append",4421 prependto: "prepend",4422 insertbefore: "before",4423 insertafter: "after",4424 replaceall: "replacewith"4425}, function( name, original ) {4426 jquery.fn[ name ] = function( selector ) {4427 var ret = [],4428 insert = jquery( selector ),4429 parent = this.length === 1 && this[0].parentnode;4430 if ( parent && parent.nodetype === 11 && parent.childnodes.length === 1 && insert.length === 1 ) {4431 insert[ original ]( this[0] );4432 return this;4433 } else {4434 for ( var i = 0, l = insert.length; i < l; i++ ) {4435 var elems = (i > 0 ? this.clone(true) : this).get();4436 jquery( insert[i] )[ original ]( elems );4437 ret = ret.concat( elems );4438 }4439 return this.pushstack( ret, name, insert.selector );4440 }4441 };4442});4443function getall( elem ) {4444 if ( "getelementsbytagname" in elem ) {4445 return elem.getelementsbytagname( "*" );4446 4447 } else if ( "queryselectorall" in elem ) {4448 return elem.queryselectorall( "*" );4449 } else {4450 return [];4451 }4452}4453jquery.extend({4454 clone: function( elem, dataandevents, deepdataandevents ) {4455 var clone = elem.clonenode(true),4456 srcelements,4457 destelements,4458 i;4459 if ( (!jquery.support.nocloneevent || !jquery.support.noclonechecked) &&4460 (elem.nodetype === 1 || elem.nodetype === 11) && !jquery.isxmldoc(elem) ) {4461 // ie copies events bound via attachevent when using clonenode.4462 // calling detachevent on the clone will also remove the events4463 // from the original. in order to get around this, we use some4464 // proprietary methods to clear the events. thanks to mootools4465 // guys for this hotness.4466 clonefixattributes( elem, clone );4467 // using sizzle here is crazy slow, so we use getelementsbytagname4468 // instead4469 srcelements = getall( elem );4470 destelements = getall( clone );4471 // weird iteration because ie will replace the length property4472 // with an element if you are cloning the body and one of the4473 // elements on the page has a name or id of "length"4474 for ( i = 0; srcelements[i]; ++i ) {4475 clonefixattributes( srcelements[i], destelements[i] );4476 }4477 }4478 // copy the events from the original to the clone4479 if ( dataandevents ) {4480 clonecopyevent( elem, clone );4481 if ( deepdataandevents ) {4482 srcelements = getall( elem );4483 destelements = getall( clone );4484 for ( i = 0; srcelements[i]; ++i ) {4485 clonecopyevent( srcelements[i], destelements[i] );4486 }4487 }4488 }4489 // return the cloned set4490 return clone;4491},4492 clean: function( elems, context, fragment, scripts ) {4493 context = context || document;4494 // !context.createelement fails in ie with an error but returns typeof 'object'4495 if ( typeof context.createelement === "undefined" ) {4496 context = context.ownerdocument || context[0] && context[0].ownerdocument || document;4497 }4498 var ret = [];4499 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {4500 if ( typeof elem === "number" ) {4501 elem += "";4502 }4503 if ( !elem ) {4504 continue;4505 }4506 // convert html string into dom nodes4507 if ( typeof elem === "string" && !rhtml.test( elem ) ) {4508 elem = context.createtextnode( elem );4509 } else if ( typeof elem === "string" ) {4510 // fix "xhtml"-style tags in all browsers4511 elem = elem.replace(rxhtmltag, "<$1></$2>");4512 // trim whitespace, otherwise indexof won't work as expected4513 var tag = (rtagname.exec( elem ) || ["", ""])[1].tolowercase(),4514 wrap = wrapmap[ tag ] || wrapmap._default,4515 depth = wrap[0],4516 div = context.createelement("div");4517 // go to html and back, then peel off extra wrappers4518 div.innerhtml = wrap[1] + elem + wrap[2];4519 // move to the right depth4520 while ( depth-- ) {4521 div = div.lastchild;4522 }4523 // remove ie's autoinserted <tbody> from table fragments4524 if ( !jquery.support.tbody ) {4525 // string was a <table>, *may* have spurious <tbody>4526 var hasbody = rtbody.test(elem),4527 tbody = tag === "table" && !hasbody ?4528 div.firstchild && div.firstchild.childnodes :4529 // string was a bare <thead> or <tfoot>4530 wrap[1] === "<table>" && !hasbody ?4531 div.childnodes :4532 [];4533 for ( var j = tbody.length - 1; j >= 0 ; --j ) {4534 if ( jquery.nodename( tbody[ j ], "tbody" ) && !tbody[ j ].childnodes.length ) {4535 tbody[ j ].parentnode.removechild( tbody[ j ] );4536 }4537 }4538 }4539 // ie completely kills leading whitespace when innerhtml is used4540 if ( !jquery.support.leadingwhitespace && rleadingwhitespace.test( elem ) ) {4541 div.insertbefore( context.createtextnode( rleadingwhitespace.exec(elem)[0] ), div.firstchild );4542 }4543 elem = div.childnodes;4544 }4545 if ( elem.nodetype ) {4546 ret.push( elem );4547 } else {4548 ret = jquery.merge( ret, elem );4549 }4550 }4551 if ( fragment ) {4552 for ( i = 0; ret[i]; i++ ) {4553 if ( scripts && jquery.nodename( ret[i], "script" ) && (!ret[i].type || ret[i].type.tolowercase() === "text/javascript") ) {4554 scripts.push( ret[i].parentnode ? ret[i].parentnode.removechild( ret[i] ) : ret[i] );4555 } else {4556 if ( ret[i].nodetype === 1 ) {4557 ret.splice.apply( ret, [i + 1, 0].concat(jquery.makearray(ret[i].getelementsbytagname("script"))) );4558 }4559 fragment.appendchild( ret[i] );4560 }4561 }4562 }4563 return ret;4564 },4565 cleandata: function( elems ) {4566 var data, id, cache = jquery.cache, internalkey = jquery.expando, special = jquery.event.special,4567 deleteexpando = jquery.support.deleteexpando;4568 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {4569 if ( elem.nodename && jquery.nodata[elem.nodename.tolowercase()] ) {4570 continue;4571 }4572 id = elem[ jquery.expando ];4573 if ( id ) {4574 data = cache[ id ] && cache[ id ][ internalkey ];4575 if ( data && data.events ) {4576 for ( var type in data.events ) {4577 if ( special[ type ] ) {4578 jquery.event.remove( elem, type );4579 // this is a shortcut to avoid jquery.event.remove's overhead4580 } else {4581 jquery.removeevent( elem, type, data.handle );4582 }4583 }4584 // null the dom reference to avoid ie6/7/8 leak (#7054)4585 if ( data.handle ) {4586 data.handle.elem = null;4587 }4588 }4589 if ( deleteexpando ) {4590 delete elem[ jquery.expando ];4591 } else if ( elem.removeattribute ) {4592 elem.removeattribute( jquery.expando );4593 }4594 delete cache[ id ];4595 }4596 }4597 }4598});4599function evalscript( i, elem ) {4600 if ( elem.src ) {4601 jquery.ajax({4602 url: elem.src,4603 async: false,4604 datatype: "script"4605 });4606 } else {4607 jquery.globaleval( elem.text || elem.textcontent || elem.innerhtml || "" );4608 }4609 if ( elem.parentnode ) {4610 elem.parentnode.removechild( elem );4611 }4612}4613var ralpha = /alpha\([^)]*\)/i,4614 ropacity = /opacity=([^)]*)/,4615 rdashalpha = /-([a-z])/ig,4616 rupper = /([a-z])/g,4617 rnumpx = /^-?\d+(?:px)?$/i,4618 rnum = /^-?\d/,4619 cssshow = { position: "absolute", visibility: "hidden", display: "block" },4620 csswidth = [ "left", "right" ],4621 cssheight = [ "top", "bottom" ],4622 curcss,4623 getcomputedstyle,4624 currentstyle,4625 fcamelcase = function( all, letter ) {4626 return letter.touppercase();4627 };4628jquery.fn.css = function( name, value ) {4629 // setting 'undefined' is a no-op4630 if ( arguments.length === 2 && value === undefined ) {4631 return this;4632 }4633 return jquery.access( this, name, value, true, function( elem, name, value ) {4634 return value !== undefined ?4635 jquery.style( elem, name, value ) :4636 jquery.css( elem, name );4637 });4638};4639jquery.extend({4640 // add in style property hooks for overriding the default4641 // behavior of getting and setting a style property4642 csshooks: {4643 opacity: {4644 get: function( elem, computed ) {4645 if ( computed ) {4646 // we should always get a number back from opacity4647 var ret = curcss( elem, "opacity", "opacity" );4648 return ret === "" ? "1" : ret;4649 } else {4650 return elem.style.opacity;4651 }4652 }4653 }4654 },4655 // exclude the following css properties to add px4656 cssnumber: {4657 "zindex": true,4658 "fontweight": true,4659 "opacity": true,4660 "zoom": true,4661 "lineheight": true4662 },4663 // add in properties whose names you wish to fix before4664 // setting or getting the value4665 cssprops: {4666 // normalize float css property4667 "float": jquery.support.cssfloat ? "cssfloat" : "stylefloat"4668 },4669 // get and set the style property on a dom node4670 style: function( elem, name, value, extra ) {4671 // don't set styles on text and comment nodes4672 if ( !elem || elem.nodetype === 3 || elem.nodetype === 8 || !elem.style ) {4673 return;4674 }4675 // make sure that we're working with the right name4676 var ret, origname = jquery.camelcase( name ),4677 style = elem.style, hooks = jquery.csshooks[ origname ];4678 name = jquery.cssprops[ origname ] || origname;4679 // check if we're setting a value4680 if ( value !== undefined ) {4681 // make sure that nan and null values aren't set. see: #71164682 if ( typeof value === "number" && isnan( value ) || value == null ) {4683 return;4684 }4685 // if a number was passed in, add 'px' to the (except for certain css properties)4686 if ( typeof value === "number" && !jquery.cssnumber[ origname ] ) {4687 value += "px";4688 }4689 // if a hook was provided, use that value, otherwise just set the specified value4690 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {4691 // wrapped to prevent ie from throwing errors when 'invalid' values are provided4692 // fixes bug #55094693 try {4694 style[ name ] = value;4695 } catch(e) {}4696 }4697 } else {4698 // if a hook was provided get the non-computed value from there4699 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {4700 return ret;4701 }4702 // otherwise just get the value from the style object4703 return style[ name ];4704 }4705 },4706 css: function( elem, name, extra ) {4707 // make sure that we're working with the right name4708 var ret, origname = jquery.camelcase( name ),4709 hooks = jquery.csshooks[ origname ];4710 name = jquery.cssprops[ origname ] || origname;4711 // if a hook was provided get the computed value from there4712 if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {4713 return ret;4714 // otherwise, if a way to get the computed value exists, use that4715 } else if ( curcss ) {4716 return curcss( elem, name, origname );4717 }4718 },4719 // a method for quickly swapping in/out css properties to get correct calculations4720 swap: function( elem, options, callback ) {4721 var old = {};4722 // remember the old values, and insert the new ones4723 for ( var name in options ) {4724 old[ name ] = elem.style[ name ];4725 elem.style[ name ] = options[ name ];4726 }4727 callback.call( elem );4728 // revert the old values4729 for ( name in options ) {4730 elem.style[ name ] = old[ name ];4731 }4732 },4733 camelcase: function( string ) {4734 return string.replace( rdashalpha, fcamelcase );4735 }4736});4737// deprecated, use jquery.css() instead4738jquery.curcss = jquery.css;4739jquery.each(["height", "width"], function( i, name ) {4740 jquery.csshooks[ name ] = {4741 get: function( elem, computed, extra ) {4742 var val;4743 if ( computed ) {4744 if ( elem.offsetwidth !== 0 ) {4745 val = getwh( elem, name, extra );4746 } else {4747 jquery.swap( elem, cssshow, function() {4748 val = getwh( elem, name, extra );4749 });4750 }4751 if ( val <= 0 ) {4752 val = curcss( elem, name, name );4753 if ( val === "0px" && currentstyle ) {4754 val = currentstyle( elem, name, name );4755 }4756 if ( val != null ) {4757 // should return "auto" instead of 0, use 0 for4758 // temporary backwards-compat4759 return val === "" || val === "auto" ? "0px" : val;4760 }4761 }4762 if ( val < 0 || val == null ) {4763 val = elem.style[ name ];4764 // should return "auto" instead of 0, use 0 for4765 // temporary backwards-compat4766 return val === "" || val === "auto" ? "0px" : val;4767 }4768 return typeof val === "string" ? val : val + "px";4769 }4770 },4771 set: function( elem, value ) {4772 if ( rnumpx.test( value ) ) {4773 // ignore negative width and height values #15994774 value = parsefloat(value);4775 if ( value >= 0 ) {4776 return value + "px";4777 }4778 } else {4779 return value;4780 }4781 }4782 };4783});4784if ( !jquery.support.opacity ) {4785 jquery.csshooks.opacity = {4786 get: function( elem, computed ) {4787 // ie uses filters for opacity4788 return ropacity.test((computed && elem.currentstyle ? elem.currentstyle.filter : elem.style.filter) || "") ?4789 (parsefloat(regexp.$1) / 100) + "" :4790 computed ? "1" : "";4791 },4792 set: function( elem, value ) {4793 var style = elem.style;4794 // ie has trouble with opacity if it does not have layout4795 // force it by setting the zoom level4796 style.zoom = 1;4797 // set the alpha filter to set the opacity4798 var opacity = jquery.isnan(value) ?4799 "" :4800 "alpha(opacity=" + value * 100 + ")",4801 filter = style.filter || "";4802 style.filter = ralpha.test(filter) ?4803 filter.replace(ralpha, opacity) :4804 style.filter + ' ' + opacity;4805 }4806 };4807}4808if ( document.defaultview && document.defaultview.getcomputedstyle ) {4809 getcomputedstyle = function( elem, newname, name ) {4810 var ret, defaultview, computedstyle;4811 name = name.replace( rupper, "-$1" ).tolowercase();4812 if ( !(defaultview = elem.ownerdocument.defaultview) ) {4813 return undefined;4814 }4815 if ( (computedstyle = defaultview.getcomputedstyle( elem, null )) ) {4816 ret = computedstyle.getpropertyvalue( name );4817 if ( ret === "" && !jquery.contains( elem.ownerdocument.documentelement, elem ) ) {4818 ret = jquery.style( elem, name );4819 }4820 }4821 return ret;4822 };4823}4824if ( document.documentelement.currentstyle ) {4825 currentstyle = function( elem, name ) {4826 var left,4827 ret = elem.currentstyle && elem.currentstyle[ name ],4828 rsleft = elem.runtimestyle && elem.runtimestyle[ name ],4829 style = elem.style;4830 // from the awesome hack by dean edwards4831 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-1022914832 // if we're not dealing with a regular pixel number4833 // but a number that has a weird ending, we need to convert it to pixels4834 if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {4835 // remember the original values4836 left = style.left;4837 // put in the new values to get a computed value out4838 if ( rsleft ) {4839 elem.runtimestyle.left = elem.currentstyle.left;4840 }4841 style.left = name === "fontsize" ? "1em" : (ret || 0);4842 ret = style.pixelleft + "px";4843 // revert the changed values4844 style.left = left;4845 if ( rsleft ) {4846 elem.runtimestyle.left = rsleft;4847 }4848 }4849 return ret === "" ? "auto" : ret;4850 };4851}4852curcss = getcomputedstyle || currentstyle;4853function getwh( elem, name, extra ) {4854 var which = name === "width" ? csswidth : cssheight,4855 val = name === "width" ? elem.offsetwidth : elem.offsetheight;4856 if ( extra === "border" ) {4857 return val;4858 }4859 jquery.each( which, function() {4860 if ( !extra ) {4861 val -= parsefloat(jquery.css( elem, "padding" + this )) || 0;4862 }4863 if ( extra === "margin" ) {4864 val += parsefloat(jquery.css( elem, "margin" + this )) || 0;4865 } else {4866 val -= parsefloat(jquery.css( elem, "border" + this + "width" )) || 0;4867 }4868 });4869 return val;4870}4871if ( jquery.expr && jquery.expr.filters ) {4872 jquery.expr.filters.hidden = function( elem ) {4873 var width = elem.offsetwidth,4874 height = elem.offsetheight;4875 return (width === 0 && height === 0) || (!jquery.support.reliablehiddenoffsets && (elem.style.display || jquery.css( elem, "display" )) === "none");4876 };4877 jquery.expr.filters.visible = function( elem ) {4878 return !jquery.expr.filters.hidden( elem );4879 };4880}4881var r20 = /%20/g,4882 rbracket = /\[\]$/,4883 rcrlf = /\r?\n/g,4884 rhash = /#.*$/,4885 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // ie leaves an \r character at eol4886 rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,4887 // #7653, #8125, #8152: local protocol detection4888 rlocalprotocol = /(?:^file|^widget|\-extension):$/,4889 rnocontent = /^(?:get|head)$/,4890 rprotocol = /^\/\//,4891 rquery = /\?/,4892 rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,4893 rselecttextarea = /^(?:select|textarea)/i,4894 rspacesajax = /\s+/,4895 rts = /([?&])_=[^&]*/,4896 rucheaders = /(^|\-)([a-z])/g,4897 rucheadersfunc = function( _, $1, $2 ) {4898 return $1 + $2.touppercase();4899 },4900 rurl = /^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,4901 // keep a copy of the old load method4902 _load = jquery.fn.load,4903 /* prefilters4904 * 1) they are useful to introduce custom datatypes (see ajax/jsonp.js for an example)4905 * 2) these are called:4906 * - before asking for a transport4907 * - after param serialization (s.data is a string if s.processdata is true)4908 * 3) key is the datatype4909 * 4) the catchall symbol "*" can be used4910 * 5) execution will start with transport datatype and then continue down to "*" if needed4911 */4912 prefilters = {},4913 /* transports bindings4914 * 1) key is the datatype4915 * 2) the catchall symbol "*" can be used4916 * 3) selection will start with transport datatype and then go to "*" if needed4917 */4918 transports = {},4919 // document location4920 ajaxlocation,4921 // document location segments4922 ajaxlocparts;4923// #8138, ie may throw an exception when accessing4924// a field from document.location if document.domain has been set4925try {4926 ajaxlocation = document.location.href;4927} catch( e ) {4928 // use the href attribute of an a element4929 // since ie will modify it given document.location4930 ajaxlocation = document.createelement( "a" );4931 ajaxlocation.href = "";4932 ajaxlocation = ajaxlocation.href;4933}4934// segment location into parts4935ajaxlocparts = rurl.exec( ajaxlocation.tolowercase() );4936// base "constructor" for jquery.ajaxprefilter and jquery.ajaxtransport4937function addtoprefiltersortransports( structure ) {4938 // datatypeexpression is optional and defaults to "*"4939 return function( datatypeexpression, func ) {4940 if ( typeof datatypeexpression !== "string" ) {4941 func = datatypeexpression;4942 datatypeexpression = "*";4943 }4944 if ( jquery.isfunction( func ) ) {4945 var datatypes = datatypeexpression.tolowercase().split( rspacesajax ),4946 i = 0,4947 length = datatypes.length,4948 datatype,4949 list,4950 placebefore;4951 // for each datatype in the datatypeexpression4952 for(; i < length; i++ ) {4953 datatype = datatypes[ i ];4954 // we control if we're asked to add before4955 // any existing element4956 placebefore = /^\+/.test( datatype );4957 if ( placebefore ) {4958 datatype = datatype.substr( 1 ) || "*";4959 }4960 list = structure[ datatype ] = structure[ datatype ] || [];4961 // then we add to the structure accordingly4962 list[ placebefore ? "unshift" : "push" ]( func );4963 }4964 }4965 };4966}4967//base inspection function for prefilters and transports4968function inspectprefiltersortransports( structure, options, originaloptions, jqxhr,4969 datatype /* internal */, inspected /* internal */ ) {4970 datatype = datatype || options.datatypes[ 0 ];4971 inspected = inspected || {};4972 inspected[ datatype ] = true;4973 var list = structure[ datatype ],4974 i = 0,4975 length = list ? list.length : 0,4976 executeonly = ( structure === prefilters ),4977 selection;4978 for(; i < length && ( executeonly || !selection ); i++ ) {4979 selection = list[ i ]( options, originaloptions, jqxhr );4980 // if we got redirected to another datatype4981 // we try there if executing only and not done already4982 if ( typeof selection === "string" ) {4983 if ( !executeonly || inspected[ selection ] ) {4984 selection = undefined;4985 } else {4986 options.datatypes.unshift( selection );4987 selection = inspectprefiltersortransports(4988 structure, options, originaloptions, jqxhr, selection, inspected );4989 }4990 }4991 }4992 // if we're only executing or nothing was selected4993 // we try the catchall datatype if not done already4994 if ( ( executeonly || !selection ) && !inspected[ "*" ] ) {4995 selection = inspectprefiltersortransports(4996 structure, options, originaloptions, jqxhr, "*", inspected );4997 }4998 // unnecessary when only executing (prefilters)4999 // but it'll be ignored by the caller in that case5000 return selection;5001}5002jquery.fn.extend({5003 load: function( url, params, callback ) {5004 if ( typeof url !== "string" && _load ) {5005 return _load.apply( this, arguments );5006 // don't do a request if no elements are being requested5007 } else if ( !this.length ) {5008 return this;5009 }5010 var off = url.indexof( " " );5011 if ( off >= 0 ) {5012 var selector = url.slice( off, url.length );5013 url = url.slice( 0, off );5014 }5015 // default to a get request5016 var type = "get";5017 // if the second parameter was provided5018 if ( params ) {5019 // if it's a function5020 if ( jquery.isfunction( params ) ) {5021 // we assume that it's the callback5022 callback = params;5023 params = undefined;5024 // otherwise, build a param string5025 } else if ( typeof params === "object" ) {5026 params = jquery.param( params, jquery.ajaxsettings.traditional );5027 type = "post";5028 }5029 }5030 var self = this;5031 // request the remote document5032 jquery.ajax({5033 url: url,5034 type: type,5035 datatype: "html",5036 data: params,5037 // complete callback (responsetext is used internally)5038 complete: function( jqxhr, status, responsetext ) {5039 // store the response as specified by the jqxhr object5040 responsetext = jqxhr.responsetext;5041 // if successful, inject the html into all the matched elements5042 if ( jqxhr.isresolved() ) {5043 // #4825: get the actual response in case5044 // a datafilter is present in ajaxsettings5045 jqxhr.done(function( r ) {5046 responsetext = r;5047 });5048 // see if a selector was specified5049 self.html( selector ?5050 // create a dummy div to hold the results5051 jquery("<div>")5052 // inject the contents of the document in, removing the scripts5053 // to avoid any 'permission denied' errors in ie5054 .append(responsetext.replace(rscript, ""))5055 // locate the specified elements5056 .find(selector) :5057 // if not, just inject the full result5058 responsetext );5059 }5060 if ( callback ) {5061 self.each( callback, [ responsetext, status, jqxhr ] );5062 }5063 }5064 });5065 return this;5066 },5067 serialize: function() {5068 return jquery.param( this.serializearray() );5069 },5070 serializearray: function() {5071 return this.map(function(){5072 return this.elements ? jquery.makearray( this.elements ) : this;5073 })5074 .filter(function(){5075 return this.name && !this.disabled &&5076 ( this.checked || rselecttextarea.test( this.nodename ) ||5077 rinput.test( this.type ) );5078 })5079 .map(function( i, elem ){5080 var val = jquery( this ).val();5081 return val == null ?5082 null :5083 jquery.isarray( val ) ?5084 jquery.map( val, function( val, i ){5085 return { name: elem.name, value: val.replace( rcrlf, "\r\n" ) };5086 }) :5087 { name: elem.name, value: val.replace( rcrlf, "\r\n" ) };5088 }).get();5089 }5090});5091// attach a bunch of functions for handling common ajax events5092jquery.each( "ajaxstart ajaxstop ajaxcomplete ajaxerror ajaxsuccess ajaxsend".split( " " ), function( i, o ){5093 jquery.fn[ o ] = function( f ){5094 return this.bind( o, f );5095 };5096} );5097jquery.each( [ "get", "post" ], function( i, method ) {5098 jquery[ method ] = function( url, data, callback, type ) {5099 // shift arguments if data argument was omitted5100 if ( jquery.isfunction( data ) ) {5101 type = type || callback;5102 callback = data;5103 data = undefined;5104 }5105 return jquery.ajax({5106 type: method,5107 url: url,5108 data: data,5109 success: callback,5110 datatype: type5111 });5112 };5113} );5114jquery.extend({5115 getscript: function( url, callback ) {5116 return jquery.get( url, undefined, callback, "script" );5117 },5118 getjson: function( url, data, callback ) {5119 return jquery.get( url, data, callback, "json" );5120 },5121 // creates a full fledged settings object into target5122 // with both ajaxsettings and settings fields.5123 // if target is omitted, writes into ajaxsettings.5124 ajaxsetup: function ( target, settings ) {5125 if ( !settings ) {5126 // only one parameter, we extend ajaxsettings5127 settings = target;5128 target = jquery.extend( true, jquery.ajaxsettings, settings );5129 } else {5130 // target was provided, we extend into it5131 jquery.extend( true, target, jquery.ajaxsettings, settings );5132 }5133 // flatten fields we don't want deep extended5134 for( var field in { context: 1, url: 1 } ) {5135 if ( field in settings ) {5136 target[ field ] = settings[ field ];5137 } else if( field in jquery.ajaxsettings ) {5138 target[ field ] = jquery.ajaxsettings[ field ];5139 }5140 }5141 return target;5142 },5143 ajaxsettings: {5144 url: ajaxlocation,5145 islocal: rlocalprotocol.test( ajaxlocparts[ 1 ] ),5146 global: true,5147 type: "get",5148 contenttype: "application/x-www-form-urlencoded",5149 processdata: true,5150 async: true,5151 /*5152 timeout: 0,5153 data: null,5154 datatype: null,5155 username: null,5156 password: null,5157 cache: null,5158 traditional: false,5159 headers: {},5160 crossdomain: null,5161 */5162 accepts: {5163 xml: "application/xml, text/xml",5164 html: "text/html",5165 text: "text/plain",5166 json: "application/json, text/javascript",5167 "*": "*/*"5168 },5169 contents: {5170 xml: /xml/,5171 html: /html/,5172 json: /json/5173 },5174 responsefields: {5175 xml: "responsexml",5176 text: "responsetext"5177 },5178 // list of data converters5179 // 1) key format is "source_type destination_type" (a single space in-between)5180 // 2) the catchall symbol "*" can be used for source_type5181 converters: {5182 // convert anything to text5183 "* text": window.string,5184 // text to html (true = no transformation)5185 "text html": true,5186 // evaluate text as a json expression5187 "text json": jquery.parsejson,5188 // parse text as xml5189 "text xml": jquery.parsexml5190 }5191 },5192 ajaxprefilter: addtoprefiltersortransports( prefilters ),5193 ajaxtransport: addtoprefiltersortransports( transports ),5194 // main method5195 ajax: function( url, options ) {5196 // if url is an object, simulate pre-1.5 signature5197 if ( typeof url === "object" ) {5198 options = url;5199 url = undefined;5200 }5201 // force options to be an object5202 options = options || {};5203 var // create the final options object5204 s = jquery.ajaxsetup( {}, options ),5205 // callbacks context5206 callbackcontext = s.context || s,5207 // context for global events5208 // it's the callbackcontext if one was provided in the options5209 // and if it's a dom node or a jquery collection5210 globaleventcontext = callbackcontext !== s &&5211 ( callbackcontext.nodetype || callbackcontext instanceof jquery ) ?5212 jquery( callbackcontext ) : jquery.event,5213 // deferreds5214 deferred = jquery.deferred(),5215 completedeferred = jquery._deferred(),5216 // status-dependent callbacks5217 statuscode = s.statuscode || {},5218 // ifmodified key5219 ifmodifiedkey,5220 // headers (they are sent all at once)5221 requestheaders = {},5222 // response headers5223 responseheadersstring,5224 responseheaders,5225 // transport5226 transport,5227 // timeout handle5228 timeouttimer,5229 // cross-domain detection vars5230 parts,5231 // the jqxhr state5232 state = 0,5233 // to know if global events are to be dispatched5234 fireglobals,5235 // loop variable5236 i,5237 // fake xhr5238 jqxhr = {5239 readystate: 0,5240 // caches the header5241 setrequestheader: function( name, value ) {5242 if ( !state ) {5243 requestheaders[ name.tolowercase().replace( rucheaders, rucheadersfunc ) ] = value;5244 }5245 return this;5246 },5247 // raw string5248 getallresponseheaders: function() {5249 return state === 2 ? responseheadersstring : null;5250 },5251 // builds headers hashtable if needed5252 getresponseheader: function( key ) {5253 var match;5254 if ( state === 2 ) {5255 if ( !responseheaders ) {5256 responseheaders = {};5257 while( ( match = rheaders.exec( responseheadersstring ) ) ) {5258 responseheaders[ match[1].tolowercase() ] = match[ 2 ];5259 }5260 }5261 match = responseheaders[ key.tolowercase() ];5262 }5263 return match === undefined ? null : match;5264 },5265 // overrides response content-type header5266 overridemimetype: function( type ) {5267 if ( !state ) {5268 s.mimetype = type;5269 }5270 return this;5271 },5272 // cancel the request5273 abort: function( statustext ) {5274 statustext = statustext || "abort";5275 if ( transport ) {5276 transport.abort( statustext );5277 }5278 done( 0, statustext );5279 return this;5280 }5281 };5282 // callback for when everything is done5283 // it is defined here because jslint complains if it is declared5284 // at the end of the function (which would be more logical and readable)5285 function done( status, statustext, responses, headers ) {5286 // called once5287 if ( state === 2 ) {5288 return;5289 }5290 // state is "done" now5291 state = 2;5292 // clear timeout if it exists5293 if ( timeouttimer ) {5294 cleartimeout( timeouttimer );5295 }5296 // dereference transport for early garbage collection5297 // (no matter how long the jqxhr object will be used)5298 transport = undefined;5299 // cache response headers5300 responseheadersstring = headers || "";5301 // set readystate5302 jqxhr.readystate = status ? 4 : 0;5303 var issuccess,5304 success,5305 error,5306 response = responses ? ajaxhandleresponses( s, jqxhr, responses ) : undefined,5307 lastmodified,5308 etag;5309 // if successful, handle type chaining5310 if ( status >= 200 && status < 300 || status === 304 ) {5311 // set the if-modified-since and/or if-none-match header, if in ifmodified mode.5312 if ( s.ifmodified ) {5313 if ( ( lastmodified = jqxhr.getresponseheader( "last-modified" ) ) ) {5314 jquery.lastmodified[ ifmodifiedkey ] = lastmodified;5315 }5316 if ( ( etag = jqxhr.getresponseheader( "etag" ) ) ) {5317 jquery.etag[ ifmodifiedkey ] = etag;5318 }5319 }5320 // if not modified5321 if ( status === 304 ) {5322 statustext = "notmodified";5323 issuccess = true;5324 // if we have data5325 } else {5326 try {5327 success = ajaxconvert( s, response );5328 statustext = "success";5329 issuccess = true;5330 } catch(e) {5331 // we have a parsererror5332 statustext = "parsererror";5333 error = e;5334 }5335 }5336 } else {5337 // we extract error from statustext5338 // then normalize statustext and status for non-aborts5339 error = statustext;5340 if( !statustext || status ) {5341 statustext = "error";5342 if ( status < 0 ) {5343 status = 0;5344 }5345 }5346 }5347 // set data for the fake xhr object5348 jqxhr.status = status;5349 jqxhr.statustext = statustext;5350 // success/error5351 if ( issuccess ) {5352 deferred.resolvewith( callbackcontext, [ success, statustext, jqxhr ] );5353 } else {5354 deferred.rejectwith( callbackcontext, [ jqxhr, statustext, error ] );5355 }5356 // status-dependent callbacks5357 jqxhr.statuscode( statuscode );5358 statuscode = undefined;5359 if ( fireglobals ) {5360 globaleventcontext.trigger( "ajax" + ( issuccess ? "success" : "error" ),5361 [ jqxhr, s, issuccess ? success : error ] );5362 }5363 // complete5364 completedeferred.resolvewith( callbackcontext, [ jqxhr, statustext ] );5365 if ( fireglobals ) {5366 globaleventcontext.trigger( "ajaxcomplete", [ jqxhr, s] );5367 // handle the global ajax counter5368 if ( !( --jquery.active ) ) {5369 jquery.event.trigger( "ajaxstop" );5370 }5371 }5372 }5373 // attach deferreds5374 deferred.promise( jqxhr );5375 jqxhr.success = jqxhr.done;5376 jqxhr.error = jqxhr.fail;5377 jqxhr.complete = completedeferred.done;5378 // status-dependent callbacks5379 jqxhr.statuscode = function( map ) {5380 if ( map ) {5381 var tmp;5382 if ( state < 2 ) {5383 for( tmp in map ) {5384 statuscode[ tmp ] = [ statuscode[tmp], map[tmp] ];5385 }5386 } else {5387 tmp = map[ jqxhr.status ];5388 jqxhr.then( tmp, tmp );5389 }5390 }5391 return this;5392 };5393 // remove hash character (#7531: and string promotion)5394 // add protocol if not provided (#5866: ie7 issue with protocol-less urls)5395 // we also use the url parameter if available5396 s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxlocparts[ 1 ] + "//" );5397 // extract datatypes list5398 s.datatypes = jquery.trim( s.datatype || "*" ).tolowercase().split( rspacesajax );5399 // determine if a cross-domain request is in order5400 if ( !s.crossdomain ) {5401 parts = rurl.exec( s.url.tolowercase() );5402 s.crossdomain = !!( parts &&5403 ( parts[ 1 ] != ajaxlocparts[ 1 ] || parts[ 2 ] != ajaxlocparts[ 2 ] ||5404 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=5405 ( ajaxlocparts[ 3 ] || ( ajaxlocparts[ 1 ] === "http:" ? 80 : 443 ) ) )5406 );5407 }5408 // convert data if not already a string5409 if ( s.data && s.processdata && typeof s.data !== "string" ) {5410 s.data = jquery.param( s.data, s.traditional );5411 }5412 // apply prefilters5413 inspectprefiltersortransports( prefilters, s, options, jqxhr );5414 // if request was aborted inside a prefiler, stop there5415 if ( state === 2 ) {5416 return false;5417 }5418 // we can fire global events as of now if asked to5419 fireglobals = s.global;5420 // uppercase the type5421 s.type = s.type.touppercase();5422 // determine if request has content5423 s.hascontent = !rnocontent.test( s.type );5424 // watch for a new set of requests5425 if ( fireglobals && jquery.active++ === 0 ) {5426 jquery.event.trigger( "ajaxstart" );5427 }5428 // more options handling for requests with no content5429 if ( !s.hascontent ) {5430 // if data is available, append data to url5431 if ( s.data ) {5432 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;5433 }5434 // get ifmodifiedkey before adding the anti-cache parameter5435 ifmodifiedkey = s.url;5436 // add anti-cache in url if needed5437 if ( s.cache === false ) {5438 var ts = jquery.now(),5439 // try replacing _= if it is there5440 ret = s.url.replace( rts, "$1_=" + ts );5441 // if nothing was replaced, add timestamp to the end5442 s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );5443 }5444 }5445 // set the correct header, if data is being sent5446 if ( s.data && s.hascontent && s.contenttype !== false || options.contenttype ) {5447 requestheaders[ "content-type" ] = s.contenttype;5448 }5449 // set the if-modified-since and/or if-none-match header, if in ifmodified mode.5450 if ( s.ifmodified ) {5451 ifmodifiedkey = ifmodifiedkey || s.url;5452 if ( jquery.lastmodified[ ifmodifiedkey ] ) {5453 requestheaders[ "if-modified-since" ] = jquery.lastmodified[ ifmodifiedkey ];5454 }5455 if ( jquery.etag[ ifmodifiedkey ] ) {5456 requestheaders[ "if-none-match" ] = jquery.etag[ ifmodifiedkey ];5457 }5458 }5459 // set the accepts header for the server, depending on the datatype5460 requestheaders.accept = s.datatypes[ 0 ] && s.accepts[ s.datatypes[0] ] ?5461 s.accepts[ s.datatypes[0] ] + ( s.datatypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :5462 s.accepts[ "*" ];5463 // check for headers option5464 for ( i in s.headers ) {5465 jqxhr.setrequestheader( i, s.headers[ i ] );5466 }5467 // allow custom headers/mimetypes and early abort5468 if ( s.beforesend && ( s.beforesend.call( callbackcontext, jqxhr, s ) === false || state === 2 ) ) {5469 // abort if not done already5470 jqxhr.abort();5471 return false;5472 }5473 // install callbacks on deferreds5474 for ( i in { success: 1, error: 1, complete: 1 } ) {5475 jqxhr[ i ]( s[ i ] );5476 }5477 // get transport5478 transport = inspectprefiltersortransports( transports, s, options, jqxhr );5479 // if no transport, we auto-abort5480 if ( !transport ) {5481 done( -1, "no transport" );5482 } else {5483 jqxhr.readystate = 1;5484 // send global event5485 if ( fireglobals ) {5486 globaleventcontext.trigger( "ajaxsend", [ jqxhr, s ] );5487 }5488 // timeout5489 if ( s.async && s.timeout > 0 ) {5490 timeouttimer = settimeout( function(){5491 jqxhr.abort( "timeout" );5492 }, s.timeout );5493 }5494 try {5495 state = 1;5496 transport.send( requestheaders, done );5497 } catch (e) {5498 // propagate exception as error if not done5499 if ( status < 2 ) {5500 done( -1, e );5501 // simply rethrow otherwise5502 } else {5503 jquery.error( e );5504 }5505 }5506 }5507 return jqxhr;5508 },5509 // serialize an array of form elements or a set of5510 // key/values into a query string5511 param: function( a, traditional ) {5512 var s = [],5513 add = function( key, value ) {5514 // if value is a function, invoke it and return its value5515 value = jquery.isfunction( value ) ? value() : value;5516 s[ s.length ] = encodeuricomponent( key ) + "=" + encodeuricomponent( value );5517 };5518 // set traditional to true for jquery <= 1.3.2 behavior.5519 if ( traditional === undefined ) {5520 traditional = jquery.ajaxsettings.traditional;5521 }5522 // if an array was passed in, assume that it is an array of form elements.5523 if ( jquery.isarray( a ) || ( a.jquery && !jquery.isplainobject( a ) ) ) {5524 // serialize the form elements5525 jquery.each( a, function() {5526 add( this.name, this.value );5527 } );5528 } else {5529 // if traditional, encode the "old" way (the way 1.3.2 or older5530 // did it), otherwise encode params recursively.5531 for ( var prefix in a ) {5532 buildparams( prefix, a[ prefix ], traditional, add );5533 }5534 }5535 // return the resulting serialization5536 return s.join( "&" ).replace( r20, "+" );5537 }5538});5539function buildparams( prefix, obj, traditional, add ) {5540 if ( jquery.isarray( obj ) && obj.length ) {5541 // serialize array item.5542 jquery.each( obj, function( i, v ) {5543 if ( traditional || rbracket.test( prefix ) ) {5544 // treat each array item as a scalar.5545 add( prefix, v );5546 } else {5547 // if array item is non-scalar (array or object), encode its5548 // numeric index to resolve deserialization ambiguity issues.5549 // note that rack (as of 1.0.0) can't currently deserialize5550 // nested arrays properly, and attempting to do so may cause5551 // a server error. possible fixes are to modify rack's5552 // deserialization algorithm or to provide an option or flag5553 // to force array serialization to be shallow.5554 buildparams( prefix + "[" + ( typeof v === "object" || jquery.isarray(v) ? i : "" ) + "]", v, traditional, add );5555 }5556 });5557 } else if ( !traditional && obj != null && typeof obj === "object" ) {5558 // if we see an array here, it is empty and should be treated as an empty5559 // object5560 if ( jquery.isarray( obj ) || jquery.isemptyobject( obj ) ) {5561 add( prefix, "" );5562 // serialize object item.5563 } else {5564 for ( var name in obj ) {5565 buildparams( prefix + "[" + name + "]", obj[ name ], traditional, add );5566 }5567 }5568 } else {5569 // serialize scalar item.5570 add( prefix, obj );5571 }5572}5573// this is still on the jquery object... for now5574// want to move this to jquery.ajax some day5575jquery.extend({5576 // counter for holding the number of active queries5577 active: 0,5578 // last-modified header cache for next request5579 lastmodified: {},5580 etag: {}5581});5582/* handles responses to an ajax request:5583 * - sets all responsexxx fields accordingly5584 * - finds the right datatype (mediates between content-type and expected datatype)5585 * - returns the corresponding response5586 */5587function ajaxhandleresponses( s, jqxhr, responses ) {5588 var contents = s.contents,5589 datatypes = s.datatypes,5590 responsefields = s.responsefields,5591 ct,5592 type,5593 finaldatatype,5594 firstdatatype;5595 // fill responsexxx fields5596 for( type in responsefields ) {5597 if ( type in responses ) {5598 jqxhr[ responsefields[type] ] = responses[ type ];5599 }5600 }5601 // remove auto datatype and get content-type in the process5602 while( datatypes[ 0 ] === "*" ) {5603 datatypes.shift();5604 if ( ct === undefined ) {5605 ct = s.mimetype || jqxhr.getresponseheader( "content-type" );5606 }5607 }5608 // check if we're dealing with a known content-type5609 if ( ct ) {5610 for ( type in contents ) {5611 if ( contents[ type ] && contents[ type ].test( ct ) ) {5612 datatypes.unshift( type );5613 break;5614 }5615 }5616 }5617 // check to see if we have a response for the expected datatype5618 if ( datatypes[ 0 ] in responses ) {5619 finaldatatype = datatypes[ 0 ];5620 } else {5621 // try convertible datatypes5622 for ( type in responses ) {5623 if ( !datatypes[ 0 ] || s.converters[ type + " " + datatypes[0] ] ) {5624 finaldatatype = type;5625 break;5626 }5627 if ( !firstdatatype ) {5628 firstdatatype = type;5629 }5630 }5631 // or just use first one5632 finaldatatype = finaldatatype || firstdatatype;5633 }5634 // if we found a datatype5635 // we add the datatype to the list if needed5636 // and return the corresponding response5637 if ( finaldatatype ) {5638 if ( finaldatatype !== datatypes[ 0 ] ) {5639 datatypes.unshift( finaldatatype );5640 }5641 return responses[ finaldatatype ];5642 }5643}5644// chain conversions given the request and the original response5645function ajaxconvert( s, response ) {5646 // apply the datafilter if provided5647 if ( s.datafilter ) {5648 response = s.datafilter( response, s.datatype );5649 }5650 var datatypes = s.datatypes,5651 converters = {},5652 i,5653 key,5654 length = datatypes.length,5655 tmp,5656 // current and previous datatypes5657 current = datatypes[ 0 ],5658 prev,5659 // conversion expression5660 conversion,5661 // conversion function5662 conv,5663 // conversion functions (transitive conversion)5664 conv1,5665 conv2;5666 // for each datatype in the chain5667 for( i = 1; i < length; i++ ) {5668 // create converters map5669 // with lowercased keys5670 if ( i === 1 ) {5671 for( key in s.converters ) {5672 if( typeof key === "string" ) {5673 converters[ key.tolowercase() ] = s.converters[ key ];5674 }5675 }5676 }5677 // get the datatypes5678 prev = current;5679 current = datatypes[ i ];5680 // if current is auto datatype, update it to prev5681 if( current === "*" ) {5682 current = prev;5683 // if no auto and datatypes are actually different5684 } else if ( prev !== "*" && prev !== current ) {5685 // get the converter5686 conversion = prev + " " + current;5687 conv = converters[ conversion ] || converters[ "* " + current ];5688 // if there is no direct converter, search transitively5689 if ( !conv ) {5690 conv2 = undefined;5691 for( conv1 in converters ) {5692 tmp = conv1.split( " " );5693 if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {5694 conv2 = converters[ tmp[1] + " " + current ];5695 if ( conv2 ) {5696 conv1 = converters[ conv1 ];5697 if ( conv1 === true ) {5698 conv = conv2;5699 } else if ( conv2 === true ) {5700 conv = conv1;5701 }5702 break;5703 }5704 }5705 }5706 }5707 // if we found no converter, dispatch an error5708 if ( !( conv || conv2 ) ) {5709 jquery.error( "no conversion from " + conversion.replace(" "," to ") );5710 }5711 // if found converter is not an equivalence5712 if ( conv !== true ) {5713 // convert with 1 or 2 converters accordingly5714 response = conv ? conv( response ) : conv2( conv1(response) );5715 }5716 }5717 }5718 return response;5719}5720var jsc = jquery.now(),5721 jsre = /(\=)\?(&|$)|()\?\?()/i;5722// default jsonp settings5723jquery.ajaxsetup({5724 jsonp: "callback",5725 jsonpcallback: function() {5726 return jquery.expando + "_" + ( jsc++ );5727 }5728});5729// detect, normalize options and install callbacks for jsonp requests5730jquery.ajaxprefilter( "json jsonp", function( s, originalsettings, jqxhr ) {5731 var dataisstring = ( typeof s.data === "string" );5732 if ( s.datatypes[ 0 ] === "jsonp" ||5733 originalsettings.jsonpcallback ||5734 originalsettings.jsonp != null ||5735 s.jsonp !== false && ( jsre.test( s.url ) ||5736 dataisstring && jsre.test( s.data ) ) ) {5737 var responsecontainer,5738 jsonpcallback = s.jsonpcallback =5739 jquery.isfunction( s.jsonpcallback ) ? s.jsonpcallback() : s.jsonpcallback,5740 previous = window[ jsonpcallback ],5741 url = s.url,5742 data = s.data,5743 replace = "$1" + jsonpcallback + "$2",5744 cleanup = function() {5745 // set callback back to previous value5746 window[ jsonpcallback ] = previous;5747 // call if it was a function and we have a response5748 if ( responsecontainer && jquery.isfunction( previous ) ) {5749 window[ jsonpcallback ]( responsecontainer[ 0 ] );5750 }5751 };5752 if ( s.jsonp !== false ) {5753 url = url.replace( jsre, replace );5754 if ( s.url === url ) {5755 if ( dataisstring ) {5756 data = data.replace( jsre, replace );5757 }5758 if ( s.data === data ) {5759 // add callback manually5760 url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpcallback;5761 }5762 }5763 }5764 s.url = url;5765 s.data = data;5766 // install callback5767 window[ jsonpcallback ] = function( response ) {5768 responsecontainer = [ response ];5769 };5770 // install cleanup function5771 jqxhr.then( cleanup, cleanup );5772 // use data converter to retrieve json after script execution5773 s.converters["script json"] = function() {5774 if ( !responsecontainer ) {5775 jquery.error( jsonpcallback + " was not called" );5776 }5777 return responsecontainer[ 0 ];5778 };5779 // force json datatype5780 s.datatypes[ 0 ] = "json";5781 // delegate to script5782 return "script";5783 }5784} );5785// install script datatype5786jquery.ajaxsetup({5787 accepts: {5788 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"5789 },5790 contents: {5791 script: /javascript|ecmascript/5792 },5793 converters: {5794 "text script": function( text ) {5795 jquery.globaleval( text );5796 return text;5797 }5798 }5799});5800// handle cache's special case and global5801jquery.ajaxprefilter( "script", function( s ) {5802 if ( s.cache === undefined ) {5803 s.cache = false;5804 }5805 if ( s.crossdomain ) {5806 s.type = "get";5807 s.global = false;5808 }5809} );5810// bind script tag hack transport5811jquery.ajaxtransport( "script", function(s) {5812 // this transport only deals with cross domain requests5813 if ( s.crossdomain ) {5814 var script,5815 head = document.head || document.getelementsbytagname( "head" )[0] || document.documentelement;5816 return {5817 send: function( _, callback ) {5818 script = document.createelement( "script" );5819 script.async = "async";5820 if ( s.scriptcharset ) {5821 script.charset = s.scriptcharset;5822 }5823 script.src = s.url;5824 // attach handlers for all browsers5825 script.onload = script.onreadystatechange = function( _, isabort ) {5826 if ( !script.readystate || /loaded|complete/.test( script.readystate ) ) {5827 // handle memory leak in ie5828 script.onload = script.onreadystatechange = null;5829 // remove the script5830 if ( head && script.parentnode ) {5831 head.removechild( script );5832 }5833 // dereference the script5834 script = undefined;5835 // callback if not abort5836 if ( !isabort ) {5837 callback( 200, "success" );5838 }5839 }5840 };5841 // use insertbefore instead of appendchild to circumvent an ie6 bug.5842 // this arises when a base node is used (#2709 and #4378).5843 head.insertbefore( script, head.firstchild );5844 },5845 abort: function() {5846 if ( script ) {5847 script.onload( 0, 1 );5848 }5849 }5850 };5851 }5852} );5853var // #5280: next active xhr id and list of active xhrs' callbacks5854 xhrid = jquery.now(),5855 xhrcallbacks,5856 // xhr used to determine supports properties5857 testxhr;5858// #5280: internet explorer will keep connections alive if we don't abort on unload5859function xhronunloadabort() {5860 jquery( window ).unload(function() {5861 // abort all pending requests5862 for ( var key in xhrcallbacks ) {5863 xhrcallbacks[ key ]( 0, 1 );5864 }5865 });5866}5867// functions to create xhrs5868function createstandardxhr() {5869 try {5870 return new window.xmlhttprequest();5871 } catch( e ) {}5872}5873function createactivexhr() {5874 try {5875 return new window.activexobject( "microsoft.xmlhttp" );5876 } catch( e ) {}5877}5878// create the request object5879// (this is still attached to ajaxsettings for backward compatibility)5880jquery.ajaxsettings.xhr = window.activexobject ?5881 /* microsoft failed to properly5882 * implement the xmlhttprequest in ie7 (can't request local files),5883 * so we use the activexobject when it is available5884 * additionally xmlhttprequest can be disabled in ie7/ie8 so5885 * we need a fallback.5886 */5887 function() {5888 return !this.islocal && createstandardxhr() || createactivexhr();5889 } :5890 // for all other browsers, use the standard xmlhttprequest object5891 createstandardxhr;5892// test if we can create an xhr object5893testxhr = jquery.ajaxsettings.xhr();5894jquery.support.ajax = !!testxhr;5895// does this browser support crossdomain xhr requests5896jquery.support.cors = testxhr && ( "withcredentials" in testxhr );5897// no need for the temporary xhr anymore5898testxhr = undefined;5899// create transport if the browser can provide an xhr5900if ( jquery.support.ajax ) {5901 jquery.ajaxtransport(function( s ) {5902 // cross domain only allowed if supported through xmlhttprequest5903 if ( !s.crossdomain || jquery.support.cors ) {5904 var callback;5905 return {5906 send: function( headers, complete ) {5907 // get a new xhr5908 var xhr = s.xhr(),5909 handle,5910 i;5911 // open the socket5912 // passing null username, generates a login popup on opera (#2865)5913 if ( s.username ) {5914 xhr.open( s.type, s.url, s.async, s.username, s.password );5915 } else {5916 xhr.open( s.type, s.url, s.async );5917 }5918 // apply custom fields if provided5919 if ( s.xhrfields ) {5920 for ( i in s.xhrfields ) {5921 xhr[ i ] = s.xhrfields[ i ];5922 }5923 }5924 // override mime type if needed5925 if ( s.mimetype && xhr.overridemimetype ) {5926 xhr.overridemimetype( s.mimetype );5927 }5928 // requested-with header5929 // not set for crossdomain requests with no content5930 // (see why at http://trac.dojotoolkit.org/ticket/9486)5931 // won't change header if already provided5932 if ( !( s.crossdomain && !s.hascontent ) && !headers["x-requested-with"] ) {5933 headers[ "x-requested-with" ] = "xmlhttprequest";5934 }5935 // need an extra try/catch for cross domain requests in firefox 35936 try {5937 for ( i in headers ) {5938 xhr.setrequestheader( i, headers[ i ] );5939 }5940 } catch( _ ) {}5941 // do send the request5942 // this may raise an exception which is actually5943 // handled in jquery.ajax (so no try/catch here)5944 xhr.send( ( s.hascontent && s.data ) || null );5945 // listener5946 callback = function( _, isabort ) {5947 var status,5948 statustext,5949 responseheaders,5950 responses,5951 xml;5952 // firefox throws exceptions when accessing properties5953 // of an xhr when a network error occured5954 // http://helpful.knobs-dials.com/index.php/component_returned_failure_code:_0x80040111_(ns_error_not_available)5955 try {5956 // was never called and is aborted or complete5957 if ( callback && ( isabort || xhr.readystate === 4 ) ) {5958 // only called once5959 callback = undefined;5960 // do not keep as active anymore5961 if ( handle ) {5962 xhr.onreadystatechange = jquery.noop;5963 delete xhrcallbacks[ handle ];5964 }5965 // if it's an abort5966 if ( isabort ) {5967 // abort it manually if needed5968 if ( xhr.readystate !== 4 ) {5969 xhr.abort();5970 }5971 } else {5972 status = xhr.status;5973 responseheaders = xhr.getallresponseheaders();5974 responses = {};5975 xml = xhr.responsexml;5976 // construct response list5977 if ( xml && xml.documentelement /* #4958 */ ) {5978 responses.xml = xml;5979 }5980 responses.text = xhr.responsetext;5981 // firefox throws an exception when accessing5982 // statustext for faulty cross-domain requests5983 try {5984 statustext = xhr.statustext;5985 } catch( e ) {5986 // we normalize with webkit giving an empty statustext5987 statustext = "";5988 }5989 // filter status for non standard behaviors5990 // if the request is local and we have data: assume a success5991 // (success with no data won't get notified, that's the best we5992 // can do given current implementations)5993 if ( !status && s.islocal && !s.crossdomain ) {5994 status = responses.text ? 200 : 404;5995 // ie - #1450: sometimes returns 1223 when it should be 2045996 } else if ( status === 1223 ) {5997 status = 204;5998 }5999 }6000 }6001 } catch( firefoxaccessexception ) {6002 if ( !isabort ) {6003 complete( -1, firefoxaccessexception );6004 }6005 }6006 // call complete if needed6007 if ( responses ) {6008 complete( status, statustext, responses, responseheaders );6009 }6010 };6011 // if we're in sync mode or it's in cache6012 // and has been retrieved directly (ie6 & ie7)6013 // we need to manually fire the callback6014 if ( !s.async || xhr.readystate === 4 ) {6015 callback();6016 } else {6017 // create the active xhrs callbacks list if needed6018 // and attach the unload handler6019 if ( !xhrcallbacks ) {6020 xhrcallbacks = {};6021 xhronunloadabort();6022 }6023 // add to list of active xhrs callbacks6024 handle = xhrid++;6025 xhr.onreadystatechange = xhrcallbacks[ handle ] = callback;6026 }6027 },6028 abort: function() {6029 if ( callback ) {6030 callback(0,1);6031 }6032 }6033 };6034 }6035 });6036}6037var elemdisplay = {},6038 rfxtypes = /^(?:toggle|show|hide)$/,6039 rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,6040 timerid,6041 fxattrs = [6042 // height animations6043 [ "height", "margintop", "marginbottom", "paddingtop", "paddingbottom" ],6044 // width animations6045 [ "width", "marginleft", "marginright", "paddingleft", "paddingright" ],6046 // opacity animations6047 [ "opacity" ]6048 ];6049jquery.fn.extend({6050 show: function( speed, easing, callback ) {6051 var elem, display;6052 if ( speed || speed === 0 ) {6053 return this.animate( genfx("show", 3), speed, easing, callback);6054 } else {6055 for ( var i = 0, j = this.length; i < j; i++ ) {6056 elem = this[i];6057 display = elem.style.display;6058 // reset the inline display of this element to learn if it is6059 // being hidden by cascaded rules or not6060 if ( !jquery._data(elem, "olddisplay") && display === "none" ) {6061 display = elem.style.display = "";6062 }6063 // set elements which have been overridden with display: none6064 // in a stylesheet to whatever the default browser style is6065 // for such an element6066 if ( display === "" && jquery.css( elem, "display" ) === "none" ) {6067 jquery._data(elem, "olddisplay", defaultdisplay(elem.nodename));6068 }6069 }6070 // set the display of most of the elements in a second loop6071 // to avoid the constant reflow6072 for ( i = 0; i < j; i++ ) {6073 elem = this[i];6074 display = elem.style.display;6075 if ( display === "" || display === "none" ) {6076 elem.style.display = jquery._data(elem, "olddisplay") || "";6077 }6078 }6079 return this;6080 }6081 },6082 hide: function( speed, easing, callback ) {6083 if ( speed || speed === 0 ) {6084 return this.animate( genfx("hide", 3), speed, easing, callback);6085 } else {6086 for ( var i = 0, j = this.length; i < j; i++ ) {6087 var display = jquery.css( this[i], "display" );6088 if ( display !== "none" && !jquery._data( this[i], "olddisplay" ) ) {6089 jquery._data( this[i], "olddisplay", display );6090 }6091 }6092 // set the display of the elements in a second loop6093 // to avoid the constant reflow6094 for ( i = 0; i < j; i++ ) {6095 this[i].style.display = "none";6096 }6097 return this;6098 }6099 },6100 // save the old toggle function6101 _toggle: jquery.fn.toggle,6102 toggle: function( fn, fn2, callback ) {6103 var bool = typeof fn === "boolean";6104 if ( jquery.isfunction(fn) && jquery.isfunction(fn2) ) {6105 this._toggle.apply( this, arguments );6106 } else if ( fn == null || bool ) {6107 this.each(function() {6108 var state = bool ? fn : jquery(this).is(":hidden");6109 jquery(this)[ state ? "show" : "hide" ]();6110 });6111 } else {6112 this.animate(genfx("toggle", 3), fn, fn2, callback);6113 }6114 return this;6115 },6116 fadeto: function( speed, to, easing, callback ) {6117 return this.filter(":hidden").css("opacity", 0).show().end()6118 .animate({opacity: to}, speed, easing, callback);6119 },6120 animate: function( prop, speed, easing, callback ) {6121 var optall = jquery.speed(speed, easing, callback);6122 if ( jquery.isemptyobject( prop ) ) {6123 return this.each( optall.complete );6124 }6125 return this[ optall.queue === false ? "each" : "queue" ](function() {6126 // xxx 'this' does not always have a nodename when running the6127 // test suite6128 var opt = jquery.extend({}, optall), p,6129 iselement = this.nodetype === 1,6130 hidden = iselement && jquery(this).is(":hidden"),6131 self = this;6132 for ( p in prop ) {6133 var name = jquery.camelcase( p );6134 if ( p !== name ) {6135 prop[ name ] = prop[ p ];6136 delete prop[ p ];6137 p = name;6138 }6139 if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {6140 return opt.complete.call(this);6141 }6142 if ( iselement && ( p === "height" || p === "width" ) ) {6143 // make sure that nothing sneaks out6144 // record all 3 overflow attributes because ie does not6145 // change the overflow attribute when overflowx and6146 // overflowy are set to the same value6147 opt.overflow = [ this.style.overflow, this.style.overflowx, this.style.overflowy ];6148 // set display property to inline-block for height/width6149 // animations on inline elements that are having width/height6150 // animated6151 if ( jquery.css( this, "display" ) === "inline" &&6152 jquery.css( this, "float" ) === "none" ) {6153 if ( !jquery.support.inlineblockneedslayout ) {6154 this.style.display = "inline-block";6155 } else {6156 var display = defaultdisplay(this.nodename);6157 // inline-level elements accept inline-block;6158 // block-level elements need to be inline with layout6159 if ( display === "inline" ) {6160 this.style.display = "inline-block";6161 } else {6162 this.style.display = "inline";6163 this.style.zoom = 1;6164 }6165 }6166 }6167 }6168 if ( jquery.isarray( prop[p] ) ) {6169 // create (if needed) and add to specialeasing6170 (opt.specialeasing = opt.specialeasing || {})[p] = prop[p][1];6171 prop[p] = prop[p][0];6172 }6173 }6174 if ( opt.overflow != null ) {6175 this.style.overflow = "hidden";6176 }6177 opt.curanim = jquery.extend({}, prop);6178 jquery.each( prop, function( name, val ) {6179 var e = new jquery.fx( self, opt, name );6180 if ( rfxtypes.test(val) ) {6181 e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );6182 } else {6183 var parts = rfxnum.exec(val),6184 start = e.cur();6185 if ( parts ) {6186 var end = parsefloat( parts[2] ),6187 unit = parts[3] || ( jquery.cssnumber[ name ] ? "" : "px" );6188 // we need to compute starting value6189 if ( unit !== "px" ) {6190 jquery.style( self, name, (end || 1) + unit);6191 start = ((end || 1) / e.cur()) * start;6192 jquery.style( self, name, start + unit);6193 }6194 // if a +=/-= token was provided, we're doing a relative animation6195 if ( parts[1] ) {6196 end = ((parts[1] === "-=" ? -1 : 1) * end) + start;6197 }6198 e.custom( start, end, unit );6199 } else {6200 e.custom( start, val, "" );6201 }6202 }6203 });6204 // for js strict compliance6205 return true;6206 });6207 },6208 stop: function( clearqueue, gotoend ) {6209 var timers = jquery.timers;6210 if ( clearqueue ) {6211 this.queue([]);6212 }6213 this.each(function() {6214 // go in reverse order so anything added to the queue during the loop is ignored6215 for ( var i = timers.length - 1; i >= 0; i-- ) {6216 if ( timers[i].elem === this ) {6217 if (gotoend) {6218 // force the next step to be the last6219 timers[i](true);6220 }6221 timers.splice(i, 1);6222 }6223 }6224 });6225 // start the next in the queue if the last step wasn't forced6226 if ( !gotoend ) {6227 this.dequeue();6228 }6229 return this;6230 }6231});6232function genfx( type, num ) {6233 var obj = {};6234 jquery.each( fxattrs.concat.apply([], fxattrs.slice(0,num)), function() {6235 obj[ this ] = type;6236 });6237 return obj;6238}6239// generate shortcuts for custom animations6240jquery.each({6241 slidedown: genfx("show", 1),6242 slideup: genfx("hide", 1),6243 slidetoggle: genfx("toggle", 1),6244 fadein: { opacity: "show" },6245 fadeout: { opacity: "hide" },6246 fadetoggle: { opacity: "toggle" }6247}, function( name, props ) {6248 jquery.fn[ name ] = function( speed, easing, callback ) {6249 return this.animate( props, speed, easing, callback );6250 };6251});6252jquery.extend({6253 speed: function( speed, easing, fn ) {6254 var opt = speed && typeof speed === "object" ? jquery.extend({}, speed) : {6255 complete: fn || !fn && easing ||6256 jquery.isfunction( speed ) && speed,6257 duration: speed,6258 easing: fn && easing || easing && !jquery.isfunction(easing) && easing6259 };6260 opt.duration = jquery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :6261 opt.duration in jquery.fx.speeds ? jquery.fx.speeds[opt.duration] : jquery.fx.speeds._default;6262 // queueing6263 opt.old = opt.complete;6264 opt.complete = function() {6265 if ( opt.queue !== false ) {6266 jquery(this).dequeue();6267 }6268 if ( jquery.isfunction( opt.old ) ) {6269 opt.old.call( this );6270 }6271 };6272 return opt;6273 },6274 easing: {6275 linear: function( p, n, firstnum, diff ) {6276 return firstnum + diff * p;6277 },6278 swing: function( p, n, firstnum, diff ) {6279 return ((-math.cos(p*math.pi)/2) + 0.5) * diff + firstnum;6280 }6281 },6282 timers: [],6283 fx: function( elem, options, prop ) {6284 this.options = options;6285 this.elem = elem;6286 this.prop = prop;6287 if ( !options.orig ) {6288 options.orig = {};6289 }6290 }6291});6292jquery.fx.prototype = {6293 // simple function for setting a style value6294 update: function() {6295 if ( this.options.step ) {6296 this.options.step.call( this.elem, this.now, this );6297 }6298 (jquery.fx.step[this.prop] || jquery.fx.step._default)( this );6299 },6300 // get the current size6301 cur: function() {6302 if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {6303 return this.elem[ this.prop ];6304 }6305 var parsed,6306 r = jquery.css( this.elem, this.prop );6307 // empty strings, null, undefined and "auto" are converted to 0,6308 // complex values such as "rotate(1rad)" are returned as is,6309 // simple values such as "10px" are parsed to float.6310 return isnan( parsed = parsefloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;6311 },6312 // start an animation from one number to another6313 custom: function( from, to, unit ) {6314 var self = this,6315 fx = jquery.fx;6316 this.starttime = jquery.now();6317 this.start = from;6318 this.end = to;6319 this.unit = unit || this.unit || ( jquery.cssnumber[ this.prop ] ? "" : "px" );6320 this.now = this.start;6321 this.pos = this.state = 0;6322 function t( gotoend ) {6323 return self.step(gotoend);6324 }6325 t.elem = this.elem;6326 if ( t() && jquery.timers.push(t) && !timerid ) {6327 timerid = setinterval(fx.tick, fx.interval);6328 }6329 },6330 // simple 'show' function6331 show: function() {6332 // remember where we started, so that we can go back to it later6333 this.options.orig[this.prop] = jquery.style( this.elem, this.prop );6334 this.options.show = true;6335 // begin the animation6336 // make sure that we start at a small width/height to avoid any6337 // flash of content6338 this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());6339 // start by showing the element6340 jquery( this.elem ).show();6341 },6342 // simple 'hide' function6343 hide: function() {6344 // remember where we started, so that we can go back to it later6345 this.options.orig[this.prop] = jquery.style( this.elem, this.prop );6346 this.options.hide = true;6347 // begin the animation6348 this.custom(this.cur(), 0);6349 },6350 // each step of an animation6351 step: function( gotoend ) {6352 var t = jquery.now(), done = true;6353 if ( gotoend || t >= this.options.duration + this.starttime ) {6354 this.now = this.end;6355 this.pos = this.state = 1;6356 this.update();6357 this.options.curanim[ this.prop ] = true;6358 for ( var i in this.options.curanim ) {6359 if ( this.options.curanim[i] !== true ) {6360 done = false;6361 }6362 }6363 if ( done ) {6364 // reset the overflow6365 if ( this.options.overflow != null && !jquery.support.shrinkwrapblocks ) {6366 var elem = this.elem,6367 options = this.options;6368 jquery.each( [ "", "x", "y" ], function (index, value) {6369 elem.style[ "overflow" + value ] = options.overflow[index];6370 } );6371 }6372 // hide the element if the "hide" operation was done6373 if ( this.options.hide ) {6374 jquery(this.elem).hide();6375 }6376 // reset the properties, if the item has been hidden or shown6377 if ( this.options.hide || this.options.show ) {6378 for ( var p in this.options.curanim ) {6379 jquery.style( this.elem, p, this.options.orig[p] );6380 }6381 }6382 // execute the complete function6383 this.options.complete.call( this.elem );6384 }6385 return false;6386 } else {6387 var n = t - this.starttime;6388 this.state = n / this.options.duration;6389 // perform the easing function, defaults to swing6390 var specialeasing = this.options.specialeasing && this.options.specialeasing[this.prop];6391 var defaulteasing = this.options.easing || (jquery.easing.swing ? "swing" : "linear");6392 this.pos = jquery.easing[specialeasing || defaulteasing](this.state, n, 0, 1, this.options.duration);6393 this.now = this.start + ((this.end - this.start) * this.pos);6394 // perform the next step of the animation6395 this.update();6396 }6397 return true;6398 }6399};6400jquery.extend( jquery.fx, {6401 tick: function() {6402 var timers = jquery.timers;6403 for ( var i = 0; i < timers.length; i++ ) {6404 if ( !timers[i]() ) {6405 timers.splice(i--, 1);6406 }6407 }6408 if ( !timers.length ) {6409 jquery.fx.stop();6410 }6411 },6412 interval: 13,6413 stop: function() {6414 clearinterval( timerid );6415 timerid = null;6416 },6417 speeds: {6418 slow: 600,6419 fast: 200,6420 // default speed6421 _default: 4006422 },6423 step: {6424 opacity: function( fx ) {6425 jquery.style( fx.elem, "opacity", fx.now );6426 },6427 _default: function( fx ) {6428 if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {6429 fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? math.max(0, fx.now) : fx.now) + fx.unit;6430 } else {6431 fx.elem[ fx.prop ] = fx.now;6432 }6433 }6434 }6435});6436if ( jquery.expr && jquery.expr.filters ) {6437 jquery.expr.filters.animated = function( elem ) {6438 return jquery.grep(jquery.timers, function( fn ) {6439 return elem === fn.elem;6440 }).length;6441 };6442}6443function defaultdisplay( nodename ) {6444 if ( !elemdisplay[ nodename ] ) {6445 var elem = jquery("<" + nodename + ">").appendto("body"),6446 display = elem.css("display");6447 elem.remove();6448 if ( display === "none" || display === "" ) {6449 display = "block";6450 }6451 elemdisplay[ nodename ] = display;6452 }6453 return elemdisplay[ nodename ];6454}6455var rtable = /^t(?:able|d|h)$/i,6456 rroot = /^(?:body|html)$/i;6457if ( "getboundingclientrect" in document.documentelement ) {6458 jquery.fn.offset = function( options ) {6459 var elem = this[0], box;6460 if ( options ) {6461 return this.each(function( i ) {6462 jquery.offset.setoffset( this, options, i );6463 });6464 }6465 if ( !elem || !elem.ownerdocument ) {6466 return null;6467 }6468 if ( elem === elem.ownerdocument.body ) {6469 return jquery.offset.bodyoffset( elem );6470 }6471 try {6472 box = elem.getboundingclientrect();6473 } catch(e) {}6474 var doc = elem.ownerdocument,6475 docelem = doc.documentelement;6476 // make sure we're not dealing with a disconnected dom node6477 if ( !box || !jquery.contains( docelem, elem ) ) {6478 return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };6479 }6480 var body = doc.body,6481 win = getwindow(doc),6482 clienttop = docelem.clienttop || body.clienttop || 0,6483 clientleft = docelem.clientleft || body.clientleft || 0,6484 scrolltop = (win.pageyoffset || jquery.support.boxmodel && docelem.scrolltop || body.scrolltop ),6485 scrollleft = (win.pagexoffset || jquery.support.boxmodel && docelem.scrollleft || body.scrollleft),6486 top = box.top + scrolltop - clienttop,6487 left = box.left + scrollleft - clientleft;6488 return { top: top, left: left };6489 };6490} else {6491 jquery.fn.offset = function( options ) {6492 var elem = this[0];6493 if ( options ) {6494 return this.each(function( i ) {6495 jquery.offset.setoffset( this, options, i );6496 });6497 }6498 if ( !elem || !elem.ownerdocument ) {6499 return null;6500 }6501 if ( elem === elem.ownerdocument.body ) {6502 return jquery.offset.bodyoffset( elem );6503 }6504 jquery.offset.initialize();6505 var computedstyle,6506 offsetparent = elem.offsetparent,6507 prevoffsetparent = elem,6508 doc = elem.ownerdocument,6509 docelem = doc.documentelement,6510 body = doc.body,6511 defaultview = doc.defaultview,6512 prevcomputedstyle = defaultview ? defaultview.getcomputedstyle( elem, null ) : elem.currentstyle,6513 top = elem.offsettop,6514 left = elem.offsetleft;6515 while ( (elem = elem.parentnode) && elem !== body && elem !== docelem ) {6516 if ( jquery.offset.supportsfixedposition && prevcomputedstyle.position === "fixed" ) {6517 break;6518 }6519 computedstyle = defaultview ? defaultview.getcomputedstyle(elem, null) : elem.currentstyle;6520 top -= elem.scrolltop;6521 left -= elem.scrollleft;6522 if ( elem === offsetparent ) {6523 top += elem.offsettop;6524 left += elem.offsetleft;6525 if ( jquery.offset.doesnotaddborder && !(jquery.offset.doesaddborderfortableandcells && rtable.test(elem.nodename)) ) {6526 top += parsefloat( computedstyle.bordertopwidth ) || 0;6527 left += parsefloat( computedstyle.borderleftwidth ) || 0;6528 }6529 prevoffsetparent = offsetparent;6530 offsetparent = elem.offsetparent;6531 }6532 if ( jquery.offset.subtractsborderforoverflownotvisible && computedstyle.overflow !== "visible" ) {6533 top += parsefloat( computedstyle.bordertopwidth ) || 0;6534 left += parsefloat( computedstyle.borderleftwidth ) || 0;6535 }6536 prevcomputedstyle = computedstyle;6537 }6538 if ( prevcomputedstyle.position === "relative" || prevcomputedstyle.position === "static" ) {6539 top += body.offsettop;6540 left += body.offsetleft;6541 }6542 if ( jquery.offset.supportsfixedposition && prevcomputedstyle.position === "fixed" ) {6543 top += math.max( docelem.scrolltop, body.scrolltop );6544 left += math.max( docelem.scrollleft, body.scrollleft );6545 }6546 return { top: top, left: left };6547 };6548}6549jquery.offset = {6550 initialize: function() {6551 var body = document.body, container = document.createelement("div"), innerdiv, checkdiv, table, td, bodymargintop = parsefloat( jquery.css(body, "margintop") ) || 0,6552 html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";6553 jquery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );6554 container.innerhtml = html;6555 body.insertbefore( container, body.firstchild );6556 innerdiv = container.firstchild;6557 checkdiv = innerdiv.firstchild;6558 td = innerdiv.nextsibling.firstchild.firstchild;6559 this.doesnotaddborder = (checkdiv.offsettop !== 5);6560 this.doesaddborderfortableandcells = (td.offsettop === 5);6561 checkdiv.style.position = "fixed";6562 checkdiv.style.top = "20px";6563 // safari subtracts parent border width here which is 5px6564 this.supportsfixedposition = (checkdiv.offsettop === 20 || checkdiv.offsettop === 15);6565 checkdiv.style.position = checkdiv.style.top = "";6566 innerdiv.style.overflow = "hidden";6567 innerdiv.style.position = "relative";6568 this.subtractsborderforoverflownotvisible = (checkdiv.offsettop === -5);6569 this.doesnotincludemargininbodyoffset = (body.offsettop !== bodymargintop);6570 body.removechild( container );6571 body = container = innerdiv = checkdiv = table = td = null;6572 jquery.offset.initialize = jquery.noop;6573 },6574 bodyoffset: function( body ) {6575 var top = body.offsettop,6576 left = body.offsetleft;6577 jquery.offset.initialize();6578 if ( jquery.offset.doesnotincludemargininbodyoffset ) {6579 top += parsefloat( jquery.css(body, "margintop") ) || 0;6580 left += parsefloat( jquery.css(body, "marginleft") ) || 0;6581 }6582 return { top: top, left: left };6583 },6584 setoffset: function( elem, options, i ) {6585 var position = jquery.css( elem, "position" );6586 // set position first, in-case top/left are set even on static elem6587 if ( position === "static" ) {6588 elem.style.position = "relative";6589 }6590 var curelem = jquery( elem ),6591 curoffset = curelem.offset(),6592 curcsstop = jquery.css( elem, "top" ),6593 curcssleft = jquery.css( elem, "left" ),6594 calculateposition = (position === "absolute" && jquery.inarray('auto', [curcsstop, curcssleft]) > -1),6595 props = {}, curposition = {}, curtop, curleft;6596 // need to be able to calculate position if either top or left is auto and position is absolute6597 if ( calculateposition ) {6598 curposition = curelem.position();6599 }6600 curtop = calculateposition ? curposition.top : parseint( curcsstop, 10 ) || 0;6601 curleft = calculateposition ? curposition.left : parseint( curcssleft, 10 ) || 0;6602 if ( jquery.isfunction( options ) ) {6603 options = options.call( elem, i, curoffset );6604 }6605 if (options.top != null) {6606 props.top = (options.top - curoffset.top) + curtop;6607 }6608 if (options.left != null) {6609 props.left = (options.left - curoffset.left) + curleft;6610 }6611 if ( "using" in options ) {6612 options.using.call( elem, props );6613 } else {6614 curelem.css( props );6615 }6616 }6617};6618jquery.fn.extend({6619 position: function() {6620 if ( !this[0] ) {6621 return null;6622 }6623 var elem = this[0],6624 // get *real* offsetparent6625 offsetparent = this.offsetparent(),6626 // get correct offsets6627 offset = this.offset(),6628 parentoffset = rroot.test(offsetparent[0].nodename) ? { top: 0, left: 0 } : offsetparent.offset();6629 // subtract element margins6630 // note: when an element has margin: auto the offsetleft and marginleft6631 // are the same in safari causing offset.left to incorrectly be 06632 offset.top -= parsefloat( jquery.css(elem, "margintop") ) || 0;6633 offset.left -= parsefloat( jquery.css(elem, "marginleft") ) || 0;6634 // add offsetparent borders6635 parentoffset.top += parsefloat( jquery.css(offsetparent[0], "bordertopwidth") ) || 0;6636 parentoffset.left += parsefloat( jquery.css(offsetparent[0], "borderleftwidth") ) || 0;6637 // subtract the two offsets6638 return {6639 top: offset.top - parentoffset.top,6640 left: offset.left - parentoffset.left6641 };6642 },6643 offsetparent: function() {6644 return this.map(function() {6645 var offsetparent = this.offsetparent || document.body;6646 while ( offsetparent && (!rroot.test(offsetparent.nodename) && jquery.css(offsetparent, "position") === "static") ) {6647 offsetparent = offsetparent.offsetparent;6648 }6649 return offsetparent;6650 });6651 }6652});6653// create scrollleft and scrolltop methods6654jquery.each( ["left", "top"], function( i, name ) {6655 var method = "scroll" + name;6656 jquery.fn[ method ] = function(val) {6657 var elem = this[0], win;6658 if ( !elem ) {6659 return null;6660 }6661 if ( val !== undefined ) {6662 // set the scroll offset6663 return this.each(function() {6664 win = getwindow( this );6665 if ( win ) {6666 win.scrollto(6667 !i ? val : jquery(win).scrollleft(),6668 i ? val : jquery(win).scrolltop()6669 );6670 } else {6671 this[ method ] = val;6672 }6673 });6674 } else {6675 win = getwindow( elem );6676 // return the scroll offset6677 return win ? ("pagexoffset" in win) ? win[ i ? "pageyoffset" : "pagexoffset" ] :6678 jquery.support.boxmodel && win.document.documentelement[ method ] ||6679 win.document.body[ method ] :6680 elem[ method ];6681 }6682 };6683});6684function getwindow( elem ) {6685 return jquery.iswindow( elem ) ?6686 elem :6687 elem.nodetype === 9 ?6688 elem.defaultview || elem.parentwindow :6689 false;6690}6691// create innerheight, innerwidth, outerheight and outerwidth methods6692jquery.each([ "height", "width" ], function( i, name ) {6693 var type = name.tolowercase();6694 // innerheight and innerwidth6695 jquery.fn["inner" + name] = function() {6696 return this[0] ?6697 parsefloat( jquery.css( this[0], type, "padding" ) ) :6698 null;6699 };6700 // outerheight and outerwidth6701 jquery.fn["outer" + name] = function( margin ) {6702 return this[0] ?6703 parsefloat( jquery.css( this[0], type, margin ? "margin" : "border" ) ) :6704 null;6705 };6706 jquery.fn[ type ] = function( size ) {6707 // get window width or height6708 var elem = this[0];6709 if ( !elem ) {6710 return size == null ? null : this;6711 }6712 if ( jquery.isfunction( size ) ) {6713 return this.each(function( i ) {6714 var self = jquery( this );6715 self[ type ]( size.call( this, i, self[ type ]() ) );6716 });6717 }6718 if ( jquery.iswindow( elem ) ) {6719 // everyone else use document.documentelement or document.body depending on quirks vs standards mode6720 // 3rd condition allows nokia support, as it supports the docelem prop but not css1compat6721 var docelemprop = elem.document.documentelement[ "client" + name ];6722 return elem.document.compatmode === "css1compat" && docelemprop ||6723 elem.document.body[ "client" + name ] || docelemprop;6724 // get document width or height6725 } else if ( elem.nodetype === 9 ) {6726 // either scroll[width/height] or offset[width/height], whichever is greater6727 return math.max(6728 elem.documentelement["client" + name],6729 elem.body["scroll" + name], elem.documentelement["scroll" + name],6730 elem.body["offset" + name], elem.documentelement["offset" + name]6731 );6732 // get or set width or height on the element6733 } else if ( size === undefined ) {6734 var orig = jquery.css( elem, type ),6735 ret = parsefloat( orig );6736 return jquery.isnan( ret ) ? orig : ret;6737 // set the width or height on the element (default to pixels if value is unitless)6738 } else {6739 return this.css( type, typeof size === "string" ? size : size + "px" );6740 }6741 };6742});6743window.jquery = window.$ = jquery;...
jquery-3.0.0.js
Source:jquery-3.0.0.js
...389 * @param {String} type390 */391function createInputPseudo( type ) {392 return function( elem ) {393 var name = elem.nodeName.toLowerCase();394 return name === "input" && elem.type === type;395 };396}397/**398 * Returns a function to use in pseudos for buttons399 * @param {String} type400 */401function createButtonPseudo( type ) {402 return function( elem ) {403 var name = elem.nodeName.toLowerCase();404 return (name === "input" || name === "button") && elem.type === type;405 };406}407/**408 * Returns a function to use in pseudos for :enabled/:disabled409 * @param {Boolean} disabled true for :disabled; false for :enabled410 */411function createDisabledPseudo( disabled ) {412 // Known :disabled false positives:413 // IE: *[disabled]:not(button, input, select, textarea, optgroup, option, menuitem, fieldset)414 // not IE: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable415 return function( elem ) {416 // Check form elements and option elements for explicit disabling417 return "label" in elem && elem.disabled === disabled ||418 "form" in elem && elem.disabled === disabled ||419 // Check non-disabled form elements for fieldset[disabled] ancestors420 "form" in elem && elem.disabled === false && (421 // Support: IE6-11+422 // Ancestry is covered for us423 elem.isDisabled === disabled ||424 // Otherwise, assume any non-<option> under fieldset[disabled] is disabled425 /* jshint -W018 */426 elem.isDisabled !== !disabled &&427 ("label" in elem || !disabledAncestor( elem )) !== disabled428 );429 };430}431/**432 * Returns a function to use in pseudos for positionals433 * @param {Function} fn434 */435function createPositionalPseudo( fn ) {436 return markFunction(function( argument ) {437 argument = +argument;438 return markFunction(function( seed, matches ) {439 var j,440 matchIndexes = fn( [], seed.length, argument ),441 i = matchIndexes.length;442 // Match elements found at the specified indexes443 while ( i-- ) {444 if ( seed[ (j = matchIndexes[i]) ] ) {445 seed[j] = !(matches[j] = seed[j]);446 }447 }448 });449 });450}451/**452 * Checks a node for validity as a Sizzle context453 * @param {Element|Object=} context454 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value455 */456function testContext( context ) {457 return context && typeof context.getElementsByTagName !== "undefined" && context;458}459// Expose support vars for convenience460support = Sizzle.support = {};461/**462 * Detects XML nodes463 * @param {Element|Object} elem An element or a document464 * @returns {Boolean} True iff elem is a non-HTML XML node465 */466isXML = Sizzle.isXML = function( elem ) {467 // documentElement is verified for cases where it doesn't yet exist468 // (such as loading iframes in IE - #4833)469 var documentElement = elem && (elem.ownerDocument || elem).documentElement;470 return documentElement ? documentElement.nodeName !== "HTML" : false;471};472/**473 * Sets document-related variables once based on the current document474 * @param {Element|Object} [doc] An element or document object to use to set the document475 * @returns {Object} Returns the current document476 */477setDocument = Sizzle.setDocument = function( node ) {478 var hasCompare, subWindow,479 doc = node ? node.ownerDocument || node : preferredDoc;480 // Return early if doc is invalid or already selected481 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {482 return document;483 }484 // Update global variables485 document = doc;486 docElem = document.documentElement;487 documentIsHTML = !isXML( document );488 // Support: IE 9-11, Edge489 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)490 if ( preferredDoc !== document &&491 (subWindow = document.defaultView) && subWindow.top !== subWindow ) {492 // Support: IE 11, Edge493 if ( subWindow.addEventListener ) {494 subWindow.addEventListener( "unload", unloadHandler, false );495 // Support: IE 9 - 10 only496 } else if ( subWindow.attachEvent ) {497 subWindow.attachEvent( "onunload", unloadHandler );498 }499 }500 /* Attributes501 ---------------------------------------------------------------------- */502 // Support: IE<8 1="" 7="" 9="" 12359="" 13378="" verify="" that="" getattribute="" really="" returns="" attributes="" and="" not="" properties="" (excepting="" ie8="" booleans)="" support.attributes="assert(function(" el="" )="" {="" el.classname="i" ;="" return="" !el.getattribute("classname");="" });="" *="" getelement(s)by*="" ----------------------------------------------------------------------="" check="" if="" getelementsbytagname("*")="" only="" elements="" support.getelementsbytagname="assert(function(" el.appendchild(="" document.createcomment("")="" );="" !el.getelementsbytagname("*").length;="" support:="" ie<9="" support.getelementsbyclassname="rnative.test(" document.getelementsbyclassname="" ie<10="" getelementbyid="" by="" name="" the="" broken="" methods="" don't="" pick="" up="" programmatically-set="" names,="" so="" use="" a="" roundabout="" getelementsbyname="" test="" support.getbyid="assert(function(" docelem.appendchild(="" ).id="expando;" !document.getelementsbyname="" ||="" !document.getelementsbyname(="" expando="" ).length;="" id="" find="" filter="" (="" expr.find["id"]="function(" id,="" context="" typeof="" context.getelementbyid="" !="=" "undefined"="" &&="" documentishtml="" var="" m="context.getElementById(" ?="" [="" ]="" :="" [];="" }="" };="" expr.filter["id"]="function(" attrid="id.replace(" runescape,="" funescape="" function(="" elem="" elem.getattribute("id")="==" attrid;="" else="" ie6="" is="" reliable="" as="" shortcut="" delete="" expr.find["id"];="" node="typeof" elem.getattributenode="" elem.getattributenode("id");="" node.value="==" tag="" expr.find["tag"]="support.getElementsByTagName" tag,="" context.getelementsbytagname="" context.getelementsbytagname(="" documentfragment="" nodes="" have="" gebtn="" support.qsa="" context.queryselectorall(="" elem,="" tmp="[]," i="0," happy="" coincidence,="" (broken)="" appears="" on="" too="" results="context.getElementsByTagName(" out="" possible="" comments="" "*"="" while="" (elem="results[i++])" elem.nodetype="==" tmp.push(="" tmp;="" results;="" class="" expr.find["class"]="support.getElementsByClassName" classname,="" context.getelementsbyclassname="" context.getelementsbyclassname(="" classname="" qsa="" matchesselector="" support="" matchesselector(:active)="" reports="" false="" when="" true="" (ie9="" opera="" 11.5)="" rbuggymatches="[];" qsa(:focus)="" (chrome="" 21)="" we="" allow="" this="" because="" of="" bug="" in="" throws="" an="" error="" whenever="" `document.activeelement`="" accessed="" iframe="" so,="" :focus="" to="" pass="" through="" all="" time="" avoid="" ie="" see="" https:="" bugs.jquery.com="" ticket="" rbuggyqsa="[];" (support.qsa="rnative.test(" document.queryselectorall="" ))="" build="" regex="" strategy="" adopted="" from="" diego="" perini="" assert(function(="" select="" set="" empty="" string="" purpose="" ie's="" treatment="" explicitly="" setting="" boolean="" content="" attribute,="" since="" its="" presence="" should="" be="" enough="" ).innerhtml="<a id='" +="" "'="">" +503 "<select id="" + expando + "-\r\\" msallowcapture="">" +504 "<option selected></option></select>";505 // Support: IE8, Opera 11-12.16506 // Nothing should be selected when empty strings follow ^= or $= or *=507 // The test attribute must be unknown in Opera but "safe" for WinRT508 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section509 if ( el.querySelectorAll("[msallowcapture^='']").length ) {510 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );511 }512 // Support: IE8513 // Boolean attributes and "value" are not treated correctly514 if ( !el.querySelectorAll("[selected]").length ) {515 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );516 }517 // Support: Chrome<29, android<4.4,="" safari<7.0+,="" ios<7.0+,="" phantomjs<1.9.8+="" if="" (="" !el.queryselectorall(="" "[id~=" + expando + " -]"="" ).length="" )="" {="" rbuggyqsa.push("~=");518 }519 // Webkit/Opera - :checked should return selected option elements520 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked521 // IE8 throws error here and will not see later tests522 if ( !el.querySelectorAll(" :checked").length="" rbuggyqsa.push(":checked");="" }="" support:="" safari="" 8+,="" ios="" 8+="" https:="" bugs.webkit.org="" show_bug.cgi?id="136851" in-page="" `selector#id="" sibling-combinator="" selector`="" fails="" "a#"="" +="" expando="" "+*"="" rbuggyqsa.push(".#.+[+~]");="" });="" assert(function(="" el="" el.innerhtml="<a href='' disabled='disabled'></a>" "<select="" disabled="disabled"><option>";523 // Support: Windows 8 Native Apps524 // The type and name attributes are restricted during .innerHTML assignment525 var input = document.createElement("input");526 input.setAttribute( "type", "hidden" );527 el.appendChild( input ).setAttribute( "name", "D" );528 // Support: IE8529 // Enforce case-sensitivity of name attribute530 if ( el.querySelectorAll("[name=d]").length ) {531 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );532 }533 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)534 // IE8 throws error here and will not see later tests535 if ( el.querySelectorAll(":enabled").length !== 2 ) {536 rbuggyQSA.push( ":enabled", ":disabled" );537 }538 // Support: IE9-11+539 // IE's :disabled selector does not pick up the children of disabled fieldsets540 docElem.appendChild( el ).disabled = true;541 if ( el.querySelectorAll(":disabled").length !== 2 ) {542 rbuggyQSA.push( ":enabled", ":disabled" );543 }544 // Opera 10-11 does not throw on post-comma invalid pseudos545 el.querySelectorAll("*,:x");546 rbuggyQSA.push(",.*:");547 });548 }549 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||550 docElem.webkitMatchesSelector ||551 docElem.mozMatchesSelector ||552 docElem.oMatchesSelector ||553 docElem.msMatchesSelector) )) ) {554 assert(function( el ) {555 // Check to see if it's possible to do matchesSelector556 // on a disconnected node (IE 9)557 support.disconnectedMatch = matches.call( el, "*" );558 // This should fail with an exception559 // Gecko does not error, returns false instead560 matches.call( el, "[s!='']:x" );561 rbuggyMatches.push( "!=", pseudos );562 });563 }564 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );565 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );566 /* Contains567 ---------------------------------------------------------------------- */568 hasCompare = rnative.test( docElem.compareDocumentPosition );569 // Element contains another570 // Purposefully self-exclusive571 // As in, an element does not contain itself572 contains = hasCompare || rnative.test( docElem.contains ) ?573 function( a, b ) {574 var adown = a.nodeType === 9 ? a.documentElement : a,575 bup = b && b.parentNode;576 return a === bup || !!( bup && bup.nodeType === 1 && (577 adown.contains ?578 adown.contains( bup ) :579 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16580 ));581 } :582 function( a, b ) {583 if ( b ) {584 while ( (b = b.parentNode) ) {585 if ( b === a ) {586 return true;587 }588 }589 }590 return false;591 };592 /* Sorting593 ---------------------------------------------------------------------- */594 // Document order sorting595 sortOrder = hasCompare ?596 function( a, b ) {597 // Flag for duplicate removal598 if ( a === b ) {599 hasDuplicate = true;600 return 0;601 }602 // Sort on method existence if only one input has compareDocumentPosition603 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;604 if ( compare ) {605 return compare;606 }607 // Calculate position if both inputs belong to the same document608 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?609 a.compareDocumentPosition( b ) :610 // Otherwise we know they are disconnected611 1;612 // Disconnected nodes613 if ( compare & 1 ||614 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {615 // Choose the first element that is related to our preferred document616 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {617 return -1;618 }619 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {620 return 1;621 }622 // Maintain original order623 return sortInput ?624 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :625 0;626 }627 return compare & 4 ? -1 : 1;628 } :629 function( a, b ) {630 // Exit early if the nodes are identical631 if ( a === b ) {632 hasDuplicate = true;633 return 0;634 }635 var cur,636 i = 0,637 aup = a.parentNode,638 bup = b.parentNode,639 ap = [ a ],640 bp = [ b ];641 // Parentless nodes are either documents or disconnected642 if ( !aup || !bup ) {643 return a === document ? -1 :644 b === document ? 1 :645 aup ? -1 :646 bup ? 1 :647 sortInput ?648 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :649 0;650 // If the nodes are siblings, we can do a quick check651 } else if ( aup === bup ) {652 return siblingCheck( a, b );653 }654 // Otherwise we need full lists of their ancestors for comparison655 cur = a;656 while ( (cur = cur.parentNode) ) {657 ap.unshift( cur );658 }659 cur = b;660 while ( (cur = cur.parentNode) ) {661 bp.unshift( cur );662 }663 // Walk down the tree looking for a discrepancy664 while ( ap[i] === bp[i] ) {665 i++;666 }667 return i ?668 // Do a sibling check if the nodes have a common ancestor669 siblingCheck( ap[i], bp[i] ) :670 // Otherwise nodes in our document sort first671 ap[i] === preferredDoc ? -1 :672 bp[i] === preferredDoc ? 1 :673 0;674 };675 return document;676};677Sizzle.matches = function( expr, elements ) {678 return Sizzle( expr, null, null, elements );679};680Sizzle.matchesSelector = function( elem, expr ) {681 // Set document vars if needed682 if ( ( elem.ownerDocument || elem ) !== document ) {683 setDocument( elem );684 }685 // Make sure that attribute selectors are quoted686 expr = expr.replace( rattributeQuotes, "='$1']" );687 if ( support.matchesSelector && documentIsHTML &&688 !compilerCache[ expr + " " ] &&689 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&690 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {691 try {692 var ret = matches.call( elem, expr );693 // IE 9's matchesSelector returns false on disconnected nodes694 if ( ret || support.disconnectedMatch ||695 // As well, disconnected nodes are said to be in a document696 // fragment in IE 9697 elem.document && elem.document.nodeType !== 11 ) {698 return ret;699 }700 } catch (e) {}701 }702 return Sizzle( expr, document, null, [ elem ] ).length > 0;703};704Sizzle.contains = function( context, elem ) {705 // Set document vars if needed706 if ( ( context.ownerDocument || context ) !== document ) {707 setDocument( context );708 }709 return contains( context, elem );710};711Sizzle.attr = function( elem, name ) {712 // Set document vars if needed713 if ( ( elem.ownerDocument || elem ) !== document ) {714 setDocument( elem );715 }716 var fn = Expr.attrHandle[ name.toLowerCase() ],717 // Don't get fooled by Object.prototype properties (jQuery #13807)718 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?719 fn( elem, name, !documentIsHTML ) :720 undefined;721 return val !== undefined ?722 val :723 support.attributes || !documentIsHTML ?724 elem.getAttribute( name ) :725 (val = elem.getAttributeNode(name)) && val.specified ?726 val.value :727 null;728};729Sizzle.escape = function( sel ) {730 return (sel + "").replace( rcssescape, fcssescape );731};732Sizzle.error = function( msg ) {733 throw new Error( "Syntax error, unrecognized expression: " + msg );734};735/**736 * Document sorting and removing duplicates737 * @param {ArrayLike} results738 */739Sizzle.uniqueSort = function( results ) {740 var elem,741 duplicates = [],742 j = 0,743 i = 0;744 // Unless we *know* we can detect duplicates, assume their presence745 hasDuplicate = !support.detectDuplicates;746 sortInput = !support.sortStable && results.slice( 0 );747 results.sort( sortOrder );748 if ( hasDuplicate ) {749 while ( (elem = results[i++]) ) {750 if ( elem === results[ i ] ) {751 j = duplicates.push( i );752 }753 }754 while ( j-- ) {755 results.splice( duplicates[ j ], 1 );756 }757 }758 // Clear input after sorting to release objects759 // See https://github.com/jquery/sizzle/pull/225760 sortInput = null;761 return results;762};763/**764 * Utility function for retrieving the text value of an array of DOM nodes765 * @param {Array|Element} elem766 */767getText = Sizzle.getText = function( elem ) {768 var node,769 ret = "",770 i = 0,771 nodeType = elem.nodeType;772 if ( !nodeType ) {773 // If no nodeType, this is expected to be an array774 while ( (node = elem[i++]) ) {775 // Do not traverse comment nodes776 ret += getText( node );777 }778 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {779 // Use textContent for elements780 // innerText usage removed for consistency of new lines (jQuery #11153)781 if ( typeof elem.textContent === "string" ) {782 return elem.textContent;783 } else {784 // Traverse its children785 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {786 ret += getText( elem );787 }788 }789 } else if ( nodeType === 3 || nodeType === 4 ) {790 return elem.nodeValue;791 }792 // Do not include comment or processing instruction nodes793 return ret;794};795Expr = Sizzle.selectors = {796 // Can be adjusted by the user797 cacheLength: 50,798 createPseudo: markFunction,799 match: matchExpr,800 attrHandle: {},801 find: {},802 relative: {803 ">": { dir: "parentNode", first: true },804 " ": { dir: "parentNode" },805 "+": { dir: "previousSibling", first: true },806 "~": { dir: "previousSibling" }807 },808 preFilter: {809 "ATTR": function( match ) {810 match[1] = match[1].replace( runescape, funescape );811 // Move the given value to match[3] whether quoted or unquoted812 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );813 if ( match[2] === "~=" ) {814 match[3] = " " + match[3] + " ";815 }816 return match.slice( 0, 4 );817 },818 "CHILD": function( match ) {819 /* matches from matchExpr["CHILD"]820 1 type (only|nth|...)821 2 what (child|of-type)822 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)823 4 xn-component of xn+y argument ([+-]?\d*n|)824 5 sign of xn-component825 6 x of xn-component826 7 sign of y-component827 8 y of y-component828 */829 match[1] = match[1].toLowerCase();830 if ( match[1].slice( 0, 3 ) === "nth" ) {831 // nth-* requires argument832 if ( !match[3] ) {833 Sizzle.error( match[0] );834 }835 // numeric x and y parameters for Expr.filter.CHILD836 // remember that false/true cast respectively to 0/1837 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );838 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );839 // other types prohibit arguments840 } else if ( match[3] ) {841 Sizzle.error( match[0] );842 }843 return match;844 },845 "PSEUDO": function( match ) {846 var excess,847 unquoted = !match[6] && match[2];848 if ( matchExpr["CHILD"].test( match[0] ) ) {849 return null;850 }851 // Accept quoted arguments as-is852 if ( match[3] ) {853 match[2] = match[4] || match[5] || "";854 // Strip excess characters from unquoted arguments855 } else if ( unquoted && rpseudo.test( unquoted ) &&856 // Get excess from tokenize (recursively)857 (excess = tokenize( unquoted, true )) &&858 // advance to the next closing parenthesis859 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {860 // excess is a negative index861 match[0] = match[0].slice( 0, excess );862 match[2] = unquoted.slice( 0, excess );863 }864 // Return only captures needed by the pseudo filter method (type and argument)865 return match.slice( 0, 3 );866 }867 },868 filter: {869 "TAG": function( nodeNameSelector ) {870 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();871 return nodeNameSelector === "*" ?872 function() { return true; } :873 function( elem ) {874 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;875 };876 },877 "CLASS": function( className ) {878 var pattern = classCache[ className + " " ];879 return pattern ||880 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&881 classCache( className, function( elem ) {882 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );883 });884 },885 "ATTR": function( name, operator, check ) {886 return function( elem ) {887 var result = Sizzle.attr( elem, name );888 if ( result == null ) {889 return operator === "!=";890 }891 if ( !operator ) {892 return true;893 }894 result += "";895 return operator === "=" ? result === check :896 operator === "!=" ? result !== check :897 operator === "^=" ? check && result.indexOf( check ) === 0 :898 operator === "*=" ? check && result.indexOf( check ) > -1 :899 operator === "$=" ? check && result.slice( -check.length ) === check :900 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :901 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :902 false;903 };904 },905 "CHILD": function( type, what, argument, first, last ) {906 var simple = type.slice( 0, 3 ) !== "nth",907 forward = type.slice( -4 ) !== "last",908 ofType = what === "of-type";909 return first === 1 && last === 0 ?910 // Shortcut for :nth-*(n)911 function( elem ) {912 return !!elem.parentNode;913 } :914 function( elem, context, xml ) {915 var cache, uniqueCache, outerCache, node, nodeIndex, start,916 dir = simple !== forward ? "nextSibling" : "previousSibling",917 parent = elem.parentNode,918 name = ofType && elem.nodeName.toLowerCase(),919 useCache = !xml && !ofType,920 diff = false;921 if ( parent ) {922 // :(first|last|only)-(child|of-type)923 if ( simple ) {924 while ( dir ) {925 node = elem;926 while ( (node = node[ dir ]) ) {927 if ( ofType ?928 node.nodeName.toLowerCase() === name :929 node.nodeType === 1 ) {930 return false;931 }932 }933 // Reverse direction for :only-* (if we haven't yet done so)934 start = dir = type === "only" && !start && "nextSibling";935 }936 return true;937 }938 start = [ forward ? parent.firstChild : parent.lastChild ];939 // non-xml :nth-child(...) stores cache data on `parent`940 if ( forward && useCache ) {941 // Seek `elem` from a previously-cached index942 // ...in a gzip-friendly way943 node = parent;944 outerCache = node[ expando ] || (node[ expando ] = {});945 // Support: IE <9 0="" 1="" 2="" only="" defend="" against="" cloned="" attroperties="" (jquery="" gh-1709)="" uniquecache="outerCache[" node.uniqueid="" ]="" ||="" (outercache[="" cache="uniqueCache[" type="" [];="" nodeindex="cache[" dirruns="" &&="" cache[="" ];="" diff="nodeIndex" node="nodeIndex" parent.childnodes[="" while="" (="" (node="++nodeIndex" node[="" dir="" fallback="" to="" seeking="" `elem`="" from="" the="" start="" (diff="nodeIndex" =="" 0)="" start.pop())="" )="" {="" when="" found,="" indexes="" on="" `parent`="" and="" break="" if="" node.nodetype="==" ++diff="" elem="" uniquecache[="" dirruns,="" nodeindex,="" break;="" }="" else="" use="" previously-cached="" element="" index="" available="" usecache="" ...in="" a="" gzip-friendly="" way="" outercache="node[" expando="" (node[="" support:="" ie="" <9="" xml="" :nth-child(...)="" or="" :nth-last-child(...)="" :nth(-last)?-of-type(...)="" false="" same="" loop as="" above="" seek="" oftype="" ?="" node.nodename.tolowercase()="==" name="" :="" of="" each="" encountered="" incorporate="" offset,="" then="" check="" cycle="" size="" -="last;" return="" first="" %="">= 0 );946 }947 };948 },949 "PSEUDO": function( pseudo, argument ) {950 // pseudo-class names are case-insensitive951 // http://www.w3.org/TR/selectors/#pseudo-classes952 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters953 // Remember that setFilters inherits from pseudos954 var args,955 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||956 Sizzle.error( "unsupported pseudo: " + pseudo );957 // The user may use createPseudo to indicate that958 // arguments are needed to create the filter function959 // just as Sizzle does960 if ( fn[ expando ] ) {961 return fn( argument );962 }963 // But maintain support for old signatures964 if ( fn.length > 1 ) {965 args = [ pseudo, pseudo, "", argument ];966 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?967 markFunction(function( seed, matches ) {968 var idx,969 matched = fn( seed, argument ),970 i = matched.length;971 while ( i-- ) {972 idx = indexOf( seed, matched[i] );973 seed[ idx ] = !( matches[ idx ] = matched[i] );974 }975 }) :976 function( elem ) {977 return fn( elem, 0, args );978 };979 }980 return fn;981 }982 },983 pseudos: {984 // Potentially complex pseudos985 "not": markFunction(function( selector ) {986 // Trim the selector passed to compile987 // to avoid treating leading and trailing988 // spaces as combinators989 var input = [],990 results = [],991 matcher = compile( selector.replace( rtrim, "$1" ) );992 return matcher[ expando ] ?993 markFunction(function( seed, matches, context, xml ) {994 var elem,995 unmatched = matcher( seed, null, xml, [] ),996 i = seed.length;997 // Match elements unmatched by `matcher`998 while ( i-- ) {999 if ( (elem = unmatched[i]) ) {1000 seed[i] = !(matches[i] = elem);1001 }1002 }1003 }) :1004 function( elem, context, xml ) {1005 input[0] = elem;1006 matcher( input, null, xml, results );1007 // Don't keep the element (issue #299)1008 input[0] = null;1009 return !results.pop();1010 };1011 }),1012 "has": markFunction(function( selector ) {1013 return function( elem ) {1014 return Sizzle( selector, elem ).length > 0;1015 };1016 }),1017 "contains": markFunction(function( text ) {1018 text = text.replace( runescape, funescape );1019 return function( elem ) {1020 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;1021 };1022 }),1023 // "Whether an element is represented by a :lang() selector1024 // is based solely on the element's language value1025 // being equal to the identifier C,1026 // or beginning with the identifier C immediately followed by "-".1027 // The matching of C against the element's language value is performed case-insensitively.1028 // The identifier C does not have to be a valid language name."1029 // http://www.w3.org/TR/selectors/#lang-pseudo1030 "lang": markFunction( function( lang ) {1031 // lang value must be a valid identifier1032 if ( !ridentifier.test(lang || "") ) {1033 Sizzle.error( "unsupported lang: " + lang );1034 }1035 lang = lang.replace( runescape, funescape ).toLowerCase();1036 return function( elem ) {1037 var elemLang;1038 do {1039 if ( (elemLang = documentIsHTML ?1040 elem.lang :1041 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {1042 elemLang = elemLang.toLowerCase();1043 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;1044 }1045 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );1046 return false;1047 };1048 }),1049 // Miscellaneous1050 "target": function( elem ) {1051 var hash = window.location && window.location.hash;1052 return hash && hash.slice( 1 ) === elem.id;1053 },1054 "root": function( elem ) {1055 return elem === docElem;1056 },1057 "focus": function( elem ) {1058 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);1059 },1060 // Boolean properties1061 "enabled": createDisabledPseudo( false ),1062 "disabled": createDisabledPseudo( true ),1063 "checked": function( elem ) {1064 // In CSS3, :checked should return both checked and selected elements1065 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked1066 var nodeName = elem.nodeName.toLowerCase();1067 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);1068 },1069 "selected": function( elem ) {1070 // Accessing this property makes selected-by-default1071 // options in Safari work properly1072 if ( elem.parentNode ) {1073 elem.parentNode.selectedIndex;1074 }1075 return elem.selected === true;1076 },1077 // Contents1078 "empty": function( elem ) {1079 // http://www.w3.org/TR/selectors/#empty-pseudo1080 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),1081 // but not by others (comment: 8; processing instruction: 7; etc.)1082 // nodeType < 6 works because attributes (2) do not appear as children1083 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {1084 if ( elem.nodeType < 6 ) {1085 return false;1086 }1087 }1088 return true;1089 },1090 "parent": function( elem ) {1091 return !Expr.pseudos["empty"]( elem );1092 },1093 // Element/input types1094 "header": function( elem ) {1095 return rheader.test( elem.nodeName );1096 },1097 "input": function( elem ) {1098 return rinputs.test( elem.nodeName );1099 },1100 "button": function( elem ) {1101 var name = elem.nodeName.toLowerCase();1102 return name === "input" && elem.type === "button" || name === "button";1103 },1104 "text": function( elem ) {1105 var attr;1106 return elem.nodeName.toLowerCase() === "input" &&1107 elem.type === "text" &&1108 // Support: IE<8 0="" 1="" new="" html5="" attribute="" values="" (e.g.,="" "search")="" appear="" with="" elem.type="==" "text"="" (="" (attr="elem.getAttribute("type"))" =="null" ||="" attr.tolowercase()="==" );="" },="" position-in-collection="" "first":="" createpositionalpseudo(function()="" {="" return="" [="" ];="" }),="" "last":="" createpositionalpseudo(function(="" matchindexes,="" length="" )="" -="" "eq":="" length,="" argument="" <="" ?="" +="" :="" "even":="" var="" i="0;" for="" ;="" length;="" matchindexes.push(="" }="" matchindexes;="" "odd":="" "lt":="" argument;="" --i="">= 0; ) {1109 matchIndexes.push( i );1110 }1111 return matchIndexes;1112 }),1113 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {1114 var i = argument < 0 ? argument + length : argument;1115 for ( ; ++i < length; ) {1116 matchIndexes.push( i );1117 }1118 return matchIndexes;1119 })1120 }1121};1122Expr.pseudos["nth"] = Expr.pseudos["eq"];1123// Add button/input type pseudos1124for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {1125 Expr.pseudos[ i ] = createInputPseudo( i );1126}1127for ( i in { submit: true, reset: true } ) {1128 Expr.pseudos[ i ] = createButtonPseudo( i );1129}1130// Easy API for creating new setFilters1131function setFilters() {}1132setFilters.prototype = Expr.filters = Expr.pseudos;1133Expr.setFilters = new setFilters();1134tokenize = Sizzle.tokenize = function( selector, parseOnly ) {1135 var matched, match, tokens, type,1136 soFar, groups, preFilters,1137 cached = tokenCache[ selector + " " ];1138 if ( cached ) {1139 return parseOnly ? 0 : cached.slice( 0 );1140 }1141 soFar = selector;1142 groups = [];1143 preFilters = Expr.preFilter;1144 while ( soFar ) {1145 // Comma and first run1146 if ( !matched || (match = rcomma.exec( soFar )) ) {1147 if ( match ) {1148 // Don't consume trailing commas as valid1149 soFar = soFar.slice( match[0].length ) || soFar;1150 }1151 groups.push( (tokens = []) );1152 }1153 matched = false;1154 // Combinators1155 if ( (match = rcombinators.exec( soFar )) ) {1156 matched = match.shift();1157 tokens.push({1158 value: matched,1159 // Cast descendant combinators to space1160 type: match[0].replace( rtrim, " " )1161 });1162 soFar = soFar.slice( matched.length );1163 }1164 // Filters1165 for ( type in Expr.filter ) {1166 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||1167 (match = preFilters[ type ]( match ))) ) {1168 matched = match.shift();1169 tokens.push({1170 value: matched,1171 type: type,1172 matches: match1173 });1174 soFar = soFar.slice( matched.length );1175 }1176 }1177 if ( !matched ) {1178 break;1179 }1180 }1181 // Return the length of the invalid excess1182 // if we're just parsing1183 // Otherwise, throw an error or return tokens1184 return parseOnly ?1185 soFar.length :1186 soFar ?1187 Sizzle.error( selector ) :1188 // Cache the tokens1189 tokenCache( selector, groups ).slice( 0 );1190};1191function toSelector( tokens ) {1192 var i = 0,1193 len = tokens.length,1194 selector = "";1195 for ( ; i < len; i++ ) {1196 selector += tokens[i].value;1197 }1198 return selector;1199}1200function addCombinator( matcher, combinator, base ) {1201 var dir = combinator.dir,1202 skip = combinator.next,1203 key = skip || dir,1204 checkNonElements = base && key === "parentNode",1205 doneName = done++;1206 return combinator.first ?1207 // Check against closest ancestor/preceding element1208 function( elem, context, xml ) {1209 while ( (elem = elem[ dir ]) ) {1210 if ( elem.nodeType === 1 || checkNonElements ) {1211 return matcher( elem, context, xml );1212 }1213 }1214 } :1215 // Check against all ancestor/preceding elements1216 function( elem, context, xml ) {1217 var oldCache, uniqueCache, outerCache,1218 newCache = [ dirruns, doneName ];1219 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching1220 if ( xml ) {1221 while ( (elem = elem[ dir ]) ) {1222 if ( elem.nodeType === 1 || checkNonElements ) {1223 if ( matcher( elem, context, xml ) ) {1224 return true;1225 }1226 }1227 }1228 } else {1229 while ( (elem = elem[ dir ]) ) {1230 if ( elem.nodeType === 1 || checkNonElements ) {1231 outerCache = elem[ expando ] || (elem[ expando ] = {});1232 // Support: IE <9 0="" 1="" 2="" only="" defend="" against="" cloned="" attroperties="" (jquery="" gh-1709)="" uniquecache="outerCache[" elem.uniqueid="" ]="" ||="" (outercache[="" if="" (="" skip="" &&="" elem.nodename.tolowercase()="" )="" {="" elem="elem[" dir="" elem;="" }="" else="" (oldcache="uniqueCache[" key="" ])="" oldcache[="" dirruns="" donename="" assign="" to="" newcache="" so="" results="" back-propagate="" previous="" elements="" return="" (newcache[="" ]);="" reuse="" uniquecache[="" a="" match="" means="" we're="" done;="" fail="" we="" have="" keep="" checking="" elem,="" context,="" xml="" ))="" true;="" };="" function="" elementmatcher(="" matchers="" matchers.length=""> 1 ?1233 function( elem, context, xml ) {1234 var i = matchers.length;1235 while ( i-- ) {1236 if ( !matchers[i]( elem, context, xml ) ) {1237 return false;1238 }1239 }1240 return true;1241 } :1242 matchers[0];1243}1244function multipleContexts( selector, contexts, results ) {1245 var i = 0,1246 len = contexts.length;1247 for ( ; i < len; i++ ) {1248 Sizzle( selector, contexts[i], results );1249 }1250 return results;1251}1252function condense( unmatched, map, filter, context, xml ) {1253 var elem,1254 newUnmatched = [],1255 i = 0,1256 len = unmatched.length,1257 mapped = map != null;1258 for ( ; i < len; i++ ) {1259 if ( (elem = unmatched[i]) ) {1260 if ( !filter || filter( elem, context, xml ) ) {1261 newUnmatched.push( elem );1262 if ( mapped ) {1263 map.push( i );1264 }1265 }1266 }1267 }1268 return newUnmatched;1269}1270function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {1271 if ( postFilter && !postFilter[ expando ] ) {1272 postFilter = setMatcher( postFilter );1273 }1274 if ( postFinder && !postFinder[ expando ] ) {1275 postFinder = setMatcher( postFinder, postSelector );1276 }1277 return markFunction(function( seed, results, context, xml ) {1278 var temp, i, elem,1279 preMap = [],1280 postMap = [],1281 preexisting = results.length,1282 // Get initial elements from seed or context1283 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),1284 // Prefilter to get matcher input, preserving a map for seed-results synchronization1285 matcherIn = preFilter && ( seed || !selector ) ?1286 condense( elems, preMap, preFilter, context, xml ) :1287 elems,1288 matcherOut = matcher ?1289 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,1290 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?1291 // ...intermediate processing is necessary1292 [] :1293 // ...otherwise use results directly1294 results :1295 matcherIn;1296 // Find primary matches1297 if ( matcher ) {1298 matcher( matcherIn, matcherOut, context, xml );1299 }1300 // Apply postFilter1301 if ( postFilter ) {1302 temp = condense( matcherOut, postMap );1303 postFilter( temp, [], context, xml );1304 // Un-match failing elements by moving them back to matcherIn1305 i = temp.length;1306 while ( i-- ) {1307 if ( (elem = temp[i]) ) {1308 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);1309 }1310 }1311 }1312 if ( seed ) {1313 if ( postFinder || preFilter ) {1314 if ( postFinder ) {1315 // Get the final matcherOut by condensing this intermediate into postFinder contexts1316 temp = [];1317 i = matcherOut.length;1318 while ( i-- ) {1319 if ( (elem = matcherOut[i]) ) {1320 // Restore matcherIn since elem is not yet a final match1321 temp.push( (matcherIn[i] = elem) );1322 }1323 }1324 postFinder( null, (matcherOut = []), temp, xml );1325 }1326 // Move matched elements from seed to results to keep them synchronized1327 i = matcherOut.length;1328 while ( i-- ) {1329 if ( (elem = matcherOut[i]) &&1330 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {1331 seed[temp] = !(results[temp] = elem);1332 }1333 }1334 }1335 // Add elements to results, through postFinder if defined1336 } else {1337 matcherOut = condense(1338 matcherOut === results ?1339 matcherOut.splice( preexisting, matcherOut.length ) :1340 matcherOut1341 );1342 if ( postFinder ) {1343 postFinder( null, results, matcherOut, xml );1344 } else {1345 push.apply( results, matcherOut );1346 }1347 }1348 });1349}1350function matcherFromTokens( tokens ) {1351 var checkContext, matcher, j,1352 len = tokens.length,1353 leadingRelative = Expr.relative[ tokens[0].type ],1354 implicitRelative = leadingRelative || Expr.relative[" "],1355 i = leadingRelative ? 1 : 0,1356 // The foundational matcher ensures that elements are reachable from top-level context(s)1357 matchContext = addCombinator( function( elem ) {1358 return elem === checkContext;1359 }, implicitRelative, true ),1360 matchAnyContext = addCombinator( function( elem ) {1361 return indexOf( checkContext, elem ) > -1;1362 }, implicitRelative, true ),1363 matchers = [ function( elem, context, xml ) {1364 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (1365 (checkContext = context).nodeType ?1366 matchContext( elem, context, xml ) :1367 matchAnyContext( elem, context, xml ) );1368 // Avoid hanging onto element (issue #299)1369 checkContext = null;1370 return ret;1371 } ];1372 for ( ; i < len; i++ ) {1373 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {1374 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];1375 } else {1376 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );1377 // Return special upon seeing a positional matcher1378 if ( matcher[ expando ] ) {1379 // Find the next relative operator (if any) for proper handling1380 j = ++i;1381 for ( ; j < len; j++ ) {1382 if ( Expr.relative[ tokens[j].type ] ) {1383 break;1384 }1385 }1386 return setMatcher(1387 i > 1 && elementMatcher( matchers ),1388 i > 1 && toSelector(1389 // If the preceding token was a descendant combinator, insert an implicit any-element `*`1390 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })1391 ).replace( rtrim, "$1" ),1392 matcher,1393 i < j && matcherFromTokens( tokens.slice( i, j ) ),1394 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),1395 j < len && toSelector( tokens )1396 );1397 }1398 matchers.push( matcher );1399 }1400 }1401 return elementMatcher( matchers );1402}1403function matcherFromGroupMatchers( elementMatchers, setMatchers ) {1404 var bySet = setMatchers.length > 0,1405 byElement = elementMatchers.length > 0,1406 superMatcher = function( seed, context, xml, results, outermost ) {1407 var elem, j, matcher,1408 matchedCount = 0,1409 i = "0",1410 unmatched = seed && [],1411 setMatched = [],1412 contextBackup = outermostContext,1413 // We must always have either seed elements or outermost context1414 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),1415 // Use integer dirruns iff this is the outermost matcher1416 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),1417 len = elems.length;1418 if ( outermost ) {1419 outermostContext = context === document || context || outermost;1420 }1421 // Add elements passing elementMatchers directly to results1422 // Support: IE<9, safari="" tolerate="" nodelist="" properties="" (ie:="" "length";="" safari:="" <number="">) matching elements by id1423 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {1424 if ( byElement && elem ) {1425 j = 0;1426 if ( !context && elem.ownerDocument !== document ) {1427 setDocument( elem );1428 xml = !documentIsHTML;1429 }1430 while ( (matcher = elementMatchers[j++]) ) {1431 if ( matcher( elem, context || document, xml) ) {1432 results.push( elem );1433 break;1434 }1435 }1436 if ( outermost ) {1437 dirruns = dirrunsUnique;1438 }1439 }1440 // Track unmatched elements for set filters1441 if ( bySet ) {1442 // They will have gone through all possible matchers1443 if ( (elem = !matcher && elem) ) {1444 matchedCount--;1445 }1446 // Lengthen the array for every element, matched or not1447 if ( seed ) {1448 unmatched.push( elem );1449 }1450 }1451 }1452 // `i` is now the count of elements visited above, and adding it to `matchedCount`1453 // makes the latter nonnegative.1454 matchedCount += i;1455 // Apply set filters to unmatched elements1456 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`1457 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have1458 // no element matchers and no seed.1459 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that1460 // case, which will result in a "00" `matchedCount` that differs from `i` but is also1461 // numerically zero.1462 if ( bySet && i !== matchedCount ) {1463 j = 0;1464 while ( (matcher = setMatchers[j++]) ) {1465 matcher( unmatched, setMatched, context, xml );1466 }1467 if ( seed ) {1468 // Reintegrate element matches to eliminate the need for sorting1469 if ( matchedCount > 0 ) {1470 while ( i-- ) {1471 if ( !(unmatched[i] || setMatched[i]) ) {1472 setMatched[i] = pop.call( results );1473 }1474 }1475 }1476 // Discard index placeholder values to get only actual matches1477 setMatched = condense( setMatched );1478 }1479 // Add matches to results1480 push.apply( results, setMatched );1481 // Seedless set matches succeeding multiple successful matchers stipulate sorting1482 if ( outermost && !seed && setMatched.length > 0 &&1483 ( matchedCount + setMatchers.length ) > 1 ) {1484 Sizzle.uniqueSort( results );1485 }1486 }1487 // Override manipulation of globals by nested matchers1488 if ( outermost ) {1489 dirruns = dirrunsUnique;1490 outermostContext = contextBackup;1491 }1492 return unmatched;1493 };1494 return bySet ?1495 markFunction( superMatcher ) :1496 superMatcher;1497}1498compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {1499 var i,1500 setMatchers = [],1501 elementMatchers = [],1502 cached = compilerCache[ selector + " " ];1503 if ( !cached ) {1504 // Generate a function of recursive functions that can be used to check each element1505 if ( !match ) {1506 match = tokenize( selector );1507 }1508 i = match.length;1509 while ( i-- ) {1510 cached = matcherFromTokens( match[i] );1511 if ( cached[ expando ] ) {1512 setMatchers.push( cached );1513 } else {1514 elementMatchers.push( cached );1515 }1516 }1517 // Cache the compiled function1518 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );1519 // Save selector and tokenization1520 cached.selector = selector;1521 }1522 return cached;1523};1524/**1525 * A low-level selection function that works with Sizzle's compiled1526 * selector functions1527 * @param {String|Function} selector A selector or a pre-compiled1528 * selector function built with Sizzle.compile1529 * @param {Element} context1530 * @param {Array} [results]1531 * @param {Array} [seed] A set of elements to match against1532 */1533select = Sizzle.select = function( selector, context, results, seed ) {1534 var i, tokens, token, type, find,1535 compiled = typeof selector === "function" && selector,1536 match = !seed && tokenize( (selector = compiled.selector || selector) );1537 results = results || [];1538 // Try to minimize operations if there is only one selector in the list and no seed1539 // (the latter of which guarantees us context)1540 if ( match.length === 1 ) {1541 // Reduce context if the leading compound selector is an ID1542 tokens = match[0] = match[0].slice( 0 );1543 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&1544 support.getById && context.nodeType === 9 && documentIsHTML &&1545 Expr.relative[ tokens[1].type ] ) {1546 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];1547 if ( !context ) {1548 return results;1549 // Precompiled matchers will still verify ancestry, so step up a level1550 } else if ( compiled ) {1551 context = context.parentNode;1552 }1553 selector = selector.slice( tokens.shift().value.length );1554 }1555 // Fetch a seed set for right-to-left matching1556 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;1557 while ( i-- ) {1558 token = tokens[i];1559 // Abort if we hit a combinator1560 if ( Expr.relative[ (type = token.type) ] ) {1561 break;1562 }1563 if ( (find = Expr.find[ type ]) ) {1564 // Search, expanding context for leading sibling combinators1565 if ( (seed = find(1566 token.matches[0].replace( runescape, funescape ),1567 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context1568 )) ) {1569 // If seed is empty or no tokens remain, we can return early1570 tokens.splice( i, 1 );1571 selector = seed.length && toSelector( tokens );1572 if ( !selector ) {1573 push.apply( results, seed );1574 return results;1575 }1576 break;1577 }1578 }1579 }1580 }1581 // Compile and execute a filtering function if one is not provided1582 // Provide `match` to avoid retokenization if we modified the selector above1583 ( compiled || compile( selector, match ) )(1584 seed,1585 context,1586 !documentIsHTML,1587 results,1588 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context1589 );1590 return results;1591};1592// One-time assignments1593// Sort stability1594support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;1595// Support: Chrome 14-35+1596// Always assume duplicates if they aren't passed to the comparison function1597support.detectDuplicates = !!hasDuplicate;1598// Initialize against the default document1599setDocument();1600// Support: Webkit<537.32 1="" 2="" 4="" 9="" 25="" -="" safari="" 6.0.3="" chrome="" (fixed="" in="" 27)="" detached="" nodes="" confoundingly="" follow="" *each="" other*="" support.sortdetached="assert(function(" el="" )="" {="" should="" return="" 1,="" but="" returns="" (following)="" el.comparedocumentposition(="" document.createelement("fieldset")="" &="" 1;="" });="" support:="" ie<8="" prevent="" attribute="" property="" "interpolation"="" https:="" msdn.microsoft.com="" en-us="" library="" ms536429%28vs.85%29.aspx="" if="" (="" !assert(function(="" el.innerhtml="<a href='#'></a>" ;="" el.firstchild.getattribute("href")="==" "#"="" })="" addhandle(="" "type|href|height|width",="" function(="" elem,="" name,="" isxml="" !isxml="" elem.getattribute(="" name.tolowercase()="==" "type"="" ?="" :="" );="" }="" ie<9="" use="" defaultvalue="" place="" of="" getattribute("value")="" !support.attributes="" ||="" el.firstchild.setattribute(="" "value",="" ""="" el.firstchild.getattribute(="" "value"="" "";="" &&="" elem.nodename.tolowercase()="==" "input"="" elem.defaultvalue;="" getattributenode="" to="" fetch="" booleans="" when="" getattribute="" lies="" el.getattribute("disabled")="=" null;="" booleans,="" var="" val;="" elem[="" name="" ]="==" true="" (val="elem.getAttributeNode(" ))="" val.specified="" val.value="" sizzle;="" })(="" window="" jquery.find="Sizzle;" jquery.expr="Sizzle.selectors;" deprecated="" jquery.expr[="" ":"="" jquery.uniquesort="jQuery.unique" =="" sizzle.uniquesort;="" jquery.text="Sizzle.getText;" jquery.isxmldoc="Sizzle.isXML;" jquery.contains="Sizzle.contains;" jquery.escapeselector="Sizzle.escape;" dir="function(" dir,="" until="" matched="[]," truncate="until" !="=" undefined;="" while="" elem="elem[" elem.nodetype="" jquery(="" ).is(="" break;="" matched.push(="" matched;="" };="" siblings="function(" n,="" for="" n;="" n="n.nextSibling" n.nodetype="==" rneedscontext="jQuery.expr.match.needsContext;" rsingletag="(" ^<([a-z][^\="" \0="">:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\ \1="">|)$/i );1601var risSimple = /^.[^:#\[\.,]*$/;1602// Implement the identical functionality for filter and not1603function winnow( elements, qualifier, not ) {1604 if ( jQuery.isFunction( qualifier ) ) {1605 return jQuery.grep( elements, function( elem, i ) {1606 /* jshint -W018 */1607 return !!qualifier.call( elem, i, elem ) !== not;1608 } );1609 }1610 if ( qualifier.nodeType ) {1611 return jQuery.grep( elements, function( elem ) {1612 return ( elem === qualifier ) !== not;1613 } );1614 }1615 if ( typeof qualifier === "string" ) {1616 if ( risSimple.test( qualifier ) ) {1617 return jQuery.filter( qualifier, elements, not );1618 }1619 qualifier = jQuery.filter( qualifier, elements );1620 }1621 return jQuery.grep( elements, function( elem ) {1622 return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;1623 } );1624}1625jQuery.filter = function( expr, elems, not ) {1626 var elem = elems[ 0 ];1627 if ( not ) {1628 expr = ":not(" + expr + ")";1629 }1630 return elems.length === 1 && elem.nodeType === 1 ?1631 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :1632 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {1633 return elem.nodeType === 1;1634 } ) );1635};1636jQuery.fn.extend( {1637 find: function( selector ) {1638 var i, ret,1639 len = this.length,1640 self = this;1641 if ( typeof selector !== "string" ) {1642 return this.pushStack( jQuery( selector ).filter( function() {1643 for ( i = 0; i < len; i++ ) {1644 if ( jQuery.contains( self[ i ], this ) ) {1645 return true;1646 }1647 }1648 } ) );1649 }1650 ret = this.pushStack( [] );1651 for ( i = 0; i < len; i++ ) {1652 jQuery.find( selector, self[ i ], ret );1653 }1654 return len > 1 ? jQuery.uniqueSort( ret ) : ret;1655 },1656 filter: function( selector ) {1657 return this.pushStack( winnow( this, selector || [], false ) );1658 },1659 not: function( selector ) {1660 return this.pushStack( winnow( this, selector || [], true ) );1661 },1662 is: function( selector ) {1663 return !!winnow(1664 this,1665 // If this is a positional/relative selector, check membership in the returned set1666 // so $("p:first").is("p:last") won't return true for a doc with two "p".1667 typeof selector === "string" && rneedsContext.test( selector ) ?1668 jQuery( selector ) :1669 selector || [],1670 false1671 ).length;1672 }1673} );1674// Initialize a jQuery object1675// A central reference to the root jQuery(document)1676var rootjQuery,1677 // A simple way to check for HTML strings1678 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)1679 // Strict HTML recognition (#11290: must start with <) shortcut="" simple="" #id="" case="" for="" speed="" rquickexpr="/^(?:\s*(<[\w\W]+">)[^>]*|#([\w-]+))$/,1680 init = jQuery.fn.init = function( selector, context, root ) {1681 var match, elem;1682 // HANDLE: $(""), $(null), $(undefined), $(false)1683 if ( !selector ) {1684 return this;1685 }1686 // Method init() accepts an alternate rootjQuery1687 // so migrate can support jQuery.sub (gh-2101)1688 root = root || rootjQuery;1689 // Handle HTML strings1690 if ( typeof selector === "string" ) {1691 if ( selector[ 0 ] === "<" 1="" &&="" selector[="" selector.length="" -="" ]="==" "="">" &&1692 selector.length >= 3 ) {1693 // Assume that strings that start and end with <> are HTML and skip the regex check1694 match = [ null, selector, null ];1695 } else {1696 match = rquickExpr.exec( selector );1697 }1698 // Match html or make sure no context is specified for #id1699 if ( match && ( match[ 1 ] || !context ) ) {1700 // HANDLE: $(html) -> $(array)1701 if ( match[ 1 ] ) {1702 context = context instanceof jQuery ? context[ 0 ] : context;1703 // Option to run scripts is true for back-compat1704 // Intentionally let the error be thrown if parseHTML is not present1705 jQuery.merge( this, jQuery.parseHTML(1706 match[ 1 ],1707 context && context.nodeType ? context.ownerDocument || context : document,1708 true1709 ) );1710 // HANDLE: $(html, props)1711 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {1712 for ( match in context ) {1713 // Properties of context are called as methods if possible1714 if ( jQuery.isFunction( this[ match ] ) ) {1715 this[ match ]( context[ match ] );1716 // ...and otherwise set as attributes1717 } else {1718 this.attr( match, context[ match ] );1719 }1720 }1721 }1722 return this;1723 // HANDLE: $(#id)1724 } else {1725 elem = document.getElementById( match[ 2 ] );1726 if ( elem ) {1727 // Inject the element directly into the jQuery object1728 this[ 0 ] = elem;1729 this.length = 1;1730 }1731 return this;1732 }1733 // HANDLE: $(expr, $(...))1734 } else if ( !context || context.jquery ) {1735 return ( context || root ).find( selector );1736 // HANDLE: $(expr, context)1737 // (which is just equivalent to: $(context).find(expr)1738 } else {1739 return this.constructor( context ).find( selector );1740 }1741 // HANDLE: $(DOMElement)1742 } else if ( selector.nodeType ) {1743 this[ 0 ] = selector;1744 this.length = 1;1745 return this;1746 // HANDLE: $(function)1747 // Shortcut for document ready1748 } else if ( jQuery.isFunction( selector ) ) {1749 return root.ready !== undefined ?1750 root.ready( selector ) :1751 // Execute immediately if ready is not present1752 selector( jQuery );1753 }1754 return jQuery.makeArray( selector, this );1755 };1756// Give the init function the jQuery prototype for later instantiation1757init.prototype = jQuery.fn;1758// Initialize central reference1759rootjQuery = jQuery( document );1760var rparentsprev = /^(?:parents|prev(?:Until|All))/,1761 // Methods guaranteed to produce a unique set when starting from a unique set1762 guaranteedUnique = {1763 children: true,1764 contents: true,1765 next: true,1766 prev: true1767 };1768jQuery.fn.extend( {1769 has: function( target ) {1770 var targets = jQuery( target, this ),1771 l = targets.length;1772 return this.filter( function() {1773 var i = 0;1774 for ( ; i < l; i++ ) {1775 if ( jQuery.contains( this, targets[ i ] ) ) {1776 return true;1777 }1778 }1779 } );1780 },1781 closest: function( selectors, context ) {1782 var cur,1783 i = 0,1784 l = this.length,1785 matched = [],1786 targets = typeof selectors !== "string" && jQuery( selectors );1787 // Positional selectors never match, since there's no _selection_ context1788 if ( !rneedsContext.test( selectors ) ) {1789 for ( ; i < l; i++ ) {1790 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {1791 // Always skip document fragments1792 if ( cur.nodeType < 11 && ( targets ?1793 targets.index( cur ) > -1 :1794 // Don't pass non-elements to Sizzle1795 cur.nodeType === 1 &&1796 jQuery.find.matchesSelector( cur, selectors ) ) ) {1797 matched.push( cur );1798 break;1799 }1800 }1801 }1802 }1803 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );1804 },1805 // Determine the position of an element within the set1806 index: function( elem ) {1807 // No argument, return index in parent1808 if ( !elem ) {1809 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;1810 }1811 // Index in selector1812 if ( typeof elem === "string" ) {1813 return indexOf.call( jQuery( elem ), this[ 0 ] );1814 }1815 // Locate the position of the desired element1816 return indexOf.call( this,1817 // If it receives a jQuery object, the first element is used1818 elem.jquery ? elem[ 0 ] : elem1819 );1820 },1821 add: function( selector, context ) {1822 return this.pushStack(1823 jQuery.uniqueSort(1824 jQuery.merge( this.get(), jQuery( selector, context ) )1825 )1826 );1827 },1828 addBack: function( selector ) {1829 return this.add( selector == null ?1830 this.prevObject : this.prevObject.filter( selector )1831 );1832 }1833} );1834function sibling( cur, dir ) {1835 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}1836 return cur;1837}1838jQuery.each( {1839 parent: function( elem ) {1840 var parent = elem.parentNode;1841 return parent && parent.nodeType !== 11 ? parent : null;1842 },1843 parents: function( elem ) {1844 return dir( elem, "parentNode" );1845 },1846 parentsUntil: function( elem, i, until ) {1847 return dir( elem, "parentNode", until );1848 },1849 next: function( elem ) {1850 return sibling( elem, "nextSibling" );1851 },1852 prev: function( elem ) {1853 return sibling( elem, "previousSibling" );1854 },1855 nextAll: function( elem ) {1856 return dir( elem, "nextSibling" );1857 },1858 prevAll: function( elem ) {1859 return dir( elem, "previousSibling" );1860 },1861 nextUntil: function( elem, i, until ) {1862 return dir( elem, "nextSibling", until );1863 },1864 prevUntil: function( elem, i, until ) {1865 return dir( elem, "previousSibling", until );1866 },1867 siblings: function( elem ) {1868 return siblings( ( elem.parentNode || {} ).firstChild, elem );1869 },1870 children: function( elem ) {1871 return siblings( elem.firstChild );1872 },1873 contents: function( elem ) {1874 return elem.contentDocument || jQuery.merge( [], elem.childNodes );1875 }1876}, function( name, fn ) {1877 jQuery.fn[ name ] = function( until, selector ) {1878 var matched = jQuery.map( this, fn, until );1879 if ( name.slice( -5 ) !== "Until" ) {1880 selector = until;1881 }1882 if ( selector && typeof selector === "string" ) {1883 matched = jQuery.filter( selector, matched );1884 }1885 if ( this.length > 1 ) {1886 // Remove duplicates1887 if ( !guaranteedUnique[ name ] ) {1888 jQuery.uniqueSort( matched );1889 }1890 // Reverse order for parents* and prev-derivatives1891 if ( rparentsprev.test( name ) ) {1892 matched.reverse();1893 }1894 }1895 return this.pushStack( matched );1896 };1897} );1898var rnotwhite = ( /\S+/g );1899// Convert String-formatted options into Object-formatted ones1900function createOptions( options ) {1901 var object = {};1902 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {1903 object[ flag ] = true;1904 } );1905 return object;1906}1907/*1908 * Create a callback list using the following parameters:1909 *1910 * options: an optional list of space-separated options that will change how1911 * the callback list behaves or a more traditional option object1912 *1913 * By default a callback list will act like an event callback list and can be1914 * "fired" multiple times.1915 *1916 * Possible options:1917 *1918 * once: will ensure the callback list can only be fired once (like a Deferred)1919 *1920 * memory: will keep track of previous values and will call any callback added1921 * after the list has been fired right away with the latest "memorized"1922 * values (like a Deferred)1923 *1924 * unique: will ensure a callback can only be added once (no duplicate in the list)1925 *1926 * stopOnFalse: interrupt callings when a callback returns false1927 *1928 */1929jQuery.Callbacks = function( options ) {1930 // Convert options from String-formatted to Object-formatted if needed1931 // (we check in cache first)1932 options = typeof options === "string" ?1933 createOptions( options ) :1934 jQuery.extend( {}, options );1935 var // Flag to know if list is currently firing1936 firing,1937 // Last fire value for non-forgettable lists1938 memory,1939 // Flag to know if list was already fired1940 fired,1941 // Flag to prevent firing1942 locked,1943 // Actual callback list1944 list = [],1945 // Queue of execution data for repeatable lists1946 queue = [],1947 // Index of currently firing callback (modified by add/remove as needed)1948 firingIndex = -1,1949 // Fire callbacks1950 fire = function() {1951 // Enforce single-firing1952 locked = options.once;1953 // Execute callbacks for all pending executions,1954 // respecting firingIndex overrides and runtime changes1955 fired = firing = true;1956 for ( ; queue.length; firingIndex = -1 ) {1957 memory = queue.shift();1958 while ( ++firingIndex < list.length ) {1959 // Run callback and check for early termination1960 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&1961 options.stopOnFalse ) {1962 // Jump to end and forget the data so .add doesn't re-fire1963 firingIndex = list.length;1964 memory = false;1965 }1966 }1967 }1968 // Forget the data if we're done with it1969 if ( !options.memory ) {1970 memory = false;1971 }1972 firing = false;1973 // Clean up if we're done firing for good1974 if ( locked ) {1975 // Keep an empty list if we have data for future add calls1976 if ( memory ) {1977 list = [];1978 // Otherwise, this object is spent1979 } else {1980 list = "";1981 }1982 }1983 },1984 // Actual Callbacks object1985 self = {1986 // Add a callback or a collection of callbacks to the list1987 add: function() {1988 if ( list ) {1989 // If we have memory from a past run, we should fire after adding1990 if ( memory && !firing ) {1991 firingIndex = list.length - 1;1992 queue.push( memory );1993 }1994 ( function add( args ) {1995 jQuery.each( args, function( _, arg ) {1996 if ( jQuery.isFunction( arg ) ) {1997 if ( !options.unique || !self.has( arg ) ) {1998 list.push( arg );1999 }2000 } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {2001 // Inspect recursively2002 add( arg );2003 }2004 } );2005 } )( arguments );2006 if ( memory && !firing ) {2007 fire();2008 }2009 }2010 return this;2011 },2012 // Remove a callback from the list2013 remove: function() {2014 jQuery.each( arguments, function( _, arg ) {2015 var index;2016 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {2017 list.splice( index, 1 );2018 // Handle firing indexes2019 if ( index <= firingindex="" )="" {="" firingindex--;="" }="" );="" return="" this;="" },="" check="" if="" a="" given="" callback="" is="" in="" the="" list.="" no="" argument="" given,="" whether="" or="" not="" list="" has="" callbacks="" attached.="" has:="" function(="" fn="" ?="" jquery.inarray(="" fn,=""> -1 :2020 list.length > 0;2021 },2022 // Remove all callbacks from the list2023 empty: function() {2024 if ( list ) {2025 list = [];2026 }2027 return this;2028 },2029 // Disable .fire and .add2030 // Abort any current/pending executions2031 // Clear all callbacks and values2032 disable: function() {2033 locked = queue = [];2034 list = memory = "";2035 return this;2036 },2037 disabled: function() {2038 return !list;2039 },2040 // Disable .fire2041 // Also disable .add unless we have memory (since it would have no effect)2042 // Abort any pending executions2043 lock: function() {2044 locked = queue = [];2045 if ( !memory && !firing ) {2046 list = memory = "";2047 }2048 return this;2049 },2050 locked: function() {2051 return !!locked;2052 },2053 // Call all callbacks with the given context and arguments2054 fireWith: function( context, args ) {2055 if ( !locked ) {2056 args = args || [];2057 args = [ context, args.slice ? args.slice() : args ];2058 queue.push( args );2059 if ( !firing ) {2060 fire();2061 }2062 }2063 return this;2064 },2065 // Call all the callbacks with the given arguments2066 fire: function() {2067 self.fireWith( this, arguments );2068 return this;2069 },2070 // To know if the callbacks have already been called at least once2071 fired: function() {2072 return !!fired;2073 }2074 };2075 return self;2076};2077function Identity( v ) {2078 return v;2079}2080function Thrower( ex ) {2081 throw ex;2082}2083function adoptValue( value, resolve, reject ) {2084 var method;2085 try {2086 // Check for promise aspect first to privilege synchronous behavior2087 if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {2088 method.call( value ).done( resolve ).fail( reject );2089 // Other thenables2090 } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {2091 method.call( value, resolve, reject );2092 // Other non-thenables2093 } else {2094 // Support: Android 4.0 only2095 // Strict mode functions invoked without .call/.apply get global-object context2096 resolve.call( undefined, value );2097 }2098 // For Promises/A+, convert exceptions into rejections2099 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in2100 // Deferred#then to conditionally suppress rejection.2101 } catch ( /*jshint -W002 */ value ) {2102 // Support: Android 4.0 only2103 // Strict mode functions invoked without .call/.apply get global-object context2104 reject.call( undefined, value );2105 }2106}2107jQuery.extend( {2108 Deferred: function( func ) {2109 var tuples = [2110 // action, add listener, callbacks,2111 // ... .then handlers, argument index, [final state]2112 [ "notify", "progress", jQuery.Callbacks( "memory" ),2113 jQuery.Callbacks( "memory" ), 2 ],2114 [ "resolve", "done", jQuery.Callbacks( "once memory" ),2115 jQuery.Callbacks( "once memory" ), 0, "resolved" ],2116 [ "reject", "fail", jQuery.Callbacks( "once memory" ),2117 jQuery.Callbacks( "once memory" ), 1, "rejected" ]2118 ],2119 state = "pending",2120 promise = {2121 state: function() {2122 return state;2123 },2124 always: function() {2125 deferred.done( arguments ).fail( arguments );2126 return this;2127 },2128 "catch": function( fn ) {2129 return promise.then( null, fn );2130 },2131 // Keep pipe for back-compat2132 pipe: function( /* fnDone, fnFail, fnProgress */ ) {2133 var fns = arguments;2134 return jQuery.Deferred( function( newDefer ) {2135 jQuery.each( tuples, function( i, tuple ) {2136 // Map tuples (progress, done, fail) to arguments (done, fail, progress)2137 var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];2138 // deferred.progress(function() { bind to newDefer or newDefer.notify })2139 // deferred.done(function() { bind to newDefer or newDefer.resolve })2140 // deferred.fail(function() { bind to newDefer or newDefer.reject })2141 deferred[ tuple[ 1 ] ]( function() {2142 var returned = fn && fn.apply( this, arguments );2143 if ( returned && jQuery.isFunction( returned.promise ) ) {2144 returned.promise()2145 .progress( newDefer.notify )2146 .done( newDefer.resolve )2147 .fail( newDefer.reject );2148 } else {2149 newDefer[ tuple[ 0 ] + "With" ](2150 this,2151 fn ? [ returned ] : arguments2152 );2153 }2154 } );2155 } );2156 fns = null;2157 } ).promise();2158 },2159 then: function( onFulfilled, onRejected, onProgress ) {2160 var maxDepth = 0;2161 function resolve( depth, deferred, handler, special ) {2162 return function() {2163 var that = this,2164 args = arguments,2165 mightThrow = function() {2166 var returned, then;2167 // Support: Promises/A+ section 2.3.3.3.32168 // https://promisesaplus.com/#point-592169 // Ignore double-resolution attempts2170 if ( depth < maxDepth ) {2171 return;2172 }2173 returned = handler.apply( that, args );2174 // Support: Promises/A+ section 2.3.12175 // https://promisesaplus.com/#point-482176 if ( returned === deferred.promise() ) {2177 throw new TypeError( "Thenable self-resolution" );2178 }2179 // Support: Promises/A+ sections 2.3.3.1, 3.52180 // https://promisesaplus.com/#point-542181 // https://promisesaplus.com/#point-752182 // Retrieve `then` only once2183 then = returned &&2184 // Support: Promises/A+ section 2.3.42185 // https://promisesaplus.com/#point-642186 // Only check objects and functions for thenability2187 ( typeof returned === "object" ||2188 typeof returned === "function" ) &&2189 returned.then;2190 // Handle a returned thenable2191 if ( jQuery.isFunction( then ) ) {2192 // Special processors (notify) just wait for resolution2193 if ( special ) {2194 then.call(2195 returned,2196 resolve( maxDepth, deferred, Identity, special ),2197 resolve( maxDepth, deferred, Thrower, special )2198 );2199 // Normal processors (resolve) also hook into progress2200 } else {2201 // ...and disregard older resolution values2202 maxDepth++;2203 then.call(2204 returned,2205 resolve( maxDepth, deferred, Identity, special ),2206 resolve( maxDepth, deferred, Thrower, special ),2207 resolve( maxDepth, deferred, Identity,2208 deferred.notifyWith )2209 );2210 }2211 // Handle all other returned values2212 } else {2213 // Only substitute handlers pass on context2214 // and multiple values (non-spec behavior)2215 if ( handler !== Identity ) {2216 that = undefined;2217 args = [ returned ];2218 }2219 // Process the value(s)2220 // Default process is resolve2221 ( special || deferred.resolveWith )( that, args );2222 }2223 },2224 // Only normal processors (resolve) catch and reject exceptions2225 process = special ?2226 mightThrow :2227 function() {2228 try {2229 mightThrow();2230 } catch ( e ) {2231 if ( jQuery.Deferred.exceptionHook ) {2232 jQuery.Deferred.exceptionHook( e,2233 process.stackTrace );2234 }2235 // Support: Promises/A+ section 2.3.3.3.4.12236 // https://promisesaplus.com/#point-612237 // Ignore post-resolution exceptions2238 if ( depth + 1 >= maxDepth ) {2239 // Only substitute handlers pass on context2240 // and multiple values (non-spec behavior)2241 if ( handler !== Thrower ) {2242 that = undefined;2243 args = [ e ];2244 }2245 deferred.rejectWith( that, args );2246 }2247 }2248 };2249 // Support: Promises/A+ section 2.3.3.3.12250 // https://promisesaplus.com/#point-572251 // Re-resolve promises immediately to dodge false rejection from2252 // subsequent errors2253 if ( depth ) {2254 process();2255 } else {2256 // Call an optional hook to record the stack, in case of exception2257 // since it's otherwise lost when execution goes async2258 if ( jQuery.Deferred.getStackHook ) {2259 process.stackTrace = jQuery.Deferred.getStackHook();2260 }2261 window.setTimeout( process );2262 }2263 };2264 }2265 return jQuery.Deferred( function( newDefer ) {2266 // progress_handlers.add( ... )2267 tuples[ 0 ][ 3 ].add(2268 resolve(2269 0,2270 newDefer,2271 jQuery.isFunction( onProgress ) ?2272 onProgress :2273 Identity,2274 newDefer.notifyWith2275 )2276 );2277 // fulfilled_handlers.add( ... )2278 tuples[ 1 ][ 3 ].add(2279 resolve(2280 0,2281 newDefer,2282 jQuery.isFunction( onFulfilled ) ?2283 onFulfilled :2284 Identity2285 )2286 );2287 // rejected_handlers.add( ... )2288 tuples[ 2 ][ 3 ].add(2289 resolve(2290 0,2291 newDefer,2292 jQuery.isFunction( onRejected ) ?2293 onRejected :2294 Thrower2295 )2296 );2297 } ).promise();2298 },2299 // Get a promise for this deferred2300 // If obj is provided, the promise aspect is added to the object2301 promise: function( obj ) {2302 return obj != null ? jQuery.extend( obj, promise ) : promise;2303 }2304 },2305 deferred = {};2306 // Add list-specific methods2307 jQuery.each( tuples, function( i, tuple ) {2308 var list = tuple[ 2 ],2309 stateString = tuple[ 5 ];2310 // promise.progress = list.add2311 // promise.done = list.add2312 // promise.fail = list.add2313 promise[ tuple[ 1 ] ] = list.add;2314 // Handle state2315 if ( stateString ) {2316 list.add(2317 function() {2318 // state = "resolved" (i.e., fulfilled)2319 // state = "rejected"2320 state = stateString;2321 },2322 // rejected_callbacks.disable2323 // fulfilled_callbacks.disable2324 tuples[ 3 - i ][ 2 ].disable,2325 // progress_callbacks.lock2326 tuples[ 0 ][ 2 ].lock2327 );2328 }2329 // progress_handlers.fire2330 // fulfilled_handlers.fire2331 // rejected_handlers.fire2332 list.add( tuple[ 3 ].fire );2333 // deferred.notify = function() { deferred.notifyWith(...) }2334 // deferred.resolve = function() { deferred.resolveWith(...) }2335 // deferred.reject = function() { deferred.rejectWith(...) }2336 deferred[ tuple[ 0 ] ] = function() {2337 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );2338 return this;2339 };2340 // deferred.notifyWith = list.fireWith2341 // deferred.resolveWith = list.fireWith2342 // deferred.rejectWith = list.fireWith2343 deferred[ tuple[ 0 ] + "With" ] = list.fireWith;2344 } );2345 // Make the deferred a promise2346 promise.promise( deferred );2347 // Call given func if any2348 if ( func ) {2349 func.call( deferred, deferred );2350 }2351 // All done!2352 return deferred;2353 },2354 // Deferred helper2355 when: function( singleValue ) {2356 var2357 // count of uncompleted subordinates2358 remaining = arguments.length,2359 // count of unprocessed arguments2360 i = remaining,2361 // subordinate fulfillment data2362 resolveContexts = Array( i ),2363 resolveValues = slice.call( arguments ),2364 // the master Deferred2365 master = jQuery.Deferred(),2366 // subordinate callback factory2367 updateFunc = function( i ) {2368 return function( value ) {2369 resolveContexts[ i ] = this;2370 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;2371 if ( !( --remaining ) ) {2372 master.resolveWith( resolveContexts, resolveValues );2373 }2374 };2375 };2376 // Single- and empty arguments are adopted like Promise.resolve2377 if ( remaining <= 1="" 8="" 9="" )="" {="" adoptvalue(="" singlevalue,="" master.done(="" updatefunc(="" i="" ).resolve,="" master.reject="" );="" use="" .then()="" to="" unwrap="" secondary="" thenables="" (cf.="" gh-3000)="" if="" (="" master.state()="==" "pending"="" ||="" jquery.isfunction(="" resolvevalues[="" ]="" &&="" ].then="" return="" master.then();="" }="" multiple arguments="" are="" aggregated="" like="" promise.all="" array="" elements="" while="" i--="" ],="" ),="" master.promise();="" these="" usually="" indicate="" a="" programmer="" mistake="" during="" development,="" warn="" about="" them="" asap="" rather="" than="" swallowing="" by="" default.="" var="" rerrornames="/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;" jquery.deferred.exceptionhook="function(" error,="" stack="" support:="" ie="" -="" only="" console="" exists="" when="" dev="" tools="" open,="" which="" can="" happen="" at="" any="" time="" window.console="" window.console.warn="" error="" rerrornames.test(="" error.name="" window.console.warn(="" "jquery.deferred="" exception:="" "="" +="" error.message,="" error.stack,="" };="" the="" deferred="" used="" on="" dom="" ready="" readylist="jQuery.Deferred();" jquery.fn.ready="function(" fn="" readylist.then(="" this;="" jquery.extend(="" is="" be="" used?="" set="" true="" once="" it="" occurs.="" isready:="" false,="" counter="" track="" how="" many="" items="" wait="" for="" before="" event="" fires.="" see="" #6781="" readywait:="" 1,="" hold="" (or="" release)="" holdready:="" function(="" jquery.readywait++;="" else="" jquery.ready(="" },="" handle="" ready:="" abort="" there="" pending="" holds="" or="" we're="" already="" ?="" --jquery.readywait="" :="" jquery.isready="" return;="" remember="" that="" normal="" fired,="" decrement,="" and="" need="" !="="> 0 ) {2378 return;2379 }2380 // If there are functions bound, to execute2381 readyList.resolveWith( document, [ jQuery ] );2382 }2383} );2384jQuery.ready.then = readyList.then;2385// The ready event handler and self cleanup method2386function completed() {2387 document.removeEventListener( "DOMContentLoaded", completed );2388 window.removeEventListener( "load", completed );2389 jQuery.ready();2390}2391// Catch cases where $(document).ready() is called2392// after the browser event has already occurred.2393// Support: IE <=9 0="" 1="" 5="" 9="" 10="" 11="" 45="" 2014="" -="" only="" older="" ie="" sometimes="" signals="" "interactive"="" too="" soon="" if="" (="" document.readystate="==" "complete"="" ||="" !="=" "loading"="" &&="" !document.documentelement.doscroll="" )="" {="" handle="" it="" asynchronously="" to="" allow="" scripts="" the="" opportunity="" delay="" ready="" window.settimeout(="" jquery.ready="" );="" }="" else="" use="" handy="" event="" callback="" document.addeventlistener(="" "domcontentloaded",="" completed="" a="" fallback="" window.onload,="" that="" will="" always="" work="" window.addeventlistener(="" "load",="" multifunctional="" method="" get="" and="" set="" values="" of="" collection="" value="" s="" can="" optionally="" be="" executed="" it's="" function="" var="" access="function(" elems,="" fn,="" key,="" value,="" chainable,="" emptyget,="" raw="" i="0," len="elems.length," bulk="key" =="null;" sets="" many="" jquery.type(="" key="" "object"="" chainable="true;" for="" in="" access(="" i,="" key[="" ],="" true,="" one="" undefined="" !jquery.isfunction(="" operations="" run="" against="" entire="" fn.call(="" fn="null;" ...except="" when="" executing="" elem,="" return="" bulk.call(="" jquery(="" elem="" ),="" };="" ;="" <="" len;="" i++="" fn(="" elems[="" ?="" :="" value.call(="" elems="" gets="" emptyget;="" acceptdata="function(" owner="" accepts="" only:="" node="" node.element_node="" node.document_node="" object="" any="" *="" jshint="" -w018="" owner.nodetype="==" !(="" +owner.nodetype="" data()="" this.expando="jQuery.expando" +="" data.uid++;="" data.uid="1;" data.prototype="{" cache:="" function(="" check="" already="" has="" cache="" ];="" not,="" create="" !value="" we="" accept="" data="" non-element="" nodes="" modern="" browsers,="" but="" should="" see="" #8335.="" an="" empty="" object.="" acceptdata(="" is="" unlikely="" stringify-ed="" or="" looped="" over="" plain="" assignment="" owner[="" ]="value;" otherwise="" secure="" non-enumerable="" property="" configurable="" must="" true="" deleted="" removed="" object.defineproperty(="" owner,="" this.expando,="" value:="" configurable:="" value;="" },="" set:="" data,="" prop,="" handle:="" [="" args="" camelcase="" (gh-2257)="" typeof="" "string"="" cache[="" jquery.camelcase(="" properties="" copy="" one-by-one="" prop="" cache;="" get:="" this.cache(="" ][="" access:="" cases="" where="" either:="" 1.="" no="" was="" specified="" 2.="" string="" specified,="" provided="" take="" "read"="" path="" determine="" which="" return,="" respectively="" stored="" at="" this.get(="" not="" string,="" both="" are="" extend="" (existing="" objects)="" with="" this.set(="" since="" "set"="" have="" two="" possible="" entry="" points="" expected="" based="" on="" taken[*]="" key;="" remove:="" return;="" support="" array="" space="" separated="" keys="" jquery.isarray(="" keys...="" keys,="" so="" remove="" that.="" jquery.camelcase="" spaces="" exists,="" it.="" otherwise,="" by="" matching="" non-whitespace="" key.match(="" rnotwhite="" []="" while="" i--="" delete="" expando="" there's="" more="" jquery.isemptyobject(="" support:="" chrome="" webkit="" &="" blink="" performance="" suffers="" deleting="" from="" dom="" nodes,="" instead="" https:="" bugs.chromium.org="" p="" chromium="" issues="" detail?id="378607" (bug="" restricted)="" hasdata:="" !jquery.isemptyobject(="" datapriv="new" data();="" datauser="new" implementation="" summary="" enforce="" api="" surface="" semantic="" compatibility="" 1.9.x="" branch="" improve="" module's="" maintainability="" reducing="" storage="" paths="" single="" mechanism.="" 3.="" same="" mechanism="" "private"="" "user"="" data.="" 4.="" _never_="" expose="" user="" code="" (todo:="" drop="" _data,="" _removedata)="" 5.="" avoid="" exposing="" details="" objects="" (eg.="" properties)="" 6.="" provide="" clear="" upgrade="" weakmap="" rbrace="/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/," rmultidash="/[A-Z]/g;" dataattr(="" name;="" nothing="" found="" internally,="" try="" fetch="" html5="" data-*="" attribute="" elem.nodetype="==" name="data-" key.replace(="" rmultidash,="" "-$&"="" ).tolowercase();="" "true"="" "false"="" false="" "null"="" null="" convert="" number="" doesn't="" change="" +data="" ""="==" rbrace.test(="" json.parse(="" data;="" catch="" e="" {}="" make="" sure="" isn't="" changed="" later="" datauser.set(="" jquery.extend(="" datauser.hasdata(="" datapriv.hasdata(="" data:="" name,="" datauser.access(="" removedata:="" datauser.remove(="" todo:="" now="" all="" calls="" _data="" _removedata="" been="" replaced="" direct="" methods,="" these="" deprecated.="" _data:="" datapriv.access(="" _removedata:="" datapriv.remove(="" jquery.fn.extend(="" attrs="elem" elem.attributes;="" this.length="" !datapriv.get(="" "hasdataattrs"="" elements="" (#14894)="" attrs[="" ].name;="" name.indexof(="" "data-"="" name.slice(="" data[="" datapriv.set(="" "hasdataattrs",="" multiple this.each(="" function()="" this,="" calling="" jquery="" (element="" matches)="" (and="" therefore="" element="" appears="" this[="" ])="" `value`="" parameter="" undefined.="" result="" `undefined`="" throw="" exception="" attempt="" read="" made.="" camelcased="" "discover"="" custom="" tried="" really="" hard,="" exist.="" data...="" store="" null,="" arguments.length=""> 1, null, true );2394 },2395 removeData: function( key ) {2396 return this.each( function() {2397 dataUser.remove( this, key );2398 } );2399 }2400} );2401jQuery.extend( {2402 queue: function( elem, type, data ) {2403 var queue;2404 if ( elem ) {2405 type = ( type || "fx" ) + "queue";2406 queue = dataPriv.get( elem, type );2407 // Speed up dequeue by getting out quickly if this is just a lookup2408 if ( data ) {2409 if ( !queue || jQuery.isArray( data ) ) {2410 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );2411 } else {2412 queue.push( data );2413 }2414 }2415 return queue || [];2416 }2417 },2418 dequeue: function( elem, type ) {2419 type = type || "fx";2420 var queue = jQuery.queue( elem, type ),2421 startLength = queue.length,2422 fn = queue.shift(),2423 hooks = jQuery._queueHooks( elem, type ),2424 next = function() {2425 jQuery.dequeue( elem, type );2426 };2427 // If the fx queue is dequeued, always remove the progress sentinel2428 if ( fn === "inprogress" ) {2429 fn = queue.shift();2430 startLength--;2431 }2432 if ( fn ) {2433 // Add a progress sentinel to prevent the fx queue from being2434 // automatically dequeued2435 if ( type === "fx" ) {2436 queue.unshift( "inprogress" );2437 }2438 // Clear up the last queue stop function2439 delete hooks.stop;2440 fn.call( elem, next, hooks );2441 }2442 if ( !startLength && hooks ) {2443 hooks.empty.fire();2444 }2445 },2446 // Not public - generate a queueHooks object, or return the current one2447 _queueHooks: function( elem, type ) {2448 var key = type + "queueHooks";2449 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {2450 empty: jQuery.Callbacks( "once memory" ).add( function() {2451 dataPriv.remove( elem, [ type + "queue", key ] );2452 } )2453 } );2454 }2455} );2456jQuery.fn.extend( {2457 queue: function( type, data ) {2458 var setter = 2;2459 if ( typeof type !== "string" ) {2460 data = type;2461 type = "fx";2462 setter--;2463 }2464 if ( arguments.length < setter ) {2465 return jQuery.queue( this[ 0 ], type );2466 }2467 return data === undefined ?2468 this :2469 this.each( function() {2470 var queue = jQuery.queue( this, type, data );2471 // Ensure a hooks for this queue2472 jQuery._queueHooks( this, type );2473 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {2474 jQuery.dequeue( this, type );2475 }2476 } );2477 },2478 dequeue: function( type ) {2479 return this.each( function() {2480 jQuery.dequeue( this, type );2481 } );2482 },2483 clearQueue: function( type ) {2484 return this.queue( type || "fx", [] );2485 },2486 // Get a promise resolved when queues of a certain type2487 // are emptied (fx is the type by default)2488 promise: function( type, obj ) {2489 var tmp,2490 count = 1,2491 defer = jQuery.Deferred(),2492 elements = this,2493 i = this.length,2494 resolve = function() {2495 if ( !( --count ) ) {2496 defer.resolveWith( elements, [ elements ] );2497 }2498 };2499 if ( typeof type !== "string" ) {2500 obj = type;2501 type = undefined;2502 }2503 type = type || "fx";2504 while ( i-- ) {2505 tmp = dataPriv.get( elements[ i ], type + "queueHooks" );2506 if ( tmp && tmp.empty ) {2507 count++;2508 tmp.empty.add( resolve );2509 }2510 }2511 resolve();2512 return defer.promise( obj );2513 }2514} );2515var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;2516var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );2517var cssExpand = [ "Top", "Right", "Bottom", "Left" ];2518var isHiddenWithinTree = function( elem, el ) {2519 // isHiddenWithinTree might be called from jQuery#filter function;2520 // in that case, element will be second argument2521 elem = el || elem;2522 // Inline style trumps all2523 return elem.style.display === "none" ||2524 elem.style.display === "" &&2525 // Otherwise, check computed style2526 // Support: Firefox <=43 1="" 2="" 3="" 45="" -="" disconnected="" elements="" can="" have="" computed="" display:="" none,="" so="" first="" confirm="" that="" elem="" is="" in="" the="" document.="" jquery.contains(="" elem.ownerdocument,="" )="" &&="" jquery.css(="" elem,="" "display"="" "none";="" };="" var="" swap="function(" options,="" callback,="" args="" {="" ret,="" name,="" old="{};" remember="" values,="" and="" insert="" new="" ones="" for="" (="" name="" options="" old[="" ]="elem.style[" ];="" elem.style[="" }="" ret="callback.apply(" ||="" []="" );="" revert="" values="" return="" ret;="" function="" adjustcss(="" prop,="" valueparts,="" tween="" adjusted,="" scale="1," maxiterations="20," currentvalue="tween" ?="" function()="" tween.cur();="" :="" ""="" },="" initial="currentValue()," unit="valueParts" valueparts[="" jquery.cssnumber[="" prop="" "px"="" ),="" starting="" value="" computation="" required potential="" mismatches="" initialinunit="(" !="=" +initial="" rcssnum.exec(="" if="" initialinunit[="" trust="" units="" reported="" by="" jquery.css="" make="" sure="" we="" update="" properties="" later="" on="" valueparts="valueParts" [];="" iteratively="" approximate="" from="" a="" nonzero="" point="" 1;="" do="" previous="" iteration="" zeroed="" out,="" double="" until="" get="" *something*.="" use="" string="" doubling="" don't="" accidentally="" see="" as="" unchanged="" below="" ".5";="" adjust="" apply="" scale;="" jquery.style(="" +="" scale,="" tolerating="" zero="" or="" nan="" tween.cur()="" break="" loop perfect,="" we've="" just="" had="" enough.="" while="" --maxiterations="" 0;="" relative="" offset="" (+="/-=)" specified="" adjusted="valueParts[" *="" +valueparts[="" tween.unit="unit;" tween.start="initialInUnit;" tween.end="adjusted;" adjusted;="" defaultdisplaymap="{};" getdefaultdisplay(="" temp,="" doc="elem.ownerDocument," nodename="elem.nodeName," display="defaultDisplayMap[" display;="" temp="doc.body.appendChild(" doc.createelement(="" temp.parentnode.removechild(="" "none"="" ;="" defaultdisplaymap[="" showhide(="" elements,="" show="" display,="" index="0," length="elements.length;" determine="" need="" to="" change="" <="" length;="" index++="" !elem.style="" continue;="" since="" force="" visibility="" upon="" cascade-hidden="" an="" immediate="" (and="" slow)="" check="" this="" unless="" nonempty="" (either="" inline="" about-to-be-restored)="" values[="" null;="" !values[="" elem.style.display="" ishiddenwithintree(="" else="" what="" we're="" overwriting="" datapriv.set(="" "display",="" set="" of="" second="" avoid="" constant="" reflow="" elements[="" ].style.display="values[" elements;="" jquery.fn.extend(="" show:="" this,="" true="" hide:="" toggle:="" function(="" state="" typeof="" "boolean"="" this.show()="" this.hide();="" this.each(="" jquery(="" ).show();="" ).hide();="" rcheckabletype="(" ^(?:checkbox|radio)$="" i="" rtagname="(" <([a-z][^\="" \0="">\x20\t\r\n\f]+)/i );2527var rscriptType = ( /^$|\/(?:java|ecma)script/i );2528// We have to close these tags to support XHTML (#13200)2529var wrapMap = {2530 // Support: IE <=9 only="" option:="" [="" 1,="" "<select="" multiple="multiple">", "" ],2531 // XHTML parsers do not magically insert elements in the2532 // same way that tag soup parsers do. So we cannot shorten2533 // this by omitting <tbody> or other required elements.2534 thead: [ 1, "<table>", "</table>" ],2535 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],2536 tr: [ 2, "<table><tbody>", "</tbody></table>" ],2537 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],2538 _default: [ 0, "", "" ]2539};2540// Support: IE <=9 0="" 1="" 2="" 11="" only="" wrapmap.optgroup="wrapMap.option;" wrapmap.tbody="wrapMap.tfoot" =="" wrapmap.colgroup="wrapMap.caption" wrapmap.thead;="" wrapmap.th="wrapMap.td;" function="" getall(="" context,="" tag="" )="" {="" support:="" ie="" <="9" -="" use="" typeof="" to="" avoid="" zero-argument="" method="" invocation="" on="" host="" objects="" (#15151)="" var="" ret="typeof" context.getelementsbytagname="" !="=" "undefined"="" ?="" context.getelementsbytagname(="" ||="" "*"="" :="" context.queryselectorall="" context.queryselectorall(="" [];="" return="" undefined="" &&="" jquery.nodename(="" jquery.merge(="" [="" context="" ],="" ret;="" }="" mark="" scripts="" as="" having="" already="" been="" evaluated="" setglobaleval(="" elems,="" refelements="" i="0," l="elems.length;" for="" (="" ;="" l;="" i++="" datapriv.set(="" elems[="" "globaleval",="" !refelements="" datapriv.get(="" refelements[="" "globaleval"="" );="" rhtml="/<|&#?\w+;/;" buildfragment(="" scripts,="" selection,="" ignored="" elem,="" tmp,="" tag,="" wrap,="" contains,="" j,="" fragment="context.createDocumentFragment()," nodes="[]," elem="elems[" ];="" if="" add="" directly="" jquery.type(="" "object"="" android="" only,="" phantomjs="" push.apply(_,="" arraylike)="" throws="" ancient="" webkit="" nodes,="" elem.nodetype="" ]="" convert="" non-html="" into="" a="" text="" node="" else="" !rhtml.test(="" nodes.push(="" context.createtextnode(="" html="" dom="" tmp="tmp" fragment.appendchild(="" context.createelement(="" "div"="" deserialize="" standard="" representation="" rtagname.exec(="" "",="" ""="" )[="" ].tolowercase();="" wrap="wrapMap[" wrapmap._default;="" tmp.innerhtml="wrap[" +="" jquery.htmlprefilter(="" wrap[="" descend="" through="" wrappers="" the="" right="" content="" j="wrap[" while="" j--="" tmp.childnodes="" remember="" top-level="" container="" ensure="" created="" are="" orphaned="" (#12392)="" tmp.textcontent="" remove="" wrapper="" from="" fragment.textcontent="" skip="" elements="" in="" collection="" (trac-4087)="" selection="" jquery.inarray(=""> -1 ) {2541 if ( ignored ) {2542 ignored.push( elem );2543 }2544 continue;2545 }2546 contains = jQuery.contains( elem.ownerDocument, elem );2547 // Append to fragment2548 tmp = getAll( fragment.appendChild( elem ), "script" );2549 // Preserve script evaluation history2550 if ( contains ) {2551 setGlobalEval( tmp );2552 }2553 // Capture executables2554 if ( scripts ) {2555 j = 0;2556 while ( ( elem = tmp[ j++ ] ) ) {2557 if ( rscriptType.test( elem.type || "" ) ) {2558 scripts.push( elem );2559 }2560 }2561 }2562 }2563 return fragment;2564}2565( function() {2566 var fragment = document.createDocumentFragment(),2567 div = fragment.appendChild( document.createElement( "div" ) ),2568 input = document.createElement( "input" );2569 // Support: Android 4.0 - 4.3 only2570 // Check state lost if the name is set (#11217)2571 // Support: Windows Web Apps (WWA)2572 // `name` and `type` must use .setAttribute for WWA (#14901)2573 input.setAttribute( "type", "radio" );2574 input.setAttribute( "checked", "checked" );2575 input.setAttribute( "name", "t" );2576 div.appendChild( input );2577 // Support: Android <=4.1 0="" 1="" 2="" only="" older="" webkit="" doesn't="" clone="" checked state="" correctly="" in="" fragments="" support.checkclone="div.cloneNode(" true="" ).clonenode(="" ).lastchild.checked;="" support:="" ie="" <="11" make="" sure="" textarea="" (and="" checkbox)="" defaultvalue="" is="" properly="" cloned="" div.innerhtml="<textarea>x</textarea>" ;="" support.noclonechecked="!!div.cloneNode(" ).lastchild.defaultvalue;="" }="" )();="" var="" documentelement="document.documentElement;" rkeyevent="/^key/," rmouseevent="/^(?:mouse|pointer|contextmenu|drag|drop)|click/," rtypenamespace="/^([^.]*)(?:\.(.+)|)/;" function="" returntrue()="" {="" return="" true;="" returnfalse()="" false;="" see="" #13393="" for="" more="" info="" safeactiveelement()="" try="" document.activeelement;="" catch="" (="" err="" )="" on(="" elem,="" types,="" selector,="" data,="" fn,="" one="" origfn,="" type;="" types="" can="" be="" a="" map="" of="" handlers="" if="" typeof="" "object"="" types-object,="" data="" selector="" !="=" "string"="" ||="" selector;="" type="" type,="" types[="" ],="" );="" elem;="" null="" &&="" fn="=" =="" undefined;="" else="" false="" !fn="" origfn="fn;" event="" use="" an="" empty="" set,="" since="" contains="" the="" jquery().off(="" origfn.apply(="" this,="" arguments="" };="" same="" guid="" so="" caller="" remove="" using="" fn.guid="origFn.guid" origfn.guid="jQuery.guid++" elem.each(="" function()="" jquery.event.add(="" *="" helper="" functions="" managing="" events="" --="" not="" part="" public="" interface.="" props="" to="" dean="" edwards'="" addevent="" library="" many="" ideas.="" jquery.event="{" global:="" {},="" add:="" function(="" handler,="" handleobjin,="" eventhandle,="" tmp,="" events,="" t,="" handleobj,="" special,="" handlers,="" namespaces,="" origtype,="" elemdata="dataPriv.get(" elem="" don't="" attach="" nodata="" or="" text="" comment="" nodes="" (but="" allow="" plain="" objects)="" !elemdata="" return;="" pass="" object="" custom="" lieu="" handler="" handler.handler="" handleobjin="handler;" ensure="" that="" invalid="" selectors="" throw="" exceptions="" at="" time="" evaluate="" against="" case="" non-element="" node="" (e.g.,="" document)="" jquery.find.matchesselector(="" documentelement,="" has="" unique="" id,="" used="" find="" it="" later="" !handler.guid="" handler.guid="jQuery.guid++;" init="" element's="" structure="" and="" main="" this="" first="" !(="" {};="" eventhandle="elemData.handle" e="" discard="" second="" jquery.event.trigger()="" when="" called="" after="" page="" unloaded="" jquery="" "undefined"="" jquery.event.triggered="" e.type="" ?="" jquery.event.dispatch.apply(="" :="" handle="" multiple separated="" by="" space="" ""="" ).match(="" rnotwhite="" [="" ];="" t="types.length;" while="" t--="" tmp="rtypenamespace.exec(" ]="" [];="" tmp[="" namespaces="(" ).split(="" "."="" ).sort();="" there="" *must*="" no="" attaching="" namespace-only="" !type="" continue;="" changes="" its="" special="" changed="" defined,="" determine="" api="" otherwise="" given="" special.delegatetype="" special.bindtype="" update="" based="" on="" newly="" reset="" handleobj="" passed="" all="" type:="" origtype:="" data:="" handler:="" guid:="" handler.guid,="" selector:="" needscontext:="" jquery.expr.match.needscontext.test(="" ),="" namespace:="" namespaces.join(="" },="" queue="" we're="" handlers.delegatecount="0;" addeventlistener="" returns="" !special.setup="" special.setup.call(="" elem.addeventlistener="" elem.addeventlistener(="" special.add="" special.add.call(="" !handleobj.handler.guid="" handleobj.handler.guid="handler.guid;" add="" list,="" delegates="" front="" handlers.splice(="" handlers.delegatecount++,="" 0,="" handlers.push(="" keep="" track="" which="" have="" ever="" been="" used,="" optimization="" jquery.event.global[="" detach="" set="" from="" element="" remove:="" mappedtypes="" j,="" origcount,="" datapriv.get(="" once="" each="" type.namespace="" types;="" may="" omitted="" unbind="" (on="" namespace,="" provided)="" jquery.event.remove(="" +="" new="" regexp(="" "(^|\\.)"="" "\\.(?:.*\\.|)"="" "(\\.|$)"="" matching="" origcount="j" handlers.length;="" j--="" j="" origtype="==" handleobj.origtype="" !handler="" handleobj.guid="" !tmp="" tmp.test(="" handleobj.namespace="" !selector="" handleobj.selector="" "**"="" handlers.delegatecount--;="" special.remove="" special.remove.call(="" generic="" we="" removed="" something="" exist="" (avoids="" potential="" endless="" recursion="" during="" removal="" handlers)="" !handlers.length="" !special.teardown="" special.teardown.call(="" elemdata.handle="" jquery.removeevent(="" delete="" events[="" expando="" it's="" longer="" jquery.isemptyobject(="" datapriv.remove(="" "handle="" events"="" dispatch:="" nativeevent="" writable="" native="" i,="" ret,="" matched,="" handlerqueue,="" args="new" array(="" arguments.length="" "events"="" {}="" )[="" event.type="" [],="" fix-ed="" rather="" than="" (read-only)="" args[="" i="1;" arguments.length;="" i++="" event.delegatetarget="this;" call="" predispatch="" hook="" mapped="" let="" bail="" desired="" special.predispatch="" special.predispatch.call(="" handlerqueue="jQuery.event.handlers.call(" event,="" run="" first;="" they="" want="" stop="" propagation="" beneath="" us="" matched="handlerQueue[" !event.ispropagationstopped()="" event.currenttarget="matched.elem;" j++="" !event.isimmediatepropagationstopped()="" triggered="" must="" either="" 1)="" 2)="" namespace(s)="" subset="" equal="" those="" bound="" (both="" namespace).="" !event.rnamespace="" event.rnamespace.test(="" event.handleobj="handleObj;" event.data="handleObj.data;" ret="(" jquery.event.special[="" ).handle="" handleobj.handler="" ).apply(="" matched.elem,="" undefined="" event.result="ret" event.preventdefault();="" event.stoppropagation();="" postdispatch="" special.postdispatch="" special.postdispatch.call(="" event.result;="" handlers:="" matches,="" sel,="" delegatecount="handlers.delegateCount," cur="event.target;" delegate="" black-hole="" svg="" <use=""> instance trees (#13180)2578 //2579 // Support: Firefox <=42 1="" avoid="" non-left-click="" in="" ff="" but="" don't="" block="" ie="" radio="" events="" (#3861,="" gh-2343)="" if="" (="" delegatecount="" &&="" cur.nodetype="" event.type="" !="=" "click"="" ||="" isnan(="" event.button="" )="" <="" {="" for="" ;="" cur="" this;="" this="" check="" non-elements="" (#13208)="" process="" clicks="" on="" disabled elements="" (#6911,="" #8165,="" #11382,="" #11764)="" cur.disabled="" true="" matches="[];" i="0;" delegatecount;="" i++="" handleobj="handlers[" ];="" conflict="" with="" object.prototype="" properties="" (#13203)="" sel="handleObj.selector" +="" "="" ";="" matches[="" ]="==" undefined="" ?="" jquery(="" sel,="" ).index(=""> -1 :2580 jQuery.find( sel, this, null, [ cur ] ).length;2581 }2582 if ( matches[ sel ] ) {2583 matches.push( handleObj );2584 }2585 }2586 if ( matches.length ) {2587 handlerQueue.push( { elem: cur, handlers: matches } );2588 }2589 }2590 }2591 }2592 // Add the remaining (directly-bound) handlers2593 if ( delegateCount < handlers.length ) {2594 handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );2595 }2596 return handlerQueue;2597 },2598 addProp: function( name, hook ) {2599 Object.defineProperty( jQuery.Event.prototype, name, {2600 enumerable: true,2601 configurable: true,2602 get: jQuery.isFunction( hook ) ?2603 function() {2604 if ( this.originalEvent ) {2605 return hook( this.originalEvent );2606 }2607 } :2608 function() {2609 if ( this.originalEvent ) {2610 return this.originalEvent[ name ];2611 }2612 },2613 set: function( value ) {2614 Object.defineProperty( this, name, {2615 enumerable: true,2616 configurable: true,2617 writable: true,2618 value: value2619 } );2620 }2621 } );2622 },2623 fix: function( originalEvent ) {2624 return originalEvent[ jQuery.expando ] ?2625 originalEvent :2626 new jQuery.Event( originalEvent );2627 },2628 special: {2629 load: {2630 // Prevent triggered image.load events from bubbling to window.load2631 noBubble: true2632 },2633 focus: {2634 // Fire native event if possible so blur/focus sequence is correct2635 trigger: function() {2636 if ( this !== safeActiveElement() && this.focus ) {2637 this.focus();2638 return false;2639 }2640 },2641 delegateType: "focusin"2642 },2643 blur: {2644 trigger: function() {2645 if ( this === safeActiveElement() && this.blur ) {2646 this.blur();2647 return false;2648 }2649 },2650 delegateType: "focusout"2651 },2652 click: {2653 // For checkbox, fire native event so checked state will be right2654 trigger: function() {2655 if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {2656 this.click();2657 return false;2658 }2659 },2660 // For cross-browser consistency, don't fire native .click() on links2661 _default: function( event ) {2662 return jQuery.nodeName( event.target, "a" );2663 }2664 },2665 beforeunload: {2666 postDispatch: function( event ) {2667 // Support: Firefox 20+2668 // Firefox doesn't alert if the returnValue field is not set.2669 if ( event.result !== undefined && event.originalEvent ) {2670 event.originalEvent.returnValue = event.result;2671 }2672 }2673 }2674 }2675};2676jQuery.removeEvent = function( elem, type, handle ) {2677 // This "if" is needed for plain objects2678 if ( elem.removeEventListener ) {2679 elem.removeEventListener( type, handle );2680 }2681};2682jQuery.Event = function( src, props ) {2683 // Allow instantiation without the 'new' keyword2684 if ( !( this instanceof jQuery.Event ) ) {2685 return new jQuery.Event( src, props );2686 }2687 // Event object2688 if ( src && src.type ) {2689 this.originalEvent = src;2690 this.type = src.type;2691 // Events bubbling up the document may have been marked as prevented2692 // by a handler lower down the tree; reflect the correct value.2693 this.isDefaultPrevented = src.defaultPrevented ||2694 src.defaultPrevented === undefined &&2695 // Support: Android <=2.3 0="" 1="==" 2="==" 3="" 4="" 7="" 2003="" only="" src.returnvalue="==" false="" ?="" returntrue="" :="" returnfalse;="" create="" target="" properties="" support:="" safari="" <="6" -="" should="" not="" be="" a="" text="" node="" (#504,="" #13143)="" this.target="(" src.target="" &&="" src.target.nodetype="==" )="" src.target.parentnode="" src.target;="" this.currenttarget="src.currentTarget;" this.relatedtarget="src.relatedTarget;" event="" type="" }="" else="" {="" this.type="src;" put="" explicitly="" provided="" onto="" the="" object="" if="" (="" props="" jquery.extend(="" this,="" );="" timestamp="" incoming="" doesn't="" have="" one="" this.timestamp="src" src.timestamp="" ||="" jquery.now();="" mark="" it="" as="" fixed="" this[="" jquery.expando="" ]="true;" };="" jquery.event="" is="" based="" on="" dom3="" events="" specified="" by="" ecmascript="" language="" binding="" https:="" www.w3.org="" tr="" wd-dom-level-3-events-20030331="" ecma-script-binding.html="" jquery.event.prototype="{" constructor:="" jquery.event,="" isdefaultprevented:="" returnfalse,="" ispropagationstopped:="" isimmediatepropagationstopped:="" issimulated:="" false,="" preventdefault:="" function()="" var="" e="this.originalEvent;" this.isdefaultprevented="returnTrue;" !this.issimulated="" e.preventdefault();="" },="" stoppropagation:="" this.ispropagationstopped="returnTrue;" e.stoppropagation();="" stopimmediatepropagation:="" this.isimmediatepropagationstopped="returnTrue;" e.stopimmediatepropagation();="" this.stoppropagation();="" includes="" all="" common="" including="" keyevent="" and="" mouseevent="" specific="" jquery.each(="" altkey:="" true,="" bubbles:="" cancelable:="" changedtouches:="" ctrlkey:="" detail:="" eventphase:="" metakey:="" pagex:="" pagey:="" shiftkey:="" view:="" "char":="" charcode:="" key:="" keycode:="" button:="" buttons:="" clientx:="" clienty:="" offsetx:="" offsety:="" pointerid:="" pointertype:="" screenx:="" screeny:="" targettouches:="" toelement:="" touches:="" which:="" function(="" button="event.button;" add="" which="" for="" key="" event.which="=" null="" rkeyevent.test(="" event.type="" return="" event.charcode="" !="null" event.keycode;="" click:="" left;="" middle;="" right="" !event.which="" undefined="" rmouseevent.test(="" &="" event.which;="" jquery.event.addprop="" mouseenter="" leave="" using="" mouseover="" out="" event-time="" checks="" so="" that="" delegation="" works="" in="" jquery.="" do="" same="" pointerenter="" pointerleave="" pointerover="" pointerout="" sends="" too="" often;="" see:="" bugs.chromium.org="" p="" chromium="" issues="" detail?id="470258" description="" of="" bug="" (it="" existed="" older="" chrome="" versions="" well).="" mouseenter:="" "mouseover",="" mouseleave:="" "mouseout",="" pointerenter:="" "pointerover",="" pointerleave:="" "pointerout"="" orig,="" fix="" jquery.event.special[="" orig="" delegatetype:="" fix,="" bindtype:="" handle:="" ret,="" related="event.relatedTarget," handleobj="event.handleObj;" call="" handler="" outside="" target.="" nb:="" no="" relatedtarget="" mouse="" left="" entered="" browser="" window="" !related="" !jquery.contains(="" target,="" ret="handleObj.handler.apply(" arguments="" ret;="" jquery.fn.extend(="" on:="" types,="" selector,="" data,="" fn="" on(="" one:="" fn,="" off:="" handleobj,="" type;="" types="" types.preventdefault="" types.handleobj="" dispatched="" jquery(="" types.delegatetarget="" ).off(="" handleobj.namespace="" handleobj.origtype="" +="" "."="" handleobj.origtype,="" handleobj.selector,="" handleobj.handler="" this;="" typeof="" "object"="" types-object="" [,="" selector]="" this.off(="" type,="" types[="" selector="==" "function"="" fn]="" this.each(="" jquery.event.remove(="" rxhtmltag="/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0">\x20\t\r\n\f]*)[^>]*)\/>/gi,2696 // Support: IE <=10 12="" 13="" 1736512="" -="" 11,="" edge="" in="" ie="" using="" regex="" groups="" here="" causes="" severe="" slowdowns.="" see="" https:="" connect.microsoft.com="" feedback="" details="" rnoinnerhtml="/<script|<style|<link/i," checked="checked" or="" rchecked="/checked\s*(?:[^=]|=\s*.checked.)/i," rscripttypemasked="/^true\/(.*)/," rcleanscript="/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)">\s*$/g;2697function manipulationTarget( elem, content ) {2698 if ( jQuery.nodeName( elem, "table" ) &&2699 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {2700 return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;2701 }2702 return elem;2703}2704// Replace/restore the type attribute of script elements for safe DOM manipulation2705function disableScript( elem ) {2706 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;2707 return elem;2708}2709function restoreScript( elem ) {2710 var match = rscriptTypeMasked.exec( elem.type );2711 if ( match ) {2712 elem.type = match[ 1 ];2713 } else {2714 elem.removeAttribute( "type" );2715 }2716 return elem;2717}2718function cloneCopyEvent( src, dest ) {2719 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;2720 if ( dest.nodeType !== 1 ) {2721 return;2722 }2723 // 1. Copy private data: events, handlers, etc.2724 if ( dataPriv.hasData( src ) ) {2725 pdataOld = dataPriv.access( src );2726 pdataCur = dataPriv.set( dest, pdataOld );2727 events = pdataOld.events;2728 if ( events ) {2729 delete pdataCur.handle;2730 pdataCur.events = {};2731 for ( type in events ) {2732 for ( i = 0, l = events[ type ].length; i < l; i++ ) {2733 jQuery.event.add( dest, type, events[ type ][ i ] );2734 }2735 }2736 }2737 }2738 // 2. Copy user data2739 if ( dataUser.hasData( src ) ) {2740 udataOld = dataUser.access( src );2741 udataCur = jQuery.extend( {}, udataOld );2742 dataUser.set( dest, udataCur );2743 }2744}2745// Fix IE bugs, see support tests2746function fixInput( src, dest ) {2747 var nodeName = dest.nodeName.toLowerCase();2748 // Fails to persist the checked state of a cloned checkbox or radio button.2749 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {2750 dest.checked = src.checked;2751 // Fails to return the selected option to the default selected state when cloning options2752 } else if ( nodeName === "input" || nodeName === "textarea" ) {2753 dest.defaultValue = src.defaultValue;2754 }2755}2756function domManip( collection, args, callback, ignored ) {2757 // Flatten any nested arrays2758 args = concat.apply( [], args );2759 var fragment, first, scripts, hasScripts, node, doc,2760 i = 0,2761 l = collection.length,2762 iNoClone = l - 1,2763 value = args[ 0 ],2764 isFunction = jQuery.isFunction( value );2765 // We can't cloneNode fragments that contain checked, in WebKit2766 if ( isFunction ||2767 ( l > 1 && typeof value === "string" &&2768 !support.checkClone && rchecked.test( value ) ) ) {2769 return collection.each( function( index ) {2770 var self = collection.eq( index );2771 if ( isFunction ) {2772 args[ 0 ] = value.call( this, index, self.html() );2773 }2774 domManip( self, args, callback, ignored );2775 } );2776 }2777 if ( l ) {2778 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );2779 first = fragment.firstChild;2780 if ( fragment.childNodes.length === 1 ) {2781 fragment = first;2782 }2783 // Require either new content or an interest in ignored elements to invoke the callback2784 if ( first || ignored ) {2785 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );2786 hasScripts = scripts.length;2787 // Use the original fragment for the last item2788 // instead of the first because it can end up2789 // being emptied incorrectly in certain situations (#8070).2790 for ( ; i < l; i++ ) {2791 node = fragment;2792 if ( i !== iNoClone ) {2793 node = jQuery.clone( node, true, true );2794 // Keep references to cloned scripts for later restoration2795 if ( hasScripts ) {2796 // Support: Android <=4.0 1="" only,="" phantomjs="" only="" push.apply(_,="" arraylike)="" throws="" on="" ancient="" webkit="" jquery.merge(="" scripts,="" getall(="" node,="" "script"="" )="" );="" }="" callback.call(="" collection[="" i="" ],="" if="" (="" hasscripts="" {="" doc="scripts[" scripts.length="" -="" ].ownerdocument;="" reenable="" scripts="" jquery.map(="" restorescript="" evaluate="" executable="" first="" document="" insertion="" for="" <="" hasscripts;="" i++="" node="scripts[" ];="" rscripttype.test(="" node.type="" ||="" ""="" &&="" !datapriv.access(="" "globaleval"="" jquery.contains(="" doc,="" node.src="" optional="" ajax="" dependency,="" but="" won't="" run="" not="" present="" jquery._evalurl="" jquery._evalurl(="" else="" domeval(="" node.textcontent.replace(="" rcleanscript,="" ),="" return="" collection;="" function="" remove(="" elem,="" selector,="" keepdata="" var="" nodes="selector" ?="" jquery.filter(="" elem="" :="" ;="" ]="" !="null;" !keepdata="" node.nodetype="==" jquery.cleandata(="" node.parentnode="" node.ownerdocument,="" setglobaleval(="" node.parentnode.removechild(="" elem;="" jquery.extend(="" htmlprefilter:="" function(="" html="" html.replace(="" rxhtmltag,="" "<$1="">" );2797 },2798 clone: function( elem, dataAndEvents, deepDataAndEvents ) {2799 var i, l, srcElements, destElements,2800 clone = elem.cloneNode( true ),2801 inPage = jQuery.contains( elem.ownerDocument, elem );2802 // Fix IE cloning issues2803 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&2804 !jQuery.isXMLDoc( elem ) ) {2805 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/22806 destElements = getAll( clone );2807 srcElements = getAll( elem );2808 for ( i = 0, l = srcElements.length; i < l; i++ ) {2809 fixInput( srcElements[ i ], destElements[ i ] );2810 }2811 }2812 // Copy the events from the original to the clone2813 if ( dataAndEvents ) {2814 if ( deepDataAndEvents ) {2815 srcElements = srcElements || getAll( elem );2816 destElements = destElements || getAll( clone );2817 for ( i = 0, l = srcElements.length; i < l; i++ ) {2818 cloneCopyEvent( srcElements[ i ], destElements[ i ] );2819 }2820 } else {2821 cloneCopyEvent( elem, clone );2822 }2823 }2824 // Preserve script evaluation history2825 destElements = getAll( clone, "script" );2826 if ( destElements.length > 0 ) {2827 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );2828 }2829 // Return the cloned set2830 return clone;2831 },2832 cleanData: function( elems ) {2833 var data, elem, type,2834 special = jQuery.event.special,2835 i = 0;2836 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {2837 if ( acceptData( elem ) ) {2838 if ( ( data = elem[ dataPriv.expando ] ) ) {2839 if ( data.events ) {2840 for ( type in data.events ) {2841 if ( special[ type ] ) {2842 jQuery.event.remove( elem, type );2843 // This is a shortcut to avoid jQuery.event.remove's overhead2844 } else {2845 jQuery.removeEvent( elem, type, data.handle );2846 }2847 }2848 }2849 // Support: Chrome <=35 0="" 1="" 2="" 3="" 4="" 8="" 9="" 11="" 44="" -="" 45+="" assign="" undefined="" instead="" of="" using="" delete,="" see="" data#remove="" elem[="" datapriv.expando="" ]="undefined;" }="" if="" (="" datauser.expando="" )="" {="" support:="" chrome="" <="35" );="" jquery.fn.extend(="" detach:="" function(="" selector="" return="" remove(="" this,="" selector,="" true="" },="" remove:="" text:="" value="" access(="" ?="" jquery.text(="" this="" :="" this.empty().each(="" function()="" this.nodetype="==" ||="" this.textcontent="value;" null,="" value,="" arguments.length="" append:="" dommanip(="" arguments,="" elem="" var="" target="manipulationTarget(" target.appendchild(="" prepend:="" target.insertbefore(="" elem,="" target.firstchild="" before:="" this.parentnode="" this.parentnode.insertbefore(="" after:="" this.nextsibling="" empty:="" i="0;" for="" ;="" !="null;" i++="" elem.nodetype="==" prevent="" memory="" leaks="" jquery.cleandata(="" getall(="" false="" remove="" any="" remaining="" nodes="" elem.textcontent="" this;="" clone:="" dataandevents,="" deepdataandevents="" dataandevents="dataAndEvents" =="null" dataandevents;="" deepdataandevents;="" this.map(="" jquery.clone(="" html:="" {},="" l="this.length;" &&="" elem.innerhtml;="" we="" can="" take="" a="" shortcut="" and="" just="" use="" innerhtml="" typeof="" "string"="" !rnoinnerhtml.test(="" !wrapmap[="" rtagname.exec(="" [="" "",="" ""="" )[="" ].tolowercase()="" try="" l;="" {};="" element="" elem.innerhtml="value;" throws="" an="" exception,="" the="" fallback="" method="" catch="" e="" {}="" this.empty().append(="" replacewith:="" ignored="[];" make="" changes,="" replacing="" each="" non-ignored="" context="" with="" new="" content="" parent="this.parentNode;" jquery.inarray(="" parent.replacechild(="" force="" callback="" invocation="" jquery.each(="" appendto:="" "append",="" prependto:="" "prepend",="" insertbefore:="" "before",="" insertafter:="" "after",="" replaceall:="" "replacewith"="" name,="" original="" jquery.fn[="" name="" elems,="" ret="[]," insert="jQuery(" ),="" last="insert.length" 1,="" elems="i" this.clone(="" jquery(="" insert[="" ](="" android="" only,="" phantomjs="" only="" .get()="" because="" push.apply(_,="" arraylike)="" on="" ancient="" webkit="" push.apply(="" ret,="" elems.get()="" this.pushstack(="" };="" rmargin="(" ^margin="" rnumnonpx="new" regexp(="" "^("="" +="" pnum="" ")(?!px)[a-z%]+$",="" "i"="" getstyles="function(" ie="" firefox="" (#15098,="" #14150)="" elements="" created="" in="" popups="" ff="" meanwhile="" frame="" through="" "defaultview.getcomputedstyle"="" view="elem.ownerDocument.defaultView;" !view="" !view.opener="" view.getcomputedstyle(="" executing="" both="" pixelposition="" &="" boxsizingreliable="" tests="" require="" one="" layout="" so="" they're="" executed="" at="" same="" time="" to="" save="" second="" computation.="" function="" computestyletests()="" is="" singleton,="" need="" execute="" it="" once="" !div="" return;="" div.style.csstext="box-sizing:border-box;" "position:relative;display:block;"="" "margin:auto;border:1px;padding:1px;"="" "top:1%;width:50%";="" div.innerhtml="" documentelement.appendchild(="" container="" divstyle="window.getComputedStyle(" div="" pixelpositionval="divStyle.top" "1%";="" 4.0="" 4.3="" reliablemarginleftval="divStyle.marginLeft" "2px";="" boxsizingreliableval="divStyle.width" "4px";="" some="" styles="" come="" back="" percentage="" values,="" even="" though="" they="" shouldn't="" div.style.marginright="50%" pixelmarginrightval="divStyle.marginRight" documentelement.removechild(="" nullify="" wouldn't="" be="" stored="" will="" also="" sign="" that="" checks="" already="" performed="" pixelpositionval,="" boxsizingreliableval,="" pixelmarginrightval,="" reliablemarginleftval,="" "div"="" finish="" early="" limited="" (non-browser)="" environments="" !div.style="" style="" cloned="" affects="" source="" (#8908)="" div.style.backgroundclip="content-box" div.clonenode(="" ).style.backgroundclip="" support.clearclonestyle="div.style.backgroundClip" "content-box";="" container.style.csstext="border:0;width:8px;height:0;top:0;left:-9999px;" "padding:0;margin-top:1px;position:absolute";="" container.appendchild(="" jquery.extend(="" support,="" pixelposition:="" computestyletests();="" pixelpositionval;="" boxsizingreliable:="" boxsizingreliableval;="" pixelmarginright:="" pixelmarginrightval;="" reliablemarginleft:="" reliablemarginleftval;="" )();="" curcss(="" computed="" width,="" minwidth,="" maxwidth,="" getstyles(="" getpropertyvalue="" needed="" .css('filter')="" (#12537)="" computed[="" ];="" !jquery.contains(="" elem.ownerdocument,="" tribute="" "awesome="" hack="" by="" dean="" edwards"="" browser="" returns="" but="" width="" seems="" reliably="" pixels.="" against="" cssom="" draft="" spec:="" https:="" drafts.csswg.org="" #resolved-values="" !support.pixelmarginright()="" rnumnonpx.test(="" rmargin.test(="" remember="" values="" minwidth="style.minWidth;" maxwidth="style.maxWidth;" put="" get="" out="" style.minwidth="style.maxWidth" style.width="ret;" revert="" changed="" style.maxwidth="maxWidth;" zindex="" as="" integer.="" ret;="" addgethookif(="" conditionfn,="" hookfn="" define="" hook,="" we'll="" check="" first="" run="" it's="" really="" needed.="" get:="" conditionfn()="" hook="" not="" (or="" possible="" due="" missing="" dependency),="" it.="" delete="" this.get;="" needed;="" redefine="" support="" test="" again.="" this.get="hookFn" ).apply(="" arguments="" swappable="" display="" none="" or="" starts="" table="" except="" "table",="" "table-cell",="" "table-caption"="" here="" values:="" developer.mozilla.org="" en-us="" docs="" css="" rdisplayswap="/^(none|table(?!-c[ea]).+)/," cssshow="{" position:="" "absolute",="" visibility:="" "hidden",="" display:="" "block"="" cssnormaltransform="{" letterspacing:="" "0",="" fontweight:="" "400"="" cssprefixes="[" "webkit",="" "moz",="" "ms"="" ],="" emptystyle="document.createElement(" ).style;="" property="" mapped="" potentially="" vendor="" prefixed="" vendorpropname(="" names="" are="" name;="" capname="name[" ].touppercase()="" name.slice(="" while="" i--="" capname;="" setpositivenumber(="" subtract="" relative="" (+="" -)="" have="" been="" normalized="" point="" matches="rcssNum.exec(" guard="" "subtract",="" e.g.,="" when="" used="" csshooks="" math.max(="" 0,="" matches[="" "px"="" value;="" augmentwidthorheight(="" extra,="" isborderbox,="" isborderbox="" "border"="" "content"="" right="" measurement,="" avoid="" augmentation="" otherwise="" initialize="" horizontal="" vertical="" properties="" "width"="" val="0;" 4;="" box="" models="" exclude="" margin,="" add="" want="" extra="==" "margin"="" cssexpand[="" true,="" border-box="" includes="" padding,="" "padding"="" point,="" isn't="" border="" nor="" "width",="" else="" content,="" padding="" val;="" getwidthorheight(="" start="" offset="" property,="" which="" equivalent="" val,="" valueisborderbox="true," "boxsizing",="" false,="" "border-box";="" running="" getboundingclientrect="" disconnected="" node="" error.="" elem.getclientrects().length="" non-html="" offsetwidth,="" null="" svg="" bugzilla.mozilla.org="" show_bug.cgi?id="649285" mathml="" fall="" then="" uncomputed="" necessary="" unit="" stop="" return.="" case="" unreliable="" getcomputedstyle="" silently="" falls="" reliable="" elem.style="" support.boxsizingreliable()="" elem.style[="" normalize="" auto,="" prepare="" 0;="" active="" box-sizing="" model="" irrelevant="" valueisborderbox,="" "px";="" hooks="" overriding="" default behavior="" getting="" setting="" csshooks:="" opacity:="" should="" always="" number="" from="" opacity="" "opacity"="" "1"="" don't="" automatically="" these="" possibly-unitless="" cssnumber:="" "animationiterationcount":="" "columncount":="" "fillopacity":="" "flexgrow":="" "flexshrink":="" "fontweight":="" "lineheight":="" "opacity":="" "order":="" "orphans":="" "widows":="" "zindex":="" "zoom":="" whose="" you="" wish="" fix="" before="" cssprops:="" "float":="" "cssfloat"="" set="" dom="" style:="" text="" comment="" !elem="" !elem.style="" sure="" we're="" working="" type,="" hooks,="" origname="jQuery.camelCase(" jquery.cssprops[="" gets="" version,="" unprefixed="" version="" jquery.csshooks[="" type="typeof" convert="" "+=" or " string"="" ret[="" fixes="" bug="" #9237="" nan="" aren't="" (#7116)="" was="" passed="" in,="" (except="" certain="" properties)="" "number"="" jquery.cssnumber[="" background-*="" props="" affect="" clone's="" !support.clearclonestyle="" name.indexof(="" "background"="" style[="" provided,="" specified="" !hooks="" !(="" "set"="" provided="" non-computed="" there="" "get"="" object="" css:="" num,="" followed="" otherwise,="" way="" exists,="" "normal"="" numeric="" forced="" qualifier="" looks="" num="parseFloat(" isfinite(="" "height",="" i,="" computed,="" dimension="" info="" invisibly="" show="" them="" must="" current="" would="" benefit="" rdisplayswap.test(="" jquery.css(="" "display"="" safari="" 8+="" columns="" non-zero="" offsetwidth="" zero="" getboundingclientrect().width="" unless="" changed.="" !elem.getclientrects().length="" !elem.getboundingclientrect().width="" swap(="" cssshow,="" set:="" matches,="" "border-box",="" pixels="" adjustment="" jquery.csshooks.marginleft="addGetHookIf(" support.reliablemarginleft,="" parsefloat(="" "marginleft"="" elem.getboundingclientrect().left="" marginleft:="" elem.getboundingclientrect().left;="" animate="" expand="" margin:="" padding:="" border:="" prefix,="" suffix="" prefix="" expand:="" expanded="{}," assumes="" single="" string="" parts="typeof" value.split(="" "="" expanded[="" parts[="" expanded;="" !rmargin.test(="" ].set="setPositiveNumber;" styles,="" len,="" map="{}," jquery.isarray(="" len="name.length;" len;="" map[="" name[="" map;="" jquery.style(=""> 1 );2850 }2851} );2852function Tween( elem, options, prop, end, easing ) {2853 return new Tween.prototype.init( elem, options, prop, end, easing );2854}2855jQuery.Tween = Tween;2856Tween.prototype = {2857 constructor: Tween,2858 init: function( elem, options, prop, end, easing, unit ) {2859 this.elem = elem;2860 this.prop = prop;2861 this.easing = easing || jQuery.easing._default;2862 this.options = options;2863 this.start = this.now = this.cur();2864 this.end = end;2865 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );2866 },2867 cur: function() {2868 var hooks = Tween.propHooks[ this.prop ];2869 return hooks && hooks.get ?2870 hooks.get( this ) :2871 Tween.propHooks._default.get( this );2872 },2873 run: function( percent ) {2874 var eased,2875 hooks = Tween.propHooks[ this.prop ];2876 if ( this.options.duration ) {2877 this.pos = eased = jQuery.easing[ this.easing ](2878 percent, this.options.duration * percent, 0, 1, this.options.duration2879 );2880 } else {2881 this.pos = eased = percent;2882 }2883 this.now = ( this.end - this.start ) * eased + this.start;2884 if ( this.options.step ) {2885 this.options.step.call( this.elem, this.now, this );2886 }2887 if ( hooks && hooks.set ) {2888 hooks.set( this );2889 } else {2890 Tween.propHooks._default.set( this );2891 }2892 return this;2893 }2894};2895Tween.prototype.init.prototype = Tween.prototype;2896Tween.propHooks = {2897 _default: {2898 get: function( tween ) {2899 var result;2900 // Use a property on the element directly when it is not a DOM element,2901 // or when there is no matching style property that exists.2902 if ( tween.elem.nodeType !== 1 ||2903 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {2904 return tween.elem[ tween.prop ];2905 }2906 // Passing an empty string as a 3rd parameter to .css will automatically2907 // attempt a parseFloat and fallback to a string if the parse fails.2908 // Simple values such as "10px" are parsed to Float;2909 // complex values such as "rotate(1rad)" are returned as-is.2910 result = jQuery.css( tween.elem, tween.prop, "" );2911 // Empty strings, null, undefined and "auto" are converted to 0.2912 return !result || result === "auto" ? 0 : result;2913 },2914 set: function( tween ) {2915 // Use step hook for back compat.2916 // Use cssHook if its there.2917 // Use .style if available and use plain properties where available.2918 if ( jQuery.fx.step[ tween.prop ] ) {2919 jQuery.fx.step[ tween.prop ]( tween );2920 } else if ( tween.elem.nodeType === 1 &&2921 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||2922 jQuery.cssHooks[ tween.prop ] ) ) {2923 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );2924 } else {2925 tween.elem[ tween.prop ] = tween.now;2926 }2927 }2928 }2929};2930// Support: IE <=9 0="" 1="" 2="" 3="" 4="" 12="" 13="" only="" panic="" based="" approach="" to="" setting="" things="" on="" disconnected="" nodes="" tween.prophooks.scrolltop="Tween.propHooks.scrollLeft" =="" {="" set:="" function(="" tween="" )="" if="" (="" tween.elem.nodetype="" &&="" tween.elem.parentnode="" tween.elem[="" tween.prop="" ]="tween.now;" }="" };="" jquery.easing="{" linear:="" p="" return="" p;="" },="" swing:="" 0.5="" -="" math.cos(="" *="" math.pi="" 2;="" _default:="" "swing"="" jquery.fx="Tween.prototype.init;" back="" compat="" <1.8="" extension="" point="" jquery.fx.step="{};" var="" fxnow,="" timerid,="" rfxtypes="/^(?:toggle|show|hide)$/," rrun="/queueHooks$/;" function="" raf()="" timerid="" window.requestanimationframe(="" raf="" );="" jquery.fx.tick();="" animations="" created="" synchronously="" will="" run="" createfxnow()="" window.settimeout(="" function()="" fxnow="undefined;" generate="" parameters="" create="" a="" standard="" animation="" genfx(="" type,="" includewidth="" which,="" i="0," attrs="{" height:="" type="" we="" include="" width,="" step="" value="" is="" do="" all="" cssexpand="" values,="" otherwise="" skip="" over="" left="" and="" right="" ?="" :="" 0;="" for="" ;="" <="" +="2" which="cssExpand[" ];="" attrs[="" "margin"="" "padding"="" attrs.opacity="attrs.width" type;="" attrs;="" createtween(="" value,="" prop,="" tween,="" collection="(" animation.tweeners[="" prop="" ||="" []="" ).concat(="" "*"="" ),="" index="0," length="collection.length;" length;="" index++="" ].call(="" animation,="" we're="" done="" with="" this="" property="" tween;="" defaultprefilter(="" elem,="" props,="" opts="" jshint="" validthis:="" true="" toggle,="" hooks,="" oldfire,="" proptween,="" restoredisplay,="" display,="" isbox="width" in="" props="" "height"="" anim="this," orig="{}," style="elem.style," hidden="elem.nodeType" ishiddenwithintree(="" elem="" datashow="dataPriv.get(" "fxshow"="" queue-skipping="" hijack="" the="" fx="" hooks="" !opts.queue="" "fx"="" hooks.unqueued="=" null="" oldfire="hooks.empty.fire;" hooks.empty.fire="function()" !hooks.unqueued="" oldfire();="" hooks.unqueued++;="" anim.always(="" ensure="" complete="" handler="" called="" before="" completes="" hooks.unqueued--;="" !jquery.queue(="" ).length="" hooks.empty.fire();="" detect="" show="" hide="" rfxtypes.test(="" delete="" props[="" toggle="toggle" "toggle";="" "hide"="" "show"="" pretend="" be="" there="" still="" data="" from="" stopped="" datashow[="" !="=" undefined="" ignore="" other="" no-op="" else="" continue;="" orig[="" jquery.style(="" bail="" out="" like="" .hide().hide()="" proptween="!jQuery.isEmptyObject(" !proptween="" jquery.isemptyobject(="" return;="" restrict="" "overflow"="" "display"="" styles="" during="" box="" elem.nodetype="==" support:="" ie="" 11,="" edge="" record="" overflow="" attributes="" because="" does="" not="" infer="" shorthand="" identically-valued="" overflowx="" overflowy="" opts.overflow="[" style.overflow,="" style.overflowx,="" style.overflowy="" identify="" display="" preferring="" old="" css="" cascade="" restoredisplay="dataShow" datashow.display;="" "none"="" get="" nonempty="" value(s)="" by="" temporarily="" forcing="" visibility="" showhide(="" [="" ],="" restoredisplay;="" animate="" inline="" elements="" as="" inline-block="" "inline"="" "inline-block"="" jquery.css(="" "float"="" restore="" original="" at="" end="" of="" pure="" anim.done(="" style.display="restoreDisplay;" ""="" display;="" style.overflow="hidden" style.overflowx="opts.overflow[" implement="" general="" setup="" element="" "hidden"="" "fxshow",="" display:="" store="" visible="" so="" `.stop().toggle()`="" "reverses"="" datashow.hidden="!hidden;" animating="" them="" -w083="" final="" actually="" hiding="" !hidden="" datapriv.remove(="" per-property="" 0,="" !(="" proptween.end="propTween.start;" proptween.start="0;" propfilter(="" specialeasing="" index,="" name,="" easing,="" hooks;="" camelcase,="" expand="" csshook="" pass="" name="jQuery.camelCase(" easing="specialEasing[" jquery.isarray(="" "expand"="" quite="" $.extend,="" won't="" overwrite="" existing="" keys.="" reusing="" 'index'="" have="" correct="" "name"="" specialeasing[="" animation(="" properties,="" options="" result,="" stopped,="" deferred="jQuery.Deferred().always(" don't="" match="" :animated="" selector="" tick.elem;="" tick="function()" false;="" currenttime="fxNow" createfxnow(),="" remaining="Math.max(" animation.starttime="" animation.duration="" android="" 2.3="" archaic="" crash="" bug="" allow="" us="" use="" `1="" )`="" (#12497)="" temp="remaining" percent="1" temp,="" animation.tweens[="" ].run(="" deferred.notifywith(="" percent,="" remaining;="" deferred.resolvewith(="" elem:="" props:="" jquery.extend(="" {},="" properties="" opts:="" true,="" specialeasing:="" easing:="" jquery.easing._default="" originalproperties:="" originaloptions:="" options,="" starttime:="" duration:="" options.duration,="" tweens:="" [],="" createtween:="" animation.opts,="" end,="" animation.opts.specialeasing[="" animation.opts.easing="" animation.tweens.push(="" stop:="" gotoend="" are="" going="" want="" tweens="" part="" animation.tweens.length="" this;="" resolve="" when="" played="" last="" frame;="" otherwise,="" reject="" 1,="" deferred.rejectwith(="" animation.opts.specialeasing="" result="Animation.prefilters[" animation.opts="" jquery.isfunction(="" result.stop="" jquery._queuehooks(="" animation.elem,="" animation.opts.queue="" ).stop="jQuery.proxy(" result.stop,="" result;="" jquery.map(="" createtween,="" animation.opts.start="" animation.opts.start.call(="" jquery.fx.timer(="" tick,="" anim:="" queue:="" attach="" callbacks="" animation.progress(="" animation.opts.progress="" .done(="" animation.opts.done,="" animation.opts.complete="" .fail(="" animation.opts.fail="" .always(="" animation.opts.always="" jquery.animation="jQuery.extend(" tweeners:="" "*":="" adjustcss(="" tween.elem,="" rcssnum.exec(="" tweener:="" callback="" rnotwhite="" [];="" ].unshift(="" prefilters:="" defaultprefilter="" prefilter:="" callback,="" prepend="" animation.prefilters.unshift(="" animation.prefilters.push(="" jquery.speed="function(" speed,="" fn="" opt="speed" typeof="" speed="==" "object"="" complete:="" !fn="" !jquery.isfunction(="" go="" state="" off="" or="" document="" jquery.fx.off="" document.hidden="" opt.duration="0;" "number"="" jquery.fx.speeds="" jquery.fx.speeds[="" jquery.fx.speeds._default;="" normalize="" opt.queue=""> "fx"2931 if ( opt.queue == null || opt.queue === true ) {2932 opt.queue = "fx";2933 }2934 // Queueing2935 opt.old = opt.complete;2936 opt.complete = function() {2937 if ( jQuery.isFunction( opt.old ) ) {2938 opt.old.call( this );2939 }2940 if ( opt.queue ) {2941 jQuery.dequeue( this, opt.queue );2942 }2943 };2944 return opt;2945};2946jQuery.fn.extend( {2947 fadeTo: function( speed, to, easing, callback ) {2948 // Show any hidden elements after setting opacity to 02949 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()2950 // Animate to the value specified2951 .end().animate( { opacity: to }, speed, easing, callback );2952 },2953 animate: function( prop, speed, easing, callback ) {2954 var empty = jQuery.isEmptyObject( prop ),2955 optall = jQuery.speed( speed, easing, callback ),2956 doAnimation = function() {2957 // Operate on a copy of prop so per-property easing won't be lost2958 var anim = Animation( this, jQuery.extend( {}, prop ), optall );2959 // Empty animations, or finishing resolves immediately2960 if ( empty || dataPriv.get( this, "finish" ) ) {2961 anim.stop( true );2962 }2963 };2964 doAnimation.finish = doAnimation;2965 return empty || optall.queue === false ?2966 this.each( doAnimation ) :2967 this.queue( optall.queue, doAnimation );2968 },2969 stop: function( type, clearQueue, gotoEnd ) {2970 var stopQueue = function( hooks ) {2971 var stop = hooks.stop;2972 delete hooks.stop;2973 stop( gotoEnd );2974 };2975 if ( typeof type !== "string" ) {2976 gotoEnd = clearQueue;2977 clearQueue = type;2978 type = undefined;2979 }2980 if ( clearQueue && type !== false ) {2981 this.queue( type || "fx", [] );2982 }2983 return this.each( function() {2984 var dequeue = true,2985 index = type != null && type + "queueHooks",2986 timers = jQuery.timers,2987 data = dataPriv.get( this );2988 if ( index ) {2989 if ( data[ index ] && data[ index ].stop ) {2990 stopQueue( data[ index ] );2991 }2992 } else {2993 for ( index in data ) {2994 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {2995 stopQueue( data[ index ] );2996 }2997 }2998 }2999 for ( index = timers.length; index--; ) {3000 if ( timers[ index ].elem === this &&3001 ( type == null || timers[ index ].queue === type ) ) {3002 timers[ index ].anim.stop( gotoEnd );3003 dequeue = false;3004 timers.splice( index, 1 );3005 }3006 }3007 // Start the next in the queue if the last step wasn't forced.3008 // Timers currently will call their complete callbacks, which3009 // will dequeue but only if they were gotoEnd.3010 if ( dequeue || !gotoEnd ) {3011 jQuery.dequeue( this, type );3012 }3013 } );3014 },3015 finish: function( type ) {3016 if ( type !== false ) {3017 type = type || "fx";3018 }3019 return this.each( function() {3020 var index,3021 data = dataPriv.get( this ),3022 queue = data[ type + "queue" ],3023 hooks = data[ type + "queueHooks" ],3024 timers = jQuery.timers,3025 length = queue ? queue.length : 0;3026 // Enable finishing flag on private data3027 data.finish = true;3028 // Empty the queue first3029 jQuery.queue( this, type, [] );3030 if ( hooks && hooks.stop ) {3031 hooks.stop.call( this, true );3032 }3033 // Look for any active animations, and finish them3034 for ( index = timers.length; index--; ) {3035 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {3036 timers[ index ].anim.stop( true );3037 timers.splice( index, 1 );3038 }3039 }3040 // Look for any animations in the old queue and finish them3041 for ( index = 0; index < length; index++ ) {3042 if ( queue[ index ] && queue[ index ].finish ) {3043 queue[ index ].finish.call( this );3044 }3045 }3046 // Turn off finishing flag3047 delete data.finish;3048 } );3049 }3050} );3051jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {3052 var cssFn = jQuery.fn[ name ];3053 jQuery.fn[ name ] = function( speed, easing, callback ) {3054 return speed == null || typeof speed === "boolean" ?3055 cssFn.apply( this, arguments ) :3056 this.animate( genFx( name, true ), speed, easing, callback );3057 };3058} );3059// Generate shortcuts for custom animations3060jQuery.each( {3061 slideDown: genFx( "show" ),3062 slideUp: genFx( "hide" ),3063 slideToggle: genFx( "toggle" ),3064 fadeIn: { opacity: "show" },3065 fadeOut: { opacity: "hide" },3066 fadeToggle: { opacity: "toggle" }3067}, function( name, props ) {3068 jQuery.fn[ name ] = function( speed, easing, callback ) {3069 return this.animate( props, speed, easing, callback );3070 };3071} );3072jQuery.timers = [];3073jQuery.fx.tick = function() {3074 var timer,3075 i = 0,3076 timers = jQuery.timers;3077 fxNow = jQuery.now();3078 for ( ; i < timers.length; i++ ) {3079 timer = timers[ i ];3080 // Checks the timer has not already been removed3081 if ( !timer() && timers[ i ] === timer ) {3082 timers.splice( i--, 1 );3083 }3084 }3085 if ( !timers.length ) {3086 jQuery.fx.stop();3087 }3088 fxNow = undefined;3089};3090jQuery.fx.timer = function( timer ) {3091 jQuery.timers.push( timer );3092 if ( timer() ) {3093 jQuery.fx.start();3094 } else {3095 jQuery.timers.pop();3096 }3097};3098jQuery.fx.interval = 13;3099jQuery.fx.start = function() {3100 if ( !timerId ) {3101 timerId = window.requestAnimationFrame ?3102 window.requestAnimationFrame( raf ) :3103 window.setInterval( jQuery.fx.tick, jQuery.fx.interval );3104 }3105};3106jQuery.fx.stop = function() {3107 if ( window.cancelAnimationFrame ) {3108 window.cancelAnimationFrame( timerId );3109 } else {3110 window.clearInterval( timerId );3111 }3112 timerId = null;3113};3114jQuery.fx.speeds = {3115 slow: 600,3116 fast: 200,3117 // Default speed3118 _default: 4003119};3120// Based off of the plugin by Clint Helfers, with permission.3121// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/3122jQuery.fn.delay = function( time, type ) {3123 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;3124 type = type || "fx";3125 return this.queue( type, function( next, hooks ) {3126 var timeout = window.setTimeout( next, time );3127 hooks.stop = function() {3128 window.clearTimeout( timeout );3129 };3130 } );3131};3132( function() {3133 var input = document.createElement( "input" ),3134 select = document.createElement( "select" ),3135 opt = select.appendChild( document.createElement( "option" ) );3136 input.type = "checkbox";3137 // Support: Android <=4.3 only="" default value="" for="" a="" checkbox="" should="" be="" "on"="" support.checkon="input.value" !="=" "";="" support:="" ie="" <="11" must="" access="" selectedindex="" to="" make="" options="" select="" support.optselected="opt.selected;" an="" input="" loses="" its="" after="" becoming="" radio="" "input"="" );="" input.value="t" ;="" input.type="radio" support.radiovalue="input.value" =="=" "t";="" }="" )();="" var="" boolhook,="" attrhandle="jQuery.expr.attrHandle;" jquery.fn.extend(="" {="" attr:="" function(="" name,="" )="" return="" access(="" this,="" jquery.attr,="" value,="" arguments.length=""> 1 );3138 },3139 removeAttr: function( name ) {3140 return this.each( function() {3141 jQuery.removeAttr( this, name );3142 } );3143 }3144} );3145jQuery.extend( {3146 attr: function( elem, name, value ) {3147 var ret, hooks,3148 nType = elem.nodeType;3149 // Don't get/set attributes on text, comment and attribute nodes3150 if ( nType === 3 || nType === 8 || nType === 2 ) {3151 return;3152 }3153 // Fallback to prop when attributes are not supported3154 if ( typeof elem.getAttribute === "undefined" ) {3155 return jQuery.prop( elem, name, value );3156 }3157 // Attribute hooks are determined by the lowercase version3158 // Grab necessary hook if one is defined3159 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {3160 hooks = jQuery.attrHooks[ name.toLowerCase() ] ||3161 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );3162 }3163 if ( value !== undefined ) {3164 if ( value === null ) {3165 jQuery.removeAttr( elem, name );3166 return;3167 }3168 if ( hooks && "set" in hooks &&3169 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {3170 return ret;3171 }3172 elem.setAttribute( name, value + "" );3173 return value;3174 }3175 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {3176 return ret;3177 }3178 ret = jQuery.find.attr( elem, name );3179 // Non-existent attributes return null, we normalize to undefined3180 return ret == null ? undefined : ret;3181 },3182 attrHooks: {3183 type: {3184 set: function( elem, value ) {3185 if ( !support.radioValue && value === "radio" &&3186 jQuery.nodeName( elem, "input" ) ) {3187 var val = elem.value;3188 elem.setAttribute( "type", value );3189 if ( val ) {3190 elem.value = val;3191 }3192 return value;3193 }3194 }3195 }3196 },3197 removeAttr: function( elem, value ) {3198 var name,3199 i = 0,3200 attrNames = value && value.match( rnotwhite );3201 if ( attrNames && elem.nodeType === 1 ) {3202 while ( ( name = attrNames[ i++ ] ) ) {3203 elem.removeAttribute( name );3204 }3205 }3206 }3207} );3208// Hooks for boolean attributes3209boolHook = {3210 set: function( elem, value, name ) {3211 if ( value === false ) {3212 // Remove boolean attributes when set to false3213 jQuery.removeAttr( elem, name );3214 } else {3215 elem.setAttribute( name, name );3216 }3217 return name;3218 }3219};3220jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {3221 var getter = attrHandle[ name ] || jQuery.find.attr;3222 attrHandle[ name ] = function( elem, name, isXML ) {3223 var ret, handle,3224 lowercaseName = name.toLowerCase();3225 if ( !isXML ) {3226 // Avoid an infinite loop by temporarily removing this function from the getter3227 handle = attrHandle[ lowercaseName ];3228 attrHandle[ lowercaseName ] = ret;3229 ret = getter( elem, name, isXML ) != null ?3230 lowercaseName :3231 null;3232 attrHandle[ lowercaseName ] = handle;3233 }3234 return ret;3235 };3236} );3237var rfocusable = /^(?:input|select|textarea|button)$/i,3238 rclickable = /^(?:a|area)$/i;3239jQuery.fn.extend( {3240 prop: function( name, value ) {3241 return access( this, jQuery.prop, name, value, arguments.length > 1 );3242 },3243 removeProp: function( name ) {3244 return this.each( function() {3245 delete this[ jQuery.propFix[ name ] || name ];3246 } );3247 }3248} );3249jQuery.extend( {3250 prop: function( elem, name, value ) {3251 var ret, hooks,3252 nType = elem.nodeType;3253 // Don't get/set properties on text, comment and attribute nodes3254 if ( nType === 3 || nType === 8 || nType === 2 ) {3255 return;3256 }3257 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {3258 // Fix name and attach hooks3259 name = jQuery.propFix[ name ] || name;3260 hooks = jQuery.propHooks[ name ];3261 }3262 if ( value !== undefined ) {3263 if ( hooks && "set" in hooks &&3264 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {3265 return ret;3266 }3267 return ( elem[ name ] = value );3268 }3269 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {3270 return ret;3271 }3272 return elem[ name ];3273 },3274 propHooks: {3275 tabIndex: {3276 get: function( elem ) {3277 // Support: IE <=9 0="" 1="" 10="" 11="" 2008="" -="" only="" elem.tabindex="" doesn't="" always="" return="" the="" correct="" value="" when="" it="" hasn't="" been="" explicitly="" set="" https:="" web.archive.org="" web="" 20141116233347="" http:="" fluidproject.org="" blog="" 01="" 09="" getting-setting-and-removing-tabindex-values-with-javascript="" use="" proper="" attribute="" retrieval(#12072)="" var="" tabindex="jQuery.find.attr(" elem,="" "tabindex"="" );="" ?="" parseint(="" tabindex,="" )="" :="" rfocusable.test(="" elem.nodename="" ||="" rclickable.test(="" &&="" elem.href="" -1;="" }="" },="" propfix:="" {="" "for":="" "htmlfor",="" "class":="" "classname"="" support:="" ie="" <="11" accessing="" selectedindex="" property="" forces="" browser="" to="" respect="" setting="" selected on="" option="" getter="" ensures="" a="" default is="" in="" an="" optgroup="" if="" (="" !support.optselected="" jquery.prophooks.selected="{" get:="" function(="" elem="" parent="elem.parentNode;" parent.parentnode="" parent.parentnode.selectedindex;="" null;="" set:="" parent.selectedindex;="" };="" jquery.each(="" [="" "tabindex",="" "readonly",="" "maxlength",="" "cellspacing",="" "cellpadding",="" "rowspan",="" "colspan",="" "usemap",="" "frameborder",="" "contenteditable"="" ],="" function()="" jquery.propfix[="" this.tolowercase()="" ]="this;" rclass="/[\t\r\n\f]/g;" function="" getclass(="" elem.getattribute="" elem.getattribute(="" "class"="" "";="" jquery.fn.extend(="" addclass:="" classes,="" cur,="" curvalue,="" clazz,="" j,="" finalvalue,="" i="0;" jquery.isfunction(="" this.each(="" j="" jquery(="" this="" ).addclass(="" value.call(="" this,="" typeof="" "string"="" classes="value.match(" rnotwhite="" [];="" while="" i++="" curvalue="getClass(" cur="elem.nodeType" =="=" "="" +="" ).replace(="" rclass,="" clazz="classes[" j++="" cur.indexof(="" ";="" assign="" different="" avoid="" unneeded="" rendering.="" finalvalue="jQuery.trim(" !="=" elem.setattribute(="" "class",="" this;="" removeclass:="" ).removeclass(="" !arguments.length="" this.attr(="" ""="" expression="" here="" for="" better="" compressibility="" (see="" addclass)="" remove="" *all*="" instances=""> -1 ) {3278 cur = cur.replace( " " + clazz + " ", " " );3279 }3280 }3281 // Only assign if different to avoid unneeded rendering.3282 finalValue = jQuery.trim( cur );3283 if ( curValue !== finalValue ) {3284 elem.setAttribute( "class", finalValue );3285 }3286 }3287 }3288 }3289 return this;3290 },3291 toggleClass: function( value, stateVal ) {3292 var type = typeof value;3293 if ( typeof stateVal === "boolean" && type === "string" ) {3294 return stateVal ? this.addClass( value ) : this.removeClass( value );3295 }3296 if ( jQuery.isFunction( value ) ) {3297 return this.each( function( i ) {3298 jQuery( this ).toggleClass(3299 value.call( this, i, getClass( this ), stateVal ),3300 stateVal3301 );3302 } );3303 }3304 return this.each( function() {3305 var className, i, self, classNames;3306 if ( type === "string" ) {3307 // Toggle individual class names3308 i = 0;3309 self = jQuery( this );3310 classNames = value.match( rnotwhite ) || [];3311 while ( ( className = classNames[ i++ ] ) ) {3312 // Check each className given, space separated list3313 if ( self.hasClass( className ) ) {3314 self.removeClass( className );3315 } else {3316 self.addClass( className );3317 }3318 }3319 // Toggle whole class name3320 } else if ( value === undefined || type === "boolean" ) {3321 className = getClass( this );3322 if ( className ) {3323 // Store className if set3324 dataPriv.set( this, "__className__", className );3325 }3326 // If the element has a class name or if we're passed `false`,3327 // then remove the whole classname (if there was one, the above saved it).3328 // Otherwise bring back whatever was previously saved (if anything),3329 // falling back to the empty string if nothing was stored.3330 if ( this.setAttribute ) {3331 this.setAttribute( "class",3332 className || value === false ?3333 "" :3334 dataPriv.get( this, "__className__" ) || ""3335 );3336 }3337 }3338 } );3339 },3340 hasClass: function( selector ) {3341 var className, elem,3342 i = 0;3343 className = " " + selector + " ";3344 while ( ( elem = this[ i++ ] ) ) {3345 if ( elem.nodeType === 1 &&3346 ( " " + getClass( elem ) + " " ).replace( rclass, " " )3347 .indexOf( className ) > -13348 ) {3349 return true;3350 }3351 }3352 return false;3353 }3354} );3355var rreturn = /\r/g,3356 rspaces = /[\x20\t\r\n\f]+/g;3357jQuery.fn.extend( {3358 val: function( value ) {3359 var hooks, ret, isFunction,3360 elem = this[ 0 ];3361 if ( !arguments.length ) {3362 if ( elem ) {3363 hooks = jQuery.valHooks[ elem.type ] ||3364 jQuery.valHooks[ elem.nodeName.toLowerCase() ];3365 if ( hooks &&3366 "get" in hooks &&3367 ( ret = hooks.get( elem, "value" ) ) !== undefined3368 ) {3369 return ret;3370 }3371 ret = elem.value;3372 return typeof ret === "string" ?3373 // Handle most common string cases3374 ret.replace( rreturn, "" ) :3375 // Handle cases where value is null/undef or number3376 ret == null ? "" : ret;3377 }3378 return;...
jquery-3.4.1.js
Source:jquery-3.4.1.js
...351 setDocument();352 },353 inDisabledFieldset = addCombinator(354 function( elem ) {355 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";356 },357 { dir: "parentNode", next: "legend" }358 );359// Optimize for push.apply( _, NodeList )360try {361 push.apply(362 (arr = slice.call( preferredDoc.childNodes )),363 preferredDoc.childNodes364 );365 // Support: Android<4.0 1 8 9 11 detect silently failing push.apply arr[ preferreddoc.childnodes.length ].nodetype; } catch ( e ) { push="{" apply: arr.length ? leverage slice if possible function( target, els push_native.apply( slice.call(els) ); : support: ie<9 otherwise append directly var j="target.length," i="0;" can't trust nodelist.length while (target[j++]="els[i++])" {} target.length="j" - 1; }; function sizzle( selector, context, results, seed m, i, elem, nid, match, groups, newselector, newcontext="context" && context.ownerdocument, nodetype defaults to 9, since context document context.nodetype 9; results="results" || []; return early from calls with invalid selector or typeof !="=" "string" !selector results; try shortcut find operations (as opposed filters) in html documents !seed context.ownerdocument preferreddoc setdocument( document; documentishtml the is sufficiently simple, using a "get*by*" dom method (excepting documentfragment where methods don't exist) (match="rquickExpr.exec(" )) id (m="match[1])" (elem="context.getElementById(" m ie, opera, webkit todo: identify versions getelementbyid can match elements by name instead of elem.id="==" results.push( elem else element contains( type match[2] push.apply( context.getelementsbytagname( class support.getelementsbyclassname context.getelementsbyclassname context.getelementsbyclassname( take advantage queryselectorall support.qsa !nonnativeselectorcache[ + " ] (!rbuggyqsa !rbuggyqsa.test( ie only exclude object (nodetype context.nodename.tolowercase() "object") newselector="selector;" qsa considers outside scoping root when evaluating child descendant combinators, which not what we want. such cases, work around behavior prefixing every list an referencing scope context. thanks andrew dupont for this technique. rdescend.test( capture id, setting it first necessary (nid="context.getAttribute(" "id" nid="nid.replace(" rcssescape, fcssescape context.setattribute( "id", prefix groups="tokenize(" i-- groups[i]="#" toselector( "," expand sibling selectors testcontext( context.parentnode context; newcontext.queryselectorall( qsaerror nonnativeselectorcache( true finally expando context.removeattribute( all others select( selector.replace( rtrim, "$1" ), ** * create key-value caches limited size @returns {function(string, object)} returns data after storing on itself property (space-suffixed) string and (if cache larger than expr.cachelength) deleting oldest entry createcache() keys="[];" cache( key, value use (key ") avoid collision native prototype properties (see issue #157) keys.push( key> Expr.cacheLength ) {366 // Only keep the most recent entries367 delete cache[ keys.shift() ];368 }369 return (cache[ key + " " ] = value);370 }371 return cache;372}373/**374 * Mark a function for special use by Sizzle375 * @param {Function} fn The function to mark376 */377function markFunction( fn ) {378 fn[ expando ] = true;379 return fn;380}381/**382 * Support testing using an element383 * @param {Function} fn Passed the created element and returns a boolean result384 */385function assert( fn ) {386 var el = document.createElement("fieldset");387 try {388 return !!fn( el );389 } catch (e) {390 return false;391 } finally {392 // Remove from its parent by default393 if ( el.parentNode ) {394 el.parentNode.removeChild( el );395 }396 // release memory in IE397 el = null;398 }399}400/**401 * Adds the same handler for all of the specified attrs402 * @param {String} attrs Pipe-separated list of attributes403 * @param {Function} handler The method that will be applied404 */405function addHandle( attrs, handler ) {406 var arr = attrs.split("|"),407 i = arr.length;408 while ( i-- ) {409 Expr.attrHandle[ arr[i] ] = handler;410 }411}412/**413 * Checks document order of two siblings414 * @param {Element} a415 * @param {Element} b416 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b417 */418function siblingCheck( a, b ) {419 var cur = b && a,420 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&421 a.sourceIndex - b.sourceIndex;422 // Use IE sourceIndex if available on both nodes423 if ( diff ) {424 return diff;425 }426 // Check if b follows a427 if ( cur ) {428 while ( (cur = cur.nextSibling) ) {429 if ( cur === b ) {430 return -1;431 }432 }433 }434 return a ? 1 : -1;435}436/**437 * Returns a function to use in pseudos for input types438 * @param {String} type439 */440function createInputPseudo( type ) {441 return function( elem ) {442 var name = elem.nodeName.toLowerCase();443 return name === "input" && elem.type === type;444 };445}446/**447 * Returns a function to use in pseudos for buttons448 * @param {String} type449 */450function createButtonPseudo( type ) {451 return function( elem ) {452 var name = elem.nodeName.toLowerCase();453 return (name === "input" || name === "button") && elem.type === type;454 };455}456/**457 * Returns a function to use in pseudos for :enabled/:disabled458 * @param {Boolean} disabled true for :disabled; false for :enabled459 */460function createDisabledPseudo( disabled ) {461 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable462 return function( elem ) {463 // Only certain elements can match :enabled or :disabled464 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled465 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled466 if ( "form" in elem ) {467 // Check for inherited disabledness on relevant non-disabled elements:468 // * listed form-associated elements in a disabled fieldset469 // https://html.spec.whatwg.org/multipage/forms.html#category-listed470 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled471 // * option elements in a disabled optgroup472 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled473 // All such elements have a "form" property.474 if ( elem.parentNode && elem.disabled === false ) {475 // Option elements defer to a parent optgroup if present476 if ( "label" in elem ) {477 if ( "label" in elem.parentNode ) {478 return elem.parentNode.disabled === disabled;479 } else {480 return elem.disabled === disabled;481 }482 }483 // Support: IE 6 - 11484 // Use the isDisabled shortcut property to check for disabled fieldset ancestors485 return elem.isDisabled === disabled ||486 // Where there is no isDisabled, check manually487 /* jshint -W018 */488 elem.isDisabled !== !disabled &&489 inDisabledFieldset( elem ) === disabled;490 }491 return elem.disabled === disabled;492 // Try to winnow out elements that can't be disabled before trusting the disabled property.493 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't494 // even exist on them, let alone have a boolean value.495 } else if ( "label" in elem ) {496 return elem.disabled === disabled;497 }498 // Remaining elements are neither :enabled nor :disabled499 return false;500 };501}502/**503 * Returns a function to use in pseudos for positionals504 * @param {Function} fn505 */506function createPositionalPseudo( fn ) {507 return markFunction(function( argument ) {508 argument = +argument;509 return markFunction(function( seed, matches ) {510 var j,511 matchIndexes = fn( [], seed.length, argument ),512 i = matchIndexes.length;513 // Match elements found at the specified indexes514 while ( i-- ) {515 if ( seed[ (j = matchIndexes[i]) ] ) {516 seed[j] = !(matches[j] = seed[j]);517 }518 }519 });520 });521}522/**523 * Checks a node for validity as a Sizzle context524 * @param {Element|Object=} context525 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value526 */527function testContext( context ) {528 return context && typeof context.getElementsByTagName !== "undefined" && context;529}530// Expose support vars for convenience531support = Sizzle.support = {};532/**533 * Detects XML nodes534 * @param {Element|Object} elem An element or a document535 * @returns {Boolean} True iff elem is a non-HTML XML node536 */537isXML = Sizzle.isXML = function( elem ) {538 var namespace = elem.namespaceURI,539 docElem = (elem.ownerDocument || elem).documentElement;540 // Support: IE <=8 1 6 7 9 10 4833 12359 13378 assume html when documentelement doesn't yet exist, such as inside loading iframes https: bugs.jquery.com ticket return !rhtml.test( namespace || docelem && docelem.nodename "html" ); }; ** * sets document-related variables once based on the current document @param {element|object} [doc] an element or object to use set @returns {object} returns setdocument="Sizzle.setDocument" = function( node ) { var hascompare, subwindow, doc="node" ? node.ownerdocument : preferreddoc; early if is invalid already selected ( doc.nodetype !="=" !doc.documentelement document; } update global documentishtml="!isXML(" support: ie 9-11, edge accessing iframe documents after unload throws "permission denied" errors (jquery #13936) preferreddoc (subwindow="document.defaultView)" subwindow.top subwindow 11, subwindow.addeventlistener subwindow.addeventlistener( "unload", unloadhandler, false - only else subwindow.attachevent subwindow.attachevent( "onunload", unloadhandler attributes ---------------------------------------------------------------------- ie<8 verify that getattribute really and not properties (excepting ie8 booleans) support.attributes="assert(function(" el el.classname="i" ; !el.getattribute("classname"); }); getelement(s)by* check getelementsbytagname("*") elements support.getelementsbytagname="assert(function(" el.appendchild( document.createcomment("") !el.getelementsbytagname("*").length; ie<9 support.getelementsbyclassname="rnative.test(" document.getelementsbyclassname ie<10 getelementbyid by name broken methods don't pick up programmatically-set names, so a roundabout getelementsbyname test support.getbyid="assert(function(" docelem.appendchild( ).id="expando;" !document.getelementsbyname !document.getelementsbyname( expando ).length; id filter find expr.filter["id"]="function(" attrid="id.replace(" runescape, funescape elem elem.getattribute("id")="==" attrid; expr.find["id"]="function(" id, context typeof context.getelementbyid "undefined" [ ] []; elem.getattributenode elem.getattributenode("id"); node.value="==" reliable shortcut node, i, elems, attribute ]; fall back elems="context.getElementsByName(" i="0;" while (elem="elems[i++])" tag expr.find["tag"]="support.getElementsByTagName" tag, context.getelementsbytagname context.getelementsbytagname( documentfragment nodes have gebtn support.qsa context.queryselectorall( elem, tmp="[]," happy coincidence, (broken) appears too results="context.getElementsByTagName(" out possible comments "*" elem.nodetype="==" tmp.push( tmp; results; class expr.find["class"]="support.getElementsByClassName" classname, context.getelementsbyclassname context.getelementsbyclassname( classname qsa matchesselector support matchesselector(:active) reports true (ie9 opera 11.5) rbuggymatches="[];" qsa(:focus) (chrome 21) we allow this because of bug in error whenever `document.activeelement` accessed so, :focus pass through all time avoid see rbuggyqsa="[];" (support.qsa="rnative.test(" document.queryselectorall )) build regex strategy adopted from diego perini assert(function( select empty string purpose ie's treatment explicitly setting boolean content attribute, since its presence should be enough ).innerhtml="<a id='" + "'>" +541 "<select id="" + expando + "-\r\\" msallowcapture>" +542 "<option selected></option></select>";543 // Support: IE8, Opera 11-12.16544 // Nothing should be selected when empty strings follow ^= or $= or *=545 // The test attribute must be unknown in Opera but "safe" for WinRT546 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section547 if ( el.querySelectorAll("[msallowcapture^='']").length ) {548 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );549 }550 // Support: IE8551 // Boolean attributes and "value" are not treated correctly552 if ( !el.querySelectorAll("[selected]").length ) {553 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );554 }555 // Support: Chrome<29, android<4.4, safari<7.0+, ios<7.0+, phantomjs<1.9.8+ if ( !el.queryselectorall( "[id~=" + expando + " -]" ).length ) { rbuggyqsa.push("~=");556 }557 // Webkit/Opera - :checked should return selected option elements558 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked559 // IE8 throws error here and will not see later tests560 if ( !el.querySelectorAll(" :checked").length rbuggyqsa.push(":checked"); } support: safari 8+, ios 8+ https: bugs.webkit.org show_bug.cgi?id="136851" in-page `selector#id sibling-combinator selector` fails "a#" + expando "+*" rbuggyqsa.push(".#.+[+~]"); }); assert(function( el el.innerhtml="<a href='' disabled='disabled'></a>" "<select disabled="disabled"><option>";561 // Support: Windows 8 Native Apps562 // The type and name attributes are restricted during .innerHTML assignment563 var input = document.createElement("input");564 input.setAttribute( "type", "hidden" );565 el.appendChild( input ).setAttribute( "name", "D" );566 // Support: IE8567 // Enforce case-sensitivity of name attribute568 if ( el.querySelectorAll("[name=d]").length ) {569 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );570 }571 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)572 // IE8 throws error here and will not see later tests573 if ( el.querySelectorAll(":enabled").length !== 2 ) {574 rbuggyQSA.push( ":enabled", ":disabled" );575 }576 // Support: IE9-11+577 // IE's :disabled selector does not pick up the children of disabled fieldsets578 docElem.appendChild( el ).disabled = true;579 if ( el.querySelectorAll(":disabled").length !== 2 ) {580 rbuggyQSA.push( ":enabled", ":disabled" );581 }582 // Opera 10-11 does not throw on post-comma invalid pseudos583 el.querySelectorAll("*,:x");584 rbuggyQSA.push(",.*:");585 });586 }587 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||588 docElem.webkitMatchesSelector ||589 docElem.mozMatchesSelector ||590 docElem.oMatchesSelector ||591 docElem.msMatchesSelector) )) ) {592 assert(function( el ) {593 // Check to see if it's possible to do matchesSelector594 // on a disconnected node (IE 9)595 support.disconnectedMatch = matches.call( el, "*" );596 // This should fail with an exception597 // Gecko does not error, returns false instead598 matches.call( el, "[s!='']:x" );599 rbuggyMatches.push( "!=", pseudos );600 });601 }602 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );603 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );604 /* Contains605 ---------------------------------------------------------------------- */606 hasCompare = rnative.test( docElem.compareDocumentPosition );607 // Element contains another608 // Purposefully self-exclusive609 // As in, an element does not contain itself610 contains = hasCompare || rnative.test( docElem.contains ) ?611 function( a, b ) {612 var adown = a.nodeType === 9 ? a.documentElement : a,613 bup = b && b.parentNode;614 return a === bup || !!( bup && bup.nodeType === 1 && (615 adown.contains ?616 adown.contains( bup ) :617 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16618 ));619 } :620 function( a, b ) {621 if ( b ) {622 while ( (b = b.parentNode) ) {623 if ( b === a ) {624 return true;625 }626 }627 }628 return false;629 };630 /* Sorting631 ---------------------------------------------------------------------- */632 // Document order sorting633 sortOrder = hasCompare ?634 function( a, b ) {635 // Flag for duplicate removal636 if ( a === b ) {637 hasDuplicate = true;638 return 0;639 }640 // Sort on method existence if only one input has compareDocumentPosition641 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;642 if ( compare ) {643 return compare;644 }645 // Calculate position if both inputs belong to the same document646 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?647 a.compareDocumentPosition( b ) :648 // Otherwise we know they are disconnected649 1;650 // Disconnected nodes651 if ( compare & 1 ||652 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {653 // Choose the first element that is related to our preferred document654 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {655 return -1;656 }657 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {658 return 1;659 }660 // Maintain original order661 return sortInput ?662 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :663 0;664 }665 return compare & 4 ? -1 : 1;666 } :667 function( a, b ) {668 // Exit early if the nodes are identical669 if ( a === b ) {670 hasDuplicate = true;671 return 0;672 }673 var cur,674 i = 0,675 aup = a.parentNode,676 bup = b.parentNode,677 ap = [ a ],678 bp = [ b ];679 // Parentless nodes are either documents or disconnected680 if ( !aup || !bup ) {681 return a === document ? -1 :682 b === document ? 1 :683 aup ? -1 :684 bup ? 1 :685 sortInput ?686 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :687 0;688 // If the nodes are siblings, we can do a quick check689 } else if ( aup === bup ) {690 return siblingCheck( a, b );691 }692 // Otherwise we need full lists of their ancestors for comparison693 cur = a;694 while ( (cur = cur.parentNode) ) {695 ap.unshift( cur );696 }697 cur = b;698 while ( (cur = cur.parentNode) ) {699 bp.unshift( cur );700 }701 // Walk down the tree looking for a discrepancy702 while ( ap[i] === bp[i] ) {703 i++;704 }705 return i ?706 // Do a sibling check if the nodes have a common ancestor707 siblingCheck( ap[i], bp[i] ) :708 // Otherwise nodes in our document sort first709 ap[i] === preferredDoc ? -1 :710 bp[i] === preferredDoc ? 1 :711 0;712 };713 return document;714};715Sizzle.matches = function( expr, elements ) {716 return Sizzle( expr, null, null, elements );717};718Sizzle.matchesSelector = function( elem, expr ) {719 // Set document vars if needed720 if ( ( elem.ownerDocument || elem ) !== document ) {721 setDocument( elem );722 }723 if ( support.matchesSelector && documentIsHTML &&724 !nonnativeSelectorCache[ expr + " " ] &&725 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&726 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {727 try {728 var ret = matches.call( elem, expr );729 // IE 9's matchesSelector returns false on disconnected nodes730 if ( ret || support.disconnectedMatch ||731 // As well, disconnected nodes are said to be in a document732 // fragment in IE 9733 elem.document && elem.document.nodeType !== 11 ) {734 return ret;735 }736 } catch (e) {737 nonnativeSelectorCache( expr, true );738 }739 }740 return Sizzle( expr, document, null, [ elem ] ).length > 0;741};742Sizzle.contains = function( context, elem ) {743 // Set document vars if needed744 if ( ( context.ownerDocument || context ) !== document ) {745 setDocument( context );746 }747 return contains( context, elem );748};749Sizzle.attr = function( elem, name ) {750 // Set document vars if needed751 if ( ( elem.ownerDocument || elem ) !== document ) {752 setDocument( elem );753 }754 var fn = Expr.attrHandle[ name.toLowerCase() ],755 // Don't get fooled by Object.prototype properties (jQuery #13807)756 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?757 fn( elem, name, !documentIsHTML ) :758 undefined;759 return val !== undefined ?760 val :761 support.attributes || !documentIsHTML ?762 elem.getAttribute( name ) :763 (val = elem.getAttributeNode(name)) && val.specified ?764 val.value :765 null;766};767Sizzle.escape = function( sel ) {768 return (sel + "").replace( rcssescape, fcssescape );769};770Sizzle.error = function( msg ) {771 throw new Error( "Syntax error, unrecognized expression: " + msg );772};773/**774 * Document sorting and removing duplicates775 * @param {ArrayLike} results776 */777Sizzle.uniqueSort = function( results ) {778 var elem,779 duplicates = [],780 j = 0,781 i = 0;782 // Unless we *know* we can detect duplicates, assume their presence783 hasDuplicate = !support.detectDuplicates;784 sortInput = !support.sortStable && results.slice( 0 );785 results.sort( sortOrder );786 if ( hasDuplicate ) {787 while ( (elem = results[i++]) ) {788 if ( elem === results[ i ] ) {789 j = duplicates.push( i );790 }791 }792 while ( j-- ) {793 results.splice( duplicates[ j ], 1 );794 }795 }796 // Clear input after sorting to release objects797 // See https://github.com/jquery/sizzle/pull/225798 sortInput = null;799 return results;800};801/**802 * Utility function for retrieving the text value of an array of DOM nodes803 * @param {Array|Element} elem804 */805getText = Sizzle.getText = function( elem ) {806 var node,807 ret = "",808 i = 0,809 nodeType = elem.nodeType;810 if ( !nodeType ) {811 // If no nodeType, this is expected to be an array812 while ( (node = elem[i++]) ) {813 // Do not traverse comment nodes814 ret += getText( node );815 }816 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {817 // Use textContent for elements818 // innerText usage removed for consistency of new lines (jQuery #11153)819 if ( typeof elem.textContent === "string" ) {820 return elem.textContent;821 } else {822 // Traverse its children823 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {824 ret += getText( elem );825 }826 }827 } else if ( nodeType === 3 || nodeType === 4 ) {828 return elem.nodeValue;829 }830 // Do not include comment or processing instruction nodes831 return ret;832};833Expr = Sizzle.selectors = {834 // Can be adjusted by the user835 cacheLength: 50,836 createPseudo: markFunction,837 match: matchExpr,838 attrHandle: {},839 find: {},840 relative: {841 ">": { dir: "parentNode", first: true },842 " ": { dir: "parentNode" },843 "+": { dir: "previousSibling", first: true },844 "~": { dir: "previousSibling" }845 },846 preFilter: {847 "ATTR": function( match ) {848 match[1] = match[1].replace( runescape, funescape );849 // Move the given value to match[3] whether quoted or unquoted850 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );851 if ( match[2] === "~=" ) {852 match[3] = " " + match[3] + " ";853 }854 return match.slice( 0, 4 );855 },856 "CHILD": function( match ) {857 /* matches from matchExpr["CHILD"]858 1 type (only|nth|...)859 2 what (child|of-type)860 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)861 4 xn-component of xn+y argument ([+-]?\d*n|)862 5 sign of xn-component863 6 x of xn-component864 7 sign of y-component865 8 y of y-component866 */867 match[1] = match[1].toLowerCase();868 if ( match[1].slice( 0, 3 ) === "nth" ) {869 // nth-* requires argument870 if ( !match[3] ) {871 Sizzle.error( match[0] );872 }873 // numeric x and y parameters for Expr.filter.CHILD874 // remember that false/true cast respectively to 0/1875 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );876 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );877 // other types prohibit arguments878 } else if ( match[3] ) {879 Sizzle.error( match[0] );880 }881 return match;882 },883 "PSEUDO": function( match ) {884 var excess,885 unquoted = !match[6] && match[2];886 if ( matchExpr["CHILD"].test( match[0] ) ) {887 return null;888 }889 // Accept quoted arguments as-is890 if ( match[3] ) {891 match[2] = match[4] || match[5] || "";892 // Strip excess characters from unquoted arguments893 } else if ( unquoted && rpseudo.test( unquoted ) &&894 // Get excess from tokenize (recursively)895 (excess = tokenize( unquoted, true )) &&896 // advance to the next closing parenthesis897 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {898 // excess is a negative index899 match[0] = match[0].slice( 0, excess );900 match[2] = unquoted.slice( 0, excess );901 }902 // Return only captures needed by the pseudo filter method (type and argument)903 return match.slice( 0, 3 );904 }905 },906 filter: {907 "TAG": function( nodeNameSelector ) {908 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();909 return nodeNameSelector === "*" ?910 function() { return true; } :911 function( elem ) {912 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;913 };914 },915 "CLASS": function( className ) {916 var pattern = classCache[ className + " " ];917 return pattern ||918 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&919 classCache( className, function( elem ) {920 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );921 });922 },923 "ATTR": function( name, operator, check ) {924 return function( elem ) {925 var result = Sizzle.attr( elem, name );926 if ( result == null ) {927 return operator === "!=";928 }929 if ( !operator ) {930 return true;931 }932 result += "";933 return operator === "=" ? result === check :934 operator === "!=" ? result !== check :935 operator === "^=" ? check && result.indexOf( check ) === 0 :936 operator === "*=" ? check && result.indexOf( check ) > -1 :937 operator === "$=" ? check && result.slice( -check.length ) === check :938 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :939 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :940 false;941 };942 },943 "CHILD": function( type, what, argument, first, last ) {944 var simple = type.slice( 0, 3 ) !== "nth",945 forward = type.slice( -4 ) !== "last",946 ofType = what === "of-type";947 return first === 1 && last === 0 ?948 // Shortcut for :nth-*(n)949 function( elem ) {950 return !!elem.parentNode;951 } :952 function( elem, context, xml ) {953 var cache, uniqueCache, outerCache, node, nodeIndex, start,954 dir = simple !== forward ? "nextSibling" : "previousSibling",955 parent = elem.parentNode,956 name = ofType && elem.nodeName.toLowerCase(),957 useCache = !xml && !ofType,958 diff = false;959 if ( parent ) {960 // :(first|last|only)-(child|of-type)961 if ( simple ) {962 while ( dir ) {963 node = elem;964 while ( (node = node[ dir ]) ) {965 if ( ofType ?966 node.nodeName.toLowerCase() === name :967 node.nodeType === 1 ) {968 return false;969 }970 }971 // Reverse direction for :only-* (if we haven't yet done so)972 start = dir = type === "only" && !start && "nextSibling";973 }974 return true;975 }976 start = [ forward ? parent.firstChild : parent.lastChild ];977 // non-xml :nth-child(...) stores cache data on `parent`978 if ( forward && useCache ) {979 // Seek `elem` from a previously-cached index980 // ...in a gzip-friendly way981 node = parent;982 outerCache = node[ expando ] || (node[ expando ] = {});983 // Support: IE <9 0 1 2 only defend against cloned attroperties (jquery gh-1709) uniquecache="outerCache[" node.uniqueid ] || (outercache[ cache="uniqueCache[" type []; nodeindex="cache[" dirruns && cache[ ]; diff="nodeIndex" node="nodeIndex" parent.childnodes[ while ( (node="++nodeIndex" node[ dir fallback to seeking `elem` from the start (diff="nodeIndex" = 0) start.pop()) ) { when found, indexes on `parent` and break if node.nodetype="==" ++diff elem uniquecache[ dirruns, nodeindex, break; } else use previously-cached element index available usecache ...in a gzip-friendly way outercache="node[" expando (node[ support: ie <9 xml :nth-child(...) or :nth-last-child(...) :nth(-last)?-of-type(...) false same loop as above seek oftype ? node.nodename.tolowercase()="==" name : of each encountered incorporate offset, then check cycle size -="last;" return first %>= 0 );984 }985 };986 },987 "PSEUDO": function( pseudo, argument ) {988 // pseudo-class names are case-insensitive989 // http://www.w3.org/TR/selectors/#pseudo-classes990 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters991 // Remember that setFilters inherits from pseudos992 var args,993 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||994 Sizzle.error( "unsupported pseudo: " + pseudo );995 // The user may use createPseudo to indicate that996 // arguments are needed to create the filter function997 // just as Sizzle does998 if ( fn[ expando ] ) {999 return fn( argument );1000 }1001 // But maintain support for old signatures1002 if ( fn.length > 1 ) {1003 args = [ pseudo, pseudo, "", argument ];1004 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?1005 markFunction(function( seed, matches ) {1006 var idx,1007 matched = fn( seed, argument ),1008 i = matched.length;1009 while ( i-- ) {1010 idx = indexOf( seed, matched[i] );1011 seed[ idx ] = !( matches[ idx ] = matched[i] );1012 }1013 }) :1014 function( elem ) {1015 return fn( elem, 0, args );1016 };1017 }1018 return fn;1019 }1020 },1021 pseudos: {1022 // Potentially complex pseudos1023 "not": markFunction(function( selector ) {1024 // Trim the selector passed to compile1025 // to avoid treating leading and trailing1026 // spaces as combinators1027 var input = [],1028 results = [],1029 matcher = compile( selector.replace( rtrim, "$1" ) );1030 return matcher[ expando ] ?1031 markFunction(function( seed, matches, context, xml ) {1032 var elem,1033 unmatched = matcher( seed, null, xml, [] ),1034 i = seed.length;1035 // Match elements unmatched by `matcher`1036 while ( i-- ) {1037 if ( (elem = unmatched[i]) ) {1038 seed[i] = !(matches[i] = elem);1039 }1040 }1041 }) :1042 function( elem, context, xml ) {1043 input[0] = elem;1044 matcher( input, null, xml, results );1045 // Don't keep the element (issue #299)1046 input[0] = null;1047 return !results.pop();1048 };1049 }),1050 "has": markFunction(function( selector ) {1051 return function( elem ) {1052 return Sizzle( selector, elem ).length > 0;1053 };1054 }),1055 "contains": markFunction(function( text ) {1056 text = text.replace( runescape, funescape );1057 return function( elem ) {1058 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;1059 };1060 }),1061 // "Whether an element is represented by a :lang() selector1062 // is based solely on the element's language value1063 // being equal to the identifier C,1064 // or beginning with the identifier C immediately followed by "-".1065 // The matching of C against the element's language value is performed case-insensitively.1066 // The identifier C does not have to be a valid language name."1067 // http://www.w3.org/TR/selectors/#lang-pseudo1068 "lang": markFunction( function( lang ) {1069 // lang value must be a valid identifier1070 if ( !ridentifier.test(lang || "") ) {1071 Sizzle.error( "unsupported lang: " + lang );1072 }1073 lang = lang.replace( runescape, funescape ).toLowerCase();1074 return function( elem ) {1075 var elemLang;1076 do {1077 if ( (elemLang = documentIsHTML ?1078 elem.lang :1079 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {1080 elemLang = elemLang.toLowerCase();1081 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;1082 }1083 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );1084 return false;1085 };1086 }),1087 // Miscellaneous1088 "target": function( elem ) {1089 var hash = window.location && window.location.hash;1090 return hash && hash.slice( 1 ) === elem.id;1091 },1092 "root": function( elem ) {1093 return elem === docElem;1094 },1095 "focus": function( elem ) {1096 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);1097 },1098 // Boolean properties1099 "enabled": createDisabledPseudo( false ),1100 "disabled": createDisabledPseudo( true ),1101 "checked": function( elem ) {1102 // In CSS3, :checked should return both checked and selected elements1103 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked1104 var nodeName = elem.nodeName.toLowerCase();1105 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);1106 },1107 "selected": function( elem ) {1108 // Accessing this property makes selected-by-default1109 // options in Safari work properly1110 if ( elem.parentNode ) {1111 elem.parentNode.selectedIndex;1112 }1113 return elem.selected === true;1114 },1115 // Contents1116 "empty": function( elem ) {1117 // http://www.w3.org/TR/selectors/#empty-pseudo1118 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),1119 // but not by others (comment: 8; processing instruction: 7; etc.)1120 // nodeType < 6 works because attributes (2) do not appear as children1121 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {1122 if ( elem.nodeType < 6 ) {1123 return false;1124 }1125 }1126 return true;1127 },1128 "parent": function( elem ) {1129 return !Expr.pseudos["empty"]( elem );1130 },1131 // Element/input types1132 "header": function( elem ) {1133 return rheader.test( elem.nodeName );1134 },1135 "input": function( elem ) {1136 return rinputs.test( elem.nodeName );1137 },1138 "button": function( elem ) {1139 var name = elem.nodeName.toLowerCase();1140 return name === "input" && elem.type === "button" || name === "button";1141 },1142 "text": function( elem ) {1143 var attr;1144 return elem.nodeName.toLowerCase() === "input" &&1145 elem.type === "text" &&1146 // Support: IE<8 0 1 new html5 attribute values (e.g., "search") appear with elem.type="==" "text" ( (attr="elem.getAttribute("type"))" =="null" || attr.tolowercase()="==" ); }, position-in-collection "first": createpositionalpseudo(function() { return [ ]; }), "last": createpositionalpseudo(function( matchindexes, length ) - "eq": length, argument < ? + : "even": var i="0;" for ; length; matchindexes.push( } matchindexes; "odd": "lt":> length ?1147 length :1148 argument;1149 for ( ; --i >= 0; ) {1150 matchIndexes.push( i );1151 }1152 return matchIndexes;1153 }),1154 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {1155 var i = argument < 0 ? argument + length : argument;1156 for ( ; ++i < length; ) {1157 matchIndexes.push( i );1158 }1159 return matchIndexes;1160 })1161 }1162};1163Expr.pseudos["nth"] = Expr.pseudos["eq"];1164// Add button/input type pseudos1165for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {1166 Expr.pseudos[ i ] = createInputPseudo( i );1167}1168for ( i in { submit: true, reset: true } ) {1169 Expr.pseudos[ i ] = createButtonPseudo( i );1170}1171// Easy API for creating new setFilters1172function setFilters() {}1173setFilters.prototype = Expr.filters = Expr.pseudos;1174Expr.setFilters = new setFilters();1175tokenize = Sizzle.tokenize = function( selector, parseOnly ) {1176 var matched, match, tokens, type,1177 soFar, groups, preFilters,1178 cached = tokenCache[ selector + " " ];1179 if ( cached ) {1180 return parseOnly ? 0 : cached.slice( 0 );1181 }1182 soFar = selector;1183 groups = [];1184 preFilters = Expr.preFilter;1185 while ( soFar ) {1186 // Comma and first run1187 if ( !matched || (match = rcomma.exec( soFar )) ) {1188 if ( match ) {1189 // Don't consume trailing commas as valid1190 soFar = soFar.slice( match[0].length ) || soFar;1191 }1192 groups.push( (tokens = []) );1193 }1194 matched = false;1195 // Combinators1196 if ( (match = rcombinators.exec( soFar )) ) {1197 matched = match.shift();1198 tokens.push({1199 value: matched,1200 // Cast descendant combinators to space1201 type: match[0].replace( rtrim, " " )1202 });1203 soFar = soFar.slice( matched.length );1204 }1205 // Filters1206 for ( type in Expr.filter ) {1207 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||1208 (match = preFilters[ type ]( match ))) ) {1209 matched = match.shift();1210 tokens.push({1211 value: matched,1212 type: type,1213 matches: match1214 });1215 soFar = soFar.slice( matched.length );1216 }1217 }1218 if ( !matched ) {1219 break;1220 }1221 }1222 // Return the length of the invalid excess1223 // if we're just parsing1224 // Otherwise, throw an error or return tokens1225 return parseOnly ?1226 soFar.length :1227 soFar ?1228 Sizzle.error( selector ) :1229 // Cache the tokens1230 tokenCache( selector, groups ).slice( 0 );1231};1232function toSelector( tokens ) {1233 var i = 0,1234 len = tokens.length,1235 selector = "";1236 for ( ; i < len; i++ ) {1237 selector += tokens[i].value;1238 }1239 return selector;1240}1241function addCombinator( matcher, combinator, base ) {1242 var dir = combinator.dir,1243 skip = combinator.next,1244 key = skip || dir,1245 checkNonElements = base && key === "parentNode",1246 doneName = done++;1247 return combinator.first ?1248 // Check against closest ancestor/preceding element1249 function( elem, context, xml ) {1250 while ( (elem = elem[ dir ]) ) {1251 if ( elem.nodeType === 1 || checkNonElements ) {1252 return matcher( elem, context, xml );1253 }1254 }1255 return false;1256 } :1257 // Check against all ancestor/preceding elements1258 function( elem, context, xml ) {1259 var oldCache, uniqueCache, outerCache,1260 newCache = [ dirruns, doneName ];1261 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching1262 if ( xml ) {1263 while ( (elem = elem[ dir ]) ) {1264 if ( elem.nodeType === 1 || checkNonElements ) {1265 if ( matcher( elem, context, xml ) ) {1266 return true;1267 }1268 }1269 }1270 } else {1271 while ( (elem = elem[ dir ]) ) {1272 if ( elem.nodeType === 1 || checkNonElements ) {1273 outerCache = elem[ expando ] || (elem[ expando ] = {});1274 // Support: IE <9 0 1 2 only defend against cloned attroperties (jquery gh-1709) uniquecache="outerCache[" elem.uniqueid ] || (outercache[ if ( skip && elem.nodename.tolowercase() ) { elem="elem[" dir elem; } else (oldcache="uniqueCache[" key ]) oldcache[ dirruns donename assign to newcache so results back-propagate previous elements return (newcache[ ]); reuse uniquecache[ a match means we're done; fail we have keep checking elem, context, xml )) true; false; }; function elementmatcher( matchers matchers.length> 1 ?1275 function( elem, context, xml ) {1276 var i = matchers.length;1277 while ( i-- ) {1278 if ( !matchers[i]( elem, context, xml ) ) {1279 return false;1280 }1281 }1282 return true;1283 } :1284 matchers[0];1285}1286function multipleContexts( selector, contexts, results ) {1287 var i = 0,1288 len = contexts.length;1289 for ( ; i < len; i++ ) {1290 Sizzle( selector, contexts[i], results );1291 }1292 return results;1293}1294function condense( unmatched, map, filter, context, xml ) {1295 var elem,1296 newUnmatched = [],1297 i = 0,1298 len = unmatched.length,1299 mapped = map != null;1300 for ( ; i < len; i++ ) {1301 if ( (elem = unmatched[i]) ) {1302 if ( !filter || filter( elem, context, xml ) ) {1303 newUnmatched.push( elem );1304 if ( mapped ) {1305 map.push( i );1306 }1307 }1308 }1309 }1310 return newUnmatched;1311}1312function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {1313 if ( postFilter && !postFilter[ expando ] ) {1314 postFilter = setMatcher( postFilter );1315 }1316 if ( postFinder && !postFinder[ expando ] ) {1317 postFinder = setMatcher( postFinder, postSelector );1318 }1319 return markFunction(function( seed, results, context, xml ) {1320 var temp, i, elem,1321 preMap = [],1322 postMap = [],1323 preexisting = results.length,1324 // Get initial elements from seed or context1325 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),1326 // Prefilter to get matcher input, preserving a map for seed-results synchronization1327 matcherIn = preFilter && ( seed || !selector ) ?1328 condense( elems, preMap, preFilter, context, xml ) :1329 elems,1330 matcherOut = matcher ?1331 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,1332 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?1333 // ...intermediate processing is necessary1334 [] :1335 // ...otherwise use results directly1336 results :1337 matcherIn;1338 // Find primary matches1339 if ( matcher ) {1340 matcher( matcherIn, matcherOut, context, xml );1341 }1342 // Apply postFilter1343 if ( postFilter ) {1344 temp = condense( matcherOut, postMap );1345 postFilter( temp, [], context, xml );1346 // Un-match failing elements by moving them back to matcherIn1347 i = temp.length;1348 while ( i-- ) {1349 if ( (elem = temp[i]) ) {1350 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);1351 }1352 }1353 }1354 if ( seed ) {1355 if ( postFinder || preFilter ) {1356 if ( postFinder ) {1357 // Get the final matcherOut by condensing this intermediate into postFinder contexts1358 temp = [];1359 i = matcherOut.length;1360 while ( i-- ) {1361 if ( (elem = matcherOut[i]) ) {1362 // Restore matcherIn since elem is not yet a final match1363 temp.push( (matcherIn[i] = elem) );1364 }1365 }1366 postFinder( null, (matcherOut = []), temp, xml );1367 }1368 // Move matched elements from seed to results to keep them synchronized1369 i = matcherOut.length;1370 while ( i-- ) {1371 if ( (elem = matcherOut[i]) &&1372 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {1373 seed[temp] = !(results[temp] = elem);1374 }1375 }1376 }1377 // Add elements to results, through postFinder if defined1378 } else {1379 matcherOut = condense(1380 matcherOut === results ?1381 matcherOut.splice( preexisting, matcherOut.length ) :1382 matcherOut1383 );1384 if ( postFinder ) {1385 postFinder( null, results, matcherOut, xml );1386 } else {1387 push.apply( results, matcherOut );1388 }1389 }1390 });1391}1392function matcherFromTokens( tokens ) {1393 var checkContext, matcher, j,1394 len = tokens.length,1395 leadingRelative = Expr.relative[ tokens[0].type ],1396 implicitRelative = leadingRelative || Expr.relative[" "],1397 i = leadingRelative ? 1 : 0,1398 // The foundational matcher ensures that elements are reachable from top-level context(s)1399 matchContext = addCombinator( function( elem ) {1400 return elem === checkContext;1401 }, implicitRelative, true ),1402 matchAnyContext = addCombinator( function( elem ) {1403 return indexOf( checkContext, elem ) > -1;1404 }, implicitRelative, true ),1405 matchers = [ function( elem, context, xml ) {1406 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (1407 (checkContext = context).nodeType ?1408 matchContext( elem, context, xml ) :1409 matchAnyContext( elem, context, xml ) );1410 // Avoid hanging onto element (issue #299)1411 checkContext = null;1412 return ret;1413 } ];1414 for ( ; i < len; i++ ) {1415 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {1416 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];1417 } else {1418 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );1419 // Return special upon seeing a positional matcher1420 if ( matcher[ expando ] ) {1421 // Find the next relative operator (if any) for proper handling1422 j = ++i;1423 for ( ; j < len; j++ ) {1424 if ( Expr.relative[ tokens[j].type ] ) {1425 break;1426 }1427 }1428 return setMatcher(1429 i > 1 && elementMatcher( matchers ),1430 i > 1 && toSelector(1431 // If the preceding token was a descendant combinator, insert an implicit any-element `*`1432 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })1433 ).replace( rtrim, "$1" ),1434 matcher,1435 i < j && matcherFromTokens( tokens.slice( i, j ) ),1436 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),1437 j < len && toSelector( tokens )1438 );1439 }1440 matchers.push( matcher );1441 }1442 }1443 return elementMatcher( matchers );1444}1445function matcherFromGroupMatchers( elementMatchers, setMatchers ) {1446 var bySet = setMatchers.length > 0,1447 byElement = elementMatchers.length > 0,1448 superMatcher = function( seed, context, xml, results, outermost ) {1449 var elem, j, matcher,1450 matchedCount = 0,1451 i = "0",1452 unmatched = seed && [],1453 setMatched = [],1454 contextBackup = outermostContext,1455 // We must always have either seed elements or outermost context1456 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),1457 // Use integer dirruns iff this is the outermost matcher1458 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),1459 len = elems.length;1460 if ( outermost ) {1461 outermostContext = context === document || context || outermost;1462 }1463 // Add elements passing elementMatchers directly to results1464 // Support: IE<9, safari tolerate nodelist properties (ie: "length"; safari: <number>) matching elements by id1465 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {1466 if ( byElement && elem ) {1467 j = 0;1468 if ( !context && elem.ownerDocument !== document ) {1469 setDocument( elem );1470 xml = !documentIsHTML;1471 }1472 while ( (matcher = elementMatchers[j++]) ) {1473 if ( matcher( elem, context || document, xml) ) {1474 results.push( elem );1475 break;1476 }1477 }1478 if ( outermost ) {1479 dirruns = dirrunsUnique;1480 }1481 }1482 // Track unmatched elements for set filters1483 if ( bySet ) {1484 // They will have gone through all possible matchers1485 if ( (elem = !matcher && elem) ) {1486 matchedCount--;1487 }1488 // Lengthen the array for every element, matched or not1489 if ( seed ) {1490 unmatched.push( elem );1491 }1492 }1493 }1494 // `i` is now the count of elements visited above, and adding it to `matchedCount`1495 // makes the latter nonnegative.1496 matchedCount += i;1497 // Apply set filters to unmatched elements1498 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`1499 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have1500 // no element matchers and no seed.1501 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that1502 // case, which will result in a "00" `matchedCount` that differs from `i` but is also1503 // numerically zero.1504 if ( bySet && i !== matchedCount ) {1505 j = 0;1506 while ( (matcher = setMatchers[j++]) ) {1507 matcher( unmatched, setMatched, context, xml );1508 }1509 if ( seed ) {1510 // Reintegrate element matches to eliminate the need for sorting1511 if ( matchedCount > 0 ) {1512 while ( i-- ) {1513 if ( !(unmatched[i] || setMatched[i]) ) {1514 setMatched[i] = pop.call( results );1515 }1516 }1517 }1518 // Discard index placeholder values to get only actual matches1519 setMatched = condense( setMatched );1520 }1521 // Add matches to results1522 push.apply( results, setMatched );1523 // Seedless set matches succeeding multiple successful matchers stipulate sorting1524 if ( outermost && !seed && setMatched.length > 0 &&1525 ( matchedCount + setMatchers.length ) > 1 ) {1526 Sizzle.uniqueSort( results );1527 }1528 }1529 // Override manipulation of globals by nested matchers1530 if ( outermost ) {1531 dirruns = dirrunsUnique;1532 outermostContext = contextBackup;1533 }1534 return unmatched;1535 };1536 return bySet ?1537 markFunction( superMatcher ) :1538 superMatcher;1539}1540compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {1541 var i,1542 setMatchers = [],1543 elementMatchers = [],1544 cached = compilerCache[ selector + " " ];1545 if ( !cached ) {1546 // Generate a function of recursive functions that can be used to check each element1547 if ( !match ) {1548 match = tokenize( selector );1549 }1550 i = match.length;1551 while ( i-- ) {1552 cached = matcherFromTokens( match[i] );1553 if ( cached[ expando ] ) {1554 setMatchers.push( cached );1555 } else {1556 elementMatchers.push( cached );1557 }1558 }1559 // Cache the compiled function1560 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );1561 // Save selector and tokenization1562 cached.selector = selector;1563 }1564 return cached;1565};1566/**1567 * A low-level selection function that works with Sizzle's compiled1568 * selector functions1569 * @param {String|Function} selector A selector or a pre-compiled1570 * selector function built with Sizzle.compile1571 * @param {Element} context1572 * @param {Array} [results]1573 * @param {Array} [seed] A set of elements to match against1574 */1575select = Sizzle.select = function( selector, context, results, seed ) {1576 var i, tokens, token, type, find,1577 compiled = typeof selector === "function" && selector,1578 match = !seed && tokenize( (selector = compiled.selector || selector) );1579 results = results || [];1580 // Try to minimize operations if there is only one selector in the list and no seed1581 // (the latter of which guarantees us context)1582 if ( match.length === 1 ) {1583 // Reduce context if the leading compound selector is an ID1584 tokens = match[0] = match[0].slice( 0 );1585 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&1586 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {1587 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];1588 if ( !context ) {1589 return results;1590 // Precompiled matchers will still verify ancestry, so step up a level1591 } else if ( compiled ) {1592 context = context.parentNode;1593 }1594 selector = selector.slice( tokens.shift().value.length );1595 }1596 // Fetch a seed set for right-to-left matching1597 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;1598 while ( i-- ) {1599 token = tokens[i];1600 // Abort if we hit a combinator1601 if ( Expr.relative[ (type = token.type) ] ) {1602 break;1603 }1604 if ( (find = Expr.find[ type ]) ) {1605 // Search, expanding context for leading sibling combinators1606 if ( (seed = find(1607 token.matches[0].replace( runescape, funescape ),1608 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context1609 )) ) {1610 // If seed is empty or no tokens remain, we can return early1611 tokens.splice( i, 1 );1612 selector = seed.length && toSelector( tokens );1613 if ( !selector ) {1614 push.apply( results, seed );1615 return results;1616 }1617 break;1618 }1619 }1620 }1621 }1622 // Compile and execute a filtering function if one is not provided1623 // Provide `match` to avoid retokenization if we modified the selector above1624 ( compiled || compile( selector, match ) )(1625 seed,1626 context,1627 !documentIsHTML,1628 results,1629 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context1630 );1631 return results;1632};1633// One-time assignments1634// Sort stability1635support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;1636// Support: Chrome 14-35+1637// Always assume duplicates if they aren't passed to the comparison function1638support.detectDuplicates = !!hasDuplicate;1639// Initialize against the default document1640setDocument();1641// Support: Webkit<537.32 1 2 4 9 25 - safari 6.0.3 chrome (fixed in 27) detached nodes confoundingly follow *each other* support.sortdetached="assert(function(" el ) { should return 1, but returns (following) el.comparedocumentposition( document.createelement("fieldset") & 1; }); support: ie<8 prevent attribute property "interpolation" https: msdn.microsoft.com en-us library ms536429%28vs.85%29.aspx if ( !assert(function( el.innerhtml="<a href='#'></a>" ; el.firstchild.getattribute("href")="==" "#" }) addhandle( "type|href|height|width", function( elem, name, isxml !isxml elem.getattribute( name.tolowercase()="==" "type" ? : ); } ie<9 use defaultvalue place of getattribute("value") !support.attributes || el.firstchild.setattribute( "value", "" el.firstchild.getattribute( "value" ""; && elem.nodename.tolowercase()="==" "input" elem.defaultvalue; getattributenode to fetch booleans when getattribute lies el.getattribute("disabled")="=" null; booleans, var val; elem[ name ]="==" true (val="elem.getAttributeNode(" )) val.specified val.value sizzle; })( window jquery.find="Sizzle;" jquery.expr="Sizzle.selectors;" deprecated jquery.expr[ ":" jquery.uniquesort="jQuery.unique" = sizzle.uniquesort; jquery.text="Sizzle.getText;" jquery.isxmldoc="Sizzle.isXML;" jquery.contains="Sizzle.contains;" jquery.escapeselector="Sizzle.escape;" dir="function(" dir, until matched="[]," truncate="until" !="=" undefined; while elem="elem[" elem.nodetype jquery( ).is( break; matched.push( matched; }; siblings="function(" n, for n; n="n.nextSibling" n.nodetype="==" rneedscontext="jQuery.expr.match.needsContext;" function nodename( elem.nodename name.tolowercase(); rsingletag="(" ^<([a-z][^\ \0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\ \1>|)$/i );1642// Implement the identical functionality for filter and not1643function winnow( elements, qualifier, not ) {1644 if ( isFunction( qualifier ) ) {1645 return jQuery.grep( elements, function( elem, i ) {1646 return !!qualifier.call( elem, i, elem ) !== not;1647 } );1648 }1649 // Single element1650 if ( qualifier.nodeType ) {1651 return jQuery.grep( elements, function( elem ) {1652 return ( elem === qualifier ) !== not;1653 } );1654 }1655 // Arraylike of elements (jQuery, arguments, Array)1656 if ( typeof qualifier !== "string" ) {1657 return jQuery.grep( elements, function( elem ) {1658 return ( indexOf.call( qualifier, elem ) > -1 ) !== not;1659 } );1660 }1661 // Filtered directly for both simple and complex selectors1662 return jQuery.filter( qualifier, elements, not );1663}1664jQuery.filter = function( expr, elems, not ) {1665 var elem = elems[ 0 ];1666 if ( not ) {1667 expr = ":not(" + expr + ")";1668 }1669 if ( elems.length === 1 && elem.nodeType === 1 ) {1670 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];1671 }1672 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {1673 return elem.nodeType === 1;1674 } ) );1675};1676jQuery.fn.extend( {1677 find: function( selector ) {1678 var i, ret,1679 len = this.length,1680 self = this;1681 if ( typeof selector !== "string" ) {1682 return this.pushStack( jQuery( selector ).filter( function() {1683 for ( i = 0; i < len; i++ ) {1684 if ( jQuery.contains( self[ i ], this ) ) {1685 return true;1686 }1687 }1688 } ) );1689 }1690 ret = this.pushStack( [] );1691 for ( i = 0; i < len; i++ ) {1692 jQuery.find( selector, self[ i ], ret );1693 }1694 return len > 1 ? jQuery.uniqueSort( ret ) : ret;1695 },1696 filter: function( selector ) {1697 return this.pushStack( winnow( this, selector || [], false ) );1698 },1699 not: function( selector ) {1700 return this.pushStack( winnow( this, selector || [], true ) );1701 },1702 is: function( selector ) {1703 return !!winnow(1704 this,1705 // If this is a positional/relative selector, check membership in the returned set1706 // so $("p:first").is("p:last") won't return true for a doc with two "p".1707 typeof selector === "string" && rneedsContext.test( selector ) ?1708 jQuery( selector ) :1709 selector || [],1710 false1711 ).length;1712 }1713} );1714// Initialize a jQuery object1715// A central reference to the root jQuery(document)1716var rootjQuery,1717 // A simple way to check for HTML strings1718 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)1719 // Strict HTML recognition (#11290: must start with <) shortcut simple #id case for speed rquickexpr="/^(?:\s*(<[\w\W]+">)[^>]*|#([\w-]+))$/,1720 init = jQuery.fn.init = function( selector, context, root ) {1721 var match, elem;1722 // HANDLE: $(""), $(null), $(undefined), $(false)1723 if ( !selector ) {1724 return this;1725 }1726 // Method init() accepts an alternate rootjQuery1727 // so migrate can support jQuery.sub (gh-2101)1728 root = root || rootjQuery;1729 // Handle HTML strings1730 if ( typeof selector === "string" ) {1731 if ( selector[ 0 ] === "<" 1 && selector[ selector.length - ]="==" ">" &&1732 selector.length >= 3 ) {1733 // Assume that strings that start and end with <> are HTML and skip the regex check1734 match = [ null, selector, null ];1735 } else {1736 match = rquickExpr.exec( selector );1737 }1738 // Match html or make sure no context is specified for #id1739 if ( match && ( match[ 1 ] || !context ) ) {1740 // HANDLE: $(html) -> $(array)1741 if ( match[ 1 ] ) {1742 context = context instanceof jQuery ? context[ 0 ] : context;1743 // Option to run scripts is true for back-compat1744 // Intentionally let the error be thrown if parseHTML is not present1745 jQuery.merge( this, jQuery.parseHTML(1746 match[ 1 ],1747 context && context.nodeType ? context.ownerDocument || context : document,1748 true1749 ) );1750 // HANDLE: $(html, props)1751 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {1752 for ( match in context ) {1753 // Properties of context are called as methods if possible1754 if ( isFunction( this[ match ] ) ) {1755 this[ match ]( context[ match ] );1756 // ...and otherwise set as attributes1757 } else {1758 this.attr( match, context[ match ] );1759 }1760 }1761 }1762 return this;1763 // HANDLE: $(#id)1764 } else {1765 elem = document.getElementById( match[ 2 ] );1766 if ( elem ) {1767 // Inject the element directly into the jQuery object1768 this[ 0 ] = elem;1769 this.length = 1;1770 }1771 return this;1772 }1773 // HANDLE: $(expr, $(...))1774 } else if ( !context || context.jquery ) {1775 return ( context || root ).find( selector );1776 // HANDLE: $(expr, context)1777 // (which is just equivalent to: $(context).find(expr)1778 } else {1779 return this.constructor( context ).find( selector );1780 }1781 // HANDLE: $(DOMElement)1782 } else if ( selector.nodeType ) {1783 this[ 0 ] = selector;1784 this.length = 1;1785 return this;1786 // HANDLE: $(function)1787 // Shortcut for document ready1788 } else if ( isFunction( selector ) ) {1789 return root.ready !== undefined ?1790 root.ready( selector ) :1791 // Execute immediately if ready is not present1792 selector( jQuery );1793 }1794 return jQuery.makeArray( selector, this );1795 };1796// Give the init function the jQuery prototype for later instantiation1797init.prototype = jQuery.fn;1798// Initialize central reference1799rootjQuery = jQuery( document );1800var rparentsprev = /^(?:parents|prev(?:Until|All))/,1801 // Methods guaranteed to produce a unique set when starting from a unique set1802 guaranteedUnique = {1803 children: true,1804 contents: true,1805 next: true,1806 prev: true1807 };1808jQuery.fn.extend( {1809 has: function( target ) {1810 var targets = jQuery( target, this ),1811 l = targets.length;1812 return this.filter( function() {1813 var i = 0;1814 for ( ; i < l; i++ ) {1815 if ( jQuery.contains( this, targets[ i ] ) ) {1816 return true;1817 }1818 }1819 } );1820 },1821 closest: function( selectors, context ) {1822 var cur,1823 i = 0,1824 l = this.length,1825 matched = [],1826 targets = typeof selectors !== "string" && jQuery( selectors );1827 // Positional selectors never match, since there's no _selection_ context1828 if ( !rneedsContext.test( selectors ) ) {1829 for ( ; i < l; i++ ) {1830 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {1831 // Always skip document fragments1832 if ( cur.nodeType < 11 && ( targets ?1833 targets.index( cur ) > -1 :1834 // Don't pass non-elements to Sizzle1835 cur.nodeType === 1 &&1836 jQuery.find.matchesSelector( cur, selectors ) ) ) {1837 matched.push( cur );1838 break;1839 }1840 }1841 }1842 }1843 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );1844 },1845 // Determine the position of an element within the set1846 index: function( elem ) {1847 // No argument, return index in parent1848 if ( !elem ) {1849 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;1850 }1851 // Index in selector1852 if ( typeof elem === "string" ) {1853 return indexOf.call( jQuery( elem ), this[ 0 ] );1854 }1855 // Locate the position of the desired element1856 return indexOf.call( this,1857 // If it receives a jQuery object, the first element is used1858 elem.jquery ? elem[ 0 ] : elem1859 );1860 },1861 add: function( selector, context ) {1862 return this.pushStack(1863 jQuery.uniqueSort(1864 jQuery.merge( this.get(), jQuery( selector, context ) )1865 )1866 );1867 },1868 addBack: function( selector ) {1869 return this.add( selector == null ?1870 this.prevObject : this.prevObject.filter( selector )1871 );1872 }1873} );1874function sibling( cur, dir ) {1875 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}1876 return cur;1877}1878jQuery.each( {1879 parent: function( elem ) {1880 var parent = elem.parentNode;1881 return parent && parent.nodeType !== 11 ? parent : null;1882 },1883 parents: function( elem ) {1884 return dir( elem, "parentNode" );1885 },1886 parentsUntil: function( elem, i, until ) {1887 return dir( elem, "parentNode", until );1888 },1889 next: function( elem ) {1890 return sibling( elem, "nextSibling" );1891 },1892 prev: function( elem ) {1893 return sibling( elem, "previousSibling" );1894 },1895 nextAll: function( elem ) {1896 return dir( elem, "nextSibling" );1897 },1898 prevAll: function( elem ) {1899 return dir( elem, "previousSibling" );1900 },1901 nextUntil: function( elem, i, until ) {1902 return dir( elem, "nextSibling", until );1903 },1904 prevUntil: function( elem, i, until ) {1905 return dir( elem, "previousSibling", until );1906 },1907 siblings: function( elem ) {1908 return siblings( ( elem.parentNode || {} ).firstChild, elem );1909 },1910 children: function( elem ) {1911 return siblings( elem.firstChild );1912 },1913 contents: function( elem ) {1914 if ( typeof elem.contentDocument !== "undefined" ) {1915 return elem.contentDocument;1916 }1917 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only treat the template element as a regular one in browsers that don't support it. if ( nodename( elem, "template" ) { elem="elem.content" || elem; } return jquery.merge( [], elem.childnodes ); }, function( name, fn jquery.fn[ name ]="function(" until, selector var matched="jQuery.map(" this, fn, until name.slice( -5 !="=" "until" && typeof "string" selector, this.length> 1 ) {1918 // Remove duplicates1919 if ( !guaranteedUnique[ name ] ) {1920 jQuery.uniqueSort( matched );1921 }1922 // Reverse order for parents* and prev-derivatives1923 if ( rparentsprev.test( name ) ) {1924 matched.reverse();1925 }1926 }1927 return this.pushStack( matched );1928 };1929} );1930var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );1931// Convert String-formatted options into Object-formatted ones1932function createOptions( options ) {1933 var object = {};1934 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {1935 object[ flag ] = true;1936 } );1937 return object;1938}1939/*1940 * Create a callback list using the following parameters:1941 *1942 * options: an optional list of space-separated options that will change how1943 * the callback list behaves or a more traditional option object1944 *1945 * By default a callback list will act like an event callback list and can be1946 * "fired" multiple times.1947 *1948 * Possible options:1949 *1950 * once: will ensure the callback list can only be fired once (like a Deferred)1951 *1952 * memory: will keep track of previous values and will call any callback added1953 * after the list has been fired right away with the latest "memorized"1954 * values (like a Deferred)1955 *1956 * unique: will ensure a callback can only be added once (no duplicate in the list)1957 *1958 * stopOnFalse: interrupt callings when a callback returns false1959 *1960 */1961jQuery.Callbacks = function( options ) {1962 // Convert options from String-formatted to Object-formatted if needed1963 // (we check in cache first)1964 options = typeof options === "string" ?1965 createOptions( options ) :1966 jQuery.extend( {}, options );1967 var // Flag to know if list is currently firing1968 firing,1969 // Last fire value for non-forgettable lists1970 memory,1971 // Flag to know if list was already fired1972 fired,1973 // Flag to prevent firing1974 locked,1975 // Actual callback list1976 list = [],1977 // Queue of execution data for repeatable lists1978 queue = [],1979 // Index of currently firing callback (modified by add/remove as needed)1980 firingIndex = -1,1981 // Fire callbacks1982 fire = function() {1983 // Enforce single-firing1984 locked = locked || options.once;1985 // Execute callbacks for all pending executions,1986 // respecting firingIndex overrides and runtime changes1987 fired = firing = true;1988 for ( ; queue.length; firingIndex = -1 ) {1989 memory = queue.shift();1990 while ( ++firingIndex < list.length ) {1991 // Run callback and check for early termination1992 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&1993 options.stopOnFalse ) {1994 // Jump to end and forget the data so .add doesn't re-fire1995 firingIndex = list.length;1996 memory = false;1997 }1998 }1999 }2000 // Forget the data if we're done with it2001 if ( !options.memory ) {2002 memory = false;2003 }2004 firing = false;2005 // Clean up if we're done firing for good2006 if ( locked ) {2007 // Keep an empty list if we have data for future add calls2008 if ( memory ) {2009 list = [];2010 // Otherwise, this object is spent2011 } else {2012 list = "";2013 }2014 }2015 },2016 // Actual Callbacks object2017 self = {2018 // Add a callback or a collection of callbacks to the list2019 add: function() {2020 if ( list ) {2021 // If we have memory from a past run, we should fire after adding2022 if ( memory && !firing ) {2023 firingIndex = list.length - 1;2024 queue.push( memory );2025 }2026 ( function add( args ) {2027 jQuery.each( args, function( _, arg ) {2028 if ( isFunction( arg ) ) {2029 if ( !options.unique || !self.has( arg ) ) {2030 list.push( arg );2031 }2032 } else if ( arg && arg.length && toType( arg ) !== "string" ) {2033 // Inspect recursively2034 add( arg );2035 }2036 } );2037 } )( arguments );2038 if ( memory && !firing ) {2039 fire();2040 }2041 }2042 return this;2043 },2044 // Remove a callback from the list2045 remove: function() {2046 jQuery.each( arguments, function( _, arg ) {2047 var index;2048 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {2049 list.splice( index, 1 );2050 // Handle firing indexes2051 if ( index <= firingindex ) { firingindex--; } ); return this; }, check if a given callback is in the list. no argument given, whether or not list has callbacks attached. has: function( fn ? jquery.inarray( fn,> -1 :2052 list.length > 0;2053 },2054 // Remove all callbacks from the list2055 empty: function() {2056 if ( list ) {2057 list = [];2058 }2059 return this;2060 },2061 // Disable .fire and .add2062 // Abort any current/pending executions2063 // Clear all callbacks and values2064 disable: function() {2065 locked = queue = [];2066 list = memory = "";2067 return this;2068 },2069 disabled: function() {2070 return !list;2071 },2072 // Disable .fire2073 // Also disable .add unless we have memory (since it would have no effect)2074 // Abort any pending executions2075 lock: function() {2076 locked = queue = [];2077 if ( !memory && !firing ) {2078 list = memory = "";2079 }2080 return this;2081 },2082 locked: function() {2083 return !!locked;2084 },2085 // Call all callbacks with the given context and arguments2086 fireWith: function( context, args ) {2087 if ( !locked ) {2088 args = args || [];2089 args = [ context, args.slice ? args.slice() : args ];2090 queue.push( args );2091 if ( !firing ) {2092 fire();2093 }2094 }2095 return this;2096 },2097 // Call all the callbacks with the given arguments2098 fire: function() {2099 self.fireWith( this, arguments );2100 return this;2101 },2102 // To know if the callbacks have already been called at least once2103 fired: function() {2104 return !!fired;2105 }2106 };2107 return self;2108};2109function Identity( v ) {2110 return v;2111}2112function Thrower( ex ) {2113 throw ex;2114}2115function adoptValue( value, resolve, reject, noValue ) {2116 var method;2117 try {2118 // Check for promise aspect first to privilege synchronous behavior2119 if ( value && isFunction( ( method = value.promise ) ) ) {2120 method.call( value ).done( resolve ).fail( reject );2121 // Other thenables2122 } else if ( value && isFunction( ( method = value.then ) ) ) {2123 method.call( value, resolve, reject );2124 // Other non-thenables2125 } else {2126 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:2127 // * false: [ value ].slice( 0 ) => resolve( value )2128 // * true: [ value ].slice( 1 ) => resolve()2129 resolve.apply( undefined, [ value ].slice( noValue ) );2130 }2131 // For Promises/A+, convert exceptions into rejections2132 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in2133 // Deferred#then to conditionally suppress rejection.2134 } catch ( value ) {2135 // Support: Android 4.0 only2136 // Strict mode functions invoked without .call/.apply get global-object context2137 reject.apply( undefined, [ value ] );2138 }2139}2140jQuery.extend( {2141 Deferred: function( func ) {2142 var tuples = [2143 // action, add listener, callbacks,2144 // ... .then handlers, argument index, [final state]2145 [ "notify", "progress", jQuery.Callbacks( "memory" ),2146 jQuery.Callbacks( "memory" ), 2 ],2147 [ "resolve", "done", jQuery.Callbacks( "once memory" ),2148 jQuery.Callbacks( "once memory" ), 0, "resolved" ],2149 [ "reject", "fail", jQuery.Callbacks( "once memory" ),2150 jQuery.Callbacks( "once memory" ), 1, "rejected" ]2151 ],2152 state = "pending",2153 promise = {2154 state: function() {2155 return state;2156 },2157 always: function() {2158 deferred.done( arguments ).fail( arguments );2159 return this;2160 },2161 "catch": function( fn ) {2162 return promise.then( null, fn );2163 },2164 // Keep pipe for back-compat2165 pipe: function( /* fnDone, fnFail, fnProgress */ ) {2166 var fns = arguments;2167 return jQuery.Deferred( function( newDefer ) {2168 jQuery.each( tuples, function( i, tuple ) {2169 // Map tuples (progress, done, fail) to arguments (done, fail, progress)2170 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];2171 // deferred.progress(function() { bind to newDefer or newDefer.notify })2172 // deferred.done(function() { bind to newDefer or newDefer.resolve })2173 // deferred.fail(function() { bind to newDefer or newDefer.reject })2174 deferred[ tuple[ 1 ] ]( function() {2175 var returned = fn && fn.apply( this, arguments );2176 if ( returned && isFunction( returned.promise ) ) {2177 returned.promise()2178 .progress( newDefer.notify )2179 .done( newDefer.resolve )2180 .fail( newDefer.reject );2181 } else {2182 newDefer[ tuple[ 0 ] + "With" ](2183 this,2184 fn ? [ returned ] : arguments2185 );2186 }2187 } );2188 } );2189 fns = null;2190 } ).promise();2191 },2192 then: function( onFulfilled, onRejected, onProgress ) {2193 var maxDepth = 0;2194 function resolve( depth, deferred, handler, special ) {2195 return function() {2196 var that = this,2197 args = arguments,2198 mightThrow = function() {2199 var returned, then;2200 // Support: Promises/A+ section 2.3.3.3.32201 // https://promisesaplus.com/#point-592202 // Ignore double-resolution attempts2203 if ( depth < maxDepth ) {2204 return;2205 }2206 returned = handler.apply( that, args );2207 // Support: Promises/A+ section 2.3.12208 // https://promisesaplus.com/#point-482209 if ( returned === deferred.promise() ) {2210 throw new TypeError( "Thenable self-resolution" );2211 }2212 // Support: Promises/A+ sections 2.3.3.1, 3.52213 // https://promisesaplus.com/#point-542214 // https://promisesaplus.com/#point-752215 // Retrieve `then` only once2216 then = returned &&2217 // Support: Promises/A+ section 2.3.42218 // https://promisesaplus.com/#point-642219 // Only check objects and functions for thenability2220 ( typeof returned === "object" ||2221 typeof returned === "function" ) &&2222 returned.then;2223 // Handle a returned thenable2224 if ( isFunction( then ) ) {2225 // Special processors (notify) just wait for resolution2226 if ( special ) {2227 then.call(2228 returned,2229 resolve( maxDepth, deferred, Identity, special ),2230 resolve( maxDepth, deferred, Thrower, special )2231 );2232 // Normal processors (resolve) also hook into progress2233 } else {2234 // ...and disregard older resolution values2235 maxDepth++;2236 then.call(2237 returned,2238 resolve( maxDepth, deferred, Identity, special ),2239 resolve( maxDepth, deferred, Thrower, special ),2240 resolve( maxDepth, deferred, Identity,2241 deferred.notifyWith )2242 );2243 }2244 // Handle all other returned values2245 } else {2246 // Only substitute handlers pass on context2247 // and multiple values (non-spec behavior)2248 if ( handler !== Identity ) {2249 that = undefined;2250 args = [ returned ];2251 }2252 // Process the value(s)2253 // Default process is resolve2254 ( special || deferred.resolveWith )( that, args );2255 }2256 },2257 // Only normal processors (resolve) catch and reject exceptions2258 process = special ?2259 mightThrow :2260 function() {2261 try {2262 mightThrow();2263 } catch ( e ) {2264 if ( jQuery.Deferred.exceptionHook ) {2265 jQuery.Deferred.exceptionHook( e,2266 process.stackTrace );2267 }2268 // Support: Promises/A+ section 2.3.3.3.4.12269 // https://promisesaplus.com/#point-612270 // Ignore post-resolution exceptions2271 if ( depth + 1 >= maxDepth ) {2272 // Only substitute handlers pass on context2273 // and multiple values (non-spec behavior)2274 if ( handler !== Thrower ) {2275 that = undefined;2276 args = [ e ];2277 }2278 deferred.rejectWith( that, args );2279 }2280 }2281 };2282 // Support: Promises/A+ section 2.3.3.3.12283 // https://promisesaplus.com/#point-572284 // Re-resolve promises immediately to dodge false rejection from2285 // subsequent errors2286 if ( depth ) {2287 process();2288 } else {2289 // Call an optional hook to record the stack, in case of exception2290 // since it's otherwise lost when execution goes async2291 if ( jQuery.Deferred.getStackHook ) {2292 process.stackTrace = jQuery.Deferred.getStackHook();2293 }2294 window.setTimeout( process );2295 }2296 };2297 }2298 return jQuery.Deferred( function( newDefer ) {2299 // progress_handlers.add( ... )2300 tuples[ 0 ][ 3 ].add(2301 resolve(2302 0,2303 newDefer,2304 isFunction( onProgress ) ?2305 onProgress :2306 Identity,2307 newDefer.notifyWith2308 )2309 );2310 // fulfilled_handlers.add( ... )2311 tuples[ 1 ][ 3 ].add(2312 resolve(2313 0,2314 newDefer,2315 isFunction( onFulfilled ) ?2316 onFulfilled :2317 Identity2318 )2319 );2320 // rejected_handlers.add( ... )2321 tuples[ 2 ][ 3 ].add(2322 resolve(2323 0,2324 newDefer,2325 isFunction( onRejected ) ?2326 onRejected :2327 Thrower2328 )2329 );2330 } ).promise();2331 },2332 // Get a promise for this deferred2333 // If obj is provided, the promise aspect is added to the object2334 promise: function( obj ) {2335 return obj != null ? jQuery.extend( obj, promise ) : promise;2336 }2337 },2338 deferred = {};2339 // Add list-specific methods2340 jQuery.each( tuples, function( i, tuple ) {2341 var list = tuple[ 2 ],2342 stateString = tuple[ 5 ];2343 // promise.progress = list.add2344 // promise.done = list.add2345 // promise.fail = list.add2346 promise[ tuple[ 1 ] ] = list.add;2347 // Handle state2348 if ( stateString ) {2349 list.add(2350 function() {2351 // state = "resolved" (i.e., fulfilled)2352 // state = "rejected"2353 state = stateString;2354 },2355 // rejected_callbacks.disable2356 // fulfilled_callbacks.disable2357 tuples[ 3 - i ][ 2 ].disable,2358 // rejected_handlers.disable2359 // fulfilled_handlers.disable2360 tuples[ 3 - i ][ 3 ].disable,2361 // progress_callbacks.lock2362 tuples[ 0 ][ 2 ].lock,2363 // progress_handlers.lock2364 tuples[ 0 ][ 3 ].lock2365 );2366 }2367 // progress_handlers.fire2368 // fulfilled_handlers.fire2369 // rejected_handlers.fire2370 list.add( tuple[ 3 ].fire );2371 // deferred.notify = function() { deferred.notifyWith(...) }2372 // deferred.resolve = function() { deferred.resolveWith(...) }2373 // deferred.reject = function() { deferred.rejectWith(...) }2374 deferred[ tuple[ 0 ] ] = function() {2375 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );2376 return this;2377 };2378 // deferred.notifyWith = list.fireWith2379 // deferred.resolveWith = list.fireWith2380 // deferred.rejectWith = list.fireWith2381 deferred[ tuple[ 0 ] + "With" ] = list.fireWith;2382 } );2383 // Make the deferred a promise2384 promise.promise( deferred );2385 // Call given func if any2386 if ( func ) {2387 func.call( deferred, deferred );2388 }2389 // All done!2390 return deferred;2391 },2392 // Deferred helper2393 when: function( singleValue ) {2394 var2395 // count of uncompleted subordinates2396 remaining = arguments.length,2397 // count of unprocessed arguments2398 i = remaining,2399 // subordinate fulfillment data2400 resolveContexts = Array( i ),2401 resolveValues = slice.call( arguments ),2402 // the master Deferred2403 master = jQuery.Deferred(),2404 // subordinate callback factory2405 updateFunc = function( i ) {2406 return function( value ) {2407 resolveContexts[ i ] = this;2408 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;2409 if ( !( --remaining ) ) {2410 master.resolveWith( resolveContexts, resolveValues );2411 }2412 };2413 };2414 // Single- and empty arguments are adopted like Promise.resolve2415 if ( remaining <= 1 8 9 ) { adoptvalue( singlevalue, master.done( updatefunc( i ).resolve, master.reject, !remaining ); use .then() to unwrap secondary thenables (cf. gh-3000) if ( master.state()="==" "pending" || isfunction( resolvevalues[ ] && ].then return master.then(); } multiple arguments are aggregated like promise.all array elements while i-- ], ), master.reject master.promise(); these usually indicate a programmer mistake during development, warn about them asap rather than swallowing by default. var rerrornames="/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;" jquery.deferred.exceptionhook="function(" error, stack support: ie - only console exists when dev tools open, which can happen at any time window.console window.console.warn error rerrornames.test( error.name window.console.warn( "jquery.deferred exception: " + error.message, error.stack, }; jquery.readyexception="function(" window.settimeout( function() throw error; the deferred used on dom ready readylist="jQuery.Deferred();" jquery.fn.ready="function(" fn .then( wrap in function so that lookup happens of handling instead callback registration. .catch( function( jquery.readyexception( this; jquery.extend( is be used? set true once it occurs. isready: false, counter track how many items wait for before event fires. see #6781 readywait: 1, handle ready: abort there pending holds or we're already ? --jquery.readywait : jquery.isready return; remember normal fired, decrement, and need !="="> 0 ) {2416 return;2417 }2418 // If there are functions bound, to execute2419 readyList.resolveWith( document, [ jQuery ] );2420 }2421} );2422jQuery.ready.then = readyList.then;2423// The ready event handler and self cleanup method2424function completed() {2425 document.removeEventListener( "DOMContentLoaded", completed );2426 window.removeEventListener( "load", completed );2427 jQuery.ready();2428}2429// Catch cases where $(document).ready() is called2430// after the browser event has already occurred.2431// Support: IE <=9 0 1 5 9 10 11 12 15 45 2014 - only older ie sometimes signals "interactive" too soon if ( document.readystate="==" "complete" || !="=" "loading" && !document.documentelement.doscroll ) { handle it asynchronously to allow scripts the opportunity delay ready window.settimeout( jquery.ready ); } else use handy event callback document.addeventlistener( "domcontentloaded", completed a fallback window.onload, that will always work window.addeventlistener( "load", multifunctional method get and set values of collection value s can optionally be executed it's function var access="function(" elems, fn, key, value, chainable, emptyget, raw i="0," len="elems.length," bulk="key" =="null;" sets many totype( key "object" chainable="true;" for in access( i, key[ ], true, one undefined !isfunction( operations run against entire fn.call( fn="null;" ...except when executing elem, return bulk.call( jquery( elem ), }; ; < len; i++ fn( elems[ ? : value.call( elems; gets elems emptyget; matches dashed string camelizing rmsprefix="/^-ms-/," rdashalpha="/-([a-z])/g;" used by camelcase as replace() fcamelcase( all, letter letter.touppercase(); convert camelcase; css data modules support: 11, edge microsoft forgot hump their vendor prefix (#9572) camelcase( string.replace( rmsprefix, "ms-" ).replace( rdashalpha, fcamelcase acceptdata="function(" owner accepts only: node node.element_node node.document_node object any owner.nodetype="==" !( +owner.nodetype data() this.expando="jQuery.expando" + data.uid++; data.uid="1;" data.prototype="{" cache: function( check already has cache ]; not, create !value we accept non-element nodes modern browsers, but should see #8335. an empty object. acceptdata( is unlikely stringify-ed or looped over plain assignment owner[ ]="value;" otherwise secure non-enumerable property configurable must true deleted removed object.defineproperty( owner, this.expando, value: configurable: value; }, set: data, prop, handle: [ args (gh-2257) typeof "string" cache[ properties copy one-by-one prop cache; get: this.cache( ][ access: cases where either: 1. no was specified 2. specified, provided take "read" path determine which return, respectively stored at this.get( not string, both are extend (existing objects) with this.set( since "set" have two possible entry points expected based on taken[*] key; remove: return; support array space separated keys array.isarray( keys... keys, so remove that. spaces exists, it. otherwise, matching non-whitespace key.match( rnothtmlwhite [] while i-- delete expando there's more jquery.isemptyobject( chrome webkit & blink performance suffers deleting from dom nodes, instead https: bugs.chromium.org p chromium issues detail?id="378607" (bug restricted) hasdata: !jquery.isemptyobject( datapriv="new" data(); datauser="new" implementation summary enforce api surface semantic compatibility 1.9.x branch improve module's maintainability reducing storage paths single mechanism. 3. same mechanism "private" "user" data. 4. _never_ expose user code (todo: drop _data, _removedata) 5. avoid exposing details objects (eg. properties) 6. provide clear upgrade weakmap rbrace="/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/," rmultidash="/[A-Z]/g;" getdata( "true" true; "false" false; "null" null; number doesn't change +data "" +data; rbrace.test( json.parse( data; dataattr( name; nothing found internally, try fetch html5 data-* attribute elem.nodetype="==" name="data-" key.replace( rmultidash, "-$&" ).tolowercase(); catch e {} make sure isn't changed later datauser.set( jquery.extend( datauser.hasdata( datapriv.hasdata( data: name, datauser.access( removedata: datauser.remove( todo: now all calls _data _removedata been replaced direct methods, these deprecated. _data: datapriv.access( _removedata: datapriv.remove( jquery.fn.extend( attrs="elem" elem.attributes; this.length !datapriv.get( "hasdataattrs" elements null (#14894) attrs[ ].name; name.indexof( "data-" name.slice( data[ datapriv.set( "hasdataattrs", multiple this.each( function() this, calling jquery (element matches) (and therefore element appears this[ ]) `value` parameter undefined. result `undefined` throw exception attempt read made. camelcased "discover" custom tried really hard, exist. data... store null, arguments.length> 1, null, true );2432 },2433 removeData: function( key ) {2434 return this.each( function() {2435 dataUser.remove( this, key );2436 } );2437 }2438} );2439jQuery.extend( {2440 queue: function( elem, type, data ) {2441 var queue;2442 if ( elem ) {2443 type = ( type || "fx" ) + "queue";2444 queue = dataPriv.get( elem, type );2445 // Speed up dequeue by getting out quickly if this is just a lookup2446 if ( data ) {2447 if ( !queue || Array.isArray( data ) ) {2448 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );2449 } else {2450 queue.push( data );2451 }2452 }2453 return queue || [];2454 }2455 },2456 dequeue: function( elem, type ) {2457 type = type || "fx";2458 var queue = jQuery.queue( elem, type ),2459 startLength = queue.length,2460 fn = queue.shift(),2461 hooks = jQuery._queueHooks( elem, type ),2462 next = function() {2463 jQuery.dequeue( elem, type );2464 };2465 // If the fx queue is dequeued, always remove the progress sentinel2466 if ( fn === "inprogress" ) {2467 fn = queue.shift();2468 startLength--;2469 }2470 if ( fn ) {2471 // Add a progress sentinel to prevent the fx queue from being2472 // automatically dequeued2473 if ( type === "fx" ) {2474 queue.unshift( "inprogress" );2475 }2476 // Clear up the last queue stop function2477 delete hooks.stop;2478 fn.call( elem, next, hooks );2479 }2480 if ( !startLength && hooks ) {2481 hooks.empty.fire();2482 }2483 },2484 // Not public - generate a queueHooks object, or return the current one2485 _queueHooks: function( elem, type ) {2486 var key = type + "queueHooks";2487 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {2488 empty: jQuery.Callbacks( "once memory" ).add( function() {2489 dataPriv.remove( elem, [ type + "queue", key ] );2490 } )2491 } );2492 }2493} );2494jQuery.fn.extend( {2495 queue: function( type, data ) {2496 var setter = 2;2497 if ( typeof type !== "string" ) {2498 data = type;2499 type = "fx";2500 setter--;2501 }2502 if ( arguments.length < setter ) {2503 return jQuery.queue( this[ 0 ], type );2504 }2505 return data === undefined ?2506 this :2507 this.each( function() {2508 var queue = jQuery.queue( this, type, data );2509 // Ensure a hooks for this queue2510 jQuery._queueHooks( this, type );2511 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {2512 jQuery.dequeue( this, type );2513 }2514 } );2515 },2516 dequeue: function( type ) {2517 return this.each( function() {2518 jQuery.dequeue( this, type );2519 } );2520 },2521 clearQueue: function( type ) {2522 return this.queue( type || "fx", [] );2523 },2524 // Get a promise resolved when queues of a certain type2525 // are emptied (fx is the type by default)2526 promise: function( type, obj ) {2527 var tmp,2528 count = 1,2529 defer = jQuery.Deferred(),2530 elements = this,2531 i = this.length,2532 resolve = function() {2533 if ( !( --count ) ) {2534 defer.resolveWith( elements, [ elements ] );2535 }2536 };2537 if ( typeof type !== "string" ) {2538 obj = type;2539 type = undefined;2540 }2541 type = type || "fx";2542 while ( i-- ) {2543 tmp = dataPriv.get( elements[ i ], type + "queueHooks" );2544 if ( tmp && tmp.empty ) {2545 count++;2546 tmp.empty.add( resolve );2547 }2548 }2549 resolve();2550 return defer.promise( obj );2551 }2552} );2553var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;2554var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );2555var cssExpand = [ "Top", "Right", "Bottom", "Left" ];2556var documentElement = document.documentElement;2557 var isAttached = function( elem ) {2558 return jQuery.contains( elem.ownerDocument, elem );2559 },2560 composed = { composed: true };2561 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only2562 // Check attachment across shadow DOM boundaries when possible (gh-3504)2563 // Support: iOS 10.0-10.2 only2564 // Early iOS 10 versions support `attachShadow` but not `getRootNode`,2565 // leading to errors. We need to check for `getRootNode`.2566 if ( documentElement.getRootNode ) {2567 isAttached = function( elem ) {2568 return jQuery.contains( elem.ownerDocument, elem ) ||2569 elem.getRootNode( composed ) === elem.ownerDocument;2570 };2571 }2572var isHiddenWithinTree = function( elem, el ) {2573 // isHiddenWithinTree might be called from jQuery#filter function;2574 // in that case, element will be second argument2575 elem = el || elem;2576 // Inline style trumps all2577 return elem.style.display === "none" ||2578 elem.style.display === "" &&2579 // Otherwise, check computed style2580 // Support: Firefox <=43 1 2 3 45 - disconnected elements can have computed display: none, so first confirm that elem is in the document. isattached( ) && jquery.css( elem, "display" "none"; }; var swap="function(" options, callback, args { ret, name, old="{};" remember values, and insert new ones for ( name options old[ ]="elem.style[" ]; elem.style[ } ret="callback.apply(" || [] ); revert values return ret; function adjustcss( prop, valueparts, tween adjusted, scale, maxiterations="20," currentvalue="tween" ? function() tween.cur(); : "" }, initial="currentValue()," unit="valueParts" valueparts[ jquery.cssnumber[ prop "px" ), starting value computation required potential mismatches initialinunit="elem.nodeType" !="=" +initial rcssnum.exec( if initialinunit[ support: firefox <="54" halve iteration target to prevent interference from css upper bounds (gh-2144) 2; trust units reported by jquery.css iteratively approximate a nonzero point 1; while maxiterations-- evaluate update our best guess (doubling guesses zero out). finish scale equals or crosses (making old*new product non-positive). jquery.style( + * 0.5 scale; make sure we properties later on valueparts="valueParts" []; 0; apply relative offset (+="/-=)" specified adjusted="valueParts[" +valueparts[ tween.unit="unit;" tween.start="initialInUnit;" tween.end="adjusted;" adjusted; defaultdisplaymap="{};" getdefaultdisplay( temp, doc="elem.ownerDocument," nodename="elem.nodeName," display="defaultDisplayMap[" display; temp="doc.body.appendChild(" doc.createelement( temp.parentnode.removechild( "none" ; defaultdisplaymap[ showhide( elements, show display, index="0," length="elements.length;" determine need change length; index++ !elem.style continue; since force visibility upon cascade-hidden an immediate (and slow) check this loop unless nonempty (either inline about-to-be-restored) values[ null; !values[ elem.style.display ishiddenwithintree( else what we're overwriting datapriv.set( "display", set of second avoid constant reflow elements[ ].style.display="values[" elements; jquery.fn.extend( show: this, true hide: toggle: function( state typeof "boolean" this.show() this.hide(); this.each( jquery( ).show(); ).hide(); rcheckabletype="(" ^(?:checkbox|radio)$ i rtagname="(" <([a-z][^\ \0>\x20\t\r\n\f]*)/i );2581var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );2582// We have to close these tags to support XHTML (#13200)2583var wrapMap = {2584 // Support: IE <=9 only option: [ 1, "<select multiple="multiple">", "" ],2585 // XHTML parsers do not magically insert elements in the2586 // same way that tag soup parsers do. So we cannot shorten2587 // this by omitting <tbody> or other required elements.2588 thead: [ 1, "<table>", "</table>" ],2589 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],2590 tr: [ 2, "<table><tbody>", "</tbody></table>" ],2591 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],2592 _default: [ 0, "", "" ]2593};2594// Support: IE <=9 0 1 2 11 only wrapmap.optgroup="wrapMap.option;" wrapmap.tbody="wrapMap.tfoot" = wrapmap.colgroup="wrapMap.caption" wrapmap.thead; wrapmap.th="wrapMap.td;" function getall( context, tag ) { support: ie <="9" - use typeof to avoid zero-argument method invocation on host objects (#15151) var ret; if ( context.getelementsbytagname !="=" "undefined" ret="context.getElementsByTagName(" || "*" ); } else context.queryselectorall undefined && nodename( return jquery.merge( [ context ], mark scripts as having already been evaluated setglobaleval( elems, refelements i="0," l="elems.length;" for ; l; i++ datapriv.set( elems[ "globaleval", !refelements datapriv.get( refelements[ "globaleval" rhtml="/<|&#?\w+;/;" buildfragment( scripts, selection, ignored elem, tmp, tag, wrap, attached, j, fragment="context.createDocumentFragment()," nodes="[]," elem="elems[" ]; add directly totype( "object" android only, phantomjs push.apply(_, arraylike) throws ancient webkit nodes, elem.nodetype ? ] : convert non-html into a text node !rhtml.test( nodes.push( context.createtextnode( html dom tmp="tmp" fragment.appendchild( context.createelement( "div" deserialize standard representation rtagname.exec( "", "" )[ ].tolowercase(); wrap="wrapMap[" wrapmap._default; tmp.innerhtml="wrap[" + jquery.htmlprefilter( wrap[ descend through wrappers the right content j="wrap[" while j-- tmp.childnodes remember top-level container ensure created are orphaned (#12392) tmp.textcontent remove wrapper from fragment.textcontent skip elements in collection (trac-4087) selection jquery.inarray(> -1 ) {2595 if ( ignored ) {2596 ignored.push( elem );2597 }2598 continue;2599 }2600 attached = isAttached( elem );2601 // Append to fragment2602 tmp = getAll( fragment.appendChild( elem ), "script" );2603 // Preserve script evaluation history2604 if ( attached ) {2605 setGlobalEval( tmp );2606 }2607 // Capture executables2608 if ( scripts ) {2609 j = 0;2610 while ( ( elem = tmp[ j++ ] ) ) {2611 if ( rscriptType.test( elem.type || "" ) ) {2612 scripts.push( elem );2613 }2614 }2615 }2616 }2617 return fragment;2618}2619( function() {2620 var fragment = document.createDocumentFragment(),2621 div = fragment.appendChild( document.createElement( "div" ) ),2622 input = document.createElement( "input" );2623 // Support: Android 4.0 - 4.3 only2624 // Check state lost if the name is set (#11217)2625 // Support: Windows Web Apps (WWA)2626 // `name` and `type` must use .setAttribute for WWA (#14901)2627 input.setAttribute( "type", "radio" );2628 input.setAttribute( "checked", "checked" );2629 input.setAttribute( "name", "t" );2630 div.appendChild( input );2631 // Support: Android <=4.1 0 1 2 13393 only older webkit doesn't clone checked state correctly in fragments support.checkclone="div.cloneNode(" true ).clonenode( ).lastchild.checked; support: ie <="11" make sure textarea (and checkbox) defaultvalue is properly cloned div.innerhtml="<textarea>x</textarea>" ; support.noclonechecked="!!div.cloneNode(" ).lastchild.defaultvalue; } )(); var rkeyevent="/^key/," rmouseevent="/^(?:mouse|pointer|contextmenu|drag|drop)|click/," rtypenamespace="/^([^.]*)(?:\.(.+)|)/;" function returntrue() { return true; returnfalse() false; - 11+ focus() and blur() are asynchronous, except when they no-op. so expect focus to be synchronous the element already active, blur not active. (focus always other supported browsers, this just defines we can count on it). expectsync( elem, type ) ( elem="==" safeactiveelement() "focus" ); accessing document.activeelement throw unexpectedly https: bugs.jquery.com ticket try document.activeelement; catch err on( types, selector, data, fn, one origfn, type; types a map of handlers if typeof "object" types-object, data selector !="=" "string" || selector; for type, types[ ], elem; null && fn="=" = undefined; else false !fn origfn="fn;" event use an empty set, since contains info jquery().off( origfn.apply( this, arguments }; same guid caller remove using fn.guid="origFn.guid" origfn.guid="jQuery.guid++" elem.each( function() jquery.event.add( * helper functions managing events -- part public interface. props dean edwards' addevent library many ideas. jquery.event="{" global: {}, add: function( handler, handleobjin, eventhandle, tmp, events, t, handleobj, special, handlers, namespaces, origtype, elemdata="dataPriv.get(" don't attach nodata or text comment nodes (but allow plain objects) !elemdata return; pass object custom lieu handler handler.handler handleobjin="handler;" ensure that invalid selectors exceptions at time evaluate against documentelement case non-element node (e.g., document) jquery.find.matchesselector( documentelement, has unique id, used find it later !handler.guid handler.guid="jQuery.guid++;" init element's structure main first !( {}; eventhandle="elemData.handle" e discard second jquery.event.trigger() called after page unloaded jquery "undefined" jquery.event.triggered e.type ? jquery.event.dispatch.apply( : handle multiple separated by space "" ).match( rnothtmlwhite [ ]; t="types.length;" while t-- tmp="rtypenamespace.exec(" ] []; tmp[ namespaces="(" ).split( "." ).sort(); there *must* no attaching namespace-only !type continue; changes its special changed defined, determine api otherwise given special.delegatetype special.bindtype update based newly reset handleobj passed all type: origtype: data: handler: guid: handler.guid, selector: needscontext: jquery.expr.match.needscontext.test( ), namespace: namespaces.join( }, queue we're handlers.delegatecount="0;" addeventlistener returns !special.setup special.setup.call( elem.addeventlistener elem.addeventlistener( special.add special.add.call( !handleobj.handler.guid handleobj.handler.guid="handler.guid;" add list, delegates front handlers.splice( handlers.delegatecount++, 0, handlers.push( keep track which have ever been used, optimization jquery.event.global[ detach set from remove: mappedtypes j, origcount, datapriv.get( once each type.namespace types; may omitted unbind (on namespace, provided) jquery.event.remove( + new regexp( "(^|\\.)" "\\.(?:.*\\.|)" "(\\.|$)" matching origcount="j" handlers.length; j-- j origtype="==" handleobj.origtype !handler handleobj.guid !tmp tmp.test( handleobj.namespace !selector handleobj.selector "**" handlers.delegatecount--; special.remove special.remove.call( generic removed something more exist (avoids potential endless recursion during removal handlers) !handlers.length !special.teardown special.teardown.call( elemdata.handle jquery.removeevent( delete events[ expando it's longer jquery.isemptyobject( datapriv.remove( "handle events" dispatch: nativeevent writable native i, ret, matched, handlerqueue, args="new" array( arguments.length "events" {} )[ event.type [], fix-ed rather than (read-only) args[ i="1;" arguments.length; i++ event.delegatetarget="this;" call predispatch hook mapped let bail desired special.predispatch special.predispatch.call( handlerqueue="jQuery.event.handlers.call(" event, run first; want stop propagation beneath us matched="handlerQueue[" !event.ispropagationstopped() event.currenttarget="matched.elem;" j++ !event.isimmediatepropagationstopped() namespaced, then invoked specially universal superset event's. !event.rnamespace event.rnamespace.test( event.handleobj="handleObj;" event.data="handleObj.data;" ret="(" jquery.event.special[ ).handle handleobj.handler ).apply( matched.elem, undefined event.result="ret" event.preventdefault(); event.stoppropagation(); postdispatch special.postdispatch special.postdispatch.call( event.result; handlers: sel, matchedhandlers, matchedselectors, delegatecount="handlers.delegateCount," cur="event.target;" delegate black-hole svg <use> instance trees (trac-13180)2632 cur.nodeType &&2633 // Support: Firefox <=42 11 suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) https: www.w3.org tr dom-level-3-events #event-type-click support: ie only ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) !( event.type="==" "click" && event.button>= 1 ) ) {2634 for ( ; cur !== this; cur = cur.parentNode || this ) {2635 // Don't check non-elements (#13208)2636 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)2637 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {2638 matchedHandlers = [];2639 matchedSelectors = {};2640 for ( i = 0; i < delegateCount; i++ ) {2641 handleObj = handlers[ i ];2642 // Don't conflict with Object.prototype properties (#13203)2643 sel = handleObj.selector + " ";2644 if ( matchedSelectors[ sel ] === undefined ) {2645 matchedSelectors[ sel ] = handleObj.needsContext ?2646 jQuery( sel, this ).index( cur ) > -1 :2647 jQuery.find( sel, this, null, [ cur ] ).length;2648 }2649 if ( matchedSelectors[ sel ] ) {2650 matchedHandlers.push( handleObj );2651 }2652 }2653 if ( matchedHandlers.length ) {2654 handlerQueue.push( { elem: cur, handlers: matchedHandlers } );2655 }2656 }2657 }2658 }2659 // Add the remaining (directly-bound) handlers2660 cur = this;2661 if ( delegateCount < handlers.length ) {2662 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );2663 }2664 return handlerQueue;2665 },2666 addProp: function( name, hook ) {2667 Object.defineProperty( jQuery.Event.prototype, name, {2668 enumerable: true,2669 configurable: true,2670 get: isFunction( hook ) ?2671 function() {2672 if ( this.originalEvent ) {2673 return hook( this.originalEvent );2674 }2675 } :2676 function() {2677 if ( this.originalEvent ) {2678 return this.originalEvent[ name ];2679 }2680 },2681 set: function( value ) {2682 Object.defineProperty( this, name, {2683 enumerable: true,2684 configurable: true,2685 writable: true,2686 value: value2687 } );2688 }2689 } );2690 },2691 fix: function( originalEvent ) {2692 return originalEvent[ jQuery.expando ] ?2693 originalEvent :2694 new jQuery.Event( originalEvent );2695 },2696 special: {2697 load: {2698 // Prevent triggered image.load events from bubbling to window.load2699 noBubble: true2700 },2701 click: {2702 // Utilize native event to ensure correct state for checkable inputs2703 setup: function( data ) {2704 // For mutual compressibility with _default, replace `this` access with a local var.2705 // `|| data` is dead code meant only to preserve the variable through minification.2706 var el = this || data;2707 // Claim the first handler2708 if ( rcheckableType.test( el.type ) &&2709 el.click && nodeName( el, "input" ) ) {2710 // dataPriv.set( el, "click", ... )2711 leverageNative( el, "click", returnTrue );2712 }2713 // Return false to allow normal processing in the caller2714 return false;2715 },2716 trigger: function( data ) {2717 // For mutual compressibility with _default, replace `this` access with a local var.2718 // `|| data` is dead code meant only to preserve the variable through minification.2719 var el = this || data;2720 // Force setup before triggering a click2721 if ( rcheckableType.test( el.type ) &&2722 el.click && nodeName( el, "input" ) ) {2723 leverageNative( el, "click" );2724 }2725 // Return non-false to allow normal event-path propagation2726 return true;2727 },2728 // For cross-browser consistency, suppress native .click() on links2729 // Also prevent it if we're currently inside a leveraged native-event stack2730 _default: function( event ) {2731 var target = event.target;2732 return rcheckableType.test( target.type ) &&2733 target.click && nodeName( target, "input" ) &&2734 dataPriv.get( target, "click" ) ||2735 nodeName( target, "a" );2736 }2737 },2738 beforeunload: {2739 postDispatch: function( event ) {2740 // Support: Firefox 20+2741 // Firefox doesn't alert if the returnValue field is not set.2742 if ( event.result !== undefined && event.originalEvent ) {2743 event.originalEvent.returnValue = event.result;2744 }2745 }2746 }2747 }2748};2749// Ensure the presence of an event listener that handles manually-triggered2750// synthetic events by interrupting progress until reinvoked in response to2751// *native* events that it fires directly, ensuring that state changes have2752// already occurred before other listeners are invoked.2753function leverageNative( el, type, expectSync ) {2754 // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add2755 if ( !expectSync ) {2756 if ( dataPriv.get( el, type ) === undefined ) {2757 jQuery.event.add( el, type, returnTrue );2758 }2759 return;2760 }2761 // Register the controller as a special universal handler for all event namespaces2762 dataPriv.set( el, type, false );2763 jQuery.event.add( el, type, {2764 namespace: false,2765 handler: function( event ) {2766 var notAsync, result,2767 saved = dataPriv.get( this, type );2768 if ( ( event.isTrigger & 1 ) && this[ type ] ) {2769 // Interrupt processing of the outer synthetic .trigger()ed event2770 // Saved data should be false in such cases, but might be a leftover capture object2771 // from an async native handler (gh-4350)2772 if ( !saved.length ) {2773 // Store arguments for use when handling the inner native event2774 // There will always be at least one argument (an event object), so this array2775 // will not be confused with a leftover capture object.2776 saved = slice.call( arguments );2777 dataPriv.set( this, type, saved );2778 // Trigger the native event and capture its result2779 // Support: IE <=9 0 1 2="==" 3 4 7 2003 3229 - 11+ focus() and blur() are asynchronous notasync="expectSync(" this, type ); this[ ](); result="dataPriv.get(" if ( saved !="=" || ) { datapriv.set( type, false } else cancel the outer synthetic event event.stopimmediatepropagation(); event.preventdefault(); return result.value; this is an inner for with a bubbling surrogate (focus or blur), assume that already propagated from triggering native prevent happening again here. technically gets ordering wrong w.r.t. to `.trigger()` (in which propagates *after* non-bubbling base), but seems less bad than duplication. jquery.event.special[ ] {} ).delegatetype event.stoppropagation(); triggered above, everything now in order fire original arguments saved.length ...and capture value: jquery.event.trigger( support: ie <="9" extend prototype reset above stopimmediatepropagation() jquery.extend( saved[ ], jquery.event.prototype ), saved.slice( abort handling of jquery.removeevent="function(" elem, handle "if" needed plain objects elem.removeeventlistener elem.removeeventlistener( }; jquery.event="function(" src, props allow instantiation without 'new' keyword !( instanceof new jquery.event( object src && src.type this.originalevent="src;" this.type="src.type;" events up document may have been marked as prevented by handler lower down tree; reflect correct value. this.isdefaultprevented="src.defaultPrevented" src.defaultprevented="==" undefined android only src.returnvalue="==" ? returntrue : returnfalse; create target properties safari should not be text node (#504, #13143) this.target="(" src.target src.target.nodetype="==" src.target.parentnode src.target; this.currenttarget="src.currentTarget;" this.relatedtarget="src.relatedTarget;" put explicitly provided onto timestamp incoming doesn't one this.timestamp="src" src.timestamp date.now(); mark it fixed jquery.expando based on dom3 specified ecmascript language binding https: www.w3.org tr wd-dom-level-3-events-20030331 ecma-script-binding.html constructor: jquery.event, isdefaultprevented: returnfalse, ispropagationstopped: isimmediatepropagationstopped: issimulated: false, preventdefault: function() var e="this.originalEvent;" !this.issimulated e.preventdefault(); }, stoppropagation: this.ispropagationstopped="returnTrue;" e.stoppropagation(); stopimmediatepropagation: this.isimmediatepropagationstopped="returnTrue;" e.stopimmediatepropagation(); this.stoppropagation(); includes all common including keyevent mouseevent specific jquery.each( altkey: true, bubbles: cancelable: changedtouches: ctrlkey: detail: eventphase: metakey: pagex: pagey: shiftkey: view: "char": code: charcode: key: keycode: button: buttons: clientx: clienty: offsetx: offsety: pointerid: pointertype: screenx: screeny: targettouches: toelement: touches: which: function( button="event.button;" add key event.which="=" null rkeyevent.test( event.type event.charcode event.keycode; click: left; middle; right !event.which rmouseevent.test( & 1; 3; 2; 0; event.which; jquery.event.addprop focus: "focusin", blur: "focusout" delegatetype utilize possible so blur focus sequence setup: claim first "focus", ... "blur", leveragenative( expectsync normal processing caller false; trigger: force setup before trigger non-false event-path propagation true; delegatetype: mouseenter leave using mouseover out event-time checks delegation works jquery. do same pointerenter pointerleave pointerover pointerout sends too often; see: bugs.chromium.org p chromium issues detail?id="470258" description bug (it existed older chrome versions well). mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" orig, fix orig fix, bindtype: handle: ret, related="event.relatedTarget," handleobj="event.handleObj;" call outside target. nb: no relatedtarget mouse left entered browser window !related !jquery.contains( target, ret="handleObj.handler.apply(" ret; jquery.fn.extend( on: types, selector, data, fn on( one: fn, off: handleobj, type; types types.preventdefault types.handleobj dispatched jquery( types.delegatetarget ).off( handleobj.namespace handleobj.origtype + "." handleobj.origtype, handleobj.selector, handleobj.handler this; typeof "object" types-object [, selector] this.off( types[ selector="==" "function" fn] this.each( jquery.event.remove( * eslint-disable max-len see github.com eslint rxhtmltag="/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0">\x20\t\r\n\f]*)[^>]*)\/>/gi,2780 /* eslint-enable */2781 // Support: IE <=10 12 13 1736512 - 11, edge only in ie using regex groups here causes severe slowdowns. see https: connect.microsoft.com feedback details rnoinnerhtml="/<script|<style|<link/i," checked="checked" or rchecked="/checked\s*(?:[^=]|=\s*.checked.)/i," rcleanscript="/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)">\s*$/g;2782// Prefer a tbody over its parent table for containing new rows2783function manipulationTarget( elem, content ) {2784 if ( nodeName( elem, "table" ) &&2785 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {2786 return jQuery( elem ).children( "tbody" )[ 0 ] || elem;2787 }2788 return elem;2789}2790// Replace/restore the type attribute of script elements for safe DOM manipulation2791function disableScript( elem ) {2792 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;2793 return elem;2794}2795function restoreScript( elem ) {2796 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {2797 elem.type = elem.type.slice( 5 );2798 } else {2799 elem.removeAttribute( "type" );2800 }2801 return elem;2802}2803function cloneCopyEvent( src, dest ) {2804 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;2805 if ( dest.nodeType !== 1 ) {2806 return;2807 }2808 // 1. Copy private data: events, handlers, etc.2809 if ( dataPriv.hasData( src ) ) {2810 pdataOld = dataPriv.access( src );2811 pdataCur = dataPriv.set( dest, pdataOld );2812 events = pdataOld.events;2813 if ( events ) {2814 delete pdataCur.handle;2815 pdataCur.events = {};2816 for ( type in events ) {2817 for ( i = 0, l = events[ type ].length; i < l; i++ ) {2818 jQuery.event.add( dest, type, events[ type ][ i ] );2819 }2820 }2821 }2822 }2823 // 2. Copy user data2824 if ( dataUser.hasData( src ) ) {2825 udataOld = dataUser.access( src );2826 udataCur = jQuery.extend( {}, udataOld );2827 dataUser.set( dest, udataCur );2828 }2829}2830// Fix IE bugs, see support tests2831function fixInput( src, dest ) {2832 var nodeName = dest.nodeName.toLowerCase();2833 // Fails to persist the checked state of a cloned checkbox or radio button.2834 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {2835 dest.checked = src.checked;2836 // Fails to return the selected option to the default selected state when cloning options2837 } else if ( nodeName === "input" || nodeName === "textarea" ) {2838 dest.defaultValue = src.defaultValue;2839 }2840}2841function domManip( collection, args, callback, ignored ) {2842 // Flatten any nested arrays2843 args = concat.apply( [], args );2844 var fragment, first, scripts, hasScripts, node, doc,2845 i = 0,2846 l = collection.length,2847 iNoClone = l - 1,2848 value = args[ 0 ],2849 valueIsFunction = isFunction( value );2850 // We can't cloneNode fragments that contain checked, in WebKit2851 if ( valueIsFunction ||2852 ( l > 1 && typeof value === "string" &&2853 !support.checkClone && rchecked.test( value ) ) ) {2854 return collection.each( function( index ) {2855 var self = collection.eq( index );2856 if ( valueIsFunction ) {2857 args[ 0 ] = value.call( this, index, self.html() );2858 }2859 domManip( self, args, callback, ignored );2860 } );2861 }2862 if ( l ) {2863 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );2864 first = fragment.firstChild;2865 if ( fragment.childNodes.length === 1 ) {2866 fragment = first;2867 }2868 // Require either new content or an interest in ignored elements to invoke the callback2869 if ( first || ignored ) {2870 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );2871 hasScripts = scripts.length;2872 // Use the original fragment for the last item2873 // instead of the first because it can end up2874 // being emptied incorrectly in certain situations (#8070).2875 for ( ; i < l; i++ ) {2876 node = fragment;2877 if ( i !== iNoClone ) {2878 node = jQuery.clone( node, true, true );2879 // Keep references to cloned scripts for later restoration2880 if ( hasScripts ) {2881 // Support: Android <=4.0 1 only, phantomjs only push.apply(_, arraylike) throws on ancient webkit jquery.merge( scripts, getall( node, "script" ) ); } callback.call( collection[ i ], if ( hasscripts { doc="scripts[" scripts.length - ].ownerdocument; reenable scripts jquery.map( restorescript evaluate executable first document insertion for < hasscripts; i++ node="scripts[" ]; rscripttype.test( node.type || "" && !datapriv.access( "globaleval" jquery.contains( doc, node.src ).tolowercase() !="=" "module" optional ajax dependency, but won't run not present jquery._evalurl !node.nomodule jquery._evalurl( node.src, nonce: node.nonce node.getattribute( "nonce" else domeval( node.textcontent.replace( rcleanscript, ), return collection; function remove( elem, selector, keepdata var nodes="selector" ? jquery.filter( elem : ; ] !keepdata node.nodetype="==" jquery.cleandata( node.parentnode isattached( setglobaleval( node.parentnode.removechild( elem; jquery.extend( htmlprefilter: function( html html.replace( rxhtmltag, "<$1>" );2882 },2883 clone: function( elem, dataAndEvents, deepDataAndEvents ) {2884 var i, l, srcElements, destElements,2885 clone = elem.cloneNode( true ),2886 inPage = isAttached( elem );2887 // Fix IE cloning issues2888 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&2889 !jQuery.isXMLDoc( elem ) ) {2890 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/22891 destElements = getAll( clone );2892 srcElements = getAll( elem );2893 for ( i = 0, l = srcElements.length; i < l; i++ ) {2894 fixInput( srcElements[ i ], destElements[ i ] );2895 }2896 }2897 // Copy the events from the original to the clone2898 if ( dataAndEvents ) {2899 if ( deepDataAndEvents ) {2900 srcElements = srcElements || getAll( elem );2901 destElements = destElements || getAll( clone );2902 for ( i = 0, l = srcElements.length; i < l; i++ ) {2903 cloneCopyEvent( srcElements[ i ], destElements[ i ] );2904 }2905 } else {2906 cloneCopyEvent( elem, clone );2907 }2908 }2909 // Preserve script evaluation history2910 destElements = getAll( clone, "script" );2911 if ( destElements.length > 0 ) {2912 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );2913 }2914 // Return the cloned set2915 return clone;2916 },2917 cleanData: function( elems ) {2918 var data, elem, type,2919 special = jQuery.event.special,2920 i = 0;2921 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {2922 if ( acceptData( elem ) ) {2923 if ( ( data = elem[ dataPriv.expando ] ) ) {2924 if ( data.events ) {2925 for ( type in data.events ) {2926 if ( special[ type ] ) {2927 jQuery.event.remove( elem, type );2928 // This is a shortcut to avoid jQuery.event.remove's overhead2929 } else {2930 jQuery.removeEvent( elem, type, data.handle );2931 }2932 }2933 }2934 // Support: Chrome <=35 0 1 2 3 9 11 44 - 45+ assign undefined instead of using delete, see data#remove elem[ datapriv.expando ]="undefined;" } if ( datauser.expando ) { support: chrome <="35" ); jquery.fn.extend( detach: function( selector return remove( this, selector, true }, remove: text: value access( ? jquery.text( this : this.empty().each( function() this.nodetype="==" || this.textcontent="value;" null, value, arguments.length append: dommanip( arguments, elem var target="manipulationTarget(" target.appendchild( prepend: target.insertbefore( elem, target.firstchild before: this.parentnode this.parentnode.insertbefore( after: this.nextsibling empty: i="0;" for ; !="null;" i++ elem.nodetype="==" prevent memory leaks jquery.cleandata( getall( false remove any remaining nodes elem.textcontent this; clone: dataandevents, deepdataandevents dataandevents="dataAndEvents" =="null" dataandevents; deepdataandevents; this.map( jquery.clone( html: {}, l="this.length;" && elem.innerhtml; we can take a shortcut and just use innerhtml typeof "string" !rnoinnerhtml.test( !wrapmap[ rtagname.exec( [ "", "" )[ ].tolowercase() try l; {}; element elem.innerhtml="value;" throws an exception, the fallback method catch e {} this.empty().append( replacewith: ignored="[];" make changes, replacing each non-ignored context with new content parent="this.parentNode;" jquery.inarray( parent.replacechild( force callback invocation jquery.each( appendto: "append", prependto: "prepend", insertbefore: "before", insertafter: "after", replaceall: "replacewith" name, original jquery.fn[ name elems, ret="[]," insert="jQuery(" ), last="insert.length" 1, elems="i" this.clone( jquery( insert[ ]( android only, phantomjs only .get() because push.apply(_, arraylike) on ancient webkit push.apply( ret, elems.get() this.pushstack( }; rnumnonpx="new" regexp( "^(" + pnum ")(?!px)[a-z%]+$", "i" getstyles="function(" ie firefox (#15098, #14150) elements created in popups ff meanwhile frame through "defaultview.getcomputedstyle" view="elem.ownerDocument.defaultView;" !view !view.opener view.getcomputedstyle( rboxstyle="new" cssexpand.join( "|" executing both pixelposition & boxsizingreliable tests require one layout so they're executed at same time to save second computation. function computestyletests() is singleton, need execute it once !div return; container.style.csstext="position:absolute;left:-11111px;width:60px;" "margin-top:1px;padding:0;border:0"; div.style.csstext="position:relative;display:block;box-sizing:border-box;overflow:scroll;" "margin:auto;border:1px;padding:1px;" "width:60%;top:1%"; documentelement.appendchild( container ).appendchild( div divstyle="window.getComputedStyle(" pixelpositionval="divStyle.top" "1%"; 4.0 4.3 reliablemarginleftval="roundPixelMeasures(" divstyle.marginleft 12; safari 10.1, ios 9.3 some styles come back percentage values, even though they shouldn't div.style.right="60%" pixelboxstylesval="roundPixelMeasures(" divstyle.right 36; detect misreporting dimensions box-sizing:border-box boxsizingreliableval="roundPixelMeasures(" divstyle.width overflow:scroll screwiness (gh-3699) don't get tricked when zoom affects offsetwidth (gh-4029) div.style.position="absolute" scrollboxsizeval="roundPixelMeasures(" div.offsetwidth documentelement.removechild( nullify wouldn't be stored will also sign that checks already performed roundpixelmeasures( measure math.round( parsefloat( pixelpositionval, boxsizingreliableval, scrollboxsizeval, pixelboxstylesval, reliablemarginleftval, "div" finish early limited (non-browser) environments !div.style style cloned source (#8908) div.style.backgroundclip="content-box" div.clonenode( ).style.backgroundclip support.clearclonestyle="div.style.backgroundClip" "content-box"; jquery.extend( support, boxsizingreliable: computestyletests(); boxsizingreliableval; pixelboxstyles: pixelboxstylesval; pixelposition: pixelpositionval; reliablemarginleft: reliablemarginleftval; scrollboxsize: scrollboxsizeval; )(); curcss( computed width, minwidth, maxwidth, 51+ retrieving before somehow fixes issue getting wrong values detached getstyles( getpropertyvalue needed for: .css('filter') (ie #12537) .css('--customproperty) (#3144) computed[ ]; !isattached( tribute "awesome hack by dean edwards" browser returns but width seems reliably pixels. against cssom draft spec: https: drafts.csswg.org #resolved-values !support.pixelboxstyles() rnumnonpx.test( rboxstyle.test( remember minwidth="style.minWidth;" maxwidth="style.maxWidth;" put out style.minwidth="style.maxWidth" style.width="ret;" revert changed style.maxwidth="maxWidth;" zindex as integer. ret; addgethookif( conditionfn, hookfn define hook, we'll check first run it's really needed. get: conditionfn() hook not (or possible due missing dependency), it. delete this.get; needed; redefine support test again. this.get="hookFn" ).apply( arguments cssprefixes="[" "webkit", "moz", "ms" ], emptystyle="document.createElement(" ).style, vendorprops="{};" vendor-prefixed property or vendorpropname( vendor prefixed names capname="name[" ].touppercase() name.slice( while i-- capname; name; potentially-mapped jquery.cssprops finalpropname( final="jQuery.cssProps[" vendorprops[ final; swappable display none starts table except "table", "table-cell", "table-caption" here values: developer.mozilla.org en-us docs css rdisplayswap="/^(none|table(?!-c[ea]).+)/," rcustomprop="/^--/," cssshow="{" position: "absolute", visibility: "hidden", display: "block" cssnormaltransform="{" letterspacing: "0", fontweight: "400" setpositivenumber( subtract relative (+ -) have been normalized point matches="rcssNum.exec(" guard "subtract", e.g., used csshooks math.max( 0, matches[ "px" value; boxmodeladjustment( dimension, box, isborderbox, styles, computedval "width" extra="0," delta="0;" adjustment may necessary box="==" isborderbox "border" "content" 0; 4; models exclude margin "margin" cssexpand[ true, content-box, we're seeking "padding" !isborderbox add padding "margin", border "width", still keep track otherwise else border-box (content border), "content", "padding", account positive content-box scroll gutter requested providing>= 0 ) {2935 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border2936 // Assuming integer scroll gutter, subtract the rest and round down2937 delta += Math.max( 0, Math.ceil(2938 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -2939 computedVal -2940 delta -2941 extra -2942 0.52943 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter2944 // Use an explicit zero to avoid NaN (gh-3964)2945 ) ) || 0;2946 }2947 return delta;2948}2949function getWidthOrHeight( elem, dimension, extra ) {2950 // Start with computed style2951 var styles = getStyles( elem ),2952 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).2953 // Fake content-box until we know it's needed to know the true value.2954 boxSizingNeeded = !support.boxSizingReliable() || extra,2955 isBorderBox = boxSizingNeeded &&2956 jQuery.css( elem, "boxSizing", false, styles ) === "border-box",2957 valueIsBorderBox = isBorderBox,2958 val = curCSS( elem, dimension, styles ),2959 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );2960 // Support: Firefox <=54 0 1 2 3 8 return a confounding non-pixel value or feign ignorance, as appropriate. if ( rnumnonpx.test( val ) { !extra val; } ; fall back to offsetwidth offsetheight when is "auto" this happens for inline elements with no explicit setting (gh-3571) support: android <="4.1" - 4.3 only also use misreported dimensions (gh-3602) ie 9-11 box sizing unreliable we getclientrects() check hidden disconnected. in those cases, the computed can be trusted border-box !support.boxsizingreliable() && isborderbox || !parsefloat( jquery.css( elem, "display", false, styles "inline" elem.getclientrects().length "boxsizing", "border-box"; where available, approximate border dimensions. not available (e.g., svg), assume box-sizing and interpret retrieved content dimension. valueisborderbox="offsetProp" elem; offsetprop ]; normalize "" auto 0; adjust element's model + boxmodeladjustment( dimension, extra ? "border" : "content" ), valueisborderbox, styles, provide current size request scroll gutter calculation (gh-3589) "px"; jquery.extend( add style property hooks overriding default behavior of getting csshooks: opacity: get: function( should always get number from opacity var ret="curCSS(" "opacity" ); "1" ret; }, don't automatically "px" these possibly-unitless properties cssnumber: "animationiterationcount": true, "columncount": "fillopacity": "flexgrow": "flexshrink": "fontweight": "gridarea": "gridcolumn": "gridcolumnend": "gridcolumnstart": "gridrow": "gridrowend": "gridrowstart": "lineheight": "opacity": "order": "orphans": "widows": "zindex": "zoom": true whose names you wish fix before cssprops: {}, set on dom node style: name, value, text comment nodes !elem elem.nodetype="==" !elem.style return; make sure that we're working right name ret, type, hooks, origname="camelCase(" iscustomprop="rcustomProp.test(" name. want query it css custom since they are user-defined. !iscustomprop gets hook prefixed version, then unprefixed version ] jquery.csshooks[ !="=" undefined type="typeof" value; convert "+=" or " string" ret[ fixes bug #9237 null nan values aren't (#7116) was passed in, unit (except certain properties) removed jquery 4.0 auto-append few hardcoded values. "number" jquery.cssnumber[ background-* props affect original clone's !support.clearclonestyle name.indexof( "background" style[ provided, otherwise just specified !hooks !( "set" style.setproperty( else provided non-computed there "get" object css: extra, val, num, modify try followed by otherwise, way exists, "normal" cssnormaltransform numeric forced qualifier looks num="parseFloat(" isfinite( jquery.each( [ "height", "width" ], i, dimension computed, have info invisibly show them but must display would benefit rdisplayswap.test( "display" safari 8+ table columns non-zero & zero getboundingclientrect().width unless changed. running getboundingclientrect disconnected throws an error. !elem.getclientrects().length !elem.getboundingclientrect().width swap( cssshow, function() getwidthorheight( set: matches, elem read styles.position test has chance fail avoid forcing reflow. scrollboxsizebuggy="!support.scrollboxSize()" "absolute", reflow, fetch boxsizing need (gh-3991) boxsizingneeded="scrollboxSizeBuggy" "border-box", subtract="extra" isborderbox, account comparing offset* faking content-box padding (gh-3699) elem[ "offset" dimension[ ].touppercase() dimension.slice( parsefloat( styles[ "border", 0.5 pixels adjustment needed matches="rcssNum.exec(" matches[ elem.style[ setpositivenumber( }; jquery.csshooks.marginleft="addGetHookIf(" support.reliablemarginleft, curcss( "marginleft" elem.getboundingclientrect().left marginleft: elem.getboundingclientrect().left; used animate expand margin: "", padding: border: prefix, suffix prefix expand: i="0," expanded="{}," assumes single string parts="typeof" "string" value.split( " 4; i++ expanded[ cssexpand[ parts[ expanded; "margin" ].set="setPositiveNumber;" jquery.fn.extend( access( this, len, map="{}," array.isarray( len="name.length;" len; map[ name[ map; jquery.style( arguments.length> 1 );2961 }2962} );2963function Tween( elem, options, prop, end, easing ) {2964 return new Tween.prototype.init( elem, options, prop, end, easing );2965}2966jQuery.Tween = Tween;2967Tween.prototype = {2968 constructor: Tween,2969 init: function( elem, options, prop, end, easing, unit ) {2970 this.elem = elem;2971 this.prop = prop;2972 this.easing = easing || jQuery.easing._default;2973 this.options = options;2974 this.start = this.now = this.cur();2975 this.end = end;2976 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );2977 },2978 cur: function() {2979 var hooks = Tween.propHooks[ this.prop ];2980 return hooks && hooks.get ?2981 hooks.get( this ) :2982 Tween.propHooks._default.get( this );2983 },2984 run: function( percent ) {2985 var eased,2986 hooks = Tween.propHooks[ this.prop ];2987 if ( this.options.duration ) {2988 this.pos = eased = jQuery.easing[ this.easing ](2989 percent, this.options.duration * percent, 0, 1, this.options.duration2990 );2991 } else {2992 this.pos = eased = percent;2993 }2994 this.now = ( this.end - this.start ) * eased + this.start;2995 if ( this.options.step ) {2996 this.options.step.call( this.elem, this.now, this );2997 }2998 if ( hooks && hooks.set ) {2999 hooks.set( this );3000 } else {3001 Tween.propHooks._default.set( this );3002 }3003 return this;3004 }3005};3006Tween.prototype.init.prototype = Tween.prototype;3007Tween.propHooks = {3008 _default: {3009 get: function( tween ) {3010 var result;3011 // Use a property on the element directly when it is not a DOM element,3012 // or when there is no matching style property that exists.3013 if ( tween.elem.nodeType !== 1 ||3014 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {3015 return tween.elem[ tween.prop ];3016 }3017 // Passing an empty string as a 3rd parameter to .css will automatically3018 // attempt a parseFloat and fallback to a string if the parse fails.3019 // Simple values such as "10px" are parsed to Float;3020 // complex values such as "rotate(1rad)" are returned as-is.3021 result = jQuery.css( tween.elem, tween.prop, "" );3022 // Empty strings, null, undefined and "auto" are converted to 0.3023 return !result || result === "auto" ? 0 : result;3024 },3025 set: function( tween ) {3026 // Use step hook for back compat.3027 // Use cssHook if its there.3028 // Use .style if available and use plain properties where available.3029 if ( jQuery.fx.step[ tween.prop ] ) {3030 jQuery.fx.step[ tween.prop ]( tween );3031 } else if ( tween.elem.nodeType === 1 && (3032 jQuery.cssHooks[ tween.prop ] ||3033 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {3034 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );3035 } else {3036 tween.elem[ tween.prop ] = tween.now;3037 }3038 }3039 }3040};3041// Support: IE <=9 0 1 2 3 12 15 only panic based approach to setting things on disconnected nodes tween.prophooks.scrolltop="Tween.propHooks.scrollLeft" = { set: function( tween ) if ( tween.elem.nodetype && tween.elem.parentnode tween.elem[ tween.prop ]="tween.now;" } }; jquery.easing="{" linear: p return p; }, swing: 0.5 - math.cos( * math.pi 2; _default: "swing" jquery.fx="Tween.prototype.init;" back compat <1.8 extension point jquery.fx.step="{};" var fxnow, inprogress, rfxtypes="/^(?:toggle|show|hide)$/," rrun="/queueHooks$/;" function schedule() inprogress document.hidden="==" false window.requestanimationframe window.requestanimationframe( schedule ); else window.settimeout( schedule, jquery.fx.interval jquery.fx.tick(); animations created synchronously will run createfxnow() function() fxnow="undefined;" generate parameters create a standard animation genfx( type, includewidth which, i="0," attrs="{" height: type we include width, step value is do all cssexpand values, otherwise skip over left and right ? : 0; for ; < 4; +="2" which="cssExpand[" ]; attrs[ "margin" "padding" attrs.opacity="attrs.width" type; attrs; createtween( value, prop, tween, collection="(" animation.tweeners[ prop || [] ).concat( "*" ), index="0," length="collection.length;" length; index++ ].call( animation, we're done with this property tween; defaultprefilter( elem, props, opts toggle, hooks, oldfire, proptween, restoredisplay, display, isbox="width" in props "height" anim="this," orig="{}," style="elem.style," hidden="elem.nodeType" ishiddenwithintree( elem datashow="dataPriv.get(" "fxshow" queue-skipping hijack the fx hooks !opts.queue "fx" hooks.unqueued="=" null oldfire="hooks.empty.fire;" hooks.empty.fire="function()" !hooks.unqueued oldfire(); hooks.unqueued++; anim.always( ensure complete handler called before completes hooks.unqueued--; !jquery.queue( ).length hooks.empty.fire(); detect show hide rfxtypes.test( delete props[ toggle="toggle" "toggle"; "hide" "show" pretend be there still data from stopped datashow[ !="=" undefined ignore other no-op continue; orig[ jquery.style( bail out like .hide().hide() proptween="!jQuery.isEmptyObject(" !proptween jquery.isemptyobject( return; restrict "overflow" "display" styles during box elem.nodetype="==" support: ie 11, edge record overflow attributes because does not infer shorthand identically-valued overflowx overflowy just mirrors there. opts.overflow="[" style.overflow, style.overflowx, style.overflowy identify display preferring old css cascade restoredisplay="dataShow" datashow.display; "none" get nonempty value(s) by temporarily forcing visibility showhide( [ ], true restoredisplay; animate inline elements as inline-block "inline" "inline-block" jquery.css( "float" restore original at end of pure anim.done( style.display="restoreDisplay;" "" display; style.overflow="hidden" style.overflowx="opts.overflow[" implement general setup element "hidden" "fxshow", display: store visible so `.stop().toggle()` "reverses" datashow.hidden="!hidden;" animating them eslint-disable no-loop-func eslint-enable final actually hiding !hidden datapriv.remove( per-property 0, !( proptween.end="propTween.start;" proptween.start="0;" propfilter( specialeasing index, name, easing, hooks; camelcase, expand csshook pass name="camelCase(" easing="specialEasing[" array.isarray( "expand" quite $.extend, won't overwrite existing keys. reusing 'index' have correct "name" specialeasing[ animation( properties, options result, stopped, deferred="jQuery.Deferred().always(" don't match :animated selector tick.elem; tick="function()" false; currenttime="fxNow" createfxnow(), remaining="Math.max(" animation.starttime animation.duration android 2.3 archaic crash bug allow us use `1 )` (#12497) temp="remaining" percent="1" temp, animation.tweens[ ].run( deferred.notifywith( percent, there's more do, yield remaining; was an empty synthesize progress notification !length 1, resolve report its conclusion deferred.resolvewith( elem: props: jquery.extend( {}, properties opts: true, specialeasing: easing: jquery.easing._default originalproperties: originaloptions: options, starttime: duration: options.duration, tweens: [], createtween: animation.opts, end, animation.opts.specialeasing[ animation.opts.easing animation.tweens.push( stop: gotoend are going want tweens part animation.tweens.length this; when played last frame; otherwise, reject deferred.rejectwith( animation.opts.specialeasing result="Animation.prefilters[" animation.opts isfunction( result.stop jquery._queuehooks( animation.elem, animation.opts.queue ).stop="result.stop.bind(" result; jquery.map( createtween, animation.opts.start animation.opts.start.call( attach callbacks .progress( animation.opts.progress .done( animation.opts.done, animation.opts.complete .fail( animation.opts.fail .always( animation.opts.always jquery.fx.timer( tick, anim: queue: animation; jquery.animation="jQuery.extend(" tweeners: "*": adjustcss( tween.elem, rcssnum.exec( tweener: callback rnothtmlwhite []; ].unshift( prefilters: defaultprefilter prefilter: callback, prepend animation.prefilters.unshift( animation.prefilters.push( jquery.speed="function(" speed, fn opt="speed" typeof speed="==" "object" complete: !fn !isfunction( go state off jquery.fx.off opt.duration="0;" "number" jquery.fx.speeds normalize opt.queue> "fx"3042 if ( opt.queue == null || opt.queue === true ) {3043 opt.queue = "fx";3044 }3045 // Queueing3046 opt.old = opt.complete;3047 opt.complete = function() {3048 if ( isFunction( opt.old ) ) {3049 opt.old.call( this );3050 }3051 if ( opt.queue ) {3052 jQuery.dequeue( this, opt.queue );3053 }3054 };3055 return opt;3056};3057jQuery.fn.extend( {3058 fadeTo: function( speed, to, easing, callback ) {3059 // Show any hidden elements after setting opacity to 03060 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()3061 // Animate to the value specified3062 .end().animate( { opacity: to }, speed, easing, callback );3063 },3064 animate: function( prop, speed, easing, callback ) {3065 var empty = jQuery.isEmptyObject( prop ),3066 optall = jQuery.speed( speed, easing, callback ),3067 doAnimation = function() {3068 // Operate on a copy of prop so per-property easing won't be lost3069 var anim = Animation( this, jQuery.extend( {}, prop ), optall );3070 // Empty animations, or finishing resolves immediately3071 if ( empty || dataPriv.get( this, "finish" ) ) {3072 anim.stop( true );3073 }3074 };3075 doAnimation.finish = doAnimation;3076 return empty || optall.queue === false ?3077 this.each( doAnimation ) :3078 this.queue( optall.queue, doAnimation );3079 },3080 stop: function( type, clearQueue, gotoEnd ) {3081 var stopQueue = function( hooks ) {3082 var stop = hooks.stop;3083 delete hooks.stop;3084 stop( gotoEnd );3085 };3086 if ( typeof type !== "string" ) {3087 gotoEnd = clearQueue;3088 clearQueue = type;3089 type = undefined;3090 }3091 if ( clearQueue && type !== false ) {3092 this.queue( type || "fx", [] );3093 }3094 return this.each( function() {3095 var dequeue = true,3096 index = type != null && type + "queueHooks",3097 timers = jQuery.timers,3098 data = dataPriv.get( this );3099 if ( index ) {3100 if ( data[ index ] && data[ index ].stop ) {3101 stopQueue( data[ index ] );3102 }3103 } else {3104 for ( index in data ) {3105 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {3106 stopQueue( data[ index ] );3107 }3108 }3109 }3110 for ( index = timers.length; index--; ) {3111 if ( timers[ index ].elem === this &&3112 ( type == null || timers[ index ].queue === type ) ) {3113 timers[ index ].anim.stop( gotoEnd );3114 dequeue = false;3115 timers.splice( index, 1 );3116 }3117 }3118 // Start the next in the queue if the last step wasn't forced.3119 // Timers currently will call their complete callbacks, which3120 // will dequeue but only if they were gotoEnd.3121 if ( dequeue || !gotoEnd ) {3122 jQuery.dequeue( this, type );3123 }3124 } );3125 },3126 finish: function( type ) {3127 if ( type !== false ) {3128 type = type || "fx";3129 }3130 return this.each( function() {3131 var index,3132 data = dataPriv.get( this ),3133 queue = data[ type + "queue" ],3134 hooks = data[ type + "queueHooks" ],3135 timers = jQuery.timers,3136 length = queue ? queue.length : 0;3137 // Enable finishing flag on private data3138 data.finish = true;3139 // Empty the queue first3140 jQuery.queue( this, type, [] );3141 if ( hooks && hooks.stop ) {3142 hooks.stop.call( this, true );3143 }3144 // Look for any active animations, and finish them3145 for ( index = timers.length; index--; ) {3146 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {3147 timers[ index ].anim.stop( true );3148 timers.splice( index, 1 );3149 }3150 }3151 // Look for any animations in the old queue and finish them3152 for ( index = 0; index < length; index++ ) {3153 if ( queue[ index ] && queue[ index ].finish ) {3154 queue[ index ].finish.call( this );3155 }3156 }3157 // Turn off finishing flag3158 delete data.finish;3159 } );3160 }3161} );3162jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {3163 var cssFn = jQuery.fn[ name ];3164 jQuery.fn[ name ] = function( speed, easing, callback ) {3165 return speed == null || typeof speed === "boolean" ?3166 cssFn.apply( this, arguments ) :3167 this.animate( genFx( name, true ), speed, easing, callback );3168 };3169} );3170// Generate shortcuts for custom animations3171jQuery.each( {3172 slideDown: genFx( "show" ),3173 slideUp: genFx( "hide" ),3174 slideToggle: genFx( "toggle" ),3175 fadeIn: { opacity: "show" },3176 fadeOut: { opacity: "hide" },3177 fadeToggle: { opacity: "toggle" }3178}, function( name, props ) {3179 jQuery.fn[ name ] = function( speed, easing, callback ) {3180 return this.animate( props, speed, easing, callback );3181 };3182} );3183jQuery.timers = [];3184jQuery.fx.tick = function() {3185 var timer,3186 i = 0,3187 timers = jQuery.timers;3188 fxNow = Date.now();3189 for ( ; i < timers.length; i++ ) {3190 timer = timers[ i ];3191 // Run the timer and safely remove it when done (allowing for external removal)3192 if ( !timer() && timers[ i ] === timer ) {3193 timers.splice( i--, 1 );3194 }3195 }3196 if ( !timers.length ) {3197 jQuery.fx.stop();3198 }3199 fxNow = undefined;3200};3201jQuery.fx.timer = function( timer ) {3202 jQuery.timers.push( timer );3203 jQuery.fx.start();3204};3205jQuery.fx.interval = 13;3206jQuery.fx.start = function() {3207 if ( inProgress ) {3208 return;3209 }3210 inProgress = true;3211 schedule();3212};3213jQuery.fx.stop = function() {3214 inProgress = null;3215};3216jQuery.fx.speeds = {3217 slow: 600,3218 fast: 200,3219 // Default speed3220 _default: 4003221};3222// Based off of the plugin by Clint Helfers, with permission.3223// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/3224jQuery.fn.delay = function( time, type ) {3225 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;3226 type = type || "fx";3227 return this.queue( type, function( next, hooks ) {3228 var timeout = window.setTimeout( next, time );3229 hooks.stop = function() {3230 window.clearTimeout( timeout );3231 };3232 } );3233};3234( function() {3235 var input = document.createElement( "input" ),3236 select = document.createElement( "select" ),3237 opt = select.appendChild( document.createElement( "option" ) );3238 input.type = "checkbox";3239 // Support: Android <=4.3 only default value for a checkbox should be "on" support.checkon="input.value" !="=" ""; support: ie <="11" must access selectedindex to make options select support.optselected="opt.selected;" an input loses its after becoming radio "input" ); input.value="t" ; input.type="radio" support.radiovalue="input.value" =="=" "t"; } )(); var boolhook, attrhandle="jQuery.expr.attrHandle;" jquery.fn.extend( { attr: function( name, ) return access( this, jquery.attr, value, arguments.length> 1 );3240 },3241 removeAttr: function( name ) {3242 return this.each( function() {3243 jQuery.removeAttr( this, name );3244 } );3245 }3246} );3247jQuery.extend( {3248 attr: function( elem, name, value ) {3249 var ret, hooks,3250 nType = elem.nodeType;3251 // Don't get/set attributes on text, comment and attribute nodes3252 if ( nType === 3 || nType === 8 || nType === 2 ) {3253 return;3254 }3255 // Fallback to prop when attributes are not supported3256 if ( typeof elem.getAttribute === "undefined" ) {3257 return jQuery.prop( elem, name, value );3258 }3259 // Attribute hooks are determined by the lowercase version3260 // Grab necessary hook if one is defined3261 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {3262 hooks = jQuery.attrHooks[ name.toLowerCase() ] ||3263 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );3264 }3265 if ( value !== undefined ) {3266 if ( value === null ) {3267 jQuery.removeAttr( elem, name );3268 return;3269 }3270 if ( hooks && "set" in hooks &&3271 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {3272 return ret;3273 }3274 elem.setAttribute( name, value + "" );3275 return value;3276 }3277 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {3278 return ret;3279 }3280 ret = jQuery.find.attr( elem, name );3281 // Non-existent attributes return null, we normalize to undefined3282 return ret == null ? undefined : ret;3283 },3284 attrHooks: {3285 type: {3286 set: function( elem, value ) {3287 if ( !support.radioValue && value === "radio" &&3288 nodeName( elem, "input" ) ) {3289 var val = elem.value;3290 elem.setAttribute( "type", value );3291 if ( val ) {3292 elem.value = val;3293 }3294 return value;3295 }3296 }3297 }3298 },3299 removeAttr: function( elem, value ) {3300 var name,3301 i = 0,3302 // Attribute names can contain non-HTML whitespace characters3303 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-23304 attrNames = value && value.match( rnothtmlwhite );3305 if ( attrNames && elem.nodeType === 1 ) {3306 while ( ( name = attrNames[ i++ ] ) ) {3307 elem.removeAttribute( name );3308 }3309 }3310 }3311} );3312// Hooks for boolean attributes3313boolHook = {3314 set: function( elem, value, name ) {3315 if ( value === false ) {3316 // Remove boolean attributes when set to false3317 jQuery.removeAttr( elem, name );3318 } else {3319 elem.setAttribute( name, name );3320 }3321 return name;3322 }3323};3324jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {3325 var getter = attrHandle[ name ] || jQuery.find.attr;3326 attrHandle[ name ] = function( elem, name, isXML ) {3327 var ret, handle,3328 lowercaseName = name.toLowerCase();3329 if ( !isXML ) {3330 // Avoid an infinite loop by temporarily removing this function from the getter3331 handle = attrHandle[ lowercaseName ];3332 attrHandle[ lowercaseName ] = ret;3333 ret = getter( elem, name, isXML ) != null ?3334 lowercaseName :3335 null;3336 attrHandle[ lowercaseName ] = handle;3337 }3338 return ret;3339 };3340} );3341var rfocusable = /^(?:input|select|textarea|button)$/i,3342 rclickable = /^(?:a|area)$/i;3343jQuery.fn.extend( {3344 prop: function( name, value ) {3345 return access( this, jQuery.prop, name, value, arguments.length > 1 );3346 },3347 removeProp: function( name ) {3348 return this.each( function() {3349 delete this[ jQuery.propFix[ name ] || name ];3350 } );3351 }3352} );3353jQuery.extend( {3354 prop: function( elem, name, value ) {3355 var ret, hooks,3356 nType = elem.nodeType;3357 // Don't get/set properties on text, comment and attribute nodes3358 if ( nType === 3 || nType === 8 || nType === 2 ) {3359 return;3360 }3361 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {3362 // Fix name and attach hooks3363 name = jQuery.propFix[ name ] || name;3364 hooks = jQuery.propHooks[ name ];3365 }3366 if ( value !== undefined ) {3367 if ( hooks && "set" in hooks &&3368 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {3369 return ret;3370 }3371 return ( elem[ name ] = value );3372 }3373 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {3374 return ret;3375 }3376 return elem[ name ];3377 },3378 propHooks: {3379 tabIndex: {3380 get: function( elem ) {3381 // Support: IE <=9 0 1 10 11 2008 - only elem.tabindex doesn't always return the correct value when it hasn't been explicitly set https: web.archive.org web 20141116233347 http: fluidproject.org blog 01 09 getting-setting-and-removing-tabindex-values-with-javascript use proper attribute retrieval(#12072) var tabindex="jQuery.find.attr(" elem, "tabindex" ); if ( ) { parseint( tabindex, } rfocusable.test( elem.nodename || rclickable.test( && elem.href 0; -1; }, propfix: "for": "htmlfor", "class": "classname" support: ie <="11" accessing selectedindex property forces browser to respect setting selected on option getter ensures a default is in an optgroup eslint rule "no-unused-expressions" disabled for this code since considers such accessions noop !support.optselected jquery.prophooks.selected="{" get: function( elem * no-unused-expressions: "off" parent="elem.parentNode;" parent.parentnode parent.parentnode.selectedindex; null; set: parent.selectedindex; }; jquery.each( [ "tabindex", "readonly", "maxlength", "cellspacing", "cellpadding", "rowspan", "colspan", "usemap", "frameborder", "contenteditable" ], function() jquery.propfix[ this.tolowercase() ]="this;" strip and collapse whitespace according html spec infra.spec.whatwg.org #strip-and-collapse-ascii-whitespace function stripandcollapse( tokens="value.match(" rnothtmlwhite []; tokens.join( " getclass( elem.getattribute elem.getattribute( "class" ""; classestoarray( array.isarray( value; typeof "string" value.match( jquery.fn.extend( addclass: classes, cur, curvalue, clazz, j, finalvalue, i="0;" isfunction( this.each( j jquery( ).addclass( value.call( this, classes="classesToArray(" classes.length while i++ curvalue="getClass(" cur="elem.nodeType" =="=" + clazz="classes[" j++ cur.indexof( "; assign different avoid unneeded rendering. finalvalue="stripAndCollapse(" !="=" elem.setattribute( "class", this; removeclass: ).removeclass( !arguments.length this.attr( "" expression here better compressibility (see addclass) remove *all* instances> -1 ) {3382 cur = cur.replace( " " + clazz + " ", " " );3383 }3384 }3385 // Only assign if different to avoid unneeded rendering.3386 finalValue = stripAndCollapse( cur );3387 if ( curValue !== finalValue ) {3388 elem.setAttribute( "class", finalValue );3389 }3390 }3391 }3392 }3393 return this;3394 },3395 toggleClass: function( value, stateVal ) {3396 var type = typeof value,3397 isValidValue = type === "string" || Array.isArray( value );3398 if ( typeof stateVal === "boolean" && isValidValue ) {3399 return stateVal ? this.addClass( value ) : this.removeClass( value );3400 }3401 if ( isFunction( value ) ) {3402 return this.each( function( i ) {3403 jQuery( this ).toggleClass(3404 value.call( this, i, getClass( this ), stateVal ),3405 stateVal3406 );3407 } );3408 }3409 return this.each( function() {3410 var className, i, self, classNames;3411 if ( isValidValue ) {3412 // Toggle individual class names3413 i = 0;3414 self = jQuery( this );3415 classNames = classesToArray( value );3416 while ( ( className = classNames[ i++ ] ) ) {3417 // Check each className given, space separated list3418 if ( self.hasClass( className ) ) {3419 self.removeClass( className );3420 } else {3421 self.addClass( className );3422 }3423 }3424 // Toggle whole class name3425 } else if ( value === undefined || type === "boolean" ) {3426 className = getClass( this );3427 if ( className ) {3428 // Store className if set3429 dataPriv.set( this, "__className__", className );3430 }3431 // If the element has a class name or if we're passed `false`,3432 // then remove the whole classname (if there was one, the above saved it).3433 // Otherwise bring back whatever was previously saved (if anything),3434 // falling back to the empty string if nothing was stored.3435 if ( this.setAttribute ) {3436 this.setAttribute( "class",3437 className || value === false ?3438 "" :3439 dataPriv.get( this, "__className__" ) || ""3440 );3441 }3442 }3443 } );3444 },3445 hasClass: function( selector ) {3446 var className, elem,3447 i = 0;3448 className = " " + selector + " ";3449 while ( ( elem = this[ i++ ] ) ) {3450 if ( elem.nodeType === 1 &&3451 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {3452 return true;3453 }3454 }3455 return false;3456 }3457} );3458var rreturn = /\r/g;3459jQuery.fn.extend( {3460 val: function( value ) {3461 var hooks, ret, valueIsFunction,3462 elem = this[ 0 ];3463 if ( !arguments.length ) {3464 if ( elem ) {3465 hooks = jQuery.valHooks[ elem.type ] ||3466 jQuery.valHooks[ elem.nodeName.toLowerCase() ];3467 if ( hooks &&3468 "get" in hooks &&3469 ( ret = hooks.get( elem, "value" ) ) !== undefined3470 ) {3471 return ret;3472 }3473 ret = elem.value;3474 // Handle most common string cases3475 if ( typeof ret === "string" ) {3476 return ret.replace( rreturn, "" );3477 }3478 // Handle cases where value is null/undef or number3479 return ret == null ? "" : ret;3480 }...
Using AI Code Generation
1describe('My First Test', function() {2 it('Does not do much!', function() {3 cy.contains('type').click()4 cy.url().should('include', '/commands/actions')5 cy.get('.action-email')6 .type('
Using AI Code Generation
1describe('My First Test', function() {2 it('Does not do much!', function() {3 cy.contains('type').click()4 cy.url().should('include', '/commands/actions')5 cy.get('.action-email')6 .type('
Using AI Code Generation
1cy.get('button').then(elem => {2 expect(elem.nodeName.toLowerCase()).to.equal('button')3})4cy.get('button').then(elem => {5 expect(Cypress.dom.nodeName(elem)).to.equal('button')6})7cy.get('button').then(elem => {8 expect(Cypress.dom.isElement(elem)).to.be.true9})10cy.get('button').then(elem => {11 expect(Cypress.dom.isDocument(elem)).to.be.false12})13cy.get('button').then(elem => {14 expect(Cypress.dom.isWindow(elem)).to.be.false15})16cy.get('button').then(elem => {17 expect(Cypress.dom.isJquery(elem)).to.be.false18})19cy.get('button').then(elem => {20 expect(Cypress.dom.isPlainObject(elem)).to.be.false21})22cy.get('button').then(elem => {23 expect(Cypress.dom.isDom(elem)).to.be.true24})25cy.get('button').then(elem => {26 expect(Cypress.dom.isJqueryElement(elem)).to.be.false27})28cy.get('button').then(elem => {29 expect(Cypress.dom.isElementOrDocument(elem)).to.be.true30})31cy.get('button').then(elem => {32 expect(Cypress.dom.isElementOrDocumentOrWindow(elem)).to.be.true33})34cy.get('button').then(elem => {35 expect(Cypress.dom.isSelector(elem)).to.be.false36})37cy.get('button').then(elem => {38 expect(Cypress.dom.isString(elem)).to.be.false39})40cy.get('button').then(elem => {41 expect(Cypress.dom.isNumber(elem)).to.be.false42})
Using AI Code Generation
1cy.get('li').each(($el, index, $list) => {2 cy.log($el[0].nodeName.toLowerCase())3})4cy.get('li').each(($el, index, $list) => {5 cy.log($el.prop('nodeName'))6})7cy.get('li').each(($el, index, $list) => {8 cy.log($el.prop('tagName'))9})
Using AI Code Generation
1describe('Test', function() {2 it('test', function() {3 cy.get('ul').contains('apples').then((elem) => {4 cy.log(elem.nodeName.toLowerCase())5 })6 })7})8describe('Test', function() {9 it('test', function() {10 cy.get('ul').contains('apples').then((elem) => {11 cy.log(elem[0].nodeName.toLowerCase())12 })13 })14})15describe('Test', function() {16 it('test', function() {17 cy.get('ul').contains('apples').then((elem) => {18 cy.log(elem[0].tagName.toLowerCase())19 })20 })21})22describe('Test', function() {23 it('test', function() {24 cy.get('ul').contains('apples').then((elem) => {25 cy.log(elem.prop('tagName').toLowerCase())26 })27 })28})29describe('Test', function() {30 it('test', function() {31 cy.get('ul').contains('apples').then((elem) => {32 cy.log(elem.get(0).tagName.toLowerCase())33 })34 })35})36describe('Test', function() {37 it('test', function() {38 cy.get('ul').contains('apples').then((elem) => {
Using AI Code Generation
1describe('Input Test', () => {2 it('should check if the element is an input', () => {3 cy.get('input').should('have.attr', 'placeholder')4 })5})6describe('Input Test', () => {7 it('should check if the element is an input', () => {8 cy.get('input').should('have.prop', 'placeholder')9 })10})11describe('Input Test', () => {12 it('should check if the element is an input', () => {13 cy.get('input').should('have.prop', 'placeholder')14 })15})16describe('Input Test', () => {17 it('should check if the element is an input', () => {18 cy.get('input').should('have.prop', 'placeholder')19 })20})21describe('Input Test', () => {22 it('should check if the element is an input', () => {23 cy.get('input').should('have.prop', 'placeholder')24 })25})26describe('Input Test', () => {27 it('should check if the element is an input', () => {28 cy.get('input').should('have.prop', 'placeholder')29 })30})
Using AI Code Generation
1cy.get('a').then(($a) => {2})3cy.get('a').then(($a) => {4 const href = Cypress.$($a).attr('href')5})6cy.get('a').then(($a) => {7 const href = Cypress.$($a).attr('href')8})9cy.get('a').then(($a) => {10 const href = Cypress.$($a).attr('href')11})12cy.get('a').then(($a) => {13 const href = Cypress.$($a).attr('href')14})15cy.get('a').then(($a) => {16 const href = Cypress.$($a).attr('href')17})18cy.get('a').then(($a) => {19 const href = Cypress.$($a).attr('href')20})21cy.get('a').then(($a) => {22 const href = Cypress.$($a).attr('href')23})24cy.get('a').then(($a) => {25 const href = Cypress.$($a).attr('href')26})27cy.get('a').then(($a) => {28 const href = Cypress.$($a).attr('href')
Using AI Code Generation
1var elem = document.getElementById('someElementId');2var tagName = elem.nodeName.toLowerCase();3return tagName;4cy.get('#someElementId')5 .invoke('prop', 'nodeName')6 .should('eq', 'INPUT');7var elem = document.getElementById('someElementId');8var tagName = elem.tagName;9return tagName;10cy.get('#someElementId')11 .invoke('prop', 'tagName')12 .should('eq', 'INPUT');13var elem = document.getElementById('someElementId');14var tagName = elem.tagName.toLowerCase();15return tagName;16cy.get('#someElementId')17 .invoke('prop', 'tagName')18 .should('eq', 'INPUT');19var elem = document.getElementById('someElementId');20var tagName = elem.tagName.toLowerCase();21return tagName;22cy.get('#someElementId')23 .invoke('prop', 'tagName')24 .should('eq', 'INPUT');25var elem = document.getElementById('someElementId');26var tagName = elem.tagName.toLowerCase();27return tagName;28cy.get('#someElementId')29 .invoke('prop', 'tagName')30 .should('eq', 'INPUT');31var elem = document.getElementById('someElementId');32var tagName = elem.tagName.toLowerCase();33return tagName;34cy.get('#someElementId')35 .invoke('prop', 'tagName')36 .should('eq', 'INPUT');
Cypress is a renowned Javascript-based open-source, easy-to-use end-to-end testing framework primarily used for testing web applications. Cypress is a relatively new player in the automation testing space and has been gaining much traction lately, as evidenced by the number of Forks (2.7K) and Stars (42.1K) for the project. LambdaTest’s Cypress Tutorial covers step-by-step guides that will help you learn from the basics till you run automation tests on LambdaTest.
You can elevate your expertise with end-to-end testing using the Cypress automation framework and stay one step ahead in your career by earning a Cypress certification. Check out our Cypress 101 Certification.
Watch this 3 hours of complete tutorial to learn the basics of Cypress and various Cypress commands with the Cypress testing at LambdaTest.
Get 100 minutes of automation test minutes FREE!!