Last active
December 3, 2023 00:39
-
-
Save BrutuZ/7f45eceb18de9ad2ebe0cb0c09aeaa2b to your computer and use it in GitHub Desktop.
MAL Stacks Filter Userscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Stack List Toggler | |
// @namespace http://tampermonkey.net/ | |
// @version 1.1 | |
// @description Adds link to hide items in your list | |
// @author BrutuZ | |
// @match https://myanimelist.net/stacks/* | |
// @icon https://icons.duckduckgo.com/ip2/myanimelist.net.ico | |
// @downloadURL https://gist.github.com/BrutuZ/7f45eceb18de9ad2ebe0cb0c09aeaa2b/raw/stack-list-toggle.user.js | |
// @updateURL https://gist.github.com/BrutuZ/7f45eceb18de9ad2ebe0cb0c09aeaa2b/raw/stack-list-toggle.user.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
document.getElementById("my_toggle")?.remove() | |
let rem = document.createElement("a") | |
rem.id = "my_toggle" | |
rem.innerText = " 👁️🗨️ Toggle my entries" | |
rem.className = "tag-manga mr4" | |
rem.href = "javascript:;" | |
rem.onclick = function() { | |
document.querySelectorAll(".button_edit, .button_add").forEach( | |
function(item){ | |
if (item.className.includes("button_edit") || !item.closest(".seasonal-anime").querySelector(".category, .info").textContent.trimStart().startsWith("Manga")){ | |
let show = item.closest(".seasonal-anime") | |
show.hidden = !show.hidden; | |
if (show.hidden) { | |
show.style = "display:none" | |
} else { | |
show.removeAttribute("style") | |
} | |
} | |
} | |
); | |
}; | |
document.getElementsByClassName("mylist")[0].appendChild(rem) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment