User:Callofduty4/CategoryAdder.js

function CategoryAdder { var cathtml = '' + category + ''; $('#filetoc').append(cathtml); $('categorySubmit').click(function(event) {		this.innerHTML = '';		$.getJSON("/api.php", {action: "query", prop: "info", titles: wgPageName, intoken: "edit", format: "json", indexpageids: 1}, function(json) { var pageid = json.query.pageids[0]; var tk = json.query.pages[pageid].edittoken; $.post("/api.php", {action: "edit", title: wgPageName, token: tk, appendtext: "" + category + "" + "\n"}, function (result) {$(".CategoryAdder").remove;}); });		}); }

if (wgCanonicalNamespace == 'File') { addOnloadHook(FileTemplateAdder); }