Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make sure the same box art isn't used 2 times in a row #54

Merged
merged 1 commit into from

1 participant

@Randgalt
Collaborator

No description provided.

@Randgalt Randgalt merged commit d1a23fb into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 16, 2013
  1. @Randgalt
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 5 deletions.
  1. +11 −5 js/nf.js
View
16 js/nf.js
@@ -151,9 +151,11 @@ function parseISO8601(value) {
function buildRepoContent()
{
- var imageUrl, imageFileName, boxArtOverride, i;
+ var imageUrl, boxArtOverride, i;
+ var imageFileName = "";
var repoContent = "";
var boxArtIndex = 0;
+ var previousImageFileName = "";
for (i = 0; i < reposTab.length; ++i )
{
var thisRepo = reposTab[i].repo;
@@ -161,13 +163,17 @@ function buildRepoContent()
if (boxArtOverride) {
imageFileName = boxArtOverride;
} else {
- imageFileName = 'box-art-' + boxArtIndex + '.jpg'
- boxArtIndex++;
- if (boxArtIndex > 8) {
- boxArtIndex = 0;
+ while ( imageFileName === previousImageFileName )
+ {
+ imageFileName = 'box-art-' + boxArtIndex + '.jpg'
+ boxArtIndex++;
+ if (boxArtIndex > 8) {
+ boxArtIndex = 0;
+ }
}
}
imageUrl = 'assets/' + imageFileName;
+ previousImageFileName = imageFileName;
repoContent += '<a class="standard-anchor" href="' + thisRepo.html_url + '">';
repoContent += '<div class="repo-item-container">';
Something went wrong with that request. Please try again.