📄 downlist.js
字号:
}
}
}
function copy(src)
{
var s=src.value;
if (s!="")
{ window.parent.parent.title.txtPaste.value ="cpy"+s;
window.parent.parent.title.btnPaste.src="image/paste1.gif";
window.parent.parent.title.btnPaste.setAttribute("flag",1);
}
else
{ window.parent.parent.title.txtPaste.value ="";
window.parent.parent.title.btnPaste.src="image/paste3.gif";
window.parent.parent.title.btnPaste.setAttribute("flag",0);
}
}
function cut(src)
{
var s=src.value;
if (s!="")
{ window.parent.parent.title.txtPaste.value ="cut"+s;
window.parent.parent.title.btnPaste.src="image/paste1.gif";
window.parent.parent.title.btnPaste.setAttribute("flag",1);
}
else
{ window.parent.parent.title.txtPaste.value ="";
window.parent.parent.title.btnPaste.src="image/paste3.gif";
window.parent.parent.title.btnPaste.setAttribute("flag",0);
}
}
function paste(src)
{
if (window.parent.parent.title.btnPaste.getAttribute("flag")==1)
{
var s=window.parent.parent.title.txtPaste.value;
var s1=window.parent.parent.frmTree.curpath.value;
window.parent.parent.download1.location.href="action.asp?cmd=paste%20"+s+"&dest="+s1;
}
}
function txtSelectchange()
{ var s1,a,i;
var totalkb=0;
var r=/\?/gi;
var r1=/,/gi;
var s=txtSelect.value;
if (s!="")
{
a=s.split(r1);
window.parent.parent.frmTree.sta.innerText="选中"+a.length+"个对象";
for (i=0;i<a.length;i++)
{
totalkb=totalkb+Math.abs(document.all(a[i]).getAttribute("dsize"));}
window.parent.sta.innerText="共"+totalkb+"KB";
s=a[0];
if (s!=""&&window.parent.parent.title.btnPreview.getAttribute("flag")==1)
{
s1=s.substr(s.lastIndexOf("/")+1);
window.parent.dspfilename.innerText=s1.replace(r," ")+" ";
window.parent.preview.location.href="action.asp?cmd=open%20"+s;
// window.parent.parent.download1.location.href="action.asp?cmd=open%20"+s+"&wnd=preview";
}
}
else
{ window.parent.parent.frmTree.sta.innerText=window.parent.parent.frmTree.sta.getAttribute("ss");
window.parent.sta.innerText=window.parent.sta.getAttribute("ss");
}
}
function bodyKeyup()
{
if (window.event.ctrlKey&&(window.event.keyCode==67||window.event.keyCode==99)) copy(txtSelect); // ctrl+c
if (window.event.ctrlKey&&(window.event.keyCode==88||window.event.keyCode==120)) cut(txtSelect); // ctrl+x
if (window.event.ctrlKey&&(window.event.keyCode==86||window.event.keyCode==118)) paste(txtSelect); // ctrl+v
}
function txtSelectKeyup(obj)
{
var s="";
var s1="";
var tmps;
if (window.event.keyCode==46) dele();
if (window.event.ctrlKey&&(window.event.keyCode==67||window.event.keyCode==99)) // ctrl+c
{copy(obj);window.event.cancelBubble=true;}
if (window.event.ctrlKey&&(window.event.keyCode==88||window.event.keyCode==120)) // ctrl+x
{cut(obj);window.event.cancelBubble=true;}
if (window.event.ctrlKey&&(window.event.keyCode==86||window.event.keyCode==118)) // ctrl+v
{paste(obj);window.event.cancelBubble=true;}
if (window.event.keyCode==38) //up
{
s=obj.value;
s1=txtallid.value;
if (s=="")
{
s=s1.substr(0,s1.length-1);
tmps=s.substr(s.lastIndexOf(",")+1);
}
else
{
s=s1.substr(0,s1.indexOf(s)-1);
if (s.lastIndexOf(",")>=0)
tmps=s.substr(s.lastIndexOf(",")+1);
else
if (s!="")
tmps=s;
else
tmps="";
}
if (tmps=="")
alert("到头拉!");
else
{ document.all(tmps).click();}
}
if (window.event.keyCode==40) //down
{
s=obj.value;
s1=txtallid.value;
if (s=="")
{
tmps=s1.substr(0,s1.indexOf(","));
}
else
{
tmps=s1.substr(s1.indexOf(s));
tmps=tmps.substr(tmps.indexOf(",")+1);
tmps=tmps.substr(0,tmps.indexOf(","));
}
if (tmps=="")
alert("到头拉!");
else
document.all(tmps).click();
}
}
function rightclick()
{
if (event.button==2)
{
alert('呵呵,想看源代码!');
}
}
//document.onmousedown=rightclick
menuItems = new Array();
menuItemNum = 0;
menuWidth = 100; //menu width
menuHeight = 220; //menu height
menuDelay = 50; //delay before menu appears
menuSpeed = 8; //speed which menu appears (lower=faster)
menuOffset = 2; //offset of menu from mouse pointer
function showMenu(){
menuXPos = event.clientX + menuOffset;
menuYPos = event.clientY + menuOffset;
menuXIncrement = menuWidth / menuSpeed;
menuYIncrement = menuHeight / menuSpeed;
menuTimer = setTimeout("openMenu(0,0)", menuDelay);
return false;
}
function openMenu(height, width){
iHeight = height;
iWidth = width;
menuPopup.show(menuXPos, menuYPos, iWidth, iHeight, document.body);
if(iHeight < menuHeight)
menuTimer = setTimeout("openMenu(iHeight + menuYIncrement, iWidth + menuXIncrement)", 1);
else
clearTimeout(menuTimer);
}
function addMenuItem(text, url, img){
if(img) menuItems[menuItemNum] = new Array(text, url, img);
else if(text) menuItems[menuItemNum] = new Array(text, url);
else menuItems[menuItemNum] = new Array();
menuItemNum++;
}
addMenuItem("后退","imgBack");
addMenuItem("前进","imgForward");
addMenuItem("上一级","imgUP");
addMenuItem();
addMenuItem("拷贝","btnCopy");
addMenuItem("剪切","btnCut");
addMenuItem("粘贴","btnPaste");
addMenuItem("删除","btnDel");
addMenuItem();
addMenuItem("新建文件","btnNewfile");
addMenuItem("新建文件夹","btnNewfolder");
addMenuItem("刷新","btnRefresh");
addMenuItem();
addMenuItem("属性","btnP");
///////////////////////////////////////////////////////////////////////////////
// do not edit the code below, it is required for the menu to work correctly
///////////////////////////////////////////////////////////////////////////////
//只有IE5.5才能popup menu
if(window.navigator.appName == "Microsoft Internet Explorer")// && window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5, window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5)
isIe = 1;
else
isIe = 0;
if(isIe)
{
menuContent = '<table id="rightMenu" width="0" height="0" cellspacing="0" cellpadding="0" style="font:menu;color:menutext;"><tr height="1"><td style="background:threedlightshadow" colspan="4"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight" colspan="2"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="10"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"><table cellspacing="0" cellpadding="0" nowrap style="font:menu;color:menutext;cursor:default;">';
for(m=0;m<menuItems.length;m++)
{
if(menuItems[m][0] && menuItems[m][2])
menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="javascript:this.style.background=\'threedface\';this.style.color=\'menutext\';window.parent.parent.parent.title.document.all(\'' + menuItems[m][1] + '\').onclick();"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap><img src="' + menuItems[m][2] + '"></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';
else if(menuItems[m][0])
menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="javascript:this.style.background=\'threedface\';this.style.color=\'menutext\';window.parent.parent.parent.title.document.all(\'' + menuItems[m][1] + '\').onclick();"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';
else
menuContent += '<tr><td colspan="5" height="4"></td></tr><tr><td colspan="5"><table cellspacing="0"><tr><td width="2" height="1"></td><td width="0" height="1" style="background:threedshadow"></td><td width="2" height="1"></td></tr><tr><td width="2" height="1"></td><td width="100%" height="1" style="background:threedhighlight"></td><td width="2" height="1"></td></tr></table></td></tr><tr><td colspan="5" height="3"></td></tr>';
}
menuContent += '</table></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedshadow" colspan="3"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threeddarkshadow" colspan="5"></td></tr></table>';
document.oncontextmenu = showMenu;
menuPopup = window.createPopup();
menuPopup.document.body.innerHTML = menuContent;
//document.oncontextmenu = showMenu;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -