Commit d09aa978 authored by Dave Methvin's avatar Dave Methvin Committed by Sam Saccone

thorax_lumbar: tell jscs to skip generated files

parent ad60850c
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
"examples/js_of_ocaml/js/*.js", "examples/js_of_ocaml/js/*.js",
"examples/polymer/elements/elements.build.js", "examples/polymer/elements/elements.build.js",
"examples/thorax/js/lib/backbone-localstorage.js", "examples/thorax/js/lib/backbone-localstorage.js",
"examples/thorax_lumbar/public/*.js",
"examples/typescript-*/js/**/*.js", "examples/typescript-*/js/**/*.js",
"examples/vanilladart/**/*.js" "examples/vanilladart/**/*.js"
], ],
......
...@@ -17276,12 +17276,15 @@ if (module.exports.loader && module.exports.loader.map && window.Backbone) { ...@@ -17276,12 +17276,15 @@ if (module.exports.loader && module.exports.loader.map && window.Backbone) {
} }
;; ;;
/*global Thorax, Backbone, $ */
//all templates are assumed to be in the templates directory //all templates are assumed to be in the templates directory
Thorax.templatePathPrefix = 'src/templates/'; Thorax.templatePathPrefix = 'src/templates/';
var app = window.app = module.exports; var app = window.app = module.exports;
$(function () { $(function () {
'use strict';
app.initBackboneLoader(); app.initBackboneLoader();
Backbone.history.start(); Backbone.history.start();
}); });
......
...@@ -7,6 +7,7 @@ Application['todomvc'] = (function() { ...@@ -7,6 +7,7 @@ Application['todomvc'] = (function() {
/* router : todomvc */ /* router : todomvc */
module.name = "todomvc"; module.name = "todomvc";
module.routes = {"":"setFilter",":filter":"setFilter"}; module.routes = {"":"setFilter",":filter":"setFilter"};
/*global Thorax */
(function () { (function () {
'use strict'; 'use strict';
...@@ -46,6 +47,7 @@ module.routes = {"":"setFilter",":filter":"setFilter"}; ...@@ -46,6 +47,7 @@ module.routes = {"":"setFilter",":filter":"setFilter"};
}()); }());
;; ;;
/*global Thorax, Store */
(function () { (function () {
'use strict'; 'use strict';
...@@ -91,7 +93,8 @@ module.routes = {"":"setFilter",":filter":"setFilter"}; ...@@ -91,7 +93,8 @@ module.routes = {"":"setFilter",":filter":"setFilter"};
}()); }());
;; ;;
/*global Thorax, ENTER_KEY, ESCAPE_KEY*/ /*global Thorax, $, ENTER_KEY, ESCAPE_KEY */
$(function () { $(function () {
'use strict'; 'use strict';
...@@ -173,7 +176,9 @@ $(function () { ...@@ -173,7 +176,9 @@ $(function () {
}); });
;; ;;
Thorax.templates['src/templates/stats'] = Handlebars.compile('<span id=\"todo-count\"><strong>{{remaining}}</strong> {{itemText}} left</span>\n<ul id=\"filters\">\n <li>\n {{#link \"/\" class=\"selected\"}}All{{/link}}\n </li>\n <li>\n {{#link \"/active\"}}Active{{/link}}\n </li>\n <li>\n {{#link \"/completed\"}}Completed{{/link}}\n </li>\n</ul>\n{{#if completed}}\n <button id=\"clear-completed\">Clear completed</button>\n{{/if}}\n');Thorax.View.extend({ Thorax.templates['src/templates/stats'] = Handlebars.compile('<span id=\"todo-count\"><strong>{{remaining}}</strong> {{itemText}} left</span>\n<ul id=\"filters\">\n <li>\n {{#link \"/\" class=\"selected\"}}All{{/link}}\n </li>\n <li>\n {{#link \"/active\"}}Active{{/link}}\n </li>\n <li>\n {{#link \"/completed\"}}Completed{{/link}}\n </li>\n</ul>\n{{#if completed}}\n <button id=\"clear-completed\">Clear completed</button>\n{{/if}}\n');/*global Thorax, _ */
Thorax.View.extend({
name: 'stats', name: 'stats',
events: { events: {
...@@ -185,6 +190,7 @@ Thorax.templates['src/templates/stats'] = Handlebars.compile('<span id=\"todo-co ...@@ -185,6 +190,7 @@ Thorax.templates['src/templates/stats'] = Handlebars.compile('<span id=\"todo-co
}, },
initialize: function () { initialize: function () {
'use strict';
// Whenever the Todos collection changes re-render the stats // Whenever the Todos collection changes re-render the stats
// render() needs to be called with no arguments, otherwise calling // render() needs to be called with no arguments, otherwise calling
// it with arguments will insert the arguments as content // it with arguments will insert the arguments as content
...@@ -195,6 +201,7 @@ Thorax.templates['src/templates/stats'] = Handlebars.compile('<span id=\"todo-co ...@@ -195,6 +201,7 @@ Thorax.templates['src/templates/stats'] = Handlebars.compile('<span id=\"todo-co
// Clear all completed todo items, destroying their models. // Clear all completed todo items, destroying their models.
clearCompleted: function () { clearCompleted: function () {
'use strict';
_.each(window.app.Todos.completed(), function (todo) { _.each(window.app.Todos.completed(), function (todo) {
todo.destroy(); todo.destroy();
}); });
...@@ -206,6 +213,7 @@ Thorax.templates['src/templates/stats'] = Handlebars.compile('<span id=\"todo-co ...@@ -206,6 +213,7 @@ Thorax.templates['src/templates/stats'] = Handlebars.compile('<span id=\"todo-co
// be called to generate the context / scope that the template // be called to generate the context / scope that the template
// will be called with. "context" defaults to "return this" // will be called with. "context" defaults to "return this"
context: function () { context: function () {
'use strict';
var remaining = window.app.Todos.remaining().length; var remaining = window.app.Todos.remaining().length;
return { return {
itemText: remaining === 1 ? 'item' : 'items', itemText: remaining === 1 ? 'item' : 'items',
...@@ -216,15 +224,18 @@ Thorax.templates['src/templates/stats'] = Handlebars.compile('<span id=\"todo-co ...@@ -216,15 +224,18 @@ Thorax.templates['src/templates/stats'] = Handlebars.compile('<span id=\"todo-co
// Highlight which filter will appear to be active // Highlight which filter will appear to be active
highlightFilter: function () { highlightFilter: function () {
'use strict';
this.$('#filters li a') this.$('#filters li a')
.removeClass('selected') .removeClass('selected')
.filter('[href="#/' + (window.app.TodoFilter || '') + '"]') .filter('[href="#/' + (window.app.TodoFilter || '') + '"]')
.addClass('selected'); .addClass('selected');
} }
}); });
;; ;;
Thorax.templates['src/templates/app'] = Handlebars.compile('<section id=\"todoapp\">\n <header id=\"header\">\n <h1>todos</h1>\n <input id=\"new-todo\" placeholder=\"What needs to be done?\" autofocus>\n </header>\n {{^empty collection}}\n <section id=\"main\">\n <input id=\"toggle-all\" type=\"checkbox\">\n <label for=\"toggle-all\">Mark all as complete</label>\n {{#collection item-view=\"todo-item\" tag=\"ul\" id=\"todo-list\"}}\n <div class=\"view\">\n <input class=\"toggle\" type=\"checkbox\" {{#if completed}}checked=\"checked\"{{/if}}>\n <label>{{title}}</label>\n <button class=\"destroy\"></button>\n </div>\n <input class=\"edit\" value=\"{{title}}\">\n {{/collection}}\n </section>\n {{view \"stats\" tag=\"footer\" id=\"footer\"}}\n {{/empty}}\n</section>\n<div id=\"info\">\n <p>Double-click to edit a todo</p>\n <p>Written by <a href=\"https://github.com/addyosmani\">Addy Osmani</a> &amp; <a href=\"https://github.com/eastridge\">Ryan Eastridge</a></p>\n <p>Part of <a href=\"http://todomvc.com\">TodoMVC</a></p>\n</div>\n');$(function ($) { Thorax.templates['src/templates/app'] = Handlebars.compile('<section id=\"todoapp\">\n <header id=\"header\">\n <h1>todos</h1>\n <input id=\"new-todo\" placeholder=\"What needs to be done?\" autofocus>\n </header>\n {{^empty collection}}\n <section id=\"main\">\n <input id=\"toggle-all\" type=\"checkbox\">\n <label for=\"toggle-all\">Mark all as complete</label>\n {{#collection item-view=\"todo-item\" tag=\"ul\" id=\"todo-list\"}}\n <div class=\"view\">\n <input class=\"toggle\" type=\"checkbox\" {{#if completed}}checked=\"checked\"{{/if}}>\n <label>{{title}}</label>\n <button class=\"destroy\"></button>\n </div>\n <input class=\"edit\" value=\"{{title}}\">\n {{/collection}}\n </section>\n {{view \"stats\" tag=\"footer\" id=\"footer\"}}\n {{/empty}}\n</section>\n<div id=\"info\">\n <p>Double-click to edit a todo</p>\n <p>Written by <a href=\"https://github.com/addyosmani\">Addy Osmani</a> &amp; <a href=\"https://github.com/eastridge\">Ryan Eastridge</a></p>\n <p>Part of <a href=\"http://todomvc.com\">TodoMVC</a></p>\n</div>\n');/*global Thorax, $, ENTER_KEY */
$(function () {
'use strict'; 'use strict';
// The Application // The Application
...@@ -294,6 +305,8 @@ Thorax.templates['src/templates/app'] = Handlebars.compile('<section id=\"todoap ...@@ -294,6 +305,8 @@ Thorax.templates['src/templates/app'] = Handlebars.compile('<section id=\"todoap
}); });
;; ;;
/*global Thorax */
(function () { (function () {
'use strict'; 'use strict';
...@@ -313,17 +326,18 @@ Thorax.templates['src/templates/app'] = Handlebars.compile('<section id=\"todoap ...@@ -313,17 +326,18 @@ Thorax.templates['src/templates/app'] = Handlebars.compile('<section id=\"todoap
// force the collection to re-filter // force the collection to re-filter
window.app.Todos.trigger('filter'); window.app.Todos.trigger('filter');
} }
})); }))();
}()); }());
;; ;;
/*global Thorax, Backbone*/ /*global Thorax, $ */
/*jshint unused:false*/ /*jshint unused:false*/
var ENTER_KEY = 13; var ENTER_KEY = 13;
var ESCAPE_KEY = 27; var ESCAPE_KEY = 27;
$(function () { $(function () {
'use strict';
// Kick things off by creating the **App**. // Kick things off by creating the **App**.
var view = new Thorax.Views.app({ var view = new Thorax.Views.app({
collection: window.app.Todos collection: window.app.Todos
......
/*global Thorax, Backbone*/ /*global Thorax, $ */
/*jshint unused:false*/ /*jshint unused:false*/
var ENTER_KEY = 13; var ENTER_KEY = 13;
var ESCAPE_KEY = 27; var ESCAPE_KEY = 27;
$(function () { $(function () {
'use strict';
// Kick things off by creating the **App**. // Kick things off by creating the **App**.
var view = new Thorax.Views.app({ var view = new Thorax.Views.app({
collection: window.app.Todos collection: window.app.Todos
......
/*global Thorax, Store */
(function () { (function () {
'use strict'; 'use strict';
......
/*global Thorax, Backbone, $ */
//all templates are assumed to be in the templates directory //all templates are assumed to be in the templates directory
Thorax.templatePathPrefix = 'src/templates/'; Thorax.templatePathPrefix = 'src/templates/';
var app = window.app = module.exports; var app = window.app = module.exports;
$(function () { $(function () {
'use strict';
app.initBackboneLoader(); app.initBackboneLoader();
Backbone.history.start(); Backbone.history.start();
}); });
/*global Thorax */
(function () { (function () {
'use strict'; 'use strict';
......
/*global Thorax */
(function () { (function () {
'use strict'; 'use strict';
...@@ -17,6 +19,6 @@ ...@@ -17,6 +19,6 @@
// force the collection to re-filter // force the collection to re-filter
window.app.Todos.trigger('filter'); window.app.Todos.trigger('filter');
} }
})); }))();
}()); }());
$(function ($) { /*global Thorax, $, ENTER_KEY */
$(function () {
'use strict'; 'use strict';
// The Application // The Application
......
/*global Thorax, _ */
Thorax.View.extend({ Thorax.View.extend({
name: 'stats', name: 'stats',
...@@ -10,6 +12,7 @@ Thorax.View.extend({ ...@@ -10,6 +12,7 @@ Thorax.View.extend({
}, },
initialize: function () { initialize: function () {
'use strict';
// Whenever the Todos collection changes re-render the stats // Whenever the Todos collection changes re-render the stats
// render() needs to be called with no arguments, otherwise calling // render() needs to be called with no arguments, otherwise calling
// it with arguments will insert the arguments as content // it with arguments will insert the arguments as content
...@@ -20,6 +23,7 @@ Thorax.View.extend({ ...@@ -20,6 +23,7 @@ Thorax.View.extend({
// Clear all completed todo items, destroying their models. // Clear all completed todo items, destroying their models.
clearCompleted: function () { clearCompleted: function () {
'use strict';
_.each(window.app.Todos.completed(), function (todo) { _.each(window.app.Todos.completed(), function (todo) {
todo.destroy(); todo.destroy();
}); });
...@@ -31,6 +35,7 @@ Thorax.View.extend({ ...@@ -31,6 +35,7 @@ Thorax.View.extend({
// be called to generate the context / scope that the template // be called to generate the context / scope that the template
// will be called with. "context" defaults to "return this" // will be called with. "context" defaults to "return this"
context: function () { context: function () {
'use strict';
var remaining = window.app.Todos.remaining().length; var remaining = window.app.Todos.remaining().length;
return { return {
itemText: remaining === 1 ? 'item' : 'items', itemText: remaining === 1 ? 'item' : 'items',
...@@ -41,9 +46,10 @@ Thorax.View.extend({ ...@@ -41,9 +46,10 @@ Thorax.View.extend({
// Highlight which filter will appear to be active // Highlight which filter will appear to be active
highlightFilter: function () { highlightFilter: function () {
'use strict';
this.$('#filters li a') this.$('#filters li a')
.removeClass('selected') .removeClass('selected')
.filter('[href="#/' + (window.app.TodoFilter || '') + '"]') .filter('[href="#/' + (window.app.TodoFilter || '') + '"]')
.addClass('selected'); .addClass('selected');
} }
}); });
/*global Thorax, ENTER_KEY, ESCAPE_KEY*/ /*global Thorax, $, ENTER_KEY, ESCAPE_KEY */
$(function () { $(function () {
'use strict'; 'use strict';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment