mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Bring in code from previous iOS release.
This commit is contained in:
@@ -21,12 +21,7 @@ class FeedbinAccountViewController: UITableViewController {
|
||||
@IBOutlet weak var showHideButton: UIButton!
|
||||
@IBOutlet weak var actionButton: UIButton!
|
||||
@IBOutlet weak var footerLabel: UILabel!
|
||||
@IBOutlet weak var onepasswordButton: UIBarButtonItem! {
|
||||
didSet {
|
||||
onepasswordButton.image?.withTintColor(AppAssets.primaryAccentColor)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
weak var account: Account?
|
||||
weak var delegate: AddAccountDismissDelegate?
|
||||
|
||||
@@ -51,11 +46,6 @@ class FeedbinAccountViewController: UITableViewController {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(textDidChange(_:)), name: UITextField.textDidChangeNotification, object: passwordTextField)
|
||||
|
||||
tableView.register(ImageHeaderView.self, forHeaderFooterViewReuseIdentifier: "SectionHeader")
|
||||
|
||||
if !OnePasswordExtension.shared().isAppExtensionAvailable() {
|
||||
onepasswordButton.isEnabled = false
|
||||
onepasswordButton.image?.withTintColor(.clear)
|
||||
}
|
||||
}
|
||||
|
||||
private func setupFooter() {
|
||||
@@ -80,17 +70,6 @@ class FeedbinAccountViewController: UITableViewController {
|
||||
dismiss(animated: true, completion: nil)
|
||||
}
|
||||
|
||||
@IBAction func retrievePasswordDetailsFrom1Password(_ sender: Any) {
|
||||
OnePasswordExtension.shared().findLogin(forURLString: "feedbin.com", for: self, sender: self) { [self] loginDictionary, error in
|
||||
if let loginDictionary = loginDictionary {
|
||||
emailTextField.text = loginDictionary[AppExtensionUsernameKey] as? String
|
||||
passwordTextField.text = loginDictionary[AppExtensionPasswordKey] as? String
|
||||
actionButton.isEnabled = !(emailTextField.text?.isEmpty ?? false) && !(passwordTextField.text?.isEmpty ?? false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@IBAction func showHidePassword(_ sender: Any) {
|
||||
if passwordTextField.isSecureTextEntry {
|
||||
passwordTextField.isSecureTextEntry = false
|
||||
|
||||
@@ -21,11 +21,6 @@ class NewsBlurAccountViewController: UITableViewController {
|
||||
@IBOutlet weak var showHideButton: UIButton!
|
||||
@IBOutlet weak var actionButton: UIButton!
|
||||
@IBOutlet weak var footerLabel: UILabel!
|
||||
@IBOutlet weak var onepasswordButton: UIBarButtonItem! {
|
||||
didSet {
|
||||
onepasswordButton.image?.withTintColor(AppAssets.primaryAccentColor)
|
||||
}
|
||||
}
|
||||
|
||||
weak var account: Account?
|
||||
weak var delegate: AddAccountDismissDelegate?
|
||||
@@ -158,16 +153,6 @@ class NewsBlurAccountViewController: UITableViewController {
|
||||
self.present(safari, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
@IBAction func retrievePasswordDetailsFrom1Password(_ sender: Any) {
|
||||
OnePasswordExtension.shared().findLogin(forURLString: "newsblur.com", for: self, sender: sender) { [self] loginDictionary, error in
|
||||
if let loginDictionary = loginDictionary {
|
||||
usernameTextField.text = loginDictionary[AppExtensionUsernameKey] as? String
|
||||
passwordTextField.text = loginDictionary[AppExtensionPasswordKey] as? String
|
||||
actionButton.isEnabled = !(usernameTextField.text?.isEmpty ?? false) && !(passwordTextField.text?.isEmpty ?? false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc func textDidChange(_ note: Notification) {
|
||||
actionButton.isEnabled = !(usernameTextField.text?.isEmpty ?? false)
|
||||
}
|
||||
|
||||
@@ -23,12 +23,7 @@ class ReaderAPIAccountViewController: UITableViewController {
|
||||
@IBOutlet weak var actionButton: UIButton!
|
||||
@IBOutlet weak var footerLabel: UILabel!
|
||||
@IBOutlet weak var signUpButton: UIButton!
|
||||
@IBOutlet weak var onepasswordButton: UIBarButtonItem! {
|
||||
didSet {
|
||||
onepasswordButton.image?.withTintColor(AppAssets.primaryAccentColor)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
weak var account: Account?
|
||||
var accountType: AccountType?
|
||||
weak var delegate: AddAccountDismissDelegate?
|
||||
@@ -269,30 +264,6 @@ class ReaderAPIAccountViewController: UITableViewController {
|
||||
self.present(safari, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
@IBAction func retrievePasswordDetailsFrom1Password(_ sender: Any) {
|
||||
var url: String
|
||||
switch accountType {
|
||||
case .bazQux:
|
||||
url = "bazqux.com"
|
||||
case .inoreader:
|
||||
url = "inoreader.com"
|
||||
case .theOldReader:
|
||||
url = "theoldreader.com"
|
||||
case .freshRSS:
|
||||
url = apiURLTextField.text ?? ""
|
||||
default:
|
||||
url = ""
|
||||
}
|
||||
|
||||
OnePasswordExtension.shared().findLogin(forURLString: url, for: self, sender: sender) { [self] loginDictionary, error in
|
||||
if let loginDictionary = loginDictionary {
|
||||
usernameTextField.text = loginDictionary[AppExtensionUsernameKey] as? String
|
||||
passwordTextField.text = loginDictionary[AppExtensionPasswordKey] as? String
|
||||
actionButton.isEnabled = !(usernameTextField.text?.isEmpty ?? false) && !(passwordTextField.text?.isEmpty ?? false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func apiURL() -> URL? {
|
||||
switch accountType {
|
||||
case .freshRSS:
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
#import "OnePasswordExtension.h"
|
||||
|
||||
Reference in New Issue
Block a user