User:Lost Labyrinth/general/categoryadder.js

// // BEGIN MW GADGET // ********* function CategoryAdderTwo { var cat2html = 'Add Category'; $('#filetoc').append(cat2html); $('#categorySubmitTwo').click(function(event) {		newCat = $("#Category").val;		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, bot: true, appendtext: "" + "\n"}, function (result) {$(".CategoryAdderTwo").remove;}); });	}); } if (wgCanonicalNamespace == 'File') { addOnloadHook(CategoryAdderTwo); } // END MW GADGET //