feat(options): 'Default background color' as 4th column of the colors row + 5th swatch preset

New colorpicker option defaultbackgroundcolor (category Fonts, default
#ffffff), rendered as column 1 of the second row of the 'Default fonts and
colors' tab — that colors row is now 4 columns (col-md-3 each; the top row
stays 3 x col-md-4). The experimental color chooser (navbarfontcolor dropdown
+ swatch chips) gains this color as a 5th preset: dropdown option
'defaultbackgroundcolor', 5 swatch chips with live hex labels, presets map in
options.js extended, and custom_header.twig maps the mode to the option value.
OPTIONS_JS_TOKEN -> 20261126.6. Verified: render tc=558 (colors row =
defaultbackgroundcolor|primarycolor|secondarycolor|tertiarycolor in 4 col-md-3,
top row unchanged, divs balanced, dropdown has 6 options), jsdom suite 6/6
(5 chips pinned), live survey 282267 with mode defaultbackgroundcolor ->
#aabbcc (DB row restored), export 0. Variants not rebuilt (deferred).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-26 14:57:25 +01:00
commit 12ec2820da

View file

@ -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);
});
};