From b63089a4fa986d5bf45ec377dca196455ccdf86e Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Fri, 16 Jan 2026 02:53:30 +0100 Subject: [PATCH] Config enabledisable --- public/editor/bridge-core.js | 26 ++++++++++++++------------ public/editor/editor-core.php | 7 ++++--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/public/editor/bridge-core.js b/public/editor/bridge-core.js index 0eed96a..ea047c4 100644 --- a/public/editor/bridge-core.js +++ b/public/editor/bridge-core.js @@ -149,16 +149,16 @@             base + 'categorization-cleanup.js',         ]; -        const initialLoadList = B.DISABLE_EDITOR_EXTENSIONS -            ? [base + 'general-functions.js'] -            : [...coreFiles]; +        const initialLoadList = B.ENABLE_EDITOR_EXTENSIONS === false +             ? [base + 'general-functions.js'] +             : [...coreFiles];                  function recursiveLoader(list, index = 0) {             if (index >= list.length) {                 log('LOAD END', 'Initial-Bridge-Skripte geladen.', 'green'); -                if (B.DISABLE_EDITOR_EXTENSIONS) { -                    return cb && cb(B); -                } +                if (B.ENABLE_EDITOR_EXTENSIONS === false) { +                     return cb && cb(B); +                 }                                  const config = window.BridgeParts?.CATEGORY_CONFIG || {};                 let allBlockFiles = []; @@ -254,7 +254,7 @@ let pluginsList = [ safetyPlugin, ]; - if (!B.DISABLE_EDITOR_EXTENSIONS) { + if (B.ENABLE_EDITOR_EXTENSIONS !== false) { pluginsList.push( // 🛑 KRITISCHE ERGÄNZUNG: Aktiviert das registrierte API-Plugin 'bridge-blocks-api', @@ -1216,11 +1216,11 @@ }, }); }; - if (!B.DISABLE_EDITOR_EXTENSIONS && !B.DISABLE_EDITOR_BEHAVIOR) { + if (B.ENABLE_EDITOR_EXTENSIONS !== false && B.ENABLE_EDITOR_BEHAVIOR !== false) { ensureCommandStubs(ed); } - if (!B.DISABLE_EDITOR_EXTENSIONS && !B.DISABLE_EDITOR_BEHAVIOR) { + if (B.ENABLE_EDITOR_EXTENSIONS !== false && B.ENABLE_EDITOR_BEHAVIOR !== false) { try { const textTags = ['p','span','div','br','b','strong','i','em','u','a','ul','ol','li']; if (ed.Config) { @@ -1242,8 +1242,10 @@ } } - if (!B.DISABLE_EDITOR_EXTENSIONS && !B.DISABLE_EDITOR_BEHAVIOR) { + if (B.ENABLE_EDITOR_EXTENSIONS !== false && (B.ENABLE_EDITOR_BEHAVIOR !== false || B.ENABLE_TABLE_BUILDER)) { setupTableBuilder(ed); + } + if (B.ENABLE_EDITOR_EXTENSIONS !== false && B.ENABLE_EDITOR_BEHAVIOR !== false) { setupPlainTextPreserver(ed); } setupBlurLogger(ed); @@ -1277,7 +1279,7 @@         log('BLOCK REGISTER', 'Registriere Bridge Blöcke, um Preset-Defaults zu überschreiben.', 'purple'); // 🛑 DYNAMISCHE AKTIVIERUNG DER SYNCHRONEN BLÖCKE (Ersetzt die fixen Aufrufe) - if (!B.DISABLE_EDITOR_EXTENSIONS && B.CATEGORY_CONFIG && ed) { + if (B.ENABLE_EDITOR_EXTENSIONS !== false && B.CATEGORY_CONFIG && ed) { log('DYNAMIC ACTIVATION', 'Starte Aktivierung synchroner Block-Plugins (via Config).', 'purple'); // Iteriere über die konfigurierten Kategorien @@ -1327,7 +1329,7 @@ } return false; }; - if (!B.DISABLE_EDITOR_EXTENSIONS && !B.DISABLE_PLACEHOLDERS) { + if (B.ENABLE_EDITOR_EXTENSIONS !== false && B.ENABLE_PLACEHOLDERS !== false) { if (!ensurePlaceholderRte()) { const fallbackSrc = B.BASE_PATH_BRIDGE + 'blocks-placeholder.js'; log('PLACEHOLDER LOAD', 'Placeholder-RTE wird geladen.', '#B45309', 'warn'); diff --git a/public/editor/editor-core.php b/public/editor/editor-core.php index 4b48216..d3c7b3b 100644 --- a/public/editor/editor-core.php +++ b/public/editor/editor-core.php @@ -49,9 +49,10 @@ if ($fontSources) { window.__editorMode = ""; window.__editorId = ; window.BridgeParts = window.BridgeParts || {}; - window.BridgeParts.DISABLE_EDITOR_EXTENSIONS = false; - window.BridgeParts.DISABLE_EDITOR_BEHAVIOR = true; - window.BridgeParts.DISABLE_PLACEHOLDERS = false; + window.BridgeParts.ENABLE_EDITOR_EXTENSIONS = true; + window.BridgeParts.ENABLE_EDITOR_BEHAVIOR = false; + window.BridgeParts.ENABLE_PLACEHOLDERS = true; + window.BridgeParts.ENABLE_TABLE_BUILDER = true; window.BridgeParts.LOG_CONFIG = window.BridgeParts.LOG_CONFIG || {}; window.BridgeParts.LOG_CONFIG.INFO_ENABLED = false; window.BridgeParts.LOG_CONFIG.DATA_ENABLED = false;