diff --git a/webclient/css/webclient.css b/webclient/css/webclient.css index e09a582..0f237cd 100755 --- a/webclient/css/webclient.css +++ b/webclient/css/webclient.css @@ -287,7 +287,7 @@ background-color: #ddd !important; } -#browselist li a, #playlistslist li a { +#playlistslist li a { padding: 7px; } diff --git a/webclient/index.html b/webclient/index.html index d287e41..3aa1039 100755 --- a/webclient/index.html +++ b/webclient/index.html @@ -389,6 +389,7 @@ + diff --git a/webclient/js/controls.js b/webclient/js/controls.js index 4098917..87deb1b 100755 --- a/webclient/js/controls.js +++ b/webclient/js/controls.js @@ -9,7 +9,6 @@ function playBrowsedTracks(addtoqueue, trackid) { } toast('Loading...'); var selected = 0, counter = 0; - //only add one station for dirble, otherwise add all tracks if ( trackid.indexOf('dirble') != -1 ) { mopidy.tracklist.add(null, null, trackid); @@ -17,15 +16,13 @@ function playBrowsedTracks(addtoqueue, trackid) { //add all items in the playlist $('.browsetrack').each(function() { mopidy.tracklist.add(null, null, this.id); - if (this.id = trackid) { + if (this.id == trackid) { selected = counter; - } - counter++; + } + counter++; } ); } - selected = counter - selected; - for (var i = 0; i <= selected; i++) { mopidy.playback.next(); } diff --git a/webclient/js/functionsvars.js b/webclient/js/functionsvars.js index 3094a1a..a910450 100755 --- a/webclient/js/functionsvars.js +++ b/webclient/js/functionsvars.js @@ -71,7 +71,7 @@ TRACK_TIMER = 1000; //check status timer, every 5 or 10 sec STATUS_TIMER = 10000; - +/* var radioStations = []; //fill with defaults radioStations.push(['NPR 24', 'http://nprdmp.ic.llnwd.net/stream/nprdmp_live01_mp3']); @@ -80,7 +80,7 @@ var radioStations = []; radioStations.push(['Arrow Jazz', 'http://81.173.3.132:8082']); radioStations.push(['PBS Australia', 'http://eno.emit.com:8000/pbsfm_live_64.mp3']); radioStations.push(['Kiss FM Berlin', 'http://stream.kissfm.de/kissfm/mp3-128/internetradio/']); - +*/ /******* * diff --git a/webclient/js/gui.js b/webclient/js/gui.js index ba451e0..69a07cf 100755 --- a/webclient/js/gui.js +++ b/webclient/js/gui.js @@ -259,6 +259,7 @@ function initSocketevents() { }); mopidy.on("event:trackPlaybackStarted", function(data) { + console.log(mopidy); mopidy.playback.getTimePosition().then(processCurrentposition, console.error); setPlayState(true); setSongInfo(data.tl_track.track); @@ -310,7 +311,7 @@ $(document).bind("pageinit", function() { }); /************************ - * diverse + * gui stuff ************************/ function enterFullscreen() { if (isMobileSafari) { alert ("To get this app in Full Screen, you have to add it to your home-screen using the Share button."); exit(); } @@ -485,7 +486,7 @@ $(document).ready(function(event) { // Connect to server mopidy = new Mopidy(); // mopidy.on(console.log.bind(console)); // Log all events - +// mopidy.on(console.error.bind(console)); //initialize events initSocketevents(); @@ -498,9 +499,6 @@ $(document).ready(function(event) { initgui = false; window.onhashchange = locationHashChanged; - // Log all events - //mopidy.on(function() { - //}); //update gui status every x seconds from mopdidy setInterval(updateTimer, STATUS_TIMER); @@ -584,14 +582,4 @@ $(document).ready(function(event) { event.stopImmediatePropagation(); } } ); -//mopidy.on("state:online", debug); - }); - -function debug() { - if (mopidy.tracklist === undefined) { - alert('Broke at ' + new Date()); - } else { - setTimeout(debug, 100); - } -} diff --git a/webclient/js/process_ws.js b/webclient/js/process_ws.js index cdaa822..f7949e8 100755 --- a/webclient/js/process_ws.js +++ b/webclient/js/process_ws.js @@ -66,7 +66,7 @@ function processBrowseDir(resultArr) { if ((!resultArr) || (resultArr == '')) { return; } -// console.log(resultArr); + console.log(resultArr); if (resultArr.length == 0) { return; @@ -100,18 +100,19 @@ function processBrowseDir(resultArr) { if (rooturi.indexOf(':') == -1 ) { rooturi = ''; - child += '
  • ..
  • '; + child += '
  • ..

  • '; } else { - child += '
  • ..
  • '; + child += '
  • ..

  • '; } // console.log('new:' + rooturi); for (var i = 0; i < resultArr.length; i++) { if(resultArr[i].type == 'track' ) { - child += '
  • ' + resultArr[i].name + '
  • '; +// console.log(resultArr[i]); + child += '
  • ' + resultArr[i].name + '

  • '; } else { - child += '
  • ' + resultArr[i].name + '
  • '; + child += '
  • ' + resultArr[i].name + '

  • '; } }; // console.log(child); diff --git a/webclient/js/radiostations.js b/webclient/js/radiostations.js new file mode 100755 index 0000000..d872bc5 --- /dev/null +++ b/webclient/js/radiostations.js @@ -0,0 +1,12 @@ +/** + * Default Radiostations + */ + +var radioStations = []; +//fill with defaults + radioStations.push(['NPR 24', 'http://nprdmp.ic.llnwd.net/stream/nprdmp_live01_mp3']); + radioStations.push(['3FM Dutch', 'http://icecast.omroep.nl/3fm-bb-mp3']); + radioStations.push(['BBC WorldService', 'http://vprbbc.streamguys.net:8000/vprbbc24.mp3']); + radioStations.push(['Arrow Jazz', 'http://81.173.3.132:8082']); + radioStations.push(['PBS Australia', 'http://eno.emit.com:8000/pbsfm_live_64.mp3']); + radioStations.push(['Kiss FM Berlin', 'http://stream.kissfm.de/kissfm/mp3-128/internetradio/']);