Theme script

Purpose: Let a theme do more than restyle the page: add controls a reader can click, run timers, and remove all of it when the theme changes. Scenario: A reader picks Engagify. theme_toggle.js loads /assets/theme-engagify.js once; the script registers a start and a stop with window.forumThemeScripts, and start adds the nags and the Exit control. When the reader picks another theme, without a reload, stop removes every element and timer the script added; picking Engagify again starts it again from the already loaded script. Themes without a script load nothing. Sources: theme registry (source unavailable) (script on an entry, scriptPaths()), registry and loader (source unavailable) (forumThemeScripts, forumExitTheme), Engagify script (source unavailable), VM test (source unavailable), theme guide.

A failing start or stop is logged and does not block switching themes. forumExitTheme(target) applies the target like a menu choice, saving it and leaving a page theme; Engagify's Exit targets Gloss, which shares its stylesheet.