Created
November 28, 2008 06:03
-
-
Save johnbender/29910 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment