OSDN Git Service

ブラウザポップアップメニューに、IDで個別あぼ〜ん追加。
authorh677 <h677>
Wed, 3 Nov 2004 14:33:57 +0000 (14:33 +0000)
committerh677 <h677>
Wed, 3 Nov 2004 14:33:57 +0000 (14:33 +0000)
IDポップアップをブラウザポップアップメニューに追加。

Giko.dfm
Giko.pas
GikoSystem.pas
IndividualAbon.pas

index c9e4695..afe5fcf 100644 (file)
--- a/Giko.dfm
+++ b/Giko.dfm
@@ -1,6 +1,6 @@
 object GikoForm: TGikoForm
-  Left = 312
-  Top = 57
+  Left = 284
+  Top = 50
   HorzScrollBar.Visible = False
   VertScrollBar.Visible = False
   AutoScroll = False
@@ -5903,7 +5903,6 @@ object GikoForm: TGikoForm
       object N42: TMenuItem
         Caption = #20491#21029#12354#12412#12540#12435#35299#38500
         GroupIndex = 1
-        OnClick = N42Click
       end
     end
     object FavoriteMenu: TMenuItem
@@ -6838,7 +6837,6 @@ object GikoForm: TGikoForm
       Category = 'NGword'
       Caption = #20491#21029#12354#12412#12540#12435#35299#38500
       Hint = #20491#21029#12354#12412#12540#12435#35299#38500
-      OnExecute = N42Click
     end
     object TreeSelectSearchBoardName: TAction
       Tag = -1
@@ -7092,6 +7090,55 @@ object GikoForm: TGikoForm
       OnExecute = LeftTabCloseActionExecute
       OnUpdate = LeftTabCloseActionUpdate
     end
+    object SameIDResAnchorAction: TAction
+      Tag = -1
+      Category = #12502#12521#12454#12470#12509#12483#12503#12450#12483#12503
+      Caption = #21516'ID'#12408#12398#12524#12473#12450#12531#12459#12540#34920#31034
+      Hint = #21516'ID'#12408#12398#12524#12473#12450#12531#12459#12540#34920#31034
+      OnExecute = SameIDResAnchorActionExecute
+    end
+    object IndividualAbon1Action: TAction
+      Tag = -1
+      Category = #12502#12521#12454#12470#12509#12483#12503#12450#12483#12503
+      Caption = #12354#12412#65374#12435
+      Hint = #12354#12412#65374#12435
+      OnExecute = IndividualAbon1ActionExecute
+    end
+    object IndividualAbon0Action: TAction
+      Tag = -1
+      Category = #12502#12521#12454#12470#12509#12483#12503#12450#12483#12503
+      Caption = #36879#26126#12354#12412#65374#12435
+      Hint = #36879#26126#12354#12412#65374#12435
+      OnExecute = IndividualAbon0ActionExecute
+    end
+    object AntiIndividualAbonAction: TAction
+      Tag = -1
+      Category = #12502#12521#12454#12470#12509#12483#12503#12450#12483#12503
+      Caption = #12371#12398#12524#12473
+      Hint = #12371#12398#12524#12473
+      OnExecute = AntiIndividualAbonActionExecute
+    end
+    object AntiIndividualAbonDlgAction: TAction
+      Tag = -1
+      Category = #12502#12521#12454#12470#12509#12483#12503#12450#12483#12503
+      Caption = #12524#12473#30058#21495#25351#23450
+      Hint = #12524#12473#30058#21495#25351#23450
+      OnExecute = AntiIndividualAbonDlgActionExecute
+    end
+    object IndividualAbonID1Action: TAction
+      Tag = -1
+      Category = #12502#12521#12454#12470#12509#12483#12503#12450#12483#12503
+      Caption = #12354#12412#65374#12435
+      Hint = #12354#12412#65374#12435
+      OnExecute = IndividualAbonID1ActionExecute
+    end
+    object IndividualAbonID0Action: TAction
+      Tag = -1
+      Category = #12502#12521#12454#12470#12509#12483#12503#12450#12483#12503
+      Caption = #36879#26126#12354#12412#65374#12435
+      Hint = #36879#26126#12354#12412#65374#12435
+      OnExecute = IndividualAbonID0ActionExecute
+    end
   end
   object BrowserPopupMenu: TPopupMenu
     Left = 68
@@ -7236,6 +7283,7 @@ object GikoForm: TGikoForm
     end
   end
   object KokoPopupMenu: TPopupMenu
+    OnPopup = KokoPopupMenuPopup
     Left = 68
     Top = 372
     object KokomadePMenu: TMenuItem
@@ -7259,28 +7307,41 @@ object GikoForm: TGikoForm
     object N41: TMenuItem
       Caption = '-'
     end
-    object IndividualAbon1: TMenuItem
-      Caption = #12371#12398#12524#12473#12354#12412#65374#12435
-      OnClick = IndividualAbon1Click
-    end
-    object IndividualAbon2: TMenuItem
-      Caption = #12371#12398#12524#12473#36879#26126#12354#12412#65374#12435
-      OnClick = IndividualAbon2Click
-    end
     object N53: TMenuItem
