@@ -1,4 +1,4 @@
define([
define( [
"./core",
"./var/document",
"./var/rcssNum",
@@ -34,9 +34,9 @@ function raf() {

// Animations created synchronously will run synchronously
function createFxNow() {
window.setTimeout(function() {
window.setTimeout( function() {
fxNow = undefined;
});
} );
return ( fxNow = jQuery.now() );
}

@@ -67,7 +67,7 @@ function createTween( value, prop, animation ) {
index = 0,
length = collection.length;
for ( ; index < length; index++ ) {
if ( (tween = collection[ index ].call( animation, prop, value )) ) {
if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {

// We're done with this property
return tween;
@@ -99,15 +99,16 @@ function defaultPrefilter( elem, props, opts ) {
}
hooks.unqueued++;

anim.always(function() {
anim.always( function() {

// Ensure the complete handler is called before this completes
anim.always(function() {
anim.always( function() {
hooks.unqueued--;
if ( !jQuery.queue( elem, "fx" ).length ) {
hooks.empty.fire();
}
});
});
} );
} );
}

// Detect show/hide animations
@@ -140,6 +141,7 @@ function defaultPrefilter( elem, props, opts ) {

// Restrict "overflow" and "display" styles during box animations
if ( isBox && elem.nodeType === 1 ) {

// Support: IE 9 - 11
// Record all 3 overflow attributes because IE does not infer the shorthand
// from identically-valued overflowX and overflowY
@@ -163,9 +165,9 @@ function defaultPrefilter( elem, props, opts ) {

// Restore the original display value at the end of pure show/hide animations
if ( !propTween ) {
anim.done(function() {
anim.done( function() {
style.display = restoreDisplay;
});
} );
if ( restoreDisplay == null ) {
display = style.display;
restoreDisplay = display === "none" ? "" : display;
@@ -178,11 +180,11 @@ function defaultPrefilter( elem, props, opts ) {

if ( opts.overflow ) {
style.overflow = "hidden";
anim.always(function() {
anim.always( function() {
style.overflow = opts.overflow[ 0 ];
style.overflowX = opts.overflow[ 1 ];
style.overflowY = opts.overflow[ 2 ];
});
} );
}

// Implement show/hide animations
@@ -210,7 +212,8 @@ function defaultPrefilter( elem, props, opts ) {
}

/* jshint -W083 */
anim.done(function() {
anim.done( function() {

// The final step of a "hide" animation is actually hiding the element
if ( !hidden ) {
showHide( [ elem ] );
@@ -219,7 +222,7 @@ function defaultPrefilter( elem, props, opts ) {
for ( prop in orig ) {
jQuery.style( elem, prop, orig[ prop ] );
}
});
} );
}

// Per-property setup
@@ -277,15 +280,17 @@ function Animation( elem, properties, options ) {
index = 0,
length = Animation.prefilters.length,
deferred = jQuery.Deferred().always( function() {

// Don't match elem in the :animated selector
delete tick.elem;
}),
} ),
tick = function() {
if ( stopped ) {
return false;
}
var currentTime = fxNow || createFxNow(),
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),

// Support: Android 2.3
// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
temp = remaining / animation.duration || 0,
@@ -297,7 +302,7 @@ function Animation( elem, properties, options ) {
animation.tweens[ index ].run( percent );
}

deferred.notifyWith( elem, [ animation, percent, remaining ]);
deferred.notifyWith( elem, [ animation, percent, remaining ] );

if ( percent < 1 && length ) {
return remaining;
@@ -306,7 +311,7 @@ function Animation( elem, properties, options ) {
return false;
}
},
animation = deferred.promise({
animation = deferred.promise( {
elem: elem,
props: jQuery.extend( {}, properties ),
opts: jQuery.extend( true, {
@@ -326,6 +331,7 @@ function Animation( elem, properties, options ) {
},
stop: function( gotoEnd ) {
var index = 0,

// If we are going to the end, we want to run all the tweens
// otherwise we skip this part
length = gotoEnd ? animation.tweens.length : 0;
@@ -345,7 +351,7 @@ function Animation( elem, properties, options ) {
}
return this;
}
}),
} ),
props = animation.props;

propFilter( props, animation.opts.specialEasing );
@@ -372,7 +378,7 @@ function Animation( elem, properties, options ) {
elem: elem,
anim: animation,
queue: animation.opts.queue
})
} )
);

// attach callbacks from options
@@ -420,7 +426,7 @@ jQuery.Animation = jQuery.extend( Animation, {
Animation.prefilters.push( callback );
}
}
});
} );

jQuery.speed = function( speed, easing, fn ) {
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
@@ -461,19 +467,20 @@ jQuery.speed = function( speed, easing, fn ) {
return opt;
};

jQuery.fn.extend({
jQuery.fn.extend( {
fadeTo: function( speed, to, easing, callback ) {

// Show any hidden elements after setting opacity to 0
return this.filter( isHidden ).css( "opacity", 0 ).show()

// Animate to the value specified
.end().animate({ opacity: to }, speed, easing, callback );
.end().animate( { opacity: to }, speed, easing, callback );
},
animate: function( prop, speed, easing, callback ) {
var empty = jQuery.isEmptyObject( prop ),
optall = jQuery.speed( speed, easing, callback ),
doAnimation = function() {

// Operate on a copy of prop so per-property easing won't be lost
var anim = Animation( this, jQuery.extend( {}, prop ), optall );

@@ -504,7 +511,7 @@ jQuery.fn.extend({
this.queue( type || "fx", [] );
}

return this.each(function() {
return this.each( function() {
var dequeue = true,
index = type != null && type + "queueHooks",
timers = jQuery.timers,
@@ -524,7 +531,7 @@ jQuery.fn.extend({

for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this &&
(type == null || timers[ index ].queue === type) ) {
( type == null || timers[ index ].queue === type ) ) {

timers[ index ].anim.stop( gotoEnd );
dequeue = false;
@@ -538,13 +545,13 @@ jQuery.fn.extend({
if ( dequeue || !gotoEnd ) {
jQuery.dequeue( this, type );
}
});
} );
},
finish: function( type ) {
if ( type !== false ) {
type = type || "fx";
}
return this.each(function() {
return this.each( function() {
var index,
data = dataPriv.get( this ),
queue = data[ type + "queue" ],
@@ -579,32 +586,32 @@ jQuery.fn.extend({

// Turn off finishing flag
delete data.finish;
});
} );
}
});
} );

jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
var cssFn = jQuery.fn[ name ];
jQuery.fn[ name ] = function( speed, easing, callback ) {
return speed == null || typeof speed === "boolean" ?
cssFn.apply( this, arguments ) :
this.animate( genFx( name, true ), speed, easing, callback );
};
});
} );

// Generate shortcuts for custom animations
jQuery.each({
slideDown: genFx("show"),
slideUp: genFx("hide"),
slideToggle: genFx("toggle"),
jQuery.each( {
slideDown: genFx( "show" ),
slideUp: genFx( "hide" ),
slideToggle: genFx( "toggle" ),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" },
fadeToggle: { opacity: "toggle" }
}, function( name, props ) {
jQuery.fn[ name ] = function( speed, easing, callback ) {
return this.animate( props, speed, easing, callback );
};
});
} );

jQuery.timers = [];
jQuery.fx.tick = function() {
@@ -616,6 +623,7 @@ jQuery.fx.tick = function() {

for ( ; i < timers.length; i++ ) {
timer = timers[ i ];

// Checks the timer has not already been removed
if ( !timer() && timers[ i ] === timer ) {
timers.splice( i--, 1 );
@@ -659,9 +667,10 @@ jQuery.fx.stop = function() {
jQuery.fx.speeds = {
slow: 600,
fast: 200,

// Default speed
_default: 400
};

return jQuery;
});
} );
@@ -1,4 +1,4 @@
define([
define( [
"../core",
"../css"
], function( jQuery ) {
@@ -71,10 +71,12 @@ Tween.propHooks = {
// Simple values such as "10px" are parsed to Float;
// complex values such as "rotate(1rad)" are returned as-is.
result = jQuery.css( tween.elem, tween.prop, "" );

// Empty strings, null, undefined and "auto" are converted to 0.
return !result || result === "auto" ? 0 : result;
},
set: function( tween ) {

// Use step hook for back compat.
// Use cssHook if its there.
// Use .style if available and use plain properties where available.
@@ -116,4 +118,4 @@ jQuery.fx = Tween.prototype.init;
// Back Compat <1.8 extension point
jQuery.fx.step = {};

});
} );
@@ -1,13 +1,13 @@
define([
define( [
"../core",
"../selector",
"../effects"
], function( jQuery ) {

jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return jQuery.grep( jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
} ).length;
};

});
} );

Large diffs are not rendered by default.

@@ -1,10 +1,10 @@
define([
define( [
"../core",
"../event"
], function( jQuery ) {

// Attach a bunch of functions for handling common AJAX events
jQuery.each([
jQuery.each( [
"ajaxStart",
"ajaxStop",
"ajaxComplete",
@@ -15,6 +15,6 @@ jQuery.each([
jQuery.fn[ type ] = function( fn ) {
return this.on( type, fn );
};
});
} );

});
} );
@@ -1,11 +1,11 @@
define([
define( [
"../core",
"../event"
], function( jQuery ) {

jQuery.each( ("blur focus focusin focusout resize scroll click dblclick " +
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup contextmenu").split(" "),
"change select submit keydown keypress keyup contextmenu" ).split( " " ),
function( i, name ) {

// Handle event binding
@@ -14,9 +14,9 @@ jQuery.each( ("blur focus focusin focusout resize scroll click dblclick " +
this.on( name, null, data, fn ) :
this.trigger( name );
};
});
} );

jQuery.fn.extend({
jQuery.fn.extend( {
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
},
@@ -32,11 +32,12 @@ jQuery.fn.extend({
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {

// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
}
});
} );

});
} );
@@ -1,9 +1,9 @@
define([
define( [
"../var/support"
], function( support ) {

support.focusin = "onfocusin" in window;

return support;

});
} );
@@ -1,4 +1,4 @@
define([
define( [
"../core"
], function( jQuery ) {

@@ -18,7 +18,7 @@ define([
if ( typeof define === "function" && define.amd ) {
define( "jquery", [], function() {
return jQuery;
});
} );
}

});
} );
@@ -1,4 +1,5 @@
var

// Map over jQuery in case of overwrite
_jQuery = window.jQuery,

@@ -1,4 +1,4 @@
define([
define( [
"./core",
"./selector",
"./traversing",
@@ -31,6 +31,6 @@ define([
"./exports/amd"
], function( jQuery ) {

return (window.jQuery = window.$ = jQuery);
return ( window.jQuery = window.$ = jQuery );

});
} );
@@ -1,4 +1,4 @@
define([
define( [
"./core",
"./var/concat",
"./var/push",
@@ -28,6 +28,7 @@ define([
var
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
rnoInnerhtml = /<(?:script|style|link)/i,

// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptTypeMasked = /^true\/(.*)/,
@@ -45,7 +46,7 @@ function manipulationTarget( elem, content ) {

// Replace/restore the type attribute of script elements for safe DOM manipulation
function disableScript( elem ) {
elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
return elem;
}
function restoreScript( elem ) {
@@ -54,7 +55,7 @@ function restoreScript( elem ) {
if ( match ) {
elem.type = match[ 1 ];
} else {
elem.removeAttribute("type");
elem.removeAttribute( "type" );
}

return elem;
@@ -124,13 +125,13 @@ function domManip( collection, args, callback, ignored ) {
if ( isFunction ||
( l > 1 && typeof value === "string" &&
!support.checkClone && rchecked.test( value ) ) ) {
return collection.each(function( index ) {
return collection.each( function( index ) {
var self = collection.eq( index );
if ( isFunction ) {
args[ 0 ] = value.call( this, index, self.html() );
}
domManip( self, args, callback, ignored );
});
} );
}

if ( l ) {
@@ -157,6 +158,7 @@ function domManip( collection, args, callback, ignored ) {

// Keep references to cloned scripts for later restoration
if ( hasScripts ) {

// Support: Android<4.1, PhantomJS<2
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( scripts, getAll( node, "script" ) );
@@ -180,6 +182,7 @@ function domManip( collection, args, callback, ignored ) {
jQuery.contains( doc, node ) ) {

if ( node.src ) {

// Optional AJAX dependency, but won't run scripts if not present
if ( jQuery._evalUrl ) {
jQuery._evalUrl( node.src );
@@ -201,7 +204,7 @@ function remove( elem, selector, keepData ) {
nodes = selector ? jQuery.filter( selector, elem ) : elem,
i = 0;

for ( ; (node = nodes[i]) != null; i++ ) {
for ( ; ( node = nodes[ i ] ) != null; i++ ) {
if ( !keepData && node.nodeType === 1 ) {
jQuery.cleanData( getAll( node ) );
}
@@ -217,7 +220,7 @@ function remove( elem, selector, keepData ) {
return elem;
}

jQuery.extend({
jQuery.extend( {
htmlPrefilter: function( html ) {
return html.replace( rxhtmlTag, "<$1></$2>" );
},
@@ -269,9 +272,9 @@ jQuery.extend({
special = jQuery.event.special,
i = 0;

for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
if ( jQuery.acceptData( elem ) ) {
if ( (data = elem[ dataPriv.expando ] ) ) {
if ( ( data = elem[ dataPriv.expando ] ) ) {
if ( data.events ) {
for ( type in data.events ) {
if ( special[ type ] ) {
@@ -291,9 +294,9 @@ jQuery.extend({
}
}
}
});
} );

jQuery.fn.extend({
jQuery.fn.extend( {
detach: function( selector ) {
return remove( this, selector, true );
},
@@ -306,11 +309,11 @@ jQuery.fn.extend({
return access( this, function( value ) {
return value === undefined ?
jQuery.text( this ) :
this.empty().each(function() {
this.empty().each( function() {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.textContent = value;
}
});
} );
}, null, value, arguments.length );
},

@@ -320,7 +323,7 @@ jQuery.fn.extend({
var target = manipulationTarget( this, elem );
target.appendChild( elem );
}
});
} );
},

prepend: function() {
@@ -329,30 +332,30 @@ jQuery.fn.extend({
var target = manipulationTarget( this, elem );
target.insertBefore( elem, target.firstChild );
}
});
} );
},

before: function() {
return domManip( this, arguments, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this );
}
});
} );
},

after: function() {
return domManip( this, arguments, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this.nextSibling );
}
});
} );
},

empty: function() {
var elem,
i = 0;

for ( ; (elem = this[i]) != null; i++ ) {
for ( ; ( elem = this[ i ] ) != null; i++ ) {
if ( elem.nodeType === 1 ) {

// Prevent memory leaks
@@ -370,9 +373,9 @@ jQuery.fn.extend({
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;

return this.map(function() {
return this.map( function() {
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
});
} );
},

html: function( value ) {
@@ -431,9 +434,9 @@ jQuery.fn.extend({
// Force callback invocation
}, ignored );
}
});
} );

jQuery.each({
jQuery.each( {
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
@@ -458,7 +461,7 @@ jQuery.each({

return this.pushStack( ret );
};
});
} );

return jQuery;
});
} );
@@ -1,9 +1,9 @@
define([
define( [
"../ajax"
], function( jQuery ) {

jQuery._evalUrl = function( url ) {
return jQuery.ajax({
return jQuery.ajax( {
url: url,

// Make this explicit, since user can override this through ajaxSetup (#11264)
@@ -13,9 +13,9 @@ jQuery._evalUrl = function( url ) {
async: false,
global: false,
"throws": true
});
} );
};

return jQuery._evalUrl;

});
} );
@@ -1,4 +1,4 @@
define([
define( [
"../core",
"./var/rtagName",
"./var/rscriptType",
@@ -23,6 +23,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {

// Add nodes directly
if ( jQuery.type( elem ) === "object" ) {

// Support: Android<4.1, PhantomJS<2
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
@@ -98,4 +99,4 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
}

return buildFragment;
});
} );
@@ -1,8 +1,9 @@
define([
define( [
"../core"
], function( jQuery ) {

function getAll( context, tag ) {

// Support: IE9-11+
// Use typeof to avoid zero-argument method invocation on host objects (#15151)
var ret = typeof context.getElementsByTagName !== "undefined" ?
@@ -17,4 +18,4 @@ function getAll( context, tag ) {
}

return getAll;
});
} );
@@ -1,4 +1,4 @@
define([
define( [
"../data/var/dataPriv"
], function( dataPriv ) {

@@ -17,4 +17,4 @@ function setGlobalEval( elems, refElements ) {
}

return setGlobalEval;
});
} );
@@ -1,9 +1,9 @@
define([
define( [
"../var/document",
"../var/support"
], function( document, support ) {

(function() {
( function() {
var fragment = document.createDocumentFragment(),
div = fragment.appendChild( document.createElement( "div" ) ),
input = document.createElement( "input" );
@@ -26,8 +26,8 @@ define([
// Make sure textarea (and checkbox) defaultValue is properly cloned
div.innerHTML = "<textarea>x</textarea>";
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
})();
} )();

return support;

});
} );
@@ -1,3 +1,3 @@
define(function() {
return (/^(?:checkbox|radio)$/i);
});
define( function() {
return ( /^(?:checkbox|radio)$/i );
} );
@@ -1,3 +1,3 @@
define(function() {
define( function() {
return ( /^$|\/(?:java|ecma)script/i );
});
} );
@@ -1,3 +1,3 @@
define(function() {
define( function() {
return ( /<([\w:-]+)/ );
});
} );
@@ -1,4 +1,4 @@
define(function() {
define( function() {

// We have to close these tags to support XHTML (#13200)
var wrapMap = {
@@ -32,4 +32,4 @@ wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.the
wrapMap.th = wrapMap.td;

return wrapMap;
});
} );
@@ -1,4 +1,4 @@
define([
define( [
"./core",
"./core/access",
"./var/document",
@@ -36,7 +36,7 @@ jQuery.offset = {
curCSSTop = jQuery.css( elem, "top" );
curCSSLeft = jQuery.css( elem, "left" );
calculatePosition = ( position === "absolute" || position === "fixed" ) &&
( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;

// Need to be able to calculate position if either
// top or left is auto and position is either absolute or fixed
@@ -72,15 +72,16 @@ jQuery.offset = {
}
};

jQuery.fn.extend({
jQuery.fn.extend( {
offset: function( options ) {

// Preserve chaining for setter
if ( arguments.length ) {
return options === undefined ?
this :
this.each(function( i ) {
this.each( function( i ) {
jQuery.offset.setOffset( this, options, i );
});
} );
}

var docElem, win, rect, doc,
@@ -127,10 +128,12 @@ jQuery.fn.extend({
// Fixed elements are offset from window (parentOffset = {top:0, left: 0},
// because it is its only offset parent
if ( jQuery.css( elem, "position" ) === "fixed" ) {

// Assume getBoundingClientRect is there when computed position is fixed
offset = elem.getBoundingClientRect();

} else {

// Get *real* offsetParent
offsetParent = this.offsetParent();

@@ -166,17 +169,17 @@ jQuery.fn.extend({
//
// This logic, however, is not guaranteed and can change at any point in the future
offsetParent: function() {
return this.map(function() {
return this.map( function() {
var offsetParent = this.offsetParent;

while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
offsetParent = offsetParent.offsetParent;
}

return offsetParent || documentElement;
});
} );
}
});
} );

// Create scrollLeft and scrollTop methods
jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
@@ -201,7 +204,7 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
}
}, method, val, arguments.length, null );
};
});
} );

// Support: Safari<7-8+, Chrome<37-44+
// Add the top/left cssHooks using jQuery.fn.position
@@ -214,14 +217,15 @@ jQuery.each( [ "top", "left" ], function( i, prop ) {
function( elem, computed ) {
if ( computed ) {
computed = curCSS( elem, prop );

// If curCSS returns percentage, fallback to offset
return rnumnonpx.test( computed ) ?
jQuery( elem ).position()[ prop ] + "px" :
computed;
}
}
);
});
} );

return jQuery;
});
} );
@@ -1,11 +1,11 @@
define([
define( [
"./core",
"./data/var/dataPriv",
"./deferred",
"./callbacks"
], function( jQuery, dataPriv ) {

jQuery.extend({
jQuery.extend( {
queue: function( elem, type, data ) {
var queue;

@@ -16,7 +16,7 @@ jQuery.extend({
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
if ( !queue || jQuery.isArray( data ) ) {
queue = dataPriv.access( elem, type, jQuery.makeArray(data) );
queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
} else {
queue.push( data );
}
@@ -64,14 +64,14 @@ jQuery.extend({
_queueHooks: function( elem, type ) {
var key = type + "queueHooks";
return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
empty: jQuery.Callbacks("once memory").add(function() {
empty: jQuery.Callbacks( "once memory" ).add( function() {
dataPriv.remove( elem, [ type + "queue", key ] );
})
});
} )
} );
}
});
} );

jQuery.fn.extend({
jQuery.fn.extend( {
queue: function( type, data ) {
var setter = 2;

@@ -82,30 +82,31 @@ jQuery.fn.extend({
}

if ( arguments.length < setter ) {
return jQuery.queue( this[0], type );
return jQuery.queue( this[ 0 ], type );
}

return data === undefined ?
this :
this.each(function() {
this.each( function() {
var queue = jQuery.queue( this, type, data );

// Ensure a hooks for this queue
jQuery._queueHooks( this, type );

if ( type === "fx" && queue[0] !== "inprogress" ) {
if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
} );
},
dequeue: function( type ) {
return this.each(function() {
return this.each( function() {
jQuery.dequeue( this, type );
});
} );
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
},

// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, obj ) {
@@ -136,7 +137,7 @@ jQuery.fn.extend({
resolve();
return defer.promise( obj );
}
});
} );

return jQuery;
});
} );
@@ -1,4 +1,4 @@
define([
define( [
"../core",
"../queue",
"../effects" // Delay is optional because of this dependency
@@ -15,8 +15,8 @@ jQuery.fn.delay = function( time, type ) {
hooks.stop = function() {
window.clearTimeout( timeout );
};
});
} );
};

return jQuery.fn.delay;
});
} );
@@ -1,4 +1,4 @@
define([
define( [
"./core",
"./var/document",
"./var/documentElement"
@@ -36,6 +36,7 @@ var hasDuplicate,
documentElement.oMatchesSelector ||
documentElement.msMatchesSelector,
sortOrder = function( a, b ) {

// Flag for duplicate removal
if ( a === b ) {
hasDuplicate = true;
@@ -47,14 +48,15 @@ var hasDuplicate,
a.compareDocumentPosition( b );

if ( compare ) {

// Disconnected nodes
if ( compare & 1 ) {

// Choose the first element that is related to our document
if ( a === document || jQuery.contains(document, a) ) {
if ( a === document || jQuery.contains( document, a ) ) {
return -1;
}
if ( b === document || jQuery.contains(document, b) ) {
if ( b === document || jQuery.contains( document, b ) ) {
return 1;
}

@@ -78,7 +80,7 @@ var hasDuplicate,
results.sort( sortOrder );

if ( hasDuplicate ) {
while ( (elem = results[i++]) ) {
while ( ( elem = results[ i++ ] ) ) {
if ( elem === results[ i ] ) {
j = duplicates.push( i );
}
@@ -91,7 +93,7 @@ var hasDuplicate,
return results;
};

jQuery.extend({
jQuery.extend( {
find: function( selector, context, results, seed ) {
var elem, nodeType,
i = 0;
@@ -105,18 +107,18 @@ jQuery.extend({
}

// Early return if context is not an element or document
if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
if ( ( nodeType = context.nodeType ) !== 1 && nodeType !== 9 ) {
return [];
}

if ( seed ) {
while ( (elem = seed[i++]) ) {
if ( jQuery.find.matchesSelector(elem, selector) ) {
while ( ( elem = seed[ i++ ] ) ) {
if ( jQuery.find.matchesSelector( elem, selector ) ) {
results.push( elem );
}
}
} else {
jQuery.merge( results, context.querySelectorAll(selector) );
jQuery.merge( results, context.querySelectorAll( selector ) );
}

return results;
@@ -130,28 +132,32 @@ jQuery.extend({
nodeType = elem.nodeType;

if ( !nodeType ) {

// If no nodeType, this is expected to be an array
while ( (node = elem[i++]) ) {
while ( ( node = elem[ i++ ] ) ) {

// Do not traverse comment nodes
ret += jQuery.text( node );
}
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {

// Use textContent for elements
return elem.textContent;
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}

// Do not include comment or processing instruction nodes

return ret;
},
contains: function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && adown.contains(bup) );
return a === bup || !!( bup && bup.nodeType === 1 && adown.contains( bup ) );
},
isXMLDoc: function( elem ) {
return (elem.ownerDocument || elem).documentElement.nodeName !== "HTML";
return ( elem.ownerDocument || elem ).documentElement.nodeName !== "HTML";
},
expr: {
attrHandle: {},
@@ -161,7 +167,7 @@ jQuery.extend({
needsContext: /^[\x20\t\r\n\f]*[>+~]/
}
}
});
} );

jQuery.extend( jQuery.find, {
matches: function( expr, elements ) {
@@ -173,6 +179,6 @@ jQuery.extend( jQuery.find, {
attr: function( elem, name ) {
return elem.getAttribute( name );
}
});
} );

});
} );
@@ -1,14 +1,14 @@
define([
define( [
"./core",
"sizzle"
], function( jQuery, Sizzle ) {

jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.pseudos;
jQuery.expr[ ":" ] = jQuery.expr.pseudos;
jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;

});
} );
@@ -1 +1 @@
define([ "./selector-sizzle" ], function() {});
define( [ "./selector-sizzle" ], function() {} );
@@ -1,4 +1,4 @@
define([
define( [
"./core",
"./manipulation/var/rcheckableType",
"./core/init",
@@ -16,13 +16,16 @@ function buildParams( prefix, obj, traditional, add ) {
var name;

if ( jQuery.isArray( obj ) ) {

// Serialize array item.
jQuery.each( obj, function( i, v ) {
if ( traditional || rbracket.test( prefix ) ) {

// Treat each array item as a scalar.
add( prefix, v );

} else {

// Item is non-scalar (array or object), encode its numeric index.
buildParams(
prefix + "[" + ( typeof v === "object" ? i : "" ) + "]",
@@ -31,15 +34,17 @@ function buildParams( prefix, obj, traditional, add ) {
add
);
}
});
} );

} else if ( !traditional && jQuery.type( obj ) === "object" ) {

// Serialize object item.
for ( name in obj ) {
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
}

} else {

// Serialize scalar item.
add( prefix, obj );
}
@@ -51,6 +56,7 @@ jQuery.param = function( a, traditional ) {
var prefix,
s = [],
add = function( key, value ) {

// If value is a function, invoke it and return its value
value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
@@ -63,12 +69,14 @@ jQuery.param = function( a, traditional ) {

// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {

// Serialize the form elements
jQuery.each( a, function() {
add( this.name, this.value );
});
} );

} else {

// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
for ( prefix in a ) {
@@ -80,37 +88,38 @@ jQuery.param = function( a, traditional ) {
return s.join( "&" ).replace( r20, "+" );
};

jQuery.fn.extend({
jQuery.fn.extend( {
serialize: function() {
return jQuery.param( this.serializeArray() );
},
serializeArray: function() {
return this.map(function() {
return this.map( function() {

// Can add propHook for "elements" to filter or add form elements
var elements = jQuery.prop( this, "elements" );
return elements ? jQuery.makeArray( elements ) : this;
})
.filter(function() {
} )
.filter( function() {
var type = this.type;

// Use .is( ":disabled" ) so that fieldset[disabled] works
return this.name && !jQuery( this ).is( ":disabled" ) &&
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
( this.checked || !rcheckableType.test( type ) );
})
.map(function( i, elem ) {
} )
.map( function( i, elem ) {
var val = jQuery( this ).val();

return val == null ?
null :
jQuery.isArray( val ) ?
jQuery.map( val, function( val ) {
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}) :
} ) :
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}).get();
} ).get();
}
});
} );

return jQuery;
});
} );
@@ -1,4 +1,4 @@
define([
define( [
"./core",
"./var/indexOf",
"./traversing/var/rneedsContext",
@@ -8,6 +8,7 @@ define([
], function( jQuery, indexOf, rneedsContext ) {

var rparentsprev = /^(?:parents|prev(?:Until|All))/,

// Methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
@@ -16,12 +17,12 @@ var rparentsprev = /^(?:parents|prev(?:Until|All))/,
prev: true
};

jQuery.extend({
jQuery.extend( {
dir: function( elem, dir, until ) {
var matched = [],
truncate = until !== undefined;

while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
if ( elem.nodeType === 1 ) {
if ( truncate && jQuery( elem ).is( until ) ) {
break;
@@ -43,21 +44,21 @@ jQuery.extend({

return matched;
}
});
} );

jQuery.fn.extend({
jQuery.fn.extend( {
has: function( target ) {
var targets = jQuery( target, this ),
l = targets.length;

return this.filter(function() {
return this.filter( function() {
var i = 0;
for ( ; i < l; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
if ( jQuery.contains( this, targets[ i ] ) ) {
return true;
}
}
});
} );
},

closest: function( selectors, context ) {
@@ -70,14 +71,15 @@ jQuery.fn.extend({
0;

for ( ; i < l; i++ ) {
for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {

// Always skip document fragments
if ( cur.nodeType < 11 && (pos ?
pos.index(cur) > -1 :
if ( cur.nodeType < 11 && ( pos ?
pos.index( cur ) > -1 :

// Don't pass non-elements to Sizzle
cur.nodeType === 1 &&
jQuery.find.matchesSelector(cur, selectors)) ) {
jQuery.find.matchesSelector( cur, selectors ) ) ) {

matched.push( cur );
break;
@@ -119,17 +121,17 @@ jQuery.fn.extend({

addBack: function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter(selector)
this.prevObject : this.prevObject.filter( selector )
);
}
});
} );

function sibling( cur, dir ) {
while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
return cur;
}

jQuery.each({
jQuery.each( {
parent: function( elem ) {
var parent = elem.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
@@ -180,6 +182,7 @@ jQuery.each({
}

if ( this.length > 1 ) {

// Remove duplicates
if ( !guaranteedUnique[ name ] ) {
jQuery.uniqueSort( matched );
@@ -193,7 +196,7 @@ jQuery.each({

return this.pushStack( matched );
};
});
} );

return jQuery;
});
} );
@@ -1,4 +1,4 @@
define([
define( [
"../core",
"../var/indexOf",
"./var/rneedsContext",
@@ -13,14 +13,14 @@ function winnow( elements, qualifier, not ) {
return jQuery.grep( elements, function( elem, i ) {
/* jshint -W018 */
return !!qualifier.call( elem, i, elem ) !== not;
});
} );

}

if ( qualifier.nodeType ) {
return jQuery.grep( elements, function( elem ) {
return ( elem === qualifier ) !== not;
});
} );

}

@@ -34,7 +34,7 @@ function winnow( elements, qualifier, not ) {

return jQuery.grep( elements, function( elem ) {
return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
});
} );
}

jQuery.filter = function( expr, elems, not ) {
@@ -48,24 +48,24 @@ jQuery.filter = function( expr, elems, not ) {
jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
return elem.nodeType === 1;
}));
} ) );
};

jQuery.fn.extend({
jQuery.fn.extend( {
find: function( selector ) {
var i,
len = this.length,
ret = [],
self = this;

if ( typeof selector !== "string" ) {
return this.pushStack( jQuery( selector ).filter(function() {
return this.pushStack( jQuery( selector ).filter( function() {
for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
}) );
} ) );
}

for ( i = 0; i < len; i++ ) {
@@ -75,10 +75,10 @@ jQuery.fn.extend({
return this.pushStack( len > 1 ? jQuery.uniqueSort( ret ) : ret );
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector || [], false) );
return this.pushStack( winnow( this, selector || [], false ) );
},
not: function( selector ) {
return this.pushStack( winnow(this, selector || [], true) );
return this.pushStack( winnow( this, selector || [], true ) );
},
is: function( selector ) {
return !!winnow(
@@ -92,6 +92,6 @@ jQuery.fn.extend({
false
).length;
}
});
} );

});
} );
@@ -1,6 +1,6 @@
define([
define( [
"../../core",
"../../selector"
], function( jQuery ) {
return jQuery.expr.match.needsContext;
});
} );
@@ -1,3 +1,3 @@
define(function() {
define( function() {
return [];
});
} );
@@ -1,4 +1,5 @@
define(function() {
define( function() {

// [[Class]] -> type pairs
return {};
});
} );
@@ -1,5 +1,5 @@
define([
define( [
"./arr"
], function( arr ) {
return arr.concat;
});
} );
@@ -1,3 +1,3 @@
define(function() {
define( function() {
return window.document;
});
} );
@@ -1,5 +1,5 @@
define([
define( [
"./document"
], function( document ) {
return document.documentElement;
});
} );
@@ -1,5 +1,5 @@
define([
define( [
"./class2type"
], function( class2type ) {
return class2type.hasOwnProperty;
});
} );
@@ -1,5 +1,5 @@
define([
define( [
"./arr"
], function( arr ) {
return arr.indexOf;
});
} );
@@ -1,3 +1,3 @@
define(function() {
return (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
});
define( function() {
return ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
} );
@@ -1,5 +1,5 @@
define([
define( [
"./arr"
], function( arr ) {
return arr.push;
});
} );
@@ -1,7 +1,7 @@
define([
define( [
"../var/pnum"
], function( pnum ) {

return new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );

});
} );
@@ -1,3 +1,3 @@
define(function() {
return (/\S+/g);
});
define( function() {
return ( /\S+/g );
} );
@@ -1,5 +1,5 @@
define([
define( [
"./arr"
], function( arr ) {
return arr.slice;
});
} );
@@ -1,4 +1,5 @@
define(function() {
define( function() {

// All support tests are defined in their respective modules.
return {};
});
} );
@@ -1,5 +1,5 @@
define([
define( [
"./class2type"
], function( class2type ) {
return class2type.toString;
});
} );
@@ -1,11 +1,11 @@
define([
define( [
"./core",
"./core/init",
"./manipulation", // clone
"./traversing" // parent, contents
], function( jQuery ) {

jQuery.fn.extend({
jQuery.fn.extend( {
wrapAll: function( html ) {
var wrap;

@@ -21,28 +21,28 @@ jQuery.fn.extend({
wrap.insertBefore( this[ 0 ] );
}

wrap.map(function() {
wrap.map( function() {
var elem = this;

while ( elem.firstElementChild ) {
elem = elem.firstElementChild;
}

return elem;
}).append( this );
} ).append( this );
}

return this;
},

wrapInner: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function( i ) {
jQuery( this ).wrapInner( html.call(this, i) );
});
return this.each( function( i ) {
jQuery( this ).wrapInner( html.call( this, i ) );
} );
}

return this.each(function() {
return this.each( function() {
var self = jQuery( this ),
contents = self.contents();

@@ -52,24 +52,24 @@ jQuery.fn.extend({
} else {
self.append( html );
}
});
} );
},

wrap: function( html ) {
var isFunction = jQuery.isFunction( html );

return this.each(function( i ) {
jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
});
return this.each( function( i ) {
jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
} );
},

unwrap: function( selector ) {
this.parent( selector ).not( "body" ).each(function() {
this.parent( selector ).not( "body" ).each( function() {
jQuery( this ).replaceWith( this.childNodes );
});
} );
return this;
}
});
} );

return jQuery;
});
} );

Large diffs are not rendered by default.

@@ -1,25 +1,25 @@
// Simple script loader that uses jQuery.readyWait via jQuery.holdReady()

//Hold on jQuery!
jQuery.holdReady(true);
jQuery.holdReady( true );

var readyRegExp = /^(complete|loaded)$/;

function assetLoaded( evt ){
function assetLoaded( evt ) {
var node = evt.currentTarget || evt.srcElement;
if ( evt.type === "load" || readyRegExp.test(node.readyState) ) {
jQuery.holdReady(false);
if ( evt.type === "load" || readyRegExp.test( node.readyState ) ) {
jQuery.holdReady( false );
}
}

setTimeout( function() {
var script = document.createElement("script");
var script = document.createElement( "script" );
script.type = "text/javascript";
if ( script.addEventListener ) {
script.addEventListener( "load", assetLoaded, false );
} else {
script.attachEvent( "onreadystatechange", assetLoaded );
}
script.src = "data/readywaitasset.js";
document.getElementsByTagName("head")[0].appendChild(script);
document.getElementsByTagName( "head" )[ 0 ].appendChild( script );
}, 2000 );
@@ -1,3 +1,3 @@
jQuery(function() {
jQuery( function() {
parent.iframeCallback( getComputedSupport( jQuery.support ) );
});
} );
@@ -3,6 +3,7 @@
var fireNative, originaljQuery, original$,
baseURL = "",
supportjQuery = this.jQuery,

// see RFC 2606
externalHost = "example.com";

@@ -24,7 +25,7 @@ this.q = function() {
i = 0;

for ( ; i < arguments.length; i++ ) {
r.push( document.getElementById( arguments[i] ) );
r.push( document.getElementById( arguments[ i ] ) );
}
return r;
};
@@ -62,7 +63,7 @@ this.createDashboardXML = function() {
</locations> \
</dashboard>';

return jQuery.parseXML(string);
return jQuery.parseXML( string );
};

this.createWithFriesXML = function() {
@@ -131,22 +132,26 @@ fireNative = document.createEvent ?
* @result "data/test.php?foo=bar&10538358345554"
*/
function url( value ) {
return baseURL + value + (/\?/.test( value ) ? "&" : "?") +
return baseURL + value + ( /\?/.test( value ) ? "&" : "?" ) +
new Date().getTime() + "" + parseInt( Math.random() * 100000, 10 );
}

// Ajax testing helper
this.ajaxTest = function( title, expect, options ) {
var requestOptions;
if ( jQuery.isFunction( options ) ) {
options = options();
}
options = options || [];
requestOptions = options.requests || options.request || options;
if ( !jQuery.isArray( requestOptions ) ) {
requestOptions = [ requestOptions ];
}
asyncTest( title, expect, function() {
QUnit.test( title, expect, function( assert ) {
var requestOptions;

if ( jQuery.isFunction( options ) ) {
options = options( assert );
}
options = options || [];
requestOptions = options.requests || options.request || options;
if ( !jQuery.isArray( requestOptions ) ) {
requestOptions = [ requestOptions ];
}

var done = assert.async();

if ( options.setup ) {
options.setup();
}
@@ -160,7 +165,9 @@ this.ajaxTest = function( title, expect, options ) {
if ( options.teardown ) {
options.teardown();
}
start();

// Make sure all events will be called before done()
setTimeout( done );
}
},
requests = jQuery.map( requestOptions, function( options ) {
@@ -170,7 +177,7 @@ this.ajaxTest = function( title, expect, options ) {
return function( _, status ) {
if ( !completed ) {
if ( !handler ) {
ok( false, "unexpected " + status );
assert.ok( false, "unexpected " + status );
} else if ( jQuery.isFunction( handler ) ) {
handler.apply( this, arguments );
}
@@ -179,14 +186,14 @@ this.ajaxTest = function( title, expect, options ) {
};

if ( options.afterSend ) {
options.afterSend( request );
options.afterSend( request, assert );
}

return request
.done( callIfDefined( "done", "success" ) )
.fail( callIfDefined( "fail", "error" ) )
.always( complete );
});
} );

ajaxTest.abort = function( reason ) {
if ( !completed ) {
@@ -195,31 +202,31 @@ this.ajaxTest = function( title, expect, options ) {
ok( false, "aborted " + reason );
jQuery.each( requests, function( i, request ) {
request.abort();
});
} );
}
};
});
} );
};

this.testIframe = function( fileName, name, fn ) {
asyncTest(name, function() {
QUnit.test( name, function( assert ) {
var done = assert.async();

// load fixture in iframe
var iframe = loadFixture(),
win = iframe.contentWindow,
interval = setInterval(function() {
interval = setInterval( function() {
if ( win && win.jQuery && win.jQuery.isReady ) {
clearInterval( interval );

start();

// call actual tests passing the correct jQuery instance to use
fn.call( this, win.jQuery, win, win.document );
fn.call( this, win.jQuery, win, win.document, assert );
done();
document.body.removeChild( iframe );
iframe = null;
}
}, 15 );
});
} );

function loadFixture() {
var src = url( "./data/" + fileName + ".html" ),
@@ -233,26 +240,29 @@ this.testIframe = function( fileName, name, fn ) {
};

this.testIframeWithCallback = function( title, fileName, func ) {
asyncTest( title, 1, function() {
QUnit.test( title, 1, function( assert ) {
var iframe;
var done = assert.async();

window.iframeCallback = function() {
var args = arguments;
var args = Array.prototype.slice.call( arguments );

args.push( assert );

setTimeout(function() {
setTimeout( function() {
this.iframeCallback = undefined;

iframe.remove();
func.apply( this, args );
func = function() {};

start();
});
done();
} );
};
iframe = jQuery( "<div/>" ).css({ position: "absolute", width: "500px", left: "-600px" })
iframe = jQuery( "<div/>" ).css( { position: "absolute", width: "500px", left: "-600px" } )
.append( jQuery( "<iframe/>" ).attr( "src", url( "./data/" + fileName ) ) )
.appendTo( "#qunit-fixture" );
});
} );
};
this.iframeCallback = undefined;

@@ -266,7 +276,7 @@ this.loadTests = function() {
loadSwarm = url && url.indexOf( "http" ) === 0;

// Get testSubproject from testrunner first
require([ "data/testrunner.js" ], function() {
require( [ "data/testrunner.js" ], function() {
var tests = [
"unit/core.js",
"unit/callbacks.js",
@@ -291,7 +301,7 @@ this.loadTests = function() {
];

// Ensure load order (to preserve test numbers)
(function loadDep() {
( function loadDep() {
var dep = tests.shift();

if ( dep ) {
@@ -309,14 +319,14 @@ this.loadTests = function() {

// Load the TestSwarm listener if swarmURL is in the address.
if ( loadSwarm ) {
require( [ "http://swarm.jquery.org/js/inject.js?" + (new Date()).getTime() ],
require( [ "http://swarm.jquery.org/js/inject.js?" + ( new Date() ).getTime() ],
function() {
QUnit.start();
});
} );
} else {
QUnit.start();
}
}
})();
});
} )();
} );
};
@@ -1,4 +1,4 @@
(function() {
( function() {

// Store the old counts so that we only assert on tests that have actually leaked,
// instead of asserting every time a test has leaked sometime in the past
@@ -49,13 +49,15 @@ QUnit.expectJqData = function( env, elems, key ) {
// be available as long as the object is not garbage collected by
// the js engine, and when it is, the data will be removed with it.
if ( !elem.nodeType ) {

// Fixes false positives for dataTests(window), dataTests({}).
continue;
}

expando = elem[ jQuery.expando ];

if ( expando === undefined ) {

// In this case the element exists fine, but
// jQuery.data (or internal data) was never (in)directly
// called.
@@ -79,12 +81,12 @@ QUnit.expectJqData = function( env, elems, key ) {
}

};
QUnit.config.urlConfig.push({
QUnit.config.urlConfig.push( {
id: "jqdata",
label: "Always check jQuery.data",
tooltip: "Trigger QUnit.expectJqData detection for all tests " +
"instead of just the ones that call it"
});
} );

/**
* Ensures that tests have cleaned up properly after themselves. Should be passed as the
@@ -106,6 +108,7 @@ window.moduleTeardown = function() {
delete jQuery.cache[ i ];
delete expectedDataKeys[ i ];
}

// In case it was removed from cache before (or never there in the first place)
for ( i in expectedDataKeys ) {
deepEqual(
@@ -129,7 +132,7 @@ window.moduleTeardown = function() {
if ( jQuery.active !== undefined && jQuery.active !== oldActive ) {
equal( jQuery.active, oldActive, "No AJAX requests are still active" );
if ( ajaxTest.abort ) {
ajaxTest.abort("active requests");
ajaxTest.abort( "active requests" );
}
oldActive = jQuery.active;
}
@@ -150,15 +153,17 @@ window.moduleTeardown = function() {
}
};

QUnit.done(function() {
QUnit.done( function() {

// Remove our own fixtures outside #qunit-fixture
supportjQuery( "#qunit ~ *" ).remove();
});
} );

QUnit.testDone(function() {
QUnit.testDone( function() {

// Ensure jQuery events and data on the fixture are properly removed
jQuery( "#qunit-fixture" ).empty();

// ...even if the jQuery under test has a broken .empty()
supportjQuery( "#qunit-fixture" ).empty();

@@ -172,10 +177,10 @@ QUnit.testDone(function() {

// Cleanup globals
Globals.cleanup();
});
} );

// Register globals for cleanup and the cleanup code itself
window.Globals = (function() {
window.Globals = ( function() {
var globals = {};

return {
@@ -193,6 +198,6 @@ window.Globals = (function() {
globals = {};
}
};
})();
} )();

})();
} )();
@@ -17,10 +17,10 @@ function bootstrapFrom( mainSelector, mode ) {
document.webkitExitFullscreen;

function isFullscreen() {
return !!(document.fullscreenElement ||
return !!( document.fullscreenElement ||
document.mozFullScreenElement ||
document.webkitFullscreenElement ||
document.msFullscreenElement);
document.msFullscreenElement );
}

function requestFullscreen( element ) {
@@ -82,7 +82,7 @@ function bootstrapFrom( mainSelector, mode ) {
if ( isFullscreen() ) {
exitFullscreen();
} else {
requestFullscreen( jQuery( mainSelector + " .container" )[0] );
requestFullscreen( jQuery( mainSelector + " .container" )[ 0 ] );
}
}

@@ -1,5 +1,5 @@
// Use the right jQuery source on the test page (and iframes)
(function() {
( function() {
/* global loadTests: false */

var src,
@@ -8,21 +8,23 @@
require = window.require || parent.require;

// iFrames won't load AMD (the iframe tests synchronously expect jQuery to be there)
QUnit.config.urlConfig.push({
QUnit.config.urlConfig.push( {
id: "amd",
label: "Load with AMD",
tooltip: "Load the AMD jQuery file (and its dependencies)"
});
} );

// If QUnit is on window, this is the main window
// This detection allows AMD tests to be run in an iframe
if ( QUnit.urlParams.amd && window.QUnit ) {
require.config({
require.config( {
baseUrl: path,
paths: {
sizzle: "external/sizzle/dist/sizzle"
}
});
} );
src = "src/jquery";

// Include tests if specified
if ( typeof loadTests !== "undefined" ) {
require( [ src ], loadTests );
@@ -33,11 +35,11 @@
}

// Config parameter to use minified jQuery
QUnit.config.urlConfig.push({
QUnit.config.urlConfig.push( {
id: "dev",
label: "Load unminified",
tooltip: "Load the development (unminified) jQuery file"
});
} );
if ( QUnit.urlParams.dev ) {
src = "dist/jquery.js";
} else {
@@ -50,7 +52,7 @@
// Synchronous-only tests
// Other tests are loaded from the test page
if ( typeof loadTests !== "undefined" ) {
document.write( "<script src='" + path + "test/unit/ready.js'><\x2Fscript>");
document.write( "<script src='" + path + "test/unit/ready.js'><\x2Fscript>" );
}

})();
} )();
@@ -4,7 +4,7 @@ var assert = require( "assert" ),
ensureGlobalNotCreated = require( "./lib/ensure_global_not_created" ),
jQueryFactory = require( "../../dist/jquery.js" );

assert.throws( function () {
assert.throws( function() {
jQueryFactory( {} );
}, /jQuery requires a window with a document/ );

@@ -2,15 +2,15 @@

"use strict";

require( "jsdom" ).env( "", function ( errors, window ) {
require( "jsdom" ).env( "", function( errors, window ) {
if ( errors ) {
console.error( errors );
return;
}

var jQuery = require( ".." )( window );

exports.deferred = function () {
exports.deferred = function() {
var deferred = jQuery.Deferred();

return {

Large diffs are not rendered by default.

@@ -11,7 +11,7 @@ var oldRaf = window.requestAnimationFrame,
startTime = 505877050;

// This module tests jQuery.Animation and the corresponding 1.8+ effects APIs
module( "animation", {
QUnit.module( "animation", {
setup: function() {
window.requestAnimationFrame = null;
this.sandbox = sinon.sandbox.create();
@@ -33,77 +33,93 @@ module( "animation", {
}
} );

test( "Animation( subject, props, opts ) - shape", function() {
expect( 20 );
QUnit.test( "Animation( subject, props, opts ) - shape", function( assert ) {
assert.expect( 20 );

var subject = { test: 0 },
props = { test: 1 },
opts = { queue: "fx", duration: 100 },
animation = jQuery.Animation( subject, props, opts );

equal( animation.elem, subject, ".elem is set to the exact object passed" );
equal( animation.originalOptions, opts, ".originalOptions is set to options passed" );
equal( animation.originalProperties, props, ".originalProperties is set to props passed" );

notEqual( animation.props, props, ".props is not the original however" );
deepEqual( animation.props, props, ".props is a copy of the original" );

deepEqual( animation.opts, {
assert.equal(
animation.elem,
subject,
".elem is set to the exact object passed"
);
assert.equal(
animation.originalOptions,
opts,
".originalOptions is set to options passed"
);
assert.equal(
animation.originalProperties,
props,
".originalProperties is set to props passed"
);

assert.notEqual( animation.props, props, ".props is not the original however" );
assert.deepEqual( animation.props, props, ".props is a copy of the original" );

assert.deepEqual( animation.opts, {
duration: 100,
queue: "fx",
specialEasing: { test: undefined },
easing: jQuery.easing._default
}, ".options is filled with default easing and specialEasing" );

equal( animation.startTime, startTime, "startTime was set" );
equal( animation.duration, 100, ".duration is set" );
assert.equal( animation.startTime, startTime, "startTime was set" );
assert.equal( animation.duration, 100, ".duration is set" );

equal( animation.tweens.length, 1, ".tweens has one Tween" );
equal( typeof animation.tweens[ 0 ].run, "function", "which has a .run function" );
assert.equal( animation.tweens.length, 1, ".tweens has one Tween" );
assert.equal( typeof animation.tweens[ 0 ].run, "function", "which has a .run function" );

equal( typeof animation.createTween, "function", ".createTween is a function" );
equal( typeof animation.stop, "function", ".stop is a function" );
assert.equal( typeof animation.createTween, "function", ".createTween is a function" );
assert.equal( typeof animation.stop, "function", ".stop is a function" );

equal( typeof animation.done, "function", ".done is a function" );
equal( typeof animation.fail, "function", ".fail is a function" );
equal( typeof animation.always, "function", ".always is a function" );
equal( typeof animation.progress, "function", ".progress is a function" );
assert.equal( typeof animation.done, "function", ".done is a function" );
assert.equal( typeof animation.fail, "function", ".fail is a function" );
assert.equal( typeof animation.always, "function", ".always is a function" );
assert.equal( typeof animation.progress, "function", ".progress is a function" );

equal( jQuery.timers.length, 1, "Added a timers function" );
equal( jQuery.timers[ 0 ].elem, subject, "...with .elem as the subject" );
equal( jQuery.timers[ 0 ].anim, animation, "...with .anim as the animation" );
equal( jQuery.timers[ 0 ].queue, opts.queue, "...with .queue" );
assert.equal( jQuery.timers.length, 1, "Added a timers function" );
assert.equal( jQuery.timers[ 0 ].elem, subject, "...with .elem as the subject" );
assert.equal( jQuery.timers[ 0 ].anim, animation, "...with .anim as the animation" );
assert.equal( jQuery.timers[ 0 ].queue, opts.queue, "...with .queue" );

// Cleanup after ourselves by ticking to the end
this.clock.tick( 100 );
} );

test( "Animation.prefilter( fn ) - calls prefilter after defaultPrefilter", function() {
expect( 1 );
QUnit.test( "Animation.prefilter( fn ) - calls prefilter after defaultPrefilter",
function( assert ) {
assert.expect( 1 );

var prefilter = this.sandbox.stub(),
defaultSpy = this.sandbox.spy( jQuery.Animation.prefilters, 0 );
var prefilter = this.sandbox.stub(),
defaultSpy = this.sandbox.spy( jQuery.Animation.prefilters, 0 );

jQuery.Animation.prefilter( prefilter );
jQuery.Animation.prefilter( prefilter );

jQuery.Animation( {}, {}, {} );
ok( prefilter.calledAfter( defaultSpy ), "our prefilter called after" );
} );
jQuery.Animation( {}, {}, {} );
assert.ok( prefilter.calledAfter( defaultSpy ), "our prefilter called after" );
}
);

test( "Animation.prefilter( fn, true ) - calls prefilter before defaultPrefilter", function() {
expect( 1 );
QUnit.test( "Animation.prefilter( fn, true ) - calls prefilter before defaultPrefilter",
function( assert ) {
assert.expect( 1 );

var prefilter = this.sandbox.stub(),
defaultSpy = this.sandbox.spy( jQuery.Animation.prefilters, 0 );
var prefilter = this.sandbox.stub(),
defaultSpy = this.sandbox.spy( jQuery.Animation.prefilters, 0 );

jQuery.Animation.prefilter( prefilter, true );
jQuery.Animation.prefilter( prefilter, true );

jQuery.Animation( {}, {}, {} );
ok( prefilter.calledBefore( defaultSpy ), "our prefilter called before" );
} );
jQuery.Animation( {}, {}, {} );
assert.ok( prefilter.calledBefore( defaultSpy ), "our prefilter called before" );
}
);

test( "Animation.prefilter - prefilter return hooks", function() {
expect( 34 );
QUnit.test( "Animation.prefilter - prefilter return hooks", function( assert ) {
assert.expect( 34 );

var animation, realAnimation, element,
sandbox = this.sandbox,
@@ -115,10 +131,10 @@ test( "Animation.prefilter - prefilter return hooks", function() {
realAnimation = this;
sandbox.spy( realAnimation, "createTween" );

deepEqual( realAnimation.originalProperties, props, "originalProperties" );
equal( arguments[ 0 ], this.elem, "first param elem" );
equal( arguments[ 1 ], this.props, "second param props" );
equal( arguments[ 2 ], this.opts, "third param opts" );
assert.deepEqual( realAnimation.originalProperties, props, "originalProperties" );
assert.equal( arguments[ 0 ], this.elem, "first param elem" );
assert.equal( arguments[ 1 ], this.props, "second param props" );
assert.equal( arguments[ 2 ], this.opts, "third param opts" );
return ourAnimation;
} ),
defaultSpy = sandbox.spy( jQuery.Animation.prefilters, 0 ),
@@ -133,14 +149,25 @@ test( "Animation.prefilter - prefilter return hooks", function() {

animation = jQuery.Animation( target, props, opts );

equal( prefilter.callCount, 1, "Called prefilter" );

equal( defaultSpy.callCount, 0,
"Returning something from a prefilter caused remaining prefilters to not run" );
equal( jQuery.fx.timer.callCount, 0, "Returning something never queues a timer" );
equal( animation, ourAnimation, "Returning something returned it from jQuery.Animation" );
equal( realAnimation.createTween.callCount, 0, "Returning something never creates tweens" );
equal( TweenSpy.callCount, 0, "Returning something never creates tweens" );
assert.equal( prefilter.callCount, 1, "Called prefilter" );

assert.equal(
defaultSpy.callCount,
0,
"Returning something from a prefilter caused remaining prefilters to not run"
);
assert.equal( jQuery.fx.timer.callCount, 0, "Returning something never queues a timer" );
assert.equal(
animation,
ourAnimation,
"Returning something returned it from jQuery.Animation"
);
assert.equal(
realAnimation.createTween.callCount,
0,
"Returning something never creates tweens"
);
assert.equal( TweenSpy.callCount, 0, "Returning something never creates tweens" );

// Test overriden usage on queues:
prefilter.reset();
@@ -153,78 +180,84 @@ test( "Animation.prefilter - prefilter return hooks", function() {
.animate( props, 100 )
.queue( queueSpy );

equal( prefilter.callCount, 1, "Called prefilter" );
equal( queueSpy.callCount, 0, "Next function in queue not called" );
assert.equal( prefilter.callCount, 1, "Called prefilter" );
assert.equal( queueSpy.callCount, 0, "Next function in queue not called" );

realAnimation.opts.complete.call( realAnimation.elem );
equal( queueSpy.callCount, 1, "Next function in queue called after complete" );
assert.equal( queueSpy.callCount, 1, "Next function in queue called after complete" );

equal( prefilter.callCount, 2, "Called prefilter again - animation #2" );
equal( ourAnimation.stop.callCount, 0, ".stop() on our animation hasn't been called" );
assert.equal( prefilter.callCount, 2, "Called prefilter again - animation #2" );
assert.equal( ourAnimation.stop.callCount, 0, ".stop() on our animation hasn't been called" );

element.stop();
equal( ourAnimation.stop.callCount, 1, ".stop() called ourAnimation.stop()" );
ok( !ourAnimation.stop.args[ 0 ][ 0 ], ".stop( falsy ) (undefined or false are both valid)" );
assert.equal( ourAnimation.stop.callCount, 1, ".stop() called ourAnimation.stop()" );
assert.ok(
!ourAnimation.stop.args[ 0 ][ 0 ],
".stop( falsy ) (undefined or false are both valid)"
);

equal( queueSpy.callCount, 2, "Next queue function called" );
ok( queueSpy.calledAfter( ourAnimation.stop ), "After our animation was told to stop" );
assert.equal( queueSpy.callCount, 2, "Next queue function called" );
assert.ok( queueSpy.calledAfter( ourAnimation.stop ), "After our animation was told to stop" );

// ourAnimation.stop.reset();
equal( prefilter.callCount, 3, "Got the next animation" );
assert.equal( prefilter.callCount, 3, "Got the next animation" );

ourAnimation.stop.reset();

// do not clear queue, gotoEnd
element.stop( false, true );
ok( ourAnimation.stop.calledWith( true ), ".stop(true) calls .stop(true)" );
ok( queueSpy.calledAfter( ourAnimation.stop ),
assert.ok( ourAnimation.stop.calledWith( true ), ".stop(true) calls .stop(true)" );
assert.ok( queueSpy.calledAfter( ourAnimation.stop ),
"and the next queue function ran after we were told" );
} );

test( "Animation.tweener( fn ) - unshifts a * tweener", function() {
expect( 2 );
QUnit.test( "Animation.tweener( fn ) - unshifts a * tweener", function( assert ) {
assert.expect( 2 );
var starTweeners = jQuery.Animation.tweeners[ "*" ];

jQuery.Animation.tweener( jQuery.noop );
equal( starTweeners.length, 2 );
deepEqual( starTweeners, [ jQuery.noop, defaultTweener ] );
assert.equal( starTweeners.length, 2 );
assert.deepEqual( starTweeners, [ jQuery.noop, defaultTweener ] );
} );

test( "Animation.tweener( 'prop', fn ) - unshifts a 'prop' tweener", function() {
expect( 4 );
QUnit.test( "Animation.tweener( 'prop', fn ) - unshifts a 'prop' tweener", function( assert ) {
assert.expect( 4 );
var tweeners = jQuery.Animation.tweeners,
fn = function() {};

jQuery.Animation.tweener( "prop", jQuery.noop );
equal( tweeners.prop.length, 1 );
deepEqual( tweeners.prop, [ jQuery.noop ] );
assert.equal( tweeners.prop.length, 1 );
assert.deepEqual( tweeners.prop, [ jQuery.noop ] );

jQuery.Animation.tweener( "prop", fn );
equal( tweeners.prop.length, 2 );
deepEqual( tweeners.prop, [ fn, jQuery.noop ] );
assert.equal( tweeners.prop.length, 2 );
assert.deepEqual( tweeners.prop, [ fn, jQuery.noop ] );
} );

test( "Animation.tweener( 'list of props', fn ) - unshifts a tweener to each prop", function() {
expect( 2 );
var tweeners = jQuery.Animation.tweeners,
fn = function() {};

jQuery.Animation.tweener( "list of props", jQuery.noop );
deepEqual( tweeners, {
list: [ jQuery.noop ],
of: [ jQuery.noop ],
props: [ jQuery.noop ],
"*": [ defaultTweener ]
} );

// Test with extra whitespaces
jQuery.Animation.tweener( " list\t of \tprops\n*", fn );
deepEqual( tweeners, {
list: [ fn, jQuery.noop ],
of: [ fn, jQuery.noop ],
props: [ fn, jQuery.noop ],
"*": [ fn, defaultTweener ]
} );
} );
QUnit.test(
"Animation.tweener( 'list of props', fn ) - unshifts a tweener to each prop",
function( assert ) {
assert.expect( 2 );
var tweeners = jQuery.Animation.tweeners,
fn = function() {};

jQuery.Animation.tweener( "list of props", jQuery.noop );
assert.deepEqual( tweeners, {
list: [ jQuery.noop ],
of: [ jQuery.noop ],
props: [ jQuery.noop ],
"*": [ defaultTweener ]
} );

// Test with extra whitespaces
jQuery.Animation.tweener( " list\t of \tprops\n*", fn );
assert.deepEqual( tweeners, {
list: [ fn, jQuery.noop ],
of: [ fn, jQuery.noop ],
props: [ fn, jQuery.noop ],
"*": [ fn, defaultTweener ]
} );
}
);

} )();

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -1,2 +1,2 @@
module("deprecated", { teardown: moduleTeardown });
QUnit.module( "deprecated", { teardown: moduleTeardown } );

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -1,7 +1,7 @@
module("exports", { teardown: moduleTeardown });
QUnit.module( "exports", { teardown: moduleTeardown } );

test("amdModule", function() {
expect(1);
QUnit.test( "amdModule", function( assert ) {
assert.expect( 1 );

equal( jQuery, amdDefined, "Make sure defined module matches jQuery" );
});
assert.equal( jQuery, amdDefined, "Make sure defined module matches jQuery" );
} );

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -1,18 +1,18 @@
module( "event" );
QUnit.module( "ready" );

(function() {
( function() {
var notYetReady, noEarlyExecution,
order = [],
args = {};

notYetReady = !jQuery.isReady;

test( "jQuery.isReady", function() {
expect( 2 );
QUnit.test( "jQuery.isReady", function( assert ) {
assert.expect( 2 );

equal( notYetReady, true, "jQuery.isReady should not be true before DOM ready" );
equal( jQuery.isReady, true, "jQuery.isReady should be true once DOM is ready" );
});
assert.equal( notYetReady, true, "jQuery.isReady should not be true before DOM ready" );
assert.equal( jQuery.isReady, true, "jQuery.isReady should be true once DOM is ready" );
} );

// Create an event handler.
function makeHandler( testId ) {
@@ -22,7 +22,7 @@ module( "event" );
// the correct arg is being passed into the event handler.
return function( arg ) {
order.push( testId );
args[testId] = arg;
args[ testId ] = arg;
};
}

@@ -37,34 +37,34 @@ module( "event" );
noEarlyExecution = order.length === 0;

// This assumes that QUnit tests are run on DOM ready!
test( "jQuery ready", function() {
expect( 8 );
QUnit.test( "jQuery ready", function( assert ) {
assert.expect( 8 );

ok( noEarlyExecution,
assert.ok( noEarlyExecution,
"Handlers bound to DOM ready should not execute before DOM ready" );

// Ensure execution order.
deepEqual( order, [ "a", "b", "c", "d" ],
assert.deepEqual( order, [ "a", "b", "c", "d" ],
"Bound DOM ready handlers should execute in on-order" );

// Ensure handler argument is correct.
equal( args.a, jQuery,
assert.equal( args.a, jQuery,
"Argument passed to fn in jQuery( fn ) should be jQuery" );
equal( args.b, jQuery,
assert.equal( args.b, jQuery,
"Argument passed to fn in jQuery(document).ready( fn ) should be jQuery" );

order = [];

// Now that the ready event has fired, again bind to the ready event
// in every possible way. These event handlers should execute immediately.
jQuery( makeHandler( "g" ) );
equal( order.pop(), "g", "Event handler should execute immediately" );
equal( args.g, jQuery, "Argument passed to fn in jQuery( fn ) should be jQuery" );
assert.equal( order.pop(), "g", "Event handler should execute immediately" );
assert.equal( args.g, jQuery, "Argument passed to fn in jQuery( fn ) should be jQuery" );

jQuery( document ).ready( makeHandler( "h" ) );
equal( order.pop(), "h", "Event handler should execute immediately" );
equal( args.h, jQuery,
assert.equal( order.pop(), "h", "Event handler should execute immediately" );
assert.equal( args.h, jQuery,
"Argument passed to fn in jQuery(document).ready( fn ) should be jQuery" );
});
} );

})();
} )();

Large diffs are not rendered by default.

@@ -1,43 +1,43 @@
module("serialize", { teardown: moduleTeardown });
QUnit.module( "serialize", { teardown: moduleTeardown } );

test("jQuery.param()", function() {
expect(22);
QUnit.test( "jQuery.param()", function( assert ) {
assert.expect( 22 );

var params, settings;

equal( !( jQuery.ajaxSettings && jQuery.ajaxSettings.traditional ), true, "traditional flag, falsy by default" );
assert.equal( !( jQuery.ajaxSettings && jQuery.ajaxSettings.traditional ), true, "traditional flag, falsy by default" );

params = {"foo":"bar", "baz":42, "quux":"All your base are belong to us"};
equal( jQuery.param(params), "foo=bar&baz=42&quux=All+your+base+are+belong+to+us", "simple" );
params = { "foo":"bar", "baz":42, "quux":"All your base are belong to us" };
assert.equal( jQuery.param( params ), "foo=bar&baz=42&quux=All+your+base+are+belong+to+us", "simple" );

params = {"string":"foo","null":null,"undefined":undefined};
equal( jQuery.param(params), "string=foo&null=&undefined=", "handle nulls and undefineds properly" );
params = { "string":"foo","null":null,"undefined":undefined };
assert.equal( jQuery.param( params ), "string=foo&null=&undefined=", "handle nulls and undefineds properly" );

params = {"someName": [1, 2, 3], "regularThing": "blah" };
equal( jQuery.param(params), "someName%5B%5D=1&someName%5B%5D=2&someName%5B%5D=3&regularThing=blah", "with array" );
params = { "someName": [ 1, 2, 3 ], "regularThing": "blah" };
assert.equal( jQuery.param( params ), "someName%5B%5D=1&someName%5B%5D=2&someName%5B%5D=3&regularThing=blah", "with array" );

params = {"foo": ["a", "b", "c"]};
equal( jQuery.param(params), "foo%5B%5D=a&foo%5B%5D=b&foo%5B%5D=c", "with array of strings" );
params = { "foo": [ "a", "b", "c" ] };
assert.equal( jQuery.param( params ), "foo%5B%5D=a&foo%5B%5D=b&foo%5B%5D=c", "with array of strings" );

params = {"foo": ["baz", 42, "All your base are belong to us"] };
equal( jQuery.param(params), "foo%5B%5D=baz&foo%5B%5D=42&foo%5B%5D=All+your+base+are+belong+to+us", "more array" );
params = { "foo": [ "baz", 42, "All your base are belong to us" ] };
assert.equal( jQuery.param( params ), "foo%5B%5D=baz&foo%5B%5D=42&foo%5B%5D=All+your+base+are+belong+to+us", "more array" );

params = {"foo": { "bar": "baz", "beep": 42, "quux": "All your base are belong to us" } };
equal( jQuery.param(params), "foo%5Bbar%5D=baz&foo%5Bbeep%5D=42&foo%5Bquux%5D=All+your+base+are+belong+to+us", "even more arrays" );
params = { "foo": { "bar": "baz", "beep": 42, "quux": "All your base are belong to us" } };
assert.equal( jQuery.param( params ), "foo%5Bbar%5D=baz&foo%5Bbeep%5D=42&foo%5Bquux%5D=All+your+base+are+belong+to+us", "even more arrays" );

params = { a:[1,2], b:{ c:3, d:[4,5], e:{ x:[6], y:7, z:[8,9] }, f:true, g:false, h:undefined }, i:[10,11], j:true, k:false, l:[undefined,0], m:"cowboy hat?" };
equal( decodeURIComponent( jQuery.param(params) ), "a[]=1&a[]=2&b[c]=3&b[d][]=4&b[d][]=5&b[e][x][]=6&b[e][y]=7&b[e][z][]=8&b[e][z][]=9&b[f]=true&b[g]=false&b[h]=&i[]=10&i[]=11&j=true&k=false&l[]=&l[]=0&m=cowboy+hat?", "huge structure" );
params = { a:[ 1,2 ], b:{ c:3, d:[ 4,5 ], e:{ x:[ 6 ], y:7, z:[ 8,9 ] }, f:true, g:false, h:undefined }, i:[ 10,11 ], j:true, k:false, l:[ undefined,0 ], m:"cowboy hat?" };
assert.equal( decodeURIComponent( jQuery.param( params ) ), "a[]=1&a[]=2&b[c]=3&b[d][]=4&b[d][]=5&b[e][x][]=6&b[e][y]=7&b[e][z][]=8&b[e][z][]=9&b[f]=true&b[g]=false&b[h]=&i[]=10&i[]=11&j=true&k=false&l[]=&l[]=0&m=cowboy+hat?", "huge structure" );

params = { "a": [ 0, [ 1, 2 ], [ 3, [ 4, 5 ], [ 6 ] ], { "b": [ 7, [ 8, 9 ], [ { "c": 10, "d": 11 } ], [ [ 12 ] ], [ [ [ 13 ] ] ], { "e": { "f": { "g": [ 14, [ 15 ] ] } } }, 16 ] }, 17 ] };
equal( decodeURIComponent( jQuery.param(params) ), "a[]=0&a[1][]=1&a[1][]=2&a[2][]=3&a[2][1][]=4&a[2][1][]=5&a[2][2][]=6&a[3][b][]=7&a[3][b][1][]=8&a[3][b][1][]=9&a[3][b][2][0][c]=10&a[3][b][2][0][d]=11&a[3][b][3][0][]=12&a[3][b][4][0][0][]=13&a[3][b][5][e][f][g][]=14&a[3][b][5][e][f][g][1][]=15&a[3][b][]=16&a[]=17", "nested arrays" );
assert.equal( decodeURIComponent( jQuery.param( params ) ), "a[]=0&a[1][]=1&a[1][]=2&a[2][]=3&a[2][1][]=4&a[2][1][]=5&a[2][2][]=6&a[3][b][]=7&a[3][b][1][]=8&a[3][b][1][]=9&a[3][b][2][0][c]=10&a[3][b][2][0][d]=11&a[3][b][3][0][]=12&a[3][b][4][0][0][]=13&a[3][b][5][e][f][g][]=14&a[3][b][5][e][f][g][1][]=15&a[3][b][]=16&a[]=17", "nested arrays" );

params = { "a":[1,2], "b":{ "c":3, "d":[4,5], "e":{ "x":[6], "y":7, "z":[8,9] }, "f":true, "g":false, "h":undefined }, "i":[10,11], "j":true, "k":false, "l":[undefined,0], "m":"cowboy hat?" };
equal( jQuery.param(params,true), "a=1&a=2&b=%5Bobject+Object%5D&i=10&i=11&j=true&k=false&l=&l=0&m=cowboy+hat%3F", "huge structure, forced traditional" );
params = { "a":[ 1,2 ], "b":{ "c":3, "d":[ 4,5 ], "e":{ "x":[ 6 ], "y":7, "z":[ 8,9 ] }, "f":true, "g":false, "h":undefined }, "i":[ 10,11 ], "j":true, "k":false, "l":[ undefined,0 ], "m":"cowboy hat?" };
assert.equal( jQuery.param( params, true ), "a=1&a=2&b=%5Bobject+Object%5D&i=10&i=11&j=true&k=false&l=&l=0&m=cowboy+hat%3F", "huge structure, forced traditional" );

equal( decodeURIComponent( jQuery.param({ "a": [1,2,3], "b[]": [4,5,6], "c[d]": [7,8,9], "e": { "f": [10], "g": [11,12], "h": 13 } }) ), "a[]=1&a[]=2&a[]=3&b[]=4&b[]=5&b[]=6&c[d][]=7&c[d][]=8&c[d][]=9&e[f][]=10&e[g][]=11&e[g][]=12&e[h]=13", "Make sure params are not double-encoded." );
assert.equal( decodeURIComponent( jQuery.param( { "a": [ 1,2,3 ], "b[]": [ 4,5,6 ], "c[d]": [ 7,8,9 ], "e": { "f": [ 10 ], "g": [ 11,12 ], "h": 13 } } ) ), "a[]=1&a[]=2&a[]=3&b[]=4&b[]=5&b[]=6&c[d][]=7&c[d][]=8&c[d][]=9&e[f][]=10&e[g][]=11&e[g][]=12&e[h]=13", "Make sure params are not double-encoded." );

// #7945
equal( jQuery.param({"jquery": "1.4.2"}), "jquery=1.4.2", "Check that object with a jQuery property get serialized correctly" );
assert.equal( jQuery.param( { "jquery": "1.4.2" } ), "jquery=1.4.2", "Check that object with a jQuery property get serialized correctly" );

settings = { traditional: true };

@@ -47,100 +47,100 @@ test("jQuery.param()", function() {
jQuery.ajaxSettings = settings;
}

params = {"foo":"bar", "baz":42, "quux":"All your base are belong to us"};
equal( jQuery.param(params), "foo=bar&baz=42&quux=All+your+base+are+belong+to+us", "simple" );
params = { "foo":"bar", "baz":42, "quux":"All your base are belong to us" };
assert.equal( jQuery.param( params ), "foo=bar&baz=42&quux=All+your+base+are+belong+to+us", "simple" );

params = {"someName": [1, 2, 3], "regularThing": "blah" };
equal( jQuery.param(params), "someName=1&someName=2&someName=3&regularThing=blah", "with array" );
params = { "someName": [ 1, 2, 3 ], "regularThing": "blah" };
assert.equal( jQuery.param( params ), "someName=1&someName=2&someName=3&regularThing=blah", "with array" );

params = {"foo": ["a", "b", "c"]};
equal( jQuery.param(params), "foo=a&foo=b&foo=c", "with array of strings" );
params = { "foo": [ "a", "b", "c" ] };
assert.equal( jQuery.param( params ), "foo=a&foo=b&foo=c", "with array of strings" );

params = {"foo[]":["baz", 42, "All your base are belong to us"]};
equal( jQuery.param(params), "foo%5B%5D=baz&foo%5B%5D=42&foo%5B%5D=All+your+base+are+belong+to+us", "more array" );
params = { "foo[]":[ "baz", 42, "All your base are belong to us" ] };
assert.equal( jQuery.param( params ), "foo%5B%5D=baz&foo%5B%5D=42&foo%5B%5D=All+your+base+are+belong+to+us", "more array" );

params = {"foo[bar]":"baz", "foo[beep]":42, "foo[quux]":"All your base are belong to us"};
equal( jQuery.param(params), "foo%5Bbar%5D=baz&foo%5Bbeep%5D=42&foo%5Bquux%5D=All+your+base+are+belong+to+us", "even more arrays" );
params = { "foo[bar]":"baz", "foo[beep]":42, "foo[quux]":"All your base are belong to us" };
assert.equal( jQuery.param( params ), "foo%5Bbar%5D=baz&foo%5Bbeep%5D=42&foo%5Bquux%5D=All+your+base+are+belong+to+us", "even more arrays" );

params = { a:[1,2], b:{ c:3, d:[4,5], e:{ x:[6], y:7, z:[8,9] }, f:true, g:false, h:undefined }, i:[10,11], j:true, k:false, l:[undefined,0], m:"cowboy hat?" };
equal( jQuery.param(params), "a=1&a=2&b=%5Bobject+Object%5D&i=10&i=11&j=true&k=false&l=&l=0&m=cowboy+hat%3F", "huge structure" );
params = { a:[ 1,2 ], b:{ c:3, d:[ 4,5 ], e:{ x:[ 6 ], y:7, z:[ 8,9 ] }, f:true, g:false, h:undefined }, i:[ 10,11 ], j:true, k:false, l:[ undefined,0 ], m:"cowboy hat?" };
assert.equal( jQuery.param( params ), "a=1&a=2&b=%5Bobject+Object%5D&i=10&i=11&j=true&k=false&l=&l=0&m=cowboy+hat%3F", "huge structure" );

params = { "a": [ 0, [ 1, 2 ], [ 3, [ 4, 5 ], [ 6 ] ], { "b": [ 7, [ 8, 9 ], [ { "c": 10, d: 11 } ], [ [ 12 ] ], [ [ [ 13 ] ] ], { "e": { "f": { "g": [ 14, [ 15 ] ] } } }, 16 ] }, 17 ] };
equal( jQuery.param(params), "a=0&a=1%2C2&a=3%2C4%2C5%2C6&a=%5Bobject+Object%5D&a=17", "nested arrays (not possible when jQuery.param.traditional == true)" );
assert.equal( jQuery.param( params ), "a=0&a=1%2C2&a=3%2C4%2C5%2C6&a=%5Bobject+Object%5D&a=17", "nested arrays (not possible when jQuery.param.traditional == true)" );

params = { a:[1,2], b:{ c:3, d:[4,5], e:{ x:[6], y:7, z:[8,9] }, f:true, g:false, h:undefined }, i:[10,11], j:true, k:false, l:[undefined,0], m:"cowboy hat?" };
equal( decodeURIComponent( jQuery.param(params,false) ), "a[]=1&a[]=2&b[c]=3&b[d][]=4&b[d][]=5&b[e][x][]=6&b[e][y]=7&b[e][z][]=8&b[e][z][]=9&b[f]=true&b[g]=false&b[h]=&i[]=10&i[]=11&j=true&k=false&l[]=&l[]=0&m=cowboy+hat?", "huge structure, forced not traditional" );
params = { a:[ 1,2 ], b:{ c:3, d:[ 4,5 ], e:{ x:[ 6 ], y:7, z:[ 8,9 ] }, f:true, g:false, h:undefined }, i:[ 10,11 ], j:true, k:false, l:[ undefined,0 ], m:"cowboy hat?" };
assert.equal( decodeURIComponent( jQuery.param( params, false ) ), "a[]=1&a[]=2&b[c]=3&b[d][]=4&b[d][]=5&b[e][x][]=6&b[e][y]=7&b[e][z][]=8&b[e][z][]=9&b[f]=true&b[g]=false&b[h]=&i[]=10&i[]=11&j=true&k=false&l[]=&l[]=0&m=cowboy+hat?", "huge structure, forced not traditional" );

params = { "param1": null };
equal( jQuery.param(params,false), "param1=", "Make sure that null params aren't traversed." );
assert.equal( jQuery.param( params, false ), "param1=", "Make sure that null params aren't traversed." );

params = {"test": {"length": 3, "foo": "bar"} };
equal( jQuery.param( params, false ), "test%5Blength%5D=3&test%5Bfoo%5D=bar", "Sub-object with a length property" );
params = { "test": { "length": 3, "foo": "bar" } };
assert.equal( jQuery.param( params, false ), "test%5Blength%5D=3&test%5Bfoo%5D=bar", "Sub-object with a length property" );

if ( jQuery.ajaxSettings === settings ) {
delete jQuery.ajaxSettings;
} else {
jQuery.ajaxSetup({ traditional: false });
jQuery.ajaxSetup( { traditional: false } );
}
});
} );

test("jQuery.param() Constructed prop values", function() {
expect( 4 );
QUnit.test( "jQuery.param() Constructed prop values", function( assert ) {
assert.expect( 4 );

/** @constructor */
function Record() {
this["prop"] = "val";
this[ "prop" ] = "val";
}

var MyString = String,
MyNumber = Number,
params = { "test": new MyString("foo") };
params = { "test": new MyString( "foo" ) };

equal( jQuery.param( params, false ), "test=foo", "Do not mistake new String() for a plain object" );
assert.equal( jQuery.param( params, false ), "test=foo", "Do not mistake new String() for a plain object" );

params = { "test": new MyNumber(5) };
equal( jQuery.param( params, false ), "test=5", "Do not mistake new Number() for a plain object" );
params = { "test": new MyNumber( 5 ) };
assert.equal( jQuery.param( params, false ), "test=5", "Do not mistake new Number() for a plain object" );

params = { "test": new Date() };
ok( jQuery.param( params, false ), "(Non empty string returned) Do not mistake new Date() for a plain object" );
assert.ok( jQuery.param( params, false ), "(Non empty string returned) Do not mistake new Date() for a plain object" );

// should allow non-native constructed objects
params = { "test": new Record() };
equal( jQuery.param( params, false ), jQuery.param({ "test": { "prop": "val" } }), "Allow non-native constructed objects" );
});
assert.equal( jQuery.param( params, false ), jQuery.param( { "test": { "prop": "val" } } ), "Allow non-native constructed objects" );
} );

test("serialize()", function() {
expect(6);
QUnit.test( "serialize()", function( assert ) {
assert.expect( 6 );

// Add html5 elements only for serialize because selector can't yet find them on non-html5 browsers
jQuery("#search").after(
jQuery( "#search" ).after(
"<input type='email' id='html5email' name='email' value='dave@jquery.com' />" +
"<input type='number' id='html5number' name='number' value='43' />" +
"<input type='file' name='fileupload' />"
);

equal( jQuery("#form").serialize(),
assert.equal( jQuery( "#form" ).serialize(),
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3",
"Check form serialization as query string");
"Check form serialization as query string" );

equal( jQuery("input,select,textarea,button", "#form").serialize(),
assert.equal( jQuery( "input,select,textarea,button", "#form" ).serialize(),
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3",
"Check input serialization as query string");
"Check input serialization as query string" );

equal( jQuery("#testForm").serialize(),
assert.equal( jQuery( "#testForm" ).serialize(),
"T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
"Check form serialization as query string");
"Check form serialization as query string" );

equal( jQuery("input,select,textarea,button", "#testForm").serialize(),
assert.equal( jQuery( "input,select,textarea,button", "#testForm" ).serialize(),
"T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
"Check input serialization as query string");
"Check input serialization as query string" );

equal( jQuery("#form, #testForm").serialize(),
assert.equal( jQuery( "#form, #testForm" ).serialize(),
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
"Multiple form serialization as query string");
"Multiple form serialization as query string" );

equal( jQuery("#form, #testForm :input").serialize(),
assert.equal( jQuery( "#form, #testForm :input" ).serialize(),
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
"Mixed form/input serialization as query string");
jQuery("#html5email, #html5number").remove();
});
"Mixed form/input serialization as query string" );
jQuery( "#html5email, #html5number" ).remove();
} );
@@ -1,4 +1,4 @@
module("support", { teardown: moduleTeardown });
QUnit.module( "support", { teardown: moduleTeardown } );

var computedSupport = getComputedSupport( jQuery.support );

@@ -18,36 +18,41 @@ function getComputedSupport( support ) {
}

if ( jQuery.css ) {
testIframeWithCallback( "body background is not lost if set prior to loading jQuery (#9239)", "support/bodyBackground.html", function( color, support ) {
expect( 2 );
var okValue = {
"#000000": true,
"rgb(0, 0, 0)": true
};
ok( okValue[ color ], "color was not reset (" + color + ")" );
testIframeWithCallback(
"body background is not lost if set prior to loading jQuery (#9239)",
"support/bodyBackground.html",
function( color, support, assert ) {
assert.expect( 2 );
var okValue = {
"#000000": true,
"rgb(0, 0, 0)": true
};
assert.ok( okValue[ color ], "color was not reset (" + color + ")" );

deepEqual( jQuery.extend( {}, support ), computedSupport, "Same support properties" );
});
assert.deepEqual( jQuery.extend( {}, support ), computedSupport, "Same support properties" );
}
);
}

// This test checks CSP only for browsers with "Content-Security-Policy" header support
// i.e. no old WebKit or old Firefox
testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Security/CSP) restrictions",
testIframeWithCallback(
"Check CSP (https://developer.mozilla.org/en-US/docs/Security/CSP) restrictions",
"support/csp.php",
function( support ) {
expect( 2 );
deepEqual( jQuery.extend( {}, support ), computedSupport, "No violations of CSP polices" );
function( support, assert ) {
assert.expect( 2 );
assert.deepEqual( jQuery.extend( {}, support ), computedSupport, "No violations of CSP polices" );

stop();
QUnit.stop();

supportjQuery.get( "data/support/csp.log" ).done(function( data ) {
equal( data, "", "No log request should be sent" );
supportjQuery.get( "data/support/csp.log" ).done( function( data ) {
assert.equal( data, "", "No log request should be sent" );
supportjQuery.get( "data/support/csp-clean.php" ).done( start );
});
} );
}
);

(function() {
( function() {
var expected,
userAgent = window.navigator.userAgent;

@@ -106,6 +111,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"reliableMarginRight": true
};
} else if ( /chrome/i.test( userAgent ) ) {

// Catches Chrome on Android as well (i.e. the default
// Android browser on Android >= 4.4).
expected = {
@@ -254,27 +260,28 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
}

if ( expected ) {
test( "Verify that the support tests resolve as expected per browser", function() {
QUnit.test( "Verify that the support tests resolve as expected per browser", function( assert ) {
var i, prop,
j = 0;

for ( prop in computedSupport ) {
j++;
}

expect( j );
assert.expect( j );

for ( i in expected ) {

// TODO check for all modules containing support properties
if ( jQuery.ajax || i !== "ajax" && i !== "cors" ) {
equal( computedSupport[ i ], expected[ i ],
assert.equal( computedSupport[ i ], expected[ i ],
"jQuery.support['" + i + "']: " + computedSupport[ i ] +
", expected['" + i + "']: " + expected[ i ]);
", expected['" + i + "']: " + expected[ i ] );
} else {
ok( true, "no ajax; skipping jQuery.support[' " + i + " ']" );
assert.ok( true, "no ajax; skipping jQuery.support[' " + i + " ']" );
}
}
});
} );
}

})();
} )();