User:Majora/common.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
window.AjaxDeleteExtraButtons = [
	{
		'label': 'Logo violation',
		'tag': '{'+'{Logo}}',
		'img_summary': 'Marking as possible [[Commons:Copyvio|copyright violation]] because this logo exceeds the [[COM:TOO|threshold of originality]] and therefore is subject to copyright.',
		'talk_tag': '{'+'{subst:copyvionote|1=%FILE%}}',
		'talk_summary': 'Notification of possible copyright violation for %FILE%',
	}, {
		'label': 'OTRS expired',
		'tag': '{'+'{subst:nopd}}',
		'img_summary': 'OTRS expired. Tagging for deletion',
		'talk_tag': '{'+'{subst:noticket|1=%FILE%}}',
		'talk_summary': 'Notification of OTRS pending expiry for %FILE%',
	}
	];
//<nowiki>

//vFCvFCCfg/////////////////////////////////////
/////// VISUAL FILE CHANGE CONFIGURATION ///////
///// DO NOT MODIFY BY HAND - FINGERS AWAY! ////
////////////////////////////////////////////////
window.vFCSettings = {"userNote":"Yours sincerely,","firstTest":0,"testEdits":0,"defaultAction":"del","watchlistUserTalk":"preferences","watchlistFiles":"watch","watchlistReplace":"nochange","watchlistOTRS":"nochange","loadBatchSize":100,"maxSimultaneousReq":5,"summaryChacheLen":5,"loadThumbs":true,"loadWikitext":true};
//////////////////////////////////vFCvFCCfgEnd//
//</nowiki>

importScript('User:Majora/LicenseReviewBeta.js');
mw.loader.load('https://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:MusikAnimal/confirmationRollback.js');

function fastIndef(event) {
	event.preventDefault();
	if (event.data.username == mw.config.get("wgUserName"))
	{
		alert('You can\'t block yourself!');
		return;
	}
	if (mw.util.isIPAddress (event.data.username) === true)
	{
		new mw.Api()
		.postWithToken( 'csrf', {
			"action": "block",
			"user": event.data.username,
			"expiry": "3 days",
			"reason": "Long-term abuse",
			"autoblock": 1,
			"nocreate": 1,
			"noemail": 0,
			"reblock": 1
		} );
		mw.notify( 'IP ' + event.data.username + ' was blocked for 3 days.' );
	}
	else
	{
		new mw.Api()
		.postWithToken( 'csrf', {
			"action": "block",
			"user": event.data.username,
			"expiry": "never",
			"reason": "Long-term abuse",
			"autoblock": 1,
			"nocreate": 1,
			"noemail": 1,
			"reblock": 1
		} );
		mw.notify( 'User ' + event.data.username + ' was indefinitely blocked.' );
	}
}

$('.mw-userlink').each(function() {
	$( this ).after(
		' ',
		$( '<span>' ).addClass( 'fastindeflink' )
		.append(
			'[',
			$( '<a>' ).attr( 'href', '#' )
			.text('LTA block')
			.click( { username: $(this).text() }, fastIndef ),
			']'
		)
	);
});