-      Caption = '-'
+      Caption = #12371#12398#12524#12473
+      object IndividualAbon1: TMenuItem
+        Tag = 1
+        Action = IndividualAbon1Action
+      end
+      object IndividualAbon2: TMenuItem
+        Action = IndividualAbon0Action
+        OnClick = IndividualAbon1ActionExecute
+      end
+    end
+    object ID3: TMenuItem
+      Caption = #12371#12398#12524#12473#12398'ID'
+      object ID2: TMenuItem
+        Action = IndividualAbonID1Action
+      end
+      object N71: TMenuItem
+        Action = IndividualAbonID0Action
+      end
     end
     object N52: TMenuItem
       Caption = #20491#21029#12354#12412#65374#12435#35299#38500
       object AntiIndividualAbon: TMenuItem
-        Caption = #12371#12398#12524#12473
-        OnClick = AntiIndividualAbonClick
+        Action = AntiIndividualAbonAction
       end
       object N51: TMenuItem
-        Caption = #12524#12473#30058#21495#25351#23450
-        OnClick = N51Click
+        Action = AntiIndividualAbonDlgAction
       end
     end
+    object N70: TMenuItem
+      Caption = '-'
+    end
+    object ID1: TMenuItem
+      Action = SameIDResAnchorAction
+    end
   end
   object BrowserTabPopupMenu: TPopupMenu
     Images = HotToobarImageList
index 3248245..d395fcd 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -467,7 +467,6 @@ type
                N49: TMenuItem;
                N51: TMenuItem;
                N52: TMenuItem;
-               N53: TMenuItem;
                SearchBoardName: TMenuItem;
     TreeSelectLogDeleteSeparator: TMenuItem;
                TreeSelectSearchBoardName: TAction;
@@ -525,7 +524,7 @@ type
     N64: TMenuItem;
     dummy1: TMenuItem;
     TreeSelectLogDeletePopupMenu: TMenuItem;
-    N65: TMenuItem;
+       N65: TMenuItem;
     BBSSelectPopupMenu: TPopupMenu;
                PlugInMenu: TMenuItem;
        TmpToolBar: TToolBar;
@@ -581,6 +580,19 @@ type
     FavoriteTreeViewCollapseAction: TAction;
     RightTabCloseAction: TAction;
     LeftTabCloseAction: TAction;
+    N70: TMenuItem;
+    SameIDResAnchorAction: TAction;
+    ID1: TMenuItem;
+    IndividualAbon1Action: TAction;
+    IndividualAbon0Action: TAction;
+    AntiIndividualAbonAction: TAction;
+    AntiIndividualAbonDlgAction: TAction;
+    IndividualAbonID1Action: TAction;
+    ID2: TMenuItem;
+    N53: TMenuItem;
+    ID3: TMenuItem;
+    IndividualAbonID0Action: TAction;
+    N71: TMenuItem;
                                procedure FormCreate(Sender: TObject);
                procedure FormDestroy(Sender: TObject);
                procedure CabinetPanelHide(Sender: TObject);
@@ -818,12 +830,7 @@ type
                procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
                        Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
                procedure StatusBarResize(Sender: TObject);
-               procedure IndividualAbon1Click(Sender: TObject);
-               procedure IndividualAbon2Click(Sender: TObject);
-               procedure N42Click(Sender: TObject);
                procedure SelectComboBoxEnter(Sender: TObject);
-               procedure AntiIndividualAbonClick(Sender: TObject);
-               procedure N51Click(Sender: TObject);
                procedure TreeSelectSearchBoardNameExecute(Sender: TObject);
                procedure CabinetFavoriteActionExecute(Sender: TObject);
                procedure FavoriteTreeViewDragDrop(Sender, Source: TObject; X,
@@ -894,7 +901,7 @@ type
       Selected: Boolean);
     procedure SelectTimerTimer(Sender: TObject);
     procedure SelectItemSaveForHTMLExecute(Sender: TObject);
-    procedure KidokuActionExecute(Sender: TObject);
+       procedure KidokuActionExecute(Sender: TObject);
     procedure MidokuActionExecute(Sender: TObject);
     procedure SelectItemSaveForDatExecute(Sender: TObject);
     procedure LogFolderOpenActionExecute(Sender: TObject);
@@ -925,10 +932,18 @@ type
     procedure MenuToolBarResize(Sender: TObject);
     procedure ListToolBarResize(Sender: TObject);
     procedure BrowserToolBarResize(Sender: TObject);
-    procedure RightTabCloseActionExecute(Sender: TObject);
+       procedure RightTabCloseActionExecute(Sender: TObject);
     procedure RightTabCloseActionUpdate(Sender: TObject);
     procedure LeftTabCloseActionExecute(Sender: TObject);
     procedure LeftTabCloseActionUpdate(Sender: TObject);
