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, 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;
125 ToolButton7: TToolButton;
126 BeLogInOutEAction: TAction;
128 procedure EditorPageChange(Sender: TObject);
129 procedure FormCreate(Sender: TObject);
130 procedure BrowserStatusTextChange(Sender: TObject;
131 const Text: WideString);
132 procedure FormClose(Sender: TObject; var Action: TCloseAction);
133 procedure FormDestroy(Sender: TObject);
134 procedure SendActionExecute(Sender: TObject);
135 procedure SaveActionExecute(Sender: TObject);
136 procedure AbortActionExecute(Sender: TObject);
137 procedure CloseActionExecute(Sender: TObject);
138 procedure UndoActionExecute(Sender: TObject);
139 procedure CutActionExecute(Sender: TObject);
140 procedure CopyActionExecute(Sender: TObject);
141 procedure PasteActionExecute(Sender: TObject);
142 procedure SendActionUpdate(Sender: TObject);
143 procedure SaveActionUpdate(Sender: TObject);
144 procedure CloseActionUpdate(Sender: TObject);
145 procedure UndoActionUpdate(Sender: TObject);
146 procedure CutActionUpdate(Sender: TObject);
147 procedure CopyActionUpdate(Sender: TObject);
148 procedure PasteActionUpdate(Sender: TObject);
149 procedure TopActionExecute(Sender: TObject);
150 procedure TopActionUpdate(Sender: TObject);
151 procedure SageCheckBoxClick(Sender: TObject);
152 procedure MailComboBoxChange(Sender: TObject);
153 procedure TransActionExecute(Sender: TObject);
154 procedure TransActionUpdate(Sender: TObject);
155 procedure IdLogDebugReceive(ASender: TIdConnectionIntercept;
157 procedure IdLogDebugSend(ASender: TIdConnectionIntercept;
159 procedure SelectAllActionExecute(Sender: TObject);
160 procedure StatusBarResize(Sender: TObject);
161 procedure Timer1Timer(Sender: TObject);
162 procedure FormActivate(Sender: TObject);
163 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
164 procedure QuotePasteActionExecute(Sender: TObject);
165 procedure SpaceToNBSPActionExecute(Sender: TObject);
166 procedure AmpToCharRefActionExecute(Sender: TObject);
167 procedure BoardTopClick(Sender: TObject);
168 procedure GetSETTINGTXTActionExecute(Sender: TObject);
169 procedure GetTitlePictureActionUpdate(Sender: TObject);
170 procedure GetTitlePictureActionExecute(Sender: TObject);
171 procedure GetHeadTXTActionExecute(Sender: TObject);
172 procedure CalcCapacityActionExecute(Sender: TObject);
173 procedure LocalRuleClick(Sender: TObject);
174 procedure FormDeactivate(Sender: TObject);
175 procedure LocalRuleBrowseClick(Sender: TObject);
176 procedure SaveNameMailActionExecute(Sender: TObject);
177 procedure BeLogInOutEActionExecute(Sender: TObject);
178 procedure BeLogInOutEActionUpdate(Sender: TObject);
180 FThreadItem: TThreadItem;
182 FNameComboEdit: THandle;
183 FMailComboEdit: THandle;
186 FStatusCode: Integer;
187 FDebugStrReceive: string;
188 FDebugStrSend: string;
189 FSambaTime: TDateTime;
192 FGestures : TMouseGesture;
194 function RepHtml(s: string): string;
195 function Check: Boolean;
196 procedure SetNameList(sName, sMail: string);
197 // procedure Send(SendType: TGikoSendType; SPID: string; PON: string; FirstWriting: Boolean);
198 // procedure Send(SPID: string; PON: string; FirstWriting: Boolean);
199 procedure Send(ACOOKIE: string; SPID: string; PON: string; FirstWriting: Boolean);
201 function GetActiveControlHandle: THandle;
202 // function GetSendData: string;
203 // procedure GetSendData(Source: TStringStream);
204 procedure GetSendData(Source: TStringStream);
205 procedure SaveSendFile;
206 procedure SetContent(Content: string; ABrowser: TWebBrowser);
207 function GetResultType(ResponseText: string): TGikoResultType;
209 procedure ReadSambaTime(const AHost: string); overload;
210 procedure WriteSambaTime(const AHost: string; ATime: TDateTime); overload;
211 function ReadSettingTime(const AHost: string): Integer; overload;
212 function CheckSambaTime(const AHost: string; ATime: TDateTime): Boolean; overload;
213 procedure SetSamba24(AURL: string); overload;
215 //Samba
\82Ì
\8e\9e\8aÔ
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
216 procedure ReadSambaTime(); overload;
217 //Samba
\82É
\8e\9e\8aÔ
\82ð
\8f\91\82«
\8d\9e\82Þ
218 procedure WriteSambaTime(ATime: TDateTime); overload;
219 //Samba
\82Ì
\90Ý
\92è
\92l
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
220 function ReadSettingTime(): Integer ; overload;
221 //Samba
\82É
\88ø
\82Á
\82©
\82©
\82é
\82©
\8c\9f\8d¸
\82·
\82é
222 function CheckSambaTime(ATime: TDateTime): Boolean; overload;
223 //Samba
\82Ì
\90Ý
\92è
\92l
\82ð
\8f\91\82«
\8d\9e\82Þ
224 procedure SetSamba24(); overload;
226 ///
\88ø
\97p
\95\84\82Ì
\8eæ
\93¾
227 function GetOEIndentChar : string;
228 ///
\96{
\95¶
\82Ì
\8eæ
\93¾
229 function GetBody : string;
230 //IdHttp
\82Ì
\8f\89\8aú
\89»
231 procedure InitIdHTTP(http: TIdHTTP);
232 procedure ShowBoardInformation(ABoard: TBoard; AMemo: TMemo);
233 function GetTitlePictureURL(body: TStringList; ABoard: TBoard): string;
234 procedure ShowTitlePicture();
235 function GetFusianaName(body: TStringList; ABoard: TBoard): String;
236 //!
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\8aJ
\8en
237 procedure OnGestureStart(Sender: TObject);
238 //!
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\92\86
239 procedure OnGestureMove(Sender: TObject);
240 //!
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\8fI
\97¹
241 procedure OnGestureEnd(Sender: TObject);
242 //HEAD.TXT
\8e©
\93®
\95\
\8e¦
243 procedure ShowBoardHead(ABoard: TBoard; AMemo: TMemo);
244 //LocalFusianaTrapAlart
245 function LFusianaGet(s: String): Boolean;
246 // Cookie
\82Ì
\8eæ
\93¾
247 procedure GetCookie(Rawtext: String; ABoard: TBoard);
249 procedure CreateParams(var Params: TCreateParams); override;
253 procedure SetThreadItem(Item: TThreadItem);
254 procedure SetBoard(Item: TBoard);
255 property BBSID: string read FBBSID write FBBSID;
262 Giko, ItemDownload, MojuUtils, IdGlobal;
264 CAPTION_NAME_NEW: string = '
\83M
\83R
\83i
\83r
\83X
\83\8c\97§
\82Ä
\83G
\83f
\83B
\83^';
265 CAPTION_NAME_RES: string = '
\83M
\83R
\83i
\83r
\83\8c\83X
\83G
\83f
\83B
\83^';
267 //
\83G
\83f
\83B
\83b
\83g
\83E
\83B
\83\93\83h
\83E
\82ð
\89E
\89º
\82É
\82¸
\82ç
\82µ
\82Ä
\8aJ
\82
\88Ú
\93®
\97Ê
271 //DAX
\82³
\82ñ±Ø¶ÞÄ!(
\81L
\81¤
\81M)
272 READCGI_ERR = '-ERR';
273 READCGI_INCR = '-INCR';
275 READCGI_PARTIAL = '+PARTIAL';
276 READCGI_ERR_FOUND_KAKO = '-ERR
\89ß
\8b\8e\83\8d\83O
\91q
\8cÉ
\82Å
\94
\8c©';
277 READCGI_ERR_NOT_HTML = '-ERR html
\89»
\91Ò
\82¿';
278 READCGI_ERR_NOT_FOUND = '-ERR
\82»
\82ñ
\82È
\94Âor
\83X
\83\8c\83b
\83h
\82È
\82¢
\82Å
\82·
\81B';
279 READCGI_ERR_ABONE = '-ERR
\82Ç
\82±
\82©
\82Å
\82 \82Ú
\81[
\82ñ
\82ª
\82 \82Á
\82½
\82Ý
\82½
\82¢
\82Å
\82·
\81B';
280 READCGI_ERR_TIMEOUT = '-ERR
\8ew
\92è
\8e\9e\8aÔ
\82ª
\89ß
\82¬
\82Ü
\82µ
\82½
\81B';
281 READCGI_ERR_CANTUSE = '-ERR
\82à
\82¤
\81@
\82Â
\82©
\82¦
\82Ü
\82¹
\82ñ';
282 RES2CH_TRUE = '<!-- 2ch_X:true -->';
283 RES2CH_FALSE = '<!-- 2ch_X:false -->';
284 RES2CH_ERROR = '<!-- 2ch_X:error -->';
285 RES2CH_CHECK = '<!-- 2ch_X:check -->';
286 RES2CH_COOKIE = '<!-- 2ch_X:cookie -->';
289 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
290 BBS2CH_LOG_FOLDER: string = '2ch';
291 EXTERNAL_LOG_FOLDER: string = 'exboard';
293 FOLDER_INI_FILENAME: string = 'Folder.ini';
294 FOLDER_INDEX_FILENAME: string = 'Folder.idx';
295 SUBJECT_FILENAME: string = 'subject.txt';
296 PATH_DELIM: string = '\';
301 StartPos, EndPos: Integer;
306 {constructor TEditorForm.Create(AOwner: TComponent; Item: TBoard);
308 inherited Create(AOwner);
311 procedure TEditorForm.CreateParams(var Params: TCreateParams);
314 if FormStyle in [fsNormal, fsStayOnTop] then
315 if BorderStyle in [bsSingle, bsSizeable] then begin
316 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
317 Params.WndParent := 0;
321 {procedure TEditorForm.CreateParams(var Params: TCreateParams);
323 inherited CreateParams(Params);
324 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
327 procedure TEditorForm.FormCreate(Sender: TObject);
329 wp: TWindowPlacement;
334 Browser.Navigate('about:blank');
335 TitlePictureBrowser.Navigate('about:blank');
339 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\88Ê
\92u
\90Ý
\92è
340 wp.length := sizeof(wp);
341 wp.rcNormalPosition.Top := GikoSys.Setting.EditWindowTop;
342 wp.rcNormalPosition.Left := GikoSys.Setting.EditWindowLeft;
344 wp.rcNormalPosition.Bottom := GikoSys.Setting.EditWindowTop + GikoSys.Setting.EditWindowHeight;
345 wp.rcNormalPosition.Right := GikoSys.Setting.EditWindowLeft + GikoSys.Setting.EditWindowWidth;
346 wp.showCmd := SW_HIDE;
347 SetWindowPlacement(Handle, @wp);
349 if GikoSys.Setting.EditWindowMax then
350 WindowState := wsMaximized;
352 //
\83E
\83B
\83\93\83h
\83E
\82ª
\89æ
\96Ê
\8aO
\82È
\82ç
\89æ
\96Ê
\93à
\82É
\88Ú
\93®
\82·
\82é
353 if (Left + Width) > Screen.Width then
354 // Left := Screen.Width - Width;
356 if (Top + Height) > Screen.Height then
357 // Top := Screen.Height - Height;
364 //
\8c»
\8dÝ
\82Ì
\83E
\83B
\83\93\83h
\83E
\82Ì
\88Ê
\92u
\82ð
\95Û
\91¶
365 GikoSys.Setting.EditWindowTop := Top + WINDOWMOVE_V; //
\8e\9f\82É
\8aJ
\82
\83E
\83B
\83\93\83h
\83E
\82Í
366 GikoSys.Setting.EditWindowLeft := Left + WINDOWMOVE_H; //
\81@
\81@
\81@
\89E
\8eÎ
\82ß
\89º
\82É
\82¸
\82ç
\82·
367 //
\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·
368 if GikoSys.Setting.EditWindowHeight < 144 then
370 if GikoSys.Setting.EditWindowWidth < 144 then
373 EditorPage.ActivePage := EditorTab;
374 FNameComboEdit := GetWindow(NameComboBox.Handle, GW_CHILD);
375 FMailComboEdit := GetWindow(MailComboBox.Handle, GW_CHILD);
376 NameComboBox.Items.Assign(GikoSys.Setting.NameList);
377 MailComboBox.Items.Assign(GikoSys.Setting.MailList);
382 hUser32 := LoadLibrary('User32.dll');
384 TransAction.Enabled := true
386 TransAction.Enabled := false;
388 TransAction.Enabled := false;
391 FreeLibrary(hUser32);
394 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\83X
\83e
\83C
\8fó
\91Ô
395 if GikoSys.Setting.EditWindowStay then begin //
\83X
\83e
\83C
\8fó
\91Ô
396 SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
397 TopAction.Checked := true;
398 TopToolButton.Down := true;
399 end else begin //
\83X
\83e
\83C
\82µ
\82È
\82¢
400 SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
401 TopAction.Checked := false;
402 TopToolButton.Down := false;
405 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\94¼
\93§
\96¾
\8fó
\91Ô
406 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Ô
408 TransAction.Checked := true;
409 TransToolButton.Down := true;
410 end else begin //
\95s
\93§
\96¾
412 TransAction.Checked := false;
413 TransToolButton.Down := false;
415 //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
416 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked;
418 SpaceToNBSPAction.Checked := GikoSys.Setting.SpaceToNBSP;
419 AmpToCharRefAction.Checked := GikoSys.Setting.AmpToCharRef;
421 ini := TIniFile.Create(GikoSys.Setting.GetFileName);
424 BoardtopTab.TabVisible := ini.Readbool('EditorForm', 'BoardTopTab', False);
425 BoardTop.Checked := BoardtopTab.TabVisible;
426 RocalRuleTab.TabVisible := ini.ReadBool('EditorForm', 'LocalRuleTab', False);
427 LocalRule.Checked := RocalRuleTab.TabVisible;
432 //
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\82Ì
\83C
\83\93\83X
\83g
\81[
\83\8b
433 if GikoSys.Setting.GestureEnabled then begin
435 FGestures := TMouseGesture.Create;
436 GikoSys.Setting.Gestures.ClearGesture;
438 GikoSys.Setting.Gestures.LoadGesture(
439 GikoSys.Setting.GetGestureFileName, ActionList );
440 MouseGesture.OnGestureStart := OnGestureStart;
441 MouseGesture.OnGestureMove := OnGestureMove;
442 MouseGesture.OnGestureEnd := OnGestureEnd;
443 MouseGesture.SetHook( Handle );
445 SaveNameMailAction.Checked := True;
448 procedure TEditorForm.SetBoard(Item: TBoard);
451 Caption := CAPTION_NAME_NEW + ' - [' + Item.Title + ']';
452 NameComboBox.Text := FBoard.KotehanName;
453 MailComboBox.Text := FBoard.KotehanMail;
454 SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
455 TitlePanel.Visible := True;
456 SetSamba24(FBoard.URL);
457 ShowBoardInformation(FBoard, BoardInformationMemo);
461 procedure TEditorForm.SetThreadItem(Item: TThreadItem);
464 Caption := CAPTION_NAME_RES + ' - [' + FThreadItem.Title + ']';
465 NameComboBox.Text := FThreadItem.ParentBoard.KotehanName;
466 MailComboBox.Text := FThreadItem.ParentBoard.KotehanMail;
467 SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
468 TitlePanel.Visible := False;
469 SetSamba24(FThreadItem.ParentBoard.URL);
470 ShowBoardInformation(FThreadItem.ParentBoard, BoardInformationMemo);
474 function TEditorForm.GetBody : string;
483 body := BodyEdit.Text;
484 if AmpToCharRefAction.Checked then
485 // &
\82Ì
\92u
\8a·
\82Í
\88ê
\94Ô
\8dÅ
\8f\89\82É
\82â
\82é
\82±
\82Æ
486 body := CustomStringReplace( body, '&', '&' );
487 if SpaceToNBSPAction.Checked then begin
489 tail := p + Length( body );
491 while p < tail do begin
498 tmp := tmp + ' ';
499 until (len mod TAB_LENGTH) = 0;
504 tmp := tmp + p^; Inc( p );
510 tmp := tmp + ' ';
516 //
\8eÀ
\91Ì
\8eQ
\8fÆ
\82Í 1
\95¶
\8e\9a\95ª
521 while p < tail do begin
522 if p^ in ['a'..'z', 'A'..'Z', '0'..'9', '#'] then begin
524 end else if p^ = ';' then begin
536 if p^ in kYofKanji then begin
537 tmp := tmp + p^; Inc( p );
538 tmp := tmp + p^; Inc( p );
541 tmp := tmp + p^; Inc( p );
553 procedure TEditorForm.SetFont;
555 BodyEdit.Font.Name := GikoSys.Setting.EditorFontName;
556 BodyEdit.Font.Size := GikoSys.Setting.EditorFontSize;
557 BodyEdit.Font.Color := GikoSys.Setting.EditorFontColor;
558 BodyEdit.Color := GikoSys.Setting.EditorBackColor;
561 procedure TEditorForm.Preview;
574 if FThreadItem = nil then begin
576 Title := RepHtml(TitleEdit.Text);
578 No := IntToStr(FThreadItem.Count + 1);
579 Title := RepHtml(FThreadItem.Title);
583 Namae := RepHtml(NameComboBox.Text);
584 Mail := RepHtml(MailComboBox.Text);
585 Body := RepHtml(body);
586 Body := StringReplace(Body, #13#10, '<br>', [rfReplaceAll]);
587 DateTime := FormatDateTime('yyyy/mm/dd(aaa) hh:nn', now);
589 if Trim(Namae) = '' then
590 Namae := '
\96¼
\96³
\82µ
\82³
\82ñ';
592 s := '<HTML><HEAD>' + #13#10
593 + '<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">' + #13#10
594 + '<TITLE>' + title + '</TITLE>' + #13#10
595 // + '<STYLE><!--BODY{font-size : 9pt;font-family : "
\82l
\82r
\82o
\83S
\83V
\83b
\83N";}--></STYLE>' + #13#10
597 + '<BODY text="#000000" bgcolor="#EFEFEF" link="#0000FF" alink="#FF0000" vlink="#660099">' + #13#10
598 + '<FONT COLOR="#FF0000">' + title + '</FONT>' + #13#10
600 posTrip := AnsiPos( '#', Namae );
603 tripOrigin := Copy( Namae, posTrip + 1, Length( Namae ) );
605 Copy( Namae, 1, posTrip - 1 ) + '</B>
\81\9f' +
606 get_2ch_trip( PChar( tripOrigin ) ) + '<B>';
609 s := s + '<DT>' + No + '
\81F <FONT color="forestgreen"><B>' + Namae + '</B></FONT>
\81F ' + DateTime+ '<BR><DD>' + Body + '<BR><BR><BR>' + #13#10
611 s := s + '<DT>' + No + '
\81F <A href="mailto:' + Mail + '"><B>' + Namae + '</B></A> [' + Mail + ']
\81F ' + DateTime+ '<BR><DD>' + Body + '<BR><BR><BR>' + #13#10;
612 s := s + '</BODY></HTML>';
613 SetContent(s, Browser);
616 function TEditorForm.RepHtml(s: string): string;
618 // s := StringReplace(s, '&', '&', [rfReplaceAll]);
619 s := CustomStringReplace(s, '<', '<');
620 s := CustomStringReplace(s, '>', '>');
621 // s := StringReplace(s, ' ', ' ', [rfReplaceAll]); //
\8ed
\97l
\95Ï
\8dX
\82É
\82æ
\82è
\8eg
\97p
\95s
\89Â
622 s := CustomStringReplace(s, '"', '"');
626 procedure TEditorForm.EditorPageChange(Sender: TObject);
630 if FThreadItem = nil then
633 tmpBoard := FThreadItem.ParentBoard;
635 if tmpBoard = nil then Exit;
637 if EditorPage.ActivePage = PreviewTab then begin
639 end else if EditorPage.ActivePage = RocalRuleTab then begin
640 if not FileExists(tmpBoard.GETHEADTXTFileName) then begin
641 LocalEdit.Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\96¢
\8eæ
\93¾';
644 ShowBoardHead(tmpBoard, LocalEdit);
646 Browser.Navigate('about:blank');
650 procedure TEditorForm.BrowserStatusTextChange(Sender: TObject;
651 const Text: WideString);
653 if EditorPage.ActivePage = PreviewTab then begin
654 StatusBar.Panels[0].Text := Text;
656 StatusBar.Panels[0].Text := '';
660 function TEditorForm.Check: Boolean;
667 if FThreadItem = nil then
670 Board := FThreadItem.ParentBoard;
672 if (not GikoSys.Setting.UseMachineTime) and
673 ((Board.LastGetTime = 0) or
674 (Board.LastGetTime = ZERO_DATE)) then begin
675 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
676 + '
\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¢';
677 MsgBox(Handle, Msg, '
\83G
\83\89\81[', MB_OK or MB_ICONSTOP);
679 end else if BodyEdit.Text = '' then begin
680 Msg := '
\96{
\95¶
\82ª
\93ü
\97Í
\82³
\82ê
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B';
681 MsgBox(Handle, Msg, '
\83G
\83\89\81[', MB_OK or MB_ICONSTOP);
683 end else if (FBoard <> nil) and (Trim(TitleEdit.Text) = '') then begin
684 Msg := '
\83^
\83C
\83g
\83\8b\82ª
\93ü
\97Í
\82³
\82ê
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B';
685 MsgBox(Handle, Msg, '
\83G
\83\89\81[', MB_OK or MB_ICONSTOP);
688 if (not GikoSys.Dolib.Connected) and (AnsiPos('
\81\9c', NameComboBox.Text) <> 0) then begin
689 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
690 + '
\82±
\82Ì
\82Ü
\82Ü
\91\97\90M
\82µ
\82Ä
\82à
\82æ
\82ë
\82µ
\82¢
\82Å
\82·
\82©
\81H';
691 rc := MsgBox(Handle, Msg, '
\8am
\94F', MB_YESNO or MB_ICONQUESTION);
692 Result := (rc = IDYES);
697 procedure TEditorForm.FormClose(Sender: TObject; var Action: TCloseAction);
702 procedure TEditorForm.FormDestroy(Sender: TObject);
704 wp: TWindowPlacement;
706 //
\8dÅ
\91å
\89»
\81E
\83E
\83B
\83\93\83h
\83E
\88Ê
\92u
\95Û
\91¶
707 wp.length := sizeof(wp);
708 GetWindowPlacement(Handle, @wp);
710 GikoSys.Setting.EditWindowTop := wp.rcNormalPosition.Top;
711 GikoSys.Setting.EditWindowLeft := wp.rcNormalPosition.Left;
712 GikoSys.Setting.EditWindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
713 GikoSys.Setting.EditWindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
714 GikoSys.Setting.EditWindowMax := WindowState = wsMaximized;
715 //GikoSys.Setting.EditWindowStay := FormStyle = fsStayOnTop; //
\83X
\83e
\83C
\8fó
\91Ô
\82Ì
\95Û
\91¶
716 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked; //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
722 procedure TEditorForm.SetNameList(sName, sMail: string);
724 if SaveNameMailAction.Checked then begin
725 if Trim(sName) <> '' then begin
726 if GikoSys.Setting.NameList.IndexOf(sName) = -1 then
727 GikoSys.Setting.NameList.Insert(0, sName);
729 if Trim(sMail) <> '' then begin
730 if GikoSys.Setting.MailList.IndexOf(sMail) = -1 then
731 GikoSys.Setting.MailList.Insert(0, sMail);
736 function TEditorForm.GetActiveControlHandle: THandle;
738 if EditorPage.ActivePage = EditorTab then begin
739 if ActiveControl = NameComboBox then
740 Result := FNameComboEdit
741 else if ActiveControl = MailComboBox then
742 Result := FMailComboEdit
743 else if ActiveControl = BodyEdit then
744 Result := BodyEdit.Handle
745 else if ActiveControl = TitleEdit then
746 Result := TitleEdit.Handle
749 end else if Editorpage.ActivePage = BoardInformationTab then begin
750 if ActiveControl = BoardInformationMemo then
751 Result := BoardInformationMemo.Handle
754 end else if Editorpage.ActivePage = RocalRuleTab then begin
755 if ActiveCOntrol = LocalEdit then
756 Result := LocalEdit.Handle
763 procedure TEditorForm.SetContent(Content: string; ABrowser: TWebBrowser);
767 if ABrowser.Document <> nil then begin
768 doc := Idispatch( olevariant(ABrowser.ControlInterface).Document) as IHTMLDocument2;
771 doc.charset := 'Shift_JIS';
776 procedure TEditorForm.InitIdHTTP(http: TIdHTTP);
779 http.ProxyParams.BasicAuthentication := False;
780 if GikoSys.Setting.WriteProxy then begin
781 http.ProxyParams.ProxyServer := GikoSys.Setting.WriteProxyAddress;
782 http.ProxyParams.ProxyPort := GikoSys.Setting.WriteProxyPort;
783 http.ProxyParams.ProxyUsername := GikoSys.Setting.WriteProxyUserID;
784 http.ProxyParams.ProxyPassword := GikoSys.Setting.WriteProxyPassword;
785 if GikoSys.Setting.ReadProxyUserID <> '' then
786 http.ProxyParams.BasicAuthentication := True;
788 http.ProxyParams.ProxyServer := '';
789 http.ProxyParams.ProxyPort := 80;
790 http.ProxyParams.ProxyUsername := '';
791 http.ProxyParams.ProxyPassword := '';
793 Indy.Request.UserAgent := GikoSys.GetUserAgent;
794 Indy.Request.AcceptEncoding := '';
797 procedure TEditorForm.Send(ACOOKIE: string; SPID: string; PON: string; FirstWriting: Boolean);
799 TextStream: TStringStream;
800 Source: TStringStream;
801 ResponseText: string;
804 State: TGikoDownloadState;
805 ResultType: TGikoResultType;
810 //fusianasan
\83g
\83\89\83b
\83v by
\92è
\8aú
\95Ö
815 tmpRawheader: string;
816 {Protocol,Host, Path, Document, Port, Bookmark : String;}
820 Namae := RepHtml(NameComboBox.Text);
821 if FThreadItem = nil then
824 Board := FThreadItem.ParentBoard;
829 if FThreadItem = nil then begin
830 URL := FBoard.GetSendURL;
831 RefURL := GikoSys.UrlToServer(FBoard.URL) + 'test/bbs.cgi';
833 URL := FThreadItem.GetSendURL;
834 RefURL := FThreadItem.URL;
836 // Indy.Request.UserAgent := GikoSys.GetUserAgent;
837 Indy.Request.Referer := RefURL;
838 // Indy.Request.AcceptEncoding := '';
841 if ACOOKIE <> '' then
844 Cookie := Cookie + 'SPID=' + SPID + '; ';
846 Cookie := Cookie + 'PON=' + PON + '; ';
848 //
\83z
\83X
\83g
\82ª2ch
\82Å
\81ABe
\82ÉLogin
\82µ
\82Ä
\82¢
\82ê
\82ÎBE
\82Ì
\83f
\81[
\83^
\82ð
\91\97\82é
849 //GikoSys.ParseURI( URL, Protocol,Host, Path, Document, Port, Bookmark );
850 //if GikoSys.Is2chHost(Host) and GikoSys.Setting.BeLogin then
851 if (Board.Is2ch) and (GikoSys.Setting.BeLogin) then
852 Cookie := Cookie + 'MDMD=' + GikoSys.Setting.BeCode + '; '
853 + 'DMDM=' + GikoSys.Setting.BeUserID + '; ';
854 Cookie := 'Cookie: ' + Cookie + 'NAME=' + NameComboBox.Text + '; MAIL=' + MailComboBox.Text;
856 sysMenu := GetSystemMenu( Handle, false );
857 EnableMenuItem( sysMenu, SC_CLOSE, MF_GRAYED );
859 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
862 Indy.Request.CustomHeaders.Clear;
863 // Indy.Request.CacheControl := 'no-cache';
864 Indy.Request.CustomHeaders.Add('Pragma: no-cache');
865 Indy.Request.AcceptLanguage := 'ja';
866 Indy.Request.Accept := 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
867 Indy.Request.ContentType := 'application/x-www-form-urlencoded';
868 Indy.Request.CustomHeaders.Add(Cookie);
869 TextStream := TStringStream.Create('');
870 Source := TStringStream.Create('');
873 FDebugStrReceive := '';
876 IdAntiFreeze.Active := True;
878 Indy.Post(URL, Source, TextStream);
880 IdAntiFreeze.Active := False;
882 ResponseText := TextStream.DataString;
884 ResultType := GetResultType(ResponseText);
886 //MsgResult
\8f\89\8aú
\89»
888 //
\83t
\83V
\83A
\83i
\83g
\83\89\83b
\83v
\8cx
\8d\90(LocalMode) by
\92è
\8aú
\95Ö
889 if GikoSys.Setting.LocalTrapAtt then begin
890 if LFusianaGet(Namae) then begin
893 '
\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 +
894 '
\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 +
895 '
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
897 MB_YESNO or MB_ICONQUESTION);
898 if MsgResult = IDNO then begin
902 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
907 if ((Namae = '
\8eR
\8dè
\8fÂ') or (Namae = 'fusianasan')) then begin
910 '
\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 +
911 '
\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 +
912 '
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
914 MB_YESNO or MB_ICONQUESTION);
915 if MsgResult = IDNO then begin
919 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
926 if GikoSys.Setting.RemoteTrapAtt then begin
927 if FThreadItem = nil then
930 ABoard := FThreadItem.ParentBoard;
932 if ABoard = nil then Exit;
934 if FileExists(ABoard.GetSETTINGTXTFileName) then begin
935 body := TStringList.Create;
937 body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
938 Remote := GetFusianaName(body, ABoard);
944 //Setting.txt
\82ª
\82È
\82©
\82Á
\82½
\82ç
\8eæ
\93¾
945 //
\8eI
\82É
\95\89\89×
\82ª
\82©
\82©
\82è
\82»
\82¤
\82Å
\95|
\82¢
\81E
\81E
\81E
946 if not FileExists(ABoard.GetSETTINGTXTFileName) then begin
947 //GetSETTINGTXTAction
\82ð
\8cÄ
\82Ñ
\8fo
\82·
\82ÆIndy
\82ª
\8f\89\8aú
\89»
\82³
\82ê
\82é
\82Ì
\82Å
\81A
948 //
\82±
\82±
\82ÅCookie
\82ð
\95Û
\91¶
\82µ
\82È
\82
\82Ä
\82Í
\82¢
\82¯
\82È
\82¢
949 tmpRawheader := Indy.Response.RawHeaders.Text;
950 GetSETTINGTXTAction.Execute;
951 body := TStringList.Create;
953 body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
954 Remote := GetFusianaName(body, ABoard);
960 if Remote = 'fusianasan' then begin
963 '
\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 +
964 '
\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 +
965 '
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
967 MB_YESNO or MB_ICONQUESTION);
968 if MsgResult = IDNO then begin
972 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
979 if ResultType = grtOK then begin
980 if GikoSys.Setting.UseSamba then
981 WriteSambaTime(FHost, Now());
982 State := gdsComplete;
983 end else if ResultType = grtCookie then begin
984 //
\83\8b\81[
\83v
\96h
\8e~
985 if not FirstWriting then
986 raise Exception.Create('');
989 '
\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 +
990 '
\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 +
991 '
\91S
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
993 MB_YESNO or MB_ICONQUESTION);
994 if MsgResult = IDYES then begin
995 if (GikoSys.Setting.RemoteTrapAtt) and (tmpRawheader <> '') then begin
996 GetCookie(tmpRawheader, Board);
998 GetCookie(Indy.Response.RawHeaders.Text, Board);
1000 if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
1001 raise Exception.Create('');
1002 //
\82à
\82¤
\88ê
\89ñ
\82±
\82Ì
\83\81\83\
\83b
\83h
1003 Send(Board.Cookie, Board.SPID, Board.PON, False);
1009 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
1010 DrawMenuBar(Handle);
1013 end else if ResultType = grtCheck then begin
1015 //
\83\8b\81[
\83v
\96h
\8e~
1016 if not FirstWriting then
1017 raise Exception.Create('');
1019 MsgResult := MsgBox(
1021 '
\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 +
1022 '
\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 +
1023 '
\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 +
1024 '
\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 +
1026 '
\91S
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
1028 MB_YESNO or MB_ICONQUESTION);
1030 if MsgResult = IDYES then begin
1031 if (GikoSys.Setting.RemoteTrapAtt) and (tmpRawheader <> '') then begin
1032 GetCookie(tmpRawheader, Board);
1034 GetCookie(Indy.Response.RawHeaders.Text, Board);
1036 if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
1037 raise Exception.Create('');
1038 Send(Board.Cookie, Board.SPID, Board.PON, False);
1041 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
1042 DrawMenuBar(Handle);
1049 if GikoSys.Setting.UseSamba then
1050 WriteSambaTime(FHost, Now());
1052 raise Exception.Create('');
1056 on E: EIdConnectException do begin
1058 ResponseText := '<html><body>'
1059 + '<div>
\90Ú
\91±
\82ª
\8e¸
\94s
\82µ
\82Ü
\82µ
\82½<br>'
1060 + '
\89ñ
\90ü
\82â
\83v
\83\8d\83L
\83V
\82Ì
\8fó
\91Ô
\82ð
\92²
\82×
\82Ä
\82
\82¾
\82³
\82¢<br></div>'
1061 + '<br><br><div>' + E.Message + '</div>'
1064 on E: Exception do begin
1067 FDebugStrReceive := AnsiReplaceText(FDebugStrReceive, '<', '<');
1068 FDebugStrReceive := AnsiReplaceText(FDebugStrReceive, '>', '>');
1069 FDebugStrSend := AnsiReplaceText(FDebugStrSend, '<', '<');
1070 FDebugStrSend := AnsiReplaceText(FDebugStrSend, '>', '>');
1072 ResponseText := '<html><body>' + TextStream.DataString;
1073 ResponseText := AnsiReplaceText(ResponseText, '</body>', '');
1074 ResponseText := AnsiReplaceText(ResponseText, '</html>', '');
1075 ResponseText := ResponseText + '<hr><div align="left"><pre>';
1076 ResponseText := ResponseText + '<b>
\82±
\82±
\82©
\82ç
\83M
\83R
\83i
\83r
\82Ì
\8fî
\95ñ</b>'#13#10;
1077 ResponseText := ResponseText + #13#10'
\81\9c\91\97\90M'#13#10;
1078 ResponseText := ResponseText + FDebugStrSend;
1079 ResponseText := ResponseText + #13#10'
\81\9c\8eó
\90M'#13#10;
1080 ResponseText := ResponseText + FDebugStrReceive;
1081 ResponseText := ResponseText + '</pre></div></body></html>';
1084 FStatusCode := Indy.ResponseCode;
1090 //sysMenu := GetSystemMenu( Handle, true );
1091 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
1092 DrawMenuBar(Handle);
1095 //
\94ñ
\8cö
\8e®
\83M
\83R
\83i
\83r
\94Â
\82È
\82Ç
\82Ì
\83X
\83N
\83\8a\83v
\83g
\97p
1096 //ResponceCode
\82ª302Found
\82Å
\8f\91\82«
\8d\9e\82Ý
\8a®
\97¹
1097 if FStatusCode = 302 then begin
1098 GikoForm.PlaySound('ResEnd');
1100 if FThreadItem = nil then
1101 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK)
1103 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
1107 if State = gdsComplete then begin
1108 GikoForm.PlaySound('ResEnd');
1110 if FThreadItem = nil then
1111 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK)
1113 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
1115 end else if State = gdsError then begin
1116 if FThreadItem = nil then
1117 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK)
1119 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
1121 EditorPage.ActivePage := PreviewTab;
1122 SetContent(ResponseText, Browser);
1123 end else if State = gdsAbort then begin
1124 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiSAD);
1128 function TEditorForm.GetResultType(ResponseText: string): TGikoResultType;
1130 if AnsiPos('
\8f\91\82«
\82±
\82Ý
\82ª
\8fI
\82í
\82è
\82Ü
\82µ
\82½', ResponseText) <> 0 then
1132 else if (AnsiPos('
\83N
\83b
\83L
\81[
\82ª
\82È
\82¢
\82©
\8aú
\8cÀ
\90Ø
\82ê
\82Å
\82·', ResponseText) > 0) or
1133 (AnsiPos('<title>
\83N
\83b
\83L
\81[
\8am
\94F
\81I</title>', ResponseText) > 0) or
1134 (AnsiPos('<title>
\81¡
\83N
\83b
\83L
\81[
\8am
\94F
\81I
\81¡</title>', ResponseText) > 0) or
1135 //(AnsiPos('
\83N
\83b
\83L
\81[
\8am
\94F', ResponseText) > 0) or
1136 (AnsiPos(RES2CH_COOKIE, ResponseText) > 0) then
1138 else if (AnsiPos('<font size=+2 color=#FF0000>
\8f\91\82«
\8d\9e\82Ý
\83`
\83F
\83b
\83N
\81I </font>', ResponseText) > 0) or
1139 (AnsiPos('<title>
\81¡
\8f\91\82«
\8d\9e\82Ý
\8am
\94F
\82µ
\82Ü
\82·
\81¡</title>', ResponseText) > 0) or
1140 (AnsiPos('<title>
\93\8a\8de
\8am
\94F</title>', ResponseText) > 0) or
1141 (AnsiPos('<b>
\8f\91\82«
\82±
\82Ý
\8am
\94F</b>', ResponseText) > 0) or
1142 (AnsiPos('="../test/subbbs.cgi">', ResponseText) > 0) or
1143 (AnsiPos(RES2CH_FALSE, ResponseText) > 0) then
1145 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
1146 (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
1153 procedure TEditorForm.GetSendData(Source: TStringStream);
1162 if FThreadItem = nil then
1165 Board := FThreadItem.ParentBoard;
1167 if GikoSys.Setting.UseMachineTime then begin
1168 if GikoSys.Setting.TimeAdjust then
1169 Adjust := Gikosys.Setting.TimeAdjustSec
1171 Adjust := GikoSys.Setting.TimeAdjustSec * -1;
1172 SendTime := GikoSys.DateTimeToInt(Now) - (9 * 60 * 60) + Adjust
1174 if (Board.LastGetTime = 0) or (Board.LastGetTime = ZERO_DATE) then
1175 SendTime := GikoSys.DateTimeToInt(Now)
1177 SendTime := GikoSys.DateTimeToInt(Board.LastGetTime);
1182 SessionID := GikoSys.Dolib.SessionID;
1183 if SessionID <> '' then
1184 s := 'sid=' + HttpEncode(SessionID) + '&'
1187 s := s + 'subject=&'
1188 + 'FROM=' + HttpEncode(NameComboBox.Text) + '&'
1189 + 'mail=' + HttpEncode(MailComboBox.Text) + '&'
1190 + 'MESSAGE=' + HttpEncode(body) + '&'
1191 + 'bbs=' + Board.BBSID + '&'
1192 + 'time=' + IntToStr(SendTime) + '&';
1193 if FThreadItem = nil then begin
1194 s := s + 'subject=' + HttpEncode(TitleEdit.Text) + '&';
1195 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;
1197 s := s + 'key=' + ChangeFileExt(FThreadItem.FileName, '') + '&';
1198 s := s + 'submit=' + HttpEncode('
\8f\91\82«
\8d\9e\82Þ') + #13#10;
1200 Source.WriteString(s);
1203 procedure TEditorForm.SaveSendFile;
1208 ini := TMemIniFile.Create(GikoSys.GetSentFileName);
1210 sDate := IntToStr(GikoSys.DateTimeToInt(Now));
1212 ini.WriteString(sDate, 'Name', NameComboBox.Text);
1213 ini.WriteString(sDate, 'EMail', MailComboBox.Text);
1214 ini.WriteString(sDate, 'Body', HttpEncode(BodyEdit.Text));
1215 ini.WriteInteger(sDate, 'Status', FStatusCode);
1216 ini.WriteDateTime(sDate, 'Date', Now);
1217 if FThreadItem = nil then begin
1218 ini.WriteString(sDate, 'Title', TitleEdit.Text);
1219 ini.WriteString(sDate, 'BBS', FBoard.BBSID);
1220 ini.WriteInteger(sDate, 'NewThread', 1);
1222 ini.WriteString(sDate, 'Title', FThreadItem.Title);
1223 ini.WriteString(sDate, 'BBS', FThreadItem.ParentBoard.BBSID);
1224 ini.WriteString(sDate, 'Key', ChangeFileExt(FThreadItem.FileName, ''));
1233 procedure TEditorForm.SendActionExecute(Sender: TObject);
1238 state : TGikoDownloadState;
1245 SendAction.Enabled := False;
1246 Application.ProcessMessages;
1247 if not Check then Exit;
1249 if FThreadItem = nil then
1252 Board := FThreadItem.ParentBoard;
1254 if FThreadItem = nil then begin
1255 rc := GikoUtil.MsgBox(Handle,
1256 '
\81u' + Board.Title + '
\81v
\94Â
\82É
\90V
\82µ
\82¢
\83X
\83\8c\83b
\83h
\97§
\82Ä
\82Ü
\82·'#13#10#13#10
1257 + '
\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
1258 + '
\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
1259 + '
\81u
\82Í
\82¢
\81v
\82ð
\89\9f\82·
\82Æ
\91\97\90M
\82µ
\82Ü
\82·',
1261 MB_ICONQUESTION or MB_YESNO);
1262 if rc <> ID_YES then
1266 SetNameList(NameComboBox.Text, MailComboBox.Text);
1267 if (KotehanCheckBox.Enabled) and (KotehanCheckBox.Checked) then begin
1268 Board.KotehanName := NameComboBox.Text;
1269 Board.KotehanMail := MailComboBox.Text;
1272 if Board.IsBoardPlugInAvailable then begin
1275 if FThreadItem = nil then begin
1276 //
\83X
\83\8c\97§
\82Ä
1277 state := TGikoDownloadState( Board.BoardPlugIn.CreateThread(
1278 DWORD( Board ), TitleEdit.Text, NameComboBox.Text, MailComboBox.Text, body ) );
1280 if state = gdsComplete then begin
1281 GikoForm.PlaySound('ResEnd');
1283 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK);
1286 end else if State = gdsError then begin
1287 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureError)), nil, gmiNG);
1288 end else if State = gdsAbort then begin
1289 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiNG);
1293 state := TGikoDownloadState( FThreadItem.ParentBoard.BoardPlugIn.WriteThread(
1294 DWORD( FThreadItem ), NameComboBox.Text, MailComboBox.Text, body ) );
1296 if state = gdsComplete then begin
1297 GikoForm.PlaySound('ResEnd');
1299 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
1302 end else if State = gdsError then begin
1303 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmResError)), nil, gmiOK);
1304 end else if State = gdsAbort then begin
1305 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiOK);
1309 if not Timer1.Enabled then begin
1310 if CompareDateTime(Board.Expires ,Now) <= 0 then begin
1315 Send(Board.Cookie, Board.SPID, Board.PON, True);
1317 if not CheckSambaTime(FHost, Now()) then begin
1318 rc := GikoUtil.MsgBox(Handle,
1319 '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
1320 + '
\91\97\90M
\82ð
\92\86\8e~
\82µ
\82Ü
\82·
\82©
\81H' + #13#10
1321 + '(
\81u
\82¢
\82¢
\82¦
\81v
\82¾
\82Æ
\91\97\90M
\82µ
\82Ü
\82·)', 'Samba24
\8cx
\8d\90',
1322 MB_YESNO or MB_ICONQUESTION);
1323 if rc = IDYES then begin
1327 if rc = IDNO then begin
1328 rc2 := GikoUtil.MsgBox(Handle,
1329 '
\96{
\93\96\82É
\91\97\90M
\82µ
\82Ü
\82·
\82©
\81H',
1330 'Sumba24
\8cx
\8d\90',
1331 MB_YESNO or MB_ICONQUESTION);
1332 if rc2 = IDNO then begin
1338 if CompareDateTime(Board.Expires ,Now) <= 0 then begin
1343 Send(Board.Cookie, Board.SPID, Board.PON, True);
1348 if Timer1.Enabled then
1349 ReadSambaTime(FHost);
1353 procedure TEditorForm.SaveActionExecute(Sender: TObject);
1358 procedure TEditorForm.CloseActionExecute(Sender: TObject);
1363 procedure TEditorForm.UndoActionExecute(Sender: TObject);
1365 SendMessage(GetActiveControlHandle, WM_UNDO, 0, 0);
1368 procedure TEditorForm.CutActionExecute(Sender: TObject);
1370 SendMessage(GetActiveControlHandle, WM_CUT, 0, 0);
1373 procedure TEditorForm.CopyActionExecute(Sender: TObject);
1375 SendMessage(GetActiveControlHandle, WM_COPY, 0, 0);
1378 procedure TEditorForm.PasteActionExecute(Sender: TObject);
1380 SendMessage(GetActiveControlHandle, WM_PASTE, 0, 0);
1383 procedure TEditorForm.SelectAllActionExecute(Sender: TObject);
1385 SendMessage(GetActiveControlHandle, EM_SETSEL, 0, GetWindowTextLength(GetActiveControlHandle));
1388 procedure TEditorForm.TopActionExecute(Sender: TObject); //
\83E
\83B
\83\93\83h
\83E
\8dÅ
\91O
\96Ê(Stay)
\83{
\83^
\83\93\82Ì
\8f\88\97\9d
1390 if not (fsShowing in Self.FormState) then begin
1391 if TopAction.Checked then begin //
\83X
\83e
\83C
\8fó
\91Ô
\82É
\90Ý
\92è
1392 SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
1393 GikoSys.Setting.EditWindowStay := true;
1394 end else begin //
\83X
\83e
\83C
\8fó
\91Ô
\89ð
\8f\9c
1395 SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
1396 GikoSys.Setting.EditWindowStay := false;
1398 //
\83X
\83e
\83C
\8fó
\91Ô
\82Ì
\95Û
\91¶
1399 //GikoSys.Setting.EditWindowStay := FormStyle = fsStayOnTop;
1403 procedure TEditorForm.AbortActionExecute(Sender: TObject);
1408 procedure TEditorForm.SendActionUpdate(Sender: TObject);
1410 SendAction.Enabled := not FWork;
1413 procedure TEditorForm.SaveActionUpdate(Sender: TObject);
1415 SaveAction.Enabled := False;
1418 procedure TEditorForm.CloseActionUpdate(Sender: TObject);
1420 CloseAction.Enabled := not FWork;
1423 procedure TEditorForm.UndoActionUpdate(Sender: TObject);
1425 UndoAction.Enabled := (GetActiveControlHandle <> 0)
1426 and (SendMessage(GetActiveControlHandle, EM_CANUNDO, 0, 0) <> 0)
1430 procedure TEditorForm.CutActionUpdate(Sender: TObject);
1432 Selection: TSelection;
1435 AHandle := GetActiveControlHandle;
1436 SendMessage(AHandle, EM_GETSEL, Longint(@Selection.StartPos), Longint(@Selection.EndPos));
1437 CutAction.Enabled := (AHandle <> 0)
1438 and ((Selection.EndPos - Selection.StartPos) <> 0)
1442 procedure TEditorForm.CopyActionUpdate(Sender: TObject);
1444 Selection: TSelection;
1447 AHandle := GetActiveControlHandle;
1448 SendMessage(AHandle, EM_GETSEL, Longint(@Selection.StartPos), Longint(@Selection.EndPos));
1449 CopyAction.Enabled := (AHandle <> 0)
1450 and ((Selection.EndPos - Selection.StartPos) <> 0)
1454 procedure TEditorForm.PasteActionUpdate(Sender: TObject);
1456 PasteAction.Enabled := (GetActiveControlHandle <> 0)
1457 and (Clipboard.HasFormat(CF_TEXT))
1461 procedure TEditorForm.TopActionUpdate(Sender: TObject);
1463 TopAction.Enabled := not FWork;
1466 procedure TEditorForm.SageCheckBoxClick(Sender: TObject);
1468 if SageCheckBox.Checked then begin
1469 if AnsiPos('sage', MailComboBox.Text) = 0 then
1470 MailComboBox.Text := 'sage' + MailComboBox.Text;
1472 if AnsiPos('sage', MailComboBox.Text) <> 0 then
1473 MailComboBox.Text := StringReplace(MailComboBox.Text, 'sage', '', [rfReplaceAll]);
1477 procedure TEditorForm.MailComboBoxChange(Sender: TObject);
1479 if AnsiPos('sage', MailComboBox.Text) = 0 then
1480 SageCheckBox.Checked := False
1482 SageCheckBox.Checked := True;
1485 procedure TEditorForm.IdLogDebugReceive(ASender: TIdConnectionIntercept;
1488 StringStream: TStringStream;
1490 StringStream := TStringStream.Create('');
1492 StringStream.CopyFrom(AStream, AStream.Size);
1493 FDebugStrReceive := FDebugStrReceive + StringStream.DataString;
1499 procedure TEditorForm.IdLogDebugSend(ASender: TIdConnectionIntercept;
1502 StringStream: TStringStream;
1504 StringStream := TStringStream.Create('');
1506 StringStream.CopyFrom(AStream, AStream.Size);
1507 FDebugStrSend := FDebugStrSend + StringStream.DataString;
1513 procedure TEditorForm.TransActionExecute(Sender: TObject);
1515 AlphaBlend := TransAction.Checked;
1516 //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
1517 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked;
1520 procedure TEditorForm.TransActionUpdate(Sender: TObject);
1522 TransAction.Enabled := not FWork;
1524 //StatusBar
\82ÌPanels[0]
\82Ì
\95\9d\82ð
\89Â
\95Ï
\81B
\8ec
\82è
\82ð
\8cÅ
\92è
\82É
\82·
\82é
1525 procedure TEditorForm.StatusBarResize(Sender: TObject);
1527 StatusBar.Panels[0].Width := StatusBar.Width
1528 - StatusBar.Panels[1].Width - StatusBar.Panels[2].Width;
1532 procedure TEditorForm.Timer1Timer(Sender: TObject);
1534 if FSambaTime = ZERO_DATE then
1535 StatusBar.Panels[1].Text := '
\8f\89\8f\91'
1537 FNow := IncMilliSecond(FNow, 500);
1538 StatusBar.Panels[1].Text := Format('%8.0f
\95b
\8co
\89ß', [SecondSpan(FNow, FSambaTime)]);
1542 //Samba.ini
\82Ì
\8f\91\82«
\8d\9e\82Ý
\8e\9e\8aÔ
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
1543 procedure TEditorForm.ReadSambaTime(const AHost: string);
1548 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
1549 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
1551 //
\95¶
\8e\9a\97ñ
\82Å
\93Ç
\82Ý
\8eæ
\82Á
\82Ä
\81A
\95Ï
\8a·
\8aÖ
\90\94\82ÅTDateTime
\82Ö
1552 tmp := ini.ReadString('Send', AHost, DateTimeToStr(ZERO_DATE));
1553 FSambaTime := ConvertDateTimeString(tmp);
1557 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
1558 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
1560 //Samba.ini
\82É
\8dÅ
\8fI
\8f\91\82«
\8d\9e\82Ý
\8e\9e\8aÔ
\82ð
\8f\91\82«
\8d\9e\82Þ
1561 procedure TEditorForm.WriteSambaTime(const AHost: string; ATime: TDateTime);
1565 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
1567 ini.WriteDateTime('Send', AHost, ATime);
1573 //
\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
1574 function TEditorForm.CheckSambaTime(const AHost: string; ATime: TDateTime): Boolean;
1577 SettingTime: Integer;
1579 SettingTime := ReadSettingTime(AHost);
1580 ReadSambaTime(AHost);
1581 pastsec := SecondSpan(ATime, FSambaTime);
1582 if pastsec > SettingTime then
1587 //AHost
\81i
\8eI
\96¼
\81j
\82ÌSamba
\82Ì
\8bK
\92è
\92l
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
1588 function TEditorForm.ReadSettingTime(const AHost: string): Integer;
1592 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
1594 Result := ini.ReadInteger('Setting', AHost, 0);
1595 //
\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
1596 if Result = 0 then begin
1597 ini.WriteInteger('Setting', AHost, 0);
1604 //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Þ
1605 procedure TEditorForm.FormActivate(Sender: TObject);
1607 if ( Timer1.Enabled ) and ( FThreadItem <> nil )then
1608 ReadSambaTime(FHost);
1609 if GikoSys.Setting.GestureEnabled then begin
1610 GikoSys.Setting.Gestures.ClearGesture;
1611 GikoSys.Setting.Gestures.LoadGesture(
1612 GikoSys.Setting.GetGestureFileName, ActionList );
1613 MouseGesture.UnHook;
1614 MouseGesture.OnGestureStart := OnGestureStart;
1615 MouseGesture.OnGestureMove := OnGestureMove;
1616 MouseGesture.OnGestureEnd := OnGestureEnd;
1617 MouseGesture.SetHook( Handle );
1620 //Samba24
\91Î
\8dô
\82ð
\8eg
\82¤
\82©
\82Ç
\82¤
\82©
\8c\88\82ß
\82é
\8aÖ
\90\94
1621 //ReadSambaTime
\82ð
\8cÄ
\82Ñ
\8fo
\82·
\82ÆTimer
\82ªOn
\82É
\82È
\82é
1622 procedure TEditorForm.SetSamba24(AURL: string);
1624 Protocol, Host, Path, Document, Port, Bookmark : string;
1626 //Samba24
\91Î
\8dô
\82ð
\82µ
\82È
\82¢
\82È
\82ç
\8fI
\97¹
1627 if not GikoSys.Setting.UseSamba then
1629 //Host
\82ÌURL
\82É'.2ch.'
\82©'.bbspink.'
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82½
\82çSamba24
\91Î
\8dô
\82ð
\82·
\82é
1630 GikoSys.ParseURI( AURL, Protocol,Host, Path, Document, Port, Bookmark );
1631 if GikoSys.Is2chHost(Host) then begin
1632 Host := Copy(Host, 1, AnsiPos('.', Host) - 1);
1633 FHost := Host; //FHost=
\8eI
\96¼
1634 ReadSambaTime(FHost); //
\88È
\91O
\82Ì
\8f\91\82«
\8d\9e\82Ý
\8e\9e\8aÔ
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
1635 //StatusBar
\82É
\82±
\82Ì
\8eI
\82Ì
\8bK
\92è
\92l
\82ð
\95\
\8e¦
\82·
\82é
1636 StatusBar.Panels[2].Text := 'Samba24
\8bK
\92è
\92l' + IntToStr(ReadSettingTime(FHost));
1639 procedure TEditorForm.FormCloseQuery(Sender: TObject;
1640 var CanClose: Boolean);
1642 CanClose := not FWork;
1645 function TEditorForm.GetOEIndentChar : string;
1648 Identities : string;
1651 DEFAULT_CHAR = '> ';
1652 OE_MAIL_PATH = '\Software\Microsoft\Outlook Express\5.0\Mail';
1653 INDENT_CHAR = 'Indent Char';
1656 Result := DEFAULT_CHAR;
1657 regKey := TRegistry.Create;
1660 regKey.RootKey := HKEY_CURRENT_USER;
1661 if not regKey.OpenKey( 'Identities', False ) then
1663 Identities := regKey.ReadString( 'Default User ID' );
1664 if Identities = '' then
1666 if not regKey.OpenKey( Identities + OE_MAIL_PATH, False ) then
1668 IndentChar := regKey.ReadInteger( INDENT_CHAR );
1669 Result := Char( IndentChar ) + ' ';
1678 procedure TEditorForm.QuotePasteActionExecute(Sender: TObject);
1685 quote := GetOEIndentChar;
1686 s := TStringList.Create;
1688 s.Text := Clipboard.AsText;
1690 for i := s.Count - 1 downto 0 do
1691 s[ i ] := quote + s[ i ];
1693 BodyEdit.SelText := s.Text;
1700 procedure TEditorForm.SpaceToNBSPActionExecute(Sender: TObject);
1702 GikoSys.Setting.SpaceToNBSP := SpaceToNBSPAction.Checked;
1703 if EditorPage.ActivePage = PreviewTab then
1707 procedure TEditorForm.AmpToCharRefActionExecute(Sender: TObject);
1709 GikoSys.Setting.AmpToCharRef := AmpToCharRefAction.Checked;
1710 if EditorPage.ActivePage = PreviewTab then
1714 procedure TEditorForm.BoardTopClick(Sender: TObject);
1718 ini := TIniFile.Create(GikoSys.Setting.GetFileName);
1720 BoardtopTab.TabVisible := BoardTop.Checked;
1721 ini.WriteBool('EditorForm', 'BoardTopTab', BoardtopTab.TabVisible);
1728 procedure TEditorForm.GetSETTINGTXTActionExecute(Sender: TObject);
1730 URL, RefURL: string;
1731 settingBody: TStringList;
1739 if FThreadItem = nil then
1742 tmpBoard := FThreadItem.ParentBoard;
1744 if tmpBoard = nil then Exit;
1746 RefURL := tmpBoard.URL;
1747 if RefURL[Length(RefURL)] <> '/' then
1748 URL := RefURL + '/' + 'SETTING.TXT'
1750 URL := RefURL + 'SETTING.TXT';
1752 Indy.Request.LastModified := tmpBoard.SETTINGTXTTime;
1753 Indy.Request.Referer := RefURL;
1754 Screen.Cursor := crHourGlass;
1755 settingBody := TStringList.Create;
1757 StatusBar.Panels[0].Text := 'SETTING.TXT
\83_
\83E
\83\93\83\8d\81[
\83h
\92\86';
1759 IdAntiFreeze.Active := True;
1761 settingBody.Text := Indy.Get(URL);
1763 IdAntiFreeze.Active := False;
1765 if( Indy.ResponseCode = 200 ) then begin
1766 settingBody.SaveToFile(tmpBoard.GetSETTINGTXTFileName);
1767 tmpBoard.SETTINGTXTTime := Indy.Response.LastModified;
1768 tmpBoard.IsSETTINGTXT := true;
1769 tmpBoard.TitlePictureURL := GetTitlePictureURL(settingBody, tmpBoard);
1770 tmpBoard.Modified := true;
1771 StatusBar.Panels[0].Text := 'SETTING.TXT
\8eæ
\93¾
\8a®
\97¹(' + IntToStr(Indy.ResponseCode) + ')';
1774 on E: EIdException do begin
1775 if( AnsiPos('304', E.Message) > 0 ) then
1776 StatusBar.Panels[0].Text := 'SETTING.TXT
\8dX
\90V
\96³
\82µ(' + IntToStr(Indy.ResponseCode) + ')'
1778 StatusBar.Panels[0].Text := 'SETTING.TXT
\8eæ
\93¾
\83G
\83\89\81[(' + IntToStr(Indy.ResponseCode) + ')';
1783 Screen.Cursor := crDefault;
1785 ShowBoardInformation(tmpBoard, BoardInformationMemo);
1790 procedure TEditorForm.ShowBoardInformation(ABoard: TBoard; AMemo: TMemo);
1795 AMemo.Lines.Add('[SETTING.TXT]');
1796 if ABoard.IsSETTINGTXT then begin
1797 if FileExists(ABoard.GetSETTINGTXTFileName) then begin
1798 AMemo.Lines.Add(DateTimeToStr(ABoard.SETTINGTXTTime) + '
\8dX
\90V');
1799 body := TStringList.Create;
1801 body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
1802 AMemo.Lines.AddStrings(body);
1807 ABoard.IsSETTINGTXT := false;
1808 ABoard.SETTINGTXTTime := ZERO_DATE;
1809 AMemo.Lines.Add('Local
\82É
\95Û
\91¶
\82³
\82ê
\82½SETTING.TXT
\82ª
\8c©
\82Â
\82©
\82è
\82Ü
\82¹
\82ñ');
1810 AMemo.Lines.Add('
\83\81\83j
\83\85\81[
\82æ
\82è
\8dÄ
\8eæ
\93¾
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B');
1813 AMemo.Lines.Add('SETTING.TXT
\82ð
\8eæ
\93¾
\82µ
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B');
1814 AMemo.Lines.Add('
\83\81\83j
\83\85\81[
\82æ
\82è
\8eæ
\93¾
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B');
1817 function TEditorForm.GetTitlePictureURL(body: TStringList; ABoard: TBoard): string;
1818 //BBS_TITLE_PICTURE=
1825 for i := 0 to body.Count - 1 do begin
1826 if (AnsiPos('BBS_TITLE_PICTURE=', body[i]) > 0) or
1827 (AnsiPos('BBS_FIGUREHEAD=', body[i]) > 0) then begin
1829 Delete(tmp, 1, AnsiPos('=', tmp));
1830 if AnsiPos('../', tmp) > 0 then begin
1831 tmp := CustomStringReplace(tmp, '../', GikoSys.UrlToServer(ABoard.URL));
1839 procedure TEditorForm.GetTitlePictureActionUpdate(Sender: TObject);
1841 if FThreadItem = nil then
1842 GetTitlePictureAction.Enabled := FBoard.IsSETTINGTXT
1844 GetTitlePictureAction.Enabled := FThreadItem.ParentBoard.IsSETTINGTXT;
1848 procedure TEditorForm.GetTitlePictureActionExecute(Sender: TObject);
1850 memStream: TMemoryStream;
1858 memStream := TMemoryStream.Create;
1860 if FThreadItem = nil then
1863 tmpBoard := FThreadItem.ParentBoard;
1865 Indy.Request.Referer := tmpBoard.URL;
1866 if tmpBoard.TitlePictureURL <> '' then begin
1867 StatusBar.Panels[0].Text := '
\94Â
\83g
\83b
\83v
\89æ
\91\9c\83_
\83E
\83\93\83\8d\81[
\83h
\92\86';
1868 Screen.Cursor := crHourGlass;
1870 IdAntiFreeze.Active := True;
1872 Indy.Get(tmpBoard.TitlePictureURL, memStream);
1874 IdAntiFreeze.Active := False;
1876 if Indy.ResponseCode = 200 then begin
1877 memStream.SaveToFile(tmpBoard.GetTitlePictureFileName);
1879 tmpBoard.Modified := true;
1885 Screen.Cursor := crDefault;
1886 StatusBar.Panels[0].Text := '
\94Â
\83g
\83b
\83v
\89æ
\91\9c (' + IntToStr(Indy.ResponseCode) + ')';
1892 procedure TEditorForm.ShowTitlePicture();
1897 if FThreadItem = nil then
1900 tmpBoard := FThreadItem.ParentBoard;
1902 if FileExists(tmpBoard.GetTitlePictureFileName) then begin
1903 TitlePictureBrowser.Navigate(tmpBoard.GetTitlePictureFileName);
1905 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';
1906 SetContent(s, TitlePictureBrowser);
1910 function TEditorForm.GetFusianaName(body: TStringList; ABoard: TBoard): String;
1915 for i := 0 to body.Count - 1 do begin
1916 if (AnsiPos('BBS_NONAME_NAME=', body[i]) > 0) then begin
1918 Delete(tmp, 1, AnsiPos('=', tmp));
1925 procedure TEditorForm.GetHeadTXTActionExecute(Sender: TObject);
1927 URL, RefURL: string;
1928 settingBody: TStringList;
1936 if FThreadItem = nil then
1939 tmpBoard := FThreadItem.ParentBoard;
1941 if tmpBoard = nil then Exit;
1943 RefURL := tmpBoard.URL;
1944 if RefURL[Length(RefURL)] <> '/' then
1945 URL := RefURL + '/' + 'head.txt'
1947 URL := RefURL + 'head.txt';
1949 if FileExists(tmpBoard.GETHEADTXTFileName) then
1950 Indy.Request.LastModified := tmpBoard.HEADTXTTime
1952 Indy.Request.LastModified := ZERO_DATE;
1954 Indy.Request.Referer := RefURL;
1955 Screen.Cursor := crHourGlass;
1956 settingBody := TStringList.Create;
1958 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';
1960 IdAntiFreeze.Active := True;
1962 settingBody.Text := Indy.Get(URL);
1964 IdAntiFreeze.Active := False;
1966 if( Indy.ResponseCode = 200 ) then begin
1967 settingBody.Insert(0, '<HTML lang="ja"><HEAD>');
1968 settingBody.Insert(1, '<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">');
1969 settingBody.Insert(2, '<TITLE>' + tmpBoard.Title + '</TITLE>');
1970 settingBody.Insert(3, '<base href="' + RefURL + '"></HEAD><BODY>');
1971 settingBody.Add('</BODY></HTML>');
1972 settingBody.SaveToFile(tmpBoard.GETHEADTXTFileName);
1973 tmpBoard.HEADTXTTime := Indy.Response.LastModified;
1974 tmpBoard.IsHEADTXT := true;
1975 tmpBoard.Modified := true;
1976 StatusBar.Panels[0].Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\8eæ
\93¾
\8a®
\97¹(' + IntToStr(Indy.ResponseCode) + ')';
1979 on E: EIdException do begin
1980 if( AnsiPos('304', E.Message) > 0 ) then
1981 StatusBar.Panels[0].Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\8dX
\90V
\96³
\82µ(' + IntToStr(Indy.ResponseCode) + ')'
1983 StatusBar.Panels[0].Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\8eæ
\93¾
\83G
\83\89\81[(' + IntToStr(Indy.ResponseCode) + ')';
1988 Screen.Cursor := crDefault;
1990 if tmpBoard.IsHEADTXT then begin
1991 ShowBoardHead(tmpboard, LocalEdit);
1997 procedure TEditorForm.CalcCapacityActionExecute(Sender: TObject);
2003 //
\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
2004 if FThreadItem = nil then
2007 Board := FThreadItem.ParentBoard;
2009 if Board.BoardPlugIn <> nil then
2010 body := CustomStringReplace(body, #13#10, '<br>')
2012 body := CustomStringReplace(body, #13#10, ' <br> ');
2013 StatusBar.Panels[0].Text := '
\97e
\97Ê:' + IntToStr(Length(body)) + ' byte';
2016 procedure TEditorForm.LocalRuleClick(Sender: TObject);
2020 ini := TIniFile.Create(GikoSys.Setting.GetFileName);
2022 RocalRuleTab.TabVisible := LocalRule.Checked;
2023 ini.WriteBool('EditorForm', 'LocalRuleTab', RocalRuleTab.TabVisible);
2029 procedure TEditorForm.FormDeactivate(Sender: TObject);
2031 if GikoSys.Setting.GestureEnabled then begin
2032 MouseGesture.UnHook;
2033 //MouseGesture.SetHook( GikoForm.Handle );
2038 procedure TEditorForm.OnGestureStart(Sender: TObject);
2043 procedure TEditorForm.OnGestureMove(Sender: TObject);
2049 s := MouseGesture.GetGestureStr;
2051 Action := GikoSys.Setting.Gestures.GetGestureAction(s);
2052 if Action <> nil then
2053 ActStr := '
\81i' + Action.Caption + '
\81j';
2054 s := '
\83W
\83F
\83X
\83`
\83\83\81[: ' + s + ActStr;
2055 StatusBar.Panels[0].Text := s;
2058 procedure TEditorForm.OnGestureEnd(Sender: TObject);
2063 s := MouseGesture.GetGestureStr;
2064 Action := GikoSys.Setting.Gestures.GetGestureAction(s);
2065 if Action <> nil then
2067 StatusBar.Panels[0].Text := '';
2070 procedure TEditorForm.ShowBoardHead(ABoard: TBoard; AMemo: TMemo);
2072 wDoc, WTex, le: OLEVariant;
2075 //http://www.campus.ne.jp/~ishigami/CREATION/TECHNIC/WEBAP-2.htm
2076 WebBrowser1.Navigate(ABoard.GETHEADTXTFileName,le,le,le,le);
2077 //
\83\8c\83^
\83\8a\83\93\83O
\82ª
\92x
\82·
\82¬
\82ÄTXT
\82É
\88Ú
\82¹
\82È
\82¢
\81B
\82Ê
\82é
\82Ûorz
2078 //
\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
2079 //
\82±
\82ê
\82Å
\82¢
\82¯
\82Ü
\82µ
\82½
\81B
\82 \82è
\82ª
\82Æ
\82¤
\82²
\82´
\82¢
\82Ü
\82µ
\82½
\81B
2080 while (WebBrowser1.ReadyState <> READYSTATE_COMPLETE) and
2081 (WebBrowser1.ReadyState <> READYSTATE_INTERACTIVE) do begin
2082 Application.ProcessMessages;
2084 wDoc := WebBrowser1.Document;
2085 wTex := wDoc.body.createTextRange;
2086 LocalEdit.Text := wTex.text;
2089 procedure TEditorForm.LocalRuleBrowseClick(Sender: TObject);
2094 if FThreadItem = nil then
2097 ABoard := FThreadItem.ParentBoard;
2099 if ABoard = nil then Exit;
2101 URL := ABoard.GETHEADTXTFileName;
2102 GikoSys.OpenBrowser(URL, gbtAuto);
2105 procedure TEditorForm.SaveNameMailActionExecute(Sender: TObject);
2107 SaveNameMailAction.Checked := not SaveNameMailAction.Checked;
2108 KotehanCheckBox.Enabled := SaveNameMailAction.Checked;
2111 function TEditorForm.LFusianaGet(s: String): Boolean;
2115 i := AnsiPos('fusianasan', s);
2116 if (i > 0) then Result := True else Result := False;
2119 procedure TEditorForm.BeLogInOutEActionExecute(Sender: TObject);
2121 GikoSys.Setting.BeLogin := not GikoSys.Setting.BeLogin;
2124 procedure TEditorForm.BeLogInOutEActionUpdate(Sender: TObject);
2126 if (GikoSys.Setting.BeUserID <> '') and (GikoSys.Setting.BeCode <> '') then begin
2127 if (GikoSys.Setting.BeLogin) then BeLogInOutEAction.Checked := true
2128 else BeLogInOutEAction.Checked := false;
2129 BeLogInOutEAction.Enabled := true
2131 BeLogInOutEAction.Enabled := false;
2134 // Cookie
\82Ì
\8eæ
\93¾
2135 procedure TEditorForm.GetCookie(Rawtext: String; ABoard: TBoard);
2137 COOKIE_MARK = 'Set-Cookie:';
2140 EXPIRES_MARK = 'expires=';
2146 ABoard.Cookie := '';
2147 while (AnsiPos(COOKIE_MARK, Rawtext) > 0 ) do begin
2149 tmp := Copy(Rawtext, AnsiPos(COOKIE_MARK, Rawtext) + Length(COOKIE_MARK), Length(Rawtext));
2150 Delete(Rawtext, 1, AnsiPos('Set-Cookie', Rawtext)+ Length(COOKIE_MARK));
2151 //Cookie
\82ð
\90Ø
\82è
\8fo
\82·
2152 val := Trim(GikoSys.GetTokenIndex(tmp, ';', 0));
2153 if( AnsiPos(VAL_SPID, val) > 0 ) then begin
2154 ABoard.SPID := Copy(val, AnsiPos(VAL_SPID, val) + Length(VAL_SPID), Length(val));
2155 end else if( AnsiPos(VAL_PON, val) > 0 ) then begin
2156 ABoard.PON := Copy(val, AnsiPos(VAL_PON, val) + Length(VAL_PON), Length(val));
2158 ABoard.Cookie := val + '; ';
2160 //expires
\82ð
\90Ø
\82è
\8fo
\82·
2161 val := Trim(GikoSys.GetTokenIndex(tmp, ';', 1));
2162 if( AnsiPos(EXPIRES_MARK, val) > 0) then begin
2163 Delete(val, 1, AnsiPos(EXPIRES_MARK, val) + Length(EXPIRES_MARK) - 1);
2164 ABoard.Expires := GMTToLocalDateTime(val);
2169 //Samba
\82Ì
\8e\9e\8aÔ
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
2170 procedure TEditorForm.ReadSambaTime();
2177 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
2178 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
2180 //
\95¶
\8e\9a\97ñ
\82Å
\93Ç
\82Ý
\8eæ
\82Á
\82Ä
\81A
\95Ï
\8a·
\8aÖ
\90\94\82ÅTDateTime
\82Ö
2181 if( FThreadItem <> nil ) then
2182 board := FThreadItem.ParentBoard
2186 if (board <> nil) then begin
2187 //BBSID
\82Æ
\83z
\83X
\83g
\96¼
\82ª
\88ê
\92v
\82µ
\82Ä
\82¢
\82½
\82ç BBSID@
\83z
\83X
\83g
\96¼
2188 if( board.BBSID = FHost ) then
2189 skey := board.BBSID + '@' + FHost
2191 skey := board.BBSID;
2193 tmp := ini.ReadString('Send', skey, DateTimeToStr(ZERO_DATE));
2195 //BBSID
\82Ì
\83L
\81[
\82ª
\96³
\82¢
\82È
\82çFHost
\82É
\90Ø
\82è
\91Ö
\82¦
\82Ä
\82Ý
\82é
2196 if (tmp = DateTimeToStr(ZERO_DATE)) then begin
2197 tmp := ini.ReadString('Send', FHost, DateTimeToStr(ZERO_DATE));
2199 FSambaTime := ConvertDateTimeString(tmp);
2204 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
2205 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
2208 //Samba
\82É
\8e\9e\8aÔ
\82ð
\8f\91\82«
\8d\9e\82Þ
2209 procedure TEditorForm.WriteSambaTime(ATime: TDateTime);
2213 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
2215 // ini.WriteDateTime('Send', AHost, ATime);
2221 //Samba
\82Ì
\90Ý
\92è
\92l
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
2222 function TEditorForm.ReadSettingTime(): Integer ;
2228 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
2230 if( FThreadItem <> nil ) then
2231 board := FThreadItem.ParentBoard
2235 if (board <> nil) then begin
2236 //BBSID
\82Æ
\83z
\83X
\83g
\96¼
\82ª
\88ê
\92v
\82µ
\82Ä
\82¢
\82½
\82ç BBSID@
\83z
\83X
\83g
\96¼
2237 if( board.BBSID = FHost ) then
2238 skey := board.BBSID + '@' + FHost
2240 skey := board.BBSID;
2242 Result := ini.ReadInteger('Setting', skey, -1);
2243 //BBSID
\82Ì
\83L
\81[
\82ª
\96³
\82¢
\82È
\82çFHost
\82ð
\8eg
\82¤
2244 if( Result = -1 ) then
2245 Result := ini.ReadInteger('Setting', FHost, -1);
2247 //
\8bK
\92è
\92l
\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
2248 if Result = -1 then begin
2249 ini.WriteInteger('Setting', FHost, 0);
2257 //Samba
\82É
\88ø
\82Á
\82©
\82©
\82é
\82©
\8c\9f\8d¸
\82·
\82é
2258 function TEditorForm.CheckSambaTime(ATime: TDateTime): Boolean;
2261 //Samba
\82Ì
\90Ý
\92è
\92l
\82ð
\8f\91\82«
\8d\9e\82Þ
2262 procedure TEditorForm.SetSamba24();