Config enabledisable

This commit is contained in:
2026-01-16 02:53:30 +01:00
parent 1eb18c8036
commit b63089a4fa
2 changed files with 18 additions and 15 deletions

View File

@@ -149,16 +149,16 @@
            base + 'categorization-cleanup.js',             base + 'categorization-cleanup.js',
        ];         ];
        const initialLoadList = B.DISABLE_EDITOR_EXTENSIONS         const initialLoadList = B.ENABLE_EDITOR_EXTENSIONS === false
            ? [base + 'general-functions.js']              ? [base + 'general-functions.js']
            : [...coreFiles];              : [...coreFiles];
                 
        function recursiveLoader(list, index = 0) {         function recursiveLoader(list, index = 0) {
            if (index >= list.length) {             if (index >= list.length) {
                log('LOAD END', 'Initial-Bridge-Skripte geladen.', 'green');                 log('LOAD END', 'Initial-Bridge-Skripte geladen.', 'green');
                if (B.DISABLE_EDITOR_EXTENSIONS) {                 if (B.ENABLE_EDITOR_EXTENSIONS === false) {
                    return cb && cb(B);                      return cb && cb(B);
                }                  }
                                 
                const config = window.BridgeParts?.CATEGORY_CONFIG || {};                 const config = window.BridgeParts?.CATEGORY_CONFIG || {};
                let allBlockFiles = [];                 let allBlockFiles = [];
@@ -254,7 +254,7 @@
let pluginsList = [ let pluginsList = [
safetyPlugin, safetyPlugin,
]; ];
if (!B.DISABLE_EDITOR_EXTENSIONS) { if (B.ENABLE_EDITOR_EXTENSIONS !== false) {
pluginsList.push( pluginsList.push(
// 🛑 KRITISCHE ERGÄNZUNG: Aktiviert das registrierte API-Plugin // 🛑 KRITISCHE ERGÄNZUNG: Aktiviert das registrierte API-Plugin
'bridge-blocks-api', '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); ensureCommandStubs(ed);
} }
if (!B.DISABLE_EDITOR_EXTENSIONS && !B.DISABLE_EDITOR_BEHAVIOR) { if (B.ENABLE_EDITOR_EXTENSIONS !== false && B.ENABLE_EDITOR_BEHAVIOR !== false) {
try { try {
const textTags = ['p','span','div','br','b','strong','i','em','u','a','ul','ol','li']; const textTags = ['p','span','div','br','b','strong','i','em','u','a','ul','ol','li'];
if (ed.Config) { 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); setupTableBuilder(ed);
}
if (B.ENABLE_EDITOR_EXTENSIONS !== false && B.ENABLE_EDITOR_BEHAVIOR !== false) {
setupPlainTextPreserver(ed); setupPlainTextPreserver(ed);
} }
setupBlurLogger(ed); setupBlurLogger(ed);
@@ -1277,7 +1279,7 @@
        log('BLOCK REGISTER', 'Registriere Bridge Blöcke, um Preset-Defaults zu überschreiben.', 'purple');         log('BLOCK REGISTER', 'Registriere Bridge Blöcke, um Preset-Defaults zu überschreiben.', 'purple');
// 🛑 DYNAMISCHE AKTIVIERUNG DER SYNCHRONEN BLÖCKE (Ersetzt die fixen Aufrufe) // 🛑 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'); log('DYNAMIC ACTIVATION', 'Starte Aktivierung synchroner Block-Plugins (via Config).', 'purple');
// Iteriere über die konfigurierten Kategorien // Iteriere über die konfigurierten Kategorien
@@ -1327,7 +1329,7 @@
} }
return false; return false;
}; };
if (!B.DISABLE_EDITOR_EXTENSIONS && !B.DISABLE_PLACEHOLDERS) { if (B.ENABLE_EDITOR_EXTENSIONS !== false && B.ENABLE_PLACEHOLDERS !== false) {
if (!ensurePlaceholderRte()) { if (!ensurePlaceholderRte()) {
const fallbackSrc = B.BASE_PATH_BRIDGE + 'blocks-placeholder.js'; const fallbackSrc = B.BASE_PATH_BRIDGE + 'blocks-placeholder.js';
log('PLACEHOLDER LOAD', 'Placeholder-RTE wird geladen.', '#B45309', 'warn'); log('PLACEHOLDER LOAD', 'Placeholder-RTE wird geladen.', '#B45309', 'warn');

View File

@@ -49,9 +49,10 @@ if ($fontSources) {
window.__editorMode = "<?=htmlspecialchars($mode, ENT_QUOTES)?>"; window.__editorMode = "<?=htmlspecialchars($mode, ENT_QUOTES)?>";
window.__editorId = <?= $id ?>; window.__editorId = <?= $id ?>;
window.BridgeParts = window.BridgeParts || {}; window.BridgeParts = window.BridgeParts || {};
window.BridgeParts.DISABLE_EDITOR_EXTENSIONS = false; window.BridgeParts.ENABLE_EDITOR_EXTENSIONS = true;
window.BridgeParts.DISABLE_EDITOR_BEHAVIOR = true; window.BridgeParts.ENABLE_EDITOR_BEHAVIOR = false;
window.BridgeParts.DISABLE_PLACEHOLDERS = false; window.BridgeParts.ENABLE_PLACEHOLDERS = true;
window.BridgeParts.ENABLE_TABLE_BUILDER = true;
window.BridgeParts.LOG_CONFIG = window.BridgeParts.LOG_CONFIG || {}; window.BridgeParts.LOG_CONFIG = window.BridgeParts.LOG_CONFIG || {};
window.BridgeParts.LOG_CONFIG.INFO_ENABLED = false; window.BridgeParts.LOG_CONFIG.INFO_ENABLED = false;
window.BridgeParts.LOG_CONFIG.DATA_ENABLED = false; window.BridgeParts.LOG_CONFIG.DATA_ENABLED = false;