asdasd
This commit is contained in:
@@ -32,6 +32,7 @@ async function ensureAuthenticated() {
|
||||
}
|
||||
|
||||
function initAppFeatures() {
|
||||
installGlobalModalGuards();
|
||||
initTabs();
|
||||
initLists();
|
||||
initCreate();
|
||||
@@ -43,6 +44,30 @@ function initAppFeatures() {
|
||||
ensureFloatingLogout({ redirect: '/login.php' });
|
||||
}
|
||||
|
||||
function installGlobalModalGuards() {
|
||||
if (window.__modalGuardsInstalled) return;
|
||||
window.__modalGuardsInstalled = true;
|
||||
|
||||
document.addEventListener('click', (evt) => {
|
||||
const dlg = evt.target && evt.target.tagName === 'DIALOG'
|
||||
? evt.target
|
||||
: (evt.target && evt.target.closest ? evt.target.closest('dialog') : null);
|
||||
if (!dlg) return;
|
||||
if (evt.target === dlg) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
}, true);
|
||||
|
||||
document.addEventListener('cancel', (evt) => {
|
||||
const dlg = evt.target;
|
||||
if (dlg && dlg.tagName === 'DIALOG') {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
// Sync-Nachrichten aus dem Editor-Iframe (unverändert, aber mit credentials)
|
||||
async function handleEditorMessages(ev) {
|
||||
const msg = ev.data || {};
|
||||
|
||||
@@ -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/';
|
||||
|
||||
Reference in New Issue
Block a user