Wikipedia:WikiProject User scripts/Scripts/warn.js

This is an old revision of this page, as edited by Sceptre (talk | contribs) at 18:29, 18 May 2007 (warning minor edit=true). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

/*

Script version 2.1.1
Versions 1.0-2.0 in history of [[User:Sceptre/monobook.js]]... I think
*/
function warn()
{
    var txt = document.editform.wpTextbox1;
var type = prompt("Which standard warning do you wish to issue?");
var severity = prompt("How severe is the violation?");
var page = prompt("What page?");
if(type.length == 0) type = "test";
if(severity.length == 0) severity = "1";
var msgtext = "{{subst:uw-" + type + severity + "|" + page + "|subst=subst:}} ~~~~";
if(page.length == 0) {page = "Wikipedia"} else { page = "[["+page+"]]" };
var summary = "Your recent edits to " + page ;
    document.editform.wpSummary.value = summary;
    document.editform.wpMinoredit.checked = true;
    if(txt.value.length > 0) txt.value += '\n';
    txt.value += msgtext;
    document.editform.submit();
}
/*

*/