diff --git a/config.xml b/config.xml index a4b4bff..d2b87e6 100644 --- a/config.xml +++ b/config.xml @@ -216,12 +216,13 @@ navbarfontcolorcustom is rendered VISIBLE but grayed out (disabled) unless mode "other" (data-show-if-mode="disable" in options.twig) and keeps its value across saves (data-keep-value in options.js). --> - default + default + #444444 @@ -308,6 +309,11 @@ secondarycolor are set per variant via variants/.json. --> #444444 16px + + #ffffff #5e1c64 #888888 #dddddd diff --git a/options/options.js b/options/options.js index d444bac..70b9cdf 100644 --- a/options/options.js +++ b/options/options.js @@ -749,7 +749,8 @@ var ThemeOptions = function () { var navbarColorModeUI = function () { var sel = globalForm.find('select[name="navbarfontcolor"]'); if (!sel.length) { return; } - var presets = { 'default': 'fontcolor', 'color1': 'primarycolor', 'color2': 'secondarycolor', 'color3': 'tertiarycolor' }; + // row 124: 5 presets — the 4th named color is now the "Default background color" + var presets = { 'default': 'fontcolor', 'color1': 'primarycolor', 'color2': 'secondarycolor', 'color3': 'tertiarycolor', 'defaultbackgroundcolor': 'defaultbackgroundcolor' }; var customInput = globalForm.find('input[name="navbarfontcolorcustom"]'); var currentColor = function (key) { var f = globalForm.find('#simple_edit_options_' + key); @@ -849,7 +850,7 @@ var ThemeOptions = function () { // so the active outline still moves on the chosen swatch (row 122). $(document).on('change', 'select[name="navbarfontcolor"]', refreshAll); if (customInput.length) { customInput.on('input change', refreshAll); } - $.each(['fontcolor', 'primarycolor', 'secondarycolor', 'tertiarycolor'], function (i, key) { + $.each(['fontcolor', 'primarycolor', 'secondarycolor', 'tertiarycolor', 'defaultbackgroundcolor'], function (i, key) { globalForm.find('#simple_edit_options_' + key).on('input change', refreshAll); }); }; diff --git a/options/options.twig b/options/options.twig index ec201db..fbeedc8 100644 --- a/options/options.twig +++ b/options/options.twig @@ -43,7 +43,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 = '20261126.5' %} +{% set OPTIONS_JS_TOKEN = '20261126.6' %} {{ unregisterScriptFile(optionsPath ~ '/options.js') }} {{ registerScriptFile(optionsPath ~ '/options.js?v=' ~ OPTIONS_JS_TOKEN, 'POS_END') }} @@ -336,6 +336,7 @@ {% if key == 'font' %}{% set fSlot = 'f1' %} {% elseif key == 'fontcolor' %}{% set fSlot = 'f2' %} {% elseif key == 'fontsize' %}{% set fSlot = 'f3' %} + {% elseif key == 'defaultbackgroundcolor' %}{% set fSlot = 'c0' %} {% elseif key == 'primarycolor' %}{% set fSlot = 'c1' %} {% elseif key == 'secondarycolor' %}{% set fSlot = 'c2' %} {% elseif key == 'tertiarycolor' %}{% set fSlot = 'c3' %} @@ -356,8 +357,9 @@ {% endif %} {% if fSlot != fLastSlot and (bFontsPane or bTopPane) %} {% if bFontsPane %} - {% if fLastSlot == 'f3' %}

{{ gT("Default colors") }}

{{ gT("The default colors are your most used colors.") }}

- {% elseif fLastSlot == 'f1' or fLastSlot == 'f2' or fLastSlot == 'c1' or fLastSlot == 'c2' %}
+ {% if fLastSlot == 'f3' %}

{{ gT("Default colors") }}

{{ gT("The default colors are your most used colors.") }}

+ {% elseif fLastSlot == 'f1' or fLastSlot == 'f2' %}
+ {% elseif fLastSlot == 'c0' or fLastSlot == 'c1' or fLastSlot == 'c2' %}
{% endif %} {% if fSlot == 'f1' %}
{% endif %} diff --git a/views/subviews/header/custom_header.twig b/views/subviews/header/custom_header.twig index 4c831eb..8b29122 100644 --- a/views/subviews/header/custom_header.twig +++ b/views/subviews/header/custom_header.twig @@ -185,7 +185,7 @@ other -> navbarfontcolorcustom. A raw hex value (legacy stored value from before the dropdown existed, or a hand-set one) is used directly. #} {% set sNavbarFontColorMode = aSurveyInfo.options.navbarfontcolor|default('default') %} - {% set sNavbarFontColor = sNavbarFontColorMode matches '/^#[0-9a-fA-F]{3,8}$/' ? sNavbarFontColorMode : (sNavbarFontColorMode == 'color1' ? aSurveyInfo.options.primarycolor|default('') : (sNavbarFontColorMode == 'color2' ? aSurveyInfo.options.secondarycolor|default('') : (sNavbarFontColorMode == 'color3' ? aSurveyInfo.options.tertiarycolor|default('') : (sNavbarFontColorMode == 'other' ? aSurveyInfo.options.navbarfontcolorcustom|default('') : aSurveyInfo.options.fontcolor|default(''))))) %} + {% set sNavbarFontColor = sNavbarFontColorMode matches '/^#[0-9a-fA-F]{3,8}$/' ? sNavbarFontColorMode : (sNavbarFontColorMode == 'color1' ? aSurveyInfo.options.primarycolor|default('') : (sNavbarFontColorMode == 'color2' ? aSurveyInfo.options.secondarycolor|default('') : (sNavbarFontColorMode == 'color3' ? aSurveyInfo.options.tertiarycolor|default('') : (sNavbarFontColorMode == 'defaultbackgroundcolor' ? aSurveyInfo.options.defaultbackgroundcolor|default('') : (sNavbarFontColorMode == 'other' ? aSurveyInfo.options.navbarfontcolorcustom|default('') : aSurveyInfo.options.fontcolor|default('')))))) %} #survey-nav .navbar-nav > li > a, #survey-nav .navbar-nav .nav-link { color: {{ sNavbarFontColor }};