Commit 2b46d3e4 authored by addyosmani's avatar addyosmani

Initial changes to bring application up to spec.

parent b0624d35
/*
html, html,
body { body {
margin: 0; margin: 0;
...@@ -205,3 +206,4 @@ body { ...@@ -205,3 +206,4 @@ body {
#credits a { #credits a {
color: #888; color: #888;
} }
*/
\ No newline at end of file
...@@ -2,62 +2,62 @@ ...@@ -2,62 +2,62 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Backbone.js</title> <title>Backbone.js</title>
<link rel="stylesheet" href="css/app.css"/> <link rel="stylesheet" href="../../assets/base.css"/>
</head> </head>
<body> <body>
<div id="todoapp"> <section id="todoapp">
<header> <header id="header">
<h1>Todos</h1> <h1>Todos</h1>
<input id="new-todo" type="text" placeholder="What needs to be done?"> <input id="new-todo" placeholder="What needs to be done?" autofocus>
</header> </header>
<section id="main"> <section id="main">
<input id="toggle-all" type="checkbox"> <input id="toggle-all" type="checkbox">
<label for="toggle-all">Mark all as complete</label> <label for="toggle-all">Mark all as complete</label>
<ul id="todo-list"> <ul id="todo-list"></ul>
</ul>
</section> </section>
</section>
<footer> <footer id="info">
<a id="clear-completed">Clear completed</a> <p>Double-click to edit a todo</p>
<div id="todo-count"></div> <p>Created by <a href="http://addyosmani.github.com/todomvc/">Addy Osmani</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer> </footer>
</div>
<div id="instructions">
Double-click to edit a todo.
</div>
<div id="credits">
Created by
<br />
<a href="http://jgn.me/">J&eacute;r&ocirc;me Gravel-Niquet</a>.
<br />Cleanup, edits: <a href="http://addyosmani.com">Addy Osmani</a>, <a href="http://github.com/boushley">Aaron Boushley</a>.
</div>
<script src="js/libs/json2.js"></script> <script src="js/libs/json2.js"></script>
<script src="js/libs/jquery-1.7.1.min.js"></script> <script src="../../assets/jquery.min.js"></script>
<script src="js/libs/underscore.js"></script> <script src="js/libs/underscore.js"></script>
<script src="js/libs/backbone.js"></script> <script src="js/libs/backbone.js"></script>
<script src="js/libs/backbone-localstorage.js"></script> <script src="js/libs/backbone-localstorage.js"></script>
<script src="js/app.js"></script> <script src="js/app.js"></script>
<!-- Templates -->
<script type="text/template" id="item-template"> <script type="text/template" id="item-template">
<div class="view"> <div class="view">
<input class="toggle" type="checkbox" <%= done ? 'checked="checked"' : '' %> /> <input class="toggle" type="checkbox" <%= done ? 'checked="checked"' : '' %> />
<label><%= title %></label> <label><%= title %></label>
<a class="destroy"></a> <button class="destroy"></button>
</div> </div>
<input class="edit" type="text" value="<%= title %>" /> <input class="edit" type="text" value="<%= title %>" />
</script> </script>
<script type="text/template" id="stats-template"> <script type="text/template" id="stats-template">
<footer id="footer">
<span id="todo-count"><strong><%= remaining %></strong> <%= remaining == 1 ? 'item' : 'items' %> left</span>
<ul id="filters">
<li>
<a class="selected" href="#/">All</a>
</li>
<li>
<a href="#/active">Active</a>
</li>
<li>
<a href="#/completed">Completed</a>
</li>
</ul>
<% if (done) { %> <% if (done) { %>
<a id="clear-completed">Clear <%= done %> completed <%= done == 1 ? 'item' : 'items' %></a> <button id="clear-completed">Clear <%= done %> completed <%= done == 1 ? 'item' : 'items' %></button>
<% } %> <% } %>
<div class="todo-count"><b><%= remaining %></b> <%= remaining == 1 ? 'item' : 'items' %> left</div> </footer>
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
// An example Backbone application contributed by
// [Jérôme Gravel-Niquet](http://jgn.me/). This demo uses a simple
// [LocalStorage adapter](backbone-localstorage.js)
// to persist Backbone models within your browser.
// Load the application once the DOM is ready, using `jQuery.ready`: // Load the application once the DOM is ready, using `jQuery.ready`:
$(function(){ $(function(){
...@@ -92,7 +87,7 @@ $(function(){ ...@@ -92,7 +87,7 @@ $(function(){
events: { events: {
"click .toggle" : "toggleDone", "click .toggle" : "toggleDone",
"dblclick .view" : "edit", "dblclick .view" : "edit",
"click a.destroy" : "clear", "click .destroy" : "clear",
"keypress .edit" : "updateOnEnter", "keypress .edit" : "updateOnEnter",
"blur .edit" : "close" "blur .edit" : "close"
}, },
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# Template • [TodoMVC](http://todomvc.com)
## Getting Started
Read the [App Specification](https://github.com/addyosmani/todomvc/wiki/App-Specification) before touching the template.
## Need help?
Feel free to [contact me](https://github.com/sindresorhus) if you have any questions or need help with the template.
## Credit
Created by [Sindre Sorhus](http://sindresorhus.com)
\ No newline at end of file
...@@ -2,51 +2,69 @@ ...@@ -2,51 +2,69 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Template - TodoMVC</title> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Template • TodoMVC</title>
<link rel="stylesheet" href="../assets/base.css"> <link rel="stylesheet" href="../assets/base.css">
<!-- CSS overrides - remove if you don't need it -->
<link rel="stylesheet" href="css/app.css"> <link rel="stylesheet" href="css/app.css">
</head> </head>
<body> <body>
<div id="todoapp"> <section id="todoapp">
<header> <header id="header">
<h1>Todos</h1> <h1>todos</h1>
<input id="new-todo" type="text" placeholder="What needs to be done?"> <input id="new-todo" placeholder="What needs to be done?" autofocus>
</header> </header>
<!-- this section is hidden by default and you be shown when there are todos and hidden when not --> <!-- this section should be hidden by default and shown when there are todos -->
<section id="main"> <section id="main">
<input id="toggle-all" type="checkbox"> <input id="toggle-all" type="checkbox">
<label for="toggle-all">Mark all as complete</label> <label for="toggle-all">Mark all as complete</label>
<ul id="todo-list"> <ul id="todo-list">
<li class="done"> <!-- these are here just to show the structure of the list items -->
<!-- list items should get the class `editing` when editing and `completed` when marked as completed -->
<li class="completed">
<div class="view"> <div class="view">
<input class="toggle" type="checkbox" checked> <input class="toggle" type="checkbox" checked>
<label>Create a TodoMVC template</label> <label>Create a TodoMVC template</label>
<a class="destroy"></a> <button class="destroy"></button>
</div> </div>
<input class="edit" type="text" value="Create a TodoMVC template"> <input class="edit" value="Create a TodoMVC template">
</li> </li>
<li> <li>
<div class="view"> <div class="view">
<input class="toggle" type="checkbox"> <input class="toggle" type="checkbox">
<label>Rule the web</label> <label>Rule the web</label>
<a class="destroy"></a> <button class="destroy"></button>
</div> </div>
<input class="edit" type="text" value="Rule the web"> <input class="edit" value="Rule the web">
</li> </li>
</ul> </ul>
</section> </section>
<!-- this footer needs to be shown with JS when there are todos and hidden when not --> <!-- this footer should hidden by default and shown when there are todos -->
<footer> <footer id="footer">
<a id="clear-completed">Clear completed</a> <!-- this should be `0 items left` by default -->
<div id="todo-count"></div> <span id="todo-count"><strong>1</strong> item left</span>
<!-- remove this if you don't implement routing -->
<ul id="filters">
<li>
<a class="selected" href="#/">All</a>
</li>
<li>
<a href="#/active">Active</a>
</li>
<li>
<a href="#/completed">Completed</a>
</li>
</ul>
<button id="clear-completed">Clear completed (1)</button>
</footer>
</section>
<footer id="info">
<p>Double-click to edit a todo</p>
<p>Template by <a href="http://sindresorhus.com">Sindre Sorhus</a></p>
<!-- change this out with your name and url ↓ -->
<p>Created by <a href="http://addyosmani.github.com/todomvc/">you</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer> </footer>
</div>
<div id="instructions">
Double-click to edit a todo.
</div>
<div id="credits">
Created by <a href="http://addyosmani.github.com/todomvc/">you</a>.
</div>
<!-- scripts here --> <!-- scripts here -->
<script src="js/app.js"></script> <script src="js/app.js"></script>
</body> </body>
......
/* (function( window ) {
'use strict';
[MIT licensed](http://en.wikipedia.org/wiki/MIT_License) // Your starting point. Enjoy the ride!
(c) [You](http://addyosmani.github.com/todomvc/)
*/ })( window );
(function() { \ No newline at end of file
// Your starting point. Enjoy the ride!
})();
\ No newline at end of file
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