update style for jshint and jscs

This commit is contained in:
Doug Fritz 2014-09-03 21:14:36 -07:00
parent b536c15b1d
commit 49649b1ff9
9 changed files with 43 additions and 31 deletions

View File

@ -5,7 +5,7 @@
"camelcase": true, "camelcase": true,
"curly": true, "curly": true,
"immed": true, "immed": true,
"newcap": true, "newcap": false,
"noarg": true, "noarg": true,
"undef": true, "undef": true,
"unused": "vars", "unused": "vars",

View File

@ -1,4 +1,7 @@
/* globals document */
(function(scope) { (function(scope) {
'use strict';
var Gui = function(params) { var Gui = function(params) {
@ -20,7 +23,6 @@
}; };
// Register custom controllers // Register custom controllers
// ------------------------------- // -------------------------------
@ -32,7 +34,6 @@
}; };
// Returns a controller based on a value // Returns a controller based on a value
// ------------------------------- // -------------------------------
@ -52,7 +53,6 @@
}; };
// Gui ready handler ... * shakes fist at polymer * // Gui ready handler ... * shakes fist at polymer *
// ------------------------------- // -------------------------------
@ -72,11 +72,14 @@
Gui.ready = function(fnc) { Gui.ready = function(fnc) {
ready ? fnc() : readyHandlers.push(fnc); if (ready) {
fnc();
} else {
readyHandlers.push(fnc);
}
}; };
// Error // Error
// ------------------------------- // -------------------------------
@ -92,7 +95,6 @@
console.warn.apply(console, args); console.warn.apply(console, args);
}; };
// Old namespaces // Old namespaces
// ------------------------------- // -------------------------------
@ -129,13 +131,10 @@
} }
// Export // Export
// ------------------------------- // -------------------------------
scope.dat = dat; scope.dat = dat;
scope.Gui = Gui; scope.Gui = Gui;
})(this); })(this);

View File

