Extension:Gadgets/Scripts/UserRights.js

From MediaWiki.org
Jump to navigation Jump to search

This script is obsolete. The functionality was added to MediaWiki 1.21 (bug 34040 / phab:rMW17e17ba57660c480fd2e5ae0b1098225ab3fca80). It also contains deprecated JavaScript functionality, so should not be used as an example of how to construct gadgets for current versions of MediaWiki.

/** userRights (for Bureaucrats only) **/
addOnloadHook( function() {
	if ( wgNamespaceNumber != 2 && wgNamespaceNumber != 3 ) { // User or User talk
		return;
	}
	var user = wgTitle.split( '/' )[0];
	var url = wgScript + '?title=Special:UserRights&user=' + encodeURIComponent( user );
	addPortletLink( 'p-tb', url, 'User rights', 't-userrights', 'List of user groups for ' + user );
});