summaryrefslogtreecommitdiff
path: root/static/hide.js
diff options
context:
space:
mode:
authorAndré Glüpker <git@wgmd.de>2017-10-01 14:50:19 +0200
committerAndré Glüpker <git@wgmd.de>2017-10-01 14:50:19 +0200
commit1585395e7e530665c565b88fea15cbea68d3a88d (patch)
tree204033b68d01e27036a68d625f4474f3254880c2 /static/hide.js
downloadsteam-1585395e7e530665c565b88fea15cbea68d3a88d.tar.gz
steam-1585395e7e530665c565b88fea15cbea68d3a88d.tar.bz2
steam-1585395e7e530665c565b88fea15cbea68d3a88d.zip
Initial public release
Diffstat (limited to 'static/hide.js')
-rw-r--r--static/hide.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/static/hide.js b/static/hide.js
new file mode 100644
index 0000000..67cb5c9
--- /dev/null
+++ b/static/hide.js
@@ -0,0 +1,17 @@
+var hidden = false;
+
+function hideOffline() {
+ hidden = !hidden;
+ var playerboxes = document.querySelectorAll('div.Offline');
+ for(index in playerboxes) /* Show/Hide player row */
+ {
+ if(typeof playerboxes[index] != 'object') continue;
+ playerboxes[index].style.display = (hidden) ? 'none' : 'inline-block';
+ }
+ /* And update the text on our button. */
+ document.querySelector('#offlinetoggle').innerHTML = (hidden) ? 'Show Offline' : 'Hide Offline';
+}
+/* Execute function on page load. */
+setTimeout(hideOffline, 1);
+
+// vim: commentstring=/*\ %s\ */