This commit is contained in:
2026-01-17 03:36:27 +01:00
parent 83bde470d4
commit c36209975c
2 changed files with 66 additions and 13 deletions

View File

@@ -18,14 +18,41 @@
    /**
     * NEUER LOKALER WRAPPER, der die zentrale B.log Funktion verwendet.
     */
    const log = (type, message, color = '#1E90FF', logType = 'info', force = false) => {
        // Loggt NUR, wenn B.log verfügbar ist (aus general-functions.js).
        if (typeof B.log === 'function') {
            B.log(PluginName, `[${type}] ${message}`, color, logType, force);
        }
        // Ansonsten wird NICHTS geloggt, bis general-functions.js geladen ist.
    };
    // ----------------------------------------------------------------------
const log = (type, message, color = '#1E90FF', logType = 'info', force = false) => {
// Loggt NUR, wenn B.log verfügbar ist (aus general-functions.js).
if (typeof B.log === 'function') {
B.log(PluginName, `[${type}] ${message}`, color, logType, force);
}
// Ansonsten wird NICHTS geloggt, bis general-functions.js geladen ist.
};
// ----------------------------------------------------------------------
const installModalGuards = () => {
if (window.__bridgeModalGuardsInstalled) return;
window.__bridgeModalGuardsInstalled = true;
document.addEventListener('click', (evt) => {
const container = evt.target && evt.target.closest
? evt.target.closest('.gjs-mdl-container')
: null;
if (container) {
const content = evt.target.closest ? evt.target.closest('.gjs-mdl-content') : null;
if (!content) {
evt.preventDefault();
evt.stopPropagation();
}
}
}, true);
document.addEventListener('keydown', (evt) => {
if (evt.key !== 'Escape') return;
const hasModal = document.querySelector('.gjs-mdl-container');
if (hasModal) {
evt.preventDefault();
evt.stopPropagation();
}
}, true);
};
    // 🛑 GLOBALER LOG ZUR BESTÄTIGUNG DER SKRIPT-AUSFÜHRUNG
    // log('START', `SKRIPT-AUSFÜHRUNG GESTARTET.`, '#DC143C', 'info', true); // DEAKTIVIERT/IGNORIERT DURCH FEHLENDEN B.log
@@ -36,11 +63,12 @@
    const LOAD_NEWSLETTER_PRESET = false; // <<< KRITISCHER FIX: Auf FALSE gesetzt, um den "defaults" Konflikt zu beheben!
    // ----------------------------------------------------------------------
    
    if (window.__bridgeCoreInitialized) {
        log('INIT ABORT', 'Bridge Core wurde bereits initialisiert.', 'orange');
        return; 
    }
    window.__bridgeCoreInitialized = true;
if (window.__bridgeCoreInitialized) {
log('INIT ABORT', 'Bridge Core wurde bereits initialisiert.', 'orange');
return; 
}
window.__bridgeCoreInitialized = true;
installModalGuards();
    
    // --- Initialisierung BridgeParts (B) und Plugin-Registry ---
B.BASE_PATH_BRIDGE = '../assets/js/bridge/';