FSO的强大功能(5)
end if
end if
end if
end sub
sub showMe(obj1,obj2)
obj1.style.display=""
obj2.style.display="none"
end sub
sub beginDrag
'开始拖拽
delatX=window.event.clientX - px2Int(hide_control.currentStyle.left)
document.attachEvent "onmousemove",getRef("moveHandler")
dragAble = true
window.event.cancelBubble = true
end sub
sub moveHandler
'移动绑定事件
if not dragAble then exit sub
dim x
x = window.event.clientX - delatX
hide_control.style.left= x & "px"
frmTree.style.width = abs( x - 10) & "px"
frmSeach.style.width = abs( x - 10) & "px"
txtFrm.style.left=( x + 20) & "px"
window.event.cancelBubble=true
end sub
sub upHandler
'放开绑定事件
document.detachEvent "onmousemove",getRef("moveHandler")
dragAble = false
window.event.cancelBubble=true
end sub
function getTxtName(fullName)
'去掉文件名后缀
dim s:s=lastOne(fullName,".")
getTxtName = left(fullName ,len(fullName)-len(s)-1)
end function
sub reName(obj)
'改名
dim Arr,a
Arr=array("/","\",":","*","?",chr(34),"|","<",">")
for each a in Arr
if instr(obj.value,a) >0 then
alert "命名不能含有/\:*?" & chr(34) & "|<>其中的一个"
obj.focus
exit sub
end if
next
dim oldName,newName,oldPath,oldType
oldName = obj.parentElement.title
oldPath = getFolderDir(oldName)
oldType = lastOne(oldName,".")
newName = oldPath & obj.value & "." & oldType
Set f = fso.GetFile(oldName)
f.copy newName
f.delete True
obj.parentElement.title = newName
articleTitle.value = getTxtName(lastOne(newName,"\"))
end sub
Function LastOne(Str,splitStr)
'输入字符和分隔符,得到最后一部分
LastOne = right(Str,len(Str)-InStrRev(Str,splitStr))
End Function
sub selectControl
'控制页面选择的状态
if window.event.srcElement.tagName<>"INPUT" and window.event.srcElement.tagName<>"TEXTAREA" then
document.selection.clear
end if
end sub
内容版权声明:除非注明,否则皆为本站原创文章。