User:Ponor/really-quick-block
Appearance
The really-quick-block script adds configurable buttons to Recent Changes, Watchlist, and Page History pages to block IP and temporary users, no questions asked. The script will only load for administrators.
Each button takes 4 seconds to 'load', to prevent accidental blocks, and is available for another 6 seconds to 'shoot'. Re-blocks are disabled.
-
Three block buttons are provided for each anonymous user by the example configuration below
-
Button P2 was selected (click #1): it changed its color to full red after 4 seconds, when it was ready to 'shoot' (click #2)
-
The IP user has been blocked, and all the block buttons are disabled
Installation
[edit]Load the script from your wiki's Special:MyPage/common.js page
// Really quick block [[:m:User:Ponor/really-quick-block]]
mw.loader.load("//meta.wikimedia.org/w/index.php?title=User:Ponor/really-quick-block.js&action=raw&ctype=text/javascript");
Configuration
[edit]Any number of buttons can be added. Each button has a name (V1, P2, A6 in the example below), reason, expiry (expressed as time units in English: "6 hours", "1 day" etc.), and additional switches: "anononly", "autoblock", "nocreate", "allowusertalk", and "noemail". See explanations at mw:API:Block.
window.rqb_buttons = {
V1: {reason:"vandalism", expiry:"1 minute", options:["anononly","autoblock", "nocreate", "allowusertalk"]},
P2: {reason:"profanity", expiry:"2 minutes", options:["anononly","autoblock", "nocreate", "allowusertalk"]},
A60: {reason:"attacks", expiry:"1 hour"},
};