1/*! 2 * Minimal Lightbox FTTH â Auto Bind 3 * Fängt nur Bild-Links im Content ab und öffnet die Lightbox. 4 * Greift im Capture-Modus, verhindert Default NUR wenn wir übernehmen. 5 */ 6(function () { 7 "use strict"; 8 9 // Nur hier aktiv (Posts & Pages Content) 10 var SCOPE_SEL = "#content .news"; 11 12 function isImageHref(href) { 13 if (!href) return false; 14 try { 15 // Query/Hash abtrennen 16 var clean = href.split("#")[0].split("?")[0]; 17 return /\.(jpe?g|png|gif|webp|avif|bmp|tiff?)$/i.test(clean); 18 } catch (_) { 19 return false; 20 } 21 } 22 23 function eligibleAnchorFromEvent(ev) { 24 // Nur Link im gewünschten Bereich 25 var a = ev.target && ev.target.closest && ev.target.closest("a[href]"); 26 if (!a) return null; 27 if (!a.closest(SCOPE_SEL)) return null; 28 29 // Nur âechteâ Bild-Links: <a><img></a> ODER Href auf Bilddatei 30 if (!(a.querySelector("img") || isImageHref(a.getAttribute("href")))) { 31 return null; 32 } 33 34 // Modifizierte Klicks & andere Buttons nicht abfangen 35 if (ev.button !== 0 || ev.metaKey || ev.ctrlKey || ev.shiftKey || ev.altKey) { 36 return null; 37 } 38 39 return a; 40 } 41 42 // Capture: wir kommen VOR anderen Listenern dran â aber verhindern nur bei Ãbernahme 43 document.addEventListener("click", function (ev) { 44 var a = eligibleAnchorFromEvent(ev); 45 if (!a) return; 46 47 var api = window.MLB_FTTH && window.MLB_FTTH.openFromAnchor; 48 if (!api || typeof api !== "function") { 49 // API fehlt -> NICHT blockieren (normaler Link-Klick soll funktionieren) 50 return; 51 } 52 53 // Wir übernehmen: 54 ev.preventDefault(); 55 ev.stopPropagation(); 56 if (ev.stopImmediatePropagation) ev.stopImmediatePropagation(); 57 try { api(a); } catch (e) { /* failsafe: nichts tun, damit Seite nicht âblockiertâ */ } 58 }, true); 59})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.