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:
parent
8a6cf1f919
commit
12ec2820da
2 changed files with 16 additions and 7 deletions
|
|
@ -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);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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' %}</div></div><div class="row action_hide_on_inherit"><div class="col-12"><hr class="fonts-hr"></div></div><div class="row action_hide_on_inherit fonts-section-intro"><div class="col-12"><h2>{{ gT("Default colors") }}</h2><p>{{ gT("The default colors are your most used colors.") }}</p></div></div><div class="row action_hide_on_inherit fonts-colors-row"><div class="col-md-4">
|
||||
{% elseif fLastSlot == 'f1' or fLastSlot == 'f2' or fLastSlot == 'c1' or fLastSlot == 'c2' %}</div><div class="col-md-4">
|
||||
{% if fLastSlot == 'f3' %}</div></div><div class="row action_hide_on_inherit"><div class="col-12"><hr class="fonts-hr"></div></div><div class="row action_hide_on_inherit fonts-section-intro"><div class="col-12"><h2>{{ gT("Default colors") }}</h2><p>{{ gT("The default colors are your most used colors.") }}</p></div></div><div class="row action_hide_on_inherit fonts-colors-row"><div class="col-md-3">
|
||||
{% elseif fLastSlot == 'f1' or fLastSlot == 'f2' %}</div><div class="col-md-4">
|
||||
{% elseif fLastSlot == 'c0' or fLastSlot == 'c1' or fLastSlot == 'c2' %}</div><div class="col-md-3">
|
||||
{% endif %}
|
||||
{% if fSlot == 'f1' %}<div class="row action_hide_on_inherit fonts-top-row"><div class="col-md-4">
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue