Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
maccman committed Jan 27, 2012
2 parents dacde82 + 2c43085 commit 6a9c7ba
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 50 deletions.
30 changes: 17 additions & 13 deletions assets/application.js
@@ -1,7 +1,7 @@
(function($){
(function ($) {
function addRecentlyUpdatedRepo(repo) {
var $item = $("<li>");

$item.append('<span class="name"><a href="' + repo.html_url + '">' + repo.name + '</a></span>');
$item.append('<span class="time"><a href="' + repo.html_url + '/commits">' + strftime("%h %e, %Y", repo.pushed_at) + '</a></span>');
$item.append('<span class="bullet">&sdot;</span>');
Expand All @@ -11,7 +11,7 @@

$item.appendTo("#recently-updated-repos");
}

function addProject(project) {
var $project = $("<div />").addClass("project");
$project.addClass(project.language);
Expand All @@ -20,13 +20,14 @@
$project.append($("<p />").text(project.description));
$project.appendTo("#projects");
}

$.getJSON("https://api.github.com/users/twitter/repos?callback=?", function (result) {
var repos = result.data;

$(function () {
$("#num-repos").val(repos.length);

$(function () {
$("#num-repos").text(repos.length);

// Convert pushed_at to Date.
$.each(repos, function (i, repo) {
repo.pushed_at = new Date(repo.pushed_at);
});
Expand All @@ -37,20 +38,23 @@
if (b.pushed_at < a.pushed_at) return -1;
return 0;
});

$.each(repos, function(i, repo){
addProject(repo);
});

$.each(repos.slice(0, 3), function (i, repo) {
addRecentlyUpdatedRepo(repo);
});
});
});
});

$.getJSON("https://api.github.com/orgs/twitter/members?callback=?", function (members) {

$.getJSON("https://api.github.com/orgs/twitter/members?callback=?", function (result) {
var members = result.data;

$(function () {
$("#num-members").val(members.length);
$("#num-members").text(members.length);
});
});
})(jQuery);

})(jQuery);
45 changes: 21 additions & 24 deletions assets/style.css
Expand Up @@ -15,7 +15,7 @@ h1 {
}

a:link, a:visited {
color: #2984b4;
color: #0084b4;
text-decoration: none;
}

Expand All @@ -37,11 +37,9 @@ a:hover {
#main, div.header, div.project {
background: white;
background: rgba(255, 255, 255, 0.7);
/*
-moz-box-shadow: 0px 0px 5px 0px #ccc;
-webkit-box-shadow: 0px 0px 5px 0px #ccc;
box-shadow: 0px 0px 5px 0px #ccc;
*/
-moz-box-shadow: 0px 0px 5px 0px #eee;
-webkit-box-shadow: 0px 0px 5px 0px #eee;
box-shadow: 0px 0px 5px 0px #eee;
}

#main h1 {
Expand Down Expand Up @@ -70,23 +68,30 @@ a:hover {
margin: 0;
}

#statistics input {
border: none;
width: 33px;
display: inline-block;
font-weight: bold;
font-size: 20px;
color: #2984b4;
div.header {
height: 130px;
}

#statistics label {
font-size: 20px;
div.header h1, div.header p {
margin: 10px 15px 0;
}

#recently-updated h1 {
div.header h1 {
margin-bottom: 10px;
}

#num-repos, #num-members {
font-size: 14px;
font-weight: bold;
color: #0084b4;
line-height: 15px;
}

#statistics p.email {
margin-top: 6px;
font-size: 11px;
}

#recently-updated h1 a {
font-weight: normal;
font-size: 11px;
Expand Down Expand Up @@ -120,14 +125,6 @@ a:hover {
color: #666;
}

div.header {
height: 130px;
}

div.header h1, div.header p {
margin: 10px 15px 0;
}

div.project {
height: 250px;
}
Expand Down
24 changes: 11 additions & 13 deletions index.html
Expand Up @@ -12,34 +12,32 @@
</head>
<body>
<div id="wrapper" class="grid clearfix">

<div id="main" class="grid-1">
<div id="logo"><h1>Twitter Open Source</h1></div>
<h1>Twitter is built on open source software.</h1>
<p>Want to help? <a href="#">Join the Flock</a></p>
<p>Visit <a href="#">dev.twitter.com</a></p>
<p><a href="#">Logos and other goodies</a></p>
<p>Want to help? <a href="https://twitter.com/jobs">Join the Flock</a></p>
<p>Visit <a href="https://dev.twitter.com/">dev.twitter.com</a></p>
<p><a href="https://twitter.com/about/resources">Logos and other goodies</a></p>
</div>

<div class="grid grid-3">
<div id="statistics" class="grid-1 alpha header">
<h1>Statistics</h1>
<p>
<input type="text" id="num-repos" disabled="disabled">
<label for="num-repos">public repos</label>
<span id="num-repos">&nbsp;</span> public repos
<br>
<input type="text" id="num-members" disabled="disabled">
<label for="num-members">members</label>
<span id="num-members">&nbsp;</span> members
</p>
<p><a href="mailto:opensource@twitter.com">opensource@twitter.com</a></p>
<p class="email"><a href="mailto:opensource@twitter.com">opensource@twitter.com</a></p>
</div>

<div id="recently-updated" class="grid-2 omega header">
<h1>Recently updated <a href="#">View All on GitHub</a></h1>
<h1>Recently updated <a href="https://github.com/twitter/repositories">View All on GitHub</a></h1>
<ol id="recently-updated-repos"></ol>
</div>
</div>

<div id="projects"></div>
</div>
</body>
Expand Down

0 comments on commit 6a9c7ba

Please sign in to comment.