Commit graph vanilla_respondage/options/options.js
Author SHA1 Message Date
dc27d63de5 fix(options): keep navbarfontcolorcustom in column 2, full-width swatch chips
The new navbarfontcolorcustom picker fell into the generic 'rest' slot of the
Top-of-the-page layout, which opened a NEW col-md-4 — so the picker landed in
column 3 next to the sticky checkboxes and left the divs unbalanced. Map the
key to slot h2 so it stays in column 2 under the navbarfontcolor dropdown,
rendered col-12 (full column width); column 3 is the sticky block again and
the pane markup is balanced (89/89 divs). The swatch chips under the dropdown
were tiny inline squares — make the chips row full column width with taller
flex chips showing the hex value (options.js chip.text). OPTIONS_JS_TOKEN
bumped to 20261126.2 (options.js changed). Layout pinned by jsdom assertions
(picker in the same col-md-4 as the dropdown, wrapper col-12); suite 6/6,
export 0. Variants intentionally not rebuilt (owner: deferred).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-26 14:05:18 +01:00
f2ebf24270 feat(options): menu item color as preset dropdown with persistent custom color (working example)
navbarfontcolor (Top of the page tab, column 2) changes from a plain
colorpicker to a dropdown: Same as default font color | Color 1 | Color 2 |
Color 3 | Other. The new navbarfontcolorcustom colorpicker stays visible but
grayed out (disabled + aria-disabled) unless 'Other' is chosen, and keeps its
value across saves (data-keep-value) so switching back to 'Other' restores the
last picked color. Dropdown option labels show the live hex of each preset and
clickable swatch chips select a preset; an effective-color swatch next to the
picker shows the color actually applied. A legacy stored hex is migrated to
mode 'other' + custom field (options.js) and accepted directly in
custom_header.twig, so nothing is lost before a theme reset. Views map
default->fontcolor, color1/2/3->primary/secondary/tertiarycolor,
other->navbarfontcolorcustom. headerbackgroundcolor/bodybackgroundcolor stay
plain colorpickers, default #ffffff. build.php maps a legacy hex
navbarfontcolor in variant jsons to other+custom for when variants are built.
Verified: jsdom suite 6/6 (new options_navbar_color_mode test: migration,
gray-out, keep-value on save, chips, swatches), live survey render for all 5
modes, export check exit 0.

NOTE (owner 2026-11-26): variant builds are intentionally DEFERRED — no
customer is waiting; the on-disk variant folders were left at their
pre-feature state and no variant theme was reset. Run
variants/build.php per variant only after the open prompts are done.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-26 13:55:30 +01:00
7939f3de3f fix(options): isolate startup steps so a throwing step can never kill saving again
Hardening against the 2026-11-25 regression (unguarded JSON.parse of
#optionCssFiles="inherit" at global level killed the whole options.js:
no handlers bound, Save silently posted stale JSON). run() now executes
each startup step through safeStep() (try/catch + console.ls.error) and
ALWAYS calls bind(), so the save/change handlers exist even if a prepare
step fails. OPTIONS_JS_TOKEN bumped to 20261125.5.

Regression guard added in variants/tests/options_save_global.test.js
(local-only, gitignored): loads the page with optionCssFiles="inherit"
(the global-page condition) and asserts the save button has a click
handler, pickers have input+change handlers, a swatch color change
reaches the saved options JSON on Save, and the label layout (checkbox
box before label; d-block label above btn-groups). Verified the test
FAILS on the pre-fix options.js and PASSES on the fixed one; full suite
5/5.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-25 21:28:43 +01:00
44e0e871d4 fix(options): guard JSON.parse of optionCssFiles so the options page works at global level
On the GLOBAL theme options page the hidden #optionCssFiles holds the
literal string "inherit" (not JSON). options.js did an unguarded
JSON.parse($('#optionCssFiles').val()) in the ThemeOptions constructor,
which threw and meant run() never executed: no change handlers and no
save handler were bound, so Save posted the stale options JSON and
nothing changed in the UI (e.g. colors on the Default fonts and colors
tab) was saved. Fall back to an empty file list on parse failure.
OPTIONS_JS_TOKEN bumped to 20261125.4.

Verified against the live page (themeOptions/update&id=497, where
optionCssFiles="inherit"): constructor no longer throws, picker
input/change handlers bind, and the save click writes the new color
into TemplateConfiguration[options]; real HTTP POST confirmed the
value lands in lime_template_configuration.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-25 21:25:25 +01:00
588199086a fix(options): checkbox box before label, labels above controls, live color-swatch sync
- checkboxes (incl. the 9 logo show-on boxes): back to classic .form-check
  with the input BEFORE the label (label right of the box); label keeps id
  lbl_simple_edit_options_<key> so JS/test anchors are unchanged
- all other option types: label gets d-block so it sits above the control
  even next to an inline-flex btn-group (Simple options / Questions tabs)
- options.js: color swatch syncs on 'input' as well as 'change', so a color
  picked in the native popup is already in the saved JSON when Save is
  clicked (browsers fire 'change' only when the popup closes);
  OPTIONS_JS_TOKEN bumped to 20261125.3

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-25 21:05:01 +01:00
9716aac4ee feat(options): Fonts tab becomes 'Fonts and colors' with per-element font+color combos (Prompt U)
Tab 'Fonts' is renamed to 'Fonts and colors' and gets a dedicated layout:
top row (col 1: font, fontcolor, fontsize; col 2: primarycolor +
new secondarycolor; col 3 empty), an hr, then one combo row per element
(header, progressbar, questiontitle, answers, grouptitle,
groupdescription, buttons) with col 1 = existing <el>font fontselect,
col 2 = new <el>textcolor dropdown (default|primary|secondary|other),
col 3 = new <el>textcolorcustom colorpicker, visible only when mode is
'other' (parent show-value via aShowIfValues, server-side initial d-none,
options.js updateVisibilityByParent/updateChild now handle select parents,
multi-value aware; font's self-parent removed from config.xml).
config.xml: fontcolor/primarycolor moved from Colors to Fonts (retitled
'Default font color (body text)' / 'Primary color'), secondarycolor added
(default #888888), 14 per-element color keys added with dropdownoptions.
Views emit the per-element color as inline style (default->fontcolor,
primary->primarycolor, secondary->secondarycolor, other->custom picker).
Colors tab now only holds sliderhandlecolor + privacybackgroundcolor
(final Colors layout = Prompt T, still open).
Variants rebuilt (defensie, erasmus, example respondage_respondage) —
no unknown-key failures; theme reset in LS-admin still owner action.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-25 11:51:57 +01:00
671fba4aff feat(options): Questions tab as 3 columns with conditional border options + new questionhelpfontcolor (Prompt R)
config.xml: Questions options reordered into the three pane columns
(col1 colors+help, col2 border + children, col3 checkbox color), all
width=12; new colorpicker questionhelpfontcolor (default #444444);
questionbordercolor/style/dropdown + 4 radii get parent="questionborder".
options.twig: Questions pane renders three col-md-4 columns (border-start
between), options stacked as col-12; aShowIfValues map carries the
multi-value show list (box|top) as data-show-if-value since core passes
only parent through; server-side initial d-none is multi-value aware
(Prompt Q logic extended); buttons/colorpicker children now also get
data-parent/selector_radio_childfield. options.js: updateVisibilityByParent
and updateChild are multi-value + checked-radio aware (single-value
behaviour unchanged); OPTIONS_JS_TOKEN bumped.
custom_header.twig: .question-help-container gets color from
questionhelpfontcolor.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-25 11:35:18 +01:00
daf3d93bb3 fix(options): no loading-spinner flash on options-page load (Prompt I)
Remove the show/hide around the init prepare() call in options.js; the
spinner keeps its display:none default and is only shown during a real
upload (onBeforeSend/onSuccess in BindUpload). Bump OPTIONS_JS_TOKEN to
20261124.4 so browsers fetch the changed options.js once.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-24 22:33:11 +01:00
cffd3cefa6 feat!: rename theme respondage_vanilla -> vanilla_respondage, variants -> respondage_<client>
Prompt V (prompts.md rows 51-54). Mother theme folder + <name> renamed to
vanilla_respondage (version 3.3.0); client variants renamed to
respondage_defensie / respondage_erasmus (<extends>vanilla_respondage</extends>,
auto-derived by build.php). export_public.sh now derives the release name from
the theme dir and the leak-check glob matches ../respondage_* siblings, so the
public-release leak check keeps working after the rename (sabotage-tested).
All doc/tooling references updated; local-only files stay gitignored.

Also includes the pending uncommitted theme work from this testing week
(custom options page, header logos, sticky-header options, bundled OFL fonts,
per-element font overrides, font-dropdown reordering, jsdom tests) that was
verified locally but not yet pushed.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-24 22:04:11 +01:00
fd7ecba1a3 chore: normalize all line endings to LF and enforce via .gitattributes
All text files in the theme (config.xml, sass, css, js, twig, md) used mixed
CRLF/LF. Normalize everything to LF (Unix), matching the LimeSurvey core
themes. .gitattributes (* text=auto eol=lf, binary images/fonts) keeps it
that way; config.xml documents the convention in its header comment.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-16 19:36:04 +01:00
a023555acf First commit after long time, too much to describe (sorry) 2026-07-07 16:05:43 +02:00
e3be1bcde7 First commit 2026-06-17 10:06:07 +02:00