Dim Fs,Fp,Ofp
Dim strLine,strTag
Dim bFirst
Dim regEx,Matches
Dim strTargetTitle,strTargetUrl
Dim IdCount
Set Fs = CreateObject("Scripting.FileSystemObject")
Set regEx = New RegExp
Set Fp = Fs.OpenTextFile( "php_manual_ja.hhc", 1 )
Set Ofp = Fs.CreateTextFile( "control.htm", True )
Ofp.WriteLine "<SCRIPT language=VBScript>"
Ofp.WriteLine "Dim Loc"
Ofp.WriteLine "function Init()"
Ofp.WriteLine "Dim aWork,i,Elements"
Ofp.WriteLine "Loc = window.location"
Ofp.WriteLine "aWork = Split( Loc, ""/"" )"
Ofp.WriteLine "Loc = """""
Ofp.WriteLine "For i = 0 to Ubound( aWork ) - 1"
Ofp.WriteLine " if i <> 0 then"
Ofp.WriteLine " Loc = Loc & ""/"""
Ofp.WriteLine " end if"
Ofp.WriteLine " Loc = Loc & aWork(i)"
Ofp.WriteLine "Next"
Ofp.WriteLine "Loc = ""ms-its:"" & Loc & ""/php_manual_ja.chm::/"""
Ofp.WriteLine "Set Elements = document.all.tags(""INPUT"")"
Ofp.WriteLine "For i = 0 to Elements.length - 1"
Ofp.WriteLine " Elements(i).checked = false"
Ofp.WriteLine "Next"
Ofp.WriteLine "end function"
Ofp.WriteLine "function Cont( id )"
Ofp.WriteLine "if document.all( id ).style.display = """" then"
Ofp.WriteLine " document.all( id ).style.display = ""none"""
Ofp.WriteLine "else"
Ofp.WriteLine " document.all( id ).style.display = """""
Ofp.WriteLine "end if"
Ofp.WriteLine "end function"
Ofp.WriteLine "</SCRIPT>"
Ofp.WriteLine "<SCRIPT for=window event=onload language=""VBScript"">"
Ofp.WriteLine " Call Init()"
Ofp.WriteLine "</SCRIPT>"
Ofp.WriteLine "<HTML>"
Ofp.WriteLine "<HEAD>"
Ofp.WriteLine "<META HTTP-EQUIV=""Content-Type"" CONTENT=""text/html; CHARSET=Shift_JIS"">"
Ofp.WriteLine "<LINK rel=""stylesheet"" href=""style.css"">"
Ofp.WriteLine "</HEAD>"
Ofp.WriteLine "<BODY>"
Ofp.WriteLine "<TABLE width=500 cellspacing=0 cellpadding=3><tr><td>"
bFirst = True
IdCounrt = 0
strTargetTitle = "" : strTargetUrl = ""
Do While not Fp.AtEndOfStream
strLine = Fp.ReadLine
strLine = Ltrim( strLine )
strTag = Left( strLine, 4 )
strTag = Ucase( strTag )
Select Case strTag
Case "<UL>"
if bFirst then
bFirst = False
Ofp.WriteLine "<UL>"
else
Ofp.WriteLine "<LI><INPUT style='margin-left:-23' type=checkbox onClick='Call Cont(""Id" & IdCount _
& """)'><SPAN onClick='parent.Act.location=Loc&""" & strTargetUrl & """'>" & strTargetTitle & "</SPAN>"
Ofp.WriteLine "<UL id=Id" & IdCount & " style='display:none'>"
strTargetTitle = "" : strTargetUrl = ""
end if
Case "</UL"
if strTargetUrl <> "" then
Ofp.WriteLine "<LI><SPAN onClick='parent.Act.location=Loc&""" & strTargetUrl & """'>" & strTargetTitle & "</SPAN>"
strTargetTitle = "" : strTargetUrl = ""
end if
Ofp.WriteLine "</UL>"
Case "</BO"
if strTargetUrl <> "" then
Ofp.WriteLine "<LI><SPAN onClick='parent.Act.location=Loc&""" & strTargetUrl & """'>" & strTargetTitle & "</SPAN>"
strTargetTitle = "" : strTargetUrl = ""
end if
Case "<LI>"
if strTargetUrl <> "" then
Ofp.WriteLine "<LI><SPAN onClick='parent.Act.location=Loc&""" & strTargetUrl & """'>" & strTargetTitle & "</SPAN>"
strTargetTitle = "" : strTargetUrl = ""
end if
IdCount = IdCount + 1
strLine = Fp.ReadLine
regEx.Pattern = "name=""([^""]+)"".+value=""([^""]+)"""
regEx.Global = True
Set Matches = regEx.Execute(strLine) ' 検索を実行
For Each Match in Matches
if Ucase(Match.SubMatches(0)) = "NAME" then
strTargetTitle = Match.SubMatches(1)
Exit For
end if
if Ucase(Match.SubMatches(0)) = "LOCAL" then
strTargetUrl = Match.SubMatches(1)
Exit For
end if
Next
strLine = Fp.ReadLine
regEx.Pattern = "name=""([^""]+)"".+value=""([^""]+)"""
regEx.Global = True
Set Matches = regEx.Execute(strLine) ' 検索を実行
For Each Match in Matches
if Ucase(Match.SubMatches(0)) = "NAME" then
strTargetTitle = Match.SubMatches(1)
Exit For
end if
if Ucase(Match.SubMatches(0)) = "LOCAL" then
strTargetUrl = Match.SubMatches(1)
Exit For
end if
Next
End Select
Loop
Ofp.WriteLine "</TD><TR></TABLE>"
Ofp.WriteLine "</BODY>"
Ofp.WriteLine "</HTML>"
Ofp.Close
Fp.Close
<LI><INPUT style='margin-left:-23' type=checkbox onClick='Call Cont("Id539")'>
<SPAN onClick='parent.Act.location=Loc&"ja/ref.dir.html"'>ディレクトリ関数</SPAN>
<UL id=Id539 style='display:none'>
<LI><SPAN onClick='parent.Act.location=Loc&"ja/function.chdir.html"'>chdir</SPAN>
<LI><SPAN onClick='parent.Act.location=Loc&"ja/function.chroot.html"'>chroot</SPAN>
<LI><SPAN onClick='parent.Act.location=Loc&"ja/class.dir.html"'>dir</SPAN>