Wrap everything in IIFEs
This commit is contained in:
parent
553a0b05d3
commit
d4e0d31a90
|
@ -5,6 +5,7 @@ let repoUrl = $("div.repohead-details-container > h1.public > strong[itemprop=na
|
|||
// $("body").css("font-family", $("body").css("font-family").replace("BlinkMacSystemFont,", ""));
|
||||
|
||||
// releases tab
|
||||
(function() {
|
||||
let repoNav = $("nav.reponav");
|
||||
if (repoNav.length > 0) {
|
||||
let releasesUrl = repoUrl + "/releases";
|
||||
|
@ -39,8 +40,10 @@ if (repoNav.length > 0) {
|
|||
releasesTab.addClass("selected");
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
// add explore link to menu
|
||||
(function() {
|
||||
if (!location.hostname.startsWith("gist")) {
|
||||
let lastItem = $(".header-nav[role=navigation] > .header-nav-item:last");
|
||||
|
||||
|
@ -55,8 +58,10 @@ if (!location.hostname.startsWith("gist")) {
|
|||
lastItem.before(exploreItem);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
// linkify branch references in PRs
|
||||
(function() {
|
||||
$("span.commit-ref").each((i, el) => {
|
||||
el = $(el);
|
||||
let bits = el.attr("title").split(":");
|
||||
|
@ -67,6 +72,7 @@ $("span.commit-ref").each((i, el) => {
|
|||
el.wrap(link);
|
||||
});
|
||||
$("body").after("<style>span.commit-ref:hover, span.commit-ref:hover span { text-decoration: underline; }</style>");
|
||||
})();
|
||||
|
||||
// linkify issue/pr references in issue titles
|
||||
(function() {
|
||||
|
|
Loading…
Reference in New Issue