[原创]php+ajax实现模拟Win文件管理系统十
document.getElementById('t').style.display='block';
}
function Copy(path,tage){//复制文件
var time = new Date();
var filepath ="filepath";
time.setTime(time.getTime()+60000);
if(tage == 'c'){
document.getElementById(path).style.filter = "Alpha(Opacity=50,style=0);";//设置透明度让用户感觉是文件被剪切了,
path=path+"|";
}
document.cookie = filepath+"="+path+"; expires="+time.toGMTString()+"; path=/";//由于要用到全局变量所以用了cookie保存功能,
}
function Past(cookname,currentpath){//取得剪板中的文件
if(cookname == "" ){return false;}
var cookies = document.cookie;
if(cookies == ""){ alert("剪切贴为空!"); return false; }
var arrar = cookies.split("; ");
for(var i=0;i
if( arrar[i].indexOf(cookname)!= -1 ){
returnvalue=arrar[i].split("=");
Pastfile(returnvalue[1],currentpath);
}
}
}
function Pastfile(p_file,p_path){// 粘贴文件
CreateAjax();
var name=p_file.substring(p_file.lastIndexOf("/")+1);
var url="rename.php?path="+encodeURI(p_path.replace("/","\/"))+"&nname="+name+"©path="+p_file+"&action=past&rd="+Math.random();
Senddata('GET',url,Pastreturn,'');
}
function Pastreturn(){
if(xmlhttp.readystate == 4 || xmlhttp.status == 200){
window.location.reload();
}
}