Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Override random box with specific choices #2

Merged
merged 1 commit into from

2 participants

@joesondow
Collaborator

Most projects can use a random numbered image. Asgard and others can override by adding their choice to the map variable called projectsToBoxArtOverrides in index.html

@Randgalt Randgalt merged commit 2f699cd into Netflix:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 12, 2012
  1. Override random box art with specific files

    Joe Sondow authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. BIN  assets/Independent.jpg
  2. +5 −1 index.html
View
BIN  assets/Independent.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
6 index.html
@@ -160,6 +160,8 @@
}
$(function(){
+ var imageUrl, imageFileName, boxArtOverride;
+ var projectsToBoxArtOverrides = {'asgard': 'Independent.jpg'};
var repoContent = "";
var boxArtIndex = 0;
for ( var i = 0; i < reposTab.length; ++i )
@@ -167,7 +169,9 @@
var thisRepo = reposTab[i];
if ( !thisRepo.private && !ignoreRepos[thisRepo.name] )
{
- var imageUrl = 'assets/box-art-' + boxArtIndex + '.jpg';
+ boxArtOverride = projectsToBoxArtOverrides[thisRepo.name];
+ imageFileName = boxArtOverride ? boxArtOverride : 'box-art-' + boxArtIndex + '.jpg';
+ imageUrl = 'assets/' + imageFileName;
repoContent += '<a class="repo-item-anchor" href="' + thisRepo.html_url + '">';
repoContent += '<div class="repo-item-container">';
Something went wrong with that request. Please try again.