(function () { var FOOTER_ID = 'company-branding-footer'; var LOGO_URL = '/branding/company-logo.svg?v=3'; // v=2 für Cache-Busting function buildFooter() { var footer = document.createElement('div'); footer.id = FOOTER_ID; // Inline-Styles zur Sicherheit footer.style.position = 'fixed'; footer.style.bottom = '0'; footer.style.left = '0'; footer.style.right = '0'; footer.style.zIndex = '9999'; footer.style.height = '28px'; footer.style.lineHeight = '28px'; footer.style.textAlign = 'center'; footer.style.background = '#f5f5f5'; footer.style.borderTop = '1px solid #ccc'; footer.style.fontSize = '12px'; footer.innerHTML = 'Impressum' + 'Datenschutz'; return footer; } function fixLogo() { var imgs = document.querySelectorAll('clr-header img, header img, .branding img, .harbor-logo'); imgs.forEach(function(img) { if (img.src.indexOf('company-logo.svg') === -1) { img.src = LOGO_URL; } // Größe explizit erzwingen, um Harbors 16x16 CSS zu überschreiben img.style.maxHeight = '40px'; img.style.height = '40px'; img.style.width = 'auto'; img.style.minWidth = '100px'; // Mindestbreite, damit es sichtbar ist }); } function ensureFooter() { if (!document.getElementById(FOOTER_ID)) { document.body.appendChild(buildFooter()); } } function init() { ensureFooter(); fixLogo(); // Logo beim ersten Laden prüfen // Selbstheilung für Footer und Logo var observer = new MutationObserver(function () { ensureFooter(); fixLogo(); }); // subtree: true ist hier wichtig, da das Logo tief im Header steckt observer.observe(document.body, { childList: true, subtree: true }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); } })();