This commit is contained in:
2025-12-06 00:24:46 +01:00
parent 7ed1dab3c5
commit 7637c567e2
3 changed files with 38 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
<?php
$mode = strtolower($_GET['mode'] ?? 'templates');
$id = (int)($_GET['id'] ?? 0);
$ts = time();
?><!doctype html>
<html lang="de">
@@ -23,6 +24,14 @@ $ts = time();
<div id="blocks"></div>
<script>
window.__editorMode = "<?=htmlspecialchars($mode, ENT_QUOTES)?>";
window.__editorId = <?= $id ?>;
window.BridgeParts = window.BridgeParts || {};
window.BridgeParts.CURRENT_ENTITY_ID = window.BridgeParts.CURRENT_ENTITY_ID || <?= $id ?>;
window.BridgeParts.API_KERNEL_URL = window.BridgeParts.API_KERNEL_URL || '/api.php';
window.BridgeParts.API_BASE = window.BridgeParts.API_BASE || window.BridgeParts.API_KERNEL_URL;
window.BridgeParts.STORAGE_URL_BASE = window.BridgeParts.STORAGE_URL_BASE || window.BridgeParts.API_BASE;
function logToParent(type, detail){ try{ parent.postMessage({source:'editor-core',type:type,detail:String(detail||'')},'*'); }catch(e){} }
window.addEventListener('error', function(e){
var b=document.getElementById('badge');
@@ -68,8 +77,6 @@ $ts = time();
// Heartbeat vom Core (sichtbar im Hauptfenster)
var hb=0, timer=setInterval(function(){ hb++; if(hb>60){clearInterval(timer);return;} logToParent('hb','tick '+hb); }, 200);
// Mode für die Bridge bereitstellen
window.__editorMode = "<?=htmlspecialchars($mode,ENT_QUOTES)?>";
});
});
});