User:Dragoniez/MarkBLockedGlobal

MarkBLockedGlobal is a script that marks up links for users subject to edit restrictions:
- Marks up users (registered, temporary, and IP) who are locally blocked (always enabled)
- (*) Marks up IP users within locally blocked IP ranges (default: disabled)
- Marks up globally locked users (default: enabled)
- Marks up globally blocked users and IPs (default: enabled)
- (*) Marks up IP users within globally blocked IP ranges (default: disabled)
The markup targets are configurable through a user-friendly interface available at Special:MarkBLockedConfig (or its alias, Special:MBLC). The special page is dynamically created when the script is loaded and can be accessed from a portlet link added to the toolbar.
Note that the starred features may consume server resources because they require one API request per user. Use discretion when enabling them, as they may negatively affect performance depending on the page size and your browser or device environment.
Installation
[edit]Add the following to Special:MyPage/global.js (note that this script stores its configuration in global preferences, so there is little advantage to installing it in common.js).
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Dragoniez/MarkBLockedGlobal.js&action=raw&ctype=text/javascript');
After installation, remember to disable any similar gadgets or scripts. Otherwise, unnecessary API requests may be made in the background, which can slow down page loading.
- Source code: User:Dragoniez/MarkBLockedGlobal.js
- Module 1: ja:MediaWiki:Gadget-MarkBLocked-core.js
- Module 2: ja:MediaWiki:Gadget-MarkBLocked-core.css
Advanced
[edit]If your local wiki has a similar gadget installed and you want to use that gadget on a specific wiki while still using MBLG on other projects, you can opt out of MBLG on that wiki by adding an extra code block alongside your installation:
// Example 1: Opt out on jawiki
if (mw.config.get('wgWikiID') !== 'jawiki' ) {
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Dragoniez/MarkBLockedGlobal.js&action=raw&ctype=text/javascript');
}
// Example 2: Opt out on jawiki and enwiki
if (!['jawiki', 'enwiki'].includes(mw.config.get('wgWikiID'))) {
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Dragoniez/MarkBLockedGlobal.js&action=raw&ctype=text/javascript');
}