From e383c27adf149f0dec21052ed695e1cd9821bfa9 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Sat, 17 Jan 2026 03:58:45 +0100 Subject: [PATCH] asdasd --- public/editor/bridge-core.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/public/editor/bridge-core.js b/public/editor/bridge-core.js index dde5ed4..a4f96d8 100644 --- a/public/editor/bridge-core.js +++ b/public/editor/bridge-core.js @@ -597,6 +597,41 @@ setTimeout(() => { window.__bridgeModalAllowClose = false; }, 0); }; } + + if (ed && ed.on) { + ed.on('modal:open', () => { + try { + const modalEl = ed.Modal && ed.Modal.el; + if (!modalEl) return; + const titleEl = modalEl.querySelector('.gjs-mdl-title'); + const titleText = titleEl ? String(titleEl.textContent || '').toLowerCase() : ''; + if (!titleText.includes('code')) return; + if (modalEl.querySelector('[data-bridge-viewcode-close]')) return; + const contentEl = modalEl.querySelector('.gjs-mdl-content'); + if (!contentEl) return; + const footer = document.createElement('div'); + footer.style.display = 'flex'; + footer.style.justifyContent = 'flex-end'; + footer.style.paddingTop = '12px'; + const btn = document.createElement('button'); + btn.type = 'button'; + btn.textContent = 'Schließen'; + btn.setAttribute('data-bridge-viewcode-close', '1'); + btn.setAttribute('data-bridge-modal-close', '1'); + btn.style.padding = '6px 12px'; + btn.style.border = '1px solid #cbd5f5'; + btn.style.borderRadius = '4px'; + btn.style.background = '#f8fafc'; + btn.style.cursor = 'pointer'; + btn.addEventListener('click', () => { + if (B.allowModalCloseOnce) B.allowModalCloseOnce(); + if (ed.Modal && ed.Modal.close) ed.Modal.close(); + }); + footer.appendChild(btn); + contentEl.appendChild(footer); + } catch {} + }); + }                  // 🛑 KRITISCHE KORREKTUR 1: Explizite Erstellung aller konfigurierten Kategorien         ensureConfiguredCategories(ed);