mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Merge branch 'youtube-integration' into super-cut
This commit is contained in:
@@ -386,7 +386,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
||||
|
||||
alert.buttons[0].keyEquivalent = "\r"
|
||||
|
||||
let response = alert.runModal()
|
||||
_ = alert.runModal()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -527,16 +527,16 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="7UM-iq-OLB" customClass="PreferencesTableViewBackgroundView" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="44" width="180" height="219"/>
|
||||
<rect key="frame" x="20" y="44" width="180" height="217"/>
|
||||
<subviews>
|
||||
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="26" horizontalPageScroll="10" verticalLineScroll="26" verticalPageScroll="10" hasHorizontalScroller="NO" horizontalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="PaF-du-r3c">
|
||||
<rect key="frame" x="1" y="1" width="178" height="217"/>
|
||||
<rect key="frame" x="1" y="1" width="178" height="215"/>
|
||||
<clipView key="contentView" id="cil-Gq-akO">
|
||||
<rect key="frame" x="0.0" y="0.0" width="178" height="217"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="178" height="215"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="fullWidth" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="24" viewBased="YES" id="aTp-KR-y6b">
|
||||
<rect key="frame" x="0.0" y="0.0" width="178" height="217"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="178" height="215"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<size key="intercellSpacing" width="3" height="2"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -643,7 +643,7 @@
|
||||
<rect key="frame" x="83" y="20" width="117" height="24"/>
|
||||
</customView>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Y7D-xQ-wep">
|
||||
<rect key="frame" x="208" y="20" width="222" height="243"/>
|
||||
<rect key="frame" x="208" y="20" width="222" height="241"/>
|
||||
</customView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
@@ -698,16 +698,16 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="pjs-G4-byk" customClass="PreferencesTableViewBackgroundView" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="44" width="180" height="219"/>
|
||||
<rect key="frame" x="20" y="44" width="180" height="217"/>
|
||||
<subviews>
|
||||
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="26" horizontalPageScroll="10" verticalLineScroll="26" verticalPageScroll="10" hasHorizontalScroller="NO" horizontalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="29T-r2-ckC">
|
||||
<rect key="frame" x="1" y="1" width="178" height="217"/>
|
||||
<rect key="frame" x="1" y="1" width="178" height="215"/>
|
||||
<clipView key="contentView" id="dXw-GY-TP8">
|
||||
<rect key="frame" x="0.0" y="0.0" width="178" height="217"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="178" height="215"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="fullWidth" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="24" viewBased="YES" id="dfn-Vn-oDp">
|
||||
<rect key="frame" x="0.0" y="0.0" width="178" height="217"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="178" height="215"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<size key="intercellSpacing" width="3" height="2"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -810,7 +810,7 @@
|
||||
<rect key="frame" x="83" y="20" width="117" height="24"/>
|
||||
</customView>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="N1N-pE-gBL">
|
||||
<rect key="frame" x="208" y="20" width="222" height="243"/>
|
||||
<rect key="frame" x="208" y="20" width="222" height="241"/>
|
||||
</customView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import AppKit
|
||||
|
||||
final class CrashReportWindowController: NSWindowController {
|
||||
@MainActor final class CrashReportWindowController: NSWindowController {
|
||||
|
||||
@IBOutlet var textView: NSTextView! {
|
||||
didSet {
|
||||
|
||||
@@ -16,7 +16,7 @@ import CrashReporter
|
||||
// At some point this code should probably move into RSCore, so Rainier and any other
|
||||
// future apps can use it.
|
||||
|
||||
struct CrashReporter {
|
||||
@MainActor struct CrashReporter {
|
||||
|
||||
struct DefaultsKey {
|
||||
static let sendCrashLogsAutomaticallyKey = "SendCrashLogsAutomatically"
|
||||
|
||||
@@ -98,6 +98,8 @@ final class DetailWebViewController: NSViewController {
|
||||
userContentController.add(self, name: MessageName.windowDidScroll)
|
||||
userContentController.add(self, name: MessageName.mouseDidEnter)
|
||||
userContentController.add(self, name: MessageName.mouseDidExit)
|
||||
userContentController.addUserScript(forResource: "inject", withExtension: "js")
|
||||
|
||||
configuration.userContentController = userContentController
|
||||
|
||||
webView = DetailWebView(frame: NSRect.zero, configuration: configuration)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import AppKit
|
||||
|
||||
class AccountCell: NSTableCellView {
|
||||
@MainActor class AccountCell: NSTableCellView {
|
||||
|
||||
private var originalImage: NSImage?
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ enum AccountsAddCloudKitWindowControllerError: LocalizedError {
|
||||
}
|
||||
}
|
||||
|
||||
class AccountsAddCloudKitWindowController: NSWindowController {
|
||||
@MainActor class AccountsAddCloudKitWindowController: NSWindowController {
|
||||
|
||||
@IBOutlet weak var limitationsAndSolutionsTextField: NSTextField!
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import AppKit
|
||||
import Account
|
||||
|
||||
class AccountsAddLocalWindowController: NSWindowController {
|
||||
@MainActor class AccountsAddLocalWindowController: NSWindowController {
|
||||
|
||||
@IBOutlet private weak var nameTextField: NSTextField!
|
||||
@IBOutlet private weak var localAccountNameTextField: NSTextField!
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import AppKit
|
||||
import Account
|
||||
|
||||
final class AccountsDetailViewController: NSViewController, NSTextFieldDelegate {
|
||||
@MainActor final class AccountsDetailViewController: NSViewController, NSTextFieldDelegate {
|
||||
|
||||
@IBOutlet weak var typeLabel: NSTextField!
|
||||
@IBOutlet weak var nameTextField: NSTextField!
|
||||
|
||||
@@ -12,7 +12,7 @@ import RSCore
|
||||
import RSWeb
|
||||
import Secrets
|
||||
|
||||
class AccountsFeedbinWindowController: NSWindowController, Logging {
|
||||
@MainActor class AccountsFeedbinWindowController: NSWindowController, Logging {
|
||||
|
||||
@IBOutlet weak var signInTextField: NSTextField!
|
||||
@IBOutlet weak var noAccountTextField: NSTextField!
|
||||
|
||||
@@ -12,7 +12,7 @@ import RSWeb
|
||||
import RSCore
|
||||
import Secrets
|
||||
|
||||
class AccountsNewsBlurWindowController: NSWindowController, Logging {
|
||||
@MainActor class AccountsNewsBlurWindowController: NSWindowController, Logging {
|
||||
|
||||
@IBOutlet weak var signInTextField: NSTextField!
|
||||
@IBOutlet weak var noAccountTextField: NSTextField!
|
||||
|
||||
@@ -17,7 +17,7 @@ protocol AccountsPreferencesAddAccountDelegate {
|
||||
}
|
||||
|
||||
// MARK: - AccountsPreferencesViewController
|
||||
final class AccountsPreferencesViewController: NSViewController {
|
||||
@MainActor final class AccountsPreferencesViewController: NSViewController {
|
||||
|
||||
@IBOutlet weak var tableView: NSTableView!
|
||||
@IBOutlet weak var detailView: NSView!
|
||||
|
||||
@@ -12,7 +12,7 @@ import RSWeb
|
||||
import RSCore
|
||||
import Secrets
|
||||
|
||||
class AccountsReaderAPIWindowController: NSWindowController, Logging {
|
||||
@MainActor class AccountsReaderAPIWindowController: NSWindowController, Logging {
|
||||
|
||||
@IBOutlet weak var titleImageView: NSImageView!
|
||||
@IBOutlet weak var titleLabel: NSTextField!
|
||||
|
||||
@@ -8,11 +8,10 @@
|
||||
|
||||
import AppKit
|
||||
|
||||
final class AdvancedPreferencesViewController: NSViewController {
|
||||
@MainActor final class AdvancedPreferencesViewController: NSViewController {
|
||||
|
||||
@IBOutlet var releaseBuildsButton: NSButton!
|
||||
@IBOutlet var testBuildsButton: NSButton!
|
||||
@IBOutlet weak var privacyPolicyTextField: NSTextField!
|
||||
|
||||
let releaseBuildsURL = Bundle.main.infoDictionary!["SUFeedURL"]! as! String
|
||||
let testBuildsURL = Bundle.main.infoDictionary!["FeedURLForTestBuilds"]! as! String
|
||||
@@ -35,7 +34,6 @@ final class AdvancedPreferencesViewController: NSViewController {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil)
|
||||
didRegisterForNotification = true
|
||||
}
|
||||
privacyPolicyTextField.attributedStringValue = AppAssets.privacyPolicyLink
|
||||
}
|
||||
|
||||
@IBAction func updateTypeButtonClicked(_ sender: Any?) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class ExtensionPointDetailViewController: NSViewController {
|
||||
@MainActor class ExtensionPointDetailViewController: NSViewController {
|
||||
|
||||
@IBOutlet weak var imageView: NSImageView!
|
||||
@IBOutlet weak var titleLabel: NSTextField!
|
||||
|
||||
@@ -11,7 +11,7 @@ import AuthenticationServices
|
||||
import OAuthSwift
|
||||
import Secrets
|
||||
|
||||
class ExtensionPointEnableWindowController: NSWindowController {
|
||||
@MainActor class ExtensionPointEnableWindowController: NSWindowController {
|
||||
|
||||
@IBOutlet weak var imageView: NSImageView!
|
||||
@IBOutlet weak var titleLabel: NSTextField!
|
||||
|
||||
@@ -16,7 +16,7 @@ protocol ExtensionPointPreferencesEnabler: AnyObject {
|
||||
func enable(_ extensionPointType: ExtensionPoint.Type)
|
||||
}
|
||||
|
||||
final class ExtensionPointPreferencesViewController: NSViewController {
|
||||
@MainActor final class ExtensionPointPreferencesViewController: NSViewController {
|
||||
|
||||
@IBOutlet weak var tableView: NSTableView!
|
||||
@IBOutlet weak var detailView: NSView!
|
||||
|
||||
@@ -11,7 +11,7 @@ import RSCore
|
||||
import RSWeb
|
||||
import UserNotifications
|
||||
|
||||
final class GeneralPreferencesViewController: NSViewController {
|
||||
@MainActor final class GeneralPreferencesViewController: NSViewController {
|
||||
|
||||
private var userNotificationSettings: UNNotificationSettings?
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import AppKit
|
||||
import RSCore
|
||||
|
||||
final class PreferencesControlsBackgroundView: NSView {
|
||||
@MainActor final class PreferencesControlsBackgroundView: NSView {
|
||||
|
||||
private let lightModeFillColor = NSColor(white: 0.97, alpha: 1.0)
|
||||
private let darkModeFillColor = NSColor(red: 0.32, green: 0.34, blue: 0.35, alpha: 1.0)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import AppKit
|
||||
|
||||
final class PreferencesTableViewBackgroundView: NSView {
|
||||
@MainActor final class PreferencesTableViewBackgroundView: NSView {
|
||||
|
||||
let lightBorderColor = NSColor(white: 0.71, alpha: 1.0)
|
||||
let darkBorderColor = NSColor(red: 0.41, green: 0.43, blue: 0.44, alpha: 1.0)
|
||||
|
||||
@@ -28,7 +28,7 @@ private struct ToolbarItemIdentifier {
|
||||
static let Advanced = "Advanced"
|
||||
}
|
||||
|
||||
class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
|
||||
@MainActor class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
|
||||
|
||||
private let windowWidth = CGFloat(512.0) // Width is constant for all views; only the height changes
|
||||
private var viewControllers = [String: NSViewController]()
|
||||
|
||||
@@ -207,6 +207,12 @@
|
||||
514C16DE24D2EF15009A3AFA /* RSTree in Frameworks */ = {isa = PBXBuildFile; productRef = 514C16DD24D2EF15009A3AFA /* RSTree */; };
|
||||
514C16DF24D2EF15009A3AFA /* RSTree in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 514C16DD24D2EF15009A3AFA /* RSTree */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
514C16E124D2EF38009A3AFA /* RSCoreResources in Frameworks */ = {isa = PBXBuildFile; productRef = 514C16E024D2EF38009A3AFA /* RSCoreResources */; };
|
||||
514DE4C129DDFD16001B0D79 /* WKUserContentController-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 514DE4C029DDFD16001B0D79 /* WKUserContentController-Extensions.swift */; };
|
||||
514DE4C329DE0609001B0D79 /* inject.js in Resources */ = {isa = PBXBuildFile; fileRef = 514DE4C229DE0609001B0D79 /* inject.js */; };
|
||||
514DE4C429DE0609001B0D79 /* inject.js in Resources */ = {isa = PBXBuildFile; fileRef = 514DE4C229DE0609001B0D79 /* inject.js */; };
|
||||
514DE4C529DE0609001B0D79 /* inject.js in Resources */ = {isa = PBXBuildFile; fileRef = 514DE4C229DE0609001B0D79 /* inject.js */; };
|
||||
514DE4C629DE4536001B0D79 /* WKUserContentController-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 514DE4C029DDFD16001B0D79 /* WKUserContentController-Extensions.swift */; };
|
||||
514DE4C729DE4537001B0D79 /* WKUserContentController-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 514DE4C029DDFD16001B0D79 /* WKUserContentController-Extensions.swift */; };
|
||||
5153A35428DC5CEB0036C545 /* RSCore in Frameworks */ = {isa = PBXBuildFile; productRef = DF2A8F32289BFBD9002455AD /* RSCore */; };
|
||||
5154368B229404D1005E1CDF /* FaviconGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51EF0F76227716200050506E /* FaviconGenerator.swift */; };
|
||||
515A50E6243D07A90089E588 /* ExtensionPointManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 515A50E5243D07A90089E588 /* ExtensionPointManager.swift */; };
|
||||
@@ -1228,6 +1234,8 @@
|
||||
5148F44A2336DB4700F8CD8B /* MasterTimelineTitleView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MasterTimelineTitleView.xib; sourceTree = "<group>"; };
|
||||
5148F4542336DB7000F8CD8B /* MasterTimelineTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterTimelineTitleView.swift; sourceTree = "<group>"; };
|
||||
514B7C8223205EFB00BAC947 /* RootSplitViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootSplitViewController.swift; sourceTree = "<group>"; };
|
||||
514DE4C029DDFD16001B0D79 /* WKUserContentController-Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WKUserContentController-Extensions.swift"; sourceTree = "<group>"; };
|
||||
514DE4C229DE0609001B0D79 /* inject.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = inject.js; sourceTree = "<group>"; };
|
||||
515A50E5243D07A90089E588 /* ExtensionPointManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionPointManager.swift; sourceTree = "<group>"; };
|
||||
515A5147243E64BA0089E588 /* ExtensionPointEnableWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionPointEnableWindowController.swift; sourceTree = "<group>"; };
|
||||
515A516D243E7F950089E588 /* ExtensionPointDetail.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ExtensionPointDetail.xib; sourceTree = "<group>"; };
|
||||
@@ -2145,13 +2153,14 @@
|
||||
51C452A822650DA100C03939 /* Article Rendering */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
51D0214526ED617100FF2E0F /* core.css */,
|
||||
B27EEBDF244D15F2000932E6 /* stylesheet.css */,
|
||||
848362FE2262A30E00DA1D35 /* template.html */,
|
||||
517630032336215100E15FFF /* main.js */,
|
||||
49F40DEF2335B71000552BF4 /* newsfoot.js */,
|
||||
849A977D1ED9EC42007D329B /* ArticleRenderer.swift */,
|
||||
51DC07972552083500A3F79F /* ArticleTextSize.swift */,
|
||||
51D0214526ED617100FF2E0F /* core.css */,
|
||||
514DE4C229DE0609001B0D79 /* inject.js */,
|
||||
517630032336215100E15FFF /* main.js */,
|
||||
49F40DEF2335B71000552BF4 /* newsfoot.js */,
|
||||
B27EEBDF244D15F2000932E6 /* stylesheet.css */,
|
||||
848362FE2262A30E00DA1D35 /* template.html */,
|
||||
);
|
||||
path = "Article Rendering";
|
||||
sourceTree = "<group>";
|
||||
@@ -2374,6 +2383,7 @@
|
||||
51F85BF42273625800C787DC /* Bundle-Extensions.swift */,
|
||||
5108F6B52375E612001ABC45 /* CacheCleaner.swift */,
|
||||
516AE9DE2372269A007DEEAA /* IconImage.swift */,
|
||||
51D205EE28E3CF8D007C46EF /* LinkTextField.swift */,
|
||||
849A97971ED9EFAA007D329B /* Node-Extensions.swift */,
|
||||
B24E9ABA245AB88300DA5718 /* NSAttributedString+NetNewsWire.swift */,
|
||||
519279F728E23F5F000AE856 /* NSEvent-Extensions.swift */,
|
||||
@@ -2382,7 +2392,7 @@
|
||||
51126DA3225FDE2F00722696 /* RSImage-Extensions.swift */,
|
||||
84411E701FE5FBFA004B527F /* SmallIconProvider.swift */,
|
||||
51BC4ADD247277DF000A6ED8 /* URL-Extensions.swift */,
|
||||
51D205EE28E3CF8D007C46EF /* LinkTextField.swift */,
|
||||
514DE4C029DDFD16001B0D79 /* WKUserContentController-Extensions.swift */,
|
||||
);
|
||||
path = Extensions;
|
||||
sourceTree = "<group>";
|
||||
@@ -3386,6 +3396,7 @@
|
||||
65ED406A235DEF6C0081F399 /* newsfoot.js in Resources */,
|
||||
5103A9992421643300410853 /* blank.html in Resources */,
|
||||
65ED406B235DEF6C0081F399 /* CrashReporterWindow.xib in Resources */,
|
||||
514DE4C429DE0609001B0D79 /* inject.js in Resources */,
|
||||
65ED406C235DEF6C0081F399 /* Credits.rtf in Resources */,
|
||||
65ED406D235DEF6C0081F399 /* Inspector.storyboard in Resources */,
|
||||
65ED406E235DEF6C0081F399 /* AddWebFeedSheet.xib in Resources */,
|
||||
@@ -3426,6 +3437,7 @@
|
||||
51DEE81A26FBFF84006DAA56 /* Promenade.nnwtheme in Resources */,
|
||||
1768140B2564BB8300D98635 /* NetNewsWire_iOSwidgetextension_target.xcconfig in Resources */,
|
||||
5103A9B424216A4200410853 /* blank.html in Resources */,
|
||||
514DE4C529DE0609001B0D79 /* inject.js in Resources */,
|
||||
51D0214826ED617100FF2E0F /* core.css in Resources */,
|
||||
84C9FCA42262A1B800D921D6 /* LaunchScreenPhone.storyboard in Resources */,
|
||||
516A093B2360A4A000EAE89B /* SettingsTableViewCell.xib in Resources */,
|
||||
@@ -3468,6 +3480,7 @@
|
||||
5142194B2353C1CF00E07E2C /* main_mac.js in Resources */,
|
||||
DFCE4F9128EF26F100405869 /* About.plist in Resources */,
|
||||
84C9FC8C22629E8F00D921D6 /* KeyboardShortcuts.html in Resources */,
|
||||
514DE4C329DE0609001B0D79 /* inject.js in Resources */,
|
||||
B27EEBF9244D15F3000932E6 /* stylesheet.css in Resources */,
|
||||
5144EA3B227A379E00D19003 /* ImportOPMLSheet.xib in Resources */,
|
||||
844B5B691FEA20DF00C7C76A /* SidebarKeyboardShortcuts.plist in Resources */,
|
||||
@@ -3928,6 +3941,7 @@
|
||||
519279F928E23F5F000AE856 /* NSEvent-Extensions.swift in Sources */,
|
||||
65ED4015235DEF6C0081F399 /* AccountsDetailViewController.swift in Sources */,
|
||||
65ED4016235DEF6C0081F399 /* DetailViewController.swift in Sources */,
|
||||
514DE4C729DE4537001B0D79 /* WKUserContentController-Extensions.swift in Sources */,
|
||||
5117715624E1EA0F00A2A836 /* ArticleExtractorButton.swift in Sources */,
|
||||
65ED4017235DEF6C0081F399 /* AppDelegate.swift in Sources */,
|
||||
65ED4018235DEF6C0081F399 /* PreferencesTableViewBackgroundView.swift in Sources */,
|
||||
@@ -4151,6 +4165,7 @@
|
||||
84DEE56622C32CA4005FC42C /* SmartFeedDelegate.swift in Sources */,
|
||||
512E09012268907400BDCFDD /* MasterFeedTableViewSectionHeader.swift in Sources */,
|
||||
512392BF24E33A3C00F11704 /* RedditSelectSortTableViewController.swift in Sources */,
|
||||
514DE4C629DE4536001B0D79 /* WKUserContentController-Extensions.swift in Sources */,
|
||||
516AE9E02372269A007DEEAA /* IconImage.swift in Sources */,
|
||||
519ED456244828C3007F8E94 /* AddExtensionPointViewController.swift in Sources */,
|
||||
51C45268226508F600C03939 /* MasterFeedUnreadCountView.swift in Sources */,
|
||||
@@ -4347,6 +4362,7 @@
|
||||
510C418124E5D1AE008226FD /* ExtensionContainers.swift in Sources */,
|
||||
51EC114C2149FE3300B296E3 /* FolderTreeMenu.swift in Sources */,
|
||||
849ADEE42359817E000E1B81 /* NNW3ImportController.swift in Sources */,
|
||||
514DE4C129DDFD16001B0D79 /* WKUserContentController-Extensions.swift in Sources */,
|
||||
179C39EB26F76B3800D4E741 /* ArticleThemePlist.swift in Sources */,
|
||||
849A97A31ED9F180007D329B /* FolderTreeControllerDelegate.swift in Sources */,
|
||||
51126DA4225FDE2F00722696 /* RSImage-Extensions.swift in Sources */,
|
||||
|
||||
@@ -40,10 +40,10 @@ class ArticleExtractor: Logging {
|
||||
|
||||
let clientURL = "https://extract.feedbin.com/parser"
|
||||
let username = SecretsManager.provider.mercuryClientId
|
||||
let signiture = articleLink.hmacUsingSHA1(key: SecretsManager.provider.mercuryClientSecret)
|
||||
let signature = articleLink.hmacUsingSHA1(key: SecretsManager.provider.mercuryClientSecret)
|
||||
|
||||
if let base64URL = articleLink.data(using: .utf8)?.base64EncodedString() {
|
||||
let fullURL = "\(clientURL)/\(username)/\(signiture)?base64_url=\(base64URL)"
|
||||
let fullURL = "\(clientURL)/\(username)/\(signature)?base64_url=\(base64URL)"
|
||||
if let url = URL(string: fullURL) {
|
||||
self.url = url
|
||||
return
|
||||
|
||||
44
Shared/Article Rendering/inject.js
Normal file
44
Shared/Article Rendering/inject.js
Normal file
@@ -0,0 +1,44 @@
|
||||
function fixYouTube() {
|
||||
var checkForVideoTimer = null;
|
||||
|
||||
function callback(event) {
|
||||
var fullScreenButtonOld = document.querySelector("button.ytp-fullscreen-button");
|
||||
var fullScreenButton = fullScreenButtonOld.cloneNode(true);
|
||||
fullScreenButton.style = false;
|
||||
fullScreenButton.setAttribute("aria-disabled", "false");
|
||||
fullScreenButton.onclick = function() {
|
||||
var player = document.querySelector("video");
|
||||
player.webkitRequestFullScreen();
|
||||
};
|
||||
fullScreenButtonOld.parentNode.replaceChild(fullScreenButton, fullScreenButtonOld);
|
||||
}
|
||||
|
||||
function checkForVideo() {
|
||||
var video = document.querySelector("video");
|
||||
if (video) {
|
||||
clearInterval(checkForVideoTimer);
|
||||
|
||||
var goFullScreen = function() {
|
||||
video.webkitRequestFullScreen();
|
||||
};
|
||||
|
||||
var fullScreenButtonOld = document.querySelector("button.ytp-fullscreen-button");
|
||||
var fullScreenButton = fullScreenButtonOld.cloneNode(true);
|
||||
fullScreenButton.style = false;
|
||||
fullScreenButton.setAttribute("aria-disabled", "false");
|
||||
fullScreenButton.onclick = goFullScreen;
|
||||
fullScreenButtonOld.parentNode.replaceChild(fullScreenButton, fullScreenButtonOld);
|
||||
}
|
||||
}
|
||||
|
||||
const hostname = window.location.hostname;
|
||||
if (hostname.endsWith(".youtube.com") || hostname.endsWith(".youtube-nocookie.com")) {
|
||||
checkForVideoTimer = setInterval(checkForVideo, 100);
|
||||
}
|
||||
|
||||
document.addEventListener('webkitfullscreenchange', fullScreenChange, true);
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
fixYouTube();
|
||||
});
|
||||
@@ -156,19 +156,18 @@ function removeWpSmiley() {
|
||||
}
|
||||
}
|
||||
|
||||
function addYouTubeVideos() {
|
||||
function addYouTubeVideo() {
|
||||
const titleURL = document.querySelector(".articleTitle A").getAttribute("href")
|
||||
const youTubeLink = "https://www.youtube.com/watch?v="
|
||||
if (!titleURL.startsWith(youTubeLink)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Dynamically add the YouTube frame
|
||||
|
||||
const bodyContainer = document.querySelector("#bodyContainer");
|
||||
bodyContainer.setAttribute("style", "position: relative; padding-bottom: 56.25%; height: 100%; max-width: 100% !important; overflow: hidden;")
|
||||
|
||||
|
||||
var youTubeFrame = document.createElement("iFrame");
|
||||
youTubeFrame.setAttribute("src", "https://www.youtube.com/embed/" + titleURL.substring(youTubeLink.length));
|
||||
youTubeFrame.setAttribute("src", "https://www.youtube.com/embed/" + titleURL.substring(youTubeLink.length) + "?fs=0&rel=0");
|
||||
youTubeFrame.setAttribute("style", "position: absolute; top: 0; left: 0; width: 100%; height: 100%;");
|
||||
youTubeFrame.setAttribute("title", "YouTube video player");
|
||||
youTubeFrame.setAttribute("frameborder", "0");
|
||||
@@ -186,6 +185,6 @@ function processPage() {
|
||||
flattenPreElements();
|
||||
styleLocalFootnotes();
|
||||
removeWpSmiley();
|
||||
addYouTubeVideos();
|
||||
addYouTubeVideo();
|
||||
postRenderProcessing();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import Foundation
|
||||
import Account
|
||||
import RSCore
|
||||
|
||||
struct OPMLExporter {
|
||||
@MainActor struct OPMLExporter {
|
||||
|
||||
static func OPMLString(with account: Account, title: String) -> String {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import Foundation
|
||||
import RSWeb
|
||||
import RSCore
|
||||
|
||||
struct CacheCleaner: Logging {
|
||||
@MainActor struct CacheCleaner: Logging {
|
||||
|
||||
static func purgeIfNecessary() {
|
||||
|
||||
|
||||
21
Shared/Extensions/WKUserContentController-Extensions.swift
Normal file
21
Shared/Extensions/WKUserContentController-Extensions.swift
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// WKUserContentController-Extensions.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 4/5/23.
|
||||
// Copyright © 2023 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import WebKit
|
||||
|
||||
extension WKUserContentController {
|
||||
|
||||
func addUserScript(forResource res: String, withExtension ext: String) {
|
||||
if let url = Bundle.main.url(forResource: res, withExtension: ext), let source = try? String(contentsOf: url) {
|
||||
let userScript = WKUserScript(source: source, injectionTime: WKUserScriptInjectionTime.atDocumentStart, forMainFrameOnly: false)
|
||||
addUserScript(userScript)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,12 +5,17 @@
|
||||
</head>
|
||||
<body>
|
||||
<outline text="BBC News - World" title="BBC News - World" type="rss" version="RSS" htmlUrl="https://www.bbc.com/news" xmlUrl="https://feeds.bbci.co.uk/news/world/rss.xml"/>
|
||||
<outline text="Allen Pike" title="Allen Pike" type="rss" version="RSS" htmlUrl="https://www.allenpike.com/" xmlUrl="https://feeds.allenpike.com/feed/"/>
|
||||
<outline text="Becky Hansmeyer" title="Becky Hansmeyer" type="rss" version="RSS" htmlUrl="https://beckyhansmeyer.com" xmlUrl="https://beckyhansmeyer.com/feed/"/>
|
||||
<outline text="Colossal" title="Colossal" type="rss" version="RSS" htmlUrl="https://www.thisiscolossal.com/" xmlUrl="https://www.thisiscolossal.com/feed/"/>
|
||||
<outline text="Craig Hockenberry" title="Craig Hockenberry" type="rss" version="RSS" htmlUrl="https://furbo.org/" xmlUrl="https://furbo.org/feed/json"/>
|
||||
<outline text="Daring Fireball" title="Daring Fireball" type="rss" version="RSS" htmlUrl="https://daringfireball.net/" xmlUrl="https://daringfireball.net/feeds/json"/>
|
||||
<outline text="inessential" title="inessential" type="rss" version="RSS" htmlUrl="https://inessential.com/" xmlUrl="https://inessential.com/feed.json"/>
|
||||
<outline text="Jason Kottke" title="Jason Kottke" type="rss" version="RSS" htmlUrl="https://kottke.org/" xmlUrl="http://feeds.kottke.org/json"/>
|
||||
<outline text="Julia Evans" title="Julia Evans" type="rss" version="RSS" htmlUrl="https://jvns.ca/" xmlUrl="https://jvns.ca/atom.xml"/>
|
||||
<outline text="Manton Reece" title="Manton Reece" type="rss" version="RSS" htmlUrl="https://manton.org/" xmlUrl="https://www.manton.org/feed/json"/>
|
||||
<outline text="Maurice Parker" title="Maurice Parker" type="rss" version="RSS" htmlUrl="https://vincode.io/" xmlUrl="https://vincode.io/feed.xml"/>
|
||||
<outline text="Michael Tsai" title="Michael Tsai" type="rss" version="RSS" htmlUrl="https://mjtsai.com/blog/" xmlUrl="https://mjtsai.com/blog/feed/"/>
|
||||
<outline text="NetNewsWire Blog" title="NetNewsWire Blog" type="rss" version="RSS" htmlUrl="https://nnw.ranchero.com/" xmlUrl="https://nnw.ranchero.com/feed.json"/>
|
||||
<outline text="One Foot Tsunami" title="One Foot Tsunami" type="rss" version="RSS" htmlUrl="https://onefoottsunami.com/" xmlUrl="https://onefoottsunami.com/feed/json/"/>
|
||||
<outline text="Six Colors" title="Six Colors" type="rss" version="RSS" htmlUrl="https://sixcolors.com/" xmlUrl="https://feedpress.me/sixcolors?type=xml"/>
|
||||
|
||||
@@ -10,7 +10,7 @@ import Foundation
|
||||
import Account
|
||||
import RSCore
|
||||
|
||||
struct DefaultFeedsImporter {
|
||||
@MainActor struct DefaultFeedsImporter {
|
||||
|
||||
static func importDefaultFeeds(account: Account) {
|
||||
let defaultFeedsURL = Bundle.main.url(forResource: "DefaultFeeds", withExtension: "opml")!
|
||||
|
||||
@@ -545,6 +545,7 @@ private extension WebViewController {
|
||||
webView.configuration.userContentController.add(WrapperScriptMessageHandler(self), name: MessageName.imageWasClicked)
|
||||
webView.configuration.userContentController.add(WrapperScriptMessageHandler(self), name: MessageName.imageWasShown)
|
||||
webView.configuration.userContentController.add(WrapperScriptMessageHandler(self), name: MessageName.showFeedInspector)
|
||||
webView.configuration.userContentController.addUserScript(forResource: "inject", withExtension: "js")
|
||||
|
||||
self.renderPage(webView)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user