From d5c03ec36c38a3a7a3ffa0487a1e5d9feef3cf59 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 20 Sep 2014 00:46:18 +0000 Subject: parsing showlist return values diff --git a/index.html b/index.html index 5e7fbaf..6110def 100644 --- a/index.html +++ b/index.html @@ -42,8 +42,42 @@ $('#alertbox').html('
×

' + heading + '

' + message + '
'); } + var weekday = new Array(7); + weekday[0] = "Sonntag"; + weekday[1] = "Montag"; + weekday[2] = "Dienstag"; + weekday[3] = "Mittwoch"; + weekday[4] = "Donnerstag"; + weekday[5] = "Freitag"; + weekday[6] = "Samstag"; + function updateShowsList(data, status, req) { - alert(data); + shows_list = []; + $('#show-selector').find('option').remove(); + var dblist = $(data).find("dropboxList"); + var dbs = dblist.children(); + dbs.each(function() { + type = $(this).find('type').text(); + if(type == 'show') { + var show = { + id: $(this).find('showid').text(), + title: $(this).find('show-title').text(), + dow: $(this).find('show-dayofweek').text(), + rhythm: $(this).find('show-rhythm').text(), + starttime: $(this).find('show-starttime').text(), + length: $(this).find('show-length').text(), + group: $(this).find('group').text(), + normlevel: $(this).find('normalization-level').text(), + trimlevel: $(this).find('autotrim-level').text(), + } + + var name = show.title + ' (' + show.rhythm + ', ' + weekday[show.dow] + ', ' + show.starttime + ', ' + show.length + ' Min.)'; + $('#show-selector').append($('