From ccbfd45924d6ddebc7b2bb575a9c8997a3d9ec03 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 2 Apr 2012 15:55:50 -0400 Subject: [PATCH] A few lint fixes. --- ui/jquery.effects.core.js | 18 ++++++++++-------- ui/jquery.effects.drop.js | 13 +++++++------ ui/jquery.effects.scale.js | 31 ++++++++++++++++--------------- ui/jquery.effects.shake.js | 2 +- ui/jquery.effects.slide.js | 5 ++--- ui/jquery.ui.accordion.js | 2 +- ui/jquery.ui.autocomplete.js | 4 ++-- ui/jquery.ui.core.js | 12 ++++++------ ui/jquery.ui.menu.js | 6 +++--- ui/jquery.ui.mouse.js | 2 +- ui/jquery.ui.position.js | 10 +++++----- ui/jquery.ui.tabs.js | 2 +- 12 files changed, 55 insertions(+), 52 deletions(-) diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js index 1f074e6e2..62d6b2c38 100644 --- a/ui/jquery.effects.core.js +++ b/ui/jquery.effects.core.js @@ -171,9 +171,9 @@ $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopS }); function getElementStyles() { - var style = this.ownerDocument.defaultView - ? this.ownerDocument.defaultView.getComputedStyle( this, null ) - : this.currentStyle, + var style = this.ownerDocument.defaultView ? + this.ownerDocument.defaultView.getComputedStyle( this, null ) : + this.currentStyle, newStyle = {}, key, camelCase, @@ -375,13 +375,13 @@ $.extend( $.effects, { case "middle": y = 0.5; break; case "bottom": y = 1; break; default: y = origin[ 0 ] / original.height; - }; + } switch ( origin[ 1 ] ) { case "left": x = 0; break; case "center": x = 0.5; break; case "right": x = 1; break; default: x = origin[ 1 ] / original.width; - }; + } return { x: x, y: y @@ -523,8 +523,10 @@ function _normalizeArguments( effect, options, speed, callback ) { } speed = speed || options.duration; - effect.duration = $.fx.off ? 0 : typeof speed === "number" - ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default; + effect.duration = $.fx.off ? 0 : + typeof speed === "number" ? speed : + speed in $.fx.speeds ? $.fx.speeds[ speed ] : + $.fx.speeds._default; effect.complete = callback || options.complete; @@ -701,7 +703,7 @@ $.each( baseEasings, function( name, easeIn ) { return 1 - easeIn( 1 - p ); }; $.easing[ "easeInOut" + name ] = function( p ) { - return p < .5 ? + return p < 0.5 ? easeIn( p * 2 ) / 2 : easeIn( p * -2 + 2 ) / -2 + 1; }; diff --git a/ui/jquery.effects.drop.js b/ui/jquery.effects.drop.js index 8ccbfe57d..6c72be9e5 100644 --- a/ui/jquery.effects.drop.js +++ b/ui/jquery.effects.drop.js @@ -31,19 +31,19 @@ $.effects.effect.drop = function( o, done ) { el.show(); $.effects.createWrapper( el ); - distance = o.distance || el[ ref == "top" ? "outerHeight": "outerWidth" ]({ margin: true }) / 2; + distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]({ margin: true }) / 2; if ( show ) { el .css( "opacity", 0 ) - .css( ref, motion == "pos" ? -distance : distance ); + .css( ref, motion === "pos" ? -distance : distance ); } // Animation animation[ ref ] = ( show ? ( motion === "pos" ? "+=" : "-=" ) : - ( motion === "pos" ? "-=" : "+=" ) ) - + distance; + ( motion === "pos" ? "-=" : "+=" ) ) + + distance; // Animate el.animate( animation, { @@ -51,13 +51,14 @@ $.effects.effect.drop = function( o, done ) { duration: o.duration, easing: o.easing, complete: function() { - mode == "hide" && el.hide(); + if ( mode === "hide" ) { + el.hide(); + } $.effects.restore( el, props ); $.effects.removeWrapper( el ); done(); } }); - }; })(jQuery); diff --git a/ui/jquery.effects.scale.js b/ui/jquery.effects.scale.js index ea849624b..63b95275c 100644 --- a/ui/jquery.effects.scale.js +++ b/ui/jquery.effects.scale.js @@ -30,9 +30,9 @@ $.effects.effect.puff = function( o, done ) { mode: mode, complete: done, percent: hide ? percent : 100, - from: hide - ? original - : { + from: hide ? + original : + { height: original.height * factor, width: original.width * factor } @@ -47,7 +47,7 @@ $.effects.effect.scale = function( o, done ) { var el = $( this ), options = $.extend( true, {}, o ), mode = $.effects.setMode( el, o.mode || "effect" ), - percent = parseInt( o.percent, 10 ) || ( parseInt( o.percent, 10 ) == 0 ? 0 : ( mode == "hide" ? 0 : 100 ) ), + percent = parseInt( o.percent, 10 ) || ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode == "hide" ? 0 : 100 ) ), direction = o.direction || "both", origin = o.origin, original = { @@ -80,7 +80,8 @@ $.effects.effect.scale = function( o, done ) { outerWidth: original.outerWidth * factor.x }; - if ( options.fade ) { // Fade option to support puff + // Fade option to support puff + if ( options.fade ) { if ( mode == "show" ) { options.from.opacity = 0; options.to.opacity = 1; @@ -89,7 +90,7 @@ $.effects.effect.scale = function( o, done ) { options.from.opacity = 1; options.to.opacity = 0; } - }; + } // Animate el.effect( options ); @@ -152,15 +153,15 @@ $.effects.effect.size = function( o, done ) { props = props.concat( vProps ); el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from ); el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to ); - }; + } // Horizontal props scaling if ( factor.from.x !== factor.to.x ) { props = props.concat( hProps ); el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from ); el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to ); - }; - }; + } + } // Scale the content if ( scale == "content" || scale == "both" ) { @@ -170,9 +171,9 @@ $.effects.effect.size = function( o, done ) { props = props.concat( cProps ); el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from ); el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to ); - }; - }; - + } + } + $.effects.save( el, restore ? props : props1 ); el.show(); $.effects.createWrapper( el ); @@ -217,13 +218,13 @@ $.effects.effect.size = function( o, done ) { if ( factor.from.y != factor.to.y ) { child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from ); child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to ); - }; + } // Horizontal props scaling if ( factor.from.x != factor.to.x ) { child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from ); child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to ); - }; + } // Animate children child.css( child.from ); @@ -233,7 +234,7 @@ $.effects.effect.size = function( o, done ) { if (restore) $.effects.restore( child, props2 ); }); }); - }; + } // Animate el.animate( el.to, { diff --git a/ui/jquery.effects.shake.js b/ui/jquery.effects.shake.js index d027b740d..c6276d15e 100644 --- a/ui/jquery.effects.shake.js +++ b/ui/jquery.effects.shake.js @@ -49,7 +49,7 @@ $.effects.effect.shake = function( o, done ) { // Shakes for ( i = 1; i < times; i++ ) { el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing ); - }; + } el .animate( animation1, speed, o.easing ) .animate( animation, speed / 2, o.easing ) diff --git a/ui/jquery.effects.slide.js b/ui/jquery.effects.slide.js index e747b2e85..5c8eb2566 100644 --- a/ui/jquery.effects.slide.js +++ b/ui/jquery.effects.slide.js @@ -44,8 +44,8 @@ $.effects.effect.slide = function( o, done ) { // Animation animation[ ref ] = ( show ? ( positiveMotion ? "+=" : "-=") : - ( positiveMotion ? "-=" : "+=")) - + distance; + ( positiveMotion ? "-=" : "+=")) + + distance; // Animate el.animate( animation, { @@ -61,7 +61,6 @@ $.effects.effect.slide = function( o, done ) { done(); } }); - }; })(jQuery); diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 630d40d4e..92245d28e 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -695,7 +695,7 @@ if ( $.uiBackCompat !== false ) { easing: "easeOutBounce", duration: 1000 } - } + }; } else { options.animate = options.animated; } diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 866ed7798..07992ab2e 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -108,7 +108,7 @@ $.widget( "ui.autocomplete", { suppressKeyPress = true; event.preventDefault(); } - //passthrough - ENTER and TAB both select the current element + // passthrough - ENTER and TAB both select the current element case keyCode.TAB: if ( !self.menu.active ) { return; @@ -270,7 +270,7 @@ $.widget( "ui.autocomplete", { .data( "menu" ); if ( $.fn.bgiframe ) { - this.menu.element.bgiframe(); + this.menu.element.bgiframe(); } // turning off autocomplete prevents the browser from remembering the diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 574256cad..f66b71c6e 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -176,13 +176,13 @@ function focusable( element, isTabIndexNotNaN ) { img = $( "img[usemap=#" + mapName + "]" )[0]; return !!img && visible( img ); } - return ( /input|select|textarea|button|object/.test( nodeName ) - ? !element.disabled - : "a" == nodeName - ? element.href || isTabIndexNotNaN - : isTabIndexNotNaN) + return ( /input|select|textarea|button|object/.test( nodeName ) ? + !element.disabled : + "a" == nodeName ? + element.href || isTabIndexNotNaN : + isTabIndexNotNaN) && // the element and all of its ancestors must be visible - && visible( element ); + visible( element ); } function visible( element ) { diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index aeffea026..6d00f66ae 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -368,9 +368,9 @@ $.widget( "ui.menu", { var position = $.extend({}, { of: this.active - }, $.type(this.options.position) == "function" - ? this.options.position(this.active) - : this.options.position + }, $.type(this.options.position) == "function" ? + this.options.position(this.active) : + this.options.position ); submenu.show() diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index 5e7744418..53b3dcc20 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -53,7 +53,7 @@ $.widget("ui.mouse", { _mouseDown: function(event) { // don't let more than one widget handle mouseStart - if( mouseHandled ) { return }; + if( mouseHandled ) { return; } // we may have missed mouseup (out of window) (this._mouseStarted && this._mouseUp(event)); diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index c88f75f7b..7fe31626d 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -152,13 +152,13 @@ $.fn.position = function( options ) { var elem = $( this ), elemWidth = elem.outerWidth(), elemHeight = elem.outerHeight(), - marginLeft = parseInt( $.css( this, "marginLeft" ) ) || 0, - marginTop = parseInt( $.css( this, "marginTop" ) ) || 0, + marginLeft = parseInt( $.css( this, "marginLeft" ), 10 ) || 0, + marginTop = parseInt( $.css( this, "marginTop" ), 10 ) || 0, scrollInfo = $.position.getScrollInfo( within ), collisionWidth = elemWidth + marginLeft + - ( parseInt( $.css( this, "marginRight" ) ) || 0 ) + scrollInfo.width, + ( parseInt( $.css( this, "marginRight" ), 10 ) || 0 ) + scrollInfo.width, collisionHeight = elemHeight + marginTop + - ( parseInt( $.css( this, "marginBottom" ) ) || 0 ) + scrollInfo.height, + ( parseInt( $.css( this, "marginBottom" ), 10 ) || 0 ) + scrollInfo.height, position = $.extend( {}, basePosition ), myOffset = [ parseInt( offsets.my[ 0 ], 10 ) * @@ -483,7 +483,7 @@ if ( $.uiBackCompat !== false ) { at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ], offset: undefined } ) ); - } + }; }( jQuery ) ); } diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index d3ef33121..45888220d 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -966,7 +966,7 @@ if ( $.uiBackCompat !== false ) { }, _cookie: function( active ) { var cookie = [ this.cookie || - ( this.cookie = this.options.cookie.name || "ui-tabs-" + ++listId ) ]; + ( this.cookie = this.options.cookie.name || "ui-tabs-" + (++listId) ) ]; if ( arguments.length ) { cookie.push( active === false ? -1 : active ); cookie.push( this.options.cookie ); -- 2.39.5