diff options
author | Brandon Mathis <brandon@imathis.com> | 2011-09-29 16:05:43 -0500 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2011-09-29 16:06:09 -0500 |
commit | d0d1e2a98d6a1cd57dd8e4c18ac80be5776c34ce (patch) | |
tree | 8bb78791f02fb959407f37b8350213880b941cc7 /.themes/classic/source/javascripts | |
parent | 30d5bfca9ced5f9a5ac6a8d2c8117cf8cbafe30a (diff) | |
download | my_new_personal_website-d0d1e2a98d6a1cd57dd8e4c18ac80be5776c34ce.tar.xz my_new_personal_website-d0d1e2a98d6a1cd57dd8e4c18ac80be5776c34ce.zip |
updated github.js to use reqwest.js with Ender
Diffstat (limited to '.themes/classic/source/javascripts')
-rw-r--r-- | .themes/classic/source/javascripts/github.js | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/.themes/classic/source/javascripts/github.js b/.themes/classic/source/javascripts/github.js index 01877435..82e11607 100644 --- a/.themes/classic/source/javascripts/github.js +++ b/.themes/classic/source/javascripts/github.js @@ -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(); + }) } }; -})();
\ No newline at end of file +})(); |