AO3: [Wrangling] Search Wrangling Home

adds a search box on the wrangling home page to filter your assigned fandoms by their name

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name AO3: [Wrangling] Search Wrangling Home
// @description adds a search box on the wrangling home page to filter your assigned fandoms by their name
// @version 0.1
// @author Rhine
// @namespace https://github.com/RhineCloud
// @include http*://*archiveofourown.org/tag_wranglers/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @grant none
// ==/UserScript==

(function($) {
  const table = $('div.assigned.module table');
  const assigned = table.find('tbody tr');
  
  // insert the search box
  table.before('<p><input type="text" id="fandom_search" placeholder="Search.."></p>');
  
  // make it do the hiding/showing after typing
  $('#fandom_search').on('keyup', function() {
    let query = $(this).val().toLowerCase();
    
    assigned.hide();
    assigned.filter(function() {
      return $(this).find('th').text().toLowerCase().indexOf(query) > -1;
    }).show();
  });
})(jQuery);