diff --git a/jwconfsignal.js b/jwconfsignal.js index 4dec2f3..79268b4 100644 --- a/jwconfsignal.js +++ b/jwconfsignal.js @@ -1,8 +1,8 @@ /* JWConfZoomHand -2020.08.04 - - Based on JWConf Signal 2018.04.29 +2021.08.28 +(c) 2021 - JB + Some Parts from JWConf Signal 2018.04.29 (c) 2018 - Simon Lorenz - werbung@lorenzweb.net */ @@ -28,7 +28,7 @@ JWConfZoomHand if (signalEnabled === false) { return; } - var tableAttendees = document.getElementById("confroom"); + var tableAttendees = document.getElementById("content").getElementsByTagName("table")[0]; if (typeof(tableAttendees) !== "undefined" && tableAttendees !== null) { for (var i = 0, row; row = tableAttendees.rows[i]; i++) { if (row.parentNode.localName !== "thead") @@ -38,7 +38,7 @@ JWConfZoomHand } function updateJWConfRaisings() { - JWConfRaisings = document.evaluate('count(//table[@class="monitorTbl"]//tr[@class="detected meldung-blue" or @class="detected meldungActive"])', document, null, XPathResult.ANY_TYPE, null ).numberValue; + JWConfRaisings = document.evaluate('count(//table[@class="listener-table"]//tr[@class="detected speechrequest"])', document, null, XPathResult.ANY_TYPE, null ).numberValue; } function subscribeAttList() { @@ -49,7 +49,7 @@ JWConfZoomHand } }); - x.observe(document.getElementById('confroom'), { childList: true, subtree: true}); + x.observe(document.getElementById("content"), { childList: true, subtree: true}); } // add observer for any new attendee @@ -65,7 +65,7 @@ JWConfZoomHand var attributeValue = $(mutation.target).prop(mutation.attributeName); console.log("Class attribute", addToElement.children[0].innerText, "changed to:", attributeValue); - if (attributeValue === "detected meldung-blue") { + if (attributeValue === "detected speechrequest") { decideZoomHand(true); } else if (attributeValue === "detected") { @@ -113,14 +113,14 @@ JWConfZoomHand // add on/off selector to "Live Monitor" headline function addSelectorToMonitorHeadline() { - var headlineToFind = getMessage("headlineToAttach"); + var headlineToFind = " Zuhörer"; var h4Elements = document.getElementsByTagName("h4"); if (typeof(h4Elements) !== "undefined" && h4Elements !== null) { for (var i=0, h4Element; h4Element = h4Elements[i]; i++) { if (typeof(h4Element.childNodes) !== "undefined" && h4Element.childNodes !== null) { for (var ii=0, childNode; childNode = h4Element.childNodes[ii]; ii++) { if (typeof(childNode.nodeValue) !== "undefined" && childNode.nodeValue !== null) { - if (childNode.nodeValue.startsWith(headlineToFind) || childNode.nodeValue.startsWith("Live") || childNode.nodeValue.startsWith("Interface Live")) { + if (childNode.nodeValue.startsWith(headlineToFind)) { // add selector var selectorElem = document.createElement("div"); selectorElem.style = "display: inline-block; margin-left: 10px;height: 22px;background-color: #c60f13;width: 49px;"; @@ -243,7 +243,7 @@ JWConfZoomHand if (typeof(h4Element.childNodes) !== "undefined" && h4Element.childNodes !== null) { for (var ii=0, childNode; childNode = h4Element.childNodes[ii]; ii++) { if (typeof(childNode.nodeValue) !== "undefined" && childNode.nodeValue !== null) { - if (childNode.nodeValue.startsWith(getMessage("headlineToAttach")) || childNode.nodeValue.startsWith("Live") || childNode.nodeValue.startsWith("Interface Live")) { + if (childNode.nodeValue.startsWith(" Zuhörer")) { return true } } @@ -263,8 +263,8 @@ JWConfZoomHand addSelectorToMonitorHeadline(); startNewAttendeesDetection(); subscribeAttList(); - //folgende Zeile auskommentieren, wenn die Konferenz nicht automatisch verbunden werden solls - //document.evaluate('//*[@id="hall"]/div[2]/div[2]/div/div/div[1]/div/a', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue.click() + //die beiden // in der folgenden Zeile entfernen, wenn sich die Konferenz automatisch verbinden soll bzw. // davor setzen wenn sie manuell verbunden werden soll + //setTimeout(function(){ document.evaluate('//*[@id="left-column"]/div/div[2]/div[2]/button', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue.click(); }, 1000); } } diff --git a/manifest.json b/manifest.json index 62a7376..53efbc1 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtXRV6Vq2HTR6M1ryxP+8c4EvfCNo1K7SY8rkpBAdvZfDuxPB89Tkkm282/pkyl0ppmTyCpYO3bIXPKuDSg5TZfAItfXF2VgoMVUjXwiWy6qSiAkdaoHyNLuQqCcexqNvvqnKgfvkiZBK3HPNJzZFpx9BMFvSoG4RQz7GjYGjqzu95LW6tmI0HAMDKzHihdZ6d6oCgov/yJXIYyUBUSz+uVYpLM2xHRaOxU76AS896RzUNZEV5CUvioclqrmqQDp4gB7NJ2tDODil11T2yE4cVuIz9z/X3eZ7Y1mBmfHK1WnnFb+N5PMu/n1fA6re0bqAg6rT8gZNdeXlcAlytts4nwIDAQAB", "name":"jwconfzoomhand", "short_name":"JWConfZoomHand", - "version":"2021.01.10", + "version":"2021.08.28", "manifest_version":2, "default_locale": "de", "description":"-", @@ -31,6 +31,6 @@ "activeTab", "nativeMessaging" ], - "homepage_url": "http://test.local" + "homepage_url": "http://jwconfzoomhand.local" }