+    procedure SameIDResAnchorActionExecute(Sender: TObject);
+    procedure IndividualAbon1ActionExecute(Sender: TObject);
+    procedure IndividualAbon0ActionExecute(Sender: TObject);
+    procedure AntiIndividualAbonActionExecute(Sender: TObject);
+    procedure AntiIndividualAbonDlgActionExecute(Sender: TObject);
+    procedure IndividualAbonID1ActionExecute(Sender: TObject);
+    procedure IndividualAbonID0ActionExecute(Sender: TObject);
+    procedure KokoPopupMenuPopup(Sender: TObject);
        private
                { Private \90é\8c¾ }
         //RoundList : TRoundList;
@@ -1080,7 +1095,6 @@ type
                /// \8ae\8f\8a\82É\82 \82é\83L\83\83\83r\83l\83b\83g\81E BBS \83\81\83j\83\85\81[\82ð\83Z\83b\83g\81^\8dX\90V
                procedure SetBBSMenu;
                function WebBrowserClick(Sender: TObject): WordBool;
-               function WebBrowserOnMouseDown(Sender: TObject): WordBool;
                procedure SkinorCSSFilesCopy(path: string);
                /// \83^\83u\8eæ\93¾
                function GetTabURLs(AStringList: TStringList) : Boolean;
@@ -1165,7 +1179,10 @@ type
                property ActiveList: TObject read GetActiveList write SetActiveList;
                /// CoolBar \82ª\83T\83C\83Y\95Ï\8dX\82³\82ê\82½
                procedure       CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
-
+               //\93¯\88êID\82Ì\82 \82Ú\81`\82ñ
+               procedure IndividualAbonID(Atype : Integer);
+               //\82±\82Ì\83\8c\83X\82 \82Ú\81`\82ñ
+               procedure IndividualAbon(Atag, Atype : Integer);
        published
                property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
        end;
@@ -4821,7 +4838,7 @@ begin
                        top := 0;
                        nm := AName;
                        item := OleVariant( activeBrower.Document as IHTMLDocument2).anchors.item(nm);
-            item.focus();
+                       item.focus();
                        repeat
                                top := top + item.offsetTop;
                                item := item.offsetParent;
@@ -6331,6 +6348,9 @@ var
        idx: Integer;
        wkIntSt: Integer;
        wkIntTo: Integer;
+       firstElement: IHTMLElement;
+       document: IHTMLDocument2;
+       doc : Variant;
 begin
 
        Cancel := True;
@@ -6356,8 +6376,18 @@ begin
                                end else
                                        wkIntSt := StrToIntDef(Text, 0);
 
-                               if wkIntSt <> 0 then
+                               if wkIntSt <> 0 then begin
+                                       document := FActiveContent.Browser.Document as IHTMLDocument2;
+                                       if Assigned(document) then
+                                               firstElement := document.all.item('idSearch', 0) as IHTMLElement;
+                                               if Assigned(firstElement) then
+                                                       if firstElement.style.visibility <> 'hidden' then
+                                                               firstElement.style.visibility := 'hidden';
+
                                        BrowserMovement(IntToStr(wkIntSt));
+                               end;
+
+
                        end;
                end else begin
                        URL := GikoSys.GetHRefText(Html);
@@ -6668,7 +6698,6 @@ begin
                                BrowserRecord.FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2);
                                BrowserRecord.FEvent.OnContextMenu := OnDocumentContextMenu;
                                BrowserRecord.FEvent.OnClick := WebBrowserClick;  //\92Ç\89Á\82µ\82½OnClick\83C\83x\83\93\83g
-                               BrowserRecord.FEvent.OnMouseDown := WebBrowserOnMouseDown;
                        end;
                end else begin
                        if GetActiveContent <> nil then begin
@@ -6678,7 +6707,6 @@ begin
                                FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2);
                                FEvent.OnContextMenu := OnDocumentContextMenu;
                                FEvent.OnClick := WebBrowserClick;  //\92Ç\89Á\82µ\82½OnClick\83C\83x\83\93\83g
-                               FEvent.OnMouseDown := WebBrowserOnMouseDown;;
                        end;
                end;
 
@@ -9320,143 +9348,6 @@ begin
                                                                                                                         StatusBar.Panels[0].Width -
                                                                                                                         StatusBar.Panels[2].Width;
 end;
