From e082628cf6b56fe5e09e879fe1d7e9302cc4ca00 Mon Sep 17 00:00:00 2001 From: Wouter van Wijk Date: Wed, 20 Feb 2013 15:46:58 +0100 Subject: [PATCH] small gui changes --- webclient/css/ws.css | 12 +++++++---- webclient/index.html | 11 +++------- webclient/js/controls.js | 9 +++++--- webclient/js/functionsvars.js | 3 ++- webclient/js/gui.js | 39 +++++++++++++++++------------------ 5 files changed, 38 insertions(+), 36 deletions(-) diff --git a/webclient/css/ws.css b/webclient/css/ws.css index 0bb6967..860b484 100755 --- a/webclient/css/ws.css +++ b/webclient/css/ws.css @@ -87,7 +87,7 @@ display: none; } .header-breakpoint.ui-grid-b .ui-block-c { - width: 35%; + width: 33%; } /*playlists*/ .pl-breakpoint .ui-block-a, .pl-breakpoint .ui-block-b { @@ -100,8 +100,14 @@ /*controls*/ #btcontrols { display: block; + } +} + +/* phone portrait */ +@media all and (max-width: 20em) { + .header-breakpoint.ui-grid-b .ui-block-c { + display: none; } - } /*********** @@ -150,7 +156,6 @@ color: #ddd; font-size: 14px; text-shadow: 1px 1px #555; - /* border: 1px solid white; */ } #songinfo { @@ -179,7 +184,6 @@ width: 36px; heigth: 36px; margin-right: 5px; - /* border: 1px solid #666; */ margin-top: -3px; } diff --git a/webclient/index.html b/webclient/index.html index 31a0835..e1715c7 100755 --- a/webclient/index.html +++ b/webclient/index.html @@ -32,7 +32,7 @@ - + @@ -106,7 +106,7 @@
-
+
@@ -124,7 +124,6 @@
-
@@ -132,7 +131,6 @@

Play Queue

-
@@ -140,7 +138,6 @@

-
@@ -148,7 +145,6 @@

-
@@ -159,7 +155,6 @@
-
@@ -205,7 +200,7 @@
- + diff --git a/webclient/js/controls.js b/webclient/js/controls.js index 99fa89d..6b66683 100644 --- a/webclient/js/controls.js +++ b/webclient/js/controls.js @@ -4,30 +4,32 @@ function playTrack(addtobottom) { $('#popupTracks').popup('close'); $('#controlsmodal').popup('close'); + showLoading(true); //function playtrack(uri, playlisturi) { playlisturi = $('#popupTracks').data("list"); uri = $('#popupTracks').data("track"); var trackslist = new Array(); var track; - switchContent('current', uri); var tracks = getTracksFromUri(playlisturi); - if (tracks) { if (!addtobottom) { + mopidy.playback.stop(true); mopidy.tracklist.clear(); } mopidy.tracklist.add(tracks); $(CURRENT_PLAYLIST_TABLE).empty(); } else { tracks = currentplaylist; + mopidy.playback.stop(true); } if (addtobottom) { + showLoading(false); return false; } - mopidy.playback.stop(true); + switchContent('current', uri); for (var i = 0; i < tracks.length; i++) { if (tracks[i].uri == uri) { @@ -39,6 +41,7 @@ function playTrack(addtobottom) { mopidy.playback.next(); } mopidy.playback.play(); + showLoading(false); return false; } diff --git a/webclient/js/functionsvars.js b/webclient/js/functionsvars.js index 36a1f0c..ce20bda 100755 --- a/webclient/js/functionsvars.js +++ b/webclient/js/functionsvars.js @@ -172,12 +172,13 @@ function resultsToTables(results, target, uri) { } html += ' / ' + newalbum[0].album.name + '

'; html += ''; + popupData[newalbum[0].uri] = newalbum[0]; newalbum = []; } else { html += '
  • '; html += ''; - html += '

    ' + results[i].album.name + '

    '; + html += '

    ' + results[i].album.name + '

    '; for ( j = 0; j < results[i].album.artists.length; j++) { html += results[i].album.artists[j].name; html += (j == results[i].album.artists.length - 1) ? '' : ' / '; diff --git a/webclient/js/gui.js b/webclient/js/gui.js index 2087fe0..c7cbd77 100755 --- a/webclient/js/gui.js +++ b/webclient/js/gui.js @@ -25,26 +25,22 @@ function expandSonginfo() { function resizeSonginfo() { $("#infoname").html(songname); - if ((artiststext.length > 83) || (songname.length > 43)) { - $("#infoartist").html(artiststext); - //bug in truncate? - var spanwidth = $("#infoartist").width() - 38; - $("#infoname").truncate({ - width : spanwidth, - token : '…', - center : true, - multiline : false - }); - $("#infoartist").truncate({ - width : spanwidth, - token : '…', - center : true, - multiline : false - }); - $("#infoartist").html('' + $("#infoartist").html() + ''); - } else { - $("#infoartist").html(artiststext); - } + $("#infoartist").html(artiststext); + //bug in truncate? + var spanwidth = $("#infoartist").width() - 38; + $("#infoname").truncate({ + width : spanwidth, + token : '…', + center : true, + multiline : false + }); + $("#infoartist").truncate({ + width : spanwidth, + token : '…', + center : true, + multiline : false + }); + $("#infoartist").html('' + $("#infoartist").html() + ''); } function setSongInfo(data) { @@ -282,6 +278,9 @@ $(document).ready(function() { $("#btback").hide(); } + $(window).resize(function() { + resizeSonginfo(); + }); }); /************************