diff --git a/webclient/css/ws.css b/webclient/css/ws.css index 7f45cab..6a7baa6 100755 --- a/webclient/css/ws.css +++ b/webclient/css/ws.css @@ -7,7 +7,7 @@ * Responsive stuff ****************************/ -@media all and (min-width: 35.1em) { +@media all and (min-width: 50.1em){ .pl-breakpoint.ui-grid-a .ui-block-a { width: 32.95%; } @@ -18,34 +18,46 @@ clear: left; } .header-breakpoint.ui-grid-b .ui-block-a { - width: 19.95%; + width: 21.95%; } .header-breakpoint.ui-grid-b .ui-block-b { - width: 39.92%; + width: 37.92%; display: block; } .header-breakpoint.ui-grid-b .ui-block-c { - width: 39.92%; + width: 37.1%; display: block; } .pl-breakpoint.ui-grid-a .ui-block-a { clear: left; } + .srch-breakpoint.ui-grid-a .ui-block-b { + margin-left: 5px; + } + .srch-breakpoint.ui-grid-a .ui-block-a, .srch-breakpoint.ui-grid-a .ui-block-b { + width: 49.5%; + } #playlisttablediv { margin-left: 10px; } + #header { + height: 50px !important; + } } @media all and (max-width: 50em) { .header-breakpoint.ui-grid-b .ui-block-a { width: 39.95%; } - .header-breakpoint.ui-grid-b .ui-block-b { - width: 59.92%; - } .header-breakpoint.ui-grid-b .ui-block-c { + width: 59%; + } + .header-breakpoint.ui-grid-b .ui-block-b { display: none; } + #header { + height: 50px !important; + } } @media all and (max-width: 35em) { @@ -53,14 +65,16 @@ width: 100%; float:inherit; } - .header-breakpoint .ui-block-a { - float:inherit; + .header-breakpoint .ui-block-c, .header-breakpoint .ui-block-a { width: 100%; } - .header-breakpoint .ui-block-c, .header-breakpoint .ui-block-b { + .header-breakpoint .ui-block-b { display: none; width: 0; } + #header { + height: 75px !important; + } } /************************ * Volume Slider @@ -107,7 +121,7 @@ * *********************************/ #controldiv { height: 30px; - width: 210px; + width: 230px; margin-left: -5px; display: inline; } @@ -159,14 +173,6 @@ } /* div */ -body { - /* padding-top: 80px; - /* background-image:url('../iages/Chrisdesign_LP_Guitar_black.web.png'); - background-attachment: fixed; - background-repeat:no-repeat; - background-position:right; - */ -} .nobreak, .btsquare { display: inline !important; @@ -218,7 +224,3 @@ body { font-style: oblique; } -#header { - height: 50px !important; -} - diff --git a/webclient/images/start.jpg b/webclient/images/start.jpg new file mode 100644 index 0000000..7b6f4e5 Binary files /dev/null and b/webclient/images/start.jpg differ diff --git a/webclient/index.html b/webclient/index.html index 8f40563..c14e08b 100755 --- a/webclient/index.html +++ b/webclient/index.html @@ -5,6 +5,8 @@ + + -
-
+
Close

-
+

  @@ -157,7 +158,7 @@

-
+

Artists

    @@ -200,7 +201,7 @@
    - + diff --git a/webclient/js/controls.js b/webclient/js/controls.js index d57a0fb..828cd1a 100644 --- a/webclient/js/controls.js +++ b/webclient/js/controls.js @@ -37,6 +37,8 @@ function playTrack() { return false; } + + /********************** * Buttons */ @@ -151,6 +153,10 @@ function triggerPos() { function setPosition(pos) { var oldval = initgui; + if (pos > songlength) { + pos = songlength; + pauseTimer(); + } currentposition = pos; initgui = true; $("#trackslider").val(currentposition).slider('refresh'); @@ -172,7 +178,7 @@ function setVolume(value) { function doVolume(value) { if (!initgui) { console.log('volume: ' + value); - mopidy.playback.setVolume(value); + mopidy.playback.setVolume(parseInt(value)); } } @@ -188,4 +194,32 @@ function doMute() { muteVolume = -1; } -} \ No newline at end of file +} +/******* + * Track timer + */ + +//timer function to update interface +function updateTimer() { + currentposition += TRACK_TIMER; + setPosition(currentposition); + // $("#songelapsed").html(timeFromSeconds(currentposition / 1000)); +} + +function resumeTimer() { + pauseTimer(); + posTimer = setInterval(updateTimer, TRACK_TIMER); +} + +function initTimer() { + pauseTimer(); + // setPosition(0); + resumeTimer(); +} + +function pauseTimer() { + clearInterval(posTimer); +} + + + diff --git a/webclient/js/functionsvars.js b/webclient/js/functionsvars.js index 17b7013..bf9e1a7 100755 --- a/webclient/js/functionsvars.js +++ b/webclient/js/functionsvars.js @@ -23,6 +23,7 @@ var seekTimer; var initgui = true; var currentpos = 0; var popupData = {}; +var songlength = 0; var artistshtml = ''; var artiststext = ''; @@ -36,7 +37,8 @@ var customPlaylists = []; var customTracklists = []; //constants -PROGRAM_NAME = 'Mopidy'; +PROGRAM_NAME = 'MusicBox'; +//PROGRAM_NAME = 'Mopidy'; ARTIST_TABLE = '#artiststable'; ALBUM_TABLE = '#albumstable'; PLAYLIST_TABLE = '#playlisttable'; @@ -45,9 +47,14 @@ SEARCH_ALL_TABLE = '#allresulttable'; SEARCH_ALBUM_TABLE = '#albumresulttable'; SEARCH_ARTIST_TABLE = '#artistresulttable'; SEARCH_TRACK_TABLE = '#trackresulttable'; -//update track timer, milliseconds + +//update track slider timer, milliseconds TRACK_TIMER = 1000; +//check status timer, every 5 or 10 sec +STATUS_TIMER = 10000; + + /******* * */ diff --git a/webclient/js/gui.js b/webclient/js/gui.js index ceb4e20..c521454 100755 --- a/webclient/js/gui.js +++ b/webclient/js/gui.js @@ -74,6 +74,7 @@ function setSongInfo(data) { $("#modalartist").html(arttmp + ': ' + artistshtml); $("#trackslider").attr("min", 0); + songlength = data.length; $("#trackslider").attr("max", data.length); $("#songlength").html(timeFromSeconds(data.length / 1000)); @@ -232,39 +233,11 @@ function initSocketevents() { }); } -/******* - * Track timer - */ - -//timer function to update interface -function updateTimer() { - currentposition += TRACK_TIMER; - setPosition(currentposition); - // $("#songelapsed").html(timeFromSeconds(currentposition / 1000)); -} - -function resumeTimer() { - pauseTimer(); - posTimer = setInterval(updateTimer, TRACK_TIMER); -} - -function initTimer() { - pauseTimer(); - // setPosition(0); - resumeTimer(); -} - -function pauseTimer() { - clearInterval(posTimer); -} - - - /********************** * initialize software **********************/ -//$(document).ready(function() { -$(document).bind("pageinit", function() { +$(document).ready(function() { +//$(document).bind("pageinit", function() { $(window).hashchange(); @@ -273,14 +246,6 @@ $(document).bind("pageinit", function() { //initialize events initSocketevents(); - $('.pane').hide(); - $('.sidebar-nav a').bind('click', function(e) { - var divid = $(e.target).attr('href').substr(1); - var uri = $(divid + "table").attr('data'); - - switchContent(divid, uri); - }); - resetSong(); if (location.hash.length < 2) { @@ -291,7 +256,7 @@ $(document).bind("pageinit", function() { if (window.navigator.standalone) { $("#btback").show(); } else { - $("#btback").hide(); +// $("#btback").hide(); } // $("#songinfo").resize(resizeSonginfo()); @@ -299,10 +264,10 @@ $(document).bind("pageinit", function() { window.onhashchange = locationHashChanged; // Log all events mopidy.on(function() { - // console.log(arguments); + // console.log(arguments); }); - //update gui every x seconds from mopdidy - setInterval(updateStatusOfAll, 5000); + //update gui status every x seconds from mopdidy + setInterval(updateTimer, STATUS_TIMER); }); /************************ @@ -317,6 +282,13 @@ function switchContent(divid, uri) { location.hash = "#" + hash; } +//update timer +function updateStatusOfAll() { + mopidy.playback.getCurrentTrack().then(processCurrenttrack, console.error); + mopidy.playback.getTimePosition().then(processCurrentposition, console.error); +//TODO check offline? +} + //update everything as if reloaded function updateStatusOfAll() { mopidy.playback.getCurrentTrack().then(processCurrenttrack, console.error); @@ -327,8 +299,6 @@ function updateStatusOfAll() { mopidy.playback.getRandom().then(processRandom, console.error); mopidy.playback.getVolume().then(processVolume, console.error); - - //TODO check offline? } function locationHashChanged() { @@ -365,10 +335,9 @@ function locationHashChanged() { } break; } - showLoading(false); // Set the page title based on the hash. - //document.title = PROGRAM_NAME; + document.title = PROGRAM_NAME; $('.pane').hide(); $('#' + divid + 'pane').show(); return false; - } \ No newline at end of file + } diff --git a/webclient/js/library.js b/webclient/js/library.js index 3d2126b..69071fa 100644 --- a/webclient/js/library.js +++ b/webclient/js/library.js @@ -40,7 +40,7 @@ function processSearchResults(resultArr) { $(SEARCH_ARTIST_TABLE).empty(); $(SEARCH_ALBUM_TABLE).empty(); //get the right result - // 0 = raspberry 1 = dev. + // 0 = older raspberry 1 = dev. // var results = resultArr[0]; var results = resultArr[1]; var tracks = (results.tracks) ? results.tracks : '';