User:Casper2k3/Javascript/speedybutton.js
Appearance
< User:Casper2k3 | Javascript
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
Documentation for this user script can be added at User:Casper2k3/Javascript/speedybutton. |
// <nowiki>
function doSpeedyG1(){
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Nonsense - CSD:G1) - Please wait...</h2>';
doSpeedy("nonsense", "G1");
};
function doSpeedyG2(){
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Test - CSD:G2) - Please wait...</h2>';
doSpeedy("test", "G2");
};
function doSpeedyG3(){
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Vandalism - CSD:G3) - Please wait...</h2>';
doSpeedy("vandalism", "G3");
};
function doSpeedyG4(){
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Repost - CSD:G4) - Please wait...</h2>';
doSpeedy("repost", "G4");
};
function doSpeedyG5(){
var bannedName = prompt("What is the name of the banned user?");
if(bannedName == "" || bannedName == null){
alert ("You didn't enter the name of the banned user! Speedy cancelled.")
return;
}
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Banned user [' + bannedName + '] - CSD:G5) - Please wait...</h2>';
var speedyTag = "banned|" + bannedName;
doSpeedy(speedyTag, "G5");
};
function doSpeedyG6(){
var pageName = prompt("What is the name of the page to merge history from?");
if(pageName == "" || pageName == null){
alert ("You didn't enter the name of the page! Speedy cancelled.")
return;
}
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (History merge [' + pageName + '] - CSD:G6) - Please wait...</h2>';
var speedyTag = "histmerge|" + pageName;
doSpeedy(speedyTag, "G6");
};
function doSpeedyG7(){
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Author requests delete - CSD:G7) - Please wait...</h2>';
doSpeedy("author", "G7");
};
function doSpeedyG8(){
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Talk page of non-existent article - CSD:G8) - Please wait...</h2>';
doSpeedy("talk", "G8");
};
function doSpeedyA1(){
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Empty / No context - CSD:A1) - Please wait...</h2>';
doSpeedy("empty", "A1");
};
function doSpeedyA3(){
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (No content / Attempt to contact - CSD:A3) - Please wait...</h2>';
doSpeedy("contact", "A3");
};
function doSpeedyA6(){
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Attack page - CSD:A6) - Please wait...</h2>';
doSpeedy("attack", "A6");
};
function doSpeedyA7(){
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Bio (Vanity) - CSD:A7) - Please wait...</h2>';
doSpeedy("bio", "A7");
};
function doSpeedyG11(){
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Spam - CSD:G11) - Please wait...</h2>';
doSpeedy("spam", "G11");
};
function doSpeedyA8(){
var urlSource = prompt("What is the web address of the copyvio?");
if(urlSource == "" || urlSource == null){
alert ("You didn't enter the web address of the copyvio! Speedy cancelled.")
return;
}
document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Nominating for Speedy Deletion (Copyvio [' + urlSource + '] - CSD:A8) - Please wait...</h2>';
var speedyTag = "copyvio|url=" + urlSource;
doSpeedy(speedyTag, "A8");
};
function doSpeedy(tag, reason){
document.location = document.URL + "?action=edit&autoedit=s/^/\n<!-- Please do not remove or change this Speedy Deletion tag from articles you have created yourself -->{{db-" + tag + "}}\n/&autosummary=Tagged for speedy deletion (Reason:[[WP:CSD#" + reason + "|CSD: " + reason + "]]) by [[User:Casper2k3|Casper2k3]] ([[WP:RCP]])&autoclick=wpSave";
};
function speedyButton(){
document.getElementById('jsArticleMessageBox').innerHTML = '<div style="background-color:yellow; -moz-border-radius:15px;"> <a href="javascript:doSpeedyG1()"><font color="#0000FF">Nonsense</font></a> - <a href="javascript:doSpeedyG2()"><font color="#0000FF">Test</font></a> - <a href="javascript:doSpeedyG3()"><font color="#0000FF">Vandalism</font></a> - <a href="javascript:doSpeedyG4()"><font color="#0000FF">Repost</font></a> - <a href="javascript:doSpeedyG5()"><font color="#0000FF">Banned User</font></a> - <a href="javascript:doSpeedyG6()"><font color="#0000FF">History Merge</font></a> - <a href="javascript:doSpeedyG7()"><font color="#0000FF">Author Requests Delete</font></a> - <a href="javascript:doSpeedyG8()"><font color="#0000FF">Talk Page of Non-Existent Article</font></a><br> <a href="javascript:doSpeedyG11()"><font color="#0000FF">Spam</font></a> - <a href="javascript:doSpeedyA1()"><font color="#0000FF">Empty / No Context</font></a> - <a href="javascript:doSpeedyA3()"><font color="#0000FF">No Content / Attempt to Contact</font></a> - <a href="javascript:doSpeedyA6()"><font color="#0000FF">Attack</font></a> - <a href="javascript:doSpeedyA7()"><font color="#0000FF">Bio (Vanity)</font></a> - <a href="javascript:doSpeedyA8()"><font color="#0000FF">Copyvio</font></a> - [<a href="http://wiki.riteme.site/wiki/WP:CSD"><font color="#0000FF">CSD</font></a>] [<a href="http://wiki.riteme.site/wiki/WP:RCP"><font color="#0000FF">RCP</font></a>]</div>';
};
// </nowiki>