• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

ギコナビ


Commit MetaInfo

Revisionc8d738e3caf18f861cc7b756118b96f955a42e9e (tree)
Time2009-05-17 11:37:39
Authorh677 <h677>
Commiterh677

Log Message

close #15812
レス番号コンテキストメニューにこのレスのURLコピーを追加。
2ch/したらばはPATH_INFO限定。ほかは両方で取得できるが、外部板は保障外。

Change Summary

Incremental Difference

--- a/Giko.dfm
+++ b/Giko.dfm
@@ -8406,6 +8406,18 @@ object GikoForm: TGikoForm
84068406 object N83: TMenuItem
84078407 Action = GikoDM.DereferenceResAction
84088408 end
8409+ object N85: TMenuItem
8410+ Caption = '-'
8411+ end
8412+ object URL2: TMenuItem
8413+ Caption = #12371#12398#12524#12473#12398'URL'
8414+ object URLPATHINFO1: TMenuItem
8415+ Action = GikoDM.konoURLPATHAction
8416+ end
8417+ object URLQUERYSTRING1: TMenuItem
8418+ Action = GikoDM.konoURLQueryAction
8419+ end
8420+ end
84098421 end
84108422 object BrowserTabPopupMenu: TPopupMenu
84118423 Images = HotToobarImageList
--- a/Giko.pas
+++ b/Giko.pas
@@ -421,6 +421,10 @@ type
421421 N83: TMenuItem;
422422 UpdateGikonaviAction1: TMenuItem;
423423 N84: TMenuItem;
424+ N85: TMenuItem;
425+ URL2: TMenuItem;
426+ URLPATHINFO1: TMenuItem;
427+ URLQUERYSTRING1: TMenuItem;
424428 procedure FormCreate(Sender: TObject);
425429 procedure FormDestroy(Sender: TObject);
426430 procedure SaveSettingAll();
--- a/GikoDataModule.dfm
+++ b/GikoDataModule.dfm
@@ -1386,6 +1386,21 @@ object GikoDM: TGikoDM
13861386 Hint = #12462#12467#12490#12499#12398#26356#26032
13871387 OnExecute = UpdateGikonaviActionExecute
13881388 end
1389+ object konoURLPATHAction: TAction
1390+ Tag = -1
1391+ Category = #12502#12521#12454#12470#12509#12483#12503#12450#12483#12503
1392+ Caption = 'PATH_INFO'#24418#24335
1393+ Hint = #12371#12398#12524#12473#12398'URL'#12467#12500#12540#65288'PATH_INFO'#65289
1394+ OnExecute = konoURLPATHActionExecute
1395+ end
1396+ object konoURLQueryAction: TAction
1397+ Tag = -1
1398+ Category = #12502#12521#12454#12470#12509#12483#12503#12450#12483#12503
1399+ Caption = 'QUERY_STRING'#24418#24335
1400+ Hint = #12371#12398#12524#12473#12398'URL'#12467#12500#12540#65288'QUERY_STRING'#65289
1401+ OnExecute = konoURLQueryActionExecute
1402+ OnUpdate = konoURLQueryActionUpdate
1403+ end
13891404 end
13901405 object ToobarImageList: TImageList
13911406 Left = 44
--- a/GikoDataModule.pas
+++ b/GikoDataModule.pas
@@ -243,6 +243,8 @@ type
243243 ShowTabListAction: TAction;
244244 DereferenceResAction: TAction;
245245 UpdateGikonaviAction: TAction;
246+ konoURLPATHAction: TAction;
247+ konoURLQueryAction: TAction;
246248 procedure EditNGActionExecute(Sender: TObject);
247249 procedure ReloadActionExecute(Sender: TObject);
248250 procedure GoFowardActionExecute(Sender: TObject);
@@ -456,6 +458,9 @@ type
456458 procedure ShowTabListActionExecute(Sender: TObject);
457459 procedure DereferenceResActionExecute(Sender: TObject);
458460 procedure UpdateGikonaviActionExecute(Sender: TObject);
461+ procedure konoURLPATHActionExecute(Sender: TObject);
462+ procedure konoURLQueryActionExecute(Sender: TObject);
463+ procedure konoURLQueryActionUpdate(Sender: TObject);
459464 private
460465 { Private éŒ¾ }
461466 procedure ClearResFilter;
@@ -4595,6 +4600,76 @@ begin
45954600 end;
45964601
45974602 end;
4603+//! ‚±‚̃ŒƒX‚ÌURLƒRƒs[iPATH_INFO)
4604+procedure TGikoDM.konoURLPATHActionExecute(Sender: TObject);
4605+var
4606+ No : Integer;
4607+ ThreadItem : TThreadItem;
4608+ URL, Protocol, Host, Path, Document, Port, Bookmark : String;
4609+begin
4610+ No := GikoForm.KokoPopupMenu.Tag;
4611+ if No = 0 then Exit;
4612+
4613+ ThreadItem := GikoForm.KokoPopupThreadItem;
4614+ if (ThreadItem.ParentBoard.Is2ch) or not (Pos('?', ThreadItem.URL) > 0) then begin
4615+ GikoSys.ParseURI(ThreadItem.URL,Protocol, Host, Path, Document, Port, Bookmark);
4616+ URL := Protocol + '://' + Host + Path + IntToStr(No);
4617+ end else begin
4618+ if Pos('?', ThreadItem.URL) > 0 then begin
4619+ URL := Copy(ThreadItem.URL, 1, Pos('?', ThreadItem.URL)-1);
4620+ // ‚Ü‚¿BBS—pˆ’u
4621+ URL := MojuUtils.CustomStringReplace(URL, 'read.pl', 'read.cgi');
4622+ URL := URL + '/' + ThreadItem.ParentBoard.BBSID + '/' + ChangeFileExt(ThreadItem.FileName, '') + '/' + IntToStr(No);
4623+ end;
4624+ end;
4625+ Clipboard.SetTextBuf( PChar(URL) );
4626+end;
4627+//! ‚±‚̃ŒƒX‚ÌURLƒRƒs[iQuery_STRING)
4628+procedure TGikoDM.konoURLQueryActionExecute(Sender: TObject);
4629+var
4630+ No : Integer;
4631+ ThreadItem : TThreadItem;
4632+ URL, Protocol, Host, Path, Document, Port, Bookmark : String;
4633+begin
4634+ No := GikoForm.KokoPopupMenu.Tag;
4635+ if No = 0 then Exit;
4636+
4637+ ThreadItem := GikoForm.KokoPopupThreadItem;
4638+ // 2ch‚Æ‚µ‚½‚ç‚΂́AƒŒƒX”ԍ†‚ð‚¤‚Ü‚­ˆ—‚µ‚Ä‚­‚ê‚È‚¢‚Ì‚Å—˜—p•s‰Â
4639+ if ThreadItem.ParentBoard.Is2ch or not (Pos('?', ThreadItem.URL) > 0) then begin
4640+ GikoSys.ParseURI(ThreadItem.URL, Protocol, Host, Path, Document, Port, Bookmark);
4641+ URL := Protocol + '://' + Host + '/test/read.cgi?bbs=' + ThreadItem.ParentBoard.BBSID
4642+ + '&key=' + ChangeFileExt(ThreadItem.FileName, '') + '&st=' + IntToStr(No) + '&to=' + IntToStr(No);
4643+ end else begin
4644+ URL := ThreadItem.URL;
4645+ // ‚Ü‚¿BBS
4646+ if Pos('&LAST=', URL) > 0 then begin
4647+ URL := Copy(URL, 1, Pos('&LAST=', URL) - 1);
4648+ URL := URL + '&START=' + IntToStr(No) + '&END=' + IntToStr(No);
4649+ end;
4650+ // ‚»‚Ì‘¼ŠO•””Â
4651+ if Pos('&ls=', URL) > 0 then begin
4652+ URL := Copy(URL, 1, Pos('&ls=', URL) - 1);
4653+ URL := URL + '&st=' + IntToStr(No) + '&to=' + IntToStr(No);
4654+ end;
4655+
4656+ end;
4657+ Clipboard.SetTextBuf( PChar(URL) );
4658+end;
4659+//! ‚±‚̃ŒƒX‚ÌURLƒRƒs[iQuery_STRINGj‚Ì—˜—pƒ`ƒFƒbƒN
4660+procedure TGikoDM.konoURLQueryActionUpdate(Sender: TObject);
4661+const
4662+ LIVEDOOR_URL = 'http://jbbs.livedoor.jp/';
4663+begin
4664+ // 2ch‚Æ‚µ‚½‚ç‚΂͗˜—p‚Å‚«‚È‚¢‚悤‚É‚·‚éi‚¤‚Ü‚­ƒŒƒXŽw’è‚Å‚«‚È‚¢‚̂Łj
4665+ konoURLQueryAction.Enabled := false;
4666+ if (GikoForm.KokoPopupThreadItem <> nil) then begin
4667+ konoURLQueryAction.Enabled := not GikoForm.KokoPopupThreadItem.ParentBoard.Is2ch;
4668+ if konoURLQueryAction.Enabled then begin
4669+ konoURLQueryAction.Enabled := not (Pos(LIVEDOOR_URL, GikoForm.KokoPopupThreadItem.URL) = 1);
4670+ end;
4671+ end;
4672+end;
45984673
45994674 end.
46004675