您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
让 UOJ 拥有像 CF 那样的评论隐藏机制
当前为
// ==UserScript== // @name UOJ Comment Filter // @namespace n/a // @version 0.1 // @description 让 UOJ 拥有像 CF 那样的评论隐藏机制 // @author iotang // @match http://*.blog.uoj.ac/blog/* // @match https://*.blog.uoj.ac/blog/* // @grant none // ==/UserScript== (function () { 'use strict'; $(document).ready(function () { $(".list-group-item").on("filter-censor", function () { let now = $(this); let rating = now.find(".uoj-click-zan-block").attr("data-cnt"); if (rating <= -7) { now.find(".comtbox1").css("opacity", 0.30); now.find(".comtposterbox").css("opacity", 0.30); now.find(".col-sm-6").css("opacity", 0.30); now.find(".bot-buffer-no").css("opacity", 0.30); now.find(".comtbox5").find(".bot-buffer-no").css("opacity", 1.00); } if (rating <= -15) { now.find(".comtbox1").hide(); let commentHolder = document.createElement("div"); commentHolder.className = "comment-holder"; commentHolder.style = "min-height: 80px; white-space: pre-wrap; word-break: break-all; margin-top: 10px; margin-bottom: 10px; opacity: 0.30; font-size: 80%"; commentHolder.innerHTML = "这个评论由于反馈太负面而被隐藏了,请点击<a class=\"comment-holder-release\" href=\"#\">这儿</a>来显示"; now.find(".comtbox1").after(commentHolder); now.find(".comment-holder-release").click(function () { now.find(".comment-holder").hide(); now.find(".comtbox1").show(); return false; }); } }); $(".list-group-item").trigger("filter-censor"); }); })();