Jump to content

User:Dragoniez/AjaxBlock

From Meta, a Wikimedia project coordination wiki
Other languages:


AjaxBlock dialog

AjaxBlock is a global user script that helps sysops to take quick admin actions, by virtue of the script's functionality to process block/unblock links on the page without having to visit the special page. It mainly has the following features:

  • Block/unblock users via a dialog
  • One-click block/unblock actions
  • Configure your own preferences on a special page (no need to edit user JS)

Block options specified on the dialog are preserved after processing a block request. Making full use of this functionality and repeating one-click blocks, you can also virtually replicate the functionalities of a mass block script.

If you have comments, bug reports, or suggestions, leave a message on User talk:Dragoniez/AjaxBlock.

Installation

Add the following code to Special:MyPage/global.js for global use, or to Special:MyPage/common.js on your project for local use. (source code)

mw.loader.load("//meta.wikimedia.org/w/index.php?title=User:Dragoniez/AjaxBlock.js&action=raw&ctype=text/javascript");

How to use

Script initialization

When a page is loaded, the AjaxBlock logo will be displayed on the right bottom of the page when the script is getting ready. You can use the script's functionalities when this logo has disappeared. Note that you'll just be redirected to the destination page if you click a block link before the logo disappears.

Config page

You can go to the config page by clicking the "AjaxBlock config" link generated in the toolbox, or by typing the following page name into the address bar:

You can configure the following options on this special page:

  • Interface language of the script
  • Dropdown options
  • Initial values of block/unblock options
  • Warning opt-in/out

When you change the first two options, you'll need to refresh the page if you want to apply the new settings on the config page.

With AjaxBlock installed, the behaviour of links to Special:Block and Special:Unblock changes.

  • Normal click
Open the dialog
  • SHIFT click
One-click block/unblock (with warnings as neccesary)
  • CTRL click
Open the link destination
  • SHIFT+CTRL click
One-click block/unblock (with all warnings suppressed; not recommended)
  • Unprocessable links
Displayed with a dotted underline

AjaxBlock warns the user before processing a block/unblock request when there's some potential issues in the specified block/unblock options. If you click a block link in the fourth way above, you can suppress all these warnings. (This functionality applies also to the "Block" and "Unblock" buttons on the dialog.)

When blocking a user, the script internally uses different fields for registered and IP users. This means that block settings for registered users are not applied to IP users, and vice versa. When you use the one-click block functionality, be wary of the type of the user you are going to block.

What "unprocessable links" above means is, for instance, block links without a username specification. Such links will be displayed with a dotted underline, and you'll just be redirected to the special page when you click on them.