From 150b1e9be4d3545c01734f1226ae97fc3e64a447 Mon Sep 17 00:00:00 2001 From: Federico Santandrea <67011878+sntfrc@users.noreply.github.com> Date: Wed, 17 Jun 2020 11:05:36 +0200 Subject: [PATCH] Minor interface things, and disk formatting --- sendalo.html.tpl | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/sendalo.html.tpl b/sendalo.html.tpl index 96f828f..d983a29 100644 --- a/sendalo.html.tpl +++ b/sendalo.html.tpl @@ -2,7 +2,7 @@ - + Sendalo @@ -47,6 +47,7 @@ input#url { width: 300px; + font-size: 1.1em; max-width: 90%; } @@ -70,6 +71,10 @@ text-align: center; } + #audio { + display: none; + } + #playbutton { width: 10em; height: 2em; @@ -104,6 +109,13 @@ xhr.send("url=" + encodeURI(requestURL)); } + + var pb = document.getElementById('playbutton'); + pb.value = 'Please wait...'; + pb.enabled = false; + document.getElementById('url').enabled = false; + document.getElementById('upload').enabled = false; + document.getElementById('format').enabled = false; } function downloadComplete(what) { @@ -122,12 +134,35 @@ audio = document.getElementById('audio'); source = document.getElementById('source'); source.src = u; + + document.getElementById('playbutton').style.display = 'none'; + audio.style.display = 'block'; audio.load(); audio.play(); + + } function displayError() { alert('Error: only 140K DOS-order images are supported for now. That doesn\'t look like one.'); + + var pb = document.getElementById('playbutton'); + pb.value = 'Play!'; + pb.enabled = false; + document.getElementById('url').enabled = true; + document.getElementById('upload').enabled = true; + document.getElementById('format').enabled = true; + } + + function resetFile() { + document.getElementById('fc').innerHTML = ''; + document.getElementById('url').placeholder = 'https://...'; + } + + function resetURL() { + var txt = document.getElementById('url'); + txt.value=''; + txt.placeholder = '-- uploaded file --'; } @@ -140,11 +175,10 @@
-
-
+
+




-