generated from coulomb/repo-seed
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>
16 lines
476 B
Haskell
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 ()
|