X Tutup
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

0 commit comments

Comments
 (0)
X Tutup