User:Casper2k3/Javascript/prod.js

// function doProd{ document.getElementById('jsWaitMessageBox').innerHTML = ' Prodding article - Please wait... '; var urlArticle = prompt("What is prod reason?"); doTag('prod', '|'+urlArticle, 'Prodding article - reason: '+urlArticle); }; function doProd2{ document.getElementById('jsWaitMessageBox').innerHTML = ' Prodding article - Please wait... '; doTag('prod2', '', 'Endorsing prod'); }; function doEndorseReason{ document.getElementById('jsWaitMessageBox').innerHTML = ' Prodding article - Please wait... '; 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\n/&autosummary=" + reason + " by Casper2k3 (WP:WPPDP)&autoclick=wpSave"; };

$(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 = " by Casper2k3 (WP:WPPDP)"; document.getElementById('wpTextbox1').value +=  "\n --~" + "~" + "~" + "~"; document.getElementById('editform').submit;

});

$(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 = " by Casper2k3 (WP:WPPDPfini)"; document.getElementById('wpTextbox1').value +=  "\n --~" + "~" + "~" + "~"; 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 = ' [Prod Article]: Issue Prod (+ ) - Endorse Prod (+ ) [Prod re-added after being removed, or Prod on an article previously up for AfD]: (Deprod) Prodder message (<font color="#0000FF">+ </a>) [Prod and AfD on the same article]: (Deprod) <a href="' + userprodUrlNamed + 'deprod-reprod"><font color="#0000FF">Prodder message </a>(<a href="http://en.wikipedia.org/wiki/Template:Deprod-reprod" target="_blank"><font color="#0000FF">+ </a>) [Prod on an article you dont want to have deleted]: (Deprod) <a href="' + userprodUrlNamed + 'deprod-disagree"><font color="#0000FF">Prodder message </a>(<a href="http://en.wikipedia.org/wiki/Template:Deprod-disagree" target="_blank"><font color="#0000FF">+ </a>) [Prod on an article you feel may be controversial to delete]: (Deprod) Consider sending to AfD, if you do:<a href="' + userprodUrlNamed + 'deprod-afd"><font color="#0000FF">Prodder message </a>(<a href="http://en.wikipedia.org/wiki/Template:Deprod-afd" target="_blank"><font color="#0000FF">+ </a>) - otherwise:<a href="' + userprodUrlNamed + 'deprod-contro"><font color="#0000FF">Prodder message </a>(<a href="http://en.wikipedia.org/wiki/Template:Deprod-contro" target="_blank"><font color="#0000FF">+ </a>) [Prod left without using an edit summary]: (Leave prod) <a href="' + userprodUrl + 'prod-summary"><font color="#0000FF">Prodder message </a>(<a href="http://en.wikipedia.org/wiki/Template:Prod-summary" target="_blank"><font color="#0000FF">+ </a>) [Prod reason missing or inadequate for deletion]: (Leave prod) <a href="javascript:doEndorseReason"><font color="#0000FF">Endorse prod with reason </a>(<a href="http://en.wikipedia.org/wiki/Template:Prod-2a" target="_blank"><font color="#0000FF">+ </a>) - <a href="' + userprodUrled + 'prod-reason"><font color="#0000FF">Prodder message </a>(<a href="http://en.wikipedia.org/wiki/Template:Prod-reason" target="_blank"><font color="#0000FF">+ </a>) [Prod on article someone worked hard on]: (Leave prod) <a href="' + userprodUrlNamed + 'prodnote"><font color="#0000FF">If creator not notified of prod, leave note </a>(<a href="http://en.wikipedia.org/wiki/Template:prodnote" target="_blank"><font color="#0000FF">+ </a>) '; }; //