Hide Certain TYT Member's comments

Simple script to hide any annoying TYT member's posts and comments.

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name     Hide Certain TYT Member's comments
// @description:en  Simple script to hide any annoying TYT member's posts and comments.
// @include  https://tytnetwork.com*
// @require  https://code.jquery.com/jquery-2.1.3.min.js
// @version 0.0.1.20170131051239
// @namespace https://greasyfork.org/users/98831
// @description Simple script to hide any annoying TYT member's posts and comments.
// ==/UserScript==

function addJQuery(callback) {
    var script = document.createElement("script");
    script.setAttribute("src", "https://code.jquery.com/jquery-2.1.3.min.js");
    script.addEventListener('load', function() {
        var script = document.createElement("script");
        script.textContent = "(" + callback.toString() + ")();";
        document.body.appendChild(script);
    }, false);
    document.body.appendChild(script);
}

// load jQuery and execute the main function
addJQuery(main);

// The example below hides comments by member: dDErss.
// And let's face it why wouldn't you want to hide his self righteous drivel?
// If you want to hide comments from even some other pompous member, just copy and paste all the lines that contain 'dDErss'
// And then simply change the name from dDErss to the member you would also like to stop seeing comments from...
//
// Or to reverse the process, delete the lines containing a members name to allow for their comments to be seen again.
// Pretty simple stuff.

function main() {
    $('.x-comment-content-wrap:contains("dDErss")').hide();
    
//  Enabling the two lines below will create a much cleaner layout, 
//  But will ALSO remove any responses to, or any other post with a comment from, the hidden TYT member...
//  So other posts willl be affected, not just those of the hidden TYT member

//  $('.children:contains("dDErss")').hide();
//  $('.comment:contains("dDErss")').hide();

}

// It's not perfect, as I quickly typed it up while watching my toast brown one breakfast morning...
// But it gets the job done.
// And there's probably a more efficient way to write the script... and one day I'll look at it a bit more closely.
// But not today. LOL!