]> source.dussan.org Git - jquery.git/commitdiff
No ticket: fix code style inconsistencies. Closes gh-1361
authorOleg <markelog@gmail.com>
Wed, 11 Sep 2013 01:08:01 +0000 (05:08 +0400)
committerOleg <markelog@gmail.com>
Thu, 12 Sep 2013 21:04:29 +0000 (01:04 +0400)
15 files changed:
src/ajax.js
src/ajax/parseXML.js
src/ajax/xhr.js
src/attributes/support.js
src/attributes/val.js
src/callbacks.js
src/css/support.js
src/deferred.js
src/effects.js
src/effects/Tween.js
src/event.js
src/manipulation.js
src/offset.js
src/queue.js
src/serialize.js

index 364e5a4b645f9522a74d9860e0a12547bcb7e47a..15a5e9d3b430aa0b0764da35b05e4b9572c8f200 100644 (file)
@@ -102,7 +102,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
                inspected[ dataType ] = true;
                jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
                        var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
-                       if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+                       if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
                                options.dataTypes.unshift( dataTypeOrTransport );
                                inspect( dataTypeOrTransport );
                                return false;
@@ -146,7 +146,7 @@ function ajaxHandleResponses( s, jqXHR, responses ) {
                dataTypes = s.dataTypes;
 
        // Remove auto dataType and get content-type in the process
-       while( dataTypes[ 0 ] === "*" ) {
+       while ( dataTypes[ 0 ] === "*" ) {
                dataTypes.shift();
                if ( ct === undefined ) {
                        ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
@@ -510,7 +510,7 @@ jQuery.extend({
                s.type = options.method || options.type || s.method || s.type;
 
                // Extract dataTypes list
-               s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [""];
+               s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
 
                // A cross-domain request is in order when we have a protocol:host:port mismatch
                if ( s.crossDomain == null ) {
@@ -796,8 +796,8 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
 });
 
 // Attach a bunch of functions for handling common AJAX events
-jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
-       jQuery.fn[ type ] = function( fn ){
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
+       jQuery.fn[ type ] = function( fn ) {
                return this.on( type, fn );
        };
 });
index aa80e3620ea581bc3ed76dadc6d24d5dfda93c63..9eeb625ff499757018207b9d93ca7e8f9785cccf 100644 (file)
@@ -12,7 +12,7 @@ jQuery.parseXML = function( data ) {
        // Support: IE9
        try {
                tmp = new DOMParser();
-               xml = tmp.parseFromString( data , "text/xml" );
+               xml = tmp.parseFromString( data, "text/xml" );
        } catch ( e ) {
                xml = undefined;
        }
index e08cfcac33ae93d1c202cd75a36a92269fcb93b4..8e6696b0dd246f7a77d3edd7aa85eee8312d5104 100644 (file)
@@ -26,7 +26,7 @@ var xhrSupported = jQuery.ajaxSettings.xhr(),
 
 if ( window.ActiveXObject ) {
        jQuery( window ).on( "unload", function() {
-               for( var key in xhrCallbacks ) {
+               for ( var key in xhrCallbacks ) {
                        xhrCallbacks[ key ]();
                }
                xhrCallbacks = undefined;
index 08c2caf082138a52190ef1dc6d8327560433f37f..376b54ad20e91ccd16fd6f100619b49bc7de9ef8 100644 (file)
@@ -2,7 +2,7 @@ define([
        "../var/support"
 ], function( support ) {
 
-(function () {
+(function() {
        var input = document.createElement( "input" ),
                select = document.createElement( "select" ),
                opt = select.appendChild( document.createElement( "option" ) );
index 65d772cc2d6675af236c5585d0ee854ddda309e2..6fc4a84bb2212fb09306a84a46685720215dd91e 100644 (file)
@@ -49,10 +49,12 @@ jQuery.fn.extend({
                        // Treat null/undefined as ""; convert numbers to string
                        if ( val == null ) {
                                val = "";
+
                        } else if ( typeof val === "number" ) {
                                val += "";
+
                        } else if ( jQuery.isArray( val ) ) {
-                               val = jQuery.map(val, function ( value ) {
+                               val = jQuery.map( val, function( value ) {
                                        return value == null ? "" : value + "";
                                });
                        }
index ed725b49831d0808e059dab0cede3ff3f1f2cf75..17572bb9c544446e73bdfa475f9a9d9e56820774 100644 (file)
@@ -126,7 +126,7 @@ jQuery.Callbacks = function( options ) {
                                if ( list ) {
                                        jQuery.each( arguments, function( _, arg ) {
                                                var index;
-                                               while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+                                               while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
                                                        list.splice( index, 1 );
                                                        // Handle firing indexes
                                                        if ( firing ) {
index 9b882897d060b427157f2dad15e0dc3687b62cef..33644908532105afb6b3b3117c2ecc98b4f0d0ce 100644 (file)
@@ -3,7 +3,7 @@ define([
        "../var/support"
 ], function( jQuery, support ) {
 
-(function () {
+(function() {
        var pixelPositionVal, boxSizingReliableVal,
                // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
                divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;" +
index 1c2f87e868ccb02b71231bb5a6d06ae869847992..7fcc214acaac71e59054f3fb8e8e5b55027fafc1 100644 (file)
@@ -109,7 +109,7 @@ jQuery.extend({
                                return function( value ) {
                                        contexts[ i ] = this;
                                        values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
-                                       if( values === progressValues ) {
+                                       if ( values === progressValues ) {
                                                deferred.notifyWith( contexts, values );
                                        } else if ( !( --remaining ) ) {
                                                deferred.resolveWith( contexts, values );
index b2d2068503e694d7f79bb09f7cf558aa996b215f..611336053bb9bee6b58f0664c719144674c74d5e 100644 (file)
@@ -14,7 +14,7 @@ var
        rrun = /queueHooks$/,
        animationPrefilters = [ defaultPrefilter ],
        tweeners = {
-               "*": [function( prop, value ) {
+               "*": [ function( prop, value ) {
                        var tween = this.createTween( prop, value ),
                                target = tween.cur(),
                                parts = rfxnum.exec( value ),
@@ -61,7 +61,7 @@ var
                        }
 
                        return tween;
-               }]
+               } ]
        };
 
 // Dependencies not needed as vars
@@ -89,7 +89,7 @@ function genFx( type, includeWidth ) {
        // if we include width, step value is 1 to do all cssExpand values,
        // if we don't include width, step value is 2 to skip over Left and Right
        includeWidth = includeWidth ? 1 : 0;
-       for( ; i < 4 ; i += 2 - includeWidth ) {
+       for ( ; i < 4 ; i += 2 - includeWidth ) {
                which = cssExpand[ i ];
                attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
        }
@@ -181,7 +181,6 @@ function defaultPrefilter( elem, props, opts ) {
                });
        }
 
-
        // show/hide pass
        for ( prop in props ) {
                value = props[ prop ];
index 582d42a8bd872e7101bcdb5edfe0687f52b8d05c..d1e4dca8b11d57cf95456ba77ec1839e3bcdd5fe 100644 (file)
@@ -102,7 +102,7 @@ jQuery.easing = {
                return p;
        },
        swing: function( p ) {
-               return 0.5 - Math.cos( p*Math.PI ) / 2;
+               return 0.5 - Math.cos( p * Math.PI ) / 2;
        }
 };
 
index 866e4f0dd66a1cb1609aef2c2e0f3c367dccc57f..d07f2476409ea19a351516372a9ca1cec5dee0f6 100644 (file)
@@ -81,7 +81,7 @@ jQuery.event = {
                }
 
                // Handle multiple events separated by a space
-               types = ( types || "" ).match( rnotwhite ) || [""];
+               types = ( types || "" ).match( rnotwhite ) || [ "" ];
                t = types.length;
                while ( t-- ) {
                        tmp = rtypenamespace.exec( types[t] ) || [];
@@ -163,7 +163,7 @@ jQuery.event = {
                }
 
                // Once for each type.namespace in types; type may be omitted
-               types = ( types || "" ).match( rnotwhite ) || [""];
+               types = ( types || "" ).match( rnotwhite ) || [ "" ];
                t = types.length;
                while ( t-- ) {
                        tmp = rtypenamespace.exec( types[t] ) || [];
@@ -538,7 +538,7 @@ jQuery.event = {
                        event.target = event.target.parentNode;
                }
 
-               return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
+               return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
        },
 
        special: {
index c51175570672eed2fc11687a75f7d43d6374d8e4..7e5ec07ccb1b4af061523f5edf830b3c85c2f17c 100644 (file)
@@ -1,6 +1,6 @@
 // Require more than a few needed variables
 // Keep in mind that a dependency array cannot be used with CommonJS+AMD syntax
-define(function( require ){
+define(function( require ) {
 
 var
        jQuery = require( "./core" ),
@@ -48,7 +48,6 @@ require( "./traversing" );
 require( "./selector" );
 require( "./event" );
 
-
 // Support: 1.x compatibility
 // Manipulating tables requires a tbody
 function manipulationTarget( elem, content ) {
@@ -218,7 +217,7 @@ jQuery.extend({
                                        tmp = tmp || fragment.appendChild( context.createElement("div") );
 
                                        // Deserialize a standard representation
-                                       tag = ( rtagName.exec( elem ) || ["", ""] )[ 1 ].toLowerCase();
+                                       tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
                                        wrap = wrapMap[ tag ] || wrapMap._default;
                                        tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
 
@@ -398,7 +397,7 @@ jQuery.fn.extend({
                dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
                deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
 
-               return this.map( function () {
+               return this.map(function() {
                        return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
                });
        },
index 9809d1079a0ed18ea95d3221601143fa4b591890..6396e0f3803c36f493f813c907d9784fb553ddf9 100644 (file)
@@ -158,7 +158,7 @@ jQuery.fn.extend({
 });
 
 // Create scrollLeft and scrollTop methods
-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
+jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
        var top = "pageYOffset" === prop;
 
        jQuery.fn[ method ] = function( val ) {
index f72c5adacaea2c377f08f870a3765294321ac673..fbfaf9ca541a36a0a2ab45fbae4b1f9c4ae7ac04 100644 (file)
@@ -126,7 +126,7 @@ jQuery.fn.extend({
                }
                type = type || "fx";
 
-               while( i-- ) {
+               while ( i-- ) {
                        tmp = data_priv.get( elements[ i ], type + "queueHooks" );
                        if ( tmp && tmp.empty ) {
                                count++;
index 797d735aaf64d125edf3c66a655f381cbeff8c00..fc1b4dfdfc4c31b5488a68fb4e655d3f199e5de9 100644 (file)
@@ -80,25 +80,26 @@ jQuery.fn.extend({
                return jQuery.param( this.serializeArray() );
        },
        serializeArray: function() {
-               return this.map(function(){
+               return this.map(function() {
                        // Can add propHook for "elements" to filter or add form elements
                        var elements = jQuery.prop( this, "elements" );
                        return elements ? jQuery.makeArray( elements ) : this;
                })
-               .filter(function(){
+               .filter(function() {
                        var type = this.type;
-                       // Use .is(":disabled") so that fieldset[disabled] works
+
+                       // Use .is( ":disabled" ) so that fieldset[ disabled ] works
                        return this.name && !jQuery( this ).is( ":disabled" ) &&
                                rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
                                ( this.checked || !rcheckableType.test( type ) );
                })
-               .map(function( i, elem ){
+               .map(function( i, elem ) {
                        var val = jQuery( this ).val();
 
                        return val == null ?
                                null :
                                jQuery.isArray( val ) ?
-                                       jQuery.map( val, function( val ){
+                                       jQuery.map( val, function( val ) {
                                                return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
                                        }) :
                                        { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };