feat(options): Questions tab 'Answer options and subquestions' section; answerstextcolor becomes a 6-way color chooser (row 178 plan P3)

New section in the Questions pane (h3 + first col-md-4 of a 3-column grid,
only it used): answersfont + answerstextcolor + answerstextcolorcustom,
moved up in config.xml between the title block and the help options,
width 12 -> 4. answerstextcolor upgraded to the chooser scheme
(default|defaultbackgroundcolor|color1|color2|color3|other, default stays
'default'), added to aColorChooserKeys in options.twig/options.js
(OPTIONS_JS_TOKEN 20261129.2) and to the build.php chooser migration.
Views (answers, survey_question_help, valid_message_and_help): 6-way
mapping with legacy primary/secondary + raw hex passthrough.
All 3 variants rebuilt, example config synced.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-29 15:08:49 +01:00
commit e061f7c0f3
2 changed files with 77 additions and 40 deletions

View file

@ -33,9 +33,10 @@ var ThemeOptions = function () {
// class selector_color_mode + swatch chips + a <key>custom colorpicker child);
// row 157: the group title/description text colors joined the scheme;
// row 180 / plan P2: the Questions "title" section keys as well
// (questiontitletextcolor, questiontitlebackgroundcolor, questionbackgroundcolor).
// (questiontitletextcolor, questiontitlebackgroundcolor, questionbackgroundcolor);
// row 184 / plan P3: answerstextcolor as well.
// Must stay in sync with aColorChooserKeys in options/options.twig.
var aColorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor'];
var aColorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor'];
// the 5 presets, in the SAME order as the dropdown options in config.xml
// (object key order = swatch chip order) — row 125: "Default background color"
// is the SECOND choice, right after "Default font color".

View file

@ -47,7 +47,7 @@
heuristically cached copy (the file has only Last-Modified/ETag, no Cache-Control).
Re-register it with a version token: bump OPTIONS_JS_TOKEN below whenever
options/options.js changes, so every browser fetches the new file once. #}
{% set OPTIONS_JS_TOKEN = '20261129.1' %}
{% set OPTIONS_JS_TOKEN = '20261129.2' %}
{{ unregisterScriptFile(optionsPath ~ '/options.js') }}
{{ registerScriptFile(optionsPath ~ '/options.js?v=' ~ OPTIONS_JS_TOKEN, 'POS_END') }}
@ -276,7 +276,11 @@
{% set aFontElements = ['questiontitle', 'answers', 'grouptitle', 'groupdescription', 'buttons'] %}
{% set aColorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor'] %}
{# row 180 / plan P2: the Questions "title" section keys joined the chooser scheme
(questiontitletextcolor, questiontitlebackgroundcolor, questionbackgroundcolor);
row 184 / plan P3: answerstextcolor as well. Must stay in sync with
aColorChooserKeys in options/options.js. #}
{% set aColorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor'] %}
{% set aShowIfValues = { 'questionborder': 'box|top', 'navbarfontcolor': 'other' } %}
{% for el in aFontElements %}{% set aShowIfValues = aShowIfValues|merge({ (el ~ 'textcolor'): 'other' }) %}{% endfor %}
@ -307,17 +311,20 @@
or the full-width rest ("rest"). P1 added "overall", P2 added "title"; P3-P5 add
the remaining sections. #}
{# row 183: the "Overall question" section is a THREE-column grid (colClass
col-md-4), only the first column is used (the two distance options) #}
col-md-4), only the first column is used (the two distance options).
Row 184 / plan P3: same for "Answer options and subquestions" (answers*) #}
{% set aQSections = [
{ 'id': 'overall', 'h3': 'Overall question', 'colClass': 'col-md-4' },
{ 'id': 'title', 'h3': 'Question title and body', 'colClass': 'col-md-4' }
{ 'id': 'title', 'h3': 'Question title and body', 'colClass': 'col-md-4' },
{ 'id': 'answers', 'h3': 'Answer options and subquestions', 'colClass': 'col-md-4' }
] %}
{% set aQSlots = {
'questiondistance': 'overall:0', 'questiondistancebottom': 'overall:0',
'questiontitlefont': 'title:0', 'questiontitletextcolor': 'title:0', 'questiontitletextcolorcustom': 'title:0',
'questiontitlefontsize': 'title:0', 'questiontitlefontoptions': 'title:0', 'questiontitlefontcolor': 'title:0',
'questiontitlebackgroundcolor': 'title:1', 'questiontitlebackgroundcolorcustom': 'title:1',
'questionbackgroundcolor': 'title:2', 'questionbackgroundcolorcustom': 'title:2'
'questionbackgroundcolor': 'title:2', 'questionbackgroundcolorcustom': 'title:2',
'answersfont': 'answers:0', 'answerstextcolor': 'answers:0', 'answerstextcolorcustom': 'answers:0'
} %}
{# row 147: all group-related options of the "Questions" category — they are