From 25b46feac7de598f11840871f3e623e1c00b0e42 Mon Sep 17 00:00:00 2001 From: scoobybejesus Date: Wed, 22 Jun 2022 19:04:36 -0400 Subject: [PATCH] Modify base.html websocket script to update elements on index.html. Modify index.html to show previous two tracks. --- ircradio/templates/base.html | 2 ++ ircradio/templates/index.html | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ircradio/templates/base.html b/ircradio/templates/base.html index 3b8b67c..d774c3b 100644 --- a/ircradio/templates/base.html +++ b/ircradio/templates/base.html @@ -46,6 +46,8 @@ // console.log(event.data); json = JSON.parse(event.data); np = json.now_playing; + document.querySelector("#prev_two").innerText = document.querySelector("#prev_one").innerText; + document.querySelector("#prev_one").innerText = document.querySelector("#now_playing").innerText; document.querySelector("#now_playing").innerText = np; // console.log(np); return false; diff --git a/ircradio/templates/index.html b/ircradio/templates/index.html index 19f892f..e96a388 100644 --- a/ircradio/templates/index.html +++ b/ircradio/templates/index.html @@ -13,8 +13,13 @@

-
Now playing:
-
Nothing here yet
+ +

Now playing:

+
Nothing here yet
+ +
Previous:
+
Nothing here yet
+

Command list: