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 */
module.exports = function(grunt) {
module.exports = function (grunt) {
'use strict';
// Force use of Unix newlines

8
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) {

14
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);
});

17
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": "'"
}

2
js/push.js

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

Loading…
Cancel
Save