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
50f2a8aa
Commit
50f2a8aa
authored
Aug 24, 2015
by
Arthur Verschaeve
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1424 from tastejs/sjs/update-backbone
Update backbone to 2.0
parents
8e470a3e
eec62c61
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1244 additions
and
816 deletions
+1244
-816
examples/backbone/index.html
examples/backbone/index.html
+11
-11
examples/backbone/js/views/app-view.js
examples/backbone/js/views/app-view.js
+10
-10
examples/backbone/node_modules/backbone/backbone.js
examples/backbone/node_modules/backbone/backbone.js
+716
-431
examples/backbone/node_modules/jquery/dist/jquery.js
examples/backbone/node_modules/jquery/dist/jquery.js
+9
-4
examples/backbone/node_modules/todomvc-app-css/index.css
examples/backbone/node_modules/todomvc-app-css/index.css
+51
-51
examples/backbone/node_modules/todomvc-common/base.js
examples/backbone/node_modules/todomvc-common/base.js
+7
-2
examples/backbone/node_modules/underscore/underscore.js
examples/backbone/node_modules/underscore/underscore.js
+439
-306
examples/backbone/package.json
examples/backbone/package.json
+1
-1
No files found.
examples/backbone/index.html
View file @
50f2a8aa
...
...
@@ -7,19 +7,19 @@
<link
rel=
"stylesheet"
href=
"node_modules/todomvc-app-css/index.css"
>
</head>
<body>
<section
id
=
"todoapp"
>
<header
id
=
"header"
>
<section
class
=
"todoapp"
>
<header
class
=
"header"
>
<h1>
todos
</h1>
<input
id
=
"new-todo"
placeholder=
"What needs to be done?"
autofocus
>
<input
class
=
"new-todo"
placeholder=
"What needs to be done?"
autofocus
>
</header>
<section
id
=
"main"
>
<input
id
=
"toggle-all"
type=
"checkbox"
>
<section
class
=
"main"
>
<input
class
=
"toggle-all"
type=
"checkbox"
>
<label
for=
"toggle-all"
>
Mark all as complete
</label>
<ul
id
=
"todo-list"
></ul>
<ul
class
=
"todo-list"
></ul>
</section>
<footer
id
=
"footer"
></footer>
<footer
class
=
"footer"
></footer>
</section>
<footer
id
=
"info"
>
<footer
class
=
"info"
>
<p>
Double-click to edit a todo
</p>
<p>
Written by
<a
href=
"https://github.com/addyosmani"
>
Addy Osmani
</a></p>
<p>
Part of
<a
href=
"http://todomvc.com"
>
TodoMVC
</a></p>
...
...
@@ -33,8 +33,8 @@
<
input
class
=
"
edit
"
value
=
"
<%- title %>
"
>
</script>
<script
type=
"text/template"
id=
"stats-template"
>
<
span
id
=
"
todo-count
"
><
strong
><%=
remaining
%><
/strong> <%= remaining === 1
?
'item' : 'items' %> left</
span
>
<
ul
id
=
"
filters
"
>
<
span
class
=
"
todo-count
"
><
strong
><%=
remaining
%><
/strong> <%= remaining === 1
?
'item' : 'items' %> left</
span
>
<
ul
class
=
"
filters
"
>
<
li
>
<
a
class
=
"
selected
"
href
=
"
#/
"
>
All
<
/a
>
<
/li
>
...
...
@@ -46,7 +46,7 @@
<
/li
>
<
/ul
>
<%
if
(
completed
)
{
%>
<
button
id
=
"
clear-completed
"
>
Clear
completed
<
/button
>
<
button
class
=
"
clear-completed
"
>
Clear
completed
<
/button
>
<%
}
%>
</script>
<script
src=
"node_modules/todomvc-common/base.js"
></script>
...
...
examples/backbone/js/views/app-view.js
View file @
50f2a8aa
...
...
@@ -12,27 +12,27 @@ var app = app || {};
// Instead of generating a new element, bind to the existing skeleton of
// the App already present in the HTML.
el
:
'
#
todoapp
'
,
el
:
'
.
todoapp
'
,
// Our template for the line of statistics at the bottom of the app.
statsTemplate
:
_
.
template
(
$
(
'
#stats-template
'
).
html
()),
// Delegated events for creating new items, and clearing completed ones.
events
:
{
'
keypress
#
new-todo
'
:
'
createOnEnter
'
,
'
click
#
clear-completed
'
:
'
clearCompleted
'
,
'
click
#
toggle-all
'
:
'
toggleAllComplete
'
'
keypress
.
new-todo
'
:
'
createOnEnter
'
,
'
click
.
clear-completed
'
:
'
clearCompleted
'
,
'
click
.
toggle-all
'
:
'
toggleAllComplete
'
},
// At initialization we bind to the relevant events on the `Todos`
// collection, when items are added or changed. Kick things off by
// loading any preexisting todos that might be saved in *localStorage*.
initialize
:
function
()
{
this
.
allCheckbox
=
this
.
$
(
'
#
toggle-all
'
)[
0
];
this
.
$input
=
this
.
$
(
'
#
new-todo
'
);
this
.
$footer
=
this
.
$
(
'
#
footer
'
);
this
.
$main
=
this
.
$
(
'
#
main
'
);
this
.
$list
=
$
(
'
#
todo-list
'
);
this
.
allCheckbox
=
this
.
$
(
'
.
toggle-all
'
)[
0
];
this
.
$input
=
this
.
$
(
'
.
new-todo
'
);
this
.
$footer
=
this
.
$
(
'
.
footer
'
);
this
.
$main
=
this
.
$
(
'
.
main
'
);
this
.
$list
=
$
(
'
.
todo-list
'
);
this
.
listenTo
(
app
.
todos
,
'
add
'
,
this
.
addOne
);
this
.
listenTo
(
app
.
todos
,
'
reset
'
,
this
.
addAll
);
...
...
@@ -61,7 +61,7 @@ var app = app || {};
remaining
:
remaining
}));
this
.
$
(
'
#
filters li a
'
)
this
.
$
(
'
.
filters li a
'
)
.
removeClass
(
'
selected
'
)
.
filter
(
'
[href="#/
'
+
(
app
.
TodoFilter
||
''
)
+
'
"]
'
)
.
addClass
(
'
selected
'
);
...
...
examples/backbone/node_modules/backbone/backbone.js
View file @
50f2a8aa
This diff is collapsed.
Click to expand it.
examples/backbone/node_modules/jquery/dist/jquery.js
View file @
50f2a8aa
/*!
* jQuery JavaScript Library v2.1.
3
* jQuery JavaScript Library v2.1.
4
* http://jquery.com/
*
* Includes Sizzle.js
...
...
@@ -9,7 +9,7 @@
* Released under the MIT license
* http://jquery.org/license
*
* Date: 201
4-12-18T15:1
1Z
* Date: 201
5-04-28T16:0
1Z
*/
(
function
(
global
,
factory
)
{
...
...
@@ -67,7 +67,7 @@ var
// Use the correct document accordingly with window argument (sandbox)
document
=
window
.
document
,
version
=
"
2.1.
3
"
,
version
=
"
2.1.
4
"
,
// Define a local copy of jQuery
jQuery
=
function
(
selector
,
context
)
{
...
...
@@ -531,7 +531,12 @@ jQuery.each("Boolean Number String Function Array Date RegExp Object Error".spli
});
function
isArraylike
(
obj
)
{
var
length
=
obj
.
length
,
// Support: iOS 8.2 (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var
length
=
"
length
"
in
obj
&&
obj
.
length
,
type
=
jQuery
.
type
(
obj
);
if
(
type
===
"
function
"
||
jQuery
.
isWindow
(
obj
)
)
{
...
...
examples/backbone/node_modules/todomvc-app-css/index.css
View file @
50f2a8aa
...
...
@@ -44,7 +44,7 @@ input[type="checkbox"] {
display
:
none
;
}
#
todoapp
{
.
todoapp
{
background
:
#fff
;
margin
:
130px
0
40px
0
;
position
:
relative
;
...
...
@@ -52,25 +52,25 @@ input[type="checkbox"] {
0
25px
50px
0
rgba
(
0
,
0
,
0
,
0.1
);
}
#
todoapp
input
::-webkit-input-placeholder
{
.
todoapp
input
::-webkit-input-placeholder
{
font-style
:
italic
;
font-weight
:
300
;
color
:
#e6e6e6
;
}
#
todoapp
input
::-moz-placeholder
{
.
todoapp
input
::-moz-placeholder
{
font-style
:
italic
;
font-weight
:
300
;
color
:
#e6e6e6
;
}
#
todoapp
input
::input-placeholder
{
.
todoapp
input
::input-placeholder
{
font-style
:
italic
;
font-weight
:
300
;
color
:
#e6e6e6
;
}
#
todoapp
h1
{
.
todoapp
h1
{
position
:
absolute
;
top
:
-155px
;
width
:
100%
;
...
...
@@ -83,7 +83,7 @@ input[type="checkbox"] {
text-rendering
:
optimizeLegibility
;
}
#
new-todo
,
.
new-todo
,
.edit
{
position
:
relative
;
margin
:
0
;
...
...
@@ -104,14 +104,14 @@ input[type="checkbox"] {
font-smoothing
:
antialiased
;
}
#
new-todo
{
.
new-todo
{
padding
:
16px
16px
16px
60px
;
border
:
none
;
background
:
rgba
(
0
,
0
,
0
,
0.003
);
box-shadow
:
inset
0
-2px
1px
rgba
(
0
,
0
,
0
,
0.03
);
}
#
main
{
.
main
{
position
:
relative
;
z-index
:
2
;
border-top
:
1px
solid
#e6e6e6
;
...
...
@@ -121,7 +121,7 @@ label[for='toggle-all'] {
display
:
none
;
}
#
toggle-all
{
.
toggle-all
{
position
:
absolute
;
top
:
-55px
;
left
:
-12px
;
...
...
@@ -131,50 +131,50 @@ label[for='toggle-all'] {
border
:
none
;
/* Mobile Safari */
}
#
toggle-all
:before
{
.
toggle-all
:before
{
content
:
'❯'
;
font-size
:
22px
;
color
:
#e6e6e6
;
padding
:
10px
27px
10px
27px
;
}
#
toggle-all
:checked:before
{
.
toggle-all
:checked:before
{
color
:
#737373
;
}
#
todo-list
{
.
todo-list
{
margin
:
0
;
padding
:
0
;
list-style
:
none
;
}
#
todo-list
li
{
.
todo-list
li
{
position
:
relative
;
font-size
:
24px
;
border-bottom
:
1px
solid
#ededed
;
}
#
todo-list
li
:last-child
{
.
todo-list
li
:last-child
{
border-bottom
:
none
;
}
#
todo-list
li
.editing
{
.
todo-list
li
.editing
{
border-bottom
:
none
;
padding
:
0
;
}
#
todo-list
li
.editing
.edit
{
.
todo-list
li
.editing
.edit
{
display
:
block
;
width
:
506px
;
padding
:
13px
17px
12px
17px
;
margin
:
0
0
0
43px
;
}
#
todo-list
li
.editing
.view
{
.
todo-list
li
.editing
.view
{
display
:
none
;
}
#
todo-list
li
.toggle
{
.
todo-list
li
.toggle
{
text-align
:
center
;
width
:
40px
;
/* auto, since non-WebKit browsers doesn't support input styling */
...
...
@@ -188,15 +188,15 @@ label[for='toggle-all'] {
appearance
:
none
;
}
#
todo-list
li
.toggle
:after
{
.
todo-list
li
.toggle
:after
{
content
:
url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#ededed" stroke-width="3"/></svg>')
;
}
#
todo-list
li
.toggle
:checked:after
{
.
todo-list
li
.toggle
:checked:after
{
content
:
url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#bddad5" stroke-width="3"/><path fill="#5dc2af" d="M72 25L42 71 27 56l-4 4 20 20 34-52z"/></svg>')
;
}
#
todo-list
li
label
{
.
todo-list
li
label
{
white-space
:
pre
;
word-break
:
break-word
;
padding
:
15px
60px
15px
15px
;
...
...
@@ -206,12 +206,12 @@ label[for='toggle-all'] {
transition
:
color
0.4s
;
}
#
todo-list
li
.completed
label
{
.
todo-list
li
.completed
label
{
color
:
#d9d9d9
;
text-decoration
:
line-through
;
}
#
todo-list
li
.destroy
{
.
todo-list
li
.destroy
{
display
:
none
;
position
:
absolute
;
top
:
0
;
...
...
@@ -226,27 +226,27 @@ label[for='toggle-all'] {
transition
:
color
0.2s
ease-out
;
}
#
todo-list
li
.destroy
:hover
{
.
todo-list
li
.destroy
:hover
{
color
:
#af5b5e
;
}
#
todo-list
li
.destroy
:after
{
.
todo-list
li
.destroy
:after
{
content
:
'×'
;
}
#
todo-list
li
:hover
.destroy
{
.
todo-list
li
:hover
.destroy
{
display
:
block
;
}
#
todo-list
li
.edit
{
.
todo-list
li
.edit
{
display
:
none
;
}
#
todo-list
li
.editing
:last-child
{
.
todo-list
li
.editing
:last-child
{
margin-bottom
:
-1px
;
}
#
footer
{
.
footer
{
color
:
#777
;
padding
:
10px
15px
;
height
:
20px
;
...
...
@@ -254,7 +254,7 @@ label[for='toggle-all'] {
border-top
:
1px
solid
#e6e6e6
;
}
#
footer
:before
{
.
footer
:before
{
content
:
''
;
position
:
absolute
;
right
:
0
;
...
...
@@ -269,16 +269,16 @@ label[for='toggle-all'] {
0
17px
2px
-6px
rgba
(
0
,
0
,
0
,
0.2
);
}
#
todo-count
{
.
todo-count
{
float
:
left
;
text-align
:
left
;
}
#
todo-count
strong
{
.
todo-count
strong
{
font-weight
:
300
;
}
#
filters
{
.
filters
{
margin
:
0
;
padding
:
0
;
list-style
:
none
;
...
...
@@ -287,11 +287,11 @@ label[for='toggle-all'] {
left
:
0
;
}
#
filters
li
{
.
filters
li
{
display
:
inline
;
}
#
filters
li
a
{
.
filters
li
a
{
color
:
inherit
;
margin
:
3px
;
padding
:
3px
7px
;
...
...
@@ -300,17 +300,17 @@ label[for='toggle-all'] {
border-radius
:
3px
;
}
#
filters
li
a
.selected
,
#
filters
li
a
:hover
{
.
filters
li
a
.selected
,
.
filters
li
a
:hover
{
border-color
:
rgba
(
175
,
47
,
47
,
0.1
);
}
#
filters
li
a
.selected
{
.
filters
li
a
.selected
{
border-color
:
rgba
(
175
,
47
,
47
,
0.2
);
}
#
clear-completed
,
html
#
clear-completed
:active
{
.
clear-completed
,
html
.
clear-completed
:active
{
float
:
right
;
position
:
relative
;
line-height
:
20px
;
...
...
@@ -319,11 +319,11 @@ html #clear-completed:active {
position
:
relative
;
}
#
clear-completed
:hover
{
.
clear-completed
:hover
{
text-decoration
:
underline
;
}
#
info
{
.
info
{
margin
:
65px
auto
0
;
color
:
#bfbfbf
;
font-size
:
10px
;
...
...
@@ -331,17 +331,17 @@ html #clear-completed:active {
text-align
:
center
;
}
#
info
p
{
.
info
p
{
line-height
:
1
;
}
#
info
a
{
.
info
a
{
color
:
inherit
;
text-decoration
:
none
;
font-weight
:
400
;
}
#
info
a
:hover
{
.
info
a
:hover
{
text-decoration
:
underline
;
}
...
...
@@ -350,16 +350,16 @@ html #clear-completed:active {
Can't use it globally since it destroys checkboxes in Firefox
*/
@media
screen
and
(
-webkit-min-device-pixel-ratio
:
0
)
{
#
toggle-all
,
#
todo-list
li
.toggle
{
.
toggle-all
,
.
todo-list
li
.toggle
{
background
:
none
;
}
#
todo-list
li
.toggle
{
.
todo-list
li
.toggle
{
height
:
40px
;
}
#
toggle-all
{
.
toggle-all
{
-webkit-transform
:
rotate
(
90deg
);
transform
:
rotate
(
90deg
);
-webkit-appearance
:
none
;
...
...
@@ -368,11 +368,11 @@ html #clear-completed:active {
}
@media
(
max-width
:
430px
)
{
#
footer
{
.
footer
{
height
:
50px
;
}
#
filters
{
.
filters
{
bottom
:
10px
;
}
}
examples/backbone/node_modules/todomvc-common/base.js
View file @
50f2a8aa
...
...
@@ -114,7 +114,12 @@
})({});
if
(
location
.
hostname
===
'
todomvc.com
'
)
{
window
.
_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
'
));
(
function
(
i
,
s
,
o
,
g
,
r
,
a
,
m
){
i
[
'
GoogleAnalyticsObject
'
]
=
r
;
i
[
r
]
=
i
[
r
]
||
function
(){
(
i
[
r
].
q
=
i
[
r
].
q
||
[]).
push
(
arguments
)},
i
[
r
].
l
=
1
*
new
Date
();
a
=
s
.
createElement
(
o
),
m
=
s
.
getElementsByTagName
(
o
)[
0
];
a
.
async
=
1
;
a
.
src
=
g
;
m
.
parentNode
.
insertBefore
(
a
,
m
)
})(
window
,
document
,
'
script
'
,
'
https://www.google-analytics.com/analytics.js
'
,
'
ga
'
);
ga
(
'
create
'
,
'
UA-31081062-1
'
,
'
auto
'
);
ga
(
'
send
'
,
'
pageview
'
);
}
/* jshint ignore:end */
...
...
@@ -228,7 +233,7 @@
xhr
.
onload
=
function
(
e
)
{
var
parsedResponse
=
JSON
.
parse
(
e
.
target
.
responseText
);
if
(
parsedResponse
instanceof
Array
)
{
var
count
=
parsedResponse
.
length
var
count
=
parsedResponse
.
length
;
if
(
count
!==
0
)
{
issueLink
.
innerHTML
=
'
This app has
'
+
count
+
'
open issues
'
;
document
.
getElementById
(
'
issue-count
'
).
style
.
display
=
'
inline
'
;
...
...
examples/backbone/node_modules/underscore/underscore.js
View file @
50f2a8aa
This diff is collapsed.
Click to expand it.
examples/backbone/package.json
View file @
50f2a8aa
...
...
@@ -4,7 +4,7 @@
"backbone"
:
"^1.1.2"
,
"backbone.localstorage"
:
"^1.1.16"
,
"jquery"
:
"^2.1.3"
,
"todomvc-app-css"
:
"^
1
.0.0"
,
"todomvc-app-css"
:
"^
2
.0.0"
,
"todomvc-common"
:
"^1.0.1"
,
"underscore"
:
"^1.7.0"
}
...
...
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