Skip to content

Commit c241275

Browse files
committed
Effects.core: Style Commit - double-quotes and threeqals and whitespace
1 parent c89bbc1 commit c241275

File tree

1 file changed

+65
-65
lines changed

1 file changed

+65
-65
lines changed

ui/jquery.effects.core.js

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ $.effects = {
2020
/******************************************************************************/
2121

2222
// override the animation for color styles
23-
$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor',
24-
'borderRightColor', 'borderTopColor', 'borderColor', 'color', 'outlineColor'],
23+
$.each(["backgroundColor", "borderBottomColor", "borderLeftColor",
24+
"borderRightColor", "borderTopColor", "borderColor", "color", "outlineColor"],
2525
function(i, attr) {
2626
$.fx.step[attr] = function(fx) {
2727
if (!fx.colorInit) {
@@ -30,10 +30,10 @@ function(i, attr) {
3030
fx.colorInit = true;
3131
}
3232

33-
fx.elem.style[attr] = 'rgb(' +
34-
Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' +
35-
Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' +
36-
Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')';
33+
fx.elem.style[attr] = "rgb(" +
34+
Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + "," +
35+
Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + "," +
36+
Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ")";
3737
};
3838
});
3939

@@ -46,7 +46,7 @@ function getRGB(color) {
4646
var result;
4747

4848
// Check if we're already dealing with an array of colors
49-
if ( color && color.constructor == Array && color.length == 3 )
49+
if ( color && color.constructor === Array && color.length === 3 )
5050
return color;
5151

5252
// Look for rgb(num,num,num)
@@ -67,7 +67,7 @@ function getRGB(color) {
6767

6868
// Look for rgba(0, 0, 0, 0) == transparent in Safari 3
6969
if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
70-
return colors['transparent'];
70+
return colors["transparent"];
7171

7272
// Otherwise, we're most likely dealing with a named color
7373
return colors[$.trim(color).toLowerCase()];
@@ -80,7 +80,7 @@ function getColor(elem, attr) {
8080
color = $.curCSS(elem, attr);
8181

8282
// Keep going until we find an element that has color, or we hit the body
83-
if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") )
83+
if ( color != "" && color !== "transparent" || $.nodeName(elem, "body") )
8484
break;
8585

8686
attr = "backgroundColor";
@@ -160,15 +160,15 @@ var classAnimationActions = [ "add", "remove", "toggle" ],
160160
},
161161
// prefix used for storing data on .data()
162162
dataSpace = "ec.storage.";
163-
163+
164164
$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function(_, prop) {
165165
$.fx.step[ prop ] = function( fx ) {
166166
if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
167167
jQuery.style( fx.elem, prop, fx.end );
168168
fx.setAttr = true;
169169
}
170170
};
171-
})
171+
});
172172

