• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

ギコナビ


Commit MetaInfo

Revisión448c43accfd58d7bea240992bd3bae929a213729 (tree)
Tiempo2006-06-26 00:58:22
Autorcvs2git <cvs2git>
Commitercvs2git

Log Message

This commit was manufactured by cvs2svn to create tag 'v1_52_0_660'.

Cambiar Resumen

Diferencia incremental

--- a/Editor.dfm
+++ b/Editor.dfm
@@ -374,6 +374,9 @@ object EditorForm: TEditorForm
374374 object Samba241: TMenuItem
375375 Action = UpdateSambaAction
376376 end
377+ object Cookie1: TMenuItem
378+ Action = ReleaseCookieAction
379+ end
377380 object N7: TMenuItem
378381 Caption = '-'
379382 end
@@ -1704,6 +1707,7 @@ object EditorForm: TEditorForm
17041707 Caption = 'SETTING.TXT'#21462#24471
17051708 Hint = 'SETTING.TXT'#21462#24471
17061709 OnExecute = GetSETTINGTXTActionExecute
1710+ OnUpdate = GetSETTINGTXTActionUpdate
17071711 end
17081712 object GetTitlePictureAction: TAction
17091713 Category = #26495#24773#22577
@@ -1717,6 +1721,7 @@ object EditorForm: TEditorForm
17171721 Caption = #12525#12540#12459#12523#12523#12540#12523#12398#21462#24471
17181722 Hint = #12525#12540#12459#12523#12523#12540#12523#12398#21462#24471
17191723 OnExecute = GetHeadTXTActionExecute
1724+ OnUpdate = GetHeadTXTActionUpdate
17201725 end
17211726 object CalcCapacityAction: TAction
17221727 Category = #32232#38598
@@ -1759,6 +1764,12 @@ object EditorForm: TEditorForm
17591764 ImageIndex = 11
17601765 OnExecute = ShowInputAssistFormExecute
17611766 end
1767+ object ReleaseCookieAction: TAction
1768+ Category = #12501#12449#12452#12523
1769+ Caption = 'Cookie'#24773#22577#21066#38500
1770+ Hint = 'Cookie'#12398#24773#22577#12434#21066#38500#12377#12427
1771+ OnExecute = ReleaseCookieActionExecute
1772+ end
17621773 end
17631774 object IdLogDebug: TIdLogDebug
17641775 OnReceive = IdLogDebugReceive
--- a/Editor.pas
+++ b/Editor.pas
@@ -118,7 +118,7 @@ type
118118 LocalEdit: TMemo;
119119 N6: TMenuItem;
120120 LocalRuleBrowse: TMenuItem;
121- ToolButton4: TToolButton;
121+ ToolButton4: TToolButton;
122122 ToolButton6: TToolButton;
123123 SaveNameMailAction: TAction;
124124 ToolButton7: TToolButton;
@@ -133,6 +133,8 @@ type
133133 ToolButton8: TToolButton;
134134 ToolButton9: TToolButton;
135135 ShowInputAssistForm: TAction;
136+ ReleaseCookieAction: TAction;
137+ Cookie1: TMenuItem;
136138
137139 procedure EditorPageChange(Sender: TObject);
138140 procedure FormCreate(Sender: TObject);
@@ -191,6 +193,9 @@ type
191193 procedure ApplicationEvents1Message(var Msg: tagMSG;
192194 var Handled: Boolean);
193195 procedure ShowInputAssistFormExecute(Sender: TObject);
196+ procedure ReleaseCookieActionExecute(Sender: TObject);
197+ procedure GetSETTINGTXTActionUpdate(Sender: TObject);
198+ procedure GetHeadTXTActionUpdate(Sender: TObject);
194199 private
195200 FThreadItem: TThreadItem;
196201 FBoard: TBoard;
@@ -260,6 +265,8 @@ type
260265 procedure InputAssistMenuClick(Sender: TObject);
261266 //! TMemo‚̃J[ƒ\ƒ‹ˆÊ’u‚É•¶Žš—ñ‘}“ü
262267 procedure InsertText(Memo: TMemo; Text: String);
268+ //! ‘—M’†Ž~
269+ procedure CancelSend(ABoard: TBoard; ASysMenu: HMENU);
263270 protected
264271 procedure CreateParams(var Params: TCreateParams); override;
265272 public
@@ -300,17 +307,6 @@ const
300307 RES2CH_CHECK = '<!-- 2ch_X:check -->';
301308 RES2CH_COOKIE = '<!-- 2ch_X:cookie -->';
302309
303-
304- BBS2CH_NAME: string = '‚Q‚¿‚á‚ñ‚Ë‚é';
305- BBS2CH_LOG_FOLDER: string = '2ch';
306- EXTERNAL_LOG_FOLDER: string = 'exboard';
307-
308- FOLDER_INI_FILENAME: string = 'Folder.ini';
309- FOLDER_INDEX_FILENAME: string = 'Folder.idx';
310- SUBJECT_FILENAME: string = 'subject.txt';
311- PATH_DELIM: string = '\';
312-
313-
314310 type
315311 TSelection = record
316312 StartPos, EndPos: Integer;
@@ -674,6 +670,9 @@ begin
674670 end;
675671
676672 function TEditorForm.Check: Boolean;
673+const
674+ REQUIRED: string = '‚ª“ü—Í‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB';
675+ ERROR: string = 'ƒGƒ‰[';
677676 var
678677 Msg: string;
679678 rc: Integer;
@@ -690,15 +689,15 @@ begin
690689 (Board.LastGetTime = ZERO_DATE)) then begin
691690 Msg := 'ƒT[ƒo‚ÌŽž‚ª•ª‚©‚ç‚È‚¢‚½‚߁A‘—Mo—ˆ‚Ü‚¹‚ñ'#13#10
692691 + 'ƒXƒŒƒbƒh‚ðXViŽæ“¾jŒãA15•b‘Ò‚Á‚Ä‚©‚ç‘—M‚µ‚Ä‚­‚¾‚³‚¢';
693- MsgBox(Handle, Msg, 'ƒGƒ‰[', MB_OK or MB_ICONSTOP);
692+ MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
694693 Result := False;
695694 end else if BodyEdit.Text = '' then begin
696- Msg := '–{•¶‚ª“ü—Í‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB';
697- MsgBox(Handle, Msg, 'ƒGƒ‰[', MB_OK or MB_ICONSTOP);
695+ Msg := '–{•¶' + REQUIRED;
696+ MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
698697 Result := False;
699698 end else if (FBoard <> nil) and (Trim(TitleEdit.Text) = '') then begin
700- Msg := 'ƒ^ƒCƒgƒ‹‚ª“ü—Í‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB';
701- MsgBox(Handle, Msg, 'ƒGƒ‰[', MB_OK or MB_ICONSTOP);
699+ Msg := 'ƒ^ƒCƒgƒ‹' + REQUIRED;
700+ MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
702701 Result := False;
703702 end else begin
704703 if (not GikoSys.Dolib.Connected) and (AnsiPos('œ', NameComboBox.Text) <> 0) then begin
@@ -809,8 +808,21 @@ begin
809808 Indy.Request.UserAgent := GikoSys.GetUserAgent;
810809 Indy.Request.AcceptEncoding := '';
811810 end;
811+//! ‘—M’†Ž~‚Ì‚½‚߂̃ƒjƒ…[‚̍ж
812+procedure TEditorForm.CancelSend(ABoard: TBoard; ASysMenu: HMENU);
813+begin
814+ ABoard.SPID := '';
815+ ABoard.PON := '';
816+ FWork := false;
817+ EnableMenuItem(ASysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
818+ DrawMenuBar(Handle);
819+end;
812820
813821 procedure TEditorForm.Send(ACOOKIE: string; SPID: string; PON: string; FirstWriting: Boolean);
822+const
823+ MSG_FUSIANA : string = 'ƒŠƒ‚[ƒgƒzƒXƒg‚ð•\Ž¦‚·‚é‹@”\‚ªŽg‚í‚ê‚Ä‚¢‚Ü‚·'#13#10 +
824+ '‚à‚µ‚àŠÔˆá‚Á‚Ä‚±‚Ì•û–@‚ŃzƒXƒg‚ª•\Ž¦‚³‚ꂽ‚Æ‚µ‚Ä‚àAŽ©ŒÈÓ”C‚Ȃ̂ō폜ˆË—Š‚ɂ͉ž‚¶‚Ü‚¹‚ñB' +
825+ #13#10#13#10'Ó”C‚𕉂¤‚±‚Æ‚ð³‘ø‚µ‚ď‘‚«ž‚Ý‚Ü‚·‚©H';
814826 var
815827 TextStream: TStringStream;
816828 Source: TStringStream;
@@ -828,7 +840,6 @@ var
828840 body : TStringList;
829841 Remote : String;
830842 ABoard : TBoard;
831- tmpRawheader: string;
832843 {Protocol,Host, Path, Document, Port, Bookmark : String;}
833844 begin
834845 FAbort := False;
@@ -840,7 +851,7 @@ begin
840851 Board := FThreadItem.ParentBoard;
841852
842853
843- tmpRawheader := '';
854+// tmpRawheader := '';
844855 InitIdHTTP(Indy);
845856 if FThreadItem = nil then begin
846857 URL := FBoard.GetSendURL;
@@ -898,6 +909,72 @@ begin
898909 try
899910 FDebugStrReceive := '';
900911 FDebugStrSend := '';
912+
913+ if (FirstWriting) then begin
914+ //ƒtƒVƒAƒiƒgƒ‰ƒbƒvŒx(LocalMode) by ’èŠú•Ö
915+ if GikoSys.Setting.LocalTrapAtt then begin
916+ if LFusianaGet(Namae) then begin
917+ MsgResult := MsgBox( Handle, MSG_FUSIANA, 'î•ñ',
918+ MB_YESNO or MB_ICONQUESTION);
919+ if MsgResult = IDNO then begin
920+ CancelSend( Board, SysMenu );
921+ Exit;
922+ end;
923+ end;
924+ if ((Namae = 'ŽRèÂ') or (Namae = 'fusianasan')) then begin
925+ MsgResult := MsgBox(Handle, MSG_FUSIANA, 'î•ñ',
926+ MB_YESNO or MB_ICONQUESTION);
927+ if MsgResult = IDNO then begin
928+ CancelSend( Board, SysMenu );
929+ Exit;
930+ end;
931+ end;
932+ end;
933+
934+ if GikoSys.Setting.RemoteTrapAtt then begin
935+ if FThreadItem = nil then
936+ ABoard := FBoard
937+ else
938+ ABoard := FThreadItem.ParentBoard;
939+
940+ if ABoard = nil then Exit;
941+
942+ if FileExists(ABoard.GetSETTINGTXTFileName) then begin
943+ body := TStringList.Create;
944+ try
945+ body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
946+ Remote := GetFusianaName(body, ABoard);
947+ finally
948+ body.Free;
949+ end;
950+ end else begin
951+ //Setting.txt‚ª‚È‚©‚Á‚½‚çŽæ“¾
952+ //ŽI‚É•‰‰×‚ª‚©‚©‚è‚»‚¤...
953+ //if not FileExists(ABoard.GetSETTINGTXTFileName) then begin
954+ GetSETTINGTXTAction.Execute;
955+ body := TStringList.Create;
956+ try
957+ if FileExists(ABoard.GetSETTINGTXTFileName) then begin
958+ body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
959+ Remote := GetFusianaName(body, ABoard);
960+ end;
961+ finally
962+ body.Free;
963+ end;
964+ end;
965+
966+ if Remote = 'fusianasan' then begin
967+ MsgResult := MsgBox(
968+ Handle, MSG_FUSIANA, 'î•ñ',
969+ MB_YESNO or MB_ICONQUESTION);
970+ if MsgResult = IDNO then begin
971+ CancelSend( Board, SysMenu );
972+ Exit;
973+ end;
974+ end;
975+ end;
976+ end;
977+
901978 GetSendData(Source);
902979 IdAntiFreeze.Active := True;
903980 try
@@ -909,177 +986,71 @@ begin
909986
910987 ResultType := GetResultType(ResponseText);
911988
912- //MsgResult‰Šú‰»
913- MsgResult := IDNO;
914- //ƒtƒVƒAƒiƒgƒ‰ƒbƒvŒx(LocalMode) by ’èŠú•Ö
915- if GikoSys.Setting.LocalTrapAtt then begin
916- if LFusianaGet(Namae) then begin
917- MsgResult := MsgBox(
918- Handle,
919- 'ƒŠƒ‚[ƒgƒzƒXƒg‚ð•\Ž¦‚·‚é‹@”\‚ªŽg‚í‚ê‚Ä‚¢‚Ü‚·' + #13#10 +
920- '‚à‚µ‚àŠÔˆá‚Á‚Ä‚±‚Ì•û–@‚ŃzƒXƒg‚ª•\Ž¦‚³‚ꂽ‚Æ‚µ‚Ä‚àAŽ©ŒÈÓ”C‚Ȃ̂ō폜ˆË—Š‚ɂ͉ž‚¶‚Ü‚¹‚ñB' + #13#10#13#10 +
921- 'Ó”C‚𕉂¤‚±‚Æ‚ð³‘ø‚µ‚ď‘‚«ž‚Ý‚Ü‚·‚©H',
922- 'î•ñ',
923- MB_YESNO or MB_ICONQUESTION);
924- if MsgResult = IDNO then begin
925- Board.SPID := '';
926- Board.PON := '';
927- FWork := false;
928- EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
929- DrawMenuBar(Handle);
930- Exit;
931- end;
932- end;
933- if ((Namae = 'ŽRèÂ') or (Namae = 'fusianasan')) then begin
934- MsgResult := MsgBox(
935- Handle,
936- 'ƒŠƒ‚[ƒgƒzƒXƒg‚ð•\Ž¦‚·‚é‹@”\‚ªŽg‚í‚ê‚Ä‚¢‚Ü‚·' + #13#10 +
937- '‚à‚µ‚àŠÔˆá‚Á‚Ä‚±‚Ì•û–@‚ŃzƒXƒg‚ª•\Ž¦‚³‚ꂽ‚Æ‚µ‚Ä‚àAŽ©ŒÈÓ”C‚Ȃ̂ō폜ˆË—Š‚ɂ͉ž‚¶‚Ü‚¹‚ñB' + #13#10#13#10 +
938- 'Ó”C‚𕉂¤‚±‚Æ‚ð³‘ø‚µ‚ď‘‚«ž‚Ý‚Ü‚·‚©H',
939- 'î•ñ',
940- MB_YESNO or MB_ICONQUESTION);
941- if MsgResult = IDNO then begin
942- Board.SPID := '';
943- Board.PON := '';
944- FWork := false;
945- EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
946- DrawMenuBar(Handle);
947- Exit;
948- end;
949- end;
950- end;
951-
952- if GikoSys.Setting.RemoteTrapAtt then begin
953- if FThreadItem = nil then
954- ABoard := FBoard
955- else
956- ABoard := FThreadItem.ParentBoard;
957-
958- if ABoard = nil then Exit;
959-
960- if FileExists(ABoard.GetSETTINGTXTFileName) then begin
961- body := TStringList.Create;
962- try
963- body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
964- Remote := GetFusianaName(body, ABoard);
965- finally
966- body.Free;
967- end;
968- end;
969-
970- //Setting.txt‚ª‚È‚©‚Á‚½‚çŽæ“¾
971- //ŽI‚É•‰‰×‚ª‚©‚©‚è‚»‚¤...
972- if not FileExists(ABoard.GetSETTINGTXTFileName) then begin
973- //GetSETTINGTXTAction‚ðŒÄ‚яo‚·‚ÆIndy‚ª‰Šú‰»‚³‚ê‚é‚̂ŁA
974- //‚±‚±‚ÅCookie‚ð•Û‘¶‚µ‚È‚­‚Ä‚Í‚¢‚¯‚È‚¢
975- tmpRawheader := Indy.Response.RawHeaders.Text;
976- GetSETTINGTXTAction.Execute;
977- body := TStringList.Create;
978- try
979- if FileExists(ABoard.GetSETTINGTXTFileName) then begin
980- body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
981- Remote := GetFusianaName(body, ABoard);
982- end;
983- finally
984- body.Free;
985- end;
986- end;
987-
988- if Remote = 'fusianasan' then begin
989- MsgResult := MsgBox(
990- Handle,
991- 'ƒŠƒ‚[ƒgƒzƒXƒg‚ð•\Ž¦‚·‚é‹@”\‚ªŽg‚í‚ê‚Ä‚¢‚Ü‚·' + #13#10 +
992- '‚à‚µ‚àŠÔˆá‚Á‚Ä‚±‚Ì•û–@‚ŃzƒXƒg‚ª•\Ž¦‚³‚ꂽ‚Æ‚µ‚Ä‚àAŽ©ŒÈÓ”C‚Ȃ̂ō폜ˆË—Š‚ɂ͉ž‚¶‚Ü‚¹‚ñB' + #13#10#13#10 +
993- 'Ó”C‚𕉂¤‚±‚Æ‚ð³‘ø‚µ‚ď‘‚«ž‚Ý‚Ü‚·‚©H',
994- 'î•ñ',
995- MB_YESNO or MB_ICONQUESTION);
996- if MsgResult = IDNO then begin
997- Board.SPID := '';
998- Board.PON := '';
999- FWork := false;
1000- EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
1001- DrawMenuBar(Handle);
1002- Exit;
1003- end;
1004- end;
1005- end;
1006-
1007- if ResultType = grtOK then begin
1008- if (GikoSys.Setting.UseSamba) and (Timer1.Enabled) then
1009- WriteSambaTime(FHost, Now());
1010- State := gdsComplete;
1011- end else if ResultType = grtCookie then begin
1012- //ƒ‹[ƒv–hŽ~
1013- if not FirstWriting then
1014- raise Exception.Create('');
1015- MsgResult := MsgBox(
1016- Handle,
1017- 'E“Še‚³‚ꂽ“à—e‚̓Rƒs[A•Û‘¶Aˆø—pA“]Ú“™‚³‚ê‚éê‡‚ª‚ ‚è‚Ü‚·B' + #13#10 +
1018- 'E“Še‚ÉŠÖ‚µ‚Ä”­¶‚·‚éÓ”C‚Í‘S‚Ä“ŠeŽÒ‚É‹A‚µ‚Ü‚·B' + #13#10#13#10 +
1019- '‘SÓ”C‚𕉂¤‚±‚Æ‚ð³‘ø‚µ‚ď‘‚«ž‚Ý‚Ü‚·‚©H',
1020- 'î•ñ',
1021- MB_YESNO or MB_ICONQUESTION);
1022- if MsgResult = IDYES then begin
1023- if (GikoSys.Setting.RemoteTrapAtt) and (tmpRawheader <> '') then begin
1024- GetCookie(tmpRawheader, Board);
1025- end else begin
1026- GetCookie(Indy.Response.RawHeaders.Text, Board);
1027- end;
1028- if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
1029- raise Exception.Create('');
1030- //‚à‚¤ˆê‰ñ‚±‚̃ƒ\ƒbƒh
1031- Send(Board.Cookie, Board.SPID, Board.PON, False);
1032- Exit;
1033- end else begin
1034- Board.SPID := '';
1035- Board.PON := '';
1036- FWork := False;
1037- EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
1038- DrawMenuBar(Handle);
1039- Exit;
1040- end;
1041- end else if ResultType = grtCheck then begin
1042- //ƒ‹[ƒv–hŽ~
1043- if not FirstWriting then
1044- raise Exception.Create('');
1045-
1046- MsgResult := MsgBox(
1047- Handle,
1048- '‘‚«ž‚Ý‚ÉŠÖ‚µ‚Ä‚Í—lX‚ȃƒOî•ñ‚ª‹L˜^‚³‚ê‚Ä‚¢‚Ü‚·B' + #13#10 +
1049- '“Še‚ÉŠÖ‚µ‚Ä”­¶‚·‚éÓ”C‚Í‘S‚Ä“ŠeŽÒ‚É‹A‚µ‚Ü‚·B' + #13#10 +
1050- 'Œö˜—Ç‘­‚É”½‚µ‚½‚èA‘¼l‚É–À˜f‚ð‚©‚¯‚鏑‚«ž‚݂͍T‚¦‚ĉº‚³‚¢B' + #13#10 +
1051- '“Še‚³‚ꂽ“à—e‚̓Rƒs[E•Û‘¶Eˆø—pE“]Ú“™‚³‚ê‚éê‡‚ª‚ ‚è‚Ü‚·B' + #13#10 +
1052- #13#10 +
1053- '‘SÓ”C‚𕉂¤‚±‚Æ‚ð³‘ø‚µ‚ď‘‚«ž‚Ý‚Ü‚·‚©H',
1054- 'Šm”F',
1055- MB_YESNO or MB_ICONQUESTION);
1056-
1057- if MsgResult = IDYES then begin
1058- if (GikoSys.Setting.RemoteTrapAtt) and (tmpRawheader <> '') then begin
1059- GetCookie(tmpRawheader, Board);
1060- end else begin
1061- GetCookie(Indy.Response.RawHeaders.Text, Board);
1062- end;
1063989
1064- if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
1065- raise Exception.Create('');
1066- Send(Board.Cookie, Board.SPID, Board.PON, False);
1067- Exit;
1068- end else begin
1069- EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
1070- DrawMenuBar(Handle);
1071- Board.SPID := '';
1072- Board.PON := '';
1073- FWork := false;
1074- Exit;
1075- end;
1076- end else begin
1077- if (GikoSys.Setting.UseSamba) and (Timer1.Enabled) then
1078- WriteSambaTime(FHost, Now());
1079- State := gdsError;
1080- raise Exception.Create('');
1081- end;
990+ if ResultType = grtOK then begin
991+ if (GikoSys.Setting.UseSamba) and (Timer1.Enabled) then
992+ WriteSambaTime(FHost, Now());
993+
994+ State := gdsComplete;
995+ end else if ResultType = grtCookie then begin
996+ //ƒ‹[ƒv–hŽ~
997+ if not FirstWriting then
998+ raise Exception.Create('');
999+
1000+ MsgResult := MsgBox( Handle,
1001+ 'E“Še‚³‚ꂽ“à—e‚̓Rƒs[A•Û‘¶Aˆø—pA“]Ú“™‚³‚ê‚éê‡‚ª‚ ‚è‚Ü‚·B' + #13#10 +
1002+ 'E“Še‚ÉŠÖ‚µ‚Ä”­¶‚·‚éÓ”C‚Í‘S‚Ä“ŠeŽÒ‚É‹A‚µ‚Ü‚·B' + #13#10#13#10 +
1003+ '‘SÓ”C‚𕉂¤‚±‚Æ‚ð³‘ø‚µ‚ď‘‚«ž‚Ý‚Ü‚·‚©H',
1004+ 'î•ñ',
1005+ MB_YESNO or MB_ICONQUESTION);
1006+
1007+ if MsgResult = IDYES then begin
1008+ GetCookie(Indy.Response.RawHeaders.Text, Board);
10821009
1010+ if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
1011+ raise Exception.Create('');
1012+
1013+ //‚à‚¤ˆê‰ñ‚±‚̃ƒ\ƒbƒh
1014+ Send(Board.Cookie, Board.SPID, Board.PON, False);
1015+ Exit;
1016+ end else begin
1017+ CancelSend( Board, SysMenu );
1018+ Exit;
1019+ end;
1020+ end else if ResultType = grtCheck then begin
1021+ //ƒ‹[ƒv–hŽ~
1022+ if not FirstWriting then
1023+ raise Exception.Create('');
1024+
1025+ MsgResult := MsgBox( Handle,
1026+ '‘‚«ž‚Ý‚ÉŠÖ‚µ‚Ä‚Í—lX‚ȃƒOî•ñ‚ª‹L˜^‚³‚ê‚Ä‚¢‚Ü‚·B' + #13#10 +
1027+ '“Še‚ÉŠÖ‚µ‚Ä”­¶‚·‚éÓ”C‚Í‘S‚Ä“ŠeŽÒ‚É‹A‚µ‚Ü‚·B' + #13#10 +
1028+ 'Œö˜—Ç‘­‚É”½‚µ‚½‚èA‘¼l‚É–À˜f‚ð‚©‚¯‚鏑‚«ž‚݂͍T‚¦‚ĉº‚³‚¢B' + #13#10 +
1029+ '“Še‚³‚ꂽ“à—e‚̓Rƒs[E•Û‘¶Eˆø—pE“]Ú“™‚³‚ê‚éê‡‚ª‚ ‚è‚Ü‚·B' + #13#10 +
1030+ #13#10 +
1031+ '‘SÓ”C‚𕉂¤‚±‚Æ‚ð³‘ø‚µ‚ď‘‚«ž‚Ý‚Ü‚·‚©H',
1032+ 'Šm”F',
1033+ MB_YESNO or MB_ICONQUESTION);
1034+
1035+ if MsgResult = IDYES then begin
1036+ GetCookie(Indy.Response.RawHeaders.Text, Board);
1037+
1038+ if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
1039+ raise Exception.Create('');
1040+
1041+ Send(Board.Cookie, Board.SPID, Board.PON, False);
1042+ Exit;
1043+ end else begin
1044+ CancelSend( Board, SysMenu );
1045+ Exit;
1046+ end;
1047+ end else begin
1048+ if (GikoSys.Setting.UseSamba) and (Timer1.Enabled) then
1049+ WriteSambaTime(FHost, Now());
1050+
1051+ State := gdsError;
1052+ raise Exception.Create('');
1053+ end;
10831054 except
10841055 on E: EIdConnectException do begin
10851056 State := gdsError;
@@ -1261,6 +1232,8 @@ begin
12611232 end;
12621233
12631234 procedure TEditorForm.SendActionExecute(Sender: TObject);
1235+const
1236+ TITLE_SAMBA : string = 'Samba24Œx';
12641237 var
12651238 Board: TBoard;
12661239 rc: Integer;
@@ -1348,7 +1321,7 @@ begin
13481321 rc := GikoUtil.MsgBox(Handle,
13491322 'Samba24‚Ì‹K’è’l–¢–ž‚Ì•b”‚µ‚©Œo‰ß‚µ‚Ä‚¢‚Ü‚¹‚ñB'#13#10
13501323 + '‘—M‚𒆎~‚µ‚Ü‚·‚©H' + #13#10
1351- + '(u‚¢‚¢‚¦v‚¾‚Æ‘—M‚µ‚Ü‚·)', 'Samba24Œx',
1324+ + '(u‚¢‚¢‚¦v‚¾‚Æ‘—M‚µ‚Ü‚·)', TITLE_SAMBA,
13521325 MB_YESNO or MB_ICONQUESTION);
13531326 if rc = IDYES then begin
13541327 FWork := false;
@@ -1357,7 +1330,7 @@ begin
13571330 if rc = IDNO then begin
13581331 rc2 := GikoUtil.MsgBox(Handle,
13591332 '–{“–‚É‘—M‚µ‚Ü‚·‚©H',
1360- 'Sumba24Œx',
1333+ TITLE_SAMBA,
13611334 MB_YESNO or MB_ICONQUESTION);
13621335 if rc2 = IDNO then begin
13631336 FWork := False;
@@ -1763,6 +1736,12 @@ var
17631736 tmpBoard: TBoard;
17641737 begin
17651738
1739+ if FWork then begin
1740+ Exit;
1741+ end;
1742+
1743+ FWork := True;
1744+
17661745 InitIdHTTP(Indy);
17671746 if FThreadItem = nil then
17681747 tmpBoard := FBoard
@@ -1809,9 +1788,11 @@ begin
18091788 finally
18101789 settingBody.Free;
18111790 Screen.Cursor := crDefault;
1791+ FWork := False;
18121792 end;
18131793 ShowBoardInformation(tmpBoard, BoardInformationMemo);
18141794
1795+
18151796 end;
18161797
18171798 procedure TEditorForm.ShowBoardInformation(ABoard: TBoard; AMemo: TMemo);
@@ -1870,6 +1851,10 @@ begin
18701851 else
18711852 GetTitlePictureAction.Enabled := FThreadItem.ParentBoard.IsSETTINGTXT;
18721853
1854+ if GetTitlePictureAction.Enabled Then begin
1855+ // ŽÀs’†‚ÍŽÀs•s‰Â
1856+ GetTitlePictureAction.Enabled := not FWork;
1857+ end;
18731858 end;
18741859
18751860 procedure TEditorForm.GetTitlePictureActionExecute(Sender: TObject);
@@ -1877,9 +1862,10 @@ var
18771862 memStream: TMemoryStream;
18781863 tmpBoard: TBoard;
18791864 begin
1880- if FWork then
1865+ if FWork then
18811866 Exit;
1882- FWork := True;
1867+
1868+ FWork := True;
18831869
18841870 InitIdHTTP(Indy);
18851871 memStream := TMemoryStream.Create;
@@ -2013,12 +1999,13 @@ begin
20131999 finally
20142000 settingBody.Free;
20152001 Screen.Cursor := crDefault;
2002+ FWork := False;
20162003 end;
20172004 if tmpBoard.IsHEADTXT then begin
2018- ShowBoardHead(tmpboard, LocalEdit);
2005+ ShowBoardHead(tmpboard, LocalEdit);
20192006 end;
2020-
2021- FWork := False;
2007+
2008+
20222009 end;
20232010
20242011 procedure TEditorForm.CalcCapacityActionExecute(Sender: TObject);
@@ -2416,5 +2403,36 @@ begin
24162403 form.Release;
24172404 end;
24182405 end;
2406+//! Cookieî•ñíœ
2407+procedure TEditorForm.ReleaseCookieActionExecute(Sender: TObject);
2408+var
2409+ Board : TBoard;
2410+begin
2411+ // ƒXƒŒƒbƒh‚ª–³‚¢@ƒXƒŒ—§‚Ä‚Ì‚Æ‚«‚ÍFBoard‚𒼐ڎg‚¤
2412+ if FThreadItem = nil then begin
2413+ Board := FBoard
2414+ end else begin
2415+ Board := FThreadItem.ParentBoard;
2416+ end;
2417+
2418+ // ƒNƒbƒL[‚̏î•ñ‚ðŽÌ‚Ä‚é
2419+ Board.Cookie := '';
2420+ Board.SPID := '';
2421+ Board.PON := '';
2422+ // 0‚ÉŠª‚«–ß‚·
2423+ Board.Expires := 0;
2424+end;
2425+//! ”î•ñŽæ“¾UpdateƒCƒxƒ“ƒg
2426+procedure TEditorForm.GetSETTINGTXTActionUpdate(Sender: TObject);
2427+begin
2428+ // ŽÀs’†‚ÍŽÀs•s‰Â
2429+ GetSETTINGTXTAction.Enabled := not FWork;
2430+end;
2431+//! ƒ[ƒJƒ‹ƒ‹[ƒ‹Žæ“¾UpdateƒCƒxƒ“ƒg
2432+procedure TEditorForm.GetHeadTXTActionUpdate(Sender: TObject);
2433+begin
2434+ // ŽÀs’†‚ÍŽÀs•s‰Â
2435+ GetSETTINGTXTAction.Enabled := not FWork;
2436+end;
24192437
24202438 end.
--- a/Giko.dfm
+++ b/Giko.dfm
@@ -8215,7 +8215,7 @@ object GikoForm: TGikoForm
82158215 end
82168216 object BrowserPopupMenu: TPopupMenu
82178217 Left = 68
8218- Top = 276
8218+ Top = 280
82198219 object ShowThreadMenu: TMenuItem
82208220 Action = GikoDM.ShowThreadAction
82218221 end
--- a/Giko.pas
+++ b/Giko.pas
@@ -1824,7 +1824,11 @@ begin
18241824 GikoDM.TabsOpenAction.Execute;
18251825 end;
18261826
1827-
1827+{!
1828+\todo ‰½ŒÌ IE 7 ‚Å‚Í about:.. ‚É‚È‚é‚Ì‚©
1829+ (IE 7 ‚ª about:.. ‚ð’ljÁ‚µ‚Ä‚¢‚é‚Ì‚©AƒMƒRƒiƒr‚ª’ljÁ‚µ‚Ä‚¢‚é‚Ì‚©)
1830+ ’²¸‚·‚邱‚Æ
1831+}
18281832 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
18291833 var
18301834 p: TPoint;
@@ -1844,7 +1848,14 @@ var
18441848 e: IHTMLElement;
18451849 Ext: string;
18461850 PathRec: TPathRec;
1847-begin
1851+ Text2: string;
1852+begin
1853+ // ƒMƒRƒiƒr‚̓ŒƒXƒAƒ“ƒJ[‚ª about:blank.. ‚ÅŽn‚܂邱‚Æ‚ðŠú‘Ò‚µ‚Ä‚¢‚邪
1854+ // IE 7 ‚Å‚Í about:blank.. ‚Å‚Í‚È‚­ about:.. ‚É‚È‚é‚̂ŁA’uŠ·‚·‚é(“Š‚°‚â‚è)
1855+ if Pos('about:..', Text) = 1 then
1856+ Text2 := 'about:blank..' + Copy( Text, Length('about:..')+1, Length(Text) )
1857+ else
1858+ Text2 := Text;
18481859 if not( TObject(Sender) is TWebBrowser )then
18491860 Exit;
18501861 try
@@ -1871,7 +1882,7 @@ begin
18711882 Exit;
18721883 end;
18731884
1874- StatusBar.Panels[1].Text := Text;
1885+ StatusBar.Panels[1].Text := Text2;
18751886
18761887 if FHint <> nil then begin
18771888 FHint.ReleaseHandle;
@@ -1888,8 +1899,8 @@ begin
18881899 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
18891900
18901901 s := '';
1891- Ext := AnsiLowerCase(ExtractFileExt(Text));
1892- if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
1902+ Ext := AnsiLowerCase(ExtractFileExt(Text2));
1903+ if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and
18931904 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
18941905 if FPreviewBrowser = nil then begin
18951906 FPreviewBrowser := TPreviewBrowser.Create(Self);
@@ -1897,12 +1908,12 @@ begin
18971908 TOleControl(FPreviewBrowser).Parent := nil;
18981909 end;
18991910 FPreviewBrowser.Navigate(BLANK_HTML);//‘O‰ñ‚̃vƒŒƒrƒ…[‰æ‘œÁ‹Ž—p
1900- FPreviewURL := Text;
1911+ FPreviewURL := Text2;
19011912 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
19021913 PreviewTimer.Enabled := True;
1903- end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
1904- if Pos('mailto:', Text) = 1 then begin
1905- s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
1914+ end else if (Pos('about:blank', Text2) = 1) or (Pos('http://', Text2) = 1) or (Pos('mailto:', Text2) = 1) then begin
1915+ if Pos('mailto:', Text2) = 1 then begin
1916+ s := StringReplace(Text2, 'mailto:', '', [rfIgnoreCase]);
19061917 //ƒMƒRƒiƒrƒXƒŒ ƒp[ƒg3‚Ì466Ž‚ÉŠ´ŽÓ
19071918 GetCursorPos(p);
19081919 p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
@@ -1924,7 +1935,7 @@ begin
19241935 end;
19251936 end else begin
19261937 threadItem := GetActiveContent;
1927- URL := THTMLCreate.GetRespopupURL(Text, threadItem.URL);
1938+ URL := THTMLCreate.GetRespopupURL(Text2, threadItem.URL);
19281939 PathRec := Gikosys.Parse2chURL2(URL);
19291940 if (PathRec.FNoParam) then begin
19301941 PathRec.FSt := 1;
@@ -3071,12 +3082,27 @@ end;
30713082 procedure TGikoForm.DeleteHistory( threadItem: TThreadItem );
30723083 var
30733084 i: Integer;
3074-begin
3085+ node: TTreeNode;
3086+begin
3087+ // ƒLƒƒƒrƒlƒbƒg‚É—š—ð‚ª•\Ž¦‚³‚ê‚Ä‚¢‚½‚çA
3088+ // ƒLƒƒƒrƒlƒbƒg“à‚̃AƒCƒeƒ€‚àíœ‚·‚éB
3089+ if (FTreeType = gttHistory) then begin
3090+ node := TreeView.Items.GetFirstNode;
3091+ while (node <> nil) do begin
3092+ if ( TFavoriteThreadItem(node.Data).Item = threadItem ) then begin
3093+ TreeView.Items.Delete(node);
3094+ TreeView.Refresh;
3095+ node := nil;
3096+ end else begin
3097+ node := node.GetNext;
3098+ end;
3099+ end;
3100+ end;
30753101 for i := 0 to FHistoryList.Count - 1 do begin
3076- if threadItem.URL = TFavoriteThreadItem( FHistoryList.Items[i] ).URL then begin
3102+ if threadItem = TFavoriteThreadItem( FHistoryList.Items[i] ).Item then begin
30773103 TFavoriteThreadItem( FHistoryList.Items[ i ] ).Free;
30783104 FHistoryList.Delete(i);
3079- FHistoryList.Capacity := FHistoryList.Count;
3105+ FHistoryList.Capacity := FHistoryList.Count;
30803106 Break;
30813107 end;
30823108 end;
@@ -4481,6 +4507,9 @@ begin
44814507 end;
44824508
44834509 procedure TGikoForm.ShowFavoriteAddDialog( Item : TObject );
4510+const
4511+ MsgAdd : String = 'Šù‚É‚¨‹C‚É“ü‚è‚É“o˜^‚³‚ê‚Ä‚¢‚Ü‚·B‚»‚ê‚Å‚à’ljÁ‚µ‚Ü‚·‚©H';
4512+ TitleAdd: String = '‚¨‹C‚É“ü‚è‚̒ljÁ';
44844513 var
44854514 Dlg : TFavoriteAddDialog;
44864515 ItemURL : string;
@@ -4500,7 +4529,7 @@ begin
45004529 Data := Node.Data;
45014530 if TObject( Data ) is TFavoriteBoardItem then begin
45024531 if ItemURL = TFavoriteBoardItem( Data ).URL then begin
4503- if Application.MessageBox( 'Šù‚É‚¨‹C‚É“ü‚è‚É“o˜^‚³‚ê‚Ä‚¢‚Ü‚·B‚»‚ê‚Å‚à’ljÁ‚µ‚Ü‚·‚©H', '‚¨‹C‚É“ü‚è‚̒ljÁ', MB_YESNO ) = IDNO then
4532+ if Application.MessageBox(PChar(MsgAdd) , PChar(TitleAdd), MB_YESNO ) = IDNO then
45044533 Exit;
45054534 Break;
45064535 end;
@@ -4520,7 +4549,7 @@ begin
45204549 Data := Node.Data;
45214550 if TObject( Data ) is TFavoriteThreadItem then begin
45224551 if ItemURL = TFavoriteThreadItem( Data ).URL then begin
4523- if Application.MessageBox( 'Šù‚É‚¨‹C‚É“ü‚è‚É“o˜^‚³‚ê‚Ä‚¢‚Ü‚·B‚»‚ê‚Å‚à’ljÁ‚µ‚Ü‚·‚©H', '‚¨‹C‚É“ü‚è‚̒ljÁ', MB_YESNO ) = IDNO then
4552+ if Application.MessageBox( PChar(MsgAdd), PChar(TitleAdd), MB_YESNO ) = IDNO then
45244553 Exit;
45254554 Break;
45264555 end;
--- a/GikoDataModule.pas
+++ b/GikoDataModule.pas
@@ -33,14 +33,16 @@ const
3333 TOOL_ICON_FAV_BOARD = 31; //!< ‚¨‹C‚É“ü‚蔃AƒCƒRƒ“
3434 TOOL_ICON_FAV_THREAD = 32; //!< ‚¨‹C‚É“ü‚èƒXƒŒƒAƒCƒRƒ“
3535
36+ //! HTTP
37+ PROTOCOL_HTTP : string = 'http://';
3638 //! ƒMƒRƒiƒrƒTƒCƒg‚ÌURL
37- URL_GIKONAVI: string = 'http://gikonavi.sourceforge.jp/';
39+ URL_GIKONAVI: string = 'gikonavi.sourceforge.jp/';
3840 //! MonazillaƒTƒCƒg‚ÌURL
39- URL_MONAZILLA: string = 'http://www.monazilla.org/';
41+ URL_MONAZILLA: string = 'www.monazilla.org/';
4042 //! 2‚¿‚á‚ñ‚Ë‚é‚ÌURL
41- URL_2ch: string = 'http://www.2ch.net/';
43+ URL_2ch: string = 'www.2ch.net/';
4244 //! ƒMƒRƒiƒrWiki‚ÌURL
43- URL_Wiki: string = 'http://gikowiki.dyndns.info/index.php?FAQ';
45+ URL_Wiki: string = 'gikowiki.dyndns.info/index.php?FAQ';
4446
4547 SELECTCOMBOBOX_NAME: string = ''; // 'ƒXƒŒƒbƒhižŒŸõ';
4648 SELECTCOMBOBOX_COLOR: TColor = clWindow;
@@ -448,7 +450,9 @@ uses
448450 RoundName, RoundData, Menus, ListViewUtils,
449451 ThreadControl, GikoMessage, InputAssist;
450452
451-
453+const
454+ MSG_ERROR : string = 'ƒGƒ‰[';
455+
452456 {$R *.dfm}
453457 // *************************************************************************
454458 //! TAction‚ÅGetActiveContent‚ªnilˆÈŠO‚Å—LŒø‚É‚È‚é
@@ -487,7 +491,8 @@ procedure TGikoDM.ReloadActionExecute(Sender: TObject);
487491 begin
488492 //ƒŠƒ[ƒh‚ðŽÀs@Ž¸”s‚µ‚½‚烁ƒbƒZ[ƒWo—Í
489493 if GikoSys.FAbon.ReLoadFromNGwordFile =false then begin
490- MsgBox(GikoForm.Handle, 'NGƒ[ƒhƒtƒ@ƒCƒ‹‚̍ēǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½', 'ƒGƒ‰[', MB_OK or MB_ICONEXCLAMATION);
494+ MsgBox(GikoForm.Handle, 'NGƒ[ƒhƒtƒ@ƒCƒ‹‚̍ēǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½',
495+ MSG_ERROR, MB_OK or MB_ICONEXCLAMATION);
491496 end else begin
492497 //‘S‚Ẵ^ƒu‚ɍĕ`‰æ‚ðÝ’è
493498 GikoForm.RepaintAllTabsBrowser();
@@ -500,7 +505,8 @@ procedure TGikoDM.GoFowardActionExecute(Sender: TObject);
500505 begin
501506 //ˆê‚ÂŒã‚ë‚̓ǂݍž‚݁@Ž¸”s‚µ‚½‚烁ƒbƒZ[ƒWo—Í
502507 if GikoSys.FAbon.GoBack =false then begin
503- MsgBox(GikoForm.Handle, 'ˆê‚ÂŒã‚ë‚ÌNGƒ[ƒhƒtƒ@ƒCƒ‹‚̓ǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½', 'ƒGƒ‰[', MB_OK or MB_ICONEXCLAMATION);
508+ MsgBox(GikoForm.Handle, 'ˆê‚ÂŒã‚ë‚ÌNGƒ[ƒhƒtƒ@ƒCƒ‹‚̓ǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½',
509+ MSG_ERROR, MB_OK or MB_ICONEXCLAMATION);
504510 end else begin
505511 //ƒXƒe[ƒ^ƒX‚É•\Ž¦‚³‚ê‚éNGƒ[ƒhƒtƒ@ƒCƒ‹–¼‚ðXV
506512 RepaintStatusBar;
@@ -515,7 +521,8 @@ procedure TGikoDM.GoBackActionExecute(Sender: TObject);
515521 begin
516522 //ˆê‚ÂŒã‚ë‚̓ǂݍž‚݁@Ž¸”s‚µ‚½‚烁ƒbƒZ[ƒWo—Í
517523 if GikoSys.FAbon.GoForward =false then begin
518- MsgBox(GikoForm.Handle, 'ˆê‚‘O‚ÌNGƒ[ƒhƒtƒ@ƒCƒ‹‚̓ǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½', 'ƒGƒ‰[', MB_OK or MB_ICONEXCLAMATION);
524+ MsgBox(GikoForm.Handle, 'ˆê‚‘O‚ÌNGƒ[ƒhƒtƒ@ƒCƒ‹‚̓ǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½',
525+ MSG_ERROR, MB_OK or MB_ICONEXCLAMATION);
519526 end else begin
520527 //ƒXƒe[ƒ^ƒX‚É•\Ž¦‚³‚ê‚éNGƒ[ƒhƒtƒ@ƒCƒ‹–¼‚ðXV
521528 RepaintStatusBar;
@@ -1247,6 +1254,7 @@ begin
12471254 if MsgBox(GikoForm.Handle, StringReplace( DEL_MSG, '^0', ThreadItem.Title, [rfReplaceAll] ) , DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then
12481255 Exit;
12491256 GikoForm.DeleteTab(TBrowserRecord(GikoForm.BrowserTab.Tabs.Objects[idx]));
1257+ GikoForm.DeleteHistory(ThreadItem);
12501258 ThreadItem.DeleteLogFile;
12511259 if ThreadItem.ParentBoard = GikoForm.ActiveList then
12521260 GikoForm.ListView.Refresh;
@@ -1903,7 +1911,7 @@ var
19031911 begin
19041912 if GikoForm.EditorFormExists then begin
19051913 Msg := 'ƒŒƒXƒGƒfƒBƒ^‚ð‘S‚ĕ‚¶‚Ä‚­‚¾‚³‚¢';
1906- MsgBox(GikoForm.Handle, Msg, 'ƒGƒ‰[', MB_OK or MB_ICONSTOP);
1914+ MsgBox(GikoForm.Handle, Msg, MSG_ERROR, MB_OK or MB_ICONSTOP);
19071915 Exit;
19081916 end;
19091917 Dlg := TNewBoardDialog.Create(GikoForm);
@@ -2394,21 +2402,21 @@ end;
23942402 // *************************************************************************
23952403 procedure TGikoDM.GikoNaviWebPageActionExecute(Sender: TObject);
23962404 begin
2397- GikoSys.OpenBrowser(URL_GIKONAVI, gbtAuto);
2405+ GikoSys.OpenBrowser(PROTOCOL_HTTP + URL_GIKONAVI, gbtAuto);
23982406 end;
23992407 // *************************************************************************
24002408 //! ƒ‚ƒiƒWƒ‰‚̃EƒFƒuƒTƒCƒg‚ð•\Ž¦‚·‚é
24012409 // *************************************************************************
24022410 procedure TGikoDM.MonazillaWebPageActionExecute(Sender: TObject);
24032411 begin
2404- GikoSys.OpenBrowser(URL_MONAZILLA, gbtAuto);
2412+ GikoSys.OpenBrowser(PROTOCOL_HTTP + URL_MONAZILLA, gbtAuto);
24052413 end;
24062414 // *************************************************************************
24072415 //! ‚Q‚¿‚á‚ñ‚Ë‚éƒgƒbƒvƒy[ƒW‚ð•\Ž¦‚·‚é
24082416 // *************************************************************************
24092417 procedure TGikoDM.BBS2chWebPageActionExecute(Sender: TObject);
24102418 begin
2411- GikoSys.OpenBrowser(URL_2ch, gbtAuto);
2419+ GikoSys.OpenBrowser(PROTOCOL_HTTP + URL_2ch, gbtAuto);
24122420 end;
24132421 // *************************************************************************
24142422 //! ƒMƒRƒiƒr‚̃tƒHƒ‹ƒ_‚ðŠJ‚­
@@ -2445,7 +2453,7 @@ begin
24452453 'ƒwƒ‹ƒv‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½' + #13#10 +
24462454 'ƒwƒ‹ƒvƒtƒ@ƒCƒ‹‚ðƒMƒRƒiƒr‚̃tƒHƒ‹ƒ_‚É’u‚¢‚Ä‚­‚¾‚³‚¢' + #13#10 +
24472455 'ƒwƒ‹ƒv‚̓MƒRƒiƒr‚̃TƒCƒg‚É’u‚¢‚Ä‚ ‚è‚Ü‚·',
2448- 'ƒGƒ‰[',
2456+ MSG_ERROR,
24492457 MB_ICONSTOP);
24502458 Exit;
24512459 end;
@@ -2456,7 +2464,7 @@ end;
24562464 // *************************************************************************
24572465 procedure TGikoDM.WikiFAQWebPageActionExecute(Sender: TObject);
24582466 begin
2459- GikoSys.OpenBrowser(URL_Wiki, gbtAuto);
2467+ GikoSys.OpenBrowser(PROTOCOL_HTTP + URL_Wiki, gbtAuto);
24602468 end;
24612469 ////////////////////////////////ƒwƒ‹ƒv‚Ü‚Å‚¨‚µ‚Ü‚¢/////////////////////
24622470 // *************************************************************************
@@ -2940,7 +2948,7 @@ begin
29402948 cnt := RoundList.Count[grtBoard];
29412949 cnt := cnt + RoundList.Count[grtItem];
29422950 if cnt > 500 then begin
2943- MsgBox(GikoForm.Handle, '„‰ñ‚Í500ˆÈã“o˜^‚Å‚«‚Ü‚¹‚ñ', 'ƒGƒ‰[', MB_OK or MB_ICONSTOP);
2951+ MsgBox(GikoForm.Handle, '„‰ñ‚Í500ˆÈã“o˜^‚Å‚«‚Ü‚¹‚ñ', MSG_ERROR, MB_OK or MB_ICONSTOP);
29442952 Exit;
29452953 end;
29462954
--- a/GikoSystem.pas
+++ b/GikoSystem.pas
@@ -112,6 +112,8 @@ type
112112 FBayesian : TGikoBayesian; //!< ƒxƒCƒWƒAƒ“ƒtƒBƒ‹ƒ^
113113 FVersion : String; //!< ƒtƒ@ƒCƒ‹ƒo[ƒWƒ‡ƒ“
114114 FGikoMessage: TGikoMessage;
115+ //! ‚ ‚éƒZƒpƒŒ[ƒ^‚Å‹æØ‚ç‚ꂽ•¶Žš—ñ‚©‚ç‚Ž”Ô–Ú‚Ì•¶Žš—ñ‚ðŽæ‚èo‚·
116+ function ChooseString(const Text, Separator: string; Index: integer): string;
115117 public
116118 { Public éŒ¾ }
117119 FAbon : TAbon;
@@ -246,6 +248,8 @@ type
246248 procedure SetGikoMessage;
247249 //! ƒMƒRƒiƒr‚̃ƒbƒZ[ƒW‚ðŽæ“¾‚·‚é
248250 function GetGikoMessage(MesType: TGikoMessageListType): String;
251+ //! GMT‚ÌŽž‚ðTDateTime‚É•ÏŠ·‚·‚é
252+ function DateStrToDateTime(const DateStr: string): TDateTime;
249253 end;
250254
251255 var
@@ -255,7 +259,7 @@ const
255259 ZERO_DATE: Integer = 25569;
256260 BETA_VERSION_NAME_E = 'beta';
257261 BETA_VERSION_NAME_J = 'ÊÞÀ';
258- BETA_VERSION = 52;
262+ BETA_VERSION = 53;
259263 BETA_VERSION_BUILD = ''; //!< debug”Å‚È‚Ç
260264 APP_NAME = 'gikoNavi';
261265 BE_PHP_URL = 'http://be.2ch.net/test/p.php?i=';
@@ -265,7 +269,7 @@ implementation
265269
266270 uses
267271 Giko, RoundData, Favorite, Registry, HTMLCreate, MojuUtils, Sort, YofUtils,
268- IniFiles;
272+ IniFiles, DateUtils;
269273
270274 const
271275 FOLDER_INDEX_VERSION = '1.01';
@@ -365,7 +369,6 @@ end;
365369 \brief •¶Žš—ñ”Žšƒ`ƒFƒbƒN
366370 \param s ƒ`ƒFƒbƒN‚·‚镶Žš—ñ
367371 \return s ‚ª•„†•t‚«®”‚Æ‚µ‚Ä”FŽ¯‰Â”\‚È‚ç True
368-\todo MonaUtils.IsNumeric() ‚ª“¯“™‚Ì‹@”\‚ð•ÛŽ‚µ‚Ä‚¢‚é
369372 }
370373 {$HINTS OFF}
371374 function TGikoSys.IsNumeric(s: string): boolean;
@@ -382,7 +385,6 @@ end;
382385 \brief •¶Žš—ñ•‚“®¬”“_”Žšƒ`ƒFƒbƒN
383386 \param s ƒ`ƒFƒbƒN‚·‚镶Žš—ñ
384387 \return s ‚ª•„†•t‚«•‚“®¬”‚Æ‚µ‚Ä”FŽ¯‰Â”\‚È‚ç True
385-\todo MonaUtils.IsFloat() ‚ª“¯“™‚Ì‹@”\‚ð•ÛŽ‚µ‚Ä‚¢‚é
386388 }
387389 function TGikoSys.IsFloat(s: string): boolean;
388390 var
@@ -705,8 +707,8 @@ begin
705707 ThreadItem.AllResCount := ThreadItem.Count;
706708 ThreadItem.NewResCount := ThreadItem.Count;
707709 ThreadItem.Size := GetFileSize(FileName) - ThreadItem.Count;//1byte‚¸‚ê‚é‚Æ‚«‚ª‚ ‚邯‚Ç‚»‚ê‚Í‚ ‚«‚ç‚ß‚é
708- ThreadItem.RoundDate := ZERO_DATE;
709- ThreadItem.LastModified := ZERO_DATE;
710+ ThreadItem.RoundDate := FileDateToDateTime( FileAge( FileName ) );
711+ ThreadItem.LastModified := ThreadItem.RoundDate;
710712 ThreadItem.Kokomade := -1;
711713 ThreadItem.NewReceive := 0;
712714 ThreadItem.ParentBoard := Board;
@@ -3273,6 +3275,55 @@ begin
32733275 end;
32743276 end;
32753277
3278+//Tue, 17 Dec 2002 12:18:07 GMT ¨ TDateTime‚Ö
3279+//MonaUtils‚©‚çˆÚ“®
3280+function TGikoSys.DateStrToDateTime(const DateStr: string): TDateTime;
3281+ function StrMonthToMonth(const s: string): integer;
3282+ const
3283+ m: array[1..12] of string = ('Jan','Feb','Mar','Apr','May','Jun', 'Jul','Aug','Sep','Oct','Nov','Dec');
3284+ var
3285+ i: integer;
3286+ begin
3287+ Result := -1;
3288+ for i := Low(m) to High(m) do begin
3289+ if (SameText(s, m[i])) then begin
3290+ Result := i;
3291+ Break;
3292+ end;
3293+ end;
3294+ end;
3295+var
3296+ wDay, wMonth, wYear: word;
3297+ wHour, wMinute, wSecond: word;
3298+ sTime: string;
3299+ d: TDateTime;
3300+begin
3301+ wDay := StrToIntDef(ChooseString(DateStr, ' ', 1), 0);
3302+ wMonth := StrMonthToMonth(ChooseString(DateStr, ' ', 2));
3303+ wYear := StrToIntDef(ChooseString(DateStr, ' ', 3), 0);
3304+ sTime := ChooseString(DateStr, ' ', 4);
3305+ wHour := StrToIntDef(ChooseString(sTime, ':', 0), 0);
3306+ wMinute := StrToIntDef(ChooseString(sTime, ':', 1), 0);
3307+ wSecond := StrToIntDef(ChooseString(sTime, ':', 2), 0);
3308+ d := EncodeDateTime(wYear, wMonth, wDay, wHour, wMinute, wSecond, 0);
3309+ Result := d;
3310+end;
3311+//MonaUtils‚©‚çˆÚ“®
3312+//! ‚ ‚éƒZƒpƒŒ[ƒ^‚Å‹æØ‚ç‚ꂽ•¶Žš—ñ‚©‚ç‚Ž”Ô–Ú‚Ì•¶Žš—ñ‚ðŽæ‚èo‚·
3313+function TGikoSys.ChooseString(const Text, Separator: string; Index: integer): string;
3314+var
3315+ S : string;
3316+ i, p : integer;
3317+begin
3318+ S := Text;
3319+ for i := 0 to Index - 1 do begin
3320+ if (AnsiPos(Separator, S) = 0) then S := ''
3321+ else S := Copy(S, AnsiPos(Separator, S) + Length(Separator), Length(S));
3322+ end;
3323+ p := AnsiPos(Separator, S);
3324+ if (p > 0) then Result := Copy(S, 1, p - 1) else Result := S;
3325+end;
3326+
32763327 initialization
32773328 GikoSys := TGikoSys.Create;
32783329
--- a/InputAssist.pas
+++ b/InputAssist.pas
@@ -141,11 +141,16 @@ begin
141141 if (Length(KeyNameEdit.Text) = 0) then begin
142142 ShowMessage('ƒL[–¼‚ðÝ’肵‚Ä‚­‚¾‚³‚¢B');
143143 end else begin
144- resWord := InputAssistDM.Add(KeyNameEdit.Text);
145- resWord.SetCategory(CategoryNameEdit.Text);
146- resWord.SetText(TextMemo.Text);
147- AddListViewItem(resWord);
148- GikoListView1.AlphaSort;
144+ if (not InputAssistDM.IsDupulicate(
145+ KeyNameEdit.Text, CategoryNameEdit.Text) ) then begin
146+ resWord := InputAssistDM.Add(KeyNameEdit.Text);
147+ resWord.SetCategory(CategoryNameEdit.Text);
148+ resWord.SetText(TextMemo.Text);
149+ AddListViewItem(resWord);
150+ GikoListView1.AlphaSort;
151+ end else begin
152+ ShowMessage('“¯ˆê‚̃L[–¼EƒJƒeƒSƒŠ–¼‚ÅŠù‚É“o˜^Ï‚Ý‚Å‚·B');
153+ end;
149154 end;
150155 end;
151156 //! íœƒ{ƒ^ƒ“‰Ÿ‰ºŽž‚̃Cƒxƒ“ƒg
--- a/InputAssistDataModule.pas
+++ b/InputAssistDataModule.pas
@@ -37,6 +37,8 @@ type
3737 function GetCategoryResistWords(Key: String; var list: TStringList): Integer;
3838 //! “o˜^Ï‚݃L[‚Ì‘S‚ẴJƒeƒSƒŠƒŠƒXƒgŽæ“¾
3939 procedure GetCategoryList(var list: TStringList);
40+ //! Šù‚É“o˜^Ï‚݂̃L[‚ƃJƒeƒSƒŠ‚̃Zƒbƒg‚©‚Ç‚¤‚©ƒ`ƒFƒbƒN
41+ function IsDupulicate(Key: String; Category: String): Boolean;
4042
4143 end;
4244
@@ -409,5 +411,24 @@ begin
409411 except
410412 end;
411413 end;
414+//! Šù‚É“o˜^Ï‚݂̃L[‚ƃJƒeƒSƒŠ‚̃Zƒbƒg‚©‚Ç‚¤‚©ƒ`ƒFƒbƒN
415+function TInputAssistDM.IsDupulicate(Key: String; Category: String): Boolean;
416+var
417+ i : Integer;
418+ resWord : TResistWord;
419+begin
420+ // ‚±‚̃ƒ\ƒbƒh‚ł́Aƒ\[ƒgÏ‚Ý‚Æ‚ÍŒÀ‚ç‚È‚¢‚̂ŁA‘S‚ẴL[‚ð’Tõ‚µ‚Ä‚¢‚é
421+ Result := False;
422+ if (FDictionary <> nil) then begin
423+ for i := 0 to FDictionary.Count - 1 do begin
424+ if (Key = FDictionary.Strings[i]) and
425+ (Category = TResistWord(FDictionary.Objects[i]).GetCategory)
426+ then begin
427+ Result := True;
428+ Break;
429+ end;
430+ end;
431+ end;
432+end;
412433
413434 end.
--- a/ItemDownload.pas
+++ b/ItemDownload.pas
@@ -5,7 +5,7 @@ interface
55 uses
66 Windows, SysUtils, Classes, ComCtrls, Controls, Forms, IdHTTP,
77 {HTTPApp,} YofUtils, IdGlobal, IdException, IdComponent, IniFiles, {DateUtils,}
8- GikoSystem, BoardGroup, MonaUtils, ExternalBoardManager, ExternalBoardPlugInMain,
8+ GikoSystem, BoardGroup, ExternalBoardManager, ExternalBoardPlugInMain,
99 Sort;
1010
1111 type
@@ -375,9 +375,9 @@ begin
375375
376376 if Trim(FIndy.Response.RawHeaders.Values['Date']) <> '' then begin
377377 if Item.DownType = gdtBoard then
378- Item.Board.LastGetTime := MonaUtils.DateStrToDateTime(FIndy.Response.RawHeaders.Values['Date'])
378+ Item.Board.LastGetTime := GikoSys.DateStrToDateTime(FIndy.Response.RawHeaders.Values['Date'])
379379 else
380- Item.ThreadItem.ParentBoard.LastGetTime := MonaUtils.DateStrToDateTime(FIndy.Response.RawHeaders.Values['Date']);
380+ Item.ThreadItem.ParentBoard.LastGetTime := GikoSys.DateStrToDateTime(FIndy.Response.RawHeaders.Values['Date']);
381381 end;
382382
383383 if DownloadResult then begin
--- a/ListViewUtils.pas
+++ b/ListViewUtils.pas
@@ -673,17 +673,20 @@ begin
673673 Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Thread.LastModified);
674674 gbcVigor:
675675 begin
676- if (Thread.AgeSage <> gasArch) then begin
677- spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
678- end else begin
679- spanday := DaySpan(Thread.LastModified, Thread.CreateDate);
680- end;
681- if (spanday > 0) then begin
682- Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
676+ if (Thread.CreateDate <> ZERO_DATE) then begin
677+ if (Thread.AgeSage <> gasArch) then begin
678+ spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
679+ end else begin
680+ spanday := DaySpan(Thread.LastModified, Thread.CreateDate);
681+ end;
682+ if (spanday > 0) then begin
683+ Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
684+ end else begin
685+ Item.SubItems[ idx ] := '';
686+ end;
683687 end else begin
684688 Item.SubItems[ idx ] := '';
685689 end;
686-
687690 end;
688691 end;
689692 Inc( idx );
@@ -719,18 +722,21 @@ begin
719722 Item.SubItems[ idx ] := '';
720723 gbcVigor:
721724 begin
722- if (Thread.AgeSage <> gasArch) then begin
723- spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
724- end else begin
725- spanday := DaySpan(Thread.LastModified, Thread.CreateDate);
726- end;
725+ if (Thread.CreateDate <> ZERO_DATE) then begin
726+ if (Thread.AgeSage <> gasArch) then begin
727+ spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
728+ end else begin
729+ spanday := DaySpan(Thread.LastModified, Thread.CreateDate);
730+ end;
727731
728- if (spanday > 0) then begin
729- Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
732+ if (spanday > 0) then begin
733+ Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
734+ end else begin
735+ Item.SubItems[ idx ] := '';
736+ end;
730737 end else begin
731738 Item.SubItems[ idx ] := '';
732739 end;
733-
734740 end;
735741 else
736742 Item.SubItems[ idx ] := '';
--- a/MonaUtils.pas
+++ /dev/null
@@ -1,2205 +0,0 @@
1-unit MonaUtils;
2-
3-{$IOCHECKS ON}
4-
5-{----------------------------------------------------------
6- MonaUtils
7-
8- --History--
9- 2002.12.10 GetDatSinceì¬
10- 2001.03.07 ExtractUrlPathì¬
11- 2001.03.07 ExtractUrlNameì¬
12- 2001.03.08 Maxì¬
13- 2001.03.08 Minì¬
14- 2001.03 10 EMonaError, MonaErrorì¬
15- 2001.03.10 IncludeTrailingSlashì¬
16- 2001.03.10 ExcludeTrailingSlashì¬
17- 2001.03 10 IsUrlDelimiterì¬
18- 2001.03 10 FindFileì¬
19- 2001.03.10 LoadStringFromFileì¬
20- 2001.03.10 SaveStringToFileì¬
21- 2001.03.11 TMonaHtmlParserì¬
22- 2001.03.11 TMonaProfilerì¬
23- 2001.03.11 ShellOpenì¬
24- 2001.04.06 AddHRefTagì¬ < GikoNavi‚æ‚è
25- 2001.04.27 TrimHRefTagì¬
26- 2001.04.27 DecodeHtmlEscì¬
27- 2001.04.27 EncodeHtmlEscì¬
28- 2001.04.27 ExtractHostNameì¬
29- 2001.04.27 Get2chDateì¬ < GikoNavi‚æ‚è
30- 2001.04.27 ChooseStringì¬
31- 2001.04.27 ExtractQuotedStrì¬
32- 2001.04.27 ExtractUrlLastPathì¬
33- 2001.04.27 IsNumericì¬ < GikoNavi‚æ‚è
34- 2001.04.27 IsFloatì¬ < GikoNavi‚æ‚è
35- 2001.04.27 Fmt2chToDateTimeì¬ < Monaplorer‚æ‚è
36- 2001.04.27 AddHRefTag‚ðƒAƒbƒvƒf[ƒg < GikoNavi a013‚æ‚è
37- 2001.04.27 StrCount1ì¬ < Monaplorer‚æ‚è
38- 2001.04.27 BackAnsiPosì¬ < Monaplorer‚æ‚è
39- 2001.10.30 TMonaProfiler‚ðˆê’UŠO‚·
40- 2001.10.30 TMonaHtmlParser‚É AttributesƒvƒƒpƒeƒB‚ð’ljÁ < Hotzonu‚æ‚è
41- 2001.10.30 UrlToDosPathì¬ < Hotzonu‚æ‚è
42- 2001.10.30 ChooseValueì¬ < Hotzonu‚æ‚è
43- 2001.10.30 MargeUrlì¬ < Hotzonu‚æ‚è
44- 2001.10.30 ExtractHrefUrlì¬ < Hotzonu‚æ‚è
45- 2001.10.30 ZenToHanì¬ < Hotzonu‚æ‚è
46- 2001.10.30 GetContentLengthì¬ < Hotzonu‚æ‚è
47- 2001.10.30 TrimTagì¬ < Hotzonu‚æ‚è
48- 2001.10.30 AddTargetBlankì¬ < Hotzonu‚æ‚è
49- 2001.11.09 ExtractDatNoì¬
50-
51- --Procedures--
52- ExtractUrlPath .......... URL‚©‚çƒpƒX‚¾‚¯‚𒊏o
53- ExtractUrlName .......... URL‚©‚çƒtƒ@ƒCƒ‹–¼‚¾‚¯‚𒊏o
54- IncludeTrailingSlash .... ƒtƒ@ƒCƒ‹–¼‚Ì––”ö‚É'/'‚ð’ljÁ‚·‚é
55- ExcludeTrailingSlash .... ƒtƒ@ƒCƒ‹–¼‚Ì––”ö‚©‚ç'/'‚ðŽæ‚菜‚­
56- IsUrlDelimiter .......... •¶Žš—ñ’†‚ÌŽw’èˆÊ’u‚ª / ‚©‚Ç‚¤‚©
57- Max ..................... ‚Ó‚½‚‚̈ø”‚Ì‚¤‚¿‘å‚«‚¢•û‚ð•Ô‚·
58- Min ..................... ‚Ó‚½‚‚̈ø”‚Ì‚¤‚¿¬‚³‚¢•û‚ð•Ô‚·
59- FindFile ................ Žw’èƒpƒX‚̃tƒ@ƒCƒ‹‚Ì TSearchRec‚ð•Ô‚·
60- LoadStringFromFile ...... ƒtƒ@ƒCƒ‹‚©‚當Žš—ñ‚ð“ǂݍž‚Þ
61- SaveStringToFile ........ •¶Žš—ñ‚ðƒtƒ@ƒCƒ‹‚ɏ‘‚«o‚·
62- ShellOpen ............... Žw’èƒtƒ@ƒCƒ‹“™‚ðShellExecute
63- AddHRefTag .............. http://‚©‚çŽn‚܂镶Žš—ñ‚É Aƒ^ƒO‚ð‚‚¯‚é
64- TrimHRefTag ............. •¶Žš—ñ‚©‚ç<A HREF`> </A>ƒ^ƒO‚ðœ‹Ž‚·‚é
65- DecodeHtmlEsc ........... •¶Žš—ñ’†‚Ì“ÁŽêƒ^ƒO(&lt;‚Æ‚©)‚ð•ÏŠ·‚·‚é
66- EncodeHtmlEsc ........... •¶Žš—ñ’†‚Ì"<"‚È‚Ç‚ð“ÁŽêƒ^ƒO‚É•ÏŠ·‚·‚é
67- ExtractHostName ......... URL‚©‚çƒzƒXƒg–¼‚¾‚¯‚𒊏o
68- Get2chDate .............. “ú•t‚ð‚Q‚¿‚á‚ñ‚Ë‚éPOST—p“ú•t‚É•ÏŠ·‚·‚é
69- ChooseString ............ ‚ ‚éƒZƒpƒŒ[ƒ^‚Å‹æØ‚ç‚ꂽ•¶Žš—ñ‚©‚ç
70- ‚Ž”Ô–Ú‚Ì•¶Žš—ñ‚ðŽæ‚èo‚·
71- ExtractQuotedStr ........ •¶Žš—ñ‚Ì‘OŒã‚̈ø—p•„‚ðŠO‚·
72- ExtractUrlLastPath ...... URL‚̍Ōã‚̃pƒX‚𒊏o
73- IsNumeric ............... Žw’蕶Žš—ñ‚ª®”‚©‚Ç‚¤‚©‚ð”»’f‚·‚é
74- IsFloat ................. Žw’蕶Žš—ñ‚ªŽÀ”‚©‚Ç‚¤‚©‚ð”»’f‚·‚é
75- Fmt2chToDateTime ........ DATƒtƒ@ƒCƒ‹‚Å‚Ì“ú•t•¶Žš—ñ‚ð“ú•tŒ^‚É•ÏŠ·‚·‚é
76- StrCount1 ............... S‚Ì’†‚ÉSubStr‚ª‚¢‚­‚‚ ‚é‚©ƒJƒEƒ“ƒg‚·‚é(2ƒoƒCƒg‘Ήž)
77- UrlToDosPath ............ URL‚ðDOSŒ`Ž®‚̃pƒX‚É•ÏŠ·‚·‚é
78- ChooseValue ............. URL‚Ì ?param=value ‚ÌParam‚ðŽw’è‚·‚é‚ÆValue‚ðŽæ“¾‚·‚é
79- MargeUrl ................ â‘ÎURL‚Æ‘Š‘ÎURL‚ðƒ}[ƒW‚·‚é
80- ExtractHrefUrl .......... A HREFƒ^ƒO‚Ì’†‚©‚çURL‚𒊏o‚·‚é
81- ZenToHan ................ ‘SŠp•¶Žš—ñ‚𔼊p•¶Žš—ñ‚É•ÏŠ·(Windows‚Ì‚Ý)
82- GetContentLength ........ Žw’蕶Žš—ñ‚Ì’·‚³‚ð•Ô‚· (#13‚ðŠÜ‚Ü‚È‚¢)
83- TrimTag ................. Žw’肳‚ꂽ•¶Žš—ñ‚©‚çƒ^ƒO‚ðœ‹Ž‚·‚é
84- AddTargetBlank .......... A HREFƒ^ƒO‚É TARGET="_blank"‚ð‘}“ü‚·‚é
85- ExtractDatNo ............ DATƒtƒ@ƒCƒ‹–¼‚©‚ç DAT‚̔ԍ†‚¾‚¯Žæ“¾‚·‚é
86-
87- --Classes--
88- TMonaHtmlParser ......... HTMLƒp[ƒT[ƒNƒ‰ƒX
89- TMonaProfiler ........... ƒvƒƒtƒ@ƒCƒ‰
90-
91- --Report--
92- SaveStringToFile ‚ÍLinuxƒvƒ‰ƒbƒgƒtƒH[ƒ€‚Å’·‚³ƒ[ƒ‚Ì•¶Žš—ñ‚ðƒTƒ|[ƒg‚µ‚Ü‚¹‚ñB
93- ShellOpen, MonaProfiler‚ÍLinuxƒvƒ‰ƒbƒgƒtƒH[ƒ€‚ðƒTƒ|[ƒg‚µ‚Ü‚¹‚ñB
94-----------------------------------------------------------}
95-
96-interface
97-
98-uses
99- {$IFDEF LINUX}
100- QForms,
101- {$ENDIF}
102- {$IFDEF MSWINDOWS}
103- Windows, ShellApi, Forms,
104- {$ENDIF}
105- Classes, SysUtils, {HTTPApp,} YofUtils, DateUtils;
106-
107-//
108-// —áŠO
109-//
110-type
111- EMonaError = class(Exception);
112-
113-// EMonaError‚ðraise
114-procedure MonaError(msg: String); overload;
115-procedure MonaError(format: String; args: array of const); overload;
116-
117-//
118-// Žè‘±‚«EŠÖ”
119-//
120-function ExtractUrlPath(const FileName: string): string;
121-function ExtractUrlName(const FileName: string): string;
122-function Max(A, B: Integer): Integer; overload;
123-function Max(A, B: Int64): Int64; overload;
124-function Max(A, B: Single): Single; overload;
125-function Max(A, B: Double): Double; overload;
126-function Max(A, B: Extended): Extended; overload;
127-function Min(A, B: Integer): Integer; overload;
128-function Min(A, B: Int64): Int64; overload;
129-function Min(A, B: Single): Single; overload;
130-function Min(A, B: Double): Double; overload;
131-function Min(A, B: Extended): Extended; overload;
132-function IncludeTrailingSlash(const S: string): string;
133-function ExcludeTrailingSlash(const S: string): string;
134-function IsUrlDelimiter(const S: string; Index: Integer): Boolean;
135-function FindFile(const FileName: String): TSearchRec;
136-function LoadStringFromFile(const FileName: String): String;
137-procedure SaveStringToFile(const FileName, Str: String);
138-procedure ShellOpen(const FileName: String); // ‚Æ‚É‚©‚­ŠJ‚­
139-function AddHRefTag(s: string): string;
140-function TrimHRefTag(const S: string): string;
141-function DecodeHtmlEsc(const s: string): string;
142-function EncodeHtmlEsc(const s: string): string;
143-function ExtractHostName(const Url: string): string;
144-function Get2chDate(aDate: TDateTime): string; {from GikoNavi / hiroyuki}
145-function GetDatSince(aDatNo: string): string;
146-function ChooseString(const Text, Separator: string; Index: integer): string;
147-function ExtractQuotedStr(S: string; Quote: char): string;
148-function ExtractUrlLastPath(Url: string): string;
149-function IsNumeric(s: string): boolean; {GikoNavi}
150-function Fmt2chToDateTime(Fmt2ch: String): TDateTime; {monaCommonFunc}
151-function StrCount1(const Substr, S: string): Integer; {monaCommonFunc}
152-function BackAnsiPos(const SubStr,S: String): Integer;{monaCommonFunc}
153-function IsFloat(s: string): boolean;
154-function UrlToDosPath(const Url: string): string;
155-function ChooseValue(const Url, Key: string): string;
156-function MargeUrl(const BaseUrl, NewUrl: string): string;
157-function ExtractHrefUrl(const s: string): string;
158-function ZenToHan(const s: string): string;
159-function GetContentLength(S : string): integer;
160-function TrimTag(const s: string): string;
161-function AddTargetBlank(const Value: string): string;
162-function ExtractDatNo(const DatFileName: string): string;
163-function DateStrToDateTime(const DateStr: string): TDateTime;
164-//
165-procedure testMonaUtils;
166-
167-//
168-// ƒNƒ‰ƒXEƒŒƒR[ƒh
169-//
170-type
171- TMonaHtmlTokenType = (
172- htNone,
173- htTag, // ƒ^ƒO‚Ì’†
174- htText // ƒ^ƒO‚ÌŠO
175- );
176-
177- TMonaHtmlParser = class(TObject)
178- protected
179- p: PChar;
180- FLine: String;
181- FToken: String;
182- FTokenType: TMonaHtmlTokenType;
183- FAttributes: TStrings;
184- procedure SetAttributes(const Value: TStrings); // Dax
185- procedure makeAttributes(const Token: string); // Dax
186- public
187- constructor Create(s: String); virtual;
188- destructor Destory; // Dax
189- procedure Error; // ‰ðÍƒGƒ‰[—áŠO‚𔭐¶‚³‚¹‚é
190- procedure Assign(s: String);
191- procedure GetToken(ATokenType: TMonaHtmlTokenType; AToken: String; IgnoreCase: Boolean = False); overload;
192- function GetToken: TMonaHtmlTokenType; overload;
193- function GetToken(ATokenType: TMonaHtmlTokenType): String; overload;
194- property Token: String read FToken;
195- property TokenType: TMonaHtmlTokenType read FTokenType;
196- property Attributes: TStrings read FAttributes write SetAttributes; // Dax
197- end;
198-
199- TMonaProfiler = class(TObject)
200- private
201- FActive: Boolean;
202- FStartCounter, FTotalCounter: Int64;
203- function GetMicroSec: Integer;
204- function GetMilliSec: Integer;
205- function GetSec: Integer;
206- procedure SetActive(const Value: Boolean);
207- protected
208- function GetCounter: Int64;
209- public
210- constructor Create;
211- procedure Start;
212- procedure Stop;
213- procedure Clear;
214- property Active: Boolean read FActive write SetActive;
215- property MilliSec: Integer read GetMilliSec;
216- property MicroSec: Integer read GetMicroSec;
217- property Sec: Integer read GetSec;
218- end;
219-
220-////////////////////////////////////////////////////////////////////////////////
221-implementation
222-////////////////////////////////////////////////////////////////////////////////
223-
224-uses
225- MonaTest;
226-
227-procedure MonaError(msg: String);
228-begin
229- raise EMonaError.Create(msg);
230-end;
231-
232-procedure MonaError(format: String; args: array of const);
233-begin
234- MonaError(SysUtils.Format(format, args));
235-end;
236-
237-function ExtractUrlPath(const FileName: string): string;
238-var
239- I: Integer;
240-begin
241- I := LastDelimiter('/:', FileName);
242- Result := Copy(FileName, 1, I);
243-end;
244-
245-procedure testExtractUrlPath;
246- procedure mycheck(s, s2: String);
247- begin
248- Check(s, ExtractUrlPath(s2));
249- end;
250-begin
251- mycheck(
252- 'http://piza.2ch.net/tech/',
253- 'http://piza.2ch.net/tech/index2.html');
254-
255- mycheck(
256- 'http://piza.2ch.net/tech/',
257- 'http://piza.2ch.net/tech/index2.html#menu');
258-
259- mycheck(
260- 'http://',
261- 'http://www.yahoo.co.jp' );
262-
263- mycheck(
264- '',
265- 'www.yahoo.co.jp' );
266-end;
267-
268-function ExtractUrlName(const FileName: string): string;
269-var
270- I: Integer;
271-begin
272- I := LastDelimiter('/:', FileName);
273- Result := Copy(FileName, I + 1, MaxInt);
274-end;
275-
276-procedure testExtractUrlName;
277- procedure mycheck(s, s2: String);
278- begin
279- Check(s, ExtractUrlName(s2));
280- end;
281-begin
282- mycheck(
283- 'index2.html',
284- 'http://piza.2ch.net/tech/index2.html');
285-
286- mycheck(
287- 'index2.html#menu',
288- 'http://piza.2ch.net/tech/index2.html#menu');
289-
290- mycheck(
291- 'www.yahoo.co.jp',
292- 'http://www.yahoo.co.jp' );
293-
294- mycheck(
295- 'www.yahoo.co.jp',
296- 'www.yahoo.co.jp' );
297-end;
298-
299-
300-function Max(A, B: Integer): Integer;
301-begin
302- if B < A then Result := A else Result := B;
303-end;
304-
305-function Max(A, B: Int64): Int64;
306-begin
307- if B < A then Result := A else Result := B;
308-end;
309-
310-function Max(A, B: Single): Single;
311-begin
312- if B < A then Result := A else Result := B;
313-end;
314-
315-function Max(A, B: Double): Double;
316-begin
317- if B < A then Result := A else Result := B;
318-end;
319-
320-function Max(A, B: Extended): Extended;
321-begin
322- if B < A then Result := A else Result := B;
323-end;
324-
325-function Min(A, B: Integer): Integer;
326-begin
327- if A < B then Result := A else Result := B;
328-end;
329-
330-function Min(A, B: Int64): Int64; overload;
331-begin
332- if A < B then Result := A else Result := B;
333-end;
334-
335-function Min(A, B: Single): Single; overload;
336-begin
337- if A < B then Result := A else Result := B;
338-end;
339-
340-function Min(A, B: Double): Double; overload;
341-begin
342- if A < B then Result := A else Result := B;
343-end;
344-
345-function Min(A, B: Extended): Extended; overload;
346-begin
347- if A < B then Result := A else Result := B;
348-end;
349-
350-procedure testMaxMin;
351-var
352- LowInteger, HighInteger: Integer;
353- LowInt64, HighInt64: Int64;
354- LowSingle, HighSingle: Single;
355- LowDouble, HighDouble: Double;
356- LowExtended, HighExtended: Extended;
357-begin
358- LowInteger := Low(Integer) ; HighInteger := High(Integer);
359- LowInt64 := Low(Int64); HighInt64 := High(Int64);
360- LowSingle := -PI; HighSingle := PI;
361- LowDouble := -PI; HighDouble := PI;
362- LowExtended := -PI; HighExtended := PI;
363- Check(
364- HighInteger,
365- Max(LowInteger, HighInteger));
366- Check(
367- HighInt64,
368- Max(LowInt64, HighInt64));
369- Check(
370- HighSingle,
371- Max(LowSingle, HighSingle));
372- Check(
373- HighDouble,
374- Max(LowDouble, HighDouble));
375- Check(
376- HighExtended,
377- Max(LowExtended, HighExtended));
378- Check(
379- LowInteger,
380- Min(LowInteger, HighInteger));
381- Check(
382- LowInt64,
383- Min(LowInt64, HighInt64));
384- Check(
385- LowSingle,
386- Min(LowSingle, HighSingle));
387- Check(
388- LowDouble,
389- Min(LowDouble, HighDouble));
390- Check(
391- LowExtended,
392- Min(LowExtended, HighExtended));
393-end;
394-
395-
396-
397-//ƒtƒ@ƒCƒ‹–¼‚Ì––”ö‚É'\'‚ð’ljÁ‚·‚éŠÖ”
398-function IncludeTrailingSlash(const S: string): string;
399-begin
400- Result := S;
401- if not IsUrlDelimiter(Result, Length(Result)) then
402- Result := Result + '/';
403-end;
404-
405-procedure testIncludeTrailingSlash;
406- procedure mycheck(s, s2: string);
407- begin
408- Check(s, IncludeTrailingSlash(s2));
409- end;
410-begin
411- mycheck(
412- 'http://www.yahoo.co.jp/',
413- 'http://www.yahoo.co.jp' );
414- mycheck(
415- 'http://www.yahoo.co.jp/',
416- 'http://www.yahoo.co.jp/' );
417-end;
418-
419-//ƒtƒ@ƒCƒ‹–¼‚Ì––”ö‚©‚ç'\'‚ðŽæ‚菜‚­ŠÖ”
420-function ExcludeTrailingSlash(const S: string): string;
421-begin
422- Result := S;
423- if IsUrlDelimiter(Result, Length(Result)) then
424- SetLength(Result, Length(Result)-1);
425-end;
426-
427-procedure testExcludeTrailingSlash;
428- procedure mycheck(s, s2: String);
429- begin
430- Check(s, ExcludeTrailingSlash(s2));
431- end;
432-begin
433- mycheck(
434- 'http://www.yahoo.co.jp',
435- 'http://www.yahoo.co.jp/' );
436- mycheck(
437- 'http://www.yahoo.co.jp',
438- 'http://www.yahoo.co.jp' );
439-end;
440-
441-function IsUrlDelimiter(const S: string; Index: Integer): Boolean;
442-begin
443- Result := (Index > 0) and (Index <= Length(S)) and (S[Index] = '/')
444- and (ByteType(S, Index) = mbSingleByte);
445-end;
446-
447-procedure testIsUrlDelimiter;
448- procedure mycheck(b: Boolean; s: String; Index: Integer);
449- begin
450- Check(b, IsUrlDelimiter(s, Index));
451- end;
452-begin
453- mycheck(
454- True,
455- 'http://www.yahoo.co.jp/index.htm', 6 );
456- mycheck(
457- False,
458- 'http://www.yahoo.co.jp/index.htm', 3 );
459-end;
460-
461-//ƒtƒ@ƒCƒ‹‚©‚當Žš—ñ‚ð“ǂݍž‚Þ
462-function LoadStringFromFile(const FileName: String): String;
463-var
464- size: Integer;
465- F: File;
466-begin
467- size := FindFile(FileName).Size;
468- if size = 0 then
469- begin
470- Result := '';
471- Exit;
472- end;
473-
474- try
475- SetLength(Result, size);
476- AssignFile(F, FileName);
477- Reset(F, size);
478- BlockRead(F, PChar(Result)^, 1);
479- finally
480- CloseFile(F);
481- end;
482-end;
483-
484-procedure SaveStringToFile(const FileName, Str: String);
485-var
486- path: String;
487- F: File;
488-begin
489- path := ExtractFileDir(FileName);
490- if (path <> '') and not DirectoryExists(path) then
491- {$IFDEF VER130}
492- if ForceDirectories(path) then
493- MonaError('ƒfƒBƒŒƒNƒgƒŠ%s‚ªì‚ê‚Ü‚¹‚ñB', [path]);
494- {ƒEƒG(L„DM) ƒtƒHƒ‹ƒ_‚ª‘¶Ý‚µ‚È‚¢ê‡ì¬‚·‚é}
495- {$ELSE}
496- try
497- ForceDirectories(path);
498- except
499- MonaError('ƒfƒBƒŒƒNƒgƒŠ%s‚ªì‚ê‚Ü‚¹‚ñB', [path]);
500- end;
501- {$ENDIF}
502- try
503- AssignFile(F, FileName);
504- Rewrite(F, Length(Str));
505- if Length(Str) > 0 then
506- BlockWrite(F, PChar(Str)^, 1);
507- finally
508- CloseFile(F);
509- end;
510-end;
511-
512-procedure testLoadSaveString;
513- procedure mycheck(s: String);
514- var s2: String;
515- begin
516- try
517- SaveStringToFile('testString.txt', s);
518- s2 := LoadStringFromFile('testString.txt');
519- Check(s, s2, 'testLoadSaveString');
520- except
521- on E:Exception do Error(E);
522- end;
523- end;
524-begin
525- mycheck('hello,world');
526- {$IFDEF LINUX}
527- {$ELSE}
528- mycheck(''); //Kylix ‚ł̓Gƒ‰[
529- //ƒvƒƒWƒFƒNƒg Project1 ‚ª EInOutError ƒNƒ‰ƒX‚Ì—áŠO‚𐶐¬‚µ‚Ü‚µ‚½B
530- //'“ü—Í’l‚ª”’l‚Å‚Í‚ ‚è‚Ü‚¹‚ñ'
531- {$ENDIF}
532- mycheck('test' + #13 + 'LoadString' + #10 + 'SaveString' + #13 + #10 + 'xxx');
533-end;
534-
535-function FindFile(const FileName: String): TSearchRec;
536-begin
537- if FindFirst(FileName, faAnyFile, Result) = 0 then
538- FindClose(Result)
539- else
540- MonaError('%s‚̏î•ñ‚̎擾‚ÉŽ¸”s‚µ‚Ü‚µ‚½B', [FileName]);
541-end;
542-
543-procedure testFindFile;
544-var
545- sl: TStringList;
546-begin
547- sl := TStringList.Create;
548- try
549- sl.Text := 'hello,world';
550- sl.SaveToFile('fileinfo.txt');
551- with FindFile('fileinfo.txt') do
552- begin
553- Check(Size, Length(sl.Text));
554- Check(Name, 'fileinfo.txt');
555- end;
556- finally
557- sl.Free;
558- end;
559-end;
560-
561-{ TMonaHtmlParser }
562-procedure TMonaHtmlParser.Error;
563-begin
564- MonaError('HTML‚̉ðÍ‚ÉŽ¸”s‚µ‚Ü‚µ‚½:%s', [p]);
565-end;
566-
567-constructor TMonaHtmlParser.Create(s: String);
568-begin
569- FAttributes := TStringList.Create;
570- Assign(s);
571-end;
572-
573-procedure TMonaHtmlParser.Assign(s: String);
574-begin
575- FLine := s;
576- p := PChar(s);
577-end;
578-
579-function TMonaHtmlParser.GetToken: TMonaHtmlTokenType;
580-begin
581- FToken := '';
582- while True do
583- case p^ of
584- #10, #13:
585- Inc(p);
586- else
587- break;
588- end;
589-
590- case p^ of
591- #0:
592- FTokenType := htNone;
593-
594- '<':
595- begin
596- FTokenType := htTag;
597- while True do
598- begin
599- Inc(p);
600- case p^ of
601- #10, #13:
602- ;
603- #0, '<':
604- Error;
605- '>':
606- begin
607- makeAttributes(FToken); // add Dax 2001/10/30
608- Break;
609- end;
610- else
611- FToken := FToken + p^;
612- end;
613- end;
614- Inc(p);
615- end;
616-
617- else
618- FTokenType := htText;
619- while True do
620- begin
621- case p^ of
622- #10, #13:
623- ;
624- #0, '<':
625- Break;
626-
627- '>':
628- Error;
629- else
630- FToken := FToken + p^;
631- end;
632- Inc(p);
633- end;
634- end;
635-
636- Result := FTokenType;
637-end;
638-
639-function TMonaHtmlParser.GetToken(ATokenType: TMonaHtmlTokenType): String;
640-begin
641- if GetToken <> ATokenType then
642- Error;
643- Result := Token;
644-end;
645-
646-procedure TMonaHtmlParser.GetToken(ATokenType: TMonaHtmlTokenType;
647- AToken: String; IgnoreCase: Boolean);
648-begin
649- if IgnoreCase then
650- begin
651- if UpperCase(GetToken(ATokenType)) <> UpperCase(AToken) then
652- Error;
653- end else begin
654- if GetToken(ATokenType) <> AToken then
655- Error;
656- end;
657-end;
658-
659-
660-destructor TMonaHtmlParser.Destory;
661-begin
662- FAttributes.Free;
663-end;
664-
665-procedure TMonaHtmlParser.makeAttributes(const Token: string);
666-var
667- x, xend : PChar;
668- Attr : string;
669- S : string;
670-begin
671- //'<AAA BBB=CCC DDD=EEE>'
672- x := PChar(Token);
673- xend := PChar(Token) + Length(Token) + 1;
674- S := '';
675- while (x < xend) do begin
676- if (x^ = ' ') or (x^ = #0) then begin
677- if (Attr <> '') then begin
678- FAttributes.Values[Attr] := S;
679- end;
680- Attr := '';
681- S := '';
682- end else
683- if (x^ = '=') then begin
684- Attr := S;
685- S := '';
686- end else begin
687- S := S + x^;
688- end;
689- inc(x);
690- end;
691-end;
692-
693-procedure TMonaHtmlParser.SetAttributes(const Value: TStrings);
694-begin
695- FAttributes.Assign(Value);
696-end;
697-
698-procedure testMonaHtmlParser;
699-var
700- parser: TMonaHtmlParser;
701-
702-begin
703- parser := TMonaHtmlParser.Create( // TStrings.Text‚È‚Ç‚ð“n‚·
704- '<!-- saved from url=(0032)http://www.2ch.net/bbstable.html -->' +
705- '<html>' +#10+
706- '<HEAD>' +#13+
707- '<TITLE>BBS TABLE for 2ch</TITLE>' +
708- '</HEAD>' +#13+
709- '<Body>' +#13+#10+
710- 'y<B>“é‚ꍇ‚¢</B>z' +
711- '<A href="http://piza.2ch.net/intro/index2.html">Ž©ŒÈÐ‰î</A>' +
712- '</Body>' +#10+#13+
713- '</html>' +#10
714- );
715- with parser do
716- try
717- // ‰üs•¶Žš‚Í‚·‚ׂĖ³Ž‹A‘啶Žš¬•¶Žš‚Í‹æ•ÊA
718- // ƒeƒLƒXƒgEƒ^ƒO‚Ì’†g‚͉ðŽß‚¹‚¸‚É‚»‚Ì‚Ü‚Ü•Ô‚·B
719- GetToken(htTag, '!-- saved from url=(0032)http://www.2ch.net/bbstable.html --');
720-// GetToken;(htTag, 'html');
721- GetToken;
722- Check(TokenType = htTag, 'GetToken = htTag');
723- Check(Token, 'html');
724-
725-// GetToken(htTag, 'HEAD');
726- Check(GetToken(htTag), 'HEAD');
727-
728- GetToken(htTag, 'TITLE');
729- GetToken(htText, 'BBS TABLE for 2ch');
730- GetToken(htTag, '/title', True);
731- GetToken(htTAG, '/HEAD');
732- GetToken(htTag, 'Body');
733- GetToken(htText, 'y');
734- GetToken(htTag, 'B');
735- GetToken(htText, '“é‚ꍇ‚¢');
736- GetToken(htTag, '/B');
737- GetToken(htText, 'z');
738- GetToken(htTag, 'A href="http://piza.2ch.net/intro/index2.html"');
739- GetToken(htText, 'Ž©ŒÈÐ‰î');
740- GetToken(htTag, '/A');
741- GetToken(htTag, '/Body');
742- GetToken(htTag, '/html');
743- Check(GetToken = htNone); // ‚¨‚µ‚Ü‚¢
744- finally
745- Free;
746- end;
747-end;
748-
749-{ TMonaProfiler }
750-
751-// PerformanceCounter—p
752-var TMonaProfiler_FFrequency: Int64;
753-
754-procedure TMonaProfiler.Clear;
755-begin
756- FTotalCounter := 0;
757- if FActive then
758- FStartCounter := GetCounter;
759-end;
760-
761-constructor TMonaProfiler.Create;
762-begin
763- Clear;
764-end;
765-
766-function TMonaProfiler.GetCounter: Int64;
767-begin
768- {$IFDEF LINUX}
769- //
770- {$ELSE}
771- if not QueryPerformanceCounter(Result) then
772- RaiseLastWin32Error;
773- {$ENDIF}
774-end;
775-
776-function TMonaProfiler.GetMicroSec: Integer;
777-var
778- counter: Int64;
779-begin
780- counter := FTotalCounter;
781- if FActive then
782- Inc(counter, GetCounter - FStartCounter);
783- try
784- Result := Round(counter / TMonaProfiler_FFrequency * 1000000);
785- except
786- Result := 0;
787- end;
788-end;
789-
790-function TMonaProfiler.GetMilliSec: Integer;
791-var
792- counter: Int64;
793-begin
794- counter := FTotalCounter;
795- if FActive then
796- Inc(counter, GetCounter - FStartCounter);
797- try
798- Result := Round(counter / TMonaProfiler_FFrequency * 1000);
799- except
800- Result := 0;
801- end;
802-end;
803-
804-function TMonaProfiler.GetSec: Integer;
805-var
806- counter: Int64;
807-begin
808- counter := FTotalCounter;
809- if FActive then
810- Inc(counter, GetCounter - FStartCounter);
811- try
812- Result := Round(counter / TMonaProfiler_FFrequency);
813- except
814- Result := 0;
815- end;
816-end;
817-
818-procedure TMonaProfiler.SetActive(const Value: Boolean);
819-begin
820- FActive := Value;
821- if FActive then
822- Start
823- else
824- Stop;
825-end;
826-
827-procedure TMonaProfiler.Start;
828-begin
829- if FActive then
830- Exit;
831- FActive := True;
832- FStartCounter := GetCounter;
833-end;
834-
835-procedure TMonaProfiler.Stop;
836-begin
837- if not FActive then
838- Exit;
839- Inc(FTotalCounter, GetCounter - FStartCounter);
840- FActive := False;
841-end;
842-
843-procedure testMonaProfiler;
844-var
845- profiler: TMonaProfiler;
846-begin
847- profiler := TMonaProfiler.Create;
848- try
849- profiler.Start; // ŠJŽn
850- Sleep(500);
851- profiler.Stop;
852- Check(500, (profiler.MilliSec + 50) div 100 * 100);
853-
854- Sleep(500);
855-
856- profiler.Start; // ÄŠJ
857- Sleep(1000);
858- Check(1500, (profiler.MilliSec + 50) div 100 * 100); // ‰Ò“®’†‚Å‚àOK
859- profiler.Stop;
860-
861- profiler.Clear;
862- Check(0, profiler.MicroSec);
863- profiler.Start; // ŠJŽn
864- Sleep(500);
865- profiler.Stop;
866- Check(500*1000, (profiler.MicroSec + 50) div 1000 * 1000);
867- finally
868- end;
869-end;
870-
871-procedure ShellOpen(const FileName: String); // ‚Æ‚É‚©‚­ŠJ‚­
872-begin
873- {$IFDEF WINDOWS}
874- if 32 >= ShellExecute(Application.Handle, 'open', PChar(FileName), nil, nil, sw_show) then
875- RaiseLastWin32Error;
876- {$ELSE}
877- // ??‚È‚ñ‚¾‚ë‚Ë??
878- {$ENDIF}
879-end;
880-
881-(*
882-function AddHRefTag(s: string): string;
883-const
884- NORMAL_CHAR: string = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:/.%?&#=-_~+*;!^`\|@[]{}$,';
885-var
886- url: string;
887- i: Integer;
888- idx: Integer;
889-begin
890- Result := '';
891-
892- while True do begin
893- idx := AnsiPos('http://', s);
894-
895- if idx = 0 then begin
896- //ƒŠƒ“ƒN‚ª–³‚¢[‚æB
897- Result := Result + s;
898- Break;
899- end;
900-
901- Result := Result + Copy(s, 0, idx - 1);
902-
903- s := Copy(s, idx, length(s));
904-
905- for i := 0 to Length(s) do begin
906-
907- idx := AnsiPos(s[i + 1], NORMAL_CHAR);
908-
909- if (idx = 0) or (i = (Length(s))) then begin
910- //URL‚¶‚á‚È‚¢•¶Žš”­Œ©I‚Æ‚©A•¶Žš‚ª‚È‚­‚È‚Á‚½B
911- url := Copy(s, 0, i);
912-
913- Result := Result + '<a href="' + url + '" target="_blank">' + url + '</a>';
914- s := Copy(s, i + 1, Length(s));
915- Break;
916- end;
917- end;
918- end;
919-end;
920-*)
921-function AddHRefTag(s: string): string;
922-const
923- NORMAL_CHAR: string = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:/.%?&#=-_~+*;!^`\|@[]{}$,';
924-var
925- url: string;
926- i, x: Integer;
927- idx, idx1, idx2, idx3, idx4: Integer;
928- prefix: string;
929- s1: string;
930-begin
931- Result := '';
932-
933- while True do begin
934- idx1 := AnsiPos('http://', s);
935- idx2 := AnsiPos('ttp://', s);
936- idx3 := AnsiPos('www.', s);
937-
938- if (idx1 > 1) then begin
939- for x := idx1 downto 1 do begin
940- if (s[x] = '>') then begin
941- Break;
942- end else
943- if (s[x] = '<') then begin
944- idx1 := 0;
945- idx2 := 0;
946- idx3 := 0;
947- Break;
948- end;
949- end;
950- end;
951- if (idx1 > 4) then begin
952- s1 := AnsiLowerCase(Copy(s, idx1 - 4, 4));
953- if (s1 <> '<br>') and
954- (s[idx1 - 1] = '>') then
955- begin
956- idx1 := 0;
957- idx2 := 0;
958- idx3 := 0;
959- end;
960- end;
961- if ((idx3 < idx2) and (idx3 > 0)) or ((idx3 > 0) and (idx2 = 0)) then begin
962- // www
963- idx := idx3;
964- prefix:= 'http://';
965- end else
966- if (idx2 < idx1) or ((idx2 > 0) and (idx1 = 0)) then begin
967- // ttp
968- idx := idx2;
969- prefix:= 'h';
970- end else begin
971- idx := idx1;
972- prefix:= '';
973- end;
974-
975- if (idx1 = 0) and (idx2 = 0) and (idx3 = 0) then begin
976- //ƒŠƒ“ƒN‚ª–³‚¢[‚æB
977- Result := Result + s;
978- Break;
979- end;
980-
981- Result := Result + Copy(s, 0, idx - 1);
982- s := Copy(s, idx, length(s));
983- for i := 0 to Length(s) - 1 do begin
984- idx4 := AnsiPos(s[i + 1], NORMAL_CHAR);
985- if (idx4 = 0) then begin
986- url := Copy(s, 0, i);
987- Result := Result + '<a href="' + prefix + url + '" target="_blank">' + url + '</a>';
988- s := Copy(s, i + 1, Length(s));
989- Break;
990- end else
991- if (i = (Length(s) - 1)) then begin
992- //URL‚¶‚á‚È‚¢•¶Žš”­Œ©I‚Æ‚©A•¶Žš‚ª‚È‚­‚È‚Á‚½B
993- url := Copy(s, 0, i + 1);
994- Result := Result + '<a href="' + prefix + url + '" target="_blank">' + url + '</a>';
995- s := Copy(s, i + 2, Length(s));
996- Break;
997- end;
998- end;
999- end;
1000-end;
1001-
1002-procedure testAddHRefTag;
1003- procedure mycheck(s, s2: String);
1004- begin
1005- Check(s, AddHRefTag(s2));
1006- end;
1007-begin
1008- mycheck(
1009- '<a href="http://piza.2ch.net/tech/" target="_blank">http://piza.2ch.net/tech/</a>',
1010- 'http://piza.2ch.net/tech/');
1011- mycheck(
1012- 'Ú×‚̓RƒR<a href="http://piza.2ch.net/tech/" target="_blank">http://piza.2ch.net/tech/</a>',
1013- 'Ú×‚̓RƒRhttp://piza.2ch.net/tech/');
1014- mycheck(
1015- '<a href="http://piza.2ch.net/tech/" target="_blank">http://piza.2ch.net/tech/</a>‚¾‚æ',
1016- 'http://piza.2ch.net/tech/‚¾‚æ');
1017- mycheck(
1018- '<a href="http://piza.2ch.net/tech/index2.html#menu" target="_blank">http://piza.2ch.net/tech/index2.html#menu</a>',
1019- 'http://piza.2ch.net/tech/index2.html#menu');
1020- mycheck(
1021- '<a href="http://www.yahoo.com" target="_blank">http://www.yahoo.com</a>‚¾‚Á‚½‚è<a href="http://www.goo.ne.jp" target="_blank">http://www.goo.ne.jp</a>‚¾‚Á‚½‚è',
1022- 'http://www.yahoo.com‚¾‚Á‚½‚èhttp://www.goo.ne.jp‚¾‚Á‚½‚è');
1023- mycheck(
1024- 'https://piza.2ch.net/tech/index2.html#menu',
1025- 'https://piza.2ch.net/tech/index2.html#menu');
1026- mycheck(
1027- '<a href="http://piza.2ch.net/tech/index2.html#menu0" target="_blank">http://piza.2ch.net/tech/index2.html#menu0</a>',
1028- 'http://piza.2ch.net/tech/index2.html#menu0');
1029- mycheck(
1030- 'http‚ÅŽn‚Ü‚é',
1031- 'http‚ÅŽn‚Ü‚é');
1032- mycheck(
1033- '',
1034- '');
1035- mycheck(
1036- '<a href="http://www.2ch.net/tech/" target="_blank">www.2ch.net/tech/</a>',
1037- 'www.2ch.net/tech/');
1038- mycheck(
1039- 'www‚Æ‚©',
1040- 'www‚Æ‚©');
1041- mycheck(
1042- 'www ',
1043- 'www ');
1044-end;
1045-
1046-//
1047-// •¶Žš—ñ’†‚©‚ç <A HREF="xxx"> </A>ƒ^ƒO‚ðŽæ‚菜‚«‚Ü‚·
1048-//
1049-function TrimHRefTag(const S: string): string;
1050-var
1051- x, y : integer;
1052- BodyText : string;
1053-begin
1054- BodyText := StringReplace(S,'</A>', '', [rfReplaceAll,rfIgnoreCase]);
1055- while True do begin
1056- x := Pos('<a ',AnsiLowerCase(BodyText));
1057- if (AnsiPos('>',AnsiLowerCase(BodyText)) = 0) then begin
1058- Break;
1059- end;
1060- y := x;
1061- if (x > 0) then begin
1062- while true do begin
1063- if (BodyText[y] = '>') and (ByteType(BodyText, y) = mbSingleByte) then
1064- begin
1065- BodyText := Copy(BodyText,1, x-1) +
1066- Copy(BodyText,y + 1, Length(BodyText));
1067- break;
1068- end else begin
1069- inc(y);
1070- if (y > Length(BodyText)) then Break;
1071- end;
1072- end;
1073- end else begin
1074- Break;
1075- end;
1076- end;
1077- Result := BodyText;
1078-end;
1079-
1080-procedure testTrimHRefTag;
1081- procedure mycheck(s{Šú‘Ò‚³‚ê‚錋‰Ê}, s2{ŠÖ”‚É“n‚·“à—e}: String);
1082- begin
1083- Check(s, TrimHRefTag(s2));
1084- end;
1085-begin
1086- mycheck(
1087- 'http://piza.2ch.net/tech/',
1088- '<a href="http://piza.2ch.net/tech/" target="_blank">http://piza.2ch.net/tech/</a>');
1089- mycheck(
1090- 'Ú×‚̓RƒRhttp://piza.2ch.net/tech/',
1091- 'Ú×‚̓RƒR<a href="http://piza.2ch.net/tech/" target="_blank">http://piza.2ch.net/tech/</a>');
1092- mycheck(
1093- 'http://piza.2ch.net/tech/‚¾‚æ',
1094- '<a href="http://piza.2ch.net/tech/" target="_blank">http://piza.2ch.net/tech/</a>‚¾‚æ');
1095- mycheck(
1096- 'http://piza.2ch.net/tech/index2.html#menu',
1097- '<a href="http://piza.2ch.net/tech/index2.html#menu" target="_blank">http://piza.2ch.net/tech/index2.html#menu</a>');
1098- mycheck(
1099- 'http://www.yahoo.com‚¾‚Á‚½‚èhttp://www.goo.ne.jp‚¾‚Á‚½‚è',
1100- '<a href="http://www.yahoo.com" target="_blank">http://www.yahoo.com</a>‚¾‚Á‚½‚è<a href="http://www.goo.ne.jp" target="_blank">http://www.goo.ne.jp</a>‚¾‚Á‚½‚è');
1101- mycheck(
1102- 'https://piza.2ch.net/tech/index2.html#menu',
1103- 'https://piza.2ch.net/tech/index2.html#menu');
1104- mycheck(
1105- 'http‚ÅŽn‚Ü‚é',
1106- 'http‚ÅŽn‚Ü‚é');
1107- mycheck(
1108- '',
1109- '');
1110-end;
1111-
1112-function DecodeHtmlEsc(const s: string): string;
1113-var
1114- DispText : string;
1115-begin
1116- DispText := StringReplace(S, '<br>', #13#10, [rfIgnoreCase, rfReplaceAll]);
1117- DispText := StringReplace(DispText, '&lt;', '<', [rfIgnoreCase, rfReplaceAll]);
1118- DispText := StringReplace(DispText, '&gt;', '>', [rfIgnoreCase, rfReplaceAll]);
1119- DispText := StringReplace(DispText, '&quot;', '"', [rfIgnoreCase, rfReplaceAll]);
1120- DispText := StringReplace(DispText, '&amp;', '&', [rfIgnoreCase, rfReplaceAll]);
1121- DispText := StringReplace(DispText, '&nbsp;', ' ', [rfIgnoreCase, rfReplaceAll]);
1122- Result := DispText;
1123-end;
1124-
1125-procedure testDecodeHtmlEsc;
1126- procedure mycheck(s{Šú‘Ò‚³‚ê‚錋‰Ê}, s2{ŠÖ”‚É“n‚·“à—e}: String);
1127- begin
1128- Check(s, DecodeHtmlEsc(s2));
1129- end;
1130-begin
1131- mycheck(
1132- '<HTML&XML>',
1133- '&lt;HTML&amp;XML&gt;');
1134- mycheck(
1135- 'BR' + #13#10 + 'BR' + #13#10#13#10,
1136- 'BR<BR>BR<BR><BR>');
1137- mycheck(
1138- '<">',
1139- '&LT;&quot;&GT;');
1140- mycheck(
1141- ' ',
1142- '&nbsp;&nbsp;');
1143- mycheck(
1144- '',
1145- '');
1146-end;
1147-
1148-function EncodeHtmlEsc(const s: string): string;
1149-var
1150- DispText : string;
1151-begin
1152- DispText := StringReplace(S, '&', '&amp;', [rfReplaceAll]);
1153- DispText := StringReplace(DispText, '<', '&lt;', [rfReplaceAll]);
1154- DispText := StringReplace(DispText, '>', '&gt;', [rfReplaceAll]);
1155- DispText := StringReplace(DispText, '"', '&quot;', [rfReplaceAll]);
1156- DispText := StringReplace(DispText, #13#10, '<br>', [rfReplaceAll]);
1157- Result := DispText;
1158-end;
1159-
1160-procedure testEncodeHtmlEsc;
1161- procedure mycheck(s{Šú‘Ò‚³‚ê‚錋‰Ê}, s2{ŠÖ”‚É“n‚·“à—e}: String);
1162- begin
1163- Check(s, EncodeHtmlEsc(s2));
1164- end;
1165-begin
1166- mycheck(
1167- '&lt;HTML&amp;XML&gt;',
1168- '<HTML&XML>');
1169- mycheck(
1170- 'BR<br>BR<br><br>',
1171- 'BR' + #13#10 + 'BR' + #13#10#13#10);
1172- mycheck(
1173- '&lt;&quot;&gt;',
1174- '<">');
1175- mycheck(
1176- '',
1177- '');
1178-end;
1179-
1180-function ExtractHostName(const Url: string): string;
1181-const
1182- PRE = 'http://';
1183-var
1184- n : integer;
1185-begin
1186- if (AnsiPos(PRE, Url) = 1) then begin
1187- n := Pos('/', Copy(Url,Length(PRE)+1,Length(Url))) - 1;
1188- if (n < 0) then n := Length(Url) - Length(PRE);
1189- Result := Copy(Url, Length(PRE) + 1, n);
1190- end else begin
1191- Result := '';
1192- end;
1193-end;
1194-
1195-procedure testExtractHostName;
1196- procedure mycheck(s{Šú‘Ò‚³‚ê‚錋‰Ê}, s2{ŠÖ”‚É“n‚·“à—e}: String);
1197- begin
1198- Check(s, ExtractHostName(s2));
1199- end;
1200-begin
1201- mycheck(
1202- 'www.2ch.net',
1203- 'http://www.2ch.net/');
1204-
1205- mycheck(
1206- 'piza.2ch.net',
1207- 'http://piza.2ch.net/tech/index2.html');
1208-
1209- mycheck(
1210- 'piza.2ch.net',
1211- 'http://piza.2ch.net/tech/index2.html#menu');
1212-
1213- mycheck(
1214- 'www.yahoo.co.jp',
1215- 'http://www.yahoo.co.jp' );
1216-
1217- mycheck(
1218- '',
1219- 'www.yahoo.co.jp' );
1220- mycheck(
1221- '',
1222- '');
1223-end;
1224-
1225-function Get2chDate(aDate: TDateTime): string;
1226-var
1227- d1: TDateTime;
1228- d2: TDateTime;
1229-begin
1230- d1 := EncodeDate(1970, 1, 1);
1231- d2 := aDate - EncodeTime(9, 0, 0, 0);
1232- Result := FloatToStr(Trunc((d2 - d1) * 24 * 60 * 60));
1233-end;
1234-
1235-function GetDatSince(aDatNo: string): string;
1236-var
1237- s: string;
1238- v: double;
1239- ad: TDateTime;
1240- d1: TDateTime;
1241-begin
1242- if (AnsiPos('_', aDatNo) > 0) then begin
1243- s := Copy(aDatNo, 1, AnsiPos('_', aDatNo) - 1); //‚µ‚½‚ç‚ΑΉž
1244- end else begin
1245- s := aDatNo;
1246- end;
1247- if (TryStrToFloat(s, v)) then begin
1248- v := StrToFloat(s);
1249- ad := v / 60 / 60 / 24;
1250- d1 := EncodeDate(1970, 1, 1);
1251- ad := (ad + EncodeTime(9,0,0,0)) + d1;
1252- Result := FormatDateTime('yyyy/mm/dd h:m:s', ad);
1253- end else begin
1254- Result := '';
1255- end;
1256-end;
1257-
1258-procedure testGet2chDate;
1259- procedure mycheck(s{Šú‘Ò‚³‚ê‚錋‰Ê}: string; s2{ŠÖ”‚É“n‚·“à—e}: TDateTime);
1260- begin
1261- Check(s, Get2chDate(s2));
1262- end;
1263-begin
1264- mycheck(
1265- '986094000',
1266- StrToDateTime('2001/04/01 12:00:00'));
1267-
1268- mycheck(
1269- '1078023600',
1270- StrToDateTime('2004/02/29 12:00:00'));
1271-end;
1272-
1273-function ChooseString(const Text, Separator: string; Index: integer): string;
1274-var
1275- S : string;
1276- i, p : integer;
1277-begin
1278- S := Text;
1279- for i := 0 to Index - 1 do begin
1280- if (AnsiPos(Separator, S) = 0) then S := ''
1281- else S := Copy(S, AnsiPos(Separator, S) + Length(Separator), Length(S));
1282- end;
1283- p := AnsiPos(Separator, S);
1284- if (p > 0) then Result := Copy(S, 1, p - 1) else Result := S;
1285-end;
1286-
1287-procedure testChooseString;
1288- procedure mycheck(s{Šú‘Ò‚³‚ê‚錋‰Ê}, s2, s3{ŠÖ”‚É“n‚·“à—e}: String;
1289- n: integer);
1290- begin
1291- Check(s, ChooseString(s2, s3, n));
1292- end;
1293-begin
1294- mycheck(
1295- 'a',
1296- 'a/b/c/', '/', 0);
1297-
1298- mycheck(
1299- 'b',
1300- 'a/b/c/', '/', 1);
1301-
1302- mycheck(
1303- 'c',
1304- 'a/b/c/', '/', 2);
1305-
1306- mycheck(
1307- '',
1308- 'a/b/c/', '/', 3);
1309-
1310- mycheck(
1311- '',
1312- 'a/b/c', '/', 3);
1313-
1314- mycheck(
1315- 'arakabu',
1316- 'http://www.2ch.com/arakabu/', '/', 3);
1317-
1318- mycheck(
1319- '‚É‚È‚é',
1320- '‚±‚Ì–Ø‚È‚ñ‚̖ؖ؂ɂȂé–Ø', '–Ø', 3);
1321-
1322- mycheck(
1323- 'C++Builder',
1324- 'BorlandDelphiBorlandC++BuilderBorlandKylix', 'Borland', 2);
1325-
1326- mycheck(
1327- '',
1328- '', '/', 0);
1329-end;
1330-
1331-function ExtractQuotedStr(S: string; Quote: char): string;
1332-begin
1333- if (Length(S) > 1) then begin
1334- if (S[1] = Quote) and (Copy(S, Length(S), 1) = Quote) then begin
1335- Result := Copy(S, 2, Length(S) - 2);
1336- end else begin
1337- Result := S;
1338- end;
1339- end else begin
1340- Result := S;
1341- end;
1342-end;
1343-
1344-procedure testExtractQuotedStr;
1345- procedure mycheck(s{Šú‘Ò‚³‚ê‚錋‰Ê}, s2{ŠÖ”‚É“n‚·“à—e}: String; s3: char);
1346- begin
1347- Check(s, ExtractQuotedStr(s2, s3));
1348- end;
1349-begin
1350- mycheck('ABC', '"ABC"', '"');
1351- mycheck('ABC ', '"ABC "', '"');
1352- mycheck('ABC', 'ABC', '"');
1353- mycheck('"ABC"', '"ABC"', '''');
1354- mycheck('""', '""""', '"');
1355- mycheck('A', 'A', '"');
1356- mycheck('', '', '"');
1357-end;
1358-
1359-function ExtractUrlLastPath(Url: string): string;
1360-var
1361- I: Integer;
1362-begin
1363- if (Length(Url) > 0) then begin
1364- if (Url[Length(Url)] <> '/') then Url := ExtractURLPath(Url);
1365- Url := Copy(Url,1,Length(Url) - 1);
1366- I := LastDelimiter('/:', Url);
1367- Result := Copy(Url, I + 1, Length(Url) - I);
1368- end else begin
1369- Result := '';
1370- end;
1371-end;
1372-
1373-procedure testExtractURLLastPath;
1374- procedure mycheck(s{Šú‘Ò‚³‚ê‚錋‰Ê}, s2{ŠÖ”‚É“n‚·“à—e}: String);
1375- begin
1376- Check(s, ExtractURLLastPath(s2));
1377- end;
1378-begin
1379- mycheck('www.2ch.net', 'http://www.2ch.net/');
1380- mycheck('tech', 'http://piza.2ch.net/tech/index2.html');
1381- mycheck('tech', 'http://piza.2ch.net/tech/index2.html#menu');
1382- mycheck('', 'http://www.yahoo.co.jp' );
1383- mycheck('', 'www.yahoo.co.jp' );
1384- mycheck('','');
1385-end;
1386-
1387-function IsNumeric(s: string): boolean;
1388-begin
1389- try
1390- StrToInt(s);
1391- Result := true;
1392- except
1393- on EConvertError do
1394- Result := false;
1395- end;
1396-
1397-end;
1398-
1399-procedure testIsNumeric;
1400- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: boolean; s2{ŠÖ”‚É“n‚·“à—e}: String);
1401- begin
1402- Check(r, IsNumeric(s2));
1403- end;
1404-begin
1405- mycheck(True, '12345');
1406- mycheck(True, '-12345');
1407- mycheck(False,'123.45');
1408- mycheck(False,'12345F' );
1409- mycheck(True, '+50');
1410- mycheck(False,'‚P‚Q‚R‚S‚T');
1411- mycheck(False,'');
1412-end;
1413-
1414-function IsFloat(s: string): boolean;
1415-var
1416- v: Extended;
1417-begin
1418- Result := TextToFloat(PChar(s), v, fvExtended);
1419-end;
1420-
1421-procedure testIsFloat;
1422- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: boolean; s2{ŠÖ”‚É“n‚·“à—e}: String);
1423- begin
1424- Check(r, IsFloat(s2));
1425- end;
1426-begin
1427- mycheck(True, '12345.0');
1428- mycheck(True, '-12345.0');
1429- mycheck(True,'123.45');
1430- mycheck(True, '12345');
1431- mycheck(False,'12345F' );
1432- mycheck(True, '+50');
1433- mycheck(False,'‚P‚Q‚R‚S‚T');
1434- mycheck(False,'');
1435-end;
1436-
1437-
1438-function Fmt2chToDateTime(Fmt2ch: String): TDateTime;
1439-var
1440- Year, Month, Day: word;
1441- Hour, Min, Sec, MSec: word;
1442-begin
1443- try
1444- Fmt2ch := Trim(Fmt2ch); //dax
1445- Year := StrToInt(Copy(Fmt2ch, 1, 4));
1446- Month := StrToInt(Copy(Fmt2ch, 6, 2));
1447- Day := StrToInt(Copy(Fmt2ch, 9, 2));
1448-
1449- Hour := StrToInt(Copy(Fmt2ch,16, 2));
1450- Min := StrToInt(Copy(Fmt2ch,19, 2));
1451- Sec := 0;
1452- MSec:= 0;
1453-
1454- Result := EncodeDate(Year, Month, Day)
1455- + EncodeTime(Hour, Min, Sec, MSec);
1456- except
1457- raise EConvertError.Create('“ú•t•ÏŠ·‚ª³‚µ‚­‚Ë‚¦‚¼(߄Dß)ºÞÙ§');
1458- end;
1459-end;
1460-
1461-procedure testFmt2chToDateTime;
1462- procedure mycheck(d{Šú‘Ò‚³‚ê‚錋‰Ê}: TDateTime; s2{ŠÖ”‚É“n‚·“à—e}: String);
1463- begin
1464- Check(d, Fmt2chToDateTime(s2));
1465- end;
1466-begin
1467- mycheck(StrToDateTime('2001/02/18 15:23:00'),
1468- '2001/02/18(“ú) 15:23');
1469-
1470- mycheck(StrToDateTime('2001/02/18 15:23:00'),
1471- '2001/02/18(“ú) 15:23 ID=???');
1472-
1473- //‚±‚ê‚̓Gƒ‰[«
1474- {
1475- mycheck(StrToDateTime('0'),
1476- '‚ ‚ځ[‚ñ');
1477- }
1478-end;
1479-
1480-//S‚Ì’†‚ÉSubStr‚ª‚¢‚­‚‚ ‚é‚©ƒJƒEƒ“ƒg‚·‚é(2ƒoƒCƒg‘Ήž)
1481-{•¶Žš‚ðŒ©‚Â‚¯‚é‚Æ‚»‚Ì•¶Žš‚ðíœ‚µ‚ÄŒŸõ‚·‚é‚Æ‚¢‚¤•ûŽ®‚È‚Ì‚Å
1482- "‚ ‚ ‚ ‚ ‚ ‚ "‚Æ‚¢‚¤•¶Žš—ñ‚©‚ç"‚ ‚ "‚̌”‚𑪒肷‚é‚Æ3‚ð•Ô‚·}
1483-function StrCount1(const Substr, S: string): Integer;
1484-var
1485- Str: String;
1486-begin
1487- Result := 0;
1488- if (Substr = '') or (S = '') then exit;
1489-
1490- Str := S;
1491- try
1492- while AnsiPos( Substr, Str) <> 0 do
1493- begin
1494- Inc(Result);
1495- delete(Str, AnsiPos( Substr, Str), Length(Substr));
1496- end;
1497- except
1498- Result := -1;
1499- end;
1500-end;
1501-
1502-procedure testStrCount1;
1503- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: integer; s2, s3{ŠÖ”‚É“n‚·“à—e}: String);
1504- begin
1505- Check(r, StrCount1(s3, s2));
1506- end;
1507-begin
1508- mycheck(3, '‚ ‚ ‚ ‚ ‚ ‚ ', '‚ ‚ ');
1509- mycheck(3, 'BorlandDelphiBorlandC++BuilderBorlandKylix', 'Borland');
1510- mycheck(2, 'BorlandDelphiBorlandC++BuilderBorlandKylix', '+');
1511- mycheck(4, 'http://www.2ch.net/hogehoge/test', '/');
1512- mycheck(0, 'http://www.2ch.net/hogehoge/test', '+');
1513- mycheck(0, '+', '+++++');
1514- mycheck(0, '', '+');
1515-end;
1516-
1517-//•¶Žš—ñ‚ÌŒã•ûŒŸõ
1518-{"‚ ‚ ‚ ‚ ‚ "‚©‚ç"‚ ‚ "‚ðŒŸõ‚·‚é‚ƃoƒCƒg”‚Å7‚ð•Ô‚·}
1519-function BackAnsiPos(const SubStr,S: String): Integer;
1520-var
1521- SearchStr: String;
1522- BackPosIndex: Integer;
1523- MbcsFlag: TMbcsByteType;
1524-begin
1525- Result := 0;
1526- MbcsFlag := mbSingleByte; {“Á‚ɈӖ¡‚Ì‚È‚¢‰Šú‰»}
1527- if AnsiPos(subStr,S)=0 then exit;
1528-
1529- SearchStr := S;
1530- while AnsiPos(subStr,SearchStr)<>0 do
1531- begin
1532- BackPosIndex := AnsiPos(subStr,SearchStr);
1533- MbcsFlag := ByteType(SearchStr, BackPosIndex);
1534- case MbcsFlag of
1535-
1536- mbSingleByte: { ”¼Šp }
1537- Delete(SearchStr,1,BackPosIndex);
1538-
1539- mbLeadByte: { ‘SŠp‚Ì‚PƒoƒCƒg–Ú }
1540- Delete(SearchStr,1,BackPosIndex +1 );
1541-
1542- mbTrailByte: { ‘SŠp‚Ì‚QƒoƒCƒg–Ú }
1543- Delete(SearchStr,1,BackPosIndex);
1544- else
1545- raise Exception.Create('ƒGƒ‰[');
1546- end;
1547- end; //while
1548-
1549- case MbcsFlag of
1550- mbSingleByte:
1551- Result := length(S)-Length(SearchStr);
1552-
1553- mbLeadByte:
1554- Result := length(S)-Length(SearchStr) - 1;
1555-
1556- mbTrailByte:
1557- Result := length(S)-Length(SearchStr);
1558- else
1559- raise Exception.Create('ƒGƒ‰[');
1560- end;
1561-end;
1562-
1563-procedure testBackAnsiPos;
1564- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: integer; s2, s3{ŠÖ”‚É“n‚·“à—e}: String);
1565- begin
1566- Check(r, BackAnsiPos(s3, s2));
1567- end;
1568-begin
1569- mycheck(9, '‚ ‚ ‚ ‚ ‚ ‚ ', '‚ ‚ ');
1570- mycheck(31,'BorlandDelphiBorlandC++BuilderBorlandKylix', 'Borland');
1571- mycheck(28,'http://www.2ch.net/hogehoge/test', '/');
1572- mycheck(0, 'http://www.2ch.net/hogehoge/test', '+');
1573- mycheck(0, '+', '+++++');
1574- mycheck(0, '', '+');
1575-end;
1576-
1577-//URL‚ðDOSƒpƒX‚ɕύX
1578-function UrlToDosPath(const Url: string): string;
1579-const
1580- PATH_TERMINATE = '\';
1581-var
1582- S : string;
1583- n, m : integer;
1584-begin
1585- if (AnsiPos('http://', Url) = 1) then begin
1586- s := Copy(Url, 8, Length(Url));
1587- end else begin
1588- s := Url;
1589- end;
1590- n := AnsiPos(':', s);
1591- if (n > 0) then begin
1592- m := AnsiPos('/', s);
1593- s := 'http://' +
1594- Copy(s, 1, n - 1) +
1595- Copy(s, m, Length(Url));
1596- end;
1597-
1598- S := AnsiLowerCase(
1599- MonaUtils.ExcludeTrailingSlash(
1600- MonaUtils.ExtractUrlPath(S)));
1601- if (S = '') then begin
1602- Result := Url;
1603- Exit;
1604- end;
1605- if (Copy(S,1,7) = 'http://') then begin
1606- S := Copy(S,8,Length(S) - 7);
1607- end;
1608-
1609- S := StringReplace(S, '/', PATH_TERMINATE, [rfReplaceAll]);
1610-
1611- if (Copy(S,Length(S) - 3, 4) = PATH_TERMINATE + 'dat') then begin
1612- S := Copy(S,1,Length(S) - 4);
1613- end;
1614- Result := S + PATH_TERMINATE + MonaUtils.ExtractUrlName(Url);
1615-end;
1616-
1617-procedure testUrlToDosPath;
1618- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: string; s1{ŠÖ”‚É“n‚·“à—e}: String);
1619- begin
1620- Check(r, UrlToDosPath(s1));
1621- end;
1622-begin
1623- mycheck('www.2ch.net\', 'http://www.2ch.net/');
1624- mycheck('www.2ch.net\test\read.cgi', 'http://www.2ch.net/test/read.cgi');
1625- mycheck('www.2ch.net\test\', 'www.2ch.net/test/');
1626- mycheck('www.2ch.net\test', 'www.2ch.net/test');
1627- mycheck('ABCDEFG', 'ABCDEFG');
1628- mycheck('\abcdefg\', '/abcdefg/');
1629- mycheck('www.2ch.net\abc\def', 'http://www.2ch.net/abc\def');
1630-end;
1631-
1632-//?param=value‚Ì param‚ðŽw’è‚·‚é‚Æ value‚ð•Ô‚·
1633-function ChooseValue(const Url, Key: string): string;
1634-var
1635- List : TStringList;
1636- S : PChar;
1637-begin
1638- GetMem(S, Length(Url) + 1);
1639- StrCopy(S, PChar(Url));
1640- List := TStringList.Create;
1641- {$IFDEF VER120}
1642- ExtractHttpFields(['?','&'], [], S, List);
1643- {$ELSE}
1644- ExtractHttpFields(['?','&'], [], S, List, False);
1645- {$ENDIF}
1646- Result := List.Values[Key];
1647- List.Free;
1648- FreeMem(S);
1649-end;
1650-
1651-procedure testChooseValue;
1652- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: string; s1, s2{ŠÖ”‚É“n‚·“à—e}: String);
1653- begin
1654- Check(r, ChooseValue(s1, s2));
1655- end;
1656-begin
1657- mycheck('tech',
1658- 'http://www.2ch.net/test/read.cgi?bbs=tech&key=12345678&st=10',
1659- 'bbs');
1660- mycheck('12345678',
1661- 'http://www.2ch.net/test/read.cgi?bbs=tech&key=12345678&st=10',
1662- 'key');
1663- mycheck('10',
1664- 'http://www.2ch.net/test/read.cgi?bbs=tech&key=12345678&st=10',
1665- 'st');
1666- mycheck('',
1667- 'http://www.2ch.net/test/read.cgi?bbs=tech&key=12345678&st=10',
1668- 'to');
1669- mycheck('',
1670- 'http://www.2ch.net/test/read.cgi',
1671- 'bbs');
1672- mycheck('10',
1673- 'http://www.2ch.net/test/read.cgi?bbs=tech&key=12345678&st=10&st=20',
1674- 'st');
1675-end;
1676-
1677-//URL‚̃}[ƒW
1678-function MargeUrl(const BaseUrl, NewUrl: string): string;
1679-var
1680- s,r,b : string;
1681- l : TStringList;
1682- i, count : integer;
1683-begin
1684- if (NewUrl = '') then begin
1685- Result := BaseUrl;
1686- Exit;
1687- end else
1688- if (NewUrl[1] = '/') then begin
1689- Result := 'http://' + ExtractHostName(BaseUrl) + NewUrl;
1690- Exit;
1691- end;
1692- count := 0;
1693- s := NewUrl;
1694- while true do begin
1695- if (Copy(s,1,3) = '../') then begin
1696- s := Copy(s, 4, Length(s) - 3);
1697- inc(count);
1698- end else
1699- if (Copy(s,1,2) = './') then begin
1700- s := Copy(s, 3, Length(s) - 2);
1701- end else begin
1702- Break;
1703- end;
1704- end;
1705- r := '';
1706- b := ExtractUrlPath(BaseUrl);
1707- b := Copy(b,7,Length(b));
1708- l := TStringList.Create;
1709- ExtractHTTPFields(['/'],[],PChar(b), l);
1710- for i := 0 to l.Count - count - 1 do begin
1711- r := r + '/'+ l[i];
1712- end;
1713- Result := 'http:/' + r + '/' + s;
1714-end;
1715-
1716-procedure testMargeUrl;
1717- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: string; s1, s2{ŠÖ”‚É“n‚·“à—e}: String);
1718- begin
1719- Check(r, MargeUrl(s1, s2));
1720- end;
1721-begin
1722- mycheck('http://www.2ch.net/dat',
1723- 'http://www.2ch.net/test/',
1724- '../dat');
1725- mycheck('http://www.2ch.net/dat',
1726- 'http://www.2ch.net/test/data',
1727- '../dat');
1728- mycheck('http://www.2ch.net/test/dat',
1729- 'http://www.2ch.net/test/data',
1730- './dat');
1731- mycheck('http://www.2ch.net/test/dat/',
1732- 'http://www.2ch.net/test/data',
1733- './dat/');
1734- mycheck('http://www.2ch.net/',
1735- 'http://www.2ch.net/test/',
1736- '../');
1737- mycheck('http://www.2ch.net/',
1738- 'http://www.2ch.net/test/',
1739- '/');
1740- mycheck('http://www.2ch.net/test/a/',
1741- 'http://www.2ch.net/test/',
1742- 'a/');
1743-end;
1744-
1745-//A HREFƒ^ƒO‚Ì’†‚©‚çURL‚𒊏o‚·‚é
1746-function ExtractHrefUrl(const s: string): string;
1747-var
1748- r : string;
1749- n : integer;
1750-begin
1751- n := AnsiPos('href', AnsiLowerCase(s));
1752- r := Copy(s, n, Length(s));
1753- n := AnsiPos('>', r);
1754- if (n > 0) then r := Copy(r, 1, n - 1);
1755- n := AnsiPos(' ', r);
1756- if (n > 0) then r := Copy(r, 1, n - 1);
1757- n := AnsiPos('=', r);
1758- r := Copy(r, n + 1, Length(r));
1759- n := AnsiPos('"', r);
1760- if (n > 0) then r := Copy(r, 2, Length(r) - 2);
1761- Result := r;
1762-end;
1763-
1764-procedure testExtractHrefUrl;
1765- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: string; s1{ŠÖ”‚É“n‚·“à—e}: String);
1766- begin
1767- Check(r, ExtractHrefUrl(s1));
1768- end;
1769-begin
1770- mycheck('http://www.2ch.net/dat/',
1771- '<A HREF="http://www.2ch.net/dat/">');
1772- mycheck('http://www.2ch.net/dat/',
1773- '<a href=http://www.2ch.net/dat/>');
1774- mycheck('http://www.2ch.net/dat/',
1775- '<a target=_blank href=http://www.2ch.net/dat/>');
1776- mycheck('http://www.2ch.net/dat/',
1777- '<a target=_blank href=http://www.2ch.net/dat/><a href=http://www.2ch.net/test/>');
1778-end;
1779-
1780-function ZenToHan(const s: string): string;
1781-var
1782- Chr : array [0..255] of char;
1783-begin
1784- {$IFDEF LINUX}
1785- //**LINUX**
1786- {$ENDIF}
1787- {$IFDEF MSWINDOWS}
1788- Windows.LCMapString(
1789- GetUserDefaultLCID(),
1790- LCMAP_HALFWIDTH,
1791- PChar(s),
1792- Length(s) + 1,
1793- chr,
1794- Sizeof(chr)
1795- );
1796- Result := Chr;
1797- {$ENDIF}
1798-end;
1799-
1800-procedure testZenToHan;
1801- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: string; s1{ŠÖ”‚É“n‚·“à—e}: String);
1802- begin
1803- Check(r, ZenToHan(s1));
1804- end;
1805-begin
1806- mycheck('±²³´µ', 'ƒAƒCƒEƒGƒI');
1807- mycheck('±²³´µ±²³´µ', 'ƒAƒCƒEƒGƒI±²³´µ');
1808- mycheck('ABC', '‚`‚a‚b');
1809- mycheck('Š¿Žš', 'Š¿Žš');
1810- mycheck('Š¿ŽšABC', 'Š¿Žš‚`‚a‚b');
1811-end;
1812-
1813-function GetContentLength(S : string): integer;
1814-var
1815- p : PChar;
1816- p_end : PChar;
1817- n : integer;
1818-begin
1819- p := PChar(s);
1820- p_end := PChar(s) + Length(s);
1821- n := 0;
1822- while p < p_end do begin
1823- if p^ = #13 then begin
1824- //
1825- end else begin
1826- inc(n);
1827- end;
1828- Inc(p);
1829- end;
1830- Result := n;
1831-end;
1832-
1833-procedure testGetContentLength;
1834- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: integer; s1{ŠÖ”‚É“n‚·“à—e}: String);
1835- begin
1836- Check(r, GetContentLength(s1));
1837- end;
1838-begin
1839- mycheck(1, 'A');
1840- mycheck(0, '');
1841- mycheck(14, '<HTML>' + #13#10 + '</HTML>');
1842- mycheck(14, '<HTML>' + #10 + '</HTML>');
1843- mycheck(15, '<HTML>' + #13#10 + #9 + '</HTML>');
1844- mycheck(20, '<HTML>' + #13#10 + 'Hello' + #0 + '</HTML>'); //#0‚àƒJƒEƒ“ƒg
1845-end;
1846-
1847-function TrimTag(const s: string): string;
1848-var
1849- r : string;
1850- b : boolean;
1851- i : integer;
1852-begin
1853- r := '';
1854- b := False;
1855- for i := 1 to Length(s) do begin
1856- if (ByteType(s, i) = mbSingleByte) then begin
1857- if (s[i] = '<') then begin
1858- b := True;
1859- end else
1860- if (s[i] = '>') and (b) then begin
1861- b := False;
1862- end else
1863- if (not b) then begin
1864- r := r + s[i];
1865- end;
1866- end else begin
1867- if (not b) then begin
1868- r := r + s[i];
1869- end;
1870- end;
1871- end;
1872- Result := Trim(r);
1873-end;
1874-
1875-procedure testTrimTag;
1876- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: string; s1{ŠÖ”‚É“n‚·“à—e}: String);
1877- begin
1878- Check(r, TrimTag(s1));
1879- end;
1880-begin
1881- mycheck('ƒAƒCƒEƒGƒI', '<ABC>ƒAƒCƒEƒGƒI</ABC>');
1882- mycheck('ƒAƒCƒEƒGƒI', '<À‚Á‚Ă悵>ƒAƒCƒEƒGƒI</ƒIƒ}ƒGƒ‚ƒi[>');
1883- mycheck('‚ ‚ ', '<<<a>>>‚ ‚ <<</a>>>');
1884- mycheck('ƒAƒCƒEƒGƒI', 'ƒAƒCƒEƒGƒI');
1885- mycheck('', '<A HREF="ƒAƒCƒEƒGƒI">');
1886- mycheck('ABC', '<A HREF="ƒAƒCƒEƒGƒI">ABC</A>');
1887-end;
1888-
1889-function AddTargetBlank(const Value: string): string;
1890-var
1891- Org, s, r : string;
1892- x, y, z, t : string;
1893- p, i : integer;
1894-begin
1895- r := '';
1896- Org := Value;
1897- while true do begin
1898- p := AnsiPos('<a', AnsiLowerCase(Org));
1899- if (p > 0) then begin
1900- //æ“ª‚©‚ç<A ‚Ü‚Å‚ð --> r
1901- s := Copy(Org, 1, p - 1);
1902- r := r + s;
1903- //<A ‚©‚ç > ‚Ü‚Å‚ð --> s
1904-
1905- // s = "<A xxxx xxxxxx>"
1906- //t := Copy(Org, p, Length(org));
1907- s := Copy(Org, p, Length(org));
1908- i := AnsiPos('>', s);
1909- t := Copy(s, i + 1, Length(s));
1910- s := Copy(S, 1, i);
1911-
1912- if (AnsiPos('href', AnsiLowerCase(s)) > 0) then begin
1913- //TARGET=
1914- p := AnsiPos('TARGET=', AnsiUpperCase(s));
1915- if (p > 0) then begin
1916- x := Copy(s, 1, p - 1); //TARGET‚Ü‚Å
1917- y := Copy(s, p, Length(s)); //TARGETˆÈ~
1918- i := AnsiPos(' ', y);
1919- if (i > 0) then begin
1920- y := Copy(y, 1, i - 1);
1921- end;
1922- i := AnsiPos('>', y);
1923- if (i > 0) then begin
1924- y := Copy(y, 1, i - 1);
1925- end;
1926- //TARGET ‚Ì‚Ý --> y
1927- z := Copy(s, Length(x) + Length(y) + 1, Length(s)); //TARGET‚æ‚èŒã‚ë
1928- //
1929- s := x + 'TARGET="_blank"' + z;
1930- r := r + s;
1931- //org := Copy(org, AnsiPos('>', Org) + 1, Length(org));
1932- Org := t;
1933- end else begin
1934- //<A xxxxxxx>
1935- s := Copy(s, 1, Length(S) - 1) + ' TARGET="_blank">';
1936- r := r + s;
1937- //org := Copy(org, AnsiPos('>', Org) + 1, Length(org));
1938- Org := t;
1939- end;
1940-
1941-
1942- end else begin
1943- r := r + s;
1944- org := t; //Copy(org, Length(t) + 1, Length(org));
1945- end;
1946-
1947- end else begin;
1948- r := r + Org;
1949- Break;
1950- end;
1951- end;
1952- Result := r;
1953-end;
1954-
1955-{
1956-function AddTargetBlank(const Value: string): string;
1957-var
1958- org , s, r, w, x, y, z : string;
1959- frx, tox, i : integer;
1960- b : boolean;
1961-begin
1962- org := Value;
1963- r := '';
1964- while true do begin
1965- //frx := AnsiPos('<A HREF=', AnsiUpperCase(org));
1966- frx := AnsiPos('<A ', AnsiUpperCase(org));
1967- if (frx > 0) then begin
1968- r := r + Copy(org, 1, frx);
1969- org := Copy(org, frx + 1, Length(org));
1970- tox := AnsiPos('>', AnsiUpperCase(org));
1971- if (tox > 0) then begin
1972- s := Copy(org, 1, tox - 1);
1973- if (AnsiPos('TARGET=', AnsiUpperCase(org)) = 0) then begin
1974- s := s + ' TARGET="_blank"';
1975- r := r + s;
1976- org := Copy(org, tox, Length(org));
1977- end else begin
1978- //
1979- // x = '<A HREF=xxxxxxxx |TARGET
1980- //x := Copy(S, 1, AnsiPos('TARGET=', S) - 1);
1981- //y := Copy(S, AnsiPos('TARGET=', S), Length(S));
1982- //z := Copy(y, AnsiPos(' ', y) + 1, Length(y));
1983- b := False;
1984- x := Copy(org, 1, AnsiPos('TARGET=', org) - 1);
1985- w := Trim(Copy(org, Length(x) + 1, Length(org)));
1986- i := AnsiPos(' ', w);
1987- if (i > 0) then begin
1988- y := Copy(w, 1, i - 1);
1989- end else begin
1990- y := w;
1991- b := True;
1992- end;
1993- i := AnsiPos('>', y);
1994- if (i > 0) then begin
1995- y := Copy(y, 1, i - 1);
1996- end;
1997- z := Copy(org, Length(x) + Length(y) + 1, Length(org));
1998-
1999- if (Length(x) > 0) then begin
2000- if (Copy(x, Length(x), 1) <> ' ') then begin
2001- x := x + ' ';
2002- end;
2003- end;
2004- if (b) then begin
2005- s := x + 'TARGET="_blank"' + z;
2006- end else begin
2007- s := x + 'TARGET="_blank"';// + z;
2008- end;
2009-
2010- //x := x + ' TARGET="_blank"';
2011- //s := s + ' TARGET="_blank"';
2012- r := r + s;
2013- org := Copy(org, Length(s), Length(org));
2014- if (Length(org) > 0) then begin
2015- if (org[1] = '"') then begin
2016- org := Copy(org, 2, Length(org));
2017- end;
2018- end;
2019- end;
2020- end else begin
2021- r := r + org;
2022- Break;
2023- end;
2024- end else begin
2025- r := r + org;
2026- Break;
2027- end;
2028- end;
2029- Result := r;
2030-end;
2031-}
2032-procedure testAddTargetBlank;
2033- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: string; s1{ŠÖ”‚É“n‚·“à—e}: String);
2034- begin
2035- Check(r, AddTargetBlank(s1));
2036- end;
2037-begin
2038- mycheck('‚»‚Ì‚P‚ª‚P‚O‚O‚O‚ð’´‚¦‚½‚Ì‚Å‚Q‚Ɉڍs‚·‚é‚Æ‚¢‚¤‚±‚ƂŁB<BR><BR><BR>‚P‚Í‚±‚Á‚¿‚Å‚·B<BR><BR><a href=http://www.megabbs.com/cgi-bin/readres.cgi TARGET="_blank">‚±‚±</a><BR>',
2039- '‚»‚Ì‚P‚ª‚P‚O‚O‚O‚ð’´‚¦‚½‚Ì‚Å‚Q‚Ɉڍs‚·‚é‚Æ‚¢‚¤‚±‚ƂŁB<BR><BR><BR>‚P‚Í‚±‚Á‚¿‚Å‚·B<BR><BR><a href=http://www.megabbs.com/cgi-bin/readres.cgi>‚±‚±</a><BR>');
2040- mycheck('<A HREF="http://www.2ch.net" TARGET="_blank">2ch</A>',
2041- '<A HREF="http://www.2ch.net" TARGET="_blank">2ch</A>');
2042- mycheck('AAA<A HREF="http://www.2ch.net" TARGET="_blank">2ch</A>',
2043- 'AAA<A HREF="http://www.2ch.net">2ch</A>');
2044- mycheck('<A HREF="http://www.2ch.net" TARGET="_blank">2ch</A>',
2045- '<A HREF="http://www.2ch.net">2ch</A>');
2046- mycheck('<a href="http://www.2ch.net" TARGET="_blank">2ch</A>',
2047- '<a href="http://www.2ch.net">2ch</A>');
2048- mycheck('<a href=http://www.2ch.net TARGET="_blank">2ch</A>',
2049- '<a href=http://www.2ch.net>2ch</A>');
2050- mycheck('<A HREF="http://www.2ch.net" TARGET="_blank">2ch</A>',
2051- '<A HREF="http://www.2ch.net" TARGET="parent">2ch</A>');
2052- mycheck('<A TARGET="_blank" HREF="http://www.2ch.net">2ch</A>',
2053- '<A TARGET="_blank" HREF="http://www.2ch.net">2ch</A>');
2054- mycheck('<A TARGET="_blank" HREF=http://www.2ch.net>2ch</A>',
2055- '<A TARGET=_top HREF=http://www.2ch.net>2ch</A>');
2056- mycheck('<A NAME="AA">2ch</A>',
2057- '<A NAME="AA">2ch</A>');
2058- mycheck('<A>2ch</A>',
2059- '<A>2ch</A>');
2060- mycheck('2ch',
2061- '2ch');
2062-end;
2063-
2064-function ExtractDatNo(const DatFileName: string): string;
2065-var
2066- s, ext : string;
2067-begin
2068- if (AnsiPos('http:', DatFileName) = 1) then begin
2069- s := ExtractUrlName(DatFileName);
2070- end else begin
2071- s := ExtractFileName(DatFileName);
2072- end;
2073- ext := ExtractFileExt(s);
2074- if (ext <> '') then begin
2075- s := Copy(s, 1, Length(s) - Length(ext));
2076- end;
2077- Result := s;
2078-end;
2079-
2080-procedure testExtractDatNo;
2081- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: string; s1{ŠÖ”‚É“n‚·“à—e}: String);
2082- begin
2083- Check(r, ExtractDatNo(s1));
2084- end;
2085-begin
2086- mycheck('123456789',
2087- '123456789.dat');
2088- mycheck('123456789',
2089- '123456789');
2090- mycheck('123456789',
2091- 'http://www.2ch.net/tech/dat/123456789.dat');
2092- mycheck('123456789',
2093- 'C:\monazilla\monaplorer\dat\123456789.dat');
2094- mycheck('123456789_1',
2095- '123456789_1.dat');
2096- mycheck('123456789_1',
2097- '123456789_1');
2098- mycheck('123456789_1',
2099- 'http://www.2ch.net/tech/dat/123456789_1.dat');
2100- mycheck('123456789_1',
2101- 'C:\monazilla\monaplorer\dat\123456789_1.dat');
2102-end;
2103-
2104-//Tue, 17 Dec 2002 12:18:07 GMT ¨ TDateTime‚Ö
2105-function DateStrToDateTime(const DateStr: string): TDateTime;
2106- function StrMonthToMonth(const s: string): integer;
2107- const
2108- m: array[1..12] of string = ('Jan','Feb','Mar','Apr','May','Jun', 'Jul','Aug','Sep','Oct','Nov','Dec');
2109- var
2110- i: integer;
2111- begin
2112- Result := -1;
2113- for i := Low(m) to High(m) do begin
2114- if (SameText(s, m[i])) then begin
2115- Result := i;
2116- Break;
2117- end;
2118- end;
2119- end;
2120-var
2121- wDay, wMonth, wYear: word;
2122- wHour, wMinute, wSecond: word;
2123- sTime: string;
2124- d: TDateTime;
2125-begin
2126- wDay := StrToIntDef(ChooseString(DateStr, ' ', 1), 0);
2127- wMonth := StrMonthToMonth(ChooseString(DateStr, ' ', 2));
2128- wYear := StrToIntDef(ChooseString(DateStr, ' ', 3), 0);
2129- sTime := ChooseString(DateStr, ' ', 4);
2130- wHour := StrToIntDef(ChooseString(sTime, ':', 0), 0);
2131- wMinute := StrToIntDef(ChooseString(sTime, ':', 1), 0);
2132- wSecond := StrToIntDef(ChooseString(sTime, ':', 2), 0);
2133- d := EncodeDateTime(wYear, wMonth, wDay, wHour, wMinute, wSecond, 0);
2134- Result := d;
2135-end;
2136-
2137-procedure testDateStrToDateTime;
2138- procedure mycheck(r{Šú‘Ò‚³‚ê‚錋‰Ê}: TDateTime; s1{ŠÖ”‚É“n‚·“à—e}: String);
2139- begin
2140- Check(r, DateStrToDateTime(s1));
2141- end;
2142-begin
2143- mycheck(StrToDateTime('2002/12/17 12:18:07'),
2144- 'Tue, 17 Dec 2002 12:18:07 GMT');
2145- mycheck(StrToDateTime('2003/1/10 23:15:10'),
2146- 'Fri, 10 Jan 2003 23:15:10 GMT');
2147- mycheck(StrToDateTime('2004/2/29 00:00:00'),
2148- 'Fri, 29 Feb 2004 00:00:00 GMT');
2149- mycheck(StrToDateTime('2001/11/11 11:22:33'),
2150- 'Fri, 11 Nov 2001 11:22:33 JST');
2151-end;
2152-
2153-
2154-procedure testMonaUtils;
2155-begin
2156- ClearTestResult;
2157- try
2158- //testMonaHtmlParser;
2159- //testMonaProfiler;
2160- //testExtractUrlPath;
2161- //testExtractUrlName;
2162- //testMaxMin;
2163- //testIncludeTrailingSlash;
2164- //testExcludeTrailingSlash;
2165- //testIsUrlDelimiter;
2166- //testLoadSaveString;
2167- //testFindFile;
2168- //testAddHRefTag;
2169- //testTrimHRefTag;
2170- //testDecodeHtmlEsc;
2171- //testEncodeHtmlEsc;
2172- //testExtractHostName;
2173- //testGet2chDate;
2174- //testChooseString;
2175- //testExtractQuotedStr;
2176- //testExtractUrlLastPath;
2177- //testIsNumeric;
2178- //testFmt2chToDateTime;
2179- //testStrCount1;
2180- //testBackAnsiPos;
2181- //testIsFloat;
2182- //testUrlToDosPath;
2183- //testChooseValue;
2184- //testMargeUrl;
2185- //testExtractHrefUrl;
2186- //testZenToHan;
2187- //testGetContentLength;
2188- //testTrimTag;
2189- //testAddTargetBlank;
2190- //testExtractDatNo;
2191- //testAddTargetBlank;
2192- testDateStrToDateTime;
2193- except
2194- on E:ETestFailure do
2195- ;
2196- on E:Exception do
2197- Inc(TestResult.Error);
2198- end;
2199-end;
2200-
2201-initialization
2202- if not QueryPerformanceFrequency(TMonaProfiler_FFrequency) then
2203- RaiseLastWin32Error;
2204-
2205-end.
--- a/SaveFile.pas
+++ /dev/null
@@ -1,223 +0,0 @@
1-unit SaveFile;
2-
3-interface
4-uses
5- Classes, Windows{, SysUtils, ComCtrls, IniFiles, HTTPApp, Math,
6- GikoSystem, BoardGroup, Send};
7-
8-{type
9- TSaveFile = class(TObject)
10- private
11- FBoard: TBoard;
12- FThreadItem: TThreadItem;
13- FSendItem: TSendItem;
14- FHeader: TStringList;
15- FBody: TStringList;
16- FTree: TTreeView;
17- FSize: Integer;
18- function GetHeadServerDate(List: TStrings): TDateTime;
19- public
20-// procedure SaveListFile; //ƒŠƒXƒgƒtƒ@ƒCƒ‹•Û‘¶
21-// procedure SaveItemFile; //ƒAƒCƒeƒ€ƒtƒ@ƒCƒ‹•Û‘¶
22-// procedure SaveRangeItemFile; //ƒŒƒ“ƒWŽæ“¾ƒAƒCƒeƒ€ƒtƒ@ƒCƒ‹•Û‘¶
23-// procedure SaveSendFile; //‘—MÏ‚݃tƒ@ƒCƒ‹•Û‘¶
24- published
25- property Board: TBoard read FBoard write FBoard;
26- property ThreadItem: TThreadItem read FThreadItem write FThreadItem;
27-// property SendItem: TSendItem read FSendItem write FSendItem;
28- property Header: TStringList read FHeader write FHeader;
29- property Body: TStringList read FBody write FBody;
30- property Tree: TTreeView read FTree write FTree;
31- property Size: Integer read FSize write FSize;
32- end;
33-}
34-implementation
35-//uses
36-// Giko;
37-{procedure TSaveFile.SaveListFile;
38-var
39- i, j: Integer;
40- index: Integer;
41- wkItem: TThreadItem;
42- OldItem: TThreadItem;
43- NewItem: TThreadItem;
44- FileName: string;
45- Title: string;
46- Count: Integer;
47- ItemList: TList;
48- NewList: TList;
49- SaveCount: Integer;
50- Node: TTreeNode;
51- NoCount: Integer;
52- Loop: Integer;
53-begin
54- NewList := TList.Create;
55- try
56- //„‰ñ“úŽžÝ’è
57- Board.RoundDate := Now;
58- //ƒT[ƒoãƒtƒ@ƒCƒ‹‚̍XVŽžÝ’è
59- Board.LastModified := GetHeadServerDate(Header);
60-
61- //ƒŠƒXƒg•Û‘¶Œ”Žæ“¾
62- SaveCount := Board.ListCount;
63- if SaveCount = -1 then
64- SaveCount := MaxInt;
65-
66- //ŒÃ‚¢ƒŠƒXƒg‚©‚烍ƒO–³‚µƒAƒCƒeƒ€‚ðíœ
67- for i := Board.Count - 1 downto 0 do
68- if not Board.Items[i].IsLogFile then
69- Board.Delete(i);
70-
71- //V‚µ‚¢ƒŠƒXƒg‚ðì¬‚·‚éB
72- //V‚µ‚¢ƒŠƒXƒg‚Ɍ¢ƒŠƒXƒg‚̃ƒO‚ª‚ ‚é‚È‚ç‚»‚ê‚ðV‚µ‚¢ƒŠƒXƒg‚ɒljÁB
73- //ŒÃ‚¢ƒƒO‚ª‚È‚¯‚ê‚΁AV‚½‚ɃXƒŒƒIƒuƒWƒFƒNƒg‚ðì¬B
74- Loop := Min(Body.Count, SaveCount);
75- NoCount := 0;
76- for i := 0 to Loop - 1 do begin
77- inc(NoCount);
78- GikoSys.DivideSubject(Body[i], FileName, Title, Count);
79-
80- index := Board.GetIndex(FileName);
81- if index = -1 then begin
82- NewItem := TThreadItem.Create;
83- NewItem.FileName := FileName;
84- NewItem.Title := Title;
85- NewItem.Count := Count;
86- NewItem.ParentBoard := Board;
87- NewItem.No := NoCount;
88- NewList.Add(NewItem);
89- end else begin
90- Board.Items[index].Count := Count;
91- Board.Items[index].No := NoCount;
92- NewList.Add(Board.Items[index]);
93- Board.DeleteList(index);
94- end;
95- end;
96-
97- //V‚µ‚¢ƒŠƒXƒg‚É–³‚©‚Á‚½ŒÃ‚¢ƒƒO—L‚èƒAƒCƒeƒ€‚ðV‚µ‚¢ƒŠƒXƒg‚ɒljÁ
98- for i := 0 to Board.Count - 1 do begin
99- inc(NoCount);
100- Board.Items[i].No := NoCount;
101- NewList.Add(Board.Items[i]);
102- end;
103-
104- //ŒÃ‚¢ƒŠƒXƒg‚ðÁ‚·iƒŠƒXƒg‚̂݁BƒXƒŒƒIƒuƒWƒFƒNƒgŽ©‘̂͏Á‚³‚È‚¢j
105- for i := Board.Count - 1 downto 0 do
106- Board.DeleteList(i);
107-
108- //V‚µ‚¢ƒŠƒXƒg‚ðƒ{[ƒhƒIƒuƒWƒFƒNƒg‚ɒljÁ
109- for i := 0 to NewList.Count - 1 do
110- Board.Add(TThreadItem(NewList[i]));
111-
112- //ƒŠƒXƒg(subject.txt)‚ð•Û‘¶
113- GikoSys.ForceDirectoriesEx(GikoSys.GetLogDir + Board.BBSID);
114- Body.SaveToFile(GikoSys.GetSubjectFileName(Board.BBSID));
115-
116- GikoSys.ExitWrite.Add(Board.BBSID);
117- finally
118- NewList.Free;
119- end;
120-
121-end;}
122-
123-{procedure TSaveFile.SaveItemFile;
124-var
125-// Node: TTreeNode;
126-// fNode: TTreeNode;
127- Cnt: Integer;
128-begin
129- Body.SaveToFile(GikoSys.GetThreadFileName(ThreadItem.ParentBoard.BBSID, ThreadItem.FileName));
130-
131- ThreadItem.RoundDate := Now;
132- ThreadItem.Size := Size;
133- ThreadItem.LastModified := GetHeadServerDate(Header);
134- ThreadItem.Count := Body.Count;
135- ThreadItem.IsLogFile := True;
136- ThreadItem.NewReceive := 0;
137-// ThreadItem.NonRead := True;
138-
139- if ThreadItem.RoundNo = 6 then
140- ThreadItem.RoundNo := 0;
141-
142- GikoSys.ExitWrite.Add(ThreadItem.ParentBoard.BBSID);
143-end;}
144-
145-{procedure TSaveFile.SaveRangeItemFile;
146-var
147- wkBody: TStringList;
148- Node: TTreeNode;
149- fNode: TTreeNode;
150- Cnt: Integer;
151- OldCnt: Integer;
152-begin
153- if FileExists(GikoSys.GetThreadFileName(ThreadItem.ParentBoard.BBSID, ThreadItem.FileName)) then begin
154- wkBody := TStringList.Create;
155- try
156- wkBody.LoadFromFile(GikoSys.GetThreadFileName(ThreadItem.ParentBoard.BBSID, ThreadItem.FileName));
157- wkBody.AddStrings(Body);
158- wkBody.SaveToFile(GikoSys.GetThreadFileName(ThreadItem.ParentBoard.BBSID, ThreadItem.FileName));
159- finally
160- wkBody.Free;
161- end;
162- end else begin
163- Body.SaveToFile(GikoSys.GetThreadFileName(ThreadItem.ParentBoard.BBSID, ThreadItem.FileName));
164- end;
165-
166- OldCnt := ThreadItem.Count;
167-
168- ThreadItem.RoundDate := Now;
169- ThreadItem.Size := ThreadItem.Size + Size;
170- ThreadItem.LastModified := GetHeadServerDate(Header);
171- ThreadItem.Count := ThreadItem.Count + Body.Count;
172- ThreadItem.IsLogFile := True;
173- ThreadItem.NewReceive := OldCnt + 1;
174-// ThreadItem.NonRead := True;
175- if ThreadItem.RoundNo = 6 then
176- ThreadItem.RoundNo := 0;
177-
178- GikoSys.ExitWrite.Add(ThreadItem.ParentBoard.BBSID);
179-end;}
180-
181-{function TSaveFile.GetHeadServerDate(List: TStrings): TDateTime;
182-var
183- i: Integer;
184- DateStr: string;
185-begin
186- DateStr := '';
187- for i := 0 to List.Count - 1 do begin
188- if Pos('Date: ', List.Strings[i]) <> 0 then begin
189- DateStr := StringReplace(List.Strings[i], 'Date: ', '', [rfReplaceAll]);
190- Break;
191- end;
192- end;
193-// Result := GikoSys.RFC1123ToDate(DateStr);
194- Result := ParseDate(DateStr);
195-end;}
196-
197-{procedure TSaveFile.SaveSendFile;
198-var
199- sDate: string;
200- ini: TMemIniFile;
201-begin
202- ini := TMemIniFile.Create(GikoSys.GetSentFileName);
203- try
204- sDate := SendItem.StrSendDate;
205- if Trim(sDate) = '' then
206- sDate := GikoSys.Get2chDate(Now);
207-
208- ini.WriteString(sDate, 'Title', SendItem.Title);
209- ini.WriteString(sDate, 'Name', SendItem.Name);
210- ini.WriteString(sDate, 'EMail', SendItem.EMail);
211- ini.WriteString(sDate, 'Body', HttpEncode(SendItem.Body));
212- ini.WriteInteger(sDate, 'Status', SendItem.StatusCode);
213- ini.WriteDateTime(sDate, 'Date', SendItem.SendDate);
214- ini.WriteString(sDate, 'BBS', SendItem.ThreadItem.ParentBoard.BBSID);
215- ini.WriteString(sDate, 'Key', ChangeFileExt(SendItem.ThreadItem.FileName, ''));
216-
217- ini.UpdateFile;
218- finally
219- ini.Free;
220- end;
221-end;
222-}
223-end.
--- a/ToolBarUtil.pas
+++ b/ToolBarUtil.pas
@@ -4,8 +4,7 @@ interface
44
55 uses
66 Windows, Messages, SysUtils, Classes, Controls,
7- StdCtrls, ExtCtrls, ComCtrls, ActnList, IniFiles,
8- GikoSystem, MojuUtils;
7+ StdCtrls, ExtCtrls, ComCtrls, ActnList;
98
109 const
1110 //•W€ƒc[ƒ‹ƒo[ƒfƒtƒHƒ‹ƒg
@@ -124,8 +123,12 @@ const
124123 procedure ReadToolBarSetting(ActionList: TActionList; ToolBar: TToolBar);
125124 procedure SaveToolBarSetting(ToolBar: TToolBar);
126125 procedure MakeDefaultINIFile();
126+
127127 implementation
128128
129+uses
130+ IniFiles, GikoSystem, MojuUtils;
131+
129132 function ConvertToolButton( setting : string ) : string;
130133 begin
131134
--- a/gikoNavi.dpr
+++ b/gikoNavi.dpr
@@ -19,7 +19,6 @@ uses
1919 GikoSystem in 'GikoSystem.pas',
2020 Setting in 'Setting.pas',
2121 BoardGroup in 'BoardGroup.pas',
22- SaveFile in 'SaveFile.pas',
2322 Sort in 'Sort.pas',
2423 ThreadControl in 'ThreadControl.pas',
2524 ItemDownload in 'ItemDownload.pas',
@@ -38,7 +37,6 @@ uses
3837 Preview in 'Preview.pas',
3938 HTMLDocumentEvent in 'HTMLDocumentEvent.pas',
4039 Kotehan in 'Kotehan.pas' {KotehanDialog},
41- MonaUtils in 'MonaUtils.pas',
4240 HintWindow in 'HintWindow.pas',
4341 GikoUtil in 'GikoUtil.pas',
4442 ToolBarSetting in 'ToolBarSetting.pas' {ToolBarSettingDialog},
Binary files a/gikoNavi.res and b/gikoNavi.res differ
--- a/readme/Samba.default
+++ b/readme/Samba.default
@@ -1,12 +1,10 @@
11 [Setting]
2-2chplus=30
32 aa5=30
43 academy4=30
54 anime=45
65 book3=30
76 bubble4=120
87 comic6=30
9-dso=10
108 etc3=30
119 etc4=30
1210 ex9=15
@@ -39,15 +37,14 @@ qb6=30
3937 school5=30
4038 science4=30
4139 society3=30
42-sports2=0
4340 sports9=60
4441 that4=30
4542 tmp5=45
4643 travel2=30
4744 tv7=30
48-tv8=120
49-idol=30
45+tv8=60
5046 pie=30
47+idol=30
5148 sakura01=30
5249 sakura02=30
5350 sakura03=30
--- a/readme/readme.txt
+++ b/readme/readme.txt
@@ -1,4 +1,4 @@
1-¡ƒMƒRƒiƒr Version1.00 ÊÞÀ52 Readme.txt
1+¡ƒMƒRƒiƒr Version1.00 ÊÞÀ53 Readme.txt
22
33
44 ------------------------------
@@ -50,7 +50,7 @@
5050 ------------------------------
5151 ƒoƒO‚â—v–]‚́AƒMƒRƒiƒrƒXƒŒƒbƒh‚Ŏ󂯕t‚¯‚Ä‚¨‚è‚Ü‚·B
5252 ƒMƒRƒiƒrƒTƒCƒgFhttp://gikonavi.sourceforge.jp/
53-ƒMƒRƒiƒrƒXƒŒFhttp://pc7.2ch.net/test/read.cgi/software/1148818605/l50
53+ƒMƒRƒiƒrƒXƒŒFhttp://pc7.2ch.net/test/read.cgi/software/1149268313/l50
5454
5555 ------------------------------
5656 “]Ú‚ɂ‚¢‚Ä
@@ -107,13 +107,20 @@ LICENSE
107107 ------------------------------
108108 —š—ð
109109 ------------------------------
110-2006/XX/YY
110+2006/XX/XX
111+ Version ÊÞÀ53
112+@HHHH
113+
114+2006/06/18
111115 Version ÊÞÀ52
112116 @“ü—̓AƒVƒXƒg‹@\’ljÁ
113117 @ƒXƒŒƒbƒhˆê——‚Ɂh¨‚¢hƒJƒ‰ƒ€’ljÁiƒfƒtƒHƒ‹ƒg”ñ•\Ž¦j
114118 @‚¨‹C‚É“ü‚èA—š—ðA‘—MƒƒO‚̃XƒŒƒbƒhƒ^ƒCƒgƒ‹–¼‚ðƒTƒjƒ^ƒCƒY‚·‚é‚悤‚ɏC³
115119 iƒm[ƒgƒ“‚̌딽‰ž–â‘è‚Ö‚Ì•”•ª“I‘Ήžj
116120 @‚Q‚¿‚á‚ñ‚Ë‚é‚ÌCookie‚ÌŽd—l•ÏX‚ɑΉž
121+@ƒŒƒXƒGƒfƒBƒ^ã‚©‚çACookieî•ñ‚ðíœ‚Å‚«‚é‚悤‚É‚µ‚½
122+@skin30-2GAskin30-3G‚ðÅV‰»
123+ichie_image.js ‚Ì [var onOpenLoad] ‚Ì’l‚É‚æ‚Á‚ăXƒŒ•\Ž¦Žž‚̉摜“ǂݍž‚݃‚[ƒhØ‘ցj
117124
118125 2006/01/14
119126 Version ÊÞÀ51
--- a/res/skin/skin30-2G/chie_image.js
+++ b/res/skin/skin30-2G/chie_image.js
@@ -1,5 +1,5 @@
11 //======‰æ‘œ“Ǎž‚̐ݒè
2-var onOpenLoad =1; // ƒXƒŒ“ǍžŽž‚̉摜“Ǎž@0:“ǂݍž‚Ü‚È‚¢A1:V’…ƒŒƒX‚̂݁A2:‘S•”
2+var onOpenLoad =0; // ƒXƒŒ“ǍžŽž‚̉摜“Ǎž@0:“ǂݍž‚Ü‚È‚¢A1:V’…ƒŒƒX‚̂݁A2:‘S•”
33 var onMouseLoad=true; // true:ƒJ[ƒ\ƒ‹‚ð‡‚í‚¹‚½‚¾‚¯Afalse:LOADƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚©‚ç
44 var takeArisk=false; // true:‰æ‘œ“ǂݍž‚ÝŽž‚Ƀ‚[ƒhØ‘ցAfalse:Žè“®‚Ń‚[ƒhØ‘Ö
55 //==========ˆÈ‰º‚̓XƒNƒŠƒvƒg–{•¶‚Å‚·‚æB
--- a/res/skin/skin30-3G/chie_image2.js
+++ b/res/skin/skin30-3G/chie_image2.js
@@ -1,7 +1,7 @@
11 // ƒCƒxƒ“ƒgƒnƒ“ƒhƒ‰FonMouseover
22 // ŠO•”•Ï”FanchorHead,dds
33 //======‰æ‘œ“ǂݍž‚Ý‚ÌÝ’è i’jWindowsXP SP2‚Å‚Í‚±‚ê‚ç‚̐ݒè‚Í—LŒø‚É‹@”\‚µ‚Ü‚¹‚ñB
4-var onOpenLoad =1; // 0:“ǂݍž‚Ü‚È‚¢A1:V’…ƒŒƒX‚̂݁A2:‘S•”
4+var onOpenLoad =0; // 0:“ǂݍž‚Ü‚È‚¢A1:V’…ƒŒƒX‚̂݁A2:‘S•”
55 var onMouseLoad=true; // true:ƒJ[ƒ\ƒ‹‚ð‡‚í‚¹‚½‚¾‚¯Afalse:LOADƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚©‚ç
66 //==========ƒOƒ[ƒoƒ‹•Ï”
77 var lightmode=true; // Live,twin‚̃Wƒƒƒ“ƒv—p”»’è‚Å—p‚¢‚Ä‚¢‚é‚Ì‚Å•K{