Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.GetRepos = function()
- {
- //create an array of the github data, used to prevent mutiple hits
- //to the server for the same user
- var github_usernames = new Array();
- //for all the github-projects divs
- $(GITHUB_PROJECTS_CLASS).each(function(i) {
- //create an array of all unique userids in the page
- if(this.id != undefined)
- {
- //add this object (div by default) that met the query parameters
- //to a list to be altered later
- if( GitHubRepos.displayObjects[this.id] == undefined)
- {
- GitHubRepos.displayObjects[this.id] = new Array();
- }
- GitHubRepos.displayObjects[this.id][i] = this;
- }
- });
- //for each unique user
- for(var i in GitHubRepos.displayObjects)
- {
- //format the github url for our given user and callback function
- var github_url = format(GITHUB_JSON_URL, i, "GitHubRepos.DisplayRepos");
- //insert a script into the DOM to add our JSON data via the github url
- //once the script loads it will callback the DATA_DISPLAY_FUCNTION
- $('head').append(format(DYNAMIC_SCRIPT_TEMPLATE, github_url));
- }
- }
Add Comment
Please, Sign In to add comment