aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParker Moore <parkrmoore@gmail.com>2013-02-18 18:00:55 -0800
committerParker Moore <parkrmoore@gmail.com>2013-02-18 18:00:55 -0800
commit8fada73b781d656c23cda05c8060049fff661db8 (patch)
tree4013af7e2f9607c07b3358e475b24da6609d2680
parent43751b76d3a3e217b367fa5581ef6032379d1c49 (diff)
parentcc93e6fc98777418544eccd81f106b42dd915f5b (diff)
downloadmy_new_personal_website-8fada73b781d656c23cda05c8060049fff661db8.tar.xz
my_new_personal_website-8fada73b781d656c23cda05c8060049fff661db8.zip
Merge pull request #1031 from schwern/github_repo_sorting
Use the Github API repo sorting.
Diffstat (limited to '')
-rw-r--r--.themes/classic/source/javascripts/github.js10
1 files changed, 1 insertions, 9 deletions
diff --git a/.themes/classic/source/javascripts/github.js b/.themes/classic/source/javascripts/github.js
index 27a5a235..92d2fda2 100644
--- a/.themes/classic/source/javascripts/github.js
+++ b/.themes/classic/source/javascripts/github.js
@@ -13,7 +13,7 @@ var github = (function(){
return {
showRepos: function(options){
$.ajax({
- url: "https://api.github.com/users/"+options.user+"/repos?callback=?"
+ url: "https://api.github.com/users/"+options.user+"/repos?sort=pushed;callback=?"
, type: 'jsonp'
, error: function (err) { $(options.target + ' li.loading').addClass('error').text("Error loading feed"); }
, success: function(data) {
@@ -23,14 +23,6 @@ var github = (function(){
if (options.skip_forks && data.data[i].fork) { continue; }
repos.push(data.data[i]);
}
- repos.sort(function(a, b) {
- var aDate = new Date(a.pushed_at).valueOf(),
- bDate = new Date(b.pushed_at).valueOf();
-
- if (aDate === bDate) { return 0; }
- return aDate > bDate ? -1 : 1;
- });
-
if (options.count) { repos.splice(options.count); }
render(options.target, repos);
}