From 1ab78ebc5fe86e573a9a2f2f619b20e088011c33 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 9 Sep 2016 17:21:39 -0400 Subject: [PATCH] Linkify branch references --- .js/github.com.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.js/github.com.js b/.js/github.com.js index 6814928..403ed28 100644 --- a/.js/github.com.js +++ b/.js/github.com.js @@ -52,4 +52,16 @@ if (!location.hostname.startsWith("gist")) { exploreItem.append(exploreLink); lastItem.before(exploreItem); } -} \ No newline at end of file +} + +// linkify branch references in PRs +$("span.commit-ref").each((i, el) => { + el = $(el); + let bits = el.attr("title").split(":"); + let repo = bits[0]; + let branch = bits[1]; + let link = $(""); + link.attr("href", `https://github.com/${repo}/tree/${branch}`); + el.wrap(link); +}); +$("body").after(""); \ No newline at end of file