User:Casper2k3/Javascript/prod.js
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
function doProd(){ document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Prodding article - Please wait...</h2>'; var urlArticle = prompt("What is prod reason?"); doTag('prod', '|'+urlArticle, 'Prodding article - reason: '+urlArticle); }; function doProd2(){ document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Prodding article - Please wait...</h2>'; doTag('prod2', '', 'Endorsing prod'); }; function doEndorseReason(){ document.getElementById('jsWaitMessageBox').innerHTML = '<br><h2>Prodding article - Please wait...</h2>'; var urlArticle = prompt("What is prod endorse reason?"); doTag('prod2a', '|'+urlArticle, 'Endorsing prod'); }; function doTag(tag, exInfo, reason){ document.location = document.URL + "?action=edit&autoedit=s/^/\n{{sub" + "st:" + tag + exInfo + "}}\n/&autosummary=" + reason + " by [[User:Casper2k3|Casper2k3]] ([[WP:WPPDP]])&autoclick=wpSave"; }; addOnloadHook(function (){ //Add the links if (location.href.indexOf("&action=edit&issueuserprod=") == -1) return; //Are we here to issue a warning? //Get new warning userprodRegExp = /&action=edit&issueuserprod=(.*)/; userprod = userprodRegExp.exec(location.href)[1]; //Modify the form document.getElementById('wpSummary').value = "{{" + userprod + "}} by [[User:Casper2k3|Casper2k3]] ([[WP:WPPDP]])"; document.getElementById('wpTextbox1').value += "\n{{sub" + "st:" + userprod + "}} --~" + "~" + "~" + "~"; document.getElementById('editform').submit(); }); addOnloadHook(function (){ //Add the links if (location.href.indexOf("&action=edit&issueuserprodnamed=") == -1) return; //Are we here to issue a warning? //Get new warning userprodRegExp = /&action=edit&issueuserprodnamed=(.*)/; var urlArticle = prompt("What is article name?"); if(urlArticle == "" || urlArticle == null){ alert ("You didn't enter the name of the page! Prod message cancelled.") return; } userprod = userprodRegExp.exec(location.href)[1]; //Modify the form document.getElementById('wpSummary').value = "{{" + userprod + "|" + urlArticle + "}} by [[User:Casper2k3|Casper2k3]] ([[WP:WPPDPfini]])"; document.getElementById('wpTextbox1').value += "\n{{sub" + "st:" + userprod + "|" + urlArticle+ "}} --~" + "~" + "~" + "~"; document.getElementById('editform').submit(); }); var userprodUrl = "http://en.wikipedia.org/w/index.php?title=User_talk:" + wgTitle + "&action=edit&issueuserprod="; var userprodUrlNamed = "http://en.wikipedia.org/w/index.php?title=User_talk:" + wgTitle + "&action=edit&issueuserprodnamed="; function prodButton(){ document.getElementById('jsArticleMessageBox').innerHTML = '<div style="background-color:yellow; -moz-border-radius:15px;"> [Prod Article]: <a href="javascript:doProd()"><font color="#0000FF">Issue Prod</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Prod" target="_blank"><font color="#0000FF">+</font></a>)</sup> - <a href="javascript:doProd2()"><font color="#0000FF">Endorse Prod</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Prod-2" target="_blank"><font color="#0000FF">+</font></a>)</sup><br> [Prod re-added after being removed, or Prod on an article previously up for AfD]: <sup>(Deprod)</sup> <a href="' + userprodUrlNamed + 'deprod-reprod"><font color="#0000FF">Prodder message</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Deprod-reprod" target="_blank"><font color="#0000FF">+</font></a>)</sup><br> [Prod and AfD on the same article]: <sup>(Deprod)</sup> <a href="' + userprodUrlNamed + 'deprod-reprod"><font color="#0000FF">Prodder message</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Deprod-reprod" target="_blank"><font color="#0000FF">+</font></a>)</sup><br> [Prod on an article you dont want to have deleted]: <sup>(Deprod)</sup> <a href="' + userprodUrlNamed + 'deprod-disagree"><font color="#0000FF">Prodder message</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Deprod-disagree" target="_blank"><font color="#0000FF">+</font></a>)</sup><br> [Prod on an article you feel may be controversial to delete]: <sup>(Deprod)</sup> Consider sending to AfD, if you do:<a href="' + userprodUrlNamed + 'deprod-afd"><font color="#0000FF">Prodder message</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Deprod-afd" target="_blank"><font color="#0000FF">+</font></a>)</sup> - otherwise:<a href="' + userprodUrlNamed + 'deprod-contro"><font color="#0000FF">Prodder message</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Deprod-contro" target="_blank"><font color="#0000FF">+</font></a>)</sup><br> [Prod left without using an edit summary]: <sup>(Leave prod)</sup> <a href="' + userprodUrl + 'prod-summary"><font color="#0000FF">Prodder message</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Prod-summary" target="_blank"><font color="#0000FF">+</font></a>)</sup><br> [Prod reason missing or inadequate for deletion]: <sup>(Leave prod)</sup> <a href="javascript:doEndorseReason()"><font color="#0000FF">Endorse prod with reason</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Prod-2a" target="_blank"><font color="#0000FF">+</font></a>)</sup> - <a href="' + userprodUrled + 'prod-reason"><font color="#0000FF">Prodder message</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:Prod-reason" target="_blank"><font color="#0000FF">+</font></a>)</sup><br> [Prod on article someone worked hard on]: <sup>(Leave prod)</sup> <a href="' + userprodUrlNamed + 'prodnote"><font color="#0000FF">If creator not notified of prod, leave note</font></a><sup>(<a href="http://en.wikipedia.org/wiki/Template:prodnote" target="_blank"><font color="#0000FF">+</font></a>)</sup><br></div>'; };

