diff --git a/server/mess-reaktion.mjs b/server/mess-reaktion.mjs index 4bfb3400..50967082 100644 --- a/server/mess-reaktion.mjs +++ b/server/mess-reaktion.mjs @@ -2472,6 +2472,37 @@ await zuschauer.kontext.close(); console.log(` Handy offen: Saal ${platzHandy.saal} = Leiste ${platzHandy.leiste} ` + `+ Kino ${platzHandy.kino} + Regie ${platzHandy.pult}`); console.log(` Handy Zeilen: ${platzHandy.alle}`); + /* UEBERLAPPEN SICH DIE KNOEPFE DER LEISTE? + `pruef-handy` fragt nur, ob die MITTE eines Knopfes frei ist + -- zwei Knoepfe koennen sich an den Raendern ueberlagern und + trotzdem beide „erreichbar" sein. Auf dem Bildschirmfoto + sieht das aus wie ein Fehler, und wer danebentippt, trifft + den falschen. */ + const gedraengt = await chef.seite.evaluate(() => { + const knoepfe = [...document.querySelectorAll(".transport button, .transport input")] + .map((e) => ({ e, r: e.getBoundingClientRect() })) + .filter((x) => x.r.width > 0 && x.r.height > 0); + const raus = []; + for (let i = 0; i < knoepfe.length; i++) { + for (let j = i + 1; j < knoepfe.length; j++) { + const a = knoepfe[i].r, b = knoepfe[j].r; + const ueber = Math.min(a.right, b.right) - Math.max(a.left, b.left); + const hoch = Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top); + if (ueber > 1 && hoch > 1) { + const n = (x) => x.e.id || x.e.className.split(" ")[0] || x.e.tagName; + raus.push(`${n(knoepfe[i])} / ${n(knoepfe[j])} (${Math.round(ueber)}x${Math.round(hoch)} px)`); + } + } + } + return raus; + }); + if (gedraengt.length) { + console.log(` ACHTUNG: ${gedraengt.length} Knopfpaar(e) in der Leiste ` + + `ueberlappen sich: ${gedraengt.slice(0, 4).join(", ")}`); + ausgang = 1; + } else { + console.log(" Kein Knopf der Transportleiste liegt ueber einem anderen."); + } const spur = await chef.seite.evaluate(() => { const saal = document.getElementById("saal"); const r = saal.getBoundingClientRect(); diff --git a/workspace/anruf-probe.html b/workspace/anruf-probe.html index 487a394a..d543f3da 100644 --- a/workspace/anruf-probe.html +++ b/workspace/anruf-probe.html @@ -16,8 +16,8 @@ verdeckt. Gefunden hat es pruef-struktur. Richtig sind `gate.css` (die Farbwerte des Hauses) und `haus.css`. --> - - + + - +