6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7 Dialogs, StdCtrls, ComCtrls, ExtCtrls, ToolWin, Menus, OleCtrls, Registry,
15 ActiveX, {HTTPApp,} YofUtils, Trip, IniFiles, StrUtils,
16 GikoSystem, GikoUtil, ImgList, Clipbrd, BoardGroup,
17 IdAntiFreezeBase, IdAntiFreeze, IdBaseComponent, IdComponent,
18 IdTCPConnection, IdTCPClient, IdHTTP, ActnList, StdActns, IdIntercept,
19 IdLogBase, IdLogDebug, IdException, DateUtils, MojuUtils, bmRegExp;
22 // TSetLayeredWindowAttributes = function(wnd: HWND; crKey: DWORD; bAlpha: BYTE; dwFlag: DWORD): Boolean; stdcall;
23 //
\8f\91\82«
\8d\9e\82Ý
\96ß
\82è
\92l
\83^
\83C
\83v
24 TGikoResultType = (grtOK, grtCookie, grtCheck, grtError);
26 TEditorForm = class(TForm)
29 PostMessage: TMenuItem;
30 SaveMessage: TMenuItem;
33 StatusBar: TStatusBar;
34 EditorPage: TPageControl;
36 PreviewTab: TTabSheet;
44 ToolBarImageList: TImageList;
45 HotToobarImageList: TImageList;
47 NameBasePanel: TPanel;
50 NameComboBox: TComboBox;
51 MailComboBox: TComboBox;
53 SendToolButton: TToolButton;
54 OutBoxToolButton: TToolButton;
55 ToolButton5: TToolButton;
56 UndoToolButton: TToolButton;
57 CutToolButton: TToolButton;
58 CopyToolButton: TToolButton;
59 PasteToolButton: TToolButton;
60 ToolButton3: TToolButton;
61 TransToolButton: TToolButton;
62 TopToolButton: TToolButton;
64 IdAntiFreeze: TIdAntiFreeze;
65 ToolButton1: TToolButton;
66 ToolButton2: TToolButton;
67 ActionList: TActionList;
81 SageCheckBox: TCheckBox;
82 IdLogDebug: TIdLogDebug;
85 KotehanCheckBox: TCheckBox;
89 SelectAllAction: TAction;
91 SelectAll1: TMenuItem;
93 QuotePasteAction: TAction;
94 QuotePasteMenuItem: TMenuItem;
96 SpaceToNBSPAction: TAction;
97 AmpToCharRefAction: TAction;
98 SpaceTabnbsp1: TMenuItem;
100 BoardInformationTab: TTabSheet;
101 BoardtopTab: TTabSheet;
102 TitlePictureBrowser: TWebBrowser;
104 BoardInformationMemo: TMemo;
105 GetSETTINGTXTAction: TAction;
107 SETTINGTXT2: TMenuItem;
108 GetTitlePictureAction: TAction;
111 procedure EditorPageChange(Sender: TObject);
112 procedure FormCreate(Sender: TObject);
113 procedure BrowserStatusTextChange(Sender: TObject;
114 const Text: WideString);
115 procedure FormClose(Sender: TObject; var Action: TCloseAction);
116 procedure FormDestroy(Sender: TObject);
117 procedure SendActionExecute(Sender: TObject);
118 procedure SaveActionExecute(Sender: TObject);
119 procedure AbortActionExecute(Sender: TObject);
120 procedure CloseActionExecute(Sender: TObject);
121 procedure UndoActionExecute(Sender: TObject);
122 procedure CutActionExecute(Sender: TObject);
123 procedure CopyActionExecute(Sender: TObject);
124 procedure PasteActionExecute(Sender: TObject);
125 procedure SendActionUpdate(Sender: TObject);
126 procedure SaveActionUpdate(Sender: TObject);
127 procedure CloseActionUpdate(Sender: TObject);
128 procedure UndoActionUpdate(Sender: TObject);
129 procedure CutActionUpdate(Sender: TObject);
130 procedure CopyActionUpdate(Sender: TObject);
131 procedure PasteActionUpdate(Sender: TObject);
132 procedure TopActionExecute(Sender: TObject);
133 procedure TopActionUpdate(Sender: TObject);
134 procedure SageCheckBoxClick(Sender: TObject);
135 procedure MailComboBoxChange(Sender: TObject);
136 procedure TransActionExecute(Sender: TObject);
137 procedure TransActionUpdate(Sender: TObject);
138 procedure IdLogDebugReceive(ASender: TIdConnectionIntercept;
140 procedure IdLogDebugSend(ASender: TIdConnectionIntercept;
142 procedure SelectAllActionExecute(Sender: TObject);
143 procedure StatusBarResize(Sender: TObject);
144 procedure Timer1Timer(Sender: TObject);
145 procedure FormActivate(Sender: TObject);
146 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
147 procedure QuotePasteActionExecute(Sender: TObject);
148 procedure SpaceToNBSPActionExecute(Sender: TObject);
149 procedure AmpToCharRefActionExecute(Sender: TObject);
150 procedure BoardTopClick(Sender: TObject);
151 procedure GetSETTINGTXTActionExecute(Sender: TObject);
152 procedure GetTitlePictureActionUpdate(Sender: TObject);
153 procedure GetTitlePictureActionExecute(Sender: TObject);
155 FThreadItem: TThreadItem;
157 FNameComboEdit: THandle;
158 FMailComboEdit: THandle;
161 FStatusCode: Integer;
162 FDebugStrReceive: string;
163 FDebugStrSend: string;
164 FSambaTime: TDateTime;
168 function RepHtml(s: string): string;
169 function Check: Boolean;
170 procedure SetNameList(sName, sMail: string);
171 // procedure Send(SendType: TGikoSendType; SPID: string; PON: string; FirstWriting: Boolean);
172 procedure Send(SPID: string; PON: string; FirstWriting: Boolean);
174 function GetActiveControlHandle: THandle;
175 // function GetSendData: string;
176 // procedure GetSendData(Source: TStringStream);
177 procedure GetSendData(Source: TStringStream);
178 procedure SaveSendFile;
179 procedure SetContent(Content: string; ABrowser: TWebBrowser);
180 function GetSPID(CookieLine: string): string;
181 function GetPON(CookieLine: string): string;
182 function GetResultType(ResponseText: string): TGikoResultType;
183 procedure ReadSambaTime(const AHost: string);
184 procedure WriteSambaTime(const AHost: string; ATime: TDateTime);
185 function ReadSettingTime(const AHost: string): Integer;
186 function CheckSambaTime(const AHost: string; ATime: TDateTime): Boolean;
187 procedure SetSamba24(AURL: string);
188 ///
\88ø
\97p
\95\84\82Ì
\8eæ
\93¾
189 function GetOEIndentChar : string;
190 ///
\96{
\95¶
\82Ì
\8eæ
\93¾
191 function GetBody : string;
192 //IdHttp
\82Ì
\8f\89\8aú
\89»
193 procedure InitIdHTTP(http: TIdHTTP);
194 procedure ShowBoardInformation(ABoard: TBoard; AMemo: TMemo);
195 function GetTitlePictureURL(body: TStringList; ABoard: TBoard): string;
196 procedure ShowTitlePicture();
197 function GetFusianaName(body: TStringList; ABoard: TBoard): String;
199 procedure CreateParams(var Params: TCreateParams); override;
203 procedure SetThreadItem(Item: TThreadItem);
204 procedure SetBoard(Item: TBoard);
205 property BBSID: string read FBBSID write FBBSID;
214 CAPTION_NAME_NEW: string = '
\83M
\83R
\83i
\83r
\83X
\83\8c\97§
\82Ä
\83G
\83f
\83B
\83^';
215 CAPTION_NAME_RES: string = '
\83M
\83R
\83i
\83r
\83\8c\83X
\83G
\83f
\83B
\83^';
217 //
\83G
\83f
\83B
\83b
\83g
\83E
\83B
\83\93\83h
\83E
\82ð
\89E
\89º
\82É
\82¸
\82ç
\82µ
\82Ä
\8aJ
\82
\88Ú
\93®
\97Ê
221 //DAX
\82³
\82ñ±Ø¶ÞÄ!(
\81L
\81¤
\81M)
222 READCGI_ERR = '-ERR';
223 READCGI_INCR = '-INCR';
225 READCGI_PARTIAL = '+PARTIAL';
226 READCGI_ERR_FOUND_KAKO = '-ERR
\89ß
\8b\8e\83\8d\83O
\91q
\8cÉ
\82Å
\94
\8c©';
227 READCGI_ERR_NOT_HTML = '-ERR html
\89»
\91Ò
\82¿';
228 READCGI_ERR_NOT_FOUND = '-ERR
\82»
\82ñ
\82È
\94Âor
\83X
\83\8c\83b
\83h
\82È
\82¢
\82Å
\82·
\81B';
229 READCGI_ERR_ABONE = '-ERR
\82Ç
\82±
\82©
\82Å
\82 \82Ú
\81[
\82ñ
\82ª
\82 \82Á
\82½
\82Ý
\82½
\82¢
\82Å
\82·
\81B';
230 READCGI_ERR_TIMEOUT = '-ERR
\8ew
\92è
\8e\9e\8aÔ
\82ª
\89ß
\82¬
\82Ü
\82µ
\82½
\81B';
231 READCGI_ERR_CANTUSE = '-ERR
\82à
\82¤
\81@
\82Â
\82©
\82¦
\82Ü
\82¹
\82ñ';
232 RES2CH_TRUE = '<!-- 2ch_X:true -->';
233 RES2CH_FALSE = '<!-- 2ch_X:false -->';
234 RES2CH_ERROR = '<!-- 2ch_X:error -->';
235 RES2CH_CHECK = '<!-- 2ch_X:check -->';
236 RES2CH_COOKIE = '<!-- 2ch_X:cookie -->';
239 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
240 BBS2CH_LOG_FOLDER: string = '2ch';
241 EXTERNAL_LOG_FOLDER: string = 'exboard';
243 FOLDER_INI_FILENAME: string = 'Folder.ini';
244 FOLDER_INDEX_FILENAME: string = 'Folder.idx';
245 SUBJECT_FILENAME: string = 'subject.txt';
246 PATH_DELIM: string = '\';
251 StartPos, EndPos: Integer;
256 {constructor TEditorForm.Create(AOwner: TComponent; Item: TBoard);
258 inherited Create(AOwner);
261 procedure TEditorForm.CreateParams(var Params: TCreateParams);
264 if FormStyle in [fsNormal, fsStayOnTop] then
265 if BorderStyle in [bsSingle, bsSizeable] then begin
266 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
267 Params.WndParent := 0;
271 {procedure TEditorForm.CreateParams(var Params: TCreateParams);
273 inherited CreateParams(Params);
274 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
277 procedure TEditorForm.FormCreate(Sender: TObject);
279 wp: TWindowPlacement;
284 Browser.Navigate('about:blank');
285 TitlePictureBrowser.Navigate('about:blank');
289 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\88Ê
\92u
\90Ý
\92è
290 wp.length := sizeof(wp);
291 wp.rcNormalPosition.Top := GikoSys.Setting.EditWindowTop;
292 wp.rcNormalPosition.Left := GikoSys.Setting.EditWindowLeft;
294 wp.rcNormalPosition.Bottom := GikoSys.Setting.EditWindowTop + GikoSys.Setting.EditWindowHeight;
295 wp.rcNormalPosition.Right := GikoSys.Setting.EditWindowLeft + GikoSys.Setting.EditWindowWidth;
296 wp.showCmd := SW_HIDE;
297 SetWindowPlacement(Handle, @wp);
299 if GikoSys.Setting.EditWindowMax then
300 WindowState := wsMaximized;
302 //
\83E
\83B
\83\93\83h
\83E
\82ª
\89æ
\96Ê
\8aO
\82È
\82ç
\89æ
\96Ê
\93à
\82É
\88Ú
\93®
\82·
\82é
303 if (Left + Width) > Screen.Width then
304 // Left := Screen.Width - Width;
306 if (Top + Height) > Screen.Height then
307 // Top := Screen.Height - Height;
314 //
\8c»
\8dÝ
\82Ì
\83E
\83B
\83\93\83h
\83E
\82Ì
\88Ê
\92u
\82ð
\95Û
\91¶
315 GikoSys.Setting.EditWindowTop := Top + WINDOWMOVE_V; //
\8e\9f\82É
\8aJ
\82
\83E
\83B
\83\93\83h
\83E
\82Í
316 GikoSys.Setting.EditWindowLeft := Left + WINDOWMOVE_H; //
\81@
\81@
\81@
\89E
\8eÎ
\82ß
\89º
\82É
\82¸
\82ç
\82·
317 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\95\9d\82Æ
\8d\82\82³
\82ª
\8f¬
\82³
\82·
\82¬
\82¢
\82ê
\82Î
\8c³
\82É
\96ß
\82·
318 if GikoSys.Setting.EditWindowHeight < 144 then
320 if GikoSys.Setting.EditWindowWidth < 144 then
323 EditorPage.ActivePage := EditorTab;
324 FNameComboEdit := GetWindow(NameComboBox.Handle, GW_CHILD);
325 FMailComboEdit := GetWindow(MailComboBox.Handle, GW_CHILD);
326 NameComboBox.Items.Assign(GikoSys.Setting.NameList);
327 MailComboBox.Items.Assign(GikoSys.Setting.MailList);
332 hUser32 := LoadLibrary('User32.dll');
334 TransAction.Enabled := true
336 TransAction.Enabled := false;
338 TransAction.Enabled := false;
341 FreeLibrary(hUser32);
344 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\83X
\83e
\83C
\8fó
\91Ô
345 if GikoSys.Setting.EditWindowStay then begin //
\83X
\83e
\83C
\8fó
\91Ô
346 SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
347 TopAction.Checked := true;
348 TopToolButton.Down := true;
349 end else begin //
\83X
\83e
\83C
\82µ
\82È
\82¢
350 SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
351 TopAction.Checked := false;
352 TopToolButton.Down := false;
355 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\94¼
\93§
\96¾
\8fó
\91Ô
356 if(GikoSys.Setting.EditWindowTranslucent) and (TransAction.Enabled) then begin //
\94¼
\93§
\96¾
\81i
\83g
\83\89\83\93\83X
\83\8b\81[
\83Z
\83\93\83g
\81j
\8fó
\91Ô
358 TransAction.Checked := true;
359 TransToolButton.Down := true;
360 end else begin //
\95s
\93§
\96¾
362 TransAction.Checked := false;
363 TransToolButton.Down := false;
365 //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
366 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked;
368 SpaceToNBSPAction.Checked := GikoSys.Setting.SpaceToNBSP;
369 AmpToCharRefAction.Checked := GikoSys.Setting.AmpToCharRef;
371 ini := TIniFile.Create(GikoSys.Setting.GetFileName);
374 BoardtopTab.TabVisible := ini.Readbool('EditorForm', 'BoardTopTab', False);
375 BoardTop.Checked := BoardtopTab.TabVisible;
382 procedure TEditorForm.SetBoard(Item: TBoard);
385 Caption := CAPTION_NAME_NEW + ' - [' + Item.Title + ']';
386 NameComboBox.Text := FBoard.KotehanName;
387 MailComboBox.Text := FBoard.KotehanMail;
388 SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
389 TitlePanel.Visible := True;
391 ShowBoardInformation(FBoard, BoardInformationMemo);
395 procedure TEditorForm.SetThreadItem(Item: TThreadItem);
398 Caption := CAPTION_NAME_RES + ' - [' + FThreadItem.Title + ']';
399 NameComboBox.Text := FThreadItem.ParentBoard.KotehanName;
400 MailComboBox.Text := FThreadItem.ParentBoard.KotehanMail;
401 SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
402 TitlePanel.Visible := False;
403 SetSamba24(FThreadItem.ParentBoard.URL);
404 ShowBoardInformation(FThreadItem.ParentBoard, BoardInformationMemo);
408 function TEditorForm.GetBody : string;
414 body := BodyEdit.Text;
415 if AmpToCharRefAction.Checked then
416 // &
\82Ì
\92u
\8a·
\82Í
\88ê
\94Ô
\8dÅ
\8f\89\82É
\82â
\82é
\82±
\82Æ
417 body := CustomStringReplace( body, '&', '&' );
418 if SpaceToNBSPAction.Checked then begin
419 body := CustomStringReplace( body, #09, ' ' );
420 body := CustomStringReplace( body, ' ', ' ' );
421 body := CustomStringReplace( body, ' ', ' ' );
422 regexp := TAWKStr.Create( nil );
424 regexp.RegExp := '^ ';
425 regexp.GSub( '\ ', body );
435 procedure TEditorForm.SetFont;
437 BodyEdit.Font.Name := GikoSys.Setting.EditorFontName;
438 BodyEdit.Font.Size := GikoSys.Setting.EditorFontSize;
439 BodyEdit.Font.Color := GikoSys.Setting.EditorFontColor;
440 BodyEdit.Color := GikoSys.Setting.EditorBackColor;
443 procedure TEditorForm.Preview;
456 if FThreadItem = nil then begin
458 Title := RepHtml(TitleEdit.Text);
460 No := IntToStr(FThreadItem.Count + 1);
461 Title := RepHtml(FThreadItem.Title);
466 Namae := RepHtml(NameComboBox.Text);
467 Mail := RepHtml(MailComboBox.Text);
468 Body := RepHtml(body);
469 Body := StringReplace(Body, #13#10, '<br>', [rfReplaceAll]);
470 DateTime := FormatDateTime('yyyy/mm/dd(aaa) hh:nn', now);
472 if Trim(Namae) = '' then
473 Namae := '
\96¼
\96³
\82µ
\82³
\82ñ';
475 s := '<HTML><HEAD>' + #13#10
476 + '<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">' + #13#10
477 + '<TITLE>' + title + '</TITLE>' + #13#10
478 // + '<STYLE><!--BODY{font-size : 9pt;font-family : "
\82l
\82r
\82o
\83S
\83V
\83b
\83N";}--></STYLE>' + #13#10
480 + '<BODY text="#000000" bgcolor="#EFEFEF" link="#0000FF" alink="#FF0000" vlink="#660099">' + #13#10
481 + '<FONT COLOR="#FF0000">' + title + '</FONT>' + #13#10
483 posTrip := AnsiPos( '#', Namae );
486 tripOrigin := Copy( Namae, posTrip + 1, Length( Namae ) );
488 Copy( Namae, 1, posTrip - 1 ) + '</B>
\81\9f' +
489 get_2ch_trip( PChar( tripOrigin ) ) + '<B>';
492 s := s + '<DT>' + No + '
\81F <FONT color="forestgreen"><B>' + Namae + '</B></FONT>
\81F ' + DateTime+ '<BR><DD>' + Body + '<BR><BR><BR>' + #13#10
494 s := s + '<DT>' + No + '
\81F <A href="mailto:' + Mail + '"><B>' + Namae + '</B></A> [' + Mail + ']
\81F ' + DateTime+ '<BR><DD>' + Body + '<BR><BR><BR>' + #13#10;
495 s := s + '</BODY></HTML>';
496 SetContent(s, Browser);
499 function TEditorForm.RepHtml(s: string): string;
501 // s := StringReplace(s, '&', '&', [rfReplaceAll]);
502 s := StringReplace(s, '<', '<', [rfReplaceAll]);
503 s := StringReplace(s, '>', '>', [rfReplaceAll]);
504 // s := StringReplace(s, ' ', ' ', [rfReplaceAll]); //
\8ed
\97l
\95Ï
\8dX
\82É
\82æ
\82è
\8eg
\97p
\95s
\89Â
505 s := StringReplace(s, '"', '"', [rfReplaceAll]);
509 procedure TEditorForm.EditorPageChange(Sender: TObject);
511 if EditorPage.ActivePage = PreviewTab then begin
514 Browser.Navigate('about:blank');
518 procedure TEditorForm.BrowserStatusTextChange(Sender: TObject;
519 const Text: WideString);
521 if EditorPage.ActivePage = PreviewTab then begin
522 StatusBar.Panels[0].Text := Text;
524 StatusBar.Panels[0].Text := '';
528 function TEditorForm.Check: Boolean;
535 if FThreadItem = nil then
538 Board := FThreadItem.ParentBoard;
540 if (not GikoSys.Setting.UseMachineTime) and
541 ((Board.LastGetTime = 0) or
542 (Board.LastGetTime = ZERO_DATE)) then begin
543 Msg := '
\83T
\81[
\83o
\82Ì
\8e\9e\8d\8f\82ª
\95ª
\82©
\82ç
\82È
\82¢
\82½
\82ß
\81A
\91\97\90M
\8fo
\97\88\82Ü
\82¹
\82ñ'#13#10
544 + '
\83X
\83\8c\83b
\83h
\82ð
\8dX
\90V
\81i
\8eæ
\93¾
\81j
\8cã
\81A15
\95b
\91Ò
\82Á
\82Ä
\82©
\82ç
\91\97\90M
\82µ
\82Ä
\82
\82¾
\82³
\82¢';
545 MsgBox(Handle, Msg, '
\83G
\83\89\81[', MB_OK or MB_ICONSTOP);
547 end else if BodyEdit.Text = '' then begin
548 Msg := '
\96{
\95¶
\82ª
\93ü
\97Í
\82³
\82ê
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B';
549 MsgBox(Handle, Msg, '
\83G
\83\89\81[', MB_OK or MB_ICONSTOP);
551 end else if (FBoard <> nil) and (Trim(TitleEdit.Text) = '') then begin
552 Msg := '
\83^
\83C
\83g
\83\8b\82ª
\93ü
\97Í
\82³
\82ê
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B';
553 MsgBox(Handle, Msg, '
\83G
\83\89\81[', MB_OK or MB_ICONSTOP);
556 if (not GikoSys.Dolib.Connected) and (AnsiPos('
\81\9c', NameComboBox.Text) <> 0) then begin
557 Msg := '
\83\8d\83O
\83C
\83\93\82µ
\82Ä
\82¢
\82È
\82¢
\82Ì
\82Å
\81\9c\82Ì
\8b@
\94\
\82Í
\97\98\97p
\8fo
\97\88\82Ü
\82¹
\82ñ
\81B'#13#10
558 + '
\82±
\82Ì
\82Ü
\82Ü
\91\97\90M
\82µ
\82Ä
\82à
\82æ
\82ë
\82µ
\82¢
\82Å
\82·
\82©
\81H';
559 rc := MsgBox(Handle, Msg, '
\8am
\94F', MB_YESNO or MB_ICONQUESTION);
560 Result := (rc = IDYES);
565 procedure TEditorForm.FormClose(Sender: TObject; var Action: TCloseAction);
570 procedure TEditorForm.FormDestroy(Sender: TObject);
572 wp: TWindowPlacement;
574 //
\8dÅ
\91å
\89»
\81E
\83E
\83B
\83\93\83h
\83E
\88Ê
\92u
\95Û
\91¶
575 wp.length := sizeof(wp);
576 GetWindowPlacement(Handle, @wp);
578 GikoSys.Setting.EditWindowTop := wp.rcNormalPosition.Top;
579 GikoSys.Setting.EditWindowLeft := wp.rcNormalPosition.Left;
580 GikoSys.Setting.EditWindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
581 GikoSys.Setting.EditWindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
582 GikoSys.Setting.EditWindowMax := WindowState = wsMaximized;
583 //GikoSys.Setting.EditWindowStay := FormStyle = fsStayOnTop; //
\83X
\83e
\83C
\8fó
\91Ô
\82Ì
\95Û
\91¶
584 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked; //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
588 procedure TEditorForm.SetNameList(sName, sMail: string);
590 if Trim(sName) <> '' then begin
591 if GikoSys.Setting.NameList.IndexOf(sName) = -1 then
592 GikoSys.Setting.NameList.Insert(0, sName);
594 if Trim(sMail) <> '' then begin
595 if GikoSys.Setting.MailList.IndexOf(sMail) = -1 then
596 GikoSys.Setting.MailList.Insert(0, sMail);
600 function TEditorForm.GetActiveControlHandle: THandle;
602 if EditorPage.ActivePage = EditorTab then begin
603 if ActiveControl = NameComboBox then
604 Result := FNameComboEdit
605 else if ActiveControl = MailComboBox then
606 Result := FMailComboEdit
607 else if ActiveControl = BodyEdit then
608 Result := BodyEdit.Handle
609 else if ActiveControl = TitleEdit then
610 Result := TitleEdit.Handle
617 procedure TEditorForm.SetContent(Content: string; ABrowser: TWebBrowser);
621 if ABrowser.Document <> nil then begin
622 doc := Idispatch( olevariant(ABrowser.ControlInterface).Document) as IHTMLDocument2;
625 doc.charset := 'Shift_JIS';
630 procedure TEditorForm.InitIdHTTP(http: TIdHTTP);
633 http.ProxyParams.BasicAuthentication := False;
634 if GikoSys.Setting.WriteProxy then begin
635 http.ProxyParams.ProxyServer := GikoSys.Setting.WriteProxyAddress;
636 http.ProxyParams.ProxyPort := GikoSys.Setting.WriteProxyPort;
637 http.ProxyParams.ProxyUsername := GikoSys.Setting.WriteProxyUserID;
638 http.ProxyParams.ProxyPassword := GikoSys.Setting.WriteProxyPassword;
639 if GikoSys.Setting.ReadProxyUserID <> '' then
640 http.ProxyParams.BasicAuthentication := True;
642 http.ProxyParams.ProxyServer := '';
643 http.ProxyParams.ProxyPort := 80;
644 http.ProxyParams.ProxyUsername := '';
645 http.ProxyParams.ProxyPassword := '';
647 Indy.Request.UserAgent := GikoSys.GetUserAgent;
648 Indy.Request.AcceptEncoding := '';
651 procedure TEditorForm.Send(SPID: string; PON: string; FirstWriting: Boolean);
653 TextStream: TStringStream;
654 Source: TStringStream;
655 ResponseText: string;
658 State: TGikoDownloadState;
659 ResultType: TGikoResultType;
664 //fusianasan
\83g
\83\89\83b
\83v by
\92è
\8aú
\95Ö
666 // SettingTxt: String;
671 SettingBody: TStringList;
676 Namae := RepHtml(NameComboBox.Text);
677 if FThreadItem = nil then
680 Board := FThreadItem.ParentBoard;
682 { Indy.Request.Clear;
683 Indy.ProxyParams.BasicAuthentication := False;
684 if GikoSys.Setting.WriteProxy then begin
685 Indy.ProxyParams.ProxyServer := GikoSys.Setting.WriteProxyAddress;
686 Indy.ProxyParams.ProxyPort := GikoSys.Setting.WriteProxyPort;
687 Indy.ProxyParams.ProxyUsername := GikoSys.Setting.WriteProxyUserID;
688 Indy.ProxyParams.ProxyPassword := GikoSys.Setting.WriteProxyPassword;
689 if GikoSys.Setting.ReadProxyUserID <> '' then
690 Indy.ProxyParams.BasicAuthentication := True;
692 Indy.ProxyParams.ProxyServer := '';
693 Indy.ProxyParams.ProxyPort := 80;
694 Indy.ProxyParams.ProxyUsername := '';
695 Indy.ProxyParams.ProxyPassword := '';
699 if FThreadItem = nil then begin
700 URL := FBoard.GetSendURL;
701 RefURL := GikoSys.UrlToServer(FBoard.URL) + 'test/bbs.cgi';
703 URL := FThreadItem.GetSendURL;
704 RefURL := FThreadItem.URL;
706 // Indy.Request.UserAgent := GikoSys.GetUserAgent;
707 Indy.Request.Referer := RefURL;
708 // Indy.Request.AcceptEncoding := '';
712 Cookie := Cookie + 'SPID=' + SPID + '; ';
714 Cookie := Cookie + 'PON=' + PON + '; ';
715 Cookie := 'Cookie: ' + Cookie + 'NAME=' + NameComboBox.Text + '; MAIL=' + MailComboBox.Text;
717 sysMenu := GetSystemMenu( Handle, false );
718 EnableMenuItem( sysMenu, SC_CLOSE, MF_GRAYED );
720 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
723 Indy.Request.CustomHeaders.Clear;
724 // Indy.Request.CacheControl := 'no-cache';
725 Indy.Request.CustomHeaders.Add('Pragma: no-cache');
726 Indy.Request.AcceptLanguage := 'ja';
727 Indy.Request.Accept := 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
728 Indy.Request.ContentType := 'application/x-www-form-urlencoded';
729 Indy.Request.CustomHeaders.Add(Cookie);
730 TextStream := TStringStream.Create('');
731 Source := TStringStream.Create('');
734 FDebugStrReceive := '';
737 Indy.Post(URL, Source, TextStream);
738 ResponseText := TextStream.DataString;
740 ResultType := GetResultType(ResponseText);
742 //MsgResult
\8f\89\8aú
\89»
744 //
\83t
\83V
\83A
\83i
\83g
\83\89\83b
\83v
\8cx
\8d\90(LocalMode) by
\92è
\8aú
\95Ö
745 if ((Namae = '
\8eR
\8dè
\8fÂ') or (Namae = 'fusianasan')) and (FirstWriting) then begin
748 '
\83\8a\83\82\81[
\83g
\83z
\83X
\83g
\82ð
\95\
\8e¦
\82·
\82é
\8b@
\94\
\82ª
\8eg
\82í
\82ê
\82Ä
\82¢
\82Ü
\82·' + #13#10 +
749 '
\82à
\82µ
\82à
\8aÔ
\88á
\82Á
\82Ä
\82±
\82Ì
\95û
\96@
\82Å
\83z
\83X
\83g
\82ª
\95\
\8e¦
\82³
\82ê
\82½
\82Æ
\82µ
\82Ä
\82à
\81A
\8e©
\8cÈ
\90Ó
\94C
\82È
\82Ì
\82Å
\8dí
\8f\9c\88Ë
\97\8a\82É
\82Í
\89\9e\82¶
\82Ü
\82¹
\82ñ
\81B' + #13#10#13#10 +
750 '
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
752 MB_YESNO or MB_ICONQUESTION);
753 if MsgResult = IDNO then begin
757 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
762 //
\83t
\83V
\83A
\83i
\83g
\83\89\83b
\83v
\8cx
\8d\90(NetworkMode) by
\92è
\8aú
\95Ö
764 SettingBody := SettingBody.Create;
765 SettingBody.LoadFromFile(tmpBoard.GetSETTINGTXTFileName);
769 Name := GetFusianaName(settingBody, tmpBoard);
770 if ( Name = 'fusianasan' ) or ( Name = '
\8eR
\8dè
\8fÂ') then begin
773 '
\82±
\82Ì
\94Â
\82Í
\96¼
\91O
\97\93\82ð
\93ü
\97Í
\82µ
\82È
\82¢
\82Æ
\83\8a\83\82\81[
\83g
\83z
\83X
\83g
\82ª
\95\
\8e¦
\82³
\82ê
\82Ü
\82·
\81B' + #13#10 +
774 '
\82à
\82µ
\82à
\8aÔ
\88á
\82Á
\82Ä
\82±
\82Ì
\95û
\96@
\82Å
\83z
\83X
\83g
\82ª
\95\
\8e¦
\82³
\82ê
\82½
\82Æ
\82µ
\82Ä
\82à
\81A
\8e©
\8cÈ
\90Ó
\94C
\82È
\82Ì
\82Å
\8dí
\8f\9c\88Ë
\97\8a\82É
\82Í
\89\9e\82¶
\82Ü
\82¹
\82ñ
\81B' + #13#10#13#10 +
775 '
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
777 MB_YESNO or MB_ICONQUESTION);
778 if MsgResult = IDNO then begin
782 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
788 if ResultType = grtOK then begin
789 WriteSambaTime(FHost, Now());
790 State := gdsComplete;
791 end else if ResultType = grtCookie then begin
792 //
\83\8b\81[
\83v
\96h
\8e~
793 if not FirstWriting then
794 raise Exception.Create('');
797 '
\81E
\93\8a\8de
\82³
\82ê
\82½
\93à
\97e
\82Í
\83R
\83s
\81[
\81A
\95Û
\91¶
\81A
\88ø
\97p
\81A
\93]
\8dÚ
\93\99\82³
\82ê
\82é
\8fê
\8d\87\82ª
\82 \82è
\82Ü
\82·
\81B' + #13#10 +
798 '
\81E
\93\8a\8de
\82É
\8aÖ
\82µ
\82Ä
\94
\90¶
\82·
\82é
\90Ó
\94C
\82Í
\91S
\82Ä
\93\8a\8de
\8eÒ
\82É
\8bA
\82µ
\82Ü
\82·
\81B' + #13#10#13#10 +
799 '
\91S
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
801 MB_YESNO or MB_ICONQUESTION);
802 if MsgResult = IDYES then begin
803 Board.SPID := GetSPID(Indy.Response.RawHeaders.Values['Set-Cookie']);
804 Board.PON := GetPON(Indy.Response.RawHeaders.Values['Set-Cookie']);
805 if (Board.SPID = '') and (Board.PON = '') then
806 raise Exception.Create('');
807 //
\82à
\82¤
\88ê
\89ñ
\82±
\82Ì
\83\81\83\
\83b
\83h
808 Send(Board.SPID, Board.PON, False);
814 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
818 end else if ResultType = grtCheck then begin
820 //
\83\8b\81[
\83v
\96h
\8e~
821 if not FirstWriting then
822 raise Exception.Create('');
826 '
\8f\91\82«
\8d\9e\82Ý
\82É
\8aÖ
\82µ
\82Ä
\82Í
\97l
\81X
\82È
\83\8d\83O
\8fî
\95ñ
\82ª
\8bL
\98^
\82³
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B' + #13#10 +
827 '
\93\8a\8de
\82É
\8aÖ
\82µ
\82Ä
\94
\90¶
\82·
\82é
\90Ó
\94C
\82Í
\91S
\82Ä
\93\8a\8de
\8eÒ
\82É
\8bA
\82µ
\82Ü
\82·
\81B' + #13#10 +
828 '
\8cö
\8f\98\97Ç
\91
\82É
\94½
\82µ
\82½
\82è
\81A
\91¼
\90l
\82É
\96À
\98f
\82ð
\82©
\82¯
\82é
\8f\91\82«
\8d\9e\82Ý
\82Í
\8dT
\82¦
\82Ä
\89º
\82³
\82¢
\81B' + #13#10 +
829 '
\93\8a\8de
\82³
\82ê
\82½
\93à
\97e
\82Í
\83R
\83s
\81[
\81E
\95Û
\91¶
\81E
\88ø
\97p
\81E
\93]
\8dÚ
\93\99\82³
\82ê
\82é
\8fê
\8d\87\82ª
\82 \82è
\82Ü
\82·
\81B' + #13#10 +
831 '
\91S
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
833 MB_YESNO or MB_ICONQUESTION);
835 if MsgResult = IDYES then begin
836 Board.SPID := GetSPID(Indy.Response.RawHeaders.Values['Set-Cookie']);
837 Board.PON := GetPON(Indy.Response.RawHeaders.Values['Set-Cookie']);
838 if (Board.SPID = '') and (Board.PON = '') then
839 raise Exception.Create('');
840 Send(Board.SPID, Board.PON, False);
843 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
851 WriteSambaTime(FHost, Now());
853 raise Exception.Create('');
857 on E: EIdConnectException do begin
859 ResponseText := '<html><body>'
860 + '<div>
\90Ú
\91±
\82ª
\8e¸
\94s
\82µ
\82Ü
\82µ
\82½<br>'
861 + '
\89ñ
\90ü
\82â
\83v
\83\8d\83L
\83V
\82Ì
\8fó
\91Ô
\82ð
\92²
\82×
\82Ä
\82
\82¾
\82³
\82¢<br></div>'
862 + '<br><br><div>' + E.Message + '</div>'
865 on E: Exception do begin
868 FDebugStrReceive := AnsiReplaceText(FDebugStrReceive, '<', '<');
869 FDebugStrReceive := AnsiReplaceText(FDebugStrReceive, '>', '>');
870 FDebugStrSend := AnsiReplaceText(FDebugStrSend, '<', '<');
871 FDebugStrSend := AnsiReplaceText(FDebugStrSend, '>', '>');
873 ResponseText := '<html><body>' + TextStream.DataString;
874 ResponseText := AnsiReplaceText(ResponseText, '</body>', '');
875 ResponseText := AnsiReplaceText(ResponseText, '</html>', '');
876 ResponseText := ResponseText + '<hr><div align="left"><pre>';
877 ResponseText := ResponseText + '<b>
\82±
\82±
\82©
\82ç
\83M
\83R
\83i
\83r
\82Ì
\8fî
\95ñ</b>'#13#10;
878 ResponseText := ResponseText + #13#10'
\81\9c\91\97\90M'#13#10;
879 ResponseText := ResponseText + FDebugStrSend;
880 ResponseText := ResponseText + #13#10'
\81\9c\8eó
\90M'#13#10;
881 ResponseText := ResponseText + FDebugStrReceive;
882 ResponseText := ResponseText + '</pre></div></body></html>';
885 FStatusCode := Indy.ResponseCode;
891 //sysMenu := GetSystemMenu( Handle, true );
892 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
896 //
\94ñ
\8cö
\8e®
\83M
\83R
\83i
\83r
\94Â
\82È
\82Ç
\82Ì
\83X
\83N
\83\8a\83v
\83g
\97p
897 //ResponceCode
\82ª302Found
\82Å
\8f\91\82«
\8d\9e\82Ý
\8a®
\97¹
898 if FStatusCode = 302 then begin
899 GikoForm.PlaySound('ResEnd');
901 if FThreadItem = nil then
902 GikoForm.AddMessageList(FBoard.Title + ' [
\90V
\83X
\83\8c\91\97\90M
\8fI
\97¹]', nil, gmiOK)
904 GikoForm.AddMessageList(FThreadItem.Title + ' [
\83\8c\83X
\91\97\90M
\8fI
\97¹]', nil, gmiOK);
908 if State = gdsComplete then begin
909 GikoForm.PlaySound('ResEnd');
911 if FThreadItem = nil then
912 GikoForm.AddMessageList(FBoard.Title + ' [
\90V
\83X
\83\8c\91\97\90M
\8fI
\97¹]', nil, gmiOK)
914 GikoForm.AddMessageList(FThreadItem.Title + ' [
\83\8c\83X
\91\97\90M
\8fI
\97¹]', nil, gmiOK);
916 end else if State = gdsError then begin
917 if FThreadItem = nil then
918 GikoForm.AddMessageList(FBoard.Title + ' [
\90V
\83X
\83\8c\91\97\90M
\8e¸
\94s]', nil, gmiNG)
920 GikoForm.AddMessageList(FThreadItem.Title + ' [
\83\8c\83X
\91\97\90M
\8e¸
\94s]', nil, gmiNG);
921 EditorPage.ActivePage := PreviewTab;
922 SetContent(ResponseText, Browser);
923 end else if State = gdsAbort then begin
924 GikoForm.AddMessageList(FThreadItem.Title + ' [
\92\86\92f]', nil, gmiSAD);
928 function TEditorForm.GetResultType(ResponseText: string): TGikoResultType;
930 if AnsiPos('
\8f\91\82«
\82±
\82Ý
\82ª
\8fI
\82í
\82è
\82Ü
\82µ
\82½', ResponseText) <> 0 then
932 else if (AnsiPos('
\83N
\83b
\83L
\81[
\82ª
\82È
\82¢
\82©
\8aú
\8cÀ
\90Ø
\82ê
\82Å
\82·', ResponseText) > 0) or
933 (AnsiPos('<title>
\83N
\83b
\83L
\81[
\8am
\94F
\81I</title>', ResponseText) > 0) or
934 (AnsiPos('<title>
\81¡
\83N
\83b
\83L
\81[
\8am
\94F
\81I
\81¡</title>', ResponseText) > 0) or
935 //(AnsiPos('
\83N
\83b
\83L
\81[
\8am
\94F', ResponseText) > 0) or
936 (AnsiPos(RES2CH_COOKIE, ResponseText) > 0) then
938 else if (AnsiPos('<font size=+2 color=#FF0000>
\8f\91\82«
\8d\9e\82Ý
\83`
\83F
\83b
\83N
\81I </font>', ResponseText) > 0) or
939 (AnsiPos('<title>
\81¡
\8f\91\82«
\8d\9e\82Ý
\8am
\94F
\82µ
\82Ü
\82·
\81¡</title>', ResponseText) > 0) or
940 (AnsiPos('<title>
\93\8a\8de
\8am
\94F</title>', ResponseText) > 0) or
941 (AnsiPos('<b>
\8f\91\82«
\82±
\82Ý
\8am
\94F</b>', ResponseText) > 0) or
942 (AnsiPos('="../test/subbbs.cgi">', ResponseText) > 0) or
943 (AnsiPos(RES2CH_FALSE, ResponseText) > 0) then
950 procedure TEditorForm.GetSendData(Source: TStringStream);
959 if FThreadItem = nil then
962 Board := FThreadItem.ParentBoard;
964 if GikoSys.Setting.UseMachineTime then begin
965 if GikoSys.Setting.TimeAdjust then
966 Adjust := Gikosys.Setting.TimeAdjustSec
968 Adjust := GikoSys.Setting.TimeAdjustSec * -1;
969 SendTime := GikoSys.DateTimeToInt(Now) - (9 * 60 * 60) + Adjust
971 if (Board.LastGetTime = 0) or (Board.LastGetTime = ZERO_DATE) then
972 SendTime := GikoSys.DateTimeToInt(Now)
974 SendTime := GikoSys.DateTimeToInt(Board.LastGetTime);
979 SessionID := GikoSys.Dolib.SessionID;
980 if SessionID <> '' then
981 s := 'sid=' + HttpEncode(SessionID) + '&'
985 + 'FROM=' + HttpEncode(NameComboBox.Text) + '&'
986 + 'mail=' + HttpEncode(MailComboBox.Text) + '&'
987 + 'MESSAGE=' + HttpEncode(body) + '&'
988 + 'bbs=' + Board.BBSID + '&'
989 + 'time=' + IntToStr(SendTime) + '&';
990 if FThreadItem = nil then begin
991 s := s + 'subject=' + HttpEncode(TitleEdit.Text) + '&';
992 s := s + 'submit=' + HttpEncode('
\91S
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Þ') + #13#10;
994 s := s + 'key=' + ChangeFileExt(FThreadItem.FileName, '') + '&';
995 s := s + 'submit=' + HttpEncode('
\8f\91\82«
\8d\9e\82Þ') + #13#10;
997 Source.WriteString(s);
1000 procedure TEditorForm.SaveSendFile;
1005 ini := TMemIniFile.Create(GikoSys.GetSentFileName);
1007 sDate := IntToStr(GikoSys.DateTimeToInt(Now));
1009 ini.WriteString(sDate, 'Name', NameComboBox.Text);
1010 ini.WriteString(sDate, 'EMail', MailComboBox.Text);
1011 ini.WriteString(sDate, 'Body', HttpEncode(BodyEdit.Text));
1012 ini.WriteInteger(sDate, 'Status', FStatusCode);
1013 ini.WriteDateTime(sDate, 'Date', Now);
1014 if FThreadItem = nil then begin
1015 ini.WriteString(sDate, 'Title', TitleEdit.Text);
1016 ini.WriteString(sDate, 'BBS', FBoard.BBSID);
1017 ini.WriteInteger(sDate, 'NewThread', 1);
1019 ini.WriteString(sDate, 'Title', FThreadItem.Title);
1020 ini.WriteString(sDate, 'BBS', FThreadItem.ParentBoard.BBSID);
1021 ini.WriteString(sDate, 'Key', ChangeFileExt(FThreadItem.FileName, ''));
1030 procedure TEditorForm.SendActionExecute(Sender: TObject);
1034 state : TGikoDownloadState;
1041 SendAction.Enabled := False;
1042 Application.ProcessMessages;
1043 if not Check then Exit;
1045 if FThreadItem = nil then
1048 Board := FThreadItem.ParentBoard;
1050 if FThreadItem = nil then begin
1051 rc := GikoUtil.MsgBox(Handle,
1052 '
\81u' + Board.Title + '
\81v
\94Â
\82É
\90V
\82µ
\82¢
\83X
\83\8c\83b
\83h
\97§
\82Ä
\82Ü
\82·'#13#10#13#10
1053 + '
\81E
\94Â
\82Ì
\83\8b\81[
\83\8b\82ð
\8eç
\82Á
\82½
\8f\91\82«
\8d\9e\82Ý
\82Å
\82 \82é
\82±
\82Æ
\82ð
\8am
\94F
\82µ
\82Ü
\82µ
\82½
\82©
\81H'#13#10
1054 + '
\81E
\91¼
\82É
\93¯
\82¶
\82æ
\82¤
\82È
\83X
\83\8c\83b
\83h
\82ª
\96³
\82©
\82Á
\82½
\82±
\82Æ
\82ð
\8am
\94F
\82µ
\82Ü
\82µ
\82½
\82©
\81H'#13#10#13#10
1055 + '
\81u
\82Í
\82¢
\81v
\82ð
\89\9f\82·
\82Æ
\91\97\90M
\82µ
\82Ü
\82·',
1057 MB_ICONQUESTION or MB_YESNO);
1058 if rc <> ID_YES then
1062 SetNameList(NameComboBox.Text, MailComboBox.Text);
1063 if KotehanCheckBox.Checked then begin
1064 Board.KotehanName := NameComboBox.Text;
1065 Board.KotehanMail := MailComboBox.Text;
1068 if Board.IsBoardPlugInAvailable then begin
1071 if FThreadItem = nil then begin
1072 //
\83X
\83\8c\97§
\82Ä
1073 state := TGikoDownloadState( Board.BoardPlugIn.CreateThread(
1074 DWORD( Board ), TitleEdit.Text, NameComboBox.Text, MailComboBox.Text, body ) );
1076 if state = gdsComplete then begin
1077 GikoForm.PlaySound('ResEnd');
1079 GikoForm.AddMessageList(FBoard.Title + ' [
\90V
\83X
\83\8c\91\97\90M
\8fI
\97¹]', nil, gmiOK);
1082 end else if State = gdsError then begin
1083 GikoForm.AddMessageList(FBoard.Title + ' [
\90V
\83X
\83\8c\91\97\90M
\8e¸
\94s]', nil, gmiNG);
1084 end else if State = gdsAbort then begin
1085 GikoForm.AddMessageList(FThreadItem.Title + ' [
\92\86\92f]', nil, gmiSAD);
1089 state := TGikoDownloadState( FThreadItem.BoardPlugIn.WriteThread(
1090 DWORD( FThreadItem ), NameComboBox.Text, MailComboBox.Text, body ) );
1092 if state = gdsComplete then begin
1093 GikoForm.PlaySound('ResEnd');
1095 GikoForm.AddMessageList(FThreadItem.Title + ' [
\83\8c\83X
\91\97\90M
\8fI
\97¹]', nil, gmiOK);
1098 end else if State = gdsError then begin
1099 GikoForm.AddMessageList(FThreadItem.Title + ' [
\83\8c\83X
\91\97\90M
\8e¸
\94s]', nil, gmiNG);
1100 end else if State = gdsAbort then begin
1101 GikoForm.AddMessageList(FThreadItem.Title + ' [
\92\86\92f]', nil, gmiSAD);
1105 if not Timer1.Enabled then
1106 Send(Board.SPID, Board.PON, True)
1108 if not CheckSambaTime(FHost, Now()) then begin
1109 rc := GikoUtil.MsgBox(Handle,
1110 'Samba24
\82Ì
\8bK
\92è
\92l
\96¢
\96\9e\82Ì
\95b
\90\94\82µ
\82©
\8co
\89ß
\82µ
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B'#13#10
1111 + '
\91\97\90M
\82ð
\92\86\8e~
\82µ
\82Ü
\82·
\82©
\81H' + #13#10
1112 + '(
\81u
\82¢
\82¢
\82¦
\81v
\82¾
\82Æ
\91\97\90M
\82µ
\82Ü
\82·)', 'Samba24
\8cx
\8d\90',
1113 MB_YESNO or MB_ICONQUESTION);
1114 if rc = IDYES then begin
1119 Send(Board.SPID, Board.PON, True);
1124 if Timer1.Enabled then
1125 ReadSambaTime(FHost);
1129 procedure TEditorForm.SaveActionExecute(Sender: TObject);
1134 procedure TEditorForm.CloseActionExecute(Sender: TObject);
1139 procedure TEditorForm.UndoActionExecute(Sender: TObject);
1141 SendMessage(GetActiveControlHandle, WM_UNDO, 0, 0);
1144 procedure TEditorForm.CutActionExecute(Sender: TObject);
1146 SendMessage(GetActiveControlHandle, WM_CUT, 0, 0);
1149 procedure TEditorForm.CopyActionExecute(Sender: TObject);
1151 SendMessage(GetActiveControlHandle, WM_COPY, 0, 0);
1154 procedure TEditorForm.PasteActionExecute(Sender: TObject);
1156 SendMessage(GetActiveControlHandle, WM_PASTE, 0, 0);
1159 procedure TEditorForm.SelectAllActionExecute(Sender: TObject);
1161 SendMessage(GetActiveControlHandle, EM_SETSEL, 0, GetWindowTextLength(GetActiveControlHandle));
1164 procedure TEditorForm.TopActionExecute(Sender: TObject); //
\83E
\83B
\83\93\83h
\83E
\8dÅ
\91O
\96Ê(Stay)
\83{
\83^
\83\93\82Ì
\8f\88\97\9d
1166 if not (fsShowing in Self.FormState) then begin
1167 if TopAction.Checked then begin //
\83X
\83e
\83C
\8fó
\91Ô
\82É
\90Ý
\92è
1168 SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
1169 GikoSys.Setting.EditWindowStay := true;
1170 end else begin //
\83X
\83e
\83C
\8fó
\91Ô
\89ð
\8f\9c
1171 SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
1172 GikoSys.Setting.EditWindowStay := false;
1174 //
\83X
\83e
\83C
\8fó
\91Ô
\82Ì
\95Û
\91¶
1175 //GikoSys.Setting.EditWindowStay := FormStyle = fsStayOnTop;
1179 procedure TEditorForm.AbortActionExecute(Sender: TObject);
1184 procedure TEditorForm.SendActionUpdate(Sender: TObject);
1186 SendAction.Enabled := not FWork;
1189 procedure TEditorForm.SaveActionUpdate(Sender: TObject);
1191 SaveAction.Enabled := False;
1194 procedure TEditorForm.CloseActionUpdate(Sender: TObject);
1196 CloseAction.Enabled := not FWork;
1199 procedure TEditorForm.UndoActionUpdate(Sender: TObject);
1201 UndoAction.Enabled := (GetActiveControlHandle <> 0)
1202 and (SendMessage(GetActiveControlHandle, EM_CANUNDO, 0, 0) <> 0)
1206 procedure TEditorForm.CutActionUpdate(Sender: TObject);
1208 Selection: TSelection;
1211 AHandle := GetActiveControlHandle;
1212 SendMessage(AHandle, EM_GETSEL, Longint(@Selection.StartPos), Longint(@Selection.EndPos));
1213 CutAction.Enabled := (AHandle <> 0)
1214 and ((Selection.EndPos - Selection.StartPos) <> 0)
1218 procedure TEditorForm.CopyActionUpdate(Sender: TObject);
1220 Selection: TSelection;
1223 AHandle := GetActiveControlHandle;
1224 SendMessage(AHandle, EM_GETSEL, Longint(@Selection.StartPos), Longint(@Selection.EndPos));
1225 CopyAction.Enabled := (AHandle <> 0)
1226 and ((Selection.EndPos - Selection.StartPos) <> 0)
1230 procedure TEditorForm.PasteActionUpdate(Sender: TObject);
1232 PasteAction.Enabled := (GetActiveControlHandle <> 0)
1233 and (Clipboard.HasFormat(CF_TEXT))
1237 procedure TEditorForm.TopActionUpdate(Sender: TObject);
1239 TopAction.Enabled := not FWork;
1242 procedure TEditorForm.SageCheckBoxClick(Sender: TObject);
1244 if SageCheckBox.Checked then begin
1245 if AnsiPos('sage', MailComboBox.Text) = 0 then
1246 MailComboBox.Text := 'sage' + MailComboBox.Text;
1248 if AnsiPos('sage', MailComboBox.Text) <> 0 then
1249 MailComboBox.Text := StringReplace(MailComboBox.Text, 'sage', '', [rfReplaceAll]);
1253 procedure TEditorForm.MailComboBoxChange(Sender: TObject);
1255 if AnsiPos('sage', MailComboBox.Text) = 0 then
1256 SageCheckBox.Checked := False
1258 SageCheckBox.Checked := True;
1262 function TEditorForm.GetSPID(CookieLine: string): string;
1270 s := Trim(GikoSys.GetTokenIndex(CookieLine, ';', i));
1274 if Pos('SPID=', s) = 1 then begin
1275 Result := Trim(Copy(s, 6, Length(s)));
1283 function TEditorForm.GetPON(CookieLine: string): string;
1291 s := Trim(GikoSys.GetTokenIndex(CookieLine, ';', i));
1295 if Pos('PON=', s) = 1 then begin
1296 Result := Trim(Copy(s, 5, Length(s)));
1304 procedure TEditorForm.IdLogDebugReceive(ASender: TIdConnectionIntercept;
1307 StringStream: TStringStream;
1309 StringStream := TStringStream.Create('');
1311 StringStream.CopyFrom(AStream, AStream.Size);
1312 FDebugStrReceive := FDebugStrReceive + StringStream.DataString;
1318 procedure TEditorForm.IdLogDebugSend(ASender: TIdConnectionIntercept;
1321 StringStream: TStringStream;
1323 StringStream := TStringStream.Create('');
1325 StringStream.CopyFrom(AStream, AStream.Size);
1326 FDebugStrSend := FDebugStrSend + StringStream.DataString;
1332 procedure TEditorForm.TransActionExecute(Sender: TObject);
1334 AlphaBlend := TransAction.Checked;
1335 //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
1336 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked;
1339 procedure TEditorForm.TransActionUpdate(Sender: TObject);
1341 TransAction.Enabled := not FWork;
1343 //StatusBar
\82ÌPanels[0]
\82Ì
\95\9d\82ð
\89Â
\95Ï
\81B
\8ec
\82è
\82ð
\8cÅ
\92è
\82É
\82·
\82é
1344 procedure TEditorForm.StatusBarResize(Sender: TObject);
1346 StatusBar.Panels[0].Width := StatusBar.Width
1347 - StatusBar.Panels[1].Width - StatusBar.Panels[2].Width;
1351 procedure TEditorForm.Timer1Timer(Sender: TObject);
1353 if FSambaTime = ZERO_DATE then
1354 StatusBar.Panels[1].Text := '
\8f\89\8f\91'
1356 FNow := IncMilliSecond(FNow, 500);
1357 StatusBar.Panels[1].Text := Format('%8.0f
\95b
\8co
\89ß', [SecondSpan(FNow, FSambaTime)]);
1361 //Samba.ini
\82Ì
\8f\91\82«
\8d\9e\82Ý
\8e\9e\8aÔ
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
1362 procedure TEditorForm.ReadSambaTime(const AHost: string);
1367 Timer1.Enabled := false; //
\8co
\89ß
\95b
\90\94\95\
\8e¦Timer
\82ðOff
\82É
\82·
\82é
\81i
\82±
\82ê
\82ªON
\82Ì
\82Æ
\82«Samba24
\91Î
\8dôOn
\81j
1368 FNow := Now(); //
\8c»
\8dÝ
\8e\9e\8aÔ
\82ð
\8eæ
\93¾
\81iTimer
\95\
\8e¦
\97p
\82Å
\81ACheck
\82·
\82é
\82Æ
\82«
\82Í
\8dÄ
\82ÑNow()
\82ð
\8cÄ
\82Ô
\81j
1369 Timer1.Enabled := true; //
\8co
\89ß
\95b
\90\94\95\
\8e¦Timer
\82ðOn
\82É
\82·
\82é
\81i
\82±
\82ê
\82ªON
\82Ì
\82Æ
\82«Samba24
\91Î
\8dôOn
\81j
1370 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
1372 //
\95¶
\8e\9a\97ñ
\82Å
\93Ç
\82Ý
\8eæ
\82Á
\82Ä
\81A
\95Ï
\8a·
\8aÖ
\90\94\82ÅTDateTime
\82Ö
1373 tmp := ini.ReadString('Send', AHost, DateTimeToStr(ZERO_DATE));
1374 FSambaTime := ConvertDateTimeString(tmp);
1379 //Samba.ini
\82É
\8dÅ
\8fI
\8f\91\82«
\8d\9e\82Ý
\8e\9e\8aÔ
\82ð
\8f\91\82«
\8d\9e\82Þ
1380 procedure TEditorForm.WriteSambaTime(const AHost: string; ATime: TDateTime);
1384 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
1386 ini.WriteDateTime('Send', AHost, ATime);
1392 //
\8dÅ
\8fI
\8f\91\82«
\8d\9e\82Ý
\8e\9e\8aÔ
\82Æ
\8c»
\8dÝ
\8e\9e\82ð
\94ä
\8ar
\82·
\82é
\81i
\90^
\81F
\8bK
\92è
\92l
\88È
\8fã
\81@
\8bU
\81F
\8bK
\92è
\92l
\96¢
\96\9e\81j
1393 function TEditorForm.CheckSambaTime(const AHost: string; ATime: TDateTime): Boolean;
1396 SettingTime: Integer;
1398 SettingTime := ReadSettingTime(AHost);
1399 ReadSambaTime(AHost);
1400 pastsec := SecondSpan(ATime, FSambaTime);
1401 if pastsec > SettingTime then
1406 //AHost
\81i
\8eI
\96¼
\81j
\82ÌSamba
\82Ì
\8bK
\92è
\92l
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
1407 function TEditorForm.ReadSettingTime(const AHost: string): Integer;
1411 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
1413 Result := ini.ReadInteger('Setting', AHost, 0);
1414 //
\8bK
\92è
\92l
\82ª
\82O
\82Ì
\82Æ
\82«
\81A
\82à
\82µ
\82
\82Í
\90Ý
\92è
\82³
\82ê
\82Ä
\82¢
\82È
\82¢
\82Æ
\82«
\82Í
\81A
\83t
\83@
\83C
\83\8b\82É
\8f\91\82«
\82½
\82·
\81B
1415 if Result = 0 then begin
1416 ini.WriteInteger('Setting', AHost, 0);
1423 //Form
\82ªActive
\82É
\82È
\82Á
\82½
\82ç
\8dÅ
\8fI
\8f\91\82«
\8d\9e\82Ý
\8e\9e\8aÔ
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
1424 procedure TEditorForm.FormActivate(Sender: TObject);
1426 if ( Timer1.Enabled ) and ( FThreadItem <> nil )then
1427 ReadSambaTime(FHost);
1429 //Samba24
\91Î
\8dô
\82ð
\8eg
\82¤
\82©
\82Ç
\82¤
\82©
\8c\88\82ß
\82é
\8aÖ
\90\94
1430 //ReadSambaTime
\82ð
\8cÄ
\82Ñ
\8fo
\82·
\82ÆTimer
\82ªOn
\82É
\82È
\82é
1431 procedure TEditorForm.SetSamba24(AURL: string);
1433 Protocol, Host, Path, Document, Port, Bookmark : string;
1435 //Samba24
\91Î
\8dô
\82ð
\82µ
\82È
\82¢
\82È
\82ç
\8fI
\97¹
1436 if not GikoSys.Setting.UseSamba then
1438 //Host
\82ÌURL
\82É'.2ch.'
\82©'.bbspink.'
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82½
\82çSamba24
\91Î
\8dô
\82ð
\82·
\82é
1439 GikoSys.ParseURI( AURL, Protocol,Host, Path, Document, Port, Bookmark );
1440 if GikoSys.Is2chHost(Host) then begin
1441 Host := Copy(Host, 1, AnsiPos('.', Host) - 1);
1442 FHost := Host; //FHost=
\8eI
\96¼
1443 ReadSambaTime(FHost); //
\88È
\91O
\82Ì
\8f\91\82«
\8d\9e\82Ý
\8e\9e\8aÔ
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
1444 //StatusBar
\82É
\82±
\82Ì
\8eI
\82Ì
\8bK
\92è
\92l
\82ð
\95\
\8e¦
\82·
\82é
1445 StatusBar.Panels[2].Text := 'Samba24
\8bK
\92è
\92l' + IntToStr(ReadSettingTime(FHost));
1448 procedure TEditorForm.FormCloseQuery(Sender: TObject;
1449 var CanClose: Boolean);
1451 CanClose := not FWork;
1454 function TEditorForm.GetOEIndentChar : string;
1457 Identities : string;
1460 DEFAULT_CHAR = '> ';
1461 OE_MAIL_PATH = '\Software\Microsoft\Outlook Express\5.0\Mail';
1462 INDENT_CHAR = 'Indent Char';
1465 Result := DEFAULT_CHAR;
1466 regKey := TRegistry.Create;
1469 regKey.RootKey := HKEY_CURRENT_USER;
1470 if not regKey.OpenKey( 'Identities', False ) then
1472 Identities := regKey.ReadString( 'Default User ID' );
1473 if Identities = '' then
1475 if not regKey.OpenKey( Identities + OE_MAIL_PATH, False ) then
1477 IndentChar := regKey.ReadInteger( INDENT_CHAR );
1478 Result := Char( IndentChar ) + ' ';
1487 procedure TEditorForm.QuotePasteActionExecute(Sender: TObject);
1494 quote := GetOEIndentChar;
1495 s := TStringList.Create;
1497 s.Text := Clipboard.AsText;
1499 for i := s.Count - 1 downto 0 do
1500 s[ i ] := quote + s[ i ];
1502 BodyEdit.SelText := s.Text;
1509 procedure TEditorForm.SpaceToNBSPActionExecute(Sender: TObject);
1511 GikoSys.Setting.SpaceToNBSP := SpaceToNBSPAction.Checked;
1512 if EditorPage.ActivePage = PreviewTab then
1516 procedure TEditorForm.AmpToCharRefActionExecute(Sender: TObject);
1518 GikoSys.Setting.AmpToCharRef := AmpToCharRefAction.Checked;
1519 if EditorPage.ActivePage = PreviewTab then
1523 procedure TEditorForm.BoardTopClick(Sender: TObject);
1527 ini := TIniFile.Create(GikoSys.Setting.GetFileName);
1529 BoardtopTab.TabVisible := BoardTop.Checked;
1530 ini.WriteBool('EditorForm', 'BoardTopTab', BoardtopTab.TabVisible);
1537 procedure TEditorForm.GetSETTINGTXTActionExecute(Sender: TObject);
1539 URL, RefURL: string;
1540 settingBody: TStringList;
1544 if FThreadItem = nil then
1547 tmpBoard := FThreadItem.ParentBoard;
1549 if tmpBoard = nil then Exit;
1551 RefURL := tmpBoard.URL;
1552 if RefURL[Length(RefURL)] <> '/' then
1553 URL := RefURL + '/' + 'SETTING.TXT'
1555 URL := RefURL + 'SETTING.TXT';
1557 Indy.Request.LastModified := tmpBoard.SETTINGTXTTime;
1558 Indy.Request.Referer := RefURL;
1559 Screen.Cursor := crHourGlass;
1560 settingBody := TStringList.Create;
1562 StatusBar.Panels[0].Text := 'SETTING.TXT
\83_
\83E
\83\93\83\8d\81[
\83h
\92\86';
1563 settingBody.Text := Indy.Get(URL);
1564 if( Indy.ResponseCode = 200 ) then begin
1565 settingBody.SaveToFile(tmpBoard.GetSETTINGTXTFileName);
1566 tmpBoard.SETTINGTXTTime := Indy.Response.LastModified;
1567 tmpBoard.IsSETTINGTXT := true;
1568 tmpBoard.TitlePictureURL := GetTitlePictureURL(settingBody, tmpBoard);
1569 tmpBoard.Modified := true;
1571 if( Indy.ResponseCode = 304 ) then begin
1572 StatusBar.Panels[0].Text := 'SETTING.TXT
\8dX
\90V
\96³
\82µ(' + IntToStr(Indy.ResponseCode) + ')';
1576 StatusBar.Panels[0].Text := 'SETTING.TXT (' + IntToStr(Indy.ResponseCode) + ')';
1578 Screen.Cursor := crDefault;
1580 ShowBoardInformation(tmpBoard, BoardInformationMemo);
1583 procedure TEditorForm.ShowBoardInformation(ABoard: TBoard; AMemo: TMemo);
1588 AMemo.Lines.Add('[SETTING.TXT]');
1589 if ABoard.IsSETTINGTXT then begin
1590 if FileExists(ABoard.GetSETTINGTXTFileName) then begin
1591 AMemo.Lines.Add(DateTimeToStr(ABoard.SETTINGTXTTime) + '
\8dX
\90V');
1592 body := TStringList.Create;
1594 body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
1595 AMemo.Lines.AddStrings(body);
1600 ABoard.IsSETTINGTXT := false;
1601 ABoard.SETTINGTXTTime := ZERO_DATE;
1602 AMemo.Lines.Add('Local
\82É
\95Û
\91¶
\82³
\82ê
\82½SETTING.TXT
\82ª
\8c©
\82Â
\82©
\82è
\82Ü
\82¹
\82ñ');
1603 AMemo.Lines.Add('
\83\81\83j
\83\85\81[
\82æ
\82è
\8dÄ
\8eæ
\93¾
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B');
1606 AMemo.Lines.Add('SETTING.TXT
\82ð
\8eæ
\93¾
\82µ
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B');
1607 AMemo.Lines.Add('
\83\81\83j
\83\85\81[
\82æ
\82è
\8eæ
\93¾
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B');
1610 function TEditorForm.GetTitlePictureURL(body: TStringList; ABoard: TBoard): string;
1611 //BBS_TITLE_PICTURE=
1618 for i := 0 to body.Count - 1 do begin
1619 if (AnsiPos('BBS_TITLE_PICTURE=', body[i]) > 0) or
1620 (AnsiPos('BBS_FIGUREHEAD=', body[i]) > 0) then begin
1622 Delete(tmp, 1, AnsiPos('=', tmp));
1623 if AnsiPos('../', tmp) > 0 then begin
1624 CustomStringReplace(tmp, '../', GikoSys.UrlToServer(ABoard.URL));
1632 procedure TEditorForm.GetTitlePictureActionUpdate(Sender: TObject);
1634 if FThreadItem = nil then
1635 GetTitlePictureAction.Enabled := FBoard.IsSETTINGTXT
1637 GetTitlePictureAction.Enabled := FThreadItem.ParentBoard.IsSETTINGTXT;
1641 procedure TEditorForm.GetTitlePictureActionExecute(Sender: TObject);
1643 memStream: TMemoryStream;
1647 memStream := TMemoryStream.Create;
1649 if FThreadItem = nil then
1652 tmpBoard := FThreadItem.ParentBoard;
1654 Indy.Request.Referer := tmpBoard.URL;
1655 if tmpBoard.TitlePictureURL <> '' then begin
1656 StatusBar.Panels[0].Text := '
\94ÂTOP
\89æ
\91\9c\83_
\83E
\83\93\83\8d\81[
\83h
\92\86';
1657 Screen.Cursor := crHourGlass;
1658 Indy.Get(tmpBoard.TitlePictureURL, memStream);
1659 if Indy.ResponseCode = 200 then begin
1660 memStream.SaveToFile(tmpBoard.GetTitlePictureFileName);
1662 tmpBoard.Modified := true;
1666 Screen.Cursor := crDefault;
1667 StatusBar.Panels[0].Text := '
\94ÂTOP
\89æ
\91\9c (' + IntToStr(Indy.ResponseCode) + ')';
1672 procedure TEditorForm.ShowTitlePicture();
1677 if FThreadItem = nil then
1680 tmpBoard := FThreadItem.ParentBoard;
1682 if FileExists(tmpBoard.GetTitlePictureFileName) then begin
1683 TitlePictureBrowser.Navigate(tmpBoard.GetTitlePictureFileName);
1685 s := '
\94ÂTOP
\89æ
\91\9c\96¢
\8eæ
\93¾
\82Å
\82·
\81B<br>
\83\81\83j
\83\85\81[
\82æ
\82è
\8eæ
\93¾
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B';
1686 SetContent(s, TitlePictureBrowser);
1690 function TEditorForm.GetFusianaName(body: TStringList; ABoard: TBoard): String;
1695 for i := 0 to body.Count - 1 do begin
1696 if (AnsiPos('BBS_NONAME_NAME=', body[i]) > 0) then begin
1698 Delete(tmp, 1, AnsiPos('=', tmp));