From 9a7c54f108e5c089cd38f6afb69708cb18f3b28c Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 14 Oct 2014 11:46:31 +0300 Subject: [PATCH] Update JSCS config. --- Gruntfile.js | 2 +- docs/assets/js/docs.js | 8 ++++---- docs/assets/js/fingerblast.js | 14 +++++++------- js/.jscsrc | 17 +++++++++-------- js/push.js | 2 +- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index e2d8adc..42b1a07 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -6,7 +6,7 @@ */ /* jshint node: true */ -module.exports = function(grunt) { +module.exports = function (grunt) { 'use strict'; // Force use of Unix newlines diff --git a/docs/assets/js/docs.js b/docs/assets/js/docs.js index 19ddeab..094d15a 100644 --- a/docs/assets/js/docs.js +++ b/docs/assets/js/docs.js @@ -1,7 +1,7 @@ /* jshint jquery: true */ /* global FingerBlast: true */ -$(function() { +$(function () { 'use strict'; var doc; @@ -74,7 +74,7 @@ $(function() { nav.toggleClass('active'); }); - navComponentLinks.click(function(e) { + navComponentLinks.click(function (e) { e.stopPropagation(); e.preventDefault(); componentsList.toggleClass('active'); @@ -119,7 +119,7 @@ $(function() { } }; - var calculateScroll = function() { + var calculateScroll = function () { // if small screen don't worry about this if (windowWidth <= 768) { return; @@ -139,7 +139,7 @@ $(function() { device.css({ top: device.dockingOffset }); } else { device[0].className = 'device'; - device[0].setAttribute('style',''); + device[0].setAttribute('style', ''); } function updateContent(content) { diff --git a/docs/assets/js/fingerblast.js b/docs/assets/js/fingerblast.js index f859f48..68d6b43 100644 --- a/docs/assets/js/fingerblast.js +++ b/docs/assets/js/fingerblast.js @@ -197,34 +197,34 @@ gestureName = 'gestureend'; } - events.forEach(function(event) { + events.forEach(function (event) { var gesture = this.createMouseEvent.call(event._finger, gestureName, event); gestures.push(gesture); }.bind(this)); - events.concat(gestures).forEach(function(event) { + events.concat(gestures).forEach(function (event) { event.scale = distance / this.startDistance; event.rotation = this.startAngle - angle; }); } // Loop through the events array and fill in each touch array. - events.forEach(function(touch) { - touch.touches = events.filter(function(e) { + events.forEach(function (touch) { + touch.touches = events.filter(function (e) { return ~e.type.indexOf('touch') && e.type !== 'touchend'; }); - touch.changedTouches = events.filter(function(e) { + touch.changedTouches = events.filter(function (e) { return ~e.type.indexOf('touch') && e._finger.target === touch._finger.target; }); - touch.targetTouches = touch.changedTouches.filter(function(e) { + touch.targetTouches = touch.changedTouches.filter(function (e) { return ~e.type.indexOf('touch') && e.type !== 'touchend'; }); }); // Then fire the events. - events.concat(gestures).forEach(function(event, i) { + events.concat(gestures).forEach(function (event, i) { event.identifier = i; event._finger.target.dispatchEvent(event); }); diff --git a/js/.jscsrc b/js/.jscsrc index 9c03c97..657ed65 100644 --- a/js/.jscsrc +++ b/js/.jscsrc @@ -5,15 +5,15 @@ "disallowMultipleLineStrings": true, "disallowMultipleVarDecl": true, "disallowQuotedKeysInObjects": "allButReserved", - "disallowSpaceAfterPrefixUnaryOperators": ["!"], + "disallowSpaceAfterPrefixUnaryOperators": ["!", "-", "--", "~", "+", "++"], "disallowSpaceBeforeBinaryOperators": [","], - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "disallowSpaceBeforePostfixUnaryOperators": true, "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, "disallowSpacesInsideArrayBrackets": true, "disallowSpacesInsideParentheses": true, "disallowTrailingComma": true, "disallowTrailingWhitespace": true, + //"requireBlocksOnNewline": true, "requireCamelCaseOrUpperCaseIdentifiers": true, "requireCapitalizedConstructors": true, "requireCommaBeforeLineBreak": true, @@ -21,17 +21,18 @@ "requireDotNotation": true, "requireLineFeedAtFileEnd": true, "requireParenthesesAroundIIFE": true, - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], + "requireSpaceAfterBinaryOperators": true, "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], "requireSpaceAfterLineComment": true, - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "requireSpaceBeforeBinaryOperators": true, + "requireSpaceBeforeBlockStatements": true, + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true, "beforeOpeningRoundBrace": true }, "requireSpacesInConditionalExpression": true, - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, - "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "requireSpacesInFunction": { "beforeOpeningCurlyBrace": true }, "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, "requireSpacesInsideObjectBrackets": "allButNested", "validateIndentation": 2, "validateLineBreaks": "LF", + "validateParameterSeparator": ", ", "validateQuoteMarks": "'" } diff --git a/js/push.js b/js/push.js index f72282c..818f4ea 100644 --- a/js/push.js +++ b/js/push.js @@ -191,7 +191,7 @@ swapContent( (activeObj.contents || activeDom).cloneNode(true), document.querySelector('.content'), - transition, function() { + transition, function () { triggerStateChange(); } );