mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Scripting support for Author class and expanded properties for feeds
This commit is contained in:
@@ -11,7 +11,7 @@ import Account
|
||||
import Data
|
||||
|
||||
@objc(ScriptableFeed)
|
||||
class ScriptableFeed: NSObject, UniqueIdScriptingObject {
|
||||
class ScriptableFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer{
|
||||
|
||||
let feed:Feed
|
||||
let container:ScriptingObjectContainer
|
||||
@@ -41,7 +41,13 @@ class ScriptableFeed: NSObject, UniqueIdScriptingObject {
|
||||
var scriptingUniqueId:Any {
|
||||
return feed.feedID
|
||||
}
|
||||
|
||||
// MARK: --- ScriptingObjectContainer protocol ---
|
||||
|
||||
var scriptingClassDescription: NSScriptClassDescription {
|
||||
return self.classDescription as! NSScriptClassDescription
|
||||
}
|
||||
|
||||
// MARK: --- Scriptable properties ---
|
||||
|
||||
@objc(url)
|
||||
@@ -59,4 +65,25 @@ class ScriptableFeed: NSObject, UniqueIdScriptingObject {
|
||||
return self.feed.name ?? ""
|
||||
}
|
||||
|
||||
@objc(homePageURL)
|
||||
var homePageURL:String {
|
||||
return self.feed.homePageURL ?? ""
|
||||
}
|
||||
|
||||
@objc(iconURL)
|
||||
var iconURL:String {
|
||||
return self.feed.iconURL ?? ""
|
||||
}
|
||||
|
||||
@objc(faviconURL)
|
||||
var faviconURL:String {
|
||||
return self.feed.faviconURL ?? ""
|
||||
}
|
||||
|
||||
@objc(authors)
|
||||
var authors:NSArray {
|
||||
let feedAuthors = feed.authors ?? []
|
||||
return feedAuthors.map { ScriptableAuthor($0, container:self) } as NSArray
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user