[greasemonkey] Fix my menu-symbols script
This commit is contained in:
parent
ddd31570cc
commit
703247846f
|
@ -24,7 +24,7 @@
|
|||
document.addEventListener('readystatechange', async function onReadyStateChange() {
|
||||
|
||||
var lastTopBarItem = document.querySelector("div.top-bar-container nav ul li:last-child");
|
||||
console.log(lastTopBarItem);
|
||||
if (lastTopBarItem) {
|
||||
lastTopBarItem.style.marginRight = "20px"
|
||||
document.querySelectorAll("ul[data-testid=pinned-nav-items]>li>a").forEach((a) => {
|
||||
a.querySelector("div.gl-truncate-end").innerText = [
|
||||
|
@ -33,10 +33,23 @@
|
|||
].join(" ")
|
||||
|
||||
var newTopBarItem = a.cloneNode(true);
|
||||
newTopBarItem.style.fontSize = "0.8em";
|
||||
newTopBarItem.removeChild(newTopBarItem.querySelector("div[data-testid=active-indicator]"))
|
||||
newTopBarItem.removeChild(newTopBarItem.querySelector("span>button").parentNode)
|
||||
|
||||
if(newTopBarItem.querySelector("span.badge-pill") !== null) {
|
||||
const badgeCount = Number(newTopBarItem.querySelector("span.badge-pill")?.innerText.trim())
|
||||
if(badgeCount == 0 || isNaN(badgeCount)) {
|
||||
newTopBarItem.removeChild(newTopBarItem.querySelector("span.badge-pill").parentNode)
|
||||
}
|
||||
}
|
||||
|
||||
const glTextRight = newTopBarItem.querySelector(".gl-text-right")?.innerText.trim();
|
||||
if(glTextRight == undefined || glTextRight == "") {
|
||||
newTopBarItem.removeChild(newTopBarItem.querySelector(".gl-text-right"))
|
||||
}
|
||||
newTopBarItem.removeChild(newTopBarItem.querySelector("svg[data-testid=grip-icon]").parentNode)
|
||||
lastTopBarItem.parentNode.append(newTopBarItem);
|
||||
})
|
||||
});
|
||||
}}
|
||||
);
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue