您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
hide works with too many relationships on the AO3
// ==UserScript== // @name ao3 relationship savior // @description hide works with too many relationships on the AO3 // @namespace https://gf.qytechs.cn/en/users/3759-locrian // @include http*://archiveofourown.org/* // @grant none // @version 1.021 // ==/UserScript== /**** CONFIG ********************/ window.ao3RelsConfig = { maxRelationships: 2, // set to the maximum number of relationships per work you want to see }; /********************************/ (function($) { var works = $('li.blurb'); if (!works[0]) return; var toggleClass = 'ao3-rels-hide-toggle', fold = $('<p>').addClass('fold').append( $('<span>').addClass(toggleClass).text('This work is hidden! '), $('<span>').addClass(toggleClass).html('This work was hidden. ').hide(), $('<span>').addClass('reason'), $('<span>').addClass('actions').append( $('<a>').addClass('action').css({ 'position': 'absolute', 'right': 8, 'top': 10 }).text('Unhide') ) ), bl = window.ao3RelsConfig, shouldBlacklist = function(work) { var relationships = work.find('.relationships').find('a.tag'); if (relationships.length > bl.maxRelationships) { return relationships.length; } }, blacklist = function(work, reason) { var cut = $('<div>').addClass('cut').html(work.html()), reason = '(Too many relationships: ' + reason +')', thisFold = fold.clone(), reasonContainer = thisFold.find('.reason'); reasonContainer.html(reason); work.empty().append(thisFold, cut.hide()); work.find('a.action').click(function() { var fold = $(this).closest('.fold'), cut = fold.next('.cut'); cut.add(fold.children('.'+toggleClass)).toggle(); $(this).text(cut.is(':visible') ? 'Hide' : 'Unhide'); }) }; works.each(function() { var reason = shouldBlacklist($(this)); if (reason) { blacklist($(this), reason) } }); })(window.jQuery);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址