User:Anna Frodesiak/deletedcontribs.js

/* This adds a "Deleted contributions" link to the Tools menu. * It only works for admins, and only in the user or user talk namespaces. * To install it, add the following code to your common.js:

importScript('User:Anna Frodesiak/deletedcontribs.js'); // Linkback: User:Anna Frodesiak/deletedcontribs.js

*/

$( document ).ready( function {	var username;	var config = mw.config.get( [ 'wgUserGroups', 'wgNamespaceNumber', 'wgTitle' ] );	if ( config.wgUserGroups.toString.indexOf( 'sysop' ) !== -1 && // Restrict to admins ( config.wgNamespaceNumber === 2 || config.wgNamespaceNumber === 3 ) ) {		username = config.wgTitle.split( '/' )[ 0 ];		mw.util.addPortletLink( 'p-tb', mw.util.getUrl( 'Special:DeletedContributions/' + username ), 'Deleted contributions', 't-deleted', 'Deleted contributions of this user', null, '#t-log' );	} } );