GitHub: remove Pulse and Graphs tabs
This commit is contained in:
parent
bee7ba2fef
commit
c6fd26b760
|
@ -2,13 +2,27 @@
|
|||
let repoUrl = $("div.repohead-details-container > h1.public > strong[itemprop=name] > a").attr("href");
|
||||
let currentUser = $("ul.header-nav.float-right > li:last > a > img").attr("alt").substring(1);
|
||||
|
||||
// don't use the (ugly) new font
|
||||
// $("body").css("font-family", $("body").css("font-family").replace("BlinkMacSystemFont,", ""));
|
||||
// remove pulse tab
|
||||
(function() {
|
||||
let repoNav = $("nav.reponav");
|
||||
if (repoNav.length <= 0) return;
|
||||
|
||||
repoNav.find(`a[href="${repoUrl}/pulse"]`).hide();
|
||||
})();
|
||||
|
||||
// remove graphs tab
|
||||
(function() {
|
||||
let repoNav = $("nav.reponav");
|
||||
if (repoNav.length <= 0) return;
|
||||
|
||||
repoNav.find(`a[href="${repoUrl}/graphs"]`).hide();
|
||||
})();
|
||||
|
||||
// releases tab
|
||||
(function() {
|
||||
let repoNav = $("nav.reponav");
|
||||
if (repoNav.length > 0) {
|
||||
if (repoNav.length <= 0) return;
|
||||
|
||||
let releasesUrl = repoUrl + "/releases";
|
||||
let releasesTab = $("<a></a>");
|
||||
releasesTab.attr("href", releasesUrl);
|
||||
|
@ -25,7 +39,7 @@ let currentUser = $("ul.header-nav.float-right > li:last > a > img").attr("alt")
|
|||
counter.addClass("counter");
|
||||
releasesTab.append(counter);
|
||||
|
||||
repoNav.append(releasesTab);
|
||||
repoNav.find("a:last").before(releasesTab);
|
||||
|
||||
$.ajax({
|
||||
url: "https://api.github.com/repos" + repoUrl + "/releases",
|
||||
|
@ -41,7 +55,6 @@ let currentUser = $("ul.header-nav.float-right > li:last > a > img").attr("alt")
|
|||
$("nav.reponav > span:first > a").removeClass("selected");
|
||||
releasesTab.addClass("selected");
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
// add explore link to menu
|
||||
|
|
Loading…
Reference in New Issue