Browse Source

Update JSCS config.

pull/696/head
XhmikosR 10 years ago
parent
commit
9a7c54f108
  1. 2
      Gruntfile.js
  2. 8
      docs/assets/js/docs.js
  3. 14
      docs/assets/js/fingerblast.js
  4. 17
      js/.jscsrc
  5. 2
      js/push.js

2
Gruntfile.js

@ -6,7 +6,7 @@
*/ */
/* jshint node: true */ /* jshint node: true */
module.exports = function(grunt) { module.exports = function (grunt) {
'use strict'; 'use strict';
// Force use of Unix newlines // Force use of Unix newlines

8
docs/assets/js/docs.js

@ -1,7 +1,7 @@
/* jshint jquery: true */ /* jshint jquery: true */
/* global FingerBlast: true */ /* global FingerBlast: true */
$(function() { $(function () {
'use strict'; 'use strict';
var doc; var doc;
@ -74,7 +74,7 @@ $(function() {
nav.toggleClass('active'); nav.toggleClass('active');
}); });
navComponentLinks.click(function(e) { navComponentLinks.click(function (e) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
componentsList.toggleClass('active'); componentsList.toggleClass('active');
@ -119,7 +119,7 @@ $(function() {
} }
}; };
var calculateScroll = function() { var calculateScroll = function () {
// if small screen don't worry about this // if small screen don't worry about this
if (windowWidth <= 768) { if (windowWidth <= 768) {
return; return;
@ -139,7 +139,7 @@ $(function() {
device.css({ top: device.dockingOffset }); device.css({ top: device.dockingOffset });
} else { } else {
device[0].className = 'device'; device[0].className = 'device';
device[0].setAttribute('style',''); device[0].setAttribute('style', '');
} }
function updateContent(content) { function updateContent(content) {

14
docs/assets/js/fingerblast.js

@ -197,34 +197,34 @@
gestureName = 'gestureend'; gestureName = 'gestureend';
} }
events.forEach(function(event) { events.forEach(function (event) {
var gesture = this.createMouseEvent.call(event._finger, gestureName, event); var gesture = this.createMouseEvent.call(event._finger, gestureName, event);
gestures.push(gesture); gestures.push(gesture);
}.bind(this)); }.bind(this));
events.concat(gestures).forEach(function(event) { events.concat(gestures).forEach(function (event) {
event.scale = distance / this.startDistance; event.scale = distance / this.startDistance;
event.rotation = this.startAngle - angle; event.rotation = this.startAngle - angle;
}); });
} }
// Loop through the events array and fill in each touch array. // Loop through the events array and fill in each touch array.
events.forEach(function(touch) { events.forEach(function (touch) {
touch.touches = events.filter(function(e) { touch.touches = events.filter(function (e) {
return ~e.type.indexOf('touch') && e.type !== 'touchend'; 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; 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'; return ~e.type.indexOf('touch') && e.type !== 'touchend';
}); });
}); });
// Then fire the events. // Then fire the events.
events.concat(gestures).forEach(function(event, i) { events.concat(gestures).forEach(function (event, i) {
event.identifier = i; event.identifier = i;
event._finger.target.dispatchEvent(event); event._finger.target.dispatchEvent(event);
}); });

17
js/.jscsrc

@ -5,15 +5,15 @@
"disallowMultipleLineStrings": true, "disallowMultipleLineStrings": true,
"disallowMultipleVarDecl": true, "disallowMultipleVarDecl": true,
"disallowQuotedKeysInObjects": "allButReserved", "disallowQuotedKeysInObjects": "allButReserved",
"disallowSpaceAfterPrefixUnaryOperators": ["!"], "disallowSpaceAfterPrefixUnaryOperators": ["!", "-", "--", "~", "+", "++"],
"disallowSpaceBeforeBinaryOperators": [","], "disallowSpaceBeforeBinaryOperators": [","],
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], "disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
"disallowSpacesInsideArrayBrackets": true, "disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true, "disallowSpacesInsideParentheses": true,
"disallowTrailingComma": true, "disallowTrailingComma": true,
"disallowTrailingWhitespace": true, "disallowTrailingWhitespace": true,
//"requireBlocksOnNewline": true,
"requireCamelCaseOrUpperCaseIdentifiers": true, "requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCapitalizedConstructors": true, "requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true, "requireCommaBeforeLineBreak": true,
@ -21,17 +21,18 @@
"requireDotNotation": true, "requireDotNotation": true,
"requireLineFeedAtFileEnd": true, "requireLineFeedAtFileEnd": true,
"requireParenthesesAroundIIFE": true, "requireParenthesesAroundIIFE": true,
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], "requireSpaceAfterBinaryOperators": true,
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"requireSpaceAfterLineComment": true, "requireSpaceAfterLineComment": true,
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], "requireSpaceBeforeBinaryOperators": true,
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true }, "requireSpaceBeforeBlockStatements": true,
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true, "beforeOpeningRoundBrace": true },
"requireSpacesInConditionalExpression": true, "requireSpacesInConditionalExpression": true,
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, "requireSpacesInFunction": { "beforeOpeningCurlyBrace": true },
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
"requireSpacesInsideObjectBrackets": "allButNested", "requireSpacesInsideObjectBrackets": "allButNested",
"validateIndentation": 2, "validateIndentation": 2,
"validateLineBreaks": "LF", "validateLineBreaks": "LF",
"validateParameterSeparator": ", ",
"validateQuoteMarks": "'" "validateQuoteMarks": "'"
} }

2
js/push.js

@ -191,7 +191,7 @@
swapContent( swapContent(
(activeObj.contents || activeDom).cloneNode(true), (activeObj.contents || activeDom).cloneNode(true),
document.querySelector('.content'), document.querySelector('.content'),
transition, function() { transition, function () {
triggerStateChange(); triggerStateChange();
} }
); );

Loading…
Cancel
Save