1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/Resources/Web/js/jquery-1.7.2.js Sun May 27 20:15:32 2012 +0000
1.3 @@ -0,0 +1,9404 @@
1.4 +/*!
1.5 + * jQuery JavaScript Library v1.7.2
1.6 + * http://jquery.com/
1.7 + *
1.8 + * Copyright 2011, John Resig
1.9 + * Dual licensed under the MIT or GPL Version 2 licenses.
1.10 + * http://jquery.org/license
1.11 + *
1.12 + * Includes Sizzle.js
1.13 + * http://sizzlejs.com/
1.14 + * Copyright 2011, The Dojo Foundation
1.15 + * Released under the MIT, BSD, and GPL Licenses.
1.16 + *
1.17 + * Date: Wed Mar 21 12:46:34 2012 -0700
1.18 + */
1.19 +(function( window, undefined ) {
1.20 +
1.21 +// Use the correct document accordingly with window argument (sandbox)
1.22 +var document = window.document,
1.23 + navigator = window.navigator,
1.24 + location = window.location;
1.25 +var jQuery = (function() {
1.26 +
1.27 +// Define a local copy of jQuery
1.28 +var jQuery = function( selector, context ) {
1.29 + // The jQuery object is actually just the init constructor 'enhanced'
1.30 + return new jQuery.fn.init( selector, context, rootjQuery );
1.31 + },
1.32 +
1.33 + // Map over jQuery in case of overwrite
1.34 + _jQuery = window.jQuery,
1.35 +
1.36 + // Map over the $ in case of overwrite
1.37 + _$ = window.$,
1.38 +
1.39 + // A central reference to the root jQuery(document)
1.40 + rootjQuery,
1.41 +
1.42 + // A simple way to check for HTML strings or ID strings
1.43 + // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
1.44 + quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
1.45 +
1.46 + // Check if a string has a non-whitespace character in it
1.47 + rnotwhite = /\S/,
1.48 +
1.49 + // Used for trimming whitespace
1.50 + trimLeft = /^\s+/,
1.51 + trimRight = /\s+$/,
1.52 +
1.53 + // Match a standalone tag
1.54 + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
1.55 +
1.56 + // JSON RegExp
1.57 + rvalidchars = /^[\],:{}\s]*$/,
1.58 + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
1.59 + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
1.60 + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
1.61 +
1.62 + // Useragent RegExp
1.63 + rwebkit = /(webkit)[ \/]([\w.]+)/,
1.64 + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
1.65 + rmsie = /(msie) ([\w.]+)/,
1.66 + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
1.67 +
1.68 + // Matches dashed string for camelizing
1.69 + rdashAlpha = /-([a-z]|[0-9])/ig,
1.70 + rmsPrefix = /^-ms-/,
1.71 +
1.72 + // Used by jQuery.camelCase as callback to replace()
1.73 + fcamelCase = function( all, letter ) {
1.74 + return ( letter + "" ).toUpperCase();
1.75 + },
1.76 +
1.77 + // Keep a UserAgent string for use with jQuery.browser
1.78 + userAgent = navigator.userAgent,
1.79 +
1.80 + // For matching the engine and version of the browser
1.81 + browserMatch,
1.82 +
1.83 + // The deferred used on DOM ready
1.84 + readyList,
1.85 +
1.86 + // The ready event handler
1.87 + DOMContentLoaded,
1.88 +
1.89 + // Save a reference to some core methods
1.90 + toString = Object.prototype.toString,
1.91 + hasOwn = Object.prototype.hasOwnProperty,
1.92 + push = Array.prototype.push,
1.93 + slice = Array.prototype.slice,
1.94 + trim = String.prototype.trim,
1.95 + indexOf = Array.prototype.indexOf,
1.96 +
1.97 + // [[Class]] -> type pairs
1.98 + class2type = {};
1.99 +
1.100 +jQuery.fn = jQuery.prototype = {
1.101 + constructor: jQuery,
1.102 + init: function( selector, context, rootjQuery ) {
1.103 + var match, elem, ret, doc;
1.104 +
1.105 + // Handle $(""), $(null), or $(undefined)
1.106 + if ( !selector ) {
1.107 + return this;
1.108 + }
1.109 +
1.110 + // Handle $(DOMElement)
1.111 + if ( selector.nodeType ) {
1.112 + this.context = this[0] = selector;
1.113 + this.length = 1;
1.114 + return this;
1.115 + }
1.116 +
1.117 + // The body element only exists once, optimize finding it
1.118 + if ( selector === "body" && !context && document.body ) {
1.119 + this.context = document;
1.120 + this[0] = document.body;
1.121 + this.selector = selector;
1.122 + this.length = 1;
1.123 + return this;
1.124 + }
1.125 +
1.126 + // Handle HTML strings
1.127 + if ( typeof selector === "string" ) {
1.128 + // Are we dealing with HTML string or an ID?
1.129 + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
1.130 + // Assume that strings that start and end with <> are HTML and skip the regex check
1.131 + match = [ null, selector, null ];
1.132 +
1.133 + } else {
1.134 + match = quickExpr.exec( selector );
1.135 + }
1.136 +
1.137 + // Verify a match, and that no context was specified for #id
1.138 + if ( match && (match[1] || !context) ) {
1.139 +
1.140 + // HANDLE: $(html) -> $(array)
1.141 + if ( match[1] ) {
1.142 + context = context instanceof jQuery ? context[0] : context;
1.143 + doc = ( context ? context.ownerDocument || context : document );
1.144 +
1.145 + // If a single string is passed in and it's a single tag
1.146 + // just do a createElement and skip the rest
1.147 + ret = rsingleTag.exec( selector );
1.148 +
1.149 + if ( ret ) {
1.150 + if ( jQuery.isPlainObject( context ) ) {
1.151 + selector = [ document.createElement( ret[1] ) ];
1.152 + jQuery.fn.attr.call( selector, context, true );
1.153 +
1.154 + } else {
1.155 + selector = [ doc.createElement( ret[1] ) ];
1.156 + }
1.157 +
1.158 + } else {
1.159 + ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
1.160 + selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
1.161 + }
1.162 +
1.163 + return jQuery.merge( this, selector );
1.164 +
1.165 + // HANDLE: $("#id")
1.166 + } else {
1.167 + elem = document.getElementById( match[2] );
1.168 +
1.169 + // Check parentNode to catch when Blackberry 4.6 returns
1.170 + // nodes that are no longer in the document #6963
1.171 + if ( elem && elem.parentNode ) {
1.172 + // Handle the case where IE and Opera return items
1.173 + // by name instead of ID
1.174 + if ( elem.id !== match[2] ) {
1.175 + return rootjQuery.find( selector );
1.176 + }
1.177 +
1.178 + // Otherwise, we inject the element directly into the jQuery object
1.179 + this.length = 1;
1.180 + this[0] = elem;
1.181 + }
1.182 +
1.183 + this.context = document;
1.184 + this.selector = selector;
1.185 + return this;
1.186 + }
1.187 +
1.188 + // HANDLE: $(expr, $(...))
1.189 + } else if ( !context || context.jquery ) {
1.190 + return ( context || rootjQuery ).find( selector );
1.191 +
1.192 + // HANDLE: $(expr, context)
1.193 + // (which is just equivalent to: $(context).find(expr)
1.194 + } else {
1.195 + return this.constructor( context ).find( selector );
1.196 + }
1.197 +
1.198 + // HANDLE: $(function)
1.199 + // Shortcut for document ready
1.200 + } else if ( jQuery.isFunction( selector ) ) {
1.201 + return rootjQuery.ready( selector );
1.202 + }
1.203 +
1.204 + if ( selector.selector !== undefined ) {
1.205 + this.selector = selector.selector;
1.206 + this.context = selector.context;
1.207 + }
1.208 +
1.209 + return jQuery.makeArray( selector, this );
1.210 + },
1.211 +
1.212 + // Start with an empty selector
1.213 + selector: "",
1.214 +
1.215 + // The current version of jQuery being used
1.216 + jquery: "1.7.2",
1.217 +
1.218 + // The default length of a jQuery object is 0
1.219 + length: 0,
1.220 +
1.221 + // The number of elements contained in the matched element set
1.222 + size: function() {
1.223 + return this.length;
1.224 + },
1.225 +
1.226 + toArray: function() {
1.227 + return slice.call( this, 0 );
1.228 + },
1.229 +
1.230 + // Get the Nth element in the matched element set OR
1.231 + // Get the whole matched element set as a clean array
1.232 + get: function( num ) {
1.233 + return num == null ?
1.234 +
1.235 + // Return a 'clean' array
1.236 + this.toArray() :
1.237 +
1.238 + // Return just the object
1.239 + ( num < 0 ? this[ this.length + num ] : this[ num ] );
1.240 + },
1.241 +
1.242 + // Take an array of elements and push it onto the stack
1.243 + // (returning the new matched element set)
1.244 + pushStack: function( elems, name, selector ) {
1.245 + // Build a new jQuery matched element set
1.246 + var ret = this.constructor();
1.247 +
1.248 + if ( jQuery.isArray( elems ) ) {
1.249 + push.apply( ret, elems );
1.250 +
1.251 + } else {
1.252 + jQuery.merge( ret, elems );
1.253 + }
1.254 +
1.255 + // Add the old object onto the stack (as a reference)
1.256 + ret.prevObject = this;
1.257 +
1.258 + ret.context = this.context;
1.259 +
1.260 + if ( name === "find" ) {
1.261 + ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
1.262 + } else if ( name ) {
1.263 + ret.selector = this.selector + "." + name + "(" + selector + ")";
1.264 + }
1.265 +
1.266 + // Return the newly-formed element set
1.267 + return ret;
1.268 + },
1.269 +
1.270 + // Execute a callback for every element in the matched set.
1.271 + // (You can seed the arguments with an array of args, but this is
1.272 + // only used internally.)
1.273 + each: function( callback, args ) {
1.274 + return jQuery.each( this, callback, args );
1.275 + },
1.276 +
1.277 + ready: function( fn ) {
1.278 + // Attach the listeners
1.279 + jQuery.bindReady();
1.280 +
1.281 + // Add the callback
1.282 + readyList.add( fn );
1.283 +
1.284 + return this;
1.285 + },
1.286 +
1.287 + eq: function( i ) {
1.288 + i = +i;
1.289 + return i === -1 ?
1.290 + this.slice( i ) :
1.291 + this.slice( i, i + 1 );
1.292 + },
1.293 +
1.294 + first: function() {
1.295 + return this.eq( 0 );
1.296 + },
1.297 +
1.298 + last: function() {
1.299 + return this.eq( -1 );
1.300 + },
1.301 +
1.302 + slice: function() {
1.303 + return this.pushStack( slice.apply( this, arguments ),
1.304 + "slice", slice.call(arguments).join(",") );
1.305 + },
1.306 +
1.307 + map: function( callback ) {
1.308 + return this.pushStack( jQuery.map(this, function( elem, i ) {
1.309 + return callback.call( elem, i, elem );
1.310 + }));
1.311 + },
1.312 +
1.313 + end: function() {
1.314 + return this.prevObject || this.constructor(null);
1.315 + },
1.316 +
1.317 + // For internal use only.
1.318 + // Behaves like an Array's method, not like a jQuery method.
1.319 + push: push,
1.320 + sort: [].sort,
1.321 + splice: [].splice
1.322 +};
1.323 +
1.324 +// Give the init function the jQuery prototype for later instantiation
1.325 +jQuery.fn.init.prototype = jQuery.fn;
1.326 +
1.327 +jQuery.extend = jQuery.fn.extend = function() {
1.328 + var options, name, src, copy, copyIsArray, clone,
1.329 + target = arguments[0] || {},
1.330 + i = 1,
1.331 + length = arguments.length,
1.332 + deep = false;
1.333 +
1.334 + // Handle a deep copy situation
1.335 + if ( typeof target === "boolean" ) {
1.336 + deep = target;
1.337 + target = arguments[1] || {};
1.338 + // skip the boolean and the target
1.339 + i = 2;
1.340 + }
1.341 +
1.342 + // Handle case when target is a string or something (possible in deep copy)
1.343 + if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
1.344 + target = {};
1.345 + }
1.346 +
1.347 + // extend jQuery itself if only one argument is passed
1.348 + if ( length === i ) {
1.349 + target = this;
1.350 + --i;
1.351 + }
1.352 +
1.353 + for ( ; i < length; i++ ) {
1.354 + // Only deal with non-null/undefined values
1.355 + if ( (options = arguments[ i ]) != null ) {
1.356 + // Extend the base object
1.357 + for ( name in options ) {
1.358 + src = target[ name ];
1.359 + copy = options[ name ];
1.360 +
1.361 + // Prevent never-ending loop
1.362 + if ( target === copy ) {
1.363 + continue;
1.364 + }
1.365 +
1.366 + // Recurse if we're merging plain objects or arrays
1.367 + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
1.368 + if ( copyIsArray ) {
1.369 + copyIsArray = false;
1.370 + clone = src && jQuery.isArray(src) ? src : [];
1.371 +
1.372 + } else {
1.373 + clone = src && jQuery.isPlainObject(src) ? src : {};
1.374 + }
1.375 +
1.376 + // Never move original objects, clone them
1.377 + target[ name ] = jQuery.extend( deep, clone, copy );
1.378 +
1.379 + // Don't bring in undefined values
1.380 + } else if ( copy !== undefined ) {
1.381 + target[ name ] = copy;
1.382 + }
1.383 + }
1.384 + }
1.385 + }
1.386 +
1.387 + // Return the modified object
1.388 + return target;
1.389 +};
1.390 +
1.391 +jQuery.extend({
1.392 + noConflict: function( deep ) {
1.393 + if ( window.$ === jQuery ) {
1.394 + window.$ = _$;
1.395 + }
1.396 +
1.397 + if ( deep && window.jQuery === jQuery ) {
1.398 + window.jQuery = _jQuery;
1.399 + }
1.400 +
1.401 + return jQuery;
1.402 + },
1.403 +
1.404 + // Is the DOM ready to be used? Set to true once it occurs.
1.405 + isReady: false,
1.406 +
1.407 + // A counter to track how many items to wait for before
1.408 + // the ready event fires. See #6781
1.409 + readyWait: 1,
1.410 +
1.411 + // Hold (or release) the ready event
1.412 + holdReady: function( hold ) {
1.413 + if ( hold ) {
1.414 + jQuery.readyWait++;
1.415 + } else {
1.416 + jQuery.ready( true );
1.417 + }
1.418 + },
1.419 +
1.420 + // Handle when the DOM is ready
1.421 + ready: function( wait ) {
1.422 + // Either a released hold or an DOMready/load event and not yet ready
1.423 + if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
1.424 + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
1.425 + if ( !document.body ) {
1.426 + return setTimeout( jQuery.ready, 1 );
1.427 + }
1.428 +
1.429 + // Remember that the DOM is ready
1.430 + jQuery.isReady = true;
1.431 +
1.432 + // If a normal DOM Ready event fired, decrement, and wait if need be
1.433 + if ( wait !== true && --jQuery.readyWait > 0 ) {
1.434 + return;
1.435 + }
1.436 +
1.437 + // If there are functions bound, to execute
1.438 + readyList.fireWith( document, [ jQuery ] );
1.439 +
1.440 + // Trigger any bound ready events
1.441 + if ( jQuery.fn.trigger ) {
1.442 + jQuery( document ).trigger( "ready" ).off( "ready" );
1.443 + }
1.444 + }
1.445 + },
1.446 +
1.447 + bindReady: function() {
1.448 + if ( readyList ) {
1.449 + return;
1.450 + }
1.451 +
1.452 + readyList = jQuery.Callbacks( "once memory" );
1.453 +
1.454 + // Catch cases where $(document).ready() is called after the
1.455 + // browser event has already occurred.
1.456 + if ( document.readyState === "complete" ) {
1.457 + // Handle it asynchronously to allow scripts the opportunity to delay ready
1.458 + return setTimeout( jQuery.ready, 1 );
1.459 + }
1.460 +
1.461 + // Mozilla, Opera and webkit nightlies currently support this event
1.462 + if ( document.addEventListener ) {
1.463 + // Use the handy event callback
1.464 + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
1.465 +
1.466 + // A fallback to window.onload, that will always work
1.467 + window.addEventListener( "load", jQuery.ready, false );
1.468 +
1.469 + // If IE event model is used
1.470 + } else if ( document.attachEvent ) {
1.471 + // ensure firing before onload,
1.472 + // maybe late but safe also for iframes
1.473 + document.attachEvent( "onreadystatechange", DOMContentLoaded );
1.474 +
1.475 + // A fallback to window.onload, that will always work
1.476 + window.attachEvent( "onload", jQuery.ready );
1.477 +
1.478 + // If IE and not a frame
1.479 + // continually check to see if the document is ready
1.480 + var toplevel = false;
1.481 +
1.482 + try {
1.483 + toplevel = window.frameElement == null;
1.484 + } catch(e) {}
1.485 +
1.486 + if ( document.documentElement.doScroll && toplevel ) {
1.487 + doScrollCheck();
1.488 + }
1.489 + }
1.490 + },
1.491 +
1.492 + // See test/unit/core.js for details concerning isFunction.
1.493 + // Since version 1.3, DOM methods and functions like alert
1.494 + // aren't supported. They return false on IE (#2968).
1.495 + isFunction: function( obj ) {
1.496 + return jQuery.type(obj) === "function";
1.497 + },
1.498 +
1.499 + isArray: Array.isArray || function( obj ) {
1.500 + return jQuery.type(obj) === "array";
1.501 + },
1.502 +
1.503 + isWindow: function( obj ) {
1.504 + return obj != null && obj == obj.window;
1.505 + },
1.506 +
1.507 + isNumeric: function( obj ) {
1.508 + return !isNaN( parseFloat(obj) ) && isFinite( obj );
1.509 + },
1.510 +
1.511 + type: function( obj ) {
1.512 + return obj == null ?
1.513 + String( obj ) :
1.514 + class2type[ toString.call(obj) ] || "object";
1.515 + },
1.516 +
1.517 + isPlainObject: function( obj ) {
1.518 + // Must be an Object.
1.519 + // Because of IE, we also have to check the presence of the constructor property.
1.520 + // Make sure that DOM nodes and window objects don't pass through, as well
1.521 + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
1.522 + return false;
1.523 + }
1.524 +
1.525 + try {
1.526 + // Not own constructor property must be Object
1.527 + if ( obj.constructor &&
1.528 + !hasOwn.call(obj, "constructor") &&
1.529 + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
1.530 + return false;
1.531 + }
1.532 + } catch ( e ) {
1.533 + // IE8,9 Will throw exceptions on certain host objects #9897
1.534 + return false;
1.535 + }
1.536 +
1.537 + // Own properties are enumerated firstly, so to speed up,
1.538 + // if last one is own, then all properties are own.
1.539 +
1.540 + var key;
1.541 + for ( key in obj ) {}
1.542 +
1.543 + return key === undefined || hasOwn.call( obj, key );
1.544 + },
1.545 +
1.546 + isEmptyObject: function( obj ) {
1.547 + for ( var name in obj ) {
1.548 + return false;
1.549 + }
1.550 + return true;
1.551 + },
1.552 +
1.553 + error: function( msg ) {
1.554 + throw new Error( msg );
1.555 + },
1.556 +
1.557 + parseJSON: function( data ) {
1.558 + if ( typeof data !== "string" || !data ) {
1.559 + return null;
1.560 + }
1.561 +
1.562 + // Make sure leading/trailing whitespace is removed (IE can't handle it)
1.563 + data = jQuery.trim( data );
1.564 +
1.565 + // Attempt to parse using the native JSON parser first
1.566 + if ( window.JSON && window.JSON.parse ) {
1.567 + return window.JSON.parse( data );
1.568 + }
1.569 +
1.570 + // Make sure the incoming data is actual JSON
1.571 + // Logic borrowed from http://json.org/json2.js
1.572 + if ( rvalidchars.test( data.replace( rvalidescape, "@" )
1.573 + .replace( rvalidtokens, "]" )
1.574 + .replace( rvalidbraces, "")) ) {
1.575 +
1.576 + return ( new Function( "return " + data ) )();
1.577 +
1.578 + }
1.579 + jQuery.error( "Invalid JSON: " + data );
1.580 + },
1.581 +
1.582 + // Cross-browser xml parsing
1.583 + parseXML: function( data ) {
1.584 + if ( typeof data !== "string" || !data ) {
1.585 + return null;
1.586 + }
1.587 + var xml, tmp;
1.588 + try {
1.589 + if ( window.DOMParser ) { // Standard
1.590 + tmp = new DOMParser();
1.591 + xml = tmp.parseFromString( data , "text/xml" );
1.592 + } else { // IE
1.593 + xml = new ActiveXObject( "Microsoft.XMLDOM" );
1.594 + xml.async = "false";
1.595 + xml.loadXML( data );
1.596 + }
1.597 + } catch( e ) {
1.598 + xml = undefined;
1.599 + }
1.600 + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
1.601 + jQuery.error( "Invalid XML: " + data );
1.602 + }
1.603 + return xml;
1.604 + },
1.605 +
1.606 + noop: function() {},
1.607 +
1.608 + // Evaluates a script in a global context
1.609 + // Workarounds based on findings by Jim Driscoll
1.610 + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
1.611 + globalEval: function( data ) {
1.612 + if ( data && rnotwhite.test( data ) ) {
1.613 + // We use execScript on Internet Explorer
1.614 + // We use an anonymous function so that context is window
1.615 + // rather than jQuery in Firefox
1.616 + ( window.execScript || function( data ) {
1.617 + window[ "eval" ].call( window, data );
1.618 + } )( data );
1.619 + }
1.620 + },
1.621 +
1.622 + // Convert dashed to camelCase; used by the css and data modules
1.623 + // Microsoft forgot to hump their vendor prefix (#9572)
1.624 + camelCase: function( string ) {
1.625 + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
1.626 + },
1.627 +
1.628 + nodeName: function( elem, name ) {
1.629 + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
1.630 + },
1.631 +
1.632 + // args is for internal usage only
1.633 + each: function( object, callback, args ) {
1.634 + var name, i = 0,
1.635 + length = object.length,
1.636 + isObj = length === undefined || jQuery.isFunction( object );
1.637 +
1.638 + if ( args ) {
1.639 + if ( isObj ) {
1.640 + for ( name in object ) {
1.641 + if ( callback.apply( object[ name ], args ) === false ) {
1.642 + break;
1.643 + }
1.644 + }
1.645 + } else {
1.646 + for ( ; i < length; ) {
1.647 + if ( callback.apply( object[ i++ ], args ) === false ) {
1.648 + break;
1.649 + }
1.650 + }
1.651 + }
1.652 +
1.653 + // A special, fast, case for the most common use of each
1.654 + } else {
1.655 + if ( isObj ) {
1.656 + for ( name in object ) {
1.657 + if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
1.658 + break;
1.659 + }
1.660 + }
1.661 + } else {
1.662 + for ( ; i < length; ) {
1.663 + if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
1.664 + break;
1.665 + }
1.666 + }
1.667 + }
1.668 + }
1.669 +
1.670 + return object;
1.671 + },
1.672 +
1.673 + // Use native String.trim function wherever possible
1.674 + trim: trim ?
1.675 + function( text ) {
1.676 + return text == null ?
1.677 + "" :
1.678 + trim.call( text );
1.679 + } :
1.680 +
1.681 + // Otherwise use our own trimming functionality
1.682 + function( text ) {
1.683 + return text == null ?
1.684 + "" :
1.685 + text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
1.686 + },
1.687 +
1.688 + // results is for internal usage only
1.689 + makeArray: function( array, results ) {
1.690 + var ret = results || [];
1.691 +
1.692 + if ( array != null ) {
1.693 + // The window, strings (and functions) also have 'length'
1.694 + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
1.695 + var type = jQuery.type( array );
1.696 +
1.697 + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
1.698 + push.call( ret, array );
1.699 + } else {
1.700 + jQuery.merge( ret, array );
1.701 + }
1.702 + }
1.703 +
1.704 + return ret;
1.705 + },
1.706 +
1.707 + inArray: function( elem, array, i ) {
1.708 + var len;
1.709 +
1.710 + if ( array ) {
1.711 + if ( indexOf ) {
1.712 + return indexOf.call( array, elem, i );
1.713 + }
1.714 +
1.715 + len = array.length;
1.716 + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
1.717 +
1.718 + for ( ; i < len; i++ ) {
1.719 + // Skip accessing in sparse arrays
1.720 + if ( i in array && array[ i ] === elem ) {
1.721 + return i;
1.722 + }
1.723 + }
1.724 + }
1.725 +
1.726 + return -1;
1.727 + },
1.728 +
1.729 + merge: function( first, second ) {
1.730 + var i = first.length,
1.731 + j = 0;
1.732 +
1.733 + if ( typeof second.length === "number" ) {
1.734 + for ( var l = second.length; j < l; j++ ) {
1.735 + first[ i++ ] = second[ j ];
1.736 + }
1.737 +
1.738 + } else {
1.739 + while ( second[j] !== undefined ) {
1.740 + first[ i++ ] = second[ j++ ];
1.741 + }
1.742 + }
1.743 +
1.744 + first.length = i;
1.745 +
1.746 + return first;
1.747 + },
1.748 +
1.749 + grep: function( elems, callback, inv ) {
1.750 + var ret = [], retVal;
1.751 + inv = !!inv;
1.752 +
1.753 + // Go through the array, only saving the items
1.754 + // that pass the validator function
1.755 + for ( var i = 0, length = elems.length; i < length; i++ ) {
1.756 + retVal = !!callback( elems[ i ], i );
1.757 + if ( inv !== retVal ) {
1.758 + ret.push( elems[ i ] );
1.759 + }
1.760 + }
1.761 +
1.762 + return ret;
1.763 + },
1.764 +
1.765 + // arg is for internal usage only
1.766 + map: function( elems, callback, arg ) {
1.767 + var value, key, ret = [],
1.768 + i = 0,
1.769 + length = elems.length,
1.770 + // jquery objects are treated as arrays
1.771 + isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
1.772 +
1.773 + // Go through the array, translating each of the items to their
1.774 + if ( isArray ) {
1.775 + for ( ; i < length; i++ ) {
1.776 + value = callback( elems[ i ], i, arg );
1.777 +
1.778 + if ( value != null ) {
1.779 + ret[ ret.length ] = value;
1.780 + }
1.781 + }
1.782 +
1.783 + // Go through every key on the object,
1.784 + } else {
1.785 + for ( key in elems ) {
1.786 + value = callback( elems[ key ], key, arg );
1.787 +
1.788 + if ( value != null ) {
1.789 + ret[ ret.length ] = value;
1.790 + }
1.791 + }
1.792 + }
1.793 +
1.794 + // Flatten any nested arrays
1.795 + return ret.concat.apply( [], ret );
1.796 + },
1.797 +
1.798 + // A global GUID counter for objects
1.799 + guid: 1,
1.800 +
1.801 + // Bind a function to a context, optionally partially applying any
1.802 + // arguments.
1.803 + proxy: function( fn, context ) {
1.804 + if ( typeof context === "string" ) {
1.805 + var tmp = fn[ context ];
1.806 + context = fn;
1.807 + fn = tmp;
1.808 + }
1.809 +
1.810 + // Quick check to determine if target is callable, in the spec
1.811 + // this throws a TypeError, but we will just return undefined.
1.812 + if ( !jQuery.isFunction( fn ) ) {
1.813 + return undefined;
1.814 + }
1.815 +
1.816 + // Simulated bind
1.817 + var args = slice.call( arguments, 2 ),
1.818 + proxy = function() {
1.819 + return fn.apply( context, args.concat( slice.call( arguments ) ) );
1.820 + };
1.821 +
1.822 + // Set the guid of unique handler to the same of original handler, so it can be removed
1.823 + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
1.824 +
1.825 + return proxy;
1.826 + },
1.827 +
1.828 + // Mutifunctional method to get and set values to a collection
1.829 + // The value/s can optionally be executed if it's a function
1.830 + access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
1.831 + var exec,
1.832 + bulk = key == null,
1.833 + i = 0,
1.834 + length = elems.length;
1.835 +
1.836 + // Sets many values
1.837 + if ( key && typeof key === "object" ) {
1.838 + for ( i in key ) {
1.839 + jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
1.840 + }
1.841 + chainable = 1;
1.842 +
1.843 + // Sets one value
1.844 + } else if ( value !== undefined ) {
1.845 + // Optionally, function values get executed if exec is true
1.846 + exec = pass === undefined && jQuery.isFunction( value );
1.847 +
1.848 + if ( bulk ) {
1.849 + // Bulk operations only iterate when executing function values
1.850 + if ( exec ) {
1.851 + exec = fn;
1.852 + fn = function( elem, key, value ) {
1.853 + return exec.call( jQuery( elem ), value );
1.854 + };
1.855 +
1.856 + // Otherwise they run against the entire set
1.857 + } else {
1.858 + fn.call( elems, value );
1.859 + fn = null;
1.860 + }
1.861 + }
1.862 +
1.863 + if ( fn ) {
1.864 + for (; i < length; i++ ) {
1.865 + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
1.866 + }
1.867 + }
1.868 +
1.869 + chainable = 1;
1.870 + }
1.871 +
1.872 + return chainable ?
1.873 + elems :
1.874 +
1.875 + // Gets
1.876 + bulk ?
1.877 + fn.call( elems ) :
1.878 + length ? fn( elems[0], key ) : emptyGet;
1.879 + },
1.880 +
1.881 + now: function() {
1.882 + return ( new Date() ).getTime();
1.883 + },
1.884 +
1.885 + // Use of jQuery.browser is frowned upon.
1.886 + // More details: http://docs.jquery.com/Utilities/jQuery.browser
1.887 + uaMatch: function( ua ) {
1.888 + ua = ua.toLowerCase();
1.889 +
1.890 + var match = rwebkit.exec( ua ) ||
1.891 + ropera.exec( ua ) ||
1.892 + rmsie.exec( ua ) ||
1.893 + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
1.894 + [];
1.895 +
1.896 + return { browser: match[1] || "", version: match[2] || "0" };
1.897 + },
1.898 +
1.899 + sub: function() {
1.900 + function jQuerySub( selector, context ) {
1.901 + return new jQuerySub.fn.init( selector, context );
1.902 + }
1.903 + jQuery.extend( true, jQuerySub, this );
1.904 + jQuerySub.superclass = this;
1.905 + jQuerySub.fn = jQuerySub.prototype = this();
1.906 + jQuerySub.fn.constructor = jQuerySub;
1.907 + jQuerySub.sub = this.sub;
1.908 + jQuerySub.fn.init = function init( selector, context ) {
1.909 + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
1.910 + context = jQuerySub( context );
1.911 + }
1.912 +
1.913 + return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
1.914 + };
1.915 + jQuerySub.fn.init.prototype = jQuerySub.fn;
1.916 + var rootjQuerySub = jQuerySub(document);
1.917 + return jQuerySub;
1.918 + },
1.919 +
1.920 + browser: {}
1.921 +});
1.922 +
1.923 +// Populate the class2type map
1.924 +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
1.925 + class2type[ "[object " + name + "]" ] = name.toLowerCase();
1.926 +});
1.927 +
1.928 +browserMatch = jQuery.uaMatch( userAgent );
1.929 +if ( browserMatch.browser ) {
1.930 + jQuery.browser[ browserMatch.browser ] = true;
1.931 + jQuery.browser.version = browserMatch.version;
1.932 +}
1.933 +
1.934 +// Deprecated, use jQuery.browser.webkit instead
1.935 +if ( jQuery.browser.webkit ) {
1.936 + jQuery.browser.safari = true;
1.937 +}
1.938 +
1.939 +// IE doesn't match non-breaking spaces with \s
1.940 +if ( rnotwhite.test( "\xA0" ) ) {
1.941 + trimLeft = /^[\s\xA0]+/;
1.942 + trimRight = /[\s\xA0]+$/;
1.943 +}
1.944 +
1.945 +// All jQuery objects should point back to these
1.946 +rootjQuery = jQuery(document);
1.947 +
1.948 +// Cleanup functions for the document ready method
1.949 +if ( document.addEventListener ) {
1.950 + DOMContentLoaded = function() {
1.951 + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
1.952 + jQuery.ready();
1.953 + };
1.954 +
1.955 +} else if ( document.attachEvent ) {
1.956 + DOMContentLoaded = function() {
1.957 + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
1.958 + if ( document.readyState === "complete" ) {
1.959 + document.detachEvent( "onreadystatechange", DOMContentLoaded );
1.960 + jQuery.ready();
1.961 + }
1.962 + };
1.963 +}
1.964 +
1.965 +// The DOM ready check for Internet Explorer
1.966 +function doScrollCheck() {
1.967 + if ( jQuery.isReady ) {
1.968 + return;
1.969 + }
1.970 +
1.971 + try {
1.972 + // If IE is used, use the trick by Diego Perini
1.973 + // http://javascript.nwbox.com/IEContentLoaded/
1.974 + document.documentElement.doScroll("left");
1.975 + } catch(e) {
1.976 + setTimeout( doScrollCheck, 1 );
1.977 + return;
1.978 + }
1.979 +
1.980 + // and execute any waiting functions
1.981 + jQuery.ready();
1.982 +}
1.983 +
1.984 +return jQuery;
1.985 +
1.986 +})();
1.987 +
1.988 +
1.989 +// String to Object flags format cache
1.990 +var flagsCache = {};
1.991 +
1.992 +// Convert String-formatted flags into Object-formatted ones and store in cache
1.993 +function createFlags( flags ) {
1.994 + var object = flagsCache[ flags ] = {},
1.995 + i, length;
1.996 + flags = flags.split( /\s+/ );
1.997 + for ( i = 0, length = flags.length; i < length; i++ ) {
1.998 + object[ flags[i] ] = true;
1.999 + }
1.1000 + return object;
1.1001 +}
1.1002 +
1.1003 +/*
1.1004 + * Create a callback list using the following parameters:
1.1005 + *
1.1006 + * flags: an optional list of space-separated flags that will change how
1.1007 + * the callback list behaves
1.1008 + *
1.1009 + * By default a callback list will act like an event callback list and can be
1.1010 + * "fired" multiple times.
1.1011 + *
1.1012 + * Possible flags:
1.1013 + *
1.1014 + * once: will ensure the callback list can only be fired once (like a Deferred)
1.1015 + *
1.1016 + * memory: will keep track of previous values and will call any callback added
1.1017 + * after the list has been fired right away with the latest "memorized"
1.1018 + * values (like a Deferred)
1.1019 + *
1.1020 + * unique: will ensure a callback can only be added once (no duplicate in the list)
1.1021 + *
1.1022 + * stopOnFalse: interrupt callings when a callback returns false
1.1023 + *
1.1024 + */
1.1025 +jQuery.Callbacks = function( flags ) {
1.1026 +
1.1027 + // Convert flags from String-formatted to Object-formatted
1.1028 + // (we check in cache first)
1.1029 + flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
1.1030 +
1.1031 + var // Actual callback list
1.1032 + list = [],
1.1033 + // Stack of fire calls for repeatable lists
1.1034 + stack = [],
1.1035 + // Last fire value (for non-forgettable lists)
1.1036 + memory,
1.1037 + // Flag to know if list was already fired
1.1038 + fired,
1.1039 + // Flag to know if list is currently firing
1.1040 + firing,
1.1041 + // First callback to fire (used internally by add and fireWith)
1.1042 + firingStart,
1.1043 + // End of the loop when firing
1.1044 + firingLength,
1.1045 + // Index of currently firing callback (modified by remove if needed)
1.1046 + firingIndex,
1.1047 + // Add one or several callbacks to the list
1.1048 + add = function( args ) {
1.1049 + var i,
1.1050 + length,
1.1051 + elem,
1.1052 + type,
1.1053 + actual;
1.1054 + for ( i = 0, length = args.length; i < length; i++ ) {
1.1055 + elem = args[ i ];
1.1056 + type = jQuery.type( elem );
1.1057 + if ( type === "array" ) {
1.1058 + // Inspect recursively
1.1059 + add( elem );
1.1060 + } else if ( type === "function" ) {
1.1061 + // Add if not in unique mode and callback is not in
1.1062 + if ( !flags.unique || !self.has( elem ) ) {
1.1063 + list.push( elem );
1.1064 + }
1.1065 + }
1.1066 + }
1.1067 + },
1.1068 + // Fire callbacks
1.1069 + fire = function( context, args ) {
1.1070 + args = args || [];
1.1071 + memory = !flags.memory || [ context, args ];
1.1072 + fired = true;
1.1073 + firing = true;
1.1074 + firingIndex = firingStart || 0;
1.1075 + firingStart = 0;
1.1076 + firingLength = list.length;
1.1077 + for ( ; list && firingIndex < firingLength; firingIndex++ ) {
1.1078 + if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
1.1079 + memory = true; // Mark as halted
1.1080 + break;
1.1081 + }
1.1082 + }
1.1083 + firing = false;
1.1084 + if ( list ) {
1.1085 + if ( !flags.once ) {
1.1086 + if ( stack && stack.length ) {
1.1087 + memory = stack.shift();
1.1088 + self.fireWith( memory[ 0 ], memory[ 1 ] );
1.1089 + }
1.1090 + } else if ( memory === true ) {
1.1091 + self.disable();
1.1092 + } else {
1.1093 + list = [];
1.1094 + }
1.1095 + }
1.1096 + },
1.1097 + // Actual Callbacks object
1.1098 + self = {
1.1099 + // Add a callback or a collection of callbacks to the list
1.1100 + add: function() {
1.1101 + if ( list ) {
1.1102 + var length = list.length;
1.1103 + add( arguments );
1.1104 + // Do we need to add the callbacks to the
1.1105 + // current firing batch?
1.1106 + if ( firing ) {
1.1107 + firingLength = list.length;
1.1108 + // With memory, if we're not firing then
1.1109 + // we should call right away, unless previous
1.1110 + // firing was halted (stopOnFalse)
1.1111 + } else if ( memory && memory !== true ) {
1.1112 + firingStart = length;
1.1113 + fire( memory[ 0 ], memory[ 1 ] );
1.1114 + }
1.1115 + }
1.1116 + return this;
1.1117 + },
1.1118 + // Remove a callback from the list
1.1119 + remove: function() {
1.1120 + if ( list ) {
1.1121 + var args = arguments,
1.1122 + argIndex = 0,
1.1123 + argLength = args.length;
1.1124 + for ( ; argIndex < argLength ; argIndex++ ) {
1.1125 + for ( var i = 0; i < list.length; i++ ) {
1.1126 + if ( args[ argIndex ] === list[ i ] ) {
1.1127 + // Handle firingIndex and firingLength
1.1128 + if ( firing ) {
1.1129 + if ( i <= firingLength ) {
1.1130 + firingLength--;
1.1131 + if ( i <= firingIndex ) {
1.1132 + firingIndex--;
1.1133 + }
1.1134 + }
1.1135 + }
1.1136 + // Remove the element
1.1137 + list.splice( i--, 1 );
1.1138 + // If we have some unicity property then
1.1139 + // we only need to do this once
1.1140 + if ( flags.unique ) {
1.1141 + break;
1.1142 + }
1.1143 + }
1.1144 + }
1.1145 + }
1.1146 + }
1.1147 + return this;
1.1148 + },
1.1149 + // Control if a given callback is in the list
1.1150 + has: function( fn ) {
1.1151 + if ( list ) {
1.1152 + var i = 0,
1.1153 + length = list.length;
1.1154 + for ( ; i < length; i++ ) {
1.1155 + if ( fn === list[ i ] ) {
1.1156 + return true;
1.1157 + }
1.1158 + }
1.1159 + }
1.1160 + return false;
1.1161 + },
1.1162 + // Remove all callbacks from the list
1.1163 + empty: function() {
1.1164 + list = [];
1.1165 + return this;
1.1166 + },
1.1167 + // Have the list do nothing anymore
1.1168 + disable: function() {
1.1169 + list = stack = memory = undefined;
1.1170 + return this;
1.1171 + },
1.1172 + // Is it disabled?
1.1173 + disabled: function() {
1.1174 + return !list;
1.1175 + },
1.1176 + // Lock the list in its current state
1.1177 + lock: function() {
1.1178 + stack = undefined;
1.1179 + if ( !memory || memory === true ) {
1.1180 + self.disable();
1.1181 + }
1.1182 + return this;
1.1183 + },
1.1184 + // Is it locked?
1.1185 + locked: function() {
1.1186 + return !stack;
1.1187 + },
1.1188 + // Call all callbacks with the given context and arguments
1.1189 + fireWith: function( context, args ) {
1.1190 + if ( stack ) {
1.1191 + if ( firing ) {
1.1192 + if ( !flags.once ) {
1.1193 + stack.push( [ context, args ] );
1.1194 + }
1.1195 + } else if ( !( flags.once && memory ) ) {
1.1196 + fire( context, args );
1.1197 + }
1.1198 + }
1.1199 + return this;
1.1200 + },
1.1201 + // Call all the callbacks with the given arguments
1.1202 + fire: function() {
1.1203 + self.fireWith( this, arguments );
1.1204 + return this;
1.1205 + },
1.1206 + // To know if the callbacks have already been called at least once
1.1207 + fired: function() {
1.1208 + return !!fired;
1.1209 + }
1.1210 + };
1.1211 +
1.1212 + return self;
1.1213 +};
1.1214 +
1.1215 +
1.1216 +
1.1217 +
1.1218 +var // Static reference to slice
1.1219 + sliceDeferred = [].slice;
1.1220 +
1.1221 +jQuery.extend({
1.1222 +
1.1223 + Deferred: function( func ) {
1.1224 + var doneList = jQuery.Callbacks( "once memory" ),
1.1225 + failList = jQuery.Callbacks( "once memory" ),
1.1226 + progressList = jQuery.Callbacks( "memory" ),
1.1227 + state = "pending",
1.1228 + lists = {
1.1229 + resolve: doneList,
1.1230 + reject: failList,
1.1231 + notify: progressList
1.1232 + },
1.1233 + promise = {
1.1234 + done: doneList.add,
1.1235 + fail: failList.add,
1.1236 + progress: progressList.add,
1.1237 +
1.1238 + state: function() {
1.1239 + return state;
1.1240 + },
1.1241 +
1.1242 + // Deprecated
1.1243 + isResolved: doneList.fired,
1.1244 + isRejected: failList.fired,
1.1245 +
1.1246 + then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
1.1247 + deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
1.1248 + return this;
1.1249 + },
1.1250 + always: function() {
1.1251 + deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
1.1252 + return this;
1.1253 + },
1.1254 + pipe: function( fnDone, fnFail, fnProgress ) {
1.1255 + return jQuery.Deferred(function( newDefer ) {
1.1256 + jQuery.each( {
1.1257 + done: [ fnDone, "resolve" ],
1.1258 + fail: [ fnFail, "reject" ],
1.1259 + progress: [ fnProgress, "notify" ]
1.1260 + }, function( handler, data ) {
1.1261 + var fn = data[ 0 ],
1.1262 + action = data[ 1 ],
1.1263 + returned;
1.1264 + if ( jQuery.isFunction( fn ) ) {
1.1265 + deferred[ handler ](function() {
1.1266 + returned = fn.apply( this, arguments );
1.1267 + if ( returned && jQuery.isFunction( returned.promise ) ) {
1.1268 + returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
1.1269 + } else {
1.1270 + newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
1.1271 + }
1.1272 + });
1.1273 + } else {
1.1274 + deferred[ handler ]( newDefer[ action ] );
1.1275 + }
1.1276 + });
1.1277 + }).promise();
1.1278 + },
1.1279 + // Get a promise for this deferred
1.1280 + // If obj is provided, the promise aspect is added to the object
1.1281 + promise: function( obj ) {
1.1282 + if ( obj == null ) {
1.1283 + obj = promise;
1.1284 + } else {
1.1285 + for ( var key in promise ) {
1.1286 + obj[ key ] = promise[ key ];
1.1287 + }
1.1288 + }
1.1289 + return obj;
1.1290 + }
1.1291 + },
1.1292 + deferred = promise.promise({}),
1.1293 + key;
1.1294 +
1.1295 + for ( key in lists ) {
1.1296 + deferred[ key ] = lists[ key ].fire;
1.1297 + deferred[ key + "With" ] = lists[ key ].fireWith;
1.1298 + }
1.1299 +
1.1300 + // Handle state
1.1301 + deferred.done( function() {
1.1302 + state = "resolved";
1.1303 + }, failList.disable, progressList.lock ).fail( function() {
1.1304 + state = "rejected";
1.1305 + }, doneList.disable, progressList.lock );
1.1306 +
1.1307 + // Call given func if any
1.1308 + if ( func ) {
1.1309 + func.call( deferred, deferred );
1.1310 + }
1.1311 +
1.1312 + // All done!
1.1313 + return deferred;
1.1314 + },
1.1315 +
1.1316 + // Deferred helper
1.1317 + when: function( firstParam ) {
1.1318 + var args = sliceDeferred.call( arguments, 0 ),
1.1319 + i = 0,
1.1320 + length = args.length,
1.1321 + pValues = new Array( length ),
1.1322 + count = length,
1.1323 + pCount = length,
1.1324 + deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
1.1325 + firstParam :
1.1326 + jQuery.Deferred(),
1.1327 + promise = deferred.promise();
1.1328 + function resolveFunc( i ) {
1.1329 + return function( value ) {
1.1330 + args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
1.1331 + if ( !( --count ) ) {
1.1332 + deferred.resolveWith( deferred, args );
1.1333 + }
1.1334 + };
1.1335 + }
1.1336 + function progressFunc( i ) {
1.1337 + return function( value ) {
1.1338 + pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
1.1339 + deferred.notifyWith( promise, pValues );
1.1340 + };
1.1341 + }
1.1342 + if ( length > 1 ) {
1.1343 + for ( ; i < length; i++ ) {
1.1344 + if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
1.1345 + args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
1.1346 + } else {
1.1347 + --count;
1.1348 + }
1.1349 + }
1.1350 + if ( !count ) {
1.1351 + deferred.resolveWith( deferred, args );
1.1352 + }
1.1353 + } else if ( deferred !== firstParam ) {
1.1354 + deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
1.1355 + }
1.1356 + return promise;
1.1357 + }
1.1358 +});
1.1359 +
1.1360 +
1.1361 +
1.1362 +
1.1363 +jQuery.support = (function() {
1.1364 +
1.1365 + var support,
1.1366 + all,
1.1367 + a,
1.1368 + select,
1.1369 + opt,
1.1370 + input,
1.1371 + fragment,
1.1372 + tds,
1.1373 + events,
1.1374 + eventName,
1.1375 + i,
1.1376 + isSupported,
1.1377 + div = document.createElement( "div" ),
1.1378 + documentElement = document.documentElement;
1.1379 +
1.1380 + // Preliminary tests
1.1381 + div.setAttribute("className", "t");
1.1382 + div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
1.1383 +
1.1384 + all = div.getElementsByTagName( "*" );
1.1385 + a = div.getElementsByTagName( "a" )[ 0 ];
1.1386 +
1.1387 + // Can't get basic test support
1.1388 + if ( !all || !all.length || !a ) {
1.1389 + return {};
1.1390 + }
1.1391 +
1.1392 + // First batch of supports tests
1.1393 + select = document.createElement( "select" );
1.1394 + opt = select.appendChild( document.createElement("option") );
1.1395 + input = div.getElementsByTagName( "input" )[ 0 ];
1.1396 +
1.1397 + support = {
1.1398 + // IE strips leading whitespace when .innerHTML is used
1.1399 + leadingWhitespace: ( div.firstChild.nodeType === 3 ),
1.1400 +
1.1401 + // Make sure that tbody elements aren't automatically inserted
1.1402 + // IE will insert them into empty tables
1.1403 + tbody: !div.getElementsByTagName("tbody").length,
1.1404 +
1.1405 + // Make sure that link elements get serialized correctly by innerHTML
1.1406 + // This requires a wrapper element in IE
1.1407 + htmlSerialize: !!div.getElementsByTagName("link").length,
1.1408 +
1.1409 + // Get the style information from getAttribute
1.1410 + // (IE uses .cssText instead)
1.1411 + style: /top/.test( a.getAttribute("style") ),
1.1412 +
1.1413 + // Make sure that URLs aren't manipulated
1.1414 + // (IE normalizes it by default)
1.1415 + hrefNormalized: ( a.getAttribute("href") === "/a" ),
1.1416 +
1.1417 + // Make sure that element opacity exists
1.1418 + // (IE uses filter instead)
1.1419 + // Use a regex to work around a WebKit issue. See #5145
1.1420 + opacity: /^0.55/.test( a.style.opacity ),
1.1421 +
1.1422 + // Verify style float existence
1.1423 + // (IE uses styleFloat instead of cssFloat)
1.1424 + cssFloat: !!a.style.cssFloat,
1.1425 +
1.1426 + // Make sure that if no value is specified for a checkbox
1.1427 + // that it defaults to "on".
1.1428 + // (WebKit defaults to "" instead)
1.1429 + checkOn: ( input.value === "on" ),
1.1430 +
1.1431 + // Make sure that a selected-by-default option has a working selected property.
1.1432 + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
1.1433 + optSelected: opt.selected,
1.1434 +
1.1435 + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
1.1436 + getSetAttribute: div.className !== "t",
1.1437 +
1.1438 + // Tests for enctype support on a form(#6743)
1.1439 + enctype: !!document.createElement("form").enctype,
1.1440 +
1.1441 + // Makes sure cloning an html5 element does not cause problems
1.1442 + // Where outerHTML is undefined, this still works
1.1443 + html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
1.1444 +
1.1445 + // Will be defined later
1.1446 + submitBubbles: true,
1.1447 + changeBubbles: true,
1.1448 + focusinBubbles: false,
1.1449 + deleteExpando: true,
1.1450 + noCloneEvent: true,
1.1451 + inlineBlockNeedsLayout: false,
1.1452 + shrinkWrapBlocks: false,
1.1453 + reliableMarginRight: true,
1.1454 + pixelMargin: true
1.1455 + };
1.1456 +
1.1457 + // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
1.1458 + jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
1.1459 +
1.1460 + // Make sure checked status is properly cloned
1.1461 + input.checked = true;
1.1462 + support.noCloneChecked = input.cloneNode( true ).checked;
1.1463 +
1.1464 + // Make sure that the options inside disabled selects aren't marked as disabled
1.1465 + // (WebKit marks them as disabled)
1.1466 + select.disabled = true;
1.1467 + support.optDisabled = !opt.disabled;
1.1468 +
1.1469 + // Test to see if it's possible to delete an expando from an element
1.1470 + // Fails in Internet Explorer
1.1471 + try {
1.1472 + delete div.test;
1.1473 + } catch( e ) {
1.1474 + support.deleteExpando = false;
1.1475 + }
1.1476 +
1.1477 + if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
1.1478 + div.attachEvent( "onclick", function() {
1.1479 + // Cloning a node shouldn't copy over any
1.1480 + // bound event handlers (IE does this)
1.1481 + support.noCloneEvent = false;
1.1482 + });
1.1483 + div.cloneNode( true ).fireEvent( "onclick" );
1.1484 + }
1.1485 +
1.1486 + // Check if a radio maintains its value
1.1487 + // after being appended to the DOM
1.1488 + input = document.createElement("input");
1.1489 + input.value = "t";
1.1490 + input.setAttribute("type", "radio");
1.1491 + support.radioValue = input.value === "t";
1.1492 +
1.1493 + input.setAttribute("checked", "checked");
1.1494 +
1.1495 + // #11217 - WebKit loses check when the name is after the checked attribute
1.1496 + input.setAttribute( "name", "t" );
1.1497 +
1.1498 + div.appendChild( input );
1.1499 + fragment = document.createDocumentFragment();
1.1500 + fragment.appendChild( div.lastChild );
1.1501 +
1.1502 + // WebKit doesn't clone checked state correctly in fragments
1.1503 + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
1.1504 +
1.1505 + // Check if a disconnected checkbox will retain its checked
1.1506 + // value of true after appended to the DOM (IE6/7)
1.1507 + support.appendChecked = input.checked;
1.1508 +
1.1509 + fragment.removeChild( input );
1.1510 + fragment.appendChild( div );
1.1511 +
1.1512 + // Technique from Juriy Zaytsev
1.1513 + // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
1.1514 + // We only care about the case where non-standard event systems
1.1515 + // are used, namely in IE. Short-circuiting here helps us to
1.1516 + // avoid an eval call (in setAttribute) which can cause CSP
1.1517 + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
1.1518 + if ( div.attachEvent ) {
1.1519 + for ( i in {
1.1520 + submit: 1,
1.1521 + change: 1,
1.1522 + focusin: 1
1.1523 + }) {
1.1524 + eventName = "on" + i;
1.1525 + isSupported = ( eventName in div );
1.1526 + if ( !isSupported ) {
1.1527 + div.setAttribute( eventName, "return;" );
1.1528 + isSupported = ( typeof div[ eventName ] === "function" );
1.1529 + }
1.1530 + support[ i + "Bubbles" ] = isSupported;
1.1531 + }
1.1532 + }
1.1533 +
1.1534 + fragment.removeChild( div );
1.1535 +
1.1536 + // Null elements to avoid leaks in IE
1.1537 + fragment = select = opt = div = input = null;
1.1538 +
1.1539 + // Run tests that need a body at doc ready
1.1540 + jQuery(function() {
1.1541 + var container, outer, inner, table, td, offsetSupport,
1.1542 + marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
1.1543 + paddingMarginBorderVisibility, paddingMarginBorder,
1.1544 + body = document.getElementsByTagName("body")[0];
1.1545 +
1.1546 + if ( !body ) {
1.1547 + // Return for frameset docs that don't have a body
1.1548 + return;
1.1549 + }
1.1550 +
1.1551 + conMarginTop = 1;
1.1552 + paddingMarginBorder = "padding:0;margin:0;border:";
1.1553 + positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
1.1554 + paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
1.1555 + style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
1.1556 + html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
1.1557 + "<table " + style + "' cellpadding='0' cellspacing='0'>" +
1.1558 + "<tr><td></td></tr></table>";
1.1559 +
1.1560 + container = document.createElement("div");
1.1561 + container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
1.1562 + body.insertBefore( container, body.firstChild );
1.1563 +
1.1564 + // Construct the test element
1.1565 + div = document.createElement("div");
1.1566 + container.appendChild( div );
1.1567 +
1.1568 + // Check if table cells still have offsetWidth/Height when they are set
1.1569 + // to display:none and there are still other visible table cells in a
1.1570 + // table row; if so, offsetWidth/Height are not reliable for use when
1.1571 + // determining if an element has been hidden directly using
1.1572 + // display:none (it is still safe to use offsets if a parent element is
1.1573 + // hidden; don safety goggles and see bug #4512 for more information).
1.1574 + // (only IE 8 fails this test)
1.1575 + div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
1.1576 + tds = div.getElementsByTagName( "td" );
1.1577 + isSupported = ( tds[ 0 ].offsetHeight === 0 );
1.1578 +
1.1579 + tds[ 0 ].style.display = "";
1.1580 + tds[ 1 ].style.display = "none";
1.1581 +
1.1582 + // Check if empty table cells still have offsetWidth/Height
1.1583 + // (IE <= 8 fail this test)
1.1584 + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
1.1585 +
1.1586 + // Check if div with explicit width and no margin-right incorrectly
1.1587 + // gets computed margin-right based on width of container. For more
1.1588 + // info see bug #3333
1.1589 + // Fails in WebKit before Feb 2011 nightlies
1.1590 + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1.1591 + if ( window.getComputedStyle ) {
1.1592 + div.innerHTML = "";
1.1593 + marginDiv = document.createElement( "div" );
1.1594 + marginDiv.style.width = "0";
1.1595 + marginDiv.style.marginRight = "0";
1.1596 + div.style.width = "2px";
1.1597 + div.appendChild( marginDiv );
1.1598 + support.reliableMarginRight =
1.1599 + ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
1.1600 + }
1.1601 +
1.1602 + if ( typeof div.style.zoom !== "undefined" ) {
1.1603 + // Check if natively block-level elements act like inline-block
1.1604 + // elements when setting their display to 'inline' and giving
1.1605 + // them layout
1.1606 + // (IE < 8 does this)
1.1607 + div.innerHTML = "";
1.1608 + div.style.width = div.style.padding = "1px";
1.1609 + div.style.border = 0;
1.1610 + div.style.overflow = "hidden";
1.1611 + div.style.display = "inline";
1.1612 + div.style.zoom = 1;
1.1613 + support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
1.1614 +
1.1615 + // Check if elements with layout shrink-wrap their children
1.1616 + // (IE 6 does this)
1.1617 + div.style.display = "block";
1.1618 + div.style.overflow = "visible";
1.1619 + div.innerHTML = "<div style='width:5px;'></div>";
1.1620 + support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
1.1621 + }
1.1622 +
1.1623 + div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
1.1624 + div.innerHTML = html;
1.1625 +
1.1626 + outer = div.firstChild;
1.1627 + inner = outer.firstChild;
1.1628 + td = outer.nextSibling.firstChild.firstChild;
1.1629 +
1.1630 + offsetSupport = {
1.1631 + doesNotAddBorder: ( inner.offsetTop !== 5 ),
1.1632 + doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
1.1633 + };
1.1634 +
1.1635 + inner.style.position = "fixed";
1.1636 + inner.style.top = "20px";
1.1637 +
1.1638 + // safari subtracts parent border width here which is 5px
1.1639 + offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
1.1640 + inner.style.position = inner.style.top = "";
1.1641 +
1.1642 + outer.style.overflow = "hidden";
1.1643 + outer.style.position = "relative";
1.1644 +
1.1645 + offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
1.1646 + offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
1.1647 +
1.1648 + if ( window.getComputedStyle ) {
1.1649 + div.style.marginTop = "1%";
1.1650 + support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
1.1651 + }
1.1652 +
1.1653 + if ( typeof container.style.zoom !== "undefined" ) {
1.1654 + container.style.zoom = 1;
1.1655 + }
1.1656 +
1.1657 + body.removeChild( container );
1.1658 + marginDiv = div = container = null;
1.1659 +
1.1660 + jQuery.extend( support, offsetSupport );
1.1661 + });
1.1662 +
1.1663 + return support;
1.1664 +})();
1.1665 +
1.1666 +
1.1667 +
1.1668 +
1.1669 +var rbrace = /^(?:\{.*\}|\[.*\])$/,
1.1670 + rmultiDash = /([A-Z])/g;
1.1671 +
1.1672 +jQuery.extend({
1.1673 + cache: {},
1.1674 +
1.1675 + // Please use with caution
1.1676 + uuid: 0,
1.1677 +
1.1678 + // Unique for each copy of jQuery on the page
1.1679 + // Non-digits removed to match rinlinejQuery
1.1680 + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
1.1681 +
1.1682 + // The following elements throw uncatchable exceptions if you
1.1683 + // attempt to add expando properties to them.
1.1684 + noData: {
1.1685 + "embed": true,
1.1686 + // Ban all objects except for Flash (which handle expandos)
1.1687 + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
1.1688 + "applet": true
1.1689 + },
1.1690 +
1.1691 + hasData: function( elem ) {
1.1692 + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
1.1693 + return !!elem && !isEmptyDataObject( elem );
1.1694 + },
1.1695 +
1.1696 + data: function( elem, name, data, pvt /* Internal Use Only */ ) {
1.1697 + if ( !jQuery.acceptData( elem ) ) {
1.1698 + return;
1.1699 + }
1.1700 +
1.1701 + var privateCache, thisCache, ret,
1.1702 + internalKey = jQuery.expando,
1.1703 + getByName = typeof name === "string",
1.1704 +
1.1705 + // We have to handle DOM nodes and JS objects differently because IE6-7
1.1706 + // can't GC object references properly across the DOM-JS boundary
1.1707 + isNode = elem.nodeType,
1.1708 +
1.1709 + // Only DOM nodes need the global jQuery cache; JS object data is
1.1710 + // attached directly to the object so GC can occur automatically
1.1711 + cache = isNode ? jQuery.cache : elem,
1.1712 +
1.1713 + // Only defining an ID for JS objects if its cache already exists allows
1.1714 + // the code to shortcut on the same path as a DOM node with no cache
1.1715 + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
1.1716 + isEvents = name === "events";
1.1717 +
1.1718 + // Avoid doing any more work than we need to when trying to get data on an
1.1719 + // object that has no data at all
1.1720 + if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
1.1721 + return;
1.1722 + }
1.1723 +
1.1724 + if ( !id ) {
1.1725 + // Only DOM nodes need a new unique ID for each element since their data
1.1726 + // ends up in the global cache
1.1727 + if ( isNode ) {
1.1728 + elem[ internalKey ] = id = ++jQuery.uuid;
1.1729 + } else {
1.1730 + id = internalKey;
1.1731 + }
1.1732 + }
1.1733 +
1.1734 + if ( !cache[ id ] ) {
1.1735 + cache[ id ] = {};
1.1736 +
1.1737 + // Avoids exposing jQuery metadata on plain JS objects when the object
1.1738 + // is serialized using JSON.stringify
1.1739 + if ( !isNode ) {
1.1740 + cache[ id ].toJSON = jQuery.noop;
1.1741 + }
1.1742 + }
1.1743 +
1.1744 + // An object can be passed to jQuery.data instead of a key/value pair; this gets
1.1745 + // shallow copied over onto the existing cache
1.1746 + if ( typeof name === "object" || typeof name === "function" ) {
1.1747 + if ( pvt ) {
1.1748 + cache[ id ] = jQuery.extend( cache[ id ], name );
1.1749 + } else {
1.1750 + cache[ id ].data = jQuery.extend( cache[ id ].data, name );
1.1751 + }
1.1752 + }
1.1753 +
1.1754 + privateCache = thisCache = cache[ id ];
1.1755 +
1.1756 + // jQuery data() is stored in a separate object inside the object's internal data
1.1757 + // cache in order to avoid key collisions between internal data and user-defined
1.1758 + // data.
1.1759 + if ( !pvt ) {
1.1760 + if ( !thisCache.data ) {
1.1761 + thisCache.data = {};
1.1762 + }
1.1763 +
1.1764 + thisCache = thisCache.data;
1.1765 + }
1.1766 +
1.1767 + if ( data !== undefined ) {
1.1768 + thisCache[ jQuery.camelCase( name ) ] = data;
1.1769 + }
1.1770 +
1.1771 + // Users should not attempt to inspect the internal events object using jQuery.data,
1.1772 + // it is undocumented and subject to change. But does anyone listen? No.
1.1773 + if ( isEvents && !thisCache[ name ] ) {
1.1774 + return privateCache.events;
1.1775 + }
1.1776 +
1.1777 + // Check for both converted-to-camel and non-converted data property names
1.1778 + // If a data property was specified
1.1779 + if ( getByName ) {
1.1780 +
1.1781 + // First Try to find as-is property data
1.1782 + ret = thisCache[ name ];
1.1783 +
1.1784 + // Test for null|undefined property data
1.1785 + if ( ret == null ) {
1.1786 +
1.1787 + // Try to find the camelCased property
1.1788 + ret = thisCache[ jQuery.camelCase( name ) ];
1.1789 + }
1.1790 + } else {
1.1791 + ret = thisCache;
1.1792 + }
1.1793 +
1.1794 + return ret;
1.1795 + },
1.1796 +
1.1797 + removeData: function( elem, name, pvt /* Internal Use Only */ ) {
1.1798 + if ( !jQuery.acceptData( elem ) ) {
1.1799 + return;
1.1800 + }
1.1801 +
1.1802 + var thisCache, i, l,
1.1803 +
1.1804 + // Reference to internal data cache key
1.1805 + internalKey = jQuery.expando,
1.1806 +
1.1807 + isNode = elem.nodeType,
1.1808 +
1.1809 + // See jQuery.data for more information
1.1810 + cache = isNode ? jQuery.cache : elem,
1.1811 +
1.1812 + // See jQuery.data for more information
1.1813 + id = isNode ? elem[ internalKey ] : internalKey;
1.1814 +
1.1815 + // If there is already no cache entry for this object, there is no
1.1816 + // purpose in continuing
1.1817 + if ( !cache[ id ] ) {
1.1818 + return;
1.1819 + }
1.1820 +
1.1821 + if ( name ) {
1.1822 +
1.1823 + thisCache = pvt ? cache[ id ] : cache[ id ].data;
1.1824 +
1.1825 + if ( thisCache ) {
1.1826 +
1.1827 + // Support array or space separated string names for data keys
1.1828 + if ( !jQuery.isArray( name ) ) {
1.1829 +
1.1830 + // try the string as a key before any manipulation
1.1831 + if ( name in thisCache ) {
1.1832 + name = [ name ];
1.1833 + } else {
1.1834 +
1.1835 + // split the camel cased version by spaces unless a key with the spaces exists
1.1836 + name = jQuery.camelCase( name );
1.1837 + if ( name in thisCache ) {
1.1838 + name = [ name ];
1.1839 + } else {
1.1840 + name = name.split( " " );
1.1841 + }
1.1842 + }
1.1843 + }
1.1844 +
1.1845 + for ( i = 0, l = name.length; i < l; i++ ) {
1.1846 + delete thisCache[ name[i] ];
1.1847 + }
1.1848 +
1.1849 + // If there is no data left in the cache, we want to continue
1.1850 + // and let the cache object itself get destroyed
1.1851 + if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
1.1852 + return;
1.1853 + }
1.1854 + }
1.1855 + }
1.1856 +
1.1857 + // See jQuery.data for more information
1.1858 + if ( !pvt ) {
1.1859 + delete cache[ id ].data;
1.1860 +
1.1861 + // Don't destroy the parent cache unless the internal data object
1.1862 + // had been the only thing left in it
1.1863 + if ( !isEmptyDataObject(cache[ id ]) ) {
1.1864 + return;
1.1865 + }
1.1866 + }
1.1867 +
1.1868 + // Browsers that fail expando deletion also refuse to delete expandos on
1.1869 + // the window, but it will allow it on all other JS objects; other browsers
1.1870 + // don't care
1.1871 + // Ensure that `cache` is not a window object #10080
1.1872 + if ( jQuery.support.deleteExpando || !cache.setInterval ) {
1.1873 + delete cache[ id ];
1.1874 + } else {
1.1875 + cache[ id ] = null;
1.1876 + }
1.1877 +
1.1878 + // We destroyed the cache and need to eliminate the expando on the node to avoid
1.1879 + // false lookups in the cache for entries that no longer exist
1.1880 + if ( isNode ) {
1.1881 + // IE does not allow us to delete expando properties from nodes,
1.1882 + // nor does it have a removeAttribute function on Document nodes;
1.1883 + // we must handle all of these cases
1.1884 + if ( jQuery.support.deleteExpando ) {
1.1885 + delete elem[ internalKey ];
1.1886 + } else if ( elem.removeAttribute ) {
1.1887 + elem.removeAttribute( internalKey );
1.1888 + } else {
1.1889 + elem[ internalKey ] = null;
1.1890 + }
1.1891 + }
1.1892 + },
1.1893 +
1.1894 + // For internal use only.
1.1895 + _data: function( elem, name, data ) {
1.1896 + return jQuery.data( elem, name, data, true );
1.1897 + },
1.1898 +
1.1899 + // A method for determining if a DOM node can handle the data expando
1.1900 + acceptData: function( elem ) {
1.1901 + if ( elem.nodeName ) {
1.1902 + var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
1.1903 +
1.1904 + if ( match ) {
1.1905 + return !(match === true || elem.getAttribute("classid") !== match);
1.1906 + }
1.1907 + }
1.1908 +
1.1909 + return true;
1.1910 + }
1.1911 +});
1.1912 +
1.1913 +jQuery.fn.extend({
1.1914 + data: function( key, value ) {
1.1915 + var parts, part, attr, name, l,
1.1916 + elem = this[0],
1.1917 + i = 0,
1.1918 + data = null;
1.1919 +
1.1920 + // Gets all values
1.1921 + if ( key === undefined ) {
1.1922 + if ( this.length ) {
1.1923 + data = jQuery.data( elem );
1.1924 +
1.1925 + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
1.1926 + attr = elem.attributes;
1.1927 + for ( l = attr.length; i < l; i++ ) {
1.1928 + name = attr[i].name;
1.1929 +
1.1930 + if ( name.indexOf( "data-" ) === 0 ) {
1.1931 + name = jQuery.camelCase( name.substring(5) );
1.1932 +
1.1933 + dataAttr( elem, name, data[ name ] );
1.1934 + }
1.1935 + }
1.1936 + jQuery._data( elem, "parsedAttrs", true );
1.1937 + }
1.1938 + }
1.1939 +
1.1940 + return data;
1.1941 + }
1.1942 +
1.1943 + // Sets multiple values
1.1944 + if ( typeof key === "object" ) {
1.1945 + return this.each(function() {
1.1946 + jQuery.data( this, key );
1.1947 + });
1.1948 + }
1.1949 +
1.1950 + parts = key.split( ".", 2 );
1.1951 + parts[1] = parts[1] ? "." + parts[1] : "";
1.1952 + part = parts[1] + "!";
1.1953 +
1.1954 + return jQuery.access( this, function( value ) {
1.1955 +
1.1956 + if ( value === undefined ) {
1.1957 + data = this.triggerHandler( "getData" + part, [ parts[0] ] );
1.1958 +
1.1959 + // Try to fetch any internally stored data first
1.1960 + if ( data === undefined && elem ) {
1.1961 + data = jQuery.data( elem, key );
1.1962 + data = dataAttr( elem, key, data );
1.1963 + }
1.1964 +
1.1965 + return data === undefined && parts[1] ?
1.1966 + this.data( parts[0] ) :
1.1967 + data;
1.1968 + }
1.1969 +
1.1970 + parts[1] = value;
1.1971 + this.each(function() {
1.1972 + var self = jQuery( this );
1.1973 +
1.1974 + self.triggerHandler( "setData" + part, parts );
1.1975 + jQuery.data( this, key, value );
1.1976 + self.triggerHandler( "changeData" + part, parts );
1.1977 + });
1.1978 + }, null, value, arguments.length > 1, null, false );
1.1979 + },
1.1980 +
1.1981 + removeData: function( key ) {
1.1982 + return this.each(function() {
1.1983 + jQuery.removeData( this, key );
1.1984 + });
1.1985 + }
1.1986 +});
1.1987 +
1.1988 +function dataAttr( elem, key, data ) {
1.1989 + // If nothing was found internally, try to fetch any
1.1990 + // data from the HTML5 data-* attribute
1.1991 + if ( data === undefined && elem.nodeType === 1 ) {
1.1992 +
1.1993 + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
1.1994 +
1.1995 + data = elem.getAttribute( name );
1.1996 +
1.1997 + if ( typeof data === "string" ) {
1.1998 + try {
1.1999 + data = data === "true" ? true :
1.2000 + data === "false" ? false :
1.2001 + data === "null" ? null :
1.2002 + jQuery.isNumeric( data ) ? +data :
1.2003 + rbrace.test( data ) ? jQuery.parseJSON( data ) :
1.2004 + data;
1.2005 + } catch( e ) {}
1.2006 +
1.2007 + // Make sure we set the data so it isn't changed later
1.2008 + jQuery.data( elem, key, data );
1.2009 +
1.2010 + } else {
1.2011 + data = undefined;
1.2012 + }
1.2013 + }
1.2014 +
1.2015 + return data;
1.2016 +}
1.2017 +
1.2018 +// checks a cache object for emptiness
1.2019 +function isEmptyDataObject( obj ) {
1.2020 + for ( var name in obj ) {
1.2021 +
1.2022 + // if the public data object is empty, the private is still empty
1.2023 + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
1.2024 + continue;
1.2025 + }
1.2026 + if ( name !== "toJSON" ) {
1.2027 + return false;
1.2028 + }
1.2029 + }
1.2030 +
1.2031 + return true;
1.2032 +}
1.2033 +
1.2034 +
1.2035 +
1.2036 +
1.2037 +function handleQueueMarkDefer( elem, type, src ) {
1.2038 + var deferDataKey = type + "defer",
1.2039 + queueDataKey = type + "queue",
1.2040 + markDataKey = type + "mark",
1.2041 + defer = jQuery._data( elem, deferDataKey );
1.2042 + if ( defer &&
1.2043 + ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
1.2044 + ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
1.2045 + // Give room for hard-coded callbacks to fire first
1.2046 + // and eventually mark/queue something else on the element
1.2047 + setTimeout( function() {
1.2048 + if ( !jQuery._data( elem, queueDataKey ) &&
1.2049 + !jQuery._data( elem, markDataKey ) ) {
1.2050 + jQuery.removeData( elem, deferDataKey, true );
1.2051 + defer.fire();
1.2052 + }
1.2053 + }, 0 );
1.2054 + }
1.2055 +}
1.2056 +
1.2057 +jQuery.extend({
1.2058 +
1.2059 + _mark: function( elem, type ) {
1.2060 + if ( elem ) {
1.2061 + type = ( type || "fx" ) + "mark";
1.2062 + jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
1.2063 + }
1.2064 + },
1.2065 +
1.2066 + _unmark: function( force, elem, type ) {
1.2067 + if ( force !== true ) {
1.2068 + type = elem;
1.2069 + elem = force;
1.2070 + force = false;
1.2071 + }
1.2072 + if ( elem ) {
1.2073 + type = type || "fx";
1.2074 + var key = type + "mark",
1.2075 + count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
1.2076 + if ( count ) {
1.2077 + jQuery._data( elem, key, count );
1.2078 + } else {
1.2079 + jQuery.removeData( elem, key, true );
1.2080 + handleQueueMarkDefer( elem, type, "mark" );
1.2081 + }
1.2082 + }
1.2083 + },
1.2084 +
1.2085 + queue: function( elem, type, data ) {
1.2086 + var q;
1.2087 + if ( elem ) {
1.2088 + type = ( type || "fx" ) + "queue";
1.2089 + q = jQuery._data( elem, type );
1.2090 +
1.2091 + // Speed up dequeue by getting out quickly if this is just a lookup
1.2092 + if ( data ) {
1.2093 + if ( !q || jQuery.isArray(data) ) {
1.2094 + q = jQuery._data( elem, type, jQuery.makeArray(data) );
1.2095 + } else {
1.2096 + q.push( data );
1.2097 + }
1.2098 + }
1.2099 + return q || [];
1.2100 + }
1.2101 + },
1.2102 +
1.2103 + dequeue: function( elem, type ) {
1.2104 + type = type || "fx";
1.2105 +
1.2106 + var queue = jQuery.queue( elem, type ),
1.2107 + fn = queue.shift(),
1.2108 + hooks = {};
1.2109 +
1.2110 + // If the fx queue is dequeued, always remove the progress sentinel
1.2111 + if ( fn === "inprogress" ) {
1.2112 + fn = queue.shift();
1.2113 + }
1.2114 +
1.2115 + if ( fn ) {
1.2116 + // Add a progress sentinel to prevent the fx queue from being
1.2117 + // automatically dequeued
1.2118 + if ( type === "fx" ) {
1.2119 + queue.unshift( "inprogress" );
1.2120 + }
1.2121 +
1.2122 + jQuery._data( elem, type + ".run", hooks );
1.2123 + fn.call( elem, function() {
1.2124 + jQuery.dequeue( elem, type );
1.2125 + }, hooks );
1.2126 + }
1.2127 +
1.2128 + if ( !queue.length ) {
1.2129 + jQuery.removeData( elem, type + "queue " + type + ".run", true );
1.2130 + handleQueueMarkDefer( elem, type, "queue" );
1.2131 + }
1.2132 + }
1.2133 +});
1.2134 +
1.2135 +jQuery.fn.extend({
1.2136 + queue: function( type, data ) {
1.2137 + var setter = 2;
1.2138 +
1.2139 + if ( typeof type !== "string" ) {
1.2140 + data = type;
1.2141 + type = "fx";
1.2142 + setter--;
1.2143 + }
1.2144 +
1.2145 + if ( arguments.length < setter ) {
1.2146 + return jQuery.queue( this[0], type );
1.2147 + }
1.2148 +
1.2149 + return data === undefined ?
1.2150 + this :
1.2151 + this.each(function() {
1.2152 + var queue = jQuery.queue( this, type, data );
1.2153 +
1.2154 + if ( type === "fx" && queue[0] !== "inprogress" ) {
1.2155 + jQuery.dequeue( this, type );
1.2156 + }
1.2157 + });
1.2158 + },
1.2159 + dequeue: function( type ) {
1.2160 + return this.each(function() {
1.2161 + jQuery.dequeue( this, type );
1.2162 + });
1.2163 + },
1.2164 + // Based off of the plugin by Clint Helfers, with permission.
1.2165 + // http://blindsignals.com/index.php/2009/07/jquery-delay/
1.2166 + delay: function( time, type ) {
1.2167 + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
1.2168 + type = type || "fx";
1.2169 +
1.2170 + return this.queue( type, function( next, hooks ) {
1.2171 + var timeout = setTimeout( next, time );
1.2172 + hooks.stop = function() {
1.2173 + clearTimeout( timeout );
1.2174 + };
1.2175 + });
1.2176 + },
1.2177 + clearQueue: function( type ) {
1.2178 + return this.queue( type || "fx", [] );
1.2179 + },
1.2180 + // Get a promise resolved when queues of a certain type
1.2181 + // are emptied (fx is the type by default)
1.2182 + promise: function( type, object ) {
1.2183 + if ( typeof type !== "string" ) {
1.2184 + object = type;
1.2185 + type = undefined;
1.2186 + }
1.2187 + type = type || "fx";
1.2188 + var defer = jQuery.Deferred(),
1.2189 + elements = this,
1.2190 + i = elements.length,
1.2191 + count = 1,
1.2192 + deferDataKey = type + "defer",
1.2193 + queueDataKey = type + "queue",
1.2194 + markDataKey = type + "mark",
1.2195 + tmp;
1.2196 + function resolve() {
1.2197 + if ( !( --count ) ) {
1.2198 + defer.resolveWith( elements, [ elements ] );
1.2199 + }
1.2200 + }
1.2201 + while( i-- ) {
1.2202 + if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
1.2203 + ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
1.2204 + jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
1.2205 + jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
1.2206 + count++;
1.2207 + tmp.add( resolve );
1.2208 + }
1.2209 + }
1.2210 + resolve();
1.2211 + return defer.promise( object );
1.2212 + }
1.2213 +});
1.2214 +
1.2215 +
1.2216 +
1.2217 +
1.2218 +var rclass = /[\n\t\r]/g,
1.2219 + rspace = /\s+/,
1.2220 + rreturn = /\r/g,
1.2221 + rtype = /^(?:button|input)$/i,
1.2222 + rfocusable = /^(?:button|input|object|select|textarea)$/i,
1.2223 + rclickable = /^a(?:rea)?$/i,
1.2224 + rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
1.2225 + getSetAttribute = jQuery.support.getSetAttribute,
1.2226 + nodeHook, boolHook, fixSpecified;
1.2227 +
1.2228 +jQuery.fn.extend({
1.2229 + attr: function( name, value ) {
1.2230 + return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
1.2231 + },
1.2232 +
1.2233 + removeAttr: function( name ) {
1.2234 + return this.each(function() {
1.2235 + jQuery.removeAttr( this, name );
1.2236 + });
1.2237 + },
1.2238 +
1.2239 + prop: function( name, value ) {
1.2240 + return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
1.2241 + },
1.2242 +
1.2243 + removeProp: function( name ) {
1.2244 + name = jQuery.propFix[ name ] || name;
1.2245 + return this.each(function() {
1.2246 + // try/catch handles cases where IE balks (such as removing a property on window)
1.2247 + try {
1.2248 + this[ name ] = undefined;
1.2249 + delete this[ name ];
1.2250 + } catch( e ) {}
1.2251 + });
1.2252 + },
1.2253 +
1.2254 + addClass: function( value ) {
1.2255 + var classNames, i, l, elem,
1.2256 + setClass, c, cl;
1.2257 +
1.2258 + if ( jQuery.isFunction( value ) ) {
1.2259 + return this.each(function( j ) {
1.2260 + jQuery( this ).addClass( value.call(this, j, this.className) );
1.2261 + });
1.2262 + }
1.2263 +
1.2264 + if ( value && typeof value === "string" ) {
1.2265 + classNames = value.split( rspace );
1.2266 +
1.2267 + for ( i = 0, l = this.length; i < l; i++ ) {
1.2268 + elem = this[ i ];
1.2269 +
1.2270 + if ( elem.nodeType === 1 ) {
1.2271 + if ( !elem.className && classNames.length === 1 ) {
1.2272 + elem.className = value;
1.2273 +
1.2274 + } else {
1.2275 + setClass = " " + elem.className + " ";
1.2276 +
1.2277 + for ( c = 0, cl = classNames.length; c < cl; c++ ) {
1.2278 + if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
1.2279 + setClass += classNames[ c ] + " ";
1.2280 + }
1.2281 + }
1.2282 + elem.className = jQuery.trim( setClass );
1.2283 + }
1.2284 + }
1.2285 + }
1.2286 + }
1.2287 +
1.2288 + return this;
1.2289 + },
1.2290 +
1.2291 + removeClass: function( value ) {
1.2292 + var classNames, i, l, elem, className, c, cl;
1.2293 +
1.2294 + if ( jQuery.isFunction( value ) ) {
1.2295 + return this.each(function( j ) {
1.2296 + jQuery( this ).removeClass( value.call(this, j, this.className) );
1.2297 + });
1.2298 + }
1.2299 +
1.2300 + if ( (value && typeof value === "string") || value === undefined ) {
1.2301 + classNames = ( value || "" ).split( rspace );
1.2302 +
1.2303 + for ( i = 0, l = this.length; i < l; i++ ) {
1.2304 + elem = this[ i ];
1.2305 +
1.2306 + if ( elem.nodeType === 1 && elem.className ) {
1.2307 + if ( value ) {
1.2308 + className = (" " + elem.className + " ").replace( rclass, " " );
1.2309 + for ( c = 0, cl = classNames.length; c < cl; c++ ) {
1.2310 + className = className.replace(" " + classNames[ c ] + " ", " ");
1.2311 + }
1.2312 + elem.className = jQuery.trim( className );
1.2313 +
1.2314 + } else {
1.2315 + elem.className = "";
1.2316 + }
1.2317 + }
1.2318 + }
1.2319 + }
1.2320 +
1.2321 + return this;
1.2322 + },
1.2323 +
1.2324 + toggleClass: function( value, stateVal ) {
1.2325 + var type = typeof value,
1.2326 + isBool = typeof stateVal === "boolean";
1.2327 +
1.2328 + if ( jQuery.isFunction( value ) ) {
1.2329 + return this.each(function( i ) {
1.2330 + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
1.2331 + });
1.2332 + }
1.2333 +
1.2334 + return this.each(function() {
1.2335 + if ( type === "string" ) {
1.2336 + // toggle individual class names
1.2337 + var className,
1.2338 + i = 0,
1.2339 + self = jQuery( this ),
1.2340 + state = stateVal,
1.2341 + classNames = value.split( rspace );
1.2342 +
1.2343 + while ( (className = classNames[ i++ ]) ) {
1.2344 + // check each className given, space seperated list
1.2345 + state = isBool ? state : !self.hasClass( className );
1.2346 + self[ state ? "addClass" : "removeClass" ]( className );
1.2347 + }
1.2348 +
1.2349 + } else if ( type === "undefined" || type === "boolean" ) {
1.2350 + if ( this.className ) {
1.2351 + // store className if set
1.2352 + jQuery._data( this, "__className__", this.className );
1.2353 + }
1.2354 +
1.2355 + // toggle whole className
1.2356 + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
1.2357 + }
1.2358 + });
1.2359 + },
1.2360 +
1.2361 + hasClass: function( selector ) {
1.2362 + var className = " " + selector + " ",
1.2363 + i = 0,
1.2364 + l = this.length;
1.2365 + for ( ; i < l; i++ ) {
1.2366 + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
1.2367 + return true;
1.2368 + }
1.2369 + }
1.2370 +
1.2371 + return false;
1.2372 + },
1.2373 +
1.2374 + val: function( value ) {
1.2375 + var hooks, ret, isFunction,
1.2376 + elem = this[0];
1.2377 +
1.2378 + if ( !arguments.length ) {
1.2379 + if ( elem ) {
1.2380 + hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
1.2381 +
1.2382 + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
1.2383 + return ret;
1.2384 + }
1.2385 +
1.2386 + ret = elem.value;
1.2387 +
1.2388 + return typeof ret === "string" ?
1.2389 + // handle most common string cases
1.2390 + ret.replace(rreturn, "") :
1.2391 + // handle cases where value is null/undef or number
1.2392 + ret == null ? "" : ret;
1.2393 + }
1.2394 +
1.2395 + return;
1.2396 + }
1.2397 +
1.2398 + isFunction = jQuery.isFunction( value );
1.2399 +
1.2400 + return this.each(function( i ) {
1.2401 + var self = jQuery(this), val;
1.2402 +
1.2403 + if ( this.nodeType !== 1 ) {
1.2404 + return;
1.2405 + }
1.2406 +
1.2407 + if ( isFunction ) {
1.2408 + val = value.call( this, i, self.val() );
1.2409 + } else {
1.2410 + val = value;
1.2411 + }
1.2412 +
1.2413 + // Treat null/undefined as ""; convert numbers to string
1.2414 + if ( val == null ) {
1.2415 + val = "";
1.2416 + } else if ( typeof val === "number" ) {
1.2417 + val += "";
1.2418 + } else if ( jQuery.isArray( val ) ) {
1.2419 + val = jQuery.map(val, function ( value ) {
1.2420 + return value == null ? "" : value + "";
1.2421 + });
1.2422 + }
1.2423 +
1.2424 + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
1.2425 +
1.2426 + // If set returns undefined, fall back to normal setting
1.2427 + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
1.2428 + this.value = val;
1.2429 + }
1.2430 + });
1.2431 + }
1.2432 +});
1.2433 +
1.2434 +jQuery.extend({
1.2435 + valHooks: {
1.2436 + option: {
1.2437 + get: function( elem ) {
1.2438 + // attributes.value is undefined in Blackberry 4.7 but
1.2439 + // uses .value. See #6932
1.2440 + var val = elem.attributes.value;
1.2441 + return !val || val.specified ? elem.value : elem.text;
1.2442 + }
1.2443 + },
1.2444 + select: {
1.2445 + get: function( elem ) {
1.2446 + var value, i, max, option,
1.2447 + index = elem.selectedIndex,
1.2448 + values = [],
1.2449 + options = elem.options,
1.2450 + one = elem.type === "select-one";
1.2451 +
1.2452 + // Nothing was selected
1.2453 + if ( index < 0 ) {
1.2454 + return null;
1.2455 + }
1.2456 +
1.2457 + // Loop through all the selected options
1.2458 + i = one ? index : 0;
1.2459 + max = one ? index + 1 : options.length;
1.2460 + for ( ; i < max; i++ ) {
1.2461 + option = options[ i ];
1.2462 +
1.2463 + // Don't return options that are disabled or in a disabled optgroup
1.2464 + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
1.2465 + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
1.2466 +
1.2467 + // Get the specific value for the option
1.2468 + value = jQuery( option ).val();
1.2469 +
1.2470 + // We don't need an array for one selects
1.2471 + if ( one ) {
1.2472 + return value;
1.2473 + }
1.2474 +
1.2475 + // Multi-Selects return an array
1.2476 + values.push( value );
1.2477 + }
1.2478 + }
1.2479 +
1.2480 + // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
1.2481 + if ( one && !values.length && options.length ) {
1.2482 + return jQuery( options[ index ] ).val();
1.2483 + }
1.2484 +
1.2485 + return values;
1.2486 + },
1.2487 +
1.2488 + set: function( elem, value ) {
1.2489 + var values = jQuery.makeArray( value );
1.2490 +
1.2491 + jQuery(elem).find("option").each(function() {
1.2492 + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
1.2493 + });
1.2494 +
1.2495 + if ( !values.length ) {
1.2496 + elem.selectedIndex = -1;
1.2497 + }
1.2498 + return values;
1.2499 + }
1.2500 + }
1.2501 + },
1.2502 +
1.2503 + attrFn: {
1.2504 + val: true,
1.2505 + css: true,
1.2506 + html: true,
1.2507 + text: true,
1.2508 + data: true,
1.2509 + width: true,
1.2510 + height: true,
1.2511 + offset: true
1.2512 + },
1.2513 +
1.2514 + attr: function( elem, name, value, pass ) {
1.2515 + var ret, hooks, notxml,
1.2516 + nType = elem.nodeType;
1.2517 +
1.2518 + // don't get/set attributes on text, comment and attribute nodes
1.2519 + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
1.2520 + return;
1.2521 + }
1.2522 +
1.2523 + if ( pass && name in jQuery.attrFn ) {
1.2524 + return jQuery( elem )[ name ]( value );
1.2525 + }
1.2526 +
1.2527 + // Fallback to prop when attributes are not supported
1.2528 + if ( typeof elem.getAttribute === "undefined" ) {
1.2529 + return jQuery.prop( elem, name, value );
1.2530 + }
1.2531 +
1.2532 + notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
1.2533 +
1.2534 + // All attributes are lowercase
1.2535 + // Grab necessary hook if one is defined
1.2536 + if ( notxml ) {
1.2537 + name = name.toLowerCase();
1.2538 + hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
1.2539 + }
1.2540 +
1.2541 + if ( value !== undefined ) {
1.2542 +
1.2543 + if ( value === null ) {
1.2544 + jQuery.removeAttr( elem, name );
1.2545 + return;
1.2546 +
1.2547 + } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
1.2548 + return ret;
1.2549 +
1.2550 + } else {
1.2551 + elem.setAttribute( name, "" + value );
1.2552 + return value;
1.2553 + }
1.2554 +
1.2555 + } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
1.2556 + return ret;
1.2557 +
1.2558 + } else {
1.2559 +
1.2560 + ret = elem.getAttribute( name );
1.2561 +
1.2562 + // Non-existent attributes return null, we normalize to undefined
1.2563 + return ret === null ?
1.2564 + undefined :
1.2565 + ret;
1.2566 + }
1.2567 + },
1.2568 +
1.2569 + removeAttr: function( elem, value ) {
1.2570 + var propName, attrNames, name, l, isBool,
1.2571 + i = 0;
1.2572 +
1.2573 + if ( value && elem.nodeType === 1 ) {
1.2574 + attrNames = value.toLowerCase().split( rspace );
1.2575 + l = attrNames.length;
1.2576 +
1.2577 + for ( ; i < l; i++ ) {
1.2578 + name = attrNames[ i ];
1.2579 +
1.2580 + if ( name ) {
1.2581 + propName = jQuery.propFix[ name ] || name;
1.2582 + isBool = rboolean.test( name );
1.2583 +
1.2584 + // See #9699 for explanation of this approach (setting first, then removal)
1.2585 + // Do not do this for boolean attributes (see #10870)
1.2586 + if ( !isBool ) {
1.2587 + jQuery.attr( elem, name, "" );
1.2588 + }
1.2589 + elem.removeAttribute( getSetAttribute ? name : propName );
1.2590 +
1.2591 + // Set corresponding property to false for boolean attributes
1.2592 + if ( isBool && propName in elem ) {
1.2593 + elem[ propName ] = false;
1.2594 + }
1.2595 + }
1.2596 + }
1.2597 + }
1.2598 + },
1.2599 +
1.2600 + attrHooks: {
1.2601 + type: {
1.2602 + set: function( elem, value ) {
1.2603 + // We can't allow the type property to be changed (since it causes problems in IE)
1.2604 + if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
1.2605 + jQuery.error( "type property can't be changed" );
1.2606 + } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
1.2607 + // Setting the type on a radio button after the value resets the value in IE6-9
1.2608 + // Reset value to it's default in case type is set after value
1.2609 + // This is for element creation
1.2610 + var val = elem.value;
1.2611 + elem.setAttribute( "type", value );
1.2612 + if ( val ) {
1.2613 + elem.value = val;
1.2614 + }
1.2615 + return value;
1.2616 + }
1.2617 + }
1.2618 + },
1.2619 + // Use the value property for back compat
1.2620 + // Use the nodeHook for button elements in IE6/7 (#1954)
1.2621 + value: {
1.2622 + get: function( elem, name ) {
1.2623 + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
1.2624 + return nodeHook.get( elem, name );
1.2625 + }
1.2626 + return name in elem ?
1.2627 + elem.value :
1.2628 + null;
1.2629 + },
1.2630 + set: function( elem, value, name ) {
1.2631 + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
1.2632 + return nodeHook.set( elem, value, name );
1.2633 + }
1.2634 + // Does not return so that setAttribute is also used
1.2635 + elem.value = value;
1.2636 + }
1.2637 + }
1.2638 + },
1.2639 +
1.2640 + propFix: {
1.2641 + tabindex: "tabIndex",
1.2642 + readonly: "readOnly",
1.2643 + "for": "htmlFor",
1.2644 + "class": "className",
1.2645 + maxlength: "maxLength",
1.2646 + cellspacing: "cellSpacing",
1.2647 + cellpadding: "cellPadding",
1.2648 + rowspan: "rowSpan",
1.2649 + colspan: "colSpan",
1.2650 + usemap: "useMap",
1.2651 + frameborder: "frameBorder",
1.2652 + contenteditable: "contentEditable"
1.2653 + },
1.2654 +
1.2655 + prop: function( elem, name, value ) {
1.2656 + var ret, hooks, notxml,
1.2657 + nType = elem.nodeType;
1.2658 +
1.2659 + // don't get/set properties on text, comment and attribute nodes
1.2660 + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
1.2661 + return;
1.2662 + }
1.2663 +
1.2664 + notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
1.2665 +
1.2666 + if ( notxml ) {
1.2667 + // Fix name and attach hooks
1.2668 + name = jQuery.propFix[ name ] || name;
1.2669 + hooks = jQuery.propHooks[ name ];
1.2670 + }
1.2671 +
1.2672 + if ( value !== undefined ) {
1.2673 + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
1.2674 + return ret;
1.2675 +
1.2676 + } else {
1.2677 + return ( elem[ name ] = value );
1.2678 + }
1.2679 +
1.2680 + } else {
1.2681 + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
1.2682 + return ret;
1.2683 +
1.2684 + } else {
1.2685 + return elem[ name ];
1.2686 + }
1.2687 + }
1.2688 + },
1.2689 +
1.2690 + propHooks: {
1.2691 + tabIndex: {
1.2692 + get: function( elem ) {
1.2693 + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
1.2694 + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
1.2695 + var attributeNode = elem.getAttributeNode("tabindex");
1.2696 +
1.2697 + return attributeNode && attributeNode.specified ?
1.2698 + parseInt( attributeNode.value, 10 ) :
1.2699 + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
1.2700 + 0 :
1.2701 + undefined;
1.2702 + }
1.2703 + }
1.2704 + }
1.2705 +});
1.2706 +
1.2707 +// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
1.2708 +jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
1.2709 +
1.2710 +// Hook for boolean attributes
1.2711 +boolHook = {
1.2712 + get: function( elem, name ) {
1.2713 + // Align boolean attributes with corresponding properties
1.2714 + // Fall back to attribute presence where some booleans are not supported
1.2715 + var attrNode,
1.2716 + property = jQuery.prop( elem, name );
1.2717 + return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
1.2718 + name.toLowerCase() :
1.2719 + undefined;
1.2720 + },
1.2721 + set: function( elem, value, name ) {
1.2722 + var propName;
1.2723 + if ( value === false ) {
1.2724 + // Remove boolean attributes when set to false
1.2725 + jQuery.removeAttr( elem, name );
1.2726 + } else {
1.2727 + // value is true since we know at this point it's type boolean and not false
1.2728 + // Set boolean attributes to the same name and set the DOM property
1.2729 + propName = jQuery.propFix[ name ] || name;
1.2730 + if ( propName in elem ) {
1.2731 + // Only set the IDL specifically if it already exists on the element
1.2732 + elem[ propName ] = true;
1.2733 + }
1.2734 +
1.2735 + elem.setAttribute( name, name.toLowerCase() );
1.2736 + }
1.2737 + return name;
1.2738 + }
1.2739 +};
1.2740 +
1.2741 +// IE6/7 do not support getting/setting some attributes with get/setAttribute
1.2742 +if ( !getSetAttribute ) {
1.2743 +
1.2744 + fixSpecified = {
1.2745 + name: true,
1.2746 + id: true,
1.2747 + coords: true
1.2748 + };
1.2749 +
1.2750 + // Use this for any attribute in IE6/7
1.2751 + // This fixes almost every IE6/7 issue
1.2752 + nodeHook = jQuery.valHooks.button = {
1.2753 + get: function( elem, name ) {
1.2754 + var ret;
1.2755 + ret = elem.getAttributeNode( name );
1.2756 + return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
1.2757 + ret.nodeValue :
1.2758 + undefined;
1.2759 + },
1.2760 + set: function( elem, value, name ) {
1.2761 + // Set the existing or create a new attribute node
1.2762 + var ret = elem.getAttributeNode( name );
1.2763 + if ( !ret ) {
1.2764 + ret = document.createAttribute( name );
1.2765 + elem.setAttributeNode( ret );
1.2766 + }
1.2767 + return ( ret.nodeValue = value + "" );
1.2768 + }
1.2769 + };
1.2770 +
1.2771 + // Apply the nodeHook to tabindex
1.2772 + jQuery.attrHooks.tabindex.set = nodeHook.set;
1.2773 +
1.2774 + // Set width and height to auto instead of 0 on empty string( Bug #8150 )
1.2775 + // This is for removals
1.2776 + jQuery.each([ "width", "height" ], function( i, name ) {
1.2777 + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
1.2778 + set: function( elem, value ) {
1.2779 + if ( value === "" ) {
1.2780 + elem.setAttribute( name, "auto" );
1.2781 + return value;
1.2782 + }
1.2783 + }
1.2784 + });
1.2785 + });
1.2786 +
1.2787 + // Set contenteditable to false on removals(#10429)
1.2788 + // Setting to empty string throws an error as an invalid value
1.2789 + jQuery.attrHooks.contenteditable = {
1.2790 + get: nodeHook.get,
1.2791 + set: function( elem, value, name ) {
1.2792 + if ( value === "" ) {
1.2793 + value = "false";
1.2794 + }
1.2795 + nodeHook.set( elem, value, name );
1.2796 + }
1.2797 + };
1.2798 +}
1.2799 +
1.2800 +
1.2801 +// Some attributes require a special call on IE
1.2802 +if ( !jQuery.support.hrefNormalized ) {
1.2803 + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
1.2804 + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
1.2805 + get: function( elem ) {
1.2806 + var ret = elem.getAttribute( name, 2 );
1.2807 + return ret === null ? undefined : ret;
1.2808 + }
1.2809 + });
1.2810 + });
1.2811 +}
1.2812 +
1.2813 +if ( !jQuery.support.style ) {
1.2814 + jQuery.attrHooks.style = {
1.2815 + get: function( elem ) {
1.2816 + // Return undefined in the case of empty string
1.2817 + // Normalize to lowercase since IE uppercases css property names
1.2818 + return elem.style.cssText.toLowerCase() || undefined;
1.2819 + },
1.2820 + set: function( elem, value ) {
1.2821 + return ( elem.style.cssText = "" + value );
1.2822 + }
1.2823 + };
1.2824 +}
1.2825 +
1.2826 +// Safari mis-reports the default selected property of an option
1.2827 +// Accessing the parent's selectedIndex property fixes it
1.2828 +if ( !jQuery.support.optSelected ) {
1.2829 + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
1.2830 + get: function( elem ) {
1.2831 + var parent = elem.parentNode;
1.2832 +
1.2833 + if ( parent ) {
1.2834 + parent.selectedIndex;
1.2835 +
1.2836 + // Make sure that it also works with optgroups, see #5701
1.2837 + if ( parent.parentNode ) {
1.2838 + parent.parentNode.selectedIndex;
1.2839 + }
1.2840 + }
1.2841 + return null;
1.2842 + }
1.2843 + });
1.2844 +}
1.2845 +
1.2846 +// IE6/7 call enctype encoding
1.2847 +if ( !jQuery.support.enctype ) {
1.2848 + jQuery.propFix.enctype = "encoding";
1.2849 +}
1.2850 +
1.2851 +// Radios and checkboxes getter/setter
1.2852 +if ( !jQuery.support.checkOn ) {
1.2853 + jQuery.each([ "radio", "checkbox" ], function() {
1.2854 + jQuery.valHooks[ this ] = {
1.2855 + get: function( elem ) {
1.2856 + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
1.2857 + return elem.getAttribute("value") === null ? "on" : elem.value;
1.2858 + }
1.2859 + };
1.2860 + });
1.2861 +}
1.2862 +jQuery.each([ "radio", "checkbox" ], function() {
1.2863 + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
1.2864 + set: function( elem, value ) {
1.2865 + if ( jQuery.isArray( value ) ) {
1.2866 + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
1.2867 + }
1.2868 + }
1.2869 + });
1.2870 +});
1.2871 +
1.2872 +
1.2873 +
1.2874 +
1.2875 +var rformElems = /^(?:textarea|input|select)$/i,
1.2876 + rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
1.2877 + rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
1.2878 + rkeyEvent = /^key/,
1.2879 + rmouseEvent = /^(?:mouse|contextmenu)|click/,
1.2880 + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
1.2881 + rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
1.2882 + quickParse = function( selector ) {
1.2883 + var quick = rquickIs.exec( selector );
1.2884 + if ( quick ) {
1.2885 + // 0 1 2 3
1.2886 + // [ _, tag, id, class ]
1.2887 + quick[1] = ( quick[1] || "" ).toLowerCase();
1.2888 + quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
1.2889 + }
1.2890 + return quick;
1.2891 + },
1.2892 + quickIs = function( elem, m ) {
1.2893 + var attrs = elem.attributes || {};
1.2894 + return (
1.2895 + (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
1.2896 + (!m[2] || (attrs.id || {}).value === m[2]) &&
1.2897 + (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
1.2898 + );
1.2899 + },
1.2900 + hoverHack = function( events ) {
1.2901 + return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
1.2902 + };
1.2903 +
1.2904 +/*
1.2905 + * Helper functions for managing events -- not part of the public interface.
1.2906 + * Props to Dean Edwards' addEvent library for many of the ideas.
1.2907 + */
1.2908 +jQuery.event = {
1.2909 +
1.2910 + add: function( elem, types, handler, data, selector ) {
1.2911 +
1.2912 + var elemData, eventHandle, events,
1.2913 + t, tns, type, namespaces, handleObj,
1.2914 + handleObjIn, quick, handlers, special;
1.2915 +
1.2916 + // Don't attach events to noData or text/comment nodes (allow plain objects tho)
1.2917 + if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
1.2918 + return;
1.2919 + }
1.2920 +
1.2921 + // Caller can pass in an object of custom data in lieu of the handler
1.2922 + if ( handler.handler ) {
1.2923 + handleObjIn = handler;
1.2924 + handler = handleObjIn.handler;
1.2925 + selector = handleObjIn.selector;
1.2926 + }
1.2927 +
1.2928 + // Make sure that the handler has a unique ID, used to find/remove it later
1.2929 + if ( !handler.guid ) {
1.2930 + handler.guid = jQuery.guid++;
1.2931 + }
1.2932 +
1.2933 + // Init the element's event structure and main handler, if this is the first
1.2934 + events = elemData.events;
1.2935 + if ( !events ) {
1.2936 + elemData.events = events = {};
1.2937 + }
1.2938 + eventHandle = elemData.handle;
1.2939 + if ( !eventHandle ) {
1.2940 + elemData.handle = eventHandle = function( e ) {
1.2941 + // Discard the second event of a jQuery.event.trigger() and
1.2942 + // when an event is called after a page has unloaded
1.2943 + return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
1.2944 + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
1.2945 + undefined;
1.2946 + };
1.2947 + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
1.2948 + eventHandle.elem = elem;
1.2949 + }
1.2950 +
1.2951 + // Handle multiple events separated by a space
1.2952 + // jQuery(...).bind("mouseover mouseout", fn);
1.2953 + types = jQuery.trim( hoverHack(types) ).split( " " );
1.2954 + for ( t = 0; t < types.length; t++ ) {
1.2955 +
1.2956 + tns = rtypenamespace.exec( types[t] ) || [];
1.2957 + type = tns[1];
1.2958 + namespaces = ( tns[2] || "" ).split( "." ).sort();
1.2959 +
1.2960 + // If event changes its type, use the special event handlers for the changed type
1.2961 + special = jQuery.event.special[ type ] || {};
1.2962 +
1.2963 + // If selector defined, determine special event api type, otherwise given type
1.2964 + type = ( selector ? special.delegateType : special.bindType ) || type;
1.2965 +
1.2966 + // Update special based on newly reset type
1.2967 + special = jQuery.event.special[ type ] || {};
1.2968 +
1.2969 + // handleObj is passed to all event handlers
1.2970 + handleObj = jQuery.extend({
1.2971 + type: type,
1.2972 + origType: tns[1],
1.2973 + data: data,
1.2974 + handler: handler,
1.2975 + guid: handler.guid,
1.2976 + selector: selector,
1.2977 + quick: selector && quickParse( selector ),
1.2978 + namespace: namespaces.join(".")
1.2979 + }, handleObjIn );
1.2980 +
1.2981 + // Init the event handler queue if we're the first
1.2982 + handlers = events[ type ];
1.2983 + if ( !handlers ) {
1.2984 + handlers = events[ type ] = [];
1.2985 + handlers.delegateCount = 0;
1.2986 +
1.2987 + // Only use addEventListener/attachEvent if the special events handler returns false
1.2988 + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
1.2989 + // Bind the global event handler to the element
1.2990 + if ( elem.addEventListener ) {
1.2991 + elem.addEventListener( type, eventHandle, false );
1.2992 +
1.2993 + } else if ( elem.attachEvent ) {
1.2994 + elem.attachEvent( "on" + type, eventHandle );
1.2995 + }
1.2996 + }
1.2997 + }
1.2998 +
1.2999 + if ( special.add ) {
1.3000 + special.add.call( elem, handleObj );
1.3001 +
1.3002 + if ( !handleObj.handler.guid ) {
1.3003 + handleObj.handler.guid = handler.guid;
1.3004 + }
1.3005 + }
1.3006 +
1.3007 + // Add to the element's handler list, delegates in front
1.3008 + if ( selector ) {
1.3009 + handlers.splice( handlers.delegateCount++, 0, handleObj );
1.3010 + } else {
1.3011 + handlers.push( handleObj );
1.3012 + }
1.3013 +
1.3014 + // Keep track of which events have ever been used, for event optimization
1.3015 + jQuery.event.global[ type ] = true;
1.3016 + }
1.3017 +
1.3018 + // Nullify elem to prevent memory leaks in IE
1.3019 + elem = null;
1.3020 + },
1.3021 +
1.3022 + global: {},
1.3023 +
1.3024 + // Detach an event or set of events from an element
1.3025 + remove: function( elem, types, handler, selector, mappedTypes ) {
1.3026 +
1.3027 + var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
1.3028 + t, tns, type, origType, namespaces, origCount,
1.3029 + j, events, special, handle, eventType, handleObj;
1.3030 +
1.3031 + if ( !elemData || !(events = elemData.events) ) {
1.3032 + return;
1.3033 + }
1.3034 +
1.3035 + // Once for each type.namespace in types; type may be omitted
1.3036 + types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
1.3037 + for ( t = 0; t < types.length; t++ ) {
1.3038 + tns = rtypenamespace.exec( types[t] ) || [];
1.3039 + type = origType = tns[1];
1.3040 + namespaces = tns[2];
1.3041 +
1.3042 + // Unbind all events (on this namespace, if provided) for the element
1.3043 + if ( !type ) {
1.3044 + for ( type in events ) {
1.3045 + jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
1.3046 + }
1.3047 + continue;
1.3048 + }
1.3049 +
1.3050 + special = jQuery.event.special[ type ] || {};
1.3051 + type = ( selector? special.delegateType : special.bindType ) || type;
1.3052 + eventType = events[ type ] || [];
1.3053 + origCount = eventType.length;
1.3054 + namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
1.3055 +
1.3056 + // Remove matching events
1.3057 + for ( j = 0; j < eventType.length; j++ ) {
1.3058 + handleObj = eventType[ j ];
1.3059 +
1.3060 + if ( ( mappedTypes || origType === handleObj.origType ) &&
1.3061 + ( !handler || handler.guid === handleObj.guid ) &&
1.3062 + ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
1.3063 + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
1.3064 + eventType.splice( j--, 1 );
1.3065 +
1.3066 + if ( handleObj.selector ) {
1.3067 + eventType.delegateCount--;
1.3068 + }
1.3069 + if ( special.remove ) {
1.3070 + special.remove.call( elem, handleObj );
1.3071 + }
1.3072 + }
1.3073 + }
1.3074 +
1.3075 + // Remove generic event handler if we removed something and no more handlers exist
1.3076 + // (avoids potential for endless recursion during removal of special event handlers)
1.3077 + if ( eventType.length === 0 && origCount !== eventType.length ) {
1.3078 + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
1.3079 + jQuery.removeEvent( elem, type, elemData.handle );
1.3080 + }
1.3081 +
1.3082 + delete events[ type ];
1.3083 + }
1.3084 + }
1.3085 +
1.3086 + // Remove the expando if it's no longer used
1.3087 + if ( jQuery.isEmptyObject( events ) ) {
1.3088 + handle = elemData.handle;
1.3089 + if ( handle ) {
1.3090 + handle.elem = null;
1.3091 + }
1.3092 +
1.3093 + // removeData also checks for emptiness and clears the expando if empty
1.3094 + // so use it instead of delete
1.3095 + jQuery.removeData( elem, [ "events", "handle" ], true );
1.3096 + }
1.3097 + },
1.3098 +
1.3099 + // Events that are safe to short-circuit if no handlers are attached.
1.3100 + // Native DOM events should not be added, they may have inline handlers.
1.3101 + customEvent: {
1.3102 + "getData": true,
1.3103 + "setData": true,
1.3104 + "changeData": true
1.3105 + },
1.3106 +
1.3107 + trigger: function( event, data, elem, onlyHandlers ) {
1.3108 + // Don't do events on text and comment nodes
1.3109 + if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
1.3110 + return;
1.3111 + }
1.3112 +
1.3113 + // Event object or event type
1.3114 + var type = event.type || event,
1.3115 + namespaces = [],
1.3116 + cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
1.3117 +
1.3118 + // focus/blur morphs to focusin/out; ensure we're not firing them right now
1.3119 + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
1.3120 + return;
1.3121 + }
1.3122 +
1.3123 + if ( type.indexOf( "!" ) >= 0 ) {
1.3124 + // Exclusive events trigger only for the exact event (no namespaces)
1.3125 + type = type.slice(0, -1);
1.3126 + exclusive = true;
1.3127 + }
1.3128 +
1.3129 + if ( type.indexOf( "." ) >= 0 ) {
1.3130 + // Namespaced trigger; create a regexp to match event type in handle()
1.3131 + namespaces = type.split(".");
1.3132 + type = namespaces.shift();
1.3133 + namespaces.sort();
1.3134 + }
1.3135 +
1.3136 + if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
1.3137 + // No jQuery handlers for this event type, and it can't have inline handlers
1.3138 + return;
1.3139 + }
1.3140 +
1.3141 + // Caller can pass in an Event, Object, or just an event type string
1.3142 + event = typeof event === "object" ?
1.3143 + // jQuery.Event object
1.3144 + event[ jQuery.expando ] ? event :
1.3145 + // Object literal
1.3146 + new jQuery.Event( type, event ) :
1.3147 + // Just the event type (string)
1.3148 + new jQuery.Event( type );
1.3149 +
1.3150 + event.type = type;
1.3151 + event.isTrigger = true;
1.3152 + event.exclusive = exclusive;
1.3153 + event.namespace = namespaces.join( "." );
1.3154 + event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
1.3155 + ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
1.3156 +
1.3157 + // Handle a global trigger
1.3158 + if ( !elem ) {
1.3159 +
1.3160 + // TODO: Stop taunting the data cache; remove global events and always attach to document
1.3161 + cache = jQuery.cache;
1.3162 + for ( i in cache ) {
1.3163 + if ( cache[ i ].events && cache[ i ].events[ type ] ) {
1.3164 + jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
1.3165 + }
1.3166 + }
1.3167 + return;
1.3168 + }
1.3169 +
1.3170 + // Clean up the event in case it is being reused
1.3171 + event.result = undefined;
1.3172 + if ( !event.target ) {
1.3173 + event.target = elem;
1.3174 + }
1.3175 +
1.3176 + // Clone any incoming data and prepend the event, creating the handler arg list
1.3177 + data = data != null ? jQuery.makeArray( data ) : [];
1.3178 + data.unshift( event );
1.3179 +
1.3180 + // Allow special events to draw outside the lines
1.3181 + special = jQuery.event.special[ type ] || {};
1.3182 + if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
1.3183 + return;
1.3184 + }
1.3185 +
1.3186 + // Determine event propagation path in advance, per W3C events spec (#9951)
1.3187 + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
1.3188 + eventPath = [[ elem, special.bindType || type ]];
1.3189 + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
1.3190 +
1.3191 + bubbleType = special.delegateType || type;
1.3192 + cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
1.3193 + old = null;
1.3194 + for ( ; cur; cur = cur.parentNode ) {
1.3195 + eventPath.push([ cur, bubbleType ]);
1.3196 + old = cur;
1.3197 + }
1.3198 +
1.3199 + // Only add window if we got to document (e.g., not plain obj or detached DOM)
1.3200 + if ( old && old === elem.ownerDocument ) {
1.3201 + eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
1.3202 + }
1.3203 + }
1.3204 +
1.3205 + // Fire handlers on the event path
1.3206 + for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
1.3207 +
1.3208 + cur = eventPath[i][0];
1.3209 + event.type = eventPath[i][1];
1.3210 +
1.3211 + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
1.3212 + if ( handle ) {
1.3213 + handle.apply( cur, data );
1.3214 + }
1.3215 + // Note that this is a bare JS function and not a jQuery handler
1.3216 + handle = ontype && cur[ ontype ];
1.3217 + if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
1.3218 + event.preventDefault();
1.3219 + }
1.3220 + }
1.3221 + event.type = type;
1.3222 +
1.3223 + // If nobody prevented the default action, do it now
1.3224 + if ( !onlyHandlers && !event.isDefaultPrevented() ) {
1.3225 +
1.3226 + if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
1.3227 + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
1.3228 +
1.3229 + // Call a native DOM method on the target with the same name name as the event.
1.3230 + // Can't use an .isFunction() check here because IE6/7 fails that test.
1.3231 + // Don't do default actions on window, that's where global variables be (#6170)
1.3232 + // IE<9 dies on focus/blur to hidden element (#1486)
1.3233 + if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
1.3234 +
1.3235 + // Don't re-trigger an onFOO event when we call its FOO() method
1.3236 + old = elem[ ontype ];
1.3237 +
1.3238 + if ( old ) {
1.3239 + elem[ ontype ] = null;
1.3240 + }
1.3241 +
1.3242 + // Prevent re-triggering of the same event, since we already bubbled it above
1.3243 + jQuery.event.triggered = type;
1.3244 + elem[ type ]();
1.3245 + jQuery.event.triggered = undefined;
1.3246 +
1.3247 + if ( old ) {
1.3248 + elem[ ontype ] = old;
1.3249 + }
1.3250 + }
1.3251 + }
1.3252 + }
1.3253 +
1.3254 + return event.result;
1.3255 + },
1.3256 +
1.3257 + dispatch: function( event ) {
1.3258 +
1.3259 + // Make a writable jQuery.Event from the native event object
1.3260 + event = jQuery.event.fix( event || window.event );
1.3261 +
1.3262 + var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
1.3263 + delegateCount = handlers.delegateCount,
1.3264 + args = [].slice.call( arguments, 0 ),
1.3265 + run_all = !event.exclusive && !event.namespace,
1.3266 + special = jQuery.event.special[ event.type ] || {},
1.3267 + handlerQueue = [],
1.3268 + i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
1.3269 +
1.3270 + // Use the fix-ed jQuery.Event rather than the (read-only) native event
1.3271 + args[0] = event;
1.3272 + event.delegateTarget = this;
1.3273 +
1.3274 + // Call the preDispatch hook for the mapped type, and let it bail if desired
1.3275 + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
1.3276 + return;
1.3277 + }
1.3278 +
1.3279 + // Determine handlers that should run if there are delegated events
1.3280 + // Avoid non-left-click bubbling in Firefox (#3861)
1.3281 + if ( delegateCount && !(event.button && event.type === "click") ) {
1.3282 +
1.3283 + // Pregenerate a single jQuery object for reuse with .is()
1.3284 + jqcur = jQuery(this);
1.3285 + jqcur.context = this.ownerDocument || this;
1.3286 +
1.3287 + for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
1.3288 +
1.3289 + // Don't process events on disabled elements (#6911, #8165)
1.3290 + if ( cur.disabled !== true ) {
1.3291 + selMatch = {};
1.3292 + matches = [];
1.3293 + jqcur[0] = cur;
1.3294 + for ( i = 0; i < delegateCount; i++ ) {
1.3295 + handleObj = handlers[ i ];
1.3296 + sel = handleObj.selector;
1.3297 +
1.3298 + if ( selMatch[ sel ] === undefined ) {
1.3299 + selMatch[ sel ] = (
1.3300 + handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
1.3301 + );
1.3302 + }
1.3303 + if ( selMatch[ sel ] ) {
1.3304 + matches.push( handleObj );
1.3305 + }
1.3306 + }
1.3307 + if ( matches.length ) {
1.3308 + handlerQueue.push({ elem: cur, matches: matches });
1.3309 + }
1.3310 + }
1.3311 + }
1.3312 + }
1.3313 +
1.3314 + // Add the remaining (directly-bound) handlers
1.3315 + if ( handlers.length > delegateCount ) {
1.3316 + handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
1.3317 + }
1.3318 +
1.3319 + // Run delegates first; they may want to stop propagation beneath us
1.3320 + for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
1.3321 + matched = handlerQueue[ i ];
1.3322 + event.currentTarget = matched.elem;
1.3323 +
1.3324 + for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
1.3325 + handleObj = matched.matches[ j ];
1.3326 +
1.3327 + // Triggered event must either 1) be non-exclusive and have no namespace, or
1.3328 + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
1.3329 + if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
1.3330 +
1.3331 + event.data = handleObj.data;
1.3332 + event.handleObj = handleObj;
1.3333 +
1.3334 + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
1.3335 + .apply( matched.elem, args );
1.3336 +
1.3337 + if ( ret !== undefined ) {
1.3338 + event.result = ret;
1.3339 + if ( ret === false ) {
1.3340 + event.preventDefault();
1.3341 + event.stopPropagation();
1.3342 + }
1.3343 + }
1.3344 + }
1.3345 + }
1.3346 + }
1.3347 +
1.3348 + // Call the postDispatch hook for the mapped type
1.3349 + if ( special.postDispatch ) {
1.3350 + special.postDispatch.call( this, event );
1.3351 + }
1.3352 +
1.3353 + return event.result;
1.3354 + },
1.3355 +
1.3356 + // Includes some event props shared by KeyEvent and MouseEvent
1.3357 + // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
1.3358 + props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
1.3359 +
1.3360 + fixHooks: {},
1.3361 +
1.3362 + keyHooks: {
1.3363 + props: "char charCode key keyCode".split(" "),
1.3364 + filter: function( event, original ) {
1.3365 +
1.3366 + // Add which for key events
1.3367 + if ( event.which == null ) {
1.3368 + event.which = original.charCode != null ? original.charCode : original.keyCode;
1.3369 + }
1.3370 +
1.3371 + return event;
1.3372 + }
1.3373 + },
1.3374 +
1.3375 + mouseHooks: {
1.3376 + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
1.3377 + filter: function( event, original ) {
1.3378 + var eventDoc, doc, body,
1.3379 + button = original.button,
1.3380 + fromElement = original.fromElement;
1.3381 +
1.3382 + // Calculate pageX/Y if missing and clientX/Y available
1.3383 + if ( event.pageX == null && original.clientX != null ) {
1.3384 + eventDoc = event.target.ownerDocument || document;
1.3385 + doc = eventDoc.documentElement;
1.3386 + body = eventDoc.body;
1.3387 +
1.3388 + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
1.3389 + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
1.3390 + }
1.3391 +
1.3392 + // Add relatedTarget, if necessary
1.3393 + if ( !event.relatedTarget && fromElement ) {
1.3394 + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
1.3395 + }
1.3396 +
1.3397 + // Add which for click: 1 === left; 2 === middle; 3 === right
1.3398 + // Note: button is not normalized, so don't use it
1.3399 + if ( !event.which && button !== undefined ) {
1.3400 + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
1.3401 + }
1.3402 +
1.3403 + return event;
1.3404 + }
1.3405 + },
1.3406 +
1.3407 + fix: function( event ) {
1.3408 + if ( event[ jQuery.expando ] ) {
1.3409 + return event;
1.3410 + }
1.3411 +
1.3412 + // Create a writable copy of the event object and normalize some properties
1.3413 + var i, prop,
1.3414 + originalEvent = event,
1.3415 + fixHook = jQuery.event.fixHooks[ event.type ] || {},
1.3416 + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
1.3417 +
1.3418 + event = jQuery.Event( originalEvent );
1.3419 +
1.3420 + for ( i = copy.length; i; ) {
1.3421 + prop = copy[ --i ];
1.3422 + event[ prop ] = originalEvent[ prop ];
1.3423 + }
1.3424 +
1.3425 + // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
1.3426 + if ( !event.target ) {
1.3427 + event.target = originalEvent.srcElement || document;
1.3428 + }
1.3429 +
1.3430 + // Target should not be a text node (#504, Safari)
1.3431 + if ( event.target.nodeType === 3 ) {
1.3432 + event.target = event.target.parentNode;
1.3433 + }
1.3434 +
1.3435 + // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
1.3436 + if ( event.metaKey === undefined ) {
1.3437 + event.metaKey = event.ctrlKey;
1.3438 + }
1.3439 +
1.3440 + return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
1.3441 + },
1.3442 +
1.3443 + special: {
1.3444 + ready: {
1.3445 + // Make sure the ready event is setup
1.3446 + setup: jQuery.bindReady
1.3447 + },
1.3448 +
1.3449 + load: {
1.3450 + // Prevent triggered image.load events from bubbling to window.load
1.3451 + noBubble: true
1.3452 + },
1.3453 +
1.3454 + focus: {
1.3455 + delegateType: "focusin"
1.3456 + },
1.3457 + blur: {
1.3458 + delegateType: "focusout"
1.3459 + },
1.3460 +
1.3461 + beforeunload: {
1.3462 + setup: function( data, namespaces, eventHandle ) {
1.3463 + // We only want to do this special case on windows
1.3464 + if ( jQuery.isWindow( this ) ) {
1.3465 + this.onbeforeunload = eventHandle;
1.3466 + }
1.3467 + },
1.3468 +
1.3469 + teardown: function( namespaces, eventHandle ) {
1.3470 + if ( this.onbeforeunload === eventHandle ) {
1.3471 + this.onbeforeunload = null;
1.3472 + }
1.3473 + }
1.3474 + }
1.3475 + },
1.3476 +
1.3477 + simulate: function( type, elem, event, bubble ) {
1.3478 + // Piggyback on a donor event to simulate a different one.
1.3479 + // Fake originalEvent to avoid donor's stopPropagation, but if the
1.3480 + // simulated event prevents default then we do the same on the donor.
1.3481 + var e = jQuery.extend(
1.3482 + new jQuery.Event(),
1.3483 + event,
1.3484 + { type: type,
1.3485 + isSimulated: true,
1.3486 + originalEvent: {}
1.3487 + }
1.3488 + );
1.3489 + if ( bubble ) {
1.3490 + jQuery.event.trigger( e, null, elem );
1.3491 + } else {
1.3492 + jQuery.event.dispatch.call( elem, e );
1.3493 + }
1.3494 + if ( e.isDefaultPrevented() ) {
1.3495 + event.preventDefault();
1.3496 + }
1.3497 + }
1.3498 +};
1.3499 +
1.3500 +// Some plugins are using, but it's undocumented/deprecated and will be removed.
1.3501 +// The 1.7 special event interface should provide all the hooks needed now.
1.3502 +jQuery.event.handle = jQuery.event.dispatch;
1.3503 +
1.3504 +jQuery.removeEvent = document.removeEventListener ?
1.3505 + function( elem, type, handle ) {
1.3506 + if ( elem.removeEventListener ) {
1.3507 + elem.removeEventListener( type, handle, false );
1.3508 + }
1.3509 + } :
1.3510 + function( elem, type, handle ) {
1.3511 + if ( elem.detachEvent ) {
1.3512 + elem.detachEvent( "on" + type, handle );
1.3513 + }
1.3514 + };
1.3515 +
1.3516 +jQuery.Event = function( src, props ) {
1.3517 + // Allow instantiation without the 'new' keyword
1.3518 + if ( !(this instanceof jQuery.Event) ) {
1.3519 + return new jQuery.Event( src, props );
1.3520 + }
1.3521 +
1.3522 + // Event object
1.3523 + if ( src && src.type ) {
1.3524 + this.originalEvent = src;
1.3525 + this.type = src.type;
1.3526 +
1.3527 + // Events bubbling up the document may have been marked as prevented
1.3528 + // by a handler lower down the tree; reflect the correct value.
1.3529 + this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
1.3530 + src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
1.3531 +
1.3532 + // Event type
1.3533 + } else {
1.3534 + this.type = src;
1.3535 + }
1.3536 +
1.3537 + // Put explicitly provided properties onto the event object
1.3538 + if ( props ) {
1.3539 + jQuery.extend( this, props );
1.3540 + }
1.3541 +
1.3542 + // Create a timestamp if incoming event doesn't have one
1.3543 + this.timeStamp = src && src.timeStamp || jQuery.now();
1.3544 +
1.3545 + // Mark it as fixed
1.3546 + this[ jQuery.expando ] = true;
1.3547 +};
1.3548 +
1.3549 +function returnFalse() {
1.3550 + return false;
1.3551 +}
1.3552 +function returnTrue() {
1.3553 + return true;
1.3554 +}
1.3555 +
1.3556 +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
1.3557 +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
1.3558 +jQuery.Event.prototype = {
1.3559 + preventDefault: function() {
1.3560 + this.isDefaultPrevented = returnTrue;
1.3561 +
1.3562 + var e = this.originalEvent;
1.3563 + if ( !e ) {
1.3564 + return;
1.3565 + }
1.3566 +
1.3567 + // if preventDefault exists run it on the original event
1.3568 + if ( e.preventDefault ) {
1.3569 + e.preventDefault();
1.3570 +
1.3571 + // otherwise set the returnValue property of the original event to false (IE)
1.3572 + } else {
1.3573 + e.returnValue = false;
1.3574 + }
1.3575 + },
1.3576 + stopPropagation: function() {
1.3577 + this.isPropagationStopped = returnTrue;
1.3578 +
1.3579 + var e = this.originalEvent;
1.3580 + if ( !e ) {
1.3581 + return;
1.3582 + }
1.3583 + // if stopPropagation exists run it on the original event
1.3584 + if ( e.stopPropagation ) {
1.3585 + e.stopPropagation();
1.3586 + }
1.3587 + // otherwise set the cancelBubble property of the original event to true (IE)
1.3588 + e.cancelBubble = true;
1.3589 + },
1.3590 + stopImmediatePropagation: function() {
1.3591 + this.isImmediatePropagationStopped = returnTrue;
1.3592 + this.stopPropagation();
1.3593 + },
1.3594 + isDefaultPrevented: returnFalse,
1.3595 + isPropagationStopped: returnFalse,
1.3596 + isImmediatePropagationStopped: returnFalse
1.3597 +};
1.3598 +
1.3599 +// Create mouseenter/leave events using mouseover/out and event-time checks
1.3600 +jQuery.each({
1.3601 + mouseenter: "mouseover",
1.3602 + mouseleave: "mouseout"
1.3603 +}, function( orig, fix ) {
1.3604 + jQuery.event.special[ orig ] = {
1.3605 + delegateType: fix,
1.3606 + bindType: fix,
1.3607 +
1.3608 + handle: function( event ) {
1.3609 + var target = this,
1.3610 + related = event.relatedTarget,
1.3611 + handleObj = event.handleObj,
1.3612 + selector = handleObj.selector,
1.3613 + ret;
1.3614 +
1.3615 + // For mousenter/leave call the handler if related is outside the target.
1.3616 + // NB: No relatedTarget if the mouse left/entered the browser window
1.3617 + if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
1.3618 + event.type = handleObj.origType;
1.3619 + ret = handleObj.handler.apply( this, arguments );
1.3620 + event.type = fix;
1.3621 + }
1.3622 + return ret;
1.3623 + }
1.3624 + };
1.3625 +});
1.3626 +
1.3627 +// IE submit delegation
1.3628 +if ( !jQuery.support.submitBubbles ) {
1.3629 +
1.3630 + jQuery.event.special.submit = {
1.3631 + setup: function() {
1.3632 + // Only need this for delegated form submit events
1.3633 + if ( jQuery.nodeName( this, "form" ) ) {
1.3634 + return false;
1.3635 + }
1.3636 +
1.3637 + // Lazy-add a submit handler when a descendant form may potentially be submitted
1.3638 + jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
1.3639 + // Node name check avoids a VML-related crash in IE (#9807)
1.3640 + var elem = e.target,
1.3641 + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
1.3642 + if ( form && !form._submit_attached ) {
1.3643 + jQuery.event.add( form, "submit._submit", function( event ) {
1.3644 + event._submit_bubble = true;
1.3645 + });
1.3646 + form._submit_attached = true;
1.3647 + }
1.3648 + });
1.3649 + // return undefined since we don't need an event listener
1.3650 + },
1.3651 +
1.3652 + postDispatch: function( event ) {
1.3653 + // If form was submitted by the user, bubble the event up the tree
1.3654 + if ( event._submit_bubble ) {
1.3655 + delete event._submit_bubble;
1.3656 + if ( this.parentNode && !event.isTrigger ) {
1.3657 + jQuery.event.simulate( "submit", this.parentNode, event, true );
1.3658 + }
1.3659 + }
1.3660 + },
1.3661 +
1.3662 + teardown: function() {
1.3663 + // Only need this for delegated form submit events
1.3664 + if ( jQuery.nodeName( this, "form" ) ) {
1.3665 + return false;
1.3666 + }
1.3667 +
1.3668 + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
1.3669 + jQuery.event.remove( this, "._submit" );
1.3670 + }
1.3671 + };
1.3672 +}
1.3673 +
1.3674 +// IE change delegation and checkbox/radio fix
1.3675 +if ( !jQuery.support.changeBubbles ) {
1.3676 +
1.3677 + jQuery.event.special.change = {
1.3678 +
1.3679 + setup: function() {
1.3680 +
1.3681 + if ( rformElems.test( this.nodeName ) ) {
1.3682 + // IE doesn't fire change on a check/radio until blur; trigger it on click
1.3683 + // after a propertychange. Eat the blur-change in special.change.handle.
1.3684 + // This still fires onchange a second time for check/radio after blur.
1.3685 + if ( this.type === "checkbox" || this.type === "radio" ) {
1.3686 + jQuery.event.add( this, "propertychange._change", function( event ) {
1.3687 + if ( event.originalEvent.propertyName === "checked" ) {
1.3688 + this._just_changed = true;
1.3689 + }
1.3690 + });
1.3691 + jQuery.event.add( this, "click._change", function( event ) {
1.3692 + if ( this._just_changed && !event.isTrigger ) {
1.3693 + this._just_changed = false;
1.3694 + jQuery.event.simulate( "change", this, event, true );
1.3695 + }
1.3696 + });
1.3697 + }
1.3698 + return false;
1.3699 + }
1.3700 + // Delegated event; lazy-add a change handler on descendant inputs
1.3701 + jQuery.event.add( this, "beforeactivate._change", function( e ) {
1.3702 + var elem = e.target;
1.3703 +
1.3704 + if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
1.3705 + jQuery.event.add( elem, "change._change", function( event ) {
1.3706 + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
1.3707 + jQuery.event.simulate( "change", this.parentNode, event, true );
1.3708 + }
1.3709 + });
1.3710 + elem._change_attached = true;
1.3711 + }
1.3712 + });
1.3713 + },
1.3714 +
1.3715 + handle: function( event ) {
1.3716 + var elem = event.target;
1.3717 +
1.3718 + // Swallow native change events from checkbox/radio, we already triggered them above
1.3719 + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
1.3720 + return event.handleObj.handler.apply( this, arguments );
1.3721 + }
1.3722 + },
1.3723 +
1.3724 + teardown: function() {
1.3725 + jQuery.event.remove( this, "._change" );
1.3726 +
1.3727 + return rformElems.test( this.nodeName );
1.3728 + }
1.3729 + };
1.3730 +}
1.3731 +
1.3732 +// Create "bubbling" focus and blur events
1.3733 +if ( !jQuery.support.focusinBubbles ) {
1.3734 + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
1.3735 +
1.3736 + // Attach a single capturing handler while someone wants focusin/focusout
1.3737 + var attaches = 0,
1.3738 + handler = function( event ) {
1.3739 + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
1.3740 + };
1.3741 +
1.3742 + jQuery.event.special[ fix ] = {
1.3743 + setup: function() {
1.3744 + if ( attaches++ === 0 ) {
1.3745 + document.addEventListener( orig, handler, true );
1.3746 + }
1.3747 + },
1.3748 + teardown: function() {
1.3749 + if ( --attaches === 0 ) {
1.3750 + document.removeEventListener( orig, handler, true );
1.3751 + }
1.3752 + }
1.3753 + };
1.3754 + });
1.3755 +}
1.3756 +
1.3757 +jQuery.fn.extend({
1.3758 +
1.3759 + on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
1.3760 + var origFn, type;
1.3761 +
1.3762 + // Types can be a map of types/handlers
1.3763 + if ( typeof types === "object" ) {
1.3764 + // ( types-Object, selector, data )
1.3765 + if ( typeof selector !== "string" ) { // && selector != null
1.3766 + // ( types-Object, data )
1.3767 + data = data || selector;
1.3768 + selector = undefined;
1.3769 + }
1.3770 + for ( type in types ) {
1.3771 + this.on( type, selector, data, types[ type ], one );
1.3772 + }
1.3773 + return this;
1.3774 + }
1.3775 +
1.3776 + if ( data == null && fn == null ) {
1.3777 + // ( types, fn )
1.3778 + fn = selector;
1.3779 + data = selector = undefined;
1.3780 + } else if ( fn == null ) {
1.3781 + if ( typeof selector === "string" ) {
1.3782 + // ( types, selector, fn )
1.3783 + fn = data;
1.3784 + data = undefined;
1.3785 + } else {
1.3786 + // ( types, data, fn )
1.3787 + fn = data;
1.3788 + data = selector;
1.3789 + selector = undefined;
1.3790 + }
1.3791 + }
1.3792 + if ( fn === false ) {
1.3793 + fn = returnFalse;
1.3794 + } else if ( !fn ) {
1.3795 + return this;
1.3796 + }
1.3797 +
1.3798 + if ( one === 1 ) {
1.3799 + origFn = fn;
1.3800 + fn = function( event ) {
1.3801 + // Can use an empty set, since event contains the info
1.3802 + jQuery().off( event );
1.3803 + return origFn.apply( this, arguments );
1.3804 + };
1.3805 + // Use same guid so caller can remove using origFn
1.3806 + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
1.3807 + }
1.3808 + return this.each( function() {
1.3809 + jQuery.event.add( this, types, fn, data, selector );
1.3810 + });
1.3811 + },
1.3812 + one: function( types, selector, data, fn ) {
1.3813 + return this.on( types, selector, data, fn, 1 );
1.3814 + },
1.3815 + off: function( types, selector, fn ) {
1.3816 + if ( types && types.preventDefault && types.handleObj ) {
1.3817 + // ( event ) dispatched jQuery.Event
1.3818 + var handleObj = types.handleObj;
1.3819 + jQuery( types.delegateTarget ).off(
1.3820 + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
1.3821 + handleObj.selector,
1.3822 + handleObj.handler
1.3823 + );
1.3824 + return this;
1.3825 + }
1.3826 + if ( typeof types === "object" ) {
1.3827 + // ( types-object [, selector] )
1.3828 + for ( var type in types ) {
1.3829 + this.off( type, selector, types[ type ] );
1.3830 + }
1.3831 + return this;
1.3832 + }
1.3833 + if ( selector === false || typeof selector === "function" ) {
1.3834 + // ( types [, fn] )
1.3835 + fn = selector;
1.3836 + selector = undefined;
1.3837 + }
1.3838 + if ( fn === false ) {
1.3839 + fn = returnFalse;
1.3840 + }
1.3841 + return this.each(function() {
1.3842 + jQuery.event.remove( this, types, fn, selector );
1.3843 + });
1.3844 + },
1.3845 +
1.3846 + bind: function( types, data, fn ) {
1.3847 + return this.on( types, null, data, fn );
1.3848 + },
1.3849 + unbind: function( types, fn ) {
1.3850 + return this.off( types, null, fn );
1.3851 + },
1.3852 +
1.3853 + live: function( types, data, fn ) {
1.3854 + jQuery( this.context ).on( types, this.selector, data, fn );
1.3855 + return this;
1.3856 + },
1.3857 + die: function( types, fn ) {
1.3858 + jQuery( this.context ).off( types, this.selector || "**", fn );
1.3859 + return this;
1.3860 + },
1.3861 +
1.3862 + delegate: function( selector, types, data, fn ) {
1.3863 + return this.on( types, selector, data, fn );
1.3864 + },
1.3865 + undelegate: function( selector, types, fn ) {
1.3866 + // ( namespace ) or ( selector, types [, fn] )
1.3867 + return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
1.3868 + },
1.3869 +
1.3870 + trigger: function( type, data ) {
1.3871 + return this.each(function() {
1.3872 + jQuery.event.trigger( type, data, this );
1.3873 + });
1.3874 + },
1.3875 + triggerHandler: function( type, data ) {
1.3876 + if ( this[0] ) {
1.3877 + return jQuery.event.trigger( type, data, this[0], true );
1.3878 + }
1.3879 + },
1.3880 +
1.3881 + toggle: function( fn ) {
1.3882 + // Save reference to arguments for access in closure
1.3883 + var args = arguments,
1.3884 + guid = fn.guid || jQuery.guid++,
1.3885 + i = 0,
1.3886 + toggler = function( event ) {
1.3887 + // Figure out which function to execute
1.3888 + var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
1.3889 + jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
1.3890 +
1.3891 + // Make sure that clicks stop
1.3892 + event.preventDefault();
1.3893 +
1.3894 + // and execute the function
1.3895 + return args[ lastToggle ].apply( this, arguments ) || false;
1.3896 + };
1.3897 +
1.3898 + // link all the functions, so any of them can unbind this click handler
1.3899 + toggler.guid = guid;
1.3900 + while ( i < args.length ) {
1.3901 + args[ i++ ].guid = guid;
1.3902 + }
1.3903 +
1.3904 + return this.click( toggler );
1.3905 + },
1.3906 +
1.3907 + hover: function( fnOver, fnOut ) {
1.3908 + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
1.3909 + }
1.3910 +});
1.3911 +
1.3912 +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
1.3913 + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
1.3914 + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
1.3915 +
1.3916 + // Handle event binding
1.3917 + jQuery.fn[ name ] = function( data, fn ) {
1.3918 + if ( fn == null ) {
1.3919 + fn = data;
1.3920 + data = null;
1.3921 + }
1.3922 +
1.3923 + return arguments.length > 0 ?
1.3924 + this.on( name, null, data, fn ) :
1.3925 + this.trigger( name );
1.3926 + };
1.3927 +
1.3928 + if ( jQuery.attrFn ) {
1.3929 + jQuery.attrFn[ name ] = true;
1.3930 + }
1.3931 +
1.3932 + if ( rkeyEvent.test( name ) ) {
1.3933 + jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
1.3934 + }
1.3935 +
1.3936 + if ( rmouseEvent.test( name ) ) {
1.3937 + jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
1.3938 + }
1.3939 +});
1.3940 +
1.3941 +
1.3942 +
1.3943 +/*!
1.3944 + * Sizzle CSS Selector Engine
1.3945 + * Copyright 2011, The Dojo Foundation
1.3946 + * Released under the MIT, BSD, and GPL Licenses.
1.3947 + * More information: http://sizzlejs.com/
1.3948 + */
1.3949 +(function(){
1.3950 +
1.3951 +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
1.3952 + expando = "sizcache" + (Math.random() + '').replace('.', ''),
1.3953 + done = 0,
1.3954 + toString = Object.prototype.toString,
1.3955 + hasDuplicate = false,
1.3956 + baseHasDuplicate = true,
1.3957 + rBackslash = /\\/g,
1.3958 + rReturn = /\r\n/g,
1.3959 + rNonWord = /\W/;
1.3960 +
1.3961 +// Here we check if the JavaScript engine is using some sort of
1.3962 +// optimization where it does not always call our comparision
1.3963 +// function. If that is the case, discard the hasDuplicate value.
1.3964 +// Thus far that includes Google Chrome.
1.3965 +[0, 0].sort(function() {
1.3966 + baseHasDuplicate = false;
1.3967 + return 0;
1.3968 +});
1.3969 +
1.3970 +var Sizzle = function( selector, context, results, seed ) {
1.3971 + results = results || [];
1.3972 + context = context || document;
1.3973 +
1.3974 + var origContext = context;
1.3975 +
1.3976 + if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
1.3977 + return [];
1.3978 + }
1.3979 +
1.3980 + if ( !selector || typeof selector !== "string" ) {
1.3981 + return results;
1.3982 + }
1.3983 +
1.3984 + var m, set, checkSet, extra, ret, cur, pop, i,
1.3985 + prune = true,
1.3986 + contextXML = Sizzle.isXML( context ),
1.3987 + parts = [],
1.3988 + soFar = selector;
1.3989 +
1.3990 + // Reset the position of the chunker regexp (start from head)
1.3991 + do {
1.3992 + chunker.exec( "" );
1.3993 + m = chunker.exec( soFar );
1.3994 +
1.3995 + if ( m ) {
1.3996 + soFar = m[3];
1.3997 +
1.3998 + parts.push( m[1] );
1.3999 +
1.4000 + if ( m[2] ) {
1.4001 + extra = m[3];
1.4002 + break;
1.4003 + }
1.4004 + }
1.4005 + } while ( m );
1.4006 +
1.4007 + if ( parts.length > 1 && origPOS.exec( selector ) ) {
1.4008 +
1.4009 + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
1.4010 + set = posProcess( parts[0] + parts[1], context, seed );
1.4011 +
1.4012 + } else {
1.4013 + set = Expr.relative[ parts[0] ] ?
1.4014 + [ context ] :
1.4015 + Sizzle( parts.shift(), context );
1.4016 +
1.4017 + while ( parts.length ) {
1.4018 + selector = parts.shift();
1.4019 +
1.4020 + if ( Expr.relative[ selector ] ) {
1.4021 + selector += parts.shift();
1.4022 + }
1.4023 +
1.4024 + set = posProcess( selector, set, seed );
1.4025 + }
1.4026 + }
1.4027 +
1.4028 + } else {
1.4029 + // Take a shortcut and set the context if the root selector is an ID
1.4030 + // (but not if it'll be faster if the inner selector is an ID)
1.4031 + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
1.4032 + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
1.4033 +
1.4034 + ret = Sizzle.find( parts.shift(), context, contextXML );
1.4035 + context = ret.expr ?
1.4036 + Sizzle.filter( ret.expr, ret.set )[0] :
1.4037 + ret.set[0];
1.4038 + }
1.4039 +
1.4040 + if ( context ) {
1.4041 + ret = seed ?
1.4042 + { expr: parts.pop(), set: makeArray(seed) } :
1.4043 + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
1.4044 +
1.4045 + set = ret.expr ?
1.4046 + Sizzle.filter( ret.expr, ret.set ) :
1.4047 + ret.set;
1.4048 +
1.4049 + if ( parts.length > 0 ) {
1.4050 + checkSet = makeArray( set );
1.4051 +
1.4052 + } else {
1.4053 + prune = false;
1.4054 + }
1.4055 +
1.4056 + while ( parts.length ) {
1.4057 + cur = parts.pop();
1.4058 + pop = cur;
1.4059 +
1.4060 + if ( !Expr.relative[ cur ] ) {
1.4061 + cur = "";
1.4062 + } else {
1.4063 + pop = parts.pop();
1.4064 + }
1.4065 +
1.4066 + if ( pop == null ) {
1.4067 + pop = context;
1.4068 + }
1.4069 +
1.4070 + Expr.relative[ cur ]( checkSet, pop, contextXML );
1.4071 + }
1.4072 +
1.4073 + } else {
1.4074 + checkSet = parts = [];
1.4075 + }
1.4076 + }
1.4077 +
1.4078 + if ( !checkSet ) {
1.4079 + checkSet = set;
1.4080 + }
1.4081 +
1.4082 + if ( !checkSet ) {
1.4083 + Sizzle.error( cur || selector );
1.4084 + }
1.4085 +
1.4086 + if ( toString.call(checkSet) === "[object Array]" ) {
1.4087 + if ( !prune ) {
1.4088 + results.push.apply( results, checkSet );
1.4089 +
1.4090 + } else if ( context && context.nodeType === 1 ) {
1.4091 + for ( i = 0; checkSet[i] != null; i++ ) {
1.4092 + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
1.4093 + results.push( set[i] );
1.4094 + }
1.4095 + }
1.4096 +
1.4097 + } else {
1.4098 + for ( i = 0; checkSet[i] != null; i++ ) {
1.4099 + if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
1.4100 + results.push( set[i] );
1.4101 + }
1.4102 + }
1.4103 + }
1.4104 +
1.4105 + } else {
1.4106 + makeArray( checkSet, results );
1.4107 + }
1.4108 +
1.4109 + if ( extra ) {
1.4110 + Sizzle( extra, origContext, results, seed );
1.4111 + Sizzle.uniqueSort( results );
1.4112 + }
1.4113 +
1.4114 + return results;
1.4115 +};
1.4116 +
1.4117 +Sizzle.uniqueSort = function( results ) {
1.4118 + if ( sortOrder ) {
1.4119 + hasDuplicate = baseHasDuplicate;
1.4120 + results.sort( sortOrder );
1.4121 +
1.4122 + if ( hasDuplicate ) {
1.4123 + for ( var i = 1; i < results.length; i++ ) {
1.4124 + if ( results[i] === results[ i - 1 ] ) {
1.4125 + results.splice( i--, 1 );
1.4126 + }
1.4127 + }
1.4128 + }
1.4129 + }
1.4130 +
1.4131 + return results;
1.4132 +};
1.4133 +
1.4134 +Sizzle.matches = function( expr, set ) {
1.4135 + return Sizzle( expr, null, null, set );
1.4136 +};
1.4137 +
1.4138 +Sizzle.matchesSelector = function( node, expr ) {
1.4139 + return Sizzle( expr, null, null, [node] ).length > 0;
1.4140 +};
1.4141 +
1.4142 +Sizzle.find = function( expr, context, isXML ) {
1.4143 + var set, i, len, match, type, left;
1.4144 +
1.4145 + if ( !expr ) {
1.4146 + return [];
1.4147 + }
1.4148 +
1.4149 + for ( i = 0, len = Expr.order.length; i < len; i++ ) {
1.4150 + type = Expr.order[i];
1.4151 +
1.4152 + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
1.4153 + left = match[1];
1.4154 + match.splice( 1, 1 );
1.4155 +
1.4156 + if ( left.substr( left.length - 1 ) !== "\\" ) {
1.4157 + match[1] = (match[1] || "").replace( rBackslash, "" );
1.4158 + set = Expr.find[ type ]( match, context, isXML );
1.4159 +
1.4160 + if ( set != null ) {
1.4161 + expr = expr.replace( Expr.match[ type ], "" );
1.4162 + break;
1.4163 + }
1.4164 + }
1.4165 + }
1.4166 + }
1.4167 +
1.4168 + if ( !set ) {
1.4169 + set = typeof context.getElementsByTagName !== "undefined" ?
1.4170 + context.getElementsByTagName( "*" ) :
1.4171 + [];
1.4172 + }
1.4173 +
1.4174 + return { set: set, expr: expr };
1.4175 +};
1.4176 +
1.4177 +Sizzle.filter = function( expr, set, inplace, not ) {
1.4178 + var match, anyFound,
1.4179 + type, found, item, filter, left,
1.4180 + i, pass,
1.4181 + old = expr,
1.4182 + result = [],
1.4183 + curLoop = set,
1.4184 + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
1.4185 +
1.4186 + while ( expr && set.length ) {
1.4187 + for ( type in Expr.filter ) {
1.4188 + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
1.4189 + filter = Expr.filter[ type ];
1.4190 + left = match[1];
1.4191 +
1.4192 + anyFound = false;
1.4193 +
1.4194 + match.splice(1,1);
1.4195 +
1.4196 + if ( left.substr( left.length - 1 ) === "\\" ) {
1.4197 + continue;
1.4198 + }
1.4199 +
1.4200 + if ( curLoop === result ) {
1.4201 + result = [];
1.4202 + }
1.4203 +
1.4204 + if ( Expr.preFilter[ type ] ) {
1.4205 + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
1.4206 +
1.4207 + if ( !match ) {
1.4208 + anyFound = found = true;
1.4209 +
1.4210 + } else if ( match === true ) {
1.4211 + continue;
1.4212 + }
1.4213 + }
1.4214 +
1.4215 + if ( match ) {
1.4216 + for ( i = 0; (item = curLoop[i]) != null; i++ ) {
1.4217 + if ( item ) {
1.4218 + found = filter( item, match, i, curLoop );
1.4219 + pass = not ^ found;
1.4220 +
1.4221 + if ( inplace && found != null ) {
1.4222 + if ( pass ) {
1.4223 + anyFound = true;
1.4224 +
1.4225 + } else {
1.4226 + curLoop[i] = false;
1.4227 + }
1.4228 +
1.4229 + } else if ( pass ) {
1.4230 + result.push( item );
1.4231 + anyFound = true;
1.4232 + }
1.4233 + }
1.4234 + }
1.4235 + }
1.4236 +
1.4237 + if ( found !== undefined ) {
1.4238 + if ( !inplace ) {
1.4239 + curLoop = result;
1.4240 + }
1.4241 +
1.4242 + expr = expr.replace( Expr.match[ type ], "" );
1.4243 +
1.4244 + if ( !anyFound ) {
1.4245 + return [];
1.4246 + }
1.4247 +
1.4248 + break;
1.4249 + }
1.4250 + }
1.4251 + }
1.4252 +
1.4253 + // Improper expression
1.4254 + if ( expr === old ) {
1.4255 + if ( anyFound == null ) {
1.4256 + Sizzle.error( expr );
1.4257 +
1.4258 + } else {
1.4259 + break;
1.4260 + }
1.4261 + }
1.4262 +
1.4263 + old = expr;
1.4264 + }
1.4265 +
1.4266 + return curLoop;
1.4267 +};
1.4268 +
1.4269 +Sizzle.error = function( msg ) {
1.4270 + throw new Error( "Syntax error, unrecognized expression: " + msg );
1.4271 +};
1.4272 +
1.4273 +/**
1.4274 + * Utility function for retreiving the text value of an array of DOM nodes
1.4275 + * @param {Array|Element} elem
1.4276 + */
1.4277 +var getText = Sizzle.getText = function( elem ) {
1.4278 + var i, node,
1.4279 + nodeType = elem.nodeType,
1.4280 + ret = "";
1.4281 +
1.4282 + if ( nodeType ) {
1.4283 + if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1.4284 + // Use textContent || innerText for elements
1.4285 + if ( typeof elem.textContent === 'string' ) {
1.4286 + return elem.textContent;
1.4287 + } else if ( typeof elem.innerText === 'string' ) {
1.4288 + // Replace IE's carriage returns
1.4289 + return elem.innerText.replace( rReturn, '' );
1.4290 + } else {
1.4291 + // Traverse it's children
1.4292 + for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
1.4293 + ret += getText( elem );
1.4294 + }
1.4295 + }
1.4296 + } else if ( nodeType === 3 || nodeType === 4 ) {
1.4297 + return elem.nodeValue;
1.4298 + }
1.4299 + } else {
1.4300 +
1.4301 + // If no nodeType, this is expected to be an array
1.4302 + for ( i = 0; (node = elem[i]); i++ ) {
1.4303 + // Do not traverse comment nodes
1.4304 + if ( node.nodeType !== 8 ) {
1.4305 + ret += getText( node );
1.4306 + }
1.4307 + }
1.4308 + }
1.4309 + return ret;
1.4310 +};
1.4311 +
1.4312 +var Expr = Sizzle.selectors = {
1.4313 + order: [ "ID", "NAME", "TAG" ],
1.4314 +
1.4315 + match: {
1.4316 + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
1.4317 + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
1.4318 + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
1.4319 + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
1.4320 + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
1.4321 + CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
1.4322 + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
1.4323 + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
1.4324 + },
1.4325 +
1.4326 + leftMatch: {},
1.4327 +
1.4328 + attrMap: {
1.4329 + "class": "className",
1.4330 + "for": "htmlFor"
1.4331 + },
1.4332 +
1.4333 + attrHandle: {
1.4334 + href: function( elem ) {
1.4335 + return elem.getAttribute( "href" );
1.4336 + },
1.4337 + type: function( elem ) {
1.4338 + return elem.getAttribute( "type" );
1.4339 + }
1.4340 + },
1.4341 +
1.4342 + relative: {
1.4343 + "+": function(checkSet, part){
1.4344 + var isPartStr = typeof part === "string",
1.4345 + isTag = isPartStr && !rNonWord.test( part ),
1.4346 + isPartStrNotTag = isPartStr && !isTag;
1.4347 +
1.4348 + if ( isTag ) {
1.4349 + part = part.toLowerCase();
1.4350 + }
1.4351 +
1.4352 + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
1.4353 + if ( (elem = checkSet[i]) ) {
1.4354 + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
1.4355 +
1.4356 + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
1.4357 + elem || false :
1.4358 + elem === part;
1.4359 + }
1.4360 + }
1.4361 +
1.4362 + if ( isPartStrNotTag ) {
1.4363 + Sizzle.filter( part, checkSet, true );
1.4364 + }
1.4365 + },
1.4366 +
1.4367 + ">": function( checkSet, part ) {
1.4368 + var elem,
1.4369 + isPartStr = typeof part === "string",
1.4370 + i = 0,
1.4371 + l = checkSet.length;
1.4372 +
1.4373 + if ( isPartStr && !rNonWord.test( part ) ) {
1.4374 + part = part.toLowerCase();
1.4375 +
1.4376 + for ( ; i < l; i++ ) {
1.4377 + elem = checkSet[i];
1.4378 +
1.4379 + if ( elem ) {
1.4380 + var parent = elem.parentNode;
1.4381 + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
1.4382 + }
1.4383 + }
1.4384 +
1.4385 + } else {
1.4386 + for ( ; i < l; i++ ) {
1.4387 + elem = checkSet[i];
1.4388 +
1.4389 + if ( elem ) {
1.4390 + checkSet[i] = isPartStr ?
1.4391 + elem.parentNode :
1.4392 + elem.parentNode === part;
1.4393 + }
1.4394 + }
1.4395 +
1.4396 + if ( isPartStr ) {
1.4397 + Sizzle.filter( part, checkSet, true );
1.4398 + }
1.4399 + }
1.4400 + },
1.4401 +
1.4402 + "": function(checkSet, part, isXML){
1.4403 + var nodeCheck,
1.4404 + doneName = done++,
1.4405 + checkFn = dirCheck;
1.4406 +
1.4407 + if ( typeof part === "string" && !rNonWord.test( part ) ) {
1.4408 + part = part.toLowerCase();
1.4409 + nodeCheck = part;
1.4410 + checkFn = dirNodeCheck;
1.4411 + }
1.4412 +
1.4413 + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
1.4414 + },
1.4415 +
1.4416 + "~": function( checkSet, part, isXML ) {
1.4417 + var nodeCheck,
1.4418 + doneName = done++,
1.4419 + checkFn = dirCheck;
1.4420 +
1.4421 + if ( typeof part === "string" && !rNonWord.test( part ) ) {
1.4422 + part = part.toLowerCase();
1.4423 + nodeCheck = part;
1.4424 + checkFn = dirNodeCheck;
1.4425 + }
1.4426 +
1.4427 + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
1.4428 + }
1.4429 + },
1.4430 +
1.4431 + find: {
1.4432 + ID: function( match, context, isXML ) {
1.4433 + if ( typeof context.getElementById !== "undefined" && !isXML ) {
1.4434 + var m = context.getElementById(match[1]);
1.4435 + // Check parentNode to catch when Blackberry 4.6 returns
1.4436 + // nodes that are no longer in the document #6963
1.4437 + return m && m.parentNode ? [m] : [];
1.4438 + }
1.4439 + },
1.4440 +
1.4441 + NAME: function( match, context ) {
1.4442 + if ( typeof context.getElementsByName !== "undefined" ) {
1.4443 + var ret = [],
1.4444 + results = context.getElementsByName( match[1] );
1.4445 +
1.4446 + for ( var i = 0, l = results.length; i < l; i++ ) {
1.4447 + if ( results[i].getAttribute("name") === match[1] ) {
1.4448 + ret.push( results[i] );
1.4449 + }
1.4450 + }
1.4451 +
1.4452 + return ret.length === 0 ? null : ret;
1.4453 + }
1.4454 + },
1.4455 +
1.4456 + TAG: function( match, context ) {
1.4457 + if ( typeof context.getElementsByTagName !== "undefined" ) {
1.4458 + return context.getElementsByTagName( match[1] );
1.4459 + }
1.4460 + }
1.4461 + },
1.4462 + preFilter: {
1.4463 + CLASS: function( match, curLoop, inplace, result, not, isXML ) {
1.4464 + match = " " + match[1].replace( rBackslash, "" ) + " ";
1.4465 +
1.4466 + if ( isXML ) {
1.4467 + return match;
1.4468 + }
1.4469 +
1.4470 + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
1.4471 + if ( elem ) {
1.4472 + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
1.4473 + if ( !inplace ) {
1.4474 + result.push( elem );
1.4475 + }
1.4476 +
1.4477 + } else if ( inplace ) {
1.4478 + curLoop[i] = false;
1.4479 + }
1.4480 + }
1.4481 + }
1.4482 +
1.4483 + return false;
1.4484 + },
1.4485 +
1.4486 + ID: function( match ) {
1.4487 + return match[1].replace( rBackslash, "" );
1.4488 + },
1.4489 +
1.4490 + TAG: function( match, curLoop ) {
1.4491 + return match[1].replace( rBackslash, "" ).toLowerCase();
1.4492 + },
1.4493 +
1.4494 + CHILD: function( match ) {
1.4495 + if ( match[1] === "nth" ) {
1.4496 + if ( !match[2] ) {
1.4497 + Sizzle.error( match[0] );
1.4498 + }
1.4499 +
1.4500 + match[2] = match[2].replace(/^\+|\s*/g, '');
1.4501 +
1.4502 + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
1.4503 + var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
1.4504 + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
1.4505 + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
1.4506 +
1.4507 + // calculate the numbers (first)n+(last) including if they are negative
1.4508 + match[2] = (test[1] + (test[2] || 1)) - 0;
1.4509 + match[3] = test[3] - 0;
1.4510 + }
1.4511 + else if ( match[2] ) {
1.4512 + Sizzle.error( match[0] );
1.4513 + }
1.4514 +
1.4515 + // TODO: Move to normal caching system
1.4516 + match[0] = done++;
1.4517 +
1.4518 + return match;
1.4519 + },
1.4520 +
1.4521 + ATTR: function( match, curLoop, inplace, result, not, isXML ) {
1.4522 + var name = match[1] = match[1].replace( rBackslash, "" );
1.4523 +
1.4524 + if ( !isXML && Expr.attrMap[name] ) {
1.4525 + match[1] = Expr.attrMap[name];
1.4526 + }
1.4527 +
1.4528 + // Handle if an un-quoted value was used
1.4529 + match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
1.4530 +
1.4531 + if ( match[2] === "~=" ) {
1.4532 + match[4] = " " + match[4] + " ";
1.4533 + }
1.4534 +
1.4535 + return match;
1.4536 + },
1.4537 +
1.4538 + PSEUDO: function( match, curLoop, inplace, result, not ) {
1.4539 + if ( match[1] === "not" ) {
1.4540 + // If we're dealing with a complex expression, or a simple one
1.4541 + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
1.4542 + match[3] = Sizzle(match[3], null, null, curLoop);
1.4543 +
1.4544 + } else {
1.4545 + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
1.4546 +
1.4547 + if ( !inplace ) {
1.4548 + result.push.apply( result, ret );
1.4549 + }
1.4550 +
1.4551 + return false;
1.4552 + }
1.4553 +
1.4554 + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
1.4555 + return true;
1.4556 + }
1.4557 +
1.4558 + return match;
1.4559 + },
1.4560 +
1.4561 + POS: function( match ) {
1.4562 + match.unshift( true );
1.4563 +
1.4564 + return match;
1.4565 + }
1.4566 + },
1.4567 +
1.4568 + filters: {
1.4569 + enabled: function( elem ) {
1.4570 + return elem.disabled === false && elem.type !== "hidden";
1.4571 + },
1.4572 +
1.4573 + disabled: function( elem ) {
1.4574 + return elem.disabled === true;
1.4575 + },
1.4576 +
1.4577 + checked: function( elem ) {
1.4578 + return elem.checked === true;
1.4579 + },
1.4580 +
1.4581 + selected: function( elem ) {
1.4582 + // Accessing this property makes selected-by-default
1.4583 + // options in Safari work properly
1.4584 + if ( elem.parentNode ) {
1.4585 + elem.parentNode.selectedIndex;
1.4586 + }
1.4587 +
1.4588 + return elem.selected === true;
1.4589 + },
1.4590 +
1.4591 + parent: function( elem ) {
1.4592 + return !!elem.firstChild;
1.4593 + },
1.4594 +
1.4595 + empty: function( elem ) {
1.4596 + return !elem.firstChild;
1.4597 + },
1.4598 +
1.4599 + has: function( elem, i, match ) {
1.4600 + return !!Sizzle( match[3], elem ).length;
1.4601 + },
1.4602 +
1.4603 + header: function( elem ) {
1.4604 + return (/h\d/i).test( elem.nodeName );
1.4605 + },
1.4606 +
1.4607 + text: function( elem ) {
1.4608 + var attr = elem.getAttribute( "type" ), type = elem.type;
1.4609 + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
1.4610 + // use getAttribute instead to test this case
1.4611 + return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
1.4612 + },
1.4613 +
1.4614 + radio: function( elem ) {
1.4615 + return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
1.4616 + },
1.4617 +
1.4618 + checkbox: function( elem ) {
1.4619 + return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
1.4620 + },
1.4621 +
1.4622 + file: function( elem ) {
1.4623 + return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
1.4624 + },
1.4625 +
1.4626 + password: function( elem ) {
1.4627 + return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
1.4628 + },
1.4629 +
1.4630 + submit: function( elem ) {
1.4631 + var name = elem.nodeName.toLowerCase();
1.4632 + return (name === "input" || name === "button") && "submit" === elem.type;
1.4633 + },
1.4634 +
1.4635 + image: function( elem ) {
1.4636 + return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
1.4637 + },
1.4638 +
1.4639 + reset: function( elem ) {
1.4640 + var name = elem.nodeName.toLowerCase();
1.4641 + return (name === "input" || name === "button") && "reset" === elem.type;
1.4642 + },
1.4643 +
1.4644 + button: function( elem ) {
1.4645 + var name = elem.nodeName.toLowerCase();
1.4646 + return name === "input" && "button" === elem.type || name === "button";
1.4647 + },
1.4648 +
1.4649 + input: function( elem ) {
1.4650 + return (/input|select|textarea|button/i).test( elem.nodeName );
1.4651 + },
1.4652 +
1.4653 + focus: function( elem ) {
1.4654 + return elem === elem.ownerDocument.activeElement;
1.4655 + }
1.4656 + },
1.4657 + setFilters: {
1.4658 + first: function( elem, i ) {
1.4659 + return i === 0;
1.4660 + },
1.4661 +
1.4662 + last: function( elem, i, match, array ) {
1.4663 + return i === array.length - 1;
1.4664 + },
1.4665 +
1.4666 + even: function( elem, i ) {
1.4667 + return i % 2 === 0;
1.4668 + },
1.4669 +
1.4670 + odd: function( elem, i ) {
1.4671 + return i % 2 === 1;
1.4672 + },
1.4673 +
1.4674 + lt: function( elem, i, match ) {
1.4675 + return i < match[3] - 0;
1.4676 + },
1.4677 +
1.4678 + gt: function( elem, i, match ) {
1.4679 + return i > match[3] - 0;
1.4680 + },
1.4681 +
1.4682 + nth: function( elem, i, match ) {
1.4683 + return match[3] - 0 === i;
1.4684 + },
1.4685 +
1.4686 + eq: function( elem, i, match ) {
1.4687 + return match[3] - 0 === i;
1.4688 + }
1.4689 + },
1.4690 + filter: {
1.4691 + PSEUDO: function( elem, match, i, array ) {
1.4692 + var name = match[1],
1.4693 + filter = Expr.filters[ name ];
1.4694 +
1.4695 + if ( filter ) {
1.4696 + return filter( elem, i, match, array );
1.4697 +
1.4698 + } else if ( name === "contains" ) {
1.4699 + return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
1.4700 +
1.4701 + } else if ( name === "not" ) {
1.4702 + var not = match[3];
1.4703 +
1.4704 + for ( var j = 0, l = not.length; j < l; j++ ) {
1.4705 + if ( not[j] === elem ) {
1.4706 + return false;
1.4707 + }
1.4708 + }
1.4709 +
1.4710 + return true;
1.4711 +
1.4712 + } else {
1.4713 + Sizzle.error( name );
1.4714 + }
1.4715 + },
1.4716 +
1.4717 + CHILD: function( elem, match ) {
1.4718 + var first, last,
1.4719 + doneName, parent, cache,
1.4720 + count, diff,
1.4721 + type = match[1],
1.4722 + node = elem;
1.4723 +
1.4724 + switch ( type ) {
1.4725 + case "only":
1.4726 + case "first":
1.4727 + while ( (node = node.previousSibling) ) {
1.4728 + if ( node.nodeType === 1 ) {
1.4729 + return false;
1.4730 + }
1.4731 + }
1.4732 +
1.4733 + if ( type === "first" ) {
1.4734 + return true;
1.4735 + }
1.4736 +
1.4737 + node = elem;
1.4738 +
1.4739 + /* falls through */
1.4740 + case "last":
1.4741 + while ( (node = node.nextSibling) ) {
1.4742 + if ( node.nodeType === 1 ) {
1.4743 + return false;
1.4744 + }
1.4745 + }
1.4746 +
1.4747 + return true;
1.4748 +
1.4749 + case "nth":
1.4750 + first = match[2];
1.4751 + last = match[3];
1.4752 +
1.4753 + if ( first === 1 && last === 0 ) {
1.4754 + return true;
1.4755 + }
1.4756 +
1.4757 + doneName = match[0];
1.4758 + parent = elem.parentNode;
1.4759 +
1.4760 + if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
1.4761 + count = 0;
1.4762 +
1.4763 + for ( node = parent.firstChild; node; node = node.nextSibling ) {
1.4764 + if ( node.nodeType === 1 ) {
1.4765 + node.nodeIndex = ++count;
1.4766 + }
1.4767 + }
1.4768 +
1.4769 + parent[ expando ] = doneName;
1.4770 + }
1.4771 +
1.4772 + diff = elem.nodeIndex - last;
1.4773 +
1.4774 + if ( first === 0 ) {
1.4775 + return diff === 0;
1.4776 +
1.4777 + } else {
1.4778 + return ( diff % first === 0 && diff / first >= 0 );
1.4779 + }
1.4780 + }
1.4781 + },
1.4782 +
1.4783 + ID: function( elem, match ) {
1.4784 + return elem.nodeType === 1 && elem.getAttribute("id") === match;
1.4785 + },
1.4786 +
1.4787 + TAG: function( elem, match ) {
1.4788 + return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
1.4789 + },
1.4790 +
1.4791 + CLASS: function( elem, match ) {
1.4792 + return (" " + (elem.className || elem.getAttribute("class")) + " ")
1.4793 + .indexOf( match ) > -1;
1.4794 + },
1.4795 +
1.4796 + ATTR: function( elem, match ) {
1.4797 + var name = match[1],
1.4798 + result = Sizzle.attr ?
1.4799 + Sizzle.attr( elem, name ) :
1.4800 + Expr.attrHandle[ name ] ?
1.4801 + Expr.attrHandle[ name ]( elem ) :
1.4802 + elem[ name ] != null ?
1.4803 + elem[ name ] :
1.4804 + elem.getAttribute( name ),
1.4805 + value = result + "",
1.4806 + type = match[2],
1.4807 + check = match[4];
1.4808 +
1.4809 + return result == null ?
1.4810 + type === "!=" :
1.4811 + !type && Sizzle.attr ?
1.4812 + result != null :
1.4813 + type === "=" ?
1.4814 + value === check :
1.4815 + type === "*=" ?
1.4816 + value.indexOf(check) >= 0 :
1.4817 + type === "~=" ?
1.4818 + (" " + value + " ").indexOf(check) >= 0 :
1.4819 + !check ?
1.4820 + value && result !== false :
1.4821 + type === "!=" ?
1.4822 + value !== check :
1.4823 + type === "^=" ?
1.4824 + value.indexOf(check) === 0 :
1.4825 + type === "$=" ?
1.4826 + value.substr(value.length - check.length) === check :
1.4827 + type === "|=" ?
1.4828 + value === check || value.substr(0, check.length + 1) === check + "-" :
1.4829 + false;
1.4830 + },
1.4831 +
1.4832 + POS: function( elem, match, i, array ) {
1.4833 + var name = match[2],
1.4834 + filter = Expr.setFilters[ name ];
1.4835 +
1.4836 + if ( filter ) {
1.4837 + return filter( elem, i, match, array );
1.4838 + }
1.4839 + }
1.4840 + }
1.4841 +};
1.4842 +
1.4843 +var origPOS = Expr.match.POS,
1.4844 + fescape = function(all, num){
1.4845 + return "\\" + (num - 0 + 1);
1.4846 + };
1.4847 +
1.4848 +for ( var type in Expr.match ) {
1.4849 + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
1.4850 + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
1.4851 +}
1.4852 +// Expose origPOS
1.4853 +// "global" as in regardless of relation to brackets/parens
1.4854 +Expr.match.globalPOS = origPOS;
1.4855 +
1.4856 +var makeArray = function( array, results ) {
1.4857 + array = Array.prototype.slice.call( array, 0 );
1.4858 +
1.4859 + if ( results ) {
1.4860 + results.push.apply( results, array );
1.4861 + return results;
1.4862 + }
1.4863 +
1.4864 + return array;
1.4865 +};
1.4866 +
1.4867 +// Perform a simple check to determine if the browser is capable of
1.4868 +// converting a NodeList to an array using builtin methods.
1.4869 +// Also verifies that the returned array holds DOM nodes
1.4870 +// (which is not the case in the Blackberry browser)
1.4871 +try {
1.4872 + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
1.4873 +
1.4874 +// Provide a fallback method if it does not work
1.4875 +} catch( e ) {
1.4876 + makeArray = function( array, results ) {
1.4877 + var i = 0,
1.4878 + ret = results || [];
1.4879 +
1.4880 + if ( toString.call(array) === "[object Array]" ) {
1.4881 + Array.prototype.push.apply( ret, array );
1.4882 +
1.4883 + } else {
1.4884 + if ( typeof array.length === "number" ) {
1.4885 + for ( var l = array.length; i < l; i++ ) {
1.4886 + ret.push( array[i] );
1.4887 + }
1.4888 +
1.4889 + } else {
1.4890 + for ( ; array[i]; i++ ) {
1.4891 + ret.push( array[i] );
1.4892 + }
1.4893 + }
1.4894 + }
1.4895 +
1.4896 + return ret;
1.4897 + };
1.4898 +}
1.4899 +
1.4900 +var sortOrder, siblingCheck;
1.4901 +
1.4902 +if ( document.documentElement.compareDocumentPosition ) {
1.4903 + sortOrder = function( a, b ) {
1.4904 + if ( a === b ) {
1.4905 + hasDuplicate = true;
1.4906 + return 0;
1.4907 + }
1.4908 +
1.4909 + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
1.4910 + return a.compareDocumentPosition ? -1 : 1;
1.4911 + }
1.4912 +
1.4913 + return a.compareDocumentPosition(b) & 4 ? -1 : 1;
1.4914 + };
1.4915 +
1.4916 +} else {
1.4917 + sortOrder = function( a, b ) {
1.4918 + // The nodes are identical, we can exit early
1.4919 + if ( a === b ) {
1.4920 + hasDuplicate = true;
1.4921 + return 0;
1.4922 +
1.4923 + // Fallback to using sourceIndex (in IE) if it's available on both nodes
1.4924 + } else if ( a.sourceIndex && b.sourceIndex ) {
1.4925 + return a.sourceIndex - b.sourceIndex;
1.4926 + }
1.4927 +
1.4928 + var al, bl,
1.4929 + ap = [],
1.4930 + bp = [],
1.4931 + aup = a.parentNode,
1.4932 + bup = b.parentNode,
1.4933 + cur = aup;
1.4934 +
1.4935 + // If the nodes are siblings (or identical) we can do a quick check
1.4936 + if ( aup === bup ) {
1.4937 + return siblingCheck( a, b );
1.4938 +
1.4939 + // If no parents were found then the nodes are disconnected
1.4940 + } else if ( !aup ) {
1.4941 + return -1;
1.4942 +
1.4943 + } else if ( !bup ) {
1.4944 + return 1;
1.4945 + }
1.4946 +
1.4947 + // Otherwise they're somewhere else in the tree so we need
1.4948 + // to build up a full list of the parentNodes for comparison
1.4949 + while ( cur ) {
1.4950 + ap.unshift( cur );
1.4951 + cur = cur.parentNode;
1.4952 + }
1.4953 +
1.4954 + cur = bup;
1.4955 +
1.4956 + while ( cur ) {
1.4957 + bp.unshift( cur );
1.4958 + cur = cur.parentNode;
1.4959 + }
1.4960 +
1.4961 + al = ap.length;
1.4962 + bl = bp.length;
1.4963 +
1.4964 + // Start walking down the tree looking for a discrepancy
1.4965 + for ( var i = 0; i < al && i < bl; i++ ) {
1.4966 + if ( ap[i] !== bp[i] ) {
1.4967 + return siblingCheck( ap[i], bp[i] );
1.4968 + }
1.4969 + }
1.4970 +
1.4971 + // We ended someplace up the tree so do a sibling check
1.4972 + return i === al ?
1.4973 + siblingCheck( a, bp[i], -1 ) :
1.4974 + siblingCheck( ap[i], b, 1 );
1.4975 + };
1.4976 +
1.4977 + siblingCheck = function( a, b, ret ) {
1.4978 + if ( a === b ) {
1.4979 + return ret;
1.4980 + }
1.4981 +
1.4982 + var cur = a.nextSibling;
1.4983 +
1.4984 + while ( cur ) {
1.4985 + if ( cur === b ) {
1.4986 + return -1;
1.4987 + }
1.4988 +
1.4989 + cur = cur.nextSibling;
1.4990 + }
1.4991 +
1.4992 + return 1;
1.4993 + };
1.4994 +}
1.4995 +
1.4996 +// Check to see if the browser returns elements by name when
1.4997 +// querying by getElementById (and provide a workaround)
1.4998 +(function(){
1.4999 + // We're going to inject a fake input element with a specified name
1.5000 + var form = document.createElement("div"),
1.5001 + id = "script" + (new Date()).getTime(),
1.5002 + root = document.documentElement;
1.5003 +
1.5004 + form.innerHTML = "<a name='" + id + "'/>";
1.5005 +
1.5006 + // Inject it into the root element, check its status, and remove it quickly
1.5007 + root.insertBefore( form, root.firstChild );
1.5008 +
1.5009 + // The workaround has to do additional checks after a getElementById
1.5010 + // Which slows things down for other browsers (hence the branching)
1.5011 + if ( document.getElementById( id ) ) {
1.5012 + Expr.find.ID = function( match, context, isXML ) {
1.5013 + if ( typeof context.getElementById !== "undefined" && !isXML ) {
1.5014 + var m = context.getElementById(match[1]);
1.5015 +
1.5016 + return m ?
1.5017 + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
1.5018 + [m] :
1.5019 + undefined :
1.5020 + [];
1.5021 + }
1.5022 + };
1.5023 +
1.5024 + Expr.filter.ID = function( elem, match ) {
1.5025 + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
1.5026 +
1.5027 + return elem.nodeType === 1 && node && node.nodeValue === match;
1.5028 + };
1.5029 + }
1.5030 +
1.5031 + root.removeChild( form );
1.5032 +
1.5033 + // release memory in IE
1.5034 + root = form = null;
1.5035 +})();
1.5036 +
1.5037 +(function(){
1.5038 + // Check to see if the browser returns only elements
1.5039 + // when doing getElementsByTagName("*")
1.5040 +
1.5041 + // Create a fake element
1.5042 + var div = document.createElement("div");
1.5043 + div.appendChild( document.createComment("") );
1.5044 +
1.5045 + // Make sure no comments are found
1.5046 + if ( div.getElementsByTagName("*").length > 0 ) {
1.5047 + Expr.find.TAG = function( match, context ) {
1.5048 + var results = context.getElementsByTagName( match[1] );
1.5049 +
1.5050 + // Filter out possible comments
1.5051 + if ( match[1] === "*" ) {
1.5052 + var tmp = [];
1.5053 +
1.5054 + for ( var i = 0; results[i]; i++ ) {
1.5055 + if ( results[i].nodeType === 1 ) {
1.5056 + tmp.push( results[i] );
1.5057 + }
1.5058 + }
1.5059 +
1.5060 + results = tmp;
1.5061 + }
1.5062 +
1.5063 + return results;
1.5064 + };
1.5065 + }
1.5066 +
1.5067 + // Check to see if an attribute returns normalized href attributes
1.5068 + div.innerHTML = "<a href='#'></a>";
1.5069 +
1.5070 + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
1.5071 + div.firstChild.getAttribute("href") !== "#" ) {
1.5072 +
1.5073 + Expr.attrHandle.href = function( elem ) {
1.5074 + return elem.getAttribute( "href", 2 );
1.5075 + };
1.5076 + }
1.5077 +
1.5078 + // release memory in IE
1.5079 + div = null;
1.5080 +})();
1.5081 +
1.5082 +if ( document.querySelectorAll ) {
1.5083 + (function(){
1.5084 + var oldSizzle = Sizzle,
1.5085 + div = document.createElement("div"),
1.5086 + id = "__sizzle__";
1.5087 +
1.5088 + div.innerHTML = "<p class='TEST'></p>";
1.5089 +
1.5090 + // Safari can't handle uppercase or unicode characters when
1.5091 + // in quirks mode.
1.5092 + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
1.5093 + return;
1.5094 + }
1.5095 +
1.5096 + Sizzle = function( query, context, extra, seed ) {
1.5097 + context = context || document;
1.5098 +
1.5099 + // Only use querySelectorAll on non-XML documents
1.5100 + // (ID selectors don't work in non-HTML documents)
1.5101 + if ( !seed && !Sizzle.isXML(context) ) {
1.5102 + // See if we find a selector to speed up
1.5103 + var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
1.5104 +
1.5105 + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
1.5106 + // Speed-up: Sizzle("TAG")
1.5107 + if ( match[1] ) {
1.5108 + return makeArray( context.getElementsByTagName( query ), extra );
1.5109 +
1.5110 + // Speed-up: Sizzle(".CLASS")
1.5111 + } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
1.5112 + return makeArray( context.getElementsByClassName( match[2] ), extra );
1.5113 + }
1.5114 + }
1.5115 +
1.5116 + if ( context.nodeType === 9 ) {
1.5117 + // Speed-up: Sizzle("body")
1.5118 + // The body element only exists once, optimize finding it
1.5119 + if ( query === "body" && context.body ) {
1.5120 + return makeArray( [ context.body ], extra );
1.5121 +
1.5122 + // Speed-up: Sizzle("#ID")
1.5123 + } else if ( match && match[3] ) {
1.5124 + var elem = context.getElementById( match[3] );
1.5125 +
1.5126 + // Check parentNode to catch when Blackberry 4.6 returns
1.5127 + // nodes that are no longer in the document #6963
1.5128 + if ( elem && elem.parentNode ) {
1.5129 + // Handle the case where IE and Opera return items
1.5130 + // by name instead of ID
1.5131 + if ( elem.id === match[3] ) {
1.5132 + return makeArray( [ elem ], extra );
1.5133 + }
1.5134 +
1.5135 + } else {
1.5136 + return makeArray( [], extra );
1.5137 + }
1.5138 + }
1.5139 +
1.5140 + try {
1.5141 + return makeArray( context.querySelectorAll(query), extra );
1.5142 + } catch(qsaError) {}
1.5143 +
1.5144 + // qSA works strangely on Element-rooted queries
1.5145 + // We can work around this by specifying an extra ID on the root
1.5146 + // and working up from there (Thanks to Andrew Dupont for the technique)
1.5147 + // IE 8 doesn't work on object elements
1.5148 + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
1.5149 + var oldContext = context,
1.5150 + old = context.getAttribute( "id" ),
1.5151 + nid = old || id,
1.5152 + hasParent = context.parentNode,
1.5153 + relativeHierarchySelector = /^\s*[+~]/.test( query );
1.5154 +
1.5155 + if ( !old ) {
1.5156 + context.setAttribute( "id", nid );
1.5157 + } else {
1.5158 + nid = nid.replace( /'/g, "\\$&" );
1.5159 + }
1.5160 + if ( relativeHierarchySelector && hasParent ) {
1.5161 + context = context.parentNode;
1.5162 + }
1.5163 +
1.5164 + try {
1.5165 + if ( !relativeHierarchySelector || hasParent ) {
1.5166 + return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
1.5167 + }
1.5168 +
1.5169 + } catch(pseudoError) {
1.5170 + } finally {
1.5171 + if ( !old ) {
1.5172 + oldContext.removeAttribute( "id" );
1.5173 + }
1.5174 + }
1.5175 + }
1.5176 + }
1.5177 +
1.5178 + return oldSizzle(query, context, extra, seed);
1.5179 + };
1.5180 +
1.5181 + for ( var prop in oldSizzle ) {
1.5182 + Sizzle[ prop ] = oldSizzle[ prop ];
1.5183 + }
1.5184 +
1.5185 + // release memory in IE
1.5186 + div = null;
1.5187 + })();
1.5188 +}
1.5189 +
1.5190 +(function(){
1.5191 + var html = document.documentElement,
1.5192 + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
1.5193 +
1.5194 + if ( matches ) {
1.5195 + // Check to see if it's possible to do matchesSelector
1.5196 + // on a disconnected node (IE 9 fails this)
1.5197 + var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
1.5198 + pseudoWorks = false;
1.5199 +
1.5200 + try {
1.5201 + // This should fail with an exception
1.5202 + // Gecko does not error, returns false instead
1.5203 + matches.call( document.documentElement, "[test!='']:sizzle" );
1.5204 +
1.5205 + } catch( pseudoError ) {
1.5206 + pseudoWorks = true;
1.5207 + }
1.5208 +
1.5209 + Sizzle.matchesSelector = function( node, expr ) {
1.5210 + // Make sure that attribute selectors are quoted
1.5211 + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
1.5212 +
1.5213 + if ( !Sizzle.isXML( node ) ) {
1.5214 + try {
1.5215 + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
1.5216 + var ret = matches.call( node, expr );
1.5217 +
1.5218 + // IE 9's matchesSelector returns false on disconnected nodes
1.5219 + if ( ret || !disconnectedMatch ||
1.5220 + // As well, disconnected nodes are said to be in a document
1.5221 + // fragment in IE 9, so check for that
1.5222 + node.document && node.document.nodeType !== 11 ) {
1.5223 + return ret;
1.5224 + }
1.5225 + }
1.5226 + } catch(e) {}
1.5227 + }
1.5228 +
1.5229 + return Sizzle(expr, null, null, [node]).length > 0;
1.5230 + };
1.5231 + }
1.5232 +})();
1.5233 +
1.5234 +(function(){
1.5235 + var div = document.createElement("div");
1.5236 +
1.5237 + div.innerHTML = "<div class='test e'></div><div class='test'></div>";
1.5238 +
1.5239 + // Opera can't find a second classname (in 9.6)
1.5240 + // Also, make sure that getElementsByClassName actually exists
1.5241 + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
1.5242 + return;
1.5243 + }
1.5244 +
1.5245 + // Safari caches class attributes, doesn't catch changes (in 3.2)
1.5246 + div.lastChild.className = "e";
1.5247 +
1.5248 + if ( div.getElementsByClassName("e").length === 1 ) {
1.5249 + return;
1.5250 + }
1.5251 +
1.5252 + Expr.order.splice(1, 0, "CLASS");
1.5253 + Expr.find.CLASS = function( match, context, isXML ) {
1.5254 + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
1.5255 + return context.getElementsByClassName(match[1]);
1.5256 + }
1.5257 + };
1.5258 +
1.5259 + // release memory in IE
1.5260 + div = null;
1.5261 +})();
1.5262 +
1.5263 +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
1.5264 + for ( var i = 0, l = checkSet.length; i < l; i++ ) {
1.5265 + var elem = checkSet[i];
1.5266 +
1.5267 + if ( elem ) {
1.5268 + var match = false;
1.5269 +
1.5270 + elem = elem[dir];
1.5271 +
1.5272 + while ( elem ) {
1.5273 + if ( elem[ expando ] === doneName ) {
1.5274 + match = checkSet[elem.sizset];
1.5275 + break;
1.5276 + }
1.5277 +
1.5278 + if ( elem.nodeType === 1 && !isXML ){
1.5279 + elem[ expando ] = doneName;
1.5280 + elem.sizset = i;
1.5281 + }
1.5282 +
1.5283 + if ( elem.nodeName.toLowerCase() === cur ) {
1.5284 + match = elem;
1.5285 + break;
1.5286 + }
1.5287 +
1.5288 + elem = elem[dir];
1.5289 + }
1.5290 +
1.5291 + checkSet[i] = match;
1.5292 + }
1.5293 + }
1.5294 +}
1.5295 +
1.5296 +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
1.5297 + for ( var i = 0, l = checkSet.length; i < l; i++ ) {
1.5298 + var elem = checkSet[i];
1.5299 +
1.5300 + if ( elem ) {
1.5301 + var match = false;
1.5302 +
1.5303 + elem = elem[dir];
1.5304 +
1.5305 + while ( elem ) {
1.5306 + if ( elem[ expando ] === doneName ) {
1.5307 + match = checkSet[elem.sizset];
1.5308 + break;
1.5309 + }
1.5310 +
1.5311 + if ( elem.nodeType === 1 ) {
1.5312 + if ( !isXML ) {
1.5313 + elem[ expando ] = doneName;
1.5314 + elem.sizset = i;
1.5315 + }
1.5316 +
1.5317 + if ( typeof cur !== "string" ) {
1.5318 + if ( elem === cur ) {
1.5319 + match = true;
1.5320 + break;
1.5321 + }
1.5322 +
1.5323 + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
1.5324 + match = elem;
1.5325 + break;
1.5326 + }
1.5327 + }
1.5328 +
1.5329 + elem = elem[dir];
1.5330 + }
1.5331 +
1.5332 + checkSet[i] = match;
1.5333 + }
1.5334 + }
1.5335 +}
1.5336 +
1.5337 +if ( document.documentElement.contains ) {
1.5338 + Sizzle.contains = function( a, b ) {
1.5339 + return a !== b && (a.contains ? a.contains(b) : true);
1.5340 + };
1.5341 +
1.5342 +} else if ( document.documentElement.compareDocumentPosition ) {
1.5343 + Sizzle.contains = function( a, b ) {
1.5344 + return !!(a.compareDocumentPosition(b) & 16);
1.5345 + };
1.5346 +
1.5347 +} else {
1.5348 + Sizzle.contains = function() {
1.5349 + return false;
1.5350 + };
1.5351 +}
1.5352 +
1.5353 +Sizzle.isXML = function( elem ) {
1.5354 + // documentElement is verified for cases where it doesn't yet exist
1.5355 + // (such as loading iframes in IE - #4833)
1.5356 + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
1.5357 +
1.5358 + return documentElement ? documentElement.nodeName !== "HTML" : false;
1.5359 +};
1.5360 +
1.5361 +var posProcess = function( selector, context, seed ) {
1.5362 + var match,
1.5363 + tmpSet = [],
1.5364 + later = "",
1.5365 + root = context.nodeType ? [context] : context;
1.5366 +
1.5367 + // Position selectors must be done after the filter
1.5368 + // And so must :not(positional) so we move all PSEUDOs to the end
1.5369 + while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
1.5370 + later += match[0];
1.5371 + selector = selector.replace( Expr.match.PSEUDO, "" );
1.5372 + }
1.5373 +
1.5374 + selector = Expr.relative[selector] ? selector + "*" : selector;
1.5375 +
1.5376 + for ( var i = 0, l = root.length; i < l; i++ ) {
1.5377 + Sizzle( selector, root[i], tmpSet, seed );
1.5378 + }
1.5379 +
1.5380 + return Sizzle.filter( later, tmpSet );
1.5381 +};
1.5382 +
1.5383 +// EXPOSE
1.5384 +// Override sizzle attribute retrieval
1.5385 +Sizzle.attr = jQuery.attr;
1.5386 +Sizzle.selectors.attrMap = {};
1.5387 +jQuery.find = Sizzle;
1.5388 +jQuery.expr = Sizzle.selectors;
1.5389 +jQuery.expr[":"] = jQuery.expr.filters;
1.5390 +jQuery.unique = Sizzle.uniqueSort;
1.5391 +jQuery.text = Sizzle.getText;
1.5392 +jQuery.isXMLDoc = Sizzle.isXML;
1.5393 +jQuery.contains = Sizzle.contains;
1.5394 +
1.5395 +
1.5396 +})();
1.5397 +
1.5398 +
1.5399 +var runtil = /Until$/,
1.5400 + rparentsprev = /^(?:parents|prevUntil|prevAll)/,
1.5401 + // Note: This RegExp should be improved, or likely pulled from Sizzle
1.5402 + rmultiselector = /,/,
1.5403 + isSimple = /^.[^:#\[\.,]*$/,
1.5404 + slice = Array.prototype.slice,
1.5405 + POS = jQuery.expr.match.globalPOS,
1.5406 + // methods guaranteed to produce a unique set when starting from a unique set
1.5407 + guaranteedUnique = {
1.5408 + children: true,
1.5409 + contents: true,
1.5410 + next: true,
1.5411 + prev: true
1.5412 + };
1.5413 +
1.5414 +jQuery.fn.extend({
1.5415 + find: function( selector ) {
1.5416 + var self = this,
1.5417 + i, l;
1.5418 +
1.5419 + if ( typeof selector !== "string" ) {
1.5420 + return jQuery( selector ).filter(function() {
1.5421 + for ( i = 0, l = self.length; i < l; i++ ) {
1.5422 + if ( jQuery.contains( self[ i ], this ) ) {
1.5423 + return true;
1.5424 + }
1.5425 + }
1.5426 + });
1.5427 + }
1.5428 +
1.5429 + var ret = this.pushStack( "", "find", selector ),
1.5430 + length, n, r;
1.5431 +
1.5432 + for ( i = 0, l = this.length; i < l; i++ ) {
1.5433 + length = ret.length;
1.5434 + jQuery.find( selector, this[i], ret );
1.5435 +
1.5436 + if ( i > 0 ) {
1.5437 + // Make sure that the results are unique
1.5438 + for ( n = length; n < ret.length; n++ ) {
1.5439 + for ( r = 0; r < length; r++ ) {
1.5440 + if ( ret[r] === ret[n] ) {
1.5441 + ret.splice(n--, 1);
1.5442 + break;
1.5443 + }
1.5444 + }
1.5445 + }
1.5446 + }
1.5447 + }
1.5448 +
1.5449 + return ret;
1.5450 + },
1.5451 +
1.5452 + has: function( target ) {
1.5453 + var targets = jQuery( target );
1.5454 + return this.filter(function() {
1.5455 + for ( var i = 0, l = targets.length; i < l; i++ ) {
1.5456 + if ( jQuery.contains( this, targets[i] ) ) {
1.5457 + return true;
1.5458 + }
1.5459 + }
1.5460 + });
1.5461 + },
1.5462 +
1.5463 + not: function( selector ) {
1.5464 + return this.pushStack( winnow(this, selector, false), "not", selector);
1.5465 + },
1.5466 +
1.5467 + filter: function( selector ) {
1.5468 + return this.pushStack( winnow(this, selector, true), "filter", selector );
1.5469 + },
1.5470 +
1.5471 + is: function( selector ) {
1.5472 + return !!selector && (
1.5473 + typeof selector === "string" ?
1.5474 + // If this is a positional selector, check membership in the returned set
1.5475 + // so $("p:first").is("p:last") won't return true for a doc with two "p".
1.5476 + POS.test( selector ) ?
1.5477 + jQuery( selector, this.context ).index( this[0] ) >= 0 :
1.5478 + jQuery.filter( selector, this ).length > 0 :
1.5479 + this.filter( selector ).length > 0 );
1.5480 + },
1.5481 +
1.5482 + closest: function( selectors, context ) {
1.5483 + var ret = [], i, l, cur = this[0];
1.5484 +
1.5485 + // Array (deprecated as of jQuery 1.7)
1.5486 + if ( jQuery.isArray( selectors ) ) {
1.5487 + var level = 1;
1.5488 +
1.5489 + while ( cur && cur.ownerDocument && cur !== context ) {
1.5490 + for ( i = 0; i < selectors.length; i++ ) {
1.5491 +
1.5492 + if ( jQuery( cur ).is( selectors[ i ] ) ) {
1.5493 + ret.push({ selector: selectors[ i ], elem: cur, level: level });
1.5494 + }
1.5495 + }
1.5496 +
1.5497 + cur = cur.parentNode;
1.5498 + level++;
1.5499 + }
1.5500 +
1.5501 + return ret;
1.5502 + }
1.5503 +
1.5504 + // String
1.5505 + var pos = POS.test( selectors ) || typeof selectors !== "string" ?
1.5506 + jQuery( selectors, context || this.context ) :
1.5507 + 0;
1.5508 +
1.5509 + for ( i = 0, l = this.length; i < l; i++ ) {
1.5510 + cur = this[i];
1.5511 +
1.5512 + while ( cur ) {
1.5513 + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
1.5514 + ret.push( cur );
1.5515 + break;
1.5516 +
1.5517 + } else {
1.5518 + cur = cur.parentNode;
1.5519 + if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
1.5520 + break;
1.5521 + }
1.5522 + }
1.5523 + }
1.5524 + }
1.5525 +
1.5526 + ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
1.5527 +
1.5528 + return this.pushStack( ret, "closest", selectors );
1.5529 + },
1.5530 +
1.5531 + // Determine the position of an element within
1.5532 + // the matched set of elements
1.5533 + index: function( elem ) {
1.5534 +
1.5535 + // No argument, return index in parent
1.5536 + if ( !elem ) {
1.5537 + return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
1.5538 + }
1.5539 +
1.5540 + // index in selector
1.5541 + if ( typeof elem === "string" ) {
1.5542 + return jQuery.inArray( this[0], jQuery( elem ) );
1.5543 + }
1.5544 +
1.5545 + // Locate the position of the desired element
1.5546 + return jQuery.inArray(
1.5547 + // If it receives a jQuery object, the first element is used
1.5548 + elem.jquery ? elem[0] : elem, this );
1.5549 + },
1.5550 +
1.5551 + add: function( selector, context ) {
1.5552 + var set = typeof selector === "string" ?
1.5553 + jQuery( selector, context ) :
1.5554 + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
1.5555 + all = jQuery.merge( this.get(), set );
1.5556 +
1.5557 + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
1.5558 + all :
1.5559 + jQuery.unique( all ) );
1.5560 + },
1.5561 +
1.5562 + andSelf: function() {
1.5563 + return this.add( this.prevObject );
1.5564 + }
1.5565 +});
1.5566 +
1.5567 +// A painfully simple check to see if an element is disconnected
1.5568 +// from a document (should be improved, where feasible).
1.5569 +function isDisconnected( node ) {
1.5570 + return !node || !node.parentNode || node.parentNode.nodeType === 11;
1.5571 +}
1.5572 +
1.5573 +jQuery.each({
1.5574 + parent: function( elem ) {
1.5575 + var parent = elem.parentNode;
1.5576 + return parent && parent.nodeType !== 11 ? parent : null;
1.5577 + },
1.5578 + parents: function( elem ) {
1.5579 + return jQuery.dir( elem, "parentNode" );
1.5580 + },
1.5581 + parentsUntil: function( elem, i, until ) {
1.5582 + return jQuery.dir( elem, "parentNode", until );
1.5583 + },
1.5584 + next: function( elem ) {
1.5585 + return jQuery.nth( elem, 2, "nextSibling" );
1.5586 + },
1.5587 + prev: function( elem ) {
1.5588 + return jQuery.nth( elem, 2, "previousSibling" );
1.5589 + },
1.5590 + nextAll: function( elem ) {
1.5591 + return jQuery.dir( elem, "nextSibling" );
1.5592 + },
1.5593 + prevAll: function( elem ) {
1.5594 + return jQuery.dir( elem, "previousSibling" );
1.5595 + },
1.5596 + nextUntil: function( elem, i, until ) {
1.5597 + return jQuery.dir( elem, "nextSibling", until );
1.5598 + },
1.5599 + prevUntil: function( elem, i, until ) {
1.5600 + return jQuery.dir( elem, "previousSibling", until );
1.5601 + },
1.5602 + siblings: function( elem ) {
1.5603 + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
1.5604 + },
1.5605 + children: function( elem ) {
1.5606 + return jQuery.sibling( elem.firstChild );
1.5607 + },
1.5608 + contents: function( elem ) {
1.5609 + return jQuery.nodeName( elem, "iframe" ) ?
1.5610 + elem.contentDocument || elem.contentWindow.document :
1.5611 + jQuery.makeArray( elem.childNodes );
1.5612 + }
1.5613 +}, function( name, fn ) {
1.5614 + jQuery.fn[ name ] = function( until, selector ) {
1.5615 + var ret = jQuery.map( this, fn, until );
1.5616 +
1.5617 + if ( !runtil.test( name ) ) {
1.5618 + selector = until;
1.5619 + }
1.5620 +
1.5621 + if ( selector && typeof selector === "string" ) {
1.5622 + ret = jQuery.filter( selector, ret );
1.5623 + }
1.5624 +
1.5625 + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
1.5626 +
1.5627 + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
1.5628 + ret = ret.reverse();
1.5629 + }
1.5630 +
1.5631 + return this.pushStack( ret, name, slice.call( arguments ).join(",") );
1.5632 + };
1.5633 +});
1.5634 +
1.5635 +jQuery.extend({
1.5636 + filter: function( expr, elems, not ) {
1.5637 + if ( not ) {
1.5638 + expr = ":not(" + expr + ")";
1.5639 + }
1.5640 +
1.5641 + return elems.length === 1 ?
1.5642 + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
1.5643 + jQuery.find.matches(expr, elems);
1.5644 + },
1.5645 +
1.5646 + dir: function( elem, dir, until ) {
1.5647 + var matched = [],
1.5648 + cur = elem[ dir ];
1.5649 +
1.5650 + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
1.5651 + if ( cur.nodeType === 1 ) {
1.5652 + matched.push( cur );
1.5653 + }
1.5654 + cur = cur[dir];
1.5655 + }
1.5656 + return matched;
1.5657 + },
1.5658 +
1.5659 + nth: function( cur, result, dir, elem ) {
1.5660 + result = result || 1;
1.5661 + var num = 0;
1.5662 +
1.5663 + for ( ; cur; cur = cur[dir] ) {
1.5664 + if ( cur.nodeType === 1 && ++num === result ) {
1.5665 + break;
1.5666 + }
1.5667 + }
1.5668 +
1.5669 + return cur;
1.5670 + },
1.5671 +
1.5672 + sibling: function( n, elem ) {
1.5673 + var r = [];
1.5674 +
1.5675 + for ( ; n; n = n.nextSibling ) {
1.5676 + if ( n.nodeType === 1 && n !== elem ) {
1.5677 + r.push( n );
1.5678 + }
1.5679 + }
1.5680 +
1.5681 + return r;
1.5682 + }
1.5683 +});
1.5684 +
1.5685 +// Implement the identical functionality for filter and not
1.5686 +function winnow( elements, qualifier, keep ) {
1.5687 +
1.5688 + // Can't pass null or undefined to indexOf in Firefox 4
1.5689 + // Set to 0 to skip string check
1.5690 + qualifier = qualifier || 0;
1.5691 +
1.5692 + if ( jQuery.isFunction( qualifier ) ) {
1.5693 + return jQuery.grep(elements, function( elem, i ) {
1.5694 + var retVal = !!qualifier.call( elem, i, elem );
1.5695 + return retVal === keep;
1.5696 + });
1.5697 +
1.5698 + } else if ( qualifier.nodeType ) {
1.5699 + return jQuery.grep(elements, function( elem, i ) {
1.5700 + return ( elem === qualifier ) === keep;
1.5701 + });
1.5702 +
1.5703 + } else if ( typeof qualifier === "string" ) {
1.5704 + var filtered = jQuery.grep(elements, function( elem ) {
1.5705 + return elem.nodeType === 1;
1.5706 + });
1.5707 +
1.5708 + if ( isSimple.test( qualifier ) ) {
1.5709 + return jQuery.filter(qualifier, filtered, !keep);
1.5710 + } else {
1.5711 + qualifier = jQuery.filter( qualifier, filtered );
1.5712 + }
1.5713 + }
1.5714 +
1.5715 + return jQuery.grep(elements, function( elem, i ) {
1.5716 + return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
1.5717 + });
1.5718 +}
1.5719 +
1.5720 +
1.5721 +
1.5722 +
1.5723 +function createSafeFragment( document ) {
1.5724 + var list = nodeNames.split( "|" ),
1.5725 + safeFrag = document.createDocumentFragment();
1.5726 +
1.5727 + if ( safeFrag.createElement ) {
1.5728 + while ( list.length ) {
1.5729 + safeFrag.createElement(
1.5730 + list.pop()
1.5731 + );
1.5732 + }
1.5733 + }
1.5734 + return safeFrag;
1.5735 +}
1.5736 +
1.5737 +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
1.5738 + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
1.5739 + rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
1.5740 + rleadingWhitespace = /^\s+/,
1.5741 + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
1.5742 + rtagName = /<([\w:]+)/,
1.5743 + rtbody = /<tbody/i,
1.5744 + rhtml = /<|&#?\w+;/,
1.5745 + rnoInnerhtml = /<(?:script|style)/i,
1.5746 + rnocache = /<(?:script|object|embed|option|style)/i,
1.5747 + rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
1.5748 + // checked="checked" or checked
1.5749 + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
1.5750 + rscriptType = /\/(java|ecma)script/i,
1.5751 + rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
1.5752 + wrapMap = {
1.5753 + option: [ 1, "<select multiple='multiple'>", "</select>" ],
1.5754 + legend: [ 1, "<fieldset>", "</fieldset>" ],
1.5755 + thead: [ 1, "<table>", "</table>" ],
1.5756 + tr: [ 2, "<table><tbody>", "</tbody></table>" ],
1.5757 + td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
1.5758 + col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
1.5759 + area: [ 1, "<map>", "</map>" ],
1.5760 + _default: [ 0, "", "" ]
1.5761 + },
1.5762 + safeFragment = createSafeFragment( document );
1.5763 +
1.5764 +wrapMap.optgroup = wrapMap.option;
1.5765 +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
1.5766 +wrapMap.th = wrapMap.td;
1.5767 +
1.5768 +// IE can't serialize <link> and <script> tags normally
1.5769 +if ( !jQuery.support.htmlSerialize ) {
1.5770 + wrapMap._default = [ 1, "div<div>", "</div>" ];
1.5771 +}
1.5772 +
1.5773 +jQuery.fn.extend({
1.5774 + text: function( value ) {
1.5775 + return jQuery.access( this, function( value ) {
1.5776 + return value === undefined ?
1.5777 + jQuery.text( this ) :
1.5778 + this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
1.5779 + }, null, value, arguments.length );
1.5780 + },
1.5781 +
1.5782 + wrapAll: function( html ) {
1.5783 + if ( jQuery.isFunction( html ) ) {
1.5784 + return this.each(function(i) {
1.5785 + jQuery(this).wrapAll( html.call(this, i) );
1.5786 + });
1.5787 + }
1.5788 +
1.5789 + if ( this[0] ) {
1.5790 + // The elements to wrap the target around
1.5791 + var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
1.5792 +
1.5793 + if ( this[0].parentNode ) {
1.5794 + wrap.insertBefore( this[0] );
1.5795 + }
1.5796 +
1.5797 + wrap.map(function() {
1.5798 + var elem = this;
1.5799 +
1.5800 + while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
1.5801 + elem = elem.firstChild;
1.5802 + }
1.5803 +
1.5804 + return elem;
1.5805 + }).append( this );
1.5806 + }
1.5807 +
1.5808 + return this;
1.5809 + },
1.5810 +
1.5811 + wrapInner: function( html ) {
1.5812 + if ( jQuery.isFunction( html ) ) {
1.5813 + return this.each(function(i) {
1.5814 + jQuery(this).wrapInner( html.call(this, i) );
1.5815 + });
1.5816 + }
1.5817 +
1.5818 + return this.each(function() {
1.5819 + var self = jQuery( this ),
1.5820 + contents = self.contents();
1.5821 +
1.5822 + if ( contents.length ) {
1.5823 + contents.wrapAll( html );
1.5824 +
1.5825 + } else {
1.5826 + self.append( html );
1.5827 + }
1.5828 + });
1.5829 + },
1.5830 +
1.5831 + wrap: function( html ) {
1.5832 + var isFunction = jQuery.isFunction( html );
1.5833 +
1.5834 + return this.each(function(i) {
1.5835 + jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
1.5836 + });
1.5837 + },
1.5838 +
1.5839 + unwrap: function() {
1.5840 + return this.parent().each(function() {
1.5841 + if ( !jQuery.nodeName( this, "body" ) ) {
1.5842 + jQuery( this ).replaceWith( this.childNodes );
1.5843 + }
1.5844 + }).end();
1.5845 + },
1.5846 +
1.5847 + append: function() {
1.5848 + return this.domManip(arguments, true, function( elem ) {
1.5849 + if ( this.nodeType === 1 ) {
1.5850 + this.appendChild( elem );
1.5851 + }
1.5852 + });
1.5853 + },
1.5854 +
1.5855 + prepend: function() {
1.5856 + return this.domManip(arguments, true, function( elem ) {
1.5857 + if ( this.nodeType === 1 ) {
1.5858 + this.insertBefore( elem, this.firstChild );
1.5859 + }
1.5860 + });
1.5861 + },
1.5862 +
1.5863 + before: function() {
1.5864 + if ( this[0] && this[0].parentNode ) {
1.5865 + return this.domManip(arguments, false, function( elem ) {
1.5866 + this.parentNode.insertBefore( elem, this );
1.5867 + });
1.5868 + } else if ( arguments.length ) {
1.5869 + var set = jQuery.clean( arguments );
1.5870 + set.push.apply( set, this.toArray() );
1.5871 + return this.pushStack( set, "before", arguments );
1.5872 + }
1.5873 + },
1.5874 +
1.5875 + after: function() {
1.5876 + if ( this[0] && this[0].parentNode ) {
1.5877 + return this.domManip(arguments, false, function( elem ) {
1.5878 + this.parentNode.insertBefore( elem, this.nextSibling );
1.5879 + });
1.5880 + } else if ( arguments.length ) {
1.5881 + var set = this.pushStack( this, "after", arguments );
1.5882 + set.push.apply( set, jQuery.clean(arguments) );
1.5883 + return set;
1.5884 + }
1.5885 + },
1.5886 +
1.5887 + // keepData is for internal use only--do not document
1.5888 + remove: function( selector, keepData ) {
1.5889 + for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
1.5890 + if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
1.5891 + if ( !keepData && elem.nodeType === 1 ) {
1.5892 + jQuery.cleanData( elem.getElementsByTagName("*") );
1.5893 + jQuery.cleanData( [ elem ] );
1.5894 + }
1.5895 +
1.5896 + if ( elem.parentNode ) {
1.5897 + elem.parentNode.removeChild( elem );
1.5898 + }
1.5899 + }
1.5900 + }
1.5901 +
1.5902 + return this;
1.5903 + },
1.5904 +
1.5905 + empty: function() {
1.5906 + for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
1.5907 + // Remove element nodes and prevent memory leaks
1.5908 + if ( elem.nodeType === 1 ) {
1.5909 + jQuery.cleanData( elem.getElementsByTagName("*") );
1.5910 + }
1.5911 +
1.5912 + // Remove any remaining nodes
1.5913 + while ( elem.firstChild ) {
1.5914 + elem.removeChild( elem.firstChild );
1.5915 + }
1.5916 + }
1.5917 +
1.5918 + return this;
1.5919 + },
1.5920 +
1.5921 + clone: function( dataAndEvents, deepDataAndEvents ) {
1.5922 + dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
1.5923 + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
1.5924 +
1.5925 + return this.map( function () {
1.5926 + return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
1.5927 + });
1.5928 + },
1.5929 +
1.5930 + html: function( value ) {
1.5931 + return jQuery.access( this, function( value ) {
1.5932 + var elem = this[0] || {},
1.5933 + i = 0,
1.5934 + l = this.length;
1.5935 +
1.5936 + if ( value === undefined ) {
1.5937 + return elem.nodeType === 1 ?
1.5938 + elem.innerHTML.replace( rinlinejQuery, "" ) :
1.5939 + null;
1.5940 + }
1.5941 +
1.5942 +
1.5943 + if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
1.5944 + ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
1.5945 + !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
1.5946 +
1.5947 + value = value.replace( rxhtmlTag, "<$1></$2>" );
1.5948 +
1.5949 + try {
1.5950 + for (; i < l; i++ ) {
1.5951 + // Remove element nodes and prevent memory leaks
1.5952 + elem = this[i] || {};
1.5953 + if ( elem.nodeType === 1 ) {
1.5954 + jQuery.cleanData( elem.getElementsByTagName( "*" ) );
1.5955 + elem.innerHTML = value;
1.5956 + }
1.5957 + }
1.5958 +
1.5959 + elem = 0;
1.5960 +
1.5961 + // If using innerHTML throws an exception, use the fallback method
1.5962 + } catch(e) {}
1.5963 + }
1.5964 +
1.5965 + if ( elem ) {
1.5966 + this.empty().append( value );
1.5967 + }
1.5968 + }, null, value, arguments.length );
1.5969 + },
1.5970 +
1.5971 + replaceWith: function( value ) {
1.5972 + if ( this[0] && this[0].parentNode ) {
1.5973 + // Make sure that the elements are removed from the DOM before they are inserted
1.5974 + // this can help fix replacing a parent with child elements
1.5975 + if ( jQuery.isFunction( value ) ) {
1.5976 + return this.each(function(i) {
1.5977 + var self = jQuery(this), old = self.html();
1.5978 + self.replaceWith( value.call( this, i, old ) );
1.5979 + });
1.5980 + }
1.5981 +
1.5982 + if ( typeof value !== "string" ) {
1.5983 + value = jQuery( value ).detach();
1.5984 + }
1.5985 +
1.5986 + return this.each(function() {
1.5987 + var next = this.nextSibling,
1.5988 + parent = this.parentNode;
1.5989 +
1.5990 + jQuery( this ).remove();
1.5991 +
1.5992 + if ( next ) {
1.5993 + jQuery(next).before( value );
1.5994 + } else {
1.5995 + jQuery(parent).append( value );
1.5996 + }
1.5997 + });
1.5998 + } else {
1.5999 + return this.length ?
1.6000 + this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
1.6001 + this;
1.6002 + }
1.6003 + },
1.6004 +
1.6005 + detach: function( selector ) {
1.6006 + return this.remove( selector, true );
1.6007 + },
1.6008 +
1.6009 + domManip: function( args, table, callback ) {
1.6010 + var results, first, fragment, parent,
1.6011 + value = args[0],
1.6012 + scripts = [];
1.6013 +
1.6014 + // We can't cloneNode fragments that contain checked, in WebKit
1.6015 + if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
1.6016 + return this.each(function() {
1.6017 + jQuery(this).domManip( args, table, callback, true );
1.6018 + });
1.6019 + }
1.6020 +
1.6021 + if ( jQuery.isFunction(value) ) {
1.6022 + return this.each(function(i) {
1.6023 + var self = jQuery(this);
1.6024 + args[0] = value.call(this, i, table ? self.html() : undefined);
1.6025 + self.domManip( args, table, callback );
1.6026 + });
1.6027 + }
1.6028 +
1.6029 + if ( this[0] ) {
1.6030 + parent = value && value.parentNode;
1.6031 +
1.6032 + // If we're in a fragment, just use that instead of building a new one
1.6033 + if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
1.6034 + results = { fragment: parent };
1.6035 +
1.6036 + } else {
1.6037 + results = jQuery.buildFragment( args, this, scripts );
1.6038 + }
1.6039 +
1.6040 + fragment = results.fragment;
1.6041 +
1.6042 + if ( fragment.childNodes.length === 1 ) {
1.6043 + first = fragment = fragment.firstChild;
1.6044 + } else {
1.6045 + first = fragment.firstChild;
1.6046 + }
1.6047 +
1.6048 + if ( first ) {
1.6049 + table = table && jQuery.nodeName( first, "tr" );
1.6050 +
1.6051 + for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
1.6052 + callback.call(
1.6053 + table ?
1.6054 + root(this[i], first) :
1.6055 + this[i],
1.6056 + // Make sure that we do not leak memory by inadvertently discarding
1.6057 + // the original fragment (which might have attached data) instead of
1.6058 + // using it; in addition, use the original fragment object for the last
1.6059 + // item instead of first because it can end up being emptied incorrectly
1.6060 + // in certain situations (Bug #8070).
1.6061 + // Fragments from the fragment cache must always be cloned and never used
1.6062 + // in place.
1.6063 + results.cacheable || ( l > 1 && i < lastIndex ) ?
1.6064 + jQuery.clone( fragment, true, true ) :
1.6065 + fragment
1.6066 + );
1.6067 + }
1.6068 + }
1.6069 +
1.6070 + if ( scripts.length ) {
1.6071 + jQuery.each( scripts, function( i, elem ) {
1.6072 + if ( elem.src ) {
1.6073 + jQuery.ajax({
1.6074 + type: "GET",
1.6075 + global: false,
1.6076 + url: elem.src,
1.6077 + async: false,
1.6078 + dataType: "script"
1.6079 + });
1.6080 + } else {
1.6081 + jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
1.6082 + }
1.6083 +
1.6084 + if ( elem.parentNode ) {
1.6085 + elem.parentNode.removeChild( elem );
1.6086 + }
1.6087 + });
1.6088 + }
1.6089 + }
1.6090 +
1.6091 + return this;
1.6092 + }
1.6093 +});
1.6094 +
1.6095 +function root( elem, cur ) {
1.6096 + return jQuery.nodeName(elem, "table") ?
1.6097 + (elem.getElementsByTagName("tbody")[0] ||
1.6098 + elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
1.6099 + elem;
1.6100 +}
1.6101 +
1.6102 +function cloneCopyEvent( src, dest ) {
1.6103 +
1.6104 + if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
1.6105 + return;
1.6106 + }
1.6107 +
1.6108 + var type, i, l,
1.6109 + oldData = jQuery._data( src ),
1.6110 + curData = jQuery._data( dest, oldData ),
1.6111 + events = oldData.events;
1.6112 +
1.6113 + if ( events ) {
1.6114 + delete curData.handle;
1.6115 + curData.events = {};
1.6116 +
1.6117 + for ( type in events ) {
1.6118 + for ( i = 0, l = events[ type ].length; i < l; i++ ) {
1.6119 + jQuery.event.add( dest, type, events[ type ][ i ] );
1.6120 + }
1.6121 + }
1.6122 + }
1.6123 +
1.6124 + // make the cloned public data object a copy from the original
1.6125 + if ( curData.data ) {
1.6126 + curData.data = jQuery.extend( {}, curData.data );
1.6127 + }
1.6128 +}
1.6129 +
1.6130 +function cloneFixAttributes( src, dest ) {
1.6131 + var nodeName;
1.6132 +
1.6133 + // We do not need to do anything for non-Elements
1.6134 + if ( dest.nodeType !== 1 ) {
1.6135 + return;
1.6136 + }
1.6137 +
1.6138 + // clearAttributes removes the attributes, which we don't want,
1.6139 + // but also removes the attachEvent events, which we *do* want
1.6140 + if ( dest.clearAttributes ) {
1.6141 + dest.clearAttributes();
1.6142 + }
1.6143 +
1.6144 + // mergeAttributes, in contrast, only merges back on the
1.6145 + // original attributes, not the events
1.6146 + if ( dest.mergeAttributes ) {
1.6147 + dest.mergeAttributes( src );
1.6148 + }
1.6149 +
1.6150 + nodeName = dest.nodeName.toLowerCase();
1.6151 +
1.6152 + // IE6-8 fail to clone children inside object elements that use
1.6153 + // the proprietary classid attribute value (rather than the type
1.6154 + // attribute) to identify the type of content to display
1.6155 + if ( nodeName === "object" ) {
1.6156 + dest.outerHTML = src.outerHTML;
1.6157 +
1.6158 + } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
1.6159 + // IE6-8 fails to persist the checked state of a cloned checkbox
1.6160 + // or radio button. Worse, IE6-7 fail to give the cloned element
1.6161 + // a checked appearance if the defaultChecked value isn't also set
1.6162 + if ( src.checked ) {
1.6163 + dest.defaultChecked = dest.checked = src.checked;
1.6164 + }
1.6165 +
1.6166 + // IE6-7 get confused and end up setting the value of a cloned
1.6167 + // checkbox/radio button to an empty string instead of "on"
1.6168 + if ( dest.value !== src.value ) {
1.6169 + dest.value = src.value;
1.6170 + }
1.6171 +
1.6172 + // IE6-8 fails to return the selected option to the default selected
1.6173 + // state when cloning options
1.6174 + } else if ( nodeName === "option" ) {
1.6175 + dest.selected = src.defaultSelected;
1.6176 +
1.6177 + // IE6-8 fails to set the defaultValue to the correct value when
1.6178 + // cloning other types of input fields
1.6179 + } else if ( nodeName === "input" || nodeName === "textarea" ) {
1.6180 + dest.defaultValue = src.defaultValue;
1.6181 +
1.6182 + // IE blanks contents when cloning scripts
1.6183 + } else if ( nodeName === "script" && dest.text !== src.text ) {
1.6184 + dest.text = src.text;
1.6185 + }
1.6186 +
1.6187 + // Event data gets referenced instead of copied if the expando
1.6188 + // gets copied too
1.6189 + dest.removeAttribute( jQuery.expando );
1.6190 +
1.6191 + // Clear flags for bubbling special change/submit events, they must
1.6192 + // be reattached when the newly cloned events are first activated
1.6193 + dest.removeAttribute( "_submit_attached" );
1.6194 + dest.removeAttribute( "_change_attached" );
1.6195 +}
1.6196 +
1.6197 +jQuery.buildFragment = function( args, nodes, scripts ) {
1.6198 + var fragment, cacheable, cacheresults, doc,
1.6199 + first = args[ 0 ];
1.6200 +
1.6201 + // nodes may contain either an explicit document object,
1.6202 + // a jQuery collection or context object.
1.6203 + // If nodes[0] contains a valid object to assign to doc
1.6204 + if ( nodes && nodes[0] ) {
1.6205 + doc = nodes[0].ownerDocument || nodes[0];
1.6206 + }
1.6207 +
1.6208 + // Ensure that an attr object doesn't incorrectly stand in as a document object
1.6209 + // Chrome and Firefox seem to allow this to occur and will throw exception
1.6210 + // Fixes #8950
1.6211 + if ( !doc.createDocumentFragment ) {
1.6212 + doc = document;
1.6213 + }
1.6214 +
1.6215 + // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
1.6216 + // Cloning options loses the selected state, so don't cache them
1.6217 + // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
1.6218 + // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
1.6219 + // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
1.6220 + if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
1.6221 + first.charAt(0) === "<" && !rnocache.test( first ) &&
1.6222 + (jQuery.support.checkClone || !rchecked.test( first )) &&
1.6223 + (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
1.6224 +
1.6225 + cacheable = true;
1.6226 +
1.6227 + cacheresults = jQuery.fragments[ first ];
1.6228 + if ( cacheresults && cacheresults !== 1 ) {
1.6229 + fragment = cacheresults;
1.6230 + }
1.6231 + }
1.6232 +
1.6233 + if ( !fragment ) {
1.6234 + fragment = doc.createDocumentFragment();
1.6235 + jQuery.clean( args, doc, fragment, scripts );
1.6236 + }
1.6237 +
1.6238 + if ( cacheable ) {
1.6239 + jQuery.fragments[ first ] = cacheresults ? fragment : 1;
1.6240 + }
1.6241 +
1.6242 + return { fragment: fragment, cacheable: cacheable };
1.6243 +};
1.6244 +
1.6245 +jQuery.fragments = {};
1.6246 +
1.6247 +jQuery.each({
1.6248 + appendTo: "append",
1.6249 + prependTo: "prepend",
1.6250 + insertBefore: "before",
1.6251 + insertAfter: "after",
1.6252 + replaceAll: "replaceWith"
1.6253 +}, function( name, original ) {
1.6254 + jQuery.fn[ name ] = function( selector ) {
1.6255 + var ret = [],
1.6256 + insert = jQuery( selector ),
1.6257 + parent = this.length === 1 && this[0].parentNode;
1.6258 +
1.6259 + if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
1.6260 + insert[ original ]( this[0] );
1.6261 + return this;
1.6262 +
1.6263 + } else {
1.6264 + for ( var i = 0, l = insert.length; i < l; i++ ) {
1.6265 + var elems = ( i > 0 ? this.clone(true) : this ).get();
1.6266 + jQuery( insert[i] )[ original ]( elems );
1.6267 + ret = ret.concat( elems );
1.6268 + }
1.6269 +
1.6270 + return this.pushStack( ret, name, insert.selector );
1.6271 + }
1.6272 + };
1.6273 +});
1.6274 +
1.6275 +function getAll( elem ) {
1.6276 + if ( typeof elem.getElementsByTagName !== "undefined" ) {
1.6277 + return elem.getElementsByTagName( "*" );
1.6278 +
1.6279 + } else if ( typeof elem.querySelectorAll !== "undefined" ) {
1.6280 + return elem.querySelectorAll( "*" );
1.6281 +
1.6282 + } else {
1.6283 + return [];
1.6284 + }
1.6285 +}
1.6286 +
1.6287 +// Used in clean, fixes the defaultChecked property
1.6288 +function fixDefaultChecked( elem ) {
1.6289 + if ( elem.type === "checkbox" || elem.type === "radio" ) {
1.6290 + elem.defaultChecked = elem.checked;
1.6291 + }
1.6292 +}
1.6293 +// Finds all inputs and passes them to fixDefaultChecked
1.6294 +function findInputs( elem ) {
1.6295 + var nodeName = ( elem.nodeName || "" ).toLowerCase();
1.6296 + if ( nodeName === "input" ) {
1.6297 + fixDefaultChecked( elem );
1.6298 + // Skip scripts, get other children
1.6299 + } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
1.6300 + jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
1.6301 + }
1.6302 +}
1.6303 +
1.6304 +// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
1.6305 +function shimCloneNode( elem ) {
1.6306 + var div = document.createElement( "div" );
1.6307 + safeFragment.appendChild( div );
1.6308 +
1.6309 + div.innerHTML = elem.outerHTML;
1.6310 + return div.firstChild;
1.6311 +}
1.6312 +
1.6313 +jQuery.extend({
1.6314 + clone: function( elem, dataAndEvents, deepDataAndEvents ) {
1.6315 + var srcElements,
1.6316 + destElements,
1.6317 + i,
1.6318 + // IE<=8 does not properly clone detached, unknown element nodes
1.6319 + clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
1.6320 + elem.cloneNode( true ) :
1.6321 + shimCloneNode( elem );
1.6322 +
1.6323 + if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
1.6324 + (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
1.6325 + // IE copies events bound via attachEvent when using cloneNode.
1.6326 + // Calling detachEvent on the clone will also remove the events
1.6327 + // from the original. In order to get around this, we use some
1.6328 + // proprietary methods to clear the events. Thanks to MooTools
1.6329 + // guys for this hotness.
1.6330 +
1.6331 + cloneFixAttributes( elem, clone );
1.6332 +
1.6333 + // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
1.6334 + srcElements = getAll( elem );
1.6335 + destElements = getAll( clone );
1.6336 +
1.6337 + // Weird iteration because IE will replace the length property
1.6338 + // with an element if you are cloning the body and one of the
1.6339 + // elements on the page has a name or id of "length"
1.6340 + for ( i = 0; srcElements[i]; ++i ) {
1.6341 + // Ensure that the destination node is not null; Fixes #9587
1.6342 + if ( destElements[i] ) {
1.6343 + cloneFixAttributes( srcElements[i], destElements[i] );
1.6344 + }
1.6345 + }
1.6346 + }
1.6347 +
1.6348 + // Copy the events from the original to the clone
1.6349 + if ( dataAndEvents ) {
1.6350 + cloneCopyEvent( elem, clone );
1.6351 +
1.6352 + if ( deepDataAndEvents ) {
1.6353 + srcElements = getAll( elem );
1.6354 + destElements = getAll( clone );
1.6355 +
1.6356 + for ( i = 0; srcElements[i]; ++i ) {
1.6357 + cloneCopyEvent( srcElements[i], destElements[i] );
1.6358 + }
1.6359 + }
1.6360 + }
1.6361 +
1.6362 + srcElements = destElements = null;
1.6363 +
1.6364 + // Return the cloned set
1.6365 + return clone;
1.6366 + },
1.6367 +
1.6368 + clean: function( elems, context, fragment, scripts ) {
1.6369 + var checkScriptType, script, j,
1.6370 + ret = [];
1.6371 +
1.6372 + context = context || document;
1.6373 +
1.6374 + // !context.createElement fails in IE with an error but returns typeof 'object'
1.6375 + if ( typeof context.createElement === "undefined" ) {
1.6376 + context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
1.6377 + }
1.6378 +
1.6379 + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
1.6380 + if ( typeof elem === "number" ) {
1.6381 + elem += "";
1.6382 + }
1.6383 +
1.6384 + if ( !elem ) {
1.6385 + continue;
1.6386 + }
1.6387 +
1.6388 + // Convert html string into DOM nodes
1.6389 + if ( typeof elem === "string" ) {
1.6390 + if ( !rhtml.test( elem ) ) {
1.6391 + elem = context.createTextNode( elem );
1.6392 + } else {
1.6393 + // Fix "XHTML"-style tags in all browsers
1.6394 + elem = elem.replace(rxhtmlTag, "<$1></$2>");
1.6395 +
1.6396 + // Trim whitespace, otherwise indexOf won't work as expected
1.6397 + var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
1.6398 + wrap = wrapMap[ tag ] || wrapMap._default,
1.6399 + depth = wrap[0],
1.6400 + div = context.createElement("div"),
1.6401 + safeChildNodes = safeFragment.childNodes,
1.6402 + remove;
1.6403 +
1.6404 + // Append wrapper element to unknown element safe doc fragment
1.6405 + if ( context === document ) {
1.6406 + // Use the fragment we've already created for this document
1.6407 + safeFragment.appendChild( div );
1.6408 + } else {
1.6409 + // Use a fragment created with the owner document
1.6410 + createSafeFragment( context ).appendChild( div );
1.6411 + }
1.6412 +
1.6413 + // Go to html and back, then peel off extra wrappers
1.6414 + div.innerHTML = wrap[1] + elem + wrap[2];
1.6415 +
1.6416 + // Move to the right depth
1.6417 + while ( depth-- ) {
1.6418 + div = div.lastChild;
1.6419 + }
1.6420 +
1.6421 + // Remove IE's autoinserted <tbody> from table fragments
1.6422 + if ( !jQuery.support.tbody ) {
1.6423 +
1.6424 + // String was a <table>, *may* have spurious <tbody>
1.6425 + var hasBody = rtbody.test(elem),
1.6426 + tbody = tag === "table" && !hasBody ?
1.6427 + div.firstChild && div.firstChild.childNodes :
1.6428 +
1.6429 + // String was a bare <thead> or <tfoot>
1.6430 + wrap[1] === "<table>" && !hasBody ?
1.6431 + div.childNodes :
1.6432 + [];
1.6433 +
1.6434 + for ( j = tbody.length - 1; j >= 0 ; --j ) {
1.6435 + if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
1.6436 + tbody[ j ].parentNode.removeChild( tbody[ j ] );
1.6437 + }
1.6438 + }
1.6439 + }
1.6440 +
1.6441 + // IE completely kills leading whitespace when innerHTML is used
1.6442 + if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
1.6443 + div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
1.6444 + }
1.6445 +
1.6446 + elem = div.childNodes;
1.6447 +
1.6448 + // Clear elements from DocumentFragment (safeFragment or otherwise)
1.6449 + // to avoid hoarding elements. Fixes #11356
1.6450 + if ( div ) {
1.6451 + div.parentNode.removeChild( div );
1.6452 +
1.6453 + // Guard against -1 index exceptions in FF3.6
1.6454 + if ( safeChildNodes.length > 0 ) {
1.6455 + remove = safeChildNodes[ safeChildNodes.length - 1 ];
1.6456 +
1.6457 + if ( remove && remove.parentNode ) {
1.6458 + remove.parentNode.removeChild( remove );
1.6459 + }
1.6460 + }
1.6461 + }
1.6462 + }
1.6463 + }
1.6464 +
1.6465 + // Resets defaultChecked for any radios and checkboxes
1.6466 + // about to be appended to the DOM in IE 6/7 (#8060)
1.6467 + var len;
1.6468 + if ( !jQuery.support.appendChecked ) {
1.6469 + if ( elem[0] && typeof (len = elem.length) === "number" ) {
1.6470 + for ( j = 0; j < len; j++ ) {
1.6471 + findInputs( elem[j] );
1.6472 + }
1.6473 + } else {
1.6474 + findInputs( elem );
1.6475 + }
1.6476 + }
1.6477 +
1.6478 + if ( elem.nodeType ) {
1.6479 + ret.push( elem );
1.6480 + } else {
1.6481 + ret = jQuery.merge( ret, elem );
1.6482 + }
1.6483 + }
1.6484 +
1.6485 + if ( fragment ) {
1.6486 + checkScriptType = function( elem ) {
1.6487 + return !elem.type || rscriptType.test( elem.type );
1.6488 + };
1.6489 + for ( i = 0; ret[i]; i++ ) {
1.6490 + script = ret[i];
1.6491 + if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) {
1.6492 + scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script );
1.6493 +
1.6494 + } else {
1.6495 + if ( script.nodeType === 1 ) {
1.6496 + var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType );
1.6497 +
1.6498 + ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
1.6499 + }
1.6500 + fragment.appendChild( script );
1.6501 + }
1.6502 + }
1.6503 + }
1.6504 +
1.6505 + return ret;
1.6506 + },
1.6507 +
1.6508 + cleanData: function( elems ) {
1.6509 + var data, id,
1.6510 + cache = jQuery.cache,
1.6511 + special = jQuery.event.special,
1.6512 + deleteExpando = jQuery.support.deleteExpando;
1.6513 +
1.6514 + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
1.6515 + if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
1.6516 + continue;
1.6517 + }
1.6518 +
1.6519 + id = elem[ jQuery.expando ];
1.6520 +
1.6521 + if ( id ) {
1.6522 + data = cache[ id ];
1.6523 +
1.6524 + if ( data && data.events ) {
1.6525 + for ( var type in data.events ) {
1.6526 + if ( special[ type ] ) {
1.6527 + jQuery.event.remove( elem, type );
1.6528 +
1.6529 + // This is a shortcut to avoid jQuery.event.remove's overhead
1.6530 + } else {
1.6531 + jQuery.removeEvent( elem, type, data.handle );
1.6532 + }
1.6533 + }
1.6534 +
1.6535 + // Null the DOM reference to avoid IE6/7/8 leak (#7054)
1.6536 + if ( data.handle ) {
1.6537 + data.handle.elem = null;
1.6538 + }
1.6539 + }
1.6540 +
1.6541 + if ( deleteExpando ) {
1.6542 + delete elem[ jQuery.expando ];
1.6543 +
1.6544 + } else if ( elem.removeAttribute ) {
1.6545 + elem.removeAttribute( jQuery.expando );
1.6546 + }
1.6547 +
1.6548 + delete cache[ id ];
1.6549 + }
1.6550 + }
1.6551 + }
1.6552 +});
1.6553 +
1.6554 +
1.6555 +
1.6556 +
1.6557 +var ralpha = /alpha\([^)]*\)/i,
1.6558 + ropacity = /opacity=([^)]*)/,
1.6559 + // fixed for IE9, see #8346
1.6560 + rupper = /([A-Z]|^ms)/g,
1.6561 + rnum = /^[\-+]?(?:\d*\.)?\d+$/i,
1.6562 + rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
1.6563 + rrelNum = /^([\-+])=([\-+.\de]+)/,
1.6564 + rmargin = /^margin/,
1.6565 +
1.6566 + cssShow = { position: "absolute", visibility: "hidden", display: "block" },
1.6567 +
1.6568 + // order is important!
1.6569 + cssExpand = [ "Top", "Right", "Bottom", "Left" ],
1.6570 +
1.6571 + curCSS,
1.6572 +
1.6573 + getComputedStyle,
1.6574 + currentStyle;
1.6575 +
1.6576 +jQuery.fn.css = function( name, value ) {
1.6577 + return jQuery.access( this, function( elem, name, value ) {
1.6578 + return value !== undefined ?
1.6579 + jQuery.style( elem, name, value ) :
1.6580 + jQuery.css( elem, name );
1.6581 + }, name, value, arguments.length > 1 );
1.6582 +};
1.6583 +
1.6584 +jQuery.extend({
1.6585 + // Add in style property hooks for overriding the default
1.6586 + // behavior of getting and setting a style property
1.6587 + cssHooks: {
1.6588 + opacity: {
1.6589 + get: function( elem, computed ) {
1.6590 + if ( computed ) {
1.6591 + // We should always get a number back from opacity
1.6592 + var ret = curCSS( elem, "opacity" );
1.6593 + return ret === "" ? "1" : ret;
1.6594 +
1.6595 + } else {
1.6596 + return elem.style.opacity;
1.6597 + }
1.6598 + }
1.6599 + }
1.6600 + },
1.6601 +
1.6602 + // Exclude the following css properties to add px
1.6603 + cssNumber: {
1.6604 + "fillOpacity": true,
1.6605 + "fontWeight": true,
1.6606 + "lineHeight": true,
1.6607 + "opacity": true,
1.6608 + "orphans": true,
1.6609 + "widows": true,
1.6610 + "zIndex": true,
1.6611 + "zoom": true
1.6612 + },
1.6613 +
1.6614 + // Add in properties whose names you wish to fix before
1.6615 + // setting or getting the value
1.6616 + cssProps: {
1.6617 + // normalize float css property
1.6618 + "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
1.6619 + },
1.6620 +
1.6621 + // Get and set the style property on a DOM Node
1.6622 + style: function( elem, name, value, extra ) {
1.6623 + // Don't set styles on text and comment nodes
1.6624 + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
1.6625 + return;
1.6626 + }
1.6627 +
1.6628 + // Make sure that we're working with the right name
1.6629 + var ret, type, origName = jQuery.camelCase( name ),
1.6630 + style = elem.style, hooks = jQuery.cssHooks[ origName ];
1.6631 +
1.6632 + name = jQuery.cssProps[ origName ] || origName;
1.6633 +
1.6634 + // Check if we're setting a value
1.6635 + if ( value !== undefined ) {
1.6636 + type = typeof value;
1.6637 +
1.6638 + // convert relative number strings (+= or -=) to relative numbers. #7345
1.6639 + if ( type === "string" && (ret = rrelNum.exec( value )) ) {
1.6640 + value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
1.6641 + // Fixes bug #9237
1.6642 + type = "number";
1.6643 + }
1.6644 +
1.6645 + // Make sure that NaN and null values aren't set. See: #7116
1.6646 + if ( value == null || type === "number" && isNaN( value ) ) {
1.6647 + return;
1.6648 + }
1.6649 +
1.6650 + // If a number was passed in, add 'px' to the (except for certain CSS properties)
1.6651 + if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
1.6652 + value += "px";
1.6653 + }
1.6654 +
1.6655 + // If a hook was provided, use that value, otherwise just set the specified value
1.6656 + if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
1.6657 + // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
1.6658 + // Fixes bug #5509
1.6659 + try {
1.6660 + style[ name ] = value;
1.6661 + } catch(e) {}
1.6662 + }
1.6663 +
1.6664 + } else {
1.6665 + // If a hook was provided get the non-computed value from there
1.6666 + if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
1.6667 + return ret;
1.6668 + }
1.6669 +
1.6670 + // Otherwise just get the value from the style object
1.6671 + return style[ name ];
1.6672 + }
1.6673 + },
1.6674 +
1.6675 + css: function( elem, name, extra ) {
1.6676 + var ret, hooks;
1.6677 +
1.6678 + // Make sure that we're working with the right name
1.6679 + name = jQuery.camelCase( name );
1.6680 + hooks = jQuery.cssHooks[ name ];
1.6681 + name = jQuery.cssProps[ name ] || name;
1.6682 +
1.6683 + // cssFloat needs a special treatment
1.6684 + if ( name === "cssFloat" ) {
1.6685 + name = "float";
1.6686 + }
1.6687 +
1.6688 + // If a hook was provided get the computed value from there
1.6689 + if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
1.6690 + return ret;
1.6691 +
1.6692 + // Otherwise, if a way to get the computed value exists, use that
1.6693 + } else if ( curCSS ) {
1.6694 + return curCSS( elem, name );
1.6695 + }
1.6696 + },
1.6697 +
1.6698 + // A method for quickly swapping in/out CSS properties to get correct calculations
1.6699 + swap: function( elem, options, callback ) {
1.6700 + var old = {},
1.6701 + ret, name;
1.6702 +
1.6703 + // Remember the old values, and insert the new ones
1.6704 + for ( name in options ) {
1.6705 + old[ name ] = elem.style[ name ];
1.6706 + elem.style[ name ] = options[ name ];
1.6707 + }
1.6708 +
1.6709 + ret = callback.call( elem );
1.6710 +
1.6711 + // Revert the old values
1.6712 + for ( name in options ) {
1.6713 + elem.style[ name ] = old[ name ];
1.6714 + }
1.6715 +
1.6716 + return ret;
1.6717 + }
1.6718 +});
1.6719 +
1.6720 +// DEPRECATED in 1.3, Use jQuery.css() instead
1.6721 +jQuery.curCSS = jQuery.css;
1.6722 +
1.6723 +if ( document.defaultView && document.defaultView.getComputedStyle ) {
1.6724 + getComputedStyle = function( elem, name ) {
1.6725 + var ret, defaultView, computedStyle, width,
1.6726 + style = elem.style;
1.6727 +
1.6728 + name = name.replace( rupper, "-$1" ).toLowerCase();
1.6729 +
1.6730 + if ( (defaultView = elem.ownerDocument.defaultView) &&
1.6731 + (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
1.6732 +
1.6733 + ret = computedStyle.getPropertyValue( name );
1.6734 + if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
1.6735 + ret = jQuery.style( elem, name );
1.6736 + }
1.6737 + }
1.6738 +
1.6739 + // A tribute to the "awesome hack by Dean Edwards"
1.6740 + // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
1.6741 + // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
1.6742 + if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) {
1.6743 + width = style.width;
1.6744 + style.width = ret;
1.6745 + ret = computedStyle.width;
1.6746 + style.width = width;
1.6747 + }
1.6748 +
1.6749 + return ret;
1.6750 + };
1.6751 +}
1.6752 +
1.6753 +if ( document.documentElement.currentStyle ) {
1.6754 + currentStyle = function( elem, name ) {
1.6755 + var left, rsLeft, uncomputed,
1.6756 + ret = elem.currentStyle && elem.currentStyle[ name ],
1.6757 + style = elem.style;
1.6758 +
1.6759 + // Avoid setting ret to empty string here
1.6760 + // so we don't default to auto
1.6761 + if ( ret == null && style && (uncomputed = style[ name ]) ) {
1.6762 + ret = uncomputed;
1.6763 + }
1.6764 +
1.6765 + // From the awesome hack by Dean Edwards
1.6766 + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
1.6767 +
1.6768 + // If we're not dealing with a regular pixel number
1.6769 + // but a number that has a weird ending, we need to convert it to pixels
1.6770 + if ( rnumnonpx.test( ret ) ) {
1.6771 +
1.6772 + // Remember the original values
1.6773 + left = style.left;
1.6774 + rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
1.6775 +
1.6776 + // Put in the new values to get a computed value out
1.6777 + if ( rsLeft ) {
1.6778 + elem.runtimeStyle.left = elem.currentStyle.left;
1.6779 + }
1.6780 + style.left = name === "fontSize" ? "1em" : ret;
1.6781 + ret = style.pixelLeft + "px";
1.6782 +
1.6783 + // Revert the changed values
1.6784 + style.left = left;
1.6785 + if ( rsLeft ) {
1.6786 + elem.runtimeStyle.left = rsLeft;
1.6787 + }
1.6788 + }
1.6789 +
1.6790 + return ret === "" ? "auto" : ret;
1.6791 + };
1.6792 +}
1.6793 +
1.6794 +curCSS = getComputedStyle || currentStyle;
1.6795 +
1.6796 +function getWidthOrHeight( elem, name, extra ) {
1.6797 +
1.6798 + // Start with offset property
1.6799 + var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
1.6800 + i = name === "width" ? 1 : 0,
1.6801 + len = 4;
1.6802 +
1.6803 + if ( val > 0 ) {
1.6804 + if ( extra !== "border" ) {
1.6805 + for ( ; i < len; i += 2 ) {
1.6806 + if ( !extra ) {
1.6807 + val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
1.6808 + }
1.6809 + if ( extra === "margin" ) {
1.6810 + val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0;
1.6811 + } else {
1.6812 + val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
1.6813 + }
1.6814 + }
1.6815 + }
1.6816 +
1.6817 + return val + "px";
1.6818 + }
1.6819 +
1.6820 + // Fall back to computed then uncomputed css if necessary
1.6821 + val = curCSS( elem, name );
1.6822 + if ( val < 0 || val == null ) {
1.6823 + val = elem.style[ name ];
1.6824 + }
1.6825 +
1.6826 + // Computed unit is not pixels. Stop here and return.
1.6827 + if ( rnumnonpx.test(val) ) {
1.6828 + return val;
1.6829 + }
1.6830 +
1.6831 + // Normalize "", auto, and prepare for extra
1.6832 + val = parseFloat( val ) || 0;
1.6833 +
1.6834 + // Add padding, border, margin
1.6835 + if ( extra ) {
1.6836 + for ( ; i < len; i += 2 ) {
1.6837 + val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
1.6838 + if ( extra !== "padding" ) {
1.6839 + val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
1.6840 + }
1.6841 + if ( extra === "margin" ) {
1.6842 + val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0;
1.6843 + }
1.6844 + }
1.6845 + }
1.6846 +
1.6847 + return val + "px";
1.6848 +}
1.6849 +
1.6850 +jQuery.each([ "height", "width" ], function( i, name ) {
1.6851 + jQuery.cssHooks[ name ] = {
1.6852 + get: function( elem, computed, extra ) {
1.6853 + if ( computed ) {
1.6854 + if ( elem.offsetWidth !== 0 ) {
1.6855 + return getWidthOrHeight( elem, name, extra );
1.6856 + } else {
1.6857 + return jQuery.swap( elem, cssShow, function() {
1.6858 + return getWidthOrHeight( elem, name, extra );
1.6859 + });
1.6860 + }
1.6861 + }
1.6862 + },
1.6863 +
1.6864 + set: function( elem, value ) {
1.6865 + return rnum.test( value ) ?
1.6866 + value + "px" :
1.6867 + value;
1.6868 + }
1.6869 + };
1.6870 +});
1.6871 +
1.6872 +if ( !jQuery.support.opacity ) {
1.6873 + jQuery.cssHooks.opacity = {
1.6874 + get: function( elem, computed ) {
1.6875 + // IE uses filters for opacity
1.6876 + return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
1.6877 + ( parseFloat( RegExp.$1 ) / 100 ) + "" :
1.6878 + computed ? "1" : "";
1.6879 + },
1.6880 +
1.6881 + set: function( elem, value ) {
1.6882 + var style = elem.style,
1.6883 + currentStyle = elem.currentStyle,
1.6884 + opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
1.6885 + filter = currentStyle && currentStyle.filter || style.filter || "";
1.6886 +
1.6887 + // IE has trouble with opacity if it does not have layout
1.6888 + // Force it by setting the zoom level
1.6889 + style.zoom = 1;
1.6890 +
1.6891 + // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
1.6892 + if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
1.6893 +
1.6894 + // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
1.6895 + // if "filter:" is present at all, clearType is disabled, we want to avoid this
1.6896 + // style.removeAttribute is IE Only, but so apparently is this code path...
1.6897 + style.removeAttribute( "filter" );
1.6898 +
1.6899 + // if there there is no filter style applied in a css rule, we are done
1.6900 + if ( currentStyle && !currentStyle.filter ) {
1.6901 + return;
1.6902 + }
1.6903 + }
1.6904 +
1.6905 + // otherwise, set new filter values
1.6906 + style.filter = ralpha.test( filter ) ?
1.6907 + filter.replace( ralpha, opacity ) :
1.6908 + filter + " " + opacity;
1.6909 + }
1.6910 + };
1.6911 +}
1.6912 +
1.6913 +jQuery(function() {
1.6914 + // This hook cannot be added until DOM ready because the support test
1.6915 + // for it is not run until after DOM ready
1.6916 + if ( !jQuery.support.reliableMarginRight ) {
1.6917 + jQuery.cssHooks.marginRight = {
1.6918 + get: function( elem, computed ) {
1.6919 + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1.6920 + // Work around by temporarily setting element display to inline-block
1.6921 + return jQuery.swap( elem, { "display": "inline-block" }, function() {
1.6922 + if ( computed ) {
1.6923 + return curCSS( elem, "margin-right" );
1.6924 + } else {
1.6925 + return elem.style.marginRight;
1.6926 + }
1.6927 + });
1.6928 + }
1.6929 + };
1.6930 + }
1.6931 +});
1.6932 +
1.6933 +if ( jQuery.expr && jQuery.expr.filters ) {
1.6934 + jQuery.expr.filters.hidden = function( elem ) {
1.6935 + var width = elem.offsetWidth,
1.6936 + height = elem.offsetHeight;
1.6937 +
1.6938 + return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
1.6939 + };
1.6940 +
1.6941 + jQuery.expr.filters.visible = function( elem ) {
1.6942 + return !jQuery.expr.filters.hidden( elem );
1.6943 + };
1.6944 +}
1.6945 +
1.6946 +// These hooks are used by animate to expand properties
1.6947 +jQuery.each({
1.6948 + margin: "",
1.6949 + padding: "",
1.6950 + border: "Width"
1.6951 +}, function( prefix, suffix ) {
1.6952 +
1.6953 + jQuery.cssHooks[ prefix + suffix ] = {
1.6954 + expand: function( value ) {
1.6955 + var i,
1.6956 +
1.6957 + // assumes a single number if not a string
1.6958 + parts = typeof value === "string" ? value.split(" ") : [ value ],
1.6959 + expanded = {};
1.6960 +
1.6961 + for ( i = 0; i < 4; i++ ) {
1.6962 + expanded[ prefix + cssExpand[ i ] + suffix ] =
1.6963 + parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
1.6964 + }
1.6965 +
1.6966 + return expanded;
1.6967 + }
1.6968 + };
1.6969 +});
1.6970 +
1.6971 +
1.6972 +
1.6973 +
1.6974 +var r20 = /%20/g,
1.6975 + rbracket = /\[\]$/,
1.6976 + rCRLF = /\r?\n/g,
1.6977 + rhash = /#.*$/,
1.6978 + rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
1.6979 + rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
1.6980 + // #7653, #8125, #8152: local protocol detection
1.6981 + rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
1.6982 + rnoContent = /^(?:GET|HEAD)$/,
1.6983 + rprotocol = /^\/\//,
1.6984 + rquery = /\?/,
1.6985 + rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
1.6986 + rselectTextarea = /^(?:select|textarea)/i,
1.6987 + rspacesAjax = /\s+/,
1.6988 + rts = /([?&])_=[^&]*/,
1.6989 + rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
1.6990 +
1.6991 + // Keep a copy of the old load method
1.6992 + _load = jQuery.fn.load,
1.6993 +
1.6994 + /* Prefilters
1.6995 + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
1.6996 + * 2) These are called:
1.6997 + * - BEFORE asking for a transport
1.6998 + * - AFTER param serialization (s.data is a string if s.processData is true)
1.6999 + * 3) key is the dataType
1.7000 + * 4) the catchall symbol "*" can be used
1.7001 + * 5) execution will start with transport dataType and THEN continue down to "*" if needed
1.7002 + */
1.7003 + prefilters = {},
1.7004 +
1.7005 + /* Transports bindings
1.7006 + * 1) key is the dataType
1.7007 + * 2) the catchall symbol "*" can be used
1.7008 + * 3) selection will start with transport dataType and THEN go to "*" if needed
1.7009 + */
1.7010 + transports = {},
1.7011 +
1.7012 + // Document location
1.7013 + ajaxLocation,
1.7014 +
1.7015 + // Document location segments
1.7016 + ajaxLocParts,
1.7017 +
1.7018 + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
1.7019 + allTypes = ["*/"] + ["*"];
1.7020 +
1.7021 +// #8138, IE may throw an exception when accessing
1.7022 +// a field from window.location if document.domain has been set
1.7023 +try {
1.7024 + ajaxLocation = location.href;
1.7025 +} catch( e ) {
1.7026 + // Use the href attribute of an A element
1.7027 + // since IE will modify it given document.location
1.7028 + ajaxLocation = document.createElement( "a" );
1.7029 + ajaxLocation.href = "";
1.7030 + ajaxLocation = ajaxLocation.href;
1.7031 +}
1.7032 +
1.7033 +// Segment location into parts
1.7034 +ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
1.7035 +
1.7036 +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
1.7037 +function addToPrefiltersOrTransports( structure ) {
1.7038 +
1.7039 + // dataTypeExpression is optional and defaults to "*"
1.7040 + return function( dataTypeExpression, func ) {
1.7041 +
1.7042 + if ( typeof dataTypeExpression !== "string" ) {
1.7043 + func = dataTypeExpression;
1.7044 + dataTypeExpression = "*";
1.7045 + }
1.7046 +
1.7047 + if ( jQuery.isFunction( func ) ) {
1.7048 + var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
1.7049 + i = 0,
1.7050 + length = dataTypes.length,
1.7051 + dataType,
1.7052 + list,
1.7053 + placeBefore;
1.7054 +
1.7055 + // For each dataType in the dataTypeExpression
1.7056 + for ( ; i < length; i++ ) {
1.7057 + dataType = dataTypes[ i ];
1.7058 + // We control if we're asked to add before
1.7059 + // any existing element
1.7060 + placeBefore = /^\+/.test( dataType );
1.7061 + if ( placeBefore ) {
1.7062 + dataType = dataType.substr( 1 ) || "*";
1.7063 + }
1.7064 + list = structure[ dataType ] = structure[ dataType ] || [];
1.7065 + // then we add to the structure accordingly
1.7066 + list[ placeBefore ? "unshift" : "push" ]( func );
1.7067 + }
1.7068 + }
1.7069 + };
1.7070 +}
1.7071 +
1.7072 +// Base inspection function for prefilters and transports
1.7073 +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
1.7074 + dataType /* internal */, inspected /* internal */ ) {
1.7075 +
1.7076 + dataType = dataType || options.dataTypes[ 0 ];
1.7077 + inspected = inspected || {};
1.7078 +
1.7079 + inspected[ dataType ] = true;
1.7080 +
1.7081 + var list = structure[ dataType ],
1.7082 + i = 0,
1.7083 + length = list ? list.length : 0,
1.7084 + executeOnly = ( structure === prefilters ),
1.7085 + selection;
1.7086 +
1.7087 + for ( ; i < length && ( executeOnly || !selection ); i++ ) {
1.7088 + selection = list[ i ]( options, originalOptions, jqXHR );
1.7089 + // If we got redirected to another dataType
1.7090 + // we try there if executing only and not done already
1.7091 + if ( typeof selection === "string" ) {
1.7092 + if ( !executeOnly || inspected[ selection ] ) {
1.7093 + selection = undefined;
1.7094 + } else {
1.7095 + options.dataTypes.unshift( selection );
1.7096 + selection = inspectPrefiltersOrTransports(
1.7097 + structure, options, originalOptions, jqXHR, selection, inspected );
1.7098 + }
1.7099 + }
1.7100 + }
1.7101 + // If we're only executing or nothing was selected
1.7102 + // we try the catchall dataType if not done already
1.7103 + if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
1.7104 + selection = inspectPrefiltersOrTransports(
1.7105 + structure, options, originalOptions, jqXHR, "*", inspected );
1.7106 + }
1.7107 + // unnecessary when only executing (prefilters)
1.7108 + // but it'll be ignored by the caller in that case
1.7109 + return selection;
1.7110 +}
1.7111 +
1.7112 +// A special extend for ajax options
1.7113 +// that takes "flat" options (not to be deep extended)
1.7114 +// Fixes #9887
1.7115 +function ajaxExtend( target, src ) {
1.7116 + var key, deep,
1.7117 + flatOptions = jQuery.ajaxSettings.flatOptions || {};
1.7118 + for ( key in src ) {
1.7119 + if ( src[ key ] !== undefined ) {
1.7120 + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
1.7121 + }
1.7122 + }
1.7123 + if ( deep ) {
1.7124 + jQuery.extend( true, target, deep );
1.7125 + }
1.7126 +}
1.7127 +
1.7128 +jQuery.fn.extend({
1.7129 + load: function( url, params, callback ) {
1.7130 + if ( typeof url !== "string" && _load ) {
1.7131 + return _load.apply( this, arguments );
1.7132 +
1.7133 + // Don't do a request if no elements are being requested
1.7134 + } else if ( !this.length ) {
1.7135 + return this;
1.7136 + }
1.7137 +
1.7138 + var off = url.indexOf( " " );
1.7139 + if ( off >= 0 ) {
1.7140 + var selector = url.slice( off, url.length );
1.7141 + url = url.slice( 0, off );
1.7142 + }
1.7143 +
1.7144 + // Default to a GET request
1.7145 + var type = "GET";
1.7146 +
1.7147 + // If the second parameter was provided
1.7148 + if ( params ) {
1.7149 + // If it's a function
1.7150 + if ( jQuery.isFunction( params ) ) {
1.7151 + // We assume that it's the callback
1.7152 + callback = params;
1.7153 + params = undefined;
1.7154 +
1.7155 + // Otherwise, build a param string
1.7156 + } else if ( typeof params === "object" ) {
1.7157 + params = jQuery.param( params, jQuery.ajaxSettings.traditional );
1.7158 + type = "POST";
1.7159 + }
1.7160 + }
1.7161 +
1.7162 + var self = this;
1.7163 +
1.7164 + // Request the remote document
1.7165 + jQuery.ajax({
1.7166 + url: url,
1.7167 + type: type,
1.7168 + dataType: "html",
1.7169 + data: params,
1.7170 + // Complete callback (responseText is used internally)
1.7171 + complete: function( jqXHR, status, responseText ) {
1.7172 + // Store the response as specified by the jqXHR object
1.7173 + responseText = jqXHR.responseText;
1.7174 + // If successful, inject the HTML into all the matched elements
1.7175 + if ( jqXHR.isResolved() ) {
1.7176 + // #4825: Get the actual response in case
1.7177 + // a dataFilter is present in ajaxSettings
1.7178 + jqXHR.done(function( r ) {
1.7179 + responseText = r;
1.7180 + });
1.7181 + // See if a selector was specified
1.7182 + self.html( selector ?
1.7183 + // Create a dummy div to hold the results
1.7184 + jQuery("<div>")
1.7185 + // inject the contents of the document in, removing the scripts
1.7186 + // to avoid any 'Permission Denied' errors in IE
1.7187 + .append(responseText.replace(rscript, ""))
1.7188 +
1.7189 + // Locate the specified elements
1.7190 + .find(selector) :
1.7191 +
1.7192 + // If not, just inject the full result
1.7193 + responseText );
1.7194 + }
1.7195 +
1.7196 + if ( callback ) {
1.7197 + self.each( callback, [ responseText, status, jqXHR ] );
1.7198 + }
1.7199 + }
1.7200 + });
1.7201 +
1.7202 + return this;
1.7203 + },
1.7204 +
1.7205 + serialize: function() {
1.7206 + return jQuery.param( this.serializeArray() );
1.7207 + },
1.7208 +
1.7209 + serializeArray: function() {
1.7210 + return this.map(function(){
1.7211 + return this.elements ? jQuery.makeArray( this.elements ) : this;
1.7212 + })
1.7213 + .filter(function(){
1.7214 + return this.name && !this.disabled &&
1.7215 + ( this.checked || rselectTextarea.test( this.nodeName ) ||
1.7216 + rinput.test( this.type ) );
1.7217 + })
1.7218 + .map(function( i, elem ){
1.7219 + var val = jQuery( this ).val();
1.7220 +
1.7221 + return val == null ?
1.7222 + null :
1.7223 + jQuery.isArray( val ) ?
1.7224 + jQuery.map( val, function( val, i ){
1.7225 + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
1.7226 + }) :
1.7227 + { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
1.7228 + }).get();
1.7229 + }
1.7230 +});
1.7231 +
1.7232 +// Attach a bunch of functions for handling common AJAX events
1.7233 +jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
1.7234 + jQuery.fn[ o ] = function( f ){
1.7235 + return this.on( o, f );
1.7236 + };
1.7237 +});
1.7238 +
1.7239 +jQuery.each( [ "get", "post" ], function( i, method ) {
1.7240 + jQuery[ method ] = function( url, data, callback, type ) {
1.7241 + // shift arguments if data argument was omitted
1.7242 + if ( jQuery.isFunction( data ) ) {
1.7243 + type = type || callback;
1.7244 + callback = data;
1.7245 + data = undefined;
1.7246 + }
1.7247 +
1.7248 + return jQuery.ajax({
1.7249 + type: method,
1.7250 + url: url,
1.7251 + data: data,
1.7252 + success: callback,
1.7253 + dataType: type
1.7254 + });
1.7255 + };
1.7256 +});
1.7257 +
1.7258 +jQuery.extend({
1.7259 +
1.7260 + getScript: function( url, callback ) {
1.7261 + return jQuery.get( url, undefined, callback, "script" );
1.7262 + },
1.7263 +
1.7264 + getJSON: function( url, data, callback ) {
1.7265 + return jQuery.get( url, data, callback, "json" );
1.7266 + },
1.7267 +
1.7268 + // Creates a full fledged settings object into target
1.7269 + // with both ajaxSettings and settings fields.
1.7270 + // If target is omitted, writes into ajaxSettings.
1.7271 + ajaxSetup: function( target, settings ) {
1.7272 + if ( settings ) {
1.7273 + // Building a settings object
1.7274 + ajaxExtend( target, jQuery.ajaxSettings );
1.7275 + } else {
1.7276 + // Extending ajaxSettings
1.7277 + settings = target;
1.7278 + target = jQuery.ajaxSettings;
1.7279 + }
1.7280 + ajaxExtend( target, settings );
1.7281 + return target;
1.7282 + },
1.7283 +
1.7284 + ajaxSettings: {
1.7285 + url: ajaxLocation,
1.7286 + isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
1.7287 + global: true,
1.7288 + type: "GET",
1.7289 + contentType: "application/x-www-form-urlencoded; charset=UTF-8",
1.7290 + processData: true,
1.7291 + async: true,
1.7292 + /*
1.7293 + timeout: 0,
1.7294 + data: null,
1.7295 + dataType: null,
1.7296 + username: null,
1.7297 + password: null,
1.7298 + cache: null,
1.7299 + traditional: false,
1.7300 + headers: {},
1.7301 + */
1.7302 +
1.7303 + accepts: {
1.7304 + xml: "application/xml, text/xml",
1.7305 + html: "text/html",
1.7306 + text: "text/plain",
1.7307 + json: "application/json, text/javascript",
1.7308 + "*": allTypes
1.7309 + },
1.7310 +
1.7311 + contents: {
1.7312 + xml: /xml/,
1.7313 + html: /html/,
1.7314 + json: /json/
1.7315 + },
1.7316 +
1.7317 + responseFields: {
1.7318 + xml: "responseXML",
1.7319 + text: "responseText"
1.7320 + },
1.7321 +
1.7322 + // List of data converters
1.7323 + // 1) key format is "source_type destination_type" (a single space in-between)
1.7324 + // 2) the catchall symbol "*" can be used for source_type
1.7325 + converters: {
1.7326 +
1.7327 + // Convert anything to text
1.7328 + "* text": window.String,
1.7329 +
1.7330 + // Text to html (true = no transformation)
1.7331 + "text html": true,
1.7332 +
1.7333 + // Evaluate text as a json expression
1.7334 + "text json": jQuery.parseJSON,
1.7335 +
1.7336 + // Parse text as xml
1.7337 + "text xml": jQuery.parseXML
1.7338 + },
1.7339 +
1.7340 + // For options that shouldn't be deep extended:
1.7341 + // you can add your own custom options here if
1.7342 + // and when you create one that shouldn't be
1.7343 + // deep extended (see ajaxExtend)
1.7344 + flatOptions: {
1.7345 + context: true,
1.7346 + url: true
1.7347 + }
1.7348 + },
1.7349 +
1.7350 + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
1.7351 + ajaxTransport: addToPrefiltersOrTransports( transports ),
1.7352 +
1.7353 + // Main method
1.7354 + ajax: function( url, options ) {
1.7355 +
1.7356 + // If url is an object, simulate pre-1.5 signature
1.7357 + if ( typeof url === "object" ) {
1.7358 + options = url;
1.7359 + url = undefined;
1.7360 + }
1.7361 +
1.7362 + // Force options to be an object
1.7363 + options = options || {};
1.7364 +
1.7365 + var // Create the final options object
1.7366 + s = jQuery.ajaxSetup( {}, options ),
1.7367 + // Callbacks context
1.7368 + callbackContext = s.context || s,
1.7369 + // Context for global events
1.7370 + // It's the callbackContext if one was provided in the options
1.7371 + // and if it's a DOM node or a jQuery collection
1.7372 + globalEventContext = callbackContext !== s &&
1.7373 + ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
1.7374 + jQuery( callbackContext ) : jQuery.event,
1.7375 + // Deferreds
1.7376 + deferred = jQuery.Deferred(),
1.7377 + completeDeferred = jQuery.Callbacks( "once memory" ),
1.7378 + // Status-dependent callbacks
1.7379 + statusCode = s.statusCode || {},
1.7380 + // ifModified key
1.7381 + ifModifiedKey,
1.7382 + // Headers (they are sent all at once)
1.7383 + requestHeaders = {},
1.7384 + requestHeadersNames = {},
1.7385 + // Response headers
1.7386 + responseHeadersString,
1.7387 + responseHeaders,
1.7388 + // transport
1.7389 + transport,
1.7390 + // timeout handle
1.7391 + timeoutTimer,
1.7392 + // Cross-domain detection vars
1.7393 + parts,
1.7394 + // The jqXHR state
1.7395 + state = 0,
1.7396 + // To know if global events are to be dispatched
1.7397 + fireGlobals,
1.7398 + // Loop variable
1.7399 + i,
1.7400 + // Fake xhr
1.7401 + jqXHR = {
1.7402 +
1.7403 + readyState: 0,
1.7404 +
1.7405 + // Caches the header
1.7406 + setRequestHeader: function( name, value ) {
1.7407 + if ( !state ) {
1.7408 + var lname = name.toLowerCase();
1.7409 + name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
1.7410 + requestHeaders[ name ] = value;
1.7411 + }
1.7412 + return this;
1.7413 + },
1.7414 +
1.7415 + // Raw string
1.7416 + getAllResponseHeaders: function() {
1.7417 + return state === 2 ? responseHeadersString : null;
1.7418 + },
1.7419 +
1.7420 + // Builds headers hashtable if needed
1.7421 + getResponseHeader: function( key ) {
1.7422 + var match;
1.7423 + if ( state === 2 ) {
1.7424 + if ( !responseHeaders ) {
1.7425 + responseHeaders = {};
1.7426 + while( ( match = rheaders.exec( responseHeadersString ) ) ) {
1.7427 + responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
1.7428 + }
1.7429 + }
1.7430 + match = responseHeaders[ key.toLowerCase() ];
1.7431 + }
1.7432 + return match === undefined ? null : match;
1.7433 + },
1.7434 +
1.7435 + // Overrides response content-type header
1.7436 + overrideMimeType: function( type ) {
1.7437 + if ( !state ) {
1.7438 + s.mimeType = type;
1.7439 + }
1.7440 + return this;
1.7441 + },
1.7442 +
1.7443 + // Cancel the request
1.7444 + abort: function( statusText ) {
1.7445 + statusText = statusText || "abort";
1.7446 + if ( transport ) {
1.7447 + transport.abort( statusText );
1.7448 + }
1.7449 + done( 0, statusText );
1.7450 + return this;
1.7451 + }
1.7452 + };
1.7453 +
1.7454 + // Callback for when everything is done
1.7455 + // It is defined here because jslint complains if it is declared
1.7456 + // at the end of the function (which would be more logical and readable)
1.7457 + function done( status, nativeStatusText, responses, headers ) {
1.7458 +
1.7459 + // Called once
1.7460 + if ( state === 2 ) {
1.7461 + return;
1.7462 + }
1.7463 +
1.7464 + // State is "done" now
1.7465 + state = 2;
1.7466 +
1.7467 + // Clear timeout if it exists
1.7468 + if ( timeoutTimer ) {
1.7469 + clearTimeout( timeoutTimer );
1.7470 + }
1.7471 +
1.7472 + // Dereference transport for early garbage collection
1.7473 + // (no matter how long the jqXHR object will be used)
1.7474 + transport = undefined;
1.7475 +
1.7476 + // Cache response headers
1.7477 + responseHeadersString = headers || "";
1.7478 +
1.7479 + // Set readyState
1.7480 + jqXHR.readyState = status > 0 ? 4 : 0;
1.7481 +
1.7482 + var isSuccess,
1.7483 + success,
1.7484 + error,
1.7485 + statusText = nativeStatusText,
1.7486 + response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
1.7487 + lastModified,
1.7488 + etag;
1.7489 +
1.7490 + // If successful, handle type chaining
1.7491 + if ( status >= 200 && status < 300 || status === 304 ) {
1.7492 +
1.7493 + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
1.7494 + if ( s.ifModified ) {
1.7495 +
1.7496 + if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
1.7497 + jQuery.lastModified[ ifModifiedKey ] = lastModified;
1.7498 + }
1.7499 + if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
1.7500 + jQuery.etag[ ifModifiedKey ] = etag;
1.7501 + }
1.7502 + }
1.7503 +
1.7504 + // If not modified
1.7505 + if ( status === 304 ) {
1.7506 +
1.7507 + statusText = "notmodified";
1.7508 + isSuccess = true;
1.7509 +
1.7510 + // If we have data
1.7511 + } else {
1.7512 +
1.7513 + try {
1.7514 + success = ajaxConvert( s, response );
1.7515 + statusText = "success";
1.7516 + isSuccess = true;
1.7517 + } catch(e) {
1.7518 + // We have a parsererror
1.7519 + statusText = "parsererror";
1.7520 + error = e;
1.7521 + }
1.7522 + }
1.7523 + } else {
1.7524 + // We extract error from statusText
1.7525 + // then normalize statusText and status for non-aborts
1.7526 + error = statusText;
1.7527 + if ( !statusText || status ) {
1.7528 + statusText = "error";
1.7529 + if ( status < 0 ) {
1.7530 + status = 0;
1.7531 + }
1.7532 + }
1.7533 + }
1.7534 +
1.7535 + // Set data for the fake xhr object
1.7536 + jqXHR.status = status;
1.7537 + jqXHR.statusText = "" + ( nativeStatusText || statusText );
1.7538 +
1.7539 + // Success/Error
1.7540 + if ( isSuccess ) {
1.7541 + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
1.7542 + } else {
1.7543 + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
1.7544 + }
1.7545 +
1.7546 + // Status-dependent callbacks
1.7547 + jqXHR.statusCode( statusCode );
1.7548 + statusCode = undefined;
1.7549 +
1.7550 + if ( fireGlobals ) {
1.7551 + globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
1.7552 + [ jqXHR, s, isSuccess ? success : error ] );
1.7553 + }
1.7554 +
1.7555 + // Complete
1.7556 + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
1.7557 +
1.7558 + if ( fireGlobals ) {
1.7559 + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
1.7560 + // Handle the global AJAX counter
1.7561 + if ( !( --jQuery.active ) ) {
1.7562 + jQuery.event.trigger( "ajaxStop" );
1.7563 + }
1.7564 + }
1.7565 + }
1.7566 +
1.7567 + // Attach deferreds
1.7568 + deferred.promise( jqXHR );
1.7569 + jqXHR.success = jqXHR.done;
1.7570 + jqXHR.error = jqXHR.fail;
1.7571 + jqXHR.complete = completeDeferred.add;
1.7572 +
1.7573 + // Status-dependent callbacks
1.7574 + jqXHR.statusCode = function( map ) {
1.7575 + if ( map ) {
1.7576 + var tmp;
1.7577 + if ( state < 2 ) {
1.7578 + for ( tmp in map ) {
1.7579 + statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
1.7580 + }
1.7581 + } else {
1.7582 + tmp = map[ jqXHR.status ];
1.7583 + jqXHR.then( tmp, tmp );
1.7584 + }
1.7585 + }
1.7586 + return this;
1.7587 + };
1.7588 +
1.7589 + // Remove hash character (#7531: and string promotion)
1.7590 + // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
1.7591 + // We also use the url parameter if available
1.7592 + s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
1.7593 +
1.7594 + // Extract dataTypes list
1.7595 + s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
1.7596 +
1.7597 + // Determine if a cross-domain request is in order
1.7598 + if ( s.crossDomain == null ) {
1.7599 + parts = rurl.exec( s.url.toLowerCase() );
1.7600 + s.crossDomain = !!( parts &&
1.7601 + ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
1.7602 + ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
1.7603 + ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
1.7604 + );
1.7605 + }
1.7606 +
1.7607 + // Convert data if not already a string
1.7608 + if ( s.data && s.processData && typeof s.data !== "string" ) {
1.7609 + s.data = jQuery.param( s.data, s.traditional );
1.7610 + }
1.7611 +
1.7612 + // Apply prefilters
1.7613 + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
1.7614 +
1.7615 + // If request was aborted inside a prefilter, stop there
1.7616 + if ( state === 2 ) {
1.7617 + return false;
1.7618 + }
1.7619 +
1.7620 + // We can fire global events as of now if asked to
1.7621 + fireGlobals = s.global;
1.7622 +
1.7623 + // Uppercase the type
1.7624 + s.type = s.type.toUpperCase();
1.7625 +
1.7626 + // Determine if request has content
1.7627 + s.hasContent = !rnoContent.test( s.type );
1.7628 +
1.7629 + // Watch for a new set of requests
1.7630 + if ( fireGlobals && jQuery.active++ === 0 ) {
1.7631 + jQuery.event.trigger( "ajaxStart" );
1.7632 + }
1.7633 +
1.7634 + // More options handling for requests with no content
1.7635 + if ( !s.hasContent ) {
1.7636 +
1.7637 + // If data is available, append data to url
1.7638 + if ( s.data ) {
1.7639 + s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
1.7640 + // #9682: remove data so that it's not used in an eventual retry
1.7641 + delete s.data;
1.7642 + }
1.7643 +
1.7644 + // Get ifModifiedKey before adding the anti-cache parameter
1.7645 + ifModifiedKey = s.url;
1.7646 +
1.7647 + // Add anti-cache in url if needed
1.7648 + if ( s.cache === false ) {
1.7649 +
1.7650 + var ts = jQuery.now(),
1.7651 + // try replacing _= if it is there
1.7652 + ret = s.url.replace( rts, "$1_=" + ts );
1.7653 +
1.7654 + // if nothing was replaced, add timestamp to the end
1.7655 + s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
1.7656 + }
1.7657 + }
1.7658 +
1.7659 + // Set the correct header, if data is being sent
1.7660 + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
1.7661 + jqXHR.setRequestHeader( "Content-Type", s.contentType );
1.7662 + }
1.7663 +
1.7664 + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
1.7665 + if ( s.ifModified ) {
1.7666 + ifModifiedKey = ifModifiedKey || s.url;
1.7667 + if ( jQuery.lastModified[ ifModifiedKey ] ) {
1.7668 + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
1.7669 + }
1.7670 + if ( jQuery.etag[ ifModifiedKey ] ) {
1.7671 + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
1.7672 + }
1.7673 + }
1.7674 +
1.7675 + // Set the Accepts header for the server, depending on the dataType
1.7676 + jqXHR.setRequestHeader(
1.7677 + "Accept",
1.7678 + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
1.7679 + s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
1.7680 + s.accepts[ "*" ]
1.7681 + );
1.7682 +
1.7683 + // Check for headers option
1.7684 + for ( i in s.headers ) {
1.7685 + jqXHR.setRequestHeader( i, s.headers[ i ] );
1.7686 + }
1.7687 +
1.7688 + // Allow custom headers/mimetypes and early abort
1.7689 + if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
1.7690 + // Abort if not done already
1.7691 + jqXHR.abort();
1.7692 + return false;
1.7693 +
1.7694 + }
1.7695 +
1.7696 + // Install callbacks on deferreds
1.7697 + for ( i in { success: 1, error: 1, complete: 1 } ) {
1.7698 + jqXHR[ i ]( s[ i ] );
1.7699 + }
1.7700 +
1.7701 + // Get transport
1.7702 + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
1.7703 +
1.7704 + // If no transport, we auto-abort
1.7705 + if ( !transport ) {
1.7706 + done( -1, "No Transport" );
1.7707 + } else {
1.7708 + jqXHR.readyState = 1;
1.7709 + // Send global event
1.7710 + if ( fireGlobals ) {
1.7711 + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
1.7712 + }
1.7713 + // Timeout
1.7714 + if ( s.async && s.timeout > 0 ) {
1.7715 + timeoutTimer = setTimeout( function(){
1.7716 + jqXHR.abort( "timeout" );
1.7717 + }, s.timeout );
1.7718 + }
1.7719 +
1.7720 + try {
1.7721 + state = 1;
1.7722 + transport.send( requestHeaders, done );
1.7723 + } catch (e) {
1.7724 + // Propagate exception as error if not done
1.7725 + if ( state < 2 ) {
1.7726 + done( -1, e );
1.7727 + // Simply rethrow otherwise
1.7728 + } else {
1.7729 + throw e;
1.7730 + }
1.7731 + }
1.7732 + }
1.7733 +
1.7734 + return jqXHR;
1.7735 + },
1.7736 +
1.7737 + // Serialize an array of form elements or a set of
1.7738 + // key/values into a query string
1.7739 + param: function( a, traditional ) {
1.7740 + var s = [],
1.7741 + add = function( key, value ) {
1.7742 + // If value is a function, invoke it and return its value
1.7743 + value = jQuery.isFunction( value ) ? value() : value;
1.7744 + s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
1.7745 + };
1.7746 +
1.7747 + // Set traditional to true for jQuery <= 1.3.2 behavior.
1.7748 + if ( traditional === undefined ) {
1.7749 + traditional = jQuery.ajaxSettings.traditional;
1.7750 + }
1.7751 +
1.7752 + // If an array was passed in, assume that it is an array of form elements.
1.7753 + if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
1.7754 + // Serialize the form elements
1.7755 + jQuery.each( a, function() {
1.7756 + add( this.name, this.value );
1.7757 + });
1.7758 +
1.7759 + } else {
1.7760 + // If traditional, encode the "old" way (the way 1.3.2 or older
1.7761 + // did it), otherwise encode params recursively.
1.7762 + for ( var prefix in a ) {
1.7763 + buildParams( prefix, a[ prefix ], traditional, add );
1.7764 + }
1.7765 + }
1.7766 +
1.7767 + // Return the resulting serialization
1.7768 + return s.join( "&" ).replace( r20, "+" );
1.7769 + }
1.7770 +});
1.7771 +
1.7772 +function buildParams( prefix, obj, traditional, add ) {
1.7773 + if ( jQuery.isArray( obj ) ) {
1.7774 + // Serialize array item.
1.7775 + jQuery.each( obj, function( i, v ) {
1.7776 + if ( traditional || rbracket.test( prefix ) ) {
1.7777 + // Treat each array item as a scalar.
1.7778 + add( prefix, v );
1.7779 +
1.7780 + } else {
1.7781 + // If array item is non-scalar (array or object), encode its
1.7782 + // numeric index to resolve deserialization ambiguity issues.
1.7783 + // Note that rack (as of 1.0.0) can't currently deserialize
1.7784 + // nested arrays properly, and attempting to do so may cause
1.7785 + // a server error. Possible fixes are to modify rack's
1.7786 + // deserialization algorithm or to provide an option or flag
1.7787 + // to force array serialization to be shallow.
1.7788 + buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
1.7789 + }
1.7790 + });
1.7791 +
1.7792 + } else if ( !traditional && jQuery.type( obj ) === "object" ) {
1.7793 + // Serialize object item.
1.7794 + for ( var name in obj ) {
1.7795 + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
1.7796 + }
1.7797 +
1.7798 + } else {
1.7799 + // Serialize scalar item.
1.7800 + add( prefix, obj );
1.7801 + }
1.7802 +}
1.7803 +
1.7804 +// This is still on the jQuery object... for now
1.7805 +// Want to move this to jQuery.ajax some day
1.7806 +jQuery.extend({
1.7807 +
1.7808 + // Counter for holding the number of active queries
1.7809 + active: 0,
1.7810 +
1.7811 + // Last-Modified header cache for next request
1.7812 + lastModified: {},
1.7813 + etag: {}
1.7814 +
1.7815 +});
1.7816 +
1.7817 +/* Handles responses to an ajax request:
1.7818 + * - sets all responseXXX fields accordingly
1.7819 + * - finds the right dataType (mediates between content-type and expected dataType)
1.7820 + * - returns the corresponding response
1.7821 + */
1.7822 +function ajaxHandleResponses( s, jqXHR, responses ) {
1.7823 +
1.7824 + var contents = s.contents,
1.7825 + dataTypes = s.dataTypes,
1.7826 + responseFields = s.responseFields,
1.7827 + ct,
1.7828 + type,
1.7829 + finalDataType,
1.7830 + firstDataType;
1.7831 +
1.7832 + // Fill responseXXX fields
1.7833 + for ( type in responseFields ) {
1.7834 + if ( type in responses ) {
1.7835 + jqXHR[ responseFields[type] ] = responses[ type ];
1.7836 + }
1.7837 + }
1.7838 +
1.7839 + // Remove auto dataType and get content-type in the process
1.7840 + while( dataTypes[ 0 ] === "*" ) {
1.7841 + dataTypes.shift();
1.7842 + if ( ct === undefined ) {
1.7843 + ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
1.7844 + }
1.7845 + }
1.7846 +
1.7847 + // Check if we're dealing with a known content-type
1.7848 + if ( ct ) {
1.7849 + for ( type in contents ) {
1.7850 + if ( contents[ type ] && contents[ type ].test( ct ) ) {
1.7851 + dataTypes.unshift( type );
1.7852 + break;
1.7853 + }
1.7854 + }
1.7855 + }
1.7856 +
1.7857 + // Check to see if we have a response for the expected dataType
1.7858 + if ( dataTypes[ 0 ] in responses ) {
1.7859 + finalDataType = dataTypes[ 0 ];
1.7860 + } else {
1.7861 + // Try convertible dataTypes
1.7862 + for ( type in responses ) {
1.7863 + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
1.7864 + finalDataType = type;
1.7865 + break;
1.7866 + }
1.7867 + if ( !firstDataType ) {
1.7868 + firstDataType = type;
1.7869 + }
1.7870 + }
1.7871 + // Or just use first one
1.7872 + finalDataType = finalDataType || firstDataType;
1.7873 + }
1.7874 +
1.7875 + // If we found a dataType
1.7876 + // We add the dataType to the list if needed
1.7877 + // and return the corresponding response
1.7878 + if ( finalDataType ) {
1.7879 + if ( finalDataType !== dataTypes[ 0 ] ) {
1.7880 + dataTypes.unshift( finalDataType );
1.7881 + }
1.7882 + return responses[ finalDataType ];
1.7883 + }
1.7884 +}
1.7885 +
1.7886 +// Chain conversions given the request and the original response
1.7887 +function ajaxConvert( s, response ) {
1.7888 +
1.7889 + // Apply the dataFilter if provided
1.7890 + if ( s.dataFilter ) {
1.7891 + response = s.dataFilter( response, s.dataType );
1.7892 + }
1.7893 +
1.7894 + var dataTypes = s.dataTypes,
1.7895 + converters = {},
1.7896 + i,
1.7897 + key,
1.7898 + length = dataTypes.length,
1.7899 + tmp,
1.7900 + // Current and previous dataTypes
1.7901 + current = dataTypes[ 0 ],
1.7902 + prev,
1.7903 + // Conversion expression
1.7904 + conversion,
1.7905 + // Conversion function
1.7906 + conv,
1.7907 + // Conversion functions (transitive conversion)
1.7908 + conv1,
1.7909 + conv2;
1.7910 +
1.7911 + // For each dataType in the chain
1.7912 + for ( i = 1; i < length; i++ ) {
1.7913 +
1.7914 + // Create converters map
1.7915 + // with lowercased keys
1.7916 + if ( i === 1 ) {
1.7917 + for ( key in s.converters ) {
1.7918 + if ( typeof key === "string" ) {
1.7919 + converters[ key.toLowerCase() ] = s.converters[ key ];
1.7920 + }
1.7921 + }
1.7922 + }
1.7923 +
1.7924 + // Get the dataTypes
1.7925 + prev = current;
1.7926 + current = dataTypes[ i ];
1.7927 +
1.7928 + // If current is auto dataType, update it to prev
1.7929 + if ( current === "*" ) {
1.7930 + current = prev;
1.7931 + // If no auto and dataTypes are actually different
1.7932 + } else if ( prev !== "*" && prev !== current ) {
1.7933 +
1.7934 + // Get the converter
1.7935 + conversion = prev + " " + current;
1.7936 + conv = converters[ conversion ] || converters[ "* " + current ];
1.7937 +
1.7938 + // If there is no direct converter, search transitively
1.7939 + if ( !conv ) {
1.7940 + conv2 = undefined;
1.7941 + for ( conv1 in converters ) {
1.7942 + tmp = conv1.split( " " );
1.7943 + if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
1.7944 + conv2 = converters[ tmp[1] + " " + current ];
1.7945 + if ( conv2 ) {
1.7946 + conv1 = converters[ conv1 ];
1.7947 + if ( conv1 === true ) {
1.7948 + conv = conv2;
1.7949 + } else if ( conv2 === true ) {
1.7950 + conv = conv1;
1.7951 + }
1.7952 + break;
1.7953 + }
1.7954 + }
1.7955 + }
1.7956 + }
1.7957 + // If we found no converter, dispatch an error
1.7958 + if ( !( conv || conv2 ) ) {
1.7959 + jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
1.7960 + }
1.7961 + // If found converter is not an equivalence
1.7962 + if ( conv !== true ) {
1.7963 + // Convert with 1 or 2 converters accordingly
1.7964 + response = conv ? conv( response ) : conv2( conv1(response) );
1.7965 + }
1.7966 + }
1.7967 + }
1.7968 + return response;
1.7969 +}
1.7970 +
1.7971 +
1.7972 +
1.7973 +
1.7974 +var jsc = jQuery.now(),
1.7975 + jsre = /(\=)\?(&|$)|\?\?/i;
1.7976 +
1.7977 +// Default jsonp settings
1.7978 +jQuery.ajaxSetup({
1.7979 + jsonp: "callback",
1.7980 + jsonpCallback: function() {
1.7981 + return jQuery.expando + "_" + ( jsc++ );
1.7982 + }
1.7983 +});
1.7984 +
1.7985 +// Detect, normalize options and install callbacks for jsonp requests
1.7986 +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
1.7987 +
1.7988 + var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType );
1.7989 +
1.7990 + if ( s.dataTypes[ 0 ] === "jsonp" ||
1.7991 + s.jsonp !== false && ( jsre.test( s.url ) ||
1.7992 + inspectData && jsre.test( s.data ) ) ) {
1.7993 +
1.7994 + var responseContainer,
1.7995 + jsonpCallback = s.jsonpCallback =
1.7996 + jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
1.7997 + previous = window[ jsonpCallback ],
1.7998 + url = s.url,
1.7999 + data = s.data,
1.8000 + replace = "$1" + jsonpCallback + "$2";
1.8001 +
1.8002 + if ( s.jsonp !== false ) {
1.8003 + url = url.replace( jsre, replace );
1.8004 + if ( s.url === url ) {
1.8005 + if ( inspectData ) {
1.8006 + data = data.replace( jsre, replace );
1.8007 + }
1.8008 + if ( s.data === data ) {
1.8009 + // Add callback manually
1.8010 + url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
1.8011 + }
1.8012 + }
1.8013 + }
1.8014 +
1.8015 + s.url = url;
1.8016 + s.data = data;
1.8017 +
1.8018 + // Install callback
1.8019 + window[ jsonpCallback ] = function( response ) {
1.8020 + responseContainer = [ response ];
1.8021 + };
1.8022 +
1.8023 + // Clean-up function
1.8024 + jqXHR.always(function() {
1.8025 + // Set callback back to previous value
1.8026 + window[ jsonpCallback ] = previous;
1.8027 + // Call if it was a function and we have a response
1.8028 + if ( responseContainer && jQuery.isFunction( previous ) ) {
1.8029 + window[ jsonpCallback ]( responseContainer[ 0 ] );
1.8030 + }
1.8031 + });
1.8032 +
1.8033 + // Use data converter to retrieve json after script execution
1.8034 + s.converters["script json"] = function() {
1.8035 + if ( !responseContainer ) {
1.8036 + jQuery.error( jsonpCallback + " was not called" );
1.8037 + }
1.8038 + return responseContainer[ 0 ];
1.8039 + };
1.8040 +
1.8041 + // force json dataType
1.8042 + s.dataTypes[ 0 ] = "json";
1.8043 +
1.8044 + // Delegate to script
1.8045 + return "script";
1.8046 + }
1.8047 +});
1.8048 +
1.8049 +
1.8050 +
1.8051 +
1.8052 +// Install script dataType
1.8053 +jQuery.ajaxSetup({
1.8054 + accepts: {
1.8055 + script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
1.8056 + },
1.8057 + contents: {
1.8058 + script: /javascript|ecmascript/
1.8059 + },
1.8060 + converters: {
1.8061 + "text script": function( text ) {
1.8062 + jQuery.globalEval( text );
1.8063 + return text;
1.8064 + }
1.8065 + }
1.8066 +});
1.8067 +
1.8068 +// Handle cache's special case and global
1.8069 +jQuery.ajaxPrefilter( "script", function( s ) {
1.8070 + if ( s.cache === undefined ) {
1.8071 + s.cache = false;
1.8072 + }
1.8073 + if ( s.crossDomain ) {
1.8074 + s.type = "GET";
1.8075 + s.global = false;
1.8076 + }
1.8077 +});
1.8078 +
1.8079 +// Bind script tag hack transport
1.8080 +jQuery.ajaxTransport( "script", function(s) {
1.8081 +
1.8082 + // This transport only deals with cross domain requests
1.8083 + if ( s.crossDomain ) {
1.8084 +
1.8085 + var script,
1.8086 + head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
1.8087 +
1.8088 + return {
1.8089 +
1.8090 + send: function( _, callback ) {
1.8091 +
1.8092 + script = document.createElement( "script" );
1.8093 +
1.8094 + script.async = "async";
1.8095 +
1.8096 + if ( s.scriptCharset ) {
1.8097 + script.charset = s.scriptCharset;
1.8098 + }
1.8099 +
1.8100 + script.src = s.url;
1.8101 +
1.8102 + // Attach handlers for all browsers
1.8103 + script.onload = script.onreadystatechange = function( _, isAbort ) {
1.8104 +
1.8105 + if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
1.8106 +
1.8107 + // Handle memory leak in IE
1.8108 + script.onload = script.onreadystatechange = null;
1.8109 +
1.8110 + // Remove the script
1.8111 + if ( head && script.parentNode ) {
1.8112 + head.removeChild( script );
1.8113 + }
1.8114 +
1.8115 + // Dereference the script
1.8116 + script = undefined;
1.8117 +
1.8118 + // Callback if not abort
1.8119 + if ( !isAbort ) {
1.8120 + callback( 200, "success" );
1.8121 + }
1.8122 + }
1.8123 + };
1.8124 + // Use insertBefore instead of appendChild to circumvent an IE6 bug.
1.8125 + // This arises when a base node is used (#2709 and #4378).
1.8126 + head.insertBefore( script, head.firstChild );
1.8127 + },
1.8128 +
1.8129 + abort: function() {
1.8130 + if ( script ) {
1.8131 + script.onload( 0, 1 );
1.8132 + }
1.8133 + }
1.8134 + };
1.8135 + }
1.8136 +});
1.8137 +
1.8138 +
1.8139 +
1.8140 +
1.8141 +var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
1.8142 + xhrOnUnloadAbort = window.ActiveXObject ? function() {
1.8143 + // Abort all pending requests
1.8144 + for ( var key in xhrCallbacks ) {
1.8145 + xhrCallbacks[ key ]( 0, 1 );
1.8146 + }
1.8147 + } : false,
1.8148 + xhrId = 0,
1.8149 + xhrCallbacks;
1.8150 +
1.8151 +// Functions to create xhrs
1.8152 +function createStandardXHR() {
1.8153 + try {
1.8154 + return new window.XMLHttpRequest();
1.8155 + } catch( e ) {}
1.8156 +}
1.8157 +
1.8158 +function createActiveXHR() {
1.8159 + try {
1.8160 + return new window.ActiveXObject( "Microsoft.XMLHTTP" );
1.8161 + } catch( e ) {}
1.8162 +}
1.8163 +
1.8164 +// Create the request object
1.8165 +// (This is still attached to ajaxSettings for backward compatibility)
1.8166 +jQuery.ajaxSettings.xhr = window.ActiveXObject ?
1.8167 + /* Microsoft failed to properly
1.8168 + * implement the XMLHttpRequest in IE7 (can't request local files),
1.8169 + * so we use the ActiveXObject when it is available
1.8170 + * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
1.8171 + * we need a fallback.
1.8172 + */
1.8173 + function() {
1.8174 + return !this.isLocal && createStandardXHR() || createActiveXHR();
1.8175 + } :
1.8176 + // For all other browsers, use the standard XMLHttpRequest object
1.8177 + createStandardXHR;
1.8178 +
1.8179 +// Determine support properties
1.8180 +(function( xhr ) {
1.8181 + jQuery.extend( jQuery.support, {
1.8182 + ajax: !!xhr,
1.8183 + cors: !!xhr && ( "withCredentials" in xhr )
1.8184 + });
1.8185 +})( jQuery.ajaxSettings.xhr() );
1.8186 +
1.8187 +// Create transport if the browser can provide an xhr
1.8188 +if ( jQuery.support.ajax ) {
1.8189 +
1.8190 + jQuery.ajaxTransport(function( s ) {
1.8191 + // Cross domain only allowed if supported through XMLHttpRequest
1.8192 + if ( !s.crossDomain || jQuery.support.cors ) {
1.8193 +
1.8194 + var callback;
1.8195 +
1.8196 + return {
1.8197 + send: function( headers, complete ) {
1.8198 +
1.8199 + // Get a new xhr
1.8200 + var xhr = s.xhr(),
1.8201 + handle,
1.8202 + i;
1.8203 +
1.8204 + // Open the socket
1.8205 + // Passing null username, generates a login popup on Opera (#2865)
1.8206 + if ( s.username ) {
1.8207 + xhr.open( s.type, s.url, s.async, s.username, s.password );
1.8208 + } else {
1.8209 + xhr.open( s.type, s.url, s.async );
1.8210 + }
1.8211 +
1.8212 + // Apply custom fields if provided
1.8213 + if ( s.xhrFields ) {
1.8214 + for ( i in s.xhrFields ) {
1.8215 + xhr[ i ] = s.xhrFields[ i ];
1.8216 + }
1.8217 + }
1.8218 +
1.8219 + // Override mime type if needed
1.8220 + if ( s.mimeType && xhr.overrideMimeType ) {
1.8221 + xhr.overrideMimeType( s.mimeType );
1.8222 + }
1.8223 +
1.8224 + // X-Requested-With header
1.8225 + // For cross-domain requests, seeing as conditions for a preflight are
1.8226 + // akin to a jigsaw puzzle, we simply never set it to be sure.
1.8227 + // (it can always be set on a per-request basis or even using ajaxSetup)
1.8228 + // For same-domain requests, won't change header if already provided.
1.8229 + if ( !s.crossDomain && !headers["X-Requested-With"] ) {
1.8230 + headers[ "X-Requested-With" ] = "XMLHttpRequest";
1.8231 + }
1.8232 +
1.8233 + // Need an extra try/catch for cross domain requests in Firefox 3
1.8234 + try {
1.8235 + for ( i in headers ) {
1.8236 + xhr.setRequestHeader( i, headers[ i ] );
1.8237 + }
1.8238 + } catch( _ ) {}
1.8239 +
1.8240 + // Do send the request
1.8241 + // This may raise an exception which is actually
1.8242 + // handled in jQuery.ajax (so no try/catch here)
1.8243 + xhr.send( ( s.hasContent && s.data ) || null );
1.8244 +
1.8245 + // Listener
1.8246 + callback = function( _, isAbort ) {
1.8247 +
1.8248 + var status,
1.8249 + statusText,
1.8250 + responseHeaders,
1.8251 + responses,
1.8252 + xml;
1.8253 +
1.8254 + // Firefox throws exceptions when accessing properties
1.8255 + // of an xhr when a network error occured
1.8256 + // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
1.8257 + try {
1.8258 +
1.8259 + // Was never called and is aborted or complete
1.8260 + if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
1.8261 +
1.8262 + // Only called once
1.8263 + callback = undefined;
1.8264 +
1.8265 + // Do not keep as active anymore
1.8266 + if ( handle ) {
1.8267 + xhr.onreadystatechange = jQuery.noop;
1.8268 + if ( xhrOnUnloadAbort ) {
1.8269 + delete xhrCallbacks[ handle ];
1.8270 + }
1.8271 + }
1.8272 +
1.8273 + // If it's an abort
1.8274 + if ( isAbort ) {
1.8275 + // Abort it manually if needed
1.8276 + if ( xhr.readyState !== 4 ) {
1.8277 + xhr.abort();
1.8278 + }
1.8279 + } else {
1.8280 + status = xhr.status;
1.8281 + responseHeaders = xhr.getAllResponseHeaders();
1.8282 + responses = {};
1.8283 + xml = xhr.responseXML;
1.8284 +
1.8285 + // Construct response list
1.8286 + if ( xml && xml.documentElement /* #4958 */ ) {
1.8287 + responses.xml = xml;
1.8288 + }
1.8289 +
1.8290 + // When requesting binary data, IE6-9 will throw an exception
1.8291 + // on any attempt to access responseText (#11426)
1.8292 + try {
1.8293 + responses.text = xhr.responseText;
1.8294 + } catch( _ ) {
1.8295 + }
1.8296 +
1.8297 + // Firefox throws an exception when accessing
1.8298 + // statusText for faulty cross-domain requests
1.8299 + try {
1.8300 + statusText = xhr.statusText;
1.8301 + } catch( e ) {
1.8302 + // We normalize with Webkit giving an empty statusText
1.8303 + statusText = "";
1.8304 + }
1.8305 +
1.8306 + // Filter status for non standard behaviors
1.8307 +
1.8308 + // If the request is local and we have data: assume a success
1.8309 + // (success with no data won't get notified, that's the best we
1.8310 + // can do given current implementations)
1.8311 + if ( !status && s.isLocal && !s.crossDomain ) {
1.8312 + status = responses.text ? 200 : 404;
1.8313 + // IE - #1450: sometimes returns 1223 when it should be 204
1.8314 + } else if ( status === 1223 ) {
1.8315 + status = 204;
1.8316 + }
1.8317 + }
1.8318 + }
1.8319 + } catch( firefoxAccessException ) {
1.8320 + if ( !isAbort ) {
1.8321 + complete( -1, firefoxAccessException );
1.8322 + }
1.8323 + }
1.8324 +
1.8325 + // Call complete if needed
1.8326 + if ( responses ) {
1.8327 + complete( status, statusText, responses, responseHeaders );
1.8328 + }
1.8329 + };
1.8330 +
1.8331 + // if we're in sync mode or it's in cache
1.8332 + // and has been retrieved directly (IE6 & IE7)
1.8333 + // we need to manually fire the callback
1.8334 + if ( !s.async || xhr.readyState === 4 ) {
1.8335 + callback();
1.8336 + } else {
1.8337 + handle = ++xhrId;
1.8338 + if ( xhrOnUnloadAbort ) {
1.8339 + // Create the active xhrs callbacks list if needed
1.8340 + // and attach the unload handler
1.8341 + if ( !xhrCallbacks ) {
1.8342 + xhrCallbacks = {};
1.8343 + jQuery( window ).unload( xhrOnUnloadAbort );
1.8344 + }
1.8345 + // Add to list of active xhrs callbacks
1.8346 + xhrCallbacks[ handle ] = callback;
1.8347 + }
1.8348 + xhr.onreadystatechange = callback;
1.8349 + }
1.8350 + },
1.8351 +
1.8352 + abort: function() {
1.8353 + if ( callback ) {
1.8354 + callback(0,1);
1.8355 + }
1.8356 + }
1.8357 + };
1.8358 + }
1.8359 + });
1.8360 +}
1.8361 +
1.8362 +
1.8363 +
1.8364 +
1.8365 +var elemdisplay = {},
1.8366 + iframe, iframeDoc,
1.8367 + rfxtypes = /^(?:toggle|show|hide)$/,
1.8368 + rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
1.8369 + timerId,
1.8370 + fxAttrs = [
1.8371 + // height animations
1.8372 + [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
1.8373 + // width animations
1.8374 + [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
1.8375 + // opacity animations
1.8376 + [ "opacity" ]
1.8377 + ],
1.8378 + fxNow;
1.8379 +
1.8380 +jQuery.fn.extend({
1.8381 + show: function( speed, easing, callback ) {
1.8382 + var elem, display;
1.8383 +
1.8384 + if ( speed || speed === 0 ) {
1.8385 + return this.animate( genFx("show", 3), speed, easing, callback );
1.8386 +
1.8387 + } else {
1.8388 + for ( var i = 0, j = this.length; i < j; i++ ) {
1.8389 + elem = this[ i ];
1.8390 +
1.8391 + if ( elem.style ) {
1.8392 + display = elem.style.display;
1.8393 +
1.8394 + // Reset the inline display of this element to learn if it is
1.8395 + // being hidden by cascaded rules or not
1.8396 + if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
1.8397 + display = elem.style.display = "";
1.8398 + }
1.8399 +
1.8400 + // Set elements which have been overridden with display: none
1.8401 + // in a stylesheet to whatever the default browser style is
1.8402 + // for such an element
1.8403 + if ( (display === "" && jQuery.css(elem, "display") === "none") ||
1.8404 + !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
1.8405 + jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
1.8406 + }
1.8407 + }
1.8408 + }
1.8409 +
1.8410 + // Set the display of most of the elements in a second loop
1.8411 + // to avoid the constant reflow
1.8412 + for ( i = 0; i < j; i++ ) {
1.8413 + elem = this[ i ];
1.8414 +
1.8415 + if ( elem.style ) {
1.8416 + display = elem.style.display;
1.8417 +
1.8418 + if ( display === "" || display === "none" ) {
1.8419 + elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
1.8420 + }
1.8421 + }
1.8422 + }
1.8423 +
1.8424 + return this;
1.8425 + }
1.8426 + },
1.8427 +
1.8428 + hide: function( speed, easing, callback ) {
1.8429 + if ( speed || speed === 0 ) {
1.8430 + return this.animate( genFx("hide", 3), speed, easing, callback);
1.8431 +
1.8432 + } else {
1.8433 + var elem, display,
1.8434 + i = 0,
1.8435 + j = this.length;
1.8436 +
1.8437 + for ( ; i < j; i++ ) {
1.8438 + elem = this[i];
1.8439 + if ( elem.style ) {
1.8440 + display = jQuery.css( elem, "display" );
1.8441 +
1.8442 + if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
1.8443 + jQuery._data( elem, "olddisplay", display );
1.8444 + }
1.8445 + }
1.8446 + }
1.8447 +
1.8448 + // Set the display of the elements in a second loop
1.8449 + // to avoid the constant reflow
1.8450 + for ( i = 0; i < j; i++ ) {
1.8451 + if ( this[i].style ) {
1.8452 + this[i].style.display = "none";
1.8453 + }
1.8454 + }
1.8455 +
1.8456 + return this;
1.8457 + }
1.8458 + },
1.8459 +
1.8460 + // Save the old toggle function
1.8461 + _toggle: jQuery.fn.toggle,
1.8462 +
1.8463 + toggle: function( fn, fn2, callback ) {
1.8464 + var bool = typeof fn === "boolean";
1.8465 +
1.8466 + if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
1.8467 + this._toggle.apply( this, arguments );
1.8468 +
1.8469 + } else if ( fn == null || bool ) {
1.8470 + this.each(function() {
1.8471 + var state = bool ? fn : jQuery(this).is(":hidden");
1.8472 + jQuery(this)[ state ? "show" : "hide" ]();
1.8473 + });
1.8474 +
1.8475 + } else {
1.8476 + this.animate(genFx("toggle", 3), fn, fn2, callback);
1.8477 + }
1.8478 +
1.8479 + return this;
1.8480 + },
1.8481 +
1.8482 + fadeTo: function( speed, to, easing, callback ) {
1.8483 + return this.filter(":hidden").css("opacity", 0).show().end()
1.8484 + .animate({opacity: to}, speed, easing, callback);
1.8485 + },
1.8486 +
1.8487 + animate: function( prop, speed, easing, callback ) {
1.8488 + var optall = jQuery.speed( speed, easing, callback );
1.8489 +
1.8490 + if ( jQuery.isEmptyObject( prop ) ) {
1.8491 + return this.each( optall.complete, [ false ] );
1.8492 + }
1.8493 +
1.8494 + // Do not change referenced properties as per-property easing will be lost
1.8495 + prop = jQuery.extend( {}, prop );
1.8496 +
1.8497 + function doAnimation() {
1.8498 + // XXX 'this' does not always have a nodeName when running the
1.8499 + // test suite
1.8500 +
1.8501 + if ( optall.queue === false ) {
1.8502 + jQuery._mark( this );
1.8503 + }
1.8504 +
1.8505 + var opt = jQuery.extend( {}, optall ),
1.8506 + isElement = this.nodeType === 1,
1.8507 + hidden = isElement && jQuery(this).is(":hidden"),
1.8508 + name, val, p, e, hooks, replace,
1.8509 + parts, start, end, unit,
1.8510 + method;
1.8511 +
1.8512 + // will store per property easing and be used to determine when an animation is complete
1.8513 + opt.animatedProperties = {};
1.8514 +
1.8515 + // first pass over propertys to expand / normalize
1.8516 + for ( p in prop ) {
1.8517 + name = jQuery.camelCase( p );
1.8518 + if ( p !== name ) {
1.8519 + prop[ name ] = prop[ p ];
1.8520 + delete prop[ p ];
1.8521 + }
1.8522 +
1.8523 + if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) {
1.8524 + replace = hooks.expand( prop[ name ] );
1.8525 + delete prop[ name ];
1.8526 +
1.8527 + // not quite $.extend, this wont overwrite keys already present.
1.8528 + // also - reusing 'p' from above because we have the correct "name"
1.8529 + for ( p in replace ) {
1.8530 + if ( ! ( p in prop ) ) {
1.8531 + prop[ p ] = replace[ p ];
1.8532 + }
1.8533 + }
1.8534 + }
1.8535 + }
1.8536 +
1.8537 + for ( name in prop ) {
1.8538 + val = prop[ name ];
1.8539 + // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
1.8540 + if ( jQuery.isArray( val ) ) {
1.8541 + opt.animatedProperties[ name ] = val[ 1 ];
1.8542 + val = prop[ name ] = val[ 0 ];
1.8543 + } else {
1.8544 + opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
1.8545 + }
1.8546 +
1.8547 + if ( val === "hide" && hidden || val === "show" && !hidden ) {
1.8548 + return opt.complete.call( this );
1.8549 + }
1.8550 +
1.8551 + if ( isElement && ( name === "height" || name === "width" ) ) {
1.8552 + // Make sure that nothing sneaks out
1.8553 + // Record all 3 overflow attributes because IE does not
1.8554 + // change the overflow attribute when overflowX and
1.8555 + // overflowY are set to the same value
1.8556 + opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
1.8557 +
1.8558 + // Set display property to inline-block for height/width
1.8559 + // animations on inline elements that are having width/height animated
1.8560 + if ( jQuery.css( this, "display" ) === "inline" &&
1.8561 + jQuery.css( this, "float" ) === "none" ) {
1.8562 +
1.8563 + // inline-level elements accept inline-block;
1.8564 + // block-level elements need to be inline with layout
1.8565 + if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
1.8566 + this.style.display = "inline-block";
1.8567 +
1.8568 + } else {
1.8569 + this.style.zoom = 1;
1.8570 + }
1.8571 + }
1.8572 + }
1.8573 + }
1.8574 +
1.8575 + if ( opt.overflow != null ) {
1.8576 + this.style.overflow = "hidden";
1.8577 + }
1.8578 +
1.8579 + for ( p in prop ) {
1.8580 + e = new jQuery.fx( this, opt, p );
1.8581 + val = prop[ p ];
1.8582 +
1.8583 + if ( rfxtypes.test( val ) ) {
1.8584 +
1.8585 + // Tracks whether to show or hide based on private
1.8586 + // data attached to the element
1.8587 + method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
1.8588 + if ( method ) {
1.8589 + jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
1.8590 + e[ method ]();
1.8591 + } else {
1.8592 + e[ val ]();
1.8593 + }
1.8594 +
1.8595 + } else {
1.8596 + parts = rfxnum.exec( val );
1.8597 + start = e.cur();
1.8598 +
1.8599 + if ( parts ) {
1.8600 + end = parseFloat( parts[2] );
1.8601 + unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
1.8602 +
1.8603 + // We need to compute starting value
1.8604 + if ( unit !== "px" ) {
1.8605 + jQuery.style( this, p, (end || 1) + unit);
1.8606 + start = ( (end || 1) / e.cur() ) * start;
1.8607 + jQuery.style( this, p, start + unit);
1.8608 + }
1.8609 +
1.8610 + // If a +=/-= token was provided, we're doing a relative animation
1.8611 + if ( parts[1] ) {
1.8612 + end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
1.8613 + }
1.8614 +
1.8615 + e.custom( start, end, unit );
1.8616 +
1.8617 + } else {
1.8618 + e.custom( start, val, "" );
1.8619 + }
1.8620 + }
1.8621 + }
1.8622 +
1.8623 + // For JS strict compliance
1.8624 + return true;
1.8625 + }
1.8626 +
1.8627 + return optall.queue === false ?
1.8628 + this.each( doAnimation ) :
1.8629 + this.queue( optall.queue, doAnimation );
1.8630 + },
1.8631 +
1.8632 + stop: function( type, clearQueue, gotoEnd ) {
1.8633 + if ( typeof type !== "string" ) {
1.8634 + gotoEnd = clearQueue;
1.8635 + clearQueue = type;
1.8636 + type = undefined;
1.8637 + }
1.8638 + if ( clearQueue && type !== false ) {
1.8639 + this.queue( type || "fx", [] );
1.8640 + }
1.8641 +
1.8642 + return this.each(function() {
1.8643 + var index,
1.8644 + hadTimers = false,
1.8645 + timers = jQuery.timers,
1.8646 + data = jQuery._data( this );
1.8647 +
1.8648 + // clear marker counters if we know they won't be
1.8649 + if ( !gotoEnd ) {
1.8650 + jQuery._unmark( true, this );
1.8651 + }
1.8652 +
1.8653 + function stopQueue( elem, data, index ) {
1.8654 + var hooks = data[ index ];
1.8655 + jQuery.removeData( elem, index, true );
1.8656 + hooks.stop( gotoEnd );
1.8657 + }
1.8658 +
1.8659 + if ( type == null ) {
1.8660 + for ( index in data ) {
1.8661 + if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
1.8662 + stopQueue( this, data, index );
1.8663 + }
1.8664 + }
1.8665 + } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
1.8666 + stopQueue( this, data, index );
1.8667 + }
1.8668 +
1.8669 + for ( index = timers.length; index--; ) {
1.8670 + if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
1.8671 + if ( gotoEnd ) {
1.8672 +
1.8673 + // force the next step to be the last
1.8674 + timers[ index ]( true );
1.8675 + } else {
1.8676 + timers[ index ].saveState();
1.8677 + }
1.8678 + hadTimers = true;
1.8679 + timers.splice( index, 1 );
1.8680 + }
1.8681 + }
1.8682 +
1.8683 + // start the next in the queue if the last step wasn't forced
1.8684 + // timers currently will call their complete callbacks, which will dequeue
1.8685 + // but only if they were gotoEnd
1.8686 + if ( !( gotoEnd && hadTimers ) ) {
1.8687 + jQuery.dequeue( this, type );
1.8688 + }
1.8689 + });
1.8690 + }
1.8691 +
1.8692 +});
1.8693 +
1.8694 +// Animations created synchronously will run synchronously
1.8695 +function createFxNow() {
1.8696 + setTimeout( clearFxNow, 0 );
1.8697 + return ( fxNow = jQuery.now() );
1.8698 +}
1.8699 +
1.8700 +function clearFxNow() {
1.8701 + fxNow = undefined;
1.8702 +}
1.8703 +
1.8704 +// Generate parameters to create a standard animation
1.8705 +function genFx( type, num ) {
1.8706 + var obj = {};
1.8707 +
1.8708 + jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
1.8709 + obj[ this ] = type;
1.8710 + });
1.8711 +
1.8712 + return obj;
1.8713 +}
1.8714 +
1.8715 +// Generate shortcuts for custom animations
1.8716 +jQuery.each({
1.8717 + slideDown: genFx( "show", 1 ),
1.8718 + slideUp: genFx( "hide", 1 ),
1.8719 + slideToggle: genFx( "toggle", 1 ),
1.8720 + fadeIn: { opacity: "show" },
1.8721 + fadeOut: { opacity: "hide" },
1.8722 + fadeToggle: { opacity: "toggle" }
1.8723 +}, function( name, props ) {
1.8724 + jQuery.fn[ name ] = function( speed, easing, callback ) {
1.8725 + return this.animate( props, speed, easing, callback );
1.8726 + };
1.8727 +});
1.8728 +
1.8729 +jQuery.extend({
1.8730 + speed: function( speed, easing, fn ) {
1.8731 + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
1.8732 + complete: fn || !fn && easing ||
1.8733 + jQuery.isFunction( speed ) && speed,
1.8734 + duration: speed,
1.8735 + easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
1.8736 + };
1.8737 +
1.8738 + opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
1.8739 + opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
1.8740 +
1.8741 + // normalize opt.queue - true/undefined/null -> "fx"
1.8742 + if ( opt.queue == null || opt.queue === true ) {
1.8743 + opt.queue = "fx";
1.8744 + }
1.8745 +
1.8746 + // Queueing
1.8747 + opt.old = opt.complete;
1.8748 +
1.8749 + opt.complete = function( noUnmark ) {
1.8750 + if ( jQuery.isFunction( opt.old ) ) {
1.8751 + opt.old.call( this );
1.8752 + }
1.8753 +
1.8754 + if ( opt.queue ) {
1.8755 + jQuery.dequeue( this, opt.queue );
1.8756 + } else if ( noUnmark !== false ) {
1.8757 + jQuery._unmark( this );
1.8758 + }
1.8759 + };
1.8760 +
1.8761 + return opt;
1.8762 + },
1.8763 +
1.8764 + easing: {
1.8765 + linear: function( p ) {
1.8766 + return p;
1.8767 + },
1.8768 + swing: function( p ) {
1.8769 + return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5;
1.8770 + }
1.8771 + },
1.8772 +
1.8773 + timers: [],
1.8774 +
1.8775 + fx: function( elem, options, prop ) {
1.8776 + this.options = options;
1.8777 + this.elem = elem;
1.8778 + this.prop = prop;
1.8779 +
1.8780 + options.orig = options.orig || {};
1.8781 + }
1.8782 +
1.8783 +});
1.8784 +
1.8785 +jQuery.fx.prototype = {
1.8786 + // Simple function for setting a style value
1.8787 + update: function() {
1.8788 + if ( this.options.step ) {
1.8789 + this.options.step.call( this.elem, this.now, this );
1.8790 + }
1.8791 +
1.8792 + ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
1.8793 + },
1.8794 +
1.8795 + // Get the current size
1.8796 + cur: function() {
1.8797 + if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
1.8798 + return this.elem[ this.prop ];
1.8799 + }
1.8800 +
1.8801 + var parsed,
1.8802 + r = jQuery.css( this.elem, this.prop );
1.8803 + // Empty strings, null, undefined and "auto" are converted to 0,
1.8804 + // complex values such as "rotate(1rad)" are returned as is,
1.8805 + // simple values such as "10px" are parsed to Float.
1.8806 + return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
1.8807 + },
1.8808 +
1.8809 + // Start an animation from one number to another
1.8810 + custom: function( from, to, unit ) {
1.8811 + var self = this,
1.8812 + fx = jQuery.fx;
1.8813 +
1.8814 + this.startTime = fxNow || createFxNow();
1.8815 + this.end = to;
1.8816 + this.now = this.start = from;
1.8817 + this.pos = this.state = 0;
1.8818 + this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
1.8819 +
1.8820 + function t( gotoEnd ) {
1.8821 + return self.step( gotoEnd );
1.8822 + }
1.8823 +
1.8824 + t.queue = this.options.queue;
1.8825 + t.elem = this.elem;
1.8826 + t.saveState = function() {
1.8827 + if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
1.8828 + if ( self.options.hide ) {
1.8829 + jQuery._data( self.elem, "fxshow" + self.prop, self.start );
1.8830 + } else if ( self.options.show ) {
1.8831 + jQuery._data( self.elem, "fxshow" + self.prop, self.end );
1.8832 + }
1.8833 + }
1.8834 + };
1.8835 +
1.8836 + if ( t() && jQuery.timers.push(t) && !timerId ) {
1.8837 + timerId = setInterval( fx.tick, fx.interval );
1.8838 + }
1.8839 + },
1.8840 +
1.8841 + // Simple 'show' function
1.8842 + show: function() {
1.8843 + var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
1.8844 +
1.8845 + // Remember where we started, so that we can go back to it later
1.8846 + this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
1.8847 + this.options.show = true;
1.8848 +
1.8849 + // Begin the animation
1.8850 + // Make sure that we start at a small width/height to avoid any flash of content
1.8851 + if ( dataShow !== undefined ) {
1.8852 + // This show is picking up where a previous hide or show left off
1.8853 + this.custom( this.cur(), dataShow );
1.8854 + } else {
1.8855 + this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
1.8856 + }
1.8857 +
1.8858 + // Start by showing the element
1.8859 + jQuery( this.elem ).show();
1.8860 + },
1.8861 +
1.8862 + // Simple 'hide' function
1.8863 + hide: function() {
1.8864 + // Remember where we started, so that we can go back to it later
1.8865 + this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
1.8866 + this.options.hide = true;
1.8867 +
1.8868 + // Begin the animation
1.8869 + this.custom( this.cur(), 0 );
1.8870 + },
1.8871 +
1.8872 + // Each step of an animation
1.8873 + step: function( gotoEnd ) {
1.8874 + var p, n, complete,
1.8875 + t = fxNow || createFxNow(),
1.8876 + done = true,
1.8877 + elem = this.elem,
1.8878 + options = this.options;
1.8879 +
1.8880 + if ( gotoEnd || t >= options.duration + this.startTime ) {
1.8881 + this.now = this.end;
1.8882 + this.pos = this.state = 1;
1.8883 + this.update();
1.8884 +
1.8885 + options.animatedProperties[ this.prop ] = true;
1.8886 +
1.8887 + for ( p in options.animatedProperties ) {
1.8888 + if ( options.animatedProperties[ p ] !== true ) {
1.8889 + done = false;
1.8890 + }
1.8891 + }
1.8892 +
1.8893 + if ( done ) {
1.8894 + // Reset the overflow
1.8895 + if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
1.8896 +
1.8897 + jQuery.each( [ "", "X", "Y" ], function( index, value ) {
1.8898 + elem.style[ "overflow" + value ] = options.overflow[ index ];
1.8899 + });
1.8900 + }
1.8901 +
1.8902 + // Hide the element if the "hide" operation was done
1.8903 + if ( options.hide ) {
1.8904 + jQuery( elem ).hide();
1.8905 + }
1.8906 +
1.8907 + // Reset the properties, if the item has been hidden or shown
1.8908 + if ( options.hide || options.show ) {
1.8909 + for ( p in options.animatedProperties ) {
1.8910 + jQuery.style( elem, p, options.orig[ p ] );
1.8911 + jQuery.removeData( elem, "fxshow" + p, true );
1.8912 + // Toggle data is no longer needed
1.8913 + jQuery.removeData( elem, "toggle" + p, true );
1.8914 + }
1.8915 + }
1.8916 +
1.8917 + // Execute the complete function
1.8918 + // in the event that the complete function throws an exception
1.8919 + // we must ensure it won't be called twice. #5684
1.8920 +
1.8921 + complete = options.complete;
1.8922 + if ( complete ) {
1.8923 +
1.8924 + options.complete = false;
1.8925 + complete.call( elem );
1.8926 + }
1.8927 + }
1.8928 +
1.8929 + return false;
1.8930 +
1.8931 + } else {
1.8932 + // classical easing cannot be used with an Infinity duration
1.8933 + if ( options.duration == Infinity ) {
1.8934 + this.now = t;
1.8935 + } else {
1.8936 + n = t - this.startTime;
1.8937 + this.state = n / options.duration;
1.8938 +
1.8939 + // Perform the easing function, defaults to swing
1.8940 + this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
1.8941 + this.now = this.start + ( (this.end - this.start) * this.pos );
1.8942 + }
1.8943 + // Perform the next step of the animation
1.8944 + this.update();
1.8945 + }
1.8946 +
1.8947 + return true;
1.8948 + }
1.8949 +};
1.8950 +
1.8951 +jQuery.extend( jQuery.fx, {
1.8952 + tick: function() {
1.8953 + var timer,
1.8954 + timers = jQuery.timers,
1.8955 + i = 0;
1.8956 +
1.8957 + for ( ; i < timers.length; i++ ) {
1.8958 + timer = timers[ i ];
1.8959 + // Checks the timer has not already been removed
1.8960 + if ( !timer() && timers[ i ] === timer ) {
1.8961 + timers.splice( i--, 1 );
1.8962 + }
1.8963 + }
1.8964 +
1.8965 + if ( !timers.length ) {
1.8966 + jQuery.fx.stop();
1.8967 + }
1.8968 + },
1.8969 +
1.8970 + interval: 13,
1.8971 +
1.8972 + stop: function() {
1.8973 + clearInterval( timerId );
1.8974 + timerId = null;
1.8975 + },
1.8976 +
1.8977 + speeds: {
1.8978 + slow: 600,
1.8979 + fast: 200,
1.8980 + // Default speed
1.8981 + _default: 400
1.8982 + },
1.8983 +
1.8984 + step: {
1.8985 + opacity: function( fx ) {
1.8986 + jQuery.style( fx.elem, "opacity", fx.now );
1.8987 + },
1.8988 +
1.8989 + _default: function( fx ) {
1.8990 + if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
1.8991 + fx.elem.style[ fx.prop ] = fx.now + fx.unit;
1.8992 + } else {
1.8993 + fx.elem[ fx.prop ] = fx.now;
1.8994 + }
1.8995 + }
1.8996 + }
1.8997 +});
1.8998 +
1.8999 +// Ensure props that can't be negative don't go there on undershoot easing
1.9000 +jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
1.9001 + // exclude marginTop, marginLeft, marginBottom and marginRight from this list
1.9002 + if ( prop.indexOf( "margin" ) ) {
1.9003 + jQuery.fx.step[ prop ] = function( fx ) {
1.9004 + jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
1.9005 + };
1.9006 + }
1.9007 +});
1.9008 +
1.9009 +if ( jQuery.expr && jQuery.expr.filters ) {
1.9010 + jQuery.expr.filters.animated = function( elem ) {
1.9011 + return jQuery.grep(jQuery.timers, function( fn ) {
1.9012 + return elem === fn.elem;
1.9013 + }).length;
1.9014 + };
1.9015 +}
1.9016 +
1.9017 +// Try to restore the default display value of an element
1.9018 +function defaultDisplay( nodeName ) {
1.9019 +
1.9020 + if ( !elemdisplay[ nodeName ] ) {
1.9021 +
1.9022 + var body = document.body,
1.9023 + elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
1.9024 + display = elem.css( "display" );
1.9025 + elem.remove();
1.9026 +
1.9027 + // If the simple way fails,
1.9028 + // get element's real default display by attaching it to a temp iframe
1.9029 + if ( display === "none" || display === "" ) {
1.9030 + // No iframe to use yet, so create it
1.9031 + if ( !iframe ) {
1.9032 + iframe = document.createElement( "iframe" );
1.9033 + iframe.frameBorder = iframe.width = iframe.height = 0;
1.9034 + }
1.9035 +
1.9036 + body.appendChild( iframe );
1.9037 +
1.9038 + // Create a cacheable copy of the iframe document on first call.
1.9039 + // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
1.9040 + // document to it; WebKit & Firefox won't allow reusing the iframe document.
1.9041 + if ( !iframeDoc || !iframe.createElement ) {
1.9042 + iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
1.9043 + iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" );
1.9044 + iframeDoc.close();
1.9045 + }
1.9046 +
1.9047 + elem = iframeDoc.createElement( nodeName );
1.9048 +
1.9049 + iframeDoc.body.appendChild( elem );
1.9050 +
1.9051 + display = jQuery.css( elem, "display" );
1.9052 + body.removeChild( iframe );
1.9053 + }
1.9054 +
1.9055 + // Store the correct default display
1.9056 + elemdisplay[ nodeName ] = display;
1.9057 + }
1.9058 +
1.9059 + return elemdisplay[ nodeName ];
1.9060 +}
1.9061 +
1.9062 +
1.9063 +
1.9064 +
1.9065 +var getOffset,
1.9066 + rtable = /^t(?:able|d|h)$/i,
1.9067 + rroot = /^(?:body|html)$/i;
1.9068 +
1.9069 +if ( "getBoundingClientRect" in document.documentElement ) {
1.9070 + getOffset = function( elem, doc, docElem, box ) {
1.9071 + try {
1.9072 + box = elem.getBoundingClientRect();
1.9073 + } catch(e) {}
1.9074 +
1.9075 + // Make sure we're not dealing with a disconnected DOM node
1.9076 + if ( !box || !jQuery.contains( docElem, elem ) ) {
1.9077 + return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
1.9078 + }
1.9079 +
1.9080 + var body = doc.body,
1.9081 + win = getWindow( doc ),
1.9082 + clientTop = docElem.clientTop || body.clientTop || 0,
1.9083 + clientLeft = docElem.clientLeft || body.clientLeft || 0,
1.9084 + scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
1.9085 + scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
1.9086 + top = box.top + scrollTop - clientTop,
1.9087 + left = box.left + scrollLeft - clientLeft;
1.9088 +
1.9089 + return { top: top, left: left };
1.9090 + };
1.9091 +
1.9092 +} else {
1.9093 + getOffset = function( elem, doc, docElem ) {
1.9094 + var computedStyle,
1.9095 + offsetParent = elem.offsetParent,
1.9096 + prevOffsetParent = elem,
1.9097 + body = doc.body,
1.9098 + defaultView = doc.defaultView,
1.9099 + prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
1.9100 + top = elem.offsetTop,
1.9101 + left = elem.offsetLeft;
1.9102 +
1.9103 + while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
1.9104 + if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
1.9105 + break;
1.9106 + }
1.9107 +
1.9108 + computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
1.9109 + top -= elem.scrollTop;
1.9110 + left -= elem.scrollLeft;
1.9111 +
1.9112 + if ( elem === offsetParent ) {
1.9113 + top += elem.offsetTop;
1.9114 + left += elem.offsetLeft;
1.9115 +
1.9116 + if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
1.9117 + top += parseFloat( computedStyle.borderTopWidth ) || 0;
1.9118 + left += parseFloat( computedStyle.borderLeftWidth ) || 0;
1.9119 + }
1.9120 +
1.9121 + prevOffsetParent = offsetParent;
1.9122 + offsetParent = elem.offsetParent;
1.9123 + }
1.9124 +
1.9125 + if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
1.9126 + top += parseFloat( computedStyle.borderTopWidth ) || 0;
1.9127 + left += parseFloat( computedStyle.borderLeftWidth ) || 0;
1.9128 + }
1.9129 +
1.9130 + prevComputedStyle = computedStyle;
1.9131 + }
1.9132 +
1.9133 + if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
1.9134 + top += body.offsetTop;
1.9135 + left += body.offsetLeft;
1.9136 + }
1.9137 +
1.9138 + if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
1.9139 + top += Math.max( docElem.scrollTop, body.scrollTop );
1.9140 + left += Math.max( docElem.scrollLeft, body.scrollLeft );
1.9141 + }
1.9142 +
1.9143 + return { top: top, left: left };
1.9144 + };
1.9145 +}
1.9146 +
1.9147 +jQuery.fn.offset = function( options ) {
1.9148 + if ( arguments.length ) {
1.9149 + return options === undefined ?
1.9150 + this :
1.9151 + this.each(function( i ) {
1.9152 + jQuery.offset.setOffset( this, options, i );
1.9153 + });
1.9154 + }
1.9155 +
1.9156 + var elem = this[0],
1.9157 + doc = elem && elem.ownerDocument;
1.9158 +
1.9159 + if ( !doc ) {
1.9160 + return null;
1.9161 + }
1.9162 +
1.9163 + if ( elem === doc.body ) {
1.9164 + return jQuery.offset.bodyOffset( elem );
1.9165 + }
1.9166 +
1.9167 + return getOffset( elem, doc, doc.documentElement );
1.9168 +};
1.9169 +
1.9170 +jQuery.offset = {
1.9171 +
1.9172 + bodyOffset: function( body ) {
1.9173 + var top = body.offsetTop,
1.9174 + left = body.offsetLeft;
1.9175 +
1.9176 + if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
1.9177 + top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
1.9178 + left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
1.9179 + }
1.9180 +
1.9181 + return { top: top, left: left };
1.9182 + },
1.9183 +
1.9184 + setOffset: function( elem, options, i ) {
1.9185 + var position = jQuery.css( elem, "position" );
1.9186 +
1.9187 + // set position first, in-case top/left are set even on static elem
1.9188 + if ( position === "static" ) {
1.9189 + elem.style.position = "relative";
1.9190 + }
1.9191 +
1.9192 + var curElem = jQuery( elem ),
1.9193 + curOffset = curElem.offset(),
1.9194 + curCSSTop = jQuery.css( elem, "top" ),
1.9195 + curCSSLeft = jQuery.css( elem, "left" ),
1.9196 + calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
1.9197 + props = {}, curPosition = {}, curTop, curLeft;
1.9198 +
1.9199 + // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
1.9200 + if ( calculatePosition ) {
1.9201 + curPosition = curElem.position();
1.9202 + curTop = curPosition.top;
1.9203 + curLeft = curPosition.left;
1.9204 + } else {
1.9205 + curTop = parseFloat( curCSSTop ) || 0;
1.9206 + curLeft = parseFloat( curCSSLeft ) || 0;
1.9207 + }
1.9208 +
1.9209 + if ( jQuery.isFunction( options ) ) {
1.9210 + options = options.call( elem, i, curOffset );
1.9211 + }
1.9212 +
1.9213 + if ( options.top != null ) {
1.9214 + props.top = ( options.top - curOffset.top ) + curTop;
1.9215 + }
1.9216 + if ( options.left != null ) {
1.9217 + props.left = ( options.left - curOffset.left ) + curLeft;
1.9218 + }
1.9219 +
1.9220 + if ( "using" in options ) {
1.9221 + options.using.call( elem, props );
1.9222 + } else {
1.9223 + curElem.css( props );
1.9224 + }
1.9225 + }
1.9226 +};
1.9227 +
1.9228 +
1.9229 +jQuery.fn.extend({
1.9230 +
1.9231 + position: function() {
1.9232 + if ( !this[0] ) {
1.9233 + return null;
1.9234 + }
1.9235 +
1.9236 + var elem = this[0],
1.9237 +
1.9238 + // Get *real* offsetParent
1.9239 + offsetParent = this.offsetParent(),
1.9240 +
1.9241 + // Get correct offsets
1.9242 + offset = this.offset(),
1.9243 + parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
1.9244 +
1.9245 + // Subtract element margins
1.9246 + // note: when an element has margin: auto the offsetLeft and marginLeft
1.9247 + // are the same in Safari causing offset.left to incorrectly be 0
1.9248 + offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
1.9249 + offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
1.9250 +
1.9251 + // Add offsetParent borders
1.9252 + parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
1.9253 + parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
1.9254 +
1.9255 + // Subtract the two offsets
1.9256 + return {
1.9257 + top: offset.top - parentOffset.top,
1.9258 + left: offset.left - parentOffset.left
1.9259 + };
1.9260 + },
1.9261 +
1.9262 + offsetParent: function() {
1.9263 + return this.map(function() {
1.9264 + var offsetParent = this.offsetParent || document.body;
1.9265 + while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
1.9266 + offsetParent = offsetParent.offsetParent;
1.9267 + }
1.9268 + return offsetParent;
1.9269 + });
1.9270 + }
1.9271 +});
1.9272 +
1.9273 +
1.9274 +// Create scrollLeft and scrollTop methods
1.9275 +jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
1.9276 + var top = /Y/.test( prop );
1.9277 +
1.9278 + jQuery.fn[ method ] = function( val ) {
1.9279 + return jQuery.access( this, function( elem, method, val ) {
1.9280 + var win = getWindow( elem );
1.9281 +
1.9282 + if ( val === undefined ) {
1.9283 + return win ? (prop in win) ? win[ prop ] :
1.9284 + jQuery.support.boxModel && win.document.documentElement[ method ] ||
1.9285 + win.document.body[ method ] :
1.9286 + elem[ method ];
1.9287 + }
1.9288 +
1.9289 + if ( win ) {
1.9290 + win.scrollTo(
1.9291 + !top ? val : jQuery( win ).scrollLeft(),
1.9292 + top ? val : jQuery( win ).scrollTop()
1.9293 + );
1.9294 +
1.9295 + } else {
1.9296 + elem[ method ] = val;
1.9297 + }
1.9298 + }, method, val, arguments.length, null );
1.9299 + };
1.9300 +});
1.9301 +
1.9302 +function getWindow( elem ) {
1.9303 + return jQuery.isWindow( elem ) ?
1.9304 + elem :
1.9305 + elem.nodeType === 9 ?
1.9306 + elem.defaultView || elem.parentWindow :
1.9307 + false;
1.9308 +}
1.9309 +
1.9310 +
1.9311 +
1.9312 +
1.9313 +// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
1.9314 +jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
1.9315 + var clientProp = "client" + name,
1.9316 + scrollProp = "scroll" + name,
1.9317 + offsetProp = "offset" + name;
1.9318 +
1.9319 + // innerHeight and innerWidth
1.9320 + jQuery.fn[ "inner" + name ] = function() {
1.9321 + var elem = this[0];
1.9322 + return elem ?
1.9323 + elem.style ?
1.9324 + parseFloat( jQuery.css( elem, type, "padding" ) ) :
1.9325 + this[ type ]() :
1.9326 + null;
1.9327 + };
1.9328 +
1.9329 + // outerHeight and outerWidth
1.9330 + jQuery.fn[ "outer" + name ] = function( margin ) {
1.9331 + var elem = this[0];
1.9332 + return elem ?
1.9333 + elem.style ?
1.9334 + parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
1.9335 + this[ type ]() :
1.9336 + null;
1.9337 + };
1.9338 +
1.9339 + jQuery.fn[ type ] = function( value ) {
1.9340 + return jQuery.access( this, function( elem, type, value ) {
1.9341 + var doc, docElemProp, orig, ret;
1.9342 +
1.9343 + if ( jQuery.isWindow( elem ) ) {
1.9344 + // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
1.9345 + doc = elem.document;
1.9346 + docElemProp = doc.documentElement[ clientProp ];
1.9347 + return jQuery.support.boxModel && docElemProp ||
1.9348 + doc.body && doc.body[ clientProp ] || docElemProp;
1.9349 + }
1.9350 +
1.9351 + // Get document width or height
1.9352 + if ( elem.nodeType === 9 ) {
1.9353 + // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
1.9354 + doc = elem.documentElement;
1.9355 +
1.9356 + // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height]
1.9357 + // so we can't use max, as it'll choose the incorrect offset[Width/Height]
1.9358 + // instead we use the correct client[Width/Height]
1.9359 + // support:IE6
1.9360 + if ( doc[ clientProp ] >= doc[ scrollProp ] ) {
1.9361 + return doc[ clientProp ];
1.9362 + }
1.9363 +
1.9364 + return Math.max(
1.9365 + elem.body[ scrollProp ], doc[ scrollProp ],
1.9366 + elem.body[ offsetProp ], doc[ offsetProp ]
1.9367 + );
1.9368 + }
1.9369 +
1.9370 + // Get width or height on the element
1.9371 + if ( value === undefined ) {
1.9372 + orig = jQuery.css( elem, type );
1.9373 + ret = parseFloat( orig );
1.9374 + return jQuery.isNumeric( ret ) ? ret : orig;
1.9375 + }
1.9376 +
1.9377 + // Set the width or height on the element
1.9378 + jQuery( elem ).css( type, value );
1.9379 + }, type, value, arguments.length, null );
1.9380 + };
1.9381 +});
1.9382 +
1.9383 +
1.9384 +
1.9385 +
1.9386 +// Expose jQuery to the global object
1.9387 +window.jQuery = window.$ = jQuery;
1.9388 +
1.9389 +// Expose jQuery as an AMD module, but only for AMD loaders that
1.9390 +// understand the issues with loading multiple versions of jQuery
1.9391 +// in a page that all might call define(). The loader will indicate
1.9392 +// they have special allowances for multiple jQuery versions by
1.9393 +// specifying define.amd.jQuery = true. Register as a named module,
1.9394 +// since jQuery can be concatenated with other files that may use define,
1.9395 +// but not use a proper concatenation script that understands anonymous
1.9396 +// AMD modules. A named AMD is safest and most robust way to register.
1.9397 +// Lowercase jquery is used because AMD module names are derived from
1.9398 +// file names, and jQuery is normally delivered in a lowercase file name.
1.9399 +// Do this after creating the global so that if an AMD module wants to call
1.9400 +// noConflict to hide this version of jQuery, it will work.
1.9401 +if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
1.9402 + define( "jquery", [], function () { return jQuery; } );
1.9403 +}
1.9404 +
1.9405 +
1.9406 +
1.9407 +})( window );