Jump to content

User:Ponor/really-quick-block

From Meta, a Wikimedia project coordination wiki

The really-quick-block script adds configurable buttons to Recent Changes, Watchlist, and Page History pages to block IP 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.

Installation[edit]

Load the script from your wiki's Special:MyPage/common.js page

// Really quick block
// meta.wikimedia.org/wiki/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: "anoonly", "autoblock", "nocreate", and "allowusertalk". 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"]},
    A6: {reason:"attacks", expiry:"6 minutes"},
  };