FSO的强大功能(3)
tree.title = thisFileFolder
dim currentDir'当前路径
dim currentFile'当前文件
dim currentDiv'当前DIV对象
dim currentSpan'当前Span对象
dim delatX
dim dragAble:dragAble = false
currentDir = thisFileFolder
set currentDiv = tree
tree.innerText = getTxtName(thisFileName)
showMe frmTree,frmSeach
showFolder tree
sub showLn
Ln.innerText = cint((window.event.offsetY-2)/15)+1
end sub
sub shortCut
if window.event.keyCode=83 and window.event.ctrlKey then
if currentFile<>"" then saveFile
window.event.cancelBubble = true
window.event.returnValue = false
end if
if window.event.keyCode=66 and window.event.ctrlKey then
browseMe
window.event.cancelBubble = true
window.event.returnValue = false
end if
if window.event.keyCode=78 and window.event.ctrlKey then
createFile
window.event.cancelBubble = true
window.event.returnValue = false
end if
end sub
sub browseMe
dim win
set win=window.open()
win.document.write txt.value
end sub
sub createFile
'点创建按钮,真的创建了.
if vartype(currentSpan)<>0 then currentSpan.style.color = "navy"
if currentDir ="" then
'如果点到了文件
currentDir=getFolderDir(currentFile)
else
'点到了文件夹
dim n
set n=currentDiv.nextSibling
do
if vartype(n) =9 then exit do
if left(n.title,len(currentDir)) <> currentDir then exit do
set currentDiv =n
set n=n.nextSibling
loop
end if
dim re,newFile,s,f
set re = new RegExp
re.Pattern = "[^\d]"
re.Global=true
newFile = currentDir & "新收藏" & re.Replace(mid(cstr(now()),3),"") & ".txt"
currentFile=newFile'新建文件是当前文件
'构造innerHTML
s = "<div class='file' title='" & newFile
s = s & "' style='margin-left:"
if currentDiv.className = "file" then
s = s & currentDiv.style.marginLeft & ";' > "
else
s = s & px2Int(currentDiv.style.marginLeft) + 8 & ";' > "
内容版权声明:除非注明,否则皆为本站原创文章。