MediaWiki:Gadget-CheckUserMenu.js: Difference between revisions

From the Kingdom Hearts Wiki, the Kingdom Hearts encyclopedia
Jump to navigationJump to search
No edit summary
No edit summary
Line 6: Line 6:
$('#checkreason').change(function() {
$('#checkreason').change(function() {
if ($('#checkreason').val() == 'Other')
if ($('#checkreason').val() == 'Other')
$('#checkreason').replaceWith('<input id="checkreason" name="reason" style="font-size:98.7%;width:100%;max-width:50em;height:25.5px" maxlength="150" value=""/>');
$('#checkreason').replaceWith('<input id="checkreason" name="reason" style="font-size:98.7%;width:98.7%;max-width:50em;height:25.5px" maxlength="150" value=""/>');
});
});
}
}
});
});

Revision as of 18:07, 1 August 2023

/* Add a drop-down menu for Special:CheckUser reasons */

$(function() {
	if (mw.config.get('wgCanonicalSpecialPageName') === 'CheckUser') {
		$('#checkreason').replaceWith('<select id="checkreason" name="reason" style="font-size:100%;width:100%;max-width:50em;height:31.5px"><option value="" selected="selected">Please select a reason...</option><option value="Routine new user check">Routine new user check</option><option value="Suspected sockpuppet account">Suspected sockpuppet account</option><option value="Matching a vandal account">Matching a vandal account</option><option value="Other">Other</option></select>');
		$('#checkreason').change(function() {
			if ($('#checkreason').val() == 'Other')
				$('#checkreason').replaceWith('<input id="checkreason" name="reason" style="font-size:98.7%;width:98.7%;max-width:50em;height:25.5px" maxlength="150" value=""/>');
		});
	}
});