Commit 74c49b35 authored by Pascal Hartig's avatar Pascal Hartig

Spine: Recompiled with CoffeeScript 1.6.2

parent 0a865424
// Generated by CoffeeScript 1.3.3 // Generated by CoffeeScript 1.6.2
(function() { (function() {
var TodoApp, var TodoApp,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
...@@ -31,13 +31,9 @@ ...@@ -31,13 +31,9 @@
function TodoApp() { function TodoApp() {
this.renderFooter = __bind(this.renderFooter, this); this.renderFooter = __bind(this.renderFooter, this);
this.toggleElems = __bind(this.toggleElems, this); this.toggleElems = __bind(this.toggleElems, this);
this.addAll = __bind(this.addAll, this); this.addAll = __bind(this.addAll, this);
this.addNew = __bind(this.addNew, this); TodoApp.__super__.constructor.apply(this, arguments);
this.addNew = __bind(this.addNew, this);
TodoApp.__super__.constructor.apply(this, arguments);
Todo.bind('create', this.addNew); Todo.bind('create', this.addNew);
Todo.bind('refresh change', this.addAll); Todo.bind('refresh change', this.addAll);
Todo.bind('refresh change', this.toggleElems); Todo.bind('refresh change', this.toggleElems);
...@@ -58,6 +54,7 @@ ...@@ -58,6 +54,7 @@
TodoApp.prototype["new"] = function(e) { TodoApp.prototype["new"] = function(e) {
var val; var val;
val = $.trim(this.newTodoInput.val()); val = $.trim(this.newTodoInput.val());
if (e.which === ENTER_KEY && val) { if (e.which === ENTER_KEY && val) {
Todo.create({ Todo.create({
...@@ -80,6 +77,7 @@ ...@@ -80,6 +77,7 @@
TodoApp.prototype.addNew = function(todo) { TodoApp.prototype.addNew = function(todo) {
var view; var view;
view = new Todos({ view = new Todos({
todo: todo todo: todo
}); });
...@@ -88,6 +86,7 @@ ...@@ -88,6 +86,7 @@
TodoApp.prototype.addAll = function() { TodoApp.prototype.addAll = function() {
var todo, _i, _len, _ref, _results; var todo, _i, _len, _ref, _results;
this.todos.empty(); this.todos.empty();
_ref = this.getByFilter(); _ref = this.getByFilter();
_results = []; _results = [];
...@@ -115,6 +114,7 @@ ...@@ -115,6 +114,7 @@
TodoApp.prototype.toggleElems = function() { TodoApp.prototype.toggleElems = function() {
var isTodos; var isTodos;
isTodos = !!Todo.count(); isTodos = !!Todo.count();
this.main.toggle(isTodos); this.main.toggle(isTodos);
this.footer.toggle(isTodos); this.footer.toggle(isTodos);
...@@ -126,6 +126,7 @@ ...@@ -126,6 +126,7 @@
TodoApp.prototype.renderFooter = function() { TodoApp.prototype.renderFooter = function() {
var active, completed, text; var active, completed, text;
text = function(count) { text = function(count) {
if (count === 1) { if (count === 1) {
return 'item'; return 'item';
......
// Generated by CoffeeScript 1.3.3 // Generated by CoffeeScript 1.6.2
(function() { (function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty, __hasProp = {}.hasOwnProperty,
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
}; };
function Todos() { function Todos() {
this.render = __bind(this.render, this); this.render = __bind(this.render, this); Todos.__super__.constructor.apply(this, arguments);
Todos.__super__.constructor.apply(this, arguments);
this.todo.bind('update', this.render); this.todo.bind('update', this.render);
this.todo.bind('destroy', this.release); this.todo.bind('destroy', this.release);
} }
...@@ -52,6 +51,7 @@ ...@@ -52,6 +51,7 @@
Todos.prototype.finishEdit = function() { Todos.prototype.finishEdit = function() {
var val; var val;
this.el.removeClass('editing'); this.el.removeClass('editing');
val = $.trim(this.editElem.val()); val = $.trim(this.editElem.val());
if (val) { if (val) {
......
// Generated by CoffeeScript 1.3.3 // Generated by CoffeeScript 1.6.2
(function() { (function() {
var __hasProp = {}.hasOwnProperty, var _ref,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
window.Todo = (function(_super) { window.Todo = (function(_super) {
__extends(Todo, _super); __extends(Todo, _super);
function Todo() { function Todo() {
return Todo.__super__.constructor.apply(this, arguments); _ref = Todo.__super__.constructor.apply(this, arguments);
return _ref;
} }
Todo.configure('Todo', 'title', 'completed'); Todo.configure('Todo', 'title', 'completed');
...@@ -28,11 +29,12 @@ ...@@ -28,11 +29,12 @@
}; };
Todo.destroyCompleted = function() { Todo.destroyCompleted = function() {
var todo, _i, _len, _ref, _results; var todo, _i, _len, _ref1, _results;
_ref = this.completed();
_ref1 = this.completed();
_results = []; _results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
todo = _ref[_i]; todo = _ref1[_i];
_results.push(todo.destroy()); _results.push(todo.destroy());
} }
return _results; return _results;
......
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