Skip to content

Instantly share code, notes, and snippets.

@tobbez
Created August 10, 2010 13:37
Show Gist options
  • Save tobbez/517275 to your computer and use it in GitHub Desktop.
Save tobbez/517275 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Hide translation threads from the project forum
// @namespace tobbez
// @include http*://*what.cd*
// ==/UserScript==
if (document.location.pathname == '/forums.php' && document.location.search == '?action=viewforum&forumid=45') {
var rows = $('tr.rowa, tr.rowb').objects;
for (var i in rows) {
if (rows[i].getElementsByTagName('a')[0].innerHTML.match(/^Translating the rules into/)) {
rows[i].parentElement.removeChild(rows[i]);
}
}
var tables = document.getElementsByTagName('table');
for (var i = 0; i < tables.length; i++) {
var table_rows = tables[i].getElementsByTagName('tr');
var classes = ['rowa', 'rowb'], class_index = 0;
for (var j = 1; j < table_rows.length; j++) {
table_rows[j].className = classes[class_index++];
class_index %= classes.length;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment