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
30b47d89
Commit
30b47d89
authored
Feb 18, 2012
by
Sindre Sorhus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add contributor list to the site
Dynamically updated from the GitHub API
parent
cab2a2c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
index.html
index.html
+1
-0
site/css/main.css
site/css/main.css
+5
-0
site/js/main.js
site/js/main.js
+25
-1
No files found.
index.html
View file @
30b47d89
...
...
@@ -135,6 +135,7 @@ had it been designed for web apps">AngularJS</a>
<hr>
<footer>
<p>
© TodoMVC. Brought to you by
<a
href=
"http://github.com/addyosmani"
>
Addy Osmani
</a>
(lead),
<a
href=
"https://github.com/boushley"
>
Aaron Boushley
</a>
and
<a
href=
"https://github.com/sindresorhus"
>
Sindre Sorhus
</a>
.
</p>
<p
id=
"contributor-list"
>
Big thanks to our magnificent contributors:
<span></span></p>
</footer>
</div>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"
></script>
...
...
site/css/main.css
View file @
30b47d89
...
...
@@ -95,6 +95,11 @@ h2 {
right
:
20px
;
}
#contributor-list
{
display
:
none
;
font-size
:
12px
;
}
@media
(
max-width
:
480px
)
{
#demos
ul
{
float
:
none
;
...
...
site/js/main.js
View file @
30b47d89
...
...
@@ -2,15 +2,39 @@
// Demos popover
$
(
'
#demos li a
'
).
popover
({
delay
:
200
,
placement
:
'
in right
'
,
title
:
function
()
{
return
$
(
this
).
text
()
+
'
<a href="
'
+
$
(
this
).
data
(
'
source
'
)
+
'
">Go to site</a>
'
;
}
}).
on
(
'
click
'
,
'
.popover
'
,
function
(
e
)
{
// Prevent click on the popover, but allow links inside
if
(
e
.
target
.
nodeName
!==
'
A
'
)
{
if
(
e
.
target
.
nodeName
.
toLowerCase
()
!==
'
a
'
)
{
e
.
preventDefault
();
}
});
// Contributor list
$
.
getJSON
(
'
https://api.github.com/repos/addyosmani/todomvc/contributors?callback=?
'
,
function
(
res
)
{
var
data
=
res
.
data
;
// Add some previous contributors not on the GitHub list
/*
[].push.apply(data, [{
login: 'test'
}, {
login: 'test'
}, {
login: 'test'
}]);
*/
var
ret
=
$
.
map
(
res
.
data
,
function
(
elem
)
{
var
username
=
elem
.
login
;
if
(
$
.
inArray
(
username
,
[
'
addyosmani
'
,
'
boushley
'
,
'
sindresorhus
'
]
)
>=
0
)
{
return
;
}
return
'
<a href="https://github.com/
'
+
username
+
'
">
'
+
username
+
'
</a>
'
;
});
$
(
'
#contributor-list
'
).
show
().
children
(
'
span
'
).
html
(
ret
.
join
(
'
,
'
)
);
});
})();
\ 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