pub / tw2html

Checks online status of streams on twitch.tv and lets you watch them
git clone https://src.jayvii.de/pub/tw2html.git
Home | Log | Files | Exports | Refs | README | RSS

commit 60c697f7d82f0c9a7aba9a2fc4f81df0d02d1fdc
parent c753c47be1f8d539fddad1e56d32e976177c1c8c
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Sat, 24 Feb 2024 18:27:43 +0100

apply preview class to iframes correctly

Diffstat:
Massets/js/twitch.js | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/assets/js/twitch.js b/assets/js/twitch.js @@ -8,19 +8,19 @@ function toggle_player(stream, img64) { player.height = "100%"; player.frameborder = "0"; player.scrolling = "no"; - player.class = "preview"; player.src = "https://player.twitch.tv/?channel=" + stream + "&parent=" + window.location.hostname; player.id = "play-" + stream; + player.classList.add("preview"); img.replaceWith(player); } if (ply != null) { var image = document.createElement("img"); - image.class= "preview"; image.src = img64; image.id = "img-" + stream; + image.classList.add("preview"); ply.replaceWith(image); } } @@ -38,12 +38,12 @@ function toggle_chat(stream) { chatembed.height = "100vh"; chatembed.frameborder = "0"; chatembed.scrolling = "auto"; - chatembed.class = "preview"; /* FIXME: not the correct class */ chatembed.src = "https://www.twitch.tv/embed/" + stream + "/chat?parent=" + window.location.hostname; chatembed.id = "chat-" + stream; + chatembed.classList.add("preview"); /* FIXME: wrong class */ plho.replaceWith(chatembed); } }