您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Cleanup new BPL
当前为
// ==UserScript== // @name Hide BPL Trolls and other junk // @namespace ffmike // @description Cleanup new BPL // @include https://bplight.wpengine.com/* // @include https://backpackinglight.com/* // @grant none // @version 2 // @domain www.backpackinglight.com // @license CC0 1.0; https://creativecommons.org/publicdomain/zero/1.0/ // ==/UserScript== // In part shamelessly based on https://greasyfork.org/en/scripts/48-maximumpc-troll-remover/code $(function () { // Utility function to inject global CSS into HEAD tag function addGlobalStyle(css) { var head, style; head = document.getElementsByTagName('head')[0]; if (!head) { return; } style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = css; head.appendChild(style); } // Hide various clutter, including the subscription blocks and forum instructions $("#text-28").hide(); $("#text-29").hide(); $("#text-32").hide(); $("#text-34").hide(); $("#menu-item-15").hide(); $(".bbp-header").hide(); $(".bbp-footer").hide(); // Hide the 'related posts' display addGlobalStyle('div.zem_rp_content { display: none ! important; }'); // Make fonts easier to read and generally condense the layout addGlobalStyle("body {font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important; font-weight: 400 !important; font-size: 11px !important; color: black !important; line-height: 1.25 !important; }") addGlobalStyle('.entry-title {font-size: 20px !important;}'); addGlobalStyle('.entry-content code {color: black !important; }'); addGlobalStyle('.entry-content a {color: black !important; }'); addGlobalStyle('.entry-content a.bbp-topic-permalink {font-weight: 600 !important; }'); addGlobalStyle('.bbp-reply-author {font-size: 8px !important; padding-bottom: 2px !important; }'); addGlobalStyle('.bbp-reply-content {padding-bottom: 0px !important; }'); addGlobalStyle('.bbp-author-role {font-size: 8px !important; }'); addGlobalStyle('.bbp-user-nicename {margin-bottom: 0px !important; }'); addGlobalStyle('.entry {margin-bottom: 2px !important; }'); // Hide small avatars on topic list addGlobalStyle('.bbp-topic-started-by .bbp-author-avatar {display: none !important; }'); // Make links visible addGlobalStyle('a {border-bottom: .0625rem solid skyblue !important; }'); // Hide the WordPress minibar $('#wpadminbar').hide(); // Get rid of some wasted space addGlobalStyle('html {margin-top: 0px !important; }'); addGlobalStyle('.site-container {margin-top: 0px !important; padding-top: 2px !important; }'); addGlobalStyle('.site-inner {padding-top: 0px !important;}'); // Move and shrink the navigation. Best on wide screens. addGlobalStyle('.nav-primary {position: absolute !important; top: 10px !important; left: 0px !important;}'); addGlobalStyle('.nav-secondary {position:absolute !important; top: 43px !important;}'); addGlobalStyle('.mega-sticky {margin-top: -10px !important; position: absolute !important; width: 500px !important;}') addGlobalStyle('a.mega-menu-link {font-size: 9px !important; }'); $('.nav-menu-bpl-logo-type-bold').html('BPL'); $('.nav-menu-bpl-logo-type-ultralight').hide(); // Nuke the social media links $('#mega-menu-item-1141556').hide(); $('#mega-menu-item-1141557').hide(); $('#mega-menu-item-1141558').hide(); // If there are users you don't ever want to see posts from, add their handles to this list var joList = ["tipiwalter", "rosyfinch", ]; var joLength = joList.length; var numJoComments = 0; var thisJo, userName, ref; // Look at all the links on the page and hide the ones I don't care about $("a").each(function(index, value) { ref = value.href; // Get rid of Gear Swap posts on Recent Forums Topics if (ref == 'https://backpackinglight.com/forums/forum/commerce/gear-swap/') { $(this).closest('.topic').hide(); } // Get rid of posts from trolls var pieces = ref.split('/'); userName = pieces[pieces.length - 2]; for(var i=0; i<joLength; i++) { if(userName == joList[i]) { //console.log('Hiding ' + userName); $(this).closest('.reply').hide(); break; } } }); });