您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
adds CSS classes .rainbow0 through .rainbow5, updates dynamically when filters are applied
当前为
// ==UserScript== // @name AO3: [Wrangling] Rainbow Home Page // @namespace https://greasyfork.org/en/users/906106-escctrl // @description adds CSS classes .rainbow0 through .rainbow5, updates dynamically when filters are applied // @author escctrl // @version 1.1 // @match *://*.archiveofourown.org/tag_wranglers/* // @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js // @license MIT // ==/UserScript== (function($) { 'use strict'; function resetRainbow() { $('.assigned tbody tr').removeClass('rainbow0 rainbow1 rainbow2 rainbow3 rainbow4 rainbow5'); $('.assigned tbody tr:visible').each( function(it, row) { $(row).addClass('rainbow'+it%6); }); } // wait for document to finish loading (seems to be required - events only work properly after other scripts finished writing the filtering links) $(document).ready(function(){ // executes on page load for initial coloring resetRainbow(); // add events for dynamic updates of the CSS classes when filters are applied // Redux $('#filter-fandoms a').on("click", resetRainbow); // N-in-1 $('#media-filter a').add('#source-filter a').add('#fandom-filter a').add('#setup-filter a').add('#reset-filter a').on("click", resetRainbow); // Standard (doesn't specify a p#id so we have to assume it's the second p) $('.assigned p:nth-of-type(2)').not('#filter-fandoms, #media-filter, #source-filter, #fandom-filter, #setup-filter, #reset-filter, #fandom_search').children('a').on("click", resetRainbow); // Search $('#fandom_search').on('keyup', resetRainbow); }); })(jQuery);