close
Jump to content

User:Oshwah/QuickBlockScript.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Amend success message, fixed punctuation.
Add code to skip displaying checkuser block options if the user is not a CU.
Line 9: Line 9:
blockReason = "[[WP:DE|Disruptive editing]]",
blockReason = "[[WP:DE|Disruptive editing]]",
blockSummary = "You have been blocked temporarily from editing for [[WP:Disruptive editing|abuse of editing privileges]].",
blockSummary = "You have been blocked temporarily from editing for [[WP:Disruptive editing|abuse of editing privileges]].",
checkuserCheck = mw.config.get('wgUserGroups').includes('checkuser'),
api = new mw.Api();
api = new mw.Api();
Line 35: Line 36:


//{{CU}} SOCK BLOCK (SILENT)
//{{CU}} SOCK BLOCK (SILENT)
if (checkuserCheck) {
mw.util.addPortletLink('p-cactions', 'javascript:void(0)', '{{CU}} SOCK BLOCK (S)', 'ca-qbs-cusockblock', 'Execute CHECKUSER BLOCK (indefinitely) on current account.');
mw.util.addPortletLink('p-cactions', 'javascript:void(0)', '{{CU}} SOCK BLOCK (S)', 'ca-qbs-cusockblock', 'Execute CHECKUSER BLOCK (indefinitely) on current account.');
$('#ca-qbs-cusockblock').on('click', function() {
$('#ca-qbs-cusockblock').on('click', function() {
if (confirm('This script will CHECKUSER block the user as a SOCK PUPPET ACCOUNT, and will NOT notify the user.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
if (confirm('This script will CHECKUSER block the user as a SOCK PUPPET ACCOUNT, and will NOT notify the user.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
$('#ca-qbs-cusockblock').text('Please wait...');
$('#ca-qbs-cusockblock').text('Please wait...');
prepForBlock(2,0,0,1,'checkuserblock-account','indefinite');
prepForBlock(2,0,0,1,'checkuserblock-account','indefinite');
}
});
}
});
}
//{{CU}} SOCK BLOCK (REVOKE TPA, EMAIL) (SILENT)
//{{CU}} SOCK BLOCK (REVOKE TPA, EMAIL) (SILENT)
if (checkuserCheck) {
mw.util.addPortletLink('p-cactions', 'javascript:void(0)', '{{CU}} SOCK BLOCK (NT, NE, S)', 'ca-qbs-cusockblock-ntnes', 'Execute CHECKUSER BLOCK (indefinitely) on current account.');
mw.util.addPortletLink('p-cactions', 'javascript:void(0)', '{{CU}} SOCK BLOCK (NT, NE, S)', 'ca-qbs-cusockblock-ntnes', 'Execute CHECKUSER BLOCK (indefinitely) on current account.');
$('#ca-qbs-cusockblock-ntnes').on('click', function() {
$('#ca-qbs-cusockblock-ntnes').on('click', function() {
if (confirm('This script will CHECKUSER block the user as a SOCK PUPPET ACCOUNT and WITH EMAIL AND TPA REVOKED, and will NOT notify the user.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
if (confirm('This script will CHECKUSER block the user as a SOCK PUPPET ACCOUNT and WITH EMAIL AND TPA REVOKED, and will NOT notify the user.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
$('#ca-qbs-cusockblock-ntnes').text('Please wait...');
$('#ca-qbs-cusockblock-ntnes').text('Please wait...');
prepForBlock(2,0,1,1,'checkuserblock-account','indefinite');
prepForBlock(2,0,1,1,'checkuserblock-account','indefinite');
}
});
}
});
}
//ABUSING MULTIPLE ACCOUNTS
//ABUSING MULTIPLE ACCOUNTS
Line 71: Line 76:
//VANDALISM (36H - SILENT)
//VANDALISM (36H - SILENT)
mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'VANDALISM - 36H (S)', 'ca-qbs-ipvandalblocksilent', 'Execute vandalism block (36 hours) on current user, but do not leave a talk page notice (SILENT).');
mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'VANDALISM - 36H (S)', 'ca-qbs-ipvandalblocksilent', 'Execute vandalism block (36 hours) on current user without leave a talk page notice (SILENT).');
$('#ca-qbs-ipvandalblocksilent').on('click', function() {
$('#ca-qbs-ipvandalblocksilent').on('click', function() {
if (confirm('This script will block the user for VANDALISM for 36 HOURS and WITHOUT leaving a block notice.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
if (confirm('This script will block the user for VANDALISM for 36 HOURS and WITHOUT leaving a block notice.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
Line 227: Line 232:


//SPAMBOT BLOCK (CU)
//SPAMBOT BLOCK (CU)
if (checkuserCheck) {
mw.util.addPortletLink('p-cactions', 'javascript:void(0)', '{{CU}} SPAMBOT', 'ca-qbs-cuspambotblock', 'Execute CHECKUSER block on account as a confirmed SPAMBOT.');
mw.util.addPortletLink('p-cactions', 'javascript:void(0)', '{{CU}} SPAMBOT', 'ca-qbs-cuspambotblock', 'Execute CHECKUSER block on account as a confirmed SPAMBOT.');
$('#ca-qbs-cuspambotblock').on('click', function() {
$('#ca-qbs-cuspambotblock').on('click', function() {
if (confirm('This script will block the user as a SPAMBOT and AS A CHECKUSER BLOCK, and will NOT notify the user.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
if (confirm('This script will block the user as a SPAMBOT and AS A CHECKUSER BLOCK, and will NOT notify the user.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
$('#ca-qbs-cuspambotblock').text('Please wait...');
$('#ca-qbs-cuspambotblock').text('Please wait...');
prepForBlock(17,0,1,1,'checkuserblock-account','indefinite');
prepForBlock(17,0,1,1,'checkuserblock-account','indefinite');
}
});
}
});
}
//G11 DELETION
//G11 DELETION

Revision as of 06:44, 24 July 2026

//<nowiki>
$(function() {
	let namespace = mw.config.get('wgNamespaceNumber'),
	pageName = mw.config.get('wgPageName'),
	myUserName = mw.config.get('wgUserName'),
	targetUserName = mw.config.get('wgRelevantUserName'),
	blockTemplateName = "uw-block",
	blockTemplate = "{{subst:" + blockTemplateName + "|time=36 hours|sig=yes}}",
	blockReason = "[[WP:DE|Disruptive editing]]",
	blockSummary = "You have been blocked temporarily from editing for [[WP:Disruptive editing|abuse of editing privileges]].",
	checkuserCheck = mw.config.get('wgUserGroups').includes('checkuser'),
	api = new mw.Api();
	
	mw.loader.using( ['mediawiki.util'], function() {
		if([-1,0,2,3].indexOf(namespace) !== -1 && myUserName != targetUserName && targetUserName != null) {
			
			//ADD LINKS TO THE "MORE" MENU TO BE CLICKED ON, AND ADD BENEATH IT THE CLICK ACTIONS THAT FOLLOW.
			
			//SOCK BLOCK (SILENT)
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'SOCK BLOCK (S)', 'ca-qbs-sockblock', 'Execute SOCK BLOCK on current user account with talk page notice.');
			$('#ca-qbs-sockblock').on('click', function() {
				if (confirm('This script will block the user as a SOCK PUPPET ACCOUNT.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-sockblock').text('Please wait...');
					prepForBlock(1,0,0,1,'uw-sockblock','indefinite');
				}
			});
			
			//SOCK BLOCK (REVOKE TPA, EMAIL) (SILENT)
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'SOCK BLOCK (NT, NE, S)', 'ca-qbs-sockblock-ntnes', 'Execute SOCK BLOCK on current user account, revoke talk page access and email, and with no talk page notice (SILENT).');
			$('#ca-qbs-sockblock-ntnes').on('click', function() {
				if (confirm('This script will block the user as a SOCK PUPPET ACCOUNT and WITH EMAIL AND TPA REVOKED, and will NOT notify the user.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-sockblock-ntnes').text('Please wait...');
					prepForBlock(1,0,1,1,'uw-sockblock','indefinite');
				}
			});

			//{{CU}} SOCK BLOCK (SILENT)
			if (checkuserCheck) {
				mw.util.addPortletLink('p-cactions', 'javascript:void(0)', '{{CU}} SOCK BLOCK (S)', 'ca-qbs-cusockblock', 'Execute CHECKUSER BLOCK (indefinitely) on current account.');
				$('#ca-qbs-cusockblock').on('click', function() {
					if (confirm('This script will CHECKUSER block the user as a SOCK PUPPET ACCOUNT, and will NOT notify the user.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
						$('#ca-qbs-cusockblock').text('Please wait...');
						prepForBlock(2,0,0,1,'checkuserblock-account','indefinite');
					}
				});
			}
			
			//{{CU}} SOCK BLOCK (REVOKE TPA, EMAIL) (SILENT)
			if (checkuserCheck) {
				mw.util.addPortletLink('p-cactions', 'javascript:void(0)', '{{CU}} SOCK BLOCK (NT, NE, S)', 'ca-qbs-cusockblock-ntnes', 'Execute CHECKUSER BLOCK (indefinitely) on current account.');
				$('#ca-qbs-cusockblock-ntnes').on('click', function() {
					if (confirm('This script will CHECKUSER block the user as a SOCK PUPPET ACCOUNT and WITH EMAIL AND TPA REVOKED, and will NOT notify the user.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
						$('#ca-qbs-cusockblock-ntnes').text('Please wait...');
						prepForBlock(2,0,1,1,'checkuserblock-account','indefinite');
					}
				});
			}
			
			//ABUSING MULTIPLE ACCOUNTS
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'ABUSING MULTIPLE ACCOUNTS', 'ca-qbs-abusingaccblock', 'Execute ABUSING MULTIPLE ACCOUNTS block on current user account.');
			$('#ca-qbs-abusingaccblock').on('click', function() {
				if (confirm('This script will block the user as a ACCOUNT ABUSING OTHER ACCOUNTS and will NOT notify the user.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-abusingaccblock').text('Please wait...');
					prepForBlock(3,1,0,1,'uw-abusingaccblock','indefinite');
				}
			});
			
			//VANDALISM (36H)
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'VANDALISM - 36H', 'ca-qbs-ipvandalblock', 'Execute vandalism block (36 hours) on current user.');
			$('#ca-qbs-ipvandalblock').on('click', function() {
				if (confirm('This script will block the user for VANDALISM for 36 HOURS.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-ipvandalblock').text('Please wait...');
					prepForBlock(4,1,0,0,'uw-vblock','36 hours');
				}
			});
			
			//VANDALISM (36H - SILENT)
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'VANDALISM - 36H (S)', 'ca-qbs-ipvandalblocksilent', 'Execute vandalism block (36 hours) on current user without leave a talk page notice (SILENT).');
			$('#ca-qbs-ipvandalblocksilent').on('click', function() {
				if (confirm('This script will block the user for VANDALISM for 36 HOURS and WITHOUT leaving a block notice.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-ipvandalblocksilent').text('Please wait...');
					prepForBlock(4,0,0,0,'uw-vblock','36 hours');
				}
			});	

			//VANDALISM (INDEF)
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'VANDALISM - INDEF', 'ca-qbs-indefvandalblock', 'Execute indefinite vandalism block on current user.');
			$('#ca-qbs-indefvandalblock').on('click', function() {
				if (confirm('This script will block the user for VANDALISM INDEFINITELY.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-indefvandalblock').text('Please wait...');
					prepForBlock(4,1,0,0,'uw-vblock','indefinite');
				}
			});
			
			//VANDALISM (INDEF - SILENT)
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'VANDALISM - INDEF (S)', 'ca-qbs-indefvandalblocksilent', 'Execute indefinite vandalism block on current user, but do not leave a talk page notice (SILENT).');
			$('#ca-qbs-indefvandalblocksilent').on('click', function() {
				if (confirm('This script will block the user for VANDALISM INDEFINITELY and WITHOUT leaving a block notice.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-indefvandalblocksilent').text('Please wait...');
					prepForBlock(4,0,0,0,'uw-vblock','indefinite');
				}
			});

			//BLOCK EVASION
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'BLOCK EVASION', 'ca-qbs-evadeblock', 'Execute indefinite EVASION BLOCK on current user.');
			$('#ca-qbs-evadeblock').on('click', function() {
				if (confirm('This script will block the user for BLOCK EVASION INDEFINITELY and WITHOUT leaving a talk page block notice.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-evadeblock').text('Please wait...');
					prepForBlock(5,0,0,0,'Uw-ipevadeblock','indefinite');
				}
			});

			//BLOCK EVASION (SILENT)
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'BLOCK EVASION (S)', 'ca-qbs-evadeblocksilent', 'Execute indefinite EVASION BLOCK on current user, but do not leave a talk page notice (SILENT).');
			$('#ca-qbs-evadeblocksilent').on('click', function() {
				if (confirm('This script will block the user for BLOCK EVASION INDEFINITELY and WITHOUT leaving a talk page block notice.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-evadeblocksilent').text('Please wait...');
					prepForBlock(5,0,0,0,'Uw-ipevadeblock','indefinite');
				}
			});
			
			//VANDALISM-ONLY ACCOUNT
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'VOA BLOCK', 'ca-qbs-voablock', 'Execute VOA block on current user account.');
			$('#ca-qbs-voablock').on('click', function() {
				if (confirm('This script will apply a VOA BLOCK on the account.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-voablock').text('Please wait...');
					prepForBlock(6,1,0,0,'uw-voablock','indefinite');
				}
			});
			
			//VANDALISM-ONLY ACCOUNT (SILENT)
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'VOA BLOCK (S)', 'ca-qbs-voablocksilent', 'Execute VOA block on current user account, but do not leave a talk page notice (SILENT).');
			$('#ca-qbs-voablocksilent').on('click', function() {
				if (confirm('This script will apply a VOA BLOCK on the account and WITHOUT leaving a block notice.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-voablocksilent').text('Please wait...');
					prepForBlock(6,0,0,0,'uw-voablock','indefinite');
				}
			});

			//WP:NOTHERE
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'WP:NOTHERE Block', 'ca-qbs-nothereblock', 'Execute WP:NOTHERE block on current user account.');
			$('#ca-qbs-nothereblock').on('click', function() {
				if (confirm('This script will apply a WP:NOTHERE BLOCK on the account.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-nothereblock').text('Please wait...');
					prepForBlock(7,1,0,0,'uw-nothereblock','indefinite');
				}
			});
			
			//BLOCKED PROXY
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', '{{blocked proxy}}', 'ca-qbs-proxyblock', 'Execute PROXY block (3 months) on current IP user (SILENT).');
			$('#ca-qbs-proxyblock').on('click', function() {
				if (confirm('This script will block the IP as a PROXY for THREE MONTHS and WITHOUT leaving a block notice.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-proxyblock').text('Please wait...');
					prepForBlock(8,0,0,1,'uw-proxyblock','3 months');
				}
			});
				
			//DISRUPTION (36H)
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'DISRUPTION - 36H', 'ca-qbs-disruptionblock', 'Execute disruptive editing block (36 hours) on current user.');
			$('#ca-qbs-disruptionblock').on('click', function() {
				if (confirm('This script will block the user for DISRUPTIVE EDITING for 36 HOURS.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-disruptionblock').text('Please wait...');
					prepForBlock(9,1,0,0,'uw-disruptblock','36 hours');
				}
			});
			
			//UPOL BLOCK - SOFT
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'UPOL Block - Soft', 'ca-qbs-upolsoftblock', 'Execute UPOL soft block (IP auto-block disabled) on current user account.');
			$('#ca-qbs-upolsoftblock').on('click', function() {
				if (confirm('This script will apply a soft block on the account per UPOL.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-upolsoftblock').text('Please wait...');
					prepForBlock(10,1,0,0,'Uw-ublock','indefinite');
				}
			});
			
			//UPOL BLOCK - HARD
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'UPOL Block - HARD', 'ca-qbs-upolhardblock', 'Execute UPOL HARD block on current user account.');
			$('#ca-qbs-upolhardblock').on('click', function() {
				if (confirm('This script will apply a HARD BLOCK on the account per obvious UPOL.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-upolhardblock').text('Please wait...');
					prepForBlock(11,1,0,0,'Uw-uhblock','indefinite');
				}
			});
			
			//UPOL BLOCK - ABUSE (SILENT)
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'UPOL Block - ABUSE', 'ca-qbs-upolabuseblock', 'Execute UPOL ABUSE block on current user (similar to \'UPOL Block - HARD\' but SILENT).');
			$('#ca-qbs-upolabuseblock').on('click', function() {
				if (confirm('This will HARD BLOCK the username per LTA/ABUSIVE/LIBELOUS UPOL and LEAVE NO TEMPLATE OR NOTICE.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-upolabuseblock').text('Please wait...');
					prepForBlock(11,0,0,0,'Uw-uhblock','indefinite');
				}
			});			
			
			//UPOL BLOCK - VOA
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'UPOL Block - VOA', 'ca-qbs-upolvoablock', 'Execute UPOL and VOA ({{uw-vaublock}}) block on current user account.');
			$('#ca-qbs-upolvoablock').on('click', function() {
				if (confirm('This will apply a block on the account as a UPOL violation that\'s ALSO a VOA.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('#ca-qbs-upolvoablock').text('Please wait...');
					prepForBlock(12,1,0,0,'uw-vaublock','indefinite');
				}
			});
		
			//IF THE CURRENT PAGE IS A PAGE THAT CAN BE DELETED, EXECUTE THE FUNCTIONS TO SHOW THE OTHER "DELETE AND BLOCK" OPTIONS
			if([0,2,3].indexOf(namespace) !== -1 && myUserName != targetUserName && targetUserName != null) {
				
				//PROMO BLOCK - HARD
				mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'Promo Block - HARD', 'ca-qbs-promohardblock', 'Execute Promo HARD block on current user');
				$('#ca-qbs-promohardblock').on('click', function() {
					if (confirm('This script delete the current page and apply a HARD BLOCK on the account as a promotional username with promotional edits.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
						$('#ca-qbs-promohardblock').text('Please wait...');
						prepForBlock(14,1,0,0,'uw-spamublock','indefinite');
					}
				});
				
				//SPAM ADVERTISING ONLY ACCOUNT
				mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'Spam / Ad-only Block', 'ca-qbs-soablock', 'Execute spam / advertising-only block on current user');
				$('#ca-qbs-soablock').on('click', function() {
					if (confirm('This script will delete the current page and apply a BLOCK on the account as spam / advertising-only.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
						$('#ca-qbs-soablock').text('Please wait...');
						prepForBlock(15,1,0,0,'uw-soablock','indefinite');
					}
				});
				
				//SPAMBOT BLOCK
				mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'SPAMBOT', 'ca-qbs-spambotblock', 'Execute SPAMBOT block on current user.');
				$('#ca-qbs-spambotblock').on('click', function() {
					if (confirm('This script will delete the page and block the user as a SPAMBOT and revoke TPA and leave NO NOTICE.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
						$('#ca-qbs-spambotblock').text('Please wait...');
						prepForBlock(16,0,1,1,'uw-spamublock','indefinite');
					}
				});

				//SPAMBOT BLOCK (CU)
				if (checkuserCheck) {
					mw.util.addPortletLink('p-cactions', 'javascript:void(0)', '{{CU}} SPAMBOT', 'ca-qbs-cuspambotblock', 'Execute CHECKUSER block on account as a confirmed SPAMBOT.');
					$('#ca-qbs-cuspambotblock').on('click', function() {
						if (confirm('This script will block the user as a SPAMBOT and AS A CHECKUSER BLOCK, and will NOT notify the user.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
							$('#ca-qbs-cuspambotblock').text('Please wait...');
							prepForBlock(17,0,1,1,'checkuserblock-account','indefinite');
						}
					});
				}
				
				//G11 DELETION
				mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'G11 DELETION', 'ca-qbs-g11delete', 'Execute deletion per G11 on current page.');
				$('#ca-qbs-g11delete').on('click', function() {
					if (confirm('This script will delete the current page per G11 and leave NO NOTICE.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
						$('#ca-qbs-g11delete').text('Please wait...');
						//prepForBlock(19,'',''); This would normally be called, but since this is only deleting a page, we call the deletion function directly instead.
						deleteUserPageG11();
					}
				});
				
				//G10 DELETION
				mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'G10 DELETION', 'ca-qbs-g10delete', 'Execute deletion per G10 on current page.');
				$('#ca-qbs-g10delete').on('click', function() {
					if (confirm('This script will delete the current page per G10 (ATTACK PAGE) and leave NO NOTICE.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
						$('#ca-qbs-g10delete').text('Please wait...');
						//prepForBlock(19,'',''); This would normally be called, but since this is only deleting a page, we call the deletion function directly instead.
						deleteUserPageG10();
					}
				});
			}
			
			//SALEBOT1 LTA BLOCK
			mw.util.addPortletLink('p-cactions', 'javascript:void(0)', 'SALEBOT1 LTA BLOCK', 'ca-qbs-salebot1block', 'Execute block on account as a sock of Salebot1.');
			$('#ca-qbs-salebot1block').on('click', function() {
				if (confirm('This script will block the account and as a sock of Salebot1. NO NOTICE IS LEFT.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {
					$('ca-qbs-salebot1block').text('Please wait...');
					prepForBlock(18,0,0,0,'uw-sockblock','indefinite');
				}
			});
		}
	});
	
	function prepForBlock(blockID,templateUser,revokeTalkAndEmail,overwriteExistingBlock,blockTemplateGivenName,blockDuration) {
		let blockDurationParameter = 'time='+blockDuration;
		
		if(blockDuration=='indefinite') {
			blockDurationParameter = 'indef=yes';
		}
		
		if(blockTemplateGivenName!='') {
			blockTemplateName = blockTemplateGivenName;
			blockTemplate = "{{subst:"+blockTemplateName+"|"+blockDurationParameter+"|sig=yes}}";
		}
		
		switch (blockID) {
			case 1:
				blockReason = '[[WP:BADSOCK|Sock puppetry]]';
				blockSummary = 'You have been blocked from editing for [[WP:BADSOCK|abusing multiple accounts]].';
				break;
			case 2:
				blockReason = '{{checkuserblock-account}} <!-- [[WP:BADSOCK|Sock puppetry]]. -->';
				blockSummary = 'You have been blocked from editing for [[WP:BADSOCK|abusing multiple accounts]].';
				break;
			case 3:
				blockReason = '[[WP:BADSOCK|Abusing multiple accounts]]';
				blockSummary = 'You have been blocked from editing for [[WP:BADSOCK|abusing multiple accounts]].';
				break;
			case 4:
				blockReason = '[[WP:Vandalism|Vandalism]]';
				blockSummary = 'You have been blocked from editing for persistent [[WP:Vandalism|vandalism]].';
				blockUserIP(templateUser,blockDuration);
				break;
			case 5:
				blockReason = '[[WP:EVADE|Block evasion]]';
				blockSummary = 'You have been blocked from editing for engaging in [[WP:EVADE|block evasion]].';
				blockUserIP(templateUser,blockDuration);
				break;
			case 6:
				blockReason = '[[WP:Vandalism-only account|Vandalism-only account]]';
				blockSummary = 'You have been indefinitely blocked from editing because your account is being [[WP:VOA|used only for vandalism]].';
				break;
			case 7:
				blockReason = 'Clearly [[WP:NOTHERE|not here to contribute to the encyclopedia]]';
				blockSummary = 'You have been indefinitely blocked from editing because it appears that you are not here to [[WP:NOTHERE|build an encyclopedia]].';
				break;
			case 8:
				blockReason = '{{blocked proxy}}';
				//blockSummary = '';
				blockUserIPProxy();
				break;
			case 9:
				blockReason = '[[WP:Disruptive editing|Disruptive editing]]';
				blockSummary = 'You have been blocked from editing for [[WP:DE|disruptive editing]].';
				blockUserIP(templateUser,blockDuration);
				break;
			case 10:
				blockReason = '{{uw-ublock}} <!-- Username violation, soft block -->';
				blockSummary = 'Your account has been blocked from editing Wikipedia with this username because it does not meet our [[WP:UPOL|username policy]].';
				blockUserSoft(templateUser,blockDuration);
				break;
			case 11:
				blockReason = '{{uw-uhblock}} <!-- Username violation, hard block -->';
				blockSummary = 'Your account has been blocked indefinitely because the chosen username is a clear violation of our [[WP:UPOL|username policy]].';
				break;
			case 12:
				blockReason = '{{uw-vaublock}} <!-- Username violation, vandalism-only account -->';
				blockSummary = 'You have been indefinitely blocked from editing because your account is being [[WP:VOA|used only for vandalism]] and your username is a blatant violation of the [[WP:UPOL|username policy]].';
				break;
			//case 13:
				//blockReason = '{{uw-softerblock}} <!-- Promotional username, soft block -->';
				//blockSummary = 'You have been indefinitely blocked from editing because your [[WP:UPOL|username]] gives the impression that the account represents a group, organization or website.';
				//blockUserSoft(templateUser,blockDuration);
				//break;
			case 14:
				blockReason = '{{uw-spamublock}} <!-- Promotional username, promotional edits -->';
				blockSummary = 'You have been indefinitely blocked from editing because your account is being used only for [[WP:SPAM|spam or advertising]] and your username is a violation of the [[WP:U|username policy]].';
				deleteUserPageG11();
				break;
			case 15:
				blockReason = '[[WP:Spam|Spam]] / [[WP:NOTADVERTISING|advertising]]-only account';
				blockSummary = 'You have been indefinitely blocked from editing because your account is being used only for [[WP:SPAM|spam, advertising, or promotion]].';
				deleteUserPageG11();
				break;
			case 16:
				blockReason = 'Spambot.';
				//blockSummary = '';
				deleteUserPageG11();
				break;
			case 17:
				blockReason = '{{checkuserblock-account}} <!-- [[WP:SPAMBOT|Spambot]]. -->';
				//blockSummary = '';
				deleteUserPageG11();
				break;
			case 18:
				blockReason = 'Abusing [[WP:Sockpuppetry|multiple accounts]] <!-- Salebot1. -->';
				break;
			default:
				//TODO: CREATE DEFAULT CASE.
				break;
		}
		if (blockID != 4 && blockID != 5 && blockID != 8 && blockID !=9 && blockID != 10 && blockID != 13) {
			switch (overwriteExistingBlock) {
				case 0:
					switch (revokeTalkAndEmail) {
						case 0:
							blockUser(templateUser,blockDuration);
							break;
						case 1:
							blockUserNoTalkNoEmail(templateUser,blockDuration);
							break;
						default:
							blockUser(templateUser,blockDuration);
							break;
					}
					break;
				case 1:
					switch (revokeTalkAndEmail) {
						case 0:
							reblockUser(templateUser,blockDuration);
							break;
						case 1:
							reblockUserNoTalkNoEmail(templateUser,blockDuration);
							break;
						default:
							reblockUser(templateUser,blockDuration);
							break;
					}
					break;
				default:
					switch (revokeTalkAndEmail) {
						case 0:
							blockUser(templateUser,blockDuration);
							break;
						case 1:
							blockUserNoTalkNoEmail(templateUser,blockDuration);
							break;
						default:
							blockUser(templateUser,blockDuration);
							break;
					}
					break;
			}
		}
	}
  
	function blockUser(templateBool,templateDuration) {
		api.postWithToken("block", {
			action: 'block',
			expiry: templateDuration,
			allowusertalk: true,
			noemail: false,
			autoblock: true,
			nocreate: true,
			reason: blockReason,
			watchuser: false,
			user: targetUserName
		}).then(function() {
			$("#mw-content-text").append(
				"<p><b>Success</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a> (account creation blocked) with an expiry time of " + templateDuration + " <i>(<span id='blocked-reason'></span>)</i>.</p>"
			);
			$('<span/>').text(blockReason).appendTo("#blocked-reason");
			if(templateBool == 1) {
				addTemplateUserTalk();
			}
		}, function(error) {
			$("#mw-content-text").append(
				"<p><b>Error</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a>. Error message: " + error + ".</p>"
			);
		});
	}

	function reblockUser(templateBool,templateDuration) {
		api.postWithToken("block", {
			action: 'block',
			reblock: 1,
			expiry: templateDuration,
			allowusertalk: true,
			noemail: false,
			autoblock: true,
			nocreate: true,
			reason: blockReason,
			watchuser: false,
			user: targetUserName
		}).then(function() {
			$("#mw-content-text").append(
				"<p><b>Success</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a> (account creation blocked) with an expiry time of " + templateDuration + " <i>(<span id='blocked-reason'></span>)</i>.</p>"
			);
			$('<span/>').text(blockReason).appendTo("#blocked-reason");
			if(templateBool == 1) {
				addTemplateUserTalk();
			}
		}, function(error) {
			$("#mw-content-text").append(
				"<p><b>Error</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a>. Error message: " + error + ".</p>"
			);
		});
	}

	function blockUserSoft(templateBool,templateDuration) {
		api.postWithToken("block", {
			action: 'block',
			expiry: templateDuration,
			allowusertalk: true,
			noemail: false,
			anononly: false,
			autoblock: false,
			nocreate: false,
			reason: blockReason,
			watchuser: false,
			user: targetUserName
		}).then(function() {
			$("#mw-content-text").append(
				"<p><b>Success</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a> (autoblock disabled) with an expiry time of " + templateDuration + " <i>(<span id='blocked-reason'></span>)</i>.</p>"
			);
			$('<span/>').text(blockReason).appendTo("#blocked-reason");
			if(templateBool == 1) {
				addTemplateUserTalk();
			}
		}, function(error) {
			$("#mw-content-text").append(
				"<p><b>Error</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a>. Error message: " + error + ".</p>"
			);
		});
	}

	/*function blockUserNoTalk(templateBool,templateDuration) {
		api.postWithToken("block", {
			action: 'block',
			expiry: templateDuration,
			allowusertalk: false,
			noemail: false,
			autoblock: true,
			nocreate: true,
			reason: blockReason,
			watchuser: false,
			user: targetUserName
		}).then(function() {
			$("#mw-content-text").append(
				"<p><b>Success</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a> (account creation blocked, cannot edit own talk page) with an expiry time of " + templateDuration + " <i>(<span id='blocked-reason'></span>)</i>.</p>"
			);
			$('<span/>').text(blockReason).appendTo("#blocked-reason");
			if(templateBool == 1) {
				addTemplateUserTalk();
			}
		}, function(error) {
			$("#mw-content-text").append(
				"<p><b>Error</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a>. Error message: " + error + ".</p>"
			);
		});
	}*/
  
	function blockUserNoTalkNoEmail(templateBool,templateDuration) {
		api.postWithToken("block", {
			action: 'block',
			expiry: templateDuration,
			allowusertalk: false,
			noemail: true,
			autoblock: true,
			nocreate: true,
			reason: blockReason,
			watchuser: false,
			user: targetUserName
		}).then(function() {
			$("#mw-content-text").append(
				"<p><b>Success</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a> (account creation blocked, email disabled, cannot edit own talk page) with an expiry time of " + templateDuration + " <i>(<span id='blocked-reason'></span>)</i>.</p>"
			);
			$('<span/>').text(blockReason).appendTo("#blocked-reason");
			if(templateBool == 1) {
				addTemplateUserTalk();
			}
		}, function(error) {
			$("#mw-content-text").append(
				"<p><b>Error</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a>. Error message: " + error + ".</p>"
			);
		});
	}

	function reblockUserNoTalkNoEmail(templateBool,templateDuration) {
		api.postWithToken("block", {
			action: 'block',
			reblock: 1,
			expiry: templateDuration,
			allowusertalk: false,
			noemail: true,
			autoblock: true,
			nocreate: true,
			reason: blockReason,
			watchuser: false,
			user: targetUserName
		}).then(function() {
			$("#mw-content-text").append(
				"<p><b>Success</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a> (account creation blocked, email disabled, cannot edit own talk page) with an expiry time of " + templateDuration + " <i>(<span id='blocked-reason'></span>)</i>.</p>"
			);
			$('<span/>').text(blockReason).appendTo("#blocked-reason");
			if(templateBool == 1) {
				addTemplateUserTalk();
			}
		}, function(error) {
			$("#mw-content-text").append(
				"<p><b>Error</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a>. Error message: " + error + ".</p>"
			);
		});
	}

	function blockUserIP(templateBool,templateDuration) {
		api.postWithToken("block", {
			action: 'block',
			expiry: templateDuration,
			allowusertalk: true,
			noemail: false,
			anononly: true,
			autoblock: true,
			nocreate: true,
			reason: blockReason,
			watchuser: false,
			user: targetUserName
		}).then(function() {
			$("#mw-content-text").append(
				"<p><b>Success</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a> (anon. only, account creation blocked) with an expiry time of " + templateDuration + " <i>(<span id='blocked-reason'></span>)</i>.</p>"
			);
			$('<span/>').text(blockReason).appendTo("#blocked-reason");
			if(templateBool == 1) {
				addTemplateUserTalk();
			}
		}, function(error) {
			$("#mw-content-text").append(
				"<p><b>Error</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a>. Error message: " + error + ".</p>"
			);
		});
	}

	function blockUserIPProxy() {
		api.postWithToken("block", {
			action: 'block',
			expiry: '3 months',
			allowusertalk: true,
			noemail: false,
			anononly: false,
			autoblock: true,
			nocreate: true,
			reason: blockReason,
			watchuser: false,
			user: targetUserName
		}).then(function() {
			$("#mw-content-text").append(
				"<p><b>Success</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a> (anon. only, account creation blocked) with an expiry time of 3 months <i>(<span id='blocked-reason'></span>)</i>.</p>"
			);
			$('<span/>').text(blockReason).appendTo("#blocked-reason");
		}, function(error) {
			$("#mw-content-text").append(
				"<p><b>Error</b> blocking <a href='"+mw.util.getUrl('User:'+targetUserName) + "'>" + targetUserName + "</a>. Error message: " + error + ".</p>"
			);
		});
	}
	
	function deleteUserPageG11() {
		api.postWithToken("delete", {
			action: 'delete',
			reason: '[[WP:G11|G11]]: Unambiguous [[Wikipedia:NOTADVERTISING|advertising]] or promotion',
			watchlist: false,
			title: pageName
		}).then(function() {
			$("#mw-content-text").append(
				"<p><b>Success</b> deleting page <a href='"+mw.util.getUrl(pageName) + "'>"+pageName+"</a> <i>(<a href='"+mw.util.getUrl('WP:G11') + "'>G11</a>: Unambiguous <a href='"+mw.util.getUrl('WP:NOTADVERTISING') + "'>advertising</a> or promotion)</i></p>"
			);
		},function(error) {
			$("#mw-content-text").append(
				"<p><b>Error</b> deleting page "+pageName+": " + error + "</p>"
			);
		});
	}
  
	function deleteUserPageG10() {
		api.postWithToken("delete", {
			action: 'delete',
			reason: '[[WP:G10|G10]]: [[WP:ATP|Attack page]] or negative unsourced [[WP:BLP|BLP]]',
			watchlist: false,
			title: pageName
		}).then(function() {
			$("#mw-content-text").append(
				"<p><b>Success</b> deleting page <a href='"+mw.util.getUrl(pageName) + "'>"+pageName+"</a> <i>(<a href='"+mw.util.getUrl('WP:G10') + "'>G10</a>: <a href='"+mw.util.getUrl('WP:ATP') + "'>Attack page</a> or negative unsourced <a href='"+mw.util.getUrl('WP:BLP') + "'>BLP</a>)</i></p>"
			);
		},function(error) {
			$("#mw-content-text").append(
				"<p><b>Error</b> deleting page "+pageName+": " + error + "</p>"
			);
		});
	}
  
	function addTemplateUserTalk() {
		let monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
		d = new Date();

		api.postWithToken( "edit", {
			action: "edit",
			section: 'new',
			watchlist: "unwatch",
			sectiontitle: monthNames[d.getMonth()] + ' ' + d.getFullYear(),
			summary: blockSummary,
			text: "\n"+blockTemplate,
			title: "User talk:"+targetUserName
		}).then(function() {
			$("#mw-content-text").append(
				"<p><b>Success</b> editing <a href='"+mw.util.getUrl('User talk:'+targetUserName) + "'>User talk:" + targetUserName + "</a>: Created new section with template " + blockTemplateName + ".</p>" +
				"<p><b>Complete (<a href='javascript:document.location.reload()'>reload page</a>)</b>.</p>"
			);
		},function(error) {
			$("#mw-content-text").append(
				"<p><b>Error</b> editing <a href='"+mw.util.getUrl('User talk:'+targetUserName) + "'>User talk:" + targetUserName + "</a>: " + error + ".</p>" +
				"<p><b>Completed with errors (<a href='javascript:document.location.reload()'>reload page</a>)</b>.</p>"
			);
		});
	}
});
//</nowiki>