AjaxBlock

AjaxBlock allows you to block and unblock users without leaving the current page you're on, by showing a block modal when you click on any block/unblock link.
Note: The modal won't open if you're holding either the or key. This is to allow users to access the block and unblock special pages normally.
== ==
== ==
The block modal will show up when you click on any Special:Block link with a target. 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 formats). Then select one of the common block reasons or type your own on the input. You can specify the reason further if you choose a common reason and input your own at the same time, which would result in: <common reason>: <further ellaboration>. 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.
When unblocking, a modal will pop up prompting you to input a reason. Clicking "Unblock this user" will unblock the user, or "Cancel" to close the modal.
== Customization ==
All custom variables are under the window.AjaxBlock object.
==== Custom default expiry times ====
To set custom expiry times, you just need to add to the window.AjaxBlock.expiryTimes object using the syntax: 'time to submit': 'time to display',. For example:
The default is grabbed from MediaWiki:Ipboptions. On most English wikis, it's: 2 hours, 5 hours, 12 hours, 1 day, 3 days, 5 days, 1 week, 2 weeks, 1 month, 3 months, 6 months, 1 year, 2 years, 3 years, infinite.
==== Custom default block reasons ====
Pretty much the same as with expiry times, but you have to change window.AjaxBlock.blockReasons. For example:
There's a fancier syntax in case you want grouped reasons like the ones generated with the MediaWiki page. It does require some finnicky code so it's advised to stay away from it unless you're experienced with JavaScript object notation. An example can be found at the bottom of the page.
The defaults are grabbed from MediaWiki:Ipbreason-dropdown, so you may not need this setting!
==== Custom default unblock reasons ====
The object below represents the custom default unblock reasons selection.
Pretty much the same as with the block reasons. But with unblock reasons. And it's window.AjaxBlock.unblockReasons. For example:
There are no defaults. If you don't provide this, you'll have to type out the unblock reason manually. Of course, Special:Unblock doesn't have a dropdown either, so it should be fine.
==== Auto-check options ====
Automatically checked checkboxes on the block modal. talk specifies whether the user will be stripped of rights to post on their talk page or message wall. autoBlock specifies whether the user will be autoblocked with their subsequent IPs. override specifies whether to override the current block. And noCreate specifies whether to prevent the user from creating new accounts. That one doesn't work.
window.AjaxBlock = {
 check: {
 talk: true,
 autoBlock: true,
 override: true,
 noCreate: true,
 }
};
talk and autoBlock are unchecked by default.
=== Example configuration ===
==== Example configuration with all parameters ====