Guest User

Untitled

a guest
Feb 21st, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. this.GetRepos = function()
  2. {
  3. //create an array of the github data, used to prevent mutiple hits
  4. //to the server for the same user
  5. var github_usernames = new Array();
  6.  
  7. //for all the github-projects divs
  8. $(GITHUB_PROJECTS_CLASS).each(function(i) {
  9.  
  10. //create an array of all unique userids in the page
  11. if(this.id != undefined)
  12. {
  13. //add this object (div by default) that met the query parameters
  14. //to a list to be altered later
  15. if( GitHubRepos.displayObjects[this.id] == undefined)
  16. {
  17. GitHubRepos.displayObjects[this.id] = new Array();
  18. }
  19. GitHubRepos.displayObjects[this.id][i] = this;
  20. }
  21. });
  22.  
  23. //for each unique user
  24. for(var i in GitHubRepos.displayObjects)
  25. {
  26. //format the github url for our given user and callback function
  27. var github_url = format(GITHUB_JSON_URL, i, "GitHubRepos.DisplayRepos");
  28.  
  29. //insert a script into the DOM to add our JSON data via the github url
  30. //once the script loads it will callback the DATA_DISPLAY_FUCNTION
  31. $('head').append(format(DYNAMIC_SCRIPT_TEMPLATE, github_url));
  32. }
  33. }
Add Comment
Please, Sign In to add comment