Permalink
Browse files

accept urls of the form github.com/user/repo/issues/labels/label for …

…github labels.

the same URL without `issues/` in the middle is currently accepted, but adding that in also works - github redirects to github/com/user/repo/issues?q=label%3label
  • Loading branch information...
1 parent 4a5d2bc commit 176e39a1215c5c38f9157e4efadbf61e22cfe886 @christianp christianp committed Oct 6, 2016
Showing with 3 additions and 2 deletions.
  1. +3 −2 javascripts/main.js
View
@@ -63,8 +63,9 @@
})(window);
var issueCount = function(project) {
+
var a = $(project).find('.label a')
- , gh = a.attr('href').match(/github.com(\/[^\/]+\/[^\/]+\/)labels\/([^\/]+)$/)
+ , gh = a.attr('href').match(/github.com(\/[^\/]+\/[^\/]+\/)(?:issues\/)?labels\/([^\/]+)$/)
, url = gh && ('https://api.github.com/repos' + gh[1] + 'issues?labels=' + gh[2])
, count = a.find('.count');
@@ -136,4 +137,4 @@
app.raise_errors = true;
app.run("#/");
});
-})(jQuery);
+})(jQuery);

0 comments on commit 176e39a

Please sign in to comment.