Difference between revisions of "MediaWiki:Common.js"
From TestWiki
(Adding JS to make spam management more automated.) |
(Fix JS - not undefined, but null. Let's just do a non-strict boolean check.) |
||
Line 2: | Line 2: | ||
// Default delete message. | // Default delete message. | ||
− | + | if (document.getElementById("deleteconfirm")) { | |
− | + | ||
document.getElementById("wpReason").value = "Junk/spam"; | document.getElementById("wpReason").value = "Junk/spam"; | ||
} | } | ||
// Default block settings. | // Default block settings. | ||
− | + | if (document.getElementById("blockip")) { | |
− | + | ||
document.getElementById("wpBlockExpiry").value = "infinite"; | document.getElementById("wpBlockExpiry").value = "infinite"; | ||
document.getElementById("wpBlockExpiry").onchange(); | document.getElementById("wpBlockExpiry").onchange(); |
Revision as of 12:51, 18 October 2014
window.onload = function() { // Default delete message. if (document.getElementById("deleteconfirm")) { document.getElementById("wpReason").value = "Junk/spam"; } // Default block settings. if (document.getElementById("blockip")) { document.getElementById("wpBlockExpiry").value = "infinite"; document.getElementById("wpBlockExpiry").onchange(); document.getElementById("mw-bi-reason").value = "Spamming"; document.getElementById("wpHideName").checked = true; } }