Hey everypony,
I have a gift for you guys. Posted in the LT Drama, but here you go: A script to prevent LT threads from appearing.
If you want, I'll work on the original so that it's a bit smarter about what it removes.
// ==UserScript==
// @name LT Ignore Topics
// @version 0.1.1
// @description Ignore Lord Tony's topics, too.
// @include http://forum.blockland.us/index.php?board=*
// @copyright 2012+ Iban
// ==/UserScript==
var tables = document.getElementsByTagName('table'), matchClass = "bordercolor", badRows = new Array();
for(var i = 0; tables.length; i++)
{
if((" "+tables[i].className+" ").indexOf(" "+matchClass+" ") > -1) {
var rows = tables[i].getElementsByTagName('tr');
for(var j = 0; j < rows.length; j++) {
var cells = rows[j].getElementsByTagName('td');
if(cells[2].innerHTML.search("Lørd Tøny") > -1) {
badRows.push(rows[j]);
}
}
// Google Chrome intelligently places a <tbody> in the <table>.
// However, the original SMF code does not have the <tbody>
// Cover our ass.
var tbody = tables[i].getElementsByTagName('tbody');
for(var k = 0; k < badRows.length; k++) {
if(tbody.length) {
tbody[0].removeChild(badRows[k]);
}
// No <tbody>, remove straight from the <table>
else {
tables[i].removeChild(badRows[k]);
}
}
break;
}
}