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