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
Sven Franck
todomvc
Commits
79ade429
Commit
79ade429
authored
Mar 10, 2015
by
Arthur Verschaeve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate `serenadejs` to `todomvc-app-css`
Also replaced bower by npm. Ref #1110
parent
456db014
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
639 additions
and
62 deletions
+639
-62
examples/serenadejs/.gitignore
examples/serenadejs/.gitignore
+9
-0
examples/serenadejs/bower.json
examples/serenadejs/bower.json
+0
-8
examples/serenadejs/bower_components/todomvc-common/bg.png
examples/serenadejs/bower_components/todomvc-common/bg.png
+0
-0
examples/serenadejs/index.html
examples/serenadejs/index.html
+4
-3
examples/serenadejs/node_modules/director/build/director.js
examples/serenadejs/node_modules/director/build/director.js
+51
-38
examples/serenadejs/node_modules/todomvc-app-css/index.css
examples/serenadejs/node_modules/todomvc-app-css/index.css
+394
-0
examples/serenadejs/node_modules/todomvc-common/base.css
examples/serenadejs/node_modules/todomvc-common/base.css
+141
-0
examples/serenadejs/node_modules/todomvc-common/base.js
examples/serenadejs/node_modules/todomvc-common/base.js
+27
-0
examples/serenadejs/package.json
examples/serenadejs/package.json
+13
-13
No files found.
examples/serenadejs/.gitignore
0 → 100644
View file @
79ade429
node_modules/todomvc-app-css/*
!node_modules/todomvc-app-css/index.css
node_modules/todomvc-common/*
!node_modules/todomvc-common/base.js
!node_modules/todomvc-common/base.css
node_modules/director/**
!node_modules/director/build/director.js
examples/serenadejs/bower.json
deleted
100644 → 0
View file @
456db014
{
"name"
:
"todomvc-serenadejs"
,
"version"
:
"0.0.0"
,
"dependencies"
:
{
"director"
:
"~1.2.0"
,
"todomvc-common"
:
"~0.3.0"
}
}
examples/serenadejs/bower_components/todomvc-common/bg.png
deleted
100644 → 0
View file @
456db014
2.08 KB
examples/serenadejs/index.html
View file @
79ade429
...
...
@@ -3,7 +3,8 @@
<head>
<meta
charset=
"utf-8"
>
<title>
Serenade.js • TodoMVC
</title>
<link
href=
"bower_components/todomvc-common/base.css"
rel=
"stylesheet"
>
<link
href=
"node_modules/todomvc-common/base.css"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"node_modules/todomvc-app-css/index.css"
>
</head>
<body>
<script
id=
"app"
type=
"text/serenade"
>
...
...
@@ -59,8 +60,8 @@
<p>
Part of
<a
href=
"http://todomvc.com"
>
TodoMVC
</a></p>
</footer>
<script
src=
"
bower_component
s/todomvc-common/base.js"
></script>
<script
src=
"
bower_component
s/director/build/director.js"
></script>
<script
src=
"
node_module
s/todomvc-common/base.js"
></script>
<script
src=
"
node_module
s/director/build/director.js"
></script>
<script
src=
"js/lib/serenade.js"
></script>
<script
src=
"js/app.js"
></script>
</body>
...
...
examples/serenadejs/
bower_component
s/director/build/director.js
→
examples/serenadejs/
node_module
s/director/build/director.js
View file @
79ade429
//
// Generated on
Sun Dec 16 2012 22:47:05 GMT-0500 (EST) by Nodejitsu, Inc
(Using Codesurgeon).
// Version 1.
1.9
// Generated on
Tue Dec 16 2014 12:13:47 GMT+0100 (CET) by Charlie Robbins, Paolo Fragomeni & the Contributors
(Using Codesurgeon).
// Version 1.
2.6
//
(
function
(
exports
)
{
/*
* browser.js: Browser specific functionality for director.
*
* (C) 2011,
Nodejitsu Inc
.
* (C) 2011,
Charlie Robbins, Paolo Fragomeni, & the Contributors
.
* MIT LICENSE
*
*/
if
(
!
Array
.
prototype
.
filter
)
{
Array
.
prototype
.
filter
=
function
(
filter
,
that
)
{
var
other
=
[],
v
;
for
(
var
i
=
0
,
n
=
this
.
length
;
i
<
n
;
i
++
)
{
if
(
i
in
this
&&
filter
.
call
(
that
,
v
=
this
[
i
],
i
,
this
))
{
other
.
push
(
v
);
}
}
return
other
;
};
}
if
(
!
Array
.
isArray
){
Array
.
isArray
=
function
(
obj
)
{
return
Object
.
prototype
.
toString
.
call
(
obj
)
===
'
[object Array]
'
;
};
}
var
dloc
=
document
.
location
;
function
dlocHashEmpty
()
{
...
...
@@ -197,11 +178,12 @@ var Router = exports.Router = function (routes) {
};
Router
.
prototype
.
init
=
function
(
r
)
{
var
self
=
this
;
var
self
=
this
,
routeTo
;
this
.
handler
=
function
(
onChangeEvent
)
{
var
newURL
=
onChangeEvent
&&
onChangeEvent
.
newURL
||
window
.
location
.
hash
;
var
url
=
self
.
history
===
true
?
self
.
getPath
()
:
newURL
.
replace
(
/.*#/
,
''
);
self
.
dispatch
(
'
on
'
,
url
);
self
.
dispatch
(
'
on
'
,
url
.
charAt
(
0
)
===
'
/
'
?
url
:
'
/
'
+
url
);
};
listener
.
init
(
this
.
handler
,
this
.
history
);
...
...
@@ -210,13 +192,20 @@ Router.prototype.init = function (r) {
if
(
dlocHashEmpty
()
&&
r
)
{
dloc
.
hash
=
r
;
}
else
if
(
!
dlocHashEmpty
())
{
self
.
dispatch
(
'
on
'
,
dloc
.
hash
.
replace
(
/^#
/
,
''
));
self
.
dispatch
(
'
on
'
,
'
/
'
+
dloc
.
hash
.
replace
(
/^
(
#
\/
|#|
\/)
/
,
''
));
}
}
else
{
var
routeTo
=
dlocHashEmpty
()
&&
r
?
r
:
!
dlocHashEmpty
()
?
dloc
.
hash
.
replace
(
/^#/
,
''
)
:
null
;
if
(
routeTo
)
{
window
.
history
.
replaceState
({},
document
.
title
,
routeTo
);
if
(
this
.
convert_hash_in_init
)
{
// Use hash as route
routeTo
=
dlocHashEmpty
()
&&
r
?
r
:
!
dlocHashEmpty
()
?
dloc
.
hash
.
replace
(
/^#/
,
''
)
:
null
;
if
(
routeTo
)
{
window
.
history
.
replaceState
({},
document
.
title
,
routeTo
);
}
}
else
{
// Use canonical url
routeTo
=
this
.
getPath
();
}
// Router has been initialized, but due to the chrome bug it will not
...
...
@@ -352,7 +341,7 @@ function paramifyString(str, params, mod) {
}
}
}
return
mod
===
str
?
"
([._a-zA-Z0-9-]+)
"
:
mod
;
return
mod
===
str
?
"
([._a-zA-Z0-9-
%()
]+)
"
:
mod
;
}
function
regifyString
(
str
,
params
)
{
...
...
@@ -363,11 +352,16 @@ function regifyString(str, params) {
out
+=
str
.
substr
(
0
,
matches
.
index
)
+
matches
[
0
];
}
str
=
out
+=
str
.
substr
(
last
);
var
captures
=
str
.
match
(
/:
([^\/]
+
)
/ig
),
length
;
var
captures
=
str
.
match
(
/:
([^\/]
+
)
/ig
),
capture
,
length
;
if
(
captures
)
{
length
=
captures
.
length
;
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
str
=
str
.
replace
(
captures
[
i
],
paramifyString
(
captures
[
i
],
params
));
capture
=
captures
[
i
];
if
(
capture
.
slice
(
0
,
2
)
===
"
::
"
)
{
str
=
capture
.
slice
(
1
);
}
else
{
str
=
str
.
replace
(
capture
,
paramifyString
(
capture
,
params
));
}
}
}
return
str
;
...
...
@@ -393,6 +387,8 @@ function terminator(routes, delimiter, start, stop) {
return
routes
;
}
var
QUERY_SEPARATOR
=
/
\?
.*/
;
Router
.
prototype
.
configure
=
function
(
options
)
{
options
=
options
||
{};
for
(
var
i
=
0
;
i
<
this
.
methods
.
length
;
i
++
)
{
...
...
@@ -406,6 +402,7 @@ Router.prototype.configure = function(options) {
this
.
resource
=
options
.
resource
;
this
.
history
=
options
.
html5history
&&
this
.
historySupport
||
false
;
this
.
run_in_init
=
this
.
history
===
true
&&
options
.
run_handler_in_init
!==
false
;
this
.
convert_hash_in_init
=
this
.
history
===
true
&&
options
.
convert_hash_in_init
!==
false
;
this
.
every
=
{
after
:
options
.
after
||
null
,
before
:
options
.
before
||
null
,
...
...
@@ -422,6 +419,7 @@ Router.prototype.param = function(token, matcher) {
this
.
params
[
token
]
=
function
(
str
)
{
return
str
.
replace
(
compiled
,
matcher
.
source
||
matcher
);
};
return
this
;
};
Router
.
prototype
.
on
=
Router
.
prototype
.
route
=
function
(
method
,
path
,
route
)
{
...
...
@@ -449,8 +447,20 @@ Router.prototype.on = Router.prototype.route = function(method, path, route) {
this
.
insert
(
method
,
this
.
scope
.
concat
(
path
),
route
);
};
Router
.
prototype
.
path
=
function
(
path
,
routesFn
)
{
var
self
=
this
,
length
=
this
.
scope
.
length
;
if
(
path
.
source
)
{
path
=
path
.
source
.
replace
(
/
\\\/
/ig
,
"
/
"
);
}
path
=
path
.
split
(
new
RegExp
(
this
.
delimiter
));
path
=
terminator
(
path
,
this
.
delimiter
);
this
.
scope
=
this
.
scope
.
concat
(
path
);
routesFn
.
call
(
this
,
this
);
this
.
scope
.
splice
(
length
,
path
.
length
);
};
Router
.
prototype
.
dispatch
=
function
(
method
,
path
,
callback
)
{
var
self
=
this
,
fns
=
this
.
traverse
(
method
,
path
,
this
.
routes
,
""
),
invoked
=
this
.
_invoked
,
after
;
var
self
=
this
,
fns
=
this
.
traverse
(
method
,
path
.
replace
(
QUERY_SEPARATOR
,
""
)
,
this
.
routes
,
""
),
invoked
=
this
.
_invoked
,
after
;
this
.
_invoked
=
true
;
if
(
!
fns
||
fns
.
length
===
0
)
{
this
.
last
=
[];
...
...
@@ -485,20 +495,22 @@ Router.prototype.dispatch = function(method, path, callback) {
Router
.
prototype
.
invoke
=
function
(
fns
,
thisArg
,
callback
)
{
var
self
=
this
;
var
apply
;
if
(
this
.
async
)
{
_asyncEverySeries
(
fns
,
function
apply
(
fn
,
next
)
{
apply
=
function
(
fn
,
next
)
{
if
(
Array
.
isArray
(
fn
))
{
return
_asyncEverySeries
(
fn
,
apply
,
next
);
}
else
if
(
typeof
fn
==
"
function
"
)
{
fn
.
apply
(
thisArg
,
fns
.
captures
.
concat
(
next
));
fn
.
apply
(
thisArg
,
(
fns
.
captures
||
[])
.
concat
(
next
));
}
},
function
()
{
};
_asyncEverySeries
(
fns
,
apply
,
function
()
{
if
(
callback
)
{
callback
.
apply
(
thisArg
,
arguments
);
}
});
}
else
{
_every
(
fns
,
function
apply
(
fn
)
{
apply
=
function
(
fn
)
{
if
(
Array
.
isArray
(
fn
))
{
return
_every
(
fn
,
apply
);
}
else
if
(
typeof
fn
===
"
function
"
)
{
...
...
@@ -506,7 +518,8 @@ Router.prototype.invoke = function(fns, thisArg, callback) {
}
else
if
(
typeof
fn
===
"
string
"
&&
self
.
resource
)
{
self
.
resource
[
fn
].
apply
(
thisArg
,
fns
.
captures
||
[]);
}
});
};
_every
(
fns
,
apply
);
}
};
...
...
@@ -686,7 +699,7 @@ Router.prototype.mount = function(routes, path) {
function
insertOrMount
(
route
,
local
)
{
var
rename
=
route
,
parts
=
route
.
split
(
self
.
delimiter
),
routeType
=
typeof
routes
[
route
],
isRoute
=
parts
[
0
]
===
""
||
!
self
.
_methods
[
parts
[
0
]],
event
=
isRoute
?
"
on
"
:
rename
;
if
(
isRoute
)
{
rename
=
rename
.
slice
((
rename
.
match
(
new
RegExp
(
self
.
delimiter
))
||
[
""
])[
0
].
length
);
rename
=
rename
.
slice
((
rename
.
match
(
new
RegExp
(
"
^
"
+
self
.
delimiter
))
||
[
""
])[
0
].
length
);
parts
.
shift
();
}
if
(
isRoute
&&
routeType
===
"
object
"
&&
!
Array
.
isArray
(
routes
[
route
]))
{
...
...
examples/serenadejs/
bower_components/todomvc-common/base
.css
→
examples/serenadejs/
node_modules/todomvc-app-css/index
.css
View file @
79ade429
This diff is collapsed.
Click to expand it.
examples/serenadejs/node_modules/todomvc-common/base.css
0 → 100644
View file @
79ade429
hr
{
margin
:
20px
0
;
border
:
0
;
border-top
:
1px
dashed
#c5c5c5
;
border-bottom
:
1px
dashed
#f7f7f7
;
}
.learn
a
{
font-weight
:
normal
;
text-decoration
:
none
;
color
:
#b83f45
;
}
.learn
a
:hover
{
text-decoration
:
underline
;
color
:
#787e7e
;
}
.learn
h3
,
.learn
h4
,
.learn
h5
{
margin
:
10px
0
;
font-weight
:
500
;
line-height
:
1.2
;
color
:
#000
;
}
.learn
h3
{
font-size
:
24px
;
}
.learn
h4
{
font-size
:
18px
;
}
.learn
h5
{
margin-bottom
:
0
;
font-size
:
14px
;
}
.learn
ul
{
padding
:
0
;
margin
:
0
0
30px
25px
;
}
.learn
li
{
line-height
:
20px
;
}
.learn
p
{
font-size
:
15px
;
font-weight
:
300
;
line-height
:
1.3
;
margin-top
:
0
;
margin-bottom
:
0
;
}
#issue-count
{
display
:
none
;
}
.quote
{
border
:
none
;
margin
:
20px
0
60px
0
;
}
.quote
p
{
font-style
:
italic
;
}
.quote
p
:before
{
content
:
'“'
;
font-size
:
50px
;
opacity
:
.15
;
position
:
absolute
;
top
:
-20px
;
left
:
3px
;
}
.quote
p
:after
{
content
:
'”'
;
font-size
:
50px
;
opacity
:
.15
;
position
:
absolute
;
bottom
:
-42px
;
right
:
3px
;
}
.quote
footer
{
position
:
absolute
;
bottom
:
-40px
;
right
:
0
;
}
.quote
footer
img
{
border-radius
:
3px
;
}
.quote
footer
a
{
margin-left
:
5px
;
vertical-align
:
middle
;
}
.speech-bubble
{
position
:
relative
;
padding
:
10px
;
background
:
rgba
(
0
,
0
,
0
,
.04
);
border-radius
:
5px
;
}
.speech-bubble
:after
{
content
:
''
;
position
:
absolute
;
top
:
100%
;
right
:
30px
;
border
:
13px
solid
transparent
;
border-top-color
:
rgba
(
0
,
0
,
0
,
.04
);
}
.learn-bar
>
.learn
{
position
:
absolute
;
width
:
272px
;
top
:
8px
;
left
:
-300px
;
padding
:
10px
;
border-radius
:
5px
;
background-color
:
rgba
(
255
,
255
,
255
,
.6
);
transition-property
:
left
;
transition-duration
:
500ms
;
}
@media
(
min-width
:
899px
)
{
.learn-bar
{
width
:
auto
;
padding-left
:
300px
;
}
.learn-bar
>
.learn
{
left
:
8px
;
}
}
examples/serenadejs/
bower_component
s/todomvc-common/base.js
→
examples/serenadejs/
node_module
s/todomvc-common/base.js
View file @
79ade429
/* global _ */
(
function
()
{
'
use strict
'
;
/* jshint ignore:start */
// Underscore's Template Module
// Courtesy of underscorejs.org
var
_
=
(
function
(
_
)
{
...
...
@@ -114,6 +116,7 @@
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
'
));
}
/* jshint ignore:end */
function
redirect
()
{
if
(
location
.
hostname
===
'
tastejs.github.io
'
)
{
...
...
@@ -175,13 +178,17 @@
if
(
learnJSON
.
backend
)
{
this
.
frameworkJSON
=
learnJSON
.
backend
;
this
.
frameworkJSON
.
issueLabel
=
framework
;
this
.
append
({
backend
:
true
});
}
else
if
(
learnJSON
[
framework
])
{
this
.
frameworkJSON
=
learnJSON
[
framework
];
this
.
frameworkJSON
.
issueLabel
=
framework
;
this
.
append
();
}
this
.
fetchIssueCount
();
}
Learn
.
prototype
.
append
=
function
(
opts
)
{
...
...
@@ -212,6 +219,26 @@
document
.
body
.
insertAdjacentHTML
(
'
afterBegin
'
,
aside
.
outerHTML
);
};
Learn
.
prototype
.
fetchIssueCount
=
function
()
{
var
issueLink
=
document
.
getElementById
(
'
issue-count-link
'
);
if
(
issueLink
)
{
var
url
=
issueLink
.
href
.
replace
(
'
https://github.com
'
,
'
https://api.github.com/repos
'
);
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'
GET
'
,
url
,
true
);
xhr
.
onload
=
function
(
e
)
{
var
parsedResponse
=
JSON
.
parse
(
e
.
target
.
responseText
);
if
(
parsedResponse
instanceof
Array
)
{
var
count
=
parsedResponse
.
length
if
(
count
!==
0
)
{
issueLink
.
innerHTML
=
'
This app has
'
+
count
+
'
open issues
'
;
document
.
getElementById
(
'
issue-count
'
).
style
.
display
=
'
inline
'
;
}
}
};
xhr
.
send
();
}
};
redirect
();
getFile
(
'
learn.json
'
,
Learn
);
})();
examples/serenadejs/package.json
View file @
79ade429
{
"name"
:
"todomvc-serenadejs"
,
"description"
:
"TodoMVC todo app using Serenade.js"
,
"version"
:
"0.0.0"
,
"dependencies"
:
{
},
"devDependencies"
:
{
"serenade"
:
"~0.4.0
"
,
"coffee-script"
:
"~1.6.2
"
},
"script
s"
:
{
"compile"
:
"coffee -co js/ js/"
},
"private"
:
true
"private"
:
true
,
"scripts"
:
{
"compile"
:
"coffee -co js/ js/"
},
"dependencies"
:
{
"director"
:
"^1.2.0"
,
"todomvc-common"
:
"^1.0.1
"
,
"todomvc-app-css"
:
"^1.0.1
"
},
"devDependencie
s"
:
{
"serenade"
:
"~0.4.0"
,
"coffee-script"
:
"~1.6.2"
}
}
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