@ -1,3 +1,6 @@
/* globals Gui, Polymer, PathObserver */
'use strict';
/* /*
[ ] onChange() [ ] onChange()
@ -17,7 +20,6 @@ Polymer('controller-base', {
init: function() {}, init: function() {},
// Observers // Observers
// ------------------------------- // -------------------------------
@ -36,7 +38,6 @@ Polymer('controller-base', {
}, },
// Helpers // Helpers
// ------------------------------- // -------------------------------
@ -44,7 +45,6 @@ Polymer('controller-base', {
return (x - a) / (b - a) * (d - c) + c; return (x - a) / (b - a) * (d - c) + c;
}, },
// Legacy // Legacy
// ------------------------------- // -------------------------------
@ -68,5 +68,4 @@ Polymer('controller-base', {
} }
}); });

View File

@ -1,3 +1,6 @@
/* globals Gui, Polymer */
'use strict';
Gui.register('controller-boolean', function(value) { Gui.register('controller-boolean', function(value) {
return typeof value == 'boolean'; return typeof value == 'boolean';
@ -8,7 +11,6 @@ Polymer('controller-boolean', {
ready: function() { ready: function() {
}, },
toggle: function() { toggle: function() {

View File

@ -1,3 +1,6 @@
/* globals Gui, Polymer */
'use strict';
Gui.register('controller-function', function(value) { Gui.register('controller-function', function(value) {
return typeof value == 'function'; return typeof value == 'function';

View File

@ -1,3 +1,6 @@
/* globals Gui, Polymer, window */
'use strict';
/* /*
[ ] arrow keys [ ] arrow keys
@ -34,11 +37,15 @@ Polymer('controller-number', {
var _this = this; var _this = this;
window.addEventListener('keydown', function(e) { window.addEventListener('keydown', function(e) {
if (e.keyCode == 18) _this._alt = true; if (e.keyCode == 18) {
_this._alt = true;
}
}, false); }, false);
window.addEventListener('keyup', function(e) { window.addEventListener('keyup', function(e) {
if (e.keyCode == 18) _this._alt = false; if (e.keyCode == 18) {
_this._alt = false;
}
}, false); }, false);
this.super(); this.super();
@ -140,7 +147,6 @@ Polymer('controller-number', {
}, },
// Events // Events
// ------------------------------- // -------------------------------
@ -162,7 +168,7 @@ Polymer('controller-number', {
e.preventDefault(); e.preventDefault();
this._rect = this.$.track.getBoundingClientRect(); this._rect = this.$.track.getBoundingClientRect();
if (!this._alt) this.value = this.valueFromX(e.x); if (!this._alt) { this.value = this.valueFromX(e.x); }
}, },
@ -185,7 +191,7 @@ Polymer('controller-number', {
var dv = this.valueFromDX(e.ddx); var dv = this.valueFromDX(e.ddx);
if (this._alt) dv /= 10; if (this._alt) { dv /= 10; }
this.value += dv * this._dragFriction; this.value += dv * this._dragFriction;
@ -213,8 +219,6 @@ Polymer('controller-number', {
}, },
// Filters // Filters
// ------------------------------- // -------------------------------
@ -228,7 +232,6 @@ Polymer('controller-number', {
}, },
// Helpers // Helpers
// ------------------------------- // -------------------------------

View File

@ -1,3 +1,6 @@
/* globals Gui, Polymer */
'use strict';
Gui.register('controller-string', function(value) { Gui.register('controller-string', function(value) {
return typeof value == 'string'; return typeof value == 'string';

View File

@ -1,3 +1,6 @@
/* globals Polymer, window, document, Path, Gui */
'use strict';
// [ ] scrolling when docked // [ ] scrolling when docked
// [ ] scrolling when window short and not docked // [ ] scrolling when window short and not docked
@ -6,7 +9,7 @@ Polymer('gui-panel', {
docked: false, docked: false,
open: true, open: true,
touch: ('ontouchstart' in window) || touch: ('ontouchstart' in window) ||
(!!window.DocumentTouch && document instanceof DocumentTouch), (!!window.DocumentTouch && document instanceof window.DocumentTouch),
ready: function() { ready: function() {
@ -17,14 +20,15 @@ Polymer('gui-panel', {
}, },
anon: function() { anon: function() {
var name;
if (arguments.length == 1) { if (arguments.length == 1) {
var name = arguments[0]; name = arguments[0];
return this.anon.values[name]; return this.anon.values[name];
} }
var initialValue = arguments[0]; var initialValue = arguments[0];
var name = arguments[1]; name = arguments[1];
var args = [this.anon.values, name]; var args = [this.anon.values, name];
args = args.concat(Array.prototype.slice.call(arguments, 2)); args = args.concat(Array.prototype.slice.call(arguments, 2));
@ -41,7 +45,7 @@ Polymer('gui-panel', {
var value = Path.get(path).getValueFrom(object); var value = Path.get(path).getValueFrom(object);
if (value == null || value == undefined) { if (value === null || value === undefined) {
return Gui.error(object + return Gui.error(object +
' doesn\'t have a value for path "' + path + '".'); ' doesn\'t have a value for path "' + path + '".');
} }
@ -79,7 +83,6 @@ Polymer('gui-panel', {
}, },
// Observers // Observers
// ------------------------------- // -------------------------------
@ -101,7 +104,6 @@ Polymer('gui-panel', {
} }
}, },
dockedChanged: function() { dockedChanged: function() {
@ -110,7 +112,6 @@ Polymer('gui-panel', {
}, },
// Events // Events
// ------------------------------- // -------------------------------
@ -128,7 +129,6 @@ Polymer('gui-panel', {
// }, // },
// Legacy // Legacy
// ------------------------------- // -------------------------------

View File

@ -1,3 +1,6 @@
/* globals Polymer */
'use strict';
Polymer('gui-row', { Polymer('gui-row', {
comment: null, comment: null,