diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2022-07-21 01:49:24 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2022-07-21 01:49:24 +0200 |
| commit | a14ffdfc999abd76c2d9937e778c932a457be08f (patch) | |
| tree | 0100d002bf6f50c46d8b3e587f02db12fe2985f9 /web | |
| parent | 318fd2fda65e6a0a329a5fad5be3f81d54ccacff (diff) | |
| download | WRMS-a14ffdfc999abd76c2d9937e778c932a457be08f.tar.gz WRMS-a14ffdfc999abd76c2d9937e778c932a457be08f.zip | |
start implementing song search
Diffstat (limited to 'web')
| -rw-r--r-- | web/client.html | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/web/client.html b/web/client.html index d7f8db2..8e3faab 100644 --- a/web/client.html +++ b/web/client.html @@ -190,6 +190,13 @@ console.log("Socket Error: ", error); }; + function submitSearch() { + const form = new FormData(document.getElementById("searchForm")); + const pattern = new URLSearchParams(form).toString(); + new HttpClient().get("/search?" + pattern, console.log); + return false; + } + window.onload = function() { document.getElementById("ppbutton").addEventListener("click", function() { new HttpClient().get("/playpause", console.log); @@ -199,10 +206,18 @@ </head> <body> + <h2>Add your song</h2> + <div id="add"> + <form id="searchForm" onsubmit="return submitSearch()"> + <input id="searchInput" name="pattern" type="text" value="Title/Artist/Album/..."> + <button id="searchButton">Search</button> + </form> + </div> + <h2>Playing</h2> <p id='playing'></p> <div id='controls'> - <button id="ppbutton" form='ppform'>Play</button> + <button id="ppbutton">Play</button> </div> <h2>Playlist</h2> |
