mirror of
https://github.com/resume/resume.github.com.git
synced 2024-10-03 23:18:01 +03:00
Merge pull request #20 from alotaiba/master.
Fixed Some Issues With Languages and Organizaitions
This commit is contained in:
commit
fce62cde11
27
js/github.js
27
js/github.js
@ -233,26 +233,7 @@
|
||||
// alert(data.repositories.length);
|
||||
// });
|
||||
gh.user.prototype.allRepos = function (callback, context) {
|
||||
var repos = [],
|
||||
username = this.username,
|
||||
page = 1;
|
||||
|
||||
function exitCallback () {
|
||||
callback.call(context, { repositories: repos });
|
||||
}
|
||||
|
||||
function pageLoop (data) {
|
||||
if (data.repositories.length == 0) {
|
||||
exitCallback();
|
||||
} else {
|
||||
repos = repos.concat(data.repositories);
|
||||
page += 1;
|
||||
gh.repo.forUser(username, pageLoop, context, page);
|
||||
}
|
||||
}
|
||||
|
||||
gh.repo.forUser(username, pageLoop, context, page);
|
||||
|
||||
gh.repo.search('username:' + this.username, "", callback, context);
|
||||
return this;
|
||||
};
|
||||
|
||||
@ -282,6 +263,11 @@
|
||||
return this;
|
||||
}
|
||||
);
|
||||
|
||||
gh.user.prototype.orgs = function(callback, context) {
|
||||
jsonp("user/show/" + this.username + "/organizations", callback, context);
|
||||
return this;
|
||||
}
|
||||
|
||||
// Search users for `query`.
|
||||
gh.user.search = function (query, callback, context) {
|
||||
@ -425,6 +411,7 @@
|
||||
context = arguments[2];
|
||||
}
|
||||
url += "?" + paramify(opts);
|
||||
jsonp(url, callback, context);
|
||||
return this;
|
||||
};
|
||||
|
||||
|
@ -54,15 +54,10 @@ var home = function() {
|
||||
};
|
||||
|
||||
var run = function() {
|
||||
|
||||
var gh_user = gh.user(username);
|
||||
var itemCount = 0, maxItems = 5, maxLanguages = 9;
|
||||
|
||||
var res = gh_user.show(function(data) {
|
||||
gh_user.allRepos(function(data) {
|
||||
repos = data;
|
||||
});
|
||||
|
||||
var since = new Date(data.user.created_at);
|
||||
since = since.getFullYear();
|
||||
|
||||
@ -116,7 +111,7 @@ var run = function() {
|
||||
if (arr[i].fork !== false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (arr[i].language) {
|
||||
if (arr[i].language in languages) {
|
||||
languages[arr[i].language]++;
|
||||
|
Loading…
Reference in New Issue
Block a user