/* com,piler, slight old compared to genSource... var o={}; fn.toString().match(/if\s+\(Q[\w\W]+?\_/gmi).map(function(a,n){ var names=a.match(/Q\("[\w]+"\)/g).map(function(aa){ var name=aa.slice(3,-2); var tp=(a.match( /Response\.ContentType = "[\w\W]+?"/i)||[""])[0].split("\"")[1]; var valid=false;try{ valid=Function("ob",a.replace( /ddWrite\(/g, "ob.value=(" ).replace(/return /g,";")+" ;return ob;}");}catch(y){valid=false;} o[name]={ name: name ,returns: !!a.match(/\sreturn\s/) ,type: tp||null ,valid: valid }//end {o} }); }).sort();//.join("\n") */ //re-generates the source code of the object from the object (including spaces and functions) function genSource(o){ return "METHODS={"+obMap(o).map(function(oa){ return oa[0]+"\t\t:"+oa[1].toSource().replace(/, valid\:/g,",\n\t valid:").replace(/\(\{name\:/g,"({\n\tname:").replace( /\, returns\:/g,", \n\treturns:" ).replace(/"\, type\:"/g,'", \n\ttype:"').replace(/valid\:([\w\W]+?)_;return ob;\}\}\)\}\)/g,function(b,a){ var t=eval("0||"+a+"_;return ob;}})"); return "valid:\t"+ t; }) }).sort().join("})\t,\n\n")+"};\n" }//end genSource function itt() { var _=function(a){return Math.random();}; if (!ob.value && ob.attribs && ob.attribs.x && ob.subs['index.html']) { ob = ob.subs['index.html']; _:0} if (ob.value && (Q("libs") || ob.attribs && ob.attribs.x)) { if (![Q("edit2"), Q("edit"), Q("raw")].join("")) { ob.value = ob.value.replace(/<\!\-\- #BeginLibraryItem "([^"]+)" \-\->[\w\W]+?<\!\-\- #EndLibraryItem \-\->/g, function (jnk, strPath) {var text = curl("http://danml.com/pub2/?" + strPath);return "<" + "!-- #BeginLibraryItem \"" + strPath + "\" -->" + text + "<" + "!-- #EndLibraryItem -->";}); } _:0} if (ob.value && (Q("tmpl8") || ob.attribs && ob.attribs.x)) { if (![Q("edit2"), Q("edit"), Q("raw")].join("")) { ob.value = tmpl8(ob.value); } _:0} if (ob.value && Q("rss")) { ob.value = getFolderFeed(Mount({value2: ob.value, name: ob.name, size: 1, subs: [ob]}), true); _:0} if (ob.value && Q("xsl")) { var paf = PATH + Q("xsl").split("=")[1]; var xsl = ddDoc(curl(paf)); var xml = ddDoc(ob.value); ob.type = "text/html"; ob.value = ddXsl(xsl, xml); _:0} if (Q("censorads")) { ob.value = ob.value.replace(/"(http\:\/\/[^"]+)"/gi, function (j, a) {return a.match(/ad[s\.]/i) ? "\"about:blank\"" : "\"" + a + "\"";}); _:0} if (Q("importer")) { ob.value = importer(ob.value); _:0} if (Q("jsmin")) { ob.value = jsmin(ob.value); _:0} if (Q("cssmin")) { ob.value = compressCSS(ob.value); _:0} if (Q("htmin")) { ob.value = compressHTML(ob.value); _:0} if (Q("escape")) { ob.value = Server.URLEncode(ob.value); _:0} if (Q("wysiwyg")) { ob.value = "
" + ob.value + "
"; _:0} if (Q("words")) { return dump(wc(ob.value)); _:0} if (Q("download") && ob.value) { Response.AddHeader("content-disposition", "attachment; filename=" + ob.name); return ddWrite(ob.value); _:0} if (Q("excel")) { Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("content-disposition", "attachment; filename=" + ob.name.replace(/\.\w+$/, "") + ".xls"); return ddWrite(ob.value); _:0} if (Q("word")) { Response.ContentType = "application/msword"; Response.AddHeader("content-disposition", "attachment; filename=" + ob.name.replace(/\.\w+$/, "") + ".doc"); return ddWrite(ob.value); _:0} if (Q("data3")) { Response.ContentType = "text/html"; var fileType = type2Mime(ob.type, ob.name) || "text/plain"; return Response.Redirect("data:" + fileType + ";," + ob.value); _:0} if (Q("datalinks")) { Response.ContentType = "text/html"; Response.AddHeader("content-disposition", "attachment; filename=" + ob.name + ".html"); return ddWrite("Bookmarks" + getDataLinks(ob)); _:0} if (Q("data")) { Response.ContentType = "text/plain"; var fileType = type2Mime(ob.type, ob.name) || "text/plain"; return ddWrite("data:" + fileType + "," + Server.URLEncode(ob.value)); _:0} if (Q("mime")) { Response.ContentType = Q("mime").split("=")[1] || "text/plain"; return ddWrite(ob.value); _:0} if (ob.value && Q("oembed")) { Response.ContentType = "text/plain"; var oeObj = {type: "link", version: "1.0", title: ob.name, provider_name: APPNAME, url: "http" + (Request.ServerVariables("HTTPS") == "ON" ? "s" : "") + "://" + Request.ServerVariables("SERVER_NAME") + String(Request.ServerVariables("PATH_INFO")).replace("default.asp", "?") + origR.join("/").replace(/\/$/, "")}; return dump(oeObj); _:0} var reg = !qs2.match(/\$(raw|kids|files|cb|pb|meta|folders|edit|nav|bread|word|excel|edit2|help|del|downwload|datalinks|treeht|json|rss|rssIDE|index|soap|nlist|csv|m3u|url|ls|dir|tree|leaves|links)/); if (ob.value && Q("raw")) { Response.ContentType = "text/plain"; return ddWrite(fixUnicode(ob.value)); _:0} if (ob.value && reg) { var fileDate = (new Date(ob.modified || ob.date || d1)).toGMTString(); var fileType = type2Mime(ob.type, ob.name) || "text/plain"; var buff = ob.value; Response.AddHeader("Last-Modified", fileDate); Response.AddHeader("Content-Length", buff.length); Response.ContentType = fileType; Response.AddHeader("X-Buildtime", (new Date).getTime() - d1); return fileType.match(/image/i) ? Response.binaryWrite(buff) : ddWrite(buff); _:0} if ((!id || id === "ROOT") && reg) { Response.ContentType = "text/html"; return ddWrite(buildRootList(whole)); _:0} if (id && reg) { Response.ContentType = "text/html"; ddWrite(buildFolderList(ob)); Response.AddHeader("X-Buildtime", (new Date).getTime() - d1); return; _:0} if (Q("kids")) { return dump(zapFolders(ob)); _:0} if (Q("files")) { return dump(zapFolders2(ob)); _:0} if (Q("folders")) { zapFiles(ob); _:0} if (Q("rssIDE")) { return getFolderFeedIDE(ob); _:0} if (Q("rss")) { return getFolderFeed(ob); _:0} if (Q("ls")) { Response.ContentType = "text/plain"; return ddWrite(getLS(ob)); _:0} if (Q("dir")) { Response.ContentType = "text/plain"; return ddWrite(getDir(ob)); } if (Q("nlist")) { Response.ContentType = "text/plain"; return ddWrite(getNlist(ob)); _:0} if (Q("url")) { Response.AddHeader("content-disposition", "attachment; filename=" + ob.name + ".url"); Response.ContentType = "text/x-url"; return ddWrite("[InternetShortcut]\r\nURL=http://danml.com/pub2/?" + qs + "\r\n"); _:0} if (Q("bread")) { return doBread(origR); _:0} if (Q("nav")) { Response.ContentType = "text/html"; var a = "\t\t\t\t\t\t\t\t\t"; return ddWrite(a + getTreeHTML(Mount(ob), true) + b); _:0} if (Q("treeht")) { Response.ContentType = "text/html"; var a = "\t\t<\/script>\t\t<\/"+"script>\t\t\t
    ", b = "
