# HG changeset patch # User drewp@bigasterisk.com # Date 2018-06-10 19:45:36 # Node ID 736784c0db935cb0a713ce23ed1f13abb353e459 # Parent 741bfcc0b47c5e42e7a5144dd2664c28a46a61cb ascoltami: Go button, style updates Ignore-this: df26b8c9e6774055a0196592151adfe8 diff --git a/light9/ascoltami/index.html b/light9/ascoltami/index.html --- a/light9/ascoltami/index.html +++ b/light9/ascoltami/index.html @@ -9,6 +9,9 @@ +

ascoltami on ${host}

@@ -41,7 +44,7 @@ - + @@ -90,6 +93,7 @@ $(data.playing ? "#cmd-play" : "#cmd-stop").addClass("active"); lastPlaying = data.playing; } + $("#next").text(data.next); doneCallback(); }); } @@ -134,7 +138,10 @@ if (ev.which == 105) { $("#cmd-intro").click(); return false; } if (ev.which == 116) { $("#cmd-post").click(); return false; } - if (ev.which == 32) { $("#cmd-go").click(); return false; } + if (ev.key == 'g') { + $("#cmd-go").click(); + return false; + } return true; }); diff --git a/light9/ascoltami/webapp.py b/light9/ascoltami/webapp.py --- a/light9/ascoltami/webapp.py +++ b/light9/ascoltami/webapp.py @@ -39,6 +39,14 @@ class timeResource(PrettyErrorHandler,cy player = self.settings.app.player graph = self.settings.app.graph self.set_header("Content-Type", "application/json") + + if player.isAutostopped(): + nextAction = 'finish' + elif player.isPlaying(): + nextAction = 'disabled' + else: + nextAction = 'play' + self.write(json.dumps({ "song" : playerSongUri(graph, player), "started" : player.playStartTime, @@ -46,6 +54,7 @@ class timeResource(PrettyErrorHandler,cy "playing" : player.isPlaying(), "t" : player.currentTime(), "state" : player.states(), + "next" : nextAction, })) def post(self): @@ -109,7 +118,9 @@ class goButton(PrettyErrorHandler, cyclo """ graph, player = self.settings.app.graph, self.settings.app.player - if player.isPlaying(): + if player.isAutostopped(): + player.resume() + elif player.isPlaying(): pass else: player.resume() diff --git a/light9/web/style.css b/light9/web/style.css --- a/light9/web/style.css +++ b/light9/web/style.css @@ -40,13 +40,19 @@ input[type=text] { } .songs button { display: inline-block; - width: 200px; + width: 15em; height: 50px; text-align: left; background: black; color: white; margin: 2px; - font-size: 115%; + font-size: 130% !important; + font-weight: bold; + text-shadow: -1px -1px 0 #000, + 1px -1px 0 #000, + -1px 1px 0 #000, + 1px 1px 0 #000; + white-space: nowrap; } button a { color: white; @@ -62,13 +68,13 @@ button a { padding: 20px } .commands button.active { - background: #1C4054; + background: #a90707; } .key { color: #888; } .currentSong button { - background: #55A5C9; + background: #a90707; } .timeRow { margin: 14px; @@ -80,7 +86,13 @@ button a { font-size: 27px; color: rgb(233, 122, 122); display: inline-block; - padding: 10px + padding: 10px; + font-size: 200% !important; + font-weight: bold; + text-shadow: -1px -1px 0 #000, + 1px -1px 0 #000, + -1px 1px 0 #000, + 1px 1px 0 #000; } .dropTarget { @@ -122,7 +134,7 @@ button a { /* ascoltami mini mode */ @media (max-height: 600px) { .songs { - -webkit-column-width: 9em; + -webkit-column-width: 12em; } .songs button { font-size: initial;