diff --git a/config.xml b/config.xml
index df34454..a1a876c 100644
--- a/config.xml
+++ b/config.xml
@@ -218,20 +218,22 @@
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).
- PER-OPTION DEFAULT (row 125/126): every color-chooser dropdown can pick its
- own default value — the element text below IS that default (LimeSurvey
+ PER-OPTION DEFAULT (row 125/126/134): every color-chooser dropdown can pick
+ its own default value — the element text below IS that default (LimeSurvey
stores it in the DB on theme reset), and the
- marks it so the options page can show it in BOLD (options.twig CSS +
- options.js swatch label). Here the default is "default" ("Default font
- color"); e.g. when questiontitlebackgroundcolor is later converted to
- this pattern, its default can be set to "color1".
+ marks it. The default entry is enclosed in [ ] in the dropdown list
+ (bolding text is not rendered by every browser — row 134), and
+ its swatch label below the swatch stays bold (options.js is-default).
+ Here the default is "default" ("Default font color"); e.g. when
+ questiontitlebackgroundcolor is later converted to this pattern, its
+ default can be set to "color1".
ROW 131: the option TEXTS are exactly "Default font color",
"Default background color", "Color 1", "Color 2", "Color 3",
"Other ..." — options.js appends each entry's live hexcode in brackets
(for "Other ..." the custom color's hex) and bolds the default. -->
default
- Default font color
+ [Default font color]
Default background color
Color 1
Color 2
@@ -347,7 +349,7 @@
base
default
- Default font color
+ [Default font color]
Primary color
Secondary color
Other…
@@ -356,7 +358,7 @@
base
default
- Default font color
+ [Default font color]
Primary color
Secondary color
Other…
@@ -365,7 +367,7 @@
base
default
- Default font color
+ [Default font color]
Primary color
Secondary color
Other…
@@ -374,7 +376,7 @@
base
default
- Default font color
+ [Default font color]
Primary color
Secondary color
Other…
@@ -383,7 +385,7 @@
base
default
- Default font color
+ [Default font color]
Primary color
Secondary color
Other…
diff --git a/options/options.js b/options/options.js
index 479ee3d..8052ecb 100644
--- a/options/options.js
+++ b/options/options.js
@@ -754,12 +754,12 @@ var ThemeOptions = function () {
// "Default background color" is the SECOND choice, right after "Same as
// default font color".
var presets = { 'default': 'fontcolor', 'defaultbackgroundcolor': 'defaultbackgroundcolor', 'color1': 'primarycolor', 'color2': 'secondarycolor', 'color3': 'tertiarycolor' };
- // row 126/132: the option's DEFAULT choice — the config.xml
- // (same value as the element text). Shown bold via every mechanism
- // available, because browsers differ: CSS on the option + a real + inline
- // style (row 132) for the popup, :has() rule for the CLOSED select box, and the
- // is-default class on the swatch label. Fallback when the marker is missing:
- // the inherited value, else the first non-"inherit" entry.
+ // row 126/134: the option's DEFAULT choice — the config.xml
+ // (same value as the element text). In the dropdown LIST it is
+ // enclosed in [ ] (bolding is not rendered by every browser — row 134);
+ // the swatch label below the swatch stays bold via the is-default class.
+ // Fallback when the marker is missing: the inherited value, else the first
+ // non-"inherit" entry.
var defaultMode = String(sel.find('option[data-default="1"]').first().attr('value')
|| sel.data('inheritvalue')
|| sel.find('option').not('[value="inherit"]').first().attr('value')
@@ -781,30 +781,24 @@ var ThemeOptions = function () {
sel.find('option').each(function () {
var op = $(this);
var mode = String(op.attr('value'));
- if (op.attr('data-default')) {
- // row 132: inline style as well — some browsers only honour the
- // inline style on , not the stylesheet rule
- op.css('font-weight', '700');
+ if (!op.data('base-label')) {
+ // strip the [ ] default marker from config.xml so re-wrapping stays idempotent
+ op.data('base-label', op.text().replace(/^\s*\[(.*)\]\s*$/, '$1'));
}
- if (!op.data('base-label')) { op.data('base-label', op.text()); }
var base = String(op.data('base-label'));
var pk = presets[mode];
// row 131: every entry shows its chosen hexcode — the preset colors
// from their option fields, "Other ..." from the custom picker's value
var c = pk ? currentColor(pk)
: (mode === 'other' && customInput.length && /^#[0-9a-fA-F]{3,8}$/.test(String(customInput.val() || '')) ? String(customInput.val()) : '');
+ // row 134: the DEFAULT choice is enclosed in [ ] in the dropdown list —
+ // bolding text is not rendered by every browser, so brackets
+ // are the marker in the list (the swatch label below the swatch stays bold)
+ var name = op.attr('data-default') ? '[' + base + ']' : base;
if (pk || mode === 'other') {
- var label = c ? base + ' [' + c + ']' : base;
- if (op.attr('data-default')) {
- // row 129: the DEFAULT choice is bold — via a real element
- // (not every browser applies font-weight CSS to ),
- // on top of the select option[data-default="1"] CSS rule
- op.empty().append($('').text(label));
- } else {
- op.text(label);
- }
+ op.text(c ? name + ' [' + c + ']' : name);
} else if (op.attr('data-default')) {
- op.empty().append($('').text(base));
+ op.text(name);
}
});
};
diff --git a/options/options.twig b/options/options.twig
index 7805f60..cbbfcea 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.12' %}
+{% set OPTIONS_JS_TOKEN = '20261126.13' %}
{{ unregisterScriptFile(optionsPath ~ '/options.js') }}
{{ registerScriptFile(optionsPath ~ '/options.js?v=' ~ OPTIONS_JS_TOKEN, 'POS_END') }}
@@ -154,18 +154,11 @@
overflow: hidden;
text-overflow: ellipsis;
}
- /* row 126: the DEFAULT choice of a color-chooser option (the config.xml
- ) is shown in bold — in the dropdown (CSS below)
- and on its swatch label (is-default class set by options.js) */
- select option[data-default="1"] {
- font-weight: 700;
- }
- /* row 132: also bold the CLOSED select box when the default choice is the
- selected one (the popup alone is not enough — some browsers ignore option
- styling in the closed box) */
- .action_update_options_string_form select:has(option[data-default="1"]:checked) {
- font-weight: 700;
- }
+ /* row 126/134: the DEFAULT choice of a color-chooser option (the config.xml
+ ) is enclosed in [ ] in the dropdown list — bolding
+ text is not rendered by every browser, so brackets are used there
+ instead. The bold remains ONLY on the swatch label below the swatch
+ (is-default class set by options.js). */
.color-chip-label.is-default {
font-weight: 700;
color: #212529;