diff --git a/webclient/css/ws.css b/webclient/css/ws.css index 582894a..ae6e39a 100755 --- a/webclient/css/ws.css +++ b/webclient/css/ws.css @@ -289,8 +289,7 @@ a { height: 50px !important; } - -#controlspopupimage, #coverpopupimage, #artistpopupimage { +#buttons, #controlspopupimage, #coverpopupimage, #artistpopupimage { display: block; margin-left: auto; margin-right: auto diff --git a/webclient/images/icons/fork_21x24.png b/webclient/images/icons/fork_21x24.png new file mode 100755 index 0000000..15af7ac Binary files /dev/null and b/webclient/images/icons/fork_21x24.png differ diff --git a/webclient/images/icons/layers_24x21.png b/webclient/images/icons/layers_24x21.png new file mode 100755 index 0000000..f8ddd79 Binary files /dev/null and b/webclient/images/icons/layers_24x21.png differ diff --git a/webclient/index.html b/webclient/index.html index b55f8f0..57dd6de 100755 --- a/webclient/index.html +++ b/webclient/index.html @@ -44,29 +44,30 @@

bbb

- +
Close

bbb

- +
Close -

+

  -

- - - -
+  

+
+ + + +

- +
@@ -79,7 +80,7 @@ Play Track
  • - Add tracks to bottom of queue + Add tracks to bottom of queue
  • Show Album @@ -104,11 +105,7 @@
  • - - -
    -
    -
    +
    @@ -213,7 +210,7 @@ - + diff --git a/webclient/js/controls.js b/webclient/js/controls.js index 666de89..1ae495d 100644 --- a/webclient/js/controls.js +++ b/webclient/js/controls.js @@ -8,8 +8,6 @@ function playTrack(addtobottom) { //function playtrack(uri, playlisturi) { playlisturi = $('#popupTracks').data("list"); uri = $('#popupTracks').data("track"); - //console.log(uri); - //console.log(playlisturi); var trackslist = new Array(); var track; switchContent('current', uri); @@ -24,9 +22,11 @@ function playTrack(addtobottom) { } else { tracks = currentplaylist; } - - if (addtobottom) { return false;} - + + if (addtobottom) { + return false; + } + mopidy.playback.stop(true); for (var i = 0; i < tracks.length; i++) { @@ -47,6 +47,12 @@ function playTrack(addtobottom) { * Buttons */ +function doShuffle() { + mopidy.playback.stop(true); + mopidy.tracklist.shuffle(); + mopidy.playback.play(); +} + /* Toggle state of play button */ function setPlayState(nwplay) { if (nwplay) { @@ -180,7 +186,6 @@ function setPosition(pos) { function setVolume(value) { var oldval = initgui; - console.log('volume: ' + value); initgui = true; $("#volumeslider").val(value).slider('refresh'); initgui = oldval; @@ -238,4 +243,3 @@ function initTimer() { function pauseTimer() { clearInterval(posTimer); } - diff --git a/webclient/js/functionsvars.js b/webclient/js/functionsvars.js index 93b0475..c1c6bd1 100755 --- a/webclient/js/functionsvars.js +++ b/webclient/js/functionsvars.js @@ -63,7 +63,13 @@ STATUS_TIMER = 10000; */ function scrollToTop() { var divtop = 0; - // console.log(divtop); + $('body,html').animate({ + scrollTop : divtop + }, 250); +} + +function scrollToTracklist() { + var divtop = $("#playlisttablediv").offset().top - 25; $('body,html').animate({ scrollTop : divtop }, 250); @@ -133,8 +139,6 @@ function resultsToTables(results, target, uri) { nexturi = results[i + 1].album.uri; } if (results[i].album.uri != nexturi) { - // console.log(i); - tableid = 'art' + i; html += '
  • '; html += ''; @@ -161,7 +165,6 @@ function resultsToTables(results, target, uri) { newalbum = []; } } - //console.log(html); tableid = "#" + tableid; $(target).html(html); $(target).attr('data', uri); @@ -175,24 +178,6 @@ function playlisttotable(pl, table, uri) { var child = ''; for (var i = 0; i < pl.length; i++) { - /* var child = '
  • ' + pl[i].name + "

    "; - child += '

    ' + timeFromSeconds(pl[i].length / 1000) + '

    '; - // console.log(i); - child += '

    '; - for (var j = 0; j < pl[i].artists.length; j++) { - child += '' + pl[i].artists[j].name + ""; - //stop after 3 - if (j > 2) { - child += '...'; - break; - } - } - // child += ''; - child += ' / ' + pl[i].album.name + '

    '; - child += '
  • '; - //console.log(child); - tmp += child; - */ popupData[pl[i].uri] = pl[i]; child = '
  • '; diff --git a/webclient/js/gui.js b/webclient/js/gui.js index c5bee0d..edd7632 100755 --- a/webclient/js/gui.js +++ b/webclient/js/gui.js @@ -99,7 +99,6 @@ function setSongInfo(data) { function popupTracks(e, listuri, trackuri) { if (!e) var e = window.event; - //console.log('list: ' + listuri + ', track: ' + trackuri); $('#popupTrackName').html(popupData[trackuri].name); $('#popupAlbumName').html(popupData[trackuri].album.name); var child = ""; @@ -120,13 +119,11 @@ function popupTracks(e, listuri, trackuri) { })))); $('#popupArtistsDiv').hide(); - // console.log(child); // $('#popupArtistsLi').html(child).show(); } else { for (var j = 0; j < popupData[trackuri].artists.length; j++) { child += '
  • ' + popupData[trackuri].artists[j].name + '
  • '; } - //console.log(child); $('#popupArtistsLi').hide(); $('#popupArtistsLv').html(child).show(); $('#popupArtistsDiv').show(); @@ -273,7 +270,6 @@ $(document).ready(function() { window.onhashchange = locationHashChanged; // Log all events mopidy.on(function() { - // console.log(arguments); }); //update gui status every x seconds from mopdidy diff --git a/webclient/js/library.js b/webclient/js/library.js index f57e2dd..2bca96e 100644 --- a/webclient/js/library.js +++ b/webclient/js/library.js @@ -114,12 +114,11 @@ function showTracklist(uri) { showLoading(true); var pl = getPlaylistFromUri(uri); - // console.log (pl); //load from cache if (pl) { playlisttotable(pl.tracks, PLAYLIST_TABLE, uri); } - scrollToTop(); + scrollToTracklist(); //lookup recent tracklist mopidy.playlists.lookup(uri).then(processGetTracklist, console.error); return false; diff --git a/webclient/js/process_ws.js b/webclient/js/process_ws.js index 833653d..22796c2 100755 --- a/webclient/js/process_ws.js +++ b/webclient/js/process_ws.js @@ -41,14 +41,12 @@ function processRandom(data) { function processCurrentposition(data) { var pos = parseInt(data); setPosition(pos); - // console.log('pos:' + pos); } /******************************************************** * process results playstate *********************************************************/ function processPlaystate(data) { - // console.log(data); if (data == 'playing') { setPlayState(true); resumeTimer(); @@ -86,13 +84,12 @@ function processGetPlaylists(resultArr) { function processGetTracklist(resultArr) { //cache result var newplaylisturi = resultArr.uri; - //console.log(newplaylisturi); playlists[newplaylisturi] = resultArr; resultsToTables(playlists[newplaylisturi].tracks, PLAYLIST_TABLE, newplaylisturi); // playlisttotable(playlists[newplaylisturi].tracks, PLAYLIST_TABLE, newplaylisturi); // $('#playlistloader').hide(); showLoading(false); - scrollToTop(); + scrollToTracklist(); } /********************************************************