User:Gryllida/js/showUserContributionsWhenBlocking.js

/* Author : Svetlana Tkachenko svetlana@members.fsf.org This file is a part of showUserContributionsWhenBlocking.js. Licence: GPLv3+ Description: [beta] shows a user contributions on the block page (sysop-only) See also . mw.loader.using(['mediawiki.api'], function {	"use strict";	// == Check whether we are blocking a user ==	var thisPageTitle = mw.config.get( 'wgPageName' );	// == Retrieve and show this user's contributions ==	if (thisPageTitle.indexOf('Special:Block') === 0){		// == Create an API object ==		var api = new mw.Api;		// == Query the wiki API to get HTML of ==		api.get( { action: 'parse', text: ''.replace('$1', mw.config.get( 'wgRelevantUserName' )) } ).done( function ( data ) { // == Add the HTML at the end of current page == $('#content').append($(' ', {text: 'User contributions'})); $('#content').append(data.parse.text['*']); console.log('[showUserContributionsWhenBlocking] hi'); console.log(_addDeleteLink); console.log('[showUserContributionsWhenBlocking] bye'); if(_addDeleteLink){ _addDeleteLink; }       });	} });