-//\8cÂ\95Ê\82 \82Ú\81[\82ñ\81u\92Ê\8fí\81v
-procedure TGikoForm.IndividualAbon1Click(Sender: TObject);
-var
-       ThreadItem      : TThreadItem;
-       ReadList                : TStringList;
-       wordCount               : TWordCount;
-begin
-       ThreadItem      := GetActiveContent;
-       ReadList                := TStringList.Create;
-       wordCount               := TWordCount.Create;
-       try
-               ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
-               // \83X\83p\83\80\82É\90Ý\92è
-               ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
-               GikoSys.SpamCountWord( ReadList[ KokoPopupMenu.Tag - 1 ], wordCount );
-               GikoSys.SpamForget( wordCount, False ); // \83n\83\80\82ð\89ð\8f\9c
-               GikoSys.SpamLearn( wordCount, True );           // \83X\83p\83\80\82É\90Ý\92è
-               // \82 \82Ú\81[\82ñ\82É\90Ý\92è
-               GikoSys.FAbon.AddIndividualAbon(KokoPopupMenu.Tag, 1, ChangeFileExt(ThreadItem.GetThreadFileName, '.NG'));
-       finally
-               wordCount.Free;
-               ReadList.Free;
-       end;
-       FActiveContent.Repaint := true;
-       if ThreadItem <> nil then
-               InsertBrowserTab( ThreadItem, True );
-end;
-//\8cÂ\95Ê\82 \82Ú\81[\82ñ\81u\93§\96¾\81v
-procedure TGikoForm.IndividualAbon2Click(Sender: TObject);
-var
-       ThreadItem : TThreadItem;
-       ReadList                : TStringList;
-       wordCount               : TWordCount;
-begin
-       ThreadItem := GetActiveContent;
-       ReadList                := TStringList.Create;
-       wordCount               := TWordCount.Create;
-       try
-               ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
-               // \83X\83p\83\80\82É\90Ý\92è
-               ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
-               GikoSys.SpamCountWord( ReadList[ KokoPopupMenu.Tag - 1 ], wordCount );
-               GikoSys.SpamForget( wordCount, False ); // \83n\83\80\82ð\89ð\8f\9c
-               GikoSys.SpamLearn( wordCount, True );           // \83X\83p\83\80\82É\90Ý\92è
-               // \82 \82Ú\81[\82ñ\82É\90Ý\92è
-               GikoSys.FAbon.AddIndividualAbon(KokoPopupMenu.Tag, 0, ChangeFileExt(ThreadItem.GetThreadFileName, '.NG'));
-       finally
-               wordCount.Free;
-               ReadList.Free;
-       end;
-       FActiveContent.Repaint := true;
-       if ThreadItem <> nil then
-               InsertBrowserTab( ThreadItem, True );
-end;
-//\8cÂ\95Ê\82 \82Ú\81[\82ñ\89ð\8f\9c\81i\81j
-procedure TGikoForm.AntiIndividualAbonClick(Sender: TObject);
-var
-       IndividualForm :TIndividualAbonForm;
-       ThreadItem : TThreadItem;
-       msg : String;
-       ReadList                : TStringList;
-       wordCount               : TWordCount;
-begin
-       IndividualForm := TIndividualAbonForm.Create(Self);
-       try
-               ThreadItem := GetActiveContent;
-               ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
-               if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
-                       if IndividualForm.SetThreadLogFileName(ThreadItem.GetThreadFileName) then begin
-                               ReadList                := TStringList.Create;
-                               wordCount               := TWordCount.Create;
-                               try
-                                       // \83X\83p\83\80\82ð\89ð\8f\9c
-                                       ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
-                                       GikoSys.SpamCountWord( ReadList[ KokoPopupMenu.Tag - 1 ], wordCount );
-                                       GikoSys.SpamForget( wordCount, True );  // \83X\83p\83\80\82ð\89ð\8f\9c
-                                       GikoSys.SpamLearn( wordCount, False );  // \83n\83\80\82É\90Ý\92è
-                                       if IndividualForm.DeleteNG(KokoPopupMenu.Tag) then begin
-                                               FActiveContent.Repaint := true;
-                                               InsertBrowserTab( ThreadItem, True );
-                                       end;
-                               finally
-                                       wordCount.Free;
-                                       ReadList.Free;
-                               end;
-                       end else begin
-                               msg := '\82±\82Ì\83X\83\8c\83b\83h\82Å\82Í\8cÂ\95Ê\82 \82Ú\81`\82ñ\82ð\8ds\82Á\82Ä\82Ü\82¹\82ñ';
-                               MsgBox(Handle, msg, '\83\81\83b\83Z\81[\83W', MB_OK);
-                       end;
-               end;
-       finally
-               IndividualForm.Release;
-       end;
-end;
-//\8cÂ\95Ê\82 \82Ú\81[\82ñ\89ð\8f\9c
-procedure TGikoForm.N42Click(Sender: TObject);
-var
-       IndividualForm :TIndividualAbonForm;
-       ThreadItem : TThreadItem;
-       msg : String;
-       ReadList                : TStringList;
-       wordCount               : TWordCount;
-begin
-       IndividualForm := TIndividualAbonForm.Create(Self);
-       try
-               ThreadItem := GetActiveContent;
-               ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
-               if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
-                       if IndividualForm.SetThreadLogFileName(ThreadItem.GetThreadFileName) then begin
-                               if IndividualForm.ShowModal = mrOK then begin
-                                       ReadList                := TStringList.Create;
-                                       wordCount               := TWordCount.Create;
-                                       try
-                                               // \83X\83p\83\80\82ð\89ð\8f\9c
-                                               ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
-                                               GikoSys.SpamCountWord( ReadList[ KokoPopupMenu.Tag - 1 ], wordCount );
-                                               GikoSys.SpamForget( wordCount, True );  // \83X\83p\83\80\82ð\89ð\8f\9c
-                                               GikoSys.SpamLearn( wordCount, False );  // \83n\83\80\82É\90Ý\92è
-                                               if IndividualForm.FRepaint then begin
-                                                       FActiveContent.Repaint := true;
-                                                       InsertBrowserTab( ThreadItem, True );
-                                               end;
-                                       finally
-                                               wordCount.Free;
-                                               ReadList.Free;
-                                       end;
-                               end;
-                       end else begin
-                               msg := '\82±\82Ì\83X\83\8c\83b\83h\82Å\82Í\8cÂ\95Ê\82 \82Ú\81`\82ñ\82ð\8ds\82Á\82Ä\82Ü\82¹\82ñ';
-                               MsgBox(Handle, msg, '\83\81\83b\83Z\81[\83W', MB_OK);
-                       end;
-               end;
-       finally
-               IndividualForm.Release;
-       end;
-end;
-
 procedure TGikoForm.SelectComboBoxEnter(Sender: TObject);
 begin
 
