User:JJPMaster/Scripts/masscat.js

This is an old revision of this page, as edited by JJPMaster (talk | contribs) at 16:30, 16 November 2024 (adapted from WP:MASSMOVE's script). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
var contentContent;

$(function() {
	if(mw.config.get("wgPageName").toLowerCase() == "special:masscat") {
		document.getElementById("firstHeading").innerText = "Mass categorizer";	
		
		contentContent.innerHTML = `'<form id="wpMassMove" name="wpMassMove">' +
			'<b>If you abuse this tool, it\'s <i>your</i> fault, not mine.</b>' +
			'<div id="wpMassMoveFailedContainer"></div>' +
			'<br /><br />' +
				'Pages to move (one on each line, please):<br />' +
					'<textarea tabindex="1" accesskey="," name="wpMassMovePages" id="wpMassMovePages" rows="10" cols="80" oninput="massMoveUpdatePreview()"></textarea>' +
				'<br /><br /><table style="background-color:transparent">' +
				'<tr><td>Apply <a href="' + (mw.config.get('wgServer')+mw.config.get('wgArticlePath')).replace('$1','Help:Pipe_trick') + '">"Pipe Trick"</a> to old name:</td>' +
					'<td colspan="5"><input type="checkbox" id="wpMassMovePipeTrick" name="wpMassMovePipeTrick"/ oninput="massMoveUpdatePreview()"></td></tr>' +
				'<tr><td class="mincol">Prefix to remove from the old name (e.g., Template:):</td>' +
					'<td class="mincol"><input type="text" id="wpMassMovePrefix1" name="wpMassMovePrefix1" maxlength="255"  oninput="massMoveUpdatePreview()"/></td>' +
					'<td class="maxcol">&nbsp;</td>' +
					'<td class="mincol">Prefix to add to the new name (e.g., User:Plastikspork/):</td>' +
					'<td class="mincol"><input type="text" id="wpMassMovePrefix2" name="wpMassMovePrefix2" maxlength="255"  oninput="massMoveUpdatePreview()"/></td>' +
					'<td class="maxcol">&nbsp;</td></tr>' +
				'<tr><td class="mincol">Suffix to remove from the old name (e.g., /sandbox):</td>' +
					'<td class="mincol"><input type="text" id="wpMassMoveSuffix1" name="wpMassMoveSuffix1" maxlength="255"  oninput="massMoveUpdatePreview()"/></td>' +
					'<td class="maxcol">&nbsp;</td>' +
					'<td class="mincol">Suffix to add to the new name (e.g., /Archive_1):</td>' +
					'<td class="mincol"><input type="text" id="wpMassMoveSuffix2" name="wpMassMoveSuffix2" maxlength="255"  oninput="massMoveUpdatePreview()"/></td>' +
					'<td class="maxcol">&nbsp;</td></tr>' +
				'<tr><td class="mincol">Move associated talk page:</td>' +
					'<td class="mincol"><input type="checkbox" id="wpMassMoveMoveTalk" name="wpMassMoveMoveTalk" checked/></td>' +
					'<td class="maxcol">&nbsp;</td>' +
					'<td class="mincol">Leave a redirect behind:</td>' +
					'<td class="mincol"><input type="checkbox" id="wpMassMoveLeaveRedirect" name="wpMassMoveLeaveRedirect" checked/></td></tr>' +
				'<tr><td class="mincol">Move subpages (up to 100):</td>' +
					'<td class="mincol"><input type="checkbox" id="wpMassMoveMoveSubPages" name="wpMassMoveMoveSubPages" checked/></td>' +	
					'<td class="maxcol">&nbsp;</td>' +
					'<td class="mincol">Ignore ratelimit (may cause errors):</td>' +
					'<td class="mincol"><input type="checkbox" id="wpMassMoveNoRatelimit" name="wpMassMoveNoRatelimit"/></td></tr>' +
				'<tr><td>Watch source page and target page:</td>' +
						'<td colspan="5"><select id="wpMassMoveWatch">' +
							'<option value="nochange">No change</option>' +
							'<option value="preferences">User preferences</option>' +
							'<option value="watch">Add to watch list</option>' +
							'<option value="unwatch">Remove from watch list</option>' +
						'</select></td></tr>' +
				'<tr><td>Edit summary:</td>' +
					'<td colspan="4"><input type="text" id="wpMassMoveReason" name="wpMassMoveReason" maxlength="500" style="width:100%;" /></td>' +
					'<td class="maxcol">&nbsp;</td></tr></table>' +
				'<br /><br />Preview:<br />' +
					'<textarea disabled name="wpMassMovePreview" id="wpMassMovePreview" rows="10" cols="80"></textarea>' +
				'<br /><br /><input disabled type="button" id="wpMassMoveSubmit" name="wpMassMoveSubmit" value="Move" />' +
			'</form>'`;

		
	}
});