feat(options): new Buttons tab after Questions with per-button color choosers (row 178 plan P6)
- config.xml: new 'Buttons' category directly after Questions — buttonsfont (full width) + 12 per-button options (Previous/Next/Submit x background+ text, 6-way mode dropdown + custom picker, width 4); old global buttonstextcolor(+custom) removed (row-178 decision 7) - options.twig: Buttons pane = h2+intro, full-width font row, one row of three col-md-4 columns (Previous/Next/Submit, border-start dividers); 6 new keys in aColorChooserKeys; OPTIONS_JS_TOKEN 20261129.4 - options.js + build.php: chooser key lists synced (+6) - navigator.twig: respondage-btn-prev/-next/-submit classes, old global text color inline style removed; custom_header.twig: cmbg() macro (mode 'default' = no override) + per-button bg/text rules with decision-7 defaults (Next/Submit bg=Color 1 + text #ffffff, Previous bg=#ffffff + default font color) Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
af3b408768
commit
aae3112981
7 changed files with 212 additions and 63 deletions
94
config.xml
94
config.xml
|
|
@ -536,29 +536,81 @@
|
|||
in custom_header.twig on .question-help-container. -->
|
||||
<!-- Questions -->
|
||||
<checkboxcolor type="colorpicker" category="Questions" width="4" title="Checkbox/radiobutton color (when checked)" options="on|off" optionlabels="Yes|No">#ff005f</checkboxcolor>
|
||||
<!-- Per-element font+color combos (Prompt U; row 178 plan P6 moves the
|
||||
buttons ones into their own tab; the answers ones moved to the
|
||||
"Answer options and subquestions" section above in P3). Each element gets:
|
||||
- <el>font (type "fontselect"): the SAME choices as the base "font"
|
||||
dropdown above (bundled + variant-custom + browser fonts), plus a
|
||||
first option "Same as base font" (value "base" = no extra class, the
|
||||
element inherits the body font). Applied as class font-<value> on the
|
||||
element in the views (nav_bar, progress_bar, question_text_container,
|
||||
answers, help, group_name, group_desc, navigator). Default "base".
|
||||
- <el>textcolor (dropdown): text color mode for that element —
|
||||
default|primary|secondary|other (default "default" = the body font
|
||||
color fontcolor). Resolved to an inline style="color: …" in the views.
|
||||
- <el>textcolorcustom (colorpicker): only visible when <el>textcolor
|
||||
= "other" (parent show-value "other"). -->
|
||||
<buttonsfont type="fontselect" category="Questions" width="12" title="Font for the buttons (Previous/Next/Submit)">base</buttonsfont>
|
||||
<buttonstextcolor type="dropdown" category="Questions" width="12" title="Text color for the buttons (Previous/Next/Submit)" options="default|primary|secondary|other" optionlabels="Default font color|Primary color|Secondary color|Other…">default
|
||||
<!-- Buttons tab (row 178 plan P6): own category directly after Questions,
|
||||
so the options page renders it as a tab directly after the Questions tab.
|
||||
One column per navigator button — col 1 = Previous, col 2 = Next,
|
||||
col 3 = Submit (row-178 decision 1). Each button gets a background color
|
||||
chooser and a text color chooser (6-way mode dropdown + a <key>custom
|
||||
colorpicker child for "other", same scheme as the other color choosers;
|
||||
resolved in custom_header.twig via cmm.cmbg() for backgrounds and
|
||||
cmm.cm() for text colors). Row-178 decision 7 defaults: Next/Submit
|
||||
background = Color 1, text color = Other ... #ffffff; Previous
|
||||
background = Other ... #ffffff, text color = Default font color.
|
||||
The old global buttonstextcolor(+custom) options are REPLACED by these
|
||||
per-button colors and were removed. buttonsfont (the font for all three
|
||||
buttons) is full-width at the top of this tab.
|
||||
NOT house-style (structural). -->
|
||||
<buttonsfont type="fontselect" category="Buttons" width="12" title="Font for the buttons (Previous/Next/Submit)">base</buttonsfont>
|
||||
<previousbuttonbackgroundcolor type="dropdown" category="Buttons" width="4" title="Previous button background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default button color|Default background color|Color 1|Color 2|Color 3|Other ...">other
|
||||
<dropdownoptions>
|
||||
<option value="default">Default button color</option>
|
||||
<option value="defaultbackgroundcolor">Default background color</option>
|
||||
<option value="color1">Color 1</option>
|
||||
<option value="color2">Color 2</option>
|
||||
<option value="color3">Color 3</option>
|
||||
<option value="other" data-default="1">[Other ...]</option>
|
||||
</dropdownoptions></previousbuttonbackgroundcolor>
|
||||
<previousbuttonbackgroundcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom previous button background color (for 'Other ...')" parent="previousbuttonbackgroundcolor">#ffffff</previousbuttonbackgroundcolorcustom>
|
||||
<previousbuttontextcolor type="dropdown" category="Buttons" width="4" title="Previous button text color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">default
|
||||
<dropdownoptions>
|
||||
<option value="default" data-default="1">[Default font color]</option>
|
||||
<option value="primary">Primary color</option>
|
||||
<option value="secondary">Secondary color</option>
|
||||
<option value="other">Other…</option>
|
||||
</dropdownoptions></buttonstextcolor>
|
||||
<buttonstextcolorcustom type="colorpicker" category="Questions" width="12" title="Custom text color for the buttons (Previous/Next/Submit)" parent="buttonstextcolor">#444444</buttonstextcolorcustom>
|
||||
<option value="defaultbackgroundcolor">Default background color</option>
|
||||
<option value="color1">Color 1</option>
|
||||
<option value="color2">Color 2</option>
|
||||
<option value="color3">Color 3</option>
|
||||
<option value="other">Other ...</option>
|
||||
</dropdownoptions></previousbuttontextcolor>
|
||||
<previousbuttontextcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom previous button text color (for 'Other ...')" parent="previousbuttontextcolor">#444444</previousbuttontextcolorcustom>
|
||||
<nextbuttonbackgroundcolor type="dropdown" category="Buttons" width="4" title="Next button background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default button color|Default background color|Color 1|Color 2|Color 3|Other ...">color1
|
||||
<dropdownoptions>
|
||||
<option value="default">Default button color</option>
|
||||
<option value="defaultbackgroundcolor">Default background color</option>
|
||||
<option value="color1" data-default="1">[Color 1]</option>
|
||||
<option value="color2">Color 2</option>
|
||||
<option value="color3">Color 3</option>
|
||||
<option value="other">Other ...</option>
|
||||
</dropdownoptions></nextbuttonbackgroundcolor>
|
||||
<nextbuttonbackgroundcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom next button background color (for 'Other ...')" parent="nextbuttonbackgroundcolor">#ffffff</nextbuttonbackgroundcolorcustom>
|
||||
<nextbuttontextcolor type="dropdown" category="Buttons" width="4" title="Next button text color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">other
|
||||
<dropdownoptions>
|
||||
<option value="default">Default font color</option>
|
||||
<option value="defaultbackgroundcolor">Default background color</option>
|
||||
<option value="color1">Color 1</option>
|
||||
<option value="color2">Color 2</option>
|
||||
<option value="color3">Color 3</option>
|
||||
<option value="other" data-default="1">[Other ...]</option>
|
||||
</dropdownoptions></nextbuttontextcolor>
|
||||
<nextbuttontextcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom next button text color (for 'Other ...')" parent="nextbuttontextcolor">#ffffff</nextbuttontextcolorcustom>
|
||||
<submitbuttonbackgroundcolor type="dropdown" category="Buttons" width="4" title="Submit button background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default button color|Default background color|Color 1|Color 2|Color 3|Other ...">color1
|
||||
<dropdownoptions>
|
||||
<option value="default">Default button color</option>
|
||||
<option value="defaultbackgroundcolor">Default background color</option>
|
||||
<option value="color1" data-default="1">[Color 1]</option>
|
||||
<option value="color2">Color 2</option>
|
||||
<option value="color3">Color 3</option>
|
||||
<option value="other">Other ...</option>
|
||||
</dropdownoptions></submitbuttonbackgroundcolor>
|
||||
<submitbuttonbackgroundcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom submit button background color (for 'Other ...')" parent="submitbuttonbackgroundcolor">#ffffff</submitbuttonbackgroundcolorcustom>
|
||||
<submitbuttontextcolor type="dropdown" category="Buttons" width="4" title="Submit button text color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">other
|
||||
<dropdownoptions>
|
||||
<option value="default">Default font color</option>
|
||||
<option value="defaultbackgroundcolor">Default background color</option>
|
||||
<option value="color1">Color 1</option>
|
||||
<option value="color2">Color 2</option>
|
||||
<option value="color3">Color 3</option>
|
||||
<option value="other" data-default="1">[Other ...]</option>
|
||||
</dropdownoptions></submitbuttontextcolor>
|
||||
<submitbuttontextcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom submit button text color (for 'Other ...')" parent="submitbuttontextcolor">#ffffff</submitbuttontextcolorcustom>
|
||||
|
||||
<!-- Colors: no tab in the custom options page yet (Prompt T) — these two stay in core mode only. -->
|
||||
<sliderhandlecolor type="colorpicker" category="Colors" width="12" title="Slider handle color" options="on|off" optionlabels="Yes|No">#5e1c64</sliderhandlecolor>
|
||||
|
|
|
|||
|
|
@ -35,9 +35,10 @@ var ThemeOptions = function () {
|
|||
// row 180 / plan P2: the Questions "title" section keys as well
|
||||
// (questiontitletextcolor, questiontitlebackgroundcolor, questionbackgroundcolor);
|
||||
// row 184 / plan P3: answerstextcolor as well; row 186 / plan P4:
|
||||
// questionhelpbackgroundcolor as well.
|
||||
// questionhelpbackgroundcolor as well; row 191 / plan P6: the six per-button
|
||||
// choosers (previous/next/submit button background + text color).
|
||||
// Must stay in sync with aColorChooserKeys in options/options.twig.
|
||||
var aColorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor', 'questionhelpbackgroundcolor'];
|
||||
var aColorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor', 'questionhelpbackgroundcolor', 'previousbuttonbackgroundcolor', 'previousbuttontextcolor', 'nextbuttonbackgroundcolor', 'nextbuttontextcolor', 'submitbuttonbackgroundcolor', 'submitbuttontextcolor'];
|
||||
// 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".
|
||||
|
|
|
|||
|
|
@ -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.3' %}
|
||||
{% set OPTIONS_JS_TOKEN = '20261129.4' %}
|
||||
{{ unregisterScriptFile(optionsPath ~ '/options.js') }}
|
||||
{{ registerScriptFile(optionsPath ~ '/options.js?v=' ~ OPTIONS_JS_TOKEN, 'POS_END') }}
|
||||
|
||||
|
|
@ -293,7 +293,7 @@
|
|||
row 184 / plan P3: answerstextcolor as well; row 186 / plan P4:
|
||||
questionhelpbackgroundcolor 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', 'questionhelpbackgroundcolor'] %}
|
||||
{% set aColorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor', 'questionhelpbackgroundcolor', 'previousbuttonbackgroundcolor', 'previousbuttontextcolor', 'nextbuttonbackgroundcolor', 'nextbuttontextcolor', 'submitbuttonbackgroundcolor', 'submitbuttontextcolor'] %}
|
||||
|
||||
{% set aShowIfValues = { 'questionborder': 'box|top', 'navbarfontcolor': 'other' } %}
|
||||
{% for el in aFontElements %}{% set aShowIfValues = aShowIfValues|merge({ (el ~ 'textcolor'): 'other' }) %}{% endfor %}
|
||||
|
|
@ -364,6 +364,14 @@
|
|||
{% set aGroupCol1 = ['grouptitlefont', 'grouptitletextcolor', 'grouptitletextcolorcustom', 'grouptitlefontsize', 'grouptitlefontoptions'] %}
|
||||
{% set aGroupCol2 = ['groupdescriptionfont', 'groupdescriptiontextcolor', 'groupdescriptiontextcolorcustom', 'groupdescriptionfontsize', 'groupdescriptionfontoptions'] %}
|
||||
|
||||
{# row 191 / row 178 plan P6: the Buttons pane — a full-width font row at the top
|
||||
(buttonsfont), then ONE row with three col-md-4 columns: col 1 = Previous,
|
||||
col 2 = Next, col 3 = Submit (row-178 decision 1); each column holds that
|
||||
button's background color chooser (+custom) and text color chooser (+custom). #}
|
||||
{% set aButtonsCol1 = ['previousbuttonbackgroundcolor', 'previousbuttonbackgroundcolorcustom', 'previousbuttontextcolor', 'previousbuttontextcolorcustom'] %}
|
||||
{% set aButtonsCol2 = ['nextbuttonbackgroundcolor', 'nextbuttonbackgroundcolorcustom', 'nextbuttontextcolor', 'nextbuttontextcolorcustom'] %}
|
||||
{% set aButtonsCol3 = ['submitbuttonbackgroundcolor', 'submitbuttonbackgroundcolorcustom', 'submitbuttontextcolor', 'submitbuttontextcolorcustom'] %}
|
||||
|
||||
{# Tab list: FIRST the "Default font and colors" tab (where the default/base font
|
||||
and the default colors are chosen), then the "Header" tab
|
||||
tab (keys = aTopOfPageKeys), then row 147: the "Page background" tab (the
|
||||
|
|
@ -514,6 +522,13 @@
|
|||
<p>{{ gT("Questions are the core of a survey. Here you create your own design of how questions are displayed to your respondent.") }}</p>
|
||||
</div></div>
|
||||
{% endif %}
|
||||
{% if tab.category == 'Buttons' %}
|
||||
{# row 191 / plan P6: h2 + intro of the Buttons tab #}
|
||||
<div class="row action_hide_on_inherit buttons-intro"><div class="col-12">
|
||||
<h2>{{ gT("Buttons") }}</h2>
|
||||
<p>{{ gT("The buttons at the bottom of each page of the survey: Previous, Next and Submit. Here you choose the font and the colors of each of them.") }}</p>
|
||||
</div></div>
|
||||
{% endif %}
|
||||
<div class="row action_hide_on_inherit">
|
||||
{% set qLastSlot = '' %}
|
||||
{% set fLastSlot = 0 %}
|
||||
|
|
@ -529,6 +544,7 @@
|
|||
{% set bTopPane = tab.id == 'top-of-page' %}
|
||||
{% set bImagesPane = tab.category == 'Page background' %}
|
||||
{% set bGroupsPane = tab.id == 'groups' %}
|
||||
{% set bButtonsPane = tab.category == 'Buttons' %}
|
||||
{% set fSlot = 'rest' %}
|
||||
{% if bFontsPane %}
|
||||
{# row 174: one row, three col-md-4 columns — col 1 (fc1) =
|
||||
|
|
@ -578,8 +594,16 @@
|
|||
{% if key in aGroupCol1 %}{% set fSlot = 'g1' %}
|
||||
{% elseif key in aGroupCol2 %}{% set fSlot = 'g2' %}
|
||||
{% endif %}
|
||||
{% elseif bButtonsPane %}
|
||||
{# row 191 / plan P6: Buttons pane — bfont = the full-width font
|
||||
row (buttonsfont), b1/b2/b3 = the Previous/Next/Submit columns #}
|
||||
{% if key == 'buttonsfont' %}{% set fSlot = 'bfont' %}
|
||||
{% elseif key in aButtonsCol1 %}{% set fSlot = 'b1' %}
|
||||
{% elseif key in aButtonsCol2 %}{% set fSlot = 'b2' %}
|
||||
{% elseif key in aButtonsCol3 %}{% set fSlot = 'b3' %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if fSlot != fLastSlot and (bFontsPane or bTopPane or bImagesPane or bGroupsPane) %}
|
||||
{% if fSlot != fLastSlot and (bFontsPane or bTopPane or bImagesPane or bGroupsPane or bButtonsPane) %}
|
||||
{% if bFontsPane %}
|
||||
{# row 174: column change inside the single fonts row —
|
||||
close the previous col-md-4, open the next one #}
|
||||
|
|
@ -615,6 +639,16 @@
|
|||
col 2 (border-start); the first g1 key opens col 1 #}
|
||||
{% if fLastSlot == 'g1' %}</div><div class="col-md-6 border-start groups-col-2">{% endif %}
|
||||
{% if fSlot == 'g1' %}<div class="col-md-6 groups-col-1">{% endif %}
|
||||
{% elseif bButtonsPane %}
|
||||
{# row 191 / plan P6: Buttons transitions — bfont -> b1 closes the
|
||||
font row (row+col) and opens the buttons row + col 1 (Previous);
|
||||
b1 -> b2 -> b3 move to the next col-md-4 with a border-start
|
||||
divider (row-178 decision 4 style, like the Groups columns) #}
|
||||
{% if fLastSlot == 'bfont' %}</div></div>{% endif %}
|
||||
{% if fLastSlot == 'b1' %}</div><div class="col-md-4 border-start buttons-col-2 buttons-col-next">{% endif %}
|
||||
{% if fLastSlot == 'b2' %}</div><div class="col-md-4 border-start buttons-col-3 buttons-col-submit">{% endif %}
|
||||
{% if fSlot == 'bfont' %}<div class="row action_hide_on_inherit buttons-font-row"><div class="col-12">{% endif %}
|
||||
{% if fSlot == 'b1' %}<div class="row action_hide_on_inherit buttons-row"><div class="col-md-4 buttons-col-1 buttons-col-prev">{% endif %}
|
||||
{% endif %}
|
||||
{% set fLastSlot = fSlot %}
|
||||
{% endif %}
|
||||
|
|
@ -755,7 +789,7 @@
|
|||
plain grid panes. Without bImagesPane here the wrappers rendered
|
||||
col-12 col-md-<width> INSIDE the col-md-6 slot column, i.e. only
|
||||
the left part of each column was used. #}
|
||||
{% if bQuestionsPane or bTopPane or bGroupsPane or bImagesPane or (bFontsPane and fSlot != 'rest') %}{% set wrapClass = 'col-12' %}{% else %}{% set wrapClass = 'col-12 col-md-' ~ attr.width|default(2) %}{% endif %}
|
||||
{% if bQuestionsPane or bTopPane or bGroupsPane or bImagesPane or bButtonsPane or (bFontsPane and fSlot != 'rest') %}{% set wrapClass = 'col-12' %}{% else %}{% set wrapClass = 'col-12 col-md-' ~ attr.width|default(2) %}{% endif %}
|
||||
{# row 188 / plan P5: inside the "Question border" section's radius
|
||||
subcolumn the four radius options form two rows of two — their
|
||||
wrappers are half the column (col-md-6) instead of col-12 #}
|
||||
|
|
@ -1014,6 +1048,9 @@
|
|||
{# row 157: close the open Groups column (each groups slot opens exactly
|
||||
one div: the col-md-6) #}
|
||||
{% if tab.id == 'groups' and fLastSlot in ['g1', 'g2'] %}</div>{% endif %}
|
||||
{# row 191 / plan P6: close the open Buttons slot (bfont opened row+col-12,
|
||||
b1/b2/b3 opened one col inside the buttons row — both close two divs) #}
|
||||
{% if tab.category == 'Buttons' and fLastSlot in ['bfont', 'b1', 'b2', 'b3'] %}</div></div>{% endif %}
|
||||
{# close an open slot container at the end of a Fonts/Top-of-page pane
|
||||
(every non-logo, non-rest slot has exactly two open divs: row + col) #}
|
||||
{% if (tab.category == 'Default font and colors' or tab.id == 'top-of-page') and fLastSlot != 0 and fLastSlot != 'rest' and fLastSlot != 'logo' %}</div></div>{% endif %}
|
||||
|
|
|
|||
|
|
@ -273,14 +273,15 @@ foreach ($logoPositions as $pos) {
|
|||
// progressbarfontcolor, bodybackgroundcolor, grouptitletextcolor,
|
||||
// groupdescriptiontextcolor; row 180 plan P2 adds questiontitletextcolor,
|
||||
// questiontitlebackgroundcolor, questionbackgroundcolor; row 184 plan P3 adds
|
||||
// answerstextcolor; row 186 plan P4 adds questionhelpbackgroundcolor) became mode
|
||||
// answerstextcolor; row 186 plan P4 adds questionhelpbackgroundcolor; row 191 plan
|
||||
// P6 adds the six per-button choosers) became mode
|
||||
// dropdowns
|
||||
// (default|defaultbackgroundcolor|color1|color2|color3|other) with a <key>custom
|
||||
// colorpicker child. A legacy HEX value in the json means "custom color": map it
|
||||
// to mode "other" and move the hex into the <key>custom child, so the variant
|
||||
// default stays valid for the dropdown. A legacy mode "primary"/"secondary"
|
||||
// (old 4-way textcolor dropdown) maps to "color1"/"color2".
|
||||
$colorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor', 'questionhelpbackgroundcolor'];
|
||||
$colorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor', 'questionhelpbackgroundcolor', 'previousbuttonbackgroundcolor', 'previousbuttontextcolor', 'nextbuttonbackgroundcolor', 'nextbuttontextcolor', 'submitbuttonbackgroundcolor', 'submitbuttontextcolor'];
|
||||
$colorChooserLegacyModes = ['primary' => 'color1', 'secondary' => 'color2'];
|
||||
foreach ($colorChooserKeys as $ck) {
|
||||
if (isset($definition['options'][$ck])
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<version>3.3.0</version>
|
||||
<apiVersion>3</apiVersion>
|
||||
<description><strong>Example variant of Respondage Vanilla</strong><br>Public example of a build output: only a few house-style option values differ, all views, CSS and JS are inherited from the mother theme via extends.</description>
|
||||
<lastUpdate>2026-11-29 14:23:13</lastUpdate>
|
||||
<lastUpdate>2026-11-29 14:39:51</lastUpdate>
|
||||
<extends>vanilla_respondage</extends>
|
||||
</metadata>
|
||||
<compatibility>
|
||||
|
|
@ -409,24 +409,39 @@
|
|||
in custom_header.twig on .question-help-container. -->
|
||||
<!-- Questions -->
|
||||
<checkboxcolor type="colorpicker" category="Questions" width="4" title="Checkbox/radiobutton color (when checked)" options="on|off" optionlabels="Yes|No">#ff005f</checkboxcolor>
|
||||
<!-- Per-element font+color combos (Prompt U; row 178 plan P6 moves the
|
||||
buttons ones into their own tab; the answers ones moved to the
|
||||
"Answer options and subquestions" section above in P3). Each element gets:
|
||||
- <el>font (type "fontselect"): the SAME choices as the base "font"
|
||||
dropdown above (bundled + variant-custom + browser fonts), plus a
|
||||
first option "Same as base font" (value "base" = no extra class, the
|
||||
element inherits the body font). Applied as class font-<value> on the
|
||||
element in the views (nav_bar, progress_bar, question_text_container,
|
||||
answers, help, group_name, group_desc, navigator). Default "base".
|
||||
- <el>textcolor (dropdown): text color mode for that element —
|
||||
default|primary|secondary|other (default "default" = the body font
|
||||
color fontcolor). Resolved to an inline style="color: …" in the views.
|
||||
- <el>textcolorcustom (colorpicker): only visible when <el>textcolor
|
||||
= "other" (parent show-value "other"). -->
|
||||
<buttonsfont type="fontselect" category="Questions" width="12" title="Font for the buttons (Previous/Next/Submit)">base</buttonsfont>
|
||||
<buttonstextcolor type="dropdown" category="Questions" width="12" title="Text color for the buttons (Previous/Next/Submit)" options="default|primary|secondary|other" optionlabels="Default font color|Primary color|Secondary color|Other…">default
|
||||
<dropdownoptions><option value="default" data-default="1">[Default font color]</option><option value="primary">Primary color</option><option value="secondary">Secondary color</option><option value="other">Other…</option></dropdownoptions></buttonstextcolor>
|
||||
<buttonstextcolorcustom type="colorpicker" category="Questions" width="12" title="Custom text color for the buttons (Previous/Next/Submit)" parent="buttonstextcolor">#444444</buttonstextcolorcustom>
|
||||
<!-- Buttons tab (row 178 plan P6): own category directly after Questions,
|
||||
so the options page renders it as a tab directly after the Questions tab.
|
||||
One column per navigator button — col 1 = Previous, col 2 = Next,
|
||||
col 3 = Submit (row-178 decision 1). Each button gets a background color
|
||||
chooser and a text color chooser (6-way mode dropdown + a <key>custom
|
||||
colorpicker child for "other", same scheme as the other color choosers;
|
||||
resolved in custom_header.twig via cmm.cmbg() for backgrounds and
|
||||
cmm.cm() for text colors). Row-178 decision 7 defaults: Next/Submit
|
||||
background = Color 1, text color = Other ... #ffffff; Previous
|
||||
background = Other ... #ffffff, text color = Default font color.
|
||||
The old global buttonstextcolor(+custom) options are REPLACED by these
|
||||
per-button colors and were removed. buttonsfont (the font for all three
|
||||
buttons) is full-width at the top of this tab.
|
||||
NOT house-style (structural). -->
|
||||
<buttonsfont type="fontselect" category="Buttons" width="12" title="Font for the buttons (Previous/Next/Submit)">base</buttonsfont>
|
||||
<previousbuttonbackgroundcolor type="dropdown" category="Buttons" width="4" title="Previous button background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default button color|Default background color|Color 1|Color 2|Color 3|Other ...">other
|
||||
<dropdownoptions><option value="default">Default button color</option><option value="defaultbackgroundcolor">Default background color</option><option value="color1">Color 1</option><option value="color2">Color 2</option><option value="color3">Color 3</option><option value="other" data-default="1">[Other ...]</option></dropdownoptions></previousbuttonbackgroundcolor>
|
||||
<previousbuttonbackgroundcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom previous button background color (for 'Other ...')" parent="previousbuttonbackgroundcolor">#ffffff</previousbuttonbackgroundcolorcustom>
|
||||
<previousbuttontextcolor type="dropdown" category="Buttons" width="4" title="Previous button text color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">default
|
||||
<dropdownoptions><option value="default" data-default="1">[Default font color]</option><option value="defaultbackgroundcolor">Default background color</option><option value="color1">Color 1</option><option value="color2">Color 2</option><option value="color3">Color 3</option><option value="other">Other ...</option></dropdownoptions></previousbuttontextcolor>
|
||||
<previousbuttontextcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom previous button text color (for 'Other ...')" parent="previousbuttontextcolor">#444444</previousbuttontextcolorcustom>
|
||||
<nextbuttonbackgroundcolor type="dropdown" category="Buttons" width="4" title="Next button background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default button color|Default background color|Color 1|Color 2|Color 3|Other ...">color1
|
||||
<dropdownoptions><option value="default">Default button color</option><option value="defaultbackgroundcolor">Default background color</option><option value="color1" data-default="1">[Color 1]</option><option value="color2">Color 2</option><option value="color3">Color 3</option><option value="other">Other ...</option></dropdownoptions></nextbuttonbackgroundcolor>
|
||||
<nextbuttonbackgroundcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom next button background color (for 'Other ...')" parent="nextbuttonbackgroundcolor">#ffffff</nextbuttonbackgroundcolorcustom>
|
||||
<nextbuttontextcolor type="dropdown" category="Buttons" width="4" title="Next button text color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">other
|
||||
<dropdownoptions><option value="default">Default font color</option><option value="defaultbackgroundcolor">Default background color</option><option value="color1">Color 1</option><option value="color2">Color 2</option><option value="color3">Color 3</option><option value="other" data-default="1">[Other ...]</option></dropdownoptions></nextbuttontextcolor>
|
||||
<nextbuttontextcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom next button text color (for 'Other ...')" parent="nextbuttontextcolor">#ffffff</nextbuttontextcolorcustom>
|
||||
<submitbuttonbackgroundcolor type="dropdown" category="Buttons" width="4" title="Submit button background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default button color|Default background color|Color 1|Color 2|Color 3|Other ...">color1
|
||||
<dropdownoptions><option value="default">Default button color</option><option value="defaultbackgroundcolor">Default background color</option><option value="color1" data-default="1">[Color 1]</option><option value="color2">Color 2</option><option value="color3">Color 3</option><option value="other">Other ...</option></dropdownoptions></submitbuttonbackgroundcolor>
|
||||
<submitbuttonbackgroundcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom submit button background color (for 'Other ...')" parent="submitbuttonbackgroundcolor">#ffffff</submitbuttonbackgroundcolorcustom>
|
||||
<submitbuttontextcolor type="dropdown" category="Buttons" width="4" title="Submit button text color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">other
|
||||
<dropdownoptions><option value="default">Default font color</option><option value="defaultbackgroundcolor">Default background color</option><option value="color1">Color 1</option><option value="color2">Color 2</option><option value="color3">Color 3</option><option value="other" data-default="1">[Other ...]</option></dropdownoptions></submitbuttontextcolor>
|
||||
<submitbuttontextcolorcustom type="colorpicker" category="Buttons" width="4" title="Custom submit button text color (for 'Other ...')" parent="submitbuttontextcolor">#ffffff</submitbuttontextcolorcustom>
|
||||
<!-- Colors: no tab in the custom options page yet (Prompt T) — these two stay in core mode only. -->
|
||||
<sliderhandlecolor type="colorpicker" category="Colors" width="12" title="Slider handle color" options="on|off" optionlabels="Yes|No">#5e1c64</sliderhandlecolor>
|
||||
<privacybackgroundcolor type="colorpicker" category="Colors" width="12" title="Privacy background color" options="on|off" optionlabels="Yes|No">lightyellow</privacybackgroundcolor>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,14 @@
|
|||
{%- set m = mode|default('') -%}
|
||||
{{- m matches '/^#[0-9a-fA-F]{3,8}$/' ? m : (m == 'color1' or m == 'primary' ? opts.primarycolor|default('') : (m == 'color2' or m == 'secondary' ? opts.secondarycolor|default('') : (m == 'color3' ? opts.tertiarycolor|default('') : (m == 'defaultbackgroundcolor' ? opts.defaultbackgroundcolor|default('') : (m == 'other' ? custom|default('') : opts.fontcolor|default('')))))) -}}
|
||||
{%- endmacro %}
|
||||
{# Row 191 / row 178 plan P6: like cm(), but for BACKGROUND choosers — mode
|
||||
"default" means "no override" (empty string), so the Bootstrap button default
|
||||
(btn-primary / btn-outline-secondary) stays; all other modes resolve the same
|
||||
way as cm(). Used for the per-button background colors of the navigator. #}
|
||||
{% macro cmbg(mode, custom, opts) -%}
|
||||
{%- set m = mode|default('') -%}
|
||||
{{- m matches '/^#[0-9a-fA-F]{3,8}$/' ? m : (m == 'color1' or m == 'primary' ? opts.primarycolor|default('') : (m == 'color2' or m == 'secondary' ? opts.secondarycolor|default('') : (m == 'color3' ? opts.tertiarycolor|default('') : (m == 'defaultbackgroundcolor' ? opts.defaultbackgroundcolor|default('') : (m == 'other' ? custom|default('') : ''))))) -}}
|
||||
{%- endmacro %}
|
||||
{% import _self as cmm %}
|
||||
|
||||
<style>
|
||||
|
|
@ -330,6 +338,41 @@
|
|||
background: {{ aSurveyInfo.options.primarycolor }};
|
||||
}
|
||||
|
||||
{# Row 191 / row 178 plan P6: per-button colors for the navigator buttons
|
||||
(classes respondage-btn-prev/-next/-submit from navigator.twig).
|
||||
Backgrounds resolve via cmbg() (mode "default" = no rule = Bootstrap
|
||||
default button background), text colors via cm() (mode "default" = the
|
||||
default font color). Row-178 decision 7 defaults: Next/Submit background =
|
||||
Color 1, text = Other ... #ffffff; Previous background = Other ... #ffffff,
|
||||
text = Default font color. Legacy stored hex values pass through both
|
||||
macros. The :hover/:focus/:active variants keep the same specificity as
|
||||
Bootstrap's .btn-primary:hover rules above and win because this style
|
||||
block is emitted later. #}
|
||||
{% set sPrevBtnBg = cmm.cmbg(aSurveyInfo.options.previousbuttonbackgroundcolor|default('other'), aSurveyInfo.options.previousbuttonbackgroundcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
|
||||
{% set sPrevBtnColor = cmm.cm(aSurveyInfo.options.previousbuttontextcolor|default('default'), aSurveyInfo.options.previousbuttontextcolorcustom|default(''), aSurveyInfo.options) %}
|
||||
{% set sNextBtnBg = cmm.cmbg(aSurveyInfo.options.nextbuttonbackgroundcolor|default('color1'), aSurveyInfo.options.nextbuttonbackgroundcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
|
||||
{% set sNextBtnColor = cmm.cm(aSurveyInfo.options.nextbuttontextcolor|default('other'), aSurveyInfo.options.nextbuttontextcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
|
||||
{% set sSubmitBtnBg = cmm.cmbg(aSurveyInfo.options.submitbuttonbackgroundcolor|default('color1'), aSurveyInfo.options.submitbuttonbackgroundcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
|
||||
{% set sSubmitBtnColor = cmm.cm(aSurveyInfo.options.submitbuttontextcolor|default('other'), aSurveyInfo.options.submitbuttontextcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
|
||||
{% if sPrevBtnBg != '' or sPrevBtnColor != '' %}
|
||||
.respondage-btn-prev, .respondage-btn-prev:hover, .respondage-btn-prev:focus, .respondage-btn-prev:active {
|
||||
{% if sPrevBtnBg != '' %}background: {{ sPrevBtnBg }}; border-color: {{ sPrevBtnBg }};{% endif %}
|
||||
{% if sPrevBtnColor != '' %}color: {{ sPrevBtnColor }};{% endif %}
|
||||
}
|
||||
{% endif %}
|
||||
{% if sNextBtnBg != '' or sNextBtnColor != '' %}
|
||||
.respondage-btn-next, .respondage-btn-next:hover, .respondage-btn-next:focus, .respondage-btn-next:active {
|
||||
{% if sNextBtnBg != '' %}background: {{ sNextBtnBg }}; border-color: {{ sNextBtnBg }};{% endif %}
|
||||
{% if sNextBtnColor != '' %}color: {{ sNextBtnColor }};{% endif %}
|
||||
}
|
||||
{% endif %}
|
||||
{% if sSubmitBtnBg != '' or sSubmitBtnColor != '' %}
|
||||
.respondage-btn-submit, .respondage-btn-submit:hover, .respondage-btn-submit:focus, .respondage-btn-submit:active {
|
||||
{% if sSubmitBtnBg != '' %}background: {{ sSubmitBtnBg }}; border-color: {{ sSubmitBtnBg }};{% endif %}
|
||||
{% if sSubmitBtnColor != '' %}color: {{ sSubmitBtnColor }};{% endif %}
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% set checkicon = '"\\' ~ aSurveyInfo.options.checkicon ~ '"' %}
|
||||
.checkbox-item input[type="checkbox"]:checked + label::after, .checkbox-item input[type="radio"]:checked + label::after {
|
||||
content: {{ checkicon }};
|
||||
|
|
|
|||
|
|
@ -26,14 +26,14 @@
|
|||
option "buttonsfont", type fontselect. The class goes on the navigator container,
|
||||
the buttons inherit it. "base" = same as the base font: no extra class. #}
|
||||
{% set sButtonsFont = aSurveyInfo.options.buttonsfont|default('base') %}
|
||||
{# Prompt U: per-element text color — mode default -> fontcolor, primary ->
|
||||
primarycolor, secondary -> secondarycolor, other -> buttonstextcolorcustom.
|
||||
Emitted as an inline style on the element below. #}
|
||||
{% set sButtonsTextColorMode = aSurveyInfo.options.buttonstextcolor|default('default') %}
|
||||
{% set sButtonsTextColor = sButtonsTextColorMode == 'primary' ? aSurveyInfo.options.primarycolor|default('') : (sButtonsTextColorMode == 'secondary' ? aSurveyInfo.options.secondarycolor|default('') : (sButtonsTextColorMode == 'other' ? aSurveyInfo.options.buttonstextcolorcustom|default('') : aSurveyInfo.options.fontcolor|default(''))) %}
|
||||
{# Row 191 / row 178 plan P6: per-button colors. Each button gets a theme class
|
||||
(respondage-btn-prev / -next / -submit); custom_header.twig emits the per-button
|
||||
background/text color rules for these classes from the previousbutton*/nextbutton*/
|
||||
submitbutton* chooser options. The old global buttonstextcolor inline style on the
|
||||
container is gone. #}
|
||||
|
||||
<!-- PRESENT THE NAVIGATOR -->
|
||||
<div class="{{ aSurveyInfo.class.navigatorcontainer }} row navigator space-col {% if sButtonsFont != 'base' %}font-{{ sButtonsFont }}{% endif %}" {% if sButtonsTextColor != '' %}style="color: {{ sButtonsTextColor }};"{% endif %} id="{{ aSurveyInfo.id.navigatorcontainer }}" {{ aSurveyInfo.attr.navigatorcontainer }}>
|
||||
<div class="{{ aSurveyInfo.class.navigatorcontainer }} row navigator space-col {% if sButtonsFont != 'base' %}font-{{ sButtonsFont }}{% endif %}" id="{{ aSurveyInfo.id.navigatorcontainer }}" {{ aSurveyInfo.attr.navigatorcontainer }}>
|
||||
|
||||
<!-- Previous button container -->
|
||||
<div class="{{ aSurveyInfo.class.navigatorbuttonl }} col-6 text-start" {{ aSurveyInfo.attr.navigatorbuttonl }}>
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
{# Previous button must be set to ON in survey settings (and it's not shown in first page, in All in One survey mode, etc) #}
|
||||
{% if (not aSurveyInfo.popupPreview) and aNavigator.aMovePrev.show %}
|
||||
<!-- Button previous -->
|
||||
<button {{ aSurveyInfo.attr.navigatorbuttonprev }} accesskey="p" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonprev }} btn btn-lg btn-outline-secondary " >
|
||||
<button {{ aSurveyInfo.attr.navigatorbuttonprev }} accesskey="p" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonprev }} btn btn-lg btn-outline-secondary respondage-btn-prev" >
|
||||
{{ gT("Previous") }}
|
||||
</button>
|
||||
{% endif %}
|
||||
|
|
@ -54,12 +54,12 @@
|
|||
{# On last page, Next button become submit button. #}
|
||||
{% if aNavigator.aMoveNext.value == "movesubmit" %}
|
||||
<!-- Button submit -->
|
||||
<button {{ aSurveyInfo.attr.navigatorbuttonsubmit }} accesskey="n" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonsubmit }} btn btn-lg btn-primary">
|
||||
<button {{ aSurveyInfo.attr.navigatorbuttonsubmit }} accesskey="n" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonsubmit }} btn btn-lg btn-primary respondage-btn-submit">
|
||||
{{ gT("Submit") }}
|
||||
</button>
|
||||
{% else %}
|
||||
<!-- Button Next -->
|
||||
<button {{ aSurveyInfo.attr.navigatorbuttonnext }} accesskey="n" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonnext }} btn btn-lg btn-primary " >
|
||||
<button {{ aSurveyInfo.attr.navigatorbuttonnext }} accesskey="n" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonnext }} btn btn-lg btn-primary respondage-btn-next" >
|
||||
{{ gT("Next") }}
|
||||
</button>
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue