• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

ギコナビ


Commit MetaInfo

Revision79ef146793e729cb3a38d1dfa81609b42c3ed337 (tree)
Time2008-07-14 00:51:04
Authorh677 <h677>
Commiterh677

Log Message

レス番号のコンテキストメニューから逆参照のレスアンカーを表示するメニューを追加

Change Summary

Incremental Difference

--- a/Giko.dfm
+++ b/Giko.dfm
@@ -8397,6 +8397,9 @@ object GikoForm: TGikoForm
83978397 object ID1: TMenuItem
83988398 Action = GikoDM.SameIDResAnchorAction
83998399 end
8400+ object N83: TMenuItem
8401+ Action = GikoDM.DereferenceResAction
8402+ end
84008403 end
84018404 object BrowserTabPopupMenu: TPopupMenu
84028405 Images = HotToobarImageList
--- a/Giko.pas
+++ b/Giko.pas
@@ -419,6 +419,7 @@ type
419419 ResPopupClearTimer: TTimer;
420420 TaskTrayPopupMenu: TPopupMenu;
421421 Exit1: TMenuItem;
422+ N83: TMenuItem;
422423 procedure FormCreate(Sender: TObject);
423424 procedure FormDestroy(Sender: TObject);
424425 procedure BrowserStatusTextChange(Sender: TObject;
@@ -6870,7 +6871,7 @@ begin
68706871 end
68716872 end;
68726873 FActiveContent.IDAnchorPopup(
6873- GikoSys.CreateSameIDResAnchor(numbers, FActiveContent.Thread, limited));
6874+ GikoSys.CreateResAnchor(numbers, FActiveContent.Thread, limited));
68746875 finally
68756876 numbers.Free;
68766877 end;
--- a/GikoDataModule.dfm
+++ b/GikoDataModule.dfm
@@ -1369,6 +1369,14 @@ object GikoDM: TGikoDM
13691369 Hint = #12479#12502#19968#35239#34920#31034
13701370 OnExecute = ShowTabListActionExecute
13711371 end
1372+ object DereferenceResAction: TAction
1373+ Tag = 1
1374+ Category = #12473#12524#12483#12489
1375+ Caption = #12371#12398#12524#12473#12434#21442#29031#12375#12390#12356#12427#12524#12473#12450#12531#12459#12540#34920#31034
1376+ Hint = #12371#12398#12524#12473#12434#21442#29031#12375#12390#12356#12427#12524#12473#12450#12531#12459#12540#34920#31034
1377+ OnExecute = DereferenceResActionExecute
1378+ OnUpdate = DependActiveCntentLogActionUpdate
1379+ end
13721380 end
13731381 object ToobarImageList: TImageList
13741382 Left = 44
--- a/GikoDataModule.pas
+++ b/GikoDataModule.pas
@@ -241,6 +241,7 @@ type
241241 AddIDtoNGWord1Action: TAction;
242242 ExtractSameIDAction: TAction;
243243 ShowTabListAction: TAction;
244+ DereferenceResAction: TAction;
244245 procedure EditNGActionExecute(Sender: TObject);
245246 procedure ReloadActionExecute(Sender: TObject);
246247 procedure GoFowardActionExecute(Sender: TObject);
@@ -452,6 +453,7 @@ type
452453 procedure AddIDtoNGWord1ActionExecute(Sender: TObject);
453454 procedure ExtractSameIDActionExecute(Sender: TObject);
454455 procedure ShowTabListActionExecute(Sender: TObject);
456+ procedure DereferenceResActionExecute(Sender: TObject);
455457 private
456458 { Private éŒ¾ }
457459 procedure ClearResFilter;
@@ -4399,7 +4401,7 @@ begin
43994401 // ƒŒƒX‚̔ԍ†‚ðXV
44004402 if (Pos('menu:', url) > 0) then begin
44014403 index := StrToInt64Def(
4402- Copy(url, 5, Length(url)), index + 1
4404+ Copy(url, 6, Length(url)), index + 1
44034405 );
44044406 end else begin
44054407 // ŠJŽnƒŒƒX”ԍ†ˆÈ~‚©ƒ`ƒFƒbƒN
@@ -4494,5 +4496,72 @@ begin
44944496 GikoForm.ListView.Items.EndUpdate;
44954497 GikoForm.SetActiveList(BoardGroup.SpecialBoard);
44964498 end;
4499+//! ‹tŽQÆ‚µ‚Ä‚¢‚郌ƒX‚ð’ljÁ‚·‚é
4500+procedure TGikoDM.DereferenceResActionExecute(Sender: TObject);
4501+var
4502+ i, currentNo, No : Integer;
4503+ links : IHTMLElementCollection;
4504+ threadItem : TThreadItem;
4505+ item : IHTMLElement;
4506+ url, url2 : string;
4507+ resNo : TStringList;
4508+ alreadyExist : Boolean;
4509+ PathRec: TPathRec;
4510+begin
4511+ No := GikoForm.KokoPopupMenu.Tag;
4512+ if No = 0 then Exit;
4513+
4514+ ThreadItem := GikoForm.GetActiveContent;
4515+ // ƒAƒNƒeƒBƒuƒ^ƒu‚©‚ç‘S‚ẴŠƒ“ƒN‚ðŽæ“¾‚·‚é
4516+ links := GetActiveThreadLinks;
4517+ if (ThreadItem <> nil) and (links <> nil) then begin
4518+ resNo := TStringList.Create;
4519+ try
4520+ currentNo := 0;
4521+ alreadyExist := False;
4522+ // ƒŠƒ“ƒN‚ð‘S‚Ä‘–¸‚·‚é
4523+ for i := 0 to links.length - 1 do begin
4524+ item := links.item(i, 0) as IHTMLElement;
4525+ if (item <> nil) then begin
4526+ url := item.getAttribute('href', 0);
4527+ // ƒŒƒX‚̔ԍ†‚ðXV
4528+ if (Pos('menu:', url) > 0) then begin
4529+ currentNo := StrToInt64Def(
4530+ Copy(url, 6, Length(url)), currentNo + 1
4531+ );
4532+ alreadyExist := False;
4533+ end else if (currentNo <> -1) and (not alreadyExist) then begin
4534+ // IE7‘Ήž
4535+ if Pos('about:..', url) = 1 then begin
4536+ url := 'about:blank..' + Copy( url, Length('about:..')+1, Length(url) )
4537+ end;
4538+ // Ž©•ª‚ւ̃Šƒ“ƒN‚©‚烌ƒXƒ|ƒbƒv—p‚̔ԍ†Žæ“¾
4539+ if Pos('about:blank..', url) = 1 then begin
4540+ // No ”Ԃւ̃Šƒ“ƒN‚ª‚ ‚ê‚ÎŽQÆ‚ ‚è
4541+ url2 := THTMLCreate.GetRespopupURL(url, ThreadItem.URL);
4542+ PathRec := Gikosys.Parse2chURL2(url2);
4543+ if (not PathRec.FNoParam) then begin
4544+ Gikosys.GetPopupResNumber(url2,PathRec.FSt,PathRec.FTo);
4545+ end;
4546+ // ‘ΏۃŒƒX‚à‚µ‚­‚Í‚»‚ê‚ðŠÜ‚Þ‚È‚çŽQÆ‚ ‚è‚Æ‚·‚é
4547+ if (PathRec.FSt = No) or
4548+ ((PathRec.FSt <= No) and (PathRec.FTo >= No)) then begin
4549+ alreadyExist := True;
4550+ resNo.Add(IntToStr(currentNo));
4551+ end;
4552+ end;
4553+ end;
4554+ end;
4555+ end;
4556+ // –³§ŒÀ‚È‚Ì‚Å-1ŒÅ’è
4557+ GikoForm.ActiveContent.IDAnchorPopup(
4558+ GikoSys.CreateResAnchor(resNo, ThreadItem, -1));
4559+ finally
4560+ resNo.Clear;
4561+ resNo.Free;
4562+ end;
4563+ end;
4564+end;
4565+
44974566 end.
44984567
--- a/GikoSystem.pas
+++ b/GikoSystem.pas
@@ -213,7 +213,7 @@ type
213213 procedure GetPopupResNumber(URL : string; var stRes, endRes : Int64);
214214
215215 property Bayesian : TGikoBayesian read FBayesian write FBayesian;
216- function CreateSameIDResAnchor(var Numbers: TStringList; ThreadItem: TThreadItem; limited: Integer):string;
216+ function CreateResAnchor(var Numbers: TStringList; ThreadItem: TThreadItem; limited: Integer):string;
217217 procedure GetSameIDRes(const AID : string; ThreadItem: TThreadItem;var body: TStringList); overload;
218218 procedure GetSameIDRes(AIDNum : Integer; ThreadItem: TThreadItem;var body: TStringList); overload;
219219 function GetResID(AIDNum: Integer; ThreadItem: TThreadItem): String;
@@ -2770,7 +2770,7 @@ end;
27702770 \param limited —ñ‹“‚·‚鐔‚𐧌À‚·‚é‚È‚ç1ˆÈã
27712771 \return —ñ‹“‚³‚ꂽƒŒƒXƒAƒ“ƒJ[
27722772 }
2773-function TGikoSys.CreateSameIDResAnchor(
2773+function TGikoSys.CreateResAnchor(
27742774 var Numbers: TStringList; ThreadItem: TThreadItem;
27752775 limited: Integer):string;
27762776 var