Permalink
Browse files

add linting rc for sublime linter plugin

  • Loading branch information...
mobz committed Feb 15, 2013
1 parent 1ceb9de commit 64b0c8b3cc8eb18e4f0e5f3232a613d3a4aa4b1e
Showing with 43 additions and 11 deletions.
  1. +31 −0 .jshintrc
  2. +1 −1 lib/es/widgets.js
  3. +11 −10 lib/jsacx/src/jsacx-widgets.js
View
@@ -0,0 +1,31 @@
+{
+ "maxerr": 1000,
+
+ "predef": [
+ ],
+
+ "jquery" : true,
+ "browser" : true,
+
+ "curly": true,
+ "debug": false,
+ "devel": true,
+ "eqeqeq": true,
+ "eqnull": true,
+ "expr": true,
+ "forin": false,
+ "immed": false,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "noempty": false,
+ "nonew": false,
+ "nomen": false,
+ "plusplus": false,
+ "regexp": false,
+ "undef": true,
+ "sub": true,
+ "white": false,
+ "scripturl": true,
+ "esnext": true
+}
View
@@ -629,7 +629,7 @@
{ tag: "EM", text: item.query },
" ",
{ tag: "SPAN", text: item.transform }
- ] }
+ ] };
}
});
@@ -1,3 +1,5 @@
+var acx = window.acx || {};
+
/**
* acx.ut namespace for small (non-stateful) templates
* @namespace
@@ -16,15 +18,14 @@ acx.ux = {};
* a class for generating custom events in widgets
*/
acx.ux.Observable = acx.Class.extend((function() {
- function getObs(type) {
- return ( this.observers[type] || ( this.observers[type] = [] ) );
- }
+ function getObs(type) { return ( this.observers[type] || ( this.observers[type] = [] ) ); }
+ function toLower(a) { return a.toLowerCase(); }
return {
init: function() {
this.observers = {};
for(var opt in this.config) { // automatically install observers that are defined in the configuration
if(opt.indexOf('on') === 0) {
- this.on(opt.substring(2).replace(/^[A-Z]/, function(a) { return a.toLowerCase(); }), this.config[opt]);
+ this.on(opt.substring(2).replace(/^[A-Z]/, toLower ), this.config[opt]);
}
}
},
@@ -43,7 +44,7 @@ acx.ux.Observable = acx.Class.extend((function() {
this.observers = {};
},
removeObserver: function(type, fn) {
- var obs = getObs.call(this, type), index = obs.reduce(function(p, t, i) { return (t.cb === fn) ? i : p }, -1 );
+ var obs = getObs.call(this, type), index = obs.reduce( function(p, t, i) { return (t.cb === fn) ? i : p; }, -1 );
if(index !== -1) {
obs.splice(index, 1);
}
@@ -232,7 +233,7 @@ acx.ui.Toolbar = acx.ui.Widget.extend({
{ tag: "DIV", cls: "ui-left", children: [
{ tag: "H2", text: this.config.label }
].concat(this.config.left) },
- { tag: "DIV", cls: "ui-right", children: this.config.right },
+ { tag: "DIV", cls: "ui-right", children: this.config.right }
]};
}
});
@@ -364,7 +365,7 @@ acx.ui.AbstractPanel = acx.ui.Widget.extend({
_getPosition: function() {
return $(window).vSize() // get the current viewport size
.sub(this.el.vSize()) // subtract the size of the panel
- .mod(function(s) { return s / 2 }) // divide by 2 (to center it)
+ .mod(function(s) { return s / 2; }) // divide by 2 (to center it)
.add($(document).vScroll()) // add the current scroll offset
.mod(function(s) { return Math.max(5, s); }) // make sure the panel is not off the edge of the window
.asOffset(); // and return it as a {top, left} object
@@ -425,13 +426,13 @@ acx.ui.DialogPanel = acx.ui.DraggablePanel.extend({
},
_main_template: function() {
var t = this._super();
- t.children.push(this._actionsBar_template())
+ t.children.push(this._actionsBar_template());
return t;
},
_actionsBar_template: function() {
return { tag: "DIV", cls: "ui-right", children: [
new acx.ui.Button({ label: "Cancel", onclick: this._close_handler }),
- new acx.ui.Button({ label: "OK", onclick: this._commit_handler })
+ new acx.ui.Button({ label: "OK", onclick: this._commit_handler })
]};
}
});
@@ -616,7 +617,7 @@ acx.ui.Table = acx.ui.Widget.extend({
] };
},
_header_template: function(columns) {
- var ret = { tag: "TABLE", child: this._headerRow_template(columns) }
+ var ret = { tag: "TABLE", child: this._headerRow_template(columns) };
ret.child.children.push(this._headerEndCap_template());
return ret;
},

0 comments on commit 64b0c8b

Please sign in to comment.