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,
23 // TSetLayeredWindowAttributes = function(wnd: HWND; crKey: DWORD; bAlpha: BYTE; dwFlag: DWORD): Boolean; stdcall;
24 //
\8f\91\82«
\8d\9e\82Ý
\96ß
\82è
\92l
\83^
\83C
\83v
25 TGikoResultType = (grtOK, grtCookie, grtCheck, grtError);
27 TEditorForm = class(TForm)
30 PostMessage: TMenuItem;
31 SaveMessage: TMenuItem;
34 StatusBar: TStatusBar;
35 EditorPage: TPageControl;
37 PreviewTab: TTabSheet;
45 ToolBarImageList: TImageList;
46 HotToobarImageList: TImageList;
48 NameBasePanel: TPanel;
51 NameComboBox: TComboBox;
52 MailComboBox: TComboBox;
54 SendToolButton: TToolButton;
55 OutBoxToolButton: TToolButton;
56 ToolButton5: TToolButton;
57 UndoToolButton: TToolButton;
58 CutToolButton: TToolButton;
59 CopyToolButton: TToolButton;
60 PasteToolButton: TToolButton;
61 ToolButton3: TToolButton;
62 TransToolButton: TToolButton;
63 TopToolButton: TToolButton;
65 IdAntiFreeze: TIdAntiFreeze;
66 ToolButton1: TToolButton;
67 ToolButton2: TToolButton;
68 ActionList: TActionList;
82 SageCheckBox: TCheckBox;
83 IdLogDebug: TIdLogDebug;
86 KotehanCheckBox: TCheckBox;
90 SelectAllAction: TAction;
92 SelectAll1: TMenuItem;
94 QuotePasteAction: TAction;
95 QuotePasteMenuItem: TMenuItem;
97 SpaceToNBSPAction: TAction;
98 AmpToCharRefAction: TAction;
99 SpaceTabnbsp1: TMenuItem;
101 BoardInformationTab: TTabSheet;
102 BoardtopTab: TTabSheet;
103 TitlePictureBrowser: TWebBrowser;
105 BoardInformationMemo: TMemo;
106 GetSETTINGTXTAction: TAction;
108 SETTINGTXT2: TMenuItem;
109 GetTitlePictureAction: TAction;
111 GetHeadTXTAction: TAction;
113 RocalRuleTab: TTabSheet;
114 WebBrowser1: TWebBrowser;
115 CalcCapacityAction: TAction;
118 LocalRule: TMenuItem;
121 LocalRuleBrowse: TMenuItem;
122 ToolButton4: TToolButton;
123 ToolButton6: TToolButton;
124 SaveNameMailAction: TAction;
126 procedure EditorPageChange(Sender: TObject);
127 procedure FormCreate(Sender: TObject);
128 procedure BrowserStatusTextChange(Sender: TObject;
129 const Text: WideString);
130 procedure FormClose(Sender: TObject; var Action: TCloseAction);
131 procedure FormDestroy(Sender: TObject);
132 procedure SendActionExecute(Sender: TObject);
133 procedure SaveActionExecute(Sender: TObject);
134 procedure AbortActionExecute(Sender: TObject);
135 procedure CloseActionExecute(Sender: TObject);
136 procedure UndoActionExecute(Sender: TObject);
137 procedure CutActionExecute(Sender: TObject);
138 procedure CopyActionExecute(Sender: TObject);
139 procedure PasteActionExecute(Sender: TObject);
140 procedure SendActionUpdate(Sender: TObject);
141 procedure SaveActionUpdate(Sender: TObject);
142 procedure CloseActionUpdate(Sender: TObject);
143 procedure UndoActionUpdate(Sender: TObject);
144 procedure CutActionUpdate(Sender: TObject);
145 procedure CopyActionUpdate(Sender: TObject);
146 procedure PasteActionUpdate(Sender: TObject);
147 procedure TopActionExecute(Sender: TObject);
148 procedure TopActionUpdate(Sender: TObject);
149 procedure SageCheckBoxClick(Sender: TObject);
150 procedure MailComboBoxChange(Sender: TObject);
151 procedure TransActionExecute(Sender: TObject);
152 procedure TransActionUpdate(Sender: TObject);
153 procedure IdLogDebugReceive(ASender: TIdConnectionIntercept;
155 procedure IdLogDebugSend(ASender: TIdConnectionIntercept;
157 procedure SelectAllActionExecute(Sender: TObject);
158 procedure StatusBarResize(Sender: TObject);
159 procedure Timer1Timer(Sender: TObject);
160 procedure FormActivate(Sender: TObject);
161 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
162 procedure QuotePasteActionExecute(Sender: TObject);
163 procedure SpaceToNBSPActionExecute(Sender: TObject);
164 procedure AmpToCharRefActionExecute(Sender: TObject);
165 procedure BoardTopClick(Sender: TObject);
166 procedure GetSETTINGTXTActionExecute(Sender: TObject);
167 procedure GetTitlePictureActionUpdate(Sender: TObject);
168 procedure GetTitlePictureActionExecute(Sender: TObject);
169 procedure GetHeadTXTActionExecute(Sender: TObject);
170 procedure CalcCapacityActionExecute(Sender: TObject);
171 procedure LocalRuleClick(Sender: TObject);
172 procedure FormDeactivate(Sender: TObject);
173 procedure LocalRuleBrowseClick(Sender: TObject);
174 procedure SaveNameMailActionExecute(Sender: TObject);
176 FThreadItem: TThreadItem;
178 FNameComboEdit: THandle;
179 FMailComboEdit: THandle;
182 FStatusCode: Integer;
183 FDebugStrReceive: string;
184 FDebugStrSend: string;
185 FSambaTime: TDateTime;
188 FGestures : TGestureModel;
190 function RepHtml(s: string): string;
191 function Check: Boolean;
192 procedure SetNameList(sName, sMail: string);
193 // procedure Send(SendType: TGikoSendType; SPID: string; PON: string; FirstWriting: Boolean);
194 procedure Send(SPID: string; PON: string; FirstWriting: Boolean);
196 function GetActiveControlHandle: THandle;
197 // function GetSendData: string;
198 // procedure GetSendData(Source: TStringStream);
199 procedure GetSendData(Source: TStringStream);
200 procedure SaveSendFile;
201 procedure SetContent(Content: string; ABrowser: TWebBrowser);
202 function GetSPID(CookieLine: string): string;
203 function GetPON(CookieLine: string): string;
204 function GetResultType(ResponseText: string): TGikoResultType;
205 procedure ReadSambaTime(const AHost: string);
206 procedure WriteSambaTime(const AHost: string; ATime: TDateTime);
207 function ReadSettingTime(const AHost: string): Integer;
208 function CheckSambaTime(const AHost: string; ATime: TDateTime): Boolean;
209 procedure SetSamba24(AURL: string);
210 ///
\88ø
\97p
\95\84\82Ì
\8eæ
\93¾
211 function GetOEIndentChar : string;
212 ///
\96{
\95¶
\82Ì
\8eæ
\93¾
213 function GetBody : string;
214 //IdHttp
\82Ì
\8f\89\8aú
\89»
215 procedure InitIdHTTP(http: TIdHTTP);
216 procedure ShowBoardInformation(ABoard: TBoard; AMemo: TMemo);
217 function GetTitlePictureURL(body: TStringList; ABoard: TBoard): string;
218 procedure ShowTitlePicture();
219 function GetFusianaName(body: TStringList; ABoard: TBoard): String;
220 //!
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\8aJ
\8en
221 procedure OnGestureStart(Sender: TObject);
222 //!
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\92\86
223 procedure OnGestureMove(Sender: TObject);
224 //!
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\8fI
\97¹
225 procedure OnGestureEnd(Sender: TObject);
226 //HEAD.TXT
\8e©
\93®
\95\
\8e¦
227 procedure ShowBoardHead(ABoard: TBoard; AMemo: TMemo);
228 //LocalFusianaTrapAlart
229 function LFusianaGet(s: String): Boolean;
231 procedure CreateParams(var Params: TCreateParams); override;
235 procedure SetThreadItem(Item: TThreadItem);
236 procedure SetBoard(Item: TBoard);
237 property BBSID: string read FBBSID write FBBSID;
244 Giko, ItemDownload, Gesture;
246 CAPTION_NAME_NEW: string = '
\83M
\83R
\83i
\83r
\83X
\83\8c\97§
\82Ä
\83G
\83f
\83B
\83^';
247 CAPTION_NAME_RES: string = '
\83M
\83R
\83i
\83r
\83\8c\83X
\83G
\83f
\83B
\83^';
249 //
\83G
\83f
\83B
\83b
\83g
\83E
\83B
\83\93\83h
\83E
\82ð
\89E
\89º
\82É
\82¸
\82ç
\82µ
\82Ä
\8aJ
\82
\88Ú
\93®
\97Ê
253 //DAX
\82³
\82ñ±Ø¶ÞÄ!(
\81L
\81¤
\81M)
254 READCGI_ERR = '-ERR';
255 READCGI_INCR = '-INCR';
257 READCGI_PARTIAL = '+PARTIAL';
258 READCGI_ERR_FOUND_KAKO = '-ERR
\89ß
\8b\8e\83\8d\83O
\91q
\8cÉ
\82Å
\94
\8c©';
259 READCGI_ERR_NOT_HTML = '-ERR html
\89»
\91Ò
\82¿';
260 READCGI_ERR_NOT_FOUND = '-ERR
\82»
\82ñ
\82È
\94Âor
\83X
\83\8c\83b
\83h
\82È
\82¢
\82Å
\82·
\81B';
261 READCGI_ERR_ABONE = '-ERR
\82Ç
\82±
\82©
\82Å
\82 \82Ú
\81[
\82ñ
\82ª
\82 \82Á
\82½
\82Ý
\82½
\82¢
\82Å
\82·
\81B';
262 READCGI_ERR_TIMEOUT = '-ERR
\8ew
\92è
\8e\9e\8aÔ
\82ª
\89ß
\82¬
\82Ü
\82µ
\82½
\81B';
263 READCGI_ERR_CANTUSE = '-ERR
\82à
\82¤
\81@
\82Â
\82©
\82¦
\82Ü
\82¹
\82ñ';
264 RES2CH_TRUE = '<!-- 2ch_X:true -->';
265 RES2CH_FALSE = '<!-- 2ch_X:false -->';
266 RES2CH_ERROR = '<!-- 2ch_X:error -->';
267 RES2CH_CHECK = '<!-- 2ch_X:check -->';
268 RES2CH_COOKIE = '<!-- 2ch_X:cookie -->';
271 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
272 BBS2CH_LOG_FOLDER: string = '2ch';
273 EXTERNAL_LOG_FOLDER: string = 'exboard';
275 FOLDER_INI_FILENAME: string = 'Folder.ini';
276 FOLDER_INDEX_FILENAME: string = 'Folder.idx';
277 SUBJECT_FILENAME: string = 'subject.txt';
278 PATH_DELIM: string = '\';
283 StartPos, EndPos: Integer;
288 {constructor TEditorForm.Create(AOwner: TComponent; Item: TBoard);
290 inherited Create(AOwner);
293 procedure TEditorForm.CreateParams(var Params: TCreateParams);
296 if FormStyle in [fsNormal, fsStayOnTop] then
297 if BorderStyle in [bsSingle, bsSizeable] then begin
298 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
299 Params.WndParent := 0;
303 {procedure TEditorForm.CreateParams(var Params: TCreateParams);
305 inherited CreateParams(Params);
306 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
309 procedure TEditorForm.FormCreate(Sender: TObject);
311 wp: TWindowPlacement;
316 Browser.Navigate('about:blank');
317 TitlePictureBrowser.Navigate('about:blank');
321 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\88Ê
\92u
\90Ý
\92è
322 wp.length := sizeof(wp);
323 wp.rcNormalPosition.Top := GikoSys.Setting.EditWindowTop;
324 wp.rcNormalPosition.Left := GikoSys.Setting.EditWindowLeft;
326 wp.rcNormalPosition.Bottom := GikoSys.Setting.EditWindowTop + GikoSys.Setting.EditWindowHeight;
327 wp.rcNormalPosition.Right := GikoSys.Setting.EditWindowLeft + GikoSys.Setting.EditWindowWidth;
328 wp.showCmd := SW_HIDE;
329 SetWindowPlacement(Handle, @wp);
331 if GikoSys.Setting.EditWindowMax then
332 WindowState := wsMaximized;
334 //
\83E
\83B
\83\93\83h
\83E
\82ª
\89æ
\96Ê
\8aO
\82È
\82ç
\89æ
\96Ê
\93à
\82É
\88Ú
\93®
\82·
\82é
335 if (Left + Width) > Screen.Width then
336 // Left := Screen.Width - Width;
338 if (Top + Height) > Screen.Height then
339 // Top := Screen.Height - Height;
346 //
\8c»
\8dÝ
\82Ì
\83E
\83B
\83\93\83h
\83E
\82Ì
\88Ê
\92u
\82ð
\95Û
\91¶
347 GikoSys.Setting.EditWindowTop := Top + WINDOWMOVE_V; //
\8e\9f\82É
\8aJ
\82
\83E
\83B
\83\93\83h
\83E
\82Í
348 GikoSys.Setting.EditWindowLeft := Left + WINDOWMOVE_H; //
\81@
\81@
\81@
\89E
\8eÎ
\82ß
\89º
\82É
\82¸
\82ç
\82·
349 //
\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·
350 if GikoSys.Setting.EditWindowHeight < 144 then
352 if GikoSys.Setting.EditWindowWidth < 144 then
355 EditorPage.ActivePage := EditorTab;
356 FNameComboEdit := GetWindow(NameComboBox.Handle, GW_CHILD);
357 FMailComboEdit := GetWindow(MailComboBox.Handle, GW_CHILD);
358 NameComboBox.Items.Assign(GikoSys.Setting.NameList);
359 MailComboBox.Items.Assign(GikoSys.Setting.MailList);
364 hUser32 := LoadLibrary('User32.dll');
366 TransAction.Enabled := true
368 TransAction.Enabled := false;
370 TransAction.Enabled := false;
373 FreeLibrary(hUser32);
376 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\83X
\83e
\83C
\8fó
\91Ô
377 if GikoSys.Setting.EditWindowStay then begin //
\83X
\83e
\83C
\8fó
\91Ô
378 SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
379 TopAction.Checked := true;
380 TopToolButton.Down := true;
381 end else begin //
\83X
\83e
\83C
\82µ
\82È
\82¢
382 SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
383 TopAction.Checked := false;
384 TopToolButton.Down := false;
387 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\94¼
\93§
\96¾
\8fó
\91Ô
388 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Ô
390 TransAction.Checked := true;
391 TransToolButton.Down := true;
392 end else begin //
\95s
\93§
\96¾
394 TransAction.Checked := false;
395 TransToolButton.Down := false;
397 //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
398 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked;
400 SpaceToNBSPAction.Checked := GikoSys.Setting.SpaceToNBSP;
401 AmpToCharRefAction.Checked := GikoSys.Setting.AmpToCharRef;
403 ini := TIniFile.Create(GikoSys.Setting.GetFileName);
406 BoardtopTab.TabVisible := ini.Readbool('EditorForm', 'BoardTopTab', False);
407 BoardTop.Checked := BoardtopTab.TabVisible;
408 RocalRuleTab.TabVisible := ini.ReadBool('EditorForm', 'LocalRuleTab', False);
409 LocalRule.Checked := RocalRuleTab.TabVisible;
414 //
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\82Ì
\83C
\83\93\83X
\83g
\81[
\83\8b
415 if GikoSys.Setting.GestureEnabled then begin
417 FGestures := TGestureModel.Create;
418 FGestures.LoadGesture(
419 GikoSys.Setting.GetGestureFileName, ActionList );
420 MouseGesture.OnGestureStart := OnGestureStart;
421 MouseGesture.OnGestureMove := OnGestureMove;
422 MouseGesture.OnGestureEnd := OnGestureEnd;
423 MouseGesture.SetHook( Handle );
425 SaveNameMailAction.Checked := True;
428 procedure TEditorForm.SetBoard(Item: TBoard);
431 Caption := CAPTION_NAME_NEW + ' - [' + Item.Title + ']';
432 NameComboBox.Text := FBoard.KotehanName;
433 MailComboBox.Text := FBoard.KotehanMail;
434 SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
435 TitlePanel.Visible := True;
436 SetSamba24(FBoard.URL);
437 ShowBoardInformation(FBoard, BoardInformationMemo);
441 procedure TEditorForm.SetThreadItem(Item: TThreadItem);
444 Caption := CAPTION_NAME_RES + ' - [' + FThreadItem.Title + ']';
445 NameComboBox.Text := FThreadItem.ParentBoard.KotehanName;
446 MailComboBox.Text := FThreadItem.ParentBoard.KotehanMail;
447 SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
448 TitlePanel.Visible := False;
449 SetSamba24(FThreadItem.ParentBoard.URL);
450 ShowBoardInformation(FThreadItem.ParentBoard, BoardInformationMemo);
454 function TEditorForm.GetBody : string;
463 body := BodyEdit.Text;
464 if AmpToCharRefAction.Checked then
465 // &
\82Ì
\92u
\8a·
\82Í
\88ê
\94Ô
\8dÅ
\8f\89\82É
\82â
\82é
\82±
\82Æ
466 body := CustomStringReplace( body, '&', '&' );
467 if SpaceToNBSPAction.Checked then begin
469 tail := p + Length( body );
471 while p < tail do begin
478 tmp := tmp + ' ';
479 until (len mod TAB_LENGTH) = 0;
484 tmp := tmp + p^; Inc( p );
490 tmp := tmp + ' ';
496 //
\8eÀ
\91Ì
\8eQ
\8fÆ
\82Í 1
\95¶
\8e\9a\95ª
501 while p < tail do begin
502 if p^ in ['a'..'z', 'A'..'Z', '0'..'9', '#'] then begin
504 end else if p^ = ';' then begin
516 if p^ in kYofKanji then begin
517 tmp := tmp + p^; Inc( p );
518 tmp := tmp + p^; Inc( p );
521 tmp := tmp + p^; Inc( p );
533 procedure TEditorForm.SetFont;
535 BodyEdit.Font.Name := GikoSys.Setting.EditorFontName;
536 BodyEdit.Font.Size := GikoSys.Setting.EditorFontSize;
537 BodyEdit.Font.Color := GikoSys.Setting.EditorFontColor;
538 BodyEdit.Color := GikoSys.Setting.EditorBackColor;
541 procedure TEditorForm.Preview;
554 if FThreadItem = nil then begin
556 Title := RepHtml(TitleEdit.Text);
558 No := IntToStr(FThreadItem.Count + 1);
559 Title := RepHtml(FThreadItem.Title);
563 Namae := RepHtml(NameComboBox.Text);
564 Mail := RepHtml(MailComboBox.Text);
565 Body := RepHtml(body);
566 Body := StringReplace(Body, #13#10, '<br>', [rfReplaceAll]);
567 DateTime := FormatDateTime('yyyy/mm/dd(aaa) hh:nn', now);
569 if Trim(Namae) = '' then
570 Namae := '
\96¼
\96³
\82µ
\82³
\82ñ';
572 s := '<HTML><HEAD>' + #13#10
573 + '<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">' + #13#10
574 + '<TITLE>' + title + '</TITLE>' + #13#10
575 // + '<STYLE><!--BODY{font-size : 9pt;font-family : "
\82l
\82r
\82o
\83S
\83V
\83b
\83N";}--></STYLE>' + #13#10
577 + '<BODY text="#000000" bgcolor="#EFEFEF" link="#0000FF" alink="#FF0000" vlink="#660099">' + #13#10
578 + '<FONT COLOR="#FF0000">' + title + '</FONT>' + #13#10
580 posTrip := AnsiPos( '#', Namae );
583 tripOrigin := Copy( Namae, posTrip + 1, Length( Namae ) );
585 Copy( Namae, 1, posTrip - 1 ) + '</B>
\81\9f' +
586 get_2ch_trip( PChar( tripOrigin ) ) + '<B>';
589 s := s + '<DT>' + No + '
\81F <FONT color="forestgreen"><B>' + Namae + '</B></FONT>
\81F ' + DateTime+ '<BR><DD>' + Body + '<BR><BR><BR>' + #13#10
591 s := s + '<DT>' + No + '
\81F <A href="mailto:' + Mail + '"><B>' + Namae + '</B></A> [' + Mail + ']
\81F ' + DateTime+ '<BR><DD>' + Body + '<BR><BR><BR>' + #13#10;
592 s := s + '</BODY></HTML>';
593 SetContent(s, Browser);
596 function TEditorForm.RepHtml(s: string): string;
598 // s := StringReplace(s, '&', '&', [rfReplaceAll]);
599 s := StringReplace(s, '<', '<', [rfReplaceAll]);
600 s := StringReplace(s, '>', '>', [rfReplaceAll]);
601 // s := StringReplace(s, ' ', ' ', [rfReplaceAll]); //
\8ed
\97l
\95Ï
\8dX
\82É
\82æ
\82è
\8eg
\97p
\95s
\89Â
602 s := StringReplace(s, '"', '"', [rfReplaceAll]);
606 procedure TEditorForm.EditorPageChange(Sender: TObject);
610 if FThreadItem = nil then
613 tmpBoard := FThreadItem.ParentBoard;
615 if tmpBoard = nil then Exit;
617 if EditorPage.ActivePage = PreviewTab then begin
619 end else if EditorPage.ActivePage = RocalRuleTab then begin
620 if not FileExists(tmpBoard.GETHEADTXTFileName) then begin
621 LocalEdit.Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\96¢
\8eæ
\93¾';
624 ShowBoardHead(tmpBoard, LocalEdit);
626 Browser.Navigate('about:blank');
630 procedure TEditorForm.BrowserStatusTextChange(Sender: TObject;
631 const Text: WideString);
633 if EditorPage.ActivePage = PreviewTab then begin
634 StatusBar.Panels[0].Text := Text;
636 StatusBar.Panels[0].Text := '';
640 function TEditorForm.Check: Boolean;
647 if FThreadItem = nil then
650 Board := FThreadItem.ParentBoard;
652 if (not GikoSys.Setting.UseMachineTime) and
653 ((Board.LastGetTime = 0) or
654 (Board.LastGetTime = ZERO_DATE)) then begin
655 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
656 + '
\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¢';
657 MsgBox(Handle, Msg, '
\83G
\83\89\81[', MB_OK or MB_ICONSTOP);
659 end else if BodyEdit.Text = '' then begin
660 Msg := '
\96{
\95¶
\82ª
\93ü
\97Í
\82³
\82ê
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B';
661 MsgBox(Handle, Msg, '
\83G
\83\89\81[', MB_OK or MB_ICONSTOP);
663 end else if (FBoard <> nil) and (Trim(TitleEdit.Text) = '') then begin
664 Msg := '
\83^
\83C
\83g
\83\8b\82ª
\93ü
\97Í
\82³
\82ê
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B';
665 MsgBox(Handle, Msg, '
\83G
\83\89\81[', MB_OK or MB_ICONSTOP);
668 if (not GikoSys.Dolib.Connected) and (AnsiPos('
\81\9c', NameComboBox.Text) <> 0) then begin
669 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
670 + '
\82±
\82Ì
\82Ü
\82Ü
\91\97\90M
\82µ
\82Ä
\82à
\82æ
\82ë
\82µ
\82¢
\82Å
\82·
\82©
\81H';
671 rc := MsgBox(Handle, Msg, '
\8am
\94F', MB_YESNO or MB_ICONQUESTION);
672 Result := (rc = IDYES);
677 procedure TEditorForm.FormClose(Sender: TObject; var Action: TCloseAction);
682 procedure TEditorForm.FormDestroy(Sender: TObject);
684 wp: TWindowPlacement;
686 //
\8dÅ
\91å
\89»
\81E
\83E
\83B
\83\93\83h
\83E
\88Ê
\92u
\95Û
\91¶
687 wp.length := sizeof(wp);
688 GetWindowPlacement(Handle, @wp);
690 GikoSys.Setting.EditWindowTop := wp.rcNormalPosition.Top;
691 GikoSys.Setting.EditWindowLeft := wp.rcNormalPosition.Left;
692 GikoSys.Setting.EditWindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
693 GikoSys.Setting.EditWindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
694 GikoSys.Setting.EditWindowMax := WindowState = wsMaximized;
695 //GikoSys.Setting.EditWindowStay := FormStyle = fsStayOnTop; //
\83X
\83e
\83C
\8fó
\91Ô
\82Ì
\95Û
\91¶
696 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked; //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
702 procedure TEditorForm.SetNameList(sName, sMail: string);
704 if SaveNameMailAction.Checked then begin
705 if Trim(sName) <> '' then begin
706 if GikoSys.Setting.NameList.IndexOf(sName) = -1 then
707 GikoSys.Setting.NameList.Insert(0, sName);
709 if Trim(sMail) <> '' then begin
710 if GikoSys.Setting.MailList.IndexOf(sMail) = -1 then
711 GikoSys.Setting.MailList.Insert(0, sMail);
716 function TEditorForm.GetActiveControlHandle: THandle;
718 if EditorPage.ActivePage = EditorTab then begin
719 if ActiveControl = NameComboBox then
720 Result := FNameComboEdit
721 else if ActiveControl = MailComboBox then
722 Result := FMailComboEdit
723 else if ActiveControl = BodyEdit then
724 Result := BodyEdit.Handle
725 else if ActiveControl = TitleEdit then
726 Result := TitleEdit.Handle
729 end else if Editorpage.ActivePage = BoardInformationTab then begin
730 if ActiveControl = BoardInformationMemo then
731 Result := BoardInformationMemo.Handle
738 procedure TEditorForm.SetContent(Content: string; ABrowser: TWebBrowser);
742 if ABrowser.Document <> nil then begin
743 doc := Idispatch( olevariant(ABrowser.ControlInterface).Document) as IHTMLDocument2;
746 doc.charset := 'Shift_JIS';
751 procedure TEditorForm.InitIdHTTP(http: TIdHTTP);
754 http.ProxyParams.BasicAuthentication := False;
755 if GikoSys.Setting.WriteProxy then begin
756 http.ProxyParams.ProxyServer := GikoSys.Setting.WriteProxyAddress;
757 http.ProxyParams.ProxyPort := GikoSys.Setting.WriteProxyPort;
758 http.ProxyParams.ProxyUsername := GikoSys.Setting.WriteProxyUserID;
759 http.ProxyParams.ProxyPassword := GikoSys.Setting.WriteProxyPassword;
760 if GikoSys.Setting.ReadProxyUserID <> '' then
761 http.ProxyParams.BasicAuthentication := True;
763 http.ProxyParams.ProxyServer := '';
764 http.ProxyParams.ProxyPort := 80;
765 http.ProxyParams.ProxyUsername := '';
766 http.ProxyParams.ProxyPassword := '';
768 Indy.Request.UserAgent := GikoSys.GetUserAgent;
769 Indy.Request.AcceptEncoding := '';
772 procedure TEditorForm.Send(SPID: string; PON: string; FirstWriting: Boolean);
774 TextStream: TStringStream;
775 Source: TStringStream;
776 ResponseText: string;
779 State: TGikoDownloadState;
780 ResultType: TGikoResultType;
785 //fusianasan
\83g
\83\89\83b
\83v by
\92è
\8aú
\95Ö
793 Namae := RepHtml(NameComboBox.Text);
794 if FThreadItem = nil then
797 Board := FThreadItem.ParentBoard;
801 if FThreadItem = nil then begin
802 URL := FBoard.GetSendURL;
803 RefURL := GikoSys.UrlToServer(FBoard.URL) + 'test/bbs.cgi';
805 URL := FThreadItem.GetSendURL;
806 RefURL := FThreadItem.URL;
808 // Indy.Request.UserAgent := GikoSys.GetUserAgent;
809 Indy.Request.Referer := RefURL;
810 // Indy.Request.AcceptEncoding := '';
814 Cookie := Cookie + 'SPID=' + SPID + '; ';
816 Cookie := Cookie + 'PON=' + PON + '; ';
817 Cookie := 'Cookie: ' + Cookie + 'NAME=' + NameComboBox.Text + '; MAIL=' + MailComboBox.Text;
819 sysMenu := GetSystemMenu( Handle, false );
820 EnableMenuItem( sysMenu, SC_CLOSE, MF_GRAYED );
822 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
825 Indy.Request.CustomHeaders.Clear;
826 // Indy.Request.CacheControl := 'no-cache';
827 Indy.Request.CustomHeaders.Add('Pragma: no-cache');
828 Indy.Request.AcceptLanguage := 'ja';
829 Indy.Request.Accept := 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
830 Indy.Request.ContentType := 'application/x-www-form-urlencoded';
831 Indy.Request.CustomHeaders.Add(Cookie);
832 TextStream := TStringStream.Create('');
833 Source := TStringStream.Create('');
836 FDebugStrReceive := '';
839 Indy.Post(URL, Source, TextStream);
840 ResponseText := TextStream.DataString;
842 ResultType := GetResultType(ResponseText);
844 //MsgResult
\8f\89\8aú
\89»
846 //
\83t
\83V
\83A
\83i
\83g
\83\89\83b
\83v
\8cx
\8d\90(LocalMode) by
\92è
\8aú
\95Ö
847 if GikoSys.Setting.LocalTrapAtt then begin
848 if LFusianaGet(Namae) then begin
851 '
\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 +
852 '
\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 +
853 '
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
855 MB_YESNO or MB_ICONQUESTION);
856 if MsgResult = IDNO then begin
860 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
865 if ((Namae = '
\8eR
\8dè
\8fÂ') or (Namae = 'fusianasan')) then begin
868 '
\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 +
869 '
\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 +
870 '
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
872 MB_YESNO or MB_ICONQUESTION);
873 if MsgResult = IDNO then begin
877 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
884 if GikoSys.Setting.RemoteTrapAtt then begin
885 if FThreadItem = nil then
888 ABoard := FThreadItem.ParentBoard;
890 if ABoard = nil then Exit;
892 if FileExists(ABoard.GetSETTINGTXTFileName) then begin
893 body := TStringList.Create;
895 body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
896 Remote := GetFusianaName(body, ABoard);
902 //Setting.txt
\82ª
\82È
\82©
\82Á
\82½
\82ç
\8eæ
\93¾
903 //
\8eI
\82É
\95\89\89×
\82ª
\82©
\82©
\82è
\82»
\82¤
\82Å
\95|
\82¢
\81E
\81E
\81E
904 if not FileExists(ABoard.GetSETTINGTXTFileName) then begin
905 GetSETTINGTXTAction.Execute;
906 body := TStringList.Create;
908 body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
909 Remote := GetFusianaName(body, ABoard);
915 if Remote = 'fusianasan' then begin
918 '
\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 +
919 '
\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 +
920 '
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
922 MB_YESNO or MB_ICONQUESTION);
923 if MsgResult = IDNO then begin
927 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
934 if ResultType = grtOK then begin
935 WriteSambaTime(FHost, Now());
936 State := gdsComplete;
937 end else if ResultType = grtCookie then begin
938 //
\83\8b\81[
\83v
\96h
\8e~
939 if not FirstWriting then
940 raise Exception.Create('');
943 '
\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 +
944 '
\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 +
945 '
\91S
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
947 MB_YESNO or MB_ICONQUESTION);
948 if MsgResult = IDYES then begin
949 Board.SPID := GetSPID(Indy.Response.RawHeaders.Values['Set-Cookie']);
950 Board.PON := GetPON(Indy.Response.RawHeaders.Values['Set-Cookie']);
951 if (Board.SPID = '') and (Board.PON = '') then
952 raise Exception.Create('');
953 //
\82à
\82¤
\88ê
\89ñ
\82±
\82Ì
\83\81\83\
\83b
\83h
954 Send(Board.SPID, Board.PON, False);
960 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
964 end else if ResultType = grtCheck then begin
966 //
\83\8b\81[
\83v
\96h
\8e~
967 if not FirstWriting then
968 raise Exception.Create('');
972 '
\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 +
973 '
\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 +
974 '
\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 +
975 '
\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 +
977 '
\91S
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
979 MB_YESNO or MB_ICONQUESTION);
981 if MsgResult = IDYES then begin
982 Board.SPID := GetSPID(Indy.Response.RawHeaders.Values['Set-Cookie']);
983 Board.PON := GetPON(Indy.Response.RawHeaders.Values['Set-Cookie']);
984 if (Board.SPID = '') and (Board.PON = '') then
985 raise Exception.Create('');
986 Send(Board.SPID, Board.PON, False);
989 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
997 WriteSambaTime(FHost, Now());
999 raise Exception.Create('');
1003 on E: EIdConnectException do begin
1005 ResponseText := '<html><body>'
1006 + '<div>
\90Ú
\91±
\82ª
\8e¸
\94s
\82µ
\82Ü
\82µ
\82½<br>'
1007 + '
\89ñ
\90ü
\82â
\83v
\83\8d\83L
\83V
\82Ì
\8fó
\91Ô
\82ð
\92²
\82×
\82Ä
\82
\82¾
\82³
\82¢<br></div>'
1008 + '<br><br><div>' + E.Message + '</div>'
1011 on E: Exception do begin
1014 FDebugStrReceive := AnsiReplaceText(FDebugStrReceive, '<', '<');
1015 FDebugStrReceive := AnsiReplaceText(FDebugStrReceive, '>', '>');
1016 FDebugStrSend := AnsiReplaceText(FDebugStrSend, '<', '<');
1017 FDebugStrSend := AnsiReplaceText(FDebugStrSend, '>', '>');
1019 ResponseText := '<html><body>' + TextStream.DataString;
1020 ResponseText := AnsiReplaceText(ResponseText, '</body>', '');
1021 ResponseText := AnsiReplaceText(ResponseText, '</html>', '');
1022 ResponseText := ResponseText + '<hr><div align="left"><pre>';
1023 ResponseText := ResponseText + '<b>
\82±
\82±
\82©
\82ç
\83M
\83R
\83i
\83r
\82Ì
\8fî
\95ñ</b>'#13#10;
1024 ResponseText := ResponseText + #13#10'
\81\9c\91\97\90M'#13#10;
1025 ResponseText := ResponseText + FDebugStrSend;
1026 ResponseText := ResponseText + #13#10'
\81\9c\8eó
\90M'#13#10;
1027 ResponseText := ResponseText + FDebugStrReceive;
1028 ResponseText := ResponseText + '</pre></div></body></html>';
1031 FStatusCode := Indy.ResponseCode;
1037 //sysMenu := GetSystemMenu( Handle, true );
1038 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
1039 DrawMenuBar(Handle);
1042 //
\94ñ
\8cö
\8e®
\83M
\83R
\83i
\83r
\94Â
\82È
\82Ç
\82Ì
\83X
\83N
\83\8a\83v
\83g
\97p
1043 //ResponceCode
\82ª302Found
\82Å
\8f\91\82«
\8d\9e\82Ý
\8a®
\97¹
1044 if FStatusCode = 302 then begin
1045 GikoForm.PlaySound('ResEnd');
1047 if FThreadItem = nil then
1048 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK)
1050 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
1054 if State = gdsComplete then begin
1055 GikoForm.PlaySound('ResEnd');
1057 if FThreadItem = nil then
1058 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK)
1060 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
1062 end else if State = gdsError then begin
1063 if FThreadItem = nil then
1064 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK)
1066 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
1068 EditorPage.ActivePage := PreviewTab;
1069 SetContent(ResponseText, Browser);
1070 end else if State = gdsAbort then begin
1071 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiSAD);
1075 function TEditorForm.GetResultType(ResponseText: string): TGikoResultType;
1077 if AnsiPos('
\8f\91\82«
\82±
\82Ý
\82ª
\8fI
\82í
\82è
\82Ü
\82µ
\82½', ResponseText) <> 0 then
1079 else if (AnsiPos('
\83N
\83b
\83L
\81[
\82ª
\82È
\82¢
\82©
\8aú
\8cÀ
\90Ø
\82ê
\82Å
\82·', ResponseText) > 0) or
1080 (AnsiPos('<title>
\83N
\83b
\83L
\81[
\8am
\94F
\81I</title>', ResponseText) > 0) or
1081 (AnsiPos('<title>
\81¡
\83N
\83b
\83L
\81[
\8am
\94F
\81I
\81¡</title>', ResponseText) > 0) or
1082 //(AnsiPos('
\83N
\83b
\83L
\81[
\8am
\94F', ResponseText) > 0) or
1083 (AnsiPos(RES2CH_COOKIE, ResponseText) > 0) then
1085 else if (AnsiPos('<font size=+2 color=#FF0000>
\8f\91\82«
\8d\9e\82Ý
\83`
\83F
\83b
\83N
\81I </font>', ResponseText) > 0) or
1086 (AnsiPos('<title>
\81¡
\8f\91\82«
\8d\9e\82Ý
\8am
\94F
\82µ
\82Ü
\82·
\81¡</title>', ResponseText) > 0) or
1087 (AnsiPos('<title>
\93\8a\8de
\8am
\94F</title>', ResponseText) > 0) or
1088 (AnsiPos('<b>
\8f\91\82«
\82±
\82Ý
\8am
\94F</b>', ResponseText) > 0) or
1089 (AnsiPos('="../test/subbbs.cgi">', ResponseText) > 0) or
1090 (AnsiPos(RES2CH_FALSE, ResponseText) > 0) then
1092 else if (AnsiPos('
\81E
\93\8a\8de
\8eÒ
\82Í
\81A
\8cf
\8e¦
\94Â
\89^
\89c
\8eÒ
\82É
\91Î
\82µ
\82Ä
\81A
\92\98\8dì
\8eÒ
\90l
\8ai
\8c \82ð
\88ê
\90Ø
\8ds
\8eg
\82µ
\82È
\82¢
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ü
\82·
\81B<br>', ResponseText) > 0) or
1093 (AnsiPos('
\81i
\92\98\8dì
\8c \96@
\91æ21
\8fð
\82È
\82¢
\82µ
\91æ28
\8fð
\82É
\8bK
\92è
\82³
\82ê
\82é
\8c \97\98\82à
\8aÜ
\82Þ
\81j
\82»
\82Ì
\91¼
\82Ì
\8c \97\98\82É
\82Â
\82«
\81A', ResponseText) > 0) then
1094 Result := grtCookie;
1100 procedure TEditorForm.GetSendData(Source: TStringStream);
1109 if FThreadItem = nil then
1112 Board := FThreadItem.ParentBoard;
1114 if GikoSys.Setting.UseMachineTime then begin
1115 if GikoSys.Setting.TimeAdjust then
1116 Adjust := Gikosys.Setting.TimeAdjustSec
1118 Adjust := GikoSys.Setting.TimeAdjustSec * -1;
1119 SendTime := GikoSys.DateTimeToInt(Now) - (9 * 60 * 60) + Adjust
1121 if (Board.LastGetTime = 0) or (Board.LastGetTime = ZERO_DATE) then
1122 SendTime := GikoSys.DateTimeToInt(Now)
1124 SendTime := GikoSys.DateTimeToInt(Board.LastGetTime);
1129 SessionID := GikoSys.Dolib.SessionID;
1130 if SessionID <> '' then
1131 s := 'sid=' + HttpEncode(SessionID) + '&'
1134 s := s + 'subject=&'
1135 + 'FROM=' + HttpEncode(NameComboBox.Text) + '&'
1136 + 'mail=' + HttpEncode(MailComboBox.Text) + '&'
1137 + 'MESSAGE=' + HttpEncode(body) + '&'
1138 + 'bbs=' + Board.BBSID + '&'
1139 + 'time=' + IntToStr(SendTime) + '&';
1140 if FThreadItem = nil then begin
1141 s := s + 'subject=' + HttpEncode(TitleEdit.Text) + '&';
1142 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;
1144 s := s + 'key=' + ChangeFileExt(FThreadItem.FileName, '') + '&';
1145 s := s + 'submit=' + HttpEncode('
\8f\91\82«
\8d\9e\82Þ') + #13#10;
1147 Source.WriteString(s);
1150 procedure TEditorForm.SaveSendFile;
1155 ini := TMemIniFile.Create(GikoSys.GetSentFileName);
1157 sDate := IntToStr(GikoSys.DateTimeToInt(Now));
1159 ini.WriteString(sDate, 'Name', NameComboBox.Text);
1160 ini.WriteString(sDate, 'EMail', MailComboBox.Text);
1161 ini.WriteString(sDate, 'Body', HttpEncode(BodyEdit.Text));
1162 ini.WriteInteger(sDate, 'Status', FStatusCode);
1163 ini.WriteDateTime(sDate, 'Date', Now);
1164 if FThreadItem = nil then begin
1165 ini.WriteString(sDate, 'Title', TitleEdit.Text);
1166 ini.WriteString(sDate, 'BBS', FBoard.BBSID);
1167 ini.WriteInteger(sDate, 'NewThread', 1);
1169 ini.WriteString(sDate, 'Title', FThreadItem.Title);
1170 ini.WriteString(sDate, 'BBS', FThreadItem.ParentBoard.BBSID);
1171 ini.WriteString(sDate, 'Key', ChangeFileExt(FThreadItem.FileName, ''));
1180 procedure TEditorForm.SendActionExecute(Sender: TObject);
1185 state : TGikoDownloadState;
1192 SendAction.Enabled := False;
1193 Application.ProcessMessages;
1194 if not Check then Exit;
1196 if FThreadItem = nil then
1199 Board := FThreadItem.ParentBoard;
1201 if FThreadItem = nil then begin
1202 rc := GikoUtil.MsgBox(Handle,
1203 '
\81u' + Board.Title + '
\81v
\94Â
\82É
\90V
\82µ
\82¢
\83X
\83\8c\83b
\83h
\97§
\82Ä
\82Ü
\82·'#13#10#13#10
1204 + '
\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
1205 + '
\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
1206 + '
\81u
\82Í
\82¢
\81v
\82ð
\89\9f\82·
\82Æ
\91\97\90M
\82µ
\82Ü
\82·',
1208 MB_ICONQUESTION or MB_YESNO);
1209 if rc <> ID_YES then
1213 SetNameList(NameComboBox.Text, MailComboBox.Text);
1214 if (KotehanCheckBox.Enabled) and (KotehanCheckBox.Checked) then begin
1215 Board.KotehanName := NameComboBox.Text;
1216 Board.KotehanMail := MailComboBox.Text;
1219 if Board.IsBoardPlugInAvailable then begin
1222 if FThreadItem = nil then begin
1223 //
\83X
\83\8c\97§
\82Ä
1224 state := TGikoDownloadState( Board.BoardPlugIn.CreateThread(
1225 DWORD( Board ), TitleEdit.Text, NameComboBox.Text, MailComboBox.Text, body ) );
1227 if state = gdsComplete then begin
1228 GikoForm.PlaySound('ResEnd');
1230 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK);
1233 end else if State = gdsError then begin
1234 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureError)), nil, gmiNG);
1235 end else if State = gdsAbort then begin
1236 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiNG);
1240 state := TGikoDownloadState( FThreadItem.BoardPlugIn.WriteThread(
1241 DWORD( FThreadItem ), NameComboBox.Text, MailComboBox.Text, body ) );
1243 if state = gdsComplete then begin
1244 GikoForm.PlaySound('ResEnd');
1246 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
1249 end else if State = gdsError then begin
1250 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmResError)), nil, gmiOK);
1251 end else if State = gdsAbort then begin
1252 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiOK);
1256 if not Timer1.Enabled then
1257 Send(Board.SPID, Board.PON, True)
1259 if not CheckSambaTime(FHost, Now()) then begin
1260 rc := GikoUtil.MsgBox(Handle,
1261 '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
1262 + '
\91\97\90M
\82ð
\92\86\8e~
\82µ
\82Ü
\82·
\82©
\81H' + #13#10
1263 + '(
\81u
\82¢
\82¢
\82¦
\81v
\82¾
\82Æ
\91\97\90M
\82µ
\82Ü
\82·)', 'Samba24
\8cx
\8d\90',
1264 MB_YESNO or MB_ICONQUESTION);
1265 if rc = IDYES then begin
1269 if rc = IDNO then begin
1270 rc2 := GikoUtil.MsgBox(Handle,
1271 '
\96{
\93\96\82É
\91\97\90M
\82µ
\82Ü
\82·
\82©
\81H',
1272 'Sumba24
\8cx
\8d\90',
1273 MB_YESNO or MB_ICONQUESTION);
1274 if rc2 = IDNO then begin
1280 Send(Board.SPID, Board.PON, True);
1285 if Timer1.Enabled then
1286 ReadSambaTime(FHost);
1290 procedure TEditorForm.SaveActionExecute(Sender: TObject);
1295 procedure TEditorForm.CloseActionExecute(Sender: TObject);
1300 procedure TEditorForm.UndoActionExecute(Sender: TObject);
1302 SendMessage(GetActiveControlHandle, WM_UNDO, 0, 0);
1305 procedure TEditorForm.CutActionExecute(Sender: TObject);
1307 SendMessage(GetActiveControlHandle, WM_CUT, 0, 0);
1310 procedure TEditorForm.CopyActionExecute(Sender: TObject);
1312 SendMessage(GetActiveControlHandle, WM_COPY, 0, 0);
1315 procedure TEditorForm.PasteActionExecute(Sender: TObject);
1317 SendMessage(GetActiveControlHandle, WM_PASTE, 0, 0);
1320 procedure TEditorForm.SelectAllActionExecute(Sender: TObject);
1322 SendMessage(GetActiveControlHandle, EM_SETSEL, 0, GetWindowTextLength(GetActiveControlHandle));
1325 procedure TEditorForm.TopActionExecute(Sender: TObject); //
\83E
\83B
\83\93\83h
\83E
\8dÅ
\91O
\96Ê(Stay)
\83{
\83^
\83\93\82Ì
\8f\88\97\9d
1327 if not (fsShowing in Self.FormState) then begin
1328 if TopAction.Checked then begin //
\83X
\83e
\83C
\8fó
\91Ô
\82É
\90Ý
\92è
1329 SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
1330 GikoSys.Setting.EditWindowStay := true;
1331 end else begin //
\83X
\83e
\83C
\8fó
\91Ô
\89ð
\8f\9c
1332 SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
1333 GikoSys.Setting.EditWindowStay := false;
1335 //
\83X
\83e
\83C
\8fó
\91Ô
\82Ì
\95Û
\91¶
1336 //GikoSys.Setting.EditWindowStay := FormStyle = fsStayOnTop;
1340 procedure TEditorForm.AbortActionExecute(Sender: TObject);
1345 procedure TEditorForm.SendActionUpdate(Sender: TObject);
1347 SendAction.Enabled := not FWork;
1350 procedure TEditorForm.SaveActionUpdate(Sender: TObject);
1352 SaveAction.Enabled := False;
1355 procedure TEditorForm.CloseActionUpdate(Sender: TObject);
1357 CloseAction.Enabled := not FWork;
1360 procedure TEditorForm.UndoActionUpdate(Sender: TObject);
1362 UndoAction.Enabled := (GetActiveControlHandle <> 0)
1363 and (SendMessage(GetActiveControlHandle, EM_CANUNDO, 0, 0) <> 0)
1367 procedure TEditorForm.CutActionUpdate(Sender: TObject);
1369 Selection: TSelection;
1372 AHandle := GetActiveControlHandle;
1373 SendMessage(AHandle, EM_GETSEL, Longint(@Selection.StartPos), Longint(@Selection.EndPos));
1374 CutAction.Enabled := (AHandle <> 0)
1375 and ((Selection.EndPos - Selection.StartPos) <> 0)
1379 procedure TEditorForm.CopyActionUpdate(Sender: TObject);
1381 Selection: TSelection;
1384 AHandle := GetActiveControlHandle;
1385 SendMessage(AHandle, EM_GETSEL, Longint(@Selection.StartPos), Longint(@Selection.EndPos));
1386 CopyAction.Enabled := (AHandle <> 0)
1387 and ((Selection.EndPos - Selection.StartPos) <> 0)
1391 procedure TEditorForm.PasteActionUpdate(Sender: TObject);
1393 PasteAction.Enabled := (GetActiveControlHandle <> 0)
1394 and (Clipboard.HasFormat(CF_TEXT))
1398 procedure TEditorForm.TopActionUpdate(Sender: TObject);
1400 TopAction.Enabled := not FWork;
1403 procedure TEditorForm.SageCheckBoxClick(Sender: TObject);
1405 if SageCheckBox.Checked then begin
1406 if AnsiPos('sage', MailComboBox.Text) = 0 then
1407 MailComboBox.Text := 'sage' + MailComboBox.Text;
1409 if AnsiPos('sage', MailComboBox.Text) <> 0 then
1410 MailComboBox.Text := StringReplace(MailComboBox.Text, 'sage', '', [rfReplaceAll]);
1414 procedure TEditorForm.MailComboBoxChange(Sender: TObject);
1416 if AnsiPos('sage', MailComboBox.Text) = 0 then
1417 SageCheckBox.Checked := False
1419 SageCheckBox.Checked := True;
1423 function TEditorForm.GetSPID(CookieLine: string): string;
1431 s := Trim(GikoSys.GetTokenIndex(CookieLine, ';', i));
1435 if Pos('SPID=', s) = 1 then begin
1436 Result := Trim(Copy(s, 6, Length(s)));
1444 function TEditorForm.GetPON(CookieLine: string): string;
1452 s := Trim(GikoSys.GetTokenIndex(CookieLine, ';', i));
1456 if Pos('PON=', s) = 1 then begin
1457 Result := Trim(Copy(s, 5, Length(s)));
1465 procedure TEditorForm.IdLogDebugReceive(ASender: TIdConnectionIntercept;
1468 StringStream: TStringStream;
1470 StringStream := TStringStream.Create('');
1472 StringStream.CopyFrom(AStream, AStream.Size);
1473 FDebugStrReceive := FDebugStrReceive + StringStream.DataString;
1479 procedure TEditorForm.IdLogDebugSend(ASender: TIdConnectionIntercept;
1482 StringStream: TStringStream;
1484 StringStream := TStringStream.Create('');
1486 StringStream.CopyFrom(AStream, AStream.Size);
1487 FDebugStrSend := FDebugStrSend + StringStream.DataString;
1493 procedure TEditorForm.TransActionExecute(Sender: TObject);
1495 AlphaBlend := TransAction.Checked;
1496 //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
1497 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked;
1500 procedure TEditorForm.TransActionUpdate(Sender: TObject);
1502 TransAction.Enabled := not FWork;
1504 //StatusBar
\82ÌPanels[0]
\82Ì
\95\9d\82ð
\89Â
\95Ï
\81B
\8ec
\82è
\82ð
\8cÅ
\92è
\82É
\82·
\82é
1505 procedure TEditorForm.StatusBarResize(Sender: TObject);
1507 StatusBar.Panels[0].Width := StatusBar.Width
1508 - StatusBar.Panels[1].Width - StatusBar.Panels[2].Width;
1512 procedure TEditorForm.Timer1Timer(Sender: TObject);
1514 if FSambaTime = ZERO_DATE then
1515 StatusBar.Panels[1].Text := '
\8f\89\8f\91'
1517 FNow := IncMilliSecond(FNow, 500);
1518 StatusBar.Panels[1].Text := Format('%8.0f
\95b
\8co
\89ß', [SecondSpan(FNow, FSambaTime)]);
1522 //Samba.ini
\82Ì
\8f\91\82«
\8d\9e\82Ý
\8e\9e\8aÔ
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
1523 procedure TEditorForm.ReadSambaTime(const AHost: string);
1528 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
1529 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
1531 //
\95¶
\8e\9a\97ñ
\82Å
\93Ç
\82Ý
\8eæ
\82Á
\82Ä
\81A
\95Ï
\8a·
\8aÖ
\90\94\82ÅTDateTime
\82Ö
1532 tmp := ini.ReadString('Send', AHost, DateTimeToStr(ZERO_DATE));
1533 FSambaTime := ConvertDateTimeString(tmp);
1537 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
1538 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
1540 //Samba.ini
\82É
\8dÅ
\8fI
\8f\91\82«
\8d\9e\82Ý
\8e\9e\8aÔ
\82ð
\8f\91\82«
\8d\9e\82Þ
1541 procedure TEditorForm.WriteSambaTime(const AHost: string; ATime: TDateTime);
1545 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
1547 ini.WriteDateTime('Send', AHost, ATime);
1553 //
\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
1554 function TEditorForm.CheckSambaTime(const AHost: string; ATime: TDateTime): Boolean;
1557 SettingTime: Integer;
1559 SettingTime := ReadSettingTime(AHost);
1560 ReadSambaTime(AHost);
1561 pastsec := SecondSpan(ATime, FSambaTime);
1562 if pastsec > SettingTime then
1567 //AHost
\81i
\8eI
\96¼
\81j
\82ÌSamba
\82Ì
\8bK
\92è
\92l
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
1568 function TEditorForm.ReadSettingTime(const AHost: string): Integer;
1572 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
1574 Result := ini.ReadInteger('Setting', AHost, 0);
1575 //
\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
1576 if Result = 0 then begin
1577 ini.WriteInteger('Setting', AHost, 0);
1584 //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Þ
1585 procedure TEditorForm.FormActivate(Sender: TObject);
1587 if ( Timer1.Enabled ) and ( FThreadItem <> nil )then
1588 ReadSambaTime(FHost);
1589 if GikoSys.Setting.GestureEnabled then begin
1590 MouseGesture.UnHook;
1591 MouseGesture.OnGestureStart := OnGestureStart;
1592 MouseGesture.OnGestureMove := OnGestureMove;
1593 MouseGesture.OnGestureEnd := OnGestureEnd;
1594 MouseGesture.SetHook( Handle );
1597 //Samba24
\91Î
\8dô
\82ð
\8eg
\82¤
\82©
\82Ç
\82¤
\82©
\8c\88\82ß
\82é
\8aÖ
\90\94
1598 //ReadSambaTime
\82ð
\8cÄ
\82Ñ
\8fo
\82·
\82ÆTimer
\82ªOn
\82É
\82È
\82é
1599 procedure TEditorForm.SetSamba24(AURL: string);
1601 Protocol, Host, Path, Document, Port, Bookmark : string;
1603 //Samba24
\91Î
\8dô
\82ð
\82µ
\82È
\82¢
\82È
\82ç
\8fI
\97¹
1604 if not GikoSys.Setting.UseSamba then
1606 //Host
\82ÌURL
\82É'.2ch.'
\82©'.bbspink.'
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82½
\82çSamba24
\91Î
\8dô
\82ð
\82·
\82é
1607 GikoSys.ParseURI( AURL, Protocol,Host, Path, Document, Port, Bookmark );
1608 if GikoSys.Is2chHost(Host) then begin
1609 Host := Copy(Host, 1, AnsiPos('.', Host) - 1);
1610 FHost := Host; //FHost=
\8eI
\96¼
1611 ReadSambaTime(FHost); //
\88È
\91O
\82Ì
\8f\91\82«
\8d\9e\82Ý
\8e\9e\8aÔ
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
1612 //StatusBar
\82É
\82±
\82Ì
\8eI
\82Ì
\8bK
\92è
\92l
\82ð
\95\
\8e¦
\82·
\82é
1613 StatusBar.Panels[2].Text := 'Samba24
\8bK
\92è
\92l' + IntToStr(ReadSettingTime(FHost));
1616 procedure TEditorForm.FormCloseQuery(Sender: TObject;
1617 var CanClose: Boolean);
1619 CanClose := not FWork;
1622 function TEditorForm.GetOEIndentChar : string;
1625 Identities : string;
1628 DEFAULT_CHAR = '> ';
1629 OE_MAIL_PATH = '\Software\Microsoft\Outlook Express\5.0\Mail';
1630 INDENT_CHAR = 'Indent Char';
1633 Result := DEFAULT_CHAR;
1634 regKey := TRegistry.Create;
1637 regKey.RootKey := HKEY_CURRENT_USER;
1638 if not regKey.OpenKey( 'Identities', False ) then
1640 Identities := regKey.ReadString( 'Default User ID' );
1641 if Identities = '' then
1643 if not regKey.OpenKey( Identities + OE_MAIL_PATH, False ) then
1645 IndentChar := regKey.ReadInteger( INDENT_CHAR );
1646 Result := Char( IndentChar ) + ' ';
1655 procedure TEditorForm.QuotePasteActionExecute(Sender: TObject);
1662 quote := GetOEIndentChar;
1663 s := TStringList.Create;
1665 s.Text := Clipboard.AsText;
1667 for i := s.Count - 1 downto 0 do
1668 s[ i ] := quote + s[ i ];
1670 BodyEdit.SelText := s.Text;
1677 procedure TEditorForm.SpaceToNBSPActionExecute(Sender: TObject);
1679 GikoSys.Setting.SpaceToNBSP := SpaceToNBSPAction.Checked;
1680 if EditorPage.ActivePage = PreviewTab then
1684 procedure TEditorForm.AmpToCharRefActionExecute(Sender: TObject);
1686 GikoSys.Setting.AmpToCharRef := AmpToCharRefAction.Checked;
1687 if EditorPage.ActivePage = PreviewTab then
1691 procedure TEditorForm.BoardTopClick(Sender: TObject);
1695 ini := TIniFile.Create(GikoSys.Setting.GetFileName);
1697 BoardtopTab.TabVisible := BoardTop.Checked;
1698 ini.WriteBool('EditorForm', 'BoardTopTab', BoardtopTab.TabVisible);
1705 procedure TEditorForm.GetSETTINGTXTActionExecute(Sender: TObject);
1707 URL, RefURL: string;
1708 settingBody: TStringList;
1712 if FThreadItem = nil then
1715 tmpBoard := FThreadItem.ParentBoard;
1717 if tmpBoard = nil then Exit;
1719 RefURL := tmpBoard.URL;
1720 if RefURL[Length(RefURL)] <> '/' then
1721 URL := RefURL + '/' + 'SETTING.TXT'
1723 URL := RefURL + 'SETTING.TXT';
1725 Indy.Request.LastModified := tmpBoard.SETTINGTXTTime;
1726 Indy.Request.Referer := RefURL;
1727 Screen.Cursor := crHourGlass;
1728 settingBody := TStringList.Create;
1730 StatusBar.Panels[0].Text := 'SETTING.TXT
\83_
\83E
\83\93\83\8d\81[
\83h
\92\86';
1732 settingBody.Text := Indy.Get(URL);
1733 if( Indy.ResponseCode = 200 ) then begin
1734 settingBody.SaveToFile(tmpBoard.GetSETTINGTXTFileName);
1735 tmpBoard.SETTINGTXTTime := Indy.Response.LastModified;
1736 tmpBoard.IsSETTINGTXT := true;
1737 tmpBoard.TitlePictureURL := GetTitlePictureURL(settingBody, tmpBoard);
1738 tmpBoard.Modified := true;
1739 StatusBar.Panels[0].Text := 'SETTING.TXT
\8eæ
\93¾
\8a®
\97¹(' + IntToStr(Indy.ResponseCode) + ')';
1742 on E: EIdException do begin
1743 if( AnsiPos('304', E.Message) > 0 ) then
1744 StatusBar.Panels[0].Text := 'SETTING.TXT
\8dX
\90V
\96³
\82µ(' + IntToStr(Indy.ResponseCode) + ')'
1746 StatusBar.Panels[0].Text := 'SETTING.TXT
\8eæ
\93¾
\83G
\83\89\81[(' + IntToStr(Indy.ResponseCode) + ')';
1751 Screen.Cursor := crDefault;
1753 ShowBoardInformation(tmpBoard, BoardInformationMemo);
1756 procedure TEditorForm.ShowBoardInformation(ABoard: TBoard; AMemo: TMemo);
1761 AMemo.Lines.Add('[SETTING.TXT]');
1762 if ABoard.IsSETTINGTXT then begin
1763 if FileExists(ABoard.GetSETTINGTXTFileName) then begin
1764 AMemo.Lines.Add(DateTimeToStr(ABoard.SETTINGTXTTime) + '
\8dX
\90V');
1765 body := TStringList.Create;
1767 body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
1768 AMemo.Lines.AddStrings(body);
1773 ABoard.IsSETTINGTXT := false;
1774 ABoard.SETTINGTXTTime := ZERO_DATE;
1775 AMemo.Lines.Add('Local
\82É
\95Û
\91¶
\82³
\82ê
\82½SETTING.TXT
\82ª
\8c©
\82Â
\82©
\82è
\82Ü
\82¹
\82ñ');
1776 AMemo.Lines.Add('
\83\81\83j
\83\85\81[
\82æ
\82è
\8dÄ
\8eæ
\93¾
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B');
1779 AMemo.Lines.Add('SETTING.TXT
\82ð
\8eæ
\93¾
\82µ
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B');
1780 AMemo.Lines.Add('
\83\81\83j
\83\85\81[
\82æ
\82è
\8eæ
\93¾
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B');
1783 function TEditorForm.GetTitlePictureURL(body: TStringList; ABoard: TBoard): string;
1784 //BBS_TITLE_PICTURE=
1791 for i := 0 to body.Count - 1 do begin
1792 if (AnsiPos('BBS_TITLE_PICTURE=', body[i]) > 0) or
1793 (AnsiPos('BBS_FIGUREHEAD=', body[i]) > 0) then begin
1795 Delete(tmp, 1, AnsiPos('=', tmp));
1796 if AnsiPos('../', tmp) > 0 then begin
1797 tmp := CustomStringReplace(tmp, '../', GikoSys.UrlToServer(ABoard.URL));
1805 procedure TEditorForm.GetTitlePictureActionUpdate(Sender: TObject);
1807 if FThreadItem = nil then
1808 GetTitlePictureAction.Enabled := FBoard.IsSETTINGTXT
1810 GetTitlePictureAction.Enabled := FThreadItem.ParentBoard.IsSETTINGTXT;
1814 procedure TEditorForm.GetTitlePictureActionExecute(Sender: TObject);
1816 memStream: TMemoryStream;
1820 memStream := TMemoryStream.Create;
1822 if FThreadItem = nil then
1825 tmpBoard := FThreadItem.ParentBoard;
1827 Indy.Request.Referer := tmpBoard.URL;
1828 if tmpBoard.TitlePictureURL <> '' then begin
1829 StatusBar.Panels[0].Text := '
\94Â
\83g
\83b
\83v
\89æ
\91\9c\83_
\83E
\83\93\83\8d\81[
\83h
\92\86';
1830 Screen.Cursor := crHourGlass;
1832 Indy.Get(tmpBoard.TitlePictureURL, memStream);
1833 if Indy.ResponseCode = 200 then begin
1834 memStream.SaveToFile(tmpBoard.GetTitlePictureFileName);
1836 tmpBoard.Modified := true;
1842 Screen.Cursor := crDefault;
1843 StatusBar.Panels[0].Text := '
\94Â
\83g
\83b
\83v
\89æ
\91\9c (' + IntToStr(Indy.ResponseCode) + ')';
1848 procedure TEditorForm.ShowTitlePicture();
1853 if FThreadItem = nil then
1856 tmpBoard := FThreadItem.ParentBoard;
1858 if FileExists(tmpBoard.GetTitlePictureFileName) then begin
1859 TitlePictureBrowser.Navigate(tmpBoard.GetTitlePictureFileName);
1861 s := '
\94Â
\83g
\83b
\83v
\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';
1862 SetContent(s, TitlePictureBrowser);
1866 function TEditorForm.GetFusianaName(body: TStringList; ABoard: TBoard): String;
1871 for i := 0 to body.Count - 1 do begin
1872 if (AnsiPos('BBS_NONAME_NAME=', body[i]) > 0) then begin
1874 Delete(tmp, 1, AnsiPos('=', tmp));
1881 procedure TEditorForm.GetHeadTXTActionExecute(Sender: TObject);
1883 URL, RefURL: string;
1884 settingBody: TStringList;
1888 if FThreadItem = nil then
1891 tmpBoard := FThreadItem.ParentBoard;
1893 if tmpBoard = nil then Exit;
1895 RefURL := tmpBoard.URL;
1896 if RefURL[Length(RefURL)] <> '/' then
1897 URL := RefURL + '/' + 'head.txt'
1899 URL := RefURL + 'head.txt';
1901 if FileExists(tmpBoard.GETHEADTXTFileName) then
1902 Indy.Request.LastModified := tmpBoard.HEADTXTTime
1904 Indy.Request.LastModified := ZERO_DATE;
1906 Indy.Request.Referer := RefURL;
1907 Screen.Cursor := crHourGlass;
1908 settingBody := TStringList.Create;
1910 StatusBar.Panels[0].Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b(head.txt)
\83_
\83E
\83\93\83\8d\81[
\83h
\92\86';
1912 settingBody.Text := Indy.Get(URL);
1913 if( Indy.ResponseCode = 200 ) then begin
1914 settingBody.Insert(0, '<HTML lang="ja"><HEAD>');
1915 settingBody.Insert(1, '<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">');
1916 settingBody.Insert(2, '<TITLE>' + tmpBoard.Title + '</TITLE>');
1917 settingBody.Insert(3, '<base href="' + RefURL + '"></HEAD><BODY>');
1918 settingBody.Add('</BODY></HTML>');
1919 settingBody.SaveToFile(tmpBoard.GETHEADTXTFileName);
1920 tmpBoard.HEADTXTTime := Indy.Response.LastModified;
1921 tmpBoard.IsHEADTXT := true;
1922 tmpBoard.Modified := true;
1923 StatusBar.Panels[0].Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\8eæ
\93¾
\8a®
\97¹(' + IntToStr(Indy.ResponseCode) + ')';
1926 on E: EIdException do begin
1927 if( AnsiPos('304', E.Message) > 0 ) then
1928 StatusBar.Panels[0].Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\8dX
\90V
\96³
\82µ(' + IntToStr(Indy.ResponseCode) + ')'
1930 StatusBar.Panels[0].Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\8eæ
\93¾
\83G
\83\89\81[(' + IntToStr(Indy.ResponseCode) + ')';
1935 Screen.Cursor := crDefault;
1937 if tmpBoard.IsHEADTXT then begin
1938 ShowBoardHead(tmpboard, LocalEdit);
1943 procedure TEditorForm.CalcCapacityActionExecute(Sender: TObject);
1949 //
\82Ç
\82¤
\82à
\81A
\89ü
\8ds
\95ª
\82¸
\82ê
\82Ä
\82½
\82Á
\82Û
\82¢
\82¯
\82Ç
\81A
\96{
\93\96\82©
\82æ
\82
\95ª
\82©
\82ç
\82È
\82¢
\81B
1950 if FThreadItem = nil then
1953 Board := FThreadItem.ParentBoard;
1955 if Board.BoardPlugIn <> nil then
1956 body := CustomStringReplace(body, #13#10, '<br>')
1958 body := CustomStringReplace(body, #13#10, ' <br> ');
1959 StatusBar.Panels[0].Text := '
\97e
\97Ê:' + IntToStr(Length(body)) + ' byte';
1962 procedure TEditorForm.LocalRuleClick(Sender: TObject);
1966 ini := TIniFile.Create(GikoSys.Setting.GetFileName);
1968 RocalRuleTab.TabVisible := LocalRule.Checked;
1969 ini.WriteBool('EditorForm', 'LocalRuleTab', RocalRuleTab.TabVisible);
1975 procedure TEditorForm.FormDeactivate(Sender: TObject);
1977 if GikoSys.Setting.GestureEnabled then begin
1978 MouseGesture.UnHook;
1979 MouseGesture.SetHook( GikoForm.Handle );
1983 procedure TEditorForm.OnGestureStart(Sender: TObject);
1988 procedure TEditorForm.OnGestureMove(Sender: TObject);
1994 s := MouseGesture.GetGestureStr;
1996 Action := FGestures.GetGestureAction(s);
1997 if Action <> nil then
1998 ActStr := '
\81i' + Action.Caption + '
\81j';
1999 s := '
\83W
\83F
\83X
\83`
\83\83\81[: ' + s + ActStr;
2000 StatusBar.Panels[0].Text := s;
2003 procedure TEditorForm.OnGestureEnd(Sender: TObject);
2008 s := MouseGesture.GetGestureStr;
2009 Action := FGestures.GetGestureAction(s);
2010 if Action <> nil then
2012 StatusBar.Panels[0].Text := '';
2015 procedure TEditorForm.ShowBoardHead(ABoard: TBoard; AMemo: TMemo);
2017 wDoc, WTex, le: OLEVariant;
2020 //http://www.campus.ne.jp/~ishigami/CREATION/TECHNIC/WEBAP-2.htm
2021 WebBrowser1.Navigate(ABoard.GETHEADTXTFileName,le,le,le,le);
2022 //
\83\8c\83^
\83\8a\83\93\83O
\82ª
\92x
\82·
\82¬
\82ÄTXT
\82É
\88Ú
\82¹
\82È
\82¢
\81B
\82Ê
\82é
\82Ûorz
2023 //
\89º
\82Ì
\82æ
\82¤
\82É
\82¿
\82á
\82ñ
\82Æ
\93Ç
\82Ý
\8d\9e\82Ý
\82ª
\8fI
\82í
\82Á
\82Ä
\82¢
\82é
\82©
\81A
\83`
\83F
\83b
\83N
\82·
\82ê
\82Î
\82¢
\82¢
\82ñ
\82¾
\82æ
\81B
2024 //
\82±
\82ê
\82Å
\82¢
\82¯
\82Ü
\82µ
\82½
\81B
\82 \82è
\82ª
\82Æ
\82¤
\82²
\82´
\82¢
\82Ü
\82µ
\82½
\81B
2025 while (WebBrowser1.ReadyState <> READYSTATE_COMPLETE) and
2026 (WebBrowser1.ReadyState <> READYSTATE_INTERACTIVE) do begin
2027 Application.ProcessMessages;
2029 wDoc := WebBrowser1.Document;
2030 wTex := wDoc.body.createTextRange;
2031 LocalEdit.Text := wTex.text;
2034 procedure TEditorForm.LocalRuleBrowseClick(Sender: TObject);
2039 if FThreadItem = nil then
2042 ABoard := FThreadItem.ParentBoard;
2044 if ABoard = nil then Exit;
2046 URL := ABoard.GETHEADTXTFileName;
2047 GikoSys.OpenBrowser(URL, gbtAuto);
2050 procedure TEditorForm.SaveNameMailActionExecute(Sender: TObject);
2052 SaveNameMailAction.Checked := not SaveNameMailAction.Checked;
2053 KotehanCheckBox.Enabled := SaveNameMailAction.Checked;
2056 function TEditorForm.LFusianaGet(s: String): Boolean;
2060 i := AnsiPos('fusianasan', s);
2061 if (i > 0) then Result := True else Result := False;