Guest User

Untitled

a guest
Feb 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. //add the repo data to the div using the template
  2. this.DisplayRepos = function(data)
  3. {
  4. //if we got properly formed data
  5. if(data.user != undefined)
  6. {
  7. var user = data.user;
  8.  
  9. //for all the div objects that correspond to that user
  10. for(var j in GitHubRepos.displayObjects[user.login])
  11. {
  12. var proj_div = GitHubRepos.displayObjects[user.login][j];
  13.  
  14. //for each of the user repositories in the data
  15. $.each(user.repositories, function(i, repo) {
  16.  
  17. //add the templated information to the divs existing content
  18. proj_div.innerHTML = proj_div.innerHTML + format(REPO_TEMPLATE, repo.url, repo.name);
  19.  
  20. });
  21.  
  22. //the style div.github-projects is display: none by default
  23. //display it if there was no error message
  24. proj_div.style.display = "block";
  25. }
  26.  
  27. }
  28. }
Add Comment
Please, Sign In to add comment