User:Oshwah/QuickBlockScript.js

// $(function {	var namespace = mw.config.get('wgNamespaceNumber'),	pageName = mw.config.get('wgPageName'),	myUserName = mw.config.get('wgUserName'),	targetUserName = mw.config.get('wgRelevantUserName'),	blockTemplateName = "uw-block",	blockTemplate = "",	blockReason = "Disruptive editing",	blockSummary = "You have been blocked temporarily from editing for abuse of editing privileges.",	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)', 				'aca-sockblock', 'Execute SOCK BLOCK on current user account with talk page notice.'			); $('#aca-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?')) {					$('#aca-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)', 				'aca-sockblock-ntnes', 'Execute SOCK BLOCK on current user account, revoke talk page access and email, and with no talk page notice (SILENT).'			); $('#aca-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?')) {					$('#aca-sockblock-ntnes').text('Please wait...');					prepForBlock(1,0,1,1,'uw-sockblock','indefinite');				}			});

// SOCK BLOCK (SILENT) mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',				' SOCK BLOCK (S)', 				'aca-cusockblock', 'Execute CHECKUSER BLOCK (indefinitely) on current account.'			); $('#aca-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?')) {					$('#aca-cusockblock').text('Please wait...');					prepForBlock(2,0,0,1,'checkuserblock-account','indefinite');				}			}); // SOCK BLOCK (REVOKE TPA, EMAIL) (SILENT) mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',				' SOCK BLOCK (NT, NE, S)',				'aca-cusockblock-ntnes', 'Execute CHECKUSER BLOCK (indefinitely) on current account.'			); $('#aca-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?')) {					$('#aca-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',				'aca-abusingaccblock', 'Execute ABUSING MULTIPLE ACCOUNTS block on current user account.'			); $('#aca-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?')) {					$('#aca-abusingaccblock').text('Please wait...');					prepForBlock(3,1,0,1,'uw-abusingaccblock','indefinite');				}			}); //IP VANDALISM (36H) mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',				'VANDALISM - IP / 36H', 				'aca-ipvandalblock', 'Execute vandalism block (36 hours) on current user.'			); $('#aca-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?')) {					$('#aca-ipvandalblock').text('Please wait...');					prepForBlock(4,1,0,0,'uw-vblock','36 hours');				}			}); //IP VANDALISM (36H - SILENT) mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',					'VANDALISM - IP / 36H (S)', 				'aca-ipvandalblocksilent', 'Execute vandalism block (36 hours) on current user, but do not leave a talk page notice (SILENT).'			); $('#aca-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?')) {					$('#aca-ipvandalblocksilent').text('Please wait...');					prepForBlock(4,0,0,0,'uw-vblock','36 hours');				}			});

//IP EVASION BLOCK (36H) mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',				'EVASION BLOCK - IP (S)', 				'aca-evadeblock', 'Execute EVASION BLOCK (36 hours) on current IP user, but do not leave a talk page notice (SILENT).'			); $('#aca-evadeblock').on('click', function {				if (confirm('This script will block the IP for BLOCK EVASION for 36 HOURS and WITHOUT leaving a block notice.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {					$('#aca-evadeblock').text('Please wait...');					prepForBlock(5,0,0,0,'Uw-ipevadeblock','36 hours');				}			}); //VANDALISM-ONLY ACCOUNT mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',					'VOA BLOCK', 				'aca-voablock', 'Execute VOA block on current user account.'			); $('#aca-voablock').on('click', function {				if (confirm('This script will apply a VOA BLOCK on the account.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {					$('#aca-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)', 				'aca-voablocksilent', 'Execute VOA block on current user account, but do not leave a talk page notice (SILENT).'			); $('#aca-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?')) {					$('#aca-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', 				'aca-nothereblock', 'Execute WP:NOTHERE block on current user account.'			); $('#aca-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?')) {					$('#aca-nothereblock').text('Please wait...');					prepForBlock(7,1,0,0,'uw-nothereblock','indefinite');				}			}); //BLOCKED PROXY mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',				'', 				'aca-proxyblock', 'Execute PROXY block (3 months) on current IP user (SILENT).'			); $('#aca-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?')) {					$('#aca-proxyblock').text('Please wait...');					prepForBlock(8,0,0,1,'uw-proxyblock','3 months');				}			}); //IP DISRUPTION (36H) mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',					'DISRUPTION - IP / 36H', 				'aca-disruptionblock', 'Execute disruptive editing block (36 hours) on current user.'			); $('#aca-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?')) {					$('#aca-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', 				'aca-upolsoftblock', 'Execute UPOL soft block (IP auto-block disabled) on current user account.'			); $('#aca-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?')) {					$('#aca-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', 				'aca-upolhardblock', 'Execute UPOL HARD block on current user account.'			); $('#aca-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?')) {					$('#aca-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', 				'aca-upolabuseblock', 'Execute UPOL ABUSE block on current user (similar to \'UPOL Block - HARD\' but SILENT).'			); $('#aca-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?')) {					$('#aca-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', 				'aca-upolvoablock', 'Execute UPOL and VOA block on current user account.'			); $('#aca-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?')) {					$('#aca-upolvoablock').text('Please wait...');					prepForBlock(12,1,0,0,'uw-vaublock','indefinite');				}			});

