您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button to hide an entire group of recommendations.
当前为
// ==UserScript== // @name Add Hide All Button // @namespace https://greasyfork.org/en/users/96096-purple-pinapples // @version 0.1 // @description Adds a button to hide an entire group of recommendations. // @author PurplePinapples // @include /^https:\/\/graph\.anime\.plus\/.*\/recommendations,(anime|manga) // @grant none // ==/UserScript== (function() { "use strict"; var missing_entries = $("div.section.missing table"); $(missing_entries).find("tbody").each(function() { var trs = $(this).children().toArray(); // first TR is subject/proposed // second TR is either nothing or the `a` element to expand if possible // trs[1].find("a").first().click(); // expand if possible. var subject = $(trs[0]).find("td.subject"); var proposed = $(trs[0]).find("td.proposed"); var proposed_non_hidden_ul = $(proposed).find("ul").first(); if ($(proposed_non_hidden_ul).find("li").toArray().length > 1) { $(proposed_non_hidden_ul).find("li").last().after('<li style="text-align: right; font-variant: small-caps"><a class="user_script_hide_these">hide all</a></li>'); } }); // add underline to mouseover $(".user_script_hide_these").mouseenter(function() { $(this).css("text-decoration", "underline"); }).mouseleave(function() { $(this).css("text-decoration", "none"); }); // function that hides other elements oncclick (and hides the hide-all button) $(".user_script_hide_these").on("click", function() { $(this).parents(".proposed").first().find("li:not('.user_script_hide_these')").each(function() { $(this).find("a.delete-trigger").first().click(); // first() probably isnt necessary. }); $(this).parents("tbody").first().fadeOut(); $(this).remove(); }); })();