AjaxBlock

AjaxBlock allows you to block users without leaving the current page you're on, by showing a block modal when you click on a Special:Block link.

Note: The modal won't open if you're holding either the shift or control key. This is to allow users to access Special:Block links normally.

Installation
Add this JavaScript on either your global.js, common.js or wikia.js: or, if you instead want the simple version of the script, use this:

Usage
The block modal will show up when you click on any Special:Block link, using it is pretty self-explanatory. Set a block length from either the dropdown or typing on the input the custom time you prefer (times like 4 months and 2 weeks are acceptable too). Then select one of the common block reasons or type your own on the input. Check the options you'd like to be applied to the block and finally click the "Block this user" button, or "Cancel" to close the modal.

On the simple version it will prompt a message telling you to enter the block time, and then one telling you to enter the block reason. The options like AutoBlock and disabling user talk editing are defined by variables before the import.

Customization
All custom variables are under the  object.

Custom default expiry times
To set custom expiry times, you just need to add to the  object in the syntax:. For example: Default: 2 hours, 3 hours, 1 day, 3 days, 5 days, 1 week, 2 weeks, 1 month, 3 months, 6 months, 1 year, 2 years, 3 years.

Custom default block reasons
Pretty much the same as with expiry times. Example: Default: Vandalism: Vandalism; Spam Spam; Sockpuppetry/Ban Evasion: Sockpuppetry; Removing content/blanking pages: Page blanking; Inserting false information or nonsense: Gibberish; Intimidating behaviour/harassment/trolling: Troll/Harassment; Unacceptable username, avatar, or global masthead: Name/avatar; Under the legal age: COPPA.

Auto-check options
Create automatically checked checkboxes on the block modal. Default Checked: creation (prevent account creation) and autoBlock. Default unchecked: talk (prevent posting on talk page) and override (override current blocks).

Simple Version
On this version, as stated before, checkboxes are set on the window.AjaxBlock object, and they will be applied to all blocks using the script.


 * defBlockDuration: Placeholder for the block length. Can accept values like "1 day" or "2 weeks". Default: 2 weeks.
 * defBlockReason: Placeholder for block reason. Default: Vandalism.
 * config: object that holds the variables that will be replacing checkboxes.
 * nocreate: Prevent IP from creating accounts. Default: true.
 * autoblock: Block the last IP address used by the user, and any subsequent IP addresses they try to edit from. Default: true.
 * allowtalk: Allow the blocked user to post on their own message wall/talk page. Default: false.
 * override: Override any other block already in effect. Default: true.

Example configuration: