OSDN Git Service

スレッドの最後に関連キーワードのリンクを加えるオプションを追加
authorh677 <h677>
Tue, 13 Feb 2007 15:58:59 +0000 (15:58 +0000)
committerh677 <h677>
Tue, 13 Feb 2007 15:58:59 +0000 (15:58 +0000)
スレッド一覧にカテゴリを表示しているときの名前をコピーを有効にした。

Giko.dfm
Giko.pas
GikoDataModule.pas
HTMLCreate.pas
KuroutSetting.dfm
KuroutSetting.pas
Setting.pas

index 3137450..b167091 100644 (file)
--- a/Giko.dfm
+++ b/Giko.dfm
@@ -5147,7 +5147,7 @@ object GikoForm: TGikoForm
     object UrlCopyPMenu: TMenuItem
       Action = GikoDM.SelectItemURLCopyAction
     end
-    object C2: TMenuItem
+    object NameCopyPMenu: TMenuItem
       Action = GikoDM.SelectItemNameCopyAction
     end
     object NameUrlCopyPMenu: TMenuItem
index a546364..5bc3617 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -284,7 +284,7 @@ type
                SelectItemNameCopyAction1: TMenuItem;
                B6: TMenuItem;
                T9: TMenuItem;
-               C2: TMenuItem;
+    NameCopyPMenu: TMenuItem;
                SelectComboBox: TComboBox;
                MainCoolBarPopupMenu: TPopupMenu;
                StdToolBarVisiblePMenu: TMenuItem;
@@ -3555,7 +3555,7 @@ end;
 
 procedure TGikoForm.ListPopupMenuPopup(Sender: TObject);
 var
-    bBoard, bCategory : Boolean;
+    bBoard, bCategory, bBBS : Boolean;
 begin
     bBoard := (GetActiveList is TBoard);
     bCategory := (GetActiveList is TCategory);
index 5bf4dae..bfad25e 100644 (file)
@@ -2902,7 +2902,9 @@ begin
        try
                GikoForm.SelectListItem(List);
                for i := 0 to List.Count - 1 do begin
-                       if TObject(List[i]) is TBoard then
+            if TObject(List[i]) is TCategory then
+                s := s + TCategory(List[i]).Title + #13#10
+                       else if TObject(List[i]) is TBoard then
                                s := s + TBoard(List[i]).Title + #13#10
                        else if TObject(List[i]) is TThreadItem then
                                s := s + TThreadItem(List[i]).Title + #13#10;
@@ -2918,7 +2920,8 @@ end;
 // *************************************************************************
 procedure TGikoDM.SelectItemNameCopyActionUpdate(Sender: TObject);
 begin
-       if ((GikoForm.GetActiveList is TBoard) or
+       if ((GikoForm.GetActiveList is TBBS) or
+        (GikoForm.GetActiveList is TBoard) or
                (GikoForm.GetActiveList is TCategory))and (GikoForm.ListView.SelCount > 0) then
                TAction(Sender).Enabled := True
        else
index 0bec152..15e230f 100644 (file)
@@ -68,6 +68,7 @@ type
         function getNumberString(const str: String;var index :Integer; var dbCharlen: Boolean;
              sLen :Integer): String;
         function isOutsideRange(item: TThreadItem; index: Integer ): Boolean;
+        function getKeywordLink(item: TThreadItem): String;
        public
                { Public \90é\8c¾ }
                procedure AddAnchorTag(PRes: PResRec);
@@ -797,7 +798,7 @@ begin
                                html.Add( KOKO_TAG );
                end;
        end;
-
+    html.Add(getKeywordLink(ThreadItem));
        html.Add('<a name="bottom"></a>');
        // \83X\83L\83\93(\83t\83b\83^)
        html.Add( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) );
@@ -886,7 +887,7 @@ begin
                        end;
 
                end;
-
+        html.Add(getKeywordLink(ThreadItem));
                html.Add('<a name="bottom"></a>');
                html.Add('<a name="last"></a>');
                html.Add('</body></html>');
@@ -956,6 +957,7 @@ begin
                        html.Add('<dl>');
                end;
        end;
+    html.Add(getKeywordLink(ThreadItem));
        html.Add('</dl>'#13#10'<a name="bottom"></a>'#13#10'</body></html>');
 end;
 
@@ -1684,7 +1686,17 @@ begin
        end;
        inherited;
 end;
-
+//! \8aÖ\98A\83L\81[\83\8f\81[\83h\83\8a\83\93\83N\8fo\97Í
+function THTMLCreate.getKeywordLink(item: TThreadItem): String;
+const
+    PARA_URL = 'http://p2.2ch.io/getf.cgi?';
+begin
+    Result := '';
+    if (GikoSys.Setting.AddKeywordLink) and (item.ParentBoard.Is2ch) then begin
+        Result := '<p><span id="keyword"><a href="' + PARA_URL
+            + item.URL + '" target="_blank">\8aÖ\98A\83L\81[\83\8f\81[\83h</a></span></p>';
+    end;
+end;
 initialization
         HTMLCreater := THTMLCreate.Create;
 
index 52a9913..7fa64ba 100644 (file)
@@ -21,8 +21,8 @@ object KuroutOption: TKuroutOption
     Top = 0
     Width = 517
     Height = 393
-    ActivePage = KakikomiTabSheet
-    TabIndex = 2
+    ActivePage = TabSheet1
+    TabIndex = 0
     TabOrder = 0
     object TabSheet1: TTabSheet
       Caption = #35443#32048#35373#23450#65297
@@ -427,8 +427,8 @@ object KuroutOption: TKuroutOption
       end
       object AHandredGroupBox: TGroupBox
         Left = 16
-        Top = 192
-        Width = 465
+        Top = 184
+        Width = 473
         Height = 65
         Caption = '100'#12524#12473#34920#31034#35373#23450
         TabOrder = 2
@@ -458,6 +458,22 @@ object KuroutOption: TKuroutOption
           Wrap = False
         end
       end
+      object HTMLGroupBox: TGroupBox
+        Left = 16
+        Top = 256
+        Width = 473
+        Height = 65
+        Caption = #12473#12524#12483#12489#25551#30011
+        TabOrder = 3
+        object AddKeywordCheckBox: TCheckBox
+          Left = 16
+          Top = 24
+          Width = 233
+          Height = 17
+          Caption = #38306#36899#12461#12540#12527#12540#12489#12398#12522#12531#12463#12434#36861#21152#12377#12427
+          TabOrder = 0
+        end
+      end
     end
   end
   object OkBotton: TButton
index 93bbaf4..ca72cc7 100644 (file)
@@ -68,6 +68,8 @@ type
     AHandredGroupBox: TGroupBox;
     AHandredLabeledEdit: TLabeledEdit;
     UpDown1: TUpDown;
+    HTMLGroupBox: TGroupBox;
+    AddKeywordCheckBox: TCheckBox;
        procedure OkBottonClick(Sender: TObject);
        procedure FormCreate(Sender: TObject);
        procedure CDeleteButtonClick(Sender: TObject);
@@ -136,6 +138,8 @@ begin
     MoveHistoryMaxEdit.Text := IntToStr( GikoSys.Setting.MoveHistorySize );
     //\81@\90æ\93ª\95\\8e¦\83\8c\83X\90\94
     AHandredLabeledEdit.Text := IntToStr( GikoSys.Setting.HeadResCount );
+    // \8aÖ\98A\83L\81[\83\8f\81[\83h\92Ç\89Á\83t\83\89\83O
+    AddKeywordCheckBox.Checked := GikoSys.Setting.AddKeywordLink;
 end;
 
 procedure TKuroutOption.SaveSetting;
@@ -172,6 +176,9 @@ begin
         StrToIntDef( AHandredLabeledEdit.Text , 1);
 
        GikoSys.Setting.KuroutSettingTabIndex := PageControl1.ActivePageIndex;
+    // \8aÖ\98A\83L\81[\83\8f\81[\83h\92Ç\89Á\83t\83\89\83O
+    GikoSys.Setting.AddKeywordLink := AddKeywordCheckBox.Checked;
+
 end;
 
 procedure TKuroutOption.RecvBufferSizeExit(Sender: TObject);
index e592fdf..3220b9c 100644 (file)
@@ -441,6 +441,9 @@ type
         FLoopBrowserTabs : Boolean;
         //! 100\83\8c\83X\95\\8e¦\82Ì\90æ\93ª\95\\8e¦\83\8c\83X\90\94
         FHeadResCount : Integer;
+        //! \8aÖ\98A\83L\81[\83\8f\81[\83h\92Ç\89Á\83t\83\89\83O
+        FAddKeywordLink: Boolean;
+
                function GetMainCoolSet(Index: Integer): TCoolSet;
                function GetBoardCoolSet(Index: Integer): TCoolSet;
                function GetBrowserCoolSet(Index: Integer): TCoolSet;
@@ -790,6 +793,8 @@ type
         property LoopBrowserTabs : Boolean read FLoopBrowserTabs write FLoopBrowserTabs;
         //! 100\83\8c\83X\95\\8e¦\82Ì\90æ\93ª\95\\8e¦\83\8c\83X\90\94
         property HeadResCount : Integer read FHeadResCount write FHeadResCount;
+        //! \8aÖ\98A\83L\81[\83\8f\81[\83h\92Ç\89Á\83t\83\89\83O
+        property AddKeywordLink: Boolean read FAddKeywordLink write FAddKeywordLink;
 end;
 
 
@@ -1262,7 +1267,7 @@ begin
 
         FStoredTaskTray := ini.ReadBool('Function', 'StroedTaskTray', false);
         FLoopBrowserTabs := ini.ReadBool('Function', 'LoopBrowserTabs', false);
-
+        FAddKeywordLink := ini.ReadBool('Thread', 'AddKeywordLink', false);
                ini.UpdateFile;
        finally
                ini.Free;
@@ -1640,6 +1645,7 @@ begin
 
         ini.WriteBool('Function', 'StroedTaskTray', FStoredTaskTray);
         ini.WriteBool('Function', 'LoopBrowserTabs', FLoopBrowserTabs);
+        ini.WriteBool('Thread', 'AddKeywordLink', FAddKeywordLink);
                ini.UpdateFile;
        finally
                ini.Free;