Jump to content

User:Retired user 0001/WikiProject Tagger.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.
$(function(){addPortletLink("p-cactions", "javascript:easyProd()", "Tag", "wprojtag", "Tag talk page with a WikiProject", "");});

function easyProd() {

 if (wgCanonicalNamespace != "" && wgAction != 'edit')
    return;

 reason = prompt("Enter in WikiProject name (without either the 'Wikipedia:' or 'WikiProject' text)");
 if (reason == "null") { return; }
 reason1 = prompt("Enter in class (if any)");
 if (reason1 == "null") { reason1=""; }
 reason2 = prompt("Enter in priority/importance (if any)");
 if (reason2 == "null") { reason2=""; }
 var f = document.forms[0], t = f.wpTextbox1;
 t.value = "{"+"{WikiProject " + reason + "|class="+reason1+"|importance="+reason2+"}}\n" + t.value;
 f.wpSummary.value = "Tagging WikiProject";
 f.wpSave.click();
}