Commit 176e3b31 authored by Sindre Sorhus's avatar Sindre Sorhus

Remove all trailing whitespace and add EOF newlines

parent 2b995142
......@@ -6,4 +6,4 @@ indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
\ No newline at end of file
insert_final_newline = true
......@@ -54,4 +54,4 @@
<script src="js/localstorage.js"></script>
<script src="js/app.js"></script>
</body>
</html>
\ No newline at end of file
</html>
/*
Agility.js
Agility.js
Copyright (c) Artur B. Adib, 2011
http://agilityjs.com
......@@ -74,4 +74,4 @@ this._data.persist.openRequests++;this._data.persist.adapter.call(this,{type:'DE
else{if(typeof selectorOrQuery==='string'){selector=selectorOrQuery;}
else{selector=undefined;query=selectorOrQuery;}}
if(this._data.persist.openRequests===0){this.trigger('persist:start');}
this._data.persist.openRequests++;proto._data.persist.adapter.call(proto,{type:'GET',data:query,complete:function(){self._data.persist.openRequests--;if(self._data.persist.openRequests===0){self.trigger('persist:stop');}},success:function(data){$.each(data,function(index,entry){var obj=$$(proto,entry);if(typeof method==='string'){self[method](obj,selector);}});self.trigger('persist:gather:success',{data:data});},error:function(){self.trigger('persist:error');self.trigger('persist:gather:error');}});return this;};return this;};agility.adapter={};agility.adapter.restful=function(_params){var params=$.extend({dataType:'json',url:(this._data.persist.baseUrl||'api/')+this._data.persist.collection+(_params.id?'/'+_params.id:'')},_params);$.ajax(params);};})(window);
\ No newline at end of file
this._data.persist.openRequests++;proto._data.persist.adapter.call(proto,{type:'GET',data:query,complete:function(){self._data.persist.openRequests--;if(self._data.persist.openRequests===0){self.trigger('persist:stop');}},success:function(data){$.each(data,function(index,entry){var obj=$$(proto,entry);if(typeof method==='string'){self[method](obj,selector);}});self.trigger('persist:gather:success',{data:data});},error:function(){self.trigger('persist:error');self.trigger('persist:gather:error');}});return this;};return this;};agility.adapter={};agility.adapter.restful=function(_params){var params=$.extend({dataType:'json',url:(this._data.persist.baseUrl||'api/')+this._data.persist.collection+(_params.id?'/'+_params.id:'')},_params);$.ajax(params);};})(window);
......@@ -81,4 +81,4 @@ Backbone.sync = function(method, model, options) {
} else {
options.error("Record not found");
}
};
\ No newline at end of file
};
plovr-4b3caf2b7d84
\ No newline at end of file
plovr-4b3caf2b7d84
......@@ -48,4 +48,4 @@
<!-- The COMPILED development version (to serve the files run java -jar build/plovr.jar serve plovr.json) -->
<!-- <script type="text/javascript" src="http://localhost:9810/compile?id=todomvc&mode=ADVANCED"></script> -->
</body>
</html>
\ No newline at end of file
</html>
......@@ -46,4 +46,4 @@
*/
{template .clearCompletedInner}
Clear completed ({$number})
{/template}
\ No newline at end of file
{/template}
......@@ -11,7 +11,7 @@
// Unfortunately, the Closure Library violates these in many places.
// "accessControls": "ERROR",
// "visibility": "ERROR"
"checkRegExp": "WARNING",
"checkTypes": "WARNING",
"checkVars": "WARNING",
......
......@@ -25,7 +25,7 @@ Whilst Plovr features many of the tools from the Closure toolkit, one very usefu
The linter must be installed before use, the installation package is included in the build folder and the instructions are available on the [linter homepage](https://developers.google.com/closure/utilities/). Once installed run the following to check for errors -
`find . -name *.js | xargs gjslint`
`find . -name *.js | xargs gjslint`
(or whatever floats your OSs boat)
......@@ -47,4 +47,4 @@ Part of [TodoMVC](http://todomvc.com)
## License
Public Domain
\ No newline at end of file
Public Domain
......@@ -4,7 +4,7 @@
}
#todoapp.todos_selected #clear-completed,
#todoapp.todos_present #footer,
#todoapp.todos_present #footer,
#todoapp.todos_present #main,
.multiple .plural {
display: inherit;
......@@ -79,7 +79,7 @@
margin: 0 !important;
}
/**
/**
* Inline edit box doesn't provide indication via class names
* when a box is 'live'. Style values are set manually. Use the
* opacity change as indicator... :( */
......
......@@ -17,7 +17,7 @@
<p>Double-click to edit a todo</p>
<p>Created by <a href="http://jamesthom.as/">James Thomas</a> and <a href="https://github.com/edchat">Ed Chatelain</a></p>
</footer>
<script src="../../assets/base.js"></script>
<script data-dojo-config="async:true, parseOnLoad:true, locale:'en', paths:{'todo':'../todo/'}, deps:['dojo/parser', 'todo/app']" src="js/lib/dojo/dojo.js"></script>
</body>
......
......@@ -20,4 +20,4 @@ define(
"decimalFormat-short": "000T"
}
//end v1.x content
);
\ No newline at end of file
);
......@@ -12,7 +12,7 @@ define(["dojo/_base/declare",
"dojo/text!./app.html",
// Template Widgets
"todo/form/InlineEditBox", "todo/form/CheckBox", "dojox/mvc/Group", "dojox/mvc/Repeat", "dojox/mvc/Output"],
function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, lang, _event, on, domClass, domAttr,
function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, lang, _event, on, domClass, domAttr,
query, str, manager, keys, mvc, hash, connect, TodoModel, template) {
return declare("todo.app", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
......@@ -64,10 +64,10 @@ define(["dojo/_base/declare",
this.onItemStatusUpdate();
},
/**
* Ensure application state reflects current
/**
* Ensure application state reflects current
* hash value after rendering model in the view.
*/
*/
startup: function () {
this.inherited(arguments);
this.onHashChange(hash());
......@@ -115,7 +115,7 @@ define(["dojo/_base/declare",
* Also verify state of the "Mark All" box.
*/
onItemStatusUpdate: function () {
var completed = this.model.complete.get("value"),
var completed = this.model.complete.get("value"),
length = this.model.todos.get("length");
domClass.toggle(this.domNode, "todos_selected", completed > 0);
......@@ -129,9 +129,9 @@ define(["dojo/_base/declare",
/**
* Event fired when user selects the "Mark All" checkbox.
* Update selection state of all the todos based upon current
* Update selection state of all the todos based upon current
* checked value.
*/
*/
onMarkAll: function () {
var checked = this.mark_all.checked;
......@@ -146,7 +146,7 @@ define(["dojo/_base/declare",
* text value as new todo item in the model.
*/
onKeyPress: function (event) {
if (event.keyCode !== keys.ENTER ||
if (event.keyCode !== keys.ENTER ||
!str.trim(event.target.value).length) {
return;
}
......@@ -163,12 +163,12 @@ define(["dojo/_base/declare",
*/
onRemove: function (event) {
this.model.todos.remove(domAttr.get(event.target, "data-model-id"));
},
},
/**
* Whenever the user double clicks the item label,
* Whenever the user double clicks the item label,
* set inline edit box to true.
*/
*/
onEdit: function (event) {
query(".inline_edit", event.target).forEach(function (inline_edit) {
manager.byNode(inline_edit).edit();
......@@ -176,15 +176,15 @@ define(["dojo/_base/declare",
},
/**
* When the URI's hash value changes, modify the
* When the URI's hash value changes, modify the
* displayed list items to show either completed,
* remaining or all tasks.
* remaining or all tasks.
* Also highlight currently selected link value.
*/
*/
onHashChange: function (hash) {
var showIfDone = (hash === this.COMPLETED ? false :
var showIfDone = (hash === this.COMPLETED ? false :
(hash === this.ACTIVE? true : null));
query("#todo-list > li").forEach(lang.hitch(this, function (item, idx) {
var done = this.model.todos[idx].completed.get("value");
domClass.toggle(item, "hidden", done === showIfDone);
......
/**
/**
* There's an incompatibility between the Dojo CheckBox and the Dojo MVC
* module. To use them together, I've manually tied the "checked" attribute
* value to push updates to the "value" attribute, which the Dojo MVC module
......
......@@ -73,9 +73,9 @@ define(["dojo/_base/declare", "dojox/mvc/StatefulModel", "todo/store/LocalStorag
},
/**
* Search through current tasks list, removing all
* Search through current tasks list, removing all
* with empty titles.
*/
*/
deleteEmptyTasks: function () {
var len = this.todos.length, idx = 0;
......
......@@ -13,4 +13,4 @@ function E(a,b){var c=v;for(var d=0,e=a.length-1;d<e;++d){c=c[a[d]]||(c[a[d]]=[]
function F(a){var b=u[a](),c=t[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(y){y(a,d,b)}throw null}
u[tb]=function(){var c=navigator.userAgent.toLowerCase();var d=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(function(){return c.indexOf(ub)!=-1}())return ub;if(function(){return c.indexOf(vb)!=-1||function(){if(c.indexOf(wb)!=-1){return true}if(typeof window[xb]!=bb){try{var b=new ActiveXObject(yb);if(b){b.registerBhoIfNeeded();return true}}catch(a){}}return false}()}())return zb;if(function(){return c.indexOf(Ab)!=-1&&m.documentMode>=9}())return Bb;if(function(){return c.indexOf(Ab)!=-1&&m.documentMode>=8}())return Cb;if(function(){var a=/msie ([0-9]+)\.([0-9]+)/.exec(c);if(a&&a.length==3)return d(a)>=6000}())return Db;if(function(){return c.indexOf(Eb)!=-1}())return Fb;return Gb};t[tb]={gecko1_8:0,ie6:1,ie8:2,ie9:3,opera:4,safari:5};gwttodo.onScriptLoad=function(a){gwttodo.onScriptLoad=null;p=a;A()};if(z()){alert(Hb+Ib);return}C();B();n&&n({moduleName:M,sessionId:o,subSystem:N,evtGroup:O,millis:(new Date).getTime(),type:Jb});var G;try{E([Bb],Kb);E([ub],Lb);E([Fb],Mb);E([Cb],Nb);E([zb],Ob);E([Db],Pb);G=v[F(tb)];var H=G.indexOf(Qb);if(H!=-1){w=Number(G.substring(H+1));G=G.substring(0,H)}}catch(a){return}var I;function J(){if(!q){q=true;A();if(m.removeEventListener){m.removeEventListener(Rb,J,false)}if(I){clearInterval(I)}}}
if(m.addEventListener){m.addEventListener(Rb,function(){J()},false)}var I=setInterval(function(){if(/loaded|complete/.test(m.readyState)){J()}},50);n&&n({moduleName:M,sessionId:o,subSystem:N,evtGroup:O,millis:(new Date).getTime(),type:U});n&&n({moduleName:M,sessionId:o,subSystem:N,evtGroup:Sb,millis:(new Date).getTime(),type:P});var K=Tb+r+G+Ub;m.write(Vb+Wb+Xb+Yb+Zb+$b+_b+Yb+Zb+ac+bc+cc+K+dc+ec+fc+gc)}
gwttodo();
\ No newline at end of file
gwttodo();
......@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link type="text/css" rel="stylesheet" href="../../assets/base.css">
<link type="text/css" rel="stylesheet" href="css/app.css">
<title>GWT • TodoMVC</title>
<title>GWT • TodoMVC</title>
<script type="text/javascript" language="javascript" src="gwttodo/gwttodo.nocache.js"></script>
</head>
<body>
......@@ -13,6 +13,6 @@
<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
Your web browser must have JavaScript enabled in order for this application to display correctly.
</div>
</noscript>
</noscript>
</body>
</html>
......@@ -6,9 +6,9 @@ written in Java which is compiled to JavaScript. The files within the `gwttodo`
of running the GWT compilation process on the Java files found within the src folder. The UI
pattern used by this application is Model-View-Presenter.
Whilst this application is very different to the other TodoMVC implementations, it still makes for
Whilst this application is very different to the other TodoMVC implementations, it still makes for
an interesting comparison. Large-scale JavaScript applications are often written with GWT or Closure,
with the resulting JavaScript code delivered to the client being compiled.
with the resulting JavaScript code delivered to the client being compiled.
You can read more about the implementation on my blog:
......@@ -22,7 +22,7 @@ code for each <a href "http://code.google.com/webtoolkit/doc/latest/tutorial/com
folder also includes some redundant files, see the issue <a href="https://github.com/ColinEberhardt/todomvc/issues/9">
Remove redundant compiler output</a>.
- `src` - the Java source for this application
### Building this application
The GWT TodoMVC application was built with Java 1.6 and GWT 2.4.0. The easiest way to build this application
......
......@@ -2,7 +2,7 @@
<module rename-to='gwttodo'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.json.JSON'/>
<inherits name='com.google.gwt.json.JSON'/>
<!-- Don't inherit any GWT styles - they're ugly! -->
<!-- <inherits name='com.google.gwt.user.theme.clean.Clean'/>-->
......
......@@ -6,7 +6,7 @@ public class TextBoxWithPlaceholder extends TextBox {
/**
* Sets the placeholder for this textbox
*
*
* @param value the placeholder value
*/
public void setPlaceholder(String value) {
......@@ -15,7 +15,7 @@ public class TextBoxWithPlaceholder extends TextBox {
/**
* Gets the placeholder for this textbox
*
*
* @return the placeholder
*/
public String getPlaceholder() {
......
......@@ -2,9 +2,9 @@ package com.todo.client;
/**
* An individual ToDo item.
*
*
* @author ceberhardt
*
*
*/
public class ToDoItem {
......
......@@ -16,9 +16,9 @@ import com.google.gwt.view.client.ListDataProvider;
/**
* The presenter for the ToDo application. This class is responsible for the lifecycle of the
* {@link ToDoItem} instances.
*
*
* @author ceberhardt
*
*
*/
public class ToDoPresenter {
......@@ -57,7 +57,7 @@ public class ToDoPresenter {
/**
* The interface that handles interactions from the view.
*
*
*/
public interface ViewEventHandler {
/**
......
......@@ -24,7 +24,7 @@ import com.todo.client.ToDoPresenter.ViewEventHandler;
/**
* A view for the {@link ToDoPresenter}
*
*
*/
public class ToDoView extends Composite implements ToDoPresenter.View {
......
......@@ -19,7 +19,7 @@
</div>
</section>
<footer ui:field="todoStatsContainer">
<footer ui:field="todoStatsContainer">
<span id="todo-count">
<strong class="number" ui:field="remainingTasksCount"></strong>
<span class="word" ui:field="remainingTasksLabel"></span>
......@@ -36,6 +36,6 @@
<p>Template by <a href="http://sindresorhus.com">Sindre Sorhus</a></p>
<p>Created by <a href="http://www.scottlogic.co.uk/blog/colin/">Colin Eberhardt</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
</footer>
</g:HTMLPanel>
</ui:UiBinder>
\ No newline at end of file
</ui:UiBinder>
#main,
#footer {
display: none;
}
\ No newline at end of file
}
......@@ -52,4 +52,4 @@
<script src="../../assets/handlebars.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>
\ No newline at end of file
</html>
......@@ -154,4 +154,4 @@ jQuery(function( $ ) {
App.init();
});
\ No newline at end of file
});
......@@ -2,4 +2,4 @@
## Credit
Created by [Sindre Sorhus](https://github.com/sindresorhus)
\ No newline at end of file
Created by [Sindre Sorhus](https://github.com/sindresorhus)
......@@ -15,4 +15,4 @@ task 'watch', 'Watch src/ for changes', ->
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
print data.toString()
\ No newline at end of file
print data.toString()
......@@ -74,4 +74,4 @@
<!-- The Demo -->
<script src="js/app.js"></script>
</body>
</html>
\ No newline at end of file
</html>
/**
* Backbone localStorage Adapter
* https://github.com/jeromegn/Backbone.localStorage
*/(function(){function a(){return((1+Math.random())*65536|0).toString(16).substring(1)}function b(){return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}Backbone.LocalStorage=window.Store=function(a){this.name=a;var b=this.localStorage().getItem(this.name);this.records=b&&b.split(",")||[]},_.extend(Backbone.LocalStorage.prototype,{save:function(){this.localStorage().setItem(this.name,this.records.join(","))},create:function(a){return a.id||(a.id=b(),a.set(a.idAttribute,a.id)),this.localStorage().setItem(this.name+"-"+a.id,JSON.stringify(a)),this.records.push(a.id.toString()),this.save(),a},update:function(a){return this.localStorage().setItem(this.name+"-"+a.id,JSON.stringify(a)),_.include(this.records,a.id.toString())||this.records.push(a.id.toString()),this.save(),a},find:function(a){return JSON.parse(this.localStorage().getItem(this.name+"-"+a.id))},findAll:function(){return _(this.records).chain().map(function(a){return JSON.parse(this.localStorage().getItem(this.name+"-"+a))},this).compact().value()},destroy:function(a){return this.localStorage().removeItem(this.name+"-"+a.id),this.records=_.reject(this.records,function(b){return b==a.id.toString()}),this.save(),a},localStorage:function(){return localStorage}}),Backbone.LocalStorage.sync=window.Store.sync=Backbone.localSync=function(a,b,c,d){var e=b.localStorage||b.collection.localStorage;typeof c=="function"&&(c={success:c,error:d});var f;switch(a){case"read":f=b.id!=undefined?e.find(b):e.findAll();break;case"create":f=e.create(b);break;case"update":f=e.update(b);break;case"delete":f=e.destroy(b)}f?c.success(f):c.error("Record not found")},Backbone.ajaxSync=Backbone.sync,Backbone.getSyncMethod=function(a){return a.localStorage||a.collection&&a.collection.localStorage?Backbone.localSync:Backbone.ajaxSync},Backbone.sync=function(a,b,c,d){return Backbone.getSyncMethod(b).apply(this,[a,b,c,d])}})();
\ No newline at end of file
*/(function(){function a(){return((1+Math.random())*65536|0).toString(16).substring(1)}function b(){return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}Backbone.LocalStorage=window.Store=function(a){this.name=a;var b=this.localStorage().getItem(this.name);this.records=b&&b.split(",")||[]},_.extend(Backbone.LocalStorage.prototype,{save:function(){this.localStorage().setItem(this.name,this.records.join(","))},create:function(a){return a.id||(a.id=b(),a.set(a.idAttribute,a.id)),this.localStorage().setItem(this.name+"-"+a.id,JSON.stringify(a)),this.records.push(a.id.toString()),this.save(),a},update:function(a){return this.localStorage().setItem(this.name+"-"+a.id,JSON.stringify(a)),_.include(this.records,a.id.toString())||this.records.push(a.id.toString()),this.save(),a},find:function(a){return JSON.parse(this.localStorage().getItem(this.name+"-"+a.id))},findAll:function(){return _(this.records).chain().map(function(a){return JSON.parse(this.localStorage().getItem(this.name+"-"+a))},this).compact().value()},destroy:function(a){return this.localStorage().removeItem(this.name+"-"+a.id),this.records=_.reject(this.records,function(b){return b==a.id.toString()}),this.save(),a},localStorage:function(){return localStorage}}),Backbone.LocalStorage.sync=window.Store.sync=Backbone.localSync=function(a,b,c,d){var e=b.localStorage||b.collection.localStorage;typeof c=="function"&&(c={success:c,error:d});var f;switch(a){case"read":f=b.id!=undefined?e.find(b):e.findAll();break;case"create":f=e.create(b);break;case"update":f=e.update(b);break;case"delete":f=e.destroy(b)}f?c.success(f):c.error("Record not found")},Backbone.ajaxSync=Backbone.sync,Backbone.getSyncMethod=function(a){return a.localStorage||a.collection&&a.collection.localStorage?Backbone.localSync:Backbone.ajaxSync},Backbone.sync=function(a,b,c,d){return Backbone.getSyncMethod(b).apply(this,[a,b,c,d])}})();
......@@ -14,4 +14,4 @@ Open Terminal in this folder.
- `cake build` to compile once
- `cake watch` to compile on save
\ No newline at end of file
- `cake watch` to compile on save
......@@ -28,4 +28,4 @@ $ ->
# Load the todos
todos.fetch()
# kb.vmRelease(app.viewmodels) # Destroy when finished with the view model
\ No newline at end of file
# kb.vmRelease(app.viewmodels) # Destroy when finished with the view model
class window.Todo extends Backbone.Model
completed: (completed) ->
return !!@get('completed') if arguments.length == 0
@save({completed: if completed then new Date() else null})
\ No newline at end of file
@save({completed: if completed then new Date() else null})
......@@ -9,4 +9,4 @@ class window.TodoCollection extends Backbone.Collection
destroyCompleted: ->
completed_tasks = @filter((todo) -> return todo.completed())
model.destroy() for model in completed_tasks
\ No newline at end of file
model.destroy() for model in completed_tasks
......@@ -6,4 +6,4 @@ class window.AppRouter extends Backbone.Router
all: -> app.viewmodels.settings.list_filter_mode('')
active: -> app.viewmodels.settings.list_filter_mode('active')
completed: -> app.viewmodels.settings.list_filter_mode('completed')
\ No newline at end of file
completed: -> app.viewmodels.settings.list_filter_mode('completed')
......@@ -10,4 +10,4 @@ window.FooterViewModel = (todos) ->
)
@onDestroyCompleted = => todos.destroyCompleted()
@
\ No newline at end of file
@
......@@ -9,4 +9,4 @@ window.HeaderViewModel = (todos) ->
# Create task and reset UI
todos.create({title: $.trim(@title())})
@title('')
@
\ No newline at end of file
@
window.SettingsViewModel = ->
@list_filter_mode = ko.observable('')
@
\ No newline at end of file
@
......@@ -33,4 +33,4 @@ window.TodosViewModel = (todos) ->
read: => return not @todos.collection().remainingCount()
write: (completed) => @todos.collection().completeAll(completed)
)
@
\ No newline at end of file
@
......@@ -64,4 +64,4 @@
<!-- / -->
<script src="js/app.js"></script>
</body>
</html>
\ No newline at end of file
</html>
# Knockout.js TodoMVC app
[ashish101](https://github.com/ashish01/knockoutjs-todos) wrote the original version of this application, which was then refactored by Addy Osmani and later rewritten by TodoMVC contributors.
\ No newline at end of file
[ashish101](https://github.com/ashish01/knockoutjs-todos) wrote the original version of this application, which was then refactored by Addy Osmani and later rewritten by TodoMVC contributors.
......@@ -15,4 +15,4 @@ task 'watch', 'Watch src/ for changes', ->
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
print data.toString()
\ No newline at end of file
print data.toString()
......@@ -205,4 +205,4 @@ body {
#credits a {
color: #888;
}
\ No newline at end of file
}
......@@ -63,4 +63,4 @@
<script src="js/models/todo.js"></script>
<script src="js/app.js"></script>
</body>
</html>
\ No newline at end of file
</html>
......@@ -27,4 +27,4 @@
module.exports = Spine.Model.Local;
}
}).call(this);
\ No newline at end of file
}).call(this);
......@@ -4,4 +4,4 @@ a&&(a={});this.options=f.extend({},this.options,a);this.options.history&&(this.h
typeof b?c=a.pop():"boolean"===typeof b&&(c.trigger=a.pop());c=f.extend({},this.options,c);a=a.join("/");if(this.path!==a&&(this.path=a,this.trigger("navigate",this.path),c.trigger&&this.matchRoute(this.path,c),!c.shim))return this.history?history.pushState({},document.title,this.path):window.location.hash=this.path};b.getPath=function(){var a;a=window.location.pathname;"/"!==a.substr(0,1)&&(a="/"+a);return a};b.getHash=function(){return window.location.hash};b.getFragment=function(){return this.getHash().replace(j,
"")};b.getHost=function(){return(document.location+"").replace(this.getPath()+this.getHash(),"")};b.change=function(){var a;a=""!==this.getFragment()?this.getFragment():this.getPath();if(a!==this.path)return this.path=a,this.matchRoute(this.path)};b.matchRoute=function(a,b){var c,d,g,e;e=this.routes;d=0;for(g=e.length;d<g;d++)if(c=e[d],c.match(a,b))return this.trigger("change",c,a),c};b.prototype.match=function(a,b){var c,d,e,f;null==b&&(b={});c=this.route.exec(a);if(!c)return!1;b.match=c;e=c.slice(1);
if(this.names.length){c=0;for(f=e.length;c<f;c++)d=e[c],b[this.names[c]]=d}return!1!==this.callback.call(null,b)};return b}(Spine.Module);Spine.Route.change=Spine.Route.proxy(Spine.Route.change);Spine.Controller.include({route:function(d,b){return Spine.Route.add(d,this.proxy(b))},routes:function(d){var b,e,a;a=[];for(b in d)e=d[b],a.push(this.route(b,e));return a},navigate:function(){return Spine.Route.navigate.apply(Spine.Route,arguments)}});"undefined"!==typeof module&&null!==module&&(module.exports=
Spine.Route)}).call(this);
\ No newline at end of file
Spine.Route)}).call(this);
......@@ -20,4 +20,4 @@ function(){var a,c,d,f,g,h;g=this.events;h=[];for(c in g)f=g[c],"function"!==typ
return this.el};a.prototype.append=function(){var a,c,d;c=1<=arguments.length?k.call(arguments,0):[];var f,g,h;h=[];f=0;for(g=c.length;f<g;f++)a=c[f],h.push(a.el||a);(d=this.el).append.apply(d,h);this.refreshElements();return this.el};a.prototype.appendTo=function(a){this.el.appendTo(a.el||a);this.refreshElements();return this.el};a.prototype.prepend=function(){var a,c,d;c=1<=arguments.length?k.call(arguments,0):[];var f,g,h;h=[];f=0;for(g=c.length;f<g;f++)a=c[f],h.push(a.el||a);(d=this.el).prepend.apply(d,
h);this.refreshElements();return this.el};a.prototype.replace=function(a){var c;c=[this.el,l(a.el||a)];a=c[0];this.el=c[1];a.replaceWith(this.el);this.delegateEvents();this.refreshElements();return this.el};return a}(j);l=("undefined"!==typeof window&&null!==window?window.jQuery:void 0)||("undefined"!==typeof window&&null!==window?window.Zepto:void 0)||function(c){return c};"function"!==typeof Object.create&&(Object.create=function(c){var a;a=function(){};a.prototype=c;return new a});p=function(c){return Object.prototype.toString.call(c)===
"[object Array]"};t=function(c){return Array.prototype.slice.call(c,0)};i=this.Spine={};"undefined"!==typeof module&&null!==module&&(module.exports=i);i.version="1.0.6";i.isArray=p;i.isBlank=function(c){var a;if(!c)return true;for(a in c)return false;return true};i.$=l;i.Events=n;i.Log=r;i.Module=j;i.Controller=m;i.Model=o;j.extend.call(i,n);j.create=j.sub=m.create=m.sub=o.sub=function(c,a){var b;b=function(a){function b(){b.__super__.constructor.apply(this,arguments)}q(b,a);return b}(this);c&&b.include(c);
a&&b.extend(a);typeof b.unbind==="function"&&b.unbind();return b};o.setup=function(c,a){var b;a==null&&(a=[]);b=function(a){function b(){b.__super__.constructor.apply(this,arguments)}q(b,a);return b}(this);b.configure.apply(b,[c].concat(k.call(a)));return b};j.init=m.init=o.init=function(c,a,b,e,d){return new this(c,a,b,e,d)};i.Class=j}).call(this);
\ No newline at end of file
a&&b.extend(a);typeof b.unbind==="function"&&b.unbind();return b};o.setup=function(c,a){var b;a==null&&(a=[]);b=function(a){function b(){b.__super__.constructor.apply(this,arguments)}q(b,a);return b}(this);b.configure.apply(b,[c].concat(k.call(a)));return b};j.init=m.init=o.init=function(c,a,b,e,d){return new this(c,a,b,e,d)};i.Class=j}).call(this);
......@@ -17,4 +17,4 @@ Open Terminal in this folder.
## Credit
Created by [Sindre Sorhus](https://github.com/sindresorhus)
\ No newline at end of file
Created by [Sindre Sorhus](https://github.com/sindresorhus)
......@@ -85,4 +85,4 @@ class TodoApp extends Spine.Controller
$ ->
new TodoApp el: $('#todoapp')
Spine.Route.setup()
\ No newline at end of file
Spine.Route.setup()
......@@ -37,4 +37,4 @@ class window.Todos extends Spine.Controller
if val then @todo.updateAttribute( 'title', val ) else @remove()
finishEditOnEnter: (e) ->
@finishEdit() if e.which is ENTER_KEY
\ No newline at end of file
@finishEdit() if e.which is ENTER_KEY
......@@ -9,4 +9,4 @@ class window.Todo extends Spine.Model
@select (todo) -> !!todo.completed
@destroyCompleted: ->
todo.destroy() for todo in @completed()
\ No newline at end of file
todo.destroy() for todo in @completed()
......@@ -36,7 +36,7 @@
</div>
<input class="edit" type="text" value="{{title}}" />
</script>
<script type="text/x-handlebars-template" id="stats-template">
<span id="todo-count"><strong>{{remaining}}</strong> {{pluralize remaining "item"}} left</span>
<ul id="filters">
......
......@@ -5,12 +5,12 @@ YUI.add('todo-app', function (Y) {
var TodoList = Y.TodoMVC.TodoList,
TodoView = Y.TodoMVC.TodoView,
TodoApp;
// -- Main Application --------------
TodoApp = Y.Base.create('todoApp', Y.App, [], {
// Set container to bind to the existing '#todoapp' element
containerTemplate: '#todoapp',
// Compile statistics template with Handlebars.
template: Y.Handlebars.compile(Y.one('#stats-template').getHTML()),
......@@ -71,11 +71,11 @@ YUI.add('todo-app', function (Y) {
completed: completed,
remaining: remaining
}));
// Highlights for filters at the bottom of our Todo application.
container.one('#filters li a').removeClass('selected');
container.all('#filters li a')
.filter('[href="#/' + (this.get('filter') || '') + '"]')
.addClass('selected');
......@@ -83,7 +83,7 @@ YUI.add('todo-app', function (Y) {
main.hide();
footer.hide();
}
// Set the checkbox only if all Todos have been completed.
this.get('allCheckbox').set('checked', !remaining);
this.addViews();
......
YUI.add('todo-list', function (Y) {
"use strict";
// Dependencies from Y.MVC.
var Todo = Y.TodoMVC.Todo,
TodoList;
......
......@@ -6,7 +6,7 @@ YUI.add('todo-view', function (Y) {
// The container element that the View is rendered under.
containerTemplate: '<li>',
// Compile our template using Handlebars.
template: Y.Handlebars.compile(Y.one('#item-template').getHTML()),
......@@ -50,7 +50,7 @@ YUI.add('todo-view', function (Y) {
return this;
},
// Toggle the linked Todo's completion status.
// Toggle the linked Todo's completion status.
toggleComplete: function () {
this.get('model').toggle();
},
......@@ -61,12 +61,12 @@ YUI.add('todo-view', function (Y) {
this.get('inputNode').focus();
},
// Get the value from our input field while hiding it, and
// Get the value from our input field while hiding it, and
// save it to our Todo when focus is lost from the field.
close: function (e) {
var value = this.get('inputNode').get('value'),
editedValue = Y.Escape.html(Y.Lang.trim(value));
this.get('container').removeClass('editing');
if (editedValue) {
......
......@@ -4,4 +4,4 @@
if ( location.hostname === 'todomvc.com' ) {
var _gaq=[['_setAccount','UA-31081062-1'],['_trackPageview']];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)}(document,'script'));
}
})( window );
\ No newline at end of file
})( window );
......@@ -76,4 +76,4 @@ define([
});
return TodoView;
});
\ No newline at end of file
});
......@@ -77,4 +77,4 @@ define('app/models/store', [
};
};
}
);
\ No newline at end of file
);
......@@ -17,4 +17,4 @@ define('app/models/todo', ['ember'],
}.observes( 'title', 'completed' )
});
}
);
\ No newline at end of file
);
......@@ -62,4 +62,4 @@ describe( 'controllers/todos', function() {
done();
});
});
\ No newline at end of file
});
......@@ -28,4 +28,4 @@ describe( 'models/store', function() {
store.remove( todo );
});
});
\ No newline at end of file
});
......@@ -18,11 +18,11 @@ describe( 'TodoMVC features.', function(){
it( 'should allow creating a new todo' , function() {
runs( function(){
$( '#new-todo' ).val( todoTitle ).trigger( enterEvent );
$( '#new-todo' ).val( todoTitle ).trigger( enterEvent );
});
waits( 100 );
runs( function() {
!!$( '#todo-list li' ).text().match( todoTitle );
});
......
......@@ -26,4 +26,4 @@ describe( 'views/*', function() {
});
});
});
\ No newline at end of file
});
......@@ -28,4 +28,4 @@ d.isBrowser=G)if(x=v.head=document.getElementsByTagName("head")[0],y=document.ge
null,a=c.getAttribute("data-requirecontext"),h=c.getAttribute("data-requiremodule"),t[a].completeLoad(h),c.detachEvent&&!da?c.detachEvent("onreadystatechange",d.onScriptLoad):c.removeEventListener("load",d.onScriptLoad,!1)};d.attach=function(a,c,h,k,j,n){var o;if(G)return k=k||d.onScriptLoad,o=c&&c.config&&c.config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),o.type=j||"text/javascript",o.charset="utf-8",o.async=!v.skipAsync[a],c&&o.setAttribute("data-requirecontext",
c.contextName),o.setAttribute("data-requiremodule",h),o.attachEvent&&!da?(O=!0,n?o.onreadystatechange=function(){if(o.readyState==="loaded")o.onreadystatechange=null,o.attachEvent("onreadystatechange",k),n(o)}:o.attachEvent("onreadystatechange",k)):o.addEventListener("load",k,!1),o.src=a,n||d.addScriptToDom(o),o;else ca&&(importScripts(a),c.completeLoad(h));return null};if(G){u=document.getElementsByTagName("script");for(H=u.length-1;H>-1&&(z=u[H]);H--){if(!x)x=z.parentNode;if(A=z.getAttribute("data-main")){if(!r.baseUrl)u=
A.split("/"),z=u.pop(),u=u.length?u.join("/")+"/":"./",r.baseUrl=u,A=z.replace(aa,"");r.deps=r.deps?r.deps.concat(A):[A];break}}}d.checkReadyState=function(){var a=v.contexts,c;for(c in a)if(!(c in K)&&a[c].waitCount)return;d.resourcesReady(!0)};d.resourcesReady=function(a){var c,h;d.resourcesDone=a;if(d.resourcesDone)for(h in a=v.contexts,a)if(!(h in K)&&(c=a[h],c.jQueryIncremented))V(c.jQuery,!1),c.jQueryIncremented=!1};d.pageLoaded=function(){if(document.readyState!=="complete")document.readyState=
"complete"};if(G&&document.addEventListener&&!document.readyState)document.readyState="loading",window.addEventListener("load",d.pageLoaded,!1);d(r);if(d.isAsync&&typeof setTimeout!=="undefined")B=v.contexts[r.context||"_"],B.requireWait=!0,setTimeout(function(){B.requireWait=!1;B.takeGlobalQueue();B.jQueryCheck();B.scriptCount||B.resume();d.checkReadyState()},0)}})();
\ No newline at end of file
"complete"};if(G&&document.addEventListener&&!document.readyState)document.readyState="loading",window.addEventListener("load",d.pageLoaded,!1);d(r);if(d.isAsync&&typeof setTimeout!=="undefined")B=v.contexts[r.context||"_"],B.requireWait=!0,setTimeout(function(){B.requireWait=!1;B.takeGlobalQueue();B.jQueryCheck();B.scriptCount||B.resume();d.checkReadyState()},0)}})();
......@@ -8,4 +8,4 @@ function(){c.readyState===4&&b(c.responseText)};c.send(null)}:typeof process!=="
f.charAt(0)===65279&&(f=f.substring(1));for(d.append(f);(f=c.readLine())!==null;)d.append(e),d.append(f);g=String(d.toString())}finally{c.close()}b(g)});return g={version:"0.27.0",strip:function(a){if(a){var a=a.replace(n,""),b=a.match(o);b&&(a=b[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var a,b,c;if(typeof XMLHttpRequest!==
"undefined")return new XMLHttpRequest;else for(b=0;b<3;b++){c=k[b];try{a=new ActiveXObject(c)}catch(e){}if(a){k=[c];break}}if(!a)throw Error("createXhr(): XMLHttpRequest not available");return a},get:h,parseName:function(a){var b=!1,c=a.indexOf("."),e=a.substring(0,c),a=a.substring(c+1,a.length),c=a.indexOf("!");c!==-1&&(b=a.substring(c+1,a.length),b=b==="strip",a=a.substring(0,c));return{moduleName:e,ext:a,strip:b}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,b,c,e){var d=g.xdRegExp.exec(a),
f;if(!d)return!0;a=d[2];d=d[3];d=d.split(":");f=d[1];d=d[0];return(!a||a===b)&&(!d||d===c)&&(!f&&!d||f===e)},finishLoad:function(a,b,c,e,d){c=b?g.strip(c):c;d.isBuild&&d.inlineText&&(j[a]=c);e(c)},load:function(a,b,c,e){var d=g.parseName(a),f=d.moduleName+"."+d.ext,m=b.toUrl(f),h=e&&e.text&&e.text.useXhr||g.useXhr;!i||h(m,p,q,r)?g.get(m,function(b){g.finishLoad(a,d.strip,b,c,e)}):b([f],function(a){g.finishLoad(d.moduleName+"."+d.ext,d.strip,a,c,e)})},write:function(a,b,c){if(b in j){var e=g.jsEscape(j[b]);
c.asModule(a+"!"+b,"define(function () { return '"+e+"';});\n")}},writeFile:function(a,b,c,e,d){var b=g.parseName(b),f=b.moduleName+"."+b.ext,h=c.toUrl(b.moduleName+"."+b.ext)+".js";g.load(f,c,function(){var b=function(a){return e(h,a)};b.asModule=function(a,b){return e.asModule(a,h,b)};g.write(a,f,b,d)},d)}}})})();
\ No newline at end of file
c.asModule(a+"!"+b,"define(function () { return '"+e+"';});\n")}},writeFile:function(a,b,c,e,d){var b=g.parseName(b),f=b.moduleName+"."+b.ext,h=c.toUrl(b.moduleName+"."+b.ext)+".js";g.load(f,c,function(){var b=function(a){return e(h,a)};b.asModule=function(a,b){return e.asModule(a,h,b)};g.write(a,f,b,d)},d)}}})})();
......@@ -10,4 +10,4 @@ To fire specs runner, append `#specs` to the url in address bar, and reload the
Initial release by @tomdale.
Refactoring and maintenance by @stas.
\ No newline at end of file
Refactoring and maintenance by @stas.
......@@ -70,4 +70,4 @@
<script src="js/lib/batman.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>
\ No newline at end of file
</html>
......@@ -15,4 +15,4 @@ A quick note: This app uses `Batman.LocalStorage` to persist the Todo records ac
## Build
This app is written in CoffeeScript, so to make changes, please edit `js/app.coffee` and rebuild the JavaScript with the `coffee` compiler.
\ No newline at end of file
This app is written in CoffeeScript, so to make changes, please edit `js/app.coffee` and rebuild the JavaScript with the `coffee` compiler.
......@@ -205,4 +205,4 @@ body {
#credits a {
color: #888;
}
\ No newline at end of file
}
......@@ -236,4 +236,4 @@ li[class^="icon-"].icon-large:before, li[class*=" icon-"].icon-large:before {
.icon-trophy:before { content: "\f091"; }
.icon-github-sign:before { content: "\f092"; }
.icon-upload-alt:before { content: "\f093"; }
.icon-lemon:before { content: "\f094"; }
\ No newline at end of file
.icon-lemon:before { content: "\f094"; }
......@@ -205,4 +205,4 @@ body {
#credits a {
color: #888;
}
\ No newline at end of file
}
......@@ -26,4 +26,4 @@
<script type='text/javascript' data-dojo-config="async: true" src='http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js.uncompressed.js'></script>
<script src="todo.js"></script>
</body>
</html>
\ No newline at end of file
</html>
......@@ -2,4 +2,4 @@
#stats.show,
#stats.show #clear-completed {
display: block;
}
\ No newline at end of file
}
......@@ -3,9 +3,9 @@
<label for="toggle-all">Mark all as complete</label>
<ul id="todo-list">
<% list(todos, function( todo ) { %>
<li class="todo
<%= todo.attr("complete") ? "done" : "" %>
<%= todo.attr("editing") ? "editing" : "" %>"
<li class="todo
<%= todo.attr("complete") ? "done" : "" %>
<%= todo.attr("editing") ? "editing" : "" %>"
<%= (el)-> can.data(el, 'todo', todo) %>>
<div class="view">
<input class="toggle" type="checkbox" <%= todo.attr("complete") ? "checked" : "" %>>
......@@ -18,8 +18,8 @@
</ul>
</section>
<footer id="stats" class="<%= todos.attr("length") > 0 ? "show" : "" %>">
<a id="clear-completed">Clear <%= todos.completed() %>
<a id="clear-completed">Clear <%= todos.completed() %>
completed item<%= todos.completed() == 1 ? "" : "s" %></a>
<div id="todo-count"><span><%= todos.remaining() %></span>
<div id="todo-count"><span><%= todos.remaining() %></span>
item<%= todos.remaining() == 1 ? "" : "s" %> left</div>
</footer>
\ No newline at end of file
</footer>
......@@ -11,4 +11,4 @@ define({
completed: 'Completed'
},
clearCompleted: 'Clear completed'
});
\ No newline at end of file
});
......@@ -35,4 +35,4 @@
/* TODO: Reinstate once we add routing */
#filters {
display: none;
}
\ No newline at end of file
}
......@@ -7,4 +7,4 @@ define(function() {
return todo;
}
});
\ No newline at end of file
});
......@@ -22,4 +22,4 @@ define(function() {
return (s4()+s4()+"-"+s4()+"-"+s4()+"-"+s4()+"-"+s4()+s4()+s4());
}
});
\ No newline at end of file
});
......@@ -3,4 +3,4 @@ define({
todo: {
placeholder: 'What needs to be done?'
}
});
\ No newline at end of file
});
......@@ -15,4 +15,4 @@ define(function() {
return result;
}
});
\ No newline at end of file
});
......@@ -3,4 +3,4 @@ define({
templateBy: 'Template by',
createdBy: 'Created by',
partOf: 'Part of'
});
\ No newline at end of file
});
......@@ -11,4 +11,4 @@ define(function() {
node.className = data[info.prop] ? 'completed' : '';
};
});
\ No newline at end of file
});
define({
markAll: 'Mark all as complete'
});
\ No newline at end of file
});
......@@ -3,4 +3,4 @@
}
.todos-one #toggle-all, .todos-many #toggle-all {
display: block;
}
\ No newline at end of file
}
......@@ -182,4 +182,4 @@ define({
{ module: 'wire/connect' },
{ module: 'cola' }
]
});
\ No newline at end of file
});
......@@ -18,4 +18,4 @@
curl(config, ['poly/string', 'poly/array']).next(['wire!main']);
})( curl );
\ No newline at end of file
})( curl );
......@@ -15,4 +15,4 @@
<section id="todoapp"></section>
<script src="../../../assets/base.js"></script>
</body>
</html>
\ No newline at end of file
</html>
......@@ -39,4 +39,4 @@ Helpful link for updating submodules:
* [AspectJ](http://www.eclipse.org/aspectj/) and [Spring Framework AOP](http://static.springsource.org/spring/docs/3.0.x/reference/aop.html) for inspiration and great docs
* Implementation ideas from @phiggins42's [uber.js AOP](https://github.com/phiggins42/uber.js/blob/master/lib/aop.js)
* API ideas from [jquery-aop](http://code.google.com/p/jquery-aop/)
\ No newline at end of file
* API ideas from [jquery-aop](http://code.google.com/p/jquery-aop/)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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