Skip to content

Commit

Permalink
1.去掉无效规则
Browse files Browse the repository at this point in the history
2.修复右键功能不能使用问题
  • Loading branch information
youusername committed Jul 15, 2020
1 parent 912b149 commit e86c897
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 109 deletions.
16 changes: 8 additions & 8 deletions magnetX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
AAC820DF1DB9ED9700D12963 /* MovieModel.m in Sources */ = {isa = PBXBuildFile; fileRef = AAC820DE1DB9ED9700D12963 /* MovieModel.m */; };
AAC820E11DB9F27500D12963 /* SourceList.plist in Resources */ = {isa = PBXBuildFile; fileRef = AAC820E01DB9F27500D12963 /* SourceList.plist */; };
AAC820E41DB9FF3B00D12963 /* breakDownHtml.m in Sources */ = {isa = PBXBuildFile; fileRef = AAC820E31DB9FF3B00D12963 /* breakDownHtml.m */; };
AAE4C0181DC07E710000D0B9 /* NSTableView+ContextMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = AAE4C0171DC07E710000D0B9 /* NSTableView+ContextMenu.m */; };
B6E4C0CB24BEEDB700EEF50E /* XTTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = B6E4C0CA24BEEDB700EEF50E /* XTTableView.m */; };
B6FFDD432322079A0075317C /* NSString+XTNSString.m in Sources */ = {isa = PBXBuildFile; fileRef = B6FFDD422322079A0075317C /* NSString+XTNSString.m */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -107,8 +107,8 @@
AAC820E01DB9F27500D12963 /* SourceList.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SourceList.plist; sourceTree = "<group>"; };
AAC820E21DB9FF3B00D12963 /* breakDownHtml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = breakDownHtml.h; sourceTree = "<group>"; };
AAC820E31DB9FF3B00D12963 /* breakDownHtml.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = breakDownHtml.m; sourceTree = "<group>"; };
AAE4C0161DC07E710000D0B9 /* NSTableView+ContextMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTableView+ContextMenu.h"; sourceTree = "<group>"; };
AAE4C0171DC07E710000D0B9 /* NSTableView+ContextMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTableView+ContextMenu.m"; sourceTree = "<group>"; };
B6E4C0C924BEEDB700EEF50E /* XTTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XTTableView.h; sourceTree = "<group>"; };
B6E4C0CA24BEEDB700EEF50E /* XTTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XTTableView.m; sourceTree = "<group>"; };
B6FFDD412322079A0075317C /* NSString+XTNSString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+XTNSString.h"; sourceTree = "<group>"; };
B6FFDD422322079A0075317C /* NSString+XTNSString.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+XTNSString.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -258,8 +258,8 @@
AAC820D41DB8CAD300D12963 /* View */ = {
isa = PBXGroup;
children = (
AAE4C0161DC07E710000D0B9 /* NSTableView+ContextMenu.h */,
AAE4C0171DC07E710000D0B9 /* NSTableView+ContextMenu.m */,
B6E4C0C924BEEDB700EEF50E /* XTTableView.h */,
B6E4C0CA24BEEDB700EEF50E /* XTTableView.m */,
AAC820C71DB8C8C700D12963 /* Main.storyboard */,
);
name = View;
Expand Down Expand Up @@ -444,10 +444,10 @@
AAC820DB1DB9C27F00D12963 /* NavigationView.m in Sources */,
AAC820D71DB8CE4100D12963 /* WindowController.m in Sources */,
612BA6261FE2AEDD005EDC47 /* NSError+GitHubUpdates.m in Sources */,
AAE4C0181DC07E710000D0B9 /* NSTableView+ContextMenu.m in Sources */,
612BA62C1FE2AEDD005EDC47 /* GitHubProgressWindowController.m in Sources */,
61B0E2101E7CFC6300C2C6C3 /* UserEditorStatus.m in Sources */,
1F161DE91DBA457D0037BDBF /* sideModel.m in Sources */,
B6E4C0CB24BEEDB700EEF50E /* XTTableView.m in Sources */,
B6FFDD432322079A0075317C /* NSString+XTNSString.m in Sources */,
AAC820E41DB9FF3B00D12963 /* breakDownHtml.m in Sources */,
612BA62B1FE2AEDD005EDC47 /* NSString+GitHubUpdates.m in Sources */,
Expand Down Expand Up @@ -591,7 +591,7 @@
INFOPLIST_FILE = magnetX/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MARKETING_VERSION = 1.3.2;
MARKETING_VERSION = 1.3.3;
PRODUCT_BUNDLE_IDENTIFIER = com.214644496.magnetX;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -612,7 +612,7 @@
INFOPLIST_FILE = magnetX/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MARKETING_VERSION = 1.3.2;
MARKETING_VERSION = 1.3.3;
PRODUCT_BUNDLE_IDENTIFIER = com.214644496.magnetX;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
17 changes: 6 additions & 11 deletions magnetX/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -625,7 +625,6 @@
<tableColumns>
<tableColumn identifier="siteCell" width="97" minWidth="40" maxWidth="1000" id="M4W-a7-Uye">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="源网站">
<font key="font" metaFont="message" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
Expand Down Expand Up @@ -756,7 +755,7 @@
<rect key="frame" x="0.0" y="0.0" width="762" height="514"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="30" rowSizeStyle="automatic" viewBased="YES" id="tPD-oQ-0qT">
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="30" rowSizeStyle="automatic" viewBased="YES" id="tPD-oQ-0qT" customClass="XTTableView">
<rect key="frame" x="0.0" y="0.0" width="762" height="514"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
Expand All @@ -765,7 +764,6 @@
<tableColumns>
<tableColumn identifier="nameCell" width="530" minWidth="40" maxWidth="1000" id="pIb-4I-zyV">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="标题">
<font key="font" metaFont="message" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
Expand Down Expand Up @@ -805,7 +803,6 @@
</tableColumn>
<tableColumn identifier="sizeCell" width="64" minWidth="40" maxWidth="500" id="vmv-A4-Je8">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="center" title="文件大小">
<font key="font" metaFont="message" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
Expand Down Expand Up @@ -838,7 +835,6 @@
</tableColumn>
<tableColumn identifier="countCell" width="85" minWidth="10" maxWidth="3.4028234663852886e+38" id="OGM-QT-mVz">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="center" title="文件数量or时间">
<font key="font" metaFont="message" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableHeaderCell>
Expand Down Expand Up @@ -871,7 +867,6 @@
</tableColumn>
<tableColumn identifier="sourceCell" width="70" minWidth="10" maxWidth="3.4028234663852886e+38" id="swz-gu-RxO">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="center" title="来源">
<font key="font" metaFont="message" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableHeaderCell>
Expand Down Expand Up @@ -1009,12 +1004,12 @@
<point key="canvasLocation" x="860" y="1464.5"/>
</scene>
</scenes>
<inferredMetricsTieBreakers>
<segue reference="8cQ-1K-lli"/>
</inferredMetricsTieBreakers>
<resources>
<image name="256icon" width="256" height="256"/>
<image name="donateImage" width="1388" height="1032"/>
<image name="qq" width="541" height="741"/>
</resources>
<inferredMetricsTieBreakers>
<segue reference="8cQ-1K-lli"/>
</inferredMetricsTieBreakers>
</document>
19 changes: 0 additions & 19 deletions magnetX/NSTableView+ContextMenu.h

This file was deleted.

49 changes: 0 additions & 49 deletions magnetX/NSTableView+ContextMenu.m

This file was deleted.

7 changes: 4 additions & 3 deletions magnetX/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
#import "MovieModel.h"
#import "breakDownHtml.h"

#import "NSTableView+ContextMenu.h"
#import "XTTableView.h"
#import <QuartzCore/QuartzCore.h>
#import <WebKit/WebKit.h>
#import "MLHudAlert.h"
#import "AppDelegate.h"
#import "NSString+XTNSString.h"

@interface ViewController()<NSTableViewDataSource, NSTableViewDelegate, NSTextFieldDelegate,ContextMenuDelegate,WKUIDelegate,WKNavigationDelegate>
@interface ViewController()<NSTableViewDataSource, NSTableViewDelegate, NSTextFieldDelegate,WKUIDelegate,WKNavigationDelegate>

@property (weak) IBOutlet NSTextField *searchTextField;
@property (weak) IBOutlet NSProgressIndicator *indicator;
@property (weak) IBOutlet NSTextField *info;
@property (weak) IBOutlet NSTableView *tableView;
@property (weak) IBOutlet XTTableView *tableView;
@property (nonatomic, strong) NSMutableArray<MovieModel*> *magnets;
@property (nonatomic, strong) NSString *searchURLString;
@property (nonatomic, strong) WKWebView*web;
Expand Down Expand Up @@ -59,6 +59,7 @@ - (void)config{
self.web =[[WKWebView alloc]initWithFrame:CGRectZero];
self.web.UIDelegate = self;
self.web.navigationDelegate = self;
self.tableView.delegate = self;
[self.view addSubview:self.web];

}
Expand Down
21 changes: 21 additions & 0 deletions magnetX/XTTableView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// XTTableView.h
//
//
// Created by finn on 2020/6/30.
// Copyright © 2020 finn. All rights reserved.
//

#import <Cocoa/Cocoa.h>

NS_ASSUME_NONNULL_BEGIN
@protocol XTMenuDelegate <NSObject>
- (NSMenu*)tableView:(NSTableView*)aTableView menuForRows:(NSIndexSet*)rows;
- (NSMenu*)emptySelectionTableView:(NSTableView*)aTableView;

@end
@interface XTTableView : NSTableView

@end

NS_ASSUME_NONNULL_END
38 changes: 38 additions & 0 deletions magnetX/XTTableView.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// XTTableView.m
//
//
// Created by finn on 2020/6/30.
// Copyright © 2020 finn. All rights reserved.
//

#import "XTTableView.h"

@implementation XTTableView

- (void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];

// Drawing code here.
}
- (NSMenu*)menuForEvent:(NSEvent*)event
{
NSPoint location = [self convertPoint:[event locationInWindow] fromView:nil];
NSInteger row = [self rowAtPoint:location];
if (!(row >= 0) || ([event type] != NSRightMouseDown)) {
if ([[self delegate] respondsToSelector:@selector(emptySelectionTableView:)]) {
return [(id)[self delegate] emptySelectionTableView:self];
}
return [super menuForEvent:event];
}
NSIndexSet *selected = [self selectedRowIndexes];
if (![selected containsIndex:row]) {
selected = [NSIndexSet indexSetWithIndex:row];
[self selectRowIndexes:selected byExtendingSelection:NO];
}
if ([[self delegate] respondsToSelector:@selector(tableView:menuForRows:)]) {
return [(id)[self delegate] tableView:self menuForRows:selected];
}
return [super menuForEvent:event];
}
@end
20 changes: 1 addition & 19 deletions rule.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,7 @@
"name": ".//div[1]/h3/a",
"size": ".//div[3]/span[1]/b",
"count": ".//div[3]/span[2]/b",
"source": "https://bthub.xyz/main-search-kw-XXX-PPP.html"
},
{
"site": "btdb.io",
"group": "//div[@class='media']",
"magnet": ".//ul/li/h2/a/@href",
"name": ".//ul/li/h2/a",
"size": ".//ul/li/div/small[1]/strong",
"count": ".//ul/li/div/small[2]/strong",
"source": "https://btdb.io/search/XXX/?page=PPP"
"source": "https://bthub.site/cn/search/kw-XXX-PPP.html"
},
{
"site": " Btdad.info",
Expand All @@ -99,15 +90,6 @@
"count": "./li/span[2]/span[2]",
"source": "http://f.cili001.com/index/index/k/XXX/p/PPP"
},
{
"site": "Zooqle",
"group": "//*[@class='table table-condensed table-torrents vmiddle']/tr",
"magnet": "./td[3]/ul/li/a/@href",
"name": "./td[2]/a",
"size": ".//td[4]/div/div",
"count": "./td[5]",
"source": "https://zooqle.com/search?pg=PPP&q=XXX&v=t"
},
{
"site": "octopgo",
"group": "//div[@class='listitem']",
Expand Down

0 comments on commit e86c897

Please sign in to comment.