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