1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | (function( window, undefined ) {
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | var
|
22 |
|
23 | rootjQuery,
|
24 |
|
25 |
|
26 | readyList,
|
27 |
|
28 |
|
29 |
|
30 | core_strundefined = typeof undefined,
|
31 |
|
32 |
|
33 | location = window.location,
|
34 | document = window.document,
|
35 | docElem = document.documentElement,
|
36 |
|
37 |
|
38 | _jQuery = window.jQuery,
|
39 |
|
40 |
|
41 | _$ = window.$,
|
42 |
|
43 |
|
44 | class2type = {},
|
45 |
|
46 |
|
47 | core_deletedIds = [],
|
48 |
|
49 | core_version = "2.0.0",
|
50 |
|
51 |
|
52 | core_concat = core_deletedIds.concat,
|
53 | core_push = core_deletedIds.push,
|
54 | core_slice = core_deletedIds.slice,
|
55 | core_indexOf = core_deletedIds.indexOf,
|
56 | core_toString = class2type.toString,
|
57 | core_hasOwn = class2type.hasOwnProperty,
|
58 | core_trim = core_version.trim,
|
59 |
|
60 |
|
61 | jQuery = function( selector, context ) {
|
62 |
|
63 | return new jQuery.fn.init( selector, context, rootjQuery );
|
64 | },
|
65 |
|
66 |
|
67 | core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
|
68 |
|
69 |
|
70 | core_rnotwhite = /\S+/g,
|
71 |
|
72 |
|
73 |
|
74 |
|
75 | rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
|
76 |
|
77 |
|
78 | rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
|
79 |
|
80 |
|
81 | rmsPrefix = /^-ms-/,
|
82 | rdashAlpha = /-([\da-z])/gi,
|
83 |
|
84 |
|
85 | fcamelCase = function( all, letter ) {
|
86 | return letter.toUpperCase();
|
87 | },
|
88 |
|
89 |
|
90 | completed = function() {
|
91 | document.removeEventListener( "DOMContentLoaded", completed, false );
|
92 | window.removeEventListener( "load", completed, false );
|
93 | jQuery.ready();
|
94 | };
|
95 |
|
96 | jQuery.fn = jQuery.prototype = {
|
97 |
|
98 | jquery: core_version,
|
99 |
|
100 | constructor: jQuery,
|
101 | init: function( selector, context, rootjQuery ) {
|
102 | var match, elem;
|
103 |
|
104 |
|
105 | if ( !selector ) {
|
106 | return this;
|
107 | }
|
108 |
|
109 |
|
110 | if ( typeof selector === "string" ) {
|
111 | if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
|
112 |
|
113 | match = [ null, selector, null ];
|
114 |
|
115 | } else {
|
116 | match = rquickExpr.exec( selector );
|
117 | }
|
118 |
|
119 |
|
120 | if ( match && (match[1] || !context) ) {
|
121 |
|
122 |
|
123 | if ( match[1] ) {
|
124 | context = context instanceof jQuery ? context[0] : context;
|
125 |
|
126 |
|
127 | jQuery.merge( this, jQuery.parseHTML(
|
128 | match[1],
|
129 | context && context.nodeType ? context.ownerDocument || context : document,
|
130 | true
|
131 | ) );
|
132 |
|
133 |
|
134 | if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
|
135 | for ( match in context ) {
|
136 |
|
137 | if ( jQuery.isFunction( this[ match ] ) ) {
|
138 | this[ match ]( context[ match ] );
|
139 |
|
140 |
|
141 | } else {
|
142 | this.attr( match, context[ match ] );
|
143 | }
|
144 | }
|
145 | }
|
146 |
|
147 | return this;
|
148 |
|
149 |
|
150 | } else {
|
151 | elem = document.getElementById( match[2] );
|
152 |
|
153 |
|
154 |
|
155 | if ( elem && elem.parentNode ) {
|
156 |
|
157 | this.length = 1;
|
158 | this[0] = elem;
|
159 | }
|
160 |
|
161 | this.context = document;
|
162 | this.selector = selector;
|
163 | return this;
|
164 | }
|
165 |
|
166 |
|
167 | } else if ( !context || context.jquery ) {
|
168 | return ( context || rootjQuery ).find( selector );
|
169 |
|
170 |
|
171 |
|
172 | } else {
|
173 | return this.constructor( context ).find( selector );
|
174 | }
|
175 |
|
176 |
|
177 | } else if ( selector.nodeType ) {
|
178 | this.context = this[0] = selector;
|
179 | this.length = 1;
|
180 | return this;
|
181 |
|
182 |
|
183 |
|
184 | } else if ( jQuery.isFunction( selector ) ) {
|
185 | return rootjQuery.ready( selector );
|
186 | }
|
187 |
|
188 | if ( selector.selector !== undefined ) {
|
189 | this.selector = selector.selector;
|
190 | this.context = selector.context;
|
191 | }
|
192 |
|
193 | return jQuery.makeArray( selector, this );
|
194 | },
|
195 |
|
196 |
|
197 | selector: "",
|
198 |
|
199 |
|
200 | length: 0,
|
201 |
|
202 | toArray: function() {
|
203 | return core_slice.call( this );
|
204 | },
|
205 |
|
206 |
|
207 |
|
208 | get: function( num ) {
|
209 | return num == null ?
|
210 |
|
211 |
|
212 | this.toArray() :
|
213 |
|
214 |
|
215 | ( num < 0 ? this[ this.length + num ] : this[ num ] );
|
216 | },
|
217 |
|
218 |
|
219 |
|
220 | pushStack: function( elems ) {
|
221 |
|
222 |
|
223 | var ret = jQuery.merge( this.constructor(), elems );
|
224 |
|
225 |
|
226 | ret.prevObject = this;
|
227 | ret.context = this.context;
|
228 |
|
229 |
|
230 | return ret;
|
231 | },
|
232 |
|
233 |
|
234 |
|
235 |
|
236 | each: function( callback, args ) {
|
237 | return jQuery.each( this, callback, args );
|
238 | },
|
239 |
|
240 | ready: function( fn ) {
|
241 |
|
242 | jQuery.ready.promise().done( fn );
|
243 |
|
244 | return this;
|
245 | },
|
246 |
|
247 | slice: function() {
|
248 | return this.pushStack( core_slice.apply( this, arguments ) );
|
249 | },
|
250 |
|
251 | first: function() {
|
252 | return this.eq( 0 );
|
253 | },
|
254 |
|
255 | last: function() {
|
256 | return this.eq( -1 );
|
257 | },
|
258 |
|
259 | eq: function( i ) {
|
260 | var len = this.length,
|
261 | j = +i + ( i < 0 ? len : 0 );
|
262 | return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
|
263 | },
|
264 |
|
265 | map: function( callback ) {
|
266 | return this.pushStack( jQuery.map(this, function( elem, i ) {
|
267 | return callback.call( elem, i, elem );
|
268 | }));
|
269 | },
|
270 |
|
271 | end: function() {
|
272 | return this.prevObject || this.constructor(null);
|
273 | },
|
274 |
|
275 |
|
276 |
|
277 | push: core_push,
|
278 | sort: [].sort,
|
279 | splice: [].splice
|
280 | };
|
281 |
|
282 |
|
283 | jQuery.fn.init.prototype = jQuery.fn;
|
284 |
|
285 | jQuery.extend = jQuery.fn.extend = function() {
|
286 | var options, name, src, copy, copyIsArray, clone,
|
287 | target = arguments[0] || {},
|
288 | i = 1,
|
289 | length = arguments.length,
|
290 | deep = false;
|
291 |
|
292 |
|
293 | if ( typeof target === "boolean" ) {
|
294 | deep = target;
|
295 | target = arguments[1] || {};
|
296 |
|
297 | i = 2;
|
298 | }
|
299 |
|
300 |
|
301 | if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
|
302 | target = {};
|
303 | }
|
304 |
|
305 |
|
306 | if ( length === i ) {
|
307 | target = this;
|
308 | --i;
|
309 | }
|
310 |
|
311 | for ( ; i < length; i++ ) {
|
312 |
|
313 | if ( (options = arguments[ i ]) != null ) {
|
314 |
|
315 | for ( name in options ) {
|
316 | src = target[ name ];
|
317 | copy = options[ name ];
|
318 |
|
319 |
|
320 | if ( target === copy ) {
|
321 | continue;
|
322 | }
|
323 |
|
324 |
|
325 | if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
|
326 | if ( copyIsArray ) {
|
327 | copyIsArray = false;
|
328 | clone = src && jQuery.isArray(src) ? src : [];
|
329 |
|
330 | } else {
|
331 | clone = src && jQuery.isPlainObject(src) ? src : {};
|
332 | }
|
333 |
|
334 |
|
335 | target[ name ] = jQuery.extend( deep, clone, copy );
|
336 |
|
337 |
|
338 | } else if ( copy !== undefined ) {
|
339 | target[ name ] = copy;
|
340 | }
|
341 | }
|
342 | }
|
343 | }
|
344 |
|
345 |
|
346 | return target;
|
347 | };
|
348 |
|
349 | jQuery.extend({
|
350 |
|
351 | expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
|
352 |
|
353 | noConflict: function( deep ) {
|
354 | if ( window.$ === jQuery ) {
|
355 | window.$ = _$;
|
356 | }
|
357 |
|
358 | if ( deep && window.jQuery === jQuery ) {
|
359 | window.jQuery = _jQuery;
|
360 | }
|
361 |
|
362 | return jQuery;
|
363 | },
|
364 |
|
365 |
|
366 | isReady: false,
|
367 |
|
368 |
|
369 |
|
370 | readyWait: 1,
|
371 |
|
372 |
|
373 | holdReady: function( hold ) {
|
374 | if ( hold ) {
|
375 | jQuery.readyWait++;
|
376 | } else {
|
377 | jQuery.ready( true );
|
378 | }
|
379 | },
|
380 |
|
381 |
|
382 | ready: function( wait ) {
|
383 |
|
384 |
|
385 | if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
|
386 | return;
|
387 | }
|
388 |
|
389 |
|
390 | jQuery.isReady = true;
|
391 |
|
392 |
|
393 | if ( wait !== true && --jQuery.readyWait > 0 ) {
|
394 | return;
|
395 | }
|
396 |
|
397 |
|
398 | readyList.resolveWith( document, [ jQuery ] );
|
399 |
|
400 |
|
401 | if ( jQuery.fn.trigger ) {
|
402 | jQuery( document ).trigger("ready").off("ready");
|
403 | }
|
404 | },
|
405 |
|
406 |
|
407 |
|
408 |
|
409 | isFunction: function( obj ) {
|
410 | return jQuery.type(obj) === "function";
|
411 | },
|
412 |
|
413 | isArray: Array.isArray,
|
414 |
|
415 | isWindow: function( obj ) {
|
416 | return obj != null && obj === obj.window;
|
417 | },
|
418 |
|
419 | isNumeric: function( obj ) {
|
420 | return !isNaN( parseFloat(obj) ) && isFinite( obj );
|
421 | },
|
422 |
|
423 | type: function( obj ) {
|
424 | if ( obj == null ) {
|
425 | return String( obj );
|
426 | }
|
427 |
|
428 | return typeof obj === "object" || typeof obj === "function" ?
|
429 | class2type[ core_toString.call(obj) ] || "object" :
|
430 | typeof obj;
|
431 | },
|
432 |
|
433 | isPlainObject: function( obj ) {
|
434 |
|
435 |
|
436 |
|
437 |
|
438 | if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
|
439 | return false;
|
440 | }
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 | try {
|
447 | if ( obj.constructor &&
|
448 | !core_hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
|
449 | return false;
|
450 | }
|
451 | } catch ( e ) {
|
452 | return false;
|
453 | }
|
454 |
|
455 |
|
456 |
|
457 | return true;
|
458 | },
|
459 |
|
460 | isEmptyObject: function( obj ) {
|
461 | var name;
|
462 | for ( name in obj ) {
|
463 | return false;
|
464 | }
|
465 | return true;
|
466 | },
|
467 |
|
468 | error: function( msg ) {
|
469 | throw new Error( msg );
|
470 | },
|
471 |
|
472 |
|
473 |
|
474 |
|
475 | parseHTML: function( data, context, keepScripts ) {
|
476 | if ( !data || typeof data !== "string" ) {
|
477 | return null;
|
478 | }
|
479 | if ( typeof context === "boolean" ) {
|
480 | keepScripts = context;
|
481 | context = false;
|
482 | }
|
483 | context = context || document;
|
484 |
|
485 | var parsed = rsingleTag.exec( data ),
|
486 | scripts = !keepScripts && [];
|
487 |
|
488 |
|
489 | if ( parsed ) {
|
490 | return [ context.createElement( parsed[1] ) ];
|
491 | }
|
492 |
|
493 | parsed = jQuery.buildFragment( [ data ], context, scripts );
|
494 |
|
495 | if ( scripts ) {
|
496 | jQuery( scripts ).remove();
|
497 | }
|
498 |
|
499 | return jQuery.merge( [], parsed.childNodes );
|
500 | },
|
501 |
|
502 | parseJSON: JSON.parse,
|
503 |
|
504 |
|
505 | parseXML: function( data ) {
|
506 | var xml, tmp;
|
507 | if ( !data || typeof data !== "string" ) {
|
508 | return null;
|
509 | }
|
510 |
|
511 |
|
512 | try {
|
513 | tmp = new DOMParser();
|
514 | xml = tmp.parseFromString( data , "text/xml" );
|
515 | } catch ( e ) {
|
516 | xml = undefined;
|
517 | }
|
518 |
|
519 | if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
|
520 | jQuery.error( "Invalid XML: " + data );
|
521 | }
|
522 | return xml;
|
523 | },
|
524 |
|
525 | noop: function() {},
|
526 |
|
527 |
|
528 | globalEval: function( code ) {
|
529 | var script,
|
530 | indirect = eval;
|
531 |
|
532 | code = jQuery.trim( code );
|
533 |
|
534 | if ( code ) {
|
535 |
|
536 |
|
537 |
|
538 | if ( code.indexOf("use strict") === 1 ) {
|
539 | script = document.createElement("script");
|
540 | script.text = code;
|
541 | document.head.appendChild( script ).parentNode.removeChild( script );
|
542 | } else {
|
543 |
|
544 |
|
545 | indirect( code );
|
546 | }
|
547 | }
|
548 | },
|
549 |
|
550 |
|
551 |
|
552 | camelCase: function( string ) {
|
553 | return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
554 | },
|
555 |
|
556 | nodeName: function( elem, name ) {
|
557 | return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
|
558 | },
|
559 |
|
560 |
|
561 | each: function( obj, callback, args ) {
|
562 | var value,
|
563 | i = 0,
|
564 | length = obj.length,
|
565 | isArray = isArraylike( obj );
|
566 |
|
567 | if ( args ) {
|
568 | if ( isArray ) {
|
569 | for ( ; i < length; i++ ) {
|
570 | value = callback.apply( obj[ i ], args );
|
571 |
|
572 | if ( value === false ) {
|
573 | break;
|
574 | }
|
575 | }
|
576 | } else {
|
577 | for ( i in obj ) {
|
578 | value = callback.apply( obj[ i ], args );
|
579 |
|
580 | if ( value === false ) {
|
581 | break;
|
582 | }
|
583 | }
|
584 | }
|
585 |
|
586 |
|
587 | } else {
|
588 | if ( isArray ) {
|
589 | for ( ; i < length; i++ ) {
|
590 | value = callback.call( obj[ i ], i, obj[ i ] );
|
591 |
|
592 | if ( value === false ) {
|
593 | break;
|
594 | }
|
595 | }
|
596 | } else {
|
597 | for ( i in obj ) {
|
598 | value = callback.call( obj[ i ], i, obj[ i ] );
|
599 |
|
600 | if ( value === false ) {
|
601 | break;
|
602 | }
|
603 | }
|
604 | }
|
605 | }
|
606 |
|
607 | return obj;
|
608 | },
|
609 |
|
610 | trim: function( text ) {
|
611 | return text == null ? "" : core_trim.call( text );
|
612 | },
|
613 |
|
614 |
|
615 | makeArray: function( arr, results ) {
|
616 | var ret = results || [];
|
617 |
|
618 | if ( arr != null ) {
|
619 | if ( isArraylike( Object(arr) ) ) {
|
620 | jQuery.merge( ret,
|
621 | typeof arr === "string" ?
|
622 | [ arr ] : arr
|
623 | );
|
624 | } else {
|
625 | core_push.call( ret, arr );
|
626 | }
|
627 | }
|
628 |
|
629 | return ret;
|
630 | },
|
631 |
|
632 | inArray: function( elem, arr, i ) {
|
633 | return arr == null ? -1 : core_indexOf.call( arr, elem, i );
|
634 | },
|
635 |
|
636 | merge: function( first, second ) {
|
637 | var l = second.length,
|
638 | i = first.length,
|
639 | j = 0;
|
640 |
|
641 | if ( typeof l === "number" ) {
|
642 | for ( ; j < l; j++ ) {
|
643 | first[ i++ ] = second[ j ];
|
644 | }
|
645 | } else {
|
646 | while ( second[j] !== undefined ) {
|
647 | first[ i++ ] = second[ j++ ];
|
648 | }
|
649 | }
|
650 |
|
651 | first.length = i;
|
652 |
|
653 | return first;
|
654 | },
|
655 |
|
656 | grep: function( elems, callback, inv ) {
|
657 | var retVal,
|
658 | ret = [],
|
659 | i = 0,
|
660 | length = elems.length;
|
661 | inv = !!inv;
|
662 |
|
663 |
|
664 |
|
665 | for ( ; i < length; i++ ) {
|
666 | retVal = !!callback( elems[ i ], i );
|
667 | if ( inv !== retVal ) {
|
668 | ret.push( elems[ i ] );
|
669 | }
|
670 | }
|
671 |
|
672 | return ret;
|
673 | },
|
674 |
|
675 |
|
676 | map: function( elems, callback, arg ) {
|
677 | var value,
|
678 | i = 0,
|
679 | length = elems.length,
|
680 | isArray = isArraylike( elems ),
|
681 | ret = [];
|
682 |
|
683 |
|
684 | if ( isArray ) {
|
685 | for ( ; i < length; i++ ) {
|
686 | value = callback( elems[ i ], i, arg );
|
687 |
|
688 | if ( value != null ) {
|
689 | ret[ ret.length ] = value;
|
690 | }
|
691 | }
|
692 |
|
693 |
|
694 | } else {
|
695 | for ( i in elems ) {
|
696 | value = callback( elems[ i ], i, arg );
|
697 |
|
698 | if ( value != null ) {
|
699 | ret[ ret.length ] = value;
|
700 | }
|
701 | }
|
702 | }
|
703 |
|
704 |
|
705 | return core_concat.apply( [], ret );
|
706 | },
|
707 |
|
708 |
|
709 | guid: 1,
|
710 |
|
711 |
|
712 |
|
713 | proxy: function( fn, context ) {
|
714 | var tmp, args, proxy;
|
715 |
|
716 | if ( typeof context === "string" ) {
|
717 | tmp = fn[ context ];
|
718 | context = fn;
|
719 | fn = tmp;
|
720 | }
|
721 |
|
722 |
|
723 |
|
724 | if ( !jQuery.isFunction( fn ) ) {
|
725 | return undefined;
|
726 | }
|
727 |
|
728 |
|
729 | args = core_slice.call( arguments, 2 );
|
730 | proxy = function() {
|
731 | return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
|
732 | };
|
733 |
|
734 |
|
735 | proxy.guid = fn.guid = fn.guid || jQuery.guid++;
|
736 |
|
737 | return proxy;
|
738 | },
|
739 |
|
740 |
|
741 |
|
742 | access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
743 | var i = 0,
|
744 | length = elems.length,
|
745 | bulk = key == null;
|
746 |
|
747 |
|
748 | if ( jQuery.type( key ) === "object" ) {
|
749 | chainable = true;
|
750 | for ( i in key ) {
|
751 | jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
|
752 | }
|
753 |
|
754 |
|
755 | } else if ( value !== undefined ) {
|
756 | chainable = true;
|
757 |
|
758 | if ( !jQuery.isFunction( value ) ) {
|
759 | raw = true;
|
760 | }
|
761 |
|
762 | if ( bulk ) {
|
763 |
|
764 | if ( raw ) {
|
765 | fn.call( elems, value );
|
766 | fn = null;
|
767 |
|
768 |
|
769 | } else {
|
770 | bulk = fn;
|
771 | fn = function( elem, key, value ) {
|
772 | return bulk.call( jQuery( elem ), value );
|
773 | };
|
774 | }
|
775 | }
|
776 |
|
777 | if ( fn ) {
|
778 | for ( ; i < length; i++ ) {
|
779 | fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
|
780 | }
|
781 | }
|
782 | }
|
783 |
|
784 | return chainable ?
|
785 | elems :
|
786 |
|
787 |
|
788 | bulk ?
|
789 | fn.call( elems ) :
|
790 | length ? fn( elems[0], key ) : emptyGet;
|
791 | },
|
792 |
|
793 | now: Date.now,
|
794 |
|
795 |
|
796 |
|
797 |
|
798 | swap: function( elem, options, callback, args ) {
|
799 | var ret, name,
|
800 | old = {};
|
801 |
|
802 |
|
803 | for ( name in options ) {
|
804 | old[ name ] = elem.style[ name ];
|
805 | elem.style[ name ] = options[ name ];
|
806 | }
|
807 |
|
808 | ret = callback.apply( elem, args || [] );
|
809 |
|
810 |
|
811 | for ( name in options ) {
|
812 | elem.style[ name ] = old[ name ];
|
813 | }
|
814 |
|
815 | return ret;
|
816 | }
|
817 | });
|
818 |
|
819 | jQuery.ready.promise = function( obj ) {
|
820 | if ( !readyList ) {
|
821 |
|
822 | readyList = jQuery.Deferred();
|
823 |
|
824 |
|
825 |
|
826 |
|
827 | if ( document.readyState === "complete" ) {
|
828 |
|
829 | setTimeout( jQuery.ready );
|
830 |
|
831 | } else {
|
832 |
|
833 |
|
834 | document.addEventListener( "DOMContentLoaded", completed, false );
|
835 |
|
836 |
|
837 | window.addEventListener( "load", completed, false );
|
838 | }
|
839 | }
|
840 | return readyList.promise( obj );
|
841 | };
|
842 |
|
843 |
|
844 | jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
|
845 | class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
846 | });
|
847 |
|
848 | function isArraylike( obj ) {
|
849 | var length = obj.length,
|
850 | type = jQuery.type( obj );
|
851 |
|
852 | if ( jQuery.isWindow( obj ) ) {
|
853 | return false;
|
854 | }
|
855 |
|
856 | if ( obj.nodeType === 1 && length ) {
|
857 | return true;
|
858 | }
|
859 |
|
860 | return type === "array" || type !== "function" &&
|
861 | ( length === 0 ||
|
862 | typeof length === "number" && length > 0 && ( length - 1 ) in obj );
|
863 | }
|
864 |
|
865 |
|
866 | rootjQuery = jQuery(document);
|
867 |
|
868 |
|
869 |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 | (function( window, undefined ) {
|
878 |
|
879 | var i,
|
880 | cachedruns,
|
881 | Expr,
|
882 | getText,
|
883 | isXML,
|
884 | compile,
|
885 | outermostContext,
|
886 | sortInput,
|
887 |
|
888 |
|
889 | setDocument,
|
890 | document,
|
891 | docElem,
|
892 | documentIsHTML,
|
893 | rbuggyQSA,
|
894 | rbuggyMatches,
|
895 | matches,
|
896 | contains,
|
897 |
|
898 |
|
899 | expando = "sizzle" + -(new Date()),
|
900 | preferredDoc = window.document,
|
901 | support = {},
|
902 | dirruns = 0,
|
903 | done = 0,
|
904 | classCache = createCache(),
|
905 | tokenCache = createCache(),
|
906 | compilerCache = createCache(),
|
907 | hasDuplicate = false,
|
908 | sortOrder = function() { return 0; },
|
909 |
|
910 |
|
911 | strundefined = typeof undefined,
|
912 | MAX_NEGATIVE = 1 << 31,
|
913 |
|
914 |
|
915 | arr = [],
|
916 | pop = arr.pop,
|
917 | push_native = arr.push,
|
918 | push = arr.push,
|
919 | slice = arr.slice,
|
920 |
|
921 | indexOf = arr.indexOf || function( elem ) {
|
922 | var i = 0,
|
923 | len = this.length;
|
924 | for ( ; i < len; i++ ) {
|
925 | if ( this[i] === elem ) {
|
926 | return i;
|
927 | }
|
928 | }
|
929 | return -1;
|
930 | },
|
931 |
|
932 | booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
|
933 |
|
934 |
|
935 |
|
936 |
|
937 | whitespace = "[\\x20\\t\\r\\n\\f]",
|
938 |
|
939 | characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
|
940 |
|
941 |
|
942 |
|
943 |
|
944 | identifier = characterEncoding.replace( "w", "w#" ),
|
945 |
|
946 |
|
947 | attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
|
948 | "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 | pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
|
957 |
|
958 |
|
959 | rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
|
960 |
|
961 | rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
|
962 | rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
|
963 |
|
964 | rsibling = new RegExp( whitespace + "*[+~]" ),
|
965 | rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
|
966 |
|
967 | rpseudo = new RegExp( pseudos ),
|
968 | ridentifier = new RegExp( "^" + identifier + "$" ),
|
969 |
|
970 | matchExpr = {
|
971 | "ID": new RegExp( "^#(" + characterEncoding + ")" ),
|
972 | "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
|
973 | "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
|
974 | "ATTR": new RegExp( "^" + attributes ),
|
975 | "PSEUDO": new RegExp( "^" + pseudos ),
|
976 | "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
|
977 | "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
|
978 | "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
|
979 | "boolean": new RegExp( "^(?:" + booleans + ")$", "i" ),
|
980 |
|
981 |
|
982 | "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
|
983 | whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
|
984 | },
|
985 |
|
986 | rnative = /^[^{]+\{\s*\[native \w/,
|
987 |
|
988 |
|
989 | rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
|
990 |
|
991 | rinputs = /^(?:input|select|textarea|button)$/i,
|
992 | rheader = /^h\d$/i,
|
993 |
|
994 | rescape = /'|\\/g,
|
995 |
|
996 |
|
997 | runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
|
998 | funescape = function( _, escaped ) {
|
999 | var high = "0x" + escaped - 0x10000;
|
1000 |
|
1001 | return high !== high ?
|
1002 | escaped :
|
1003 |
|
1004 | high < 0 ?
|
1005 | String.fromCharCode( high + 0x10000 ) :
|
1006 |
|
1007 | String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
|
1008 | };
|
1009 |
|
1010 |
|
1011 | try {
|
1012 | push.apply(
|
1013 | (arr = slice.call( preferredDoc.childNodes )),
|
1014 | preferredDoc.childNodes
|
1015 | );
|
1016 |
|
1017 |
|
1018 | arr[ preferredDoc.childNodes.length ].nodeType;
|
1019 | } catch ( e ) {
|
1020 | push = { apply: arr.length ?
|
1021 |
|
1022 |
|
1023 | function( target, els ) {
|
1024 | push_native.apply( target, slice.call(els) );
|
1025 | } :
|
1026 |
|
1027 |
|
1028 |
|
1029 | function( target, els ) {
|
1030 | var j = target.length,
|
1031 | i = 0;
|
1032 |
|
1033 | while ( (target[j++] = els[i++]) ) {}
|
1034 | target.length = j - 1;
|
1035 | }
|
1036 | };
|
1037 | }
|
1038 |
|
1039 |
|
1040 |
|
1041 |
|
1042 |
|
1043 | function isNative( fn ) {
|
1044 | return rnative.test( fn + "" );
|
1045 | }
|
1046 |
|
1047 |
|
1048 |
|
1049 |
|
1050 |
|
1051 |
|
1052 |
|
1053 | function createCache() {
|
1054 | var cache,
|
1055 | keys = [];
|
1056 |
|
1057 | return (cache = function( key, value ) {
|
1058 |
|
1059 | if ( keys.push( key += " " ) > Expr.cacheLength ) {
|
1060 |
|
1061 | delete cache[ keys.shift() ];
|
1062 | }
|
1063 | return (cache[ key ] = value);
|
1064 | });
|
1065 | }
|
1066 |
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 | function markFunction( fn ) {
|
1072 | fn[ expando ] = true;
|
1073 | return fn;
|
1074 | }
|
1075 |
|
1076 |
|
1077 |
|
1078 |
|
1079 |
|
1080 | function assert( fn ) {
|
1081 | var div = document.createElement("div");
|
1082 |
|
1083 | try {
|
1084 | return !!fn( div );
|
1085 | } catch (e) {
|
1086 | return false;
|
1087 | } finally {
|
1088 | if ( div.parentNode ) {
|
1089 | div.parentNode.removeChild( div );
|
1090 | }
|
1091 |
|
1092 | div = null;
|
1093 | }
|
1094 | }
|
1095 |
|
1096 | function Sizzle( selector, context, results, seed ) {
|
1097 | var match, elem, m, nodeType,
|
1098 |
|
1099 | i, groups, old, nid, newContext, newSelector;
|
1100 |
|
1101 | if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
|
1102 | setDocument( context );
|
1103 | }
|
1104 |
|
1105 | context = context || document;
|
1106 | results = results || [];
|
1107 |
|
1108 | if ( !selector || typeof selector !== "string" ) {
|
1109 | return results;
|
1110 | }
|
1111 |
|
1112 | if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
|
1113 | return [];
|
1114 | }
|
1115 |
|
1116 | if ( documentIsHTML && !seed ) {
|
1117 |
|
1118 |
|
1119 | if ( (match = rquickExpr.exec( selector )) ) {
|
1120 |
|
1121 | if ( (m = match[1]) ) {
|
1122 | if ( nodeType === 9 ) {
|
1123 | elem = context.getElementById( m );
|
1124 |
|
1125 |
|
1126 | if ( elem && elem.parentNode ) {
|
1127 |
|
1128 |
|
1129 | if ( elem.id === m ) {
|
1130 | results.push( elem );
|
1131 | return results;
|
1132 | }
|
1133 | } else {
|
1134 | return results;
|
1135 | }
|
1136 | } else {
|
1137 |
|
1138 | if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
|
1139 | contains( context, elem ) && elem.id === m ) {
|
1140 | results.push( elem );
|
1141 | return results;
|
1142 | }
|
1143 | }
|
1144 |
|
1145 |
|
1146 | } else if ( match[2] ) {
|
1147 | push.apply( results, context.getElementsByTagName( selector ) );
|
1148 | return results;
|
1149 |
|
1150 |
|
1151 | } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
|
1152 | push.apply( results, context.getElementsByClassName( m ) );
|
1153 | return results;
|
1154 | }
|
1155 | }
|
1156 |
|
1157 |
|
1158 | if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
|
1159 | nid = old = expando;
|
1160 | newContext = context;
|
1161 | newSelector = nodeType === 9 && selector;
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 |
|
1167 | if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
|
1168 | groups = tokenize( selector );
|
1169 |
|
1170 | if ( (old = context.getAttribute("id")) ) {
|
1171 | nid = old.replace( rescape, "\\$&" );
|
1172 | } else {
|
1173 | context.setAttribute( "id", nid );
|
1174 | }
|
1175 | nid = "[id='" + nid + "'] ";
|
1176 |
|
1177 | i = groups.length;
|
1178 | while ( i-- ) {
|
1179 | groups[i] = nid + toSelector( groups[i] );
|
1180 | }
|
1181 | newContext = rsibling.test( selector ) && context.parentNode || context;
|
1182 | newSelector = groups.join(",");
|
1183 | }
|
1184 |
|
1185 | if ( newSelector ) {
|
1186 | try {
|
1187 | push.apply( results,
|
1188 | newContext.querySelectorAll( newSelector )
|
1189 | );
|
1190 | return results;
|
1191 | } catch(qsaError) {
|
1192 | } finally {
|
1193 | if ( !old ) {
|
1194 | context.removeAttribute("id");
|
1195 | }
|
1196 | }
|
1197 | }
|
1198 | }
|
1199 | }
|
1200 |
|
1201 |
|
1202 | return select( selector.replace( rtrim, "$1" ), context, results, seed );
|
1203 | }
|
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 | isXML = Sizzle.isXML = function( elem ) {
|
1210 |
|
1211 |
|
1212 | var documentElement = elem && (elem.ownerDocument || elem).documentElement;
|
1213 | return documentElement ? documentElement.nodeName !== "HTML" : false;
|
1214 | };
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 | setDocument = Sizzle.setDocument = function( node ) {
|
1222 | var doc = node ? node.ownerDocument || node : preferredDoc;
|
1223 |
|
1224 |
|
1225 | if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
|
1226 | return document;
|
1227 | }
|
1228 |
|
1229 |
|
1230 | document = doc;
|
1231 | docElem = doc.documentElement;
|
1232 |
|
1233 |
|
1234 | documentIsHTML = !isXML( doc );
|
1235 |
|
1236 |
|
1237 | support.getElementsByTagName = assert(function( div ) {
|
1238 | div.appendChild( doc.createComment("") );
|
1239 | return !div.getElementsByTagName("*").length;
|
1240 | });
|
1241 |
|
1242 |
|
1243 |
|
1244 | support.attributes = assert(function( div ) {
|
1245 | div.className = "i";
|
1246 | return !div.getAttribute("className");
|
1247 | });
|
1248 |
|
1249 |
|
1250 | support.getElementsByClassName = assert(function( div ) {
|
1251 | div.innerHTML = "<div class='a'></div><div class='a i'></div>";
|
1252 |
|
1253 |
|
1254 |
|
1255 | div.firstChild.className = "i";
|
1256 |
|
1257 |
|
1258 | return div.getElementsByClassName("i").length === 2;
|
1259 | });
|
1260 |
|
1261 |
|
1262 |
|
1263 | support.sortDetached = assert(function( div1 ) {
|
1264 |
|
1265 | return div1.compareDocumentPosition( document.createElement("div") ) & 1;
|
1266 | });
|
1267 |
|
1268 |
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 | support.getById = assert(function( div ) {
|
1276 | docElem.appendChild( div ).id = expando;
|
1277 | return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
|
1278 | });
|
1279 |
|
1280 |
|
1281 | if ( support.getById ) {
|
1282 | Expr.find["ID"] = function( id, context ) {
|
1283 | if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
|
1284 | var m = context.getElementById( id );
|
1285 |
|
1286 |
|
1287 | return m && m.parentNode ? [m] : [];
|
1288 | }
|
1289 | };
|
1290 | Expr.filter["ID"] = function( id ) {
|
1291 | var attrId = id.replace( runescape, funescape );
|
1292 | return function( elem ) {
|
1293 | return elem.getAttribute("id") === attrId;
|
1294 | };
|
1295 | };
|
1296 | } else {
|
1297 | Expr.find["ID"] = function( id, context ) {
|
1298 | if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
|
1299 | var m = context.getElementById( id );
|
1300 |
|
1301 | return m ?
|
1302 | m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
|
1303 | [m] :
|
1304 | undefined :
|
1305 | [];
|
1306 | }
|
1307 | };
|
1308 | Expr.filter["ID"] = function( id ) {
|
1309 | var attrId = id.replace( runescape, funescape );
|
1310 | return function( elem ) {
|
1311 | var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
|
1312 | return node && node.value === attrId;
|
1313 | };
|
1314 | };
|
1315 | }
|
1316 |
|
1317 |
|
1318 | Expr.find["TAG"] = support.getElementsByTagName ?
|
1319 | function( tag, context ) {
|
1320 | if ( typeof context.getElementsByTagName !== strundefined ) {
|
1321 | return context.getElementsByTagName( tag );
|
1322 | }
|
1323 | } :
|
1324 | function( tag, context ) {
|
1325 | var elem,
|
1326 | tmp = [],
|
1327 | i = 0,
|
1328 | results = context.getElementsByTagName( tag );
|
1329 |
|
1330 |
|
1331 | if ( tag === "*" ) {
|
1332 | while ( (elem = results[i++]) ) {
|
1333 | if ( elem.nodeType === 1 ) {
|
1334 | tmp.push( elem );
|
1335 | }
|
1336 | }
|
1337 |
|
1338 | return tmp;
|
1339 | }
|
1340 | return results;
|
1341 | };
|
1342 |
|
1343 |
|
1344 | Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
|
1345 | if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
|
1346 | return context.getElementsByClassName( className );
|
1347 | }
|
1348 | };
|
1349 |
|
1350 |
|
1351 |
|
1352 |
|
1353 | rbuggyMatches = [];
|
1354 |
|
1355 |
|
1356 |
|
1357 |
|
1358 |
|
1359 |
|
1360 | rbuggyQSA = [];
|
1361 |
|
1362 | if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
|
1363 |
|
1364 |
|
1365 | assert(function( div ) {
|
1366 |
|
1367 |
|
1368 |
|
1369 |
|
1370 |
|
1371 | div.innerHTML = "<select><option selected=''></option></select>";
|
1372 |
|
1373 |
|
1374 |
|
1375 | if ( !div.querySelectorAll("[selected]").length ) {
|
1376 | rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
|
1377 | }
|
1378 |
|
1379 |
|
1380 |
|
1381 |
|
1382 | if ( !div.querySelectorAll(":checked").length ) {
|
1383 | rbuggyQSA.push(":checked");
|
1384 | }
|
1385 | });
|
1386 |
|
1387 | assert(function( div ) {
|
1388 |
|
1389 |
|
1390 |
|
1391 |
|
1392 |
|
1393 |
|
1394 | var input = document.createElement("input");
|
1395 | input.setAttribute( "type", "hidden" );
|
1396 | div.appendChild( input ).setAttribute( "t", "" );
|
1397 |
|
1398 | if ( div.querySelectorAll("[t^='']").length ) {
|
1399 | rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
|
1400 | }
|
1401 |
|
1402 |
|
1403 |
|
1404 | if ( !div.querySelectorAll(":enabled").length ) {
|
1405 | rbuggyQSA.push( ":enabled", ":disabled" );
|
1406 | }
|
1407 |
|
1408 |
|
1409 | div.querySelectorAll("*,:x");
|
1410 | rbuggyQSA.push(",.*:");
|
1411 | });
|
1412 | }
|
1413 |
|
1414 | if ( (support.matchesSelector = isNative( (matches = docElem.webkitMatchesSelector ||
|
1415 | docElem.mozMatchesSelector ||
|
1416 | docElem.oMatchesSelector ||
|
1417 | docElem.msMatchesSelector) )) ) {
|
1418 |
|
1419 | assert(function( div ) {
|
1420 |
|
1421 |
|
1422 | support.disconnectedMatch = matches.call( div, "div" );
|
1423 |
|
1424 |
|
1425 |
|
1426 | matches.call( div, "[s!='']:x" );
|
1427 | rbuggyMatches.push( "!=", pseudos );
|
1428 | });
|
1429 | }
|
1430 |
|
1431 | rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
|
1432 | rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
|
1433 |
|
1434 |
|
1435 |
|
1436 |
|
1437 | contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
|
1438 | function( a, b ) {
|
1439 | var adown = a.nodeType === 9 ? a.documentElement : a,
|
1440 | bup = b && b.parentNode;
|
1441 | return a === bup || !!( bup && bup.nodeType === 1 && (
|
1442 | adown.contains ?
|
1443 | adown.contains( bup ) :
|
1444 | a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
|
1445 | ));
|
1446 | } :
|
1447 | function( a, b ) {
|
1448 | if ( b ) {
|
1449 | while ( (b = b.parentNode) ) {
|
1450 | if ( b === a ) {
|
1451 | return true;
|
1452 | }
|
1453 | }
|
1454 | }
|
1455 | return false;
|
1456 | };
|
1457 |
|
1458 |
|
1459 | sortOrder = docElem.compareDocumentPosition ?
|
1460 | function( a, b ) {
|
1461 |
|
1462 |
|
1463 | if ( a === b ) {
|
1464 | hasDuplicate = true;
|
1465 | return 0;
|
1466 | }
|
1467 |
|
1468 | var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
|
1469 |
|
1470 | if ( compare ) {
|
1471 |
|
1472 | if ( compare & 1 ||
|
1473 | (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
|
1474 |
|
1475 |
|
1476 | if ( a === doc || contains(preferredDoc, a) ) {
|
1477 | return -1;
|
1478 | }
|
1479 | if ( b === doc || contains(preferredDoc, b) ) {
|
1480 | return 1;
|
1481 | }
|
1482 |
|
1483 |
|
1484 | return sortInput ?
|
1485 | ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
|
1486 | 0;
|
1487 | }
|
1488 |
|
1489 | return compare & 4 ? -1 : 1;
|
1490 | }
|
1491 |
|
1492 |
|
1493 | return a.compareDocumentPosition ? -1 : 1;
|
1494 | } :
|
1495 | function( a, b ) {
|
1496 | var cur,
|
1497 | i = 0,
|
1498 | aup = a.parentNode,
|
1499 | bup = b.parentNode,
|
1500 | ap = [ a ],
|
1501 | bp = [ b ];
|
1502 |
|
1503 |
|
1504 | if ( a === b ) {
|
1505 | hasDuplicate = true;
|
1506 | return 0;
|
1507 |
|
1508 |
|
1509 | } else if ( !aup || !bup ) {
|
1510 | return a === doc ? -1 :
|
1511 | b === doc ? 1 :
|
1512 | aup ? -1 :
|
1513 | bup ? 1 :
|
1514 | sortInput ?
|
1515 | ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
|
1516 | 0;
|
1517 |
|
1518 |
|
1519 | } else if ( aup === bup ) {
|
1520 | return siblingCheck( a, b );
|
1521 | }
|
1522 |
|
1523 |
|
1524 | cur = a;
|
1525 | while ( (cur = cur.parentNode) ) {
|
1526 | ap.unshift( cur );
|
1527 | }
|
1528 | cur = b;
|
1529 | while ( (cur = cur.parentNode) ) {
|
1530 | bp.unshift( cur );
|
1531 | }
|
1532 |
|
1533 |
|
1534 | while ( ap[i] === bp[i] ) {
|
1535 | i++;
|
1536 | }
|
1537 |
|
1538 | return i ?
|
1539 |
|
1540 | siblingCheck( ap[i], bp[i] ) :
|
1541 |
|
1542 |
|
1543 | ap[i] === preferredDoc ? -1 :
|
1544 | bp[i] === preferredDoc ? 1 :
|
1545 | 0;
|
1546 | };
|
1547 |
|
1548 | return document;
|
1549 | };
|
1550 |
|
1551 | Sizzle.matches = function( expr, elements ) {
|
1552 | return Sizzle( expr, null, null, elements );
|
1553 | };
|
1554 |
|
1555 | Sizzle.matchesSelector = function( elem, expr ) {
|
1556 |
|
1557 | if ( ( elem.ownerDocument || elem ) !== document ) {
|
1558 | setDocument( elem );
|
1559 | }
|
1560 |
|
1561 |
|
1562 | expr = expr.replace( rattributeQuotes, "='$1']" );
|
1563 |
|
1564 |
|
1565 | if ( support.matchesSelector && documentIsHTML &&
|
1566 | (!rbuggyMatches || !rbuggyMatches.test(expr)) &&
|
1567 | (!rbuggyQSA || !rbuggyQSA.test(expr)) ) {
|
1568 |
|
1569 | try {
|
1570 | var ret = matches.call( elem, expr );
|
1571 |
|
1572 |
|
1573 | if ( ret || support.disconnectedMatch ||
|
1574 |
|
1575 |
|
1576 | elem.document && elem.document.nodeType !== 11 ) {
|
1577 | return ret;
|
1578 | }
|
1579 | } catch(e) {}
|
1580 | }
|
1581 |
|
1582 | return Sizzle( expr, document, null, [elem] ).length > 0;
|
1583 | };
|
1584 |
|
1585 | Sizzle.contains = function( context, elem ) {
|
1586 |
|
1587 | if ( ( context.ownerDocument || context ) !== document ) {
|
1588 | setDocument( context );
|
1589 | }
|
1590 | return contains( context, elem );
|
1591 | };
|
1592 |
|
1593 | Sizzle.attr = function( elem, name ) {
|
1594 |
|
1595 | if ( ( elem.ownerDocument || elem ) !== document ) {
|
1596 | setDocument( elem );
|
1597 | }
|
1598 |
|
1599 | var fn = Expr.attrHandle[ name.toLowerCase() ],
|
1600 | val = fn && fn( elem, name, !documentIsHTML );
|
1601 |
|
1602 | return val === undefined ?
|
1603 | support.attributes || !documentIsHTML ?
|
1604 | elem.getAttribute( name ) :
|
1605 | (val = elem.getAttributeNode(name)) && val.specified ?
|
1606 | val.value :
|
1607 | null :
|
1608 | val;
|
1609 | };
|
1610 |
|
1611 | Sizzle.error = function( msg ) {
|
1612 | throw new Error( "Syntax error, unrecognized expression: " + msg );
|
1613 | };
|
1614 |
|
1615 |
|
1616 | Sizzle.uniqueSort = function( results ) {
|
1617 | var elem,
|
1618 | duplicates = [],
|
1619 | j = 0,
|
1620 | i = 0;
|
1621 |
|
1622 |
|
1623 | hasDuplicate = !support.detectDuplicates;
|
1624 | sortInput = !support.sortStable && results.slice( 0 );
|
1625 | results.sort( sortOrder );
|
1626 |
|
1627 | if ( hasDuplicate ) {
|
1628 | while ( (elem = results[i++]) ) {
|
1629 | if ( elem === results[ i ] ) {
|
1630 | j = duplicates.push( i );
|
1631 | }
|
1632 | }
|
1633 | while ( j-- ) {
|
1634 | results.splice( duplicates[ j ], 1 );
|
1635 | }
|
1636 | }
|
1637 |
|
1638 | return results;
|
1639 | };
|
1640 |
|
1641 |
|
1642 |
|
1643 |
|
1644 |
|
1645 |
|
1646 |
|
1647 | function siblingCheck( a, b ) {
|
1648 | var cur = b && a,
|
1649 | diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
|
1650 |
|
1651 |
|
1652 | if ( diff ) {
|
1653 | return diff;
|
1654 | }
|
1655 |
|
1656 |
|
1657 | if ( cur ) {
|
1658 | while ( (cur = cur.nextSibling) ) {
|
1659 | if ( cur === b ) {
|
1660 | return -1;
|
1661 | }
|
1662 | }
|
1663 | }
|
1664 |
|
1665 | return a ? 1 : -1;
|
1666 | }
|
1667 |
|
1668 |
|
1669 | function boolHandler( elem, name, isXML ) {
|
1670 | var val;
|
1671 | return isXML ?
|
1672 | undefined :
|
1673 | (val = elem.getAttributeNode( name )) && val.specified ?
|
1674 | val.value :
|
1675 | elem[ name ] === true ? name.toLowerCase() : null;
|
1676 | }
|
1677 |
|
1678 |
|
1679 |
|
1680 | function interpolationHandler( elem, name, isXML ) {
|
1681 | var val;
|
1682 | return isXML ?
|
1683 | undefined :
|
1684 | (val = elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ));
|
1685 | }
|
1686 |
|
1687 |
|
1688 | function createInputPseudo( type ) {
|
1689 | return function( elem ) {
|
1690 | var name = elem.nodeName.toLowerCase();
|
1691 | return name === "input" && elem.type === type;
|
1692 | };
|
1693 | }
|
1694 |
|
1695 |
|
1696 | function createButtonPseudo( type ) {
|
1697 | return function( elem ) {
|
1698 | var name = elem.nodeName.toLowerCase();
|
1699 | return (name === "input" || name === "button") && elem.type === type;
|
1700 | };
|
1701 | }
|
1702 |
|
1703 |
|
1704 | function createPositionalPseudo( fn ) {
|
1705 | return markFunction(function( argument ) {
|
1706 | argument = +argument;
|
1707 | return markFunction(function( seed, matches ) {
|
1708 | var j,
|
1709 | matchIndexes = fn( [], seed.length, argument ),
|
1710 | i = matchIndexes.length;
|
1711 |
|
1712 |
|
1713 | while ( i-- ) {
|
1714 | if ( seed[ (j = matchIndexes[i]) ] ) {
|
1715 | seed[j] = !(matches[j] = seed[j]);
|
1716 | }
|
1717 | }
|
1718 | });
|
1719 | });
|
1720 | }
|
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 |
|
1726 | getText = Sizzle.getText = function( elem ) {
|
1727 | var node,
|
1728 | ret = "",
|
1729 | i = 0,
|
1730 | nodeType = elem.nodeType;
|
1731 |
|
1732 | if ( !nodeType ) {
|
1733 |
|
1734 | for ( ; (node = elem[i]); i++ ) {
|
1735 |
|
1736 | ret += getText( node );
|
1737 | }
|
1738 | } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
|
1739 |
|
1740 |
|
1741 | if ( typeof elem.textContent === "string" ) {
|
1742 | return elem.textContent;
|
1743 | } else {
|
1744 |
|
1745 | for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
|
1746 | ret += getText( elem );
|
1747 | }
|
1748 | }
|
1749 | } else if ( nodeType === 3 || nodeType === 4 ) {
|
1750 | return elem.nodeValue;
|
1751 | }
|
1752 |
|
1753 |
|
1754 | return ret;
|
1755 | };
|
1756 |
|
1757 | Expr = Sizzle.selectors = {
|
1758 |
|
1759 |
|
1760 | cacheLength: 50,
|
1761 |
|
1762 | createPseudo: markFunction,
|
1763 |
|
1764 | match: matchExpr,
|
1765 |
|
1766 | attrHandle: {},
|
1767 |
|
1768 | find: {},
|
1769 |
|
1770 | relative: {
|
1771 | ">": { dir: "parentNode", first: true },
|
1772 | " ": { dir: "parentNode" },
|
1773 | "+": { dir: "previousSibling", first: true },
|
1774 | "~": { dir: "previousSibling" }
|
1775 | },
|
1776 |
|
1777 | preFilter: {
|
1778 | "ATTR": function( match ) {
|
1779 | match[1] = match[1].replace( runescape, funescape );
|
1780 |
|
1781 |
|
1782 | match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
|
1783 |
|
1784 | if ( match[2] === "~=" ) {
|
1785 | match[3] = " " + match[3] + " ";
|
1786 | }
|
1787 |
|
1788 | return match.slice( 0, 4 );
|
1789 | },
|
1790 |
|
1791 | "CHILD": function( match ) {
|
1792 | |
1793 |
|
1794 |
|
1795 |
|
1796 |
|
1797 |
|
1798 |
|
1799 |
|
1800 |
|
1801 |
|
1802 | match[1] = match[1].toLowerCase();
|
1803 |
|
1804 | if ( match[1].slice( 0, 3 ) === "nth" ) {
|
1805 |
|
1806 | if ( !match[3] ) {
|
1807 | Sizzle.error( match[0] );
|
1808 | }
|
1809 |
|
1810 |
|
1811 |
|
1812 | match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
|
1813 | match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
|
1814 |
|
1815 |
|
1816 | } else if ( match[3] ) {
|
1817 | Sizzle.error( match[0] );
|
1818 | }
|
1819 |
|
1820 | return match;
|
1821 | },
|
1822 |
|
1823 | "PSEUDO": function( match ) {
|
1824 | var excess,
|
1825 | unquoted = !match[5] && match[2];
|
1826 |
|
1827 | if ( matchExpr["CHILD"].test( match[0] ) ) {
|
1828 | return null;
|
1829 | }
|
1830 |
|
1831 |
|
1832 | if ( match[4] ) {
|
1833 | match[2] = match[4];
|
1834 |
|
1835 |
|
1836 | } else if ( unquoted && rpseudo.test( unquoted ) &&
|
1837 |
|
1838 | (excess = tokenize( unquoted, true )) &&
|
1839 |
|
1840 | (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
|
1841 |
|
1842 |
|
1843 | match[0] = match[0].slice( 0, excess );
|
1844 | match[2] = unquoted.slice( 0, excess );
|
1845 | }
|
1846 |
|
1847 |
|
1848 | return match.slice( 0, 3 );
|
1849 | }
|
1850 | },
|
1851 |
|
1852 | filter: {
|
1853 |
|
1854 | "TAG": function( nodeNameSelector ) {
|
1855 | var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
|
1856 | return nodeNameSelector === "*" ?
|
1857 | function() { return true; } :
|
1858 | function( elem ) {
|
1859 | return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
|
1860 | };
|
1861 | },
|
1862 |
|
1863 | "CLASS": function( className ) {
|
1864 | var pattern = classCache[ className + " " ];
|
1865 |
|
1866 | return pattern ||
|
1867 | (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
|
1868 | classCache( className, function( elem ) {
|
1869 | return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
|
1870 | });
|
1871 | },
|
1872 |
|
1873 | "ATTR": function( name, operator, check ) {
|
1874 | return function( elem ) {
|
1875 | var result = Sizzle.attr( elem, name );
|
1876 |
|
1877 | if ( result == null ) {
|
1878 | return operator === "!=";
|
1879 | }
|
1880 | if ( !operator ) {
|
1881 | return true;
|
1882 | }
|
1883 |
|
1884 | result += "";
|
1885 |
|
1886 | return operator === "=" ? result === check :
|
1887 | operator === "!=" ? result !== check :
|
1888 | operator === "^=" ? check && result.indexOf( check ) === 0 :
|
1889 | operator === "*=" ? check && result.indexOf( check ) > -1 :
|
1890 | operator === "$=" ? check && result.slice( -check.length ) === check :
|
1891 | operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
|
1892 | operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
|
1893 | false;
|
1894 | };
|
1895 | },
|
1896 |
|
1897 | "CHILD": function( type, what, argument, first, last ) {
|
1898 | var simple = type.slice( 0, 3 ) !== "nth",
|
1899 | forward = type.slice( -4 ) !== "last",
|
1900 | ofType = what === "of-type";
|
1901 |
|
1902 | return first === 1 && last === 0 ?
|
1903 |
|
1904 |
|
1905 | function( elem ) {
|
1906 | return !!elem.parentNode;
|
1907 | } :
|
1908 |
|
1909 | function( elem, context, xml ) {
|
1910 | var cache, outerCache, node, diff, nodeIndex, start,
|
1911 | dir = simple !== forward ? "nextSibling" : "previousSibling",
|
1912 | parent = elem.parentNode,
|
1913 | name = ofType && elem.nodeName.toLowerCase(),
|
1914 | useCache = !xml && !ofType;
|
1915 |
|
1916 | if ( parent ) {
|
1917 |
|
1918 |
|
1919 | if ( simple ) {
|
1920 | while ( dir ) {
|
1921 | node = elem;
|
1922 | while ( (node = node[ dir ]) ) {
|
1923 | if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
|
1924 | return false;
|
1925 | }
|
1926 | }
|
1927 |
|
1928 | start = dir = type === "only" && !start && "nextSibling";
|
1929 | }
|
1930 | return true;
|
1931 | }
|
1932 |
|
1933 | start = [ forward ? parent.firstChild : parent.lastChild ];
|
1934 |
|
1935 |
|
1936 | if ( forward && useCache ) {
|
1937 |
|
1938 | outerCache = parent[ expando ] || (parent[ expando ] = {});
|
1939 | cache = outerCache[ type ] || [];
|
1940 | nodeIndex = cache[0] === dirruns && cache[1];
|
1941 | diff = cache[0] === dirruns && cache[2];
|
1942 | node = nodeIndex && parent.childNodes[ nodeIndex ];
|
1943 |
|
1944 | while ( (node = ++nodeIndex && node && node[ dir ] ||
|
1945 |
|
1946 |
|
1947 | (diff = nodeIndex = 0) || start.pop()) ) {
|
1948 |
|
1949 |
|
1950 | if ( node.nodeType === 1 && ++diff && node === elem ) {
|
1951 | outerCache[ type ] = [ dirruns, nodeIndex, diff ];
|
1952 | break;
|
1953 | }
|
1954 | }
|
1955 |
|
1956 |
|
1957 | } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
|
1958 | diff = cache[1];
|
1959 |
|
1960 |
|
1961 | } else {
|
1962 |
|
1963 | while ( (node = ++nodeIndex && node && node[ dir ] ||
|
1964 | (diff = nodeIndex = 0) || start.pop()) ) {
|
1965 |
|
1966 | if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
|
1967 |
|
1968 | if ( useCache ) {
|
1969 | (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
|
1970 | }
|
1971 |
|
1972 | if ( node === elem ) {
|
1973 | break;
|
1974 | }
|
1975 | }
|
1976 | }
|
1977 | }
|
1978 |
|
1979 |
|
1980 | diff -= last;
|
1981 | return diff === first || ( diff % first === 0 && diff / first >= 0 );
|
1982 | }
|
1983 | };
|
1984 | },
|
1985 |
|
1986 | "PSEUDO": function( pseudo, argument ) {
|
1987 |
|
1988 |
|
1989 |
|
1990 |
|
1991 | var args,
|
1992 | fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
|
1993 | Sizzle.error( "unsupported pseudo: " + pseudo );
|
1994 |
|
1995 |
|
1996 |
|
1997 |
|
1998 | if ( fn[ expando ] ) {
|
1999 | return fn( argument );
|
2000 | }
|
2001 |
|
2002 |
|
2003 | if ( fn.length > 1 ) {
|
2004 | args = [ pseudo, pseudo, "", argument ];
|
2005 | return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
|
2006 | markFunction(function( seed, matches ) {
|
2007 | var idx,
|
2008 | matched = fn( seed, argument ),
|
2009 | i = matched.length;
|
2010 | while ( i-- ) {
|
2011 | idx = indexOf.call( seed, matched[i] );
|
2012 | seed[ idx ] = !( matches[ idx ] = matched[i] );
|
2013 | }
|
2014 | }) :
|
2015 | function( elem ) {
|
2016 | return fn( elem, 0, args );
|
2017 | };
|
2018 | }
|
2019 |
|
2020 | return fn;
|
2021 | }
|
2022 | },
|
2023 |
|
2024 | pseudos: {
|
2025 |
|
2026 | "not": markFunction(function( selector ) {
|
2027 |
|
2028 |
|
2029 |
|
2030 | var input = [],
|
2031 | results = [],
|
2032 | matcher = compile( selector.replace( rtrim, "$1" ) );
|
2033 |
|
2034 | return matcher[ expando ] ?
|
2035 | markFunction(function( seed, matches, context, xml ) {
|
2036 | var elem,
|
2037 | unmatched = matcher( seed, null, xml, [] ),
|
2038 | i = seed.length;
|
2039 |
|
2040 |
|
2041 | while ( i-- ) {
|
2042 | if ( (elem = unmatched[i]) ) {
|
2043 | seed[i] = !(matches[i] = elem);
|
2044 | }
|
2045 | }
|
2046 | }) :
|
2047 | function( elem, context, xml ) {
|
2048 | input[0] = elem;
|
2049 | matcher( input, null, xml, results );
|
2050 | return !results.pop();
|
2051 | };
|
2052 | }),
|
2053 |
|
2054 | "has": markFunction(function( selector ) {
|
2055 | return function( elem ) {
|
2056 | return Sizzle( selector, elem ).length > 0;
|
2057 | };
|
2058 | }),
|
2059 |
|
2060 | "contains": markFunction(function( text ) {
|
2061 | return function( elem ) {
|
2062 | return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
|
2063 | };
|
2064 | }),
|
2065 |
|
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 |
|
2071 |
|
2072 |
|
2073 | "lang": markFunction( function( lang ) {
|
2074 |
|
2075 | if ( !ridentifier.test(lang || "") ) {
|
2076 | Sizzle.error( "unsupported lang: " + lang );
|
2077 | }
|
2078 | lang = lang.replace( runescape, funescape ).toLowerCase();
|
2079 | return function( elem ) {
|
2080 | var elemLang;
|
2081 | do {
|
2082 | if ( (elemLang = documentIsHTML ?
|
2083 | elem.lang :
|
2084 | elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
|
2085 |
|
2086 | elemLang = elemLang.toLowerCase();
|
2087 | return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
|
2088 | }
|
2089 | } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
|
2090 | return false;
|
2091 | };
|
2092 | }),
|
2093 |
|
2094 |
|
2095 | "target": function( elem ) {
|
2096 | var hash = window.location && window.location.hash;
|
2097 | return hash && hash.slice( 1 ) === elem.id;
|
2098 | },
|
2099 |
|
2100 | "root": function( elem ) {
|
2101 | return elem === docElem;
|
2102 | },
|
2103 |
|
2104 | "focus": function( elem ) {
|
2105 | return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
|
2106 | },
|
2107 |
|
2108 |
|
2109 | "enabled": function( elem ) {
|
2110 | return elem.disabled === false;
|
2111 | },
|
2112 |
|
2113 | "disabled": function( elem ) {
|
2114 | return elem.disabled === true;
|
2115 | },
|
2116 |
|
2117 | "checked": function( elem ) {
|
2118 |
|
2119 |
|
2120 | var nodeName = elem.nodeName.toLowerCase();
|
2121 | return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
|
2122 | },
|
2123 |
|
2124 | "selected": function( elem ) {
|
2125 |
|
2126 |
|
2127 | if ( elem.parentNode ) {
|
2128 | elem.parentNode.selectedIndex;
|
2129 | }
|
2130 |
|
2131 | return elem.selected === true;
|
2132 | },
|
2133 |
|
2134 |
|
2135 | "empty": function( elem ) {
|
2136 |
|
2137 |
|
2138 |
|
2139 |
|
2140 |
|
2141 | for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
|
2142 | if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
|
2143 | return false;
|
2144 | }
|
2145 | }
|
2146 | return true;
|
2147 | },
|
2148 |
|
2149 | "parent": function( elem ) {
|
2150 | return !Expr.pseudos["empty"]( elem );
|
2151 | },
|
2152 |
|
2153 |
|
2154 | "header": function( elem ) {
|
2155 | return rheader.test( elem.nodeName );
|
2156 | },
|
2157 |
|
2158 | "input": function( elem ) {
|
2159 | return rinputs.test( elem.nodeName );
|
2160 | },
|
2161 |
|
2162 | "button": function( elem ) {
|
2163 | var name = elem.nodeName.toLowerCase();
|
2164 | return name === "input" && elem.type === "button" || name === "button";
|
2165 | },
|
2166 |
|
2167 | "text": function( elem ) {
|
2168 | var attr;
|
2169 |
|
2170 |
|
2171 | return elem.nodeName.toLowerCase() === "input" &&
|
2172 | elem.type === "text" &&
|
2173 | ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
|
2174 | },
|
2175 |
|
2176 |
|
2177 | "first": createPositionalPseudo(function() {
|
2178 | return [ 0 ];
|
2179 | }),
|
2180 |
|
2181 | "last": createPositionalPseudo(function( matchIndexes, length ) {
|
2182 | return [ length - 1 ];
|
2183 | }),
|
2184 |
|
2185 | "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
|
2186 | return [ argument < 0 ? argument + length : argument ];
|
2187 | }),
|
2188 |
|
2189 | "even": createPositionalPseudo(function( matchIndexes, length ) {
|
2190 | var i = 0;
|
2191 | for ( ; i < length; i += 2 ) {
|
2192 | matchIndexes.push( i );
|
2193 | }
|
2194 | return matchIndexes;
|
2195 | }),
|
2196 |
|
2197 | "odd": createPositionalPseudo(function( matchIndexes, length ) {
|
2198 | var i = 1;
|
2199 | for ( ; i < length; i += 2 ) {
|
2200 | matchIndexes.push( i );
|
2201 | }
|
2202 | return matchIndexes;
|
2203 | }),
|
2204 |
|
2205 | "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
|
2206 | var i = argument < 0 ? argument + length : argument;
|
2207 | for ( ; --i >= 0; ) {
|
2208 | matchIndexes.push( i );
|
2209 | }
|
2210 | return matchIndexes;
|
2211 | }),
|
2212 |
|
2213 | "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
|
2214 | var i = argument < 0 ? argument + length : argument;
|
2215 | for ( ; ++i < length; ) {
|
2216 | matchIndexes.push( i );
|
2217 | }
|
2218 | return matchIndexes;
|
2219 | })
|
2220 | }
|
2221 | };
|
2222 |
|
2223 |
|
2224 | for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
|
2225 | Expr.pseudos[ i ] = createInputPseudo( i );
|
2226 | }
|
2227 | for ( i in { submit: true, reset: true } ) {
|
2228 | Expr.pseudos[ i ] = createButtonPseudo( i );
|
2229 | }
|
2230 |
|
2231 | function tokenize( selector, parseOnly ) {
|
2232 | var matched, match, tokens, type,
|
2233 | soFar, groups, preFilters,
|
2234 | cached = tokenCache[ selector + " " ];
|
2235 |
|
2236 | if ( cached ) {
|
2237 | return parseOnly ? 0 : cached.slice( 0 );
|
2238 | }
|
2239 |
|
2240 | soFar = selector;
|
2241 | groups = [];
|
2242 | preFilters = Expr.preFilter;
|
2243 |
|
2244 | while ( soFar ) {
|
2245 |
|
2246 |
|
2247 | if ( !matched || (match = rcomma.exec( soFar )) ) {
|
2248 | if ( match ) {
|
2249 |
|
2250 | soFar = soFar.slice( match[0].length ) || soFar;
|
2251 | }
|
2252 | groups.push( tokens = [] );
|
2253 | }
|
2254 |
|
2255 | matched = false;
|
2256 |
|
2257 |
|
2258 | if ( (match = rcombinators.exec( soFar )) ) {
|
2259 | matched = match.shift();
|
2260 | tokens.push( {
|
2261 | value: matched,
|
2262 |
|
2263 | type: match[0].replace( rtrim, " " )
|
2264 | } );
|
2265 | soFar = soFar.slice( matched.length );
|
2266 | }
|
2267 |
|
2268 |
|
2269 | for ( type in Expr.filter ) {
|
2270 | if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
|
2271 | (match = preFilters[ type ]( match ))) ) {
|
2272 | matched = match.shift();
|
2273 | tokens.push( {
|
2274 | value: matched,
|
2275 | type: type,
|
2276 | matches: match
|
2277 | } );
|
2278 | soFar = soFar.slice( matched.length );
|
2279 | }
|
2280 | }
|
2281 |
|
2282 | if ( !matched ) {
|
2283 | break;
|
2284 | }
|
2285 | }
|
2286 |
|
2287 |
|
2288 |
|
2289 |
|
2290 | return parseOnly ?
|
2291 | soFar.length :
|
2292 | soFar ?
|
2293 | Sizzle.error( selector ) :
|
2294 |
|
2295 | tokenCache( selector, groups ).slice( 0 );
|
2296 | }
|
2297 |
|
2298 | function toSelector( tokens ) {
|
2299 | var i = 0,
|
2300 | len = tokens.length,
|
2301 | selector = "";
|
2302 | for ( ; i < len; i++ ) {
|
2303 | selector += tokens[i].value;
|
2304 | }
|
2305 | return selector;
|
2306 | }
|
2307 |
|
2308 | function addCombinator( matcher, combinator, base ) {
|
2309 | var dir = combinator.dir,
|
2310 | checkNonElements = base && dir === "parentNode",
|
2311 | doneName = done++;
|
2312 |
|
2313 | return combinator.first ?
|
2314 |
|
2315 | function( elem, context, xml ) {
|
2316 | while ( (elem = elem[ dir ]) ) {
|
2317 | if ( elem.nodeType === 1 || checkNonElements ) {
|
2318 | return matcher( elem, context, xml );
|
2319 | }
|
2320 | }
|
2321 | } :
|
2322 |
|
2323 |
|
2324 | function( elem, context, xml ) {
|
2325 | var data, cache, outerCache,
|
2326 | dirkey = dirruns + " " + doneName;
|
2327 |
|
2328 |
|
2329 | if ( xml ) {
|
2330 | while ( (elem = elem[ dir ]) ) {
|
2331 | if ( elem.nodeType === 1 || checkNonElements ) {
|
2332 | if ( matcher( elem, context, xml ) ) {
|
2333 | return true;
|
2334 | }
|
2335 | }
|
2336 | }
|
2337 | } else {
|
2338 | while ( (elem = elem[ dir ]) ) {
|
2339 | if ( elem.nodeType === 1 || checkNonElements ) {
|
2340 | outerCache = elem[ expando ] || (elem[ expando ] = {});
|
2341 | if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
|
2342 | if ( (data = cache[1]) === true || data === cachedruns ) {
|
2343 | return data === true;
|
2344 | }
|
2345 | } else {
|
2346 | cache = outerCache[ dir ] = [ dirkey ];
|
2347 | cache[1] = matcher( elem, context, xml ) || cachedruns;
|
2348 | if ( cache[1] === true ) {
|
2349 | return true;
|
2350 | }
|
2351 | }
|
2352 | }
|
2353 | }
|
2354 | }
|
2355 | };
|
2356 | }
|
2357 |
|
2358 | function elementMatcher( matchers ) {
|
2359 | return matchers.length > 1 ?
|
2360 | function( elem, context, xml ) {
|
2361 | var i = matchers.length;
|
2362 | while ( i-- ) {
|
2363 | if ( !matchers[i]( elem, context, xml ) ) {
|
2364 | return false;
|
2365 | }
|
2366 | }
|
2367 | return true;
|
2368 | } :
|
2369 | matchers[0];
|
2370 | }
|
2371 |
|
2372 | function condense( unmatched, map, filter, context, xml ) {
|
2373 | var elem,
|
2374 | newUnmatched = [],
|
2375 | i = 0,
|
2376 | len = unmatched.length,
|
2377 | mapped = map != null;
|
2378 |
|
2379 | for ( ; i < len; i++ ) {
|
2380 | if ( (elem = unmatched[i]) ) {
|
2381 | if ( !filter || filter( elem, context, xml ) ) {
|
2382 | newUnmatched.push( elem );
|
2383 | if ( mapped ) {
|
2384 | map.push( i );
|
2385 | }
|
2386 | }
|
2387 | }
|
2388 | }
|
2389 |
|
2390 | return newUnmatched;
|
2391 | }
|
2392 |
|
2393 | function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
|
2394 | if ( postFilter && !postFilter[ expando ] ) {
|
2395 | postFilter = setMatcher( postFilter );
|
2396 | }
|
2397 | if ( postFinder && !postFinder[ expando ] ) {
|
2398 | postFinder = setMatcher( postFinder, postSelector );
|
2399 | }
|
2400 | return markFunction(function( seed, results, context, xml ) {
|
2401 | var temp, i, elem,
|
2402 | preMap = [],
|
2403 | postMap = [],
|
2404 | preexisting = results.length,
|
2405 |
|
2406 |
|
2407 | elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
|
2408 |
|
2409 |
|
2410 | matcherIn = preFilter && ( seed || !selector ) ?
|
2411 | condense( elems, preMap, preFilter, context, xml ) :
|
2412 | elems,
|
2413 |
|
2414 | matcherOut = matcher ?
|
2415 |
|
2416 | postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
|
2417 |
|
2418 |
|
2419 | [] :
|
2420 |
|
2421 |
|
2422 | results :
|
2423 | matcherIn;
|
2424 |
|
2425 |
|
2426 | if ( matcher ) {
|
2427 | matcher( matcherIn, matcherOut, context, xml );
|
2428 | }
|
2429 |
|
2430 |
|
2431 | if ( postFilter ) {
|
2432 | temp = condense( matcherOut, postMap );
|
2433 | postFilter( temp, [], context, xml );
|
2434 |
|
2435 |
|
2436 | i = temp.length;
|
2437 | while ( i-- ) {
|
2438 | if ( (elem = temp[i]) ) {
|
2439 | matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
|
2440 | }
|
2441 | }
|
2442 | }
|
2443 |
|
2444 | if ( seed ) {
|
2445 | if ( postFinder || preFilter ) {
|
2446 | if ( postFinder ) {
|
2447 |
|
2448 | temp = [];
|
2449 | i = matcherOut.length;
|
2450 | while ( i-- ) {
|
2451 | if ( (elem = matcherOut[i]) ) {
|
2452 |
|
2453 | temp.push( (matcherIn[i] = elem) );
|
2454 | }
|
2455 | }
|
2456 | postFinder( null, (matcherOut = []), temp, xml );
|
2457 | }
|
2458 |
|
2459 |
|
2460 | i = matcherOut.length;
|
2461 | while ( i-- ) {
|
2462 | if ( (elem = matcherOut[i]) &&
|
2463 | (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
|
2464 |
|
2465 | seed[temp] = !(results[temp] = elem);
|
2466 | }
|
2467 | }
|
2468 | }
|
2469 |
|
2470 |
|
2471 | } else {
|
2472 | matcherOut = condense(
|
2473 | matcherOut === results ?
|
2474 | matcherOut.splice( preexisting, matcherOut.length ) :
|
2475 | matcherOut
|
2476 | );
|
2477 | if ( postFinder ) {
|
2478 | postFinder( null, results, matcherOut, xml );
|
2479 | } else {
|
2480 | push.apply( results, matcherOut );
|
2481 | }
|
2482 | }
|
2483 | });
|
2484 | }
|
2485 |
|
2486 | function matcherFromTokens( tokens ) {
|
2487 | var checkContext, matcher, j,
|
2488 | len = tokens.length,
|
2489 | leadingRelative = Expr.relative[ tokens[0].type ],
|
2490 | implicitRelative = leadingRelative || Expr.relative[" "],
|
2491 | i = leadingRelative ? 1 : 0,
|
2492 |
|
2493 |
|
2494 | matchContext = addCombinator( function( elem ) {
|
2495 | return elem === checkContext;
|
2496 | }, implicitRelative, true ),
|
2497 | matchAnyContext = addCombinator( function( elem ) {
|
2498 | return indexOf.call( checkContext, elem ) > -1;
|
2499 | }, implicitRelative, true ),
|
2500 | matchers = [ function( elem, context, xml ) {
|
2501 | return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
|
2502 | (checkContext = context).nodeType ?
|
2503 | matchContext( elem, context, xml ) :
|
2504 | matchAnyContext( elem, context, xml ) );
|
2505 | } ];
|
2506 |
|
2507 | for ( ; i < len; i++ ) {
|
2508 | if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
|
2509 | matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
|
2510 | } else {
|
2511 | matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
|
2512 |
|
2513 |
|
2514 | if ( matcher[ expando ] ) {
|
2515 |
|
2516 | j = ++i;
|
2517 | for ( ; j < len; j++ ) {
|
2518 | if ( Expr.relative[ tokens[j].type ] ) {
|
2519 | break;
|
2520 | }
|
2521 | }
|
2522 | return setMatcher(
|
2523 | i > 1 && elementMatcher( matchers ),
|
2524 | i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
|
2525 | matcher,
|
2526 | i < j && matcherFromTokens( tokens.slice( i, j ) ),
|
2527 | j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
|
2528 | j < len && toSelector( tokens )
|
2529 | );
|
2530 | }
|
2531 | matchers.push( matcher );
|
2532 | }
|
2533 | }
|
2534 |
|
2535 | return elementMatcher( matchers );
|
2536 | }
|
2537 |
|
2538 | function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
2539 |
|
2540 | var matcherCachedRuns = 0,
|
2541 | bySet = setMatchers.length > 0,
|
2542 | byElement = elementMatchers.length > 0,
|
2543 | superMatcher = function( seed, context, xml, results, expandContext ) {
|
2544 | var elem, j, matcher,
|
2545 | setMatched = [],
|
2546 | matchedCount = 0,
|
2547 | i = "0",
|
2548 | unmatched = seed && [],
|
2549 | outermost = expandContext != null,
|
2550 | contextBackup = outermostContext,
|
2551 |
|
2552 | elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
|
2553 |
|
2554 | dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
|
2555 |
|
2556 | if ( outermost ) {
|
2557 | outermostContext = context !== document && context;
|
2558 | cachedruns = matcherCachedRuns;
|
2559 | }
|
2560 |
|
2561 |
|
2562 |
|
2563 | for ( ; (elem = elems[i]) != null; i++ ) {
|
2564 | if ( byElement && elem ) {
|
2565 | j = 0;
|
2566 | while ( (matcher = elementMatchers[j++]) ) {
|
2567 | if ( matcher( elem, context, xml ) ) {
|
2568 | results.push( elem );
|
2569 | break;
|
2570 | }
|
2571 | }
|
2572 | if ( outermost ) {
|
2573 | dirruns = dirrunsUnique;
|
2574 | cachedruns = ++matcherCachedRuns;
|
2575 | }
|
2576 | }
|
2577 |
|
2578 |
|
2579 | if ( bySet ) {
|
2580 |
|
2581 | if ( (elem = !matcher && elem) ) {
|
2582 | matchedCount--;
|
2583 | }
|
2584 |
|
2585 |
|
2586 | if ( seed ) {
|
2587 | unmatched.push( elem );
|
2588 | }
|
2589 | }
|
2590 | }
|
2591 |
|
2592 |
|
2593 | matchedCount += i;
|
2594 | if ( bySet && i !== matchedCount ) {
|
2595 | j = 0;
|
2596 | while ( (matcher = setMatchers[j++]) ) {
|
2597 | matcher( unmatched, setMatched, context, xml );
|
2598 | }
|
2599 |
|
2600 | if ( seed ) {
|
2601 |
|
2602 | if ( matchedCount > 0 ) {
|
2603 | while ( i-- ) {
|
2604 | if ( !(unmatched[i] || setMatched[i]) ) {
|
2605 | setMatched[i] = pop.call( results );
|
2606 | }
|
2607 | }
|
2608 | }
|
2609 |
|
2610 |
|
2611 | setMatched = condense( setMatched );
|
2612 | }
|
2613 |
|
2614 |
|
2615 | push.apply( results, setMatched );
|
2616 |
|
2617 |
|
2618 | if ( outermost && !seed && setMatched.length > 0 &&
|
2619 | ( matchedCount + setMatchers.length ) > 1 ) {
|
2620 |
|
2621 | Sizzle.uniqueSort( results );
|
2622 | }
|
2623 | }
|
2624 |
|
2625 |
|
2626 | if ( outermost ) {
|
2627 | dirruns = dirrunsUnique;
|
2628 | outermostContext = contextBackup;
|
2629 | }
|
2630 |
|
2631 | return unmatched;
|
2632 | };
|
2633 |
|
2634 | return bySet ?
|
2635 | markFunction( superMatcher ) :
|
2636 | superMatcher;
|
2637 | }
|
2638 |
|
2639 | compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
|
2640 | var i,
|
2641 | setMatchers = [],
|
2642 | elementMatchers = [],
|
2643 | cached = compilerCache[ selector + " " ];
|
2644 |
|
2645 | if ( !cached ) {
|
2646 |
|
2647 | if ( !group ) {
|
2648 | group = tokenize( selector );
|
2649 | }
|
2650 | i = group.length;
|
2651 | while ( i-- ) {
|
2652 | cached = matcherFromTokens( group[i] );
|
2653 | if ( cached[ expando ] ) {
|
2654 | setMatchers.push( cached );
|
2655 | } else {
|
2656 | elementMatchers.push( cached );
|
2657 | }
|
2658 | }
|
2659 |
|
2660 |
|
2661 | cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
|
2662 | }
|
2663 | return cached;
|
2664 | };
|
2665 |
|
2666 | function multipleContexts( selector, contexts, results ) {
|
2667 | var i = 0,
|
2668 | len = contexts.length;
|
2669 | for ( ; i < len; i++ ) {
|
2670 | Sizzle( selector, contexts[i], results );
|
2671 | }
|
2672 | return results;
|
2673 | }
|
2674 |
|
2675 | function select( selector, context, results, seed ) {
|
2676 | var i, tokens, token, type, find,
|
2677 | match = tokenize( selector );
|
2678 |
|
2679 | if ( !seed ) {
|
2680 |
|
2681 | if ( match.length === 1 ) {
|
2682 |
|
2683 |
|
2684 | tokens = match[0] = match[0].slice( 0 );
|
2685 | if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
|
2686 | context.nodeType === 9 && documentIsHTML &&
|
2687 | Expr.relative[ tokens[1].type ] ) {
|
2688 |
|
2689 | context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
|
2690 | if ( !context ) {
|
2691 | return results;
|
2692 | }
|
2693 |
|
2694 | selector = selector.slice( tokens.shift().value.length );
|
2695 | }
|
2696 |
|
2697 |
|
2698 | i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
|
2699 | while ( i-- ) {
|
2700 | token = tokens[i];
|
2701 |
|
2702 |
|
2703 | if ( Expr.relative[ (type = token.type) ] ) {
|
2704 | break;
|
2705 | }
|
2706 | if ( (find = Expr.find[ type ]) ) {
|
2707 |
|
2708 | if ( (seed = find(
|
2709 | token.matches[0].replace( runescape, funescape ),
|
2710 | rsibling.test( tokens[0].type ) && context.parentNode || context
|
2711 | )) ) {
|
2712 |
|
2713 |
|
2714 | tokens.splice( i, 1 );
|
2715 | selector = seed.length && toSelector( tokens );
|
2716 | if ( !selector ) {
|
2717 | push.apply( results, seed );
|
2718 | return results;
|
2719 | }
|
2720 |
|
2721 | break;
|
2722 | }
|
2723 | }
|
2724 | }
|
2725 | }
|
2726 | }
|
2727 |
|
2728 |
|
2729 |
|
2730 | compile( selector, match )(
|
2731 | seed,
|
2732 | context,
|
2733 | !documentIsHTML,
|
2734 | results,
|
2735 | rsibling.test( selector )
|
2736 | );
|
2737 | return results;
|
2738 | }
|
2739 |
|
2740 |
|
2741 | Expr.pseudos["nth"] = Expr.pseudos["eq"];
|
2742 |
|
2743 |
|
2744 | function setFilters() {}
|
2745 | setFilters.prototype = Expr.filters = Expr.pseudos;
|
2746 | Expr.setFilters = new setFilters();
|
2747 |
|
2748 |
|
2749 |
|
2750 |
|
2751 | support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
|
2752 |
|
2753 |
|
2754 | setDocument();
|
2755 |
|
2756 |
|
2757 |
|
2758 | [0, 0].sort( sortOrder );
|
2759 | support.detectDuplicates = hasDuplicate;
|
2760 |
|
2761 |
|
2762 |
|
2763 | assert(function( div ) {
|
2764 | div.innerHTML = "<a href='#'></a>";
|
2765 | if ( div.firstChild.getAttribute("href") !== "#" ) {
|
2766 | var attrs = "type|href|height|width".split("|"),
|
2767 | i = attrs.length;
|
2768 | while ( i-- ) {
|
2769 | Expr.attrHandle[ attrs[i] ] = interpolationHandler;
|
2770 | }
|
2771 | }
|
2772 | });
|
2773 |
|
2774 |
|
2775 |
|
2776 | assert(function( div ) {
|
2777 | if ( div.getAttribute("disabled") != null ) {
|
2778 | var attrs = booleans.split("|"),
|
2779 | i = attrs.length;
|
2780 | while ( i-- ) {
|
2781 | Expr.attrHandle[ attrs[i] ] = boolHandler;
|
2782 | }
|
2783 | }
|
2784 | });
|
2785 |
|
2786 | jQuery.find = Sizzle;
|
2787 | jQuery.expr = Sizzle.selectors;
|
2788 | jQuery.expr[":"] = jQuery.expr.pseudos;
|
2789 | jQuery.unique = Sizzle.uniqueSort;
|
2790 | jQuery.text = Sizzle.getText;
|
2791 | jQuery.isXMLDoc = Sizzle.isXML;
|
2792 | jQuery.contains = Sizzle.contains;
|
2793 |
|
2794 |
|
2795 | })( window );
|
2796 |
|
2797 | var optionsCache = {};
|
2798 |
|
2799 |
|
2800 | function createOptions( options ) {
|
2801 | var object = optionsCache[ options ] = {};
|
2802 | jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
|
2803 | object[ flag ] = true;
|
2804 | });
|
2805 | return object;
|
2806 | }
|
2807 |
|
2808 |
|
2809 |
|
2810 |
|
2811 |
|
2812 |
|
2813 |
|
2814 |
|
2815 |
|
2816 |
|
2817 |
|
2818 |
|
2819 |
|
2820 |
|
2821 |
|
2822 |
|
2823 |
|
2824 |
|
2825 |
|
2826 |
|
2827 |
|
2828 |
|
2829 |
|
2830 | jQuery.Callbacks = function( options ) {
|
2831 |
|
2832 |
|
2833 |
|
2834 | options = typeof options === "string" ?
|
2835 | ( optionsCache[ options ] || createOptions( options ) ) :
|
2836 | jQuery.extend( {}, options );
|
2837 |
|
2838 | var
|
2839 | memory,
|
2840 |
|
2841 | fired,
|
2842 |
|
2843 | firing,
|
2844 |
|
2845 | firingStart,
|
2846 |
|
2847 | firingLength,
|
2848 |
|
2849 | firingIndex,
|
2850 |
|
2851 | list = [],
|
2852 |
|
2853 | stack = !options.once && [],
|
2854 |
|
2855 | fire = function( data ) {
|
2856 | memory = options.memory && data;
|
2857 | fired = true;
|
2858 | firingIndex = firingStart || 0;
|
2859 | firingStart = 0;
|
2860 | firingLength = list.length;
|
2861 | firing = true;
|
2862 | for ( ; list && firingIndex < firingLength; firingIndex++ ) {
|
2863 | if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
|
2864 | memory = false;
|
2865 | break;
|
2866 | }
|
2867 | }
|
2868 | firing = false;
|
2869 | if ( list ) {
|
2870 | if ( stack ) {
|
2871 | if ( stack.length ) {
|
2872 | fire( stack.shift() );
|
2873 | }
|
2874 | } else if ( memory ) {
|
2875 | list = [];
|
2876 | } else {
|
2877 | self.disable();
|
2878 | }
|
2879 | }
|
2880 | },
|
2881 |
|
2882 | self = {
|
2883 |
|
2884 | add: function() {
|
2885 | if ( list ) {
|
2886 |
|
2887 | var start = list.length;
|
2888 | (function add( args ) {
|
2889 | jQuery.each( args, function( _, arg ) {
|
2890 | var type = jQuery.type( arg );
|
2891 | if ( type === "function" ) {
|
2892 | if ( !options.unique || !self.has( arg ) ) {
|
2893 | list.push( arg );
|
2894 | }
|
2895 | } else if ( arg && arg.length && type !== "string" ) {
|
2896 |
|
2897 | add( arg );
|
2898 | }
|
2899 | });
|
2900 | })( arguments );
|
2901 |
|
2902 |
|
2903 | if ( firing ) {
|
2904 | firingLength = list.length;
|
2905 |
|
2906 |
|
2907 | } else if ( memory ) {
|
2908 | firingStart = start;
|
2909 | fire( memory );
|
2910 | }
|
2911 | }
|
2912 | return this;
|
2913 | },
|
2914 |
|
2915 | remove: function() {
|
2916 | if ( list ) {
|
2917 | jQuery.each( arguments, function( _, arg ) {
|
2918 | var index;
|
2919 | while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
|
2920 | list.splice( index, 1 );
|
2921 |
|
2922 | if ( firing ) {
|
2923 | if ( index <= firingLength ) {
|
2924 | firingLength--;
|
2925 | }
|
2926 | if ( index <= firingIndex ) {
|
2927 | firingIndex--;
|
2928 | }
|
2929 | }
|
2930 | }
|
2931 | });
|
2932 | }
|
2933 | return this;
|
2934 | },
|
2935 |
|
2936 |
|
2937 | has: function( fn ) {
|
2938 | return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
|
2939 | },
|
2940 |
|
2941 | empty: function() {
|
2942 | list = [];
|
2943 | firingLength = 0;
|
2944 | return this;
|
2945 | },
|
2946 |
|
2947 | disable: function() {
|
2948 | list = stack = memory = undefined;
|
2949 | return this;
|
2950 | },
|
2951 |
|
2952 | disabled: function() {
|
2953 | return !list;
|
2954 | },
|
2955 |
|
2956 | lock: function() {
|
2957 | stack = undefined;
|
2958 | if ( !memory ) {
|
2959 | self.disable();
|
2960 | }
|
2961 | return this;
|
2962 | },
|
2963 |
|
2964 | locked: function() {
|
2965 | return !stack;
|
2966 | },
|
2967 |
|
2968 | fireWith: function( context, args ) {
|
2969 | args = args || [];
|
2970 | args = [ context, args.slice ? args.slice() : args ];
|
2971 | if ( list && ( !fired || stack ) ) {
|
2972 | if ( firing ) {
|
2973 | stack.push( args );
|
2974 | } else {
|
2975 | fire( args );
|
2976 | }
|
2977 | }
|
2978 | return this;
|
2979 | },
|
2980 |
|
2981 | fire: function() {
|
2982 | self.fireWith( this, arguments );
|
2983 | return this;
|
2984 | },
|
2985 |
|
2986 | fired: function() {
|
2987 | return !!fired;
|
2988 | }
|
2989 | };
|
2990 |
|
2991 | return self;
|
2992 | };
|
2993 | jQuery.extend({
|
2994 |
|
2995 | Deferred: function( func ) {
|
2996 | var tuples = [
|
2997 |
|
2998 | [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
|
2999 | [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
|
3000 | [ "notify", "progress", jQuery.Callbacks("memory") ]
|
3001 | ],
|
3002 | state = "pending",
|
3003 | promise = {
|
3004 | state: function() {
|
3005 | return state;
|
3006 | },
|
3007 | always: function() {
|
3008 | deferred.done( arguments ).fail( arguments );
|
3009 | return this;
|
3010 | },
|
3011 | then: function( /* fnDone, fnFail, fnProgress */ ) {
|
3012 | var fns = arguments;
|
3013 | return jQuery.Deferred(function( newDefer ) {
|
3014 | jQuery.each( tuples, function( i, tuple ) {
|
3015 | var action = tuple[ 0 ],
|
3016 | fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
|
3017 |
|
3018 | deferred[ tuple[1] ](function() {
|
3019 | var returned = fn && fn.apply( this, arguments );
|
3020 | if ( returned && jQuery.isFunction( returned.promise ) ) {
|
3021 | returned.promise()
|
3022 | .done( newDefer.resolve )
|
3023 | .fail( newDefer.reject )
|
3024 | .progress( newDefer.notify );
|
3025 | } else {
|
3026 | newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
|
3027 | }
|
3028 | });
|
3029 | });
|
3030 | fns = null;
|
3031 | }).promise();
|
3032 | },
|
3033 |
|
3034 |
|
3035 | promise: function( obj ) {
|
3036 | return obj != null ? jQuery.extend( obj, promise ) : promise;
|
3037 | }
|
3038 | },
|
3039 | deferred = {};
|
3040 |
|
3041 |
|
3042 | promise.pipe = promise.then;
|
3043 |
|
3044 |
|
3045 | jQuery.each( tuples, function( i, tuple ) {
|
3046 | var list = tuple[ 2 ],
|
3047 | stateString = tuple[ 3 ];
|
3048 |
|
3049 |
|
3050 | promise[ tuple[1] ] = list.add;
|
3051 |
|
3052 |
|
3053 | if ( stateString ) {
|
3054 | list.add(function() {
|
3055 |
|
3056 | state = stateString;
|
3057 |
|
3058 |
|
3059 | }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
|
3060 | }
|
3061 |
|
3062 |
|
3063 | deferred[ tuple[0] ] = function() {
|
3064 | deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
|
3065 | return this;
|
3066 | };
|
3067 | deferred[ tuple[0] + "With" ] = list.fireWith;
|
3068 | });
|
3069 |
|
3070 |
|
3071 | promise.promise( deferred );
|
3072 |
|
3073 |
|
3074 | if ( func ) {
|
3075 | func.call( deferred, deferred );
|
3076 | }
|
3077 |
|
3078 |
|
3079 | return deferred;
|
3080 | },
|
3081 |
|
3082 |
|
3083 | when: function( subordinate /* , ..., subordinateN */ ) {
|
3084 | var i = 0,
|
3085 | resolveValues = core_slice.call( arguments ),
|
3086 | length = resolveValues.length,
|
3087 |
|
3088 |
|
3089 | remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
|
3090 |
|
3091 |
|
3092 | deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
|
3093 |
|
3094 |
|
3095 | updateFunc = function( i, contexts, values ) {
|
3096 | return function( value ) {
|
3097 | contexts[ i ] = this;
|
3098 | values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
|
3099 | if( values === progressValues ) {
|
3100 | deferred.notifyWith( contexts, values );
|
3101 | } else if ( !( --remaining ) ) {
|
3102 | deferred.resolveWith( contexts, values );
|
3103 | }
|
3104 | };
|
3105 | },
|
3106 |
|
3107 | progressValues, progressContexts, resolveContexts;
|
3108 |
|
3109 |
|
3110 | if ( length > 1 ) {
|
3111 | progressValues = new Array( length );
|
3112 | progressContexts = new Array( length );
|
3113 | resolveContexts = new Array( length );
|
3114 | for ( ; i < length; i++ ) {
|
3115 | if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
|
3116 | resolveValues[ i ].promise()
|
3117 | .done( updateFunc( i, resolveContexts, resolveValues ) )
|
3118 | .fail( deferred.reject )
|
3119 | .progress( updateFunc( i, progressContexts, progressValues ) );
|
3120 | } else {
|
3121 | --remaining;
|
3122 | }
|
3123 | }
|
3124 | }
|
3125 |
|
3126 |
|
3127 | if ( !remaining ) {
|
3128 | deferred.resolveWith( resolveContexts, resolveValues );
|
3129 | }
|
3130 |
|
3131 | return deferred.promise();
|
3132 | }
|
3133 | });
|
3134 | jQuery.support = (function( support ) {
|
3135 | var input = document.createElement("input"),
|
3136 | fragment = document.createDocumentFragment(),
|
3137 | div = document.createElement("div"),
|
3138 | select = document.createElement("select"),
|
3139 | opt = select.appendChild( document.createElement("option") );
|
3140 |
|
3141 |
|
3142 | if ( !input.type ) {
|
3143 | return support;
|
3144 | }
|
3145 |
|
3146 | input.type = "checkbox";
|
3147 |
|
3148 |
|
3149 |
|
3150 | support.checkOn = input.value !== "";
|
3151 |
|
3152 |
|
3153 |
|
3154 | support.optSelected = opt.selected;
|
3155 |
|
3156 |
|
3157 | support.reliableMarginRight = true;
|
3158 | support.boxSizingReliable = true;
|
3159 | support.pixelPosition = false;
|
3160 |
|
3161 |
|
3162 |
|
3163 | input.checked = true;
|
3164 | support.noCloneChecked = input.cloneNode( true ).checked;
|
3165 |
|
3166 |
|
3167 |
|
3168 | select.disabled = true;
|
3169 | support.optDisabled = !opt.disabled;
|
3170 |
|
3171 |
|
3172 |
|
3173 | input = document.createElement("input");
|
3174 | input.value = "t";
|
3175 | input.type = "radio";
|
3176 | support.radioValue = input.value === "t";
|
3177 |
|
3178 |
|
3179 | input.setAttribute( "checked", "t" );
|
3180 | input.setAttribute( "name", "t" );
|
3181 |
|
3182 | fragment.appendChild( input );
|
3183 |
|
3184 |
|
3185 |
|
3186 | support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
3187 |
|
3188 |
|
3189 |
|
3190 | support.focusinBubbles = "onfocusin" in window;
|
3191 |
|
3192 | div.style.backgroundClip = "content-box";
|
3193 | div.cloneNode( true ).style.backgroundClip = "";
|
3194 | support.clearCloneStyle = div.style.backgroundClip === "content-box";
|
3195 |
|
3196 |
|
3197 | jQuery(function() {
|
3198 | var container, marginDiv,
|
3199 |
|
3200 | divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",
|
3201 | body = document.getElementsByTagName("body")[ 0 ];
|
3202 |
|
3203 | if ( !body ) {
|
3204 |
|
3205 | return;
|
3206 | }
|
3207 |
|
3208 | container = document.createElement("div");
|
3209 | container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
|
3210 |
|
3211 |
|
3212 | body.appendChild( container ).appendChild( div );
|
3213 | div.innerHTML = "";
|
3214 |
|
3215 | div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%";
|
3216 |
|
3217 |
|
3218 |
|
3219 | jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
|
3220 | support.boxSizing = div.offsetWidth === 4;
|
3221 | });
|
3222 |
|
3223 |
|
3224 | if ( window.getComputedStyle ) {
|
3225 | support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
|
3226 | support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
|
3227 |
|
3228 |
|
3229 |
|
3230 |
|
3231 |
|
3232 | marginDiv = div.appendChild( document.createElement("div") );
|
3233 | marginDiv.style.cssText = div.style.cssText = divReset;
|
3234 | marginDiv.style.marginRight = marginDiv.style.width = "0";
|
3235 | div.style.width = "1px";
|
3236 |
|
3237 | support.reliableMarginRight =
|
3238 | !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
|
3239 | }
|
3240 |
|
3241 | body.removeChild( container );
|
3242 | });
|
3243 |
|
3244 | return support;
|
3245 | })( {} );
|
3246 |
|
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 |
|
3252 |
|
3253 |
|
3254 |
|
3255 |
|
3256 |
|
3257 |
|
3258 | var data_user, data_priv,
|
3259 | rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
|
3260 | rmultiDash = /([A-Z])/g;
|
3261 |
|
3262 | function Data() {
|
3263 |
|
3264 |
|
3265 |
|
3266 | Object.defineProperty( this.cache = {}, 0, {
|
3267 | get: function() {
|
3268 | return {};
|
3269 | }
|
3270 | });
|
3271 |
|
3272 | this.expando = jQuery.expando + Math.random();
|
3273 | }
|
3274 |
|
3275 | Data.uid = 1;
|
3276 |
|
3277 | Data.accepts = function( owner ) {
|
3278 |
|
3279 |
|
3280 |
|
3281 |
|
3282 |
|
3283 |
|
3284 | return owner.nodeType ?
|
3285 | owner.nodeType === 1 || owner.nodeType === 9 : true;
|
3286 | };
|
3287 |
|
3288 | Data.prototype = {
|
3289 | key: function( owner ) {
|
3290 |
|
3291 |
|
3292 |
|
3293 | if ( !Data.accepts( owner ) ) {
|
3294 | return 0;
|
3295 | }
|
3296 |
|
3297 | var descriptor = {},
|
3298 |
|
3299 | unlock = owner[ this.expando ];
|
3300 |
|
3301 |
|
3302 | if ( !unlock ) {
|
3303 | unlock = Data.uid++;
|
3304 |
|
3305 |
|
3306 | try {
|
3307 | descriptor[ this.expando ] = { value: unlock };
|
3308 | Object.defineProperties( owner, descriptor );
|
3309 |
|
3310 |
|
3311 |
|
3312 | } catch ( e ) {
|
3313 | descriptor[ this.expando ] = unlock;
|
3314 | jQuery.extend( owner, descriptor );
|
3315 | }
|
3316 | }
|
3317 |
|
3318 |
|
3319 | if ( !this.cache[ unlock ] ) {
|
3320 | this.cache[ unlock ] = {};
|
3321 | }
|
3322 |
|
3323 | return unlock;
|
3324 | },
|
3325 | set: function( owner, data, value ) {
|
3326 | var prop,
|
3327 |
|
3328 |
|
3329 |
|
3330 | unlock = this.key( owner ),
|
3331 | cache = this.cache[ unlock ];
|
3332 |
|
3333 |
|
3334 | if ( typeof data === "string" ) {
|
3335 | cache[ data ] = value;
|
3336 |
|
3337 |
|
3338 | } else {
|
3339 |
|
3340 |
|
3341 |
|
3342 |
|
3343 |
|
3344 | if ( jQuery.isEmptyObject( cache ) ) {
|
3345 | this.cache[ unlock ] = data;
|
3346 |
|
3347 | } else {
|
3348 | for ( prop in data ) {
|
3349 | cache[ prop ] = data[ prop ];
|
3350 | }
|
3351 | }
|
3352 | }
|
3353 | },
|
3354 | get: function( owner, key ) {
|
3355 |
|
3356 |
|
3357 |
|
3358 |
|
3359 | var cache = this.cache[ this.key( owner ) ];
|
3360 |
|
3361 | return key === undefined ?
|
3362 | cache : cache[ key ];
|
3363 | },
|
3364 | access: function( owner, key, value ) {
|
3365 |
|
3366 |
|
3367 |
|
3368 |
|
3369 |
|
3370 |
|
3371 |
|
3372 |
|
3373 |
|
3374 |
|
3375 |
|
3376 | if ( key === undefined ||
|
3377 | ((key && typeof key === "string") && value === undefined) ) {
|
3378 | return this.get( owner, key );
|
3379 | }
|
3380 |
|
3381 |
|
3382 |
|
3383 |
|
3384 |
|
3385 |
|
3386 |
|
3387 | this.set( owner, key, value );
|
3388 |
|
3389 |
|
3390 |
|
3391 | return value !== undefined ? value : key;
|
3392 | },
|
3393 | remove: function( owner, key ) {
|
3394 | var i, name,
|
3395 | unlock = this.key( owner ),
|
3396 | cache = this.cache[ unlock ];
|
3397 |
|
3398 | if ( key === undefined ) {
|
3399 | this.cache[ unlock ] = {};
|
3400 |
|
3401 | } else {
|
3402 |
|
3403 | if ( jQuery.isArray( key ) ) {
|
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 |
|
3409 |
|
3410 | name = key.concat( key.map( jQuery.camelCase ) );
|
3411 | } else {
|
3412 |
|
3413 | if ( key in cache ) {
|
3414 | name = [ key ];
|
3415 | } else {
|
3416 |
|
3417 |
|
3418 | name = jQuery.camelCase( key );
|
3419 | name = name in cache ?
|
3420 | [ name ] : ( name.match( core_rnotwhite ) || [] );
|
3421 | }
|
3422 | }
|
3423 |
|
3424 | i = name.length;
|
3425 | while ( i-- ) {
|
3426 | delete cache[ name[ i ] ];
|
3427 | }
|
3428 | }
|
3429 | },
|
3430 | hasData: function( owner ) {
|
3431 | return !jQuery.isEmptyObject(
|
3432 | this.cache[ owner[ this.expando ] ] || {}
|
3433 | );
|
3434 | },
|
3435 | discard: function( owner ) {
|
3436 | delete this.cache[ this.key( owner ) ];
|
3437 | }
|
3438 | };
|
3439 |
|
3440 |
|
3441 | data_user = new Data();
|
3442 | data_priv = new Data();
|
3443 |
|
3444 |
|
3445 | jQuery.extend({
|
3446 | acceptData: Data.accepts,
|
3447 |
|
3448 | hasData: function( elem ) {
|
3449 | return data_user.hasData( elem ) || data_priv.hasData( elem );
|
3450 | },
|
3451 |
|
3452 | data: function( elem, name, data ) {
|
3453 | return data_user.access( elem, name, data );
|
3454 | },
|
3455 |
|
3456 | removeData: function( elem, name ) {
|
3457 | data_user.remove( elem, name );
|
3458 | },
|
3459 |
|
3460 |
|
3461 |
|
3462 | _data: function( elem, name, data ) {
|
3463 | return data_priv.access( elem, name, data );
|
3464 | },
|
3465 |
|
3466 | _removeData: function( elem, name ) {
|
3467 | data_priv.remove( elem, name );
|
3468 | }
|
3469 | });
|
3470 |
|
3471 | jQuery.fn.extend({
|
3472 | data: function( key, value ) {
|
3473 | var attrs, name,
|
3474 | elem = this[ 0 ],
|
3475 | i = 0,
|
3476 | data = null;
|
3477 |
|
3478 |
|
3479 | if ( key === undefined ) {
|
3480 | if ( this.length ) {
|
3481 | data = data_user.get( elem );
|
3482 |
|
3483 | if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
|
3484 | attrs = elem.attributes;
|
3485 | for ( ; i < attrs.length; i++ ) {
|
3486 | name = attrs[ i ].name;
|
3487 |
|
3488 | if ( name.indexOf( "data-" ) === 0 ) {
|
3489 | name = jQuery.camelCase( name.substring(5) );
|
3490 | dataAttr( elem, name, data[ name ] );
|
3491 | }
|
3492 | }
|
3493 | data_priv.set( elem, "hasDataAttrs", true );
|
3494 | }
|
3495 | }
|
3496 |
|
3497 | return data;
|
3498 | }
|
3499 |
|
3500 |
|
3501 | if ( typeof key === "object" ) {
|
3502 | return this.each(function() {
|
3503 | data_user.set( this, key );
|
3504 | });
|
3505 | }
|
3506 |
|
3507 | return jQuery.access( this, function( value ) {
|
3508 | var data,
|
3509 | camelKey = jQuery.camelCase( key );
|
3510 |
|
3511 |
|
3512 |
|
3513 |
|
3514 |
|
3515 |
|
3516 | if ( elem && value === undefined ) {
|
3517 |
|
3518 |
|
3519 | data = data_user.get( elem, key );
|
3520 | if ( data !== undefined ) {
|
3521 | return data;
|
3522 | }
|
3523 |
|
3524 |
|
3525 |
|
3526 | data = data_user.get( elem, camelKey );
|
3527 | if ( data !== undefined ) {
|
3528 | return data;
|
3529 | }
|
3530 |
|
3531 |
|
3532 |
|
3533 | data = dataAttr( elem, camelKey, undefined );
|
3534 | if ( data !== undefined ) {
|
3535 | return data;
|
3536 | }
|
3537 |
|
3538 |
|
3539 | return;
|
3540 | }
|
3541 |
|
3542 |
|
3543 | this.each(function() {
|
3544 |
|
3545 |
|
3546 | var data = data_user.get( this, camelKey );
|
3547 |
|
3548 |
|
3549 |
|
3550 |
|
3551 | data_user.set( this, camelKey, value );
|
3552 |
|
3553 |
|
3554 |
|
3555 |
|
3556 | if ( key.indexOf("-") !== -1 && data !== undefined ) {
|
3557 | data_user.set( this, key, value );
|
3558 | }
|
3559 | });
|
3560 | }, null, value, arguments.length > 1, null, true );
|
3561 | },
|
3562 |
|
3563 | removeData: function( key ) {
|
3564 | return this.each(function() {
|
3565 | data_user.remove( this, key );
|
3566 | });
|
3567 | }
|
3568 | });
|
3569 |
|
3570 | function dataAttr( elem, key, data ) {
|
3571 | var name;
|
3572 |
|
3573 |
|
3574 |
|
3575 | if ( data === undefined && elem.nodeType === 1 ) {
|
3576 | name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
|
3577 | data = elem.getAttribute( name );
|
3578 |
|
3579 | if ( typeof data === "string" ) {
|
3580 | try {
|
3581 | data = data === "true" ? true :
|
3582 | data === "false" ? false :
|
3583 | data === "null" ? null :
|
3584 |
|
3585 | +data + "" === data ? +data :
|
3586 | rbrace.test( data ) ? JSON.parse( data ) :
|
3587 | data;
|
3588 | } catch( e ) {}
|
3589 |
|
3590 |
|
3591 | data_user.set( elem, key, data );
|
3592 | } else {
|
3593 | data = undefined;
|
3594 | }
|
3595 | }
|
3596 | return data;
|
3597 | }
|
3598 | jQuery.extend({
|
3599 | queue: function( elem, type, data ) {
|
3600 | var queue;
|
3601 |
|
3602 | if ( elem ) {
|
3603 | type = ( type || "fx" ) + "queue";
|
3604 | queue = data_priv.get( elem, type );
|
3605 |
|
3606 |
|
3607 | if ( data ) {
|
3608 | if ( !queue || jQuery.isArray( data ) ) {
|
3609 | queue = data_priv.access( elem, type, jQuery.makeArray(data) );
|
3610 | } else {
|
3611 | queue.push( data );
|
3612 | }
|
3613 | }
|
3614 | return queue || [];
|
3615 | }
|
3616 | },
|
3617 |
|
3618 | dequeue: function( elem, type ) {
|
3619 | type = type || "fx";
|
3620 |
|
3621 | var queue = jQuery.queue( elem, type ),
|
3622 | startLength = queue.length,
|
3623 | fn = queue.shift(),
|
3624 | hooks = jQuery._queueHooks( elem, type ),
|
3625 | next = function() {
|
3626 | jQuery.dequeue( elem, type );
|
3627 | };
|
3628 |
|
3629 |
|
3630 | if ( fn === "inprogress" ) {
|
3631 | fn = queue.shift();
|
3632 | startLength--;
|
3633 | }
|
3634 |
|
3635 | hooks.cur = fn;
|
3636 | if ( fn ) {
|
3637 |
|
3638 |
|
3639 |
|
3640 | if ( type === "fx" ) {
|
3641 | queue.unshift( "inprogress" );
|
3642 | }
|
3643 |
|
3644 |
|
3645 | delete hooks.stop;
|
3646 | fn.call( elem, next, hooks );
|
3647 | }
|
3648 |
|
3649 | if ( !startLength && hooks ) {
|
3650 | hooks.empty.fire();
|
3651 | }
|
3652 | },
|
3653 |
|
3654 |
|
3655 | _queueHooks: function( elem, type ) {
|
3656 | var key = type + "queueHooks";
|
3657 | return data_priv.get( elem, key ) || data_priv.access( elem, key, {
|
3658 | empty: jQuery.Callbacks("once memory").add(function() {
|
3659 | data_priv.remove( elem, [ type + "queue", key ] );
|
3660 | })
|
3661 | });
|
3662 | }
|
3663 | });
|
3664 |
|
3665 | jQuery.fn.extend({
|
3666 | queue: function( type, data ) {
|
3667 | var setter = 2;
|
3668 |
|
3669 | if ( typeof type !== "string" ) {
|
3670 | data = type;
|
3671 | type = "fx";
|
3672 | setter--;
|
3673 | }
|
3674 |
|
3675 | if ( arguments.length < setter ) {
|
3676 | return jQuery.queue( this[0], type );
|
3677 | }
|
3678 |
|
3679 | return data === undefined ?
|
3680 | this :
|
3681 | this.each(function() {
|
3682 | var queue = jQuery.queue( this, type, data );
|
3683 |
|
3684 |
|
3685 | jQuery._queueHooks( this, type );
|
3686 |
|
3687 | if ( type === "fx" && queue[0] !== "inprogress" ) {
|
3688 | jQuery.dequeue( this, type );
|
3689 | }
|
3690 | });
|
3691 | },
|
3692 | dequeue: function( type ) {
|
3693 | return this.each(function() {
|
3694 | jQuery.dequeue( this, type );
|
3695 | });
|
3696 | },
|
3697 |
|
3698 |
|
3699 | delay: function( time, type ) {
|
3700 | time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
|
3701 | type = type || "fx";
|
3702 |
|
3703 | return this.queue( type, function( next, hooks ) {
|
3704 | var timeout = setTimeout( next, time );
|
3705 | hooks.stop = function() {
|
3706 | clearTimeout( timeout );
|
3707 | };
|
3708 | });
|
3709 | },
|
3710 | clearQueue: function( type ) {
|
3711 | return this.queue( type || "fx", [] );
|
3712 | },
|
3713 |
|
3714 |
|
3715 | promise: function( type, obj ) {
|
3716 | var tmp,
|
3717 | count = 1,
|
3718 | defer = jQuery.Deferred(),
|
3719 | elements = this,
|
3720 | i = this.length,
|
3721 | resolve = function() {
|
3722 | if ( !( --count ) ) {
|
3723 | defer.resolveWith( elements, [ elements ] );
|
3724 | }
|
3725 | };
|
3726 |
|
3727 | if ( typeof type !== "string" ) {
|
3728 | obj = type;
|
3729 | type = undefined;
|
3730 | }
|
3731 | type = type || "fx";
|
3732 |
|
3733 | while( i-- ) {
|
3734 | tmp = data_priv.get( elements[ i ], type + "queueHooks" );
|
3735 | if ( tmp && tmp.empty ) {
|
3736 | count++;
|
3737 | tmp.empty.add( resolve );
|
3738 | }
|
3739 | }
|
3740 | resolve();
|
3741 | return defer.promise( obj );
|
3742 | }
|
3743 | });
|
3744 | var nodeHook, boolHook,
|
3745 | rclass = /[\t\r\n]/g,
|
3746 | rreturn = /\r/g,
|
3747 | rfocusable = /^(?:input|select|textarea|button)$/i;
|
3748 |
|
3749 | jQuery.fn.extend({
|
3750 | attr: function( name, value ) {
|
3751 | return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
|
3752 | },
|
3753 |
|
3754 | removeAttr: function( name ) {
|
3755 | return this.each(function() {
|
3756 | jQuery.removeAttr( this, name );
|
3757 | });
|
3758 | },
|
3759 |
|
3760 | prop: function( name, value ) {
|
3761 | return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
|
3762 | },
|
3763 |
|
3764 | removeProp: function( name ) {
|
3765 | return this.each(function() {
|
3766 | delete this[ jQuery.propFix[ name ] || name ];
|
3767 | });
|
3768 | },
|
3769 |
|
3770 | addClass: function( value ) {
|
3771 | var classes, elem, cur, clazz, j,
|
3772 | i = 0,
|
3773 | len = this.length,
|
3774 | proceed = typeof value === "string" && value;
|
3775 |
|
3776 | if ( jQuery.isFunction( value ) ) {
|
3777 | return this.each(function( j ) {
|
3778 | jQuery( this ).addClass( value.call( this, j, this.className ) );
|
3779 | });
|
3780 | }
|
3781 |
|
3782 | if ( proceed ) {
|
3783 |
|
3784 | classes = ( value || "" ).match( core_rnotwhite ) || [];
|
3785 |
|
3786 | for ( ; i < len; i++ ) {
|
3787 | elem = this[ i ];
|
3788 | cur = elem.nodeType === 1 && ( elem.className ?
|
3789 | ( " " + elem.className + " " ).replace( rclass, " " ) :
|
3790 | " "
|
3791 | );
|
3792 |
|
3793 | if ( cur ) {
|
3794 | j = 0;
|
3795 | while ( (clazz = classes[j++]) ) {
|
3796 | if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
|
3797 | cur += clazz + " ";
|
3798 | }
|
3799 | }
|
3800 | elem.className = jQuery.trim( cur );
|
3801 |
|
3802 | }
|
3803 | }
|
3804 | }
|
3805 |
|
3806 | return this;
|
3807 | },
|
3808 |
|
3809 | removeClass: function( value ) {
|
3810 | var classes, elem, cur, clazz, j,
|
3811 | i = 0,
|
3812 | len = this.length,
|
3813 | proceed = arguments.length === 0 || typeof value === "string" && value;
|
3814 |
|
3815 | if ( jQuery.isFunction( value ) ) {
|
3816 | return this.each(function( j ) {
|
3817 | jQuery( this ).removeClass( value.call( this, j, this.className ) );
|
3818 | });
|
3819 | }
|
3820 | if ( proceed ) {
|
3821 | classes = ( value || "" ).match( core_rnotwhite ) || [];
|
3822 |
|
3823 | for ( ; i < len; i++ ) {
|
3824 | elem = this[ i ];
|
3825 |
|
3826 | cur = elem.nodeType === 1 && ( elem.className ?
|
3827 | ( " " + elem.className + " " ).replace( rclass, " " ) :
|
3828 | ""
|
3829 | );
|
3830 |
|
3831 | if ( cur ) {
|
3832 | j = 0;
|
3833 | while ( (clazz = classes[j++]) ) {
|
3834 |
|
3835 | while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
|
3836 | cur = cur.replace( " " + clazz + " ", " " );
|
3837 | }
|
3838 | }
|
3839 | elem.className = value ? jQuery.trim( cur ) : "";
|
3840 | }
|
3841 | }
|
3842 | }
|
3843 |
|
3844 | return this;
|
3845 | },
|
3846 |
|
3847 | toggleClass: function( value, stateVal ) {
|
3848 | var type = typeof value,
|
3849 | isBool = typeof stateVal === "boolean";
|
3850 |
|
3851 | if ( jQuery.isFunction( value ) ) {
|
3852 | return this.each(function( i ) {
|
3853 | jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
|
3854 | });
|
3855 | }
|
3856 |
|
3857 | return this.each(function() {
|
3858 | if ( type === "string" ) {
|
3859 |
|
3860 | var className,
|
3861 | i = 0,
|
3862 | self = jQuery( this ),
|
3863 | state = stateVal,
|
3864 | classNames = value.match( core_rnotwhite ) || [];
|
3865 |
|
3866 | while ( (className = classNames[ i++ ]) ) {
|
3867 |
|
3868 | state = isBool ? state : !self.hasClass( className );
|
3869 | self[ state ? "addClass" : "removeClass" ]( className );
|
3870 | }
|
3871 |
|
3872 |
|
3873 | } else if ( type === core_strundefined || type === "boolean" ) {
|
3874 | if ( this.className ) {
|
3875 |
|
3876 | data_priv.set( this, "__className__", this.className );
|
3877 | }
|
3878 |
|
3879 |
|
3880 |
|
3881 |
|
3882 |
|
3883 | this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
|
3884 | }
|
3885 | });
|
3886 | },
|
3887 |
|
3888 | hasClass: function( selector ) {
|
3889 | var className = " " + selector + " ",
|
3890 | i = 0,
|
3891 | l = this.length;
|
3892 | for ( ; i < l; i++ ) {
|
3893 | if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
|
3894 | return true;
|
3895 | }
|
3896 | }
|
3897 |
|
3898 | return false;
|
3899 | },
|
3900 |
|
3901 | val: function( value ) {
|
3902 | var hooks, ret, isFunction,
|
3903 | elem = this[0];
|
3904 |
|
3905 | if ( !arguments.length ) {
|
3906 | if ( elem ) {
|
3907 | hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
|
3908 |
|
3909 | if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
|
3910 | return ret;
|
3911 | }
|
3912 |
|
3913 | ret = elem.value;
|
3914 |
|
3915 | return typeof ret === "string" ?
|
3916 |
|
3917 | ret.replace(rreturn, "") :
|
3918 |
|
3919 | ret == null ? "" : ret;
|
3920 | }
|
3921 |
|
3922 | return;
|
3923 | }
|
3924 |
|
3925 | isFunction = jQuery.isFunction( value );
|
3926 |
|
3927 | return this.each(function( i ) {
|
3928 | var val,
|
3929 | self = jQuery(this);
|
3930 |
|
3931 | if ( this.nodeType !== 1 ) {
|
3932 | return;
|
3933 | }
|
3934 |
|
3935 | if ( isFunction ) {
|
3936 | val = value.call( this, i, self.val() );
|
3937 | } else {
|
3938 | val = value;
|
3939 | }
|
3940 |
|
3941 |
|
3942 | if ( val == null ) {
|
3943 | val = "";
|
3944 | } else if ( typeof val === "number" ) {
|
3945 | val += "";
|
3946 | } else if ( jQuery.isArray( val ) ) {
|
3947 | val = jQuery.map(val, function ( value ) {
|
3948 | return value == null ? "" : value + "";
|
3949 | });
|
3950 | }
|
3951 |
|
3952 | hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
|
3953 |
|
3954 |
|
3955 | if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
|
3956 | this.value = val;
|
3957 | }
|
3958 | });
|
3959 | }
|
3960 | });
|
3961 |
|
3962 | jQuery.extend({
|
3963 | valHooks: {
|
3964 | option: {
|
3965 | get: function( elem ) {
|
3966 |
|
3967 |
|
3968 | var val = elem.attributes.value;
|
3969 | return !val || val.specified ? elem.value : elem.text;
|
3970 | }
|
3971 | },
|
3972 | select: {
|
3973 | get: function( elem ) {
|
3974 | var value, option,
|
3975 | options = elem.options,
|
3976 | index = elem.selectedIndex,
|
3977 | one = elem.type === "select-one" || index < 0,
|
3978 | values = one ? null : [],
|
3979 | max = one ? index + 1 : options.length,
|
3980 | i = index < 0 ?
|
3981 | max :
|
3982 | one ? index : 0;
|
3983 |
|
3984 |
|
3985 | for ( ; i < max; i++ ) {
|
3986 | option = options[ i ];
|
3987 |
|
3988 |
|
3989 | if ( ( option.selected || i === index ) &&
|
3990 |
|
3991 | ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
|
3992 | ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
|
3993 |
|
3994 |
|
3995 | value = jQuery( option ).val();
|
3996 |
|
3997 |
|
3998 | if ( one ) {
|
3999 | return value;
|
4000 | }
|
4001 |
|
4002 |
|
4003 | values.push( value );
|
4004 | }
|
4005 | }
|
4006 |
|
4007 | return values;
|
4008 | },
|
4009 |
|
4010 | set: function( elem, value ) {
|
4011 | var optionSet, option,
|
4012 | options = elem.options,
|
4013 | values = jQuery.makeArray( value ),
|
4014 | i = options.length;
|
4015 |
|
4016 | while ( i-- ) {
|
4017 | option = options[ i ];
|
4018 | if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
|
4019 | optionSet = true;
|
4020 | }
|
4021 | }
|
4022 |
|
4023 |
|
4024 | if ( !optionSet ) {
|
4025 | elem.selectedIndex = -1;
|
4026 | }
|
4027 | return values;
|
4028 | }
|
4029 | }
|
4030 | },
|
4031 |
|
4032 | attr: function( elem, name, value ) {
|
4033 | var hooks, ret,
|
4034 | nType = elem.nodeType;
|
4035 |
|
4036 |
|
4037 | if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
4038 | return;
|
4039 | }
|
4040 |
|
4041 |
|
4042 | if ( typeof elem.getAttribute === core_strundefined ) {
|
4043 | return jQuery.prop( elem, name, value );
|
4044 | }
|
4045 |
|
4046 |
|
4047 |
|
4048 | if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
|
4049 | name = name.toLowerCase();
|
4050 | hooks = jQuery.attrHooks[ name ] ||
|
4051 | ( jQuery.expr.match.boolean.test( name ) ? boolHook : nodeHook );
|
4052 | }
|
4053 |
|
4054 | if ( value !== undefined ) {
|
4055 |
|
4056 | if ( value === null ) {
|
4057 | jQuery.removeAttr( elem, name );
|
4058 |
|
4059 | } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
4060 | return ret;
|
4061 |
|
4062 | } else {
|
4063 | elem.setAttribute( name, value + "" );
|
4064 | return value;
|
4065 | }
|
4066 |
|
4067 | } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
|
4068 | return ret;
|
4069 |
|
4070 | } else {
|
4071 | ret = jQuery.find.attr( elem, name );
|
4072 |
|
4073 |
|
4074 | return ret == null ?
|
4075 | undefined :
|
4076 | ret;
|
4077 | }
|
4078 | },
|
4079 |
|
4080 | removeAttr: function( elem, value ) {
|
4081 | var name, propName,
|
4082 | i = 0,
|
4083 | attrNames = value && value.match( core_rnotwhite );
|
4084 |
|
4085 | if ( attrNames && elem.nodeType === 1 ) {
|
4086 | while ( (name = attrNames[i++]) ) {
|
4087 | propName = jQuery.propFix[ name ] || name;
|
4088 |
|
4089 |
|
4090 | if ( jQuery.expr.match.boolean.test( name ) ) {
|
4091 |
|
4092 | elem[ propName ] = false;
|
4093 | }
|
4094 |
|
4095 | elem.removeAttribute( name );
|
4096 | }
|
4097 | }
|
4098 | },
|
4099 |
|
4100 | attrHooks: {
|
4101 | type: {
|
4102 | set: function( elem, value ) {
|
4103 | if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
|
4104 |
|
4105 |
|
4106 | var val = elem.value;
|
4107 | elem.setAttribute( "type", value );
|
4108 | if ( val ) {
|
4109 | elem.value = val;
|
4110 | }
|
4111 | return value;
|
4112 | }
|
4113 | }
|
4114 | }
|
4115 | },
|
4116 |
|
4117 | propFix: {
|
4118 | "for": "htmlFor",
|
4119 | "class": "className"
|
4120 | },
|
4121 |
|
4122 | prop: function( elem, name, value ) {
|
4123 | var ret, hooks, notxml,
|
4124 | nType = elem.nodeType;
|
4125 |
|
4126 |
|
4127 | if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
4128 | return;
|
4129 | }
|
4130 |
|
4131 | notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
4132 |
|
4133 | if ( notxml ) {
|
4134 |
|
4135 | name = jQuery.propFix[ name ] || name;
|
4136 | hooks = jQuery.propHooks[ name ];
|
4137 | }
|
4138 |
|
4139 | if ( value !== undefined ) {
|
4140 | return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
|
4141 | ret :
|
4142 | ( elem[ name ] = value );
|
4143 |
|
4144 | } else {
|
4145 | return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
|
4146 | ret :
|
4147 | elem[ name ];
|
4148 | }
|
4149 | },
|
4150 |
|
4151 | propHooks: {
|
4152 | tabIndex: {
|
4153 | get: function( elem ) {
|
4154 | return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
|
4155 | elem.tabIndex :
|
4156 | -1;
|
4157 | }
|
4158 | }
|
4159 | }
|
4160 | });
|
4161 |
|
4162 |
|
4163 | boolHook = {
|
4164 | set: function( elem, value, name ) {
|
4165 | if ( value === false ) {
|
4166 |
|
4167 | jQuery.removeAttr( elem, name );
|
4168 | } else {
|
4169 | elem.setAttribute( name, name );
|
4170 | }
|
4171 | return name;
|
4172 | }
|
4173 | };
|
4174 | jQuery.each( jQuery.expr.match.boolean.source.match( /\w+/g ), function( i, name ) {
|
4175 | var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
|
4176 |
|
4177 | jQuery.expr.attrHandle[ name ] = function( elem, name, isXML ) {
|
4178 | var fn = jQuery.expr.attrHandle[ name ],
|
4179 | ret = isXML ?
|
4180 | undefined :
|
4181 |
|
4182 |
|
4183 | (jQuery.expr.attrHandle[ name ] = undefined) !=
|
4184 | getter( elem, name, isXML ) ?
|
4185 |
|
4186 | name.toLowerCase() :
|
4187 | null;
|
4188 |
|
4189 |
|
4190 | jQuery.expr.attrHandle[ name ] = fn;
|
4191 |
|
4192 | return ret;
|
4193 | };
|
4194 | });
|
4195 |
|
4196 |
|
4197 |
|
4198 | if ( !jQuery.support.optSelected ) {
|
4199 | jQuery.propHooks.selected = {
|
4200 | get: function( elem ) {
|
4201 | var parent = elem.parentNode;
|
4202 | if ( parent && parent.parentNode ) {
|
4203 | parent.parentNode.selectedIndex;
|
4204 | }
|
4205 | return null;
|
4206 | }
|
4207 | };
|
4208 | }
|
4209 |
|
4210 | jQuery.each([
|
4211 | "tabIndex",
|
4212 | "readOnly",
|
4213 | "maxLength",
|
4214 | "cellSpacing",
|
4215 | "cellPadding",
|
4216 | "rowSpan",
|
4217 | "colSpan",
|
4218 | "useMap",
|
4219 | "frameBorder",
|
4220 | "contentEditable"
|
4221 | ], function() {
|
4222 | jQuery.propFix[ this.toLowerCase() ] = this;
|
4223 | });
|
4224 |
|
4225 |
|
4226 | jQuery.each([ "radio", "checkbox" ], function() {
|
4227 | jQuery.valHooks[ this ] = {
|
4228 | set: function( elem, value ) {
|
4229 | if ( jQuery.isArray( value ) ) {
|
4230 | return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
|
4231 | }
|
4232 | }
|
4233 | };
|
4234 | if ( !jQuery.support.checkOn ) {
|
4235 | jQuery.valHooks[ this ].get = function( elem ) {
|
4236 |
|
4237 |
|
4238 | return elem.getAttribute("value") === null ? "on" : elem.value;
|
4239 | };
|
4240 | }
|
4241 | });
|
4242 | var rkeyEvent = /^key/,
|
4243 | rmouseEvent = /^(?:mouse|contextmenu)|click/,
|
4244 | rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
|
4245 | rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
|
4246 |
|
4247 | function returnTrue() {
|
4248 | return true;
|
4249 | }
|
4250 |
|
4251 | function returnFalse() {
|
4252 | return false;
|
4253 | }
|
4254 |
|
4255 | function safeActiveElement() {
|
4256 | try {
|
4257 | return document.activeElement;
|
4258 | } catch ( err ) { }
|
4259 | }
|
4260 |
|
4261 |
|
4262 |
|
4263 |
|
4264 |
|
4265 | jQuery.event = {
|
4266 |
|
4267 | global: {},
|
4268 |
|
4269 | add: function( elem, types, handler, data, selector ) {
|
4270 |
|
4271 | var handleObjIn, eventHandle, tmp,
|
4272 | events, t, handleObj,
|
4273 | special, handlers, type, namespaces, origType,
|
4274 | elemData = data_priv.get( elem );
|
4275 |
|
4276 |
|
4277 | if ( !elemData ) {
|
4278 | return;
|
4279 | }
|
4280 |
|
4281 |
|
4282 | if ( handler.handler ) {
|
4283 | handleObjIn = handler;
|
4284 | handler = handleObjIn.handler;
|
4285 | selector = handleObjIn.selector;
|
4286 | }
|
4287 |
|
4288 |
|
4289 | if ( !handler.guid ) {
|
4290 | handler.guid = jQuery.guid++;
|
4291 | }
|
4292 |
|
4293 |
|
4294 | if ( !(events = elemData.events) ) {
|
4295 | events = elemData.events = {};
|
4296 | }
|
4297 | if ( !(eventHandle = elemData.handle) ) {
|
4298 | eventHandle = elemData.handle = function( e ) {
|
4299 |
|
4300 |
|
4301 | return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
|
4302 | jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
|
4303 | undefined;
|
4304 | };
|
4305 |
|
4306 | eventHandle.elem = elem;
|
4307 | }
|
4308 |
|
4309 |
|
4310 | types = ( types || "" ).match( core_rnotwhite ) || [""];
|
4311 | t = types.length;
|
4312 | while ( t-- ) {
|
4313 | tmp = rtypenamespace.exec( types[t] ) || [];
|
4314 | type = origType = tmp[1];
|
4315 | namespaces = ( tmp[2] || "" ).split( "." ).sort();
|
4316 |
|
4317 |
|
4318 | if ( !type ) {
|
4319 | continue;
|
4320 | }
|
4321 |
|
4322 |
|
4323 | special = jQuery.event.special[ type ] || {};
|
4324 |
|
4325 |
|
4326 | type = ( selector ? special.delegateType : special.bindType ) || type;
|
4327 |
|
4328 |
|
4329 | special = jQuery.event.special[ type ] || {};
|
4330 |
|
4331 |
|
4332 | handleObj = jQuery.extend({
|
4333 | type: type,
|
4334 | origType: origType,
|
4335 | data: data,
|
4336 | handler: handler,
|
4337 | guid: handler.guid,
|
4338 | selector: selector,
|
4339 | needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
|
4340 | namespace: namespaces.join(".")
|
4341 | }, handleObjIn );
|
4342 |
|
4343 |
|
4344 | if ( !(handlers = events[ type ]) ) {
|
4345 | handlers = events[ type ] = [];
|
4346 | handlers.delegateCount = 0;
|
4347 |
|
4348 |
|
4349 | if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
|
4350 | if ( elem.addEventListener ) {
|
4351 | elem.addEventListener( type, eventHandle, false );
|
4352 | }
|
4353 | }
|
4354 | }
|
4355 |
|
4356 | if ( special.add ) {
|
4357 | special.add.call( elem, handleObj );
|
4358 |
|
4359 | if ( !handleObj.handler.guid ) {
|
4360 | handleObj.handler.guid = handler.guid;
|
4361 | }
|
4362 | }
|
4363 |
|
4364 |
|
4365 | if ( selector ) {
|
4366 | handlers.splice( handlers.delegateCount++, 0, handleObj );
|
4367 | } else {
|
4368 | handlers.push( handleObj );
|
4369 | }
|
4370 |
|
4371 |
|
4372 | jQuery.event.global[ type ] = true;
|
4373 | }
|
4374 |
|
4375 |
|
4376 | elem = null;
|
4377 | },
|
4378 |
|
4379 |
|
4380 | remove: function( elem, types, handler, selector, mappedTypes ) {
|
4381 |
|
4382 | var j, origCount, tmp,
|
4383 | events, t, handleObj,
|
4384 | special, handlers, type, namespaces, origType,
|
4385 | elemData = data_priv.hasData( elem ) && data_priv.get( elem );
|
4386 |
|
4387 | if ( !elemData || !(events = elemData.events) ) {
|
4388 | return;
|
4389 | }
|
4390 |
|
4391 |
|
4392 | types = ( types || "" ).match( core_rnotwhite ) || [""];
|
4393 | t = types.length;
|
4394 | while ( t-- ) {
|
4395 | tmp = rtypenamespace.exec( types[t] ) || [];
|
4396 | type = origType = tmp[1];
|
4397 | namespaces = ( tmp[2] || "" ).split( "." ).sort();
|
4398 |
|
4399 |
|
4400 | if ( !type ) {
|
4401 | for ( type in events ) {
|
4402 | jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
|
4403 | }
|
4404 | continue;
|
4405 | }
|
4406 |
|
4407 | special = jQuery.event.special[ type ] || {};
|
4408 | type = ( selector ? special.delegateType : special.bindType ) || type;
|
4409 | handlers = events[ type ] || [];
|
4410 | tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
|
4411 |
|
4412 |
|
4413 | origCount = j = handlers.length;
|
4414 | while ( j-- ) {
|
4415 | handleObj = handlers[ j ];
|
4416 |
|
4417 | if ( ( mappedTypes || origType === handleObj.origType ) &&
|
4418 | ( !handler || handler.guid === handleObj.guid ) &&
|
4419 | ( !tmp || tmp.test( handleObj.namespace ) ) &&
|
4420 | ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
|
4421 | handlers.splice( j, 1 );
|
4422 |
|
4423 | if ( handleObj.selector ) {
|
4424 | handlers.delegateCount--;
|
4425 | }
|
4426 | if ( special.remove ) {
|
4427 | special.remove.call( elem, handleObj );
|
4428 | }
|
4429 | }
|
4430 | }
|
4431 |
|
4432 |
|
4433 |
|
4434 | if ( origCount && !handlers.length ) {
|
4435 | if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
|
4436 | jQuery.removeEvent( elem, type, elemData.handle );
|
4437 | }
|
4438 |
|
4439 | delete events[ type ];
|
4440 | }
|
4441 | }
|
4442 |
|
4443 |
|
4444 | if ( jQuery.isEmptyObject( events ) ) {
|
4445 | delete elemData.handle;
|
4446 | data_priv.remove( elem, "events" );
|
4447 | }
|
4448 | },
|
4449 |
|
4450 | trigger: function( event, data, elem, onlyHandlers ) {
|
4451 |
|
4452 | var i, cur, tmp, bubbleType, ontype, handle, special,
|
4453 | eventPath = [ elem || document ],
|
4454 | type = core_hasOwn.call( event, "type" ) ? event.type : event,
|
4455 | namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
|
4456 |
|
4457 | cur = tmp = elem = elem || document;
|
4458 |
|
4459 |
|
4460 | if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
|
4461 | return;
|
4462 | }
|
4463 |
|
4464 |
|
4465 | if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
|
4466 | return;
|
4467 | }
|
4468 |
|
4469 | if ( type.indexOf(".") >= 0 ) {
|
4470 |
|
4471 | namespaces = type.split(".");
|
4472 | type = namespaces.shift();
|
4473 | namespaces.sort();
|
4474 | }
|
4475 | ontype = type.indexOf(":") < 0 && "on" + type;
|
4476 |
|
4477 |
|
4478 | event = event[ jQuery.expando ] ?
|
4479 | event :
|
4480 | new jQuery.Event( type, typeof event === "object" && event );
|
4481 |
|
4482 |
|
4483 | event.isTrigger = onlyHandlers ? 2 : 3;
|
4484 | event.namespace = namespaces.join(".");
|
4485 | event.namespace_re = event.namespace ?
|
4486 | new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
|
4487 | null;
|
4488 |
|
4489 |
|
4490 | event.result = undefined;
|
4491 | if ( !event.target ) {
|
4492 | event.target = elem;
|
4493 | }
|
4494 |
|
4495 |
|
4496 | data = data == null ?
|
4497 | [ event ] :
|
4498 | jQuery.makeArray( data, [ event ] );
|
4499 |
|
4500 |
|
4501 | special = jQuery.event.special[ type ] || {};
|
4502 | if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
|
4503 | return;
|
4504 | }
|
4505 |
|
4506 |
|
4507 |
|
4508 | if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
|
4509 |
|
4510 | bubbleType = special.delegateType || type;
|
4511 | if ( !rfocusMorph.test( bubbleType + type ) ) {
|
4512 | cur = cur.parentNode;
|
4513 | }
|
4514 | for ( ; cur; cur = cur.parentNode ) {
|
4515 | eventPath.push( cur );
|
4516 | tmp = cur;
|
4517 | }
|
4518 |
|
4519 |
|
4520 | if ( tmp === (elem.ownerDocument || document) ) {
|
4521 | eventPath.push( tmp.defaultView || tmp.parentWindow || window );
|
4522 | }
|
4523 | }
|
4524 |
|
4525 |
|
4526 | i = 0;
|
4527 | while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
|
4528 |
|
4529 | event.type = i > 1 ?
|
4530 | bubbleType :
|
4531 | special.bindType || type;
|
4532 |
|
4533 |
|
4534 | handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
|
4535 | if ( handle ) {
|
4536 | handle.apply( cur, data );
|
4537 | }
|
4538 |
|
4539 |
|
4540 | handle = ontype && cur[ ontype ];
|
4541 | if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
|
4542 | event.preventDefault();
|
4543 | }
|
4544 | }
|
4545 | event.type = type;
|
4546 |
|
4547 |
|
4548 | if ( !onlyHandlers && !event.isDefaultPrevented() ) {
|
4549 |
|
4550 | if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
|
4551 | jQuery.acceptData( elem ) ) {
|
4552 |
|
4553 |
|
4554 |
|
4555 | if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
|
4556 |
|
4557 |
|
4558 | tmp = elem[ ontype ];
|
4559 |
|
4560 | if ( tmp ) {
|
4561 | elem[ ontype ] = null;
|
4562 | }
|
4563 |
|
4564 |
|
4565 | jQuery.event.triggered = type;
|
4566 | elem[ type ]();
|
4567 | jQuery.event.triggered = undefined;
|
4568 |
|
4569 | if ( tmp ) {
|
4570 | elem[ ontype ] = tmp;
|
4571 | }
|
4572 | }
|
4573 | }
|
4574 | }
|
4575 |
|
4576 | return event.result;
|
4577 | },
|
4578 |
|
4579 | dispatch: function( event ) {
|
4580 |
|
4581 |
|
4582 | event = jQuery.event.fix( event );
|
4583 |
|
4584 | var i, j, ret, matched, handleObj,
|
4585 | handlerQueue = [],
|
4586 | args = core_slice.call( arguments ),
|
4587 | handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
|
4588 | special = jQuery.event.special[ event.type ] || {};
|
4589 |
|
4590 |
|
4591 | args[0] = event;
|
4592 | event.delegateTarget = this;
|
4593 |
|
4594 |
|
4595 | if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
|
4596 | return;
|
4597 | }
|
4598 |
|
4599 |
|
4600 | handlerQueue = jQuery.event.handlers.call( this, event, handlers );
|
4601 |
|
4602 |
|
4603 | i = 0;
|
4604 | while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
|
4605 | event.currentTarget = matched.elem;
|
4606 |
|
4607 | j = 0;
|
4608 | while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
|
4609 |
|
4610 |
|
4611 |
|
4612 | if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
|
4613 |
|
4614 | event.handleObj = handleObj;
|
4615 | event.data = handleObj.data;
|
4616 |
|
4617 | ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
|
4618 | .apply( matched.elem, args );
|
4619 |
|
4620 | if ( ret !== undefined ) {
|
4621 | if ( (event.result = ret) === false ) {
|
4622 | event.preventDefault();
|
4623 | event.stopPropagation();
|
4624 | }
|
4625 | }
|
4626 | }
|
4627 | }
|
4628 | }
|
4629 |
|
4630 |
|
4631 | if ( special.postDispatch ) {
|
4632 | special.postDispatch.call( this, event );
|
4633 | }
|
4634 |
|
4635 | return event.result;
|
4636 | },
|
4637 |
|
4638 | handlers: function( event, handlers ) {
|
4639 | var i, matches, sel, handleObj,
|
4640 | handlerQueue = [],
|
4641 | delegateCount = handlers.delegateCount,
|
4642 | cur = event.target;
|
4643 |
|
4644 |
|
4645 |
|
4646 |
|
4647 | if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
|
4648 |
|
4649 | for ( ; cur !== this; cur = cur.parentNode || this ) {
|
4650 |
|
4651 |
|
4652 | if ( cur.disabled !== true || event.type !== "click" ) {
|
4653 | matches = [];
|
4654 | for ( i = 0; i < delegateCount; i++ ) {
|
4655 | handleObj = handlers[ i ];
|
4656 |
|
4657 |
|
4658 | sel = handleObj.selector + " ";
|
4659 |
|
4660 | if ( matches[ sel ] === undefined ) {
|
4661 | matches[ sel ] = handleObj.needsContext ?
|
4662 | jQuery( sel, this ).index( cur ) >= 0 :
|
4663 | jQuery.find( sel, this, null, [ cur ] ).length;
|
4664 | }
|
4665 | if ( matches[ sel ] ) {
|
4666 | matches.push( handleObj );
|
4667 | }
|
4668 | }
|
4669 | if ( matches.length ) {
|
4670 | handlerQueue.push({ elem: cur, handlers: matches });
|
4671 | }
|
4672 | }
|
4673 | }
|
4674 | }
|
4675 |
|
4676 |
|
4677 | if ( delegateCount < handlers.length ) {
|
4678 | handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
|
4679 | }
|
4680 |
|
4681 | return handlerQueue;
|
4682 | },
|
4683 |
|
4684 |
|
4685 | props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
|
4686 |
|
4687 | fixHooks: {},
|
4688 |
|
4689 | keyHooks: {
|
4690 | props: "char charCode key keyCode".split(" "),
|
4691 | filter: function( event, original ) {
|
4692 |
|
4693 |
|
4694 | if ( event.which == null ) {
|
4695 | event.which = original.charCode != null ? original.charCode : original.keyCode;
|
4696 | }
|
4697 |
|
4698 | return event;
|
4699 | }
|
4700 | },
|
4701 |
|
4702 | mouseHooks: {
|
4703 | props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
|
4704 | filter: function( event, original ) {
|
4705 | var eventDoc, doc, body,
|
4706 | button = original.button;
|
4707 |
|
4708 |
|
4709 | if ( event.pageX == null && original.clientX != null ) {
|
4710 | eventDoc = event.target.ownerDocument || document;
|
4711 | doc = eventDoc.documentElement;
|
4712 | body = eventDoc.body;
|
4713 |
|
4714 | event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
|
4715 | event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
|
4716 | }
|
4717 |
|
4718 |
|
4719 |
|
4720 | if ( !event.which && button !== undefined ) {
|
4721 | event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
|
4722 | }
|
4723 |
|
4724 | return event;
|
4725 | }
|
4726 | },
|
4727 |
|
4728 | fix: function( event ) {
|
4729 | if ( event[ jQuery.expando ] ) {
|
4730 | return event;
|
4731 | }
|
4732 |
|
4733 |
|
4734 | var i, prop, copy,
|
4735 | type = event.type,
|
4736 | originalEvent = event,
|
4737 | fixHook = this.fixHooks[ type ];
|
4738 |
|
4739 | if ( !fixHook ) {
|
4740 | this.fixHooks[ type ] = fixHook =
|
4741 | rmouseEvent.test( type ) ? this.mouseHooks :
|
4742 | rkeyEvent.test( type ) ? this.keyHooks :
|
4743 | {};
|
4744 | }
|
4745 | copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
|
4746 |
|
4747 | event = new jQuery.Event( originalEvent );
|
4748 |
|
4749 | i = copy.length;
|
4750 | while ( i-- ) {
|
4751 | prop = copy[ i ];
|
4752 | event[ prop ] = originalEvent[ prop ];
|
4753 | }
|
4754 |
|
4755 |
|
4756 |
|
4757 | if ( event.target.nodeType === 3 ) {
|
4758 | event.target = event.target.parentNode;
|
4759 | }
|
4760 |
|
4761 | return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
|
4762 | },
|
4763 |
|
4764 | special: {
|
4765 | load: {
|
4766 |
|
4767 | noBubble: true
|
4768 | },
|
4769 | focus: {
|
4770 |
|
4771 | trigger: function() {
|
4772 | if ( this !== safeActiveElement() && this.focus ) {
|
4773 | this.focus();
|
4774 | return false;
|
4775 | }
|
4776 | },
|
4777 | delegateType: "focusin"
|
4778 | },
|
4779 | blur: {
|
4780 | trigger: function() {
|
4781 | if ( this === safeActiveElement() && this.blur ) {
|
4782 | this.blur();
|
4783 | return false;
|
4784 | }
|
4785 | },
|
4786 | delegateType: "focusout"
|
4787 | },
|
4788 | click: {
|
4789 |
|
4790 | trigger: function() {
|
4791 | if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
|
4792 | this.click();
|
4793 | return false;
|
4794 | }
|
4795 | },
|
4796 |
|
4797 |
|
4798 | _default: function( event ) {
|
4799 | return jQuery.nodeName( event.target, "a" );
|
4800 | }
|
4801 | },
|
4802 |
|
4803 | beforeunload: {
|
4804 | postDispatch: function( event ) {
|
4805 |
|
4806 |
|
4807 |
|
4808 | if ( event.result !== undefined ) {
|
4809 | event.originalEvent.returnValue = event.result;
|
4810 | }
|
4811 | }
|
4812 | }
|
4813 | },
|
4814 |
|
4815 | simulate: function( type, elem, event, bubble ) {
|
4816 |
|
4817 |
|
4818 |
|
4819 | var e = jQuery.extend(
|
4820 | new jQuery.Event(),
|
4821 | event,
|
4822 | {
|
4823 | type: type,
|
4824 | isSimulated: true,
|
4825 | originalEvent: {}
|
4826 | }
|
4827 | );
|
4828 | if ( bubble ) {
|
4829 | jQuery.event.trigger( e, null, elem );
|
4830 | } else {
|
4831 | jQuery.event.dispatch.call( elem, e );
|
4832 | }
|
4833 | if ( e.isDefaultPrevented() ) {
|
4834 | event.preventDefault();
|
4835 | }
|
4836 | }
|
4837 | };
|
4838 |
|
4839 | jQuery.removeEvent = function( elem, type, handle ) {
|
4840 | if ( elem.removeEventListener ) {
|
4841 | elem.removeEventListener( type, handle, false );
|
4842 | }
|
4843 | };
|
4844 |
|
4845 | jQuery.Event = function( src, props ) {
|
4846 |
|
4847 | if ( !(this instanceof jQuery.Event) ) {
|
4848 | return new jQuery.Event( src, props );
|
4849 | }
|
4850 |
|
4851 |
|
4852 | if ( src && src.type ) {
|
4853 | this.originalEvent = src;
|
4854 | this.type = src.type;
|
4855 |
|
4856 |
|
4857 |
|
4858 | this.isDefaultPrevented = ( src.defaultPrevented ||
|
4859 | src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
|
4860 |
|
4861 |
|
4862 | } else {
|
4863 | this.type = src;
|
4864 | }
|
4865 |
|
4866 |
|
4867 | if ( props ) {
|
4868 | jQuery.extend( this, props );
|
4869 | }
|
4870 |
|
4871 |
|
4872 | this.timeStamp = src && src.timeStamp || jQuery.now();
|
4873 |
|
4874 |
|
4875 | this[ jQuery.expando ] = true;
|
4876 | };
|
4877 |
|
4878 |
|
4879 |
|
4880 | jQuery.Event.prototype = {
|
4881 | isDefaultPrevented: returnFalse,
|
4882 | isPropagationStopped: returnFalse,
|
4883 | isImmediatePropagationStopped: returnFalse,
|
4884 |
|
4885 | preventDefault: function() {
|
4886 | var e = this.originalEvent;
|
4887 |
|
4888 | this.isDefaultPrevented = returnTrue;
|
4889 |
|
4890 | if ( e && e.preventDefault ) {
|
4891 | e.preventDefault();
|
4892 | }
|
4893 | },
|
4894 | stopPropagation: function() {
|
4895 | var e = this.originalEvent;
|
4896 |
|
4897 | this.isPropagationStopped = returnTrue;
|
4898 |
|
4899 | if ( e && e.stopPropagation ) {
|
4900 | e.stopPropagation();
|
4901 | }
|
4902 | },
|
4903 | stopImmediatePropagation: function() {
|
4904 | this.isImmediatePropagationStopped = returnTrue;
|
4905 | this.stopPropagation();
|
4906 | }
|
4907 | };
|
4908 |
|
4909 |
|
4910 |
|
4911 | jQuery.each({
|
4912 | mouseenter: "mouseover",
|
4913 | mouseleave: "mouseout"
|
4914 | }, function( orig, fix ) {
|
4915 | jQuery.event.special[ orig ] = {
|
4916 | delegateType: fix,
|
4917 | bindType: fix,
|
4918 |
|
4919 | handle: function( event ) {
|
4920 | var ret,
|
4921 | target = this,
|
4922 | related = event.relatedTarget,
|
4923 | handleObj = event.handleObj;
|
4924 |
|
4925 |
|
4926 |
|
4927 | if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
|
4928 | event.type = handleObj.origType;
|
4929 | ret = handleObj.handler.apply( this, arguments );
|
4930 | event.type = fix;
|
4931 | }
|
4932 | return ret;
|
4933 | }
|
4934 | };
|
4935 | });
|
4936 |
|
4937 |
|
4938 |
|
4939 | if ( !jQuery.support.focusinBubbles ) {
|
4940 | jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
|
4941 |
|
4942 |
|
4943 | var attaches = 0,
|
4944 | handler = function( event ) {
|
4945 | jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
|
4946 | };
|
4947 |
|
4948 | jQuery.event.special[ fix ] = {
|
4949 | setup: function() {
|
4950 | if ( attaches++ === 0 ) {
|
4951 | document.addEventListener( orig, handler, true );
|
4952 | }
|
4953 | },
|
4954 | teardown: function() {
|
4955 | if ( --attaches === 0 ) {
|
4956 | document.removeEventListener( orig, handler, true );
|
4957 | }
|
4958 | }
|
4959 | };
|
4960 | });
|
4961 | }
|
4962 |
|
4963 | jQuery.fn.extend({
|
4964 |
|
4965 | on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
|
4966 | var origFn, type;
|
4967 |
|
4968 |
|
4969 | if ( typeof types === "object" ) {
|
4970 |
|
4971 | if ( typeof selector !== "string" ) {
|
4972 |
|
4973 | data = data || selector;
|
4974 | selector = undefined;
|
4975 | }
|
4976 | for ( type in types ) {
|
4977 | this.on( type, selector, data, types[ type ], one );
|
4978 | }
|
4979 | return this;
|
4980 | }
|
4981 |
|
4982 | if ( data == null && fn == null ) {
|
4983 |
|
4984 | fn = selector;
|
4985 | data = selector = undefined;
|
4986 | } else if ( fn == null ) {
|
4987 | if ( typeof selector === "string" ) {
|
4988 |
|
4989 | fn = data;
|
4990 | data = undefined;
|
4991 | } else {
|
4992 |
|
4993 | fn = data;
|
4994 | data = selector;
|
4995 | selector = undefined;
|
4996 | }
|
4997 | }
|
4998 | if ( fn === false ) {
|
4999 | fn = returnFalse;
|
5000 | } else if ( !fn ) {
|
5001 | return this;
|
5002 | }
|
5003 |
|
5004 | if ( one === 1 ) {
|
5005 | origFn = fn;
|
5006 | fn = function( event ) {
|
5007 |
|
5008 | jQuery().off( event );
|
5009 | return origFn.apply( this, arguments );
|
5010 | };
|
5011 |
|
5012 | fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
|
5013 | }
|
5014 | return this.each( function() {
|
5015 | jQuery.event.add( this, types, fn, data, selector );
|
5016 | });
|
5017 | },
|
5018 | one: function( types, selector, data, fn ) {
|
5019 | return this.on( types, selector, data, fn, 1 );
|
5020 | },
|
5021 | off: function( types, selector, fn ) {
|
5022 | var handleObj, type;
|
5023 | if ( types && types.preventDefault && types.handleObj ) {
|
5024 |
|
5025 | handleObj = types.handleObj;
|
5026 | jQuery( types.delegateTarget ).off(
|
5027 | handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
|
5028 | handleObj.selector,
|
5029 | handleObj.handler
|
5030 | );
|
5031 | return this;
|
5032 | }
|
5033 | if ( typeof types === "object" ) {
|
5034 |
|
5035 | for ( type in types ) {
|
5036 | this.off( type, selector, types[ type ] );
|
5037 | }
|
5038 | return this;
|
5039 | }
|
5040 | if ( selector === false || typeof selector === "function" ) {
|
5041 |
|
5042 | fn = selector;
|
5043 | selector = undefined;
|
5044 | }
|
5045 | if ( fn === false ) {
|
5046 | fn = returnFalse;
|
5047 | }
|
5048 | return this.each(function() {
|
5049 | jQuery.event.remove( this, types, fn, selector );
|
5050 | });
|
5051 | },
|
5052 |
|
5053 | trigger: function( type, data ) {
|
5054 | return this.each(function() {
|
5055 | jQuery.event.trigger( type, data, this );
|
5056 | });
|
5057 | },
|
5058 | triggerHandler: function( type, data ) {
|
5059 | var elem = this[0];
|
5060 | if ( elem ) {
|
5061 | return jQuery.event.trigger( type, data, elem, true );
|
5062 | }
|
5063 | }
|
5064 | });
|
5065 | var isSimple = /^.[^:#\[\.,]*$/,
|
5066 | rneedsContext = jQuery.expr.match.needsContext,
|
5067 |
|
5068 | guaranteedUnique = {
|
5069 | children: true,
|
5070 | contents: true,
|
5071 | next: true,
|
5072 | prev: true
|
5073 | };
|
5074 |
|
5075 | jQuery.fn.extend({
|
5076 | find: function( selector ) {
|
5077 | var self, matched, i,
|
5078 | l = this.length;
|
5079 |
|
5080 | if ( typeof selector !== "string" ) {
|
5081 | self = this;
|
5082 | return this.pushStack( jQuery( selector ).filter(function() {
|
5083 | for ( i = 0; i < l; i++ ) {
|
5084 | if ( jQuery.contains( self[ i ], this ) ) {
|
5085 | return true;
|
5086 | }
|
5087 | }
|
5088 | }) );
|
5089 | }
|
5090 |
|
5091 | matched = [];
|
5092 | for ( i = 0; i < l; i++ ) {
|
5093 | jQuery.find( selector, this[ i ], matched );
|
5094 | }
|
5095 |
|
5096 |
|
5097 | matched = this.pushStack( l > 1 ? jQuery.unique( matched ) : matched );
|
5098 | matched.selector = ( this.selector ? this.selector + " " : "" ) + selector;
|
5099 | return matched;
|
5100 | },
|
5101 |
|
5102 | has: function( target ) {
|
5103 | var targets = jQuery( target, this ),
|
5104 | l = targets.length;
|
5105 |
|
5106 | return this.filter(function() {
|
5107 | var i = 0;
|
5108 | for ( ; i < l; i++ ) {
|
5109 | if ( jQuery.contains( this, targets[i] ) ) {
|
5110 | return true;
|
5111 | }
|
5112 | }
|
5113 | });
|
5114 | },
|
5115 |
|
5116 | not: function( selector ) {
|
5117 | return this.pushStack( winnow(this, selector || [], true) );
|
5118 | },
|
5119 |
|
5120 | filter: function( selector ) {
|
5121 | return this.pushStack( winnow(this, selector || [], false) );
|
5122 | },
|
5123 |
|
5124 | is: function( selector ) {
|
5125 | return !!selector && (
|
5126 | typeof selector === "string" ?
|
5127 |
|
5128 |
|
5129 | rneedsContext.test( selector ) ?
|
5130 | jQuery( selector, this.context ).index( this[ 0 ] ) >= 0 :
|
5131 | jQuery.filter( selector, this ).length > 0 :
|
5132 | this.filter( selector ).length > 0 );
|
5133 | },
|
5134 |
|
5135 | closest: function( selectors, context ) {
|
5136 | var cur,
|
5137 | i = 0,
|
5138 | l = this.length,
|
5139 | matched = [],
|
5140 | pos = ( rneedsContext.test( selectors ) || typeof selectors !== "string" ) ?
|
5141 | jQuery( selectors, context || this.context ) :
|
5142 | 0;
|
5143 |
|
5144 | for ( ; i < l; i++ ) {
|
5145 | for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
|
5146 |
|
5147 | if ( cur.nodeType < 11 && (pos ?
|
5148 | pos.index(cur) > -1 :
|
5149 |
|
5150 |
|
5151 | cur.nodeType === 1 &&
|
5152 | jQuery.find.matchesSelector(cur, selectors)) ) {
|
5153 |
|
5154 | cur = matched.push( cur );
|
5155 | break;
|
5156 | }
|
5157 | }
|
5158 | }
|
5159 |
|
5160 | return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
|
5161 | },
|
5162 |
|
5163 |
|
5164 |
|
5165 | index: function( elem ) {
|
5166 |
|
5167 |
|
5168 | if ( !elem ) {
|
5169 | return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
|
5170 | }
|
5171 |
|
5172 |
|
5173 | if ( typeof elem === "string" ) {
|
5174 | return core_indexOf.call( jQuery( elem ), this[ 0 ] );
|
5175 | }
|
5176 |
|
5177 |
|
5178 | return core_indexOf.call( this,
|
5179 |
|
5180 |
|
5181 | elem.jquery ? elem[ 0 ] : elem
|
5182 | );
|
5183 | },
|
5184 |
|
5185 | add: function( selector, context ) {
|
5186 | var set = typeof selector === "string" ?
|
5187 | jQuery( selector, context ) :
|
5188 | jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
|
5189 | all = jQuery.merge( this.get(), set );
|
5190 |
|
5191 | return this.pushStack( jQuery.unique(all) );
|
5192 | },
|
5193 |
|
5194 | addBack: function( selector ) {
|
5195 | return this.add( selector == null ?
|
5196 | this.prevObject : this.prevObject.filter(selector)
|
5197 | );
|
5198 | }
|
5199 | });
|
5200 |
|
5201 | function sibling( cur, dir ) {
|
5202 | while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
|
5203 |
|
5204 | return cur;
|
5205 | }
|
5206 |
|
5207 | jQuery.each({
|
5208 | parent: function( elem ) {
|
5209 | var parent = elem.parentNode;
|
5210 | return parent && parent.nodeType !== 11 ? parent : null;
|
5211 | },
|
5212 | parents: function( elem ) {
|
5213 | return jQuery.dir( elem, "parentNode" );
|
5214 | },
|
5215 | parentsUntil: function( elem, i, until ) {
|
5216 | return jQuery.dir( elem, "parentNode", until );
|
5217 | },
|
5218 | next: function( elem ) {
|
5219 | return sibling( elem, "nextSibling" );
|
5220 | },
|
5221 | prev: function( elem ) {
|
5222 | return sibling( elem, "previousSibling" );
|
5223 | },
|
5224 | nextAll: function( elem ) {
|
5225 | return jQuery.dir( elem, "nextSibling" );
|
5226 | },
|
5227 | prevAll: function( elem ) {
|
5228 | return jQuery.dir( elem, "previousSibling" );
|
5229 | },
|
5230 | nextUntil: function( elem, i, until ) {
|
5231 | return jQuery.dir( elem, "nextSibling", until );
|
5232 | },
|
5233 | prevUntil: function( elem, i, until ) {
|
5234 | return jQuery.dir( elem, "previousSibling", until );
|
5235 | },
|
5236 | siblings: function( elem ) {
|
5237 | return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
|
5238 | },
|
5239 | children: function( elem ) {
|
5240 | return jQuery.sibling( elem.firstChild );
|
5241 | },
|
5242 | contents: function( elem ) {
|
5243 | return jQuery.nodeName( elem, "iframe" ) ?
|
5244 | elem.contentDocument || elem.contentWindow.document :
|
5245 | jQuery.merge( [], elem.childNodes );
|
5246 | }
|
5247 | }, function( name, fn ) {
|
5248 | jQuery.fn[ name ] = function( until, selector ) {
|
5249 | var matched = jQuery.map( this, fn, until );
|
5250 |
|
5251 | if ( name.slice( -5 ) !== "Until" ) {
|
5252 | selector = until;
|
5253 | }
|
5254 |
|
5255 | if ( selector && typeof selector === "string" ) {
|
5256 | matched = jQuery.filter( selector, matched );
|
5257 | }
|
5258 |
|
5259 | if ( this.length > 1 ) {
|
5260 |
|
5261 | if ( !guaranteedUnique[ name ] ) {
|
5262 | jQuery.unique( matched );
|
5263 | }
|
5264 |
|
5265 |
|
5266 | if ( name[ 0 ] === "p" ) {
|
5267 | matched.reverse();
|
5268 | }
|
5269 | }
|
5270 |
|
5271 | return this.pushStack( matched );
|
5272 | };
|
5273 | });
|
5274 |
|
5275 | jQuery.extend({
|
5276 | filter: function( expr, elems, not ) {
|
5277 | var elem = elems[ 0 ];
|
5278 |
|
5279 | if ( not ) {
|
5280 | expr = ":not(" + expr + ")";
|
5281 | }
|
5282 |
|
5283 | return elems.length === 1 && elem.nodeType === 1 ?
|
5284 | jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
|
5285 | jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
|
5286 | return elem.nodeType === 1;
|
5287 | }));
|
5288 | },
|
5289 |
|
5290 | dir: function( elem, dir, until ) {
|
5291 | var matched = [],
|
5292 | truncate = until !== undefined;
|
5293 |
|
5294 | while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
|
5295 | if ( elem.nodeType === 1 ) {
|
5296 | if ( truncate && jQuery( elem ).is( until ) ) {
|
5297 | break;
|
5298 | }
|
5299 | matched.push( elem );
|
5300 | }
|
5301 | }
|
5302 | return matched;
|
5303 | },
|
5304 |
|
5305 | sibling: function( n, elem ) {
|
5306 | var matched = [];
|
5307 |
|
5308 | for ( ; n; n = n.nextSibling ) {
|
5309 | if ( n.nodeType === 1 && n !== elem ) {
|
5310 | matched.push( n );
|
5311 | }
|
5312 | }
|
5313 |
|
5314 | return matched;
|
5315 | }
|
5316 | });
|
5317 |
|
5318 |
|
5319 | function winnow( elements, qualifier, not ) {
|
5320 | if ( jQuery.isFunction( qualifier ) ) {
|
5321 | return jQuery.grep( elements, function( elem, i ) {
|
5322 |
|
5323 | return !!qualifier.call( elem, i, elem ) !== not;
|
5324 | });
|
5325 |
|
5326 | }
|
5327 |
|
5328 | if ( qualifier.nodeType ) {
|
5329 | return jQuery.grep( elements, function( elem ) {
|
5330 | return ( elem === qualifier ) !== not;
|
5331 | });
|
5332 |
|
5333 | }
|
5334 |
|
5335 | if ( typeof qualifier === "string" ) {
|
5336 | if ( isSimple.test( qualifier ) ) {
|
5337 | return jQuery.filter( qualifier, elements, not );
|
5338 | }
|
5339 |
|
5340 | qualifier = jQuery.filter( qualifier, elements );
|
5341 | }
|
5342 |
|
5343 | return jQuery.grep( elements, function( elem ) {
|
5344 | return ( core_indexOf.call( qualifier, elem ) >= 0 ) !== not;
|
5345 | });
|
5346 | }
|
5347 | var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
|
5348 | rtagName = /<([\w:]+)/,
|
5349 | rhtml = /<|&#?\w+;/,
|
5350 | rnoInnerhtml = /<(?:script|style|link)/i,
|
5351 | manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
|
5352 |
|
5353 | rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
5354 | rscriptType = /^$|\/(?:java|ecma)script/i,
|
5355 | rscriptTypeMasked = /^true\/(.*)/,
|
5356 | rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
|
5357 |
|
5358 |
|
5359 | wrapMap = {
|
5360 |
|
5361 |
|
5362 | option: [ 1, "<select multiple='multiple'>", "</select>" ],
|
5363 |
|
5364 | thead: [ 1, "<table>", "</table>" ],
|
5365 | tr: [ 2, "<table><tbody>", "</tbody></table>" ],
|
5366 | td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
|
5367 |
|
5368 | _default: [ 0, "", "" ]
|
5369 | };
|
5370 |
|
5371 |
|
5372 | wrapMap.optgroup = wrapMap.option;
|
5373 |
|
5374 | wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.col = wrapMap.thead;
|
5375 | wrapMap.th = wrapMap.td;
|
5376 |
|
5377 | jQuery.fn.extend({
|
5378 | text: function( value ) {
|
5379 | return jQuery.access( this, function( value ) {
|
5380 | return value === undefined ?
|
5381 | jQuery.text( this ) :
|
5382 | this.empty().append( ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) );
|
5383 | }, null, value, arguments.length );
|
5384 | },
|
5385 |
|
5386 | append: function() {
|
5387 | return this.domManip( arguments, function( elem ) {
|
5388 | if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
|
5389 | var target = manipulationTarget( this, elem );
|
5390 | target.appendChild( elem );
|
5391 | }
|
5392 | });
|
5393 | },
|
5394 |
|
5395 | prepend: function() {
|
5396 | return this.domManip( arguments, function( elem ) {
|
5397 | if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
|
5398 | var target = manipulationTarget( this, elem );
|
5399 | target.insertBefore( elem, target.firstChild );
|
5400 | }
|
5401 | });
|
5402 | },
|
5403 |
|
5404 | before: function() {
|
5405 | return this.domManip( arguments, function( elem ) {
|
5406 | if ( this.parentNode ) {
|
5407 | this.parentNode.insertBefore( elem, this );
|
5408 | }
|
5409 | });
|
5410 | },
|
5411 |
|
5412 | after: function() {
|
5413 | return this.domManip( arguments, function( elem ) {
|
5414 | if ( this.parentNode ) {
|
5415 | this.parentNode.insertBefore( elem, this.nextSibling );
|
5416 | }
|
5417 | });
|
5418 | },
|
5419 |
|
5420 |
|
5421 | remove: function( selector, keepData ) {
|
5422 | var elem,
|
5423 | elems = selector ? jQuery.filter( selector, this ) : this,
|
5424 | i = 0;
|
5425 |
|
5426 | for ( ; (elem = elems[i]) != null; i++ ) {
|
5427 | if ( !keepData && elem.nodeType === 1 ) {
|
5428 | jQuery.cleanData( getAll( elem ) );
|
5429 | }
|
5430 |
|
5431 | if ( elem.parentNode ) {
|
5432 | if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
|
5433 | setGlobalEval( getAll( elem, "script" ) );
|
5434 | }
|
5435 | elem.parentNode.removeChild( elem );
|
5436 | }
|
5437 | }
|
5438 |
|
5439 | return this;
|
5440 | },
|
5441 |
|
5442 | empty: function() {
|
5443 | var elem,
|
5444 | i = 0;
|
5445 |
|
5446 | for ( ; (elem = this[i]) != null; i++ ) {
|
5447 | if ( elem.nodeType === 1 ) {
|
5448 |
|
5449 |
|
5450 | jQuery.cleanData( getAll( elem, false ) );
|
5451 |
|
5452 |
|
5453 | elem.textContent = "";
|
5454 | }
|
5455 | }
|
5456 |
|
5457 | return this;
|
5458 | },
|
5459 |
|
5460 | clone: function( dataAndEvents, deepDataAndEvents ) {
|
5461 | dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
|
5462 | deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
|
5463 |
|
5464 | return this.map( function () {
|
5465 | return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
|
5466 | });
|
5467 | },
|
5468 |
|
5469 | html: function( value ) {
|
5470 | return jQuery.access( this, function( value ) {
|
5471 | var elem = this[ 0 ] || {},
|
5472 | i = 0,
|
5473 | l = this.length;
|
5474 |
|
5475 | if ( value === undefined && elem.nodeType === 1 ) {
|
5476 | return elem.innerHTML;
|
5477 | }
|
5478 |
|
5479 |
|
5480 | if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
|
5481 | !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
|
5482 |
|
5483 | value = value.replace( rxhtmlTag, "<$1></$2>" );
|
5484 |
|
5485 | try {
|
5486 | for ( ; i < l; i++ ) {
|
5487 | elem = this[ i ] || {};
|
5488 |
|
5489 |
|
5490 | if ( elem.nodeType === 1 ) {
|
5491 | jQuery.cleanData( getAll( elem, false ) );
|
5492 | elem.innerHTML = value;
|
5493 | }
|
5494 | }
|
5495 |
|
5496 | elem = 0;
|
5497 |
|
5498 |
|
5499 | } catch( e ) {}
|
5500 | }
|
5501 |
|
5502 | if ( elem ) {
|
5503 | this.empty().append( value );
|
5504 | }
|
5505 | }, null, value, arguments.length );
|
5506 | },
|
5507 |
|
5508 | replaceWith: function() {
|
5509 | var
|
5510 |
|
5511 | args = jQuery.map( this, function( elem ) {
|
5512 | return [ elem.nextSibling, elem.parentNode ];
|
5513 | }),
|
5514 | i = 0;
|
5515 |
|
5516 |
|
5517 | this.domManip( arguments, function( elem ) {
|
5518 | var next = args[ i++ ],
|
5519 | parent = args[ i++ ];
|
5520 |
|
5521 | if ( parent ) {
|
5522 | jQuery( this ).remove();
|
5523 | parent.insertBefore( elem, next );
|
5524 | }
|
5525 |
|
5526 | }, true );
|
5527 |
|
5528 |
|
5529 | return i ? this : this.remove();
|
5530 | },
|
5531 |
|
5532 | detach: function( selector ) {
|
5533 | return this.remove( selector, true );
|
5534 | },
|
5535 |
|
5536 | domManip: function( args, callback, allowIntersection ) {
|
5537 |
|
5538 |
|
5539 | args = core_concat.apply( [], args );
|
5540 |
|
5541 | var fragment, first, scripts, hasScripts, node, doc,
|
5542 | i = 0,
|
5543 | l = this.length,
|
5544 | set = this,
|
5545 | iNoClone = l - 1,
|
5546 | value = args[ 0 ],
|
5547 | isFunction = jQuery.isFunction( value );
|
5548 |
|
5549 | // We can't cloneNode fragments that contain checked, in WebKit
|
5550 | if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
|
5551 | return this.each(function( index ) {
|
5552 | var self = set.eq( index );
|
5553 | if ( isFunction ) {
|
5554 | args[ 0 ] = value.call( this, index, self.html() );
|
5555 | }
|
5556 | self.domManip( args, callback, allowIntersection );
|
5557 | });
|
5558 | }
|
5559 |
|
5560 | if ( l ) {
|
5561 | fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );
|
5562 | first = fragment.firstChild;
|
5563 |
|
5564 | if ( fragment.childNodes.length === 1 ) {
|
5565 | fragment = first;
|
5566 | }
|
5567 |
|
5568 | if ( first ) {
|
5569 | scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
|
5570 | hasScripts = scripts.length;
|
5571 |
|
5572 |
|
5573 |
|
5574 | for ( ; i < l; i++ ) {
|
5575 | node = fragment;
|
5576 |
|
5577 | if ( i !== iNoClone ) {
|
5578 | node = jQuery.clone( node, true, true );
|
5579 |
|
5580 |
|
5581 | if ( hasScripts ) {
|
5582 |
|
5583 |
|
5584 | jQuery.merge( scripts, getAll( node, "script" ) );
|
5585 | }
|
5586 | }
|
5587 |
|
5588 | callback.call( this[ i ], node, i );
|
5589 | }
|
5590 |
|
5591 | if ( hasScripts ) {
|
5592 | doc = scripts[ scripts.length - 1 ].ownerDocument;
|
5593 |
|
5594 |
|
5595 | jQuery.map( scripts, restoreScript );
|
5596 |
|
5597 |
|
5598 | for ( i = 0; i < hasScripts; i++ ) {
|
5599 | node = scripts[ i ];
|
5600 | if ( rscriptType.test( node.type || "" ) &&
|
5601 | !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
|
5602 |
|
5603 | if ( node.src ) {
|
5604 |
|
5605 | jQuery._evalUrl( node.src );
|
5606 | } else {
|
5607 | jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
|
5608 | }
|
5609 | }
|
5610 | }
|
5611 | }
|
5612 | }
|
5613 | }
|
5614 |
|
5615 | return this;
|
5616 | }
|
5617 | });
|
5618 |
|
5619 | jQuery.each({
|
5620 | appendTo: "append",
|
5621 | prependTo: "prepend",
|
5622 | insertBefore: "before",
|
5623 | insertAfter: "after",
|
5624 | replaceAll: "replaceWith"
|
5625 | }, function( name, original ) {
|
5626 | jQuery.fn[ name ] = function( selector ) {
|
5627 | var elems,
|
5628 | ret = [],
|
5629 | insert = jQuery( selector ),
|
5630 | last = insert.length - 1,
|
5631 | i = 0;
|
5632 |
|
5633 | for ( ; i <= last; i++ ) {
|
5634 | elems = i === last ? this : this.clone( true );
|
5635 | jQuery( insert[ i ] )[ original ]( elems );
|
5636 |
|
5637 |
|
5638 |
|
5639 | core_push.apply( ret, elems.get() );
|
5640 | }
|
5641 |
|
5642 | return this.pushStack( ret );
|
5643 | };
|
5644 | });
|
5645 |
|
5646 | jQuery.extend({
|
5647 | clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
5648 | var i, l, srcElements, destElements,
|
5649 | clone = elem.cloneNode( true ),
|
5650 | inPage = jQuery.contains( elem.ownerDocument, elem );
|
5651 |
|
5652 |
|
5653 |
|
5654 | if ( !jQuery.support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {
|
5655 |
|
5656 |
|
5657 | destElements = getAll( clone );
|
5658 | srcElements = getAll( elem );
|
5659 |
|
5660 | for ( i = 0, l = srcElements.length; i < l; i++ ) {
|
5661 | fixInput( srcElements[ i ], destElements[ i ] );
|
5662 | }
|
5663 | }
|
5664 |
|
5665 |
|
5666 | if ( dataAndEvents ) {
|
5667 | if ( deepDataAndEvents ) {
|
5668 | srcElements = srcElements || getAll( elem );
|
5669 | destElements = destElements || getAll( clone );
|
5670 |
|
5671 | for ( i = 0, l = srcElements.length; i < l; i++ ) {
|
5672 | cloneCopyEvent( srcElements[ i ], destElements[ i ] );
|
5673 | }
|
5674 | } else {
|
5675 | cloneCopyEvent( elem, clone );
|
5676 | }
|
5677 | }
|
5678 |
|
5679 |
|
5680 | destElements = getAll( clone, "script" );
|
5681 | if ( destElements.length > 0 ) {
|
5682 | setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
|
5683 | }
|
5684 |
|
5685 |
|
5686 | return clone;
|
5687 | },
|
5688 |
|
5689 | buildFragment: function( elems, context, scripts, selection ) {
|
5690 | var elem, tmp, tag, wrap, contains, j,
|
5691 | i = 0,
|
5692 | l = elems.length,
|
5693 | fragment = context.createDocumentFragment(),
|
5694 | nodes = [];
|
5695 |
|
5696 | for ( ; i < l; i++ ) {
|
5697 | elem = elems[ i ];
|
5698 |
|
5699 | if ( elem || elem === 0 ) {
|
5700 |
|
5701 |
|
5702 | if ( jQuery.type( elem ) === "object" ) {
|
5703 |
|
5704 |
|
5705 | jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
|
5706 |
|
5707 |
|
5708 | } else if ( !rhtml.test( elem ) ) {
|
5709 | nodes.push( context.createTextNode( elem ) );
|
5710 |
|
5711 |
|
5712 | } else {
|
5713 | tmp = tmp || fragment.appendChild( context.createElement("div") );
|
5714 |
|
5715 |
|
5716 | tag = ( rtagName.exec( elem ) || ["", ""] )[ 1 ].toLowerCase();
|
5717 | wrap = wrapMap[ tag ] || wrapMap._default;
|
5718 | tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
|
5719 |
|
5720 |
|
5721 | j = wrap[ 0 ];
|
5722 | while ( j-- ) {
|
5723 | tmp = tmp.firstChild;
|
5724 | }
|
5725 |
|
5726 |
|
5727 |
|
5728 | jQuery.merge( nodes, tmp.childNodes );
|
5729 |
|
5730 |
|
5731 | tmp = fragment.firstChild;
|
5732 |
|
5733 |
|
5734 |
|
5735 | tmp.textContent = "";
|
5736 | }
|
5737 | }
|
5738 | }
|
5739 |
|
5740 |
|
5741 | fragment.textContent = "";
|
5742 |
|
5743 | i = 0;
|
5744 | while ( (elem = nodes[ i++ ]) ) {
|
5745 |
|
5746 |
|
5747 |
|
5748 | if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
|
5749 | continue;
|
5750 | }
|
5751 |
|
5752 | contains = jQuery.contains( elem.ownerDocument, elem );
|
5753 |
|
5754 |
|
5755 | tmp = getAll( fragment.appendChild( elem ), "script" );
|
5756 |
|
5757 |
|
5758 | if ( contains ) {
|
5759 | setGlobalEval( tmp );
|
5760 | }
|
5761 |
|
5762 |
|
5763 | if ( scripts ) {
|
5764 | j = 0;
|
5765 | while ( (elem = tmp[ j++ ]) ) {
|
5766 | if ( rscriptType.test( elem.type || "" ) ) {
|
5767 | scripts.push( elem );
|
5768 | }
|
5769 | }
|
5770 | }
|
5771 | }
|
5772 |
|
5773 | return fragment;
|
5774 | },
|
5775 |
|
5776 | cleanData: function( elems ) {
|
5777 | var data, elem, type,
|
5778 | l = elems.length,
|
5779 | i = 0,
|
5780 | special = jQuery.event.special;
|
5781 |
|
5782 | for ( ; i < l; i++ ) {
|
5783 | elem = elems[ i ];
|
5784 |
|
5785 | if ( jQuery.acceptData( elem ) ) {
|
5786 |
|
5787 | data = data_priv.access( elem );
|
5788 |
|
5789 | if ( data ) {
|
5790 | for ( type in data.events ) {
|
5791 | if ( special[ type ] ) {
|
5792 | jQuery.event.remove( elem, type );
|
5793 |
|
5794 |
|
5795 | } else {
|
5796 | jQuery.removeEvent( elem, type, data.handle );
|
5797 | }
|
5798 | }
|
5799 | }
|
5800 | }
|
5801 |
|
5802 |
|
5803 |
|
5804 | data_user.discard( elem );
|
5805 | data_priv.discard( elem );
|
5806 | }
|
5807 | },
|
5808 |
|
5809 | _evalUrl: function( url ) {
|
5810 | return jQuery.ajax({
|
5811 | url: url,
|
5812 | type: "GET",
|
5813 | dataType: "text",
|
5814 | async: false,
|
5815 | global: false,
|
5816 | success: jQuery.globalEval
|
5817 | });
|
5818 | }
|
5819 | });
|
5820 |
|
5821 |
|
5822 |
|
5823 | function manipulationTarget( elem, content ) {
|
5824 | return jQuery.nodeName( elem, "table" ) &&
|
5825 | jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ?
|
5826 |
|
5827 | elem.getElementsByTagName("tbody")[0] ||
|
5828 | elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
|
5829 | elem;
|
5830 | }
|
5831 |
|
5832 |
|
5833 | function disableScript( elem ) {
|
5834 | elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
|
5835 | return elem;
|
5836 | }
|
5837 | function restoreScript( elem ) {
|
5838 | var match = rscriptTypeMasked.exec( elem.type );
|
5839 |
|
5840 | if ( match ) {
|
5841 | elem.type = match[ 1 ];
|
5842 | } else {
|
5843 | elem.removeAttribute("type");
|
5844 | }
|
5845 |
|
5846 | return elem;
|
5847 | }
|
5848 |
|
5849 |
|
5850 | function setGlobalEval( elems, refElements ) {
|
5851 | var l = elems.length,
|
5852 | i = 0;
|
5853 |
|
5854 | for ( ; i < l; i++ ) {
|
5855 | data_priv.set(
|
5856 | elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
|
5857 | );
|
5858 | }
|
5859 | }
|
5860 |
|
5861 | function cloneCopyEvent( src, dest ) {
|
5862 | var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
|
5863 |
|
5864 | if ( dest.nodeType !== 1 ) {
|
5865 | return;
|
5866 | }
|
5867 |
|
5868 |
|
5869 | if ( data_priv.hasData( src ) ) {
|
5870 | pdataOld = data_priv.access( src );
|
5871 | pdataCur = jQuery.extend( {}, pdataOld );
|
5872 | events = pdataOld.events;
|
5873 |
|
5874 | data_priv.set( dest, pdataCur );
|
5875 |
|
5876 | if ( events ) {
|
5877 | delete pdataCur.handle;
|
5878 | pdataCur.events = {};
|
5879 |
|
5880 | for ( type in events ) {
|
5881 | for ( i = 0, l = events[ type ].length; i < l; i++ ) {
|
5882 | jQuery.event.add( dest, type, events[ type ][ i ] );
|
5883 | }
|
5884 | }
|
5885 | }
|
5886 | }
|
5887 |
|
5888 |
|
5889 | if ( data_user.hasData( src ) ) {
|
5890 | udataOld = data_user.access( src );
|
5891 | udataCur = jQuery.extend( {}, udataOld );
|
5892 |
|
5893 | data_user.set( dest, udataCur );
|
5894 | }
|
5895 | }
|
5896 |
|
5897 |
|
5898 | function getAll( context, tag ) {
|
5899 | var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
|
5900 | context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
|
5901 | [];
|
5902 |
|
5903 | return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
|
5904 | jQuery.merge( [ context ], ret ) :
|
5905 | ret;
|
5906 | }
|
5907 |
|
5908 |
|
5909 | function fixInput( src, dest ) {
|
5910 | var nodeName = dest.nodeName.toLowerCase();
|
5911 |
|
5912 |
|
5913 | if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
|
5914 | dest.checked = src.checked;
|
5915 |
|
5916 |
|
5917 | } else if ( nodeName === "input" || nodeName === "textarea" ) {
|
5918 | dest.defaultValue = src.defaultValue;
|
5919 | }
|
5920 | }
|
5921 | jQuery.fn.extend({
|
5922 | wrapAll: function( html ) {
|
5923 | var wrap;
|
5924 |
|
5925 | if ( jQuery.isFunction( html ) ) {
|
5926 | return this.each(function( i ) {
|
5927 | jQuery( this ).wrapAll( html.call(this, i) );
|
5928 | });
|
5929 | }
|
5930 |
|
5931 | if ( this[ 0 ] ) {
|
5932 |
|
5933 |
|
5934 | wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
|
5935 |
|
5936 | if ( this[ 0 ].parentNode ) {
|
5937 | wrap.insertBefore( this[ 0 ] );
|
5938 | }
|
5939 |
|
5940 | wrap.map(function() {
|
5941 | var elem = this;
|
5942 |
|
5943 | while ( elem.firstElementChild ) {
|
5944 | elem = elem.firstElementChild;
|
5945 | }
|
5946 |
|
5947 | return elem;
|
5948 | }).append( this );
|
5949 | }
|
5950 |
|
5951 | return this;
|
5952 | },
|
5953 |
|
5954 | wrapInner: function( html ) {
|
5955 | if ( jQuery.isFunction( html ) ) {
|
5956 | return this.each(function( i ) {
|
5957 | jQuery( this ).wrapInner( html.call(this, i) );
|
5958 | });
|
5959 | }
|
5960 |
|
5961 | return this.each(function() {
|
5962 | var self = jQuery( this ),
|
5963 | contents = self.contents();
|
5964 |
|
5965 | if ( contents.length ) {
|
5966 | contents.wrapAll( html );
|
5967 |
|
5968 | } else {
|
5969 | self.append( html );
|
5970 | }
|
5971 | });
|
5972 | },
|
5973 |
|
5974 | wrap: function( html ) {
|
5975 | var isFunction = jQuery.isFunction( html );
|
5976 |
|
5977 | return this.each(function( i ) {
|
5978 | jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
|
5979 | });
|
5980 | },
|
5981 |
|
5982 | unwrap: function() {
|
5983 | return this.parent().each(function() {
|
5984 | if ( !jQuery.nodeName( this, "body" ) ) {
|
5985 | jQuery( this ).replaceWith( this.childNodes );
|
5986 | }
|
5987 | }).end();
|
5988 | }
|
5989 | });
|
5990 | var curCSS, iframe,
|
5991 |
|
5992 |
|
5993 | rdisplayswap = /^(none|table(?!-c[ea]).+)/,
|
5994 | rmargin = /^margin/,
|
5995 | rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
|
5996 | rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
|
5997 | rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
|
5998 | elemdisplay = { BODY: "block" },
|
5999 |
|
6000 | cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
6001 | cssNormalTransform = {
|
6002 | letterSpacing: 0,
|
6003 | fontWeight: 400
|
6004 | },
|
6005 |
|
6006 | cssExpand = [ "Top", "Right", "Bottom", "Left" ],
|
6007 | cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
|
6008 |
|
6009 |
|
6010 | function vendorPropName( style, name ) {
|
6011 |
|
6012 |
|
6013 | if ( name in style ) {
|
6014 | return name;
|
6015 | }
|
6016 |
|
6017 |
|
6018 | var capName = name.charAt(0).toUpperCase() + name.slice(1),
|
6019 | origName = name,
|
6020 | i = cssPrefixes.length;
|
6021 |
|
6022 | while ( i-- ) {
|
6023 | name = cssPrefixes[ i ] + capName;
|
6024 | if ( name in style ) {
|
6025 | return name;
|
6026 | }
|
6027 | }
|
6028 |
|
6029 | return origName;
|
6030 | }
|
6031 |
|
6032 | function isHidden( elem, el ) {
|
6033 |
|
6034 |
|
6035 | elem = el || elem;
|
6036 | return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
|
6037 | }
|
6038 |
|
6039 |
|
6040 |
|
6041 | function getStyles( elem ) {
|
6042 | return window.getComputedStyle( elem, null );
|
6043 | }
|
6044 |
|
6045 | function showHide( elements, show ) {
|
6046 | var display, elem, hidden,
|
6047 | values = [],
|
6048 | index = 0,
|
6049 | length = elements.length;
|
6050 |
|
6051 | for ( ; index < length; index++ ) {
|
6052 | elem = elements[ index ];
|
6053 | if ( !elem.style ) {
|
6054 | continue;
|
6055 | }
|
6056 |
|
6057 | values[ index ] = data_priv.get( elem, "olddisplay" );
|
6058 | display = elem.style.display;
|
6059 | if ( show ) {
|
6060 |
|
6061 |
|
6062 | if ( !values[ index ] && display === "none" ) {
|
6063 | elem.style.display = "";
|
6064 | }
|
6065 |
|
6066 |
|
6067 |
|
6068 |
|
6069 | if ( elem.style.display === "" && isHidden( elem ) ) {
|
6070 | values[ index ] = data_priv.access( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
|
6071 | }
|
6072 | } else {
|
6073 |
|
6074 | if ( !values[ index ] ) {
|
6075 | hidden = isHidden( elem );
|
6076 |
|
6077 | if ( display && display !== "none" || !hidden ) {
|
6078 | data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css(elem, "display") );
|
6079 | }
|
6080 | }
|
6081 | }
|
6082 | }
|
6083 |
|
6084 |
|
6085 |
|
6086 | for ( index = 0; index < length; index++ ) {
|
6087 | elem = elements[ index ];
|
6088 | if ( !elem.style ) {
|
6089 | continue;
|
6090 | }
|
6091 | if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
|
6092 | elem.style.display = show ? values[ index ] || "" : "none";
|
6093 | }
|
6094 | }
|
6095 |
|
6096 | return elements;
|
6097 | }
|
6098 |
|
6099 | jQuery.fn.extend({
|
6100 | css: function( name, value ) {
|
6101 | return jQuery.access( this, function( elem, name, value ) {
|
6102 | var styles, len,
|
6103 | map = {},
|
6104 | i = 0;
|
6105 |
|
6106 | if ( jQuery.isArray( name ) ) {
|
6107 | styles = getStyles( elem );
|
6108 | len = name.length;
|
6109 |
|
6110 | for ( ; i < len; i++ ) {
|
6111 | map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
|
6112 | }
|
6113 |
|
6114 | return map;
|
6115 | }
|
6116 |
|
6117 | return value !== undefined ?
|
6118 | jQuery.style( elem, name, value ) :
|
6119 | jQuery.css( elem, name );
|
6120 | }, name, value, arguments.length > 1 );
|
6121 | },
|
6122 | show: function() {
|
6123 | return showHide( this, true );
|
6124 | },
|
6125 | hide: function() {
|
6126 | return showHide( this );
|
6127 | },
|
6128 | toggle: function( state ) {
|
6129 | var bool = typeof state === "boolean";
|
6130 |
|
6131 | return this.each(function() {
|
6132 | if ( bool ? state : isHidden( this ) ) {
|
6133 | jQuery( this ).show();
|
6134 | } else {
|
6135 | jQuery( this ).hide();
|
6136 | }
|
6137 | });
|
6138 | }
|
6139 | });
|
6140 |
|
6141 | jQuery.extend({
|
6142 |
|
6143 |
|
6144 | cssHooks: {
|
6145 | opacity: {
|
6146 | get: function( elem, computed ) {
|
6147 | if ( computed ) {
|
6148 |
|
6149 | var ret = curCSS( elem, "opacity" );
|
6150 | return ret === "" ? "1" : ret;
|
6151 | }
|
6152 | }
|
6153 | }
|
6154 | },
|
6155 |
|
6156 |
|
6157 | cssNumber: {
|
6158 | "columnCount": true,
|
6159 | "fillOpacity": true,
|
6160 | "fontWeight": true,
|
6161 | "lineHeight": true,
|
6162 | "opacity": true,
|
6163 | "orphans": true,
|
6164 | "widows": true,
|
6165 | "zIndex": true,
|
6166 | "zoom": true
|
6167 | },
|
6168 |
|
6169 |
|
6170 |
|
6171 | cssProps: {
|
6172 |
|
6173 | "float": "cssFloat"
|
6174 | },
|
6175 |
|
6176 |
|
6177 | style: function( elem, name, value, extra ) {
|
6178 |
|
6179 | if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
|
6180 | return;
|
6181 | }
|
6182 |
|
6183 |
|
6184 | var ret, type, hooks,
|
6185 | origName = jQuery.camelCase( name ),
|
6186 | style = elem.style;
|
6187 |
|
6188 | name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
|
6189 |
|
6190 |
|
6191 |
|
6192 | hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
|
6193 |
|
6194 |
|
6195 | if ( value !== undefined ) {
|
6196 | type = typeof value;
|
6197 |
|
6198 |
|
6199 | if ( type === "string" && (ret = rrelNum.exec( value )) ) {
|
6200 | value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
|
6201 |
|
6202 | type = "number";
|
6203 | }
|
6204 |
|
6205 |
|
6206 | if ( value == null || type === "number" && isNaN( value ) ) {
|
6207 | return;
|
6208 | }
|
6209 |
|
6210 |
|
6211 | if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
|
6212 | value += "px";
|
6213 | }
|
6214 |
|
6215 |
|
6216 |
|
6217 | if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
|
6218 | style[ name ] = "inherit";
|
6219 | }
|
6220 |
|
6221 |
|
6222 | if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
|
6223 | style[ name ] = value;
|
6224 | }
|
6225 |
|
6226 | } else {
|
6227 |
|
6228 | if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
|
6229 | return ret;
|
6230 | }
|
6231 |
|
6232 |
|
6233 | return style[ name ];
|
6234 | }
|
6235 | },
|
6236 |
|
6237 | css: function( elem, name, extra, styles ) {
|
6238 | var val, num, hooks,
|
6239 | origName = jQuery.camelCase( name );
|
6240 |
|
6241 |
|
6242 | name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
|
6243 |
|
6244 |
|
6245 |
|
6246 | hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
|
6247 |
|
6248 |
|
6249 | if ( hooks && "get" in hooks ) {
|
6250 | val = hooks.get( elem, true, extra );
|
6251 | }
|
6252 |
|
6253 |
|
6254 | if ( val === undefined ) {
|
6255 | val = curCSS( elem, name, styles );
|
6256 | }
|
6257 |
|
6258 |
|
6259 | if ( val === "normal" && name in cssNormalTransform ) {
|
6260 | val = cssNormalTransform[ name ];
|
6261 | }
|
6262 |
|
6263 |
|
6264 | if ( extra === "" || extra ) {
|
6265 | num = parseFloat( val );
|
6266 | return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
|
6267 | }
|
6268 | return val;
|
6269 | }
|
6270 | });
|
6271 |
|
6272 | curCSS = function( elem, name, _computed ) {
|
6273 | var width, minWidth, maxWidth,
|
6274 | computed = _computed || getStyles( elem ),
|
6275 |
|
6276 |
|
6277 |
|
6278 | ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
|
6279 | style = elem.style;
|
6280 |
|
6281 | if ( computed ) {
|
6282 |
|
6283 | if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
|
6284 | ret = jQuery.style( elem, name );
|
6285 | }
|
6286 |
|
6287 |
|
6288 |
|
6289 |
|
6290 |
|
6291 | if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
|
6292 |
|
6293 |
|
6294 | width = style.width;
|
6295 | minWidth = style.minWidth;
|
6296 | maxWidth = style.maxWidth;
|
6297 |
|
6298 |
|
6299 | style.minWidth = style.maxWidth = style.width = ret;
|
6300 | ret = computed.width;
|
6301 |
|
6302 |
|
6303 | style.width = width;
|
6304 | style.minWidth = minWidth;
|
6305 | style.maxWidth = maxWidth;
|
6306 | }
|
6307 | }
|
6308 |
|
6309 | return ret;
|
6310 | };
|
6311 |
|
6312 |
|
6313 | function setPositiveNumber( elem, value, subtract ) {
|
6314 | var matches = rnumsplit.exec( value );
|
6315 | return matches ?
|
6316 |
|
6317 | Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
|
6318 | value;
|
6319 | }
|
6320 |
|
6321 | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
|
6322 | var i = extra === ( isBorderBox ? "border" : "content" ) ?
|
6323 |
|
6324 | 4 :
|
6325 |
|
6326 | name === "width" ? 1 : 0,
|
6327 |
|
6328 | val = 0;
|
6329 |
|
6330 | for ( ; i < 4; i += 2 ) {
|
6331 |
|
6332 | if ( extra === "margin" ) {
|
6333 | val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
|
6334 | }
|
6335 |
|
6336 | if ( isBorderBox ) {
|
6337 |
|
6338 | if ( extra === "content" ) {
|
6339 | val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
|
6340 | }
|
6341 |
|
6342 |
|
6343 | if ( extra !== "margin" ) {
|
6344 | val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
|
6345 | }
|
6346 | } else {
|
6347 |
|
6348 | val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
|
6349 |
|
6350 |
|
6351 | if ( extra !== "padding" ) {
|
6352 | val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
|
6353 | }
|
6354 | }
|
6355 | }
|
6356 |
|
6357 | return val;
|
6358 | }
|
6359 |
|
6360 | function getWidthOrHeight( elem, name, extra ) {
|
6361 |
|
6362 |
|
6363 | var valueIsBorderBox = true,
|
6364 | val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
|
6365 | styles = getStyles( elem ),
|
6366 | isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
|
6367 |
|
6368 |
|
6369 |
|
6370 |
|
6371 | if ( val <= 0 || val == null ) {
|
6372 |
|
6373 | val = curCSS( elem, name, styles );
|
6374 | if ( val < 0 || val == null ) {
|
6375 | val = elem.style[ name ];
|
6376 | }
|
6377 |
|
6378 |
|
6379 | if ( rnumnonpx.test(val) ) {
|
6380 | return val;
|
6381 | }
|
6382 |
|
6383 |
|
6384 |
|
6385 | valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
|
6386 |
|
6387 |
|
6388 | val = parseFloat( val ) || 0;
|
6389 | }
|
6390 |
|
6391 |
|
6392 | return ( val +
|
6393 | augmentWidthOrHeight(
|
6394 | elem,
|
6395 | name,
|
6396 | extra || ( isBorderBox ? "border" : "content" ),
|
6397 | valueIsBorderBox,
|
6398 | styles
|
6399 | )
|
6400 | ) + "px";
|
6401 | }
|
6402 |
|
6403 |
|
6404 | function css_defaultDisplay( nodeName ) {
|
6405 | var doc = document,
|
6406 | display = elemdisplay[ nodeName ];
|
6407 |
|
6408 | if ( !display ) {
|
6409 | display = actualDisplay( nodeName, doc );
|
6410 |
|
6411 |
|
6412 | if ( display === "none" || !display ) {
|
6413 |
|
6414 | iframe = ( iframe ||
|
6415 | jQuery("<iframe frameborder='0' width='0' height='0'/>")
|
6416 | .css( "cssText", "display:block !important" )
|
6417 | ).appendTo( doc.documentElement );
|
6418 |
|
6419 |
|
6420 | doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
|
6421 | doc.write("<!doctype html><html><body>");
|
6422 | doc.close();
|
6423 |
|
6424 | display = actualDisplay( nodeName, doc );
|
6425 | iframe.detach();
|
6426 | }
|
6427 |
|
6428 |
|
6429 | elemdisplay[ nodeName ] = display;
|
6430 | }
|
6431 |
|
6432 | return display;
|
6433 | }
|
6434 |
|
6435 |
|
6436 | function actualDisplay( name, doc ) {
|
6437 | var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
|
6438 | display = jQuery.css( elem[0], "display" );
|
6439 | elem.remove();
|
6440 | return display;
|
6441 | }
|
6442 |
|
6443 | jQuery.each([ "height", "width" ], function( i, name ) {
|
6444 | jQuery.cssHooks[ name ] = {
|
6445 | get: function( elem, computed, extra ) {
|
6446 | if ( computed ) {
|
6447 |
|
6448 |
|
6449 | return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
|
6450 | jQuery.swap( elem, cssShow, function() {
|
6451 | return getWidthOrHeight( elem, name, extra );
|
6452 | }) :
|
6453 | getWidthOrHeight( elem, name, extra );
|
6454 | }
|
6455 | },
|
6456 |
|
6457 | set: function( elem, value, extra ) {
|
6458 | var styles = extra && getStyles( elem );
|
6459 | return setPositiveNumber( elem, value, extra ?
|
6460 | augmentWidthOrHeight(
|
6461 | elem,
|
6462 | name,
|
6463 | extra,
|
6464 | jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
6465 | styles
|
6466 | ) : 0
|
6467 | );
|
6468 | }
|
6469 | };
|
6470 | });
|
6471 |
|
6472 |
|
6473 |
|
6474 | jQuery(function() {
|
6475 |
|
6476 | if ( !jQuery.support.reliableMarginRight ) {
|
6477 | jQuery.cssHooks.marginRight = {
|
6478 | get: function( elem, computed ) {
|
6479 | if ( computed ) {
|
6480 |
|
6481 |
|
6482 |
|
6483 | return jQuery.swap( elem, { "display": "inline-block" },
|
6484 | curCSS, [ elem, "marginRight" ] );
|
6485 | }
|
6486 | }
|
6487 | };
|
6488 | }
|
6489 |
|
6490 |
|
6491 |
|
6492 |
|
6493 | if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
|
6494 | jQuery.each( [ "top", "left" ], function( i, prop ) {
|
6495 | jQuery.cssHooks[ prop ] = {
|
6496 | get: function( elem, computed ) {
|
6497 | if ( computed ) {
|
6498 | computed = curCSS( elem, prop );
|
6499 |
|
6500 | return rnumnonpx.test( computed ) ?
|
6501 | jQuery( elem ).position()[ prop ] + "px" :
|
6502 | computed;
|
6503 | }
|
6504 | }
|
6505 | };
|
6506 | });
|
6507 | }
|
6508 |
|
6509 | });
|
6510 |
|
6511 | if ( jQuery.expr && jQuery.expr.filters ) {
|
6512 | jQuery.expr.filters.hidden = function( elem ) {
|
6513 |
|
6514 |
|
6515 | return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
|
6516 | };
|
6517 |
|
6518 | jQuery.expr.filters.visible = function( elem ) {
|
6519 | return !jQuery.expr.filters.hidden( elem );
|
6520 | };
|
6521 | }
|
6522 |
|
6523 |
|
6524 | jQuery.each({
|
6525 | margin: "",
|
6526 | padding: "",
|
6527 | border: "Width"
|
6528 | }, function( prefix, suffix ) {
|
6529 | jQuery.cssHooks[ prefix + suffix ] = {
|
6530 | expand: function( value ) {
|
6531 | var i = 0,
|
6532 | expanded = {},
|
6533 |
|
6534 |
|
6535 | parts = typeof value === "string" ? value.split(" ") : [ value ];
|
6536 |
|
6537 | for ( ; i < 4; i++ ) {
|
6538 | expanded[ prefix + cssExpand[ i ] + suffix ] =
|
6539 | parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
|
6540 | }
|
6541 |
|
6542 | return expanded;
|
6543 | }
|
6544 | };
|
6545 |
|
6546 | if ( !rmargin.test( prefix ) ) {
|
6547 | jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
|
6548 | }
|
6549 | });
|
6550 | var r20 = /%20/g,
|
6551 | rbracket = /\[\]$/,
|
6552 | rCRLF = /\r?\n/g,
|
6553 | rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
|
6554 | rsubmittable = /^(?:input|select|textarea|keygen)/i;
|
6555 |
|
6556 | jQuery.fn.extend({
|
6557 | serialize: function() {
|
6558 | return jQuery.param( this.serializeArray() );
|
6559 | },
|
6560 | serializeArray: function() {
|
6561 | return this.map(function(){
|
6562 |
|
6563 | var elements = jQuery.prop( this, "elements" );
|
6564 | return elements ? jQuery.makeArray( elements ) : this;
|
6565 | })
|
6566 | .filter(function(){
|
6567 | var type = this.type;
|
6568 |
|
6569 | return this.name && !jQuery( this ).is( ":disabled" ) &&
|
6570 | rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
|
6571 | ( this.checked || !manipulation_rcheckableType.test( type ) );
|
6572 | })
|
6573 | .map(function( i, elem ){
|
6574 | var val = jQuery( this ).val();
|
6575 |
|
6576 | return val == null ?
|
6577 | null :
|
6578 | jQuery.isArray( val ) ?
|
6579 | jQuery.map( val, function( val ){
|
6580 | return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
6581 | }) :
|
6582 | { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
6583 | }).get();
|
6584 | }
|
6585 | });
|
6586 |
|
6587 |
|
6588 |
|
6589 | jQuery.param = function( a, traditional ) {
|
6590 | var prefix,
|
6591 | s = [],
|
6592 | add = function( key, value ) {
|
6593 |
|
6594 | value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
|
6595 | s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
|
6596 | };
|
6597 |
|
6598 |
|
6599 | if ( traditional === undefined ) {
|
6600 | traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
|
6601 | }
|
6602 |
|
6603 |
|
6604 | if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
|
6605 |
|
6606 | jQuery.each( a, function() {
|
6607 | add( this.name, this.value );
|
6608 | });
|
6609 |
|
6610 | } else {
|
6611 |
|
6612 |
|
6613 | for ( prefix in a ) {
|
6614 | buildParams( prefix, a[ prefix ], traditional, add );
|
6615 | }
|
6616 | }
|
6617 |
|
6618 |
|
6619 | return s.join( "&" ).replace( r20, "+" );
|
6620 | };
|
6621 |
|
6622 | function buildParams( prefix, obj, traditional, add ) {
|
6623 | var name;
|
6624 |
|
6625 | if ( jQuery.isArray( obj ) ) {
|
6626 |
|
6627 | jQuery.each( obj, function( i, v ) {
|
6628 | if ( traditional || rbracket.test( prefix ) ) {
|
6629 |
|
6630 | add( prefix, v );
|
6631 |
|
6632 | } else {
|
6633 |
|
6634 | buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
|
6635 | }
|
6636 | });
|
6637 |
|
6638 | } else if ( !traditional && jQuery.type( obj ) === "object" ) {
|
6639 |
|
6640 | for ( name in obj ) {
|
6641 | buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
|
6642 | }
|
6643 |
|
6644 | } else {
|
6645 |
|
6646 | add( prefix, obj );
|
6647 | }
|
6648 | }
|
6649 | jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
|
6650 | "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
6651 | "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
|
6652 |
|
6653 |
|
6654 | jQuery.fn[ name ] = function( data, fn ) {
|
6655 | return arguments.length > 0 ?
|
6656 | this.on( name, null, data, fn ) :
|
6657 | this.trigger( name );
|
6658 | };
|
6659 | });
|
6660 |
|
6661 | jQuery.fn.extend({
|
6662 | hover: function( fnOver, fnOut ) {
|
6663 | return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
6664 | },
|
6665 |
|
6666 | bind: function( types, data, fn ) {
|
6667 | return this.on( types, null, data, fn );
|
6668 | },
|
6669 | unbind: function( types, fn ) {
|
6670 | return this.off( types, null, fn );
|
6671 | },
|
6672 |
|
6673 | delegate: function( selector, types, data, fn ) {
|
6674 | return this.on( types, selector, data, fn );
|
6675 | },
|
6676 | undelegate: function( selector, types, fn ) {
|
6677 |
|
6678 | return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
|
6679 | }
|
6680 | });
|
6681 | var
|
6682 |
|
6683 | ajaxLocParts,
|
6684 | ajaxLocation,
|
6685 |
|
6686 | ajax_nonce = jQuery.now(),
|
6687 |
|
6688 | ajax_rquery = /\?/,
|
6689 | rhash = /#.*$/,
|
6690 | rts = /([?&])_=[^&]*/,
|
6691 | rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
|
6692 |
|
6693 | rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
|
6694 | rnoContent = /^(?:GET|HEAD)$/,
|
6695 | rprotocol = /^\/\//,
|
6696 | rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
|
6697 |
|
6698 |
|
6699 | _load = jQuery.fn.load,
|
6700 |
|
6701 | |
6702 |
|
6703 |
|
6704 |
|
6705 |
|
6706 |
|
6707 |
|
6708 |
|
6709 |
|
6710 | prefilters = {},
|
6711 |
|
6712 | |
6713 |
|
6714 |
|
6715 |
|
6716 |
|
6717 | transports = {},
|
6718 |
|
6719 |
|
6720 | allTypes = "*/".concat("*");
|
6721 |
|
6722 |
|
6723 |
|
6724 | try {
|
6725 | ajaxLocation = location.href;
|
6726 | } catch( e ) {
|
6727 |
|
6728 |
|
6729 | ajaxLocation = document.createElement( "a" );
|
6730 | ajaxLocation.href = "";
|
6731 | ajaxLocation = ajaxLocation.href;
|
6732 | }
|
6733 |
|
6734 |
|
6735 | ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
|
6736 |
|
6737 |
|
6738 | function addToPrefiltersOrTransports( structure ) {
|
6739 |
|
6740 |
|
6741 | return function( dataTypeExpression, func ) {
|
6742 |
|
6743 | if ( typeof dataTypeExpression !== "string" ) {
|
6744 | func = dataTypeExpression;
|
6745 | dataTypeExpression = "*";
|
6746 | }
|
6747 |
|
6748 | var dataType,
|
6749 | i = 0,
|
6750 | dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
|
6751 |
|
6752 | if ( jQuery.isFunction( func ) ) {
|
6753 |
|
6754 | while ( (dataType = dataTypes[i++]) ) {
|
6755 |
|
6756 | if ( dataType[0] === "+" ) {
|
6757 | dataType = dataType.slice( 1 ) || "*";
|
6758 | (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
|
6759 |
|
6760 |
|
6761 | } else {
|
6762 | (structure[ dataType ] = structure[ dataType ] || []).push( func );
|
6763 | }
|
6764 | }
|
6765 | }
|
6766 | };
|
6767 | }
|
6768 |
|
6769 |
|
6770 | function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
|
6771 |
|
6772 | var inspected = {},
|
6773 | seekingTransport = ( structure === transports );
|
6774 |
|
6775 | function inspect( dataType ) {
|
6776 | var selected;
|
6777 | inspected[ dataType ] = true;
|
6778 | jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
|
6779 | var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
|
6780 | if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
|
6781 | options.dataTypes.unshift( dataTypeOrTransport );
|
6782 | inspect( dataTypeOrTransport );
|
6783 | return false;
|
6784 | } else if ( seekingTransport ) {
|
6785 | return !( selected = dataTypeOrTransport );
|
6786 | }
|
6787 | });
|
6788 | return selected;
|
6789 | }
|
6790 |
|
6791 | return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
|
6792 | }
|
6793 |
|
6794 |
|
6795 |
|
6796 |
|
6797 | function ajaxExtend( target, src ) {
|
6798 | var key, deep,
|
6799 | flatOptions = jQuery.ajaxSettings.flatOptions || {};
|
6800 |
|
6801 | for ( key in src ) {
|
6802 | if ( src[ key ] !== undefined ) {
|
6803 | ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
|
6804 | }
|
6805 | }
|
6806 | if ( deep ) {
|
6807 | jQuery.extend( true, target, deep );
|
6808 | }
|
6809 |
|
6810 | return target;
|
6811 | }
|
6812 |
|
6813 | jQuery.fn.load = function( url, params, callback ) {
|
6814 | if ( typeof url !== "string" && _load ) {
|
6815 | return _load.apply( this, arguments );
|
6816 | }
|
6817 |
|
6818 | var selector, type, response,
|
6819 | self = this,
|
6820 | off = url.indexOf(" ");
|
6821 |
|
6822 | if ( off >= 0 ) {
|
6823 | selector = url.slice( off );
|
6824 | url = url.slice( 0, off );
|
6825 | }
|
6826 |
|
6827 |
|
6828 | if ( jQuery.isFunction( params ) ) {
|
6829 |
|
6830 |
|
6831 | callback = params;
|
6832 | params = undefined;
|
6833 |
|
6834 |
|
6835 | } else if ( params && typeof params === "object" ) {
|
6836 | type = "POST";
|
6837 | }
|
6838 |
|
6839 |
|
6840 | if ( self.length > 0 ) {
|
6841 | jQuery.ajax({
|
6842 | url: url,
|
6843 |
|
6844 |
|
6845 | type: type,
|
6846 | dataType: "html",
|
6847 | data: params
|
6848 | }).done(function( responseText ) {
|
6849 |
|
6850 |
|
6851 | response = arguments;
|
6852 |
|
6853 | self.html( selector ?
|
6854 |
|
6855 |
|
6856 |
|
6857 | jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
|
6858 |
|
6859 |
|
6860 | responseText );
|
6861 |
|
6862 | }).complete( callback && function( jqXHR, status ) {
|
6863 | self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
|
6864 | });
|
6865 | }
|
6866 |
|
6867 | return this;
|
6868 | };
|
6869 |
|
6870 |
|
6871 | jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
|
6872 | jQuery.fn[ type ] = function( fn ){
|
6873 | return this.on( type, fn );
|
6874 | };
|
6875 | });
|
6876 |
|
6877 | jQuery.extend({
|
6878 |
|
6879 |
|
6880 | active: 0,
|
6881 |
|
6882 |
|
6883 | lastModified: {},
|
6884 | etag: {},
|
6885 |
|
6886 | ajaxSettings: {
|
6887 | url: ajaxLocation,
|
6888 | type: "GET",
|
6889 | isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
|
6890 | global: true,
|
6891 | processData: true,
|
6892 | async: true,
|
6893 | contentType: "application/x-www-form-urlencoded; charset=UTF-8",
|
6894 | |
6895 |
|
6896 |
|
6897 |
|
6898 |
|
6899 |
|
6900 |
|
6901 |
|
6902 |
|
6903 |
|
6904 |
|
6905 |
|
6906 | accepts: {
|
6907 | "*": allTypes,
|
6908 | text: "text/plain",
|
6909 | html: "text/html",
|
6910 | xml: "application/xml, text/xml",
|
6911 | json: "application/json, text/javascript"
|
6912 | },
|
6913 |
|
6914 | contents: {
|
6915 | xml: /xml/,
|
6916 | html: /html/,
|
6917 | json: /json/
|
6918 | },
|
6919 |
|
6920 | responseFields: {
|
6921 | xml: "responseXML",
|
6922 | text: "responseText",
|
6923 | json: "responseJSON"
|
6924 | },
|
6925 |
|
6926 |
|
6927 |
|
6928 | converters: {
|
6929 |
|
6930 |
|
6931 | "* text": String,
|
6932 |
|
6933 |
|
6934 | "text html": true,
|
6935 |
|
6936 |
|
6937 | "text json": jQuery.parseJSON,
|
6938 |
|
6939 |
|
6940 | "text xml": jQuery.parseXML
|
6941 | },
|
6942 |
|
6943 |
|
6944 |
|
6945 |
|
6946 |
|
6947 | flatOptions: {
|
6948 | url: true,
|
6949 | context: true
|
6950 | }
|
6951 | },
|
6952 |
|
6953 |
|
6954 |
|
6955 |
|
6956 | ajaxSetup: function( target, settings ) {
|
6957 | return settings ?
|
6958 |
|
6959 |
|
6960 | ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
|
6961 |
|
6962 |
|
6963 | ajaxExtend( jQuery.ajaxSettings, target );
|
6964 | },
|
6965 |
|
6966 | ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
|
6967 | ajaxTransport: addToPrefiltersOrTransports( transports ),
|
6968 |
|
6969 |
|
6970 | ajax: function( url, options ) {
|
6971 |
|
6972 |
|
6973 | if ( typeof url === "object" ) {
|
6974 | options = url;
|
6975 | url = undefined;
|
6976 | }
|
6977 |
|
6978 |
|
6979 | options = options || {};
|
6980 |
|
6981 | var transport,
|
6982 |
|
6983 | cacheURL,
|
6984 |
|
6985 | responseHeadersString,
|
6986 | responseHeaders,
|
6987 |
|
6988 | timeoutTimer,
|
6989 |
|
6990 | parts,
|
6991 |
|
6992 | fireGlobals,
|
6993 |
|
6994 | i,
|
6995 |
|
6996 | s = jQuery.ajaxSetup( {}, options ),
|
6997 |
|
6998 | callbackContext = s.context || s,
|
6999 |
|
7000 | globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
|
7001 | jQuery( callbackContext ) :
|
7002 | jQuery.event,
|
7003 |
|
7004 | deferred = jQuery.Deferred(),
|
7005 | completeDeferred = jQuery.Callbacks("once memory"),
|
7006 |
|
7007 | statusCode = s.statusCode || {},
|
7008 |
|
7009 | requestHeaders = {},
|
7010 | requestHeadersNames = {},
|
7011 |
|
7012 | state = 0,
|
7013 |
|
7014 | strAbort = "canceled",
|
7015 |
|
7016 | jqXHR = {
|
7017 | readyState: 0,
|
7018 |
|
7019 |
|
7020 | getResponseHeader: function( key ) {
|
7021 | var match;
|
7022 | if ( state === 2 ) {
|
7023 | if ( !responseHeaders ) {
|
7024 | responseHeaders = {};
|
7025 | while ( (match = rheaders.exec( responseHeadersString )) ) {
|
7026 | responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
|
7027 | }
|
7028 | }
|
7029 | match = responseHeaders[ key.toLowerCase() ];
|
7030 | }
|
7031 | return match == null ? null : match;
|
7032 | },
|
7033 |
|
7034 |
|
7035 | getAllResponseHeaders: function() {
|
7036 | return state === 2 ? responseHeadersString : null;
|
7037 | },
|
7038 |
|
7039 |
|
7040 | setRequestHeader: function( name, value ) {
|
7041 | var lname = name.toLowerCase();
|
7042 | if ( !state ) {
|
7043 | name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
|
7044 | requestHeaders[ name ] = value;
|
7045 | }
|
7046 | return this;
|
7047 | },
|
7048 |
|
7049 |
|
7050 | overrideMimeType: function( type ) {
|
7051 | if ( !state ) {
|
7052 | s.mimeType = type;
|
7053 | }
|
7054 | return this;
|
7055 | },
|
7056 |
|
7057 |
|
7058 | statusCode: function( map ) {
|
7059 | var code;
|
7060 | if ( map ) {
|
7061 | if ( state < 2 ) {
|
7062 | for ( code in map ) {
|
7063 |
|
7064 | statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
|
7065 | }
|
7066 | } else {
|
7067 |
|
7068 | jqXHR.always( map[ jqXHR.statusCode ] );
|
7069 | }
|
7070 | }
|
7071 | return this;
|
7072 | },
|
7073 |
|
7074 |
|
7075 | abort: function( statusText ) {
|
7076 | var finalText = statusText || strAbort;
|
7077 | if ( transport ) {
|
7078 | transport.abort( finalText );
|
7079 | }
|
7080 | done( 0, finalText );
|
7081 | return this;
|
7082 | }
|
7083 | };
|
7084 |
|
7085 |
|
7086 | deferred.promise( jqXHR ).complete = completeDeferred.add;
|
7087 | jqXHR.success = jqXHR.done;
|
7088 | jqXHR.error = jqXHR.fail;
|
7089 |
|
7090 |
|
7091 |
|
7092 |
|
7093 |
|
7094 | s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
|
7095 | .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
|
7096 |
|
7097 |
|
7098 | s.type = options.method || options.type || s.method || s.type;
|
7099 |
|
7100 |
|
7101 | s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
|
7102 |
|
7103 |
|
7104 | if ( s.crossDomain == null ) {
|
7105 | parts = rurl.exec( s.url.toLowerCase() );
|
7106 | s.crossDomain = !!( parts &&
|
7107 | ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
|
7108 | ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
|
7109 | ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
|
7110 | );
|
7111 | }
|
7112 |
|
7113 |
|
7114 | if ( s.data && s.processData && typeof s.data !== "string" ) {
|
7115 | s.data = jQuery.param( s.data, s.traditional );
|
7116 | }
|
7117 |
|
7118 |
|
7119 | inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
|
7120 |
|
7121 |
|
7122 | if ( state === 2 ) {
|
7123 | return jqXHR;
|
7124 | }
|
7125 |
|
7126 |
|
7127 | fireGlobals = s.global;
|
7128 |
|
7129 |
|
7130 | if ( fireGlobals && jQuery.active++ === 0 ) {
|
7131 | jQuery.event.trigger("ajaxStart");
|
7132 | }
|
7133 |
|
7134 |
|
7135 | s.type = s.type.toUpperCase();
|
7136 |
|
7137 |
|
7138 | s.hasContent = !rnoContent.test( s.type );
|
7139 |
|
7140 |
|
7141 |
|
7142 | cacheURL = s.url;
|
7143 |
|
7144 |
|
7145 | if ( !s.hasContent ) {
|
7146 |
|
7147 |
|
7148 | if ( s.data ) {
|
7149 | cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
|
7150 |
|
7151 | delete s.data;
|
7152 | }
|
7153 |
|
7154 |
|
7155 | if ( s.cache === false ) {
|
7156 | s.url = rts.test( cacheURL ) ?
|
7157 |
|
7158 |
|
7159 | cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
|
7160 |
|
7161 |
|
7162 | cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
|
7163 | }
|
7164 | }
|
7165 |
|
7166 |
|
7167 | if ( s.ifModified ) {
|
7168 | if ( jQuery.lastModified[ cacheURL ] ) {
|
7169 | jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
|
7170 | }
|
7171 | if ( jQuery.etag[ cacheURL ] ) {
|
7172 | jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
|
7173 | }
|
7174 | }
|
7175 |
|
7176 |
|
7177 | if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
|
7178 | jqXHR.setRequestHeader( "Content-Type", s.contentType );
|
7179 | }
|
7180 |
|
7181 |
|
7182 | jqXHR.setRequestHeader(
|
7183 | "Accept",
|
7184 | s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
|
7185 | s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
|
7186 | s.accepts[ "*" ]
|
7187 | );
|
7188 |
|
7189 |
|
7190 | for ( i in s.headers ) {
|
7191 | jqXHR.setRequestHeader( i, s.headers[ i ] );
|
7192 | }
|
7193 |
|
7194 |
|
7195 | if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
|
7196 |
|
7197 | return jqXHR.abort();
|
7198 | }
|
7199 |
|
7200 |
|
7201 | strAbort = "abort";
|
7202 |
|
7203 |
|
7204 | for ( i in { success: 1, error: 1, complete: 1 } ) {
|
7205 | jqXHR[ i ]( s[ i ] );
|
7206 | }
|
7207 |
|
7208 |
|
7209 | transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
|
7210 |
|
7211 |
|
7212 | if ( !transport ) {
|
7213 | done( -1, "No Transport" );
|
7214 | } else {
|
7215 | jqXHR.readyState = 1;
|
7216 |
|
7217 |
|
7218 | if ( fireGlobals ) {
|
7219 | globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
|
7220 | }
|
7221 |
|
7222 | if ( s.async && s.timeout > 0 ) {
|
7223 | timeoutTimer = setTimeout(function() {
|
7224 | jqXHR.abort("timeout");
|
7225 | }, s.timeout );
|
7226 | }
|
7227 |
|
7228 | try {
|
7229 | state = 1;
|
7230 | transport.send( requestHeaders, done );
|
7231 | } catch ( e ) {
|
7232 |
|
7233 | if ( state < 2 ) {
|
7234 | done( -1, e );
|
7235 |
|
7236 | } else {
|
7237 | throw e;
|
7238 | }
|
7239 | }
|
7240 | }
|
7241 |
|
7242 |
|
7243 | function done( status, nativeStatusText, responses, headers ) {
|
7244 | var isSuccess, success, error, response, modified,
|
7245 | statusText = nativeStatusText;
|
7246 |
|
7247 |
|
7248 | if ( state === 2 ) {
|
7249 | return;
|
7250 | }
|
7251 |
|
7252 |
|
7253 | state = 2;
|
7254 |
|
7255 |
|
7256 | if ( timeoutTimer ) {
|
7257 | clearTimeout( timeoutTimer );
|
7258 | }
|
7259 |
|
7260 |
|
7261 |
|
7262 | transport = undefined;
|
7263 |
|
7264 |
|
7265 | responseHeadersString = headers || "";
|
7266 |
|
7267 |
|
7268 | jqXHR.readyState = status > 0 ? 4 : 0;
|
7269 |
|
7270 |
|
7271 | isSuccess = status >= 200 && status < 300 || status === 304;
|
7272 |
|
7273 |
|
7274 | if ( responses ) {
|
7275 | response = ajaxHandleResponses( s, jqXHR, responses );
|
7276 | }
|
7277 |
|
7278 |
|
7279 | response = ajaxConvert( s, response, jqXHR, isSuccess );
|
7280 |
|
7281 |
|
7282 | if ( isSuccess ) {
|
7283 |
|
7284 |
|
7285 | if ( s.ifModified ) {
|
7286 | modified = jqXHR.getResponseHeader("Last-Modified");
|
7287 | if ( modified ) {
|
7288 | jQuery.lastModified[ cacheURL ] = modified;
|
7289 | }
|
7290 | modified = jqXHR.getResponseHeader("etag");
|
7291 | if ( modified ) {
|
7292 | jQuery.etag[ cacheURL ] = modified;
|
7293 | }
|
7294 | }
|
7295 |
|
7296 |
|
7297 | if ( status === 204 ) {
|
7298 | statusText = "nocontent";
|
7299 |
|
7300 |
|
7301 | } else if ( status === 304 ) {
|
7302 | statusText = "notmodified";
|
7303 |
|
7304 |
|
7305 | } else {
|
7306 | statusText = response.state;
|
7307 | success = response.data;
|
7308 | error = response.error;
|
7309 | isSuccess = !error;
|
7310 | }
|
7311 | } else {
|
7312 |
|
7313 |
|
7314 | error = statusText;
|
7315 | if ( status || !statusText ) {
|
7316 | statusText = "error";
|
7317 | if ( status < 0 ) {
|
7318 | status = 0;
|
7319 | }
|
7320 | }
|
7321 | }
|
7322 |
|
7323 |
|
7324 | jqXHR.statusCode = status;
|
7325 | jqXHR.statusText = ( nativeStatusText || statusText ) + "";
|
7326 |
|
7327 |
|
7328 | if ( isSuccess ) {
|
7329 | deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
|
7330 | } else {
|
7331 | deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
|
7332 | }
|
7333 |
|
7334 |
|
7335 | jqXHR.statusCode( statusCode );
|
7336 | statusCode = undefined;
|
7337 |
|
7338 | if ( fireGlobals ) {
|
7339 | globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
|
7340 | [ jqXHR, s, isSuccess ? success : error ] );
|
7341 | }
|
7342 |
|
7343 |
|
7344 | completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
|
7345 |
|
7346 | if ( fireGlobals ) {
|
7347 | globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
|
7348 |
|
7349 | if ( !( --jQuery.active ) ) {
|
7350 | jQuery.event.trigger("ajaxStop");
|
7351 | }
|
7352 | }
|
7353 | }
|
7354 |
|
7355 | return jqXHR;
|
7356 | },
|
7357 |
|
7358 | getJSON: function( url, data, callback ) {
|
7359 | return jQuery.get( url, data, callback, "json" );
|
7360 | },
|
7361 |
|
7362 | getScript: function( url, callback ) {
|
7363 | return jQuery.get( url, undefined, callback, "script" );
|
7364 | }
|
7365 | });
|
7366 |
|
7367 | jQuery.each( [ "get", "post" ], function( i, method ) {
|
7368 | jQuery[ method ] = function( url, data, callback, type ) {
|
7369 |
|
7370 | if ( jQuery.isFunction( data ) ) {
|
7371 | type = type || callback;
|
7372 | callback = data;
|
7373 | data = undefined;
|
7374 | }
|
7375 |
|
7376 | return jQuery.ajax({
|
7377 | url: url,
|
7378 | type: method,
|
7379 | dataType: type,
|
7380 | data: data,
|
7381 | success: callback
|
7382 | });
|
7383 | };
|
7384 | });
|
7385 |
|
7386 |
|
7387 |
|
7388 |
|
7389 |
|
7390 | function ajaxHandleResponses( s, jqXHR, responses ) {
|
7391 |
|
7392 | var ct, type, finalDataType, firstDataType,
|
7393 | contents = s.contents,
|
7394 | dataTypes = s.dataTypes;
|
7395 |
|
7396 |
|
7397 | while( dataTypes[ 0 ] === "*" ) {
|
7398 | dataTypes.shift();
|
7399 | if ( ct === undefined ) {
|
7400 | ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
|
7401 | }
|
7402 | }
|
7403 |
|
7404 |
|
7405 | if ( ct ) {
|
7406 | for ( type in contents ) {
|
7407 | if ( contents[ type ] && contents[ type ].test( ct ) ) {
|
7408 | dataTypes.unshift( type );
|
7409 | break;
|
7410 | }
|
7411 | }
|
7412 | }
|
7413 |
|
7414 |
|
7415 | if ( dataTypes[ 0 ] in responses ) {
|
7416 | finalDataType = dataTypes[ 0 ];
|
7417 | } else {
|
7418 |
|
7419 | for ( type in responses ) {
|
7420 | if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
|
7421 | finalDataType = type;
|
7422 | break;
|
7423 | }
|
7424 | if ( !firstDataType ) {
|
7425 | firstDataType = type;
|
7426 | }
|
7427 | }
|
7428 |
|
7429 | finalDataType = finalDataType || firstDataType;
|
7430 | }
|
7431 |
|
7432 |
|
7433 |
|
7434 |
|
7435 | if ( finalDataType ) {
|
7436 | if ( finalDataType !== dataTypes[ 0 ] ) {
|
7437 | dataTypes.unshift( finalDataType );
|
7438 | }
|
7439 | return responses[ finalDataType ];
|
7440 | }
|
7441 | }
|
7442 |
|
7443 |
|
7444 |
|
7445 |
|
7446 | function ajaxConvert( s, response, jqXHR, isSuccess ) {
|
7447 | var conv2, current, conv, tmp, prev,
|
7448 | converters = {},
|
7449 |
|
7450 | dataTypes = s.dataTypes.slice();
|
7451 |
|
7452 |
|
7453 | if ( dataTypes[ 1 ] ) {
|
7454 | for ( conv in s.converters ) {
|
7455 | converters[ conv.toLowerCase() ] = s.converters[ conv ];
|
7456 | }
|
7457 | }
|
7458 |
|
7459 | current = dataTypes.shift();
|
7460 |
|
7461 |
|
7462 | while ( current ) {
|
7463 |
|
7464 | if ( s.responseFields[ current ] ) {
|
7465 | jqXHR[ s.responseFields[ current ] ] = response;
|
7466 | }
|
7467 |
|
7468 |
|
7469 | if ( !prev && isSuccess && s.dataFilter ) {
|
7470 | response = s.dataFilter( response, s.dataType );
|
7471 | }
|
7472 |
|
7473 | prev = current;
|
7474 | current = dataTypes.shift();
|
7475 |
|
7476 | if ( current ) {
|
7477 |
|
7478 |
|
7479 | if ( current === "*" ) {
|
7480 |
|
7481 | current = prev;
|
7482 |
|
7483 |
|
7484 | } else if ( prev !== "*" && prev !== current ) {
|
7485 |
|
7486 |
|
7487 | conv = converters[ prev + " " + current ] || converters[ "* " + current ];
|
7488 |
|
7489 |
|
7490 | if ( !conv ) {
|
7491 | for ( conv2 in converters ) {
|
7492 |
|
7493 |
|
7494 | tmp = conv2.split( " " );
|
7495 | if ( tmp[ 1 ] === current ) {
|
7496 |
|
7497 |
|
7498 | conv = converters[ prev + " " + tmp[ 0 ] ] ||
|
7499 | converters[ "* " + tmp[ 0 ] ];
|
7500 | if ( conv ) {
|
7501 |
|
7502 | if ( conv === true ) {
|
7503 | conv = converters[ conv2 ];
|
7504 |
|
7505 |
|
7506 | } else if ( converters[ conv2 ] !== true ) {
|
7507 | current = tmp[ 0 ];
|
7508 | dataTypes.unshift( tmp[ 1 ] );
|
7509 | }
|
7510 | break;
|
7511 | }
|
7512 | }
|
7513 | }
|
7514 | }
|
7515 |
|
7516 |
|
7517 | if ( conv !== true ) {
|
7518 |
|
7519 |
|
7520 | if ( conv && s[ "throws" ] ) {
|
7521 | response = conv( response );
|
7522 | } else {
|
7523 | try {
|
7524 | response = conv( response );
|
7525 | } catch ( e ) {
|
7526 | return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
|
7527 | }
|
7528 | }
|
7529 | }
|
7530 | }
|
7531 | }
|
7532 | }
|
7533 |
|
7534 | return { state: "success", data: response };
|
7535 | }
|
7536 |
|
7537 | jQuery.ajaxSetup({
|
7538 | accepts: {
|
7539 | script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
|
7540 | },
|
7541 | contents: {
|
7542 | script: /(?:java|ecma)script/
|
7543 | },
|
7544 | converters: {
|
7545 | "text script": function( text ) {
|
7546 | jQuery.globalEval( text );
|
7547 | return text;
|
7548 | }
|
7549 | }
|
7550 | });
|
7551 |
|
7552 |
|
7553 | jQuery.ajaxPrefilter( "script", function( s ) {
|
7554 | if ( s.cache === undefined ) {
|
7555 | s.cache = false;
|
7556 | }
|
7557 | if ( s.crossDomain ) {
|
7558 | s.type = "GET";
|
7559 | }
|
7560 | });
|
7561 |
|
7562 |
|
7563 | jQuery.ajaxTransport( "script", function( s ) {
|
7564 |
|
7565 | if ( s.crossDomain ) {
|
7566 | var script, callback;
|
7567 | return {
|
7568 | send: function( _, complete ) {
|
7569 | script = jQuery("<script>").prop({
|
7570 | async: true,
|
7571 | charset: s.scriptCharset,
|
7572 | src: s.url
|
7573 | }).on(
|
7574 | "load error",
|
7575 | callback = function( evt ) {
|
7576 | script.remove();
|
7577 | callback = null;
|
7578 | if ( evt ) {
|
7579 | complete( evt.type === "error" ? 404 : 200, evt.type );
|
7580 | }
|
7581 | }
|
7582 | );
|
7583 | document.head.appendChild( script[ 0 ] );
|
7584 | },
|
7585 | abort: function() {
|
7586 | if ( callback ) {
|
7587 | callback();
|
7588 | }
|
7589 | }
|
7590 | };
|
7591 | }
|
7592 | });
|
7593 | var oldCallbacks = [],
|
7594 | rjsonp = /(=)\?(?=&|$)|\?\?/;
|
7595 |
|
7596 |
|
7597 | jQuery.ajaxSetup({
|
7598 | jsonp: "callback",
|
7599 | jsonpCallback: function() {
|
7600 | var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
|
7601 | this[ callback ] = true;
|
7602 | return callback;
|
7603 | }
|
7604 | });
|
7605 |
|
7606 |
|
7607 | jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
|
7608 |
|
7609 | var callbackName, overwritten, responseContainer,
|
7610 | jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
|
7611 | "url" :
|
7612 | typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
|
7613 | );
|
7614 |
|
7615 |
|
7616 | if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
|
7617 |
|
7618 |
|
7619 | callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
|
7620 | s.jsonpCallback() :
|
7621 | s.jsonpCallback;
|
7622 |
|
7623 |
|
7624 | if ( jsonProp ) {
|
7625 | s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
|
7626 | } else if ( s.jsonp !== false ) {
|
7627 | s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
|
7628 | }
|
7629 |
|
7630 |
|
7631 | s.converters["script json"] = function() {
|
7632 | if ( !responseContainer ) {
|
7633 | jQuery.error( callbackName + " was not called" );
|
7634 | }
|
7635 | return responseContainer[ 0 ];
|
7636 | };
|
7637 |
|
7638 |
|
7639 | s.dataTypes[ 0 ] = "json";
|
7640 |
|
7641 |
|
7642 | overwritten = window[ callbackName ];
|
7643 | window[ callbackName ] = function() {
|
7644 | responseContainer = arguments;
|
7645 | };
|
7646 |
|
7647 |
|
7648 | jqXHR.always(function() {
|
7649 |
|
7650 | window[ callbackName ] = overwritten;
|
7651 |
|
7652 |
|
7653 | if ( s[ callbackName ] ) {
|
7654 |
|
7655 | s.jsonpCallback = originalSettings.jsonpCallback;
|
7656 |
|
7657 |
|
7658 | oldCallbacks.push( callbackName );
|
7659 | }
|
7660 |
|
7661 |
|
7662 | if ( responseContainer && jQuery.isFunction( overwritten ) ) {
|
7663 | overwritten( responseContainer[ 0 ] );
|
7664 | }
|
7665 |
|
7666 | responseContainer = overwritten = undefined;
|
7667 | });
|
7668 |
|
7669 |
|
7670 | return "script";
|
7671 | }
|
7672 | });
|
7673 | jQuery.ajaxSettings.xhr = function() {
|
7674 | try {
|
7675 | return new XMLHttpRequest();
|
7676 | } catch( e ) {}
|
7677 | };
|
7678 |
|
7679 | var xhrSupported = jQuery.ajaxSettings.xhr(),
|
7680 | xhrSuccessStatus = {
|
7681 |
|
7682 | 0: 200,
|
7683 |
|
7684 |
|
7685 | 1223: 204
|
7686 | },
|
7687 |
|
7688 |
|
7689 |
|
7690 | xhrId = 0,
|
7691 | xhrCallbacks = {};
|
7692 |
|
7693 | if ( window.ActiveXObject ) {
|
7694 | jQuery( window ).on( "unload", function() {
|
7695 | for( var key in xhrCallbacks ) {
|
7696 | xhrCallbacks[ key ]();
|
7697 | }
|
7698 | xhrCallbacks = undefined;
|
7699 | });
|
7700 | }
|
7701 |
|
7702 | jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
|
7703 | jQuery.support.ajax = xhrSupported = !!xhrSupported;
|
7704 |
|
7705 | jQuery.ajaxTransport(function( options ) {
|
7706 | var callback;
|
7707 |
|
7708 | if ( jQuery.support.cors || xhrSupported && !options.crossDomain ) {
|
7709 | return {
|
7710 | send: function( headers, complete ) {
|
7711 | var i, id,
|
7712 | xhr = options.xhr();
|
7713 | xhr.open( options.type, options.url, options.async, options.username, options.password );
|
7714 |
|
7715 | if ( options.xhrFields ) {
|
7716 | for ( i in options.xhrFields ) {
|
7717 | xhr[ i ] = options.xhrFields[ i ];
|
7718 | }
|
7719 | }
|
7720 |
|
7721 | if ( options.mimeType && xhr.overrideMimeType ) {
|
7722 | xhr.overrideMimeType( options.mimeType );
|
7723 | }
|
7724 |
|
7725 |
|
7726 |
|
7727 |
|
7728 |
|
7729 | if ( !options.crossDomain && !headers["X-Requested-With"] ) {
|
7730 | headers["X-Requested-With"] = "XMLHttpRequest";
|
7731 | }
|
7732 |
|
7733 | for ( i in headers ) {
|
7734 | xhr.setRequestHeader( i, headers[ i ] );
|
7735 | }
|
7736 |
|
7737 | callback = function( type ) {
|
7738 | return function() {
|
7739 | if ( callback ) {
|
7740 | delete xhrCallbacks[ id ];
|
7741 | callback = xhr.onload = xhr.onerror = null;
|
7742 | if ( type === "abort" ) {
|
7743 | xhr.abort();
|
7744 | } else if ( type === "error" ) {
|
7745 | complete(
|
7746 |
|
7747 | xhr.statusCode || 404,
|
7748 | xhr.statusText
|
7749 | );
|
7750 | } else {
|
7751 | complete(
|
7752 | xhrSuccessStatus[ xhr.statusCode ] || xhr.statusCode,
|
7753 | xhr.statusText,
|
7754 |
|
7755 |
|
7756 |
|
7757 | typeof xhr.responseText === "string" ? {
|
7758 | text: xhr.responseText
|
7759 | } : undefined,
|
7760 | xhr.getAllResponseHeaders()
|
7761 | );
|
7762 | }
|
7763 | }
|
7764 | };
|
7765 | };
|
7766 |
|
7767 | xhr.onload = callback();
|
7768 | xhr.onerror = callback("error");
|
7769 |
|
7770 | callback = xhrCallbacks[( id = xhrId++ )] = callback("abort");
|
7771 |
|
7772 |
|
7773 |
|
7774 | xhr.send( options.hasContent && options.data || null );
|
7775 | },
|
7776 | abort: function() {
|
7777 | if ( callback ) {
|
7778 | callback();
|
7779 | }
|
7780 | }
|
7781 | };
|
7782 | }
|
7783 | });
|
7784 | var fxNow, timerId,
|
7785 | rfxtypes = /^(?:toggle|show|hide)$/,
|
7786 | rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
|
7787 | rrun = /queueHooks$/,
|
7788 | animationPrefilters = [ defaultPrefilter ],
|
7789 | tweeners = {
|
7790 | "*": [function( prop, value ) {
|
7791 | var end, unit,
|
7792 | tween = this.createTween( prop, value ),
|
7793 | parts = rfxnum.exec( value ),
|
7794 | target = tween.cur(),
|
7795 | start = +target || 0,
|
7796 | scale = 1,
|
7797 | maxIterations = 20;
|
7798 |
|
7799 | if ( parts ) {
|
7800 | end = +parts[2];
|
7801 | unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
|
7802 |
|
7803 |
|
7804 | if ( unit !== "px" && start ) {
|
7805 |
|
7806 |
|
7807 |
|
7808 | start = jQuery.css( tween.elem, prop, true ) || end || 1;
|
7809 |
|
7810 | do {
|
7811 |
|
7812 |
|
7813 | scale = scale || ".5";
|
7814 |
|
7815 |
|
7816 | start = start / scale;
|
7817 | jQuery.style( tween.elem, prop, start + unit );
|
7818 |
|
7819 |
|
7820 |
|
7821 | } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
|
7822 | }
|
7823 |
|
7824 | tween.unit = unit;
|
7825 | tween.start = start;
|
7826 |
|
7827 | tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
|
7828 | }
|
7829 | return tween;
|
7830 | }]
|
7831 | };
|
7832 |
|
7833 |
|
7834 | function createFxNow() {
|
7835 | setTimeout(function() {
|
7836 | fxNow = undefined;
|
7837 | });
|
7838 | return ( fxNow = jQuery.now() );
|
7839 | }
|
7840 |
|
7841 | function createTweens( animation, props ) {
|
7842 | jQuery.each( props, function( prop, value ) {
|
7843 | var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
|
7844 | index = 0,
|
7845 | length = collection.length;
|
7846 | for ( ; index < length; index++ ) {
|
7847 | if ( collection[ index ].call( animation, prop, value ) ) {
|
7848 |
|
7849 |
|
7850 | return;
|
7851 | }
|
7852 | }
|
7853 | });
|
7854 | }
|
7855 |
|
7856 | function Animation( elem, properties, options ) {
|
7857 | var result,
|
7858 | stopped,
|
7859 | index = 0,
|
7860 | length = animationPrefilters.length,
|
7861 | deferred = jQuery.Deferred().always( function() {
|
7862 |
|
7863 | delete tick.elem;
|
7864 | }),
|
7865 | tick = function() {
|
7866 | if ( stopped ) {
|
7867 | return false;
|
7868 | }
|
7869 | var currentTime = fxNow || createFxNow(),
|
7870 | remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
|
7871 |
|
7872 | temp = remaining / animation.duration || 0,
|
7873 | percent = 1 - temp,
|
7874 | index = 0,
|
7875 | length = animation.tweens.length;
|
7876 |
|
7877 | for ( ; index < length ; index++ ) {
|
7878 | animation.tweens[ index ].run( percent );
|
7879 | }
|
7880 |
|
7881 | deferred.notifyWith( elem, [ animation, percent, remaining ]);
|
7882 |
|
7883 | if ( percent < 1 && length ) {
|
7884 | return remaining;
|
7885 | } else {
|
7886 | deferred.resolveWith( elem, [ animation ] );
|
7887 | return false;
|
7888 | }
|
7889 | },
|
7890 | animation = deferred.promise({
|
7891 | elem: elem,
|
7892 | props: jQuery.extend( {}, properties ),
|
7893 | opts: jQuery.extend( true, { specialEasing: {} }, options ),
|
7894 | originalProperties: properties,
|
7895 | originalOptions: options,
|
7896 | startTime: fxNow || createFxNow(),
|
7897 | duration: options.duration,
|
7898 | tweens: [],
|
7899 | createTween: function( prop, end ) {
|
7900 | var tween = jQuery.Tween( elem, animation.opts, prop, end,
|
7901 | animation.opts.specialEasing[ prop ] || animation.opts.easing );
|
7902 | animation.tweens.push( tween );
|
7903 | return tween;
|
7904 | },
|
7905 | stop: function( gotoEnd ) {
|
7906 | var index = 0,
|
7907 |
|
7908 |
|
7909 | length = gotoEnd ? animation.tweens.length : 0;
|
7910 | if ( stopped ) {
|
7911 | return this;
|
7912 | }
|
7913 | stopped = true;
|
7914 | for ( ; index < length ; index++ ) {
|
7915 | animation.tweens[ index ].run( 1 );
|
7916 | }
|
7917 |
|
7918 |
|
7919 |
|
7920 | if ( gotoEnd ) {
|
7921 | deferred.resolveWith( elem, [ animation, gotoEnd ] );
|
7922 | } else {
|
7923 | deferred.rejectWith( elem, [ animation, gotoEnd ] );
|
7924 | }
|
7925 | return this;
|
7926 | }
|
7927 | }),
|
7928 | props = animation.props;
|
7929 |
|
7930 | propFilter( props, animation.opts.specialEasing );
|
7931 |
|
7932 | for ( ; index < length ; index++ ) {
|
7933 | result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
|
7934 | if ( result ) {
|
7935 | return result;
|
7936 | }
|
7937 | }
|
7938 |
|
7939 | createTweens( animation, props );
|
7940 |
|
7941 | if ( jQuery.isFunction( animation.opts.start ) ) {
|
7942 | animation.opts.start.call( elem, animation );
|
7943 | }
|
7944 |
|
7945 | jQuery.fx.timer(
|
7946 | jQuery.extend( tick, {
|
7947 | elem: elem,
|
7948 | anim: animation,
|
7949 | queue: animation.opts.queue
|
7950 | })
|
7951 | );
|
7952 |
|
7953 |
|
7954 | return animation.progress( animation.opts.progress )
|
7955 | .done( animation.opts.done, animation.opts.complete )
|
7956 | .fail( animation.opts.fail )
|
7957 | .always( animation.opts.always );
|
7958 | }
|
7959 |
|
7960 | function propFilter( props, specialEasing ) {
|
7961 | var index, name, easing, value, hooks;
|
7962 |
|
7963 |
|
7964 | for ( index in props ) {
|
7965 | name = jQuery.camelCase( index );
|
7966 | easing = specialEasing[ name ];
|
7967 | value = props[ index ];
|
7968 | if ( jQuery.isArray( value ) ) {
|
7969 | easing = value[ 1 ];
|
7970 | value = props[ index ] = value[ 0 ];
|
7971 | }
|
7972 |
|
7973 | if ( index !== name ) {
|
7974 | props[ name ] = value;
|
7975 | delete props[ index ];
|
7976 | }
|
7977 |
|
7978 | hooks = jQuery.cssHooks[ name ];
|
7979 | if ( hooks && "expand" in hooks ) {
|
7980 | value = hooks.expand( value );
|
7981 | delete props[ name ];
|
7982 |
|
7983 |
|
7984 |
|
7985 | for ( index in value ) {
|
7986 | if ( !( index in props ) ) {
|
7987 | props[ index ] = value[ index ];
|
7988 | specialEasing[ index ] = easing;
|
7989 | }
|
7990 | }
|
7991 | } else {
|
7992 | specialEasing[ name ] = easing;
|
7993 | }
|
7994 | }
|
7995 | }
|
7996 |
|
7997 | jQuery.Animation = jQuery.extend( Animation, {
|
7998 |
|
7999 | tweener: function( props, callback ) {
|
8000 | if ( jQuery.isFunction( props ) ) {
|
8001 | callback = props;
|
8002 | props = [ "*" ];
|
8003 | } else {
|
8004 | props = props.split(" ");
|
8005 | }
|
8006 |
|
8007 | var prop,
|
8008 | index = 0,
|
8009 | length = props.length;
|
8010 |
|
8011 | for ( ; index < length ; index++ ) {
|
8012 | prop = props[ index ];
|
8013 | tweeners[ prop ] = tweeners[ prop ] || [];
|
8014 | tweeners[ prop ].unshift( callback );
|
8015 | }
|
8016 | },
|
8017 |
|
8018 | prefilter: function( callback, prepend ) {
|
8019 | if ( prepend ) {
|
8020 | animationPrefilters.unshift( callback );
|
8021 | } else {
|
8022 | animationPrefilters.push( callback );
|
8023 | }
|
8024 | }
|
8025 | });
|
8026 |
|
8027 | function defaultPrefilter( elem, props, opts ) {
|
8028 |
|
8029 | var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
|
8030 | anim = this,
|
8031 | style = elem.style,
|
8032 | orig = {},
|
8033 | handled = [],
|
8034 | hidden = elem.nodeType && isHidden( elem );
|
8035 |
|
8036 |
|
8037 | if ( !opts.queue ) {
|
8038 | hooks = jQuery._queueHooks( elem, "fx" );
|
8039 | if ( hooks.unqueued == null ) {
|
8040 | hooks.unqueued = 0;
|
8041 | oldfire = hooks.empty.fire;
|
8042 | hooks.empty.fire = function() {
|
8043 | if ( !hooks.unqueued ) {
|
8044 | oldfire();
|
8045 | }
|
8046 | };
|
8047 | }
|
8048 | hooks.unqueued++;
|
8049 |
|
8050 | anim.always(function() {
|
8051 |
|
8052 |
|
8053 | anim.always(function() {
|
8054 | hooks.unqueued--;
|
8055 | if ( !jQuery.queue( elem, "fx" ).length ) {
|
8056 | hooks.empty.fire();
|
8057 | }
|
8058 | });
|
8059 | });
|
8060 | }
|
8061 |
|
8062 |
|
8063 | if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
|
8064 |
|
8065 |
|
8066 |
|
8067 |
|
8068 | opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
|
8069 |
|
8070 |
|
8071 |
|
8072 | if ( jQuery.css( elem, "display" ) === "inline" &&
|
8073 | jQuery.css( elem, "float" ) === "none" ) {
|
8074 |
|
8075 | style.display = "inline-block";
|
8076 | }
|
8077 | }
|
8078 |
|
8079 | if ( opts.overflow ) {
|
8080 | style.overflow = "hidden";
|
8081 | anim.always(function() {
|
8082 | style.overflow = opts.overflow[ 0 ];
|
8083 | style.overflowX = opts.overflow[ 1 ];
|
8084 | style.overflowY = opts.overflow[ 2 ];
|
8085 | });
|
8086 | }
|
8087 |
|
8088 |
|
8089 |
|
8090 | dataShow = data_priv.get( elem, "fxshow" );
|
8091 | for ( index in props ) {
|
8092 | value = props[ index ];
|
8093 | if ( rfxtypes.exec( value ) ) {
|
8094 | delete props[ index ];
|
8095 | toggle = toggle || value === "toggle";
|
8096 | if ( value === ( hidden ? "hide" : "show" ) ) {
|
8097 |
|
8098 |
|
8099 | if( value === "show" && dataShow !== undefined && dataShow[ index ] !== undefined ) {
|
8100 | hidden = true;
|
8101 | } else {
|
8102 | continue;
|
8103 | }
|
8104 | }
|
8105 | handled.push( index );
|
8106 | }
|
8107 | }
|
8108 |
|
8109 | length = handled.length;
|
8110 | if ( length ) {
|
8111 | dataShow = data_priv.get( elem, "fxshow" ) || data_priv.access( elem, "fxshow", {} );
|
8112 | if ( "hidden" in dataShow ) {
|
8113 | hidden = dataShow.hidden;
|
8114 | }
|
8115 |
|
8116 |
|
8117 | if ( toggle ) {
|
8118 | dataShow.hidden = !hidden;
|
8119 | }
|
8120 | if ( hidden ) {
|
8121 | jQuery( elem ).show();
|
8122 | } else {
|
8123 | anim.done(function() {
|
8124 | jQuery( elem ).hide();
|
8125 | });
|
8126 | }
|
8127 | anim.done(function() {
|
8128 | var prop;
|
8129 |
|
8130 | data_priv.remove( elem, "fxshow" );
|
8131 | for ( prop in orig ) {
|
8132 | jQuery.style( elem, prop, orig[ prop ] );
|
8133 | }
|
8134 | });
|
8135 | for ( index = 0 ; index < length ; index++ ) {
|
8136 | prop = handled[ index ];
|
8137 | tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
|
8138 | orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
|
8139 |
|
8140 | if ( !( prop in dataShow ) ) {
|
8141 | dataShow[ prop ] = tween.start;
|
8142 | if ( hidden ) {
|
8143 | tween.end = tween.start;
|
8144 | tween.start = prop === "width" || prop === "height" ? 1 : 0;
|
8145 | }
|
8146 | }
|
8147 | }
|
8148 | }
|
8149 | }
|
8150 |
|
8151 | function Tween( elem, options, prop, end, easing ) {
|
8152 | return new Tween.prototype.init( elem, options, prop, end, easing );
|
8153 | }
|
8154 | jQuery.Tween = Tween;
|
8155 |
|
8156 | Tween.prototype = {
|
8157 | constructor: Tween,
|
8158 | init: function( elem, options, prop, end, easing, unit ) {
|
8159 | this.elem = elem;
|
8160 | this.prop = prop;
|
8161 | this.easing = easing || "swing";
|
8162 | this.options = options;
|
8163 | this.start = this.now = this.cur();
|
8164 | this.end = end;
|
8165 | this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
|
8166 | },
|
8167 | cur: function() {
|
8168 | var hooks = Tween.propHooks[ this.prop ];
|
8169 |
|
8170 | return hooks && hooks.get ?
|
8171 | hooks.get( this ) :
|
8172 | Tween.propHooks._default.get( this );
|
8173 | },
|
8174 | run: function( percent ) {
|
8175 | var eased,
|
8176 | hooks = Tween.propHooks[ this.prop ];
|
8177 |
|
8178 | if ( this.options.duration ) {
|
8179 | this.pos = eased = jQuery.easing[ this.easing ](
|
8180 | percent, this.options.duration * percent, 0, 1, this.options.duration
|
8181 | );
|
8182 | } else {
|
8183 | this.pos = eased = percent;
|
8184 | }
|
8185 | this.now = ( this.end - this.start ) * eased + this.start;
|
8186 |
|
8187 | if ( this.options.step ) {
|
8188 | this.options.step.call( this.elem, this.now, this );
|
8189 | }
|
8190 |
|
8191 | if ( hooks && hooks.set ) {
|
8192 | hooks.set( this );
|
8193 | } else {
|
8194 | Tween.propHooks._default.set( this );
|
8195 | }
|
8196 | return this;
|
8197 | }
|
8198 | };
|
8199 |
|
8200 | Tween.prototype.init.prototype = Tween.prototype;
|
8201 |
|
8202 | Tween.propHooks = {
|
8203 | _default: {
|
8204 | get: function( tween ) {
|
8205 | var result;
|
8206 |
|
8207 | if ( tween.elem[ tween.prop ] != null &&
|
8208 | (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
|
8209 | return tween.elem[ tween.prop ];
|
8210 | }
|
8211 |
|
8212 |
|
8213 |
|
8214 |
|
8215 |
|
8216 | result = jQuery.css( tween.elem, tween.prop, "" );
|
8217 |
|
8218 | return !result || result === "auto" ? 0 : result;
|
8219 | },
|
8220 | set: function( tween ) {
|
8221 |
|
8222 |
|
8223 | if ( jQuery.fx.step[ tween.prop ] ) {
|
8224 | jQuery.fx.step[ tween.prop ]( tween );
|
8225 | } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
|
8226 | jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
|
8227 | } else {
|
8228 | tween.elem[ tween.prop ] = tween.now;
|
8229 | }
|
8230 | }
|
8231 | }
|
8232 | };
|
8233 |
|
8234 |
|
8235 |
|
8236 |
|
8237 | Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
|
8238 | set: function( tween ) {
|
8239 | if ( tween.elem.nodeType && tween.elem.parentNode ) {
|
8240 | tween.elem[ tween.prop ] = tween.now;
|
8241 | }
|
8242 | }
|
8243 | };
|
8244 |
|
8245 | jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
|
8246 | var cssFn = jQuery.fn[ name ];
|
8247 | jQuery.fn[ name ] = function( speed, easing, callback ) {
|
8248 | return speed == null || typeof speed === "boolean" ?
|
8249 | cssFn.apply( this, arguments ) :
|
8250 | this.animate( genFx( name, true ), speed, easing, callback );
|
8251 | };
|
8252 | });
|
8253 |
|
8254 | jQuery.fn.extend({
|
8255 | fadeTo: function( speed, to, easing, callback ) {
|
8256 |
|
8257 |
|
8258 | return this.filter( isHidden ).css( "opacity", 0 ).show()
|
8259 |
|
8260 |
|
8261 | .end().animate({ opacity: to }, speed, easing, callback );
|
8262 | },
|
8263 | animate: function( prop, speed, easing, callback ) {
|
8264 | var empty = jQuery.isEmptyObject( prop ),
|
8265 | optall = jQuery.speed( speed, easing, callback ),
|
8266 | doAnimation = function() {
|
8267 |
|
8268 | var anim = Animation( this, jQuery.extend( {}, prop ), optall );
|
8269 | doAnimation.finish = function() {
|
8270 | anim.stop( true );
|
8271 | };
|
8272 |
|
8273 | if ( empty || data_priv.get( this, "finish" ) ) {
|
8274 | anim.stop( true );
|
8275 | }
|
8276 | };
|
8277 | doAnimation.finish = doAnimation;
|
8278 |
|
8279 | return empty || optall.queue === false ?
|
8280 | this.each( doAnimation ) :
|
8281 | this.queue( optall.queue, doAnimation );
|
8282 | },
|
8283 | stop: function( type, clearQueue, gotoEnd ) {
|
8284 | var stopQueue = function( hooks ) {
|
8285 | var stop = hooks.stop;
|
8286 | delete hooks.stop;
|
8287 | stop( gotoEnd );
|
8288 | };
|
8289 |
|
8290 | if ( typeof type !== "string" ) {
|
8291 | gotoEnd = clearQueue;
|
8292 | clearQueue = type;
|
8293 | type = undefined;
|
8294 | }
|
8295 | if ( clearQueue && type !== false ) {
|
8296 | this.queue( type || "fx", [] );
|
8297 | }
|
8298 |
|
8299 | return this.each(function() {
|
8300 | var dequeue = true,
|
8301 | index = type != null && type + "queueHooks",
|
8302 | timers = jQuery.timers,
|
8303 | data = data_priv.get( this );
|
8304 |
|
8305 | if ( index ) {
|
8306 | if ( data[ index ] && data[ index ].stop ) {
|
8307 | stopQueue( data[ index ] );
|
8308 | }
|
8309 | } else {
|
8310 | for ( index in data ) {
|
8311 | if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
|
8312 | stopQueue( data[ index ] );
|
8313 | }
|
8314 | }
|
8315 | }
|
8316 |
|
8317 | for ( index = timers.length; index--; ) {
|
8318 | if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
|
8319 | timers[ index ].anim.stop( gotoEnd );
|
8320 | dequeue = false;
|
8321 | timers.splice( index, 1 );
|
8322 | }
|
8323 | }
|
8324 |
|
8325 |
|
8326 |
|
8327 |
|
8328 | if ( dequeue || !gotoEnd ) {
|
8329 | jQuery.dequeue( this, type );
|
8330 | }
|
8331 | });
|
8332 | },
|
8333 | finish: function( type ) {
|
8334 | if ( type !== false ) {
|
8335 | type = type || "fx";
|
8336 | }
|
8337 | return this.each(function() {
|
8338 | var index,
|
8339 | data = data_priv.get( this ),
|
8340 | queue = data[ type + "queue" ],
|
8341 | hooks = data[ type + "queueHooks" ],
|
8342 | timers = jQuery.timers,
|
8343 | length = queue ? queue.length : 0;
|
8344 |
|
8345 |
|
8346 | data.finish = true;
|
8347 |
|
8348 |
|
8349 | jQuery.queue( this, type, [] );
|
8350 |
|
8351 | if ( hooks && hooks.cur && hooks.cur.finish ) {
|
8352 | hooks.cur.finish.call( this );
|
8353 | }
|
8354 |
|
8355 |
|
8356 | for ( index = timers.length; index--; ) {
|
8357 | if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
|
8358 | timers[ index ].anim.stop( true );
|
8359 | timers.splice( index, 1 );
|
8360 | }
|
8361 | }
|
8362 |
|
8363 |
|
8364 | for ( index = 0; index < length; index++ ) {
|
8365 | if ( queue[ index ] && queue[ index ].finish ) {
|
8366 | queue[ index ].finish.call( this );
|
8367 | }
|
8368 | }
|
8369 |
|
8370 |
|
8371 | delete data.finish;
|
8372 | });
|
8373 | }
|
8374 | });
|
8375 |
|
8376 |
|
8377 | function genFx( type, includeWidth ) {
|
8378 | var which,
|
8379 | attrs = { height: type },
|
8380 | i = 0;
|
8381 |
|
8382 |
|
8383 |
|
8384 | includeWidth = includeWidth? 1 : 0;
|
8385 | for( ; i < 4 ; i += 2 - includeWidth ) {
|
8386 | which = cssExpand[ i ];
|
8387 | attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
|
8388 | }
|
8389 |
|
8390 | if ( includeWidth ) {
|
8391 | attrs.opacity = attrs.width = type;
|
8392 | }
|
8393 |
|
8394 | return attrs;
|
8395 | }
|
8396 |
|
8397 |
|
8398 | jQuery.each({
|
8399 | slideDown: genFx("show"),
|
8400 | slideUp: genFx("hide"),
|
8401 | slideToggle: genFx("toggle"),
|
8402 | fadeIn: { opacity: "show" },
|
8403 | fadeOut: { opacity: "hide" },
|
8404 | fadeToggle: { opacity: "toggle" }
|
8405 | }, function( name, props ) {
|
8406 | jQuery.fn[ name ] = function( speed, easing, callback ) {
|
8407 | return this.animate( props, speed, easing, callback );
|
8408 | };
|
8409 | });
|
8410 |
|
8411 | jQuery.speed = function( speed, easing, fn ) {
|
8412 | var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
|
8413 | complete: fn || !fn && easing ||
|
8414 | jQuery.isFunction( speed ) && speed,
|
8415 | duration: speed,
|
8416 | easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
|
8417 | };
|
8418 |
|
8419 | opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
|
8420 | opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
|
8421 |
|
8422 |
|
8423 | if ( opt.queue == null || opt.queue === true ) {
|
8424 | opt.queue = "fx";
|
8425 | }
|
8426 |
|
8427 |
|
8428 | opt.old = opt.complete;
|
8429 |
|
8430 | opt.complete = function() {
|
8431 | if ( jQuery.isFunction( opt.old ) ) {
|
8432 | opt.old.call( this );
|
8433 | }
|
8434 |
|
8435 | if ( opt.queue ) {
|
8436 | jQuery.dequeue( this, opt.queue );
|
8437 | }
|
8438 | };
|
8439 |
|
8440 | return opt;
|
8441 | };
|
8442 |
|
8443 | jQuery.easing = {
|
8444 | linear: function( p ) {
|
8445 | return p;
|
8446 | },
|
8447 | swing: function( p ) {
|
8448 | return 0.5 - Math.cos( p*Math.PI ) / 2;
|
8449 | }
|
8450 | };
|
8451 |
|
8452 | jQuery.timers = [];
|
8453 | jQuery.fx = Tween.prototype.init;
|
8454 | jQuery.fx.tick = function() {
|
8455 | var timer,
|
8456 | timers = jQuery.timers,
|
8457 | i = 0;
|
8458 |
|
8459 | fxNow = jQuery.now();
|
8460 |
|
8461 | for ( ; i < timers.length; i++ ) {
|
8462 | timer = timers[ i ];
|
8463 |
|
8464 | if ( !timer() && timers[ i ] === timer ) {
|
8465 | timers.splice( i--, 1 );
|
8466 | }
|
8467 | }
|
8468 |
|
8469 | if ( !timers.length ) {
|
8470 | jQuery.fx.stop();
|
8471 | }
|
8472 | fxNow = undefined;
|
8473 | };
|
8474 |
|
8475 | jQuery.fx.timer = function( timer ) {
|
8476 | if ( timer() && jQuery.timers.push( timer ) ) {
|
8477 | jQuery.fx.start();
|
8478 | }
|
8479 | };
|
8480 |
|
8481 | jQuery.fx.interval = 13;
|
8482 |
|
8483 | jQuery.fx.start = function() {
|
8484 | if ( !timerId ) {
|
8485 | timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
|
8486 | }
|
8487 | };
|
8488 |
|
8489 | jQuery.fx.stop = function() {
|
8490 | clearInterval( timerId );
|
8491 | timerId = null;
|
8492 | };
|
8493 |
|
8494 | jQuery.fx.speeds = {
|
8495 | slow: 600,
|
8496 | fast: 200,
|
8497 |
|
8498 | _default: 400
|
8499 | };
|
8500 |
|
8501 |
|
8502 | jQuery.fx.step = {};
|
8503 |
|
8504 | if ( jQuery.expr && jQuery.expr.filters ) {
|
8505 | jQuery.expr.filters.animated = function( elem ) {
|
8506 | return jQuery.grep(jQuery.timers, function( fn ) {
|
8507 | return elem === fn.elem;
|
8508 | }).length;
|
8509 | };
|
8510 | }
|
8511 | jQuery.fn.offset = function( options ) {
|
8512 | if ( arguments.length ) {
|
8513 | return options === undefined ?
|
8514 | this :
|
8515 | this.each(function( i ) {
|
8516 | jQuery.offset.setOffset( this, options, i );
|
8517 | });
|
8518 | }
|
8519 |
|
8520 | var docElem, win,
|
8521 | elem = this[ 0 ],
|
8522 | box = { top: 0, left: 0 },
|
8523 | doc = elem && elem.ownerDocument;
|
8524 |
|
8525 | if ( !doc ) {
|
8526 | return;
|
8527 | }
|
8528 |
|
8529 | docElem = doc.documentElement;
|
8530 |
|
8531 |
|
8532 | if ( !jQuery.contains( docElem, elem ) ) {
|
8533 | return box;
|
8534 | }
|
8535 |
|
8536 |
|
8537 |
|
8538 | if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
|
8539 | box = elem.getBoundingClientRect();
|
8540 | }
|
8541 | win = getWindow( doc );
|
8542 | return {
|
8543 | top: box.top + win.pageYOffset - docElem.clientTop,
|
8544 | left: box.left + win.pageXOffset - docElem.clientLeft
|
8545 | };
|
8546 | };
|
8547 |
|
8548 | jQuery.offset = {
|
8549 |
|
8550 | setOffset: function( elem, options, i ) {
|
8551 | var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
|
8552 | position = jQuery.css( elem, "position" ),
|
8553 | curElem = jQuery( elem ),
|
8554 | props = {};
|
8555 |
|
8556 |
|
8557 | if ( position === "static" ) {
|
8558 | elem.style.position = "relative";
|
8559 | }
|
8560 |
|
8561 | curOffset = curElem.offset();
|
8562 | curCSSTop = jQuery.css( elem, "top" );
|
8563 | curCSSLeft = jQuery.css( elem, "left" );
|
8564 | calculatePosition = ( position === "absolute" || position === "fixed" ) && ( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
|
8565 |
|
8566 |
|
8567 | if ( calculatePosition ) {
|
8568 | curPosition = curElem.position();
|
8569 | curTop = curPosition.top;
|
8570 | curLeft = curPosition.left;
|
8571 |
|
8572 | } else {
|
8573 | curTop = parseFloat( curCSSTop ) || 0;
|
8574 | curLeft = parseFloat( curCSSLeft ) || 0;
|
8575 | }
|
8576 |
|
8577 | if ( jQuery.isFunction( options ) ) {
|
8578 | options = options.call( elem, i, curOffset );
|
8579 | }
|
8580 |
|
8581 | if ( options.top != null ) {
|
8582 | props.top = ( options.top - curOffset.top ) + curTop;
|
8583 | }
|
8584 | if ( options.left != null ) {
|
8585 | props.left = ( options.left - curOffset.left ) + curLeft;
|
8586 | }
|
8587 |
|
8588 | if ( "using" in options ) {
|
8589 | options.using.call( elem, props );
|
8590 |
|
8591 | } else {
|
8592 | curElem.css( props );
|
8593 | }
|
8594 | }
|
8595 | };
|
8596 |
|
8597 |
|
8598 | jQuery.fn.extend({
|
8599 |
|
8600 | position: function() {
|
8601 | if ( !this[ 0 ] ) {
|
8602 | return;
|
8603 | }
|
8604 |
|
8605 | var offsetParent, offset,
|
8606 | elem = this[ 0 ],
|
8607 | parentOffset = { top: 0, left: 0 };
|
8608 |
|
8609 |
|
8610 | if ( jQuery.css( elem, "position" ) === "fixed" ) {
|
8611 |
|
8612 | offset = elem.getBoundingClientRect();
|
8613 |
|
8614 | } else {
|
8615 |
|
8616 | offsetParent = this.offsetParent();
|
8617 |
|
8618 |
|
8619 | offset = this.offset();
|
8620 | if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
|
8621 | parentOffset = offsetParent.offset();
|
8622 | }
|
8623 |
|
8624 |
|
8625 | parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
|
8626 | parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
|
8627 | }
|
8628 |
|
8629 |
|
8630 | return {
|
8631 | top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
|
8632 | left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
|
8633 | };
|
8634 | },
|
8635 |
|
8636 | offsetParent: function() {
|
8637 | return this.map(function() {
|
8638 | var offsetParent = this.offsetParent || docElem;
|
8639 |
|
8640 | while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
|
8641 | offsetParent = offsetParent.offsetParent;
|
8642 | }
|
8643 |
|
8644 | return offsetParent || docElem;
|
8645 | });
|
8646 | }
|
8647 | });
|
8648 |
|
8649 |
|
8650 |
|
8651 | jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
|
8652 | var top = "pageYOffset" === prop;
|
8653 |
|
8654 | jQuery.fn[ method ] = function( val ) {
|
8655 | return jQuery.access( this, function( elem, method, val ) {
|
8656 | var win = getWindow( elem );
|
8657 |
|
8658 | if ( val === undefined ) {
|
8659 | return win ? win[ prop ] : elem[ method ];
|
8660 | }
|
8661 |
|
8662 | if ( win ) {
|
8663 | win.scrollTo(
|
8664 | !top ? val : window.pageXOffset,
|
8665 | top ? val : window.pageYOffset
|
8666 | );
|
8667 |
|
8668 | } else {
|
8669 | elem[ method ] = val;
|
8670 | }
|
8671 | }, method, val, arguments.length, null );
|
8672 | };
|
8673 | });
|
8674 |
|
8675 | function getWindow( elem ) {
|
8676 | return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
|
8677 | }
|
8678 |
|
8679 | jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
|
8680 | jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
|
8681 |
|
8682 | jQuery.fn[ funcName ] = function( margin, value ) {
|
8683 | var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
|
8684 | extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
|
8685 |
|
8686 | return jQuery.access( this, function( elem, type, value ) {
|
8687 | var doc;
|
8688 |
|
8689 | if ( jQuery.isWindow( elem ) ) {
|
8690 |
|
8691 |
|
8692 |
|
8693 | return elem.document.documentElement[ "client" + name ];
|
8694 | }
|
8695 |
|
8696 |
|
8697 | if ( elem.nodeType === 9 ) {
|
8698 | doc = elem.documentElement;
|
8699 |
|
8700 |
|
8701 |
|
8702 | return Math.max(
|
8703 | elem.body[ "scroll" + name ], doc[ "scroll" + name ],
|
8704 | elem.body[ "offset" + name ], doc[ "offset" + name ],
|
8705 | doc[ "client" + name ]
|
8706 | );
|
8707 | }
|
8708 |
|
8709 | return value === undefined ?
|
8710 |
|
8711 | jQuery.css( elem, type, extra ) :
|
8712 |
|
8713 |
|
8714 | jQuery.style( elem, type, value, extra );
|
8715 | }, type, chainable ? margin : undefined, chainable, null );
|
8716 | };
|
8717 | });
|
8718 | });
|
8719 |
|
8720 |
|
8721 |
|
8722 |
|
8723 | jQuery.fn.size = function() {
|
8724 | return this.length;
|
8725 | };
|
8726 |
|
8727 | jQuery.fn.andSelf = jQuery.fn.addBack;
|
8728 |
|
8729 |
|
8730 | if ( typeof module === "object" && typeof module.exports === "object" ) {
|
8731 |
|
8732 |
|
8733 |
|
8734 |
|
8735 | module.exports = jQuery;
|
8736 | } else {
|
8737 |
|
8738 |
|
8739 |
|
8740 |
|
8741 |
|
8742 |
|
8743 |
|
8744 | if ( typeof define === "function" && define.amd ) {
|
8745 | define( "jquery", [], function () { return jQuery; } );
|
8746 | }
|
8747 | }
|
8748 |
|
8749 |
|
8750 |
|
8751 | if ( typeof window === "object" && typeof window.document === "object" ) {
|
8752 | window.jQuery = window.$ = jQuery;
|
8753 | }
|
8754 |
|
8755 | })( window );
|