User:Dragoniez/MarkBLockedGlobal

From Meta, a Wikimedia project coordination wiki
Other languages:
A sample image of how blocked users' links will look with the script installed

MarkBLockedGlobal is a script forked radically from ru:MediaWiki:Gadget-markblocked.js. It has the following functionalities:

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

In addition to the functionality #1 covered by the original version, the starred 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.

On the other hand, it is important to note that the script will need to retrieve quite some resources from the server if the "additional" functionalities are enabled. When enjoying the features, make sure that you don't go through performance issues. It is not a good idea to randomly enable all the functionalities before thinking them 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');
}