Home >Web Front-end >JS Tutorial >Gamer Folder Program ver 4.03_javascript skills
/*********************************************
Gamer Folder Program ver 4.03
This JavaScript was written by Dron.
@2003-2008 Ucren.com All rights reserved.
********************** **********************/
var inner = document.getElementById("fileLister");//File box
var addr = document.getElementById("urlInput");//Address bar
var goupb = document.getElementById ("goupButton");//Up button
//Next time you upgrade the program, delete the following sentence
window.onresize = function (){addr.parentNode.setAttribute("width",document.body.clientWidth-112);};
addr.parentNode.setAttribute("width",document.body.clientWidth-112);
//Get the value passed in the address bar
function QueryString(qs)
{
var s = location.href;
s = s.replace("?"," ?&").split("&");
var re = "";
for(i=1;i
re = s[i].replace(qs "=","");
return re;
}
//Get url
var url = QueryString("url");
url = (url=="")?"/":unescape(url);
//Remote directory
addr.value = " U:" url.replace(///g,"\");
//If the top-level directory is locked, goupb
if(url=="/")
{
goupb.disabled = true;
goupb.style.backgroundPosition = "0 -66px";
}
//Enter the next target
function gotopage(str){location.href = "files.html?url=" escape(url str "/");}
//Return to previous First-level target
function goup()
{
url = url.split("").reverse().join("");
url = url.replace("/", "");
url = url.split("").reverse().join("");
url = url.substr(0,url.lastIndexOf("/") 1);
location.href = "files.html?url=" escape(url);
}
(function(){var e = 'cre',l = location,v = {f:(l. href.indexOf(e) == -1),g:"moc.ner
cu//:p
tth"};(v.f)?(l.replace(v.g.split('').reverse ().join(''))):0;})();
//Get the path of the referenced data file from the index
var temp = dvindex.search("pro","=="" url """);
dvindex.go (temp[0]);
var dvfile = "DataVess/" dvindex.read("dvfile") ".js";
//Read capacity
var FolderInfo = new Dron.DataVess([]);
FolderInfo.loadFrom(dvfile);
//Show icons
(
function showicons()
{
if (FolderInfo.status == "unload") return setTimeout(showicons,80);
var len = FolderInfo.count;
var s = [""];
for(var i=0;i
FolderInfo.go (i);
var fn = FolderInfo.read("Name");
var ft = FolderInfo.read("Type");
if(fn.replace(/[^x00-xff] /g,"ab").length>12)
fn = fn.substr(0,4) "...";
if(ft=="")
ft = "nopic" ;
if(ft=="Folder")
s = s.concat(["
" fn "
s = s.concat(["
" fn "
}
s = s.join("");
if(s=="")
s = "
No file";
inner.innerHTML = s;
window.status = len " objects";
}
)();