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