//PROMO BLOCK - SOFT mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',					'Promo Block - Soft', 				'aca-promosoftblock', 'Execute promo soft block on current user account.'			); $('#aca-promosoftblock').on('click', function {				if (confirm('This will apply a soft block on the account as a promotional username.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {					$('#aca-promosoftblock').text('Please wait...');					prepForBlock(13,1,0,0,'uw-softerblock','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', 				'aca-promohardblock', 'Execute Promo HARD block on current user'			); $('#aca-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?')) {					$('#aca-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', 				'aca-soablock', 'Execute spam / advertising-only block on current user'			); $('#aca-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?')) {					$('#aca-soablock').text('Please wait...');					prepForBlock(15,1,0,0,'uw-soablock','indefinite');				}			}); ////IF THE CURRENT PAGE IS A PAGE THAT CAN BE DELETED, EXECUTE THE FUNCTION TO SHOW THE "DELETE AND BLOCK" OPTION FOR SPAMBOT //if([2].indexOf(namespace) !== -1 && myUserName != targetUserName && targetUserName != null) { //SPAMBOT BLOCK mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',					'SPAMBOT', 				'aca-spambotblock', 'Execute SPAMBOT block on current user.'			); $('#aca-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?')) {					$('#aca-spambotblock').text('Please wait...');					prepForBlock(16,0,1,1,'uw-spamublock','indefinite');				}			}); //}		}			//SPAMBOT BLOCK (CU) mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',					' SPAMBOT', 				'aca-cuspambotblock', 'Execute CHECKUSER block on account as a confirmed SPAMBOT.'			); $('#aca-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?')) {					$('#aca-cuspambotblock').text('Please wait...');					prepForBlock(17,0,1,1,'checkuserblock-account','indefinite');				}			}); //U5 DELETION mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',					'U5 DELETION', 				'aca-u5delete', 'Execute deletion per U5 on current page.'			); $('#aca-u5delete').on('click', function {				if (confirm('This script will delete the current page per U5 and leave NO NOTICE.\n\nARE YOU SURE YOU WANT TO PROCEED?')) {					$('#aca-u5delete').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.					deleteUserPageU5;				}			}); //G11 DELETION mw.util.addPortletLink(				'p-cactions', 'javascript:void(0)',					'G11 DELETION', 				'aca-g11delete', 'Execute deletion per G11 on current page.'			); $('#aca-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?')) {					$('#aca-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', 				'aca-g10delete', 'Execute deletion per G10 on current page.'			); $('#aca-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?')) {					$('#aca-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;				}			}); }	});	function prepForBlock(blockID,templateUser,revokeTalkAndEmail,overwriteExistingBlock,blockTemplateGivenName,blockDuration) {		var blockDurationParameter = 'time='+blockDuration;		if(blockDuration=='indefinite') {			blockDurationParameter = 'indef=yes';		}		if(blockTemplateGivenName!='') {			blockTemplateName = blockTemplateGivenName;			blockTemplate = ""+blockDurationParameter+"";		}		switch (blockID) {			case 1:				blockReason = 'Sock puppetry';				blockSummary = 'You have been blocked from editing for abusing multiple accounts.';				break;			case 2:				blockReason = ' ';				blockSummary = 'You have been blocked from editing for abusing multiple accounts.';				break;			case 3:				blockReason = 'Abusing multiple accounts';				blockSummary = 'You have been blocked from editing for abusing multiple accounts.'; break; case 4: blockReason = 'Vandalism'; blockSummary = 'You have been blocked from editing for persistent vandalism.'; blockUserIP(templateUser,blockDuration); break; case 5: blockReason = 'Block evasion'; blockSummary = 'Anonymous users from this IP address have been blocked temporarily from editing for block evasion.'; blockUserIP(templateUser,blockDuration); break; case 6: blockReason = 'Vandalism-only account'; blockSummary = 'You have been indefinitely blocked from editing because your account is being used only for vandalism.'; break; case 7: blockReason = 'Clearly not here to contribute to the encyclopedia'; blockSummary = 'You have been indefinitely blocked from editing because it appears that you are not here to build an encyclopedia.'; break; case 8: blockReason = ''; //blockSummary = ''; blockUserIPProxy; break; case 9: blockReason = 'Disruptive editing'; blockSummary = 'You have been blocked from editing for disruptive editing.'; blockUserIP(templateUser,blockDuration); break; case 10: blockReason = ' '; blockSummary = 'Your account has been blocked from editing Wikipedia with this username because it does not meet our username policy.'; blockUserSoft(templateUser,blockDuration); break; case 11: blockReason = ' '; blockSummary = 'Your account has been blocked indefinitely because the chosen username is a clear violation of our username policy.'; break; case 12: blockReason = ' '; blockSummary = 'You have been indefinitely blocked from editing because your account is being used only for vandalism and your username is a blatant violation of the username policy.'; break; case 13: blockReason = ' '; blockSummary = 'You have been indefinitely blocked from editing because your username gives the impression that the account represents a group, organization or website.'; blockUserSoft(templateUser,blockDuration); break; case 14: blockReason = ' '; blockSummary = 'You have been indefinitely blocked from editing because your account is being used only for spam or advertising and your username is a violation of the username policy.'; deleteUserPageG11; break; case 15: blockReason = 'Spam / advertising-only account'; blockSummary = 'You have been indefinitely blocked from editing because your account is being used only for spam, advertising, or promotion.'; deleteUserPageG11; break; case 16: blockReason = 'Spambot.'; //blockSummary = ''; deleteUserPageG11; break; case 17: blockReason = ' '; //blockSummary = ''; deleteUserPageG11; 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(blockData) {			$("#mw-content-text").append( " Blocked "+targetUserName+" (account creation blocked) with an expiry time of "+templateDuration+"  " );			$(' ').text(blockReason).appendTo("#blocked-reason");			if(templateBool == 1) {				addTemplateUserTalk;			}		}, function(error) {			$("#mw-content-text").append( " Error blocking "+targetUserName+": "+error+" " );		});	}

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(blockData) {			$("#mw-content-text").append( " Blocked "+targetUserName+" (account creation blocked) with an expiry time of "+templateDuration+"  " );			$(' ').text(blockReason).appendTo("#blocked-reason");			if(templateBool == 1) {				addTemplateUserTalk;			}		}, function(error) {			$("#mw-content-text").append( " Error blocking "+targetUserName+": "+error+" " );		});	}

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(blockData) {			$("#mw-content-text").append( " Blocked "+targetUserName+" (autoblock disabled) with an expiry time of "+templateDuration+"  " );			$(' ').text(blockReason).appendTo("#blocked-reason");			if(templateBool == 1) {				addTemplateUserTalk;			}		}, function(error) {			$("#mw-content-text").append( " Error blocking "+targetUserName+": "+error+" " );		});	}

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(blockData) {			$("#mw-content-text").append( " Blocked "+targetUserName+" (account creation blocked, cannot edit own talk page) with an expiry time of "+templateDuration+"  " );			$(' ').text(blockReason).appendTo("#blocked-reason");			if(templateBool == 1) {				addTemplateUserTalk;			}		}, function(error) {			$("#mw-content-text").append( " Error blocking "+targetUserName+": "+error+" " );		});	}	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(blockData) {			$("#mw-content-text").append( " Blocked <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+"  " );			$(' ').text(blockReason).appendTo("#blocked-reason");			if(templateBool == 1) {				addTemplateUserTalk;			}		}, function(error) {			$("#mw-content-text").append( " Error blocking <a href='"+mw.util.getUrl('User:'+targetUserName)+"'>"+targetUserName+"</a>: "+error+" " );		});	}

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(blockData) {			$("#mw-content-text").append( " Blocked <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+"  " );			$(' ').text(blockReason).appendTo("#blocked-reason");			if(templateBool == 1) {				addTemplateUserTalk;			}		}, function(error) {			$("#mw-content-text").append( " Error blocking <a href='"+mw.util.getUrl('User:'+targetUserName)+"'>"+targetUserName+"</a>: "+error+" " );		});	}

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(blockData) {			$("#mw-content-text").append( " Blocked <a href='"+mw.util.getUrl('User:'+targetUserName)+"'>"+targetUserName+"</a> (anon. only, account creation blocked) with an expiry time of "+templateDuration+"  " );			$(' ').text(blockReason).appendTo("#blocked-reason");			if(templateBool == 1) {				addTemplateUserTalk;			}		}, function(error) {			$("#mw-content-text").append( " Error blocking <a href='"+mw.util.getUrl('User:'+targetUserName)+"'>"+targetUserName+"</a>: "+error+" " );		});	}

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(blockData) {			$("#mw-content-text").append( " Blocked <a href='"+mw.util.getUrl('User:'+targetUserName)+"'>"+targetUserName+"</a> (anon. only, account creation blocked) with an expiry time of 3 months  " );			$(' ').text(blockReason).appendTo("#blocked-reason");		}, function(error) {			$("#mw-content-text").append( " Error blocking <a href='"+mw.util.getUrl('User:'+targetUserName)+"'>"+targetUserName+"</a>: "+error+" " );		});	}

function deleteUserPageU5 { api.postWithToken("delete", {			action: 'delete',			reason: 'U5: Misuse of Wikipedia as a web host',			watchlist: false,			title: pageName		}).then(function(deleteData) {			$("#mw-content-text").append( " Deleted page <a href='"+mw.util.getUrl(pageName)+"'>"+pageName+"</a> (<a href='"+mw.util.getUrl('WP:U5')+"'>U5</a>: <a href='"+mw.util.getUrl('WP:NOTWEBHOST')+"'>Misuse of Wikipedia as a web host</a>) " );		},function(error) {			$("#mw-content-text").append( " Error deleting page "+pageName+": "+error+" " );		});	}	function deleteUserPageG11 { api.postWithToken("delete", {			action: 'delete',			reason: 'G11: Unambiguous advertising or promotion',			watchlist: false,			title: pageName		}).then(function(deleteData) {			$("#mw-content-text").append( " Deleted page <a href='"+mw.util.getUrl(pageName)+"'>"+pageName+"</a> (<a href='"+mw.util.getUrl('WP:G11')+"'>G11</a>: Unambiguous <a href='"+mw.util.getUrl('WP:NOTADVERTISING')+"'>advertising</a> or promotion) " );		},function(error) {			$("#mw-content-text").append( " Error deleting page "+pageName+": "+error+" " );		});	}	function deleteUserPageG10 { api.postWithToken("delete", {			action: 'delete',			reason: 'G10: Attack page or negative unsourced BLP',			watchlist: false,			title: pageName		}).then(function(deleteData) {			$("#mw-content-text").append( " Deleted page <a href='"+mw.util.getUrl(pageName)+"'>"+pageName+"</a> (<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>) " );		},function(error) {			$("#mw-content-text").append( " Error deleting page "+pageName+": "+error+" " );		});	}	function addTemplateUserTalk { var 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(editData) {			$("#mw-content-text").append( " Edited <a href='"+mw.util.getUrl('User talk:'+targetUserName)+"'>User talk:"+targetUserName+"</a>: Created new section with template "+blockTemplateName+" " + " Complete (<a href='javascript:document.location.reload'>reload</a>) " );		},function(error) {			$("#mw-content-text").append( " Error editing <a href='"+mw.util.getUrl('User talk:'+targetUserName)+"'>User talk:"+targetUserName+"</a>: "+error+" " );		});	} }); //