diff src/chat.js @ 72:bce0480721c1

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 08 Mar 2025 17:29:57 -0700
parents f067de76084c
children a63faf49e1d7
line wrap: on
line diff
--- a/src/chat.js	Thu Mar 06 20:43:54 2025 -0700
+++ b/src/chat.js	Sat Mar 08 17:29:57 2025 -0700
@@ -245,19 +245,10 @@
 		if( online[id] < old )
 			delete online[id];
 	}
-	let a = [];
-	for( let id in online ) {
-		a.push( `span[online="${id}"]` );
-	}
-	let style = document.querySelector('style[online]');
-	if( a.length === 0 ) {
-		style.innerHTML = '';
-	} else {
-		style.innerHTML = `
-			${a.join(', ')} {
-				background-color: green;
-			}
-`		;
+	let spans = document.querySelectorAll('span[online]');
+	for( let span of spans ) {
+		let id = span.getAttribute('online');
+		span.setAttribute('is_online',!!online[id]);
 	}
 }