Delete

call:

javascript:var a=new OZONE.dialogs.WaitBox();a.content='Loading...';a.show();var head= document.getElementsByTagName('head')[0];var script= document.createElement('script');script.type= 'text/javascript';script.src= 'http://ktsangsb.wikidot.com/delete/code/2'; script.onload=function(){a.close();}; script.onreadystatechange = function() {if (this.readyState == 'complete') {a.close();}}; head.appendChild(script);void(0);
if(typeof(jxeeno)=="undefined"){ jxeeno = {}; }
if(typeof(jxeeno.utils)=="undefined"){ jxeeno.utils = {}; }
if(typeof(jxeeno.utils.massdelete)=="undefined"){ jxeeno.utils.massdelete = {}; }
jxeeno.utils.massdelete.init = function(){
    var delToolHTML =     "<b>Paste list page names here:</b> (Separate by new line)"+"<br /><span id=\"ktsang-status\"></span>"+"<br />"+"<textarea id=\"page-list\" style=\"width: 50%; height: 200px;\" onkeyup=\"jxeeno.utils.massdelete.count();\"></textarea>"+"<br /><span id=\"ktsang_count_span\">There are currently 0 page(s) in the queue.</span><br />"+"<input type=\"button\" class=\"button\" value=\"Delete pages!\" onclick=\"jxeeno.utils.massdelete.call();\" />";
    $j("#page-content").append(delToolHTML);
}
jxeeno.utils.massdelete.call = function(){
    var arrPageId = document.getElementById("page-list").value.replace("\r","\n").split("\n");
    console.log(arrPageId[0]);
    if(confirm("Are you sure you want to delete "+arrPageId.length+" pages?")){
        jxeeno.utils.massdelete.internal(0,arrPageId);
    }
}
jxeeno.utils.massdelete.internal = function(index, array){
    if(index < array.length){
        $j.get("/"+array[index]+"/norender/true",function(d){
            if(d.match(/WIKIREQUEST\.info\.pageId = ([0-9]+);/)){
                pageid=d.match(/WIKIREQUEST\.info\.pageId = ([0-9]+);/)[1];
                var c=new Object();
                c.action="WikiPageAction";
                c.event="deletePage";
                c.page_id=pageid;
                OZONE.ajax.requestModule("Empty",c,function(b){
                    if(!WIKIDOT.utils.handleError(b)){
                        alert("There was an error when deleting "+array[index]);
                    }
                    jxeeno.utils.massdelete.internal(index+1, array); //Process the next page
                });
                $j("#ktsang-status").html("Deleting page "+index+" of "+array.length+"...");
            }
        });
    }else{
        alert("The pages have been deleted!");
    }
}
jxeeno.utils.massdelete.count = function(){
    var arrPageId = document.getElementById("page-list").value.replace("\r","\n").split("\n");
    document.getElementById("ktsang_count_span").innerHTML="There are currently "+arrPageId.length+" page(s) in the queue";
}
jxeeno.utils.massdelete.init();