Skip to content

Commit 0e19297

Browse files
committed
Fix various coding style issues
1 parent 89ae764 commit 0e19297

15 files changed

+38
-47
lines changed

ui/jquery.ui.autocomplete.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ $.widget( "ui.autocomplete", {
8686
suppressInput = false;
8787
suppressKeyPressRepeat = false;
8888
var keyCode = $.ui.keyCode;
89-
switch( event.keyCode ) {
89+
switch ( event.keyCode ) {
9090
case keyCode.PAGE_UP:
9191
suppressKeyPress = true;
9292
this._move( "previousPage", event );
@@ -149,7 +149,7 @@ $.widget( "ui.autocomplete", {
149149

150150
// replicate some key handlers to allow them to repeat in Firefox and Opera
151151
var keyCode = $.ui.keyCode;
152-
switch( event.keyCode ) {
152+
switch ( event.keyCode ) {
153153
case keyCode.PAGE_UP:
154154
this._move( "previousPage", event );
155155
break;
@@ -570,7 +570,6 @@ $.extend( $.ui.autocomplete, {
570570
}
571571
});
572572

573-
574573
// live region extension, adding a `messages` option
575574
// NOTE: This is an experimental API. We are still investigating
576575
// a full solution for string manipulation and internationalization.

ui/jquery.ui.core.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,6 @@ if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
211211
})( $.fn.removeData );
212212
}
213213

214-
215-
216-
217-
218214
// deprecated
219215
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
220216

ui/jquery.ui.droppable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ $.ui.ddmanager = {
284284
}
285285

286286
// Filter out elements in the current dragged item
287-
for ( j=0; j < list.length; j++ ) {
287+
for ( j = 0; j < list.length; j++ ) {
288288
if ( list[ j ] === m[ i ].element[ 0 ] ) {
289289
m[ i ].proportions().height = 0;
290290
continue droppablesLoop;
@@ -362,7 +362,7 @@ $.ui.ddmanager = {
362362
if ( this.options.greedy ) {
363363
// find droppable parents with same scope
364364
scope = this.options.scope;
365-
parent = this.element.parents( ":data(ui-droppable)" ).filter(function () {
365+
parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
366366
return $( this ).droppable( "instance" ).options.scope === scope;
367367
});
368368

ui/jquery.ui.effect-blind.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ $.effects.effect.blind = function( o, done ) {
5656
// start at 0 if we are showing
5757
if ( show ) {
5858
wrapper.css( ref, 0 );
59-
if ( ! motion ) {
59+
if ( !motion ) {
6060
wrapper.css( ref2, margin + distance );
6161
}
6262
}

ui/jquery.ui.effect-explode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ $.effects.effect.explode = function( o, done ) {
4141
}
4242

4343
// clone the element for each row and cell.
44-
for( i = 0; i < rows ; i++ ) { // ===>
44+
for ( i = 0; i < rows ; i++ ) { // ===>
4545
top = offset.top + i * height;
4646
my = i - ( rows - 1 ) / 2 ;
4747

48-
for( j = 0; j < cells ; j++ ) { // |||
48+
for ( j = 0; j < cells ; j++ ) { // |||
4949
left = offset.left + j * width;
5050
mx = j - ( cells - 1 ) / 2 ;
5151

ui/jquery.ui.effect-scale.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ $.effects.effect.scale = function( o, done ) {
4242

4343
// Set default origin and restore for show/hide
4444
if ( mode !== "effect" ) {
45-
options.origin = origin || ["middle","center"];
45+
options.origin = origin || [ "middle", "center" ];
4646
options.restore = true;
4747
}
4848

ui/jquery.ui.effect-shake.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $.effects.effect.shake = function( o, done ) {
2222
distance = o.distance || 20,
2323
times = o.times || 3,
2424
anims = times * 2 + 1,
25-
speed = Math.round(o.duration/anims),
25+
speed = Math.round( o.duration / anims ),
2626
ref = (direction === "up" || direction === "down") ? "top" : "left",
2727
positiveMotion = (direction === "up" || direction === "left"),
2828
animation = {},

ui/jquery.ui.effect-size.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ $.effects.effect.size = function( o, done ) {
125125
hProps = hProps.concat([ "marginLeft", "marginRight" ]);
126126
props2 = props0.concat(vProps).concat(hProps);
127127

128-
el.find( "*[width]" ).each( function(){
128+
el.find( "*[width]" ).each( function() {
129129
var child = $( this ),
130130
c_original = {
131131
height: child.height(),
@@ -183,7 +183,7 @@ $.effects.effect.size = function( o, done ) {
183183
if ( el.to.opacity === 0 ) {
184184
el.css( "opacity", el.from.opacity );
185185
}
186-
if( mode === "hide" ) {
186+
if ( mode === "hide" ) {
187187
el.hide();
188188
}
189189
$.effects.restore( el, props );

ui/jquery.ui.effect-transfer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ $.effects.effect.transfer = function( o, done ) {
2222
fixLeft = targetFixed ? body.scrollLeft() : 0,
2323
endPosition = target.offset(),
2424
animation = {
25-
top: endPosition.top - fixTop ,
26-
left: endPosition.left - fixLeft ,
25+
top: endPosition.top - fixTop,
26+
left: endPosition.left - fixLeft,
2727
height: target.innerHeight(),
2828
width: target.innerWidth()
2929
},
@@ -32,8 +32,8 @@ $.effects.effect.transfer = function( o, done ) {
3232
.appendTo( document.body )
3333
.addClass( o.className )
3434
.css({
35-
top: startPosition.top - fixTop ,
36-
left: startPosition.left - fixLeft ,
35+
top: startPosition.top - fixTop,
36+
left: startPosition.left - fixLeft,
3737
height: elem.innerHeight(),
3838
width: elem.innerWidth(),
3939
position: targetFixed ? "fixed" : "absolute"

ui/jquery.ui.effect.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $.effects = {
3333
// plusequals test for += 100 -= 100
3434
rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
3535
// a set of RE's that can match strings and generate color tuples.
36-
stringParsers = [{
36+
stringParsers = [ {
3737
re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
3838
parse: function( execResult ) {
3939
return [
@@ -84,7 +84,7 @@ $.effects = {
8484
execResult[ 4 ]
8585
];
8686
}
87-
}],
87+
} ],
8888

8989
// jQuery.Color( )
9090
color = jQuery.Color = function( color, green, blue, alpha ) {
@@ -443,18 +443,18 @@ color.fn.parse.prototype = color.fn;
443443
function hue2rgb( p, q, h ) {
444444
h = ( h + 1 ) % 1;
445445
if ( h * 6 < 1 ) {
446-
return p + (q - p) * h * 6;
446+
return p + ( q - p ) * h * 6;
447447
}
448448
if ( h * 2 < 1) {
449449
return q;
450450
}
451451
if ( h * 3 < 2 ) {
452-
return p + (q - p) * ((2/3) - h) * 6;
452+
return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
453453
}
454454
return p;
455455
}
456456

457-
spaces.hsla.to = function ( rgba ) {
457+
spaces.hsla.to = function( rgba ) {
458458
if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
459459
return [ null, null, null, rgba[ 3 ] ];
460460
}
@@ -491,7 +491,7 @@ spaces.hsla.to = function ( rgba ) {
491491
return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
492492
};
493493

494-
spaces.hsla.from = function ( hsla ) {
494+
spaces.hsla.from = function( hsla ) {
495495
if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
496496
return [ null, null, null, hsla[ 3 ] ];
497497
}
@@ -510,7 +510,6 @@ spaces.hsla.from = function ( hsla ) {
510510
];
511511
};
512512

513-
514513
each( spaces, function( spaceName, space ) {
515514
var props = space.props,
516515
cache = space.cache,
@@ -680,7 +679,6 @@ colors = jQuery.Color.names = {
680679

681680
})( jQuery );
682681

683-
684682
/******************************************************************************/
685683
/****************************** CLASS ANIMATIONS ******************************/
686684
/******************************************************************************/
@@ -735,7 +733,6 @@ function getElementStyles( elem ) {
735733
return styles;
736734
}
737735

738-
739736
function styleDifference( oldStyle, newStyle ) {
740737
var diff = {},
741738
name, value;
@@ -897,7 +894,7 @@ $.extend( $.effects, {
897894

898895
// Saves a set of properties in a data storage
899896
save: function( element, set ) {
900-
for( var i=0; i < set.length; i++ ) {
897+
for ( var i = 0; i < set.length; i++ ) {
901898
if ( set[ i ] !== null ) {
902899
element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
903900
}
@@ -907,7 +904,7 @@ $.extend( $.effects, {
907904
// Restores a set of previously saved properties from a data storage
908905
restore: function( element, set ) {
909906
var val, i;
910-
for( i=0; i < set.length; i++ ) {
907+
for ( i = 0; i < set.length; i++ ) {
911908
if ( set[ i ] !== null ) {
912909
val = element.data( dataSpace + set[ i ] );
913910
// support: jQuery 1.6.2
@@ -1040,7 +1037,6 @@ $.extend( $.effects, {
10401037
}
10411038
}
10421039

1043-
10441040
return element;
10451041
},
10461042

@@ -1250,10 +1246,10 @@ $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
12501246
});
12511247

12521248
$.extend( baseEasings, {
1253-
Sine: function ( p ) {
1249+
Sine: function( p ) {
12541250
return 1 - Math.cos( p * Math.PI / 2 );
12551251
},
1256-
Circ: function ( p ) {
1252+
Circ: function( p ) {
12571253
return 1 - Math.sqrt( 1 - p * p );
12581254
},
12591255
Elastic: function( p ) {
@@ -1263,7 +1259,7 @@ $.extend( baseEasings, {
12631259
Back: function( p ) {
12641260
return p * p * ( 3 * p - 2 );
12651261
},
1266-
Bounce: function ( p ) {
1262+
Bounce: function( p ) {
12671263
var pow2,
12681264
bounce = 4;
12691265

ui/jquery.ui.mouse.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ $.widget("ui.mouse", {
5656

5757
_mouseDown: function(event) {
5858
// don't let more than one widget handle mouseStart
59-
if( mouseHandled ) { return; }
59+
if ( mouseHandled ) {
60+
return;
61+
}
6062

6163
// we may have missed mouseup (out of window)
6264
(this._mouseStarted && this._mouseUp(event));
@@ -114,9 +116,9 @@ $.widget("ui.mouse", {
114116
// IE mouseup check - mouseup happened when mouse was out of window
115117
if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
116118
return this._mouseUp(event);
117-
}
119+
118120
// Iframe mouseup check - mouseup occurred in another document
119-
else if ( !event.which ) {
121+
} else if ( !event.which ) {
120122
return this._mouseUp( event );
121123
}
122124

ui/jquery.ui.position.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,7 @@ $.ui.position = {
400400
if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
401401
position.left += myOffset + atOffset + offset;
402402
}
403-
}
404-
else if ( overRight > 0 ) {
403+
} else if ( overRight > 0 ) {
405404
newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
406405
if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
407406
position.left += myOffset + atOffset + offset;
@@ -435,8 +434,7 @@ $.ui.position = {
435434
if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {
436435
position.top += myOffset + atOffset + offset;
437436
}
438-
}
439-
else if ( overBottom > 0 ) {
437+
} else if ( overBottom > 0 ) {
440438
newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
441439
if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
442440
position.top += myOffset + atOffset + offset;
@@ -457,7 +455,7 @@ $.ui.position = {
457455
};
458456

459457
// fraction support test
460-
(function () {
458+
(function() {
461459
var testElement, testElementParent, testElementStyle, offsetLeft, i,
462460
body = document.getElementsByTagName( "body" )[ 0 ],
463461
div = document.createElement( "div" );

ui/jquery.ui.selectable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ $.widget("ui.selectable", $.ui.mouse, {
8383
var that = this,
8484
options = this.options;
8585

86-
this.opos = [event.pageX, event.pageY];
86+
this.opos = [ event.pageX, event.pageY ];
8787

8888
if (this.options.disabled) {
8989
return;
@@ -166,7 +166,7 @@ $.widget("ui.selectable", $.ui.mouse, {
166166

167167
if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
168168
if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
169-
this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
169+
this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });
170170

171171
this.selectees.each(function() {
172172
var selectee = $.data(this, "selectable-item"),

ui/jquery.ui.slider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ $.widget( "ui.slider", $.ui.mouse, {
423423
this.options.value = this._values( 0 );
424424
this.options.values = null;
425425
} else if ( value === "max" ) {
426-
this.options.value = this._values( this.options.values.length-1 );
426+
this.options.value = this._values( this.options.values.length - 1 );
427427
this.options.values = null;
428428
}
429429
}

ui/jquery.ui.spinner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ $.widget( "ui.spinner", {
301301
if ( incremental ) {
302302
return $.isFunction( incremental ) ?
303303
incremental( i ) :
304-
Math.floor( i*i*i/50000 - i*i/500 + 17*i/200 + 1 );
304+
Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
305305
}
306306

307307
return 1;

0 commit comments

Comments
 (0)