This commit adds a highlighting extension for web pages. This works on Safari, and can be used by selecting a text on a page and hitting the share button at the bottom of the Safari UI To make this possible, some refactoring was necessary: 1. Several sources were included in the extension bundle to provide access to DamusState, PostView, and the postbox 2. UIApplication.shared was replaced with `this_app`, which routes to UIApplication.shared on the main app bundle, and routes to a bogus UIApplication() in the extension. This is needed because UIApplication.shared cannot be used on an extension. 3. Some items were moved to different files to facilitate the transition. The extension itself uses PostView, and implements views for several edge cases, and tries to handle the note publishing process gracefully. Changelog-Added: Add highlighter for web pages Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
12 lines
207 B
Swift
12 lines
207 B
Swift
//
|
||
// HighlighterExtensionAliases.swift
|
||
// highlighter action extension
|
||
//
|
||
// Created by Daniel D’Aquino on 2024-08-12.
|
||
//
|
||
|
||
import Foundation
|
||
import UIKit
|
||
|
||
let this_app: UIApplication = UIApplication()
|