User:Writ Keeper/Scripts/massRollback

This script provides the ability to rollback all of a user's displayed edits from their Special:Contributions page, for use with combating widespread disruption. This makes use of the rollback function of Mediawiki, and as such requires rollback permissions (either from the rollbacker permission or as part of the administrator toolset).

***WARNING***

As with all semi-automatated tools, you are responsible for ALL of the edits you make with this gadget; it is incumbent on you to ensure that rollbacks performed with this tool are compliant with the relevant policies for rollback.

Functions

edit

Upon installation, this will add two new buttons, called "rollback all" and "rollback some", on any user's Special:Contributions page, along with a column of checkboxes for each displayed revision. (If you're using the default Vector skin, these buttons might be added as items in the "More" menu, in the upper-right of your screen next to the search bar.)

Upon clicking on "rollback all", the script will present you with a dialog box. In this dialog box, you will be prompted to supply a custom edit summary that will be applied to each rollback performed. You can also just leave this box blank--if so, the tool will use the default canned summary applied to normal rollback: "Reverted edits by UserX (talk) to last version by UserY". There is also a "Cancel" button, which will abort the process entirely without performing any rollbacks. Assuming that OK is clicked, the tool will then perform rollback on all eligible edits that are displayed on the current page (as indicated by [rollback] links next to the edits). Successful rollbacks will change that [rollback] link to [reverted], giving a visual indicator that the rollbacks were performed.

Clicking "rollback some" will behave similarly, except that rollbacks will only be attempted on edits that have their checkboxes checked. To aid in selecting many revisions at once, the script supports shift-clicking: that is, by clicking one box and then shift-clicking another box, all checkboxes between those two will be marked as checked.

Note that the script only operates on edits currently displayed on the Special:Contributions page; if there are more edits (e.g. available by clicking "older 50"), those undisplayed edits will not be affected. Similarly, increasing the number of contributions displayed (e.g. clicking on the link to increase the display limit to 500) will increase the number of revisions that massrollback will potentially be applied to.