@@ -9469,10 +9360,6 @@ begin
 
 end;
 
-procedure TGikoForm.N51Click(Sender: TObject);
-begin
-       N42Click(Sender);
-end;
 //\94Â\96¼\8c\9f\8dõ
 procedure TGikoForm.TreeSelectSearchBoardNameExecute(Sender: TObject);
 var
@@ -10843,45 +10730,6 @@ begin
   end;
 end;
 
-function TGikoForm.WebBrowserOnMouseDown(Sender: TObject): WordBool;
-var
-       p :TPoint;
-       e: IHTMLElement;
-       document: IHTMLDocument2;
-       docAll: IHTMLElementCollection;
-       firstElement: IHTMLElement;
-       nCSS, body, id : string;
-       doc : Variant;
-begin
-       result := true;
-{$IFDEF DEBUG}
-       try
-               if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
-                       GetCursorPos(p);
-                       p.x := p.x - FActiveContent.Browser.ClientOrigin.x;
-                       p.y := p.y - FActiveContent.Browser.ClientOrigin.y;
-                       e := IHTMLDocument2(FActiveContent.Browser.Document).elementFromPoint(p.x, p.y);
-                       document := FActiveContent.Browser.Document as IHTMLDocument2;
-                       if (Assigned(e)) and  Assigned(document) then begin
-                               docAll := document.all;
-                               firstElement := docAll.item('idSearch', 0) as IHTMLElement;
-                               if ( e.className = 'date' ) and (Assigned(firstElement)) and (AnsiPos('id', AnsiLowerCase(e.innerText)) > 0) then begin
-                                       id := Copy(e.innerText, AnsiPos('id', AnsiLowerCase(e.innerText)), Length(e.innerText));
-                                       body := GikoSys.GetSameIDResAnchor(id, FActiveContent.FThread);
-                                       doc := Idispatch( olevariant(FActiveContent.Browser.ControlInterface).Document) as IHTMLDocument2;
-                                       nCSS := '<p id="idSearch" style="position:absolute;top:'+ IntToStr(p.y + doc.Body.ScrollTop - firstElement.offsetHeight - 5) + 'px;right:5px;'
-                                                        + 'background-color:window; border:outset 1px infobackground; overflow-y:auto; z-index:5; border-top:none">'
-                                                        + body + '</p>';
-                                       firstElement.outerHTML := nCSS;
-                               end else if (Assigned(firstElement)) then begin
-                                       firstElement.outerHTML := '<p id="idSearch"></p>';
-                               end;
-                       end;
-               end;
-       except
-       end;
-{$ENDIF}
-end;
 
 procedure TGikoForm.SetFocusForBrowserActionExecute(Sender: TObject);
 begin
@@ -11990,6 +11838,235 @@ begin
        LeftTabCloseAction.Enabled := (BrowserTab.Tabs.Count > 1);
 end;
 
+procedure TGikoForm.SameIDResAnchorActionExecute(Sender: TObject);
+var
+       ThreadItem : TThreadItem;
+       No : Integer;
+       body, nCSS : string;
+       firstElement: IHTMLElement;
+       document: IHTMLDocument2;
+       docAll: IHTMLElementCollection;
+       doc : Variant;
+begin
+       No := KokoPopupMenu.Tag;
+       if No = 0 then Exit;
+       ThreadItem := GetActiveContent;
+       if ThreadItem = nil then Exit;
+       body := GikoSys.GetSameIDResAnchor(No, ThreadItem);
+       try
+               document := FActiveContent.Browser.Document as IHTMLDocument2;
+
+               if Assigned(document) then begin
+                       docAll := document.all;
+                       firstElement := docAll.item('idSearch', 0) as IHTMLElement;
+                       if (Assigned(firstElement)) then begin
+                               if Length(body) > 0 then begin
+                                       doc := Idispatch( olevariant(FActiveContent.Browser.ControlInterface).Document) as IHTMLDocument2;
+                                       nCSS := '<p id="idSearch" style="position:absolute;top:' + IntToStr(doc.Body.ScrollTop + 10) + 'px;right:5px;' //
+                                               + 'background-color:window; border:outset 1px infobackground; z-index:10; overflow-y:auto; border-top:none">'
+                                               + body + '</p>';
+                                       firstElement.outerHTML := nCSS;
+                                       firstElement.style.visibility := 'visible';
+                               end else begin
+                                       firstElement.outerHTML := '<p id="idSearch"></p>';
+                                       firstElement.style.visibility := 'hidden';
+                               end;
+                       end else if (Assigned(firstElement)) then begin
+                               firstElement.outerHTML := '<p id="idSearch"></p>';
+                               firstElement.style.visibility := 'hidden';
+                       end;
+               end;
+       except
+       end;
+
+end;
+//\82±\82Ì\83\8c\83X\82 \82Ú\81`\82ñ
+procedure TGikoForm.IndividualAbon1ActionExecute(Sender: TObject);
+begin
+       IndividualAbon(KokoPopupMenu.Tag, 1);
+end;
+//\82±\82Ì\83\8c\83X\93§\96¾\82 \82Ú\81`\82ñ
+procedure TGikoForm.IndividualAbon0ActionExecute(Sender: TObject);
+begin
+       IndividualAbon(KokoPopupMenu.Tag, 0);
+end;
+
+//\82±\82Ì\83\8c\83X\82 \82Ú\81`\82ñ
+procedure TGikoForm.IndividualAbon(Atag, Atype : Integer);
+var
+       ThreadItem      : TThreadItem;
+       ReadList                : TStringList;
+       wordCount               : TWordCount;
+begin
+       ThreadItem      := GetActiveContent;
+       ReadList                := TStringList.Create;
+       wordCount               := TWordCount.Create;
+       try
+               ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
+               // \83X\83p\83\80\82É\90Ý\92è
+               ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
+               GikoSys.SpamCountWord( ReadList[ KokoPopupMenu.Tag - 1 ], wordCount );
+               GikoSys.SpamForget( wordCount, False ); // \83n\83\80\82ð\89ð\8f\9c
+               GikoSys.SpamLearn( wordCount, True );           // \83X\83p\83\80\82É\90Ý\92è
+               // \82 \82Ú\81[\82ñ\82É\90Ý\92è
+               GikoSys.FAbon.AddIndividualAbon(Atag, Atype, ChangeFileExt(ThreadItem.GetThreadFileName, '.NG'));
+       finally
+               wordCount.Free;
+               ReadList.Free;
+       end;
+       FActiveContent.Repaint := true;
+       if ThreadItem <> nil then
+               InsertBrowserTab( ThreadItem, True );
+end;
+
+procedure TGikoForm.AntiIndividualAbonActionExecute(Sender: TObject);
+var
+       IndividualForm :TIndividualAbonForm;
+       ThreadItem : TThreadItem;
+       msg : String;
+       ReadList                : TStringList;
+       wordCount               : TWordCount;
+begin
+       IndividualForm := TIndividualAbonForm.Create(Self);
+       try
+               ThreadItem := GetActiveContent;
+               ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
+               if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
+                       if IndividualForm.SetThreadLogFileName(ThreadItem.GetThreadFileName) then begin
+                               ReadList                := TStringList.Create;
+                               wordCount               := TWordCount.Create;
+                               try
+                                       // \83X\83p\83\80\82ð\89ð\8f\9c
+                                       ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
+                                       GikoSys.SpamCountWord( ReadList[ KokoPopupMenu.Tag - 1 ], wordCount );
+                                       GikoSys.SpamForget( wordCount, True );  // \83X\83p\83\80\82ð\89ð\8f\9c
+                                       GikoSys.SpamLearn( wordCount, False );  // \83n\83\80\82É\90Ý\92è
+                                       if IndividualForm.DeleteNG(KokoPopupMenu.Tag) then begin
+                                               FActiveContent.Repaint := true;
+                                               InsertBrowserTab( ThreadItem, True );
+                                       end;
+                               finally
+                                       wordCount.Free;
+                                       ReadList.Free;
+                               end;
+                       end else begin
+                               msg := '\82±\82Ì\83X\83\8c\83b\83h\82Å\82Í\8cÂ\95Ê\82 \82Ú\81`\82ñ\82ð\8ds\82Á\82Ä\82Ü\82¹\82ñ';
+                               MsgBox(Handle, msg, '\83\81\83b\83Z\81[\83W', MB_OK);
+                       end;
+               end;
+       finally
+               IndividualForm.Release;
+       end;
+end;
+
+procedure TGikoForm.AntiIndividualAbonDlgActionExecute(Sender: TObject);
+var
+       IndividualForm :TIndividualAbonForm;
+       ThreadItem : TThreadItem;
+       msg : String;
+       ReadList                : TStringList;
+       wordCount               : TWordCount;
+begin
+       IndividualForm := TIndividualAbonForm.Create(Self);
+       try
+               ThreadItem := GetActiveContent;
+               ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
+               if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
+                       if IndividualForm.SetThreadLogFileName(ThreadItem.GetThreadFileName) then begin
+                               if IndividualForm.ShowModal = mrOK then begin
+                                       ReadList                := TStringList.Create;
+                                       wordCount               := TWordCount.Create;
+                                       try
+                                               // \83X\83p\83\80\82ð\89ð\8f\9c
+                                               ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
+                                               GikoSys.SpamCountWord( ReadList[ KokoPopupMenu.Tag - 1 ], wordCount );
+                                               GikoSys.SpamForget( wordCount, True );  // \83X\83p\83\80\82ð\89ð\8f\9c
+                                               GikoSys.SpamLearn( wordCount, False );  // \83n\83\80\82É\90Ý\92è
+                                               if IndividualForm.FRepaint then begin
+                                                       FActiveContent.Repaint := true;
+                                                       InsertBrowserTab( ThreadItem, True );
+                                               end;
+                                       finally
+                                               wordCount.Free;
+                                               ReadList.Free;
+                                       end;
+                               end;
+                       end else begin
+                               msg := '\82±\82Ì\83X\83\8c\83b\83h\82Å\82Í\8cÂ\95Ê\82 \82Ú\81`\82ñ\82ð\8ds\82Á\82Ä\82Ü\82¹\82ñ';
+                               MsgBox(Handle, msg, '\83\81\83b\83Z\81[\83W', MB_OK);
+                       end;
+               end;
+       finally
+               IndividualForm.Release;
+       end;
+end;
+
+procedure TGikoForm.IndividualAbonID1ActionExecute(Sender: TObject);
+begin
+       IndividualAbonID(1);
+end;
+
+procedure TGikoForm.IndividualAbonID0ActionExecute(Sender: TObject);
+begin
+       IndividualAbonID(0);
+end;
+//\93¯\88êID\82Ì\82 \82Ú\81`\82ñ
+procedure TGikoForm.IndividualAbonID(Atype : Integer);
+var
+       ThreadItem : TThreadItem;
+       i, No : Integer;
+       body : TStringList;
+       ReadList                : TStringList;
+       wordCount               : TWordCount;
+begin
+       No := KokoPopupMenu.Tag;
+       if No = 0 then Exit;
+       ThreadItem := GetActiveContent;
+       if ThreadItem = nil then Exit;
+       body := TStringList.Create;
+       try
+               GikoSys.GetSameIDRes(No, ThreadItem, body);
+
+               ReadList                := TStringList.Create;
+               wordCount               := TWordCount.Create;
+               try
+                       ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
+                       // \83X\83p\83\80\82É\90Ý\92è
+                       ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
+                       for i := 0 to body.Count - 1 do begin
+                               GikoSys.SpamCountWord( ReadList[ KokoPopupMenu.Tag - 1 ], wordCount );
+                               GikoSys.SpamForget( wordCount, False ); // \83n\83\80\82ð\89ð\8f\9c
+                               GikoSys.SpamLearn( wordCount, True );           // \83X\83p\83\80\82É\90Ý\92è
+                               // \82 \82Ú\81[\82ñ\82É\90Ý\92è
+                               GikoSys.FAbon.AddIndividualAbon(StrToInt(body[i]), Atype, ChangeFileExt(ThreadItem.GetThreadFileName, '.NG'));
+                       end;
+               finally
+                       wordCount.Free;
+                       ReadList.Free;
+               end;
+               FActiveContent.Repaint := true;
+               if ThreadItem <> nil then
+                       InsertBrowserTab( ThreadItem, True );
+       finally
+               body.Free;
+       end;
+
+end;
+
+procedure TGikoForm.KokoPopupMenuPopup(Sender: TObject);
+var
+       firstElement: IHTMLElement;
+       document: IHTMLDocument2;
+begin
+       document := FActiveContent.Browser.Document as IHTMLDocument2;
+       if Assigned(document) then
+               firstElement := document.all.item('idSearch', 0) as IHTMLElement;
+               if Assigned(firstElement) then
+                       if firstElement.style.visibility <> 'hidden' then
+                               firstElement.style.visibility := 'hidden';
+
+end;
+
 initialization
                                OleInitialize(nil);
 finalization
