Beamdog thread ignore script

Blocks specified threads or subforums on the Beamdog forums

目前為 2017-12-30 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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';
        }
    }
}