From 0000568e2ba12afaa05b5f13df93d1216f6c3509 Mon Sep 17 00:00:00 2001 From: Leah Date: Sat, 6 Mar 2021 14:47:36 +0100 Subject: [PATCH] new key-combo: ESC for goto parent folder (#4) Merge branch 'master' of destiny.zotan.network:ctucx/webmusic click on back element instead of window.location override add id to back button, use list elements Merge branch 'master' into master new key-combo: ESC for goto parent folder Co-authored-by: Leah (ctucx) Co-authored-by: Laura Hausmann Reviewed-on: https://git.zotan.services/zotan/webmusic/pulls/4 Co-Authored-By: Leah Co-Committed-By: Leah --- Pages/Index.cshtml | 10 ++++++---- webmusic.css | 6 +++++- webmusic.js | 6 +++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Pages/Index.cshtml b/Pages/Index.cshtml index c4a5b7e..f57e79e 100644 --- a/Pages/Index.cshtml +++ b/Pages/Index.cshtml @@ -16,16 +16,17 @@ else { @Model.Displaypath [..] - Go back + Go back
[--] Download playlist

@foreach (var dir in Model.Dirs) { +
  • [--] @dir -
    +
  • } @foreach (var file in Model.Files) { var jspath = IndexModel.Encode(Model.Fullpath); @@ -34,6 +35,7 @@ else { var lrcfile = basename + ".lrc"; var lrcpath = System.IO.Path.Combine(Model.Fullpath, lrcfile); +
  • [DL] @if (System.IO.File.Exists(lrcpath)) { @@ -43,6 +45,6 @@ else { [---] } @file -
    +
  • } -} \ No newline at end of file +} diff --git a/webmusic.css b/webmusic.css index 8b370dc..4b63880 100644 --- a/webmusic.css +++ b/webmusic.css @@ -40,4 +40,8 @@ h2, h2 a { #container { margin-left: 10%; margin-right: 10%; -} \ No newline at end of file +} + +li { + list-style: none; +} diff --git a/webmusic.js b/webmusic.js index 03e57a3..2864bcd 100644 --- a/webmusic.js +++ b/webmusic.js @@ -50,6 +50,9 @@ window.onkeyup = function (event) { else if (event.key === "ArrowRight") { sound.seek(sound.seek()+10); } + else if (event.key === "Escape") { + document.getElementById("back").click(); + } }; @@ -80,6 +83,7 @@ function playSong(url) { src: [url], html5: true }); + setState("loading"); sound.play(); sound.loop(repeat); @@ -162,4 +166,4 @@ function formatTime(secs) { const minutes = Math.floor(secs / 60) || 0; const seconds = (secs - minutes * 60) || 0; return minutes + ':' + (seconds < 10 ? '0' : '') + seconds; -} \ No newline at end of file +}