Number and stripe the per-script settings so each one reads as its own row
This commit is contained in:
@@ -2036,12 +2036,21 @@ function vvEditConf(id) {
|
||||
function vvRenderConfForm(groups) {
|
||||
const esc = s => String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');
|
||||
let html = '';
|
||||
// Continuous numbering across the whole panel, not restarting per group. It mirrors the
|
||||
// editor's line gutter, and it gives every setting one unambiguous handle — "number 12"
|
||||
// beats "the third one under Docker Watchdog" when someone is reading it back to you.
|
||||
// The stripe is driven by this counter rather than :nth-child, because the group header is
|
||||
// also a child and would throw the parity off inside every section.
|
||||
let n = 0;
|
||||
for (const g of groups) {
|
||||
html += '<div class="vv-cf-group">';
|
||||
html += '<div class="vv-cf-group-header">' + esc(g.subsection)
|
||||
+ ' <span class="vv-cf-file">' + esc(g.file) + '</span></div>';
|
||||
for (const f of g.fields) {
|
||||
html += '<div class="vv-cf-field">';
|
||||
n++;
|
||||
html += '<div class="vv-cf-field' + (n % 2 === 0 ? ' vv-cf-alt' : '') + '">';
|
||||
html += '<span class="vv-cf-num">' + n + '</span>';
|
||||
html += '<div class="vv-cf-body">';
|
||||
html += '<div class="vv-cf-key">' + esc(f.key) + '</div>';
|
||||
if (f.desc) html += '<div class="vv-cf-desc">' + esc(f.desc) + '</div>';
|
||||
if (f.type === 'scalar') {
|
||||
@@ -2054,7 +2063,7 @@ function vvRenderConfForm(groups) {
|
||||
+ ' data-key="' + esc(f.key) + '" data-file="' + esc(f.file) + '" data-type="' + esc(f.type) + '"'
|
||||
+ ' rows="' + rows + '">' + esc(f.value) + '</textarea>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</div></div>';
|
||||
}
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user