MediaWiki:AjaxTemplate/code.js

//Template Add-a-ma-jig //By Benjaminthewill123123 $('#WikiHeader').append('Add Template'); function addTemplates { var text = prompt('Template Name', 'Blacklist'); var sig = '' + String.fromCharCode(126) + '~' var addtexttalk = '

'+sig var addtextother = ' '	var reason = "Using The Ajax Template Script"; if (wgNamespaceNumber == "1", "3" , "5" , "7" , "9" , "11" , "13" , "15") { $.post("/api.php", {action: "edit", title: wgPageName, token: mw.user.tokens.values.editToken, appendtext: addtexttalk, summary: reason}); }       if (wgNamespaceNumber == "0", "2" , "4" , "6" , "8" , "10" , "12" , "14") { $.post("/api.php", {action: "edit", title: wgPageName, token: mw.user.tokens.values.editToken, prependtext: addtextother, summary: reason}); }}