generated from coulomb/repo-seed
feat(P6/T05): cross-framework annotation launcher JS widget
ihf-annotation-launcher.js: vanilla JS, no framework dependency. Scans DOM for data-widget-id elements, injects Annotate trigger, opens inline form, POSTs to /widgets/:widgetId/annotations. Works in React/Vue-rendered pages via MutationObserver. Feature-gated by IHP_ANNOTATION_LAUNCHER=true env var (Config.hs AnnotationLauncherEnabled, FrontController layout conditional). Docs: docs/annotation-launcher.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,9 +3,13 @@ module Config where
|
||||
import IHP.Prelude
|
||||
import IHP.Environment
|
||||
import IHP.FrameworkConfig
|
||||
import System.Environment (lookupEnv)
|
||||
|
||||
-- | Feature flag: set IHP_ANNOTATION_LAUNCHER=true to inject the JS launcher.
|
||||
newtype AnnotationLauncherEnabled = AnnotationLauncherEnabled Bool deriving (Typeable)
|
||||
|
||||
config :: ConfigBuilder
|
||||
config = do
|
||||
-- See https://ihp.digitallyinduced.com/Guide/config.html
|
||||
-- for what you can do here
|
||||
pure ()
|
||||
launcherEnv <- liftIO (lookupEnv "IHP_ANNOTATION_LAUNCHER")
|
||||
option (AnnotationLauncherEnabled (launcherEnv == Just "true"))
|
||||
pure ()
|
||||
|
||||
Reference in New Issue
Block a user