inspected[ dataType ] = true;
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
- if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+ if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
options.dataTypes.unshift( dataTypeOrTransport );
inspect( dataTypeOrTransport );
return false;
dataTypes = s.dataTypes;
// Remove auto dataType and get content-type in the process
- while( dataTypes[ 0 ] === "*" ) {
+ while ( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
s.type = options.method || options.type || s.method || s.type;
// Extract dataTypes list
- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [""];
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
// A cross-domain request is in order when we have a protocol:host:port mismatch
if ( s.crossDomain == null ) {
});
// Attach a bunch of functions for handling common AJAX events
-jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
- jQuery.fn[ type ] = function( fn ){
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
+ jQuery.fn[ type ] = function( fn ) {
return this.on( type, fn );
};
});
// Support: IE9
try {
tmp = new DOMParser();
- xml = tmp.parseFromString( data , "text/xml" );
+ xml = tmp.parseFromString( data, "text/xml" );
} catch ( e ) {
xml = undefined;
}
if ( window.ActiveXObject ) {
jQuery( window ).on( "unload", function() {
- for( var key in xhrCallbacks ) {
+ for ( var key in xhrCallbacks ) {
xhrCallbacks[ key ]();
}
xhrCallbacks = undefined;
"../var/support"
], function( support ) {
-(function () {
+(function() {
var input = document.createElement( "input" ),
select = document.createElement( "select" ),
opt = select.appendChild( document.createElement( "option" ) );
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
+
} else if ( typeof val === "number" ) {
val += "";
+
} else if ( jQuery.isArray( val ) ) {
- val = jQuery.map(val, function ( value ) {
+ val = jQuery.map( val, function( value ) {
return value == null ? "" : value + "";
});
}
if ( list ) {
jQuery.each( arguments, function( _, arg ) {
var index;
- while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 );
// Handle firing indexes
if ( firing ) {
"../var/support"
], function( jQuery, support ) {
-(function () {
+(function() {
var pixelPositionVal, boxSizingReliableVal,
// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;" +
return function( value ) {
contexts[ i ] = this;
values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
- if( values === progressValues ) {
+ if ( values === progressValues ) {
deferred.notifyWith( contexts, values );
} else if ( !( --remaining ) ) {
deferred.resolveWith( contexts, values );
rrun = /queueHooks$/,
animationPrefilters = [ defaultPrefilter ],
tweeners = {
- "*": [function( prop, value ) {
+ "*": [ function( prop, value ) {
var tween = this.createTween( prop, value ),
target = tween.cur(),
parts = rfxnum.exec( value ),
}
return tween;
- }]
+ } ]
};
// Dependencies not needed as vars
// if we include width, step value is 1 to do all cssExpand values,
// if we don't include width, step value is 2 to skip over Left and Right
includeWidth = includeWidth ? 1 : 0;
- for( ; i < 4 ; i += 2 - includeWidth ) {
+ for ( ; i < 4 ; i += 2 - includeWidth ) {
which = cssExpand[ i ];
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
}
});
}
-
// show/hide pass
for ( prop in props ) {
value = props[ prop ];
return p;
},
swing: function( p ) {
- return 0.5 - Math.cos( p*Math.PI ) / 2;
+ return 0.5 - Math.cos( p * Math.PI ) / 2;
}
};
}
// Handle multiple events separated by a space
- types = ( types || "" ).match( rnotwhite ) || [""];
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
}
// Once for each type.namespace in types; type may be omitted
- types = ( types || "" ).match( rnotwhite ) || [""];
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
event.target = event.target.parentNode;
}
- return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
},
special: {
// Require more than a few needed variables
// Keep in mind that a dependency array cannot be used with CommonJS+AMD syntax
-define(function( require ){
+define(function( require ) {
var
jQuery = require( "./core" ),
require( "./selector" );
require( "./event" );
-
// Support: 1.x compatibility
// Manipulating tables requires a tbody
function manipulationTarget( elem, content ) {
tmp = tmp || fragment.appendChild( context.createElement("div") );
// Deserialize a standard representation
- tag = ( rtagName.exec( elem ) || ["", ""] )[ 1 ].toLowerCase();
+ tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
wrap = wrapMap[ tag ] || wrapMap._default;
tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
- return this.map( function () {
+ return this.map(function() {
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
});
},
});
// Create scrollLeft and scrollTop methods
-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
+jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
var top = "pageYOffset" === prop;
jQuery.fn[ method ] = function( val ) {
}
type = type || "fx";
- while( i-- ) {
+ while ( i-- ) {
tmp = data_priv.get( elements[ i ], type + "queueHooks" );
if ( tmp && tmp.empty ) {
count++;
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
+
+ // 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 ){
+ jQuery.map( val, function( val ) {
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}) :
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };