User:Casper2k3/Javascript/userinfobutton.js
Appearance
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/userinfobutton. |
//<nowiki>
$(function (){
//Add the links
if (location.href.indexOf("&action=edit&issueinfo=") == -1) return; //Are we here to issue a info msg?
//Get new warning
infoRegExp = /&action=edit&issueinfo=(.*)/;
info = infoRegExp.exec(location.href)[1];
//Modify the form
document.getElementById('wpSummary').value = "Info: {{" + info + "}} by [[User:Casper2k3|Casper2k3]] ([[WP:RCP]])";
document.getElementById('wpTextbox1').value += "\n{{sub" + "st:" + info + "}} --~" + "~" + "~" + "~";
document.getElementById('editform').submit();
});
$(function (){
//Add the links
if (location.href.indexOf("&action=edit&issueinfofwarn") == -1) return; //Are we here to issue a info msg?
//Get new warning
//Modify the form
document.getElementById('wpSummary').value = "Info: {{non-a" + "dmin fwarn}} by [[User:Casper2k3|Casper2k3]] ([[WP:RCP]])";
document.getElementById('wpTextbox1').value += "\n{{sub" + "st:non-admin fwarn}}";
document.getElementById('editform').submit();
});
$(function (){
//Add the links
if (location.href.indexOf("&action=edit&issueinfouserfy") == -1) return; //Are we here to issue a info msg?
//Get new warning
//Modify the form
document.getElementById('wpSummary').value = "Article userfied by [[User:Casper2k3|Casper2k3]] ([[WP:RCP]])";
document.getElementById('wpTextbox1').value += "\n{{sub" + "st:User:Casper2k3/Templates/Userfy Info}} --~" + "~" + "~" + "~";
document.getElementById('editform').submit();
});
$(function (){
//Add the links
if (location.href.indexOf("&action=edit&issueinfonamed=") == -1) return; //Are we here to issue a info msg?
//Get new warning
infoRegExp = /&action=edit&issueinfonamed=(.*)/;
var urlArticle = prompt("What is article name?");
if(urlArticle == "" || urlArticle == null){
alert ("You didn't enter the name of the page! Info msg cancelled.")
return;
}
info = infoRegExp.exec(location.href)[1];
//Modify the form
document.getElementById('wpSummary').value = "Info: {{" + info + "|" + urlArticle + "}} by [[User:Casper2k3|Casper2k3]] ([[WP:RCP]])";
document.getElementById('wpTextbox1').value += "\n{{sub" + "st:" + info + "|" + urlArticle+ "}} --~" + "~" + "~" + "~";
document.getElementById('editform').submit();
});
var infoUrl = "http://en.wikipedia.org/w/index.php?title=User_talk:" + wgTitle + "&action=edit&issueinfo=";
var infoUrlNamed = "http://en.wikipedia.org/w/index.php?title=User_talk:" + wgTitle + "&action=edit&issueinfonamed=";
var infoUrlFwarn = "http://en.wikipedia.org/w/index.php?title=User_talk:" + wgTitle + "&action=edit&issueinfofwarn";
var infoUrlUserfy = "http://en.wikipedia.org/w/index.php?title=User_talk:" + wgTitle + "&action=edit&issueinfouserfy";
function userInfoButton(){
document.getElementById('jsArticleMessageBox').innerHTML = '<div style="background-color:red; -moz-border-radius:15px;"> User information messages:</div><div style="background-color:yellow; -moz-border-radius:15px;"> [Vanity]: <a href="' + infoUrlNamed + 'vanity"><font color="#0000FF">Note (1)</font></a><sup>(Named Only)(<a href="http://en.wikipedia.org/wiki/Template:Vanity" target="_blank"><font color="#0000FF">+</font></a>)</sup><br> [Edit Summary]: <a href="' + infoUrl + 'editsummary"><font color="#0000FF">Pic Box (0)</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Editsummary" target="_blank"><font color="#0000FF">+</font></a>)</sup> - <a href="' + infoUrl + 'summary"><font color="#0000FF">In-depth (0)</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Summary" target="_blank"><font color="#0000FF">+</font></a>)</sup> - <a href="' + infoUrl + 'minor"><font color="#0000FF">Minor-edit (0)</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Minor" target="_blank"><font color="#0000FF">+</font></a>)</sup> - <a href="' + infoUrl + 'preview"><font color="#0000FF">Preview (0)</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Preview" target="_blank"><font color="#0000FF">+</font></a>)</sup> - <a href="' + infoUrl + 'Summary2"><font color="#0000FF">Summary (1)</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Edit summary personal" target="_blank"><font color="#0000FF">+</font></a>)</sup> - <a href="' + infoUrl + 'Edit Summary Personal"><font color="#0000FF">Abusive E-Summary (1)</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Edit summary personal" target="_blank"><font color="#0000FF">+</font></a>)</sup><br> [Editing Related]: <a href="' + infoUrl + 'tilde"><font color="#0000FF">Tilde (0)</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Tilde" target="_blank"><font color="#0000FF">+</font></a>)</sup><br> [Reported to AiV]: <a href="' + infoUrlFwarn + '"><font color="#0000FF">Info (0)</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Non-admin fwarn" target="_blank"><font color="#0000FF">+</font></a>)</sup><br> [Userfy]: <a href="' + infoUrlUserfy + '"><font color="#0000FF">Userfy (0)</font></a><sup>(<a href="http://en.wikipedia.org/wiki/User:Casper2k3/Templates/Userfy Info" target="_blank"><font color="#0000FF">+</font></a>)</sup><br></div>';
};
//</nowiki>