\
\
@@ -26,6 +38,21 @@ $(window).on('load', function(){
});
}
+ function get_station_ids(){
+ return ["89920","44707"]
+ };
+
+ function render_stations(station_ids){
+ for (stationid in station_ids){
+ $.ajax({
+ method: "GET",
+ url: "https://www.radio-browser.info/webservice/json/stations/byid/"+station_ids[stationid],
+ dataType: 'json',
+ success: render_result
+ });
+ };
+ };
+
function radio_query(type, query){
switch (type) {
case 0:
@@ -50,7 +77,8 @@ $(window).on('load', function(){
};
function switch_menu(type) {
- $('#app-navigation').find('li').removeClass("active");;
+ $('#app-navigation').find('li').removeClass("active");
+ $("tbody > tr").remove();
switch (type) {
case 0:
$('li.nav-files').addClass('active');
@@ -62,11 +90,14 @@ $(window).on('load', function(){
break;
case 2:
$('li.nav-favorite').addClass('active');
+ station_ids = get_station_ids()
+ render_stations(station_ids)
break;
}
}
$('#radiosearch').submit(function() {
+ $("tbody > tr").remove();
var query = $('#radioquery').val();
radio_query(0, query);
});
@@ -79,5 +110,9 @@ $(window).on('load', function(){
switch_menu(1);
});
+ $('a.nav-icon-favorites').click(function() {
+ switch_menu(2);
+ });
+
switch_menu(0);
});
|