Skip to content

Instantly share code, notes, and snippets.

@johnbender
Created November 28, 2008 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnbender/29921 to your computer and use it in GitHub Desktop.
Save johnbender/29921 to your computer and use it in GitHub Desktop.
//add the repo data to the div using the template
this.DisplayRepos = function(data)
{
//if we got properly formed data
if(data.user != undefined)
{
var user = data.user;
//for all the div objects that correspond to that user
for(var j in GitHubRepos.displayObjects[user.login])
{
var proj_div = GitHubRepos.displayObjects[user.login][j];
//for each of the user repositories in the data
$.each(user.repositories, function(i, repo) {
//add the templated information to the divs existing content
proj_div.innerHTML = proj_div.innerHTML + format(REPO_TEMPLATE, repo.url, repo.name);
});
//the style div.github-projects is display: none by default
//display it if there was no error message
proj_div.style.display = "block";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment