User:Dragoniez/MarkBLockedGlobal

Other languages:
A sample image of how blocked users' links will look with the script installed

MarkBLockedGlobal is a script forked from ru:MediaWiki:Gadget-markblocked.js. This script has the following features:

  1. Mark up registered and IP users that are locally blocked (always enabled)
  2. (*) Mark up IPs in locally blocked IP ranges (default: disabled)
  3. (*) Mark up globally locked users (default: enabled)
  4. Mark up globally blocked users and IPs (default: enabled)
  5. (*) Mark up IPs in globally blocked IP ranges (default: disabled)

In addition to the functionality #1 covered by the original version, #2+ ones are unique to this script, and configurable via a user-friendly interface available on Special:MarkBLockedConfig (or Special:MBLC as its alias). The special page is dynamically created if the script is loaded, and can be reached from a portlet link generated in the toolbar.

It is important to note that the script will need to retrieve quite some resources from the server if you choose to enable the starred features. When enjoying them, make sure that you don't go through performance issues. It is not a good idea to randomly enable all of them before thinking that through.

Installation

edit

Add the following to Special:MyPage/global.js (note that this script saves the user config into global preferences; there's practically no advantage in installing it into common.js).

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

On installation, don't forget to disable any similar gadgets and scripts, or you'll be making unnecessary API requests in the background and page loading can be unnecessarily slow.

Advanced

edit

If your local wiki has a similar gadget installed and if you want to use that on that specific wiki but at the same time want to use MBLG on other projects, you can opt out for MBLG on the wiki by adding an extra code block along with your installation:

// Example 1: Opt out on jawiki
if (mw.config.get('wgDBname') !== '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'].indexOf(mw.config.get('wgDBname')) === -1) {
    mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Dragoniez/MarkBLockedGlobal.js&action=raw&ctype=text/javascript');
}