mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add code to show the Feed Inspector when the feed icon in the article view is pressed. Issue #1931
This commit is contained in:
@@ -22,6 +22,7 @@ class WebViewController: UIViewController {
|
||||
private struct MessageName {
|
||||
static let imageWasClicked = "imageWasClicked"
|
||||
static let imageWasShown = "imageWasShown"
|
||||
static let showFeedInspector = "showFeedInspector"
|
||||
}
|
||||
|
||||
private var topShowBarsView: UIView!
|
||||
@@ -345,6 +346,10 @@ extension WebViewController: WKScriptMessageHandler {
|
||||
clickedImageCompletion?()
|
||||
case MessageName.imageWasClicked:
|
||||
imageWasClicked(body: message.body as? String)
|
||||
case MessageName.showFeedInspector:
|
||||
if let webFeed = article?.webFeed {
|
||||
coordinator.showFeedInspector(for: webFeed)
|
||||
}
|
||||
default:
|
||||
return
|
||||
}
|
||||
@@ -440,6 +445,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)
|
||||
|
||||
self.renderPage(webView)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user