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
54ba802e
Commit
54ba802e
authored
May 02, 2012
by
Sindre Sorhus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add analytics to the Knockback app + small cleanup
parent
38b6a009
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
498 deletions
+15
-498
architecture-examples/knockback/README.md
architecture-examples/knockback/README.md
+3
-2
architecture-examples/knockback/index.html
architecture-examples/knockback/index.html
+5
-7
architecture-examples/knockback/js/lib/json2.js
architecture-examples/knockback/js/lib/json2.js
+0
-481
architecture-examples/knockback/src/app.coffee
architecture-examples/knockback/src/app.coffee
+1
-1
architecture-examples/knockback/src/models/todo.coffee
architecture-examples/knockback/src/models/todo.coffee
+1
-1
architecture-examples/knockback/src/models/todo_collection.coffee
...ture-examples/knockback/src/models/todo_collection.coffee
+1
-2
architecture-examples/knockback/src/routers/app.coffee
architecture-examples/knockback/src/routers/app.coffee
+3
-3
architecture-examples/knockback/src/viewmodels/settings.coffee
...tecture-examples/knockback/src/viewmodels/settings.coffee
+1
-1
No files found.
architecture-examples/knockback/README.md
View file @
54ba802e
# Knockback.js
TodoMVC app
# Knockback.js
• [TodoMVC](http://todomvc.com)
Forked from https://github.com/kmalakoff/knockback-todos
Forked from https://github.com/kmalakoff/knockback-todos
## Getting started
## Getting started
You need
[
CoffeScript
](
http://coffeescript.org
)
to compile if you make changes to the files in the
`src`
folder.
You need
[
CoffeScript
](
http://coffeescript.org
)
to compile if you make changes to the files in the
`src`
folder.
##
#
Compile
## Compile
Open Terminal in this folder.
Open Terminal in this folder.
...
...
architecture-examples/knockback/index.html
View file @
54ba802e
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<title>
Knockback.js • TodoMVC
</title>
<title>
Knockback.js • TodoMVC
</title>
<link
rel=
"stylesheet"
href=
"../../assets/base.css"
>
<link
rel=
"stylesheet"
href=
"../../assets/base.css"
>
<!--[if IE]>
<script src="../../assets/ie.js"></script>
<![endif]-->
</head>
</head>
<body>
<body>
<section
id=
"todoapp"
>
<section
id=
"todoapp"
>
...
@@ -47,27 +50,23 @@
...
@@ -47,27 +50,23 @@
</section>
</section>
<footer
id=
"info"
>
<footer
id=
"info"
>
<p>
Double-click to edit a todo
</p>
<p>
Double-click to edit a todo
</p>
<p>
Template by
<a
href=
"http://
sindresorhus.com
"
>
Sindre Sorhus
</a></p>
<p>
Template by
<a
href=
"http://
github.com/sindresorhus
"
>
Sindre Sorhus
</a></p>
<p>
Created by
<a
href=
"https://github.com/kmalakoff"
>
Kevin Malakoff
</a>
.
<br/>
<p>
Created by
<a
href=
"https://github.com/kmalakoff"
>
Kevin Malakoff
</a>
.
<br/>
Please try out the
<a
href=
"http://kmalakoff.github.com/knockback-todos/"
>
enhanced version
</a>
<br/>
Please try out the
<a
href=
"http://kmalakoff.github.com/knockback-todos/"
>
enhanced version
</a>
<br/>
with localization, priority colors, and lazy loading
<br/>
with localization, priority colors, and lazy loading
<br/>
to see just how dynamic
<a
href=
"https://github.com/kmalakoff/knockback"
>
Knockback.js
</a>
can be!
</p>
to see just how dynamic
<a
href=
"https://github.com/kmalakoff/knockback"
>
Knockback.js
</a>
can be!
</p>
<p>
Part of
<a
href=
"http://todomvc.com"
>
TodoMVC
</a></p>
<p>
Part of
<a
href=
"http://todomvc.com"
>
TodoMVC
</a></p>
</footer>
</footer>
<!-- Demo Dependencies -->
<!-- Demo Dependencies -->
<script
src=
"
js/lib/json2
.js"
></script>
<script
src=
"
../../assets/base
.js"
></script>
<script
src=
"../../assets/jquery.min.js"
></script>
<script
src=
"../../assets/jquery.min.js"
></script>
<!-- Knockback Dependencies -->
<!-- Knockback Dependencies -->
<script
src=
"js/lib/underscore-min.js"
></script>
<script
src=
"js/lib/underscore-min.js"
></script>
<script
src=
"js/lib/backbone-min.js"
></script>
<script
src=
"js/lib/backbone-min.js"
></script>
<script
src=
"js/lib/knockout-2.0.0.js"
></script>
<script
src=
"js/lib/knockout-2.0.0.js"
></script>
<script
src=
"js/lib/knockback.min.js"
></script>
<script
src=
"js/lib/knockback.min.js"
></script>
<!-- More Demo Dependencies -->
<!-- More Demo Dependencies -->
<script
src=
"js/lib/backbone-localstorage.js"
></script>
<script
src=
"js/lib/backbone-localstorage.js"
></script>
<!-- Demo Components -->
<!-- Demo Components -->
<script
src=
"js/models/todo.js"
></script>
<script
src=
"js/models/todo.js"
></script>
<script
src=
"js/models/todo_collection.js"
></script>
<script
src=
"js/models/todo_collection.js"
></script>
...
@@ -76,7 +75,6 @@
...
@@ -76,7 +75,6 @@
<script
src=
"js/viewmodels/todos.js"
></script>
<script
src=
"js/viewmodels/todos.js"
></script>
<script
src=
"js/viewmodels/footer.js"
></script>
<script
src=
"js/viewmodels/footer.js"
></script>
<script
src=
"js/routers/app.js"
></script>
<script
src=
"js/routers/app.js"
></script>
<!-- The Demo -->
<!-- The Demo -->
<script
src=
"../../assets/base.js"
></script>
<script
src=
"../../assets/base.js"
></script>
<script
src=
"js/app.js"
></script>
<script
src=
"js/app.js"
></script>
...
...
architecture-examples/knockback/js/lib/json2.js
deleted
100644 → 0
View file @
38b6a009
This diff is collapsed.
Click to expand it.
architecture-examples/knockback/src/app.coffee
View file @
54ba802e
...
@@ -28,4 +28,4 @@ $ ->
...
@@ -28,4 +28,4 @@ $ ->
# Load the todos
# Load the todos
todos
.
fetch
()
todos
.
fetch
()
# kb.vmRelease(app.viewmodels) # Destroy when finished with the view model
# kb.vmRelease(app.viewmodels) # Destroy when finished with the view model
\ No newline at end of file
architecture-examples/knockback/src/models/todo.coffee
View file @
54ba802e
class
window
.
Todo
extends
Backbone
.
Model
class
window
.
Todo
extends
Backbone
.
Model
completed
:
(
completed
)
->
completed
:
(
completed
)
->
return
!!
@
get
(
'completed'
)
if
arguments
.
length
==
0
return
!!
@
get
(
'completed'
)
if
arguments
.
length
==
0
@
save
({
completed
:
if
completed
then
new
Date
()
else
null
})
@
save
({
completed
:
if
completed
then
new
Date
()
else
null
})
\ No newline at end of file
architecture-examples/knockback/src/models/todo_collection.coffee
View file @
54ba802e
...
@@ -9,5 +9,4 @@ class window.TodosCollection extends Backbone.Collection
...
@@ -9,5 +9,4 @@ class window.TodosCollection extends Backbone.Collection
destroyCompleted
:
->
destroyCompleted
:
->
completed_tasks
=
@
filter
((
todo
)
->
return
todo
.
completed
())
completed_tasks
=
@
filter
((
todo
)
->
return
todo
.
completed
())
model
.
destroy
()
for
model
in
completed_tasks
model
.
destroy
()
for
model
in
completed_tasks
\ No newline at end of file
architecture-examples/knockback/src/routers/app.coffee
View file @
54ba802e
class
window
.
AppRouter
extends
Backbone
.
Router
class
window
.
AppRouter
extends
Backbone
.
Router
routes
:
routes
:
""
:
"all"
""
:
"all"
"active"
:
"active"
"active"
:
"active"
"completed"
:
"completed"
"completed"
:
"completed"
all
:
->
app
.
viewmodels
.
settings
.
list_filter_mode
(
''
)
all
:
->
app
.
viewmodels
.
settings
.
list_filter_mode
(
''
)
active
:
->
app
.
viewmodels
.
settings
.
list_filter_mode
(
'active'
)
active
:
->
app
.
viewmodels
.
settings
.
list_filter_mode
(
'active'
)
...
...
architecture-examples/knockback/src/viewmodels/settings.coffee
View file @
54ba802e
window
.
SettingsViewModel
=
->
window
.
SettingsViewModel
=
->
@
list_filter_mode
=
ko
.
observable
(
''
)
@
list_filter_mode
=
ko
.
observable
(
''
)
@
@
\ No newline at end of file
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