diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2022-12-23 08:51:37 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2022-12-23 08:51:37 +0100 |
| commit | b7f5ed4e5fcb3b51636a9dad79e7e80f7ebbb102 (patch) | |
| tree | 1a8c53db5e7fa34f683c8a0afcb8e33ff104b0a7 /web | |
| parent | 97a9b0e75a57c6b55bab8c50827f5ba4b896fd95 (diff) | |
| download | WRMS-b7f5ed4e5fcb3b51636a9dad79e7e80f7ebbb102.tar.gz WRMS-b7f5ed4e5fcb3b51636a9dad79e7e80f7ebbb102.zip | |
implement local storage backendv0.0.2-alpha
The 'local' backend is able to serve the music from a path specified
by '-server-music-dir'.
Add command line options to select the server port as well as a list
of backends.
Diffstat (limited to 'web')
| -rw-r--r-- | web/client.html | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/web/client.html b/web/client.html index 20a53ed..87ca51a 100644 --- a/web/client.html +++ b/web/client.html @@ -122,10 +122,10 @@ votes.set(song.uri, "down") } - url = "/" + (isUpvoteBtn ? "up" : "down") + "?song=" + song.uri; + url = "/" + (isUpvoteBtn ? "up" : "down") + "?song=" + encodeURIComponent(song.uri); } else { votes.delete(song.uri); - url = "/unvote?song=" + song.uri; + url = "/unvote?song=" + encodeURIComponent(song.uri); } console.log("Get " + url); @@ -137,8 +137,10 @@ listItem.appendChild(upvoteBtn); listItem.appendChild(downvoteBtn); - const itemValue = document.createTextNode(song.weight + ' ' + formatSong(song)); - listItem.appendChild(itemValue); + listItem.appendChild(document.createTextNode(song.weight + ' ' + formatSong(song))); + const sourceLabel = document.createElement("SMALL"); + sourceLabel.innerHTML = " (" + song.source + ")"; + listItem.appendChild(sourceLabel); playlist.appendChild(listItem); } } @@ -257,10 +259,7 @@ }); listItem.classList.add("searchResult") - - let searchResultLabel = document.createTextNode(formatSong(song)); - listItem.appendChild(searchResultLabel); - + listItem.innerHTML = formatSong(song) + " <small>(" + song.source + ")</small>"; searchResults.appendChild(listItem); } |
