Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
todomvc
Commits
ae2b72ae
Commit
ae2b72ae
authored
Jul 10, 2012
by
Alberto Monteiro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing lines
parent
c411f028
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
243 additions
and
244 deletions
+243
-244
architecture-examples/knockoutjs/index.html
architecture-examples/knockoutjs/index.html
+67
-68
architecture-examples/knockoutjs/js/app.js
architecture-examples/knockoutjs/js/app.js
+176
-176
No files found.
architecture-examples/knockoutjs/index.html
View file @
ae2b72ae
<!doctype html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<title>
Knockout.js • TodoMVC
</title>
<link
rel=
"stylesheet"
href=
"../../assets/base.css"
>
<!--[if IE]>
<script src="../../assets/ie.js"></script>
<![endif]-->
</head>
<body>
<section
id=
"todoapp"
>
<header
id=
"header"
>
<h1>
todos
</h1>
<input
id=
"new-todo"
type=
"text"
data-bind=
"value: current, valueUpdate: 'afterkeydown', enterKey: add"
placeholder=
"What needs to be done?"
autofocus
>
</header>
<section
id=
"main"
data-bind=
"visible: todos().length"
>
<input
id=
"toggle-all"
type=
"checkbox"
data-bind=
"checked: allCompleted"
>
<label
for=
"toggle-all"
>
Mark all as complete
</label>
<ul
id=
"todo-list"
data-bind=
"foreach: filteredTodos"
>
<li
data-bind=
"css: { completed: completed, editing: editing }"
>
<div
class=
"view"
data-bind=
"event: { dblclick: $root.editItem }"
>
<input
class=
"toggle"
type=
"checkbox"
data-bind=
"checked: completed"
>
<label
data-bind=
"text: title"
></label>
<button
class=
"destroy"
data-bind=
"click: $root.remove"
></button>
</div>
<input
class=
"edit"
data-bind=
"value: title, valueUpdate: 'afterkeydown', enterKey: $root.stopEditing, selectAndFocus: editing, event: { blur: $root.stopEditing }"
>
</li>
</ul>
</section>
<footer
id=
"footer"
data-bind=
"visible: completedCount() || remainingCount()"
>
<span
id=
"todo-count"
>
<strong
data-bind=
"text: remainingCount"
>
1
</strong>
<span
data-bind=
"text: getLabel( remainingCount )"
></span>
left
</span>
<ul
id=
"filters"
>
<li>
<a
data-bind=
"css: { selected: showMode() == 'all' }"
href=
"#/all"
>
All
</a>
</li>
<li>
<a
data-bind=
"css: { selected: showMode() == 'active' }"
href=
"#/active"
>
Active
</a>
</li>
<li>
<a
data-bind=
"css: { selected: showMode() == 'completed' }"
href=
"#/completed"
>
Completed
</a>
</li>
</ul>
<button
id=
"clear-completed"
data-bind=
"visible: completedCount, click: removeCompleted"
>
Clear completed (
<span
data-bind=
"text: completedCount"
></span>
)
</button>
</footer>
</section>
<footer
id=
"info"
>
<span
data-bind=
"visible: todos().length"
>
Double-click to edit a todo.
</span>
<p>
Original Knockout version from
<a
href=
"https://github.com/ashish01/knockoutjs-todos"
>
Ashish Sharma
</a></p>
<p>
Rewritten to use Knockout 2.0 and standard template by
<a
href=
"http://knockmeout.net"
>
Ryan Niemeyer
</a></p>
<p>
Patches/fixes for cross-browser compat:
<a
href=
"http://twitter.com/addyosmani"
>
Addy Osmani
</a></p>
</footer>
<script
src=
"../../assets/base.js"
></script>
<script
src=
"js/lib/knockout-2.0.0.js"
></script>
<!--Crossroad.js Begin -->
<script
src=
"js/lib/signals.js"
></script>
<script
src=
"js/lib/crossroads.js"
></script>
<script
src=
"js/lib/route.js"
></script>
<script
src=
"js/lib/pattern_lexer.js"
></script>
<script
src=
"js/lib/intro.js"
></script>
<!--Crossroad.js End -->
<script
src=
"js/app.js"
></script>
</body>
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
content=
"IE=edge,chrome=1"
http-equiv=
"X-UA-Compatible"
>
<title>
Knockout.js • TodoMVC
</title>
<link
href=
"../../assets/base.css"
rel=
"stylesheet"
>
<!--[if IE]>
<script src="../../assets/ie.js"></script>
<![endif]-->
</head>
<body>
<section
id=
"todoapp"
>
<header
id=
"header"
>
<h1>
todos
</h1>
<input
id=
"new-todo"
autofocus
data-bind=
"value: current, valueUpdate: 'afterkeydown', enterKey: add"
placeholder=
"What needs to be done?"
type=
"text"
>
</header>
<section
id=
"main"
data-bind=
"visible: todos().length"
>
<input
id=
"toggle-all"
data-bind=
"checked: allCompleted"
type=
"checkbox"
>
<label
for=
"toggle-all"
>
Mark all as complete
</label>
<ul
id=
"todo-list"
data-bind=
"foreach: filteredTodos"
>
<li
data-bind=
"css: { completed: completed, editing: editing }"
>
<div
class=
"view"
data-bind=
"event: { dblclick: $root.editItem }"
>
<input
class=
"toggle"
data-bind=
"checked: completed"
type=
"checkbox"
>
<label
data-bind=
"text: title"
></label>
<button
class=
"destroy"
data-bind=
"click: $root.remove"
></button>
</div>
<input
class=
"edit"
data-bind=
"value: title, valueUpdate: 'afterkeydown', enterKey: $root.stopEditing, selectAndFocus: editing, event: { blur: $root.stopEditing }"
>
</li>
</ul>
</section>
<footer
id=
"footer"
data-bind=
"visible: completedCount() || remainingCount()"
>
<span
id=
"todo-count"
>
<strong
data-bind=
"text: remainingCount"
>
1
</strong>
<span
data-bind=
"text: getLabel( remainingCount )"
></span>
left
</span>
<ul
id=
"filters"
>
<li>
<a
data-bind=
"css: { selected: showMode() == 'all' }"
href=
"#/all"
>
All
</a>
</li>
<li>
<a
data-bind=
"css: { selected: showMode() == 'active' }"
href=
"#/active"
>
Active
</a>
</li>
<li>
<a
data-bind=
"css: { selected: showMode() == 'completed' }"
href=
"#/completed"
>
Completed
</a>
</li>
</ul>
<button
id=
"clear-completed"
data-bind=
"visible: completedCount, click: removeCompleted"
>
Clear completed (
<span
data-bind=
"text: completedCount"
></span>
)
</button>
</footer>
</section>
<footer
id=
"info"
>
<span
data-bind=
"visible: todos().length"
>
Double-click to edit a todo.
</span>
<p>
Original Knockout version from
<a
href=
"https://github.com/ashish01/knockoutjs-todos"
>
Ashish Sharma
</a></p>
<p>
Rewritten to use Knockout 2.0 and standard template by
<a
href=
"http://knockmeout.net"
>
Ryan Niemeyer
</a></p>
<p>
Patches/fixes for cross-browser compat:
<a
href=
"http://twitter.com/addyosmani"
>
Addy Osmani
</a></p>
</footer>
<script
src=
"../../assets/base.js"
></script>
<script
src=
"js/lib/knockout-2.0.0.js"
></script>
<!--Crossroad.js Begin -->
<script
src=
"js/lib/signals.js"
></script>
<script
src=
"js/lib/crossroads.js"
></script>
<script
src=
"js/lib/route.js"
></script>
<script
src=
"js/lib/pattern_lexer.js"
></script>
<script
src=
"js/lib/intro.js"
></script>
<!--Crossroad.js End -->
<script
src=
"js/app.js"
></script>
</body>
</html>
\ No newline at end of file
architecture-examples/knockoutjs/js/app.js
View file @
ae2b72ae
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment