ギコナビ
Revision | c8d738e3caf18f861cc7b756118b96f955a42e9e (tree) |
---|---|
Time | 2009-05-17 11:37:39 |
Author | h677 <h677> |
Commiter | h677 |
close #15812
レス番号コンテキストメニューにこのレスのURLコピーを追加。
2ch/したらばはPATH_INFO限定。ほかは両方で取得できるが、外部板は保障外。
@@ -8406,6 +8406,18 @@ object GikoForm: TGikoForm | ||
8406 | 8406 | object N83: TMenuItem |
8407 | 8407 | Action = GikoDM.DereferenceResAction |
8408 | 8408 | 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 | |
8409 | 8421 | end |
8410 | 8422 | object BrowserTabPopupMenu: TPopupMenu |
8411 | 8423 | Images = HotToobarImageList |
@@ -421,6 +421,10 @@ type | ||
421 | 421 | N83: TMenuItem; |
422 | 422 | UpdateGikonaviAction1: TMenuItem; |
423 | 423 | N84: TMenuItem; |
424 | + N85: TMenuItem; | |
425 | + URL2: TMenuItem; | |
426 | + URLPATHINFO1: TMenuItem; | |
427 | + URLQUERYSTRING1: TMenuItem; | |
424 | 428 | procedure FormCreate(Sender: TObject); |
425 | 429 | procedure FormDestroy(Sender: TObject); |
426 | 430 | procedure SaveSettingAll(); |
@@ -1386,6 +1386,21 @@ object GikoDM: TGikoDM | ||
1386 | 1386 | Hint = #12462#12467#12490#12499#12398#26356#26032 |
1387 | 1387 | OnExecute = UpdateGikonaviActionExecute |
1388 | 1388 | 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 | |
1389 | 1404 | end |
1390 | 1405 | object ToobarImageList: TImageList |
1391 | 1406 | Left = 44 |
@@ -243,6 +243,8 @@ type | ||
243 | 243 | ShowTabListAction: TAction; |
244 | 244 | DereferenceResAction: TAction; |
245 | 245 | UpdateGikonaviAction: TAction; |
246 | + konoURLPATHAction: TAction; | |
247 | + konoURLQueryAction: TAction; | |
246 | 248 | procedure EditNGActionExecute(Sender: TObject); |
247 | 249 | procedure ReloadActionExecute(Sender: TObject); |
248 | 250 | procedure GoFowardActionExecute(Sender: TObject); |
@@ -456,6 +458,9 @@ type | ||
456 | 458 | procedure ShowTabListActionExecute(Sender: TObject); |
457 | 459 | procedure DereferenceResActionExecute(Sender: TObject); |
458 | 460 | procedure UpdateGikonaviActionExecute(Sender: TObject); |
461 | + procedure konoURLPATHActionExecute(Sender: TObject); | |
462 | + procedure konoURLQueryActionExecute(Sender: TObject); | |
463 | + procedure konoURLQueryActionUpdate(Sender: TObject); | |
459 | 464 | private |
460 | 465 | { Private é¾ } |
461 | 466 | procedure ClearResFilter; |
@@ -4595,6 +4600,76 @@ begin | ||
4595 | 4600 | end; |
4596 | 4601 | |
4597 | 4602 | end; |
4603 | +//! ±ÌXÌURLRs[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 | + // ܿBBSpu | |
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ÌURLRs[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Ƶ½çÎÍAXÔð¤ÜµÄêÈ¢ÌÅps | |
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ÌURLRs[iQuery_STRINGjÌp`FbN | |
4660 | +procedure TGikoDM.konoURLQueryActionUpdate(Sender: TObject); | |
4661 | +const | |
4662 | + LIVEDOOR_URL = 'http://jbbs.livedoor.jp/'; | |
4663 | +begin | |
4664 | + // 2chƵ½çÎÍpūȢæ¤É·éi¤ÜXwèūȢÌÅ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; | |
4598 | 4673 | |
4599 | 4674 | end. |
4600 | 4675 |