Remove ExtensionPoint code.

This commit is contained in:
Brent Simmons
2023-06-25 16:48:37 -07:00
parent 4f5d287ef8
commit f0699e5410
15 changed files with 14 additions and 349 deletions

View File

@@ -10,40 +10,15 @@ import AppKit
import RSCore
import Articles
final class SendToMarsEditCommand: ExtensionPoint, SendToCommand {
final class SendToMarsEditCommand: SendToCommand {
static var isSinglton = true
static var isDeveloperBuildRestricted = false
static var title = NSLocalizedString("MarsEdit", comment: "MarsEdit")
static var image = AppAssets.extensionPointMarsEdit
static var description: NSAttributedString = {
let attrString = SendToMarsEditCommand.makeAttrString("This extension enables share menu functionality to send selected article text to MarsEdit. You need the MarsEdit application for this to work.")
let range = NSRange(location: 81, length: 8)
attrString.beginEditing()
attrString.addAttribute(NSAttributedString.Key.link, value: "https://red-sweater.com/marsedit/", range: range)
attrString.addAttribute(NSAttributedString.Key.foregroundColor, value: NSColor.systemBlue, range: range)
attrString.endEditing()
return attrString
}()
let extensionPointID = ExtensionPointIdentifer.marsEdit
var title: String {
return extensionPointID.extensionPointType.title
}
var image: NSImage? {
return appToUse()?.icon ?? nil
}
let title = "MarsEdit"
let image: RSImage? = AppAssets.marsEditIcon
private let marsEditApps = [UserApp(bundleID: "com.red-sweater.marsedit4"), UserApp(bundleID: "com.red-sweater.marsedit")]
func canSendObject(_ object: Any?, selectedText: String?) -> Bool {
if let _ = appToUse() {
return true
}
return false
appToUse() != nil
}
func sendObject(_ object: Any?, selectedText: String?) {