MediaWiki:Gadget-CheckUserMenu.js
From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
/* Add a drop-down menu for Special:CheckUser reasons */
function checkUserOther(name) {
if (name == 'Other') {
var menu = document.getElementById('checkreason');
var field = '<input id="checkreason" maxlength="150" value="" size="46" name="reason">';
menu.outerHTML = field;
}
}
$(function() {
if (mw.config.get('wgCanonicalSpecialPageName') === 'CheckUser') {
var field = document.getElementById('checkreason');
var menu = '<select id="checkreason" name="reason" style="width:303px;height:22px" onchange="checkUserOther(this.options[this.selectedIndex].value)"><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>';
field.outerHTML = menu;
}
});