Jump to content

User:Casper2k3/Javascript/userinfobutton.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//<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;">&nbsp;User information messages:</div><div style="background-color:yellow; -moz-border-radius:15px;">&nbsp;[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>&nbsp;[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>&nbsp;[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>&nbsp;[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>&nbsp;[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>