Skip to content

Instantly share code, notes, and snippets.

@BrutuZ
Last active December 3, 2023 00:39
Show Gist options
  • Save BrutuZ/7f45eceb18de9ad2ebe0cb0c09aeaa2b to your computer and use it in GitHub Desktop.
Save BrutuZ/7f45eceb18de9ad2ebe0cb0c09aeaa2b to your computer and use it in GitHub Desktop.
MAL Stacks Filter Userscript
// ==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