Skip to content

Commit

Permalink
Build: Updated JSCS and fixed code style errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre committed Mar 2, 2015
1 parent ad6e1ca commit 2b242db
Show file tree
Hide file tree
Showing 74 changed files with 1,425 additions and 1,430 deletions.
9 changes: 1 addition & 8 deletions .jscsrc
Expand Up @@ -7,12 +7,5 @@
// Additional preset tightening
"requireBlocksOnNewline": true,
"requireSpaceBeforeBlockStatements": true,
"disallowMixedSpacesAndTabs": true,
"excludeFiles": [
"node_modules/**",
"dist/**",
"lib/**",
"src/polyfills/slider/slider.js",
"src/polyfills/events/mobile.js"
]
"disallowMixedSpacesAndTabs": true
}
2 changes: 2 additions & 0 deletions Gruntfile.coffee
Expand Up @@ -1144,6 +1144,8 @@ module.exports = (grunt) ->

src: [
"<%= jshint.all.src %>"
"!src/polyfills/slider/slider.js",
"!src/polyfills/events/mobile.js"
]

connect:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -54,7 +54,7 @@
"grunt-html": "^1.4.0",
"grunt-i18n-csv": "^0.1.0",
"grunt-imagine": "^0.3.4",
"grunt-jscs": "^0.7.1",
"grunt-jscs": "^1.5.0",
"grunt-mocha": "~0.4.1",
"grunt-modernizr": "~0.5.2",
"grunt-sass": "^0.14.1",
Expand Down
30 changes: 15 additions & 15 deletions src/core/helpers.js
Expand Up @@ -5,7 +5,7 @@
* @author WET Community
* Credits: http://kaibun.net/blog/2013/04/19/a-fully-fledged-coffeescript-boilerplate-for-jquery-plugins/
*/
(function( $, wb ) {
( function( $, wb ) {
wb.getData = function( element, dataName ) {
var elm = !element.jquery ? element : element[ 0 ],
dataAttr = elm.getAttribute( "data-" + dataName ),
Expand All @@ -22,9 +22,9 @@

return dataObj;
};
})( jQuery, wb );
} )( jQuery, wb );

(function( wb ) {
( function( wb ) {
"use strict";

// Escapes the characters in a string for use in a jQuery selector
Expand Down Expand Up @@ -1094,16 +1094,16 @@
* Originally from http://stackoverflow.com/a/2117523/455535
*/
wb.guid = function() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function( replacementChar ) {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace( /[xy]/g, function( replacementChar ) {
var rand = Math.random() * 16 | 0,
newChar = replacementChar === "x" ? rand : ( rand & 0x3 | 0x8 );
return newChar.toString(16);
});
return newChar.toString( 16 );
} );
};

})( wb );
} )( wb );

(function( $, undef ) {
( function( $, undef ) {
"use strict";

var methods,
Expand Down Expand Up @@ -1156,12 +1156,12 @@
}
};

})( jQuery );
} )( jQuery );

/*
:focusable and :tabable jQuery helper expressions - https://github.com/jquery/jquery-ui/blob/24756a978a977d7abbef5e5bce403837a01d964f/ui/jquery.ui.core.js
*/
(function( $ ) {
( function( $ ) {
"use strict";

function focusable( element, isTabIndexNotNaN, visibility ) {
Expand Down Expand Up @@ -1195,14 +1195,14 @@
return $.expr.filters.visible( element ) && !$( element )
.parents( )
.addBack( )
.filter(function() {
.filter( function() {
return $.css( this, "visibility" ) === "hidden";
})
} )
.length;
}

$.extend( $.expr[ ":" ], {
data: $.expr.createPseudo ? $.expr.createPseudo(function(dataName ) {
data: $.expr.createPseudo ? $.expr.createPseudo( function( dataName ) {
return function( elem ) {
return !!$.data( elem, dataName );
};
Expand All @@ -1223,6 +1223,6 @@
isTabIndexNaN = isNaN( tabIndex );
return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
}
});
} );

})( jQuery );
} )( jQuery );
32 changes: 16 additions & 16 deletions src/core/wb.js
Expand Up @@ -7,7 +7,7 @@
/*
* Vapour Object that will store tombstone data for plugins to leverage
*/
(function( $, window, document, undef ) {
( function( $, window, document, undef ) {
"use strict";

/**
Expand All @@ -30,7 +30,7 @@ var getUrlParts = function( url ) {
search: a.search,

// A collection of the parameters of the query string part of the URL.
params: (function() {
params: ( function() {
var results = {},
queryString = a.search.replace( /^\?/, "" ).split( "&" ),
len = queryString.length,
Expand All @@ -43,7 +43,7 @@ var getUrlParts = function( url ) {
}
}
return results;
}())
}() )
};
},

Expand Down Expand Up @@ -92,7 +92,7 @@ var getUrlParts = function( url ) {
* @variable oldie
* @return {integer} of IE version
*/
oldie = (function() {
oldie = ( function() {
var undef,
v = 3,
div = document.createElement( "div" ),
Expand All @@ -104,7 +104,7 @@ var getUrlParts = function( url ) {
) {}

return v > 4 ? v : undef;
}()),
}() ),

/**
* @variable currentpage
Expand All @@ -116,7 +116,7 @@ var getUrlParts = function( url ) {
* @variable disabled
* @return {boolean} of state of disabled flag
*/
disabled = (function() {
disabled = ( function() {
var disabledSaved = "false",
disabled;

Expand All @@ -126,7 +126,7 @@ var getUrlParts = function( url ) {

disabled = currentpage.params.wbdisable || disabledSaved;
return ( typeof disabled === "string" ) ? ( disabled.toLowerCase() === "true" ) : Boolean( disabled );
}()),
}() ),

/*-----------------------------
* Core Library Object
Expand Down Expand Up @@ -376,7 +376,7 @@ window.wb = wb;
yepnope.addPrefix( "site", function( resourceObj ) {
resourceObj.url = $homepath + "/" + resourceObj.url;
return resourceObj;
});
} );

/**
* @prefix: plyfll! - builds the path for the polyfill resource
Expand All @@ -400,20 +400,20 @@ yepnope.addPrefix( "plyfll", function( resourceObj ) {
resourceObj.url = path + "/polyfills/" + url;

return resourceObj;
});
} );

/**
* @prefix: i18n! - adds the correct document language for our i18n library
*/
yepnope.addPrefix( "i18n", function( resourceObj ) {
resourceObj.url = $homepath + "/" + resourceObj.url + lang + $mode + ".js";
return resourceObj;
});
} );

/*-----------------------------
* Modernizr Polyfill Loading
*-----------------------------*/
Modernizr.load([
Modernizr.load( [
{
test: Modernizr.details,
nope: [
Expand Down Expand Up @@ -476,15 +476,15 @@ Modernizr.load([

// Load the MathML dependency. Since the polyfill is only loaded
// when !Modernizr.mathml, we can skip the test here.
Modernizr.load({
Modernizr.load( {
load: "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=Accessible",
complete: function() {

// Identify that initialization has completed
wb.ready( $document, componentName );
}
});
});
} );
} );

wb.add( selector );
}
Expand All @@ -507,6 +507,6 @@ Modernizr.load([
wb.start();
}
}
]);
] );

})( jQuery, window, document );
} )( jQuery, window, document );
2 changes: 1 addition & 1 deletion src/i18n/base.js
Expand Up @@ -210,4 +210,4 @@ wb.i18nDict = {
"tmpl-signin": "@tmpl-signin@"
};

})( wb );
} )( wb );
6 changes: 3 additions & 3 deletions src/other/feedback/demo/feedback.js
Expand Up @@ -4,7 +4,7 @@
* @license wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html
* @author @pjackson28
*/
(function( $, window, document, wb ) {
( function( $, window, document, wb ) {
"use strict";

/*
Expand Down Expand Up @@ -152,9 +152,9 @@ $document.on( "click", selector + " input[type=reset]", function( event ) {
showHide( fbcntc1 );
showHide( fbcntc2 );
}
});
} );

// Add the timer poke to initialize the plugin
wb.add( selector );

})( jQuery, window, document, wb );
} )( jQuery, window, document, wb );

0 comments on commit 2b242db

Please sign in to comment.