diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2011-10-27 12:49:41 -0700 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-10-27 12:49:41 -0700 |
commit | 736d4d770633720493afe1fefd6f135095c5b5f7 (patch) | |
tree | e3b03632598f89af143c528364f508924ba6787a | |
parent | c82dbf1928f54385e83df9ec6de47616f83fe682 (diff) | |
parent | 27d099d47168d823430a1709946263f849639d4c (diff) | |
download | jquery-736d4d770633720493afe1fefd6f135095c5b5f7.tar.gz jquery-736d4d770633720493afe1fefd6f135095c5b5f7.zip |
Merge pull request #565 from rwldrn/10601
Cleanup spacing. Fixes #10601
-rw-r--r-- | src/ajax.js | 2 | ||||
-rw-r--r-- | src/attributes.js | 16 | ||||
-rw-r--r-- | src/core.js | 14 | ||||
-rw-r--r-- | src/css.js | 4 | ||||
-rw-r--r-- | src/effects.js | 8 | ||||
-rw-r--r-- | src/event.js | 18 | ||||
-rw-r--r-- | src/manipulation.js | 8 | ||||
-rw-r--r-- | src/offset.js | 10 | ||||
-rw-r--r-- | src/outro.js | 2 | ||||
-rw-r--r-- | src/queue.js | 4 | ||||
-rw-r--r-- | src/support.js | 10 | ||||
-rw-r--r-- | src/traversing.js | 4 |
12 files changed, 50 insertions, 50 deletions
diff --git a/src/ajax.js b/src/ajax.js index 3736a7431..cfd43d991 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -681,7 +681,7 @@ jQuery.extend({ ret = s.url.replace( rts, "$1_=" + ts ); // if nothing was replaced, add timestamp to the end - s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); + s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); } } diff --git a/src/attributes.js b/src/attributes.js index 58549ec42..b7c1f4a82 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -83,7 +83,7 @@ jQuery.fn.extend({ } if ( (value && typeof value === "string") || value === undefined ) { - classNames = (value || "").split( rspace ); + classNames = ( value || "" ).split( rspace ); for ( i = 0, l = this.length; i < l; i++ ) { elem = this[ i ]; @@ -320,7 +320,7 @@ jQuery.extend({ // Grab necessary hook if one is defined if ( notxml ) { name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || (rboolean.test( name ) ? boolHook : nodeHook); + hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { @@ -356,7 +356,7 @@ jQuery.extend({ i = 0; if ( elem.nodeType === 1 ) { - attrNames = (value || "").split( rspace ); + attrNames = ( value || "" ).split( rspace ); l = attrNames.length; for ( ; i < l; i++ ) { @@ -452,7 +452,7 @@ jQuery.extend({ return ret; } else { - return (elem[ name ] = value); + return ( elem[ name ] = value ); } } else { @@ -530,7 +530,7 @@ if ( !getSetAttribute ) { get: function( elem, name ) { var ret; ret = elem.getAttributeNode( name ); - return ret && (fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified) ? + return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? ret.nodeValue : undefined; }, @@ -541,7 +541,7 @@ if ( !getSetAttribute ) { ret = document.createAttribute( name ); elem.setAttributeNode( ret ); } - return (ret.nodeValue = value + ""); + return ( ret.nodeValue = value + "" ); } }; @@ -595,7 +595,7 @@ if ( !jQuery.support.style ) { return elem.style.cssText.toLowerCase() || undefined; }, set: function( elem, value ) { - return (elem.style.cssText = "" + value); + return ( elem.style.cssText = "" + value ); } }; } @@ -640,7 +640,7 @@ jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { - return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0); + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }); diff --git a/src/core.js b/src/core.js index e28c1b524..9e5a5523d 100644 --- a/src/core.js +++ b/src/core.js @@ -119,7 +119,7 @@ jQuery.fn = jQuery.prototype = { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; - doc = (context ? context.ownerDocument || context : document); + doc = ( context ? context.ownerDocument || context : document ); // If a single string is passed in and it's a single tag // just do a createElement and skip the rest @@ -136,7 +136,7 @@ jQuery.fn = jQuery.prototype = { } else { ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; + selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; } return jQuery.merge( this, selector ); @@ -166,7 +166,7 @@ jQuery.fn = jQuery.prototype = { // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { - return (context || rootjQuery).find( selector ); + return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) @@ -180,7 +180,7 @@ jQuery.fn = jQuery.prototype = { return rootjQuery.ready( selector ); } - if (selector.selector !== undefined) { + if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } @@ -237,7 +237,7 @@ jQuery.fn = jQuery.prototype = { ret.context = this.context; if ( name === "find" ) { - ret.selector = this.selector + (this.selector ? " " : "") + selector; + ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; } else if ( name ) { ret.selector = this.selector + "." + name + "(" + selector + ")"; } @@ -552,7 +552,7 @@ jQuery.extend({ .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { - return (new Function( "return " + data ))(); + return ( new Function( "return " + data ) )(); } jQuery.error( "Invalid JSON: " + data ); @@ -833,7 +833,7 @@ jQuery.extend({ }, now: function() { - return (new Date()).getTime(); + return ( new Date() ).getTime(); }, // Use of jQuery.browser is frowned upon. diff --git a/src/css.js b/src/css.js index ba645fb46..0735fc3d8 100644 --- a/src/css.js +++ b/src/css.js @@ -307,7 +307,7 @@ if ( document.documentElement.currentStyle ) { if ( rsLeft ) { elem.runtimeStyle.left = elem.currentStyle.left; } - style.left = name === "fontSize" ? "1em" : (ret || 0); + style.left = name === "fontSize" ? "1em" : ( ret || 0 ); ret = style.pixelLeft + "px"; // Revert the changed values @@ -375,7 +375,7 @@ if ( jQuery.expr && jQuery.expr.filters ) { var width = elem.offsetWidth, height = elem.offsetHeight; - return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); + return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { diff --git a/src/effects.js b/src/effects.js index 9be9293e5..458b1eae7 100644 --- a/src/effects.js +++ b/src/effects.js @@ -203,7 +203,7 @@ jQuery.fn.extend({ // Tracks whether to show or hide based on private // data attached to the element - method = jQuery._data( this, "toggle" + p ) || (val === "toggle" ? hidden ? "show" : "hide" : 0); + method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 ); if ( method ) { jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" ); e[ method ](); @@ -222,7 +222,7 @@ jQuery.fn.extend({ // We need to compute starting value if ( unit !== "px" ) { jQuery.style( this, p, (end || 1) + unit); - start = ((end || 1) / e.cur()) * start; + start = ( (end || 1) / e.cur() ) * start; jQuery.style( this, p, start + unit); } @@ -385,7 +385,7 @@ jQuery.extend({ return firstNum + diff * p; }, swing: function( p, n, firstNum, diff ) { - return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; + return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum; } }, @@ -408,7 +408,7 @@ jQuery.fx.prototype = { this.options.step.call( this.elem, this.now, this ); } - (jQuery.fx.step[ this.prop ] || jQuery.fx.step._default)( this ); + ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this ); }, // Get the current size diff --git a/src/event.js b/src/event.js index 2171f4be4..3576bffca 100644 --- a/src/event.js +++ b/src/event.js @@ -81,7 +81,7 @@ jQuery.event = { tns = rtypenamespace.exec( types[t] ) || []; type = tns[1]; - namespaces = (tns[2] || "").split( "." ).sort(); + namespaces = ( tns[2] || "" ).split( "." ).sort(); // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; @@ -166,7 +166,7 @@ jQuery.event = { } // Once for each type.namespace in types; type may be omitted - types = (types || "").replace( rhoverHack, "mouseover$1 mouseout$1" ).split(" "); + types = ( types || "" ).replace( rhoverHack, "mouseover$1 mouseout$1" ).split(" "); for ( t = 0; t < types.length; t++ ) { tns = rtypenamespace.exec( types[t] ) || []; type = tns[1]; @@ -347,7 +347,7 @@ jQuery.event = { cur = eventPath[i][0]; event.type = eventPath[i][1]; - handle = (jQuery._data( cur, "events" ) || {})[ event.type ] && jQuery._data( cur, "handle" ); + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } @@ -401,7 +401,7 @@ jQuery.event = { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event || window.event ); - var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []), + var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), delegateCount = handlers.delegateCount, args = [].slice.call( arguments, 0 ), run_all = !event.exclusive && !event.namespace, @@ -509,8 +509,8 @@ jQuery.event = { doc = eventDoc.documentElement; body = eventDoc.body; - event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); - event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary @@ -932,9 +932,9 @@ jQuery.fn.extend({ if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event var handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type, - handleObj.selector, + jQuery( types.delegateTarget ).off( + handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type, + handleObj.selector, handleObj.handler ); return this; diff --git a/src/manipulation.js b/src/manipulation.js index add7cda69..6e77e2daa 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -346,7 +346,7 @@ jQuery.fn.extend({ // in certain situations (Bug #8070). // Fragments from the fragment cache must always be cloned and never used // in place. - results.cacheable || (l > 1 && i < lastIndex) ? + results.cacheable || ( l > 1 && i < lastIndex ) ? jQuery.clone( fragment, true, true ) : fragment ); @@ -523,7 +523,7 @@ jQuery.each({ } else { for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); + var elems = ( i > 0 ? this.clone(true) : this ).get(); jQuery( insert[i] )[ original ]( elems ); ret = ret.concat( elems ); } @@ -553,7 +553,7 @@ function fixDefaultChecked( elem ) { } // Finds all inputs and passes them to fixDefaultChecked function findInputs( elem ) { - var nodeName = (elem.nodeName || "").toLowerCase(); + var nodeName = ( elem.nodeName || "" ).toLowerCase(); if ( nodeName === "input" ) { fixDefaultChecked( elem ); // Skip scripts, get other children @@ -645,7 +645,7 @@ jQuery.extend({ elem = elem.replace(rxhtmlTag, "<$1></$2>"); // Trim whitespace, otherwise indexOf won't work as expected - var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(), + var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(), wrap = wrapMap[ tag ] || wrapMap._default, depth = wrap[0], div = context.createElement("div"); diff --git a/src/offset.js b/src/offset.js index 4cc87acff..054869da6 100644 --- a/src/offset.js +++ b/src/offset.js @@ -154,7 +154,7 @@ jQuery.extend( jQuery.offset, { curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), - calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, + calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed @@ -171,11 +171,11 @@ jQuery.extend( jQuery.offset, { options = options.call( elem, i, curOffset ); } - if (options.top != null) { - props.top = (options.top - curOffset.top) + curTop; + if ( options.top != null ) { + props.top = ( options.top - curOffset.top ) + curTop; } - if (options.left != null) { - props.left = (options.left - curOffset.left) + curLeft; + if ( options.left != null ) { + props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { diff --git a/src/outro.js b/src/outro.js index b49305e72..64ef28ed3 100644 --- a/src/outro.js +++ b/src/outro.js @@ -1,3 +1,3 @@ // Expose jQuery to the global object window.jQuery = window.$ = jQuery; -})(window); +})( window ); diff --git a/src/queue.js b/src/queue.js index b2ee8de08..67689ef42 100644 --- a/src/queue.js +++ b/src/queue.js @@ -24,7 +24,7 @@ jQuery.extend({ _mark: function( elem, type ) { if ( elem ) { - type = (type || "fx") + "mark"; + type = ( type || "fx" ) + "mark"; jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); } }, @@ -51,7 +51,7 @@ jQuery.extend({ queue: function( elem, type, data ) { var q; if ( elem ) { - type = (type || "fx") + "queue"; + type = ( type || "fx" ) + "queue"; q = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup diff --git a/src/support.js b/src/support.js index 7ea85984f..20cf2b526 100644 --- a/src/support.js +++ b/src/support.js @@ -279,22 +279,22 @@ jQuery.support = (function() { td = outer.nextSibling.firstChild.firstChild; supports = { - doesNotAddBorder: (inner.offsetTop !== 5), - doesAddBorderForTableAndCells: (td.offsetTop === 5) + doesNotAddBorder: ( inner.offsetTop !== 5 ), + doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) }; inner.style.position = "fixed"; inner.style.top = "20px"; // safari subtracts parent border width here which is 5px - supports.supportsFixedPosition = (inner.offsetTop === 20 || inner.offsetTop === 15); + supports.supportsFixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); inner.style.position = inner.style.top = ""; outer.style.overflow = "hidden"; outer.style.position = "relative"; - supports.subtractsBorderForOverflowNotVisible = (inner.offsetTop === -5); - supports.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop); + supports.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); + supports.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== bodyMarginTop ); return supports; diff --git a/src/traversing.js b/src/traversing.js index d385df85a..e72335ecb 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -306,7 +306,7 @@ function winnow( elements, qualifier, keep ) { } else if ( qualifier.nodeType ) { return jQuery.grep(elements, function( elem, i ) { - return (elem === qualifier) === keep; + return ( elem === qualifier ) === keep; }); } else if ( typeof qualifier === "string" ) { @@ -322,7 +322,7 @@ function winnow( elements, qualifier, keep ) { } return jQuery.grep(elements, function( elem, i ) { - return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; }); } |