User:Gamedezyner/API/Plugins/deleteMarkedPages.js

//Delete Marked Pages plugin for API //Designed for use on w:c:sonicfanon api.functions.deleteMarkedPages = function { thisQuery = new api.actions.query; thisQuery.list = "categorymembers"; thisQuery.cmtitle = "Category:Candidates for deletion"; thisQuery.cmlimit = api.settings.pagelimit; api.actions.post(thisQuery); categorymembers = thisQuery.response.query.categorymembers; i=0; apiInterval = setInterval(function {   if (iPage Deleted: ' + categorymembers[i].title + ''); console.log('Page Deleted: ' + categorymembers[i].title); i++; }   else { console.log("Done!"); api.functions.deleteMarkedPages.running = false; api.functions.deleteMarkedPages.complete = true; $("#ok").attr("disabled",false).html("Exit"); $("#cancel").remove; clearInterval(apiInterval); }; },api.settings.throttle); } api.functions.deleteMarkedPages.running = false; api.functions.deleteMarkedPages.complete = false;

api.menu.add("deleteMarkedPages", "Delete Marked Pages"); $("#deleteMarkedPages").click(function {   api.menu.open("Delete Marked Pages", ' This will delete pages in Category:Candidates_for_deletion. ' , 510,    function { if (api.functions.deleteMarkedPages.running == false && api.functions.deleteMarkedPages.complete == false) { api.functions.deleteMarkedPages.running = true; $("#ok").attr("disabled",true).html("Running..."); api.functions.deleteMarkedPages; }       if (api.functions.deleteMarkedPages.running == false && api.functions.deleteMarkedPages.complete == true) { api.menu.cancel; }   },     function { if (typeof(apiInterval) != "undefined"){ clearInterval(apiInterval); }     api.functions.deleteMarkedPages.running = false; api.functions.deleteMarkedPages.complete = false; api.menu.cancel; },   "Go!", "Cancel"); });