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
d1198bb2
Commit
d1198bb2
authored
Apr 08, 2015
by
Arthur Verschaeve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Spine: compile using latest coffee
parent
5acb4b96
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
39 deletions
+39
-39
examples/spine/js/app.js
examples/spine/js/app.js
+20
-20
examples/spine/js/controllers/todos.js
examples/spine/js/controllers/todos.js
+7
-7
examples/spine/js/models/todo.js
examples/spine/js/models/todo.js
+12
-12
No files found.
examples/spine/js/app.js
View file @
d1198bb2
// Generated by CoffeeScript 1.
7
.1
// Generated by CoffeeScript 1.
9
.1
(
function
()
{
var
TodoApp
,
__
bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
},
__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
;
}
;
bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
},
extend
=
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
;
}
,
hasProp
=
{}.
hasOwnProperty
;
TodoApp
=
(
function
(
_super
)
{
TodoApp
=
(
function
(
superClass
)
{
var
ENTER_KEY
;
__extends
(
TodoApp
,
_super
);
extend
(
TodoApp
,
superClass
);
ENTER_KEY
=
13
;
...
...
@@ -30,10 +30,10 @@
};
function
TodoApp
()
{
this
.
renderFooter
=
__
bind
(
this
.
renderFooter
,
this
);
this
.
toggleElems
=
__
bind
(
this
.
toggleElems
,
this
);
this
.
addAll
=
__
bind
(
this
.
addAll
,
this
);
this
.
addNew
=
__
bind
(
this
.
addNew
,
this
);
this
.
renderFooter
=
bind
(
this
.
renderFooter
,
this
);
this
.
toggleElems
=
bind
(
this
.
toggleElems
,
this
);
this
.
addAll
=
bind
(
this
.
addAll
,
this
);
this
.
addNew
=
bind
(
this
.
addNew
,
this
);
TodoApp
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
Todo
.
bind
(
'
create
'
,
this
.
addNew
);
Todo
.
bind
(
'
refresh change
'
,
this
.
addAll
);
...
...
@@ -45,7 +45,7 @@
this
.
filter
=
param
.
filter
;
/*
TODO: Need to figure out why the route doesn't trigger `change` event
TODO: Need to figure out why the route doesn't trigger `change` event
*/
Todo
.
trigger
(
'
refresh
'
);
return
this
.
filters
.
removeClass
(
'
selected
'
).
filter
(
"
[href='#/
"
+
this
.
filter
+
"
']
"
).
addClass
(
'
selected
'
);
...
...
@@ -84,23 +84,23 @@
};
TodoApp
.
prototype
.
addAll
=
function
()
{
var
todo
,
_i
,
_len
,
_ref
,
_results
;
var
i
,
len
,
ref
,
results
,
todo
;
this
.
todos
.
empty
();
_
ref
=
this
.
getByFilter
();
_
results
=
[];
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_
i
++
)
{
todo
=
_ref
[
_
i
];
_
results
.
push
(
this
.
addNew
(
todo
));
ref
=
this
.
getByFilter
();
results
=
[];
for
(
i
=
0
,
len
=
ref
.
length
;
i
<
len
;
i
++
)
{
todo
=
ref
[
i
];
results
.
push
(
this
.
addNew
(
todo
));
}
return
_
results
;
return
results
;
};
TodoApp
.
prototype
.
toggleAll
=
function
(
e
)
{
return
Todo
.
each
(
function
(
todo
)
{
/*
TODO: Model updateAttribute sometimes won't stick:
https://github.com/maccman/spine/issues/219
TODO: Model updateAttribute sometimes won't stick:
https://github.com/maccman/spine/issues/219
*/
todo
.
updateAttribute
(
'
completed
'
,
e
.
target
.
checked
);
return
todo
.
trigger
(
'
update
'
,
todo
);
...
...
examples/spine/js/controllers/todos.js
View file @
d1198bb2
// Generated by CoffeeScript 1.
7
.1
// Generated by CoffeeScript 1.
9
.1
(
function
()
{
var
__
bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
},
__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
;
}
;
var
bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
},
extend
=
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
;
}
,
hasProp
=
{}.
hasOwnProperty
;
window
.
Todos
=
(
function
(
_super
)
{
window
.
Todos
=
(
function
(
superClass
)
{
var
ENTER_KEY
,
ESCAPE_KEY
,
TPL
;
__extends
(
Todos
,
_super
);
extend
(
Todos
,
superClass
);
ENTER_KEY
=
13
;
...
...
@@ -29,7 +29,7 @@
};
function
Todos
()
{
this
.
render
=
__
bind
(
this
.
render
,
this
);
this
.
render
=
bind
(
this
.
render
,
this
);
Todos
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
this
.
todo
.
bind
(
'
update
'
,
this
.
render
);
this
.
todo
.
bind
(
'
destroy
'
,
this
.
release
);
...
...
examples/spine/js/models/todo.js
View file @
d1198bb2
// Generated by CoffeeScript 1.
7
.1
// Generated by CoffeeScript 1.
9
.1
(
function
()
{
var
__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
;
}
;
var
extend
=
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
;
}
,
hasProp
=
{}.
hasOwnProperty
;
window
.
Todo
=
(
function
(
_super
)
{
__extends
(
Todo
,
_super
);
window
.
Todo
=
(
function
(
superClass
)
{
extend
(
Todo
,
superClass
);
function
Todo
()
{
return
Todo
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
...
...
@@ -27,14 +27,14 @@
};
Todo
.
destroyCompleted
=
function
()
{
var
todo
,
_i
,
_len
,
_ref
,
_results
;
_
ref
=
this
.
completed
();
_
results
=
[];
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_
i
++
)
{
todo
=
_ref
[
_
i
];
_
results
.
push
(
todo
.
destroy
());
var
i
,
len
,
ref
,
results
,
todo
;
ref
=
this
.
completed
();
results
=
[];
for
(
i
=
0
,
len
=
ref
.
length
;
i
<
len
;
i
++
)
{
todo
=
ref
[
i
];
results
.
push
(
todo
.
destroy
());
}
return
_
results
;
return
results
;
};
return
Todo
;
...
...
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