Wikipedia:WikiProject User scripts/Scripts/warn.js: Difference between revisions
Appearance
Content deleted Content added
add this new fantastic script |
m Protected Wikipedia:WikiProject User scripts/Scripts/warn.js: to avoid security being compromised on user script [edit=sysop:move=sysop] |
||
(19 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
/*<pre> |
|||
Script version 2.2.1 |
|||
Versions 1.0-2.0 in history of [[User:Sceptre/monobook.js]]... I think |
|||
*/ |
|||
function warn() |
function warn() |
||
{ |
{ |
||
var txt = document.editform.wpTextbox1; |
var txt = document.editform.wpTextbox1; |
||
var |
var prefix = prompt("What is the prefix? Change if appropriate", "uw-") |
||
var type = prompt("Which standard warning do you wish to issue?", "test"); |
|||
var msgtext = "{{subst:" + prompter + "}}"; |
|||
var |
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 ; |
|||
document.editform.wpSummary.value = summary; |
document.editform.wpSummary.value = summary; |
||
document.editform.wpMinoredit.checked = true; |
|||
if(txt.value.length > 0) txt.value += '\n'; |
if(txt.value.length > 0) txt.value += '\n'; |
||
txt.value += msgtext; |
txt.value += msgtext; |
||
document.editform.submit(); |
document.editform.submit(); |
||
} |
} |
||
/*</pre><noinclude>[[Category:Wikipedia scripts]]</noinclude>*/ |
|||
</pre></nowiki> |
Latest revision as of 22:36, 29 December 2007
/*
Script version 2.2.1 Versions 1.0-2.0 in history of [[User:Sceptre/monobook.js]]... I think */ 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 ; document.editform.wpSummary.value = summary; document.editform.wpMinoredit.checked = true; if(txt.value.length > 0) txt.value += '\n'; txt.value += msgtext; document.editform.submit(); } /*
*/