diff --git a/js/main.js b/js/main.js index bf55be9..f88e091 100644 --- a/js/main.js +++ b/js/main.js @@ -85,6 +85,29 @@ $(function(){ }; }); + /* Playbutton click */ + $('#playbutton').click(function() { + var music = document.getElementById('player'); + if (music.paused && $("#player").attr("src") != "") { + music.play(); + } else { + music.pause(); + } + }); + + /* Click on menus */ + $('a.nav-icon-files').click(function() { + switch_menu(0); + }); + + $('a.nav-icon-recent').click(function() { + switch_menu(1); + }); + + $('a.nav-icon-favorites').click(function() { + switch_menu(2); + }); + /* ============== // ACTIONS // /===============*/ @@ -165,7 +188,7 @@ $(function(){ $.each(data, function(i, station) { var isstarred = "" - + for (var fav_station in fav_stations) { if (fav_stations[fav_station]["stationid"] == station['id']) { isstarred = "starred"; @@ -201,7 +224,12 @@ $(function(){ for (var station in data) { stations.push(data[station]["stationid"]); }; - query_stations(stations); + if (stations.length == 0) { + $('#filestable').hide(); + $('#emptycontent').removeClass('hidden'); + } else { + query_stations(stations); + }; }); }; @@ -268,19 +296,7 @@ $(function(){ break; } }, 500); - } - - $('a.nav-icon-files').click(function() { - switch_menu(0); - }); - - $('a.nav-icon-recent').click(function() { - switch_menu(1); - }); - - $('a.nav-icon-favorites').click(function() { - switch_menu(2); - }); + }; function mySearch(query){ if (query != "") { @@ -299,15 +315,6 @@ $(function(){ } }); - $('#playbutton').click(function() { - var music = document.getElementById('player'); - if (music.paused && $("#player").attr("src") != "") { - music.play(); - } else { - music.pause(); - } - }); - $('#volumeslider').slider({ orientation: "horizontal", value: player.volume, diff --git a/templates/main.php b/templates/main.php index b5a2a41..806b439 100755 --- a/templates/main.php +++ b/templates/main.php @@ -33,6 +33,13 @@
+ + +