index ef1714b..98461a4 100644 (file)
@@ -212,7 +212,10 @@ type
                                procedure SambaFileExists();
 
                property Bayesian : TGikoBayesian read FBayesian write FBayesian;
-               function GetSameIDResAnchor(const AID : string; ThreadItem: TThreadItem):string;
+               function GetSameIDResAnchor(const AID : string; ThreadItem: TThreadItem):string; overload;
+               function GetSameIDResAnchor(AIDNum : Integer; ThreadItem: TThreadItem):string; overload;
+               procedure GetSameIDRes(const AID : string; ThreadItem: TThreadItem;var body: TStringList); overload;
+               procedure GetSameIDRes(AIDNum : Integer; ThreadItem: TThreadItem;var body: TStringList); overload;
                //! \92P\8cê\89ð\90Í
                procedure SpamCountWord( const text : string; wordCount : TWordCount );
                //! \8aw\8fK\83N\83\8a\83A
@@ -3857,9 +3860,30 @@ var
        ReadList: TStringList;
        Res: TResRec;
        boardPlugIn : TBoardPlugIn;
+       body: TStringList;
 begin
        Result := '';
        if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
+               body := TStringList.Create;
+               try
+                       GetSameIDRes(AID, ThreadItem, body);
+                       for i := 0 to body.Count - 1 do begin
+                               Result := Result + '&gt;' + body[i] + ' ';
+                       end;
+               finally
+                       body.Free;
+               end;
+               Result := ConvRes(Result, ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true', false);
+       end;
+end;
+procedure TGikoSys.GetSameIDRes(const AID : string; ThreadItem: TThreadItem;var body: TStringList);
+var
+       i: integer;
+       ReadList: TStringList;
+       Res: TResRec;
+       boardPlugIn : TBoardPlugIn;
+begin
+       if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
                if ThreadItem.IsBoardPlugInAvailable then begin
                        //===== \83v\83\89\83O\83C\83\93\82É\82æ\82é\95\\8e¦
                        boardPlugIn             := ThreadItem.BoardPlugIn;
@@ -3868,7 +3892,7 @@ begin
                                // \83\8c\83X
                                Res := DivideStrLine(boardPlugIn.GetDat(DWORD( threadItem ), i + 1));
                                if(AnsiPos(AID, Res.FDateTime) > 0) then begin
-                                       Result := Result + '&gt;' + IntToStr(i) + ' ';
+                                       body.Add(IntToStr(i+1));
                                end;
                        end;
                end else begin
@@ -3878,18 +3902,61 @@ begin
                                for i := 0 to ReadList.Count - 1 do begin
                                        Res := DivideStrLine(ReadList[i]);
                                        if AnsiPos(AID, Res.FDateTime) > 0 then begin
-                                               Result := Result + '&gt;' + IntToStr(i+1) + ' ';
+                                               body.Add(IntToStr(i+1));
                                        end;
                                end;
                        finally
                                ReadList.Free;
                        end;
                end;
+       end;
+end;
+function TGikoSys.GetSameIDResAnchor(AIDNum : Integer; ThreadItem: TThreadItem):string;
+var
+       i: integer;
+       ReadList: TStringList;
+       Res: TResRec;
+       boardPlugIn : TBoardPlugIn;
+       body: TStringList;
+begin
+       Result := '';
+       if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
+               body := TStringList.Create;
+               try
+                       GetSameIDRes(AIDNum, ThreadItem, body);
+                       for i := 0 to body.Count - 1 do begin
+                               Result := Result + '&gt;' + body[i] + ' ';
+                       end;
+               finally
+                       body.Free;
+               end;
                Result := ConvRes(Result, ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true', false);
        end;
+end;
 
+procedure TGikoSys.GetSameIDRes(AIDNum : Integer; ThreadItem: TThreadItem;var body: TStringList);
+var
+       i: integer;
+       Res: TResRec;
+       boardPlugIn : TBoardPlugIn;
+       AID : String;
+begin
+       if (ThreadItem <> nil) and (ThreadItem.IsLogFile)
+               and (AIDNum > 0) and (AIDNum <= ThreadItem.Count) then begin
+               if ThreadItem.IsBoardPlugInAvailable then begin
+                       //===== \83v\83\89\83O\83C\83\93\82É\82æ\82é\95\\8e¦
+                       boardPlugIn             := ThreadItem.BoardPlugIn;
+                       Res := DivideStrLine(boardPlugIn.GetDat(DWORD( threadItem ), AIDNum));
+               end else begin
+                       Res := DivideStrLine( ReadThreadFile(ThreadItem.GetThreadFileName, AIDNum));
+               end;
+               AID := Res.FDateTime;
+               AID := Copy(AID, AnsiPos('id', AnsiLowerCase(AID)) - 1, 11);
+        GetSameIDRes(AID, ThreadItem, body);
+       end;
 end;
 
+
 procedure TGikoSys.SpamCountWord( const text : string; wordCount : TWordCount );
 begin
 
index bda2222..9fb843e 100644 (file)
@@ -87,9 +87,10 @@ begin
                                ComboBox1.Items.Clear;
                                for i := 0 to NGFile.Count - 1do begin
                                        str := Copy(NGFile.Strings[i], 1, AnsiPos('-', NGFile.Strings[i]) - 1);
-                                       ComboBox1.Items.Add(str);
+                                       if str <> '' then
+                                               ComboBox1.Items.Add(str);
                                end;
-                               if NGFile.Count > 0 then
+                               if ComboBox1.Items.Count > 0 then
                                        Result := true;
                        except
                                Result := false;