• R/O
  • HTTP
  • SSH
  • HTTPS

gikonavi: Commit


Commit MetaInfo

Revision2833d0732cfdb67617dbb83106efaec9d2cb1a52 (tree)
Time2009-03-21 22:15:03
Authorcvs2git <cvs2git>
Commitercvs2git

Log Message

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

Change Summary

Incremental Difference

--- a/BoardGroup.pas
+++ b/BoardGroup.pas
@@ -279,7 +279,7 @@ type
279279 public
280280 constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard; inURL : string ); overload;
281281 constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard;
282- inURL : string; inExist: Boolean; const inFilename: string ); overload;
282+ const inURL : string; inExist: Boolean; const inFilename: string ); overload;
283283
284284 destructor Destroy; override;
285285
@@ -1574,7 +1574,7 @@ end;
15741574 constructor TThreadItem.Create(
15751575 const inPlugIn : TBoardPlugIn;
15761576 const inBoard : TBoard;
1577- inURL : string;
1577+ const inURL : string;
15781578 inExist: Boolean;
15791579 const inFilename: string
15801580 );
@@ -1589,7 +1589,7 @@ begin
15891589 // dat の保存パスを設定
15901590 FileName := inFilename;
15911591 IsLogFile := inExist;
1592- URL := GikoSys.Get2chBrowsableThreadURL( inURL );
1592+ URL := inURL;
15931593 end else begin
15941594 // プラグインに TThreadItem が作成されたことを伝える
15951595 inPlugIn.CreateThreadItem( DWORD( Self ) );
--- a/Giko.pas
+++ b/Giko.pas
@@ -1025,7 +1025,11 @@ begin
10251025 case FResRangeMenuSelect of
10261026 Ord( grrKoko ): GikoDM.OnlyKokoResAction.Checked := True;
10271027 Ord( grrNew ): GikoDM.OnlyNewResAction.Checked := True;
1028- 100: GikoDM.OnlyAHundredResAction.Checked := True;
1028+ 10..65535:
1029+ begin
1030+ GikoDM.OnlyAHundredResAction.Checked := True;
1031+ GikoSys.ResRange := GikoSys.Setting.ResRangeExCount;
1032+ end;
10291033 end;
10301034 end;
10311035
@@ -2079,7 +2083,8 @@ begin
20792083 s := '';
20802084 Ext := AnsiLowerCase(ExtractFileExt(Text2));
20812085 if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and
2082- ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2086+ ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) or
2087+ (Pos('http://www.nicovideo.jp/watch/', Text2) = 1) then begin
20832088 if FPreviewBrowser = nil then begin
20842089 FPreviewBrowser := TPreviewBrowser.Create(Self);
20852090 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
@@ -2376,6 +2381,16 @@ begin
23762381 KokoPopupMenu.PopupComponent := nil;
23772382 if (Sender is TComponent) then
23782383 KokoPopupMenu.PopupComponent := TComponent(Sender);
2384+ // 誤爆対策 クリックしたブラウザと異なるときに消す処理を追加
2385+ if not (Sender is TResPopupBrowser) then begin
2386+ if (FResPopupBrowser <> nil) and (FResPopupBrowser.CurrentBrowser.Visible = True) then begin
2387+ FResPopupBrowser.Clear;
2388+ end;
2389+ end else begin
2390+ if (Sender <> FResPopupBrowser.CurrentBrowser) then begin
2391+ TResPopupBrowser(Sender).ChildClear;
2392+ end;
2393+ end;
23792394 KokoPopupMenu.Tag := StrToInt(sNo);
23802395 KokoPopupMenu.Popup(p.x, p.y);
23812396 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
--- a/GikoBayesian.pas
+++ b/GikoBayesian.pas
@@ -5,7 +5,7 @@ unit GikoBayesian;
55 \brief ベイジアンフィルタ
66
77
8-$Id: GikoBayesian.pas,v 1.21 2006/06/26 14:57:15 h677 Exp $
8+$Id: GikoBayesian.pas,v 1.22 2009/01/31 15:47:15 h677 Exp $
99 }
1010
1111 //! 平仮名を辞書に含めない
@@ -310,12 +310,12 @@ begin
310310
311311 for i := 1 to sl.Count - 1 do begin
312312 s := sl[ i ];
313- name := RemoveToken( s, #1 );
313+ name := GikoBayesian.RemoveToken( s, #1 );
314314 info := TWordInfo.Create;
315- info.NormalWord := StrToIntDef( '$' + RemoveToken( s, #1 ), 0 );
316- info.ImportantWord := StrToIntDef( '$' + RemoveToken( s, #1 ), 0 );
317- info.NormalText := StrToIntDef( '$' + RemoveToken( s, #1 ), 0 );
318- info.ImportantText := StrToIntDef( '$' + RemoveToken( s, #1 ), 0 );
315+ info.NormalWord := StrToIntDef( '$' + GikoBayesian.RemoveToken( s, #1 ), 0 );
316+ info.ImportantWord := StrToIntDef( '$' + GikoBayesian.RemoveToken( s, #1 ), 0 );
317+ info.NormalText := StrToIntDef( '$' + GikoBayesian.RemoveToken( s, #1 ), 0 );
318+ info.ImportantText := StrToIntDef( '$' + GikoBayesian.RemoveToken( s, #1 ), 0 );
319319
320320 AddObject( name, info );
321321 end;
--- a/GikoDataModule.dfm
+++ b/GikoDataModule.dfm
@@ -1237,6 +1237,7 @@ object GikoDM: TGikoDM
12371237 OnExecute = OpenFindDialogActionExecute
12381238 end
12391239 object FavoriteTreeViewItemNameCopyAction: TAction
1240+ Tag = -1
12401241 Category = #12362#27671#12395#20837#12426#12484#12522#12540#12509#12483#12503#12450#12483#12503
12411242 Caption = #34920#31034#21517#12434#12467#12500#12540'(&S)'
12421243 Hint = #34920#31034#12375#12390#12356#12427#21517#21069#12434#12463#12522#12483#12503#12508#12540#12489#12395#12467#12500#12540#12377#12427
@@ -1345,12 +1346,14 @@ object GikoDM: TGikoDM
13451346 OnUpdate = DependActiveCntentActionUpdate
13461347 end
13471348 object AddIDtoNGWord0Action: TAction
1349+ Tag = -1
13481350 Category = #12502#12521#12454#12470#12509#12483#12503#12450#12483#12503
13491351 Caption = 'ID'#12434'NG'#12527#12540#12489#12395#36861#21152'('#36879#26126')'
13501352 Hint = #12524#12473#12398'ID'#12434'NG'#12527#12540#12489#12501#12449#12452#12523#12395#36861#21152#12377#12427#65288#36879#26126#65289
13511353 OnExecute = AddIDtoNGWord0ActionExecute
13521354 end
13531355 object AddIDtoNGWord1Action: TAction
1356+ Tag = -1
13541357 Category = #12502#12521#12454#12470#12509#12483#12503#12450#12483#12503
13551358 Caption = 'ID'#12434'NG'#12527#12540#12489#12395#36861#21152
13561359 Hint = 'ID'#12434'NG'#12527#12540#12489#12501#12449#12452#12523#12395#36861#21152#12377#12427
--- a/GikoDataModule.pas
+++ b/GikoDataModule.pas
@@ -926,8 +926,8 @@ begin
926926
927927 GikoForm.ResRangeMenuSelect := 100;
928928 OnlyAHundredResAction.Checked := True;
929- // 表示範囲を設定する
930- SetResRange(100);
929+ // 表示範囲を設定する。設定値からとってくる。
930+ SetResRange(GikoSys.Setting.ResRangeExCount);
931931 end;
932932 // *************************************************************************
933933 //! 未読レスのみ表示
@@ -4582,8 +4582,10 @@ begin
45824582 try
45834583 form.ShowModal;
45844584 shutdown := form.Allowshutdown;
4585- GikoForm.UpdateExePath := form.ExecPath;
4586- GikoForm.UpdateExeArgs := form.ExecArgs;
4585+ if shutdown then begin
4586+ GikoForm.UpdateExePath := form.ExecPath;
4587+ GikoForm.UpdateExeArgs := form.ExecArgs;
4588+ end;
45874589 finally
45884590 form.Release;
45894591 end;
--- a/GikoSystem.pas
+++ b/GikoSystem.pas
@@ -181,7 +181,7 @@ type
181181
182182 procedure MenuFont(Font: TFont);
183183
184- function RemoveToken(var s:string; const delimiter:string):string;
184+// function RemoveToken(var s:string; const delimiter:string):string;
185185 function GetTokenIndex(s: string; delimiter: string; index: Integer): string;
186186
187187 function GetShortName(const LongName: string; ALength: integer): string;
@@ -264,7 +264,7 @@ const
264264 ZERO_DATE: Integer = 25569;
265265 BETA_VERSION_NAME_E = 'beta';
266266 BETA_VERSION_NAME_J = 'バタ';
267- BETA_VERSION = 59;
267+ BETA_VERSION = 60;
268268 BETA_VERSION_BUILD = ''; //!< debug版など
269269 APP_NAME = 'gikoNavi';
270270 BE_PHP_URL = 'http://be.2ch.net/test/p.php?i=';
@@ -645,7 +645,7 @@ begin
645645 end;
646646 end;
647647
648- ThreadItem.BeginUpdate;
648+ //ThreadItem.BeginUpdate;
649649 if (datFileCheck) and (islog) then
650650 FileList.Delete( Index );
651651
@@ -670,7 +670,7 @@ begin
670670 Node := FavoriteDM.TreeView.Items.AddChildObject( FavoriteDM.TreeView.Items.Item[0], ThreadItem.Title, FavoThreadItem);
671671 *}
672672
673- ThreadItem.EndUpdate;
673+ //ThreadItem.EndUpdate;
674674 Board.Add(ThreadItem);
675675
676676 if (ThreadItem.UnRead) and (ThreadItem.IsLogFile) then
@@ -699,7 +699,7 @@ begin
699699 Board.IsThreadDatRead := True;
700700 {$IFDEF DEBUG}
701701 rt := GetTickCount - st;
702- Writeln('Read Done.' + IntToStr(rt) + ' ms');
702+ Writeln('Read Done.' + Board.Title + ':' + IntToStr(rt) + ' ms');
703703 {$ENDIF}
704704 end;
705705 {!
@@ -943,7 +943,7 @@ begin
943943 Result.FLastModified := IntToDateTime(StrToIntDef('$' + MojuUtils.RemoveToken(Line, #1), ZERO_DATE));
944944 Result.FKokomade := StrToIntDef('$' + MojuUtils.RemoveToken(Line, #1), -1);
945945 Result.FNewReceive := StrToIntDef('$' + MojuUtils.RemoveToken(Line, #1), 0);
946- RemoveToken(Line, #1);//9: ; //未使用
946+ MojuUtils.RemoveToken(Line, #1);//9: ; //未使用
947947 Result.FUnRead := IntToBool(StrToIntDef('$' + MojuUtils.RemoveToken(Line, #1), 0));
948948 Result.FScrollTop := StrToIntDef('$' + MojuUtils.RemoveToken(Line, #1), 0);
949949 Result.FAllResCount := StrToIntDef('$' + MojuUtils.RemoveToken(Line, #1), 0);
@@ -1098,8 +1098,8 @@ begin
10981098 Delim := ','
10991099 else
11001100 Delim := '<>';
1101- Result.FFileName := RemoveToken(Line, Delim);
1102- Result.FTitle := Trim(RemoveToken(Line, Delim));
1101+ Result.FFileName := MojuUtils.RemoveToken(Line, Delim);
1102+ Result.FTitle := Trim(MojuUtils.RemoveToken(Line, Delim));
11031103
11041104 ws := Result.FTitle;
11051105 if Copy(ws, Length(ws), 1) = ')' then begin
@@ -1363,7 +1363,7 @@ end;
13631363
13641364 どこかのサイトからのパクリ
13651365 }
1366-function TGikoSys.RemoveToken(var s: string;const delimiter: string): string;
1366+{function TGikoSys.RemoveToken(var s: string;const delimiter: string): string;
13671367 var
13681368 p: Integer;
13691369 begin
@@ -1374,7 +1374,7 @@ begin
13741374 Result := Copy(s, 1, p - 1);
13751375 Delete(s, 1, Length(Result) + Length(delimiter));
13761376 end;
1377-
1377+}
13781378
13791379 {!
13801380 \brief n 個目のトークンを切り出し
@@ -1390,7 +1390,7 @@ var
13901390 begin
13911391 Result := '';
13921392 for i := 0 to index do
1393- Result := RemoveToken(s, delimiter);
1393+ Result := MojuUtils.RemoveToken(s, delimiter);
13941394 end;
13951395
13961396
@@ -1632,7 +1632,7 @@ begin
16321632 SI.cbReserved2 := 0;
16331633 SI.lpReserved2 := nil;
16341634 SI.dwysize := 0;
1635- Windows.CreateProcess(nil,
1635+ if Windows.CreateProcess(nil,
16361636 PChar(Path),
16371637 nil,
16381638 nil,
@@ -1641,7 +1641,11 @@ begin
16411641 nil,
16421642 nil,
16431643 SI,
1644- PI);
1644+ PI) then
1645+ begin
1646+ CloseHandle(PI.hProcess);
1647+ end;
1648+
16451649 end;
16461650
16471651 {!
--- a/HTMLCreate.pas
+++ b/HTMLCreate.pas
@@ -1459,10 +1459,10 @@ begin
14591459 Line := CustomStringReplace(Line, '@`', ',');
14601460 end;
14611461 //Trimしてはいけない気がする byもじゅ
1462- PRes.FName := RemoveToken(Line, delimiter);
1463- PRes.FMailTo := RemoveToken(Line, delimiter);
1464- PRes.FDateTime := RemoveToken(Line, delimiter);
1465- PRes.FBody := RemoveToken(Line, delimiter);
1462+ PRes.FName := MojuUtils.RemoveToken(Line, delimiter);
1463+ PRes.FMailTo := MojuUtils.RemoveToken(Line, delimiter);
1464+ PRes.FDateTime := MojuUtils.RemoveToken(Line, delimiter);
1465+ PRes.FBody := MojuUtils.RemoveToken(Line, delimiter);
14661466 //2ちゃんねるとかだと、本文の先頭に1つ半角空白が入っているので削除する
14671467 //他の掲示板で、レス自体の空白かもしれないけどそれは諦める
14681468 PRes.FBody := TrimLeft(PRes.FBody);
@@ -1470,7 +1470,7 @@ begin
14701470 if PRes.FBody = '' then
14711471 PRes.FBody := '&nbsp;';
14721472
1473- PRes.FTitle := RemoveToken(Line, delimiter);
1473+ PRes.FTitle := MojuUtils.RemoveToken(Line, delimiter);
14741474 end;
14751475
14761476 {!
--- a/KuroutSetting.dfm
+++ b/KuroutSetting.dfm
@@ -475,6 +475,34 @@ object KuroutOption: TKuroutOption
475475 TabOrder = 1
476476 Wrap = False
477477 end
478+ object ResRangeLabeledEdit: TLabeledEdit
479+ Left = 317
480+ Top = 18
481+ Width = 121
482+ Height = 20
483+ EditLabel.Width = 113
484+ EditLabel.Height = 12
485+ EditLabel.Caption = #34920#31034#12524#12473#25968'(100-9999)'
486+ ImeMode = imDisable
487+ LabelPosition = lpLeft
488+ LabelSpacing = 3
489+ TabOrder = 2
490+ Text = '100'
491+ OnExit = ResRangeLabeledEditExit
492+ end
493+ object ResRangeCountUpDown: TUpDown
494+ Left = 438
495+ Top = 18
496+ Width = 17
497+ Height = 20
498+ Associate = ResRangeLabeledEdit
499+ Min = 100
500+ Max = 9999
501+ Position = 100
502+ TabOrder = 3
503+ Thousands = False
504+ Wrap = False
505+ end
478506 end
479507 object ThreadGroupBox: TGroupBox
480508 Left = 16
--- a/KuroutSetting.pas
+++ b/KuroutSetting.pas
@@ -94,6 +94,8 @@ type
9494 RespopupWaitUpDown: TUpDown;
9595 Label19: TLabel;
9696 RespopupMailToCheckBox: TCheckBox;
97+ ResRangeLabeledEdit: TLabeledEdit;
98+ ResRangeCountUpDown: TUpDown;
9799 procedure OkBottonClick(Sender: TObject);
98100 procedure FormCreate(Sender: TObject);
99101 procedure CDeleteButtonClick(Sender: TObject);
@@ -110,6 +112,7 @@ type
110112 procedure DeltaXLabeledEditExit(Sender: TObject);
111113 procedure DeltaYLabeledEditExit(Sender: TObject);
112114 procedure RespopupWaitLabeledEditExit(Sender: TObject);
115+ procedure ResRangeLabeledEditExit(Sender: TObject);
113116 private
114117 { Private 宣言 }
115118 procedure SetValue;
@@ -166,6 +169,8 @@ begin
166169 MoveHistoryMaxEdit.Text := IntToStr( GikoSys.Setting.MoveHistorySize );
167170 // 先頭表示レス数
168171 AHandredUpDown.Position := GikoSys.Setting.HeadResCount;
172+ // 表示レス数
173+ ResRangeCountUpDown.Position := GikoSys.Setting.ResRangeExCount;
169174 // 関連キーワード追加フラグ
170175 AddKeywordCheckBox.Checked := GikoSys.Setting.AddKeywordLink;
171176 // 誤反応対策
@@ -212,7 +217,8 @@ begin
212217 // 先頭表示レス数
213218 GikoSys.Setting.HeadResCount :=
214219 StrToIntDef( AHandredLabeledEdit.Text , 1);
215-
220+ GikoSys.Setting.ResRangeExCount :=
221+ StrToIntDef( ResRangeLabeledEdit.Text , 100 );
216222 GikoSys.Setting.KuroutSettingTabIndex := PageControl1.ActivePageIndex;
217223 // 関連キーワード追加フラグ
218224 GikoSys.Setting.AddKeywordLink := AddKeywordCheckBox.Checked;
@@ -515,4 +521,14 @@ begin
515521 RespopupWaitLabeledEdit.Text := IntToStr(RespopupWaitUpDown.Max);
516522 end;
517523
524+procedure TKuroutOption.ResRangeLabeledEditExit(Sender: TObject);
525+begin
526+ if not GikoSys.IsNumeric(ResRangeLabeledEdit.Text) then
527+ ResRangeLabeledEdit.Text := '100';
528+ if StrToInt(ResRangeLabeledEdit.Text) < 100 then
529+ ResRangeLabeledEdit.Text := '100';
530+ if StrToInt(ResRangeLabeledEdit.Text) > 9999 then
531+ ResRangeLabeledEdit.Text := '9999';
532+end;
533+
518534 end.
--- a/Option.dfm
+++ b/Option.dfm
@@ -253,7 +253,7 @@ object OptionDialog: TOptionDialog
253253 Top = 43
254254 Width = 417
255255 Height = 20
256- ItemHeight = 12
256+ ItemHeight = 0
257257 TabOrder = 0
258258 Text = 'BoardURLComboBox'
259259 end
--- a/Option.pas
+++ b/Option.pas
@@ -723,7 +723,7 @@ begin
723723 Ord( grrAll ): ResRangeHoldComboBox.ItemIndex := 0;
724724 Ord( grrKoko ): ResRangeHoldComboBox.ItemIndex := 2;
725725 Ord( grrNew ): ResRangeHoldComboBox.ItemIndex := 3;
726- 100: ResRangeHoldComboBox.ItemIndex := 1;
726+ 10..65535: ResRangeHoldComboBox.ItemIndex := 1;
727727 end;
728728 ResRangeHoldComboBox.Enabled := GikoSys.Setting.ResRangeHold;
729729 //タブ追加位置
@@ -1013,7 +1013,7 @@ begin
10131013 GikoSys.Setting.ResRangeHold := ResRangeHoldCheckBox.Checked;
10141014 case ResRangeHoldComboBox.ItemIndex of
10151015 0: GikoSys.Setting.ResRange := Ord( grrAll );
1016- 1: GikoSys.Setting.ResRange := 100;
1016+ 1: GikoSys.Setting.ResRange := GikoSys.Setting.ResRangeExCount;
10171017 2: GikoSys.Setting.ResRange := Ord( grrKoko );
10181018 3: GikoSys.Setting.ResRange := Ord( grrNew );
10191019 end;
--- a/Preview.pas
+++ b/Preview.pas
@@ -13,6 +13,7 @@ uses
1313 type
1414 TPreviewBrowser = class(TWebBrowser)
1515 private
16+ function makeHTML(const URL, Host, Document : String): String;
1617 protected
1718 procedure CreateParams(var Params: TCreateParams); override;
1819 public
@@ -31,6 +32,7 @@ const
3132 // マウスカーソルからのずらし位置
3233 DIV_X = 15;
3334 DIV_Y = 15;
35+ NICO = 'www.nicovideo.jp';
3436
3537 constructor TPreviewBrowser.Create(AOwner: TComponent);
3638 begin
@@ -52,7 +54,6 @@ end;
5254 }
5355 procedure TPreviewBrowser.PreviewImage(URL : String);
5456 var
55- html : string;
5657 HtmlFileName : string;
5758 sl : TStringList;
5859 Protocol, Host, Path, Document, Port, Bookmark : string;
@@ -62,41 +63,21 @@ var
6263 PostData: OleVariant;
6364 Headers: OleVariant;
6465 begin
65- html := '<html><head>'#13#10
66- + '<SCRIPT>'#13#10
67- + 'function init() {'#13#10
68- + ' if ((document.body.clientHeight >= Image1.height) && (document.body.clientWidth >= Image1.width)) {'#13#10
69- + ' } else {'#13#10
70- + ' var dh, ih;'#13#10
71- + ' dh = document.body.clientWidth / document.body.clientHeight;'#13#10
72- + ' ih = Image1.width / Image1.height;'#13#10
73- + ' if (document.body.clientWidth < document.body.clientHeight) {'#13#10
74- + ' if (ih > dh)'#13#10
75- + ' Image1.width = document.body.clientWidth;'#13#10
76- + ' else'#13#10
77- + ' Image1.height = document.body.clientHeight;'#13#10
78- + ' } else {'#13#10
79- + ' if (ih < dh)'#13#10
80- + ' Image1.height = document.body.clientHeight;'#13#10
81- + ' else'#13#10
82- + ' Image1.width = document.body.clientWidth;'#13#10
83- + ' }'#13#10
84- + ' }'#13#10
85- + ' Message.style.display = "none";'#13#10
86- + '}'#13#10
87- + '</SCRIPT>'#13#10
88- + '</head>'#13#10
89- + '<body topmargin="0" leftmargin="0" style="border-width: 1px; overflow:hidden; border-style: solid;" onLoad="init()">'#13#10
90- + '<div align="center" id="Message">プレビュー作成中</div>'#13#10
91- + '<div align="center"><img name="Image1" border="0" src="%ImageURL%"></div>'#13#10
92- + '</body></html>';
93-
66+ GikoSys.ParseURI(URL, Protocol, Host, Path, Document, Port, Bookmark);
67+ Referer := Protocol + '://' + Host;
68+ if Port <> '' then
69+ Referer := Referer + ':' + Port;
70+ Referer := Referer + Path;
71+ Headers := 'Referer: ' + Referer;
72+ Flags := 0;
73+ TargetFrameName := '';
74+ PostData := '';
75+
9476 HtmlFileName := GikoSys.GetAppDir + HTML_FILE_NAME;
9577 sl := TStringList.Create;
9678 try
9779 try
98- sl.Text := MojuUtils.
99- CustomStringReplace(html, '%ImageURL%', URL, False);
80+ sl.Text := makeHTML(URL, Host, Document);
10081 sl.SaveToFile(HtmlFileName);
10182 finally
10283 sl.Free;
@@ -104,15 +85,6 @@ begin
10485 except
10586 end;
10687
107- GikoSys.ParseURI(URL, Protocol, Host, Path, Document, Port, Bookmark);
108- Referer := Protocol + '://' + Host;
109- if Port <> '' then
110- Referer := Referer + ':' + Port;
111- Referer := Referer + Path;
112- Headers := 'Referer: ' + Referer;
113- Flags := 0;
114- TargetFrameName := '';
115- PostData := '';
11688
11789 Navigate(HtmlFileName,Flags, TargetFrameName, PostData, Headers);
11890
@@ -173,4 +145,60 @@ begin
173145 end;
174146
175147 end;
148+
149+{
150+\breif プレビュー用のHTMLを作成する
151+\param URL プレビューするイメージファイル
152+}
153+function TPreviewBrowser.makeHTML(const URL, Host, Document : String): String;
154+var
155+ point :TPoint;
156+ rect :TRect;
157+begin
158+ if (Pos('http://www.nicovideo.jp/watch/', URL) <> 1) then begin
159+ Result := '<html><head>'#13#10
160+ + '<SCRIPT>'#13#10
161+ + 'function init() {'#13#10
162+ + ' if ((document.body.clientHeight >= Image1.height) && (document.body.clientWidth >= Image1.width)) {'#13#10
163+ + ' } else {'#13#10
164+ + ' var dh, ih;'#13#10
165+ + ' dh = document.body.clientWidth / document.body.clientHeight;'#13#10
166+ + ' ih = Image1.width / Image1.height;'#13#10
167+ + ' if (document.body.clientWidth < document.body.clientHeight) {'#13#10
168+ + ' if (ih > dh)'#13#10
169+ + ' Image1.width = document.body.clientWidth;'#13#10
170+ + ' else'#13#10
171+ + ' Image1.height = document.body.clientHeight;'#13#10
172+ + ' } else {'#13#10
173+ + ' if (ih < dh)'#13#10
174+ + ' Image1.height = document.body.clientHeight;'#13#10
175+ + ' else'#13#10
176+ + ' Image1.width = document.body.clientWidth;'#13#10
177+ + ' }'#13#10
178+ + ' }'#13#10
179+ + ' Message.style.display = "none";'#13#10
180+ + '}'#13#10
181+ + '</SCRIPT>'#13#10
182+ + '</head>'#13#10
183+ + '<body topmargin="0" leftmargin="0" style="border-width: 1px; overflow:hidden; border-style: solid;" onLoad="init()">'#13#10
184+ + '<div align="center" id="Message">プレビュー作成中</div>'#13#10
185+ + '<div align="center"><img name="Image1" border="0" src="' + URL + '"></div>'#13#10
186+ + '</body></html>';
187+ end else begin
188+ // <div><iframe width="340" height="185" src="http://www.nicovideo.jp/thumb/sm2494604" scrolling="no" style="border:solid 1px #CCC;" frameborder="0"></iframe></div><div class=link_nicovideo_title><a href="" title="" target="_blank"></a></div>
189+ rect := GetWindowRect(point);
190+
191+ Result := '<html><head>'#13#10
192+ + '<SCRIPT>'#13#10
193+ + 'function init() {'#13#10
194+ + ' Message.style.display = "none";'#13#10
195+ + '}'#13#10
196+ + '</SCRIPT>'#13#10
197+ + '</head>'#13#10
198+ + '<body topmargin="0" leftmargin="0" style="border-width: 1px; overflow:hidden; border-style: solid;" onLoad="init()">'#13#10
199+ + '<div align="center" id="Message">プレビュー作成中</div>'#13#10
200+ + '<div><iframe width="' + IntToStr(rect.Right - rect.Left) +'" height="' + IntToStr(rect.Bottom - rect.Top) + '" src="http://' + Host + '/thumb/' + Document + '" scrolling="no" style="border:solid 1px #CCC;" frameborder="0"></iframe></div>'
201+ + '</body></html>';
202+ end;
203+end;
176204 end.
--- a/Setting.pas
+++ b/Setting.pas
@@ -440,6 +440,8 @@ type
440440 FLoopBrowserTabs : Boolean;
441441 //! 100レス表示の先頭表示レス数
442442 FHeadResCount : Integer;
443+ //! 100レス表示数(拡張用)
444+ FResRangeExCount: Integer;
443445 //! 関連キーワード追加フラグ
444446 FAddKeywordLink: Boolean;
445447 //! dat置換を有効にする
@@ -810,6 +812,8 @@ type
810812 property LoopBrowserTabs : Boolean read FLoopBrowserTabs write FLoopBrowserTabs;
811813 //! 100レス表示の先頭表示レス数
812814 property HeadResCount : Integer read FHeadResCount write FHeadResCount;
815+ //! 100レス表示数(拡張用)
816+ property ResRangeExCount: Integer read FResRangeExCount write FResRangeExCount;
813817 //! 関連キーワード追加フラグ
814818 property AddKeywordLink: Boolean read FAddKeywordLink write FAddKeywordLink;
815819 //! datの置換を有効にするか
@@ -1127,6 +1131,7 @@ begin
11271131 FResRange := ini.ReadInteger( 'Thread', 'ResRange', Ord( grrAll ) );
11281132 FResRangeHold := ini.ReadBool( 'Thread', 'ResRangeHold', False );
11291133 FHeadResCount := ini.ReadInteger('Thread', 'HeadResCount', 1);
1134+ FResRangeExCount:= ini.ReadInteger('Thread','ResRangeExCount', 100);
11301135 // スレッド一覧表示範囲
11311136 FThreadRange := TGikoThreadRange( ini.ReadInteger('ThreadList', 'ThreadRange', Ord( gtrAll )) );
11321137 //非アクティブ時レスポップアップ表示
@@ -1531,6 +1536,7 @@ begin
15311536 ini.WriteInteger('Thread', 'ResRange', FResRange);
15321537 ini.WriteBool('Thread', 'ResRangeHold', FResRangeHold);
15331538 ini.WriteInteger('Thread', 'HeadResCount', FHeadResCount);
1539+ ini.WriteInteger('Thread','ResRangeExCount', FResRangeExCount);
15341540 // スレッド一覧表示範囲
15351541 ini.WriteInteger('ThreadList', 'ThreadRange', Ord( FThreadRange ));
15361542 //ログ削除確認
--- a/UpdateCheck.pas
+++ b/UpdateCheck.pas
@@ -80,7 +80,7 @@ const
8080 CHECK_URL = 'http://gikonavi.sourceforge.jp/updater/latest.txt';
8181 {$ENDIF}
8282 var
83- value : string;
83+ value, url : string;
8484 ResStream: TMemoryStream;
8585 downResult, current, newest: TStringList;
8686 newgiko: Boolean;
@@ -129,8 +129,10 @@ begin
129129 newgiko := false;
130130 // night buildは、ビルド番号だけで判定する
131131 if (nightbuild) then begin
132+ url := downResult.Values[ 'n_url' ];
132133 newgiko := StrToInt(current[3]) < StrToInt(newest[3]);
133134 end else begin
135+ url := downResult.Values[ 'url' ];
134136 newgiko := ( StrToInt(current[1]) < StrToInt(newest[1]) ) or
135137 ( (StrToInt(current[1]) = StrToInt(newest[1]))) and
136138 ((StrToInt(current[2]) < StrToInt(newest[2])) );
@@ -138,9 +140,8 @@ begin
138140 if (newgiko) then begin
139141 if GikoUtil.MsgBox(Handle, '新しいギコナビがあります。ダウンロードしますか?', '更新確認',
140142 MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) = ID_YES then begin
141-
142- ResultMemo.Lines.Add('新しいギコナビがあります。ダウンロードを開始します。' + downResult.Values[ 'url' ]);
143- DonwloadUpdate(Trim(downResult.Values[ 'url' ]));
143+ ResultMemo.Lines.Add('新しいギコナビがあります。ダウンロードを開始します。' + url);
144+ DonwloadUpdate(Trim(url));
144145 Result := True;
145146 end;
146147 end else begin
Binary files a/gikoNavi.res and b/gikoNavi.res differ
--- a/readme/gikoSetup.iss
+++ b/readme/gikoSetup.iss
@@ -13,8 +13,8 @@ SourceDir=G:\Release
1313 OutputDir=G:\InnoSetup\Output
1414 SetupIconFile="G:\gikoNaviSFX_102\MainIcon.ico"
1515 ; ギコナビのバージョンにあわせてください
16-VersionInfoVersion=1.58.1.764
17-OutputBaseFilename=gikoNavi_b58_setup
16+VersionInfoVersion=1.59.1.778
17+OutputBaseFilename=gikoNavi_b59_setup
1818
1919
2020 [Tasks]
--- a/readme/gikoUSetup.iss
+++ b/readme/gikoUSetup.iss
@@ -18,8 +18,8 @@ SourceDir=G:\Release
1818 OutputDir=G:\InnoSetup\Output
1919 SetupIconFile="G:\gikoNaviSFX_102\MainIcon.ico"
2020 ; ギコナビのバージョンにあわせてください
21-VersionInfoVersion=1.59.0.778
22-OutputBaseFilename=gikoNavi_b59_778_usetup
21+VersionInfoVersion=1.60.0.779
22+OutputBaseFilename=gikoNavi_b60_779_usetup
2323 CreateUninstallRegKey=no
2424
2525 [Tasks]
--- a/readme/readme.txt
+++ b/readme/readme.txt
@@ -1,4 +1,4 @@
1-■ギコナビ Version1.00 バタ59 Readme.txt
1+■ギコナビ Version1.00 バタ60 Readme.txt
22
33
44 ------------------------------
@@ -108,8 +108,19 @@ LICENSE
108108 ------------------------------
109109 履歴
110110 ------------------------------
111-2008/XX/XX
111+2009/XX/YY
112+ Version バタ60
113+
114+
115+2009/02/01
112116 Version バタ59
117+ レス本文中にAタグ以外のタグが含まれると、レスポップアップで、本文が欠ける不具合の修正
118+ ギコナビ更新機能追加
119+ メインフォームで利用しているアイコンの画像を差し替えれるように修正
120+ 保存したタブのログが存在しない場合にこける問題の修正
121+ RoundBoard.2ch、RoundItem.2chの内容が1行もない場合クラッシュするバグの修正
122+ 前回投稿時とIPアドレス(ホスト名)が変わっているときに、Cookie情報が空になる不具合の修正
123+ したらばJBBSの過去ログで、投稿日+IDの前に"投稿日:"の文字列がない場合に対応
113124
114125 2008/09/16
115126 Version バタ58
--- a/res/ExternalBoardPlugIn/MachiBBSPlugIn.dpr
+++ b/res/ExternalBoardPlugIn/MachiBBSPlugIn.dpr
@@ -83,7 +83,7 @@ const
8383 MAJOR_VERSION = 1;
8484 MINOR_VERSION = 0;
8585 RELEASE_VERSION = 'beta';
86- REVISION_VERSION = 19;
86+ REVISION_VERSION = 20;
8787
8888 // =========================================================================
8989 // 雑用関数
@@ -472,7 +472,6 @@ var
472472 foundPos := AnsiPos( '<table', downResult.Text ) - 1;
473473 if foundPos > 0 then
474474 downResult.Text := Copy( downResult.Text, 1, foundPos );
475-
476475 // まちBBSは dat 直読みが出来ないし、cgi 以外に差分読み込みの方法があるわけでも無いので
477476 // 素のままを無理に保とうとはせずに 2ch の dat 形式に変換したものを保存してしまう
478477 To2chDat( downResult, Count + 1 );
@@ -519,13 +518,13 @@ begin
519518 if Count = 0 then
520519 // 1〜
521520 datURL :=
522- uri.Protocol + '://' + uri.Host + '/bbs/read.pl?' +
521+ uri.Protocol + '://' + uri.Host + '/bbs/read.cgi?' +
523522 'BBS=' + uriList.Values[ 'BBS' ] + '&KEY=' + uriList.Values[ 'KEY' ] +
524523 '&START=' + IntToStr( 1 )
525524 else
526525 // 新着のみ
527526 datURL :=
528- uri.Protocol + '://' + uri.Host + '/bbs/read.pl?' +
527+ uri.Protocol + '://' + uri.Host + '/bbs/read.cgi?' +
529528 'BBS=' + uriList.Values[ 'BBS' ] + '&KEY=' + uriList.Values[ 'KEY' ] +
530529 '&START=' + IntToStr( Count + 1 ) + '&NOFIRST=TRUE';
531530 // ダウンロード
@@ -767,7 +766,7 @@ procedure TMachiBBSThreadItem.To2chDat(
767766 );
768767 var
769768 i, bound : Integer;
770- foundPos : Integer;
769+ foundPos,foundPos2 : Integer;
771770 strTmp : string;
772771 res : TStringList;
773772 no : Integer;
@@ -804,6 +803,7 @@ begin
804803 // あぼーんチェックで問題が発生しても先へ進めたいので
805804 end;
806805
806+
807807 // トリップの後の '<b> </b>' を空に
808808 if AnsiPos('◆</b>', ioHTML.Text) <> 0 then begin
809809 ioHTML.Text := CustomStringReplace( ioHTML.Text, '<b> </b></font>', '</b></font>', true );
@@ -828,6 +828,7 @@ begin
828828 try
829829 bound := ioHTML.Count - 1;
830830 for i := 0 to bound do begin
831+ // スクリプトが含まれていたら削除する(広告対策)
831832 res.Text := CustomStringReplace( ioHTML[ i ], '<>', #10 );
832833 //StringReplace( ioHTML[ i ], '<>', #10, [rfReplaceAll] );
833834 if res.Count >= 3 then begin // 3 未満はありえないと思うけど安全のため
@@ -855,7 +856,15 @@ begin
855856 end;
856857 end;
857858 ioHTML[ i ] := CustomStringReplace( res.Text, #13#10, '<>');
858- //StringReplace( res.Text, #13#10, '<>', [rfReplaceAll] );
859+ // 広告スクリプト対策
860+ foundPos := Pos( '<script', ioHTML[ i ] );
861+ if foundPos > 0 then begin
862+ foundPos2 := Pos( '</script>', ioHTML[ i ] );
863+ if (foundPos2 > foundPos) then begin
864+ ioHTML[ i ] := Copy(ioHTML[ i ], 1, foundPos-1) +
865+ Copy(ioHTML[ i ], foundPos2 + 9, Length(ioHTML[ i ]));
866+ end;
867+ end;
859868 end;
860869 finally
861870 res.Free;
Binary files a/res/ExternalBoardPlugIn/MachiBBSPlugIn.res and b/res/ExternalBoardPlugIn/MachiBBSPlugIn.res differ
Show on old repository browser