mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-10-31 23:35:00 -04:00
updated github.js
This commit is contained in:
parent
c0cc4c9d6d
commit
6823f07f3a
@ -9,12 +9,11 @@ var github = (function(){
|
||||
}
|
||||
return {
|
||||
showRepos: function(options){
|
||||
var feed = new jXHR();
|
||||
feed.onerror = function (msg,url) {
|
||||
$(options.target + ' li.loading').addClass('error').text("Error loading feed");
|
||||
};
|
||||
feed.onreadystatechange = function(data) {
|
||||
if (feed.readyState === 4) {
|
||||
$.ajax({
|
||||
url: "http://github.com/api/v2/json/repos/show/"+options.user+"?callback=?"
|
||||
, type: 'jsonp'
|
||||
, error: function (err) { $(options.target + ' li.loading').addClass('error').text("Error loading feed"); }
|
||||
, success: function(data) {
|
||||
var repos = [];
|
||||
for (var i = 0; i < data.repositories.length; i++){
|
||||
if (options.skip_forks && data.repositories[i].fork) { continue; }
|
||||
@ -31,9 +30,7 @@ var github = (function(){
|
||||
if (options.count) { repos.splice(options.count); }
|
||||
render(options.target, repos);
|
||||
}
|
||||
};
|
||||
feed.open("GET","http://github.com/api/v2/json/repos/show/"+options.user+"?callback=?");
|
||||
feed.send();
|
||||
})
|
||||
}
|
||||
};
|
||||
})();
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user