Beamdog thread ignore script

Blocks specified threads or subforums on the Beamdog forums

当前为 2017-12-30 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Beamdog thread ignore script
// @namespace   https://greasyfork.org
// @description Blocks specified threads or subforums on the Beamdog forums
// @include     https://forums.beamdog.com/*
// @version     1
// @grant       none
// @run-at      document-ready
// ==/UserScript==

// With this script you can ignore threads. These threads will be ignored on the "Recent Discussions" page
// AND on their respective subforum discussion page.
// You can also choose to ignore a subforum. ALL the threads from ALL subforums with that name will be ignored on the "Recent Discussions" page

// Add the title of a thread to this list. Enclose the thread's title with double quotes.
// Separate different thread titles by a comma.
var threadlist = [
   "Guess Facts about the Next Poster", "Finally an ignore feature!"
];

// Add the name of a subforum to this list in the same way as above. ATTENTION! On our forum there are multiple subforums
// that have the same name. If you enter a name in this list, then ALL the threads from ALL the subforums with that
// name will be ignored!
var subforumlist =[
    
];

var threadsToDelete = document.querySelectorAll(".Title");
var subforumsToDelete = document.querySelectorAll(".Category a");

var url = window.location.href;
var sub1 = "discussion";
var sub2 = "categories";

// case: URL contains "discussion"
if (url.indexOf(sub1) !== -1 ) {

	//delete subforums
    for (var i=0; i < subforumsToDelete.length; i++) {
        if (subforumlist.indexOf(subforumsToDelete[i].textContent) > -1) {
           subforumsToDelete[i].parentNode.parentNode.parentNode.parentNode.style.display = 'none';
        }
    }
	
}

//case: URL contains "discussion" OR "categories"
if (url.indexOf(sub1) !== -1 || url.indexOf(sub2) !== -1){
    
    //delete threads 
      for (var i=0; i < threadsToDelete.length; i++) {
        if (threadlist.indexOf(threadsToDelete[i].textContent) > -1) {
           threadsToDelete[i].parentNode.parentNode.parentNode.style.display = 'none';
        }
    }
}