User:Gryllida/js/showNukeLinkInBlockPage.js

From Wikinews, the free news source you can write!
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac); IE: hold Ctrl while clicking Refresh, or press Ctrl-F5; Konqueror: simply click the Reload button, or press F5; Opera users may need to completely clear their cache in Tools→Preferences. — More skins

/* Author : Svetlana Tkachenko svetlana@members.fsf.org
This file is a part of showNukeLinkInBlockPage.js
Licence: GPLv3+
Description: [beta] shows a link to mass block at Special:Block page
See also <https://en.wikinews.org/wiki/User:Gryllida/Tasks>.
*/ 
// == 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){
	var a = $('<a></a>', {
		href: "http://en.wikinews.org/wiki/Special:Nuke/$1".replace('$1', mw.config.get( 'wgRelevantUserName' )),
		text: 'mass delete'
	});
	$('.mw-ipb-conveniencelinks').prepend(' | ');
	$('.mw-ipb-conveniencelinks').prepend(a);
}