<HTML>
<HEAD>
<TITLE>Boy Wolf Code Manager</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
body
{
font-size:12;
BACKGROUND: #DADADA;
margin-left:5;
}
.folder
{
font-size:18;
cursor:hand;
}
.folderIcon
{
color:navy;
font-family:wingdings;
font-size:18;
cursor:hand;
}
.file
{
color:navy;
font-size:18;
cursor:hand;
height:21;
}
.fileIcon
{
color:navy;
font-family:wingdings;
font-size:18;
cursor:hand;
height:21;
display:inline;
}
input
{
width:20;
overflow:visible;
border:1px solid lightblue;
background-color:#cccccc;
cursor:text;
}
button
{
border:1px solid gray;
width:60;
margin-left:2;
cursor:hand;
font-size:12;
filter:progid:(startColorStr='#eaeaff', endColorStr='#618fff', gradientType='0');
}
textarea
{
font-family:Verdana;
width:750;
height:630;
font-size:12px;
overflow:scroll;
}
#frmTree
{
WIDTH:200px;
height:630;
MARGIN: 0px;
PADDING: 0px;
overflow:scroll;
MARGIN-right:10;
}
#frmSeach
{
WIDTH:200px;
height:630;
MARGIN: 0px;
PADDING: 0px;
overflow:scroll;
MARGIN-right:10;
}
#hide_control
{
POSITION: absolute;
LEFT:213px;
TOP:10px;
WIDTH:10px;
height:630;
BACKGROUND: #DADADA;
padding-top:300;
cursor:e-resize;
border:1 solid gray;
}
#txtFrm
{
POSITION: absolute;
LEFT:230px;
TOP:10px;
WIDTH:100%;
MARGIN: 0px;
PADDING: 0px;
BACKGROUND: #DADADA;
}
#tab1
{
border:1 solid ;
cursor:hand;
}
#tab2
{
border:1 solid ;
cursor:hand;
BACKGROUND: gray;
}
#tab3
{
border:1 solid;
cursor:hand;
BACKGROUND: gray;
}
#tab4
{
border:1 solid ;
cursor:hand;
}
</style>
</HEAD>
<BODY onselectstart="vbs:selectControl" onkeydown="vbs:shortCut">
<div onclick="vbs:f_Click" onkeydown="vbs:deletFile" >
<span > Table of Contents </span>
<span onclick="vbs:showMe frmSeach,frmTree"> Search </span> Search </span>
<hr/>
<div style='margin-left:0;color:navy;font-size:12;cursor:hand;' ></div>
</div>
<div onclick="vbs:f_Click" >
<span onclick="vbs:showMe frmTree,frmSeach" > Table of Contents </span>
<span > Search </span>
<hr/>
<div style='margin-left:0' onkeydown="deletFile">
<input style="width:100"/>
<button onclick="vbs:seachFile" >Find</button><br/>
<div style='margin-left:0' >Search results</div>
</div>
</div>
<input type="button" onmousedown="vbs:beginDrag" onmouseup="vbs:upHandler" bgcolor="#eeeeee"/>
<div valign="top" >
Title: <input style="width:100" readonly/
<button onclick="vbs:browseMe" >Preview</button>
<button onclick="vbs:saveFile" >Save</button>
<button onclick="vbs:createFile" >New</button>
<button onclick="vbs:showHelp">Instructions</button>
OK <span >1</span>
<textarea onkeydown='vbs:TabTxt' onclick="vbs:showLn"></textarea>
</div>
<SCRIPT LANGUAGE="vbscript">
'**************************
'******Super Big Stupid Wolf************
'**************************
on error resume next
,
0,0
Set fso = CreateObject("")
dim thisFileDir' defines the absolute path of this file
dim thisFileName' defines the name of this file
dim thisFileFolder' defines the path to this folder
thisFileDir = replace(,"file:///","")
thisFileDir = unescape(replace(thisFileDir,"/","\"))
thisFileName = LastOne(thisFileDir,"\")
thisFileFolder=getFolderDir(thisFileDir)
= thisFileFolder
dim currentDir' current path
dim currentFile'Current file
dim currentDiv'Current DIV object
dim currentSpan'Current Span object
dim delatX
dim dragAble:dragAble = false
currentDir = thisFileFolder
set currentDiv = tree
= getTxtName(thisFileName)
showMe frmTree,frmSeach
showFolder tree
sub showLn
= cint((-2)/15)+1
end sub
sub shortCut
if =83 and then
if currentFile<>"" then saveFile
= true
= false
end if
if =66 and then
browseMe
= true
= false
end if
if =78 and then
createFile
= true
= false
end if
end sub
sub browseMe
dim win
set win=()
end sub
sub createFile
'Click the Create button, it's really created.
if vartype(currentSpan)<>0 then = "navy"
if currentDir ="" then
'If you click on the file
currentDir=getFolderDir(currentFile)
else
'Click on the folder
dim n
set n=
do
if vartype(n) =9 then exit do
if left(,len(currentDir)) <> currentDir then exit do
set currentDiv =n
set n=
loop
end if
dim re,newFile,s,f
set re = new RegExp
= "[^\d]"
=true
newFile = currentDir & "New Collection" & (mid(cstr(now()),3),"") & ".txt"
currentFile=newFile'The new file is the current file
'Construct innerHTML
s = "<div class='file' title='" & newFile
s = s & "' style='margin-left:"
if = "file" then
s = s & & ";' > "
else
s = s & px2Int() + 8 & ";' > "
end if
s = s & "<span class='fileIcon'>2" & "</span>"
s = s & "<input value='"
s = s & getTxtName(lastOne(newFile,"\")) & "' title='" & getTxtName(lastOne(newFile,"\")) & "' onchange='vbs:reName me' />"
s = s & "</div>"
'Insert innerHTML
"AfterEnd",s
= getTxtName(lastOne(newFile,"\"))
= ""
currentDir = ""
set currentDiv =
set currentSpan = ("SPAN")(0)
= "red"
'Create a file
set f=(newFile)
end sub
function getFolderDir(fullDir)
'Input gets the full path, gets the folder path
s=LastOne(fullDir,"\")
getFolderDir = left(fullDir,len(fullDir)-len(s))
end function
sub saveFile
'Save the modification to the file
Dim st
Set st = (currentFile, 2, True)
end sub
sub deletFile
'Delete the file
dim n
if =46 and <>"INPUT" then
if currentFile<>"" then
if currentFile = thisFileDir then
alert "This file is not allowed to be deleted!"
exit sub
end if
if (currentFile) then
currentFile,true
currentDiv
= ""
currentFile = ""
= ""
end if
end if
if currentDir<>"" then
if currentDir = thisFileFolder then
alert "No deletion of root directory is allowed!"
exit sub
end if
set n =
if ( currentDir & vbcrlf & "This folder has subfiles, do you want to delete all subfiles?") then
do
if vartype(n) =9 then exit do
if px2Int() <= px2Int() then exit do
n
set n=
loop
if (currentDir) then currentDir
currentDiv
end if
end if
end if
end sub
sub showMe(obj1,obj2)
=""
="none"
end sub
sub beginDrag
'Start dragging
delatX= - px2Int(hide_control.)
"onmousemove",getRef("moveHandler")
dragAble = true
= true
end sub
sub moveHandler
'Mobile binding event
if not dragAble then exit sub
dim x
x = - delatX
hide_control.= x & "px"
= abs( x - 10) & "px"
= abs( x - 10) & "px"
=( x + 20) & "px"
=true
end sub
sub upHandler
'Let the binding event be released
"onmousemove",getRef("moveHandler")
dragAble = false
=true
end sub
function getTxtName(fullName)
'Remove the file name suffix
dim s:s=lastOne(fullName,".")
getTxtName = left(fullName ,len(fullName)-len(s)-1)
end function
sub reName(obj)
'Change name
dim Arr,a
Arr=array("/","\",":","*","?",chr(34),"|","<",">")
for each a in Arr
if instr(,a) >0 then
alert "The naming cannot contain /\:*?" & chr(34) & "|<>One of them"
exit sub
end if
next
dim oldName,newName,oldPath,oldType
oldName =
oldPath = getFolderDir(oldName)
oldType = lastOne(oldName,".")
newName = oldPath & & "." & oldType
Set f = (oldName)
newName
True
= newName
= getTxtName(lastOne(newName,"\"))
end sub
Function LastOne(Str,splitStr)
'Enter characters and separators to get the last part
LastOne = right(Str,len(Str)-InStrRev(Str,splitStr))
End Function
sub selectControl
'Control the status of page selection
if <>"INPUT" and <>"TEXTAREA" then
end if
end sub
function isTXT(fileNameStr)
'Just determine whether it is a text type file
dim s,Arr,a,returnValue
returnValue = false
s=lcase(LastOne(fileNameStr,"."))
Arr=array("txt","htm","html","asp","csv","aspx","xml","js","vbs","ini","bat","css","htc","hta","xsl","xslt","sql")
for each a in Arr
if a=s then
returnValue =true
exit for
end if
next
isTXT = returnValue
end function
sub showFolder(obj)
dim folderspec :folderspec =
"parsed",true
if not (folderspec) then
alert folderspec & "This folder does not exist, maybe it was moved, so refresh this program"
exit sub
end if
dim f, f1, sf,sf1,i,s,fName
set f=(folderspec)
set sf=
re = re & & "\"
s=""
for each sf1 in sf
s = s & "<div class='folder' title='" & & "\' style='margin-left:" & cint(replace(,"px","")) + 8 & ";'>"
s = s & "<span class='folderIcon'>0" & "</span><input value='" & & "' readonly style='cursor:hand;'/></div>"
next
For Each f1 in
if isTXT() then
s = s & "<div class='file' title='" &
s = s & "' style='margin-left:"
s = s & px2Int() + 8 & ";' > "
s = s & "<span class='fileIcon'>2" & "</span>"
s = s & "<input value='"
fName = getTxtName()
s = s & fName & "' title='" & fName & "' onchange='vbs:reName me' />"
s = s & "</div>"
end if
Next
"AfterEnd",s
end sub
function px2Int(px)
px2Int = cint(replace(px,"px",""))
end function
sub f_Click()
dim obj,d,f,state
set obj =
if ="searchKey" then exit sub
if <>"SPAN" and <>"INPUT" then exit sub
set currentDiv =
set obj = ("SPAN")(0)
= true
select case
case "folderIcon"
'Click on the folder
if vartype(currentSpan)=8 then
= "navy"
end if
set currentSpan = obj
state = abs(cint() -1)
= state
="red"
set d =
currentDir =
currentFile = ""
if ("parsed")=true then
'Close
fold d,state
else
'Analysis
showFolder d
end if
case "fileIcon"
'Click on the file and load the text file in the textArea
if vartype(currentSpan)=8 then
= "navy"
end if
set currentSpan = obj
="red"
readText
currentDir = ""
currentFile =
end select
end sub
sub fold(o,stateOpen) 'Collapse
dim n
set n=
do
if vartype(n) =9 then exit do
if px2Int() <= px2Int() then exit do
if stateOpen=1 then ="" else ="none"
set n=
loop
end sub
sub readText(filePath)
Dim f,fName
if not (filePath) then
alert filePath & vbcrlf & "This file does not exist, maybe it was moved, so refresh this program"
exit sub
end if
'TXT's current file that has been loaded is no longer loaded.
if filePath = currentFile then exit sub
= ""
Set f = (filePath, 1, true)
if not then
=
else
= ""
end if
fName = lastOne(filePath,"\")
= getTxtName(fName)
= 1
End sub
sub TabTxt()
'Text box that supports tab key
if =38 then
if cint() >1 then = cint()-1
end if
if =40 then
= cint()+1
end if
if <> 9 then exit sub
dim sel,mytext
set sel = ()
'
mytext =
if len(mytext)=0 then
=string(4," ")
= true
= false
exit sub
end if
dim t,Arr
t=0
Arr = split(mytext,vbcrlf)
if then
'Press sift
for i=0 to ubound(Arr)
if left(Arr(i),1)=vbtab then
Arr(i) = mid(Arr(i),2)
t= t + 1
else
for j=1 to 4
if left(Arr(i),1)=" " then
Arr(i) = mid(Arr(i),2)
t= t + 1
else
exit for
end if
next
end if
next
t= t
else
'Don't press sift
for i=0 to ubound(Arr)
Arr(i) = vbtab & Arr(i)
t= t +1
next
end if
mytext = join(Arr,vbcrlf)
= mytext
true
"character",0
"character",(len(mytext) * -1) + t
()
= true
= false
end sub
'The following is about search
dim seachResult'Search Results
dim num 'Result Number
dim word'Search keyword
tagStop = false
seachResult =""
sub seachFile()
num =0
= “Search results”
word =
seachResult =""
if trim(word)="" then
alert "Keyword is empty!"
exit sub
else
dim l
for each l in ("DIV")
if <>"seachList" then l
next
= “Search results”
seachWord thisFileFolder
"AfterEnd",seachResult
= "Search results: " & num & "
alert "Search completed!"
end if
end sub
sub seachWord(theFolder)
dim f,f1,st,re,fd,fd1
set f = (theFolder)
for each f1 in
if isTxt() then
if instr(,word)>0 then
seachResult = seachResult & "<div class='file' title='" &
seachResult = seachResult & "'><span class='fileIcon'>2" & "</span>"
seachResult = seachResult & "<input value='"
fName = getTxtName()
seachResult = seachResult & fName & "' title='" & fName & "'>"
seachResult = seachResult & "</div>"
num = num + 1
else
set st =
'Reading line by line
Do While <> True
if instr(,word)>0 then
num = num +1
seachResult = seachResult & "<div class='file' title='" &
seachResult = seachResult & "'><span class='fileIcon'>2" & "</span>"
seachResult = seachResult & "<input value='"
fName = getTxtName()
seachResult = seachResult & fName & "' title='" & fName & "'>"
seachResult = seachResult & "</div>"
exit do
end if
Loop
end if
end if
next
set fd = (theFolder)
for each fd1 in
seachWord fd1
next
end sub
sub showHelp
dim msg
msg = “Text Code Management Tool [IE5.5 or above]” & vbcrlf
msg = msg & "------------------------------------------------" & vbcrlf
msg = msg & " How to use: Put it in a folder of text type and double-click to run." & vbcrlf
msg = msg & "Function:" & vbcrlf
msg = msg & "1, quick browse, preview CTRL+B, search for text-type files and code;" & vbcrlf
msg = msg & "2, press DEL to delete files and folders in the dot;" & vbcrlf
msg = msg & "3, you can modify the file name and text content, save CTRL+S;" & vbcrlf
msg = msg & "4, you can create file CTRL+N and edit and save;" & vbcrlf
msg = msg & "5, text editing supports TAB and shift+TAB keys;" & vbcrlf
msg = msg & vbcrlf
msg = msg & "Author: CSDN Super Big Stupid Wolf [2005/1/18 Version]" & vbcrlf
msg = msg & "Welcome to spread and use, exchange code panyuguang962@" & vbcrlf
msg = msg & "/" & vbcrlf
alert msg
end sub
</SCRIPT>
</BODY>
</HTML>