Skip to content

Commit

Permalink
Merge pull request #4 from joesondow/master
Browse files Browse the repository at this point in the history
Sort and specify box art
  • Loading branch information
Randgalt committed Nov 14, 2012
2 parents 8e903d7 + b9b9482 commit f5c9cc0
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 11 deletions.
Binary file added assets/Action-Adventure.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Animal-Tales.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Anime-and-Animation.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/Comedy.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/Documentary.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Drama.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Family-Animation.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/Independent.jpg
Binary file not shown.
Binary file added assets/Kids-Music.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/Music-and-Musicals.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/Sci-Fi-and-Fantasy.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/box-art-0.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/box-art-1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/box-art-2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/box-art-3.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/box-art-4.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/box-art-5.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/box-art-6.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/box-art-7.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/box-art-8.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 34 additions & 11 deletions index.html
Expand Up @@ -26,7 +26,12 @@
var reposTab = {};
function repos(json)
{
reposTab = $.isArray(json) ? json : json.data;
var byName, repos;
byName = function(a, b) {
return a.name.toUpperCase().localeCompare(b.name.toUpperCase());
};
repos = $.isArray(json) ? json : json.data;
reposTab = repos.sort(byName);
}
</script>
<script type="text/javascript" src="http://githubproxy-942908148.us-east-1.elb.amazonaws.com/REST/v1/repos?jsonp=repos"></script>
Expand Down Expand Up @@ -160,18 +165,41 @@
}

$(function(){
var imageUrl, imageFileName, boxArtOverride;
var projectsToBoxArtOverrides = {'asgard': 'Independent.jpg'};
var imageUrl, imageFileName, boxArtOverride, i;
var projectsToBoxArtOverrides = {
'astyanax': 'Sci-Fi-and-Fantasy.jpg',
'archaius': 'Anime-and-Animation.jpg',
'asgard': 'Family-Animation.jpg',
'aws-autoscaling': 'Kids-Music.jpg',
'CassJMeter': 'Comedy.jpg',
'curator': 'Documentary.jpg',
'edda': 'Classics.jpg',
'eureka': 'Action-Adventure.jpg',
'exhibitor': 'Drama.jpg',
'frigga': 'Music-and-Musicals.jpg',
'governator': 'Crime-Action.jpg',
'Priam': 'Romantic-Comedies.jpg',
'servo': 'Animal-Tales.jpg',
'SimianArmy': 'Mobster.jpg'
};
var repoContent = "";
var boxArtIndex = 0;
for ( var i = 0; i < reposTab.length; ++i )
for (i = 0; i < reposTab.length; ++i )
{
var thisRepo = reposTab[i];
if ( !thisRepo.private && !ignoreRepos[thisRepo.name] )
{
boxArtOverride = projectsToBoxArtOverrides[thisRepo.name];
imageFileName = boxArtOverride ? boxArtOverride : 'box-art-' + boxArtIndex + '.jpg';
imageUrl = 'assets/' + imageFileName;
if (boxArtOverride) {
imageFileName = boxArtOverride;
} else {
imageFileName = 'box-art-' + boxArtIndex + '.jpg'
boxArtIndex++;
if (boxArtIndex > 8) {
boxArtIndex = 0;
}
}
imageUrl = 'assets/' + imageFileName;

repoContent += '<a class="repo-item-anchor" href="' + thisRepo.html_url + '">';
repoContent += '<div class="repo-item-container">';
Expand All @@ -181,11 +209,6 @@
repoContent += '<div id="repo-button-id-' + i + '" class="repo-item-button"></div>';
repoContent += '</div></a>';
repoContent += '</div>';

if ( ++boxArtIndex > 10 )
{
boxArtIndex = 0;
}
}
}
$('#repo-content').html(repoContent);
Expand Down

0 comments on commit f5c9cc0

Please sign in to comment.