diff --git a/config.xml b/config.xml index de5d6bc..a35e1e1 100644 --- a/config.xml +++ b/config.xml @@ -456,18 +456,38 @@ #ffffff + + base + default + + + + + + + + + #444444 - base - default - - - - - - - #444444 base default diff --git a/options/options.js b/options/options.js index a3d17f6..544c7bd 100644 --- a/options/options.js +++ b/options/options.js @@ -33,9 +33,10 @@ var ThemeOptions = function () { // class selector_color_mode + swatch chips + a 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". diff --git a/options/options.twig b/options/options.twig index 1c4af98..a0949da 100644 --- a/options/options.twig +++ b/options/options.twig @@ -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 diff --git a/variants/build.php b/variants/build.php index 5e01b7d..085dd77 100644 --- a/variants/build.php +++ b/variants/build.php @@ -272,13 +272,14 @@ foreach ($logoPositions as $pos) { // headerbackgroundcolor, progressbarcolor, progressbarbackgroundcolor, // progressbarfontcolor, bodybackgroundcolor, grouptitletextcolor, // groupdescriptiontextcolor; row 180 plan P2 adds questiontitletextcolor, -// questiontitlebackgroundcolor, questionbackgroundcolor) became mode dropdowns +// questiontitlebackgroundcolor, questionbackgroundcolor; row 184 plan P3 adds +// answerstextcolor) became mode dropdowns // (default|defaultbackgroundcolor|color1|color2|color3|other) with a custom // colorpicker child. A legacy HEX value in the json means "custom color": map it // to mode "other" and move the hex into the 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']; +$colorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor']; $colorChooserLegacyModes = ['primary' => 'color1', 'secondary' => 'color2']; foreach ($colorChooserKeys as $ck) { if (isset($definition['options'][$ck]) diff --git a/variants/example/respondage_respondage/config.xml b/variants/example/respondage_respondage/config.xml index 159a785..9acee01 100644 --- a/variants/example/respondage_respondage/config.xml +++ b/variants/example/respondage_respondage/config.xml @@ -31,7 +31,7 @@ 3.3.0 3 <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. - 2026-11-29 13:59:51 + 2026-11-29 14:06:42 vanilla_respondage @@ -343,18 +343,31 @@ defaultbackgroundcolor #ffffff + + base + default + + #444444 - base - default - - #444444 base default diff --git a/views/subviews/survey/question_subviews/answers.twig b/views/subviews/survey/question_subviews/answers.twig index 3d31748..5c938e8 100644 --- a/views/subviews/survey/question_subviews/answers.twig +++ b/views/subviews/survey/question_subviews/answers.twig @@ -26,7 +26,9 @@ primarycolor, secondary -> secondarycolor, other -> answerstextcolorcustom. Emitted as an inline style on the element below. #} {% set sAnswersTextColorMode = aSurveyInfo.options.answerstextcolor|default('default') %} -{% set sAnswersTextColor = sAnswersTextColorMode == 'primary' ? aSurveyInfo.options.primarycolor|default('') : (sAnswersTextColorMode == 'secondary' ? aSurveyInfo.options.secondarycolor|default('') : (sAnswersTextColorMode == 'other' ? aSurveyInfo.options.answerstextcolorcustom|default('') : aSurveyInfo.options.fontcolor|default(''))) %} +{# row 184 / plan P3: 6-way color-chooser scheme (default|defaultbackgroundcolor|color1|color2|color3|other) + legacy modes primary/secondary and raw hex passthrough #} +{% set oA = aSurveyInfo.options %} +{% set sAnswersTextColor = sAnswersTextColorMode matches '/^#[0-9a-fA-F]{3,8}$/' ? sAnswersTextColorMode : (sAnswersTextColorMode == 'color1' or sAnswersTextColorMode == 'primary' ? oA.primarycolor|default('') : (sAnswersTextColorMode == 'color2' or sAnswersTextColorMode == 'secondary' ? oA.secondarycolor|default('') : (sAnswersTextColorMode == 'color3' ? oA.tertiarycolor|default('') : (sAnswersTextColorMode == 'defaultbackgroundcolor' ? oA.defaultbackgroundcolor|default('') : (sAnswersTextColorMode == 'other' ? oA.answerstextcolorcustom|default('') : oA.fontcolor|default('')))))) %}
diff --git a/views/subviews/survey/question_subviews/survey_question_help.twig b/views/subviews/survey/question_subviews/survey_question_help.twig index 8dc7e71..5bbdeaa 100644 --- a/views/subviews/survey/question_subviews/survey_question_help.twig +++ b/views/subviews/survey/question_subviews/survey_question_help.twig @@ -24,7 +24,9 @@ primarycolor, secondary -> secondarycolor, other -> answerstextcolorcustom. Emitted as an inline style on the element below. #} {% set sAnswersTextColorMode = aSurveyInfo.options.answerstextcolor|default('default') %} -{% set sAnswersTextColor = sAnswersTextColorMode == 'primary' ? aSurveyInfo.options.primarycolor|default('') : (sAnswersTextColorMode == 'secondary' ? aSurveyInfo.options.secondarycolor|default('') : (sAnswersTextColorMode == 'other' ? aSurveyInfo.options.answerstextcolorcustom|default('') : aSurveyInfo.options.fontcolor|default(''))) %} +{# row 184 / plan P3: 6-way color-chooser scheme (default|defaultbackgroundcolor|color1|color2|color3|other) + legacy modes primary/secondary and raw hex passthrough #} +{% set oA = aSurveyInfo.options %} +{% set sAnswersTextColor = sAnswersTextColorMode matches '/^#[0-9a-fA-F]{3,8}$/' ? sAnswersTextColorMode : (sAnswersTextColorMode == 'color1' or sAnswersTextColorMode == 'primary' ? oA.primarycolor|default('') : (sAnswersTextColorMode == 'color2' or sAnswersTextColorMode == 'secondary' ? oA.secondarycolor|default('') : (sAnswersTextColorMode == 'color3' ? oA.tertiarycolor|default('') : (sAnswersTextColorMode == 'defaultbackgroundcolor' ? oA.defaultbackgroundcolor|default('') : (sAnswersTextColorMode == 'other' ? oA.answerstextcolorcustom|default('') : oA.fontcolor|default('')))))) %}
diff --git a/views/subviews/survey/question_subviews/valid_message_and_help.twig b/views/subviews/survey/question_subviews/valid_message_and_help.twig index e7c2f21..ffc7d91 100644 --- a/views/subviews/survey/question_subviews/valid_message_and_help.twig +++ b/views/subviews/survey/question_subviews/valid_message_and_help.twig @@ -27,7 +27,9 @@ primarycolor, secondary -> secondarycolor, other -> answerstextcolorcustom. Emitted as an inline style on the element below. #} {% set sAnswersTextColorMode = aSurveyInfo.options.answerstextcolor|default('default') %} -{% set sAnswersTextColor = sAnswersTextColorMode == 'primary' ? aSurveyInfo.options.primarycolor|default('') : (sAnswersTextColorMode == 'secondary' ? aSurveyInfo.options.secondarycolor|default('') : (sAnswersTextColorMode == 'other' ? aSurveyInfo.options.answerstextcolorcustom|default('') : aSurveyInfo.options.fontcolor|default(''))) %} +{# row 184 / plan P3: 6-way color-chooser scheme (default|defaultbackgroundcolor|color1|color2|color3|other) + legacy modes primary/secondary and raw hex passthrough #} +{% set oA = aSurveyInfo.options %} +{% set sAnswersTextColor = sAnswersTextColorMode matches '/^#[0-9a-fA-F]{3,8}$/' ? sAnswersTextColorMode : (sAnswersTextColorMode == 'color1' or sAnswersTextColorMode == 'primary' ? oA.primarycolor|default('') : (sAnswersTextColorMode == 'color2' or sAnswersTextColorMode == 'secondary' ? oA.secondarycolor|default('') : (sAnswersTextColorMode == 'color3' ? oA.tertiarycolor|default('') : (sAnswersTextColorMode == 'defaultbackgroundcolor' ? oA.defaultbackgroundcolor|default('') : (sAnswersTextColorMode == 'other' ? oA.answerstextcolorcustom|default('') : oA.fontcolor|default('')))))) %}