Wikipedia:WikiProject User scripts/Scripts/warn.js

This is an old revision of this page, as edited by Sceptre (talk | contribs) at 14:29, 9 December 2007 (nvm, too unwieldly). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

/*

Script version 2.3
Changes to 2.3: Automatic section adding if editing whole userpage.
*/
function warn()
{
    var txt = document.editform.wpTextbox1;
var prefix = prompt("What is the prefix? Change if appropriate", "uw-")
var type = prompt("Which standard warning do you wish to issue?", "test");
var severity = prompt("How severe is the violation?", "1");
var page = prompt("What page?");
var msgtext = "{{subst:"+prefix + type + severity + "|" + page + "|subst=subst:}} ~~~~";
if(page.length == 0) {page = "Wikipedia"} else { page = "[["+page+"]]" };
var summary = "Your recent edits to " + page ;
if(txt.value.length > 0) txt.value += '\n';
    document.editform.wpSummary.value = summary;
    document.editform.wpMinoredit.checked = true;
    txt.value += msgtext;
    document.editform.submit();
}
/*

*/