From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

EasyBlock (source) is one of my scripts that aids admins who often do routine blocks, such as those for vandalism, username violations, or sockpuppeteering.

This tool will display a "block" tab, which, when the mouse hovers over it, will display a list of block options on the following pages/namespaces (see below for display options, and please read how the script detects usernames):

If useAutoWarn (see below) is not set to false, it will also automatically warn (depending on the type of block done, it may also tag) users after they've been blocked.



To install this application, add the following code to your monobook exactly as it appears when viewing this page, and bypass your cache:

importScript("User:Animum/easyblock.js"); //[[User:Animum/easyblock.js]]


EasyBlock has eight available preferences:

(Note: For the purposes of the table below, "edits" is defined as "the warnings or notifications the script will post when automatically warning a user.")

Preference Values Default Description
markWarnAsMinor true or false true Leaving this variable as true will make the script mark edits as minor; setting it to false will make it not mark edits as minor.
showOnPages ["user_usertalk", "contribs", "diffs", "ipblocklist", "blockip"] All of them This preference, which must be declared in array form, governs which pages will have "block" tabs. For example, if you do not want it to show on diff screens, all you have to do is remove "diffs", from the list. If you leave only one option (e.g., "user_usertalk"), there should be no commas within the brackets (["user_usertalk"] rather than ["user_usertalk",]).
useAutoWarn true or false true true will make the script automatically warn (and possibly tag) users after a block has been done; false will disable this function.
loadPageOnSubmit true or false true true will force the script to redirect automatically to the last page it edits; false will make it do the opposite.
displayStatus true or false true true makes the script display status updates, such as "User has been blocked"; false makes the script not display these updates. The background color will still change, however, regardless of the value of this variable.
watchlistEnabled true or false false true has the script add the blocked user's talk page to your watchlist, whereas false does not.
showOnClick true or false false true will make the drop-down list appear only after clicking on the tab; false will make the list appear when the cursor moves over the block tab.
returnTo Any string (wrapped in "quotes") The last page the script edited The script will return to whatever page you specify, which must be in URL form (underscores instead of spaces, etc.). For example, if I set this variable to "Wikipedia:Administrator_intervention_against_vandalism&action=purge", I would be taken to a purged AIV page after the script finishes its job.

To set one or more of the preferences to a value, use the key : value, pattern, which Twinkle also uses. Assume that I want to set useAutoWarn to false, displayStatus to false, and to make the tab hidden on Special:Block. I would need to add the following to my monobook:

ebPrefs = {
    useAutoWarn   : false,
    displayStatus : false,
    showOnPages   : ["user_usertalk", "contribs", "diffs", "ipblocklist"]
Note: The last key : value entry should not have a comma after it.

If you want another configurable option or need to report a bug, you can leave me a message, send me an e-mail, or contact me on IRC (if I so happen to be there). The preferred method, however, is the first one because others can act on the requests if I can't.

User detection methods (very important)[edit]

The following is the methodology this script uses to gather the username of the user to block:

  • On Special:Block, the name of the user who would be blocked per the normal means otherwise;
  • On User: or User_talk: pages, the name of the corresponding user, except for diffs, which will take the name of the user who made that specific edit;
  • On diffs of any page, the name of the user who made the edit will override any other data the script would normally collect. For instance, the username would be "Animum" on my talk page except when viewing a diff, which will take the name of the user who made the edit (in this case, Aitias);
  • On Special:Contributions, the name of the user whose contributions are being queried; and
  • On Special:BlockList, the name of the user who was just unblocked (the tab will only appear after a successful unblock).

A note about sockpuppet blocks[edit]

When using this script, please only use the "confirmedsock" option if there is specific CheckUser evidence; please use the "suspectedsock" option for all other cases.