Skip to content

Commit cb37994

Browse files
committed
No ticket: fix code style inconsistencies. Closes jquerygh-1361
1 parent e12746d commit cb37994

File tree

15 files changed

+32
-31
lines changed

15 files changed

+32
-31
lines changed

src/ajax.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
102102
inspected[ dataType ] = true;
103103
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
104104
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
105-
if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
105+
if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
106106
options.dataTypes.unshift( dataTypeOrTransport );
107107
inspect( dataTypeOrTransport );
108108
return false;
@@ -146,7 +146,7 @@ function ajaxHandleResponses( s, jqXHR, responses ) {
146146
dataTypes = s.dataTypes;
147147

148148
// Remove auto dataType and get content-type in the process
149-
while( dataTypes[ 0 ] === "*" ) {
149+
while ( dataTypes[ 0 ] === "*" ) {
150150
dataTypes.shift();
151151
if ( ct === undefined ) {
152152
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
@@ -510,7 +510,7 @@ jQuery.extend({
510510
s.type = options.method || options.type || s.method || s.type;
511511

512512
// Extract dataTypes list
513-
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [""];
513+
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
514514

515515
// A cross-domain request is in order when we have a protocol:host:port mismatch
516516
if ( s.crossDomain == null ) {
@@ -796,8 +796,8 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
796796
});
797797

798798
// Attach a bunch of functions for handling common AJAX events
799-
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
800-
jQuery.fn[ type ] = function( fn ){
799+
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
800+
jQuery.fn[ type ] = function( fn ) {
801801
return this.on( type, fn );
802802
};
803803
});

src/ajax/parseXML.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jQuery.parseXML = function( data ) {
1212
// Support: IE9
1313
try {
1414
tmp = new DOMParser();
15-
xml = tmp.parseFromString( data , "text/xml" );
15+
xml = tmp.parseFromString( data, "text/xml" );
1616
} catch ( e ) {
1717
xml = undefined;
1818
}

src/ajax/xhr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var xhrSupported = jQuery.ajaxSettings.xhr(),
2626

2727
if ( window.ActiveXObject ) {
2828
jQuery( window ).on( "unload", function() {
29-
for( var key in xhrCallbacks ) {
29+
for ( var key in xhrCallbacks ) {
3030
xhrCallbacks[ key ]();
3131
}
3232
xhrCallbacks = undefined;

src/attributes/support.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ define([
22
"../var/support"
33
], function( support ) {
44

5-
(function () {
5+
(function() {
66
var input = document.createElement( "input" ),
77
select = document.createElement( "select" ),
88
opt = select.appendChild( document.createElement( "option" ) );

src/attributes/val.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ jQuery.fn.extend({
4949
// Treat null/undefined as ""; convert numbers to string
5050
if ( val == null ) {
5151
val = "";
52+
5253
} else if ( typeof val === "number" ) {
5354
val += "";
55+
5456
} else if ( jQuery.isArray( val ) ) {
55-
val = jQuery.map(val, function ( value ) {
57+
val = jQuery.map( val, function( value ) {
5658
return value == null ? "" : value + "";
5759
});
5860
}

src/callbacks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jQuery.Callbacks = function( options ) {
126126
if ( list ) {
127127
jQuery.each( arguments, function( _, arg ) {
128128
var index;
129-
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
129+
while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
130130
list.splice( index, 1 );
131131
// Handle firing indexes
132132
if ( firing ) {

src/css/support.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ define([
33
"../var/support"
44
], function( jQuery, support ) {
55

6-
(function () {
6+
(function() {
77
var pixelPositionVal, boxSizingReliableVal,
88
// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
99
divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;" +

src/deferred.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jQuery.extend({
109109
return function( value ) {
110110
contexts[ i ] = this;
111111
values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
112-
if( values === progressValues ) {
112+
if ( values === progressValues ) {
113113
deferred.notifyWith( contexts, values );
114114
} else if ( !( --remaining ) ) {
115115
deferred.resolveWith( contexts, values );

src/effects.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var
1414
rrun = /queueHooks$/,
1515
animationPrefilters = [ defaultPrefilter ],
1616
tweeners = {
17-
"*": [function( prop, value ) {
17+
"*": [ function( prop, value ) {
1818
var tween = this.createTween( prop, value ),
1919
target = tween.cur(),
2020
parts = rfxnum.exec( value ),
@@ -61,7 +61,7 @@ var
6161
}
6262

6363
return tween;
64-
}]
64+
} ]
6565
};
6666

6767
// Dependencies not needed as vars
@@ -89,7 +89,7 @@ function genFx( type, includeWidth ) {
8989
// if we include width, step value is 1 to do all cssExpand values,
9090
// if we don't include width, step value is 2 to skip over Left and Right
9191
includeWidth = includeWidth ? 1 : 0;
92-
for( ; i < 4 ; i += 2 - includeWidth ) {
92+
for ( ; i < 4 ; i += 2 - includeWidth ) {
9393
which = cssExpand[ i ];
9494
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
9595
}
@@ -181,7 +181,6 @@ function defaultPrefilter( elem, props, opts ) {
181181
});
182182
}
183183

184-
185184
// show/hide pass
186185
for ( prop in props ) {
187186
value = props[ prop ];

src/effects/Tween.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jQuery.easing = {
102102
return p;
103103
},
104104
swing: function( p ) {
105-
return 0.5 - Math.cos( p*Math.PI ) / 2;
105+
return 0.5 - Math.cos( p * Math.PI ) / 2;
106106
}
107107
};
108108

src/event.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jQuery.event = {
8181
}
8282

8383
// Handle multiple events separated by a space
84-
types = ( types || "" ).match( rnotwhite ) || [""];
84+
types = ( types || "" ).match( rnotwhite ) || [ "" ];
8585
t = types.length;
8686
while ( t-- ) {
8787
tmp = rtypenamespace.exec( types[t] ) || [];
@@ -163,7 +163,7 @@ jQuery.event = {
163163
}
164164

165165
// Once for each type.namespace in types; type may be omitted
166-
types = ( types || "" ).match( rnotwhite ) || [""];
166+
types = ( types || "" ).match( rnotwhite ) || [ "" ];
167167
t = types.length;
168168
while ( t-- ) {
169169
tmp = rtypenamespace.exec( types[t] ) || [];
@@ -538,7 +538,7 @@ jQuery.event = {
538538
event.target = event.target.parentNode;
539539
}
540540

541-
return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
541+
return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
542542
},
543543

544544
special: {

src/manipulation.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Require more than a few needed variables
22
// Keep in mind that a dependency array cannot be used with CommonJS+AMD syntax
3-
define(function( require ){
3+
define(function( require ) {
44

55
var
66
jQuery = require( "./core" ),
@@ -48,7 +48,6 @@ require( "./traversing" );
4848
require( "./selector" );
4949
require( "./event" );
5050

51-
5251
// Support: 1.x compatibility
5352
// Manipulating tables requires a tbody
5453
function manipulationTarget( elem, content ) {
@@ -218,7 +217,7 @@ jQuery.extend({
218217
tmp = tmp || fragment.appendChild( context.createElement("div") );
219218

220219
// Deserialize a standard representation
221-
tag = ( rtagName.exec( elem ) || ["", ""] )[ 1 ].toLowerCase();
220+
tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
222221
wrap = wrapMap[ tag ] || wrapMap._default;
223222
tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
224223

@@ -398,7 +397,7 @@ jQuery.fn.extend({
398397
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
399398
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
400399

401-
return this.map( function () {
400+
return this.map(function() {
402401
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
403402
});
404403
},

src/offset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ jQuery.fn.extend({
158158
});
159159

160160
// Create scrollLeft and scrollTop methods
161-
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
161+
jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
162162
var top = "pageYOffset" === prop;
163163

164164
jQuery.fn[ method ] = function( val ) {

src/queue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jQuery.fn.extend({
126126
}
127127
type = type || "fx";
128128

129-
while( i-- ) {
129+
while ( i-- ) {
130130
tmp = data_priv.get( elements[ i ], type + "queueHooks" );
131131
if ( tmp && tmp.empty ) {
132132
count++;

src/serialize.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,26 @@ jQuery.fn.extend({
8080
return jQuery.param( this.serializeArray() );
8181
},
8282
serializeArray: function() {
83-
return this.map(function(){
83+
return this.map(function() {
8484
// Can add propHook for "elements" to filter or add form elements
8585
var elements = jQuery.prop( this, "elements" );
8686
return elements ? jQuery.makeArray( elements ) : this;
8787
})
88-
.filter(function(){
88+
.filter(function() {
8989
var type = this.type;
90-
// Use .is(":disabled") so that fieldset[disabled] works
90+
91+
// Use .is( ":disabled" ) so that fieldset[ disabled ] works
9192
return this.name && !jQuery( this ).is( ":disabled" ) &&
9293
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
9394
( this.checked || !rcheckableType.test( type ) );
9495
})
95-
.map(function( i, elem ){
96+
.map(function( i, elem ) {
9697
var val = jQuery( this ).val();
9798

9899
return val == null ?
99100
null :
100101
jQuery.isArray( val ) ?
101-
jQuery.map( val, function( val ){
102+
jQuery.map( val, function( val ) {
102103
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
103104
}) :
104105
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };

0 commit comments

Comments
 (0)