User:Walrus068/mass rollback.js

if (wgPageName == "Special:Contributions" && /rollback|sysop/gi.test(wgUserGroups)) { $(function {       var a;        if (skin == "monobook") {            a = "div#p-cactions ul:eq(0)";        } else {            a = "div.tabs-container ul.tabs";        }        $(a).prepend('Rollback all').click(function { $("span.mw-rollback-link a").each(function {               var b = this.search.replace(/&from/, "&user"),                    c = this.search.match(/[?&]title=([^&]*)/)[1];                $.ajax({ url: wgScriptPath + "/api.php" + b + "&format=json", type: "POST", success: function(d) { if (d.error.info) { alert("Error rolling back edits on page " + c + ":\n" + d.error.info); }                   }                });            });        });    }); }