rendered paste bodyaddEventSimple(window, "load", function() { // Bind click event to downvote-, upvote and revoke buttons var container = document.getElementById("similaranime"); if (!container) { return false; } var links = container.getElementsByTagName("a"); var vote_up = getElementsByClassName(links, "i_general_vote_up", true); for (i = 0; i < vote_up.length; i++) { addEventSimple(vote_up[i], "click", (function(url) { return function(e) { xhttpRequestFetch(xhttpRequest(), url); if (!e.target) { return false; } var buttons = e.target.parentNode.getElementsByTagName("a"); var dds = e.target.parentNode.parentNode.parentNode.getElementsByTagName("dd"); var percent = getElementsByClassName(buttons, "approval")[0].lastChild; var total = getElementsByClassName(buttons, "total")[0].lastChild; if (getElementsByClassName(dds, "i_general_vote_down", true)) { total.nodeValue = parseInt(total.nodeValue) + 1; } else { total.nodeValue = parseInt(total.nodeValue) + 2; } return false; } })(vote_up[i].href)); }});