Merge lp:~costales/unav/0.60-nik90-part-1 into lp:unav

Proposed by costales
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 77
Merged at revision: 67
Proposed branch: lp:~costales/unav/0.60-nik90-part-1
Merge into: lp:unav
Prerequisite: lp:~nik90/unav/unav-convergence-part-1
Diff against target: 9424 lines (+5/-9404)
2 files modified
nav/libraries/jquery.min.js (+4/-9404)
qml/PoiListPage.qml (+1/-0)
To merge this branch: bzr merge lp:~costales/unav/0.60-nik90-part-1
Reviewer Review Type Date Requested Status
Nekhelesh Ramananthan Approve
Review via email: mp+293465@code.launchpad.net

This proposal supersedes a proposal from 2016-04-30.

Commit message

Agreed. Changed branch destination

Description of the change

Minor fixes:
- Less size for jquery
- Issue: Click fav > Search nearby of that fav > Click show all in map: Issue, popup is not hidden.

To post a comment you must log in.
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

I don't think "less size for jquery" is related to convergence and should be part of a new branch. My branch lp:~nik90/unav/unav-convergence-part-1 is in itself a big branch with invasive code changes. Let's only make changes related to convergence in it.

review: Needs Fixing
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nav/libraries/jquery.min.js'
2--- nav/libraries/jquery.min.js 2016-03-26 18:53:17 +0000
3+++ nav/libraries/jquery.min.js 2016-04-30 12:16:40 +0000
4@@ -1,9404 +1,4 @@
5-/*!
6- * jQuery JavaScript Library v1.7.2
7- * http://jquery.com/
8- *
9- * Copyright 2011, John Resig
10- * Dual licensed under the MIT or GPL Version 2 licenses.
11- * http://jquery.org/license
12- *
13- * Includes Sizzle.js
14- * http://sizzlejs.com/
15- * Copyright 2011, The Dojo Foundation
16- * Released under the MIT, BSD, and GPL Licenses.
17- *
18- * Date: Wed Jul 30 14:06:55 UTC 2014
19- */
20-(function( window, undefined ) {
21-
22-// Use the correct document accordingly with window argument (sandbox)
23-var document = window.document,
24- navigator = window.navigator,
25- location = window.location;
26-var jQuery = (function() {
27-
28-// Define a local copy of jQuery
29-var jQuery = function( selector, context ) {
30- // The jQuery object is actually just the init constructor 'enhanced'
31- return new jQuery.fn.init( selector, context, rootjQuery );
32- },
33-
34- // Map over jQuery in case of overwrite
35- _jQuery = window.jQuery,
36-
37- // Map over the $ in case of overwrite
38- _$ = window.$,
39-
40- // A central reference to the root jQuery(document)
41- rootjQuery,
42-
43- // A simple way to check for HTML strings or ID strings
44- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
45- quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
46-
47- // Check if a string has a non-whitespace character in it
48- rnotwhite = /\S/,
49-
50- // Used for trimming whitespace
51- trimLeft = /^\s+/,
52- trimRight = /\s+$/,
53-
54- // Match a standalone tag
55- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
56-
57- // JSON RegExp
58- rvalidchars = /^[\],:{}\s]*$/,
59- rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
60- rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
61- rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
62-
63- // Useragent RegExp
64- rwebkit = /(webkit)[ \/]([\w.]+)/,
65- ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
66- rmsie = /(msie) ([\w.]+)/,
67- rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
68-
69- // Matches dashed string for camelizing
70- rdashAlpha = /-([a-z]|[0-9])/ig,
71- rmsPrefix = /^-ms-/,
72-
73- // Used by jQuery.camelCase as callback to replace()
74- fcamelCase = function( all, letter ) {
75- return ( letter + "" ).toUpperCase();
76- },
77-
78- // Keep a UserAgent string for use with jQuery.browser
79- userAgent = navigator.userAgent,
80-
81- // For matching the engine and version of the browser
82- browserMatch,
83-
84- // The deferred used on DOM ready
85- readyList,
86-
87- // The ready event handler
88- DOMContentLoaded,
89-
90- // Save a reference to some core methods
91- toString = Object.prototype.toString,
92- hasOwn = Object.prototype.hasOwnProperty,
93- push = Array.prototype.push,
94- slice = Array.prototype.slice,
95- trim = String.prototype.trim,
96- indexOf = Array.prototype.indexOf,
97-
98- // [[Class]] -> type pairs
99- class2type = {};
100-
101-jQuery.fn = jQuery.prototype = {
102- constructor: jQuery,
103- init: function( selector, context, rootjQuery ) {
104- var match, elem, ret, doc;
105-
106- // Handle $(""), $(null), or $(undefined)
107- if ( !selector ) {
108- return this;
109- }
110-
111- // Handle $(DOMElement)
112- if ( selector.nodeType ) {
113- this.context = this[0] = selector;
114- this.length = 1;
115- return this;
116- }
117-
118- // The body element only exists once, optimize finding it
119- if ( selector === "body" && !context && document.body ) {
120- this.context = document;
121- this[0] = document.body;
122- this.selector = selector;
123- this.length = 1;
124- return this;
125- }
126-
127- // Handle HTML strings
128- if ( typeof selector === "string" ) {
129- // Are we dealing with HTML string or an ID?
130- if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
131- // Assume that strings that start and end with <> are HTML and skip the regex check
132- match = [ null, selector, null ];
133-
134- } else {
135- match = quickExpr.exec( selector );
136- }
137-
138- // Verify a match, and that no context was specified for #id
139- if ( match && (match[1] || !context) ) {
140-
141- // HANDLE: $(html) -> $(array)
142- if ( match[1] ) {
143- context = context instanceof jQuery ? context[0] : context;
144- doc = ( context ? context.ownerDocument || context : document );
145-
146- // If a single string is passed in and it's a single tag
147- // just do a createElement and skip the rest
148- ret = rsingleTag.exec( selector );
149-
150- if ( ret ) {
151- if ( jQuery.isPlainObject( context ) ) {
152- selector = [ document.createElement( ret[1] ) ];
153- jQuery.fn.attr.call( selector, context, true );
154-
155- } else {
156- selector = [ doc.createElement( ret[1] ) ];
157- }
158-
159- } else {
160- ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
161- selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
162- }
163-
164- return jQuery.merge( this, selector );
165-
166- // HANDLE: $("#id")
167- } else {
168- elem = document.getElementById( match[2] );
169-
170- // Check parentNode to catch when Blackberry 4.6 returns
171- // nodes that are no longer in the document #6963
172- if ( elem && elem.parentNode ) {
173- // Handle the case where IE and Opera return items
174- // by name instead of ID
175- if ( elem.id !== match[2] ) {
176- return rootjQuery.find( selector );
177- }
178-
179- // Otherwise, we inject the element directly into the jQuery object
180- this.length = 1;
181- this[0] = elem;
182- }
183-
184- this.context = document;
185- this.selector = selector;
186- return this;
187- }
188-
189- // HANDLE: $(expr, $(...))
190- } else if ( !context || context.jquery ) {
191- return ( context || rootjQuery ).find( selector );
192-
193- // HANDLE: $(expr, context)
194- // (which is just equivalent to: $(context).find(expr)
195- } else {
196- return this.constructor( context ).find( selector );
197- }
198-
199- // HANDLE: $(function)
200- // Shortcut for document ready
201- } else if ( jQuery.isFunction( selector ) ) {
202- return rootjQuery.ready( selector );
203- }
204-
205- if ( selector.selector !== undefined ) {
206- this.selector = selector.selector;
207- this.context = selector.context;
208- }
209-
210- return jQuery.makeArray( selector, this );
211- },
212-
213- // Start with an empty selector
214- selector: "",
215-
216- // The current version of jQuery being used
217- jquery: "1.7.2",
218-
219- // The default length of a jQuery object is 0
220- length: 0,
221-
222- // The number of elements contained in the matched element set
223- size: function() {
224- return this.length;
225- },
226-
227- toArray: function() {
228- return slice.call( this, 0 );
229- },
230-
231- // Get the Nth element in the matched element set OR
232- // Get the whole matched element set as a clean array
233- get: function( num ) {
234- return num == null ?
235-
236- // Return a 'clean' array
237- this.toArray() :
238-
239- // Return just the object
240- ( num < 0 ? this[ this.length + num ] : this[ num ] );
241- },
242-
243- // Take an array of elements and push it onto the stack
244- // (returning the new matched element set)
245- pushStack: function( elems, name, selector ) {
246- // Build a new jQuery matched element set
247- var ret = this.constructor();
248-
249- if ( jQuery.isArray( elems ) ) {
250- push.apply( ret, elems );
251-
252- } else {
253- jQuery.merge( ret, elems );
254- }
255-
256- // Add the old object onto the stack (as a reference)
257- ret.prevObject = this;
258-
259- ret.context = this.context;
260-
261- if ( name === "find" ) {
262- ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
263- } else if ( name ) {
264- ret.selector = this.selector + "." + name + "(" + selector + ")";
265- }
266-
267- // Return the newly-formed element set
268- return ret;
269- },
270-
271- // Execute a callback for every element in the matched set.
272- // (You can seed the arguments with an array of args, but this is
273- // only used internally.)
274- each: function( callback, args ) {
275- return jQuery.each( this, callback, args );
276- },
277-
278- ready: function( fn ) {
279- // Attach the listeners
280- jQuery.bindReady();
281-
282- // Add the callback
283- readyList.add( fn );
284-
285- return this;
286- },
287-
288- eq: function( i ) {
289- i = +i;
290- return i === -1 ?
291- this.slice( i ) :
292- this.slice( i, i + 1 );
293- },
294-
295- first: function() {
296- return this.eq( 0 );
297- },
298-
299- last: function() {
300- return this.eq( -1 );
301- },
302-
303- slice: function() {
304- return this.pushStack( slice.apply( this, arguments ),
305- "slice", slice.call(arguments).join(",") );
306- },
307-
308- map: function( callback ) {
309- return this.pushStack( jQuery.map(this, function( elem, i ) {
310- return callback.call( elem, i, elem );
311- }));
312- },
313-
314- end: function() {
315- return this.prevObject || this.constructor(null);
316- },
317-
318- // For internal use only.
319- // Behaves like an Array's method, not like a jQuery method.
320- push: push,
321- sort: [].sort,
322- splice: [].splice
323-};
324-
325-// Give the init function the jQuery prototype for later instantiation
326-jQuery.fn.init.prototype = jQuery.fn;
327-
328-jQuery.extend = jQuery.fn.extend = function() {
329- var options, name, src, copy, copyIsArray, clone,
330- target = arguments[0] || {},
331- i = 1,
332- length = arguments.length,
333- deep = false;
334-
335- // Handle a deep copy situation
336- if ( typeof target === "boolean" ) {
337- deep = target;
338- target = arguments[1] || {};
339- // skip the boolean and the target
340- i = 2;
341- }
342-
343- // Handle case when target is a string or something (possible in deep copy)
344- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
345- target = {};
346- }
347-
348- // extend jQuery itself if only one argument is passed
349- if ( length === i ) {
350- target = this;
351- --i;
352- }
353-
354- for ( ; i < length; i++ ) {
355- // Only deal with non-null/undefined values
356- if ( (options = arguments[ i ]) != null ) {
357- // Extend the base object
358- for ( name in options ) {
359- src = target[ name ];
360- copy = options[ name ];
361-
362- // Prevent never-ending loop
363- if ( target === copy ) {
364- continue;
365- }
366-
367- // Recurse if we're merging plain objects or arrays
368- if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
369- if ( copyIsArray ) {
370- copyIsArray = false;
371- clone = src && jQuery.isArray(src) ? src : [];
372-
373- } else {
374- clone = src && jQuery.isPlainObject(src) ? src : {};
375- }
376-
377- // Never move original objects, clone them
378- target[ name ] = jQuery.extend( deep, clone, copy );
379-
380- // Don't bring in undefined values
381- } else if ( copy !== undefined ) {
382- target[ name ] = copy;
383- }
384- }
385- }
386- }
387-
388- // Return the modified object
389- return target;
390-};
391-
392-jQuery.extend({
393- noConflict: function( deep ) {
394- if ( window.$ === jQuery ) {
395- window.$ = _$;
396- }
397-
398- if ( deep && window.jQuery === jQuery ) {
399- window.jQuery = _jQuery;
400- }
401-
402- return jQuery;
403- },
404-
405- // Is the DOM ready to be used? Set to true once it occurs.
406- isReady: false,
407-
408- // A counter to track how many items to wait for before
409- // the ready event fires. See #6781
410- readyWait: 1,
411-
412- // Hold (or release) the ready event
413- holdReady: function( hold ) {
414- if ( hold ) {
415- jQuery.readyWait++;
416- } else {
417- jQuery.ready( true );
418- }
419- },
420-
421- // Handle when the DOM is ready
422- ready: function( wait ) {
423- // Either a released hold or an DOMready/load event and not yet ready
424- if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
425- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
426- if ( !document.body ) {
427- return setTimeout( jQuery.ready, 1 );
428- }
429-
430- // Remember that the DOM is ready
431- jQuery.isReady = true;
432-
433- // If a normal DOM Ready event fired, decrement, and wait if need be
434- if ( wait !== true && --jQuery.readyWait > 0 ) {
435- return;
436- }
437-
438- // If there are functions bound, to execute
439- readyList.fireWith( document, [ jQuery ] );
440-
441- // Trigger any bound ready events
442- if ( jQuery.fn.trigger ) {
443- jQuery( document ).trigger( "ready" ).off( "ready" );
444- }
445- }
446- },
447-
448- bindReady: function() {
449- if ( readyList ) {
450- return;
451- }
452-
453- readyList = jQuery.Callbacks( "once memory" );
454-
455- // Catch cases where $(document).ready() is called after the
456- // browser event has already occurred.
457- if ( document.readyState === "complete" ) {
458- // Handle it asynchronously to allow scripts the opportunity to delay ready
459- return setTimeout( jQuery.ready, 1 );
460- }
461-
462- // Mozilla, Opera and webkit nightlies currently support this event
463- if ( document.addEventListener ) {
464- // Use the handy event callback
465- document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
466-
467- // A fallback to window.onload, that will always work
468- window.addEventListener( "load", jQuery.ready, false );
469-
470- // If IE event model is used
471- } else if ( document.attachEvent ) {
472- // ensure firing before onload,
473- // maybe late but safe also for iframes
474- document.attachEvent( "onreadystatechange", DOMContentLoaded );
475-
476- // A fallback to window.onload, that will always work
477- window.attachEvent( "onload", jQuery.ready );
478-
479- // If IE and not a frame
480- // continually check to see if the document is ready
481- var toplevel = false;
482-
483- try {
484- toplevel = window.frameElement == null;
485- } catch(e) {}
486-
487- if ( document.documentElement.doScroll && toplevel ) {
488- doScrollCheck();
489- }
490- }
491- },
492-
493- // See test/unit/core.js for details concerning isFunction.
494- // Since version 1.3, DOM methods and functions like alert
495- // aren't supported. They return false on IE (#2968).
496- isFunction: function( obj ) {
497- return jQuery.type(obj) === "function";
498- },
499-
500- isArray: Array.isArray || function( obj ) {
501- return jQuery.type(obj) === "array";
502- },
503-
504- isWindow: function( obj ) {
505- return obj != null && obj == obj.window;
506- },
507-
508- isNumeric: function( obj ) {
509- return !isNaN( parseFloat(obj) ) && isFinite( obj );
510- },
511-
512- type: function( obj ) {
513- return obj == null ?
514- String( obj ) :
515- class2type[ toString.call(obj) ] || "object";
516- },
517-
518- isPlainObject: function( obj ) {
519- // Must be an Object.
520- // Because of IE, we also have to check the presence of the constructor property.
521- // Make sure that DOM nodes and window objects don't pass through, as well
522- if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
523- return false;
524- }
525-
526- try {
527- // Not own constructor property must be Object
528- if ( obj.constructor &&
529- !hasOwn.call(obj, "constructor") &&
530- !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
531- return false;
532- }
533- } catch ( e ) {
534- // IE8,9 Will throw exceptions on certain host objects #9897
535- return false;
536- }
537-
538- // Own properties are enumerated firstly, so to speed up,
539- // if last one is own, then all properties are own.
540-
541- var key;
542- for ( key in obj ) {}
543-
544- return key === undefined || hasOwn.call( obj, key );
545- },
546-
547- isEmptyObject: function( obj ) {
548- for ( var name in obj ) {
549- return false;
550- }
551- return true;
552- },
553-
554- error: function( msg ) {
555- throw new Error( msg );
556- },
557-
558- parseJSON: function( data ) {
559- if ( typeof data !== "string" || !data ) {
560- return null;
561- }
562-
563- // Make sure leading/trailing whitespace is removed (IE can't handle it)
564- data = jQuery.trim( data );
565-
566- // Attempt to parse using the native JSON parser first
567- if ( window.JSON && window.JSON.parse ) {
568- return window.JSON.parse( data );
569- }
570-
571- // Make sure the incoming data is actual JSON
572- // Logic borrowed from http://json.org/json2.js
573- if ( rvalidchars.test( data.replace( rvalidescape, "@" )
574- .replace( rvalidtokens, "]" )
575- .replace( rvalidbraces, "")) ) {
576-
577- return ( new Function( "return " + data ) )();
578-
579- }
580- jQuery.error( "Invalid JSON: " + data );
581- },
582-
583- // Cross-browser xml parsing
584- parseXML: function( data ) {
585- if ( typeof data !== "string" || !data ) {
586- return null;
587- }
588- var xml, tmp;
589- try {
590- if ( window.DOMParser ) { // Standard
591- tmp = new DOMParser();
592- xml = tmp.parseFromString( data , "text/xml" );
593- } else { // IE
594- xml = new ActiveXObject( "Microsoft.XMLDOM" );
595- xml.async = "false";
596- xml.loadXML( data );
597- }
598- } catch( e ) {
599- xml = undefined;
600- }
601- if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
602- jQuery.error( "Invalid XML: " + data );
603- }
604- return xml;
605- },
606-
607- noop: function() {},
608-
609- // Evaluates a script in a global context
610- // Workarounds based on findings by Jim Driscoll
611- // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
612- globalEval: function( data ) {
613- if ( data && rnotwhite.test( data ) ) {
614- // We use execScript on Internet Explorer
615- // We use an anonymous function so that context is window
616- // rather than jQuery in Firefox
617- ( window.execScript || function( data ) {
618- window[ "eval" ].call( window, data );
619- } )( data );
620- }
621- },
622-
623- // Convert dashed to camelCase; used by the css and data modules
624- // Microsoft forgot to hump their vendor prefix (#9572)
625- camelCase: function( string ) {
626- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
627- },
628-
629- nodeName: function( elem, name ) {
630- return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
631- },
632-
633- // args is for internal usage only
634- each: function( object, callback, args ) {
635- var name, i = 0,
636- length = object.length,
637- isObj = length === undefined || jQuery.isFunction( object );
638-
639- if ( args ) {
640- if ( isObj ) {
641- for ( name in object ) {
642- if ( callback.apply( object[ name ], args ) === false ) {
643- break;
644- }
645- }
646- } else {
647- for ( ; i < length; ) {
648- if ( callback.apply( object[ i++ ], args ) === false ) {
649- break;
650- }
651- }
652- }
653-
654- // A special, fast, case for the most common use of each
655- } else {
656- if ( isObj ) {
657- for ( name in object ) {
658- if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
659- break;
660- }
661- }
662- } else {
663- for ( ; i < length; ) {
664- if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
665- break;
666- }
667- }
668- }
669- }
670-
671- return object;
672- },
673-
674- // Use native String.trim function wherever possible
675- trim: trim ?
676- function( text ) {
677- return text == null ?
678- "" :
679- trim.call( text );
680- } :
681-
682- // Otherwise use our own trimming functionality
683- function( text ) {
684- return text == null ?
685- "" :
686- text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
687- },
688-
689- // results is for internal usage only
690- makeArray: function( array, results ) {
691- var ret = results || [];
692-
693- if ( array != null ) {
694- // The window, strings (and functions) also have 'length'
695- // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
696- var type = jQuery.type( array );
697-
698- if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
699- push.call( ret, array );
700- } else {
701- jQuery.merge( ret, array );
702- }
703- }
704-
705- return ret;
706- },
707-
708- inArray: function( elem, array, i ) {
709- var len;
710-
711- if ( array ) {
712- if ( indexOf ) {
713- return indexOf.call( array, elem, i );
714- }
715-
716- len = array.length;
717- i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
718-
719- for ( ; i < len; i++ ) {
720- // Skip accessing in sparse arrays
721- if ( i in array && array[ i ] === elem ) {
722- return i;
723- }
724- }
725- }
726-
727- return -1;
728- },
729-
730- merge: function( first, second ) {
731- var i = first.length,
732- j = 0;
733-
734- if ( typeof second.length === "number" ) {
735- for ( var l = second.length; j < l; j++ ) {
736- first[ i++ ] = second[ j ];
737- }
738-
739- } else {
740- while ( second[j] !== undefined ) {
741- first[ i++ ] = second[ j++ ];
742- }
743- }
744-
745- first.length = i;
746-
747- return first;
748- },
749-
750- grep: function( elems, callback, inv ) {
751- var ret = [], retVal;
752- inv = !!inv;
753-
754- // Go through the array, only saving the items
755- // that pass the validator function
756- for ( var i = 0, length = elems.length; i < length; i++ ) {
757- retVal = !!callback( elems[ i ], i );
758- if ( inv !== retVal ) {
759- ret.push( elems[ i ] );
760- }
761- }
762-
763- return ret;
764- },
765-
766- // arg is for internal usage only
767- map: function( elems, callback, arg ) {
768- var value, key, ret = [],
769- i = 0,
770- length = elems.length,
771- // jquery objects are treated as arrays
772- isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
773-
774- // Go through the array, translating each of the items to their
775- if ( isArray ) {
776- for ( ; i < length; i++ ) {
777- value = callback( elems[ i ], i, arg );
778-
779- if ( value != null ) {
780- ret[ ret.length ] = value;
781- }
782- }
783-
784- // Go through every key on the object,
785- } else {
786- for ( key in elems ) {
787- value = callback( elems[ key ], key, arg );
788-
789- if ( value != null ) {
790- ret[ ret.length ] = value;
791- }
792- }
793- }
794-
795- // Flatten any nested arrays
796- return ret.concat.apply( [], ret );
797- },
798-
799- // A global GUID counter for objects
800- guid: 1,
801-
802- // Bind a function to a context, optionally partially applying any
803- // arguments.
804- proxy: function( fn, context ) {
805- if ( typeof context === "string" ) {
806- var tmp = fn[ context ];
807- context = fn;
808- fn = tmp;
809- }
810-
811- // Quick check to determine if target is callable, in the spec
812- // this throws a TypeError, but we will just return undefined.
813- if ( !jQuery.isFunction( fn ) ) {
814- return undefined;
815- }
816-
817- // Simulated bind
818- var args = slice.call( arguments, 2 ),
819- proxy = function() {
820- return fn.apply( context, args.concat( slice.call( arguments ) ) );
821- };
822-
823- // Set the guid of unique handler to the same of original handler, so it can be removed
824- proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
825-
826- return proxy;
827- },
828-
829- // Mutifunctional method to get and set values to a collection
830- // The value/s can optionally be executed if it's a function
831- access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
832- var exec,
833- bulk = key == null,
834- i = 0,
835- length = elems.length;
836-
837- // Sets many values
838- if ( key && typeof key === "object" ) {
839- for ( i in key ) {
840- jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
841- }
842- chainable = 1;
843-
844- // Sets one value
845- } else if ( value !== undefined ) {
846- // Optionally, function values get executed if exec is true
847- exec = pass === undefined && jQuery.isFunction( value );
848-
849- if ( bulk ) {
850- // Bulk operations only iterate when executing function values
851- if ( exec ) {
852- exec = fn;
853- fn = function( elem, key, value ) {
854- return exec.call( jQuery( elem ), value );
855- };
856-
857- // Otherwise they run against the entire set
858- } else {
859- fn.call( elems, value );
860- fn = null;
861- }
862- }
863-
864- if ( fn ) {
865- for (; i < length; i++ ) {
866- fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
867- }
868- }
869-
870- chainable = 1;
871- }
872-
873- return chainable ?
874- elems :
875-
876- // Gets
877- bulk ?
878- fn.call( elems ) :
879- length ? fn( elems[0], key ) : emptyGet;
880- },
881-
882- now: function() {
883- return ( new Date() ).getTime();
884- },
885-
886- // Use of jQuery.browser is frowned upon.
887- // More details: http://docs.jquery.com/Utilities/jQuery.browser
888- uaMatch: function( ua ) {
889- ua = ua.toLowerCase();
890-
891- var match = rwebkit.exec( ua ) ||
892- ropera.exec( ua ) ||
893- rmsie.exec( ua ) ||
894- ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
895- [];
896-
897- return { browser: match[1] || "", version: match[2] || "0" };
898- },
899-
900- sub: function() {
901- function jQuerySub( selector, context ) {
902- return new jQuerySub.fn.init( selector, context );
903- }
904- jQuery.extend( true, jQuerySub, this );
905- jQuerySub.superclass = this;
906- jQuerySub.fn = jQuerySub.prototype = this();
907- jQuerySub.fn.constructor = jQuerySub;
908- jQuerySub.sub = this.sub;
909- jQuerySub.fn.init = function init( selector, context ) {
910- if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
911- context = jQuerySub( context );
912- }
913-
914- return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
915- };
916- jQuerySub.fn.init.prototype = jQuerySub.fn;
917- var rootjQuerySub = jQuerySub(document);
918- return jQuerySub;
919- },
920-
921- browser: {}
922-});
923-
924-// Populate the class2type map
925-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
926- class2type[ "[object " + name + "]" ] = name.toLowerCase();
927-});
928-
929-browserMatch = jQuery.uaMatch( userAgent );
930-if ( browserMatch.browser ) {
931- jQuery.browser[ browserMatch.browser ] = true;
932- jQuery.browser.version = browserMatch.version;
933-}
934-
935-// Deprecated, use jQuery.browser.webkit instead
936-if ( jQuery.browser.webkit ) {
937- jQuery.browser.safari = true;
938-}
939-
940-// IE doesn't match non-breaking spaces with \s
941-if ( rnotwhite.test( "\xA0" ) ) {
942- trimLeft = /^[\s\xA0]+/;
943- trimRight = /[\s\xA0]+$/;
944-}
945-
946-// All jQuery objects should point back to these
947-rootjQuery = jQuery(document);
948-
949-// Cleanup functions for the document ready method
950-if ( document.addEventListener ) {
951- DOMContentLoaded = function() {
952- document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
953- jQuery.ready();
954- };
955-
956-} else if ( document.attachEvent ) {
957- DOMContentLoaded = function() {
958- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
959- if ( document.readyState === "complete" ) {
960- document.detachEvent( "onreadystatechange", DOMContentLoaded );
961- jQuery.ready();
962- }
963- };
964-}
965-
966-// The DOM ready check for Internet Explorer
967-function doScrollCheck() {
968- if ( jQuery.isReady ) {
969- return;
970- }
971-
972- try {
973- // If IE is used, use the trick by Diego Perini
974- // http://javascript.nwbox.com/IEContentLoaded/
975- document.documentElement.doScroll("left");
976- } catch(e) {
977- setTimeout( doScrollCheck, 1 );
978- return;
979- }
980-
981- // and execute any waiting functions
982- jQuery.ready();
983-}
984-
985-return jQuery;
986-
987-})();
988-
989-
990-// String to Object flags format cache
991-var flagsCache = {};
992-
993-// Convert String-formatted flags into Object-formatted ones and store in cache
994-function createFlags( flags ) {
995- var object = flagsCache[ flags ] = {},
996- i, length;
997- flags = flags.split( /\s+/ );
998- for ( i = 0, length = flags.length; i < length; i++ ) {
999- object[ flags[i] ] = true;
1000- }
1001- return object;
1002-}
1003-
1004-/*
1005- * Create a callback list using the following parameters:
1006- *
1007- * flags: an optional list of space-separated flags that will change how
1008- * the callback list behaves
1009- *
1010- * By default a callback list will act like an event callback list and can be
1011- * "fired" multiple times.
1012- *
1013- * Possible flags:
1014- *
1015- * once: will ensure the callback list can only be fired once (like a Deferred)
1016- *
1017- * memory: will keep track of previous values and will call any callback added
1018- * after the list has been fired right away with the latest "memorized"
1019- * values (like a Deferred)
1020- *
1021- * unique: will ensure a callback can only be added once (no duplicate in the list)
1022- *
1023- * stopOnFalse: interrupt callings when a callback returns false
1024- *
1025- */
1026-jQuery.Callbacks = function( flags ) {
1027-
1028- // Convert flags from String-formatted to Object-formatted
1029- // (we check in cache first)
1030- flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
1031-
1032- var // Actual callback list
1033- list = [],
1034- // Stack of fire calls for repeatable lists
1035- stack = [],
1036- // Last fire value (for non-forgettable lists)
1037- memory,
1038- // Flag to know if list was already fired
1039- fired,
1040- // Flag to know if list is currently firing
1041- firing,
1042- // First callback to fire (used internally by add and fireWith)
1043- firingStart,
1044- // End of the loop when firing
1045- firingLength,
1046- // Index of currently firing callback (modified by remove if needed)
1047- firingIndex,
1048- // Add one or several callbacks to the list
1049- add = function( args ) {
1050- var i,
1051- length,
1052- elem,
1053- type,
1054- actual;
1055- for ( i = 0, length = args.length; i < length; i++ ) {
1056- elem = args[ i ];
1057- type = jQuery.type( elem );
1058- if ( type === "array" ) {
1059- // Inspect recursively
1060- add( elem );
1061- } else if ( type === "function" ) {
1062- // Add if not in unique mode and callback is not in
1063- if ( !flags.unique || !self.has( elem ) ) {
1064- list.push( elem );
1065- }
1066- }
1067- }
1068- },
1069- // Fire callbacks
1070- fire = function( context, args ) {
1071- args = args || [];
1072- memory = !flags.memory || [ context, args ];
1073- fired = true;
1074- firing = true;
1075- firingIndex = firingStart || 0;
1076- firingStart = 0;
1077- firingLength = list.length;
1078- for ( ; list && firingIndex < firingLength; firingIndex++ ) {
1079- if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
1080- memory = true; // Mark as halted
1081- break;
1082- }
1083- }
1084- firing = false;
1085- if ( list ) {
1086- if ( !flags.once ) {
1087- if ( stack && stack.length ) {
1088- memory = stack.shift();
1089- self.fireWith( memory[ 0 ], memory[ 1 ] );
1090- }
1091- } else if ( memory === true ) {
1092- self.disable();
1093- } else {
1094- list = [];
1095- }
1096- }
1097- },
1098- // Actual Callbacks object
1099- self = {
1100- // Add a callback or a collection of callbacks to the list
1101- add: function() {
1102- if ( list ) {
1103- var length = list.length;
1104- add( arguments );
1105- // Do we need to add the callbacks to the
1106- // current firing batch?
1107- if ( firing ) {
1108- firingLength = list.length;
1109- // With memory, if we're not firing then
1110- // we should call right away, unless previous
1111- // firing was halted (stopOnFalse)
1112- } else if ( memory && memory !== true ) {
1113- firingStart = length;
1114- fire( memory[ 0 ], memory[ 1 ] );
1115- }
1116- }
1117- return this;
1118- },
1119- // Remove a callback from the list
1120- remove: function() {
1121- if ( list ) {
1122- var args = arguments,
1123- argIndex = 0,
1124- argLength = args.length;
1125- for ( ; argIndex < argLength ; argIndex++ ) {
1126- for ( var i = 0; i < list.length; i++ ) {
1127- if ( args[ argIndex ] === list[ i ] ) {
1128- // Handle firingIndex and firingLength
1129- if ( firing ) {
1130- if ( i <= firingLength ) {
1131- firingLength--;
1132- if ( i <= firingIndex ) {
1133- firingIndex--;
1134- }
1135- }
1136- }
1137- // Remove the element
1138- list.splice( i--, 1 );
1139- // If we have some unicity property then
1140- // we only need to do this once
1141- if ( flags.unique ) {
1142- break;
1143- }
1144- }
1145- }
1146- }
1147- }
1148- return this;
1149- },
1150- // Control if a given callback is in the list
1151- has: function( fn ) {
1152- if ( list ) {
1153- var i = 0,
1154- length = list.length;
1155- for ( ; i < length; i++ ) {
1156- if ( fn === list[ i ] ) {
1157- return true;
1158- }
1159- }
1160- }
1161- return false;
1162- },
1163- // Remove all callbacks from the list
1164- empty: function() {
1165- list = [];
1166- return this;
1167- },
1168- // Have the list do nothing anymore
1169- disable: function() {
1170- list = stack = memory = undefined;
1171- return this;
1172- },
1173- // Is it disabled?
1174- disabled: function() {
1175- return !list;
1176- },
1177- // Lock the list in its current state
1178- lock: function() {
1179- stack = undefined;
1180- if ( !memory || memory === true ) {
1181- self.disable();
1182- }
1183- return this;
1184- },
1185- // Is it locked?
1186- locked: function() {
1187- return !stack;
1188- },
1189- // Call all callbacks with the given context and arguments
1190- fireWith: function( context, args ) {
1191- if ( stack ) {
1192- if ( firing ) {
1193- if ( !flags.once ) {
1194- stack.push( [ context, args ] );
1195- }
1196- } else if ( !( flags.once && memory ) ) {
1197- fire( context, args );
1198- }
1199- }
1200- return this;
1201- },
1202- // Call all the callbacks with the given arguments
1203- fire: function() {
1204- self.fireWith( this, arguments );
1205- return this;
1206- },
1207- // To know if the callbacks have already been called at least once
1208- fired: function() {
1209- return !!fired;
1210- }
1211- };
1212-
1213- return self;
1214-};
1215-
1216-
1217-
1218-
1219-var // Static reference to slice
1220- sliceDeferred = [].slice;
1221-
1222-jQuery.extend({
1223-
1224- Deferred: function( func ) {
1225- var doneList = jQuery.Callbacks( "once memory" ),
1226- failList = jQuery.Callbacks( "once memory" ),
1227- progressList = jQuery.Callbacks( "memory" ),
1228- state = "pending",
1229- lists = {
1230- resolve: doneList,
1231- reject: failList,
1232- notify: progressList
1233- },
1234- promise = {
1235- done: doneList.add,
1236- fail: failList.add,
1237- progress: progressList.add,
1238-
1239- state: function() {
1240- return state;
1241- },
1242-
1243- // Deprecated
1244- isResolved: doneList.fired,
1245- isRejected: failList.fired,
1246-
1247- then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
1248- deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
1249- return this;
1250- },
1251- always: function() {
1252- deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
1253- return this;
1254- },
1255- pipe: function( fnDone, fnFail, fnProgress ) {
1256- return jQuery.Deferred(function( newDefer ) {
1257- jQuery.each( {
1258- done: [ fnDone, "resolve" ],
1259- fail: [ fnFail, "reject" ],
1260- progress: [ fnProgress, "notify" ]
1261- }, function( handler, data ) {
1262- var fn = data[ 0 ],
1263- action = data[ 1 ],
1264- returned;
1265- if ( jQuery.isFunction( fn ) ) {
1266- deferred[ handler ](function() {
1267- returned = fn.apply( this, arguments );
1268- if ( returned && jQuery.isFunction( returned.promise ) ) {
1269- returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
1270- } else {
1271- newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
1272- }
1273- });
1274- } else {
1275- deferred[ handler ]( newDefer[ action ] );
1276- }
1277- });
1278- }).promise();
1279- },
1280- // Get a promise for this deferred
1281- // If obj is provided, the promise aspect is added to the object
1282- promise: function( obj ) {
1283- if ( obj == null ) {
1284- obj = promise;
1285- } else {
1286- for ( var key in promise ) {
1287- obj[ key ] = promise[ key ];
1288- }
1289- }
1290- return obj;
1291- }
1292- },
1293- deferred = promise.promise({}),
1294- key;
1295-
1296- for ( key in lists ) {
1297- deferred[ key ] = lists[ key ].fire;
1298- deferred[ key + "With" ] = lists[ key ].fireWith;
1299- }
1300-
1301- // Handle state
1302- deferred.done( function() {
1303- state = "resolved";
1304- }, failList.disable, progressList.lock ).fail( function() {
1305- state = "rejected";
1306- }, doneList.disable, progressList.lock );
1307-
1308- // Call given func if any
1309- if ( func ) {
1310- func.call( deferred, deferred );
1311- }
1312-
1313- // All done!
1314- return deferred;
1315- },
1316-
1317- // Deferred helper
1318- when: function( firstParam ) {
1319- var args = sliceDeferred.call( arguments, 0 ),
1320- i = 0,
1321- length = args.length,
1322- pValues = new Array( length ),
1323- count = length,
1324- pCount = length,
1325- deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
1326- firstParam :
1327- jQuery.Deferred(),
1328- promise = deferred.promise();
1329- function resolveFunc( i ) {
1330- return function( value ) {
1331- args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
1332- if ( !( --count ) ) {
1333- deferred.resolveWith( deferred, args );
1334- }
1335- };
1336- }
1337- function progressFunc( i ) {
1338- return function( value ) {
1339- pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
1340- deferred.notifyWith( promise, pValues );
1341- };
1342- }
1343- if ( length > 1 ) {
1344- for ( ; i < length; i++ ) {
1345- if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
1346- args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
1347- } else {
1348- --count;
1349- }
1350- }
1351- if ( !count ) {
1352- deferred.resolveWith( deferred, args );
1353- }
1354- } else if ( deferred !== firstParam ) {
1355- deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
1356- }
1357- return promise;
1358- }
1359-});
1360-
1361-
1362-
1363-
1364-jQuery.support = (function() {
1365-
1366- var support,
1367- all,
1368- a,
1369- select,
1370- opt,
1371- input,
1372- fragment,
1373- tds,
1374- events,
1375- eventName,
1376- i,
1377- isSupported,
1378- div = document.createElement( "div" ),
1379- documentElement = document.documentElement;
1380-
1381- // Preliminary tests
1382- div.setAttribute("className", "t");
1383- div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
1384-
1385- all = div.getElementsByTagName( "*" );
1386- a = div.getElementsByTagName( "a" )[ 0 ];
1387-
1388- // Can't get basic test support
1389- if ( !all || !all.length || !a ) {
1390- return {};
1391- }
1392-
1393- // First batch of supports tests
1394- select = document.createElement( "select" );
1395- opt = select.appendChild( document.createElement("option") );
1396- input = div.getElementsByTagName( "input" )[ 0 ];
1397-
1398- support = {
1399- // IE strips leading whitespace when .innerHTML is used
1400- leadingWhitespace: ( div.firstChild.nodeType === 3 ),
1401-
1402- // Make sure that tbody elements aren't automatically inserted
1403- // IE will insert them into empty tables
1404- tbody: !div.getElementsByTagName("tbody").length,
1405-
1406- // Make sure that link elements get serialized correctly by innerHTML
1407- // This requires a wrapper element in IE
1408- htmlSerialize: !!div.getElementsByTagName("link").length,
1409-
1410- // Get the style information from getAttribute
1411- // (IE uses .cssText instead)
1412- style: /top/.test( a.getAttribute("style") ),
1413-
1414- // Make sure that URLs aren't manipulated
1415- // (IE normalizes it by default)
1416- hrefNormalized: ( a.getAttribute("href") === "/a" ),
1417-
1418- // Make sure that element opacity exists
1419- // (IE uses filter instead)
1420- // Use a regex to work around a WebKit issue. See #5145
1421- opacity: /^0.55/.test( a.style.opacity ),
1422-
1423- // Verify style float existence
1424- // (IE uses styleFloat instead of cssFloat)
1425- cssFloat: !!a.style.cssFloat,
1426-
1427- // Make sure that if no value is specified for a checkbox
1428- // that it defaults to "on".
1429- // (WebKit defaults to "" instead)
1430- checkOn: ( input.value === "on" ),
1431-
1432- // Make sure that a selected-by-default option has a working selected property.
1433- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
1434- optSelected: opt.selected,
1435-
1436- // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
1437- getSetAttribute: div.className !== "t",
1438-
1439- // Tests for enctype support on a form(#6743)
1440- enctype: !!document.createElement("form").enctype,
1441-
1442- // Makes sure cloning an html5 element does not cause problems
1443- // Where outerHTML is undefined, this still works
1444- html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
1445-
1446- // Will be defined later
1447- submitBubbles: true,
1448- changeBubbles: true,
1449- focusinBubbles: false,
1450- deleteExpando: true,
1451- noCloneEvent: true,
1452- inlineBlockNeedsLayout: false,
1453- shrinkWrapBlocks: false,
1454- reliableMarginRight: true,
1455- pixelMargin: true
1456- };
1457-
1458- // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
1459- jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
1460-
1461- // Make sure checked status is properly cloned
1462- input.checked = true;
1463- support.noCloneChecked = input.cloneNode( true ).checked;
1464-
1465- // Make sure that the options inside disabled selects aren't marked as disabled
1466- // (WebKit marks them as disabled)
1467- select.disabled = true;
1468- support.optDisabled = !opt.disabled;
1469-
1470- // Test to see if it's possible to delete an expando from an element
1471- // Fails in Internet Explorer
1472- try {
1473- delete div.test;
1474- } catch( e ) {
1475- support.deleteExpando = false;
1476- }
1477-
1478- if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
1479- div.attachEvent( "onclick", function() {
1480- // Cloning a node shouldn't copy over any
1481- // bound event handlers (IE does this)
1482- support.noCloneEvent = false;
1483- });
1484- div.cloneNode( true ).fireEvent( "onclick" );
1485- }
1486-
1487- // Check if a radio maintains its value
1488- // after being appended to the DOM
1489- input = document.createElement("input");
1490- input.value = "t";
1491- input.setAttribute("type", "radio");
1492- support.radioValue = input.value === "t";
1493-
1494- input.setAttribute("checked", "checked");
1495-
1496- // #11217 - WebKit loses check when the name is after the checked attribute
1497- input.setAttribute( "name", "t" );
1498-
1499- div.appendChild( input );
1500- fragment = document.createDocumentFragment();
1501- fragment.appendChild( div.lastChild );
1502-
1503- // WebKit doesn't clone checked state correctly in fragments
1504- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
1505-
1506- // Check if a disconnected checkbox will retain its checked
1507- // value of true after appended to the DOM (IE6/7)
1508- support.appendChecked = input.checked;
1509-
1510- fragment.removeChild( input );
1511- fragment.appendChild( div );
1512-
1513- // Technique from Juriy Zaytsev
1514- // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
1515- // We only care about the case where non-standard event systems
1516- // are used, namely in IE. Short-circuiting here helps us to
1517- // avoid an eval call (in setAttribute) which can cause CSP
1518- // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
1519- if ( div.attachEvent ) {
1520- for ( i in {
1521- submit: 1,
1522- change: 1,
1523- focusin: 1
1524- }) {
1525- eventName = "on" + i;
1526- isSupported = ( eventName in div );
1527- if ( !isSupported ) {
1528- div.setAttribute( eventName, "return;" );
1529- isSupported = ( typeof div[ eventName ] === "function" );
1530- }
1531- support[ i + "Bubbles" ] = isSupported;
1532- }
1533- }
1534-
1535- fragment.removeChild( div );
1536-
1537- // Null elements to avoid leaks in IE
1538- fragment = select = opt = div = input = null;
1539-
1540- // Run tests that need a body at doc ready
1541- jQuery(function() {
1542- var container, outer, inner, table, td, offsetSupport,
1543- marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
1544- paddingMarginBorderVisibility, paddingMarginBorder,
1545- body = document.getElementsByTagName("body")[0];
1546-
1547- if ( !body ) {
1548- // Return for frameset docs that don't have a body
1549- return;
1550- }
1551-
1552- conMarginTop = 1;
1553- paddingMarginBorder = "padding:0;margin:0;border:";
1554- positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
1555- paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
1556- style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
1557- html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
1558- "<table " + style + "' cellpadding='0' cellspacing='0'>" +
1559- "<tr><td></td></tr></table>";
1560-
1561- container = document.createElement("div");
1562- container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
1563- body.insertBefore( container, body.firstChild );
1564-
1565- // Construct the test element
1566- div = document.createElement("div");
1567- container.appendChild( div );
1568-
1569- // Check if table cells still have offsetWidth/Height when they are set
1570- // to display:none and there are still other visible table cells in a
1571- // table row; if so, offsetWidth/Height are not reliable for use when
1572- // determining if an element has been hidden directly using
1573- // display:none (it is still safe to use offsets if a parent element is
1574- // hidden; don safety goggles and see bug #4512 for more information).
1575- // (only IE 8 fails this test)
1576- div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
1577- tds = div.getElementsByTagName( "td" );
1578- isSupported = ( tds[ 0 ].offsetHeight === 0 );
1579-
1580- tds[ 0 ].style.display = "";
1581- tds[ 1 ].style.display = "none";
1582-
1583- // Check if empty table cells still have offsetWidth/Height
1584- // (IE <= 8 fail this test)
1585- support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
1586-
1587- // Check if div with explicit width and no margin-right incorrectly
1588- // gets computed margin-right based on width of container. For more
1589- // info see bug #3333
1590- // Fails in WebKit before Feb 2011 nightlies
1591- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1592- if ( window.getComputedStyle ) {
1593- div.innerHTML = "";
1594- marginDiv = document.createElement( "div" );
1595- marginDiv.style.width = "0";
1596- marginDiv.style.marginRight = "0";
1597- div.style.width = "2px";
1598- div.appendChild( marginDiv );
1599- support.reliableMarginRight =
1600- ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
1601- }
1602-
1603- if ( typeof div.style.zoom !== "undefined" ) {
1604- // Check if natively block-level elements act like inline-block
1605- // elements when setting their display to 'inline' and giving
1606- // them layout
1607- // (IE < 8 does this)
1608- div.innerHTML = "";
1609- div.style.width = div.style.padding = "1px";
1610- div.style.border = 0;
1611- div.style.overflow = "hidden";
1612- div.style.display = "inline";
1613- div.style.zoom = 1;
1614- support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
1615-
1616- // Check if elements with layout shrink-wrap their children
1617- // (IE 6 does this)
1618- div.style.display = "block";
1619- div.style.overflow = "visible";
1620- div.innerHTML = "<div style='width:5px;'></div>";
1621- support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
1622- }
1623-
1624- div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
1625- div.innerHTML = html;
1626-
1627- outer = div.firstChild;
1628- inner = outer.firstChild;
1629- td = outer.nextSibling.firstChild.firstChild;
1630-
1631- offsetSupport = {
1632- doesNotAddBorder: ( inner.offsetTop !== 5 ),
1633- doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
1634- };
1635-
1636- inner.style.position = "fixed";
1637- inner.style.top = "20px";
1638-
1639- // safari subtracts parent border width here which is 5px
1640- offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
1641- inner.style.position = inner.style.top = "";
1642-
1643- outer.style.overflow = "hidden";
1644- outer.style.position = "relative";
1645-
1646- offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
1647- offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
1648-
1649- if ( window.getComputedStyle ) {
1650- div.style.marginTop = "1%";
1651- support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
1652- }
1653-
1654- if ( typeof container.style.zoom !== "undefined" ) {
1655- container.style.zoom = 1;
1656- }
1657-
1658- body.removeChild( container );
1659- marginDiv = div = container = null;
1660-
1661- jQuery.extend( support, offsetSupport );
1662- });
1663-
1664- return support;
1665-})();
1666-
1667-
1668-
1669-
1670-var rbrace = /^(?:\{.*\}|\[.*\])$/,
1671- rmultiDash = /([A-Z])/g;
1672-
1673-jQuery.extend({
1674- cache: {},
1675-
1676- // Please use with caution
1677- uuid: 0,
1678-
1679- // Unique for each copy of jQuery on the page
1680- // Non-digits removed to match rinlinejQuery
1681- expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
1682-
1683- // The following elements throw uncatchable exceptions if you
1684- // attempt to add expando properties to them.
1685- noData: {
1686- "embed": true,
1687- // Ban all objects except for Flash (which handle expandos)
1688- "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
1689- "applet": true
1690- },
1691-
1692- hasData: function( elem ) {
1693- elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
1694- return !!elem && !isEmptyDataObject( elem );
1695- },
1696-
1697- data: function( elem, name, data, pvt /* Internal Use Only */ ) {
1698- if ( !jQuery.acceptData( elem ) ) {
1699- return;
1700- }
1701-
1702- var privateCache, thisCache, ret,
1703- internalKey = jQuery.expando,
1704- getByName = typeof name === "string",
1705-
1706- // We have to handle DOM nodes and JS objects differently because IE6-7
1707- // can't GC object references properly across the DOM-JS boundary
1708- isNode = elem.nodeType,
1709-
1710- // Only DOM nodes need the global jQuery cache; JS object data is
1711- // attached directly to the object so GC can occur automatically
1712- cache = isNode ? jQuery.cache : elem,
1713-
1714- // Only defining an ID for JS objects if its cache already exists allows
1715- // the code to shortcut on the same path as a DOM node with no cache
1716- id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
1717- isEvents = name === "events";
1718-
1719- // Avoid doing any more work than we need to when trying to get data on an
1720- // object that has no data at all
1721- if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
1722- return;
1723- }
1724-
1725- if ( !id ) {
1726- // Only DOM nodes need a new unique ID for each element since their data
1727- // ends up in the global cache
1728- if ( isNode ) {
1729- elem[ internalKey ] = id = ++jQuery.uuid;
1730- } else {
1731- id = internalKey;
1732- }
1733- }
1734-
1735- if ( !cache[ id ] ) {
1736- cache[ id ] = {};
1737-
1738- // Avoids exposing jQuery metadata on plain JS objects when the object
1739- // is serialized using JSON.stringify
1740- if ( !isNode ) {
1741- cache[ id ].toJSON = jQuery.noop;
1742- }
1743- }
1744-
1745- // An object can be passed to jQuery.data instead of a key/value pair; this gets
1746- // shallow copied over onto the existing cache
1747- if ( typeof name === "object" || typeof name === "function" ) {
1748- if ( pvt ) {
1749- cache[ id ] = jQuery.extend( cache[ id ], name );
1750- } else {
1751- cache[ id ].data = jQuery.extend( cache[ id ].data, name );
1752- }
1753- }
1754-
1755- privateCache = thisCache = cache[ id ];
1756-
1757- // jQuery data() is stored in a separate object inside the object's internal data
1758- // cache in order to avoid key collisions between internal data and user-defined
1759- // data.
1760- if ( !pvt ) {
1761- if ( !thisCache.data ) {
1762- thisCache.data = {};
1763- }
1764-
1765- thisCache = thisCache.data;
1766- }
1767-
1768- if ( data !== undefined ) {
1769- thisCache[ jQuery.camelCase( name ) ] = data;
1770- }
1771-
1772- // Users should not attempt to inspect the internal events object using jQuery.data,
1773- // it is undocumented and subject to change. But does anyone listen? No.
1774- if ( isEvents && !thisCache[ name ] ) {
1775- return privateCache.events;
1776- }
1777-
1778- // Check for both converted-to-camel and non-converted data property names
1779- // If a data property was specified
1780- if ( getByName ) {
1781-
1782- // First Try to find as-is property data
1783- ret = thisCache[ name ];
1784-
1785- // Test for null|undefined property data
1786- if ( ret == null ) {
1787-
1788- // Try to find the camelCased property
1789- ret = thisCache[ jQuery.camelCase( name ) ];
1790- }
1791- } else {
1792- ret = thisCache;
1793- }
1794-
1795- return ret;
1796- },
1797-
1798- removeData: function( elem, name, pvt /* Internal Use Only */ ) {
1799- if ( !jQuery.acceptData( elem ) ) {
1800- return;
1801- }
1802-
1803- var thisCache, i, l,
1804-
1805- // Reference to internal data cache key
1806- internalKey = jQuery.expando,
1807-
1808- isNode = elem.nodeType,
1809-
1810- // See jQuery.data for more information
1811- cache = isNode ? jQuery.cache : elem,
1812-
1813- // See jQuery.data for more information
1814- id = isNode ? elem[ internalKey ] : internalKey;
1815-
1816- // If there is already no cache entry for this object, there is no
1817- // purpose in continuing
1818- if ( !cache[ id ] ) {
1819- return;
1820- }
1821-
1822- if ( name ) {
1823-
1824- thisCache = pvt ? cache[ id ] : cache[ id ].data;
1825-
1826- if ( thisCache ) {
1827-
1828- // Support array or space separated string names for data keys
1829- if ( !jQuery.isArray( name ) ) {
1830-
1831- // try the string as a key before any manipulation
1832- if ( name in thisCache ) {
1833- name = [ name ];
1834- } else {
1835-
1836- // split the camel cased version by spaces unless a key with the spaces exists
1837- name = jQuery.camelCase( name );
1838- if ( name in thisCache ) {
1839- name = [ name ];
1840- } else {
1841- name = name.split( " " );
1842- }
1843- }
1844- }
1845-
1846- for ( i = 0, l = name.length; i < l; i++ ) {
1847- delete thisCache[ name[i] ];
1848- }
1849-
1850- // If there is no data left in the cache, we want to continue
1851- // and let the cache object itself get destroyed
1852- if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
1853- return;
1854- }
1855- }
1856- }
1857-
1858- // See jQuery.data for more information
1859- if ( !pvt ) {
1860- delete cache[ id ].data;
1861-
1862- // Don't destroy the parent cache unless the internal data object
1863- // had been the only thing left in it
1864- if ( !isEmptyDataObject(cache[ id ]) ) {
1865- return;
1866- }
1867- }
1868-
1869- // Browsers that fail expando deletion also refuse to delete expandos on
1870- // the window, but it will allow it on all other JS objects; other browsers
1871- // don't care
1872- // Ensure that `cache` is not a window object #10080
1873- if ( jQuery.support.deleteExpando || !cache.setInterval ) {
1874- delete cache[ id ];
1875- } else {
1876- cache[ id ] = null;
1877- }
1878-
1879- // We destroyed the cache and need to eliminate the expando on the node to avoid
1880- // false lookups in the cache for entries that no longer exist
1881- if ( isNode ) {
1882- // IE does not allow us to delete expando properties from nodes,
1883- // nor does it have a removeAttribute function on Document nodes;
1884- // we must handle all of these cases
1885- if ( jQuery.support.deleteExpando ) {
1886- delete elem[ internalKey ];
1887- } else if ( elem.removeAttribute ) {
1888- elem.removeAttribute( internalKey );
1889- } else {
1890- elem[ internalKey ] = null;
1891- }
1892- }
1893- },
1894-
1895- // For internal use only.
1896- _data: function( elem, name, data ) {
1897- return jQuery.data( elem, name, data, true );
1898- },
1899-
1900- // A method for determining if a DOM node can handle the data expando
1901- acceptData: function( elem ) {
1902- if ( elem.nodeName ) {
1903- var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
1904-
1905- if ( match ) {
1906- return !(match === true || elem.getAttribute("classid") !== match);
1907- }
1908- }
1909-
1910- return true;
1911- }
1912-});
1913-
1914-jQuery.fn.extend({
1915- data: function( key, value ) {
1916- var parts, part, attr, name, l,
1917- elem = this[0],
1918- i = 0,
1919- data = null;
1920-
1921- // Gets all values
1922- if ( key === undefined ) {
1923- if ( this.length ) {
1924- data = jQuery.data( elem );
1925-
1926- if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
1927- attr = elem.attributes;
1928- for ( l = attr.length; i < l; i++ ) {
1929- name = attr[i].name;
1930-
1931- if ( name.indexOf( "data-" ) === 0 ) {
1932- name = jQuery.camelCase( name.substring(5) );
1933-
1934- dataAttr( elem, name, data[ name ] );
1935- }
1936- }
1937- jQuery._data( elem, "parsedAttrs", true );
1938- }
1939- }
1940-
1941- return data;
1942- }
1943-
1944- // Sets multiple values
1945- if ( typeof key === "object" ) {
1946- return this.each(function() {
1947- jQuery.data( this, key );
1948- });
1949- }
1950-
1951- parts = key.split( ".", 2 );
1952- parts[1] = parts[1] ? "." + parts[1] : "";
1953- part = parts[1] + "!";
1954-
1955- return jQuery.access( this, function( value ) {
1956-
1957- if ( value === undefined ) {
1958- data = this.triggerHandler( "getData" + part, [ parts[0] ] );
1959-
1960- // Try to fetch any internally stored data first
1961- if ( data === undefined && elem ) {
1962- data = jQuery.data( elem, key );
1963- data = dataAttr( elem, key, data );
1964- }
1965-
1966- return data === undefined && parts[1] ?
1967- this.data( parts[0] ) :
1968- data;
1969- }
1970-
1971- parts[1] = value;
1972- this.each(function() {
1973- var self = jQuery( this );
1974-
1975- self.triggerHandler( "setData" + part, parts );
1976- jQuery.data( this, key, value );
1977- self.triggerHandler( "changeData" + part, parts );
1978- });
1979- }, null, value, arguments.length > 1, null, false );
1980- },
1981-
1982- removeData: function( key ) {
1983- return this.each(function() {
1984- jQuery.removeData( this, key );
1985- });
1986- }
1987-});
1988-
1989-function dataAttr( elem, key, data ) {
1990- // If nothing was found internally, try to fetch any
1991- // data from the HTML5 data-* attribute
1992- if ( data === undefined && elem.nodeType === 1 ) {
1993-
1994- var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
1995-
1996- data = elem.getAttribute( name );
1997-
1998- if ( typeof data === "string" ) {
1999- try {
2000- data = data === "true" ? true :
2001- data === "false" ? false :
2002- data === "null" ? null :
2003- jQuery.isNumeric( data ) ? +data :
2004- rbrace.test( data ) ? jQuery.parseJSON( data ) :
2005- data;
2006- } catch( e ) {}
2007-
2008- // Make sure we set the data so it isn't changed later
2009- jQuery.data( elem, key, data );
2010-
2011- } else {
2012- data = undefined;
2013- }
2014- }
2015-
2016- return data;
2017-}
2018-
2019-// checks a cache object for emptiness
2020-function isEmptyDataObject( obj ) {
2021- for ( var name in obj ) {
2022-
2023- // if the public data object is empty, the private is still empty
2024- if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
2025- continue;
2026- }
2027- if ( name !== "toJSON" ) {
2028- return false;
2029- }
2030- }
2031-
2032- return true;
2033-}
2034-
2035-
2036-
2037-
2038-function handleQueueMarkDefer( elem, type, src ) {
2039- var deferDataKey = type + "defer",
2040- queueDataKey = type + "queue",
2041- markDataKey = type + "mark",
2042- defer = jQuery._data( elem, deferDataKey );
2043- if ( defer &&
2044- ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
2045- ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
2046- // Give room for hard-coded callbacks to fire first
2047- // and eventually mark/queue something else on the element
2048- setTimeout( function() {
2049- if ( !jQuery._data( elem, queueDataKey ) &&
2050- !jQuery._data( elem, markDataKey ) ) {
2051- jQuery.removeData( elem, deferDataKey, true );
2052- defer.fire();
2053- }
2054- }, 0 );
2055- }
2056-}
2057-
2058-jQuery.extend({
2059-
2060- _mark: function( elem, type ) {
2061- if ( elem ) {
2062- type = ( type || "fx" ) + "mark";
2063- jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
2064- }
2065- },
2066-
2067- _unmark: function( force, elem, type ) {
2068- if ( force !== true ) {
2069- type = elem;
2070- elem = force;
2071- force = false;
2072- }
2073- if ( elem ) {
2074- type = type || "fx";
2075- var key = type + "mark",
2076- count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
2077- if ( count ) {
2078- jQuery._data( elem, key, count );
2079- } else {
2080- jQuery.removeData( elem, key, true );
2081- handleQueueMarkDefer( elem, type, "mark" );
2082- }
2083- }
2084- },
2085-
2086- queue: function( elem, type, data ) {
2087- var q;
2088- if ( elem ) {
2089- type = ( type || "fx" ) + "queue";
2090- q = jQuery._data( elem, type );
2091-
2092- // Speed up dequeue by getting out quickly if this is just a lookup
2093- if ( data ) {
2094- if ( !q || jQuery.isArray(data) ) {
2095- q = jQuery._data( elem, type, jQuery.makeArray(data) );
2096- } else {
2097- q.push( data );
2098- }
2099- }
2100- return q || [];
2101- }
2102- },
2103-
2104- dequeue: function( elem, type ) {
2105- type = type || "fx";
2106-
2107- var queue = jQuery.queue( elem, type ),
2108- fn = queue.shift(),
2109- hooks = {};
2110-
2111- // If the fx queue is dequeued, always remove the progress sentinel
2112- if ( fn === "inprogress" ) {
2113- fn = queue.shift();
2114- }
2115-
2116- if ( fn ) {
2117- // Add a progress sentinel to prevent the fx queue from being
2118- // automatically dequeued
2119- if ( type === "fx" ) {
2120- queue.unshift( "inprogress" );
2121- }
2122-
2123- jQuery._data( elem, type + ".run", hooks );
2124- fn.call( elem, function() {
2125- jQuery.dequeue( elem, type );
2126- }, hooks );
2127- }
2128-
2129- if ( !queue.length ) {
2130- jQuery.removeData( elem, type + "queue " + type + ".run", true );
2131- handleQueueMarkDefer( elem, type, "queue" );
2132- }
2133- }
2134-});
2135-
2136-jQuery.fn.extend({
2137- queue: function( type, data ) {
2138- var setter = 2;
2139-
2140- if ( typeof type !== "string" ) {
2141- data = type;
2142- type = "fx";
2143- setter--;
2144- }
2145-
2146- if ( arguments.length < setter ) {
2147- return jQuery.queue( this[0], type );
2148- }
2149-
2150- return data === undefined ?
2151- this :
2152- this.each(function() {
2153- var queue = jQuery.queue( this, type, data );
2154-
2155- if ( type === "fx" && queue[0] !== "inprogress" ) {
2156- jQuery.dequeue( this, type );
2157- }
2158- });
2159- },
2160- dequeue: function( type ) {
2161- return this.each(function() {
2162- jQuery.dequeue( this, type );
2163- });
2164- },
2165- // Based off of the plugin by Clint Helfers, with permission.
2166- // http://blindsignals.com/index.php/2009/07/jquery-delay/
2167- delay: function( time, type ) {
2168- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
2169- type = type || "fx";
2170-
2171- return this.queue( type, function( next, hooks ) {
2172- var timeout = setTimeout( next, time );
2173- hooks.stop = function() {
2174- clearTimeout( timeout );
2175- };
2176- });
2177- },
2178- clearQueue: function( type ) {
2179- return this.queue( type || "fx", [] );
2180- },
2181- // Get a promise resolved when queues of a certain type
2182- // are emptied (fx is the type by default)
2183- promise: function( type, object ) {
2184- if ( typeof type !== "string" ) {
2185- object = type;
2186- type = undefined;
2187- }
2188- type = type || "fx";
2189- var defer = jQuery.Deferred(),
2190- elements = this,
2191- i = elements.length,
2192- count = 1,
2193- deferDataKey = type + "defer",
2194- queueDataKey = type + "queue",
2195- markDataKey = type + "mark",
2196- tmp;
2197- function resolve() {
2198- if ( !( --count ) ) {
2199- defer.resolveWith( elements, [ elements ] );
2200- }
2201- }
2202- while( i-- ) {
2203- if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
2204- ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
2205- jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
2206- jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
2207- count++;
2208- tmp.add( resolve );
2209- }
2210- }
2211- resolve();
2212- return defer.promise( object );
2213- }
2214-});
2215-
2216-
2217-
2218-
2219-var rclass = /[\n\t\r]/g,
2220- rspace = /\s+/,
2221- rreturn = /\r/g,
2222- rtype = /^(?:button|input)$/i,
2223- rfocusable = /^(?:button|input|object|select|textarea)$/i,
2224- rclickable = /^a(?:rea)?$/i,
2225- rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
2226- getSetAttribute = jQuery.support.getSetAttribute,
2227- nodeHook, boolHook, fixSpecified;
2228-
2229-jQuery.fn.extend({
2230- attr: function( name, value ) {
2231- return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
2232- },
2233-
2234- removeAttr: function( name ) {
2235- return this.each(function() {
2236- jQuery.removeAttr( this, name );
2237- });
2238- },
2239-
2240- prop: function( name, value ) {
2241- return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
2242- },
2243-
2244- removeProp: function( name ) {
2245- name = jQuery.propFix[ name ] || name;
2246- return this.each(function() {
2247- // try/catch handles cases where IE balks (such as removing a property on window)
2248- try {
2249- this[ name ] = undefined;
2250- delete this[ name ];
2251- } catch( e ) {}
2252- });
2253- },
2254-
2255- addClass: function( value ) {
2256- var classNames, i, l, elem,
2257- setClass, c, cl;
2258-
2259- if ( jQuery.isFunction( value ) ) {
2260- return this.each(function( j ) {
2261- jQuery( this ).addClass( value.call(this, j, this.className) );
2262- });
2263- }
2264-
2265- if ( value && typeof value === "string" ) {
2266- classNames = value.split( rspace );
2267-
2268- for ( i = 0, l = this.length; i < l; i++ ) {
2269- elem = this[ i ];
2270-
2271- if ( elem.nodeType === 1 ) {
2272- if ( !elem.className && classNames.length === 1 ) {
2273- elem.className = value;
2274-
2275- } else {
2276- setClass = " " + elem.className + " ";
2277-
2278- for ( c = 0, cl = classNames.length; c < cl; c++ ) {
2279- if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
2280- setClass += classNames[ c ] + " ";
2281- }
2282- }
2283- elem.className = jQuery.trim( setClass );
2284- }
2285- }
2286- }
2287- }
2288-
2289- return this;
2290- },
2291-
2292- removeClass: function( value ) {
2293- var classNames, i, l, elem, className, c, cl;
2294-
2295- if ( jQuery.isFunction( value ) ) {
2296- return this.each(function( j ) {
2297- jQuery( this ).removeClass( value.call(this, j, this.className) );
2298- });
2299- }
2300-
2301- if ( (value && typeof value === "string") || value === undefined ) {
2302- classNames = ( value || "" ).split( rspace );
2303-
2304- for ( i = 0, l = this.length; i < l; i++ ) {
2305- elem = this[ i ];
2306-
2307- if ( elem.nodeType === 1 && elem.className ) {
2308- if ( value ) {
2309- className = (" " + elem.className + " ").replace( rclass, " " );
2310- for ( c = 0, cl = classNames.length; c < cl; c++ ) {
2311- className = className.replace(" " + classNames[ c ] + " ", " ");
2312- }
2313- elem.className = jQuery.trim( className );
2314-
2315- } else {
2316- elem.className = "";
2317- }
2318- }
2319- }
2320- }
2321-
2322- return this;
2323- },
2324-
2325- toggleClass: function( value, stateVal ) {
2326- var type = typeof value,
2327- isBool = typeof stateVal === "boolean";
2328-
2329- if ( jQuery.isFunction( value ) ) {
2330- return this.each(function( i ) {
2331- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
2332- });
2333- }
2334-
2335- return this.each(function() {
2336- if ( type === "string" ) {
2337- // toggle individual class names
2338- var className,
2339- i = 0,
2340- self = jQuery( this ),
2341- state = stateVal,
2342- classNames = value.split( rspace );
2343-
2344- while ( (className = classNames[ i++ ]) ) {
2345- // check each className given, space seperated list
2346- state = isBool ? state : !self.hasClass( className );
2347- self[ state ? "addClass" : "removeClass" ]( className );
2348- }
2349-
2350- } else if ( type === "undefined" || type === "boolean" ) {
2351- if ( this.className ) {
2352- // store className if set
2353- jQuery._data( this, "__className__", this.className );
2354- }
2355-
2356- // toggle whole className
2357- this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
2358- }
2359- });
2360- },
2361-
2362- hasClass: function( selector ) {
2363- var className = " " + selector + " ",
2364- i = 0,
2365- l = this.length;
2366- for ( ; i < l; i++ ) {
2367- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
2368- return true;
2369- }
2370- }
2371-
2372- return false;
2373- },
2374-
2375- val: function( value ) {
2376- var hooks, ret, isFunction,
2377- elem = this[0];
2378-
2379- if ( !arguments.length ) {
2380- if ( elem ) {
2381- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
2382-
2383- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
2384- return ret;
2385- }
2386-
2387- ret = elem.value;
2388-
2389- return typeof ret === "string" ?
2390- // handle most common string cases
2391- ret.replace(rreturn, "") :
2392- // handle cases where value is null/undef or number
2393- ret == null ? "" : ret;
2394- }
2395-
2396- return;
2397- }
2398-
2399- isFunction = jQuery.isFunction( value );
2400-
2401- return this.each(function( i ) {
2402- var self = jQuery(this), val;
2403-
2404- if ( this.nodeType !== 1 ) {
2405- return;
2406- }
2407-
2408- if ( isFunction ) {
2409- val = value.call( this, i, self.val() );
2410- } else {
2411- val = value;
2412- }
2413-
2414- // Treat null/undefined as ""; convert numbers to string
2415- if ( val == null ) {
2416- val = "";
2417- } else if ( typeof val === "number" ) {
2418- val += "";
2419- } else if ( jQuery.isArray( val ) ) {
2420- val = jQuery.map(val, function ( value ) {
2421- return value == null ? "" : value + "";
2422- });
2423- }
2424-
2425- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
2426-
2427- // If set returns undefined, fall back to normal setting
2428- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
2429- this.value = val;
2430- }
2431- });
2432- }
2433-});
2434-
2435-jQuery.extend({
2436- valHooks: {
2437- option: {
2438- get: function( elem ) {
2439- // attributes.value is undefined in Blackberry 4.7 but
2440- // uses .value. See #6932
2441- var val = elem.attributes.value;
2442- return !val || val.specified ? elem.value : elem.text;
2443- }
2444- },
2445- select: {
2446- get: function( elem ) {
2447- var value, i, max, option,
2448- index = elem.selectedIndex,
2449- values = [],
2450- options = elem.options,
2451- one = elem.type === "select-one";
2452-
2453- // Nothing was selected
2454- if ( index < 0 ) {
2455- return null;
2456- }
2457-
2458- // Loop through all the selected options
2459- i = one ? index : 0;
2460- max = one ? index + 1 : options.length;
2461- for ( ; i < max; i++ ) {
2462- option = options[ i ];
2463-
2464- // Don't return options that are disabled or in a disabled optgroup
2465- if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
2466- (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
2467-
2468- // Get the specific value for the option
2469- value = jQuery( option ).val();
2470-
2471- // We don't need an array for one selects
2472- if ( one ) {
2473- return value;
2474- }
2475-
2476- // Multi-Selects return an array
2477- values.push( value );
2478- }
2479- }
2480-
2481- // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
2482- if ( one && !values.length && options.length ) {
2483- return jQuery( options[ index ] ).val();
2484- }
2485-
2486- return values;
2487- },
2488-
2489- set: function( elem, value ) {
2490- var values = jQuery.makeArray( value );
2491-
2492- jQuery(elem).find("option").each(function() {
2493- this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
2494- });
2495-
2496- if ( !values.length ) {
2497- elem.selectedIndex = -1;
2498- }
2499- return values;
2500- }
2501- }
2502- },
2503-
2504- attrFn: {
2505- val: true,
2506- css: true,
2507- html: true,
2508- text: true,
2509- data: true,
2510- width: true,
2511- height: true,
2512- offset: true
2513- },
2514-
2515- attr: function( elem, name, value, pass ) {
2516- var ret, hooks, notxml,
2517- nType = elem.nodeType;
2518-
2519- // don't get/set attributes on text, comment and attribute nodes
2520- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2521- return;
2522- }
2523-
2524- if ( pass && name in jQuery.attrFn ) {
2525- return jQuery( elem )[ name ]( value );
2526- }
2527-
2528- // Fallback to prop when attributes are not supported
2529- if ( typeof elem.getAttribute === "undefined" ) {
2530- return jQuery.prop( elem, name, value );
2531- }
2532-
2533- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2534-
2535- // All attributes are lowercase
2536- // Grab necessary hook if one is defined
2537- if ( notxml ) {
2538- name = name.toLowerCase();
2539- hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
2540- }
2541-
2542- if ( value !== undefined ) {
2543-
2544- if ( value === null ) {
2545- jQuery.removeAttr( elem, name );
2546- return;
2547-
2548- } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
2549- return ret;
2550-
2551- } else {
2552- elem.setAttribute( name, "" + value );
2553- return value;
2554- }
2555-
2556- } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
2557- return ret;
2558-
2559- } else {
2560-
2561- ret = elem.getAttribute( name );
2562-
2563- // Non-existent attributes return null, we normalize to undefined
2564- return ret === null ?
2565- undefined :
2566- ret;
2567- }
2568- },
2569-
2570- removeAttr: function( elem, value ) {
2571- var propName, attrNames, name, l, isBool,
2572- i = 0;
2573-
2574- if ( value && elem.nodeType === 1 ) {
2575- attrNames = value.toLowerCase().split( rspace );
2576- l = attrNames.length;
2577-
2578- for ( ; i < l; i++ ) {
2579- name = attrNames[ i ];
2580-
2581- if ( name ) {
2582- propName = jQuery.propFix[ name ] || name;
2583- isBool = rboolean.test( name );
2584-
2585- // See #9699 for explanation of this approach (setting first, then removal)
2586- // Do not do this for boolean attributes (see #10870)
2587- if ( !isBool ) {
2588- jQuery.attr( elem, name, "" );
2589- }
2590- elem.removeAttribute( getSetAttribute ? name : propName );
2591-
2592- // Set corresponding property to false for boolean attributes
2593- if ( isBool && propName in elem ) {
2594- elem[ propName ] = false;
2595- }
2596- }
2597- }
2598- }
2599- },
2600-
2601- attrHooks: {
2602- type: {
2603- set: function( elem, value ) {
2604- // We can't allow the type property to be changed (since it causes problems in IE)
2605- if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
2606- jQuery.error( "type property can't be changed" );
2607- } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
2608- // Setting the type on a radio button after the value resets the value in IE6-9
2609- // Reset value to it's default in case type is set after value
2610- // This is for element creation
2611- var val = elem.value;
2612- elem.setAttribute( "type", value );
2613- if ( val ) {
2614- elem.value = val;
2615- }
2616- return value;
2617- }
2618- }
2619- },
2620- // Use the value property for back compat
2621- // Use the nodeHook for button elements in IE6/7 (#1954)
2622- value: {
2623- get: function( elem, name ) {
2624- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
2625- return nodeHook.get( elem, name );
2626- }
2627- return name in elem ?
2628- elem.value :
2629- null;
2630- },
2631- set: function( elem, value, name ) {
2632- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
2633- return nodeHook.set( elem, value, name );
2634- }
2635- // Does not return so that setAttribute is also used
2636- elem.value = value;
2637- }
2638- }
2639- },
2640-
2641- propFix: {
2642- tabindex: "tabIndex",
2643- readonly: "readOnly",
2644- "for": "htmlFor",
2645- "class": "className",
2646- maxlength: "maxLength",
2647- cellspacing: "cellSpacing",
2648- cellpadding: "cellPadding",
2649- rowspan: "rowSpan",
2650- colspan: "colSpan",
2651- usemap: "useMap",
2652- frameborder: "frameBorder",
2653- contenteditable: "contentEditable"
2654- },
2655-
2656- prop: function( elem, name, value ) {
2657- var ret, hooks, notxml,
2658- nType = elem.nodeType;
2659-
2660- // don't get/set properties on text, comment and attribute nodes
2661- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2662- return;
2663- }
2664-
2665- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2666-
2667- if ( notxml ) {
2668- // Fix name and attach hooks
2669- name = jQuery.propFix[ name ] || name;
2670- hooks = jQuery.propHooks[ name ];
2671- }
2672-
2673- if ( value !== undefined ) {
2674- if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
2675- return ret;
2676-
2677- } else {
2678- return ( elem[ name ] = value );
2679- }
2680-
2681- } else {
2682- if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
2683- return ret;
2684-
2685- } else {
2686- return elem[ name ];
2687- }
2688- }
2689- },
2690-
2691- propHooks: {
2692- tabIndex: {
2693- get: function( elem ) {
2694- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
2695- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
2696- var attributeNode = elem.getAttributeNode("tabindex");
2697-
2698- return attributeNode && attributeNode.specified ?
2699- parseInt( attributeNode.value, 10 ) :
2700- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
2701- 0 :
2702- undefined;
2703- }
2704- }
2705- }
2706-});
2707-
2708-// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
2709-jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
2710-
2711-// Hook for boolean attributes
2712-boolHook = {
2713- get: function( elem, name ) {
2714- // Align boolean attributes with corresponding properties
2715- // Fall back to attribute presence where some booleans are not supported
2716- var attrNode,
2717- property = jQuery.prop( elem, name );
2718- return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
2719- name.toLowerCase() :
2720- undefined;
2721- },
2722- set: function( elem, value, name ) {
2723- var propName;
2724- if ( value === false ) {
2725- // Remove boolean attributes when set to false
2726- jQuery.removeAttr( elem, name );
2727- } else {
2728- // value is true since we know at this point it's type boolean and not false
2729- // Set boolean attributes to the same name and set the DOM property
2730- propName = jQuery.propFix[ name ] || name;
2731- if ( propName in elem ) {
2732- // Only set the IDL specifically if it already exists on the element
2733- elem[ propName ] = true;
2734- }
2735-
2736- elem.setAttribute( name, name.toLowerCase() );
2737- }
2738- return name;
2739- }
2740-};
2741-
2742-// IE6/7 do not support getting/setting some attributes with get/setAttribute
2743-if ( !getSetAttribute ) {
2744-
2745- fixSpecified = {
2746- name: true,
2747- id: true,
2748- coords: true
2749- };
2750-
2751- // Use this for any attribute in IE6/7
2752- // This fixes almost every IE6/7 issue
2753- nodeHook = jQuery.valHooks.button = {
2754- get: function( elem, name ) {
2755- var ret;
2756- ret = elem.getAttributeNode( name );
2757- return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
2758- ret.nodeValue :
2759- undefined;
2760- },
2761- set: function( elem, value, name ) {
2762- // Set the existing or create a new attribute node
2763- var ret = elem.getAttributeNode( name );
2764- if ( !ret ) {
2765- ret = document.createAttribute( name );
2766- elem.setAttributeNode( ret );
2767- }
2768- return ( ret.nodeValue = value + "" );
2769- }
2770- };
2771-
2772- // Apply the nodeHook to tabindex
2773- jQuery.attrHooks.tabindex.set = nodeHook.set;
2774-
2775- // Set width and height to auto instead of 0 on empty string( Bug #8150 )
2776- // This is for removals
2777- jQuery.each([ "width", "height" ], function( i, name ) {
2778- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2779- set: function( elem, value ) {
2780- if ( value === "" ) {
2781- elem.setAttribute( name, "auto" );
2782- return value;
2783- }
2784- }
2785- });
2786- });
2787-
2788- // Set contenteditable to false on removals(#10429)
2789- // Setting to empty string throws an error as an invalid value
2790- jQuery.attrHooks.contenteditable = {
2791- get: nodeHook.get,
2792- set: function( elem, value, name ) {
2793- if ( value === "" ) {
2794- value = "false";
2795- }
2796- nodeHook.set( elem, value, name );
2797- }
2798- };
2799-}
2800-
2801-
2802-// Some attributes require a special call on IE
2803-if ( !jQuery.support.hrefNormalized ) {
2804- jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
2805- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2806- get: function( elem ) {
2807- var ret = elem.getAttribute( name, 2 );
2808- return ret === null ? undefined : ret;
2809- }
2810- });
2811- });
2812-}
2813-
2814-if ( !jQuery.support.style ) {
2815- jQuery.attrHooks.style = {
2816- get: function( elem ) {
2817- // Return undefined in the case of empty string
2818- // Normalize to lowercase since IE uppercases css property names
2819- return elem.style.cssText.toLowerCase() || undefined;
2820- },
2821- set: function( elem, value ) {
2822- return ( elem.style.cssText = "" + value );
2823- }
2824- };
2825-}
2826-
2827-// Safari mis-reports the default selected property of an option
2828-// Accessing the parent's selectedIndex property fixes it
2829-if ( !jQuery.support.optSelected ) {
2830- jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
2831- get: function( elem ) {
2832- var parent = elem.parentNode;
2833-
2834- if ( parent ) {
2835- parent.selectedIndex;
2836-
2837- // Make sure that it also works with optgroups, see #5701
2838- if ( parent.parentNode ) {
2839- parent.parentNode.selectedIndex;
2840- }
2841- }
2842- return null;
2843- }
2844- });
2845-}
2846-
2847-// IE6/7 call enctype encoding
2848-if ( !jQuery.support.enctype ) {
2849- jQuery.propFix.enctype = "encoding";
2850-}
2851-
2852-// Radios and checkboxes getter/setter
2853-if ( !jQuery.support.checkOn ) {
2854- jQuery.each([ "radio", "checkbox" ], function() {
2855- jQuery.valHooks[ this ] = {
2856- get: function( elem ) {
2857- // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
2858- return elem.getAttribute("value") === null ? "on" : elem.value;
2859- }
2860- };
2861- });
2862-}
2863-jQuery.each([ "radio", "checkbox" ], function() {
2864- jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
2865- set: function( elem, value ) {
2866- if ( jQuery.isArray( value ) ) {
2867- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
2868- }
2869- }
2870- });
2871-});
2872-
2873-
2874-
2875-
2876-var rformElems = /^(?:textarea|input|select)$/i,
2877- rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
2878- rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
2879- rkeyEvent = /^key/,
2880- rmouseEvent = /^(?:mouse|contextmenu)|click/,
2881- rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
2882- rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
2883- quickParse = function( selector ) {
2884- var quick = rquickIs.exec( selector );
2885- if ( quick ) {
2886- // 0 1 2 3
2887- // [ _, tag, id, class ]
2888- quick[1] = ( quick[1] || "" ).toLowerCase();
2889- quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
2890- }
2891- return quick;
2892- },
2893- quickIs = function( elem, m ) {
2894- var attrs = elem.attributes || {};
2895- return (
2896- (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
2897- (!m[2] || (attrs.id || {}).value === m[2]) &&
2898- (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
2899- );
2900- },
2901- hoverHack = function( events ) {
2902- return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
2903- };
2904-
2905-/*
2906- * Helper functions for managing events -- not part of the public interface.
2907- * Props to Dean Edwards' addEvent library for many of the ideas.
2908- */
2909-jQuery.event = {
2910-
2911- add: function( elem, types, handler, data, selector ) {
2912-
2913- var elemData, eventHandle, events,
2914- t, tns, type, namespaces, handleObj,
2915- handleObjIn, quick, handlers, special;
2916-
2917- // Don't attach events to noData or text/comment nodes (allow plain objects tho)
2918- if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
2919- return;
2920- }
2921-
2922- // Caller can pass in an object of custom data in lieu of the handler
2923- if ( handler.handler ) {
2924- handleObjIn = handler;
2925- handler = handleObjIn.handler;
2926- selector = handleObjIn.selector;
2927- }
2928-
2929- // Make sure that the handler has a unique ID, used to find/remove it later
2930- if ( !handler.guid ) {
2931- handler.guid = jQuery.guid++;
2932- }
2933-
2934- // Init the element's event structure and main handler, if this is the first
2935- events = elemData.events;
2936- if ( !events ) {
2937- elemData.events = events = {};
2938- }
2939- eventHandle = elemData.handle;
2940- if ( !eventHandle ) {
2941- elemData.handle = eventHandle = function( e ) {
2942- // Discard the second event of a jQuery.event.trigger() and
2943- // when an event is called after a page has unloaded
2944- return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
2945- jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
2946- undefined;
2947- };
2948- // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
2949- eventHandle.elem = elem;
2950- }
2951-
2952- // Handle multiple events separated by a space
2953- // jQuery(...).bind("mouseover mouseout", fn);
2954- types = jQuery.trim( hoverHack(types) ).split( " " );
2955- for ( t = 0; t < types.length; t++ ) {
2956-
2957- tns = rtypenamespace.exec( types[t] ) || [];
2958- type = tns[1];
2959- namespaces = ( tns[2] || "" ).split( "." ).sort();
2960-
2961- // If event changes its type, use the special event handlers for the changed type
2962- special = jQuery.event.special[ type ] || {};
2963-
2964- // If selector defined, determine special event api type, otherwise given type
2965- type = ( selector ? special.delegateType : special.bindType ) || type;
2966-
2967- // Update special based on newly reset type
2968- special = jQuery.event.special[ type ] || {};
2969-
2970- // handleObj is passed to all event handlers
2971- handleObj = jQuery.extend({
2972- type: type,
2973- origType: tns[1],
2974- data: data,
2975- handler: handler,
2976- guid: handler.guid,
2977- selector: selector,
2978- quick: selector && quickParse( selector ),
2979- namespace: namespaces.join(".")
2980- }, handleObjIn );
2981-
2982- // Init the event handler queue if we're the first
2983- handlers = events[ type ];
2984- if ( !handlers ) {
2985- handlers = events[ type ] = [];
2986- handlers.delegateCount = 0;
2987-
2988- // Only use addEventListener/attachEvent if the special events handler returns false
2989- if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
2990- // Bind the global event handler to the element
2991- if ( elem.addEventListener ) {
2992- elem.addEventListener( type, eventHandle, false );
2993-
2994- } else if ( elem.attachEvent ) {
2995- elem.attachEvent( "on" + type, eventHandle );
2996- }
2997- }
2998- }
2999-
3000- if ( special.add ) {
3001- special.add.call( elem, handleObj );
3002-
3003- if ( !handleObj.handler.guid ) {
3004- handleObj.handler.guid = handler.guid;
3005- }
3006- }
3007-
3008- // Add to the element's handler list, delegates in front
3009- if ( selector ) {
3010- handlers.splice( handlers.delegateCount++, 0, handleObj );
3011- } else {
3012- handlers.push( handleObj );
3013- }
3014-
3015- // Keep track of which events have ever been used, for event optimization
3016- jQuery.event.global[ type ] = true;
3017- }
3018-
3019- // Nullify elem to prevent memory leaks in IE
3020- elem = null;
3021- },
3022-
3023- global: {},
3024-
3025- // Detach an event or set of events from an element
3026- remove: function( elem, types, handler, selector, mappedTypes ) {
3027-
3028- var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
3029- t, tns, type, origType, namespaces, origCount,
3030- j, events, special, handle, eventType, handleObj;
3031-
3032- if ( !elemData || !(events = elemData.events) ) {
3033- return;
3034- }
3035-
3036- // Once for each type.namespace in types; type may be omitted
3037- types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
3038- for ( t = 0; t < types.length; t++ ) {
3039- tns = rtypenamespace.exec( types[t] ) || [];
3040- type = origType = tns[1];
3041- namespaces = tns[2];
3042-
3043- // Unbind all events (on this namespace, if provided) for the element
3044- if ( !type ) {
3045- for ( type in events ) {
3046- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
3047- }
3048- continue;
3049- }
3050-
3051- special = jQuery.event.special[ type ] || {};
3052- type = ( selector? special.delegateType : special.bindType ) || type;
3053- eventType = events[ type ] || [];
3054- origCount = eventType.length;
3055- namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
3056-
3057- // Remove matching events
3058- for ( j = 0; j < eventType.length; j++ ) {
3059- handleObj = eventType[ j ];
3060-
3061- if ( ( mappedTypes || origType === handleObj.origType ) &&
3062- ( !handler || handler.guid === handleObj.guid ) &&
3063- ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
3064- ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
3065- eventType.splice( j--, 1 );
3066-
3067- if ( handleObj.selector ) {
3068- eventType.delegateCount--;
3069- }
3070- if ( special.remove ) {
3071- special.remove.call( elem, handleObj );
3072- }
3073- }
3074- }
3075-
3076- // Remove generic event handler if we removed something and no more handlers exist
3077- // (avoids potential for endless recursion during removal of special event handlers)
3078- if ( eventType.length === 0 && origCount !== eventType.length ) {
3079- if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
3080- jQuery.removeEvent( elem, type, elemData.handle );
3081- }
3082-
3083- delete events[ type ];
3084- }
3085- }
3086-
3087- // Remove the expando if it's no longer used
3088- if ( jQuery.isEmptyObject( events ) ) {
3089- handle = elemData.handle;
3090- if ( handle ) {
3091- handle.elem = null;
3092- }
3093-
3094- // removeData also checks for emptiness and clears the expando if empty
3095- // so use it instead of delete
3096- jQuery.removeData( elem, [ "events", "handle" ], true );
3097- }
3098- },
3099-
3100- // Events that are safe to short-circuit if no handlers are attached.
3101- // Native DOM events should not be added, they may have inline handlers.
3102- customEvent: {
3103- "getData": true,
3104- "setData": true,
3105- "changeData": true
3106- },
3107-
3108- trigger: function( event, data, elem, onlyHandlers ) {
3109- // Don't do events on text and comment nodes
3110- if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
3111- return;
3112- }
3113-
3114- // Event object or event type
3115- var type = event.type || event,
3116- namespaces = [],
3117- cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
3118-
3119- // focus/blur morphs to focusin/out; ensure we're not firing them right now
3120- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
3121- return;
3122- }
3123-
3124- if ( type.indexOf( "!" ) >= 0 ) {
3125- // Exclusive events trigger only for the exact event (no namespaces)
3126- type = type.slice(0, -1);
3127- exclusive = true;
3128- }
3129-
3130- if ( type.indexOf( "." ) >= 0 ) {
3131- // Namespaced trigger; create a regexp to match event type in handle()
3132- namespaces = type.split(".");
3133- type = namespaces.shift();
3134- namespaces.sort();
3135- }
3136-
3137- if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
3138- // No jQuery handlers for this event type, and it can't have inline handlers
3139- return;
3140- }
3141-
3142- // Caller can pass in an Event, Object, or just an event type string
3143- event = typeof event === "object" ?
3144- // jQuery.Event object
3145- event[ jQuery.expando ] ? event :
3146- // Object literal
3147- new jQuery.Event( type, event ) :
3148- // Just the event type (string)
3149- new jQuery.Event( type );
3150-
3151- event.type = type;
3152- event.isTrigger = true;
3153- event.exclusive = exclusive;
3154- event.namespace = namespaces.join( "." );
3155- event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
3156- ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
3157-
3158- // Handle a global trigger
3159- if ( !elem ) {
3160-
3161- // TODO: Stop taunting the data cache; remove global events and always attach to document
3162- cache = jQuery.cache;
3163- for ( i in cache ) {
3164- if ( cache[ i ].events && cache[ i ].events[ type ] ) {
3165- jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
3166- }
3167- }
3168- return;
3169- }
3170-
3171- // Clean up the event in case it is being reused
3172- event.result = undefined;
3173- if ( !event.target ) {
3174- event.target = elem;
3175- }
3176-
3177- // Clone any incoming data and prepend the event, creating the handler arg list
3178- data = data != null ? jQuery.makeArray( data ) : [];
3179- data.unshift( event );
3180-
3181- // Allow special events to draw outside the lines
3182- special = jQuery.event.special[ type ] || {};
3183- if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
3184- return;
3185- }
3186-
3187- // Determine event propagation path in advance, per W3C events spec (#9951)
3188- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
3189- eventPath = [[ elem, special.bindType || type ]];
3190- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
3191-
3192- bubbleType = special.delegateType || type;
3193- cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
3194- old = null;
3195- for ( ; cur; cur = cur.parentNode ) {
3196- eventPath.push([ cur, bubbleType ]);
3197- old = cur;
3198- }
3199-
3200- // Only add window if we got to document (e.g., not plain obj or detached DOM)
3201- if ( old && old === elem.ownerDocument ) {
3202- eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
3203- }
3204- }
3205-
3206- // Fire handlers on the event path
3207- for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
3208-
3209- cur = eventPath[i][0];
3210- event.type = eventPath[i][1];
3211-
3212- handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
3213- if ( handle ) {
3214- handle.apply( cur, data );
3215- }
3216- // Note that this is a bare JS function and not a jQuery handler
3217- handle = ontype && cur[ ontype ];
3218- if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
3219- event.preventDefault();
3220- }
3221- }
3222- event.type = type;
3223-
3224- // If nobody prevented the default action, do it now
3225- if ( !onlyHandlers && !event.isDefaultPrevented() ) {
3226-
3227- if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
3228- !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
3229-
3230- // Call a native DOM method on the target with the same name name as the event.
3231- // Can't use an .isFunction() check here because IE6/7 fails that test.
3232- // Don't do default actions on window, that's where global variables be (#6170)
3233- // IE<9 dies on focus/blur to hidden element (#1486)
3234- if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
3235-
3236- // Don't re-trigger an onFOO event when we call its FOO() method
3237- old = elem[ ontype ];
3238-
3239- if ( old ) {
3240- elem[ ontype ] = null;
3241- }
3242-
3243- // Prevent re-triggering of the same event, since we already bubbled it above
3244- jQuery.event.triggered = type;
3245- elem[ type ]();
3246- jQuery.event.triggered = undefined;
3247-
3248- if ( old ) {
3249- elem[ ontype ] = old;
3250- }
3251- }
3252- }
3253- }
3254-
3255- return event.result;
3256- },
3257-
3258- dispatch: function( event ) {
3259-
3260- // Make a writable jQuery.Event from the native event object
3261- event = jQuery.event.fix( event || window.event );
3262-
3263- var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
3264- delegateCount = handlers.delegateCount,
3265- args = [].slice.call( arguments, 0 ),
3266- run_all = !event.exclusive && !event.namespace,
3267- special = jQuery.event.special[ event.type ] || {},
3268- handlerQueue = [],
3269- i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
3270-
3271- // Use the fix-ed jQuery.Event rather than the (read-only) native event
3272- args[0] = event;
3273- event.delegateTarget = this;
3274-
3275- // Call the preDispatch hook for the mapped type, and let it bail if desired
3276- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
3277- return;
3278- }
3279-
3280- // Determine handlers that should run if there are delegated events
3281- // Avoid non-left-click bubbling in Firefox (#3861)
3282- if ( delegateCount && !(event.button && event.type === "click") ) {
3283-
3284- // Pregenerate a single jQuery object for reuse with .is()
3285- jqcur = jQuery(this);
3286- jqcur.context = this.ownerDocument || this;
3287-
3288- for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
3289-
3290- // Don't process events on disabled elements (#6911, #8165)
3291- if ( cur.disabled !== true ) {
3292- selMatch = {};
3293- matches = [];
3294- jqcur[0] = cur;
3295- for ( i = 0; i < delegateCount; i++ ) {
3296- handleObj = handlers[ i ];
3297- sel = handleObj.selector;
3298-
3299- if ( selMatch[ sel ] === undefined ) {
3300- selMatch[ sel ] = (
3301- handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
3302- );
3303- }
3304- if ( selMatch[ sel ] ) {
3305- matches.push( handleObj );
3306- }
3307- }
3308- if ( matches.length ) {
3309- handlerQueue.push({ elem: cur, matches: matches });
3310- }
3311- }
3312- }
3313- }
3314-
3315- // Add the remaining (directly-bound) handlers
3316- if ( handlers.length > delegateCount ) {
3317- handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
3318- }
3319-
3320- // Run delegates first; they may want to stop propagation beneath us
3321- for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
3322- matched = handlerQueue[ i ];
3323- event.currentTarget = matched.elem;
3324-
3325- for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
3326- handleObj = matched.matches[ j ];
3327-
3328- // Triggered event must either 1) be non-exclusive and have no namespace, or
3329- // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
3330- if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
3331-
3332- event.data = handleObj.data;
3333- event.handleObj = handleObj;
3334-
3335- ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
3336- .apply( matched.elem, args );
3337-
3338- if ( ret !== undefined ) {
3339- event.result = ret;
3340- if ( ret === false ) {
3341- event.preventDefault();
3342- event.stopPropagation();
3343- }
3344- }
3345- }
3346- }
3347- }
3348-
3349- // Call the postDispatch hook for the mapped type
3350- if ( special.postDispatch ) {
3351- special.postDispatch.call( this, event );
3352- }
3353-
3354- return event.result;
3355- },
3356-
3357- // Includes some event props shared by KeyEvent and MouseEvent
3358- // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
3359- props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
3360-
3361- fixHooks: {},
3362-
3363- keyHooks: {
3364- props: "char charCode key keyCode".split(" "),
3365- filter: function( event, original ) {
3366-
3367- // Add which for key events
3368- if ( event.which == null ) {
3369- event.which = original.charCode != null ? original.charCode : original.keyCode;
3370- }
3371-
3372- return event;
3373- }
3374- },
3375-
3376- mouseHooks: {
3377- props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
3378- filter: function( event, original ) {
3379- var eventDoc, doc, body,
3380- button = original.button,
3381- fromElement = original.fromElement;
3382-
3383- // Calculate pageX/Y if missing and clientX/Y available
3384- if ( event.pageX == null && original.clientX != null ) {
3385- eventDoc = event.target.ownerDocument || document;
3386- doc = eventDoc.documentElement;
3387- body = eventDoc.body;
3388-
3389- event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
3390- event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
3391- }
3392-
3393- // Add relatedTarget, if necessary
3394- if ( !event.relatedTarget && fromElement ) {
3395- event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
3396- }
3397-
3398- // Add which for click: 1 === left; 2 === middle; 3 === right
3399- // Note: button is not normalized, so don't use it
3400- if ( !event.which && button !== undefined ) {
3401- event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
3402- }
3403-
3404- return event;
3405- }
3406- },
3407-
3408- fix: function( event ) {
3409- if ( event[ jQuery.expando ] ) {
3410- return event;
3411- }
3412-
3413- // Create a writable copy of the event object and normalize some properties
3414- var i, prop,
3415- originalEvent = event,
3416- fixHook = jQuery.event.fixHooks[ event.type ] || {},
3417- copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
3418-
3419- event = jQuery.Event( originalEvent );
3420-
3421- for ( i = copy.length; i; ) {
3422- prop = copy[ --i ];
3423- event[ prop ] = originalEvent[ prop ];
3424- }
3425-
3426- // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
3427- if ( !event.target ) {
3428- event.target = originalEvent.srcElement || document;
3429- }
3430-
3431- // Target should not be a text node (#504, Safari)
3432- if ( event.target.nodeType === 3 ) {
3433- event.target = event.target.parentNode;
3434- }
3435-
3436- // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
3437- if ( event.metaKey === undefined ) {
3438- event.metaKey = event.ctrlKey;
3439- }
3440-
3441- return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
3442- },
3443-
3444- special: {
3445- ready: {
3446- // Make sure the ready event is setup
3447- setup: jQuery.bindReady
3448- },
3449-
3450- load: {
3451- // Prevent triggered image.load events from bubbling to window.load
3452- noBubble: true
3453- },
3454-
3455- focus: {
3456- delegateType: "focusin"
3457- },
3458- blur: {
3459- delegateType: "focusout"
3460- },
3461-
3462- beforeunload: {
3463- setup: function( data, namespaces, eventHandle ) {
3464- // We only want to do this special case on windows
3465- if ( jQuery.isWindow( this ) ) {
3466- this.onbeforeunload = eventHandle;
3467- }
3468- },
3469-
3470- teardown: function( namespaces, eventHandle ) {
3471- if ( this.onbeforeunload === eventHandle ) {
3472- this.onbeforeunload = null;
3473- }
3474- }
3475- }
3476- },
3477-
3478- simulate: function( type, elem, event, bubble ) {
3479- // Piggyback on a donor event to simulate a different one.
3480- // Fake originalEvent to avoid donor's stopPropagation, but if the
3481- // simulated event prevents default then we do the same on the donor.
3482- var e = jQuery.extend(
3483- new jQuery.Event(),
3484- event,
3485- { type: type,
3486- isSimulated: true,
3487- originalEvent: {}
3488- }
3489- );
3490- if ( bubble ) {
3491- jQuery.event.trigger( e, null, elem );
3492- } else {
3493- jQuery.event.dispatch.call( elem, e );
3494- }
3495- if ( e.isDefaultPrevented() ) {
3496- event.preventDefault();
3497- }
3498- }
3499-};
3500-
3501-// Some plugins are using, but it's undocumented/deprecated and will be removed.
3502-// The 1.7 special event interface should provide all the hooks needed now.
3503-jQuery.event.handle = jQuery.event.dispatch;
3504-
3505-jQuery.removeEvent = document.removeEventListener ?
3506- function( elem, type, handle ) {
3507- if ( elem.removeEventListener ) {
3508- elem.removeEventListener( type, handle, false );
3509- }
3510- } :
3511- function( elem, type, handle ) {
3512- if ( elem.detachEvent ) {
3513- elem.detachEvent( "on" + type, handle );
3514- }
3515- };
3516-
3517-jQuery.Event = function( src, props ) {
3518- // Allow instantiation without the 'new' keyword
3519- if ( !(this instanceof jQuery.Event) ) {
3520- return new jQuery.Event( src, props );
3521- }
3522-
3523- // Event object
3524- if ( src && src.type ) {
3525- this.originalEvent = src;
3526- this.type = src.type;
3527-
3528- // Events bubbling up the document may have been marked as prevented
3529- // by a handler lower down the tree; reflect the correct value.
3530- this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
3531- src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
3532-
3533- // Event type
3534- } else {
3535- this.type = src;
3536- }
3537-
3538- // Put explicitly provided properties onto the event object
3539- if ( props ) {
3540- jQuery.extend( this, props );
3541- }
3542-
3543- // Create a timestamp if incoming event doesn't have one
3544- this.timeStamp = src && src.timeStamp || jQuery.now();
3545-
3546- // Mark it as fixed
3547- this[ jQuery.expando ] = true;
3548-};
3549-
3550-function returnFalse() {
3551- return false;
3552-}
3553-function returnTrue() {
3554- return true;
3555-}
3556-
3557-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
3558-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
3559-jQuery.Event.prototype = {
3560- preventDefault: function() {
3561- this.isDefaultPrevented = returnTrue;
3562-
3563- var e = this.originalEvent;
3564- if ( !e ) {
3565- return;
3566- }
3567-
3568- // if preventDefault exists run it on the original event
3569- if ( e.preventDefault ) {
3570- e.preventDefault();
3571-
3572- // otherwise set the returnValue property of the original event to false (IE)
3573- } else {
3574- e.returnValue = false;
3575- }
3576- },
3577- stopPropagation: function() {
3578- this.isPropagationStopped = returnTrue;
3579-
3580- var e = this.originalEvent;
3581- if ( !e ) {
3582- return;
3583- }
3584- // if stopPropagation exists run it on the original event
3585- if ( e.stopPropagation ) {
3586- e.stopPropagation();
3587- }
3588- // otherwise set the cancelBubble property of the original event to true (IE)
3589- e.cancelBubble = true;
3590- },
3591- stopImmediatePropagation: function() {
3592- this.isImmediatePropagationStopped = returnTrue;
3593- this.stopPropagation();
3594- },
3595- isDefaultPrevented: returnFalse,
3596- isPropagationStopped: returnFalse,
3597- isImmediatePropagationStopped: returnFalse
3598-};
3599-
3600-// Create mouseenter/leave events using mouseover/out and event-time checks
3601-jQuery.each({
3602- mouseenter: "mouseover",
3603- mouseleave: "mouseout"
3604-}, function( orig, fix ) {
3605- jQuery.event.special[ orig ] = {
3606- delegateType: fix,
3607- bindType: fix,
3608-
3609- handle: function( event ) {
3610- var target = this,
3611- related = event.relatedTarget,
3612- handleObj = event.handleObj,
3613- selector = handleObj.selector,
3614- ret;
3615-
3616- // For mousenter/leave call the handler if related is outside the target.
3617- // NB: No relatedTarget if the mouse left/entered the browser window
3618- if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
3619- event.type = handleObj.origType;
3620- ret = handleObj.handler.apply( this, arguments );
3621- event.type = fix;
3622- }
3623- return ret;
3624- }
3625- };
3626-});
3627-
3628-// IE submit delegation
3629-if ( !jQuery.support.submitBubbles ) {
3630-
3631- jQuery.event.special.submit = {
3632- setup: function() {
3633- // Only need this for delegated form submit events
3634- if ( jQuery.nodeName( this, "form" ) ) {
3635- return false;
3636- }
3637-
3638- // Lazy-add a submit handler when a descendant form may potentially be submitted
3639- jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
3640- // Node name check avoids a VML-related crash in IE (#9807)
3641- var elem = e.target,
3642- form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
3643- if ( form && !form._submit_attached ) {
3644- jQuery.event.add( form, "submit._submit", function( event ) {
3645- event._submit_bubble = true;
3646- });
3647- form._submit_attached = true;
3648- }
3649- });
3650- // return undefined since we don't need an event listener
3651- },
3652-
3653- postDispatch: function( event ) {
3654- // If form was submitted by the user, bubble the event up the tree
3655- if ( event._submit_bubble ) {
3656- delete event._submit_bubble;
3657- if ( this.parentNode && !event.isTrigger ) {
3658- jQuery.event.simulate( "submit", this.parentNode, event, true );
3659- }
3660- }
3661- },
3662-
3663- teardown: function() {
3664- // Only need this for delegated form submit events
3665- if ( jQuery.nodeName( this, "form" ) ) {
3666- return false;
3667- }
3668-
3669- // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
3670- jQuery.event.remove( this, "._submit" );
3671- }
3672- };
3673-}
3674-
3675-// IE change delegation and checkbox/radio fix
3676-if ( !jQuery.support.changeBubbles ) {
3677-
3678- jQuery.event.special.change = {
3679-
3680- setup: function() {
3681-
3682- if ( rformElems.test( this.nodeName ) ) {
3683- // IE doesn't fire change on a check/radio until blur; trigger it on click
3684- // after a propertychange. Eat the blur-change in special.change.handle.
3685- // This still fires onchange a second time for check/radio after blur.
3686- if ( this.type === "checkbox" || this.type === "radio" ) {
3687- jQuery.event.add( this, "propertychange._change", function( event ) {
3688- if ( event.originalEvent.propertyName === "checked" ) {
3689- this._just_changed = true;
3690- }
3691- });
3692- jQuery.event.add( this, "click._change", function( event ) {
3693- if ( this._just_changed && !event.isTrigger ) {
3694- this._just_changed = false;
3695- jQuery.event.simulate( "change", this, event, true );
3696- }
3697- });
3698- }
3699- return false;
3700- }
3701- // Delegated event; lazy-add a change handler on descendant inputs
3702- jQuery.event.add( this, "beforeactivate._change", function( e ) {
3703- var elem = e.target;
3704-
3705- if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
3706- jQuery.event.add( elem, "change._change", function( event ) {
3707- if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
3708- jQuery.event.simulate( "change", this.parentNode, event, true );
3709- }
3710- });
3711- elem._change_attached = true;
3712- }
3713- });
3714- },
3715-
3716- handle: function( event ) {
3717- var elem = event.target;
3718-
3719- // Swallow native change events from checkbox/radio, we already triggered them above
3720- if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
3721- return event.handleObj.handler.apply( this, arguments );
3722- }
3723- },
3724-
3725- teardown: function() {
3726- jQuery.event.remove( this, "._change" );
3727-
3728- return rformElems.test( this.nodeName );
3729- }
3730- };
3731-}
3732-
3733-// Create "bubbling" focus and blur events
3734-if ( !jQuery.support.focusinBubbles ) {
3735- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
3736-
3737- // Attach a single capturing handler while someone wants focusin/focusout
3738- var attaches = 0,
3739- handler = function( event ) {
3740- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
3741- };
3742-
3743- jQuery.event.special[ fix ] = {
3744- setup: function() {
3745- if ( attaches++ === 0 ) {
3746- document.addEventListener( orig, handler, true );
3747- }
3748- },
3749- teardown: function() {
3750- if ( --attaches === 0 ) {
3751- document.removeEventListener( orig, handler, true );
3752- }
3753- }
3754- };
3755- });
3756-}
3757-
3758-jQuery.fn.extend({
3759-
3760- on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
3761- var origFn, type;
3762-
3763- // Types can be a map of types/handlers
3764- if ( typeof types === "object" ) {
3765- // ( types-Object, selector, data )
3766- if ( typeof selector !== "string" ) { // && selector != null
3767- // ( types-Object, data )
3768- data = data || selector;
3769- selector = undefined;
3770- }
3771- for ( type in types ) {
3772- this.on( type, selector, data, types[ type ], one );
3773- }
3774- return this;
3775- }
3776-
3777- if ( data == null && fn == null ) {
3778- // ( types, fn )
3779- fn = selector;
3780- data = selector = undefined;
3781- } else if ( fn == null ) {
3782- if ( typeof selector === "string" ) {
3783- // ( types, selector, fn )
3784- fn = data;
3785- data = undefined;
3786- } else {
3787- // ( types, data, fn )
3788- fn = data;
3789- data = selector;
3790- selector = undefined;
3791- }
3792- }
3793- if ( fn === false ) {
3794- fn = returnFalse;
3795- } else if ( !fn ) {
3796- return this;
3797- }
3798-
3799- if ( one === 1 ) {
3800- origFn = fn;
3801- fn = function( event ) {
3802- // Can use an empty set, since event contains the info
3803- jQuery().off( event );
3804- return origFn.apply( this, arguments );
3805- };
3806- // Use same guid so caller can remove using origFn
3807- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
3808- }
3809- return this.each( function() {
3810- jQuery.event.add( this, types, fn, data, selector );
3811- });
3812- },
3813- one: function( types, selector, data, fn ) {
3814- return this.on( types, selector, data, fn, 1 );
3815- },
3816- off: function( types, selector, fn ) {
3817- if ( types && types.preventDefault && types.handleObj ) {
3818- // ( event ) dispatched jQuery.Event
3819- var handleObj = types.handleObj;
3820- jQuery( types.delegateTarget ).off(
3821- handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
3822- handleObj.selector,
3823- handleObj.handler
3824- );
3825- return this;
3826- }
3827- if ( typeof types === "object" ) {
3828- // ( types-object [, selector] )
3829- for ( var type in types ) {
3830- this.off( type, selector, types[ type ] );
3831- }
3832- return this;
3833- }
3834- if ( selector === false || typeof selector === "function" ) {
3835- // ( types [, fn] )
3836- fn = selector;
3837- selector = undefined;
3838- }
3839- if ( fn === false ) {
3840- fn = returnFalse;
3841- }
3842- return this.each(function() {
3843- jQuery.event.remove( this, types, fn, selector );
3844- });
3845- },
3846-
3847- bind: function( types, data, fn ) {
3848- return this.on( types, null, data, fn );
3849- },
3850- unbind: function( types, fn ) {
3851- return this.off( types, null, fn );
3852- },
3853-
3854- live: function( types, data, fn ) {
3855- jQuery( this.context ).on( types, this.selector, data, fn );
3856- return this;
3857- },
3858- die: function( types, fn ) {
3859- jQuery( this.context ).off( types, this.selector || "**", fn );
3860- return this;
3861- },
3862-
3863- delegate: function( selector, types, data, fn ) {
3864- return this.on( types, selector, data, fn );
3865- },
3866- undelegate: function( selector, types, fn ) {
3867- // ( namespace ) or ( selector, types [, fn] )
3868- return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
3869- },
3870-
3871- trigger: function( type, data ) {
3872- return this.each(function() {
3873- jQuery.event.trigger( type, data, this );
3874- });
3875- },
3876- triggerHandler: function( type, data ) {
3877- if ( this[0] ) {
3878- return jQuery.event.trigger( type, data, this[0], true );
3879- }
3880- },
3881-
3882- toggle: function( fn ) {
3883- // Save reference to arguments for access in closure
3884- var args = arguments,
3885- guid = fn.guid || jQuery.guid++,
3886- i = 0,
3887- toggler = function( event ) {
3888- // Figure out which function to execute
3889- var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
3890- jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
3891-
3892- // Make sure that clicks stop
3893- event.preventDefault();
3894-
3895- // and execute the function
3896- return args[ lastToggle ].apply( this, arguments ) || false;
3897- };
3898-
3899- // link all the functions, so any of them can unbind this click handler
3900- toggler.guid = guid;
3901- while ( i < args.length ) {
3902- args[ i++ ].guid = guid;
3903- }
3904-
3905- return this.click( toggler );
3906- },
3907-
3908- hover: function( fnOver, fnOut ) {
3909- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
3910- }
3911-});
3912-
3913-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
3914- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
3915- "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
3916-
3917- // Handle event binding
3918- jQuery.fn[ name ] = function( data, fn ) {
3919- if ( fn == null ) {
3920- fn = data;
3921- data = null;
3922- }
3923-
3924- return arguments.length > 0 ?
3925- this.on( name, null, data, fn ) :
3926- this.trigger( name );
3927- };
3928-
3929- if ( jQuery.attrFn ) {
3930- jQuery.attrFn[ name ] = true;
3931- }
3932-
3933- if ( rkeyEvent.test( name ) ) {
3934- jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
3935- }
3936-
3937- if ( rmouseEvent.test( name ) ) {
3938- jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
3939- }
3940-});
3941-
3942-
3943-
3944-/*!
3945- * Sizzle CSS Selector Engine
3946- * Copyright 2011, The Dojo Foundation
3947- * Released under the MIT, BSD, and GPL Licenses.
3948- * More information: http://sizzlejs.com/
3949- */
3950-(function(){
3951-
3952-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
3953- expando = "sizcache" + (Math.random() + '').replace('.', ''),
3954- done = 0,
3955- toString = Object.prototype.toString,
3956- hasDuplicate = false,
3957- baseHasDuplicate = true,
3958- rBackslash = /\\/g,
3959- rReturn = /\r\n/g,
3960- rNonWord = /\W/;
3961-
3962-// Here we check if the JavaScript engine is using some sort of
3963-// optimization where it does not always call our comparision
3964-// function. If that is the case, discard the hasDuplicate value.
3965-// Thus far that includes Google Chrome.
3966-[0, 0].sort(function() {
3967- baseHasDuplicate = false;
3968- return 0;
3969-});
3970-
3971-var Sizzle = function( selector, context, results, seed ) {
3972- results = results || [];
3973- context = context || document;
3974-
3975- var origContext = context;
3976-
3977- if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
3978- return [];
3979- }
3980-
3981- if ( !selector || typeof selector !== "string" ) {
3982- return results;
3983- }
3984-
3985- var m, set, checkSet, extra, ret, cur, pop, i,
3986- prune = true,
3987- contextXML = Sizzle.isXML( context ),
3988- parts = [],
3989- soFar = selector;
3990-
3991- // Reset the position of the chunker regexp (start from head)
3992- do {
3993- chunker.exec( "" );
3994- m = chunker.exec( soFar );
3995-
3996- if ( m ) {
3997- soFar = m[3];
3998-
3999- parts.push( m[1] );
4000-
4001- if ( m[2] ) {
4002- extra = m[3];
4003- break;
4004- }
4005- }
4006- } while ( m );
4007-
4008- if ( parts.length > 1 && origPOS.exec( selector ) ) {
4009-
4010- if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
4011- set = posProcess( parts[0] + parts[1], context, seed );
4012-
4013- } else {
4014- set = Expr.relative[ parts[0] ] ?
4015- [ context ] :
4016- Sizzle( parts.shift(), context );
4017-
4018- while ( parts.length ) {
4019- selector = parts.shift();
4020-
4021- if ( Expr.relative[ selector ] ) {
4022- selector += parts.shift();
4023- }
4024-
4025- set = posProcess( selector, set, seed );
4026- }
4027- }
4028-
4029- } else {
4030- // Take a shortcut and set the context if the root selector is an ID
4031- // (but not if it'll be faster if the inner selector is an ID)
4032- if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
4033- Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
4034-
4035- ret = Sizzle.find( parts.shift(), context, contextXML );
4036- context = ret.expr ?
4037- Sizzle.filter( ret.expr, ret.set )[0] :
4038- ret.set[0];
4039- }
4040-
4041- if ( context ) {
4042- ret = seed ?
4043- { expr: parts.pop(), set: makeArray(seed) } :
4044- Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
4045-
4046- set = ret.expr ?
4047- Sizzle.filter( ret.expr, ret.set ) :
4048- ret.set;
4049-
4050- if ( parts.length > 0 ) {
4051- checkSet = makeArray( set );
4052-
4053- } else {
4054- prune = false;
4055- }
4056-
4057- while ( parts.length ) {
4058- cur = parts.pop();
4059- pop = cur;
4060-
4061- if ( !Expr.relative[ cur ] ) {
4062- cur = "";
4063- } else {
4064- pop = parts.pop();
4065- }
4066-
4067- if ( pop == null ) {
4068- pop = context;
4069- }
4070-
4071- Expr.relative[ cur ]( checkSet, pop, contextXML );
4072- }
4073-
4074- } else {
4075- checkSet = parts = [];
4076- }
4077- }
4078-
4079- if ( !checkSet ) {
4080- checkSet = set;
4081- }
4082-
4083- if ( !checkSet ) {
4084- Sizzle.error( cur || selector );
4085- }
4086-
4087- if ( toString.call(checkSet) === "[object Array]" ) {
4088- if ( !prune ) {
4089- results.push.apply( results, checkSet );
4090-
4091- } else if ( context && context.nodeType === 1 ) {
4092- for ( i = 0; checkSet[i] != null; i++ ) {
4093- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
4094- results.push( set[i] );
4095- }
4096- }
4097-
4098- } else {
4099- for ( i = 0; checkSet[i] != null; i++ ) {
4100- if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
4101- results.push( set[i] );
4102- }
4103- }
4104- }
4105-
4106- } else {
4107- makeArray( checkSet, results );
4108- }
4109-
4110- if ( extra ) {
4111- Sizzle( extra, origContext, results, seed );
4112- Sizzle.uniqueSort( results );
4113- }
4114-
4115- return results;
4116-};
4117-
4118-Sizzle.uniqueSort = function( results ) {
4119- if ( sortOrder ) {
4120- hasDuplicate = baseHasDuplicate;
4121- results.sort( sortOrder );
4122-
4123- if ( hasDuplicate ) {
4124- for ( var i = 1; i < results.length; i++ ) {
4125- if ( results[i] === results[ i - 1 ] ) {
4126- results.splice( i--, 1 );
4127- }
4128- }
4129- }
4130- }
4131-
4132- return results;
4133-};
4134-
4135-Sizzle.matches = function( expr, set ) {
4136- return Sizzle( expr, null, null, set );
4137-};
4138-
4139-Sizzle.matchesSelector = function( node, expr ) {
4140- return Sizzle( expr, null, null, [node] ).length > 0;
4141-};
4142-
4143-Sizzle.find = function( expr, context, isXML ) {
4144- var set, i, len, match, type, left;
4145-
4146- if ( !expr ) {
4147- return [];
4148- }
4149-
4150- for ( i = 0, len = Expr.order.length; i < len; i++ ) {
4151- type = Expr.order[i];
4152-
4153- if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
4154- left = match[1];
4155- match.splice( 1, 1 );
4156-
4157- if ( left.substr( left.length - 1 ) !== "\\" ) {
4158- match[1] = (match[1] || "").replace( rBackslash, "" );
4159- set = Expr.find[ type ]( match, context, isXML );
4160-
4161- if ( set != null ) {
4162- expr = expr.replace( Expr.match[ type ], "" );
4163- break;
4164- }
4165- }
4166- }
4167- }
4168-
4169- if ( !set ) {
4170- set = typeof context.getElementsByTagName !== "undefined" ?
4171- context.getElementsByTagName( "*" ) :
4172- [];
4173- }
4174-
4175- return { set: set, expr: expr };
4176-};
4177-
4178-Sizzle.filter = function( expr, set, inplace, not ) {
4179- var match, anyFound,
4180- type, found, item, filter, left,
4181- i, pass,
4182- old = expr,
4183- result = [],
4184- curLoop = set,
4185- isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
4186-
4187- while ( expr && set.length ) {
4188- for ( type in Expr.filter ) {
4189- if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
4190- filter = Expr.filter[ type ];
4191- left = match[1];
4192-
4193- anyFound = false;
4194-
4195- match.splice(1,1);
4196-
4197- if ( left.substr( left.length - 1 ) === "\\" ) {
4198- continue;
4199- }
4200-
4201- if ( curLoop === result ) {
4202- result = [];
4203- }
4204-
4205- if ( Expr.preFilter[ type ] ) {
4206- match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
4207-
4208- if ( !match ) {
4209- anyFound = found = true;
4210-
4211- } else if ( match === true ) {
4212- continue;
4213- }
4214- }
4215-
4216- if ( match ) {
4217- for ( i = 0; (item = curLoop[i]) != null; i++ ) {
4218- if ( item ) {
4219- found = filter( item, match, i, curLoop );
4220- pass = not ^ found;
4221-
4222- if ( inplace && found != null ) {
4223- if ( pass ) {
4224- anyFound = true;
4225-
4226- } else {
4227- curLoop[i] = false;
4228- }
4229-
4230- } else if ( pass ) {
4231- result.push( item );
4232- anyFound = true;
4233- }
4234- }
4235- }
4236- }
4237-
4238- if ( found !== undefined ) {
4239- if ( !inplace ) {
4240- curLoop = result;
4241- }
4242-
4243- expr = expr.replace( Expr.match[ type ], "" );
4244-
4245- if ( !anyFound ) {
4246- return [];
4247- }
4248-
4249- break;
4250- }
4251- }
4252- }
4253-
4254- // Improper expression
4255- if ( expr === old ) {
4256- if ( anyFound == null ) {
4257- Sizzle.error( expr );
4258-
4259- } else {
4260- break;
4261- }
4262- }
4263-
4264- old = expr;
4265- }
4266-
4267- return curLoop;
4268-};
4269-
4270-Sizzle.error = function( msg ) {
4271- throw new Error( "Syntax error, unrecognized expression: " + msg );
4272-};
4273-
4274-/**
4275- * Utility function for retreiving the text value of an array of DOM nodes
4276- * @param {Array|Element} elem
4277- */
4278-var getText = Sizzle.getText = function( elem ) {
4279- var i, node,
4280- nodeType = elem.nodeType,
4281- ret = "";
4282-
4283- if ( nodeType ) {
4284- if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
4285- // Use textContent || innerText for elements
4286- if ( typeof elem.textContent === 'string' ) {
4287- return elem.textContent;
4288- } else if ( typeof elem.innerText === 'string' ) {
4289- // Replace IE's carriage returns
4290- return elem.innerText.replace( rReturn, '' );
4291- } else {
4292- // Traverse it's children
4293- for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
4294- ret += getText( elem );
4295- }
4296- }
4297- } else if ( nodeType === 3 || nodeType === 4 ) {
4298- return elem.nodeValue;
4299- }
4300- } else {
4301-
4302- // If no nodeType, this is expected to be an array
4303- for ( i = 0; (node = elem[i]); i++ ) {
4304- // Do not traverse comment nodes
4305- if ( node.nodeType !== 8 ) {
4306- ret += getText( node );
4307- }
4308- }
4309- }
4310- return ret;
4311-};
4312-
4313-var Expr = Sizzle.selectors = {
4314- order: [ "ID", "NAME", "TAG" ],
4315-
4316- match: {
4317- ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
4318- CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
4319- NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
4320- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
4321- TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
4322- CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
4323- POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
4324- PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
4325- },
4326-
4327- leftMatch: {},
4328-
4329- attrMap: {
4330- "class": "className",
4331- "for": "htmlFor"
4332- },
4333-
4334- attrHandle: {
4335- href: function( elem ) {
4336- return elem.getAttribute( "href" );
4337- },
4338- type: function( elem ) {
4339- return elem.getAttribute( "type" );
4340- }
4341- },
4342-
4343- relative: {
4344- "+": function(checkSet, part){
4345- var isPartStr = typeof part === "string",
4346- isTag = isPartStr && !rNonWord.test( part ),
4347- isPartStrNotTag = isPartStr && !isTag;
4348-
4349- if ( isTag ) {
4350- part = part.toLowerCase();
4351- }
4352-
4353- for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
4354- if ( (elem = checkSet[i]) ) {
4355- while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
4356-
4357- checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
4358- elem || false :
4359- elem === part;
4360- }
4361- }
4362-
4363- if ( isPartStrNotTag ) {
4364- Sizzle.filter( part, checkSet, true );
4365- }
4366- },
4367-
4368- ">": function( checkSet, part ) {
4369- var elem,
4370- isPartStr = typeof part === "string",
4371- i = 0,
4372- l = checkSet.length;
4373-
4374- if ( isPartStr && !rNonWord.test( part ) ) {
4375- part = part.toLowerCase();
4376-
4377- for ( ; i < l; i++ ) {
4378- elem = checkSet[i];
4379-
4380- if ( elem ) {
4381- var parent = elem.parentNode;
4382- checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
4383- }
4384- }
4385-
4386- } else {
4387- for ( ; i < l; i++ ) {
4388- elem = checkSet[i];
4389-
4390- if ( elem ) {
4391- checkSet[i] = isPartStr ?
4392- elem.parentNode :
4393- elem.parentNode === part;
4394- }
4395- }
4396-
4397- if ( isPartStr ) {
4398- Sizzle.filter( part, checkSet, true );
4399- }
4400- }
4401- },
4402-
4403- "": function(checkSet, part, isXML){
4404- var nodeCheck,
4405- doneName = done++,
4406- checkFn = dirCheck;
4407-
4408- if ( typeof part === "string" && !rNonWord.test( part ) ) {
4409- part = part.toLowerCase();
4410- nodeCheck = part;
4411- checkFn = dirNodeCheck;
4412- }
4413-
4414- checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
4415- },
4416-
4417- "~": function( checkSet, part, isXML ) {
4418- var nodeCheck,
4419- doneName = done++,
4420- checkFn = dirCheck;
4421-
4422- if ( typeof part === "string" && !rNonWord.test( part ) ) {
4423- part = part.toLowerCase();
4424- nodeCheck = part;
4425- checkFn = dirNodeCheck;
4426- }
4427-
4428- checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
4429- }
4430- },
4431-
4432- find: {
4433- ID: function( match, context, isXML ) {
4434- if ( typeof context.getElementById !== "undefined" && !isXML ) {
4435- var m = context.getElementById(match[1]);
4436- // Check parentNode to catch when Blackberry 4.6 returns
4437- // nodes that are no longer in the document #6963
4438- return m && m.parentNode ? [m] : [];
4439- }
4440- },
4441-
4442- NAME: function( match, context ) {
4443- if ( typeof context.getElementsByName !== "undefined" ) {
4444- var ret = [],
4445- results = context.getElementsByName( match[1] );
4446-
4447- for ( var i = 0, l = results.length; i < l; i++ ) {
4448- if ( results[i].getAttribute("name") === match[1] ) {
4449- ret.push( results[i] );
4450- }
4451- }
4452-
4453- return ret.length === 0 ? null : ret;
4454- }
4455- },
4456-
4457- TAG: function( match, context ) {
4458- if ( typeof context.getElementsByTagName !== "undefined" ) {
4459- return context.getElementsByTagName( match[1] );
4460- }
4461- }
4462- },
4463- preFilter: {
4464- CLASS: function( match, curLoop, inplace, result, not, isXML ) {
4465- match = " " + match[1].replace( rBackslash, "" ) + " ";
4466-
4467- if ( isXML ) {
4468- return match;
4469- }
4470-
4471- for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
4472- if ( elem ) {
4473- if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
4474- if ( !inplace ) {
4475- result.push( elem );
4476- }
4477-
4478- } else if ( inplace ) {
4479- curLoop[i] = false;
4480- }
4481- }
4482- }
4483-
4484- return false;
4485- },
4486-
4487- ID: function( match ) {
4488- return match[1].replace( rBackslash, "" );
4489- },
4490-
4491- TAG: function( match, curLoop ) {
4492- return match[1].replace( rBackslash, "" ).toLowerCase();
4493- },
4494-
4495- CHILD: function( match ) {
4496- if ( match[1] === "nth" ) {
4497- if ( !match[2] ) {
4498- Sizzle.error( match[0] );
4499- }
4500-
4501- match[2] = match[2].replace(/^\+|\s*/g, '');
4502-
4503- // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
4504- var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
4505- match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
4506- !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
4507-
4508- // calculate the numbers (first)n+(last) including if they are negative
4509- match[2] = (test[1] + (test[2] || 1)) - 0;
4510- match[3] = test[3] - 0;
4511- }
4512- else if ( match[2] ) {
4513- Sizzle.error( match[0] );
4514- }
4515-
4516- // TODO: Move to normal caching system
4517- match[0] = done++;
4518-
4519- return match;
4520- },
4521-
4522- ATTR: function( match, curLoop, inplace, result, not, isXML ) {
4523- var name = match[1] = match[1].replace( rBackslash, "" );
4524-
4525- if ( !isXML && Expr.attrMap[name] ) {
4526- match[1] = Expr.attrMap[name];
4527- }
4528-
4529- // Handle if an un-quoted value was used
4530- match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
4531-
4532- if ( match[2] === "~=" ) {
4533- match[4] = " " + match[4] + " ";
4534- }
4535-
4536- return match;
4537- },
4538-
4539- PSEUDO: function( match, curLoop, inplace, result, not ) {
4540- if ( match[1] === "not" ) {
4541- // If we're dealing with a complex expression, or a simple one
4542- if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
4543- match[3] = Sizzle(match[3], null, null, curLoop);
4544-
4545- } else {
4546- var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
4547-
4548- if ( !inplace ) {
4549- result.push.apply( result, ret );
4550- }
4551-
4552- return false;
4553- }
4554-
4555- } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
4556- return true;
4557- }
4558-
4559- return match;
4560- },
4561-
4562- POS: function( match ) {
4563- match.unshift( true );
4564-
4565- return match;
4566- }
4567- },
4568-
4569- filters: {
4570- enabled: function( elem ) {
4571- return elem.disabled === false && elem.type !== "hidden";
4572- },
4573-
4574- disabled: function( elem ) {
4575- return elem.disabled === true;
4576- },
4577-
4578- checked: function( elem ) {
4579- return elem.checked === true;
4580- },
4581-
4582- selected: function( elem ) {
4583- // Accessing this property makes selected-by-default
4584- // options in Safari work properly
4585- if ( elem.parentNode ) {
4586- elem.parentNode.selectedIndex;
4587- }
4588-
4589- return elem.selected === true;
4590- },
4591-
4592- parent: function( elem ) {
4593- return !!elem.firstChild;
4594- },
4595-
4596- empty: function( elem ) {
4597- return !elem.firstChild;
4598- },
4599-
4600- has: function( elem, i, match ) {
4601- return !!Sizzle( match[3], elem ).length;
4602- },
4603-
4604- header: function( elem ) {
4605- return (/h\d/i).test( elem.nodeName );
4606- },
4607-
4608- text: function( elem ) {
4609- var attr = elem.getAttribute( "type" ), type = elem.type;
4610- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
4611- // use getAttribute instead to test this case
4612- return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
4613- },
4614-
4615- radio: function( elem ) {
4616- return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
4617- },
4618-
4619- checkbox: function( elem ) {
4620- return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
4621- },
4622-
4623- file: function( elem ) {
4624- return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
4625- },
4626-
4627- password: function( elem ) {
4628- return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
4629- },
4630-
4631- submit: function( elem ) {
4632- var name = elem.nodeName.toLowerCase();
4633- return (name === "input" || name === "button") && "submit" === elem.type;
4634- },
4635-
4636- image: function( elem ) {
4637- return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
4638- },
4639-
4640- reset: function( elem ) {
4641- var name = elem.nodeName.toLowerCase();
4642- return (name === "input" || name === "button") && "reset" === elem.type;
4643- },
4644-
4645- button: function( elem ) {
4646- var name = elem.nodeName.toLowerCase();
4647- return name === "input" && "button" === elem.type || name === "button";
4648- },
4649-
4650- input: function( elem ) {
4651- return (/input|select|textarea|button/i).test( elem.nodeName );
4652- },
4653-
4654- focus: function( elem ) {
4655- return elem === elem.ownerDocument.activeElement;
4656- }
4657- },
4658- setFilters: {
4659- first: function( elem, i ) {
4660- return i === 0;
4661- },
4662-
4663- last: function( elem, i, match, array ) {
4664- return i === array.length - 1;
4665- },
4666-
4667- even: function( elem, i ) {
4668- return i % 2 === 0;
4669- },
4670-
4671- odd: function( elem, i ) {
4672- return i % 2 === 1;
4673- },
4674-
4675- lt: function( elem, i, match ) {
4676- return i < match[3] - 0;
4677- },
4678-
4679- gt: function( elem, i, match ) {
4680- return i > match[3] - 0;
4681- },
4682-
4683- nth: function( elem, i, match ) {
4684- return match[3] - 0 === i;
4685- },
4686-
4687- eq: function( elem, i, match ) {
4688- return match[3] - 0 === i;
4689- }
4690- },
4691- filter: {
4692- PSEUDO: function( elem, match, i, array ) {
4693- var name = match[1],
4694- filter = Expr.filters[ name ];
4695-
4696- if ( filter ) {
4697- return filter( elem, i, match, array );
4698-
4699- } else if ( name === "contains" ) {
4700- return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
4701-
4702- } else if ( name === "not" ) {
4703- var not = match[3];
4704-
4705- for ( var j = 0, l = not.length; j < l; j++ ) {
4706- if ( not[j] === elem ) {
4707- return false;
4708- }
4709- }
4710-
4711- return true;
4712-
4713- } else {
4714- Sizzle.error( name );
4715- }
4716- },
4717-
4718- CHILD: function( elem, match ) {
4719- var first, last,
4720- doneName, parent, cache,
4721- count, diff,
4722- type = match[1],
4723- node = elem;
4724-
4725- switch ( type ) {
4726- case "only":
4727- case "first":
4728- while ( (node = node.previousSibling) ) {
4729- if ( node.nodeType === 1 ) {
4730- return false;
4731- }
4732- }
4733-
4734- if ( type === "first" ) {
4735- return true;
4736- }
4737-
4738- node = elem;
4739-
4740- /* falls through */
4741- case "last":
4742- while ( (node = node.nextSibling) ) {
4743- if ( node.nodeType === 1 ) {
4744- return false;
4745- }
4746- }
4747-
4748- return true;
4749-
4750- case "nth":
4751- first = match[2];
4752- last = match[3];
4753-
4754- if ( first === 1 && last === 0 ) {
4755- return true;
4756- }
4757-
4758- doneName = match[0];
4759- parent = elem.parentNode;
4760-
4761- if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
4762- count = 0;
4763-
4764- for ( node = parent.firstChild; node; node = node.nextSibling ) {
4765- if ( node.nodeType === 1 ) {
4766- node.nodeIndex = ++count;
4767- }
4768- }
4769-
4770- parent[ expando ] = doneName;
4771- }
4772-
4773- diff = elem.nodeIndex - last;
4774-
4775- if ( first === 0 ) {
4776- return diff === 0;
4777-
4778- } else {
4779- return ( diff % first === 0 && diff / first >= 0 );
4780- }
4781- }
4782- },
4783-
4784- ID: function( elem, match ) {
4785- return elem.nodeType === 1 && elem.getAttribute("id") === match;
4786- },
4787-
4788- TAG: function( elem, match ) {
4789- return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
4790- },
4791-
4792- CLASS: function( elem, match ) {
4793- return (" " + (elem.className || elem.getAttribute("class")) + " ")
4794- .indexOf( match ) > -1;
4795- },
4796-
4797- ATTR: function( elem, match ) {
4798- var name = match[1],
4799- result = Sizzle.attr ?
4800- Sizzle.attr( elem, name ) :
4801- Expr.attrHandle[ name ] ?
4802- Expr.attrHandle[ name ]( elem ) :
4803- elem[ name ] != null ?
4804- elem[ name ] :
4805- elem.getAttribute( name ),
4806- value = result + "",
4807- type = match[2],
4808- check = match[4];
4809-
4810- return result == null ?
4811- type === "!=" :
4812- !type && Sizzle.attr ?
4813- result != null :
4814- type === "=" ?
4815- value === check :
4816- type === "*=" ?
4817- value.indexOf(check) >= 0 :
4818- type === "~=" ?
4819- (" " + value + " ").indexOf(check) >= 0 :
4820- !check ?
4821- value && result !== false :
4822- type === "!=" ?
4823- value !== check :
4824- type === "^=" ?
4825- value.indexOf(check) === 0 :
4826- type === "$=" ?
4827- value.substr(value.length - check.length) === check :
4828- type === "|=" ?
4829- value === check || value.substr(0, check.length + 1) === check + "-" :
4830- false;
4831- },
4832-
4833- POS: function( elem, match, i, array ) {
4834- var name = match[2],
4835- filter = Expr.setFilters[ name ];
4836-
4837- if ( filter ) {
4838- return filter( elem, i, match, array );
4839- }
4840- }
4841- }
4842-};
4843-
4844-var origPOS = Expr.match.POS,
4845- fescape = function(all, num){
4846- return "\\" + (num - 0 + 1);
4847- };
4848-
4849-for ( var type in Expr.match ) {
4850- Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
4851- Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
4852-}
4853-// Expose origPOS
4854-// "global" as in regardless of relation to brackets/parens
4855-Expr.match.globalPOS = origPOS;
4856-
4857-var makeArray = function( array, results ) {
4858- array = Array.prototype.slice.call( array, 0 );
4859-
4860- if ( results ) {
4861- results.push.apply( results, array );
4862- return results;
4863- }
4864-
4865- return array;
4866-};
4867-
4868-// Perform a simple check to determine if the browser is capable of
4869-// converting a NodeList to an array using builtin methods.
4870-// Also verifies that the returned array holds DOM nodes
4871-// (which is not the case in the Blackberry browser)
4872-try {
4873- Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
4874-
4875-// Provide a fallback method if it does not work
4876-} catch( e ) {
4877- makeArray = function( array, results ) {
4878- var i = 0,
4879- ret = results || [];
4880-
4881- if ( toString.call(array) === "[object Array]" ) {
4882- Array.prototype.push.apply( ret, array );
4883-
4884- } else {
4885- if ( typeof array.length === "number" ) {
4886- for ( var l = array.length; i < l; i++ ) {
4887- ret.push( array[i] );
4888- }
4889-
4890- } else {
4891- for ( ; array[i]; i++ ) {
4892- ret.push( array[i] );
4893- }
4894- }
4895- }
4896-
4897- return ret;
4898- };
4899-}
4900-
4901-var sortOrder, siblingCheck;
4902-
4903-if ( document.documentElement.compareDocumentPosition ) {
4904- sortOrder = function( a, b ) {
4905- if ( a === b ) {
4906- hasDuplicate = true;
4907- return 0;
4908- }
4909-
4910- if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
4911- return a.compareDocumentPosition ? -1 : 1;
4912- }
4913-
4914- return a.compareDocumentPosition(b) & 4 ? -1 : 1;
4915- };
4916-
4917-} else {
4918- sortOrder = function( a, b ) {
4919- // The nodes are identical, we can exit early
4920- if ( a === b ) {
4921- hasDuplicate = true;
4922- return 0;
4923-
4924- // Fallback to using sourceIndex (in IE) if it's available on both nodes
4925- } else if ( a.sourceIndex && b.sourceIndex ) {
4926- return a.sourceIndex - b.sourceIndex;
4927- }
4928-
4929- var al, bl,
4930- ap = [],
4931- bp = [],
4932- aup = a.parentNode,
4933- bup = b.parentNode,
4934- cur = aup;
4935-
4936- // If the nodes are siblings (or identical) we can do a quick check
4937- if ( aup === bup ) {
4938- return siblingCheck( a, b );
4939-
4940- // If no parents were found then the nodes are disconnected
4941- } else if ( !aup ) {
4942- return -1;
4943-
4944- } else if ( !bup ) {
4945- return 1;
4946- }
4947-
4948- // Otherwise they're somewhere else in the tree so we need
4949- // to build up a full list of the parentNodes for comparison
4950- while ( cur ) {
4951- ap.unshift( cur );
4952- cur = cur.parentNode;
4953- }
4954-
4955- cur = bup;
4956-
4957- while ( cur ) {
4958- bp.unshift( cur );
4959- cur = cur.parentNode;
4960- }
4961-
4962- al = ap.length;
4963- bl = bp.length;
4964-
4965- // Start walking down the tree looking for a discrepancy
4966- for ( var i = 0; i < al && i < bl; i++ ) {
4967- if ( ap[i] !== bp[i] ) {
4968- return siblingCheck( ap[i], bp[i] );
4969- }
4970- }
4971-
4972- // We ended someplace up the tree so do a sibling check
4973- return i === al ?
4974- siblingCheck( a, bp[i], -1 ) :
4975- siblingCheck( ap[i], b, 1 );
4976- };
4977-
4978- siblingCheck = function( a, b, ret ) {
4979- if ( a === b ) {
4980- return ret;
4981- }
4982-
4983- var cur = a.nextSibling;
4984-
4985- while ( cur ) {
4986- if ( cur === b ) {
4987- return -1;
4988- }
4989-
4990- cur = cur.nextSibling;
4991- }
4992-
4993- return 1;
4994- };
4995-}
4996-
4997-// Check to see if the browser returns elements by name when
4998-// querying by getElementById (and provide a workaround)
4999-(function(){
5000- // We're going to inject a fake input element with a specified name
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches