Files
inter-hub/Config/Config.hs
Bernd Worsch 04eb4643b0 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>
2026-03-29 21:17:43 +00:00

16 lines
476 B
Haskell

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
launcherEnv <- liftIO (lookupEnv "IHP_ANNOTATION_LAUNCHER")
option (AnnotationLauncherEnabled (launcherEnv == Just "true"))
pure ()