User:TheFearow/ajaxtagger.js

//Import importScript("User:TheFearow/simpleajax.js"); //Start stub script

$(function {  if (wgCanonicalNamespace == "Special"){    return;  }  mw.util.addPortletLink("p-cactions", "javascript:easyAjaxTag", "ajaxtag (t)", "ca-ajtagt", "Add tag (top, using AJAX)", "");  mw.util.addPortletLink("p-cactions", "javascript:easyAjaxTagBottom", "ajaxtag (b)", "ca-ajtagb", "Add tag (bottom, using AJAX)", ""); }); function easyAjaxTag { var title = wgPageName; var tag = window.prompt("Enter template name"); if(tag == null){ return; } simpleAJAXPrepend(title, "{"+"{"+tag+"}}", "Adding tag '"+tag+"'", true, false, " Tagging article... ", " Article tagged! ", true); } function easyAjaxTagBottom { var title = wgPageName; var tag = window.prompt("Enter template name"); if(tag == null){ return; } simpleAJAXAppend(title, "{"+"{"+tag+"}}", "Adding tag '"+tag+"'", true, false, " Tagging article... ", " Article tagged! ", true); }