\t\t\t\t<\/script>"; return ddWrite(a + getTreeHTML(Mount(ob)) + b); _:0} if (Q("tree") || Q("leaves")) { Response.ContentType = "text/plain"; return ddWrite(getTreeText(Mount(ob), Q("leaves"))); _:0} if (Q("links")) { Response.ContentType = "text/html"; Response.AddHeader("content-disposition", "attachment; filename=bookmarks-" + ob.name + ".html"); return ddWrite("\n\t\n\t\n\tBookmarks\n\t

Bookmarks

" + getLinkTree(Mount(ob), 1)); _:0} if (Q("m3u")) { Response.AddHeader("content-disposition", "attachment; filename=" + ob.name + ".m3u"); Response.ContentType = "audio/x-mpegurl"; return ddWrite(getNlist(ob)); _:0} if (Q("csv")) { Response.AddHeader("content-disposition", "attachment; filename=" + ob.name + ".csv"); Response.ContentType = "text/csv"; return ddWrite(getCSV(ob)); _:0} if (Q("soap")) { Response.ContentType = "text/xml"; return getSOAP(ob); _:0} if (Q("index")) { Response.ContentType = "application/http-index-format"; return ddWrite(getAppIndex(ob)); _:0} //end folder options Response.AddHeader("X-Buildtime", (new Date).getTime() - d1); if (Q("edit2")) { Response.ContentType = "text/html"; return ddWrite(EDITOR); _:0} if (Q("edit")) { Response.ContentType = "text/html"; return ddWrite(EDITOR2); _:0} if (Q("meta") || Q("help")) { zap(ob); _:0} dump(ob); }; /* JSON.stringify( o ,null,"\t"); function src(a){return obVals(a).toSource().replace(/\}\, /g,"}\n\n");} obVals(o).map(function(oa){ return obMap(oa).map(src).join("\n\t"); }).join("\n\n") */ //CORE 2.0: /* METHODS={ bread:({name:"bread", returns:true, type:null, valid:(function anonymous(ob) {if (Q("bread")) {doBread(origR);_;return ob;}})}), censorads:({name:"censorads", returns:false, type:null, valid:(function anonymous(ob) {if (Q("censorads")) {ob.value = ob.value.replace(/"(http\:\/\/[^"]+)"/gi, function (j, a) {a.match(/ad[s\.]/i) ? "\"about:blank\"" : "\"" + a + "\"";});_;return ob;}})}), cssmin:({name:"cssmin", returns:false, type:null, valid:(function anonymous(ob) {if (Q("cssmin")) {ob.value = compressCSS(ob.value);_;return ob;}})}), csv:({name:"csv", returns:true, type:"text/csv", valid:(function anonymous(ob) {if (Q("csv")) {Response.AddHeader("content-disposition", "attachment; filename=" + ob.name + ".csv");Response.ContentType = "text/csv";ob.value = getCSV(ob);_;return ob;}})}), data3:({name:"data3", returns:true, type:"text/html", valid:(function anonymous(ob) {if (Q("data3")) {Response.ContentType = "text/html";var fileType = type2Mime(ob.type, ob.name) || "text/plain";Response.Redirect("data:" + fileType + ";," + ob.value);_;return ob;}})}), data:({name:"data", returns:true, type:"text/plain", valid:(function anonymous(ob) {if (Q("data")) {Response.ContentType = "text/plain";var fileType = type2Mime(ob.type, ob.name) || "text/plain";ob.value = "data:" + fileType + "," + Server.URLEncode(ob.value);_;return ob;}})}), datalinks:({name:"datalinks", returns:true, type:"text/html", valid:(function anonymous(ob) {if (Q("datalinks")) {Response.ContentType = "text/html";Response.AddHeader("content-disposition", "attachment; filename=" + ob.name + ".html");ob.value = "Bookmarks" + getDataLinks(ob);_;return ob;}})}), dir:({name:"dir", returns:true, type:"text/plain", valid:(function anonymous(ob) {if (Q("dir")) {Response.ContentType = "text/plain";ob.value = getDir(ob);}if (Q("nlist")) {Response.ContentType = "text/plain";ob.value = getNlist(ob);_;return ob;}})}), download:({name:"download", returns:true, type:null, valid:(function anonymous(ob) {if (Q("download") && ob.value) {Response.AddHeader("content-disposition", "attachment; filename=" + ob.name);ob.value = ob.value;_;return ob;}})}), edit2:({name:"edit2", returns:true, type:"text/html", valid:(function anonymous(ob) {if (Q("edit2")) {Response.ContentType = "text/html";ob.value = EDITOR;_;return ob;}})}), edit:({name:"edit", returns:true, type:"text/html", valid:(function anonymous(ob) {if (Q("edit")) {Response.ContentType = "text/html";ob.value = EDITOR2;_;return ob;}})}), escape:({name:"escape", returns:false, type:null, valid:(function anonymous(ob) {if (Q("escape")) {ob.value = Server.URLEncode(ob.value);_;return ob;}})}), excel:({name:"excel", returns:true, type:"application/vnd.ms-excel", valid:(function anonymous(ob) {if (Q("excel")) {Response.ContentType = "application/vnd.ms-excel";Response.AddHeader("content-disposition", "attachment; filename=" + ob.name.replace(/\.\w+$/, "") + ".xls");ob.value = ob.value;_;return ob;}})}), files:({name:"files", returns:true, type:null, valid:(function anonymous(ob) {if (Q("files")) {dump(zapFolders2(ob));_;return ob;}})}), folders:({name:"folders", returns:false, type:null, valid:(function anonymous(ob) {if (Q("folders")) {zapFiles(ob);_;return ob;}})}), help:({name:"help", returns:false, type:null, valid:(function anonymous(ob) {if (Q("meta") || Q("help")) {zap(ob);_;return ob;}})}), htmin:({name:"htmin", returns:false, type:null, valid:(function anonymous(ob) {if (Q("htmin")) {ob.value = compressHTML(ob.value);_;return ob;}})}), importer:({name:"importer", returns:false, type:null, valid:(function anonymous(ob) {if (Q("importer")) {ob.value = importer(ob.value);_;return ob;}})}), index:({name:"index", returns:true, type:"application/http-index-format", valid:(function anonymous(ob) {if (Q("index")) {Response.ContentType = "application/http-index-format";ob.value = getAppIndex(ob);_;return ob;}})}), jsmin:({name:"jsmin", returns:false, type:null, valid:(function anonymous(ob) {if (Q("jsmin")) {ob.value = jsmin(ob.value);_;return ob;}})}), kids:({name:"kids", returns:true, type:null, valid:(function anonymous(ob) {if (Q("kids")) {dump(zapFolders(ob));_;return ob;}})}), leaves:({name:"leaves", returns:true, type:"text/plain", valid:(function anonymous(ob) {if (Q("tree") || Q("leaves")) {Response.ContentType = "text/plain";ob.value = getTreeText(Mount(ob), Q("leaves"));_;return ob;}})}), links:({name:"links", returns:true, type:"text/html", valid:(function anonymous(ob) {if (Q("links")) {Response.ContentType = "text/html";Response.AddHeader("content-disposition", "attachment; filename=bookmarks-" + ob.name + ".html");ob.value = "\n\t\n\t\n\tBookmarks\n\t

Bookmarks

" + getLinkTree(Mount(ob), 1);_;return ob;}})}), ls:({name:"ls", returns:true, type:"text/plain", valid:(function anonymous(ob) {if (Q("ls")) {Response.ContentType = "text/plain";ob.value = getLS(ob);_;return ob;}})}), m3u:({name:"m3u", returns:true, type:"audio/x-mpegurl", valid:(function anonymous(ob) {if (Q("m3u")) {Response.AddHeader("content-disposition", "attachment; filename=" + ob.name + ".m3u");Response.ContentType = "audio/x-mpegurl";ob.value = getNlist(ob);_;return ob;}})}), meta:({name:"meta", returns:false, type:null, valid:(function anonymous(ob) {if (Q("meta") || Q("help")) {zap(ob);_;return ob;}})}), mime:({name:"mime", returns:true, type:null, valid:(function anonymous(ob) {if (Q("mime")) {Response.ContentType = Q("mime").split("=")[1] || "text/plain";ob.value = ob.value;_;return ob;}})}), nav:({name:"nav", returns:true, type:"text/html", valid:(function anonymous(ob) {if (Q("nav")) {Response.ContentType = "text/html";var a = "\t\t\t\t\t
    ", b = "
\t\t\t\t";ob.value = a + getTreeHTML(Mount(ob), true) + b;_;return ob;}})}), nlist:({name:"nlist", returns:true, type:"text/plain", valid:(function anonymous(ob) {if (Q("dir")) {Response.ContentType = "text/plain";ob.value = getDir(ob);}if (Q("nlist")) {Response.ContentType = "text/plain";ob.value = getNlist(ob);_;return ob;}})}), rss:({name:"rss", returns:true, type:null, valid:(function anonymous(ob) {if (Q("rss")) {getFolderFeed(ob);_;return ob;}})}), rssIDE:({name:"rssIDE", returns:true, type:null, valid:(function anonymous(ob) {if (Q("rssIDE")) {getFolderFeedIDE(ob);_;return ob;}})}), soap:({name:"soap", returns:true, type:"text/xml", valid:(function anonymous(ob) {if (Q("soap")) {Response.ContentType = "text/xml";getSOAP(ob);_;return ob;}})}), tree:({name:"tree", returns:true, type:"text/plain", valid:(function anonymous(ob) {if (Q("tree") || Q("leaves")) {Response.ContentType = "text/plain";ob.value = getTreeText(Mount(ob), Q("leaves"));_;return ob;}})}), url:({name:"url", returns:true, type:"text/x-url", valid:(function anonymous(ob) {if (Q("url")) {Response.AddHeader("content-disposition", "attachment; filename=" + ob.name + ".url");Response.ContentType = "text/x-url";ob.value = "[InternetShortcut]\r\nURL=http://danml.com/pub2/?" + qs + "\r\n";_;return ob;}})}), word:({name:"word", returns:true, type:"application/msword", valid:(function anonymous(ob) {if (Q("word")) {Response.ContentType = "application/msword";Response.AddHeader("content-disposition", "attachment; filename=" + ob.name.replace(/\.\w+$/, "") + ".doc");ob.value = ob.value;_;return ob;}})}), words:({name:"words", returns:true, type:null, valid:(function anonymous(ob) {if (Q("words")) {dump(wc(ob.value));_;return ob;}})}), wysiwyg:({name:"wysiwyg", returns:false, type:null, valid:(function anonymous(ob) {if (Q("wysiwyg")) {ob.value = "
" + ob.value + "
";_;return ob;}})}) }; */