173173
function getElementStyles() {
174174
var style = document.defaultView
@@ -225,7 +225,7 @@ $.effects.animateClass = function( value, duration, easing, callback ) {
225225
var animated = $( this ),
226226
baseClass = animated.attr( "class" ),
227227
finalClass,
228-
originalStyleAttr = animated.attr( "style" ) || ' ',
228+
originalStyleAttr = animated.attr( "style" ) || " ",
229229
originalStyle = getElementStyles.call( this ),
230230
newStyle,
231231
diff,
@@ -249,11 +249,11 @@ $.effects.animateClass = function( value, duration, easing, callback ) {
249249
complete: function() {
250250
animated.attr( "class", finalClass );
251251

252-
if ( typeof animated.attr( 'style' ) == 'object' ) {
253-
animated.attr( 'style' ).cssText = '';
254-
animated.attr( 'style' ).cssText = originalStyleAttr;
252+
if ( typeof animated.attr( "style" ) === "object" ) {
253+
animated.attr( "style" ).cssText = "";
254+
animated.attr( "style" ).cssText = originalStyleAttr;
255255
} else {
256-
animated.attr( 'style', originalStyleAttr );
256+
animated.attr( "style", originalStyleAttr );
257257
}
258258

259259
// this is guarnteed to be there if you use jQuery.speed()
@@ -267,21 +267,21 @@ $.effects.animateClass = function( value, duration, easing, callback ) {
267267
$.fn.extend({
268268
_addClass: $.fn.addClass,
269269
addClass: function( classNames, speed, easing, callback ) {
270-
return speed ?
270+
return speed ?
271271
$.effects.animateClass.apply( this, [{ add: classNames }, speed, easing, callback ]) :
272272
this._addClass(classNames);
273273
},
274274

275275
_removeClass: $.fn.removeClass,
276276
removeClass: function( classNames, speed, easing, callback ) {
277-
return speed ?
277+
return speed ?
278278
$.effects.animateClass.apply( this, [{ remove: classNames }, speed, easing, callback ]) :
279279
this._removeClass(classNames);
280280
},
281281

282282
_toggleClass: $.fn.toggleClass,
283283
toggleClass: function( classNames, force, speed, easing, callback ) {
284-
if ( typeof force == "boolean" || force === undefined ) {
284+
if ( typeof force === "boolean" || force === undefined ) {
285285
if ( !speed ) {
286286
// without speed parameter;
287287
return this._toggleClass( classNames, force );
@@ -295,9 +295,9 @@ $.fn.extend({
295295
},
296296

297297
switchClass: function( remove, add, speed, easing, callback) {
298-
return $.effects.animateClass.apply( this, [{
299-
add: add,
300-
remove: remove
298+
return $.effects.animateClass.apply( this, [{
299+
add: add,
300+
remove: remove
301301
}, speed, easing, callback ]);
302302
}
303303
});
@@ -330,26 +330,26 @@ $.extend( $.effects, {
330330
},
331331

332332
setMode: function( el, mode ) {
333-
if (mode == 'toggle') {
334-
mode = el.is( ':hidden' ) ? 'show' : 'hide';
333+
if (mode === "toggle") {
334+
mode = el.is( ":hidden" ) ? "show" : "hide";
335335
}
336336
return mode;
337337
},
338338

339339
// Translates a [top,left] array into a baseline value
340340
// this should be a little more flexible in the future to handle a string & hash
341-
getBaseline: function( origin, original ) {
341+
getBaseline: function( origin, original ) {
342342
var y, x;
343343
switch ( origin[ 0 ] ) {
344-
case 'top': y = 0; break;
345-
case 'middle': y = 0.5; break;
346-
case 'bottom': y = 1; break;
344+
case "top": y = 0; break;
345+
case "middle": y = 0.5; break;
346+
case "bottom": y = 1; break;
347347
default: y = origin[ 0 ] / original.height;
348348
};
349349
switch ( origin[ 1 ] ) {
350-
case 'left': x = 0; break;
351-
case 'center': x = 0.5; break;
352-
case 'right': x = 1; break;
350+
case "left": x = 0; break;
351+
case "center": x = 0.5; break;
352+
case "right": x = 1; break;
353353
default: x = origin[ 1 ] / original.width;
354354
};
355355
return {
@@ -362,22 +362,22 @@ $.extend( $.effects, {
362362
createWrapper: function( element ) {
363363

364364
// if the element is already wrapped, return it
365-
if ( element.parent().is( '.ui-effects-wrapper' )) {
365+
if ( element.parent().is( ".ui-effects-wrapper" )) {
366366
return element.parent();
367367
}
368368

369369
// wrap the element
370370
var props = {
371371
width: element.outerWidth(true),
372372
height: element.outerHeight(true),
373-
'float': element.css( 'float' )
373+
"float": element.css( "float" )
374374
},
375-
wrapper = $( '<div></div>' )
376-
.addClass( 'ui-effects-wrapper' )
375+
wrapper = $( "<div></div>" )
376+
.addClass( "ui-effects-wrapper" )
377377
.css({
378-
fontSize: '100%',
379-
background: 'transparent',
380-
border: 'none',
378+
fontSize: "100%",
379+
background: "transparent",
380+
border: "none",
381381
margin: 0,
382382
padding: 0
383383
});
@@ -386,34 +386,34 @@ $.extend( $.effects, {
386386
wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element
387387

388388
// transfer positioning properties to the wrapper
389-
if ( element.css( 'position' ) == 'static' ) {
390-
wrapper.css({ position: 'relative' });
391-
element.css({ position: 'relative' });
389+
if ( element.css( "position" ) === "static" ) {
390+
wrapper.css({ position: "relative" });
391+
element.css({ position: "relative" });
392392
} else {
393393
$.extend( props, {
394-
position: element.css( 'position' ),
395-
zIndex: element.css( 'z-index' )
394+
position: element.css( "position" ),
395+
zIndex: element.css( "z-index" )
396396
});
397-
$.each([ 'top', 'left', 'bottom', 'right' ], function(i, pos) {
397+
$.each([ "top", "left", "bottom", "right" ], function(i, pos) {
398398
props[ pos ] = element.css( pos );
399399
if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
400-
props[ pos ] = 'auto';
400+
props[ pos ] = "auto";
401401
}
402402
});
403403
element.css({
404-
position: 'relative',
404+
position: "relative",
405405
top: 0,
406406
left: 0,
407-
right: 'auto',
408-
bottom: 'auto'
407+
right: "auto",
408+
bottom: "auto"
409409
});
410410
}
411411

412412
return wrapper.css( props ).show();
413413
},
414414

415415
removeWrapper: function( element ) {
416-
if ( element.parent().is( '.ui-effects-wrapper' ) )
416+
if ( element.parent().is( ".ui-effects-wrapper" ) )
417417
return element.parent().replaceWith( element );
418418
return element;
419419
},
@@ -452,7 +452,7 @@ function _normalizeArguments( effect, options, speed, callback ) {
452452
}
453453

454454
// catch (effect, speed, ?)
455-
if ( $.type( options ) == 'number' || $.fx.speeds[ options ]) {
455+
if ( $.type( options ) === "number" || $.fx.speeds[ options ]) {
456456
callback = speed;
457457
speed = options;
458458
options = {};
@@ -468,9 +468,9 @@ function _normalizeArguments( effect, options, speed, callback ) {
468468
if ( options ) {
469469
$.extend( effect, options );
470470
}
471-
471+
472472
speed = speed || options.duration;
473-
effect.duration = $.fx.off ? 0 : typeof speed == 'number'
473+
effect.duration = $.fx.off ? 0 : typeof speed === "number"
474474
? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default;
475475

476476
effect.complete = callback || options.complete;
@@ -483,7 +483,7 @@ function standardSpeed( speed ) {
483483
if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
484484
return true;
485485
}
486-
486+
487487
// invalid strings - treat as "normal" speed
488488
if ( typeof speed === "string" && !$.effects.effect[ speed ] ) {
489489
// TODO: remove in 2.0 (#7115)
@@ -492,7 +492,7 @@ function standardSpeed( speed ) {
492492
}
493493
return true;
494494
}
495-
495+
496496
return false;
497497
}
498498

@@ -538,7 +538,7 @@ $.fn.extend({
538538
return this._show.apply( this, arguments );
539539
} else {
540540
var args = _normalizeArguments.apply( this, arguments );
541-
args.mode = 'show';
541+
args.mode = "show";
542542
return this.effect.call( this, args );
543543
}
544544
},
@@ -549,7 +549,7 @@ $.fn.extend({
549549
return this._hide.apply( this, arguments );
550550
} else {
551551
var args = _normalizeArguments.apply( this, arguments );
552-
args.mode = 'hide';
552+
args.mode = "hide";
553553
return this.effect.call( this, args );
554554
}
555555
},
@@ -561,7 +561,7 @@ $.fn.extend({
561561
return this.__toggle.apply( this, arguments );
562562
} else {
563563
var args = _normalizeArguments.apply( this, arguments );
564-
args.mode = 'toggle';
564+
args.mode = "toggle";
565565
return this.effect.call( this, args );
566566
}
567567
},
@@ -571,7 +571,7 @@ $.fn.extend({
571571
var style = this.css( key ),
572572
val = [];
573573

574-
$.each( [ 'em', 'px', '%', 'pt' ], function( i, unit ) {
574+
$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
575575
if ( style.indexOf( unit ) > 0 )
576576
val = [ parseFloat( style ), unit ];
577577
});
@@ -626,7 +626,7 @@ $.fn.extend({
626626
$.easing.jswing = $.easing.swing;
627627

628628
$.extend( $.easing, {
629-
def: 'easeOutQuad',
629+
def: "easeOutQuad",
630630
swing: function ( x, t, b, c, d ) {
631631
return $.easing[ $.easing.def ]( x, t, b, c, d );
632632
},
@@ -707,9 +707,9 @@ $.extend( $.easing, {
707707
a = c;
708708
if ( t == 0 ) return b;
709709
if ( ( t /= d ) == 1 ) return b+c;
710-
if ( a < Math.abs( c ) ) {
711-
a = c;
712-
s = p / 4;
710+
if ( a < Math.abs( c ) ) {
711+
a = c;
712+
s = p / 4;
713713
} else {
714714
s = p / ( 2 * Math.PI ) * Math.asin( c / a );
715715
}
@@ -722,8 +722,8 @@ $.extend( $.easing, {
722722
if ( t == 0 ) return b;
723723
if ( ( t /= d ) == 1 ) return b+c;
724724
if ( a < Math.abs( c ) ) {
725-
a = c;
726-
s = p / 4;
725+
a = c;
726+
s = p / 4;
727727
} else {
728728
s = p / ( 2 * Math.PI ) * Math.asin( c / a );
729729
}
@@ -735,7 +735,7 @@ $.extend( $.easing, {
735735
a = c;
736736
if ( t == 0 ) return b;
737737
if ( ( t /= d / 2 ) == 2 ) return b+c;
738-
if ( a < Math.abs( c ) ) {
738+
if ( a < Math.abs( c ) ) {
739739
a = c;
740740
s = p / 4;
741741
} else {

0 commit comments

Comments
 (0)