Commit cb37994d authored by Oleg's avatar Oleg

No ticket: fix code style inconsistencies. Closes gh-1361

parent e12746d7
...@@ -102,7 +102,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX ...@@ -102,7 +102,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
inspected[ dataType ] = true; inspected[ dataType ] = true;
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
options.dataTypes.unshift( dataTypeOrTransport ); options.dataTypes.unshift( dataTypeOrTransport );
inspect( dataTypeOrTransport ); inspect( dataTypeOrTransport );
return false; return false;
...@@ -146,7 +146,7 @@ function ajaxHandleResponses( s, jqXHR, responses ) { ...@@ -146,7 +146,7 @@ function ajaxHandleResponses( s, jqXHR, responses ) {
dataTypes = s.dataTypes; dataTypes = s.dataTypes;
// Remove auto dataType and get content-type in the process // Remove auto dataType and get content-type in the process
while( dataTypes[ 0 ] === "*" ) { while ( dataTypes[ 0 ] === "*" ) {
dataTypes.shift(); dataTypes.shift();
if ( ct === undefined ) { if ( ct === undefined ) {
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
...@@ -510,7 +510,7 @@ jQuery.extend({ ...@@ -510,7 +510,7 @@ jQuery.extend({
s.type = options.method || options.type || s.method || s.type; s.type = options.method || options.type || s.method || s.type;
// Extract dataTypes list // 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 // A cross-domain request is in order when we have a protocol:host:port mismatch
if ( s.crossDomain == null ) { if ( s.crossDomain == null ) {
...@@ -796,8 +796,8 @@ jQuery.each( [ "get", "post" ], function( i, method ) { ...@@ -796,8 +796,8 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
}); });
// Attach a bunch of functions for handling common AJAX events // Attach a bunch of functions for handling common AJAX events
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
jQuery.fn[ type ] = function( fn ){ jQuery.fn[ type ] = function( fn ) {
return this.on( type, fn ); return this.on( type, fn );
}; };
}); });
......
...@@ -12,7 +12,7 @@ jQuery.parseXML = function( data ) { ...@@ -12,7 +12,7 @@ jQuery.parseXML = function( data ) {
// Support: IE9 // Support: IE9
try { try {
tmp = new DOMParser(); tmp = new DOMParser();
xml = tmp.parseFromString( data , "text/xml" ); xml = tmp.parseFromString( data, "text/xml" );
} catch ( e ) { } catch ( e ) {
xml = undefined; xml = undefined;
} }
......
...@@ -26,7 +26,7 @@ var xhrSupported = jQuery.ajaxSettings.xhr(), ...@@ -26,7 +26,7 @@ var xhrSupported = jQuery.ajaxSettings.xhr(),
if ( window.ActiveXObject ) { if ( window.ActiveXObject ) {
jQuery( window ).on( "unload", function() { jQuery( window ).on( "unload", function() {
for( var key in xhrCallbacks ) { for ( var key in xhrCallbacks ) {
xhrCallbacks[ key ](); xhrCallbacks[ key ]();
} }
xhrCallbacks = undefined; xhrCallbacks = undefined;
......
...@@ -2,7 +2,7 @@ define([ ...@@ -2,7 +2,7 @@ define([
"../var/support" "../var/support"
], function( support ) { ], function( support ) {
(function () { (function() {
var input = document.createElement( "input" ), var input = document.createElement( "input" ),
select = document.createElement( "select" ), select = document.createElement( "select" ),
opt = select.appendChild( document.createElement( "option" ) ); opt = select.appendChild( document.createElement( "option" ) );
......
...@@ -49,10 +49,12 @@ jQuery.fn.extend({ ...@@ -49,10 +49,12 @@ jQuery.fn.extend({
// Treat null/undefined as ""; convert numbers to string // Treat null/undefined as ""; convert numbers to string
if ( val == null ) { if ( val == null ) {
val = ""; val = "";
} else if ( typeof val === "number" ) { } else if ( typeof val === "number" ) {
val += ""; val += "";
} else if ( jQuery.isArray( val ) ) { } else if ( jQuery.isArray( val ) ) {
val = jQuery.map(val, function ( value ) { val = jQuery.map( val, function( value ) {
return value == null ? "" : value + ""; return value == null ? "" : value + "";
}); });
} }
......
...@@ -126,7 +126,7 @@ jQuery.Callbacks = function( options ) { ...@@ -126,7 +126,7 @@ jQuery.Callbacks = function( options ) {
if ( list ) { if ( list ) {
jQuery.each( arguments, function( _, arg ) { jQuery.each( arguments, function( _, arg ) {
var index; var index;
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 ); list.splice( index, 1 );
// Handle firing indexes // Handle firing indexes
if ( firing ) { if ( firing ) {
......
...@@ -3,7 +3,7 @@ define([ ...@@ -3,7 +3,7 @@ define([
"../var/support" "../var/support"
], function( jQuery, support ) { ], function( jQuery, support ) {
(function () { (function() {
var pixelPositionVal, boxSizingReliableVal, var pixelPositionVal, boxSizingReliableVal,
// Support: Firefox, Android 2.3 (Prefixed box-sizing versions). // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;" + divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;" +
......
...@@ -109,7 +109,7 @@ jQuery.extend({ ...@@ -109,7 +109,7 @@ jQuery.extend({
return function( value ) { return function( value ) {
contexts[ i ] = this; contexts[ i ] = this;
values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
if( values === progressValues ) { if ( values === progressValues ) {
deferred.notifyWith( contexts, values ); deferred.notifyWith( contexts, values );
} else if ( !( --remaining ) ) { } else if ( !( --remaining ) ) {
deferred.resolveWith( contexts, values ); deferred.resolveWith( contexts, values );
......
...@@ -14,7 +14,7 @@ var ...@@ -14,7 +14,7 @@ var
rrun = /queueHooks$/, rrun = /queueHooks$/,
animationPrefilters = [ defaultPrefilter ], animationPrefilters = [ defaultPrefilter ],
tweeners = { tweeners = {
"*": [function( prop, value ) { "*": [ function( prop, value ) {
var tween = this.createTween( prop, value ), var tween = this.createTween( prop, value ),
target = tween.cur(), target = tween.cur(),
parts = rfxnum.exec( value ), parts = rfxnum.exec( value ),
...@@ -61,7 +61,7 @@ var ...@@ -61,7 +61,7 @@ var
} }
return tween; return tween;
}] } ]
}; };
// Dependencies not needed as vars // Dependencies not needed as vars
...@@ -89,7 +89,7 @@ function genFx( type, includeWidth ) { ...@@ -89,7 +89,7 @@ function genFx( type, includeWidth ) {
// if we include width, step value is 1 to do all cssExpand values, // 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 // if we don't include width, step value is 2 to skip over Left and Right
includeWidth = includeWidth ? 1 : 0; includeWidth = includeWidth ? 1 : 0;
for( ; i < 4 ; i += 2 - includeWidth ) { for ( ; i < 4 ; i += 2 - includeWidth ) {
which = cssExpand[ i ]; which = cssExpand[ i ];
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
} }
...@@ -181,7 +181,6 @@ function defaultPrefilter( elem, props, opts ) { ...@@ -181,7 +181,6 @@ function defaultPrefilter( elem, props, opts ) {
}); });
} }
// show/hide pass // show/hide pass
for ( prop in props ) { for ( prop in props ) {
value = props[ prop ]; value = props[ prop ];
......
...@@ -102,7 +102,7 @@ jQuery.easing = { ...@@ -102,7 +102,7 @@ jQuery.easing = {
return p; return p;
}, },
swing: function( p ) { swing: function( p ) {
return 0.5 - Math.cos( p*Math.PI ) / 2; return 0.5 - Math.cos( p * Math.PI ) / 2;
} }
}; };
......
...@@ -81,7 +81,7 @@ jQuery.event = { ...@@ -81,7 +81,7 @@ jQuery.event = {
} }
// Handle multiple events separated by a space // Handle multiple events separated by a space
types = ( types || "" ).match( rnotwhite ) || [""]; types = ( types || "" ).match( rnotwhite ) || [ "" ];
t = types.length; t = types.length;
while ( t-- ) { while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || []; tmp = rtypenamespace.exec( types[t] ) || [];
...@@ -163,7 +163,7 @@ jQuery.event = { ...@@ -163,7 +163,7 @@ jQuery.event = {
} }
// Once for each type.namespace in types; type may be omitted // Once for each type.namespace in types; type may be omitted
types = ( types || "" ).match( rnotwhite ) || [""]; types = ( types || "" ).match( rnotwhite ) || [ "" ];
t = types.length; t = types.length;
while ( t-- ) { while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || []; tmp = rtypenamespace.exec( types[t] ) || [];
...@@ -538,7 +538,7 @@ jQuery.event = { ...@@ -538,7 +538,7 @@ jQuery.event = {
event.target = event.target.parentNode; event.target = event.target.parentNode;
} }
return fixHook.filter? fixHook.filter( event, originalEvent ) : event; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
}, },
special: { special: {
......
// Require more than a few needed variables // Require more than a few needed variables
// Keep in mind that a dependency array cannot be used with CommonJS+AMD syntax // Keep in mind that a dependency array cannot be used with CommonJS+AMD syntax
define(function( require ){ define(function( require ) {
var var
jQuery = require( "./core" ), jQuery = require( "./core" ),
...@@ -48,7 +48,6 @@ require( "./traversing" ); ...@@ -48,7 +48,6 @@ require( "./traversing" );
require( "./selector" ); require( "./selector" );
require( "./event" ); require( "./event" );
// Support: 1.x compatibility // Support: 1.x compatibility
// Manipulating tables requires a tbody // Manipulating tables requires a tbody
function manipulationTarget( elem, content ) { function manipulationTarget( elem, content ) {
...@@ -218,7 +217,7 @@ jQuery.extend({ ...@@ -218,7 +217,7 @@ jQuery.extend({
tmp = tmp || fragment.appendChild( context.createElement("div") ); tmp = tmp || fragment.appendChild( context.createElement("div") );
// Deserialize a standard representation // Deserialize a standard representation
tag = ( rtagName.exec( elem ) || ["", ""] )[ 1 ].toLowerCase(); tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
wrap = wrapMap[ tag ] || wrapMap._default; wrap = wrapMap[ tag ] || wrapMap._default;
tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ]; tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
...@@ -398,7 +397,7 @@ jQuery.fn.extend({ ...@@ -398,7 +397,7 @@ jQuery.fn.extend({
dataAndEvents = dataAndEvents == null ? false : dataAndEvents; dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
return this.map( function () { return this.map(function() {
return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
}); });
}, },
......
...@@ -158,7 +158,7 @@ jQuery.fn.extend({ ...@@ -158,7 +158,7 @@ jQuery.fn.extend({
}); });
// Create scrollLeft and scrollTop methods // 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; var top = "pageYOffset" === prop;
jQuery.fn[ method ] = function( val ) { jQuery.fn[ method ] = function( val ) {
......
...@@ -126,7 +126,7 @@ jQuery.fn.extend({ ...@@ -126,7 +126,7 @@ jQuery.fn.extend({
} }
type = type || "fx"; type = type || "fx";
while( i-- ) { while ( i-- ) {
tmp = data_priv.get( elements[ i ], type + "queueHooks" ); tmp = data_priv.get( elements[ i ], type + "queueHooks" );
if ( tmp && tmp.empty ) { if ( tmp && tmp.empty ) {
count++; count++;
......
...@@ -80,25 +80,26 @@ jQuery.fn.extend({ ...@@ -80,25 +80,26 @@ jQuery.fn.extend({
return jQuery.param( this.serializeArray() ); return jQuery.param( this.serializeArray() );
}, },
serializeArray: function() { serializeArray: function() {
return this.map(function(){ return this.map(function() {
// Can add propHook for "elements" to filter or add form elements // Can add propHook for "elements" to filter or add form elements
var elements = jQuery.prop( this, "elements" ); var elements = jQuery.prop( this, "elements" );
return elements ? jQuery.makeArray( elements ) : this; return elements ? jQuery.makeArray( elements ) : this;
}) })
.filter(function(){ .filter(function() {
var type = this.type; 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" ) && return this.name && !jQuery( this ).is( ":disabled" ) &&
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
( this.checked || !rcheckableType.test( type ) ); ( this.checked || !rcheckableType.test( type ) );
}) })
.map(function( i, elem ){ .map(function( i, elem ) {
var val = jQuery( this ).val(); var val = jQuery( this ).val();
return val == null ? return val == null ?
null : null :
jQuery.isArray( val ) ? jQuery.isArray( val ) ?
jQuery.map( val, function( val ){ jQuery.map( val, function( val ) {
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}) : }) :
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment