User:Walrus068/mass rollbacksexi.js

//non jQuery version of User:Walrus068/mass_rollback.js function rollbackEdit(a, b, c) { var d = sajax_init_object; d.onreadystatechange = function { if (d.readyState === 4 && d.status === 200 && d.responseText.match(/error/gi)) { var b = JSON.parse(d.responseText).error.info; alert("Error rolling back edits on page " + a.replace(/_/g, " ") + ":\n" + b); }   };    d.open("POST", wgScriptPath + "/api.php?format=json&action=rollback&title=" + a + "&user=" + b + "&token=" + c, true); d.send; } if (wgPageName == "Special:Contributions" && /rollback|sysop/gi.test(wgUserGroups)) { addOnloadHook(function {       var a = document.createElement("li"),            b = document.createElement("a"),            c = null;        if (skin == "monobook") {            c = document.getElementById("p-cactions").childNodes[3].childNodes[1];        } else {            c = document.getElementById("WikiaUserPagesHeader").childNodes[11].childNodes[1];        }        a.id = "ca-rollback-all";        a.appendChild(b);        b.innerHTML = "Rollback all";        b.href = "#";        b.title = "Rollback all edits displayed here.";        b.setAttribute("style", "background-image:url(http://img24.imageshack.us/img24/271/1248654995arrowcircledo.png);padding-left:19px;background-position:0% 50%;background-repeat:no-repeat no-repeat;");        b.onclick = function {            var a = document.getElementsByTagName("a"),                b = confirm("Rolling back edits, press ok to continue."), i;           if (b) { for (i = 0; i < a.length; i++) { var d = a[i].search; if (d.match(/[?&]action=rollback/i)) { rollbackEdit(d.match(/[?&]title=([^&]*)/i)[1], d.match(/[?&]from=([^&]*)/i)[1], d.match(/[?&]token=([^&]*)/i)[1]); }               }            }            return false; };       c.appendChild(a); }); }