mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-25 08:58:58 -05:00
updated github.js to use reqwest.js with Ender
This commit is contained in:
parent
fb80e90838
commit
c0cc4c9d6d
@ -9,12 +9,11 @@ var github = (function(){
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
showRepos: function(options){
|
showRepos: function(options){
|
||||||
var feed = new jXHR();
|
$.ajax({
|
||||||
feed.onerror = function (msg,url) {
|
url: "http://github.com/api/v2/json/repos/show/"+options.user+"?callback=?"
|
||||||
$(options.target + ' li.loading').addClass('error').text("Error loading feed");
|
, type: 'jsonp'
|
||||||
};
|
, error: function (err) { $(options.target + ' li.loading').addClass('error').text("Error loading feed"); }
|
||||||
feed.onreadystatechange = function(data) {
|
, success: function(data) {
|
||||||
if (feed.readyState === 4) {
|
|
||||||
var repos = [];
|
var repos = [];
|
||||||
for (var i = 0; i < data.repositories.length; i++){
|
for (var i = 0; i < data.repositories.length; i++){
|
||||||
if (options.skip_forks && data.repositories[i].fork) { continue; }
|
if (options.skip_forks && data.repositories[i].fork) { continue; }
|
||||||
@ -31,9 +30,7 @@ var github = (function(){
|
|||||||
if (options.count) { repos.splice(options.count); }
|
if (options.count) { repos.splice(options.count); }
|
||||||
render(options.target, repos);
|
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