From d0f9f400f9900ceb8bafedea5b6535872fc660c1 Mon Sep 17 00:00:00 2001 From: Stefan Ostermann Date: Mon, 28 Aug 2023 22:10:38 +0200 Subject: [PATCH] cleanup, web interface --- src/DirectoryNode.cpp | 19 ++++++++++--------- src/WebContent.h | 30 ++++++++++-------------------- src/css.h | 1 + src/main.cpp | 2 ++ 4 files changed, 23 insertions(+), 29 deletions(-) diff --git a/src/DirectoryNode.cpp b/src/DirectoryNode.cpp index f206154..050d24b 100644 --- a/src/DirectoryNode.cpp +++ b/src/DirectoryNode.cpp @@ -226,15 +226,16 @@ String DirectoryNode::getDirectoryStructureHTML() const { String html; html.reserve(1024); // Reserve memory for better performance - - appendIndentation(html, 0); - html += "\n"; + } return html; } diff --git a/src/WebContent.h b/src/WebContent.h index be4cc42..b51d369 100644 --- a/src/WebContent.h +++ b/src/WebContent.h @@ -8,10 +8,13 @@ const char index_html[] PROGMEM = R"rawliteral(

HannaBox

-

- +
+ + +

+
-
- - - -
- + + +

-

Content of SD Card:

+

Inhalt

%DIRECTORY%

@@ -54,8 +46,6 @@ const char index_html[] PROGMEM = R"rawliteral( liElements.forEach(function(li) { li.addEventListener('click', function() { var liText = this.innerText; - var inputField = document.getElementById('titleid'); - inputField.value = liText; playNamedSong(liText); }); }); diff --git a/src/css.h b/src/css.h index 0815c37..c272cd5 100644 --- a/src/css.h +++ b/src/css.h @@ -29,6 +29,7 @@ li { .play-button.paused { border-style: double; border-width: 0px 0 0px 60px; + height: 74px; } .play-button:hover { border-color: transparent transparent transparent darkgrey; diff --git a/src/main.cpp b/src/main.cpp index 1f5f627..3fb25a1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -174,6 +174,8 @@ String getState() jsonState["playing"] = audio.isRunning(); if (currentNode!=NULL) jsonState["title"] = *currentNode->getCurrentPlaying(); + else + jsonState["title"] = "Angehalten"; jsonState["time"] = audio.getAudioCurrentTime(); jsonState["volume"] = audio.getVolume();