From 9836513d287396fabcba85956366e6410d7363ef Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 9 Jul 2026 23:21:28 -0400 Subject: fix(admin): remove extraneous message button, arrow buttons and checkboxes work, formatting fixup --- internal/admin/static/admin.css | 7 +++-- internal/admin/static/intereditor.js | 50 ++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 27 deletions(-) (limited to 'internal/admin/static') diff --git a/internal/admin/static/admin.css b/internal/admin/static/admin.css index 7c8f0a5..a5c3497 100644 --- a/internal/admin/static/admin.css +++ b/internal/admin/static/admin.css @@ -447,15 +447,18 @@ g.ud-hover:hover text{font-weight:bold} .ie-step-label{font-size:10px;color:#6af;text-transform:uppercase;letter-spacing:.3px;font-weight:bold;white-space:nowrap} .ie-step-addmore{color:#6af;border:1px solid rgba(100,160,255,.25);background:transparent;font-size:10px;padding:1px 6px;border-radius:3px;cursor:pointer;font-family:monospace;line-height:1} .ie-step-addmore:hover{background:rgba(100,160,255,.1)} +.ie-step-addmore::after{content:"+"} +.ie-step-row.show-addbar .ie-step-addmore::after{content:"-"} .ie-step-spacer{flex:1} .ie-step-up,.ie-step-dn{padding:2px 6px;font-size:9px} .ie-step-cond-panel{margin:2px 0} +.ie-cond-title{font-size:10px;color:#6af;text-transform:uppercase;letter-spacing:.3px;font-weight:bold;margin-bottom:2px} .ie-step-effects{margin:2px 0} .ie-step-messages{margin:2px 0} .ie-step-addbar{display:none;flex-wrap:wrap;gap:3px;margin-top:2px} .ie-step-row.show-addbar .ie-step-addbar{display:flex} -.ie-step-addbar-bottom{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px} -.ie-step-addbar-bottom .btn{padding:4px 10px;font-size:11px} +.ie-step-addbar-bottom{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;margin-top:6px} +.ie-step-addbar-bottom .btn{width:100%;box-sizing:border-box;text-align:center;padding:4px 10px;font-size:11px} /* ── Message rows within a step ── */ .ie-msg-row{display:flex;align-items:center;gap:4px} diff --git a/internal/admin/static/intereditor.js b/internal/admin/static/intereditor.js index 653bccf..a17225a 100644 --- a/internal/admin/static/intereditor.js +++ b/internal/admin/static/intereditor.js @@ -78,7 +78,7 @@ function ie_renderStepAddbar(step, secId, idx, si, secPath) { function ie_renderBottomAddbar(secId, secPath, idx) { var h = ''; IE_STEP_KINDS.forEach(function(sk) { - h += ''; + h += ''; }); return h; } @@ -331,7 +331,15 @@ function ie_renderCond(condObj, secId, idx, secPath, kind) { var h = ''; var isGroup = condObj && (condObj.all_of || condObj.any_of); if (condObj && typeof condObj === 'object') { + var condTitleText = ''; + if (kind && kind.indexOf('step-') === 0) { + var sn = parseInt(kind.slice(5), 10); + if (!isNaN(sn)) condTitleText = 'Condition for Step ' + (sn + 1); + } else if (kind === 'entry') { + condTitleText = 'Condition for Action Block'; + } h += '
'; + if (condTitleText) h += '
' + esc(condTitleText) + '
'; h += ie_renderGroup(condObj, secId, secPath, idx, '', kind); h += '
'; } @@ -517,7 +525,7 @@ function ie_renderAct(stepObj, secId, idx, si, secPath) { function ie_renderMessages(step, secId, idx, si, secPath) { var present = step && Array.isArray(step.messages); if (!present) { - return ''; + return ''; } var msgs = step.messages; var rmFn = 'ie_removeMessage(this,\'' + escAttr(secId) + '\',\'' + escAttr(secPath) + '\',' + idx + ',' + si + ')'; @@ -549,24 +557,25 @@ function ie_renderStepList(steps, secId, idx, secPath) { h += '
'; h += '
'; h += 'Step ' + (si + 1) + ''; - h += ''; + h += ''; + if (!stepCond) { + h += ''; + } h += ''; if (si > 0) h += ''; if (si < steps.length - 1) h += ''; h += ''; h += '
'; - h += '
'; if (stepCond) { + h += '
'; h += ie_renderCond(step.condition || null, secId, idx, secPath, 'step-' + si); - } else { - h += ''; + h += '
'; } - h += '
'; h += '
' + ie_renderAct(step, secId, idx, si, secPath) + '
'; - h += '
' + ie_renderStepAddbar(step, secId, idx, si, secPath) + '
'; h += '
' + ie_renderMessages(step, secId, idx, si, secPath) + '
'; + h += '
' + ie_renderStepAddbar(step, secId, idx, si, secPath) + '
'; h += '
'; }); @@ -876,29 +885,20 @@ function ie_toggleCondMode(secId, secPath, idx, kind, groupPath) { var ed = window._editorData; if (!ed) return; _ie_syncCond(ed, secId, secPath, idx, kind); - var cond = _ie_getCond(ed, secPath, idx, kind); - var group = ie_condAt(cond, groupPath); - if (!group || !group.all_of && !group.any_of) return; - - var oldMode = group.all_of ? 'all_of' : 'any_of'; - var children = group.all_of || group.any_of; - var newGroup = {}; - if (group.not) newGroup.not = true; - newGroup[oldMode === 'all_of' ? 'any_of' : 'all_of'] = children; - - var newCond = ie_condReplace(cond, groupPath, newGroup); - _ie_setCond(ed, secPath, idx, kind, newCond); - ced_syncDOMToData(ed); window._ieRenderOnly(); } function ie_toggleCondNot(secId, secPath, idx, kind, groupPath) { - ced_syncDOMToData(window._editorData); + var ed = window._editorData; + if (!ed) return; + _ie_syncCond(ed, secId, secPath, idx, kind); window._ieRenderOnly(); } function ie_toggleNotLeaf(secId, secPath, idx, kind, groupPath, ci) { - ced_syncDOMToData(window._editorData); + var ed = window._editorData; + if (!ed) return; + _ie_syncCond(ed, secId, secPath, idx, kind); window._ieRenderOnly(); } @@ -923,7 +923,7 @@ function ie_moveStep(secId, secPath, idx, fromSi, toSi) { if (!steps || fromSi < 0 || fromSi >= steps.length || toSi < 0 || toSi >= steps.length) return; var m = steps.splice(fromSi, 1)[0]; steps.splice(toSi, 0, m); - window._ieRenderCurrent(); + window._ieRenderOnly(); } function ie_moveRow(secPath, fromIdx, toIdx) { @@ -935,7 +935,7 @@ function ie_moveRow(secPath, fromIdx, toIdx) { if (!arr || fromIdx < 0 || fromIdx >= arr.length || toIdx < 0 || toIdx >= arr.length) return; var m = arr.splice(fromIdx, 1)[0]; arr.splice(toIdx, 0, m); - window._ieRenderCurrent(); + window._ieRenderOnly(); } function ie_moveMessage(secId, secPath, idx, si, fromMi, toMi) { -- cgit v1.2.3