mirror of
https://github.com/Myxelium/RandomMemerBot.git
synced 2026-04-11 09:39:40 +00:00
Added next play time to html page
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
function loadNextPlaybackTime() {
|
||||
fetch('/nextplaybacktime')
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
const nextPlaybackTime = document.getElementById('nextPlaybackTime');
|
||||
nextPlaybackTime.textContent = `Playing next time: ${data}`;
|
||||
}
|
||||
)
|
||||
.catch(error => console.error('Error:', error));
|
||||
}
|
||||
|
||||
function loadFiles() {
|
||||
// Fetch the JSON data from the /sounds endpoint
|
||||
fetch('/sounds')
|
||||
@@ -51,6 +62,7 @@ function loadFiles() {
|
||||
|
||||
// Call loadFiles when the script is loaded
|
||||
loadFiles();
|
||||
loadNextPlaybackTime();
|
||||
|
||||
document.getElementById('uploadForm').addEventListener('submit', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user