Home > Article > Web Front-end > Gamer folder program ver 3.0_javascript skills
/*********************************************
Gamer Folder Program ver 3.0
This JavaScript was written by Dron.
@2003-2008 Ucren.com All rights reserved.
********************** **********************/
var inner = document.getElementById("inner");
var addr = document.getElementById("addr");
var goupb = document.getElementById("goupb");
//Get the value passed in the address bar
function QueryString(qs)
{
s = location.href;
s = s.replace("?","? &").split("&");
re = "";
for(i=1;i
if(s[i]. indexOf(qs "=")==0)
{
re = s[i].replace(qs "=","");
}
}
return re;
}
//Get url
var url = QueryString("url");
if(url=="")
{
url="/";
}
else
{
url = unescape(url) ;
};
//Remote directory
addr.value = " U:" url.replace(///g,"\");
//If the highest level directory, lock goupb
if(url=="/")
{
goupb.disabled = true;
}
//Enter the next target
function gotopage(str)
{
location.href = "files.html?url=" escape(url str "/");
}
//Return to the previous 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
searchRecord("index ","rs('index','pro')==url");
setRecord("index",useRecords[1]*1);
var dvfile = "DataVess/" rs("index ","dvfile") ".dv";
//Show icons
function showicons()
{
var len = recordCount("FolderInfo");
var s = [" "];
for(var i=1;i<=len;i )
{
setRecord("FolderInfo",i);
var fn = rs("FolderInfo","Name ");
var ft = rs("FolderInfo","Type");
if(fn.replace(/[^x00-xff]/g,"ab").length>12)
{
fn = fn.substr(0,4) "...";
}
if(ft=="")
{
ft = "nopic";
}
if(rs("FolderInfo","Type")=="Folder")
{
s = s.concat(["
" fn "
}
else
{
s = s.concat([ "
" fn "
}
}
s = s.join("");
if(s=="")
s = "
No file"
inner.innerHTML = s;
}
//Reading capacity
loadDataVess(dvfile,"showicons()");