6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7 Dialogs, StdCtrls, ComCtrls, ExtCtrls, ToolWin, Menus, OleCtrls, Registry,
15 ActiveX, {HTTPApp,} YofUtils, 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,
20 Gesture, AppEvnts, SambaTimer;
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;
47 NameBasePanel: TPanel;
50 NameComboBox: TComboBox;
51 MailComboBox: TComboBox;
53 SendToolButton: TToolButton;
54 OutBoxToolButton: TToolButton;
55 ToolButton5: TToolButton;
56 UndoToolButton: TToolButton;
57 CutToolButton: TToolButton;
58 CopyToolButton: TToolButton;
59 PasteToolButton: TToolButton;
60 ToolButton3: TToolButton;
61 TransToolButton: TToolButton;
62 TopToolButton: TToolButton;
64 IdAntiFreeze: TIdAntiFreeze;
65 ToolButton1: TToolButton;
66 ToolButton2: TToolButton;
67 ActionList: TActionList;
81 SageCheckBox: TCheckBox;
82 IdLogDebug: TIdLogDebug;
85 KotehanCheckBox: TCheckBox;
89 SelectAllAction: TAction;
91 SelectAll1: TMenuItem;
92 QuotePasteAction: TAction;
93 QuotePasteMenuItem: TMenuItem;
95 SpaceToNBSPAction: TAction;
96 AmpToCharRefAction: TAction;
97 SpaceTabnbsp1: TMenuItem;
99 BoardInformationTab: TTabSheet;
100 BoardtopTab: TTabSheet;
101 TitlePictureBrowser: TWebBrowser;
103 BoardInformationMemo: TMemo;
104 GetSETTINGTXTAction: TAction;
106 SETTINGTXT2: TMenuItem;
107 GetTitlePictureAction: TAction;
109 GetHeadTXTAction: TAction;
111 RocalRuleTab: TTabSheet;
112 WebBrowser1: TWebBrowser;
113 CalcCapacityAction: TAction;
116 LocalRule: TMenuItem;
119 LocalRuleBrowse: TMenuItem;
120 ToolButton4: TToolButton;
121 ToolButton6: TToolButton;
122 SaveNameMailAction: TAction;
123 ToolButton7: TToolButton;
124 BeLogInOutEAction: TAction;
125 UpdateSambaAction: TAction;
128 InputAssistAction: TAction;
129 InputAssistPopupMenu: TPopupMenu;
131 ApplicationEvents1: TApplicationEvents;
132 ToolButton8: TToolButton;
133 ToolButton9: TToolButton;
134 ShowInputAssistForm: TAction;
135 ReleaseCookieAction: TAction;
138 procedure EditorPageChange(Sender: TObject);
139 procedure FormCreate(Sender: TObject);
140 procedure BrowserStatusTextChange(Sender: TObject;
141 const Text: WideString);
142 procedure FormClose(Sender: TObject; var Action: TCloseAction);
143 procedure FormDestroy(Sender: TObject);
144 procedure SendActionExecute(Sender: TObject);
145 procedure SaveActionExecute(Sender: TObject);
146 procedure AbortActionExecute(Sender: TObject);
147 procedure CloseActionExecute(Sender: TObject);
148 procedure UndoActionExecute(Sender: TObject);
149 procedure CutActionExecute(Sender: TObject);
150 procedure CopyActionExecute(Sender: TObject);
151 procedure PasteActionExecute(Sender: TObject);
152 procedure SendActionUpdate(Sender: TObject);
153 procedure SaveActionUpdate(Sender: TObject);
154 procedure CloseActionUpdate(Sender: TObject);
155 procedure UndoActionUpdate(Sender: TObject);
156 procedure CutActionUpdate(Sender: TObject);
157 procedure CopyActionUpdate(Sender: TObject);
158 procedure PasteActionUpdate(Sender: TObject);
159 procedure TopActionExecute(Sender: TObject);
160 procedure TopActionUpdate(Sender: TObject);
161 procedure SageCheckBoxClick(Sender: TObject);
162 procedure MailComboBoxChange(Sender: TObject);
163 procedure TransActionExecute(Sender: TObject);
164 procedure TransActionUpdate(Sender: TObject);
165 procedure IdLogDebugReceive(ASender: TIdConnectionIntercept;
167 procedure IdLogDebugSend(ASender: TIdConnectionIntercept;
169 procedure SelectAllActionExecute(Sender: TObject);
170 procedure StatusBarResize(Sender: TObject);
171 procedure FormActivate(Sender: TObject);
172 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
173 procedure QuotePasteActionExecute(Sender: TObject);
174 procedure SpaceToNBSPActionExecute(Sender: TObject);
175 procedure AmpToCharRefActionExecute(Sender: TObject);
176 procedure BoardTopClick(Sender: TObject);
177 procedure GetSETTINGTXTActionExecute(Sender: TObject);
178 procedure GetTitlePictureActionUpdate(Sender: TObject);
179 procedure GetTitlePictureActionExecute(Sender: TObject);
180 procedure GetHeadTXTActionExecute(Sender: TObject);
181 procedure CalcCapacityActionExecute(Sender: TObject);
182 procedure LocalRuleClick(Sender: TObject);
183 procedure FormDeactivate(Sender: TObject);
184 procedure LocalRuleBrowseClick(Sender: TObject);
185 procedure SaveNameMailActionExecute(Sender: TObject);
186 procedure BeLogInOutEActionExecute(Sender: TObject);
187 procedure BeLogInOutEActionUpdate(Sender: TObject);
188 procedure UpdateSambaActionUpdate(Sender: TObject);
189 procedure UpdateSambaActionExecute(Sender: TObject);
190 procedure InputAssistActionExecute(Sender: TObject);
191 procedure ApplicationEvents1Message(var Msg: tagMSG;
192 var Handled: Boolean);
193 procedure ShowInputAssistFormExecute(Sender: TObject);
194 procedure ReleaseCookieActionExecute(Sender: TObject);
195 procedure GetSETTINGTXTActionUpdate(Sender: TObject);
196 procedure GetHeadTXTActionUpdate(Sender: TObject);
198 FThreadItem: TThreadItem;
200 FNameComboEdit: THandle;
201 FMailComboEdit: THandle;
204 FStatusCode: Integer;
205 FDebugStrReceive: string;
206 FDebugStrSend: string;
208 FGestures : TMouseGesture;
209 FInputAssistKey: String; ///<
\93ü
\97Í
\83A
\83V
\83X
\83g
\82Ì
\83L
\81[
210 FResistWords: TStringList; ///<
\93ü
\97Í
\83A
\83V
\83X
\83g
\82Ì
\8e«
\8f\91\82©
\82ç
\82Ì
\8c\9f\8dõ
\8c\8b\89Ê
211 FSambaTimer: TSambaTimer; ///< Samba
\91Î
\8dô
\82Ì
\83^
\83C
\83}
\81[
213 function Check: Boolean;
214 procedure SetNameList(sName, sMail: string);
215 procedure Send(ACOOKIE: string; SPID: string; PON: string; FirstWriting: Boolean);
216 function GetActiveControlHandle: THandle;
217 procedure GetSendData(Source: TStringStream);
218 procedure SaveSendFile;
219 procedure SetContent(Content: string; ABrowser: TWebBrowser);
220 function GetResultType(ResponseText: string): TGikoResultType;
221 ///
\96{
\95¶
\82Ì
\8eæ
\93¾
222 function GetBody : string;
223 //IdHttp
\82Ì
\8f\89\8aú
\89»
224 procedure InitIdHTTP(http: TIdHTTP);
225 procedure ShowBoardInformation(ABoard: TBoard; AMemo: TMemo);
226 function GetTitlePictureURL(body: TStringList; ABoard: TBoard): string;
227 procedure ShowTitlePicture();
228 function GetFusianaName(body: TStringList; ABoard: TBoard): String;
229 //!
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\8aJ
\8en
230 procedure OnGestureStart(Sender: TObject);
231 //!
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\92\86
232 procedure OnGestureMove(Sender: TObject);
233 //!
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\8fI
\97¹
234 procedure OnGestureEnd(Sender: TObject);
235 //HEAD.TXT
\8e©
\93®
\95\
\8e¦
236 procedure ShowBoardHead(ABoard: TBoard; AMemo: TMemo);
237 //LocalFusianaTrapAlart
238 function LFusianaGet(s: String): Boolean;
239 // Cookie
\82Ì
\8eæ
\93¾
240 procedure GetCookie(Rawtext: String; ABoard: TBoard);
241 //!
\93ü
\97Í
\83A
\83V
\83X
\83g
\82Ì
\83|
\83b
\83v
\83A
\83b
\83v
\83\81\83j
\83\85\81[
\82Ì
\83N
\83\8a\83b
\83N
\83C
\83x
\83\93\83g
242 procedure InputAssistMenuClick(Sender: TObject);
243 //! TMemo
\82Ì
\83J
\81[
\83\
\83\8b\88Ê
\92u
\82É
\95¶
\8e\9a\97ñ
\91}
\93ü
244 procedure InsertText(Memo: TMemo; Text: String);
245 //!
\91\97\90M
\92\86\8e~
246 procedure CancelSend(ABoard: TBoard; ASysMenu: HMENU);
247 //! Samba
\83^
\83C
\83}
\81[
\83C
\83x
\83\93\83g
248 procedure SambaTimer(Sender: TObject);
249 //!
\83E
\83B
\83\93\83h
\83E
\82Ì
\88Ê
\92u
\82Æ
\83T
\83C
\83Y
\82Ì
\90Ý
\92è
250 procedure SetWindowRect;
251 //!
\8ag
\92£
\83^
\83u
\90Ý
\92è
252 procedure SetExtraTab;
254 procedure CreateParams(var Params: TCreateParams); override;
258 procedure SetThreadItem(Item: TThreadItem);
259 procedure SetBoard(Item: TBoard);
260 procedure UpdateSambaStatus;
261 property BBSID: string read FBBSID write FBBSID;
267 Giko, ItemDownload, MojuUtils, IdGlobal, GikoMessage, Imm,
268 InputAssistDataModule, InputAssist, HTMLCreate;
270 CAPTION_NAME_NEW: string = '
\83M
\83R
\83i
\83r
\83X
\83\8c\97§
\82Ä
\83G
\83f
\83B
\83^';
271 CAPTION_NAME_RES: string = '
\83M
\83R
\83i
\83r
\83\8c\83X
\83G
\83f
\83B
\83^';
273 //
\83G
\83f
\83B
\83b
\83g
\83E
\83B
\83\93\83h
\83E
\82ð
\89E
\89º
\82É
\82¸
\82ç
\82µ
\82Ä
\8aJ
\82
\88Ú
\93®
\97Ê
277 //DAX
\82³
\82ñ±Ø¶ÞÄ!(
\81L
\81¤
\81M)
278 READCGI_ERR = '-ERR';
279 READCGI_INCR = '-INCR';
281 READCGI_PARTIAL = '+PARTIAL';
282 READCGI_ERR_FOUND_KAKO = '-ERR
\89ß
\8b\8e\83\8d\83O
\91q
\8cÉ
\82Å
\94
\8c©';
283 READCGI_ERR_NOT_HTML = '-ERR html
\89»
\91Ò
\82¿';
284 READCGI_ERR_NOT_FOUND = '-ERR
\82»
\82ñ
\82È
\94Âor
\83X
\83\8c\83b
\83h
\82È
\82¢
\82Å
\82·
\81B';
285 READCGI_ERR_ABONE = '-ERR
\82Ç
\82±
\82©
\82Å
\82 \82Ú
\81[
\82ñ
\82ª
\82 \82Á
\82½
\82Ý
\82½
\82¢
\82Å
\82·
\81B';
286 READCGI_ERR_TIMEOUT = '-ERR
\8ew
\92è
\8e\9e\8aÔ
\82ª
\89ß
\82¬
\82Ü
\82µ
\82½
\81B';
287 READCGI_ERR_CANTUSE = '-ERR
\82à
\82¤
\81@
\82Â
\82©
\82¦
\82Ü
\82¹
\82ñ';
288 RES2CH_TRUE = '<!-- 2ch_X:true -->';
289 RES2CH_FALSE = '<!-- 2ch_X:false -->';
290 RES2CH_ERROR = '<!-- 2ch_X:error -->';
291 RES2CH_CHECK = '<!-- 2ch_X:check -->';
292 RES2CH_COOKIE = '<!-- 2ch_X:cookie -->';
296 StartPos, EndPos: Integer;
301 {constructor TEditorForm.Create(AOwner: TComponent; Item: TBoard);
303 inherited Create(AOwner);
306 procedure TEditorForm.CreateParams(var Params: TCreateParams);
309 if FormStyle in [fsNormal, fsStayOnTop] then
310 if BorderStyle in [bsSingle, bsSizeable] then begin
311 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
312 Params.WndParent := 0;
316 {procedure TEditorForm.CreateParams(var Params: TCreateParams);
318 inherited CreateParams(Params);
319 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
322 procedure TEditorForm.FormCreate(Sender: TObject);
325 FSambaTimer := TSambaTimer.Create(Self);
326 FSambaTimer.Interval := 0;
327 Browser.Navigate('about:blank');
328 TitlePictureBrowser.Navigate('about:blank');
332 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\88Ê
\92u
\90Ý
\92è
335 EditorPage.ActivePage := EditorTab;
336 FNameComboEdit := GetWindow(NameComboBox.Handle, GW_CHILD);
337 FMailComboEdit := GetWindow(MailComboBox.Handle, GW_CHILD);
338 NameComboBox.Items.Assign(GikoSys.Setting.NameList);
339 MailComboBox.Items.Assign(GikoSys.Setting.MailList);
341 //
\94¼
\93§
\96¾
\97\98\97p
\89Â
\94\
\90Ý
\92è
342 TransAction.Enabled := GikoSys.CanUser32DLL;
344 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\83X
\83e
\83C
\8fó
\91Ô
345 if GikoSys.Setting.EditWindowStay then begin //
\83X
\83e
\83C
\8fó
\91Ô
346 SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
347 TopAction.Checked := true;
348 TopToolButton.Down := true;
349 end else begin //
\83X
\83e
\83C
\82µ
\82È
\82¢
350 SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
351 TopAction.Checked := false;
352 TopToolButton.Down := false;
355 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\94¼
\93§
\96¾
\8fó
\91Ô
356 if(GikoSys.Setting.EditWindowTranslucent) and (TransAction.Enabled) then begin //
\94¼
\93§
\96¾
\81i
\83g
\83\89\83\93\83X
\83\8b\81[
\83Z
\83\93\83g
\81j
\8fó
\91Ô
358 TransAction.Checked := true;
359 TransToolButton.Down := true;
360 end else begin //
\95s
\93§
\96¾
362 TransAction.Checked := false;
363 TransToolButton.Down := false;
365 //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
366 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked;
368 SpaceToNBSPAction.Checked := GikoSys.Setting.SpaceToNBSP;
369 AmpToCharRefAction.Checked := GikoSys.Setting.AmpToCharRef;
370 //
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\81{
\94Â
\83g
\83b
\83v
\89æ
\91\9c\82Ì
\83^
\83u
\82Ì
\90Ý
\92è
373 //
\83L
\81[
\90Ý
\92è
\82Ì
\93Ç
\82Ý
\8d\9e\82Ý
374 GikoSys.LoadKeySetting(ActionList, GikoSys.GetEditorKeyFileName);
375 //
\83}
\83E
\83X
\83W
\83F
\83X
\83`
\83\83\81[
\82Ì
\83C
\83\93\83X
\83g
\81[
\83\8b
376 if GikoSys.Setting.GestureEnabled then begin
378 FGestures := TMouseGesture.Create;
379 GikoSys.Setting.Gestures.ClearGesture;
381 GikoSys.Setting.Gestures.LoadGesture(
382 GikoSys.Setting.GetGestureFileName, ActionList );
383 MouseGesture.OnGestureStart := OnGestureStart;
384 MouseGesture.OnGestureMove := OnGestureMove;
385 MouseGesture.OnGestureEnd := OnGestureEnd;
386 MouseGesture.SetHook( Handle );
388 SaveNameMailAction.Checked := True;
390 procedure TEditorForm.SetBoard(Item: TBoard);
393 Caption := CAPTION_NAME_NEW + ' - [' + Item.Title + ']';
394 NameComboBox.Text := FBoard.KotehanName;
395 MailComboBox.Text := FBoard.KotehanMail;
396 SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
397 TitlePanel.Visible := True;
399 if (FSambaTimer.SetBoard(FBoard) >= 0) then begin
402 FSambaTimer.OnTimer := SambaTimer;
405 ShowBoardInformation(FBoard, BoardInformationMemo);
409 procedure TEditorForm.SetThreadItem(Item: TThreadItem);
412 Caption := CAPTION_NAME_RES + ' - [' + FThreadItem.Title + ']';
413 NameComboBox.Text := FThreadItem.ParentBoard.KotehanName;
414 MailComboBox.Text := FThreadItem.ParentBoard.KotehanMail;
415 SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
416 TitlePanel.Visible := False;
418 if (FSambaTimer.SetBoard(FThreadItem.ParentBoard) >= 0) then begin
421 FSambaTimer.OnTimer := SambaTimer;
424 ShowBoardInformation(FThreadItem.ParentBoard, BoardInformationMemo);
428 function TEditorForm.GetBody : string;
437 body := BodyEdit.Text;
438 if AmpToCharRefAction.Checked then
439 // &
\82Ì
\92u
\8a·
\82Í
\88ê
\94Ô
\8dÅ
\8f\89\82É
\82â
\82é
\82±
\82Æ
440 body := CustomStringReplace( body, '&', '&' );
441 if SpaceToNBSPAction.Checked then begin
443 tail := p + Length( body );
445 while p < tail do begin
452 tmp := tmp + ' ';
453 until (len mod TAB_LENGTH) = 0;
458 tmp := tmp + p^; Inc( p );
464 tmp := tmp + ' ';
470 //
\8eÀ
\91Ì
\8eQ
\8fÆ
\82Í 1
\95¶
\8e\9a\95ª
475 while p < tail do begin
476 if p^ in ['a'..'z', 'A'..'Z', '0'..'9', '#'] then begin
478 end else if p^ = ';' then begin
490 if p^ in kYofKanji then begin
491 tmp := tmp + p^; Inc( p );
492 tmp := tmp + p^; Inc( p );
495 tmp := tmp + p^; Inc( p );
507 procedure TEditorForm.SetFont;
509 BodyEdit.Font.Name := GikoSys.Setting.EditorFontName;
510 BodyEdit.Font.Size := GikoSys.Setting.EditorFontSize;
511 BodyEdit.Font.Color := GikoSys.Setting.EditorFontColor;
512 BodyEdit.Color := GikoSys.Setting.EditorBackColor;
515 procedure TEditorForm.Preview;
524 if FThreadItem = nil then begin
526 Title := THTMLCreate.RepHtml(TitleEdit.Text);
528 No := IntToStr(FThreadItem.Count + 1);
529 Title := THTMLCreate.RepHtml(FThreadItem.Title);
533 Namae := THTMLCreate.RepHtml(NameComboBox.Text);
534 Mail := THTMLCreate.RepHtml(MailComboBox.Text);
535 Body := THTMLCreate.RepHtml(Body);
536 Body := CustomStringReplace(Body, #13#10, '<br>', False);
539 if Trim(Namae) = '' then
540 Namae := '
\96¼
\96³
\82µ
\82³
\82ñ';
542 s := THTMLCreate.CreatePreviewHTML(Title, No, Mail, Namae, Body);
544 SetContent(s, Browser);
547 procedure TEditorForm.EditorPageChange(Sender: TObject);
551 if FThreadItem = nil then
554 tmpBoard := FThreadItem.ParentBoard;
556 if tmpBoard = nil then Exit;
558 if EditorPage.ActivePage = PreviewTab then begin
560 end else if EditorPage.ActivePage = RocalRuleTab then begin
561 if not FileExists(tmpBoard.GETHEADTXTFileName) then begin
562 LocalEdit.Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\96¢
\8eæ
\93¾';
565 ShowBoardHead(tmpBoard, LocalEdit);
567 Browser.Navigate('about:blank');
571 procedure TEditorForm.BrowserStatusTextChange(Sender: TObject;
572 const Text: WideString);
574 if EditorPage.ActivePage = PreviewTab then begin
575 StatusBar.Panels[0].Text := Text;
577 StatusBar.Panels[0].Text := '';
581 function TEditorForm.Check: Boolean;
583 REQUIRED: string = '
\82ª
\93ü
\97Í
\82³
\82ê
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B';
584 ERROR: string = '
\83G
\83\89\81[';
591 if FThreadItem = nil then
594 Board := FThreadItem.ParentBoard;
596 if (not GikoSys.Setting.UseMachineTime) and
597 ((Board.LastGetTime = 0) or
598 (Board.LastGetTime = ZERO_DATE)) then begin
599 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
600 + '
\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¢';
601 MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
603 end else if BodyEdit.Text = '' then begin
604 Msg := '
\96{
\95¶' + REQUIRED;
605 MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
607 end else if (FBoard <> nil) and (Trim(TitleEdit.Text) = '') then begin
608 Msg := '
\83^
\83C
\83g
\83\8b' + REQUIRED;
609 MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
612 if (not GikoSys.Dolib.Connected) and (AnsiPos('
\81\9c', NameComboBox.Text) <> 0) then begin
613 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
614 + '
\82±
\82Ì
\82Ü
\82Ü
\91\97\90M
\82µ
\82Ä
\82à
\82æ
\82ë
\82µ
\82¢
\82Å
\82·
\82©
\81H';
615 rc := MsgBox(Handle, Msg, '
\8am
\94F', MB_YESNO or MB_ICONQUESTION);
616 Result := (rc = IDYES);
621 procedure TEditorForm.FormClose(Sender: TObject; var Action: TCloseAction);
627 procedure TEditorForm.FormDestroy(Sender: TObject);
629 wp: TWindowPlacement;
631 //
\8dÅ
\91å
\89»
\81E
\83E
\83B
\83\93\83h
\83E
\88Ê
\92u
\95Û
\91¶
632 wp.length := sizeof(wp);
633 GetWindowPlacement(Handle, @wp);
635 GikoSys.Setting.EditWindowTop := wp.rcNormalPosition.Top;
636 GikoSys.Setting.EditWindowLeft := wp.rcNormalPosition.Left;
637 GikoSys.Setting.EditWindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
638 GikoSys.Setting.EditWindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
639 GikoSys.Setting.EditWindowMax := WindowState = wsMaximized;
640 //GikoSys.Setting.EditWindowStay := FormStyle = fsStayOnTop; //
\83X
\83e
\83C
\8fó
\91Ô
\82Ì
\95Û
\91¶
641 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked; //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
647 procedure TEditorForm.SetNameList(sName, sMail: string);
649 if SaveNameMailAction.Checked then begin
650 if Trim(sName) <> '' then begin
651 if GikoSys.Setting.NameList.IndexOf(sName) = -1 then
652 GikoSys.Setting.NameList.Insert(0, sName);
654 if Trim(sMail) <> '' then begin
655 if GikoSys.Setting.MailList.IndexOf(sMail) = -1 then
656 GikoSys.Setting.MailList.Insert(0, sMail);
661 function TEditorForm.GetActiveControlHandle: THandle;
663 if EditorPage.ActivePage = EditorTab then begin
664 if ActiveControl = NameComboBox then
665 Result := FNameComboEdit
666 else if ActiveControl = MailComboBox then
667 Result := FMailComboEdit
668 else if ActiveControl = BodyEdit then
669 Result := BodyEdit.Handle
670 else if ActiveControl = TitleEdit then
671 Result := TitleEdit.Handle
674 end else if Editorpage.ActivePage = BoardInformationTab then begin
675 if ActiveControl = BoardInformationMemo then
676 Result := BoardInformationMemo.Handle
679 end else if Editorpage.ActivePage = RocalRuleTab then begin
680 if ActiveCOntrol = LocalEdit then
681 Result := LocalEdit.Handle
688 procedure TEditorForm.SetContent(Content: string; ABrowser: TWebBrowser);
692 if ABrowser.Document <> nil then begin
693 doc := Idispatch( olevariant(ABrowser.ControlInterface).Document) as IHTMLDocument2;
696 doc.charset := 'Shift_JIS';
701 procedure TEditorForm.InitIdHTTP(http: TIdHTTP);
704 http.ProxyParams.BasicAuthentication := False;
705 if GikoSys.Setting.WriteProxy then begin
706 http.ProxyParams.ProxyServer := GikoSys.Setting.WriteProxyAddress;
707 http.ProxyParams.ProxyPort := GikoSys.Setting.WriteProxyPort;
708 http.ProxyParams.ProxyUsername := GikoSys.Setting.WriteProxyUserID;
709 http.ProxyParams.ProxyPassword := GikoSys.Setting.WriteProxyPassword;
710 if GikoSys.Setting.ReadProxyUserID <> '' then
711 http.ProxyParams.BasicAuthentication := True;
713 http.ProxyParams.ProxyServer := '';
714 http.ProxyParams.ProxyPort := 80;
715 http.ProxyParams.ProxyUsername := '';
716 http.ProxyParams.ProxyPassword := '';
718 Indy.Request.UserAgent := GikoSys.GetUserAgent;
719 Indy.Request.AcceptEncoding := '';
721 //!
\91\97\90M
\92\86\8e~
\82Ì
\82½
\82ß
\82Ì
\83\81\83j
\83\85\81[
\82Ì
\8dÄ
\90¶
722 procedure TEditorForm.CancelSend(ABoard: TBoard; ASysMenu: HMENU);
727 EnableMenuItem(ASysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
731 procedure TEditorForm.Send(ACOOKIE: string; SPID: string; PON: string; FirstWriting: Boolean);
733 MSG_FUSIANA : string = '
\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 +
734 '
\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' +
735 #13#10#13#10'
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H';
737 TextStream: TStringStream;
738 Source: TStringStream;
739 ResponseText: string;
742 State: TGikoDownloadState;
743 ResultType: TGikoResultType;
748 //fusianasan
\83g
\83\89\83b
\83v by
\92è
\8aú
\95Ö
753 {Protocol,Host, Path, Document, Port, Bookmark : String;}
757 Namae := THTMLCreate.RepHtml(NameComboBox.Text);
758 if FThreadItem = nil then
761 Board := FThreadItem.ParentBoard;
764 // tmpRawheader := '';
766 if FThreadItem = nil then begin
767 URL := FBoard.GetSendURL;
768 RefURL := GikoSys.UrlToServer(FBoard.URL) + 'test/bbs.cgi';
770 URL := FThreadItem.GetSendURL;
771 RefURL := FThreadItem.URL;
773 // Indy.Request.UserAgent := GikoSys.GetUserAgent;
774 Indy.Request.Referer := RefURL;
775 // Indy.Request.AcceptEncoding := '';
778 if ACOOKIE <> '' then
781 Cookie := Cookie + 'SPID=' + SPID + '; ';
783 Cookie := Cookie + 'PON=' + PON + '; ';
785 //
\83z
\83X
\83g
\82ª2ch
\82Å
\81ABe
\82ÉLogin
\82µ
\82Ä
\82¢
\82ê
\82ÎBE
\82Ì
\83f
\81[
\83^
\82ð
\91\97\82é
786 //GikoSys.ParseURI( URL, Protocol,Host, Path, Document, Port, Bookmark );
787 //if GikoSys.Is2chHost(Host) and GikoSys.Setting.BeLogin then
788 if (Board.Is2ch) then begin
789 //
\8cÅ
\92è
\82Ì
\83N
\83b
\83L
\81[
\82ª
\82 \82ê
\82Î
\90H
\82í
\82¹
\82é
790 if Length(GikoSys.Setting.FixedCookie) > 0 then begin
791 //
\83z
\83X
\83g
\82ª2ch
\82Ì
\8fê
\8d\87\81C
\8cÅ
\92è
\82Ì
\83N
\83b
\83L
\81[
\82ð
\90H
\82í
\82¹
\82é
792 Cookie := Cookie + GikoSys.Setting.FixedCookie + '; ';
794 if (GikoSys.Setting.BeLogin) then begin
795 Cookie := Cookie + 'MDMD=' + GikoSys.Setting.BeCode + '; '
796 + 'DMDM=' + GikoSys.Setting.BeUserID + '; ';
801 Cookie := 'Cookie: ' + Cookie + 'NAME=' + NameComboBox.Text + '; MAIL=' + MailComboBox.Text;
803 sysMenu := GetSystemMenu( Handle, false );
804 EnableMenuItem( sysMenu, SC_CLOSE, MF_GRAYED );
806 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
809 Indy.Request.CustomHeaders.Clear;
810 // Indy.Request.CacheControl := 'no-cache';
811 Indy.Request.CustomHeaders.Add('Pragma: no-cache');
812 Indy.Request.AcceptLanguage := 'ja';
813 Indy.Request.Accept := 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
814 Indy.Request.ContentType := 'application/x-www-form-urlencoded';
815 Indy.Request.CustomHeaders.Add(Cookie);
816 TextStream := TStringStream.Create('');
817 Source := TStringStream.Create('');
820 FDebugStrReceive := '';
823 if (FirstWriting) then begin
824 //
\83t
\83V
\83A
\83i
\83g
\83\89\83b
\83v
\8cx
\8d\90(LocalMode) by
\92è
\8aú
\95Ö
825 if GikoSys.Setting.LocalTrapAtt then begin
826 if LFusianaGet(Namae) then begin
827 MsgResult := MsgBox( Handle, MSG_FUSIANA, '
\8fî
\95ñ',
828 MB_YESNO or MB_ICONQUESTION);
829 if MsgResult = IDNO then begin
830 CancelSend( Board, SysMenu );
834 if ((Namae = '
\8eR
\8dè
\8fÂ') or (Namae = 'fusianasan')) then begin
835 MsgResult := MsgBox(Handle, MSG_FUSIANA, '
\8fî
\95ñ',
836 MB_YESNO or MB_ICONQUESTION);
837 if MsgResult = IDNO then begin
838 CancelSend( Board, SysMenu );
844 if GikoSys.Setting.RemoteTrapAtt then begin
845 if FThreadItem = nil then
848 ABoard := FThreadItem.ParentBoard;
850 if ABoard = nil then Exit;
852 if FileExists(ABoard.GetSETTINGTXTFileName) then begin
853 body := TStringList.Create;
855 body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
856 Remote := GetFusianaName(body, ABoard);
861 //Setting.txt
\82ª
\82È
\82©
\82Á
\82½
\82ç
\8eæ
\93¾
862 //
\8eI
\82É
\95\89\89×
\82ª
\82©
\82©
\82è
\82»
\82¤...
863 //if not FileExists(ABoard.GetSETTINGTXTFileName) then begin
864 GetSETTINGTXTAction.Execute;
865 body := TStringList.Create;
867 if FileExists(ABoard.GetSETTINGTXTFileName) then begin
868 body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
869 Remote := GetFusianaName(body, ABoard);
876 if Remote = 'fusianasan' then begin
878 Handle, MSG_FUSIANA, '
\8fî
\95ñ',
879 MB_YESNO or MB_ICONQUESTION);
880 if MsgResult = IDNO then begin
881 CancelSend( Board, SysMenu );
889 IdAntiFreeze.Active := True;
891 Indy.Post(URL, Source, TextStream);
893 IdAntiFreeze.Active := False;
895 ResponseText := TextStream.DataString;
897 ResultType := GetResultType(ResponseText);
900 if ResultType = grtOK then begin
901 if (GikoSys.Setting.UseSamba) and (FSambaTimer.Enabled) then
903 FSambaTimer.WriteSambaTime(Now());
905 State := gdsComplete;
906 end else if ResultType = grtCookie then begin
907 //
\83\8b\81[
\83v
\96h
\8e~
908 if not FirstWriting then
909 raise Exception.Create('');
911 MsgResult := MsgBox( Handle,
912 '
\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 +
913 '
\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 +
914 '
\91S
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
916 MB_YESNO or MB_ICONQUESTION);
918 if MsgResult = IDYES then begin
919 GetCookie(Indy.Response.RawHeaders.Text, Board);
921 if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
922 raise Exception.Create('');
924 //
\82à
\82¤
\88ê
\89ñ
\82±
\82Ì
\83\81\83\
\83b
\83h
925 Send(Board.Cookie, Board.SPID, Board.PON, False);
928 CancelSend( Board, SysMenu );
931 end else if ResultType = grtCheck then begin
932 //
\83\8b\81[
\83v
\96h
\8e~
933 if not FirstWriting then
934 raise Exception.Create('');
936 MsgResult := MsgBox( Handle,
937 '
\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 +
938 '
\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 +
939 '
\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 +
940 '
\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 +
942 '
\91S
\90Ó
\94C
\82ð
\95\89\82¤
\82±
\82Æ
\82ð
\8f³
\91ø
\82µ
\82Ä
\8f\91\82«
\8d\9e\82Ý
\82Ü
\82·
\82©
\81H',
944 MB_YESNO or MB_ICONQUESTION);
946 if MsgResult = IDYES then begin
947 GetCookie(Indy.Response.RawHeaders.Text, Board);
949 if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
950 raise Exception.Create('');
952 Send(Board.Cookie, Board.SPID, Board.PON, False);
955 CancelSend( Board, SysMenu );
959 if (GikoSys.Setting.UseSamba) and (FSambaTimer.Enabled) then
961 FSambaTimer.WriteSambaTime(Now());
965 raise Exception.Create('');
968 on E: EIdConnectException do begin
970 ResponseText := '<html><body>'
971 + '<div>
\90Ú
\91±
\82ª
\8e¸
\94s
\82µ
\82Ü
\82µ
\82½<br>'
972 + '
\89ñ
\90ü
\82â
\83v
\83\8d\83L
\83V
\82Ì
\8fó
\91Ô
\82ð
\92²
\82×
\82Ä
\82
\82¾
\82³
\82¢<br></div>'
973 + '<br><br><div>' + E.Message + '</div>'
976 on E: Exception do begin
979 FDebugStrReceive := AnsiReplaceText(FDebugStrReceive, '<', '<');
980 FDebugStrReceive := AnsiReplaceText(FDebugStrReceive, '>', '>');
981 FDebugStrSend := AnsiReplaceText(FDebugStrSend, '<', '<');
982 FDebugStrSend := AnsiReplaceText(FDebugStrSend, '>', '>');
984 ResponseText := '<html><body>' + TextStream.DataString;
985 ResponseText := AnsiReplaceText(ResponseText, '</body>', '');
986 ResponseText := AnsiReplaceText(ResponseText, '</html>', '');
987 ResponseText := ResponseText + '<hr><div align="left"><pre>';
988 ResponseText := ResponseText + '<b>
\82±
\82±
\82©
\82ç
\83M
\83R
\83i
\83r
\82Ì
\8fî
\95ñ</b>'#13#10;
989 ResponseText := ResponseText + #13#10'
\81\9c\91\97\90M'#13#10;
990 ResponseText := ResponseText + FDebugStrSend;
991 ResponseText := ResponseText + #13#10'
\81\9c\8eó
\90M'#13#10;
992 ResponseText := ResponseText + FDebugStrReceive;
993 ResponseText := ResponseText + '</pre></div></body></html>';
996 FStatusCode := Indy.ResponseCode;
1002 //sysMenu := GetSystemMenu( Handle, true );
1003 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
1004 DrawMenuBar(Handle);
1007 //
\94ñ
\8cö
\8e®
\83M
\83R
\83i
\83r
\94Â
\82È
\82Ç
\82Ì2ch
\8cÝ
\8a·
\83X
\83N
\83\8a\83v
\83g
\97p
1008 //2ch
\88È
\8aO
\82Å
\82©
\82ÂResponceCode
\82ª302Found
\82Å
\8f\91\82«
\8d\9e\82Ý
\8a®
\97¹
1009 //if (not Board.Is2ch) and (FStatusCode = 302) then begin
1010 if FStatusCode = 302 then begin
1011 GikoForm.PlaySound('ResEnd');
1013 if FThreadItem = nil then
1014 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, gmiOK)
1016 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, gmiOK);
1020 if State = gdsComplete then begin
1021 GikoForm.PlaySound('ResEnd');
1023 if FThreadItem = nil then
1024 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, gmiOK)
1026 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, gmiOK);
1028 end else if State = gdsError then begin
1029 if FThreadItem = nil then
1030 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, gmiOK)
1032 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, gmiOK);
1034 EditorPage.ActivePage := PreviewTab;
1035 SetContent(ResponseText, Browser);
1036 end else if State = gdsAbort then begin
1037 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiSAD);
1041 function TEditorForm.GetResultType(ResponseText: string): TGikoResultType;
1043 if AnsiPos('
\8f\91\82«
\82±
\82Ý
\82ª
\8fI
\82í
\82è
\82Ü
\82µ
\82½', ResponseText) <> 0 then
1045 else if (AnsiPos('
\83N
\83b
\83L
\81[
\82ª
\82È
\82¢
\82©
\8aú
\8cÀ
\90Ø
\82ê
\82Å
\82·', ResponseText) > 0) or
1046 (AnsiPos('<title>
\83N
\83b
\83L
\81[
\8am
\94F
\81I</title>', ResponseText) > 0) or
1047 (AnsiPos('<title>
\81¡
\83N
\83b
\83L
\81[
\8am
\94F
\81I
\81¡</title>', ResponseText) > 0) or
1048 //(AnsiPos('
\83N
\83b
\83L
\81[
\8am
\94F', ResponseText) > 0) or
1049 (AnsiPos(RES2CH_COOKIE, ResponseText) > 0) then
1051 else if (AnsiPos('<font size=+2 color=#FF0000>
\8f\91\82«
\8d\9e\82Ý
\83`
\83F
\83b
\83N
\81I </font>', ResponseText) > 0) or
1052 (AnsiPos('<title>
\81¡
\8f\91\82«
\8d\9e\82Ý
\8am
\94F
\82µ
\82Ü
\82·
\81¡</title>', ResponseText) > 0) or
1053 (AnsiPos('<title>
\93\8a\8de
\8am
\94F</title>', ResponseText) > 0) or
1054 (AnsiPos('<b>
\8f\91\82«
\82±
\82Ý
\8am
\94F</b>', ResponseText) > 0) or
1055 (AnsiPos('="../test/subbbs.cgi">', ResponseText) > 0) or
1056 (AnsiPos(RES2CH_FALSE, ResponseText) > 0) then
1058 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
1059 (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
1066 procedure TEditorForm.GetSendData(Source: TStringStream);
1075 if FThreadItem = nil then
1078 Board := FThreadItem.ParentBoard;
1080 if GikoSys.Setting.UseMachineTime then begin
1081 if GikoSys.Setting.TimeAdjust then
1082 Adjust := Gikosys.Setting.TimeAdjustSec
1084 Adjust := GikoSys.Setting.TimeAdjustSec * -1;
1085 SendTime := GikoSys.DateTimeToInt(Now) - (9 * 60 * 60) + Adjust
1087 if (Board.LastGetTime = 0) or (Board.LastGetTime = ZERO_DATE) then
1088 SendTime := GikoSys.DateTimeToInt(Now)
1090 SendTime := GikoSys.DateTimeToInt(Board.LastGetTime);
1095 SessionID := GikoSys.Dolib.SessionID;
1096 if SessionID <> '' then
1097 s := 'sid=' + HttpEncode(SessionID) + '&'
1100 s := s + 'subject=&'
1101 + 'FROM=' + HttpEncode(NameComboBox.Text) + '&'
1102 + 'mail=' + HttpEncode(MailComboBox.Text) + '&'
1103 + 'MESSAGE=' + HttpEncode(body) + '&'
1104 + 'bbs=' + Board.BBSID + '&'
1105 + 'time=' + IntToStr(SendTime) + '&';
1107 if FThreadItem = nil then begin
1108 s := s + 'subject=' + HttpEncode(TitleEdit.Text) + '&';
1109 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;
1111 s := s + 'key=' + ChangeFileExt(FThreadItem.FileName, '') + '&';
1112 s := s + 'submit=' + HttpEncode('
\8f\91\82«
\8d\9e\82Þ') + #13#10;
1114 Source.WriteString(s);
1117 procedure TEditorForm.SaveSendFile;
1122 ini := TMemIniFile.Create(GikoSys.GetSentFileName);
1124 sDate := IntToStr(GikoSys.DateTimeToInt(Now));
1126 ini.WriteString(sDate, 'Name', NameComboBox.Text);
1127 ini.WriteString(sDate, 'EMail', MailComboBox.Text);
1128 ini.WriteString(sDate, 'Body', HttpEncode(BodyEdit.Text));
1129 ini.WriteInteger(sDate, 'Status', FStatusCode);
1130 ini.WriteDateTime(sDate, 'Date', Now);
1131 if FThreadItem = nil then begin
1132 ini.WriteString(sDate, 'Title', MojuUtils.Sanitize(TitleEdit.Text));
1133 ini.WriteString(sDate, 'BBS', FBoard.BBSID);
1134 ini.WriteInteger(sDate, 'NewThread', 1);
1136 ini.WriteString(sDate, 'Title', FThreadItem.Title);
1137 ini.WriteString(sDate, 'BBS', FThreadItem.ParentBoard.BBSID);
1138 ini.WriteString(sDate, 'Key', ChangeFileExt(FThreadItem.FileName, ''));
1147 procedure TEditorForm.SendActionExecute(Sender: TObject);
1149 TITLE_SAMBA : string = 'Samba24
\8cx
\8d\90';
1154 state : TGikoDownloadState;
1161 SendAction.Enabled := False;
1162 Application.ProcessMessages;
1163 if not Check then Exit;
1165 if FThreadItem = nil then
1168 Board := FThreadItem.ParentBoard;
1170 if FThreadItem = nil then begin
1171 rc := GikoUtil.MsgBox(Handle,
1172 '
\81u' + Board.Title + '
\81v
\94Â
\82É
\90V
\82µ
\82¢
\83X
\83\8c\83b
\83h
\97§
\82Ä
\82Ü
\82·'#13#10#13#10
1173 + '
\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
1174 + '
\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
1175 + '
\81u
\82Í
\82¢
\81v
\82ð
\89\9f\82·
\82Æ
\91\97\90M
\82µ
\82Ü
\82·',
1177 MB_ICONQUESTION or MB_YESNO);
1178 if rc <> ID_YES then
1182 SetNameList(NameComboBox.Text, MailComboBox.Text);
1183 if (KotehanCheckBox.Enabled) and (KotehanCheckBox.Checked) then begin
1184 Board.KotehanName := NameComboBox.Text;
1185 Board.KotehanMail := MailComboBox.Text;
1188 if Board.IsBoardPlugInAvailable then begin
1191 if FThreadItem = nil then begin
1192 //
\83X
\83\8c\97§
\82Ä
1193 state := TGikoDownloadState( Board.BoardPlugIn.CreateThread(
1194 DWORD( Board ), TitleEdit.Text, NameComboBox.Text, MailComboBox.Text, body ) );
1196 if state = gdsComplete then begin
1197 GikoForm.PlaySound('ResEnd');
1199 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, gmiOK);
1202 end else if State = gdsError then begin
1203 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmSureError), nil, gmiNG);
1204 end else if State = gdsAbort then begin
1205 GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiNG);
1209 state := TGikoDownloadState( FThreadItem.ParentBoard.BoardPlugIn.WriteThread(
1210 DWORD( FThreadItem ), NameComboBox.Text, MailComboBox.Text, body ) );
1212 if state = gdsComplete then begin
1213 GikoForm.PlaySound('ResEnd');
1215 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, gmiOK);
1218 end else if State = gdsError then begin
1219 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmResError), nil, gmiOK);
1220 end else if State = gdsAbort then begin
1221 GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiOK);
1225 if not FSambaTimer.Enabled then begin
1226 if CompareDateTime(Board.Expires ,Now) <= 0 then begin
1231 Send(Board.Cookie, Board.SPID, Board.PON, True);
1233 if not FSambaTimer.CheckSambaTime(Now()) then begin
1234 rc := GikoUtil.MsgBox(Handle,
1235 '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
1236 + '
\91\97\90M
\82ð
\92\86\8e~
\82µ
\82Ü
\82·
\82©
\81H' + #13#10
1237 + '(
\81u
\82¢
\82¢
\82¦
\81v
\82¾
\82Æ
\91\97\90M
\82µ
\82Ü
\82·)', TITLE_SAMBA,
1238 MB_YESNO or MB_ICONQUESTION);
1239 if rc = IDYES then begin
1243 if rc = IDNO then begin
1244 rc2 := GikoUtil.MsgBox(Handle,
1245 '
\96{
\93\96\82É
\91\97\90M
\82µ
\82Ü
\82·
\82©
\81H',
1247 MB_YESNO or MB_ICONQUESTION);
1248 if rc2 = IDNO then begin
1254 if CompareDateTime(Board.Expires ,Now) <= 0 then begin
1259 Send(Board.Cookie, Board.SPID, Board.PON, True);
1264 if FSambaTimer.Enabled then begin
1265 FNow := FSambaTimer.Update;
1270 procedure TEditorForm.SaveActionExecute(Sender: TObject);
1275 procedure TEditorForm.CloseActionExecute(Sender: TObject);
1280 procedure TEditorForm.UndoActionExecute(Sender: TObject);
1282 SendMessage(GetActiveControlHandle, WM_UNDO, 0, 0);
1285 procedure TEditorForm.CutActionExecute(Sender: TObject);
1287 SendMessage(GetActiveControlHandle, WM_CUT, 0, 0);
1290 procedure TEditorForm.CopyActionExecute(Sender: TObject);
1292 SendMessage(GetActiveControlHandle, WM_COPY, 0, 0);
1295 procedure TEditorForm.PasteActionExecute(Sender: TObject);
1297 SendMessage(GetActiveControlHandle, WM_PASTE, 0, 0);
1300 procedure TEditorForm.SelectAllActionExecute(Sender: TObject);
1302 SendMessage(GetActiveControlHandle, EM_SETSEL, 0, GetWindowTextLength(GetActiveControlHandle));
1305 procedure TEditorForm.TopActionExecute(Sender: TObject); //
\83E
\83B
\83\93\83h
\83E
\8dÅ
\91O
\96Ê(Stay)
\83{
\83^
\83\93\82Ì
\8f\88\97\9d
1307 if not (fsShowing in Self.FormState) then begin
1308 if TopAction.Checked then begin //
\83X
\83e
\83C
\8fó
\91Ô
\82É
\90Ý
\92è
1309 SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
1310 GikoSys.Setting.EditWindowStay := true;
1311 end else begin //
\83X
\83e
\83C
\8fó
\91Ô
\89ð
\8f\9c
1312 SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
1313 GikoSys.Setting.EditWindowStay := false;
1315 //
\83X
\83e
\83C
\8fó
\91Ô
\82Ì
\95Û
\91¶
1316 //GikoSys.Setting.EditWindowStay := FormStyle = fsStayOnTop;
1320 procedure TEditorForm.AbortActionExecute(Sender: TObject);
1325 procedure TEditorForm.SendActionUpdate(Sender: TObject);
1327 SendAction.Enabled := not FWork;
1330 procedure TEditorForm.SaveActionUpdate(Sender: TObject);
1332 SaveAction.Enabled := False;
1335 procedure TEditorForm.CloseActionUpdate(Sender: TObject);
1337 CloseAction.Enabled := not FWork;
1340 procedure TEditorForm.UndoActionUpdate(Sender: TObject);
1342 UndoAction.Enabled := (GetActiveControlHandle <> 0)
1343 and (SendMessage(GetActiveControlHandle, EM_CANUNDO, 0, 0) <> 0)
1347 procedure TEditorForm.CutActionUpdate(Sender: TObject);
1349 Selection: TSelection;
1352 AHandle := GetActiveControlHandle;
1353 SendMessage(AHandle, EM_GETSEL, Longint(@Selection.StartPos), Longint(@Selection.EndPos));
1354 CutAction.Enabled := (AHandle <> 0)
1355 and ((Selection.EndPos - Selection.StartPos) <> 0)
1359 procedure TEditorForm.CopyActionUpdate(Sender: TObject);
1361 Selection: TSelection;
1364 AHandle := GetActiveControlHandle;
1365 SendMessage(AHandle, EM_GETSEL, Longint(@Selection.StartPos), Longint(@Selection.EndPos));
1366 CopyAction.Enabled := (AHandle <> 0)
1367 and ((Selection.EndPos - Selection.StartPos) <> 0)
1371 procedure TEditorForm.PasteActionUpdate(Sender: TObject);
1373 PasteAction.Enabled := (GetActiveControlHandle <> 0)
1374 and (Clipboard.HasFormat(CF_TEXT))
1378 procedure TEditorForm.TopActionUpdate(Sender: TObject);
1380 TopAction.Enabled := not FWork;
1383 procedure TEditorForm.SageCheckBoxClick(Sender: TObject);
1385 if SageCheckBox.Checked then begin
1386 if AnsiPos('sage', MailComboBox.Text) = 0 then
1387 MailComboBox.Text := 'sage' + MailComboBox.Text;
1389 if AnsiPos('sage', MailComboBox.Text) <> 0 then
1390 MailComboBox.Text := StringReplace(MailComboBox.Text, 'sage', '', [rfReplaceAll]);
1394 procedure TEditorForm.MailComboBoxChange(Sender: TObject);
1396 if AnsiPos('sage', MailComboBox.Text) = 0 then
1397 SageCheckBox.Checked := False
1399 SageCheckBox.Checked := True;
1402 procedure TEditorForm.IdLogDebugReceive(ASender: TIdConnectionIntercept;
1405 StringStream: TStringStream;
1407 StringStream := TStringStream.Create('');
1409 StringStream.CopyFrom(AStream, AStream.Size);
1410 FDebugStrReceive := FDebugStrReceive + StringStream.DataString;
1416 procedure TEditorForm.IdLogDebugSend(ASender: TIdConnectionIntercept;
1419 StringStream: TStringStream;
1421 StringStream := TStringStream.Create('');
1423 StringStream.CopyFrom(AStream, AStream.Size);
1424 FDebugStrSend := FDebugStrSend + StringStream.DataString;
1430 procedure TEditorForm.TransActionExecute(Sender: TObject);
1432 AlphaBlend := TransAction.Checked;
1433 //
\94¼
\93§
\96¾
\8fó
\91Ô
\82Ì
\95Û
\91¶
1434 GikoSys.Setting.EditWindowTranslucent := TransAction.Checked;
1437 procedure TEditorForm.TransActionUpdate(Sender: TObject);
1439 TransAction.Enabled := not FWork;
1441 //StatusBar
\82ÌPanels[0]
\82Ì
\95\9d\82ð
\89Â
\95Ï
\81B
\8ec
\82è
\82ð
\8cÅ
\92è
\82É
\82·
\82é
1442 procedure TEditorForm.StatusBarResize(Sender: TObject);
1444 StatusBar.Panels[0].Width := StatusBar.Width
1445 - StatusBar.Panels[1].Width - StatusBar.Panels[2].Width;
1449 //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Þ
1450 procedure TEditorForm.FormActivate(Sender: TObject);
1452 if ( FSambaTimer.Enabled ) and ( FThreadItem <> nil ) then
1454 FNow := FSambaTimer.Update;
1456 if GikoSys.Setting.GestureEnabled then begin
1457 GikoSys.Setting.Gestures.ClearGesture;
1458 GikoSys.Setting.Gestures.LoadGesture(
1459 GikoSys.Setting.GetGestureFileName, ActionList );
1460 MouseGesture.UnHook;
1461 MouseGesture.OnGestureStart := OnGestureStart;
1462 MouseGesture.OnGestureMove := OnGestureMove;
1463 MouseGesture.OnGestureEnd := OnGestureEnd;
1464 MouseGesture.SetHook( Handle );
1467 procedure TEditorForm.FormCloseQuery(Sender: TObject;
1468 var CanClose: Boolean);
1470 CanClose := not FWork;
1473 procedure TEditorForm.QuotePasteActionExecute(Sender: TObject);
1480 quote := GikoSys.GetOEIndentChar;
1481 s := TStringList.Create;
1483 s.Text := Clipboard.AsText;
1485 for i := s.Count - 1 downto 0 do
1486 s[ i ] := quote + s[ i ];
1488 BodyEdit.SelText := s.Text;
1495 procedure TEditorForm.SpaceToNBSPActionExecute(Sender: TObject);
1497 GikoSys.Setting.SpaceToNBSP := SpaceToNBSPAction.Checked;
1498 if EditorPage.ActivePage = PreviewTab then
1502 procedure TEditorForm.AmpToCharRefActionExecute(Sender: TObject);
1504 GikoSys.Setting.AmpToCharRef := AmpToCharRefAction.Checked;
1505 if EditorPage.ActivePage = PreviewTab then
1509 procedure TEditorForm.BoardTopClick(Sender: TObject);
1513 ini := TIniFile.Create(GikoSys.Setting.GetFileName);
1515 BoardtopTab.TabVisible := BoardTop.Checked;
1516 ini.WriteBool('EditorForm', 'BoardTopTab', BoardtopTab.TabVisible);
1523 procedure TEditorForm.GetSETTINGTXTActionExecute(Sender: TObject);
1525 URL, RefURL: string;
1526 settingBody: TStringList;
1537 if FThreadItem = nil then
1540 tmpBoard := FThreadItem.ParentBoard;
1542 if tmpBoard = nil then Exit;
1544 RefURL := tmpBoard.URL;
1545 if RefURL[Length(RefURL)] <> '/' then
1546 URL := RefURL + '/' + 'SETTING.TXT'
1548 URL := RefURL + 'SETTING.TXT';
1550 Indy.Request.LastModified := tmpBoard.SETTINGTXTTime;
1551 Indy.Request.Referer := RefURL;
1552 Screen.Cursor := crHourGlass;
1553 settingBody := TStringList.Create;
1555 StatusBar.Panels[0].Text := 'SETTING.TXT
\83_
\83E
\83\93\83\8d\81[
\83h
\92\86';
1557 IdAntiFreeze.Active := True;
1559 settingBody.Text := Indy.Get(URL);
1561 IdAntiFreeze.Active := False;
1563 if( Indy.ResponseCode = 200 ) then begin
1564 settingBody.SaveToFile(tmpBoard.GetSETTINGTXTFileName);
1565 tmpBoard.SETTINGTXTTime := Indy.Response.LastModified;
1566 tmpBoard.IsSETTINGTXT := true;
1567 tmpBoard.TitlePictureURL := GetTitlePictureURL(settingBody, tmpBoard);
1568 tmpBoard.Modified := true;
1569 StatusBar.Panels[0].Text := 'SETTING.TXT
\8eæ
\93¾
\8a®
\97¹(' + IntToStr(Indy.ResponseCode) + ')';
1572 on E: EIdException do begin
1573 if( AnsiPos('304', E.Message) > 0 ) then
1574 StatusBar.Panels[0].Text := 'SETTING.TXT
\8dX
\90V
\96³
\82µ(' + IntToStr(Indy.ResponseCode) + ')'
1576 StatusBar.Panels[0].Text := 'SETTING.TXT
\8eæ
\93¾
\83G
\83\89\81[(' + IntToStr(Indy.ResponseCode) + ')';
1581 Screen.Cursor := crDefault;
1584 ShowBoardInformation(tmpBoard, BoardInformationMemo);
1589 procedure TEditorForm.ShowBoardInformation(ABoard: TBoard; AMemo: TMemo);
1594 AMemo.Lines.Add('[SETTING.TXT]');
1595 if ABoard.IsSETTINGTXT then begin
1596 if FileExists(ABoard.GetSETTINGTXTFileName) then begin
1597 AMemo.Lines.Add(DateTimeToStr(ABoard.SETTINGTXTTime) + '
\8dX
\90V');
1598 body := TStringList.Create;
1600 body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
1601 AMemo.Lines.AddStrings(body);
1606 ABoard.IsSETTINGTXT := false;
1607 ABoard.SETTINGTXTTime := ZERO_DATE;
1608 AMemo.Lines.Add('Local
\82É
\95Û
\91¶
\82³
\82ê
\82½SETTING.TXT
\82ª
\8c©
\82Â
\82©
\82è
\82Ü
\82¹
\82ñ');
1609 AMemo.Lines.Add('
\83\81\83j
\83\85\81[
\82æ
\82è
\8dÄ
\8eæ
\93¾
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B');
1612 AMemo.Lines.Add('SETTING.TXT
\82ð
\8eæ
\93¾
\82µ
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B');
1613 AMemo.Lines.Add('
\83\81\83j
\83\85\81[
\82æ
\82è
\8eæ
\93¾
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B');
1616 function TEditorForm.GetTitlePictureURL(body: TStringList; ABoard: TBoard): string;
1617 //BBS_TITLE_PICTURE=
1624 for i := 0 to body.Count - 1 do begin
1625 if (AnsiPos('BBS_TITLE_PICTURE=', body[i]) > 0) or
1626 (AnsiPos('BBS_FIGUREHEAD=', body[i]) > 0) then begin
1628 Delete(tmp, 1, AnsiPos('=', tmp));
1629 if AnsiPos('../', tmp) > 0 then begin
1630 tmp := CustomStringReplace(tmp, '../', GikoSys.UrlToServer(ABoard.URL));
1638 procedure TEditorForm.GetTitlePictureActionUpdate(Sender: TObject);
1640 if FThreadItem = nil then
1641 GetTitlePictureAction.Enabled := FBoard.IsSETTINGTXT
1643 GetTitlePictureAction.Enabled := FThreadItem.ParentBoard.IsSETTINGTXT;
1645 if GetTitlePictureAction.Enabled Then begin
1646 //
\8eÀ
\8ds
\92\86\82Í
\8eÀ
\8ds
\95s
\89Â
1647 GetTitlePictureAction.Enabled := not FWork;
1651 procedure TEditorForm.GetTitlePictureActionExecute(Sender: TObject);
1653 memStream: TMemoryStream;
1662 memStream := TMemoryStream.Create;
1664 if FThreadItem = nil then
1667 tmpBoard := FThreadItem.ParentBoard;
1669 Indy.Request.Referer := tmpBoard.URL;
1670 if tmpBoard.TitlePictureURL <> '' then begin
1671 StatusBar.Panels[0].Text := '
\94Â
\83g
\83b
\83v
\89æ
\91\9c\83_
\83E
\83\93\83\8d\81[
\83h
\92\86';
1672 Screen.Cursor := crHourGlass;
1674 IdAntiFreeze.Active := True;
1676 Indy.Get(tmpBoard.TitlePictureURL, memStream);
1678 IdAntiFreeze.Active := False;
1680 if Indy.ResponseCode = 200 then begin
1681 memStream.SaveToFile(tmpBoard.GetTitlePictureFileName);
1683 tmpBoard.Modified := true;
1689 Screen.Cursor := crDefault;
1690 StatusBar.Panels[0].Text := '
\94Â
\83g
\83b
\83v
\89æ
\91\9c (' + IntToStr(Indy.ResponseCode) + ')';
1696 procedure TEditorForm.ShowTitlePicture();
1701 if FThreadItem = nil then
1704 tmpBoard := FThreadItem.ParentBoard;
1706 if FileExists(tmpBoard.GetTitlePictureFileName) then begin
1707 TitlePictureBrowser.Navigate(tmpBoard.GetTitlePictureFileName);
1709 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';
1710 SetContent(s, TitlePictureBrowser);
1714 function TEditorForm.GetFusianaName(body: TStringList; ABoard: TBoard): String;
1719 for i := 0 to body.Count - 1 do begin
1720 if (AnsiPos('BBS_NONAME_NAME=', body[i]) > 0) then begin
1722 Delete(tmp, 1, AnsiPos('=', tmp));
1729 procedure TEditorForm.GetHeadTXTActionExecute(Sender: TObject);
1731 URL, RefURL: string;
1732 settingBody: TStringList;
1740 if FThreadItem = nil then
1743 tmpBoard := FThreadItem.ParentBoard;
1745 if tmpBoard = nil then Exit;
1747 RefURL := tmpBoard.URL;
1748 if RefURL[Length(RefURL)] <> '/' then
1749 URL := RefURL + '/' + 'head.txt'
1751 URL := RefURL + 'head.txt';
1753 if FileExists(tmpBoard.GETHEADTXTFileName) then
1754 Indy.Request.LastModified := tmpBoard.HEADTXTTime
1756 Indy.Request.LastModified := ZERO_DATE;
1758 Indy.Request.Referer := RefURL;
1759 Screen.Cursor := crHourGlass;
1760 settingBody := TStringList.Create;
1762 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';
1764 IdAntiFreeze.Active := True;
1766 settingBody.Text := Indy.Get(URL);
1768 IdAntiFreeze.Active := False;
1770 if( Indy.ResponseCode = 200 ) then begin
1771 settingBody.Insert(0, '<HTML lang="ja"><HEAD>');
1772 settingBody.Insert(1, '<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">');
1773 settingBody.Insert(2, '<TITLE>' + tmpBoard.Title + '</TITLE>');
1774 settingBody.Insert(3, '<base href="' + RefURL + '"></HEAD><BODY>');
1775 settingBody.Add('</BODY></HTML>');
1776 settingBody.SaveToFile(tmpBoard.GETHEADTXTFileName);
1777 tmpBoard.HEADTXTTime := Indy.Response.LastModified;
1778 tmpBoard.IsHEADTXT := true;
1779 tmpBoard.Modified := true;
1780 StatusBar.Panels[0].Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\8eæ
\93¾
\8a®
\97¹(' + IntToStr(Indy.ResponseCode) + ')';
1783 on E: EIdException do begin
1784 if( AnsiPos('304', E.Message) > 0 ) then
1785 StatusBar.Panels[0].Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\8dX
\90V
\96³
\82µ(' + IntToStr(Indy.ResponseCode) + ')'
1787 StatusBar.Panels[0].Text := '
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\8eæ
\93¾
\83G
\83\89\81[(' + IntToStr(Indy.ResponseCode) + ')';
1792 Screen.Cursor := crDefault;
1795 if tmpBoard.IsHEADTXT then begin
1796 ShowBoardHead(tmpboard, LocalEdit);
1802 procedure TEditorForm.CalcCapacityActionExecute(Sender: TObject);
1808 //
\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
1809 if FThreadItem = nil then
1812 Board := FThreadItem.ParentBoard;
1814 if Board.BoardPlugIn <> nil then
1815 body := CustomStringReplace(body, #13#10, '<br>')
1817 body := CustomStringReplace(body, #13#10, ' <br> ');
1818 StatusBar.Panels[0].Text := '
\97e
\97Ê:' + IntToStr(Length(body)) + ' byte';
1821 procedure TEditorForm.LocalRuleClick(Sender: TObject);
1825 ini := TIniFile.Create(GikoSys.Setting.GetFileName);
1827 RocalRuleTab.TabVisible := LocalRule.Checked;
1828 ini.WriteBool('EditorForm', 'LocalRuleTab', RocalRuleTab.TabVisible);
1834 procedure TEditorForm.FormDeactivate(Sender: TObject);
1836 if GikoSys.Setting.GestureEnabled then begin
1837 MouseGesture.UnHook;
1838 //MouseGesture.SetHook( GikoForm.Handle );
1843 procedure TEditorForm.OnGestureStart(Sender: TObject);
1848 procedure TEditorForm.OnGestureMove(Sender: TObject);
1854 s := MouseGesture.GetGestureStr;
1856 Action := GikoSys.Setting.Gestures.GetGestureAction(s);
1857 if Action <> nil then
1858 ActStr := '
\81i' + Action.Caption + '
\81j';
1859 s := '
\83W
\83F
\83X
\83`
\83\83\81[: ' + s + ActStr;
1860 StatusBar.Panels[0].Text := s;
1863 procedure TEditorForm.OnGestureEnd(Sender: TObject);
1868 s := MouseGesture.GetGestureStr;
1869 Action := GikoSys.Setting.Gestures.GetGestureAction(s);
1870 if Action <> nil then
1872 StatusBar.Panels[0].Text := '';
1875 procedure TEditorForm.ShowBoardHead(ABoard: TBoard; AMemo: TMemo);
1877 wDoc, WTex, le: OLEVariant;
1880 //http://www.campus.ne.jp/~ishigami/CREATION/TECHNIC/WEBAP-2.htm
1881 WebBrowser1.Navigate(ABoard.GETHEADTXTFileName,le,le,le,le);
1882 //
\83\8c\83^
\83\8a\83\93\83O
\82ª
\92x
\82·
\82¬
\82ÄTXT
\82É
\88Ú
\82¹
\82È
\82¢
\81B
\82Ê
\82é
\82Ûorz
1883 //
\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
1884 //
\82±
\82ê
\82Å
\82¢
\82¯
\82Ü
\82µ
\82½
\81B
\82 \82è
\82ª
\82Æ
\82¤
\82²
\82´
\82¢
\82Ü
\82µ
\82½
\81B
1885 while (WebBrowser1.ReadyState <> READYSTATE_COMPLETE) and
1886 (WebBrowser1.ReadyState <> READYSTATE_INTERACTIVE) do begin
1887 Application.ProcessMessages;
1889 wDoc := WebBrowser1.Document;
1890 wTex := wDoc.body.createTextRange;
1891 LocalEdit.Text := wTex.text;
1894 procedure TEditorForm.LocalRuleBrowseClick(Sender: TObject);
1899 if FThreadItem = nil then
1902 ABoard := FThreadItem.ParentBoard;
1904 if ABoard = nil then Exit;
1906 URL := ABoard.GETHEADTXTFileName;
1907 GikoSys.OpenBrowser(URL, gbtAuto);
1910 procedure TEditorForm.SaveNameMailActionExecute(Sender: TObject);
1912 SaveNameMailAction.Checked := not SaveNameMailAction.Checked;
1913 KotehanCheckBox.Enabled := SaveNameMailAction.Checked;
1916 function TEditorForm.LFusianaGet(s: String): Boolean;
1920 i := AnsiPos('fusianasan', s);
1921 if (i > 0) then Result := True else Result := False;
1924 procedure TEditorForm.BeLogInOutEActionExecute(Sender: TObject);
1926 GikoSys.Setting.BeLogin := not GikoSys.Setting.BeLogin;
1929 procedure TEditorForm.BeLogInOutEActionUpdate(Sender: TObject);
1931 if (GikoSys.Setting.BeUserID <> '') and (GikoSys.Setting.BeCode <> '') then begin
1932 if (GikoSys.Setting.BeLogin) then BeLogInOutEAction.Checked := true
1933 else BeLogInOutEAction.Checked := false;
1934 BeLogInOutEAction.Enabled := true
1936 BeLogInOutEAction.Enabled := false;
1939 // Cookie
\82Ì
\8eæ
\93¾
1940 procedure TEditorForm.GetCookie(Rawtext: String; ABoard: TBoard);
1942 COOKIE_MARK = 'Set-Cookie:';
1945 EXPIRES_MARK = 'expires=';
1951 ABoard.Cookie := '';
1952 while (AnsiPos(COOKIE_MARK, Rawtext) > 0 ) do begin
1954 tmp := Copy(Rawtext, AnsiPos(COOKIE_MARK, Rawtext) + Length(COOKIE_MARK), Length(Rawtext));
1955 Delete(Rawtext, 1, AnsiPos('Set-Cookie', Rawtext)+ Length(COOKIE_MARK));
1956 //Cookie
\82ð
\90Ø
\82è
\8fo
\82·
1957 val := Trim(GikoSys.GetTokenIndex(tmp, ';', 0));
1958 if( AnsiPos(VAL_SPID, val) > 0 ) then begin
1959 ABoard.SPID := Copy(val, AnsiPos(VAL_SPID, val) + Length(VAL_SPID), Length(val));
1960 end else if( AnsiPos(VAL_PON, val) > 0 ) then begin
1961 ABoard.PON := Copy(val, AnsiPos(VAL_PON, val) + Length(VAL_PON), Length(val));
1963 ABoard.Cookie := ABoard.Cookie + val + '; ';
1965 //expires
\82ð
\90Ø
\82è
\8fo
\82·
1966 val := Trim(GikoSys.GetTokenIndex(tmp, ';', 1));
1967 if( AnsiPos(EXPIRES_MARK, val) > 0) then begin
1968 Delete(val, 1, AnsiPos(EXPIRES_MARK, val) + Length(EXPIRES_MARK) - 1);
1969 ABoard.Expires := GMTToLocalDateTime(val);
1975 //!
\83T
\83\93\83o
\8dX
\90V
\82Ì
\83A
\83N
\83V
\83\87\83\93\82ÌUpdate
\83C
\83x
\83\93\83g
\81@
\8aÈ
\92P
\82Ì
\82½
\82ß
\83^
\83C
\83}
\81[
\82Æ
\93¯
\82¶
\82É
\82µ
\82Ä
\82¨
\82
1976 procedure TEditorForm.UpdateSambaActionUpdate(Sender: TObject);
1978 UpdateSambaAction.Enabled := FSambaTimer.Enabled;
1981 //!
\83T
\83\93\83o
\8dX
\90V
\83A
\83N
\83V
\83\87\83\93
1982 procedure TEditorForm.UpdateSambaActionExecute(Sender: TObject);
1987 if InputQuery('Samba24
\90Ý
\92è
\92l
\8dX
\90V', '
\90V
\82µ
\82¢
\90Ý
\92è
\92l
\82ð
\93ü
\97Í
\82µ
\82Ä
\82
\82¾
\82³
\82¢', input) then begin
1988 input := ZenToHan(input);
1989 if GikoSys.IsNumeric(input) then begin
1990 FSambaTimer.UpdateSambaSetting(StrToInt(input));
1992 //
\91S
\82Ä
\82Ì
\83t
\83H
\81[
\83\80\82©
\82ç
\81ASamba
\83^
\83C
\83}
\81[
\82ð
\8dX
\90V
\82·
\82é
1993 for i := 0 to Screen.FormCount - 1 do begin
1994 if Screen.Forms[i] is TEditorForm then begin
1995 TEditorForm(Screen.Forms[i]).FSambaTimer.Update;
1996 TEditorForm(Screen.Forms[i]).UpdateSambaStatus;
2000 ShowMessage('
\90\94\92l
\82ð
\93ü
\97Í
\82µ
\82Ä
\82
\82¾
\82³
\82¢');
2001 UpdateSambaActionExecute(Sender);
2006 procedure TEditorForm.UpdateSambaStatus;
2008 if (FSambaTimer.Enabled) then begin
2009 StatusBar.Panels[2].Text
2010 := 'Samba24
\8bK
\92è
\92l' + IntToStr(FSambaTimer.SambaInterval);
2014 procedure TEditorForm.InputAssistActionExecute(Sender: TObject);
2020 TextWidth, ItemWidth, tmpWidth: Integer;
2022 if FInputAssistKey = '' then Exit;
2024 InputAssistPopupMenu.Items.Clear;
2026 if (FResistWords = nil) then begin
2027 FResistWords := TStringList.Create;
2032 if (GetKeyState( VK_SHIFT ) < 0) then begin
2033 //
\83V
\83t
\83g
\82ª
\89\9f\82³
\82ê
\82Ä
\82¢
\82ê
\82Î
\81A
\83L
\81[
\82Å
\8en
\82Ü
\82é
\83J
\83e
\83S
\83\8a
2035 InputAssistDM.GetStartWithCategoryResistWords(
2036 FInputAssistKey, FResistWords);
2038 //
\83V
\83t
\83g
\82ª
\96³
\82¢
\82Ì
\82Å
\81A
\83L
\81[
\82Å
\8en
\82Ü
\82é
\83L
\81[
2040 InputAssistDM.GetStartWithKeyResistWords(
2041 FInputAssistKey, FResistWords);
2043 Bitmap := TBitmap.Create;
2045 Bitmap.Canvas.Font.Assign(BodyEdit.Font);
2046 //
\83}
\81[
\83W
\83\935px
2047 TextWidth := Bitmap.Canvas.TextWidth(FInputAssistKey) + 5;
2049 for i := 0 to count - 1 do begin
2050 item := TMenuItem.Create(nil);
2051 item.Break := mbNone;
2052 item.Caption := FResistWords[i];
2054 item.OnClick := InputAssistMenuClick;
2055 InputAssistPopupMenu.Items.Add(item);
2057 tmpWidth := Bitmap.Canvas.TextWidth(Item.Caption);
2058 if (tmpWidth > ItemWidth) then begin
2059 ItemWidth := tmpWidth;
2066 if (count > 0) then begin
2068 point.X := point.X + Self.Left + (Self.Width - BodyEdit.Width) div 2;
2069 point.Y := point.Y + Self.Top + (Self.Height - Self.ClientHeight);
2071 if Screen.DesktopWidth >
2072 (point.X + TextWidth + ItemWidth) then begin
2073 InputAssistPopupMenu.Popup(
2074 point.X + TextWidth,
2075 point.Y + EditorPage.Top + EditorPage.TabHeight + BodyEdit.Top);
2077 InputAssistPopupMenu.Popup(
2078 point.X - TextWidth - ItemWidth,
2079 point.Y + EditorPage.Top + EditorPage.TabHeight + BodyEdit.Top);
2084 procedure TEditorForm.InputAssistMenuClick(Sender: TObject);
2089 if not (Sender is TMenuItem) then Exit;
2091 if (FResistWords <> nil) then begin
2094 TResistWord(FResistWords.Objects[TMenuItem(Sender).Tag]).GetText;
2098 IMC := ImmGetContext(BodyEdit.Handle); //
\83R
\83\93\83e
\83L
\83X
\83g
\8eæ
\93¾
2100 ImmNotifyIME(IMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
2102 ImmReleaseContext(BodyEdit.Handle, IMC); //
\83R
\83\93\83e
\83L
\83X
\83g
\89ð
\95ú
2106 FInputAssistKey := '';
2108 InsertText(BodyEdit, text);
2111 //! TMemo
\82Ì
\83J
\81[
\83\
\83\8b\88Ê
\92u
\82É
\95¶
\8e\9a\97ñ
\91}
\93ü
2112 procedure TEditorForm.InsertText(Memo: TMemo; Text: String);
2114 line, sel, pos: Integer;
2115 left, right : String;
2117 Memo.Lines.BeginUpdate;
2118 line := SendMessage(Memo.Handle,EM_LINEFROMCHAR,-1,0); //
\8ds
2119 sel := Memo.SelStart;
2120 pos := sel - SendMessage(Memo.Handle, EM_LINEINDEX, -1, 0); //
\8c\85
2121 if (pos > 0) then begin
2122 left := Copy(Memo.Lines[line], 0, pos);
2126 right := Copy(Memo.Lines[line], pos + 1, Length(Memo.Lines[line]));
2127 Memo.Lines.Strings[line] := left + Text + right;
2128 Memo.Lines.EndUpdate;
2129 //
\81@
\83L
\83\83\83\8c\83b
\83g
\82Ì
\88Ê
\92u
\82ð
\8dX
\90V
\82·
\82é
2130 Memo.SelStart := sel + Length(text);
2131 //
\83L
\83\83\83\8c\83b
\83g
\82Ì
\88Ê
\92u
\82Ü
\82Å
\83X
\83N
\83\8d\81[
\83\8b
2132 Memo.Perform(EM_SCROLLCARET, 0, 0);
2136 procedure TEditorForm.ApplicationEvents1Message(var Msg: tagMSG;
2137 var Handled: Boolean);
2144 if (Self.Active) then begin
2146 //
\83L
\81[
\89\9f\89º
\82Ì
\82Ý
\8eó
\82¯
\8eæ
\82é
2149 //
\83^
\83u
\82ª
\81h
\95Ò
\8fW
\81h
\82ÅCtrl
\83L
\81[
\82ª
\89\9f\82³
\82ê
\82Ä
\82¢
\82é
\82Ì
\82ð
\8am
\94F
\82·
\82é
2150 if (EditorPage.ActivePageIndex = 0)
2151 and (GetKeyState( VK_CONTROL ) < 0) then begin
2152 wmMsg.Msg := Msg.message;
2153 wmMsg.CharCode := Word(Msg.wParam);
2154 wmMsg.KeyData := Msg.lParam;
2155 if (wmMsg.CharCode = 229) and (wmMsg.KeyData = 3735553) then begin
2156 IMC := ImmGetContext(BodyEdit.Handle); //
\83R
\83\93\83e
\83L
\83X
\83g
\8eæ
\93¾
2157 Len := ImmGetCompositionString(IMC, GCS_COMPSTR, nil, 0); //
\82Ü
\82¸
\92·
\82³
\82ð
\8eæ
\93¾
2158 if (Len > 0) then begin
2159 SetLength(Str, Len + 1); //Buffer
\82Ì
\83\81\83\82\83\8a\82ð
\90Ý
\92è
2160 ImmGetCompositionString(IMC, GCS_COMPSTR, PChar(Str), Len + 1); //
\82Ü
\82¸
\92·
\82³
\82ð
\8eæ
\93¾
2161 SetLength(Str, Len);
2162 FInputAssistKey := Str;
2163 InputAssistActionExecute(nil);
2166 ImmReleaseContext(BodyEdit.Handle, IMC); //
\83R
\83\93\83e
\83L
\83X
\83g
\89ð
\95ú
2175 procedure TEditorForm.ShowInputAssistFormExecute(Sender: TObject);
2177 form : TInputAssistForm;
2179 form := TInputAssistForm.Create(nil);
2181 if TopAction.Checked then begin //
\83X
\83e
\83C
\8fó
\91Ô
\82É
\90Ý
\92è
2182 SetWindowPos(form.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
2184 form.SetUpFromEditor;
2185 if (form.ShowModal = mrOk) then begin
2186 InsertText(BodyEdit, form.GetInsertText);
2192 //! Cookie
\8fî
\95ñ
\8dí
\8f\9c
2193 procedure TEditorForm.ReleaseCookieActionExecute(Sender: TObject);
2197 //
\83X
\83\8c\83b
\83h
\82ª
\96³
\82¢
\81@
\83X
\83\8c\97§
\82Ä
\82Ì
\82Æ
\82«
\82ÍFBoard
\82ð
\92¼
\90Ú
\8eg
\82¤
2198 if FThreadItem = nil then begin
2201 Board := FThreadItem.ParentBoard;
2204 //
\83N
\83b
\83L
\81[
\82Ì
\8fî
\95ñ
\82ð
\8eÌ
\82Ä
\82é
2208 // 0
\82É
\8aª
\82«
\96ß
\82·
2211 //!
\94Â
\8fî
\95ñ
\8eæ
\93¾Update
\83C
\83x
\83\93\83g
2212 procedure TEditorForm.GetSETTINGTXTActionUpdate(Sender: TObject);
2214 //
\8eÀ
\8ds
\92\86\82Í
\8eÀ
\8ds
\95s
\89Â
2215 GetSETTINGTXTAction.Enabled := not FWork;
2217 //!
\83\8d\81[
\83J
\83\8b\83\8b\81[
\83\8b\8eæ
\93¾Update
\83C
\83x
\83\93\83g
2218 procedure TEditorForm.GetHeadTXTActionUpdate(Sender: TObject);
2220 //
\8eÀ
\8ds
\92\86\82Í
\8eÀ
\8ds
\95s
\89Â
2221 GetSETTINGTXTAction.Enabled := not FWork;
2224 //! Samba
\83^
\83C
\83}
\81[
\83C
\83x
\83\93\83g
2225 procedure TEditorForm.SambaTimer(Sender: TObject);
2228 if FSambaTimer.WriteDeta = ZERO_DATE then
2229 StatusBar.Panels[1].Text := '
\8f\89\8f\91'
2231 FNow := IncMilliSecond(FNow, 500);
2232 StatusBar.Panels[1].Text :=
2233 Format('%8.0f
\95b
\8co
\89ß', [SecondSpan(FNow, FSambaTimer.WriteDeta)]);
2237 \brief
\83E
\83B
\83\93\83h
\83E
\82Ì
\88Ê
\92u
\82Æ
\83T
\83C
\83Y
\82Ì
\90Ý
\92è
2239 procedure TEditorForm.SetWindowRect;
2241 wp: TWindowPlacement;
2243 //
\83E
\83B
\83\93\83h
\83E
\82Ì
\88Ê
\92u
\90Ý
\92è
2244 wp.length := sizeof(wp);
2245 wp.rcNormalPosition.Top := GikoSys.Setting.EditWindowTop;
2246 wp.rcNormalPosition.Left := GikoSys.Setting.EditWindowLeft;
2248 wp.rcNormalPosition.Bottom := GikoSys.Setting.EditWindowTop + GikoSys.Setting.EditWindowHeight;
2249 wp.rcNormalPosition.Right := GikoSys.Setting.EditWindowLeft + GikoSys.Setting.EditWindowWidth;
2250 wp.showCmd := SW_HIDE;
2251 SetWindowPlacement(Handle, @wp);
2253 if GikoSys.Setting.EditWindowMax then begin
2254 WindowState := wsMaximized;
2257 //
\83E
\83B
\83\93\83h
\83E
\82ª
\89æ
\96Ê
\8aO
\82È
\82ç
\89æ
\96Ê
\93à
\82É
\88Ú
\93®
\82·
\82é
2258 if (Left + Width) > Screen.Width then begin
2261 if (Top + Height) > Screen.Height then begin
2264 if Left < 0 then begin
2267 if Top < 0 then begin
2271 //
\8c»
\8dÝ
\82Ì
\83E
\83B
\83\93\83h
\83E
\82Ì
\88Ê
\92u
\82ð
\95Û
\91¶
2272 GikoSys.Setting.EditWindowTop := Top + WINDOWMOVE_V; //
\8e\9f\82É
\8aJ
\82
\83E
\83B
\83\93\83h
\83E
\82Í
2273 GikoSys.Setting.EditWindowLeft := Left + WINDOWMOVE_H; //
\81@
\81@
\81@
\89E
\8eÎ
\82ß
\89º
\82É
\82¸
\82ç
\82·
2274 //
\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·
2275 if GikoSys.Setting.EditWindowHeight < 144 then begin
2278 if GikoSys.Setting.EditWindowWidth < 144 then begin
2283 \brief
\8ag
\92£
\83^
\83u
\90Ý
\92è
2285 procedure TEditorForm.SetExtraTab;
2287 SECTION = 'EditorForm';
2291 ini := TMemIniFile.Create(GikoSys.Setting.GetFileName);
2293 BoardtopTab.TabVisible := ini.Readbool(SECTION, 'BoardTopTab', False);
2294 BoardTop.Checked := BoardtopTab.TabVisible;
2295 RocalRuleTab.TabVisible := ini.ReadBool(SECTION, 'LocalRuleTab', False);
2296 LocalRule.Checked := RocalRuleTab.TabVisible;