2 Commits

Author SHA1 Message Date
James Magahern
cc6b25aab0 Rename project to Attractor 2022-03-28 18:27:28 -07:00
James Magahern
44cde0018b Support for Sydro find interaction 2022-03-28 16:52:03 -07:00
8 changed files with 49 additions and 27 deletions

View File

@@ -99,10 +99,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
),
// Find on page
(FindOnPageViewController.isEnabled() ?
UIKeyCommand(
modifiers: [.command], input: "F",
title: "Find on Page",
action: #selector(ShortcutResponder.findOnPage)
)
: UIKeyCommand()
),
// Refresh

View File

@@ -77,9 +77,17 @@ class BrowserViewController: UIViewController
override func loadView() {
browserView.toolbarView = toolbarController.toolbarView
browserView.findOnPageView = findOnPageController.findOnPageView
browserView.tabBarView = tabBarViewController.tabBarView
if FindOnPageViewController.isEnabled() {
browserView.findOnPageView = findOnPageController.findOnPageView
// Find on page dismiss
findOnPageController.findOnPageView.doneButton.addAction(UIAction(handler: { [unowned self] _ in
browserView.setFindOnPageVisible(false, animated: true)
}), for: .touchUpInside)
}
// Refresh button
toolbarController.urlBar.refreshButton.addAction(UIAction(handler: { [unowned self] action in
if self.webView.isLoading {
@@ -220,7 +228,12 @@ class BrowserViewController: UIViewController
// Find on page
documentControls.findOnPageControlView.addAction(UIAction(handler: { [unowned self] _ in
documentControls.dismiss(animated: true, completion: nil)
if FindOnPageViewController.isEnabled() {
browserView.setFindOnPageVisible(true, animated: true)
} else if #available(iOS 16.0, *) {
browserView.webView?._findInteraction.presentFindNavigatorShowingReplace(false)
}
}), for: .touchUpInside)
// Navigation controls
@@ -294,11 +307,6 @@ class BrowserViewController: UIViewController
present(documentControls, animated: true, completion: nil)
}), for: .touchUpInside)
// Find on page dismiss
findOnPageController.findOnPageView.doneButton.addAction(UIAction(handler: { [unowned self] _ in
browserView.setFindOnPageVisible(false, animated: true)
}), for: .touchUpInside)
// Tab controller
activeTabObservation = tabController.$activeTabIndex
.receive(on: RunLoop.main)

View File

@@ -9,6 +9,14 @@ import UIKit
class FindOnPageViewController: UIViewController, _WKFindDelegate
{
static func isEnabled() -> Bool {
if #available(iOS 16.0, *) {
return false
}
return true
}
let findOnPageView = FindOnPageView()
weak var webView: WKWebView? {
didSet { webView?._findDelegate = self }

View File

@@ -8,8 +8,8 @@
import UIKit
public enum SessionActivityType: String {
case BrowserWindow = "net.buzzert.rossler-attix.browser"
case SettingsWindow = "net.buzzert.rossler-attix.settings"
case BrowserWindow = "net.buzzert.attractor.browser"
case SettingsWindow = "net.buzzert.attractor.settings"
}
class SceneDelegate: UIResponder, UIWindowSceneDelegate {

View File

@@ -20,7 +20,7 @@ protocol NSToolbarDelegate {}
class SettingsViewController: UITabBarController, NSToolbarDelegate
{
#if targetEnvironment(macCatalyst)
let toolbar = NSToolbar(identifier: NSToolbar.Identifier("net.buzzert.rossler-attix.preferences-toolbar"))
let toolbar = NSToolbar(identifier: NSToolbar.Identifier("net.buzzert.attractor.preferences-toolbar"))
#endif
init(windowScene: UIWindowScene) {

View File

@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>rössler\\attix</string>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@@ -24,7 +24,7 @@
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>net.buzzert.rosslerattix</string>
<string>net.buzzert.attractor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>http</string>

View File

@@ -113,6 +113,9 @@
// Instantiate web view
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:webViewConfiguration];
if ([webView respondsToSelector:@selector(_setFindInteractionEnabled:)]) {
webView._findInteractionEnabled = YES;
}
// Configure proxy interface (interface to remote web process)
_webProcessProxy = [[webView _remoteObjectRegistry] remoteObjectProxyWithInterface:[self _webProcessProxyInterface]];

View File

@@ -116,7 +116,7 @@
1AD3103F252545BF00A4A952 /* FindOnPageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FindOnPageView.swift; sourceTree = "<group>"; };
1AD3104225254FB900A4A952 /* FindOnPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FindOnPageViewController.swift; sourceTree = "<group>"; };
1AD310442525586B00A4A952 /* DocumentControlItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentControlItemView.swift; sourceTree = "<group>"; };
1ADFF45C24C7DE53006DC7AE /* rossler attix.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "rossler attix.app"; sourceTree = BUILT_PRODUCTS_DIR; };
1ADFF45C24C7DE53006DC7AE /* Attractor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Attractor.app; sourceTree = BUILT_PRODUCTS_DIR; };
1ADFF45F24C7DE53006DC7AE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
1ADFF46124C7DE53006DC7AE /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
1ADFF46824C7DE54006DC7AE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -269,7 +269,7 @@
1ADFF45D24C7DE53006DC7AE /* Products */ = {
isa = PBXGroup;
children = (
1ADFF45C24C7DE53006DC7AE /* rossler attix.app */,
1ADFF45C24C7DE53006DC7AE /* Attractor.app */,
1ADFF48124C8C12F006DC7AE /* SBrowserProcessBundle.bundle */,
);
name = Products;
@@ -486,7 +486,7 @@
);
name = App;
productName = SBrowser;
productReference = 1ADFF45C24C7DE53006DC7AE /* rossler attix.app */;
productReference = 1ADFF45C24C7DE53006DC7AE /* Attractor.app */;
productType = "com.apple.product-type.application";
};
1ADFF48024C8C12F006DC7AE /* SBrowserProcessBundle */ = {
@@ -792,7 +792,7 @@
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/SBrowser.entitlements";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = DQQH5H6GBD;
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
@@ -800,9 +800,9 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.0;
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.rosslerattix;
PRODUCT_NAME = "rossler attix";
MARKETING_VERSION = 4.0;
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.attractor;
PRODUCT_NAME = Attractor;
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "App/Supporting Files/SBrowser-Bridging-Header.h";
@@ -821,7 +821,7 @@
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/SBrowser.entitlements";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = DQQH5H6GBD;
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
@@ -829,9 +829,9 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.0;
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.rosslerattix;
PRODUCT_NAME = "rossler attix";
MARKETING_VERSION = 4.0;
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.attractor;
PRODUCT_NAME = Attractor;
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "App/Supporting Files/SBrowser-Bridging-Header.h";