Update to be compatible with JWConfV3

This commit is contained in:
2021-08-30 19:40:06 +02:00
parent 244b5971ab
commit 20e08895d1
2 changed files with 14 additions and 14 deletions
+12 -12
View File
@@ -1,8 +1,8 @@
/* /*
JWConfZoomHand JWConfZoomHand
2020.08.04 2021.08.28
(c) 2021 - JB
Based on JWConf Signal 2018.04.29 Some Parts from JWConf Signal 2018.04.29
(c) 2018 - Simon Lorenz - werbung@lorenzweb.net (c) 2018 - Simon Lorenz - werbung@lorenzweb.net
*/ */
@@ -28,7 +28,7 @@ JWConfZoomHand
if (signalEnabled === false) { if (signalEnabled === false) {
return; return;
} }
var tableAttendees = document.getElementById("confroom"); var tableAttendees = document.getElementById("content").getElementsByTagName("table")[0];
if (typeof(tableAttendees) !== "undefined" && tableAttendees !== null) { if (typeof(tableAttendees) !== "undefined" && tableAttendees !== null) {
for (var i = 0, row; row = tableAttendees.rows[i]; i++) { for (var i = 0, row; row = tableAttendees.rows[i]; i++) {
if (row.parentNode.localName !== "thead") if (row.parentNode.localName !== "thead")
@@ -38,7 +38,7 @@ JWConfZoomHand
} }
function updateJWConfRaisings() { 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() { 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 // add observer for any new attendee
@@ -65,7 +65,7 @@ JWConfZoomHand
var attributeValue = $(mutation.target).prop(mutation.attributeName); var attributeValue = $(mutation.target).prop(mutation.attributeName);
console.log("Class attribute", addToElement.children[0].innerText, "changed to:", attributeValue); console.log("Class attribute", addToElement.children[0].innerText, "changed to:", attributeValue);
if (attributeValue === "detected meldung-blue") { if (attributeValue === "detected speechrequest") {
decideZoomHand(true); decideZoomHand(true);
} else if (attributeValue === "detected") { } else if (attributeValue === "detected") {
@@ -113,14 +113,14 @@ JWConfZoomHand
// add on/off selector to "Live Monitor" headline // add on/off selector to "Live Monitor" headline
function addSelectorToMonitorHeadline() { function addSelectorToMonitorHeadline() {
var headlineToFind = getMessage("headlineToAttach"); var headlineToFind = " Zuhörer";
var h4Elements = document.getElementsByTagName("h4"); var h4Elements = document.getElementsByTagName("h4");
if (typeof(h4Elements) !== "undefined" && h4Elements !== null) { if (typeof(h4Elements) !== "undefined" && h4Elements !== null) {
for (var i=0, h4Element; h4Element = h4Elements[i]; i++) { for (var i=0, h4Element; h4Element = h4Elements[i]; i++) {
if (typeof(h4Element.childNodes) !== "undefined" && h4Element.childNodes !== null) { if (typeof(h4Element.childNodes) !== "undefined" && h4Element.childNodes !== null) {
for (var ii=0, childNode; childNode = h4Element.childNodes[ii]; ii++) { for (var ii=0, childNode; childNode = h4Element.childNodes[ii]; ii++) {
if (typeof(childNode.nodeValue) !== "undefined" && childNode.nodeValue !== null) { 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 // add selector
var selectorElem = document.createElement("div"); var selectorElem = document.createElement("div");
selectorElem.style = "display: inline-block; margin-left: 10px;height: 22px;background-color: #c60f13;width: 49px;"; 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) { if (typeof(h4Element.childNodes) !== "undefined" && h4Element.childNodes !== null) {
for (var ii=0, childNode; childNode = h4Element.childNodes[ii]; ii++) { for (var ii=0, childNode; childNode = h4Element.childNodes[ii]; ii++) {
if (typeof(childNode.nodeValue) !== "undefined" && childNode.nodeValue !== null) { 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 return true
} }
} }
@@ -263,8 +263,8 @@ JWConfZoomHand
addSelectorToMonitorHeadline(); addSelectorToMonitorHeadline();
startNewAttendeesDetection(); startNewAttendeesDetection();
subscribeAttList(); subscribeAttList();
//folgende Zeile auskommentieren, wenn die Konferenz nicht automatisch verbunden werden solls //die beiden // in der folgenden Zeile entfernen, wenn sich die Konferenz automatisch verbinden soll bzw. // davor setzen wenn sie manuell verbunden werden soll
//document.evaluate('//*[@id="hall"]/div[2]/div[2]/div/div/div[1]/div/a', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue.click() //setTimeout(function(){ document.evaluate('//*[@id="left-column"]/div/div[2]/div[2]/button', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue.click(); }, 1000);
} }
} }
+2 -2
View File
@@ -3,7 +3,7 @@
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtXRV6Vq2HTR6M1ryxP+8c4EvfCNo1K7SY8rkpBAdvZfDuxPB89Tkkm282/pkyl0ppmTyCpYO3bIXPKuDSg5TZfAItfXF2VgoMVUjXwiWy6qSiAkdaoHyNLuQqCcexqNvvqnKgfvkiZBK3HPNJzZFpx9BMFvSoG4RQz7GjYGjqzu95LW6tmI0HAMDKzHihdZ6d6oCgov/yJXIYyUBUSz+uVYpLM2xHRaOxU76AS896RzUNZEV5CUvioclqrmqQDp4gB7NJ2tDODil11T2yE4cVuIz9z/X3eZ7Y1mBmfHK1WnnFb+N5PMu/n1fA6re0bqAg6rT8gZNdeXlcAlytts4nwIDAQAB", "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtXRV6Vq2HTR6M1ryxP+8c4EvfCNo1K7SY8rkpBAdvZfDuxPB89Tkkm282/pkyl0ppmTyCpYO3bIXPKuDSg5TZfAItfXF2VgoMVUjXwiWy6qSiAkdaoHyNLuQqCcexqNvvqnKgfvkiZBK3HPNJzZFpx9BMFvSoG4RQz7GjYGjqzu95LW6tmI0HAMDKzHihdZ6d6oCgov/yJXIYyUBUSz+uVYpLM2xHRaOxU76AS896RzUNZEV5CUvioclqrmqQDp4gB7NJ2tDODil11T2yE4cVuIz9z/X3eZ7Y1mBmfHK1WnnFb+N5PMu/n1fA6re0bqAg6rT8gZNdeXlcAlytts4nwIDAQAB",
"name":"jwconfzoomhand", "name":"jwconfzoomhand",
"short_name":"JWConfZoomHand", "short_name":"JWConfZoomHand",
"version":"2021.01.10", "version":"2021.08.28",
"manifest_version":2, "manifest_version":2,
"default_locale": "de", "default_locale": "de",
"description":"-", "description":"-",
@@ -31,6 +31,6 @@
"activeTab", "activeTab",
"nativeMessaging" "nativeMessaging"
], ],
"homepage_url": "http://test.local" "homepage_url": "http://jwconfzoomhand.local"
} }