Shoutbox thread notifications poll

Notifications options in shoutbox

  • All new posts and replies get announced in shout

    Votes: 11 35.5%
  • Only new threads get announced in shout

    Votes: 19 61.3%
  • No forum posts at all get announced in shout

    Votes: 1 3.2%

  • Total voters
    31
Status
Not open for further replies.

null

and void
|K3| Member
That's good to know, @HIBred, because I've just modified my vote as I find myself agreeing with @DamageINC (I didn't comment when I first cast a vote partly because I didn't have anything to say, but mostly because I thought it out of place considering both how new I am to the forum and that I'm not a member: at least it felt improprietous).

Anyway, since this is an annoyance to many I've just knocked together a little Greasemonkey script that will hide post notifications from the shoutbox (let me know if anyone would like a hand installing it):

Code:
// ==UserScript==
// @name        Disable thread notifications in shoutbox
// @namespace   nu11ifi3d
// @description Remove thread notifications from the shoutbox on KrewGaming.com
// @include     http://krewgaming.com/*
// @version     1
// @grant       none
// ==/UserScript==
function taigaRemoveThreads() {
    var messages = document.getElementById('taigachat_box').getElementsByTagName('li');
    for (var i = 0; i < messages.length; i++) {
        if (messages[i].innerHTML.indexOf('internalLink') > 0) {
            messages[i].style.display = 'none';
        }
    } setTimeout(function () { taigaRemoveThreads(); }, 5000);
} taigaRemoveThreads();
 

DamageINC

K3's Useless Admin
|K3| Executive
@Kreubs , the ball is in your court.

CODE FIGHT!

52376408.jpg



@null ; don't be afraid to speak up about anything. It's encouraged.
 
Last edited:

HIBred

Foolish Mortal
|K3| Executive
Null gets a massive :hi5: script works like a charm
even a noob like me was able to remove the notifications :K
Chrome use: Tampermonkey extension>>copy paste his script in the add script option>> click enable box >>restart chrome voila!
 

WaLLy

Lieutenant General
|K3| Executive
Does it remove all notifications or just Tge Last Comment wins thread?
 

null

and void
|K3| Member
no-go for me then. I'd prefer to hide certain threads only :K

Ask and you shall receive! This version allows you to define a list of threads to block by thread title (case-sensitive). I've set it up to block the 'Last Comment Wins' style out of the box, so no further config. is required if that's all you're after.

Code:
// ==UserScript==
// @name        Disable thread notifications in shoutbox
// @namespace   nu11ifi3d
// @description Remove thread notifications from the shoutbox on KrewGaming.com
// @include     http://krewgaming.com/*
// @version     1
// @grant       none
// ==/UserScript==
function taigaRemoveThreads() {
    var blockedThreads = [
        "Last Comment Wins"
    ];
    var messages = document.getElementById('taigachat_box').getElementsByTagName('li');
    for (var i = 0; i < messages.length; i++) {
        if (messages[i].innerHTML.indexOf('internalLink') > 0) {
            for (var y = 0; y < blockedThreads.length; y++) {
                if (messages[i].innerHTML.indexOf(blockedThreads[y]) > 0) {
                    messages[i].style.display = 'none';
                }
            }
        }
    } setTimeout(function () { taigaRemoveThreads(); }, 5000);
} taigaRemoveThreads();

To add more threads to your ignore list, you'll want to edit the var blockedThreads variable at the top. For example, if I want to block 'What are you listening to?' and 'funny pics' (just an example :p), I'd do:

Code:
var blockedThreads = [
    "Last Comment Wins",
    "What are you listening to?",
    "funny pics"
];

Notice that you wrap the thread title in quotes and separate new items with a comma. It's a bit easier to read if you put each thread title on its own line as well. Hope that helps!
 
Last edited:

WaLLy

Lieutenant General
|K3| Executive
@null :ytm::ty:

I see how it works now. Takes about a second or two to remove them but still a very nice way to remove certain threads.

For everyone, is this an acceptable alternative to remove the notifications and/or remove certain threads from appearing in your shoutbox?
 

null

and void
|K3| Member
Cheers guys, I'm very glad that this is useful.

@WaLLy yes, you've got it right. If you've got the script loaded in Greasemonkey or similar then it will strip the notifications when you first load the page. That works quickly, but if you keep the page open for a while then new notifications are eventually going to come through. To address this, the script is set to loop every 5 seconds. I set it to this to keep it from running too often, but the downside is that you could potentially have to wait the full 5 seconds before a notification is removed. If performance isn't an issue, then I propose the following two scripts as *final* versions which loop much more quickly and will eliminate that delay you noticed:

Strip all thread notifications:
Code:
// ==UserScript==
// @name        Disable thread notifications in shoutbox
// @namespace   nu11ifi3d
// @description Remove thread notifications from the shoutbox on KrewGaming.com
// @include     http://krewgaming.com/*
// @version     1
// @grant       none
// ==/UserScript==
function taigaRemoveThreads() {
    var messages = document.getElementById('taigachat_box').getElementsByTagName('li');
    for (var i = 0; i < messages.length; i++) {
        if (messages[i].innerHTML.indexOf('internalLink') > 0) {
            messages[i].style.display = 'none';
        }
    } setTimeout(function () { taigaRemoveThreads(); }, 100);
} taigaRemoveThreads();

Strip thread notifications by title:
Code:
// ==UserScript==
// @name        Disable thread notifications by title in shoutbox
// @namespace   nu11ifi3d
// @description Remove thread notifications by title from the shoutbox on KrewGaming.com
// @include     http://krewgaming.com/*
// @version     1
// @grant       none
// ==/UserScript==
function taigaRemoveThreads() {
    var blockedThreads = [
        "Last Comment Wins"
    ];
    var messages = document.getElementById('taigachat_box').getElementsByTagName('li');
    for (var i = 0; i < messages.length; i++) {
        if (messages[i].innerHTML.indexOf('internalLink') > 0) {
            for (var y = 0; y < blockedThreads.length; y++) {
                if (messages[i].innerHTML.indexOf(blockedThreads[y]) > 0) {
                    messages[i].style.display = 'none';
                }
            }
        }
    } setTimeout(function () { taigaRemoveThreads(); }, 100);
} taigaRemoveThreads();
 

WaLLy

Lieutenant General
|K3| Executive
If performance isn't an issue, then I propose the following two scripts as *final* versions which loop much more quickly and will eliminate that delay you noticed:
I refresh the forum far too often so that extra few seconds to wait for it to load woulda annoyed me XD.
Strip thread notifications by title:
Works perfectly now! :vh: :ty:
edit:
I'm using Tampermonkey for Chrome as @HIBred suggested. Works like a charm. :)
 

Kreubs

|K3|Minecraft Admin
|K3| Executive
@Kreubs , the ball is in your court.
CODE FIGHT!
Ok, code fight! lol
Code:
if(hideReplies) {
    for (var i = 0; i < lis.length; i++) {
         if (lis[i].innerHTML.indexOf('internalLink') > 0 && lis[i].innerHTML.indexOf('replied to thread') > 0) {
             lis[i].style.display = 'none';
        }
    }
}
I basically took part of null's script and added an extra condition because it would hide all shouts with links to the forum whether or not they were auto-generated. But, instead of looping infinitely over the shoutbox in the background, the loop now runs from the TaigaChat ajax handler for new messages. I added a user option for it in Preferences. @PrestoN phone functionality.

It will loop over every message one time on load. After that, it will only check each message/group of messages upon arrival, decreasing possible lag.
 

DamageINC

K3's Useless Admin
|K3| Executive
Ok, code fight! lol
Code:
if(hideReplies) {
    for (var i = 0; i < lis.length; i++) {
         if (lis[i].innerHTML.indexOf('internalLink') > 0 && lis[i].innerHTML.indexOf('replied to thread') > 0) {
             lis[i].style.display = 'none';
        }
    }
}
I basically took part of null's script and added an extra condition because it would hide all shouts with links to the forum whether or not they were auto-generated. But, instead of looping infinitely over the shoutbox in the background, the loop now runs from the TaigaChat ajax handler for new messages. I added a user option for it in Preferences. @PrestoN phone functionality.

It will loop over every message one time on load. After that, it will only check each message/group of messages upon arrival, decreasing possible lag.

I don't know what went on here, but it sounds quite nice. :ytm:
 

HIBred

Foolish Mortal
|K3| Executive
issue is resolved.. you may turn off thread notifications now thanks to Null and Kreubs ..Under preferences check the hide notifications box if you want to thx for voting!
 
Status
Not open for further replies.
Top Bottom