Created
August 10, 2010 13:37
-
-
Save tobbez/517275 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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