From dc133013ae2ea18507d55dc692d089c99c3a464d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 20 Sep 2014 02:09:00 +0000 Subject: group and show cart lists get imported now diff --git a/index.html b/index.html index 4b7d76b..926215e 100644 --- a/index.html +++ b/index.html @@ -52,14 +52,67 @@ weekday[6] = "Samstag"; + + var shows_list = []; + var current_show; + var group_carts = []; + var show_carts = []; + + function updateShowListing() { + $('#show-carts').find('tr:gt(0)').remove(); + + } + + function updateGroupCartList(data, status, req) { + show_carts = []; + $('#show-carts').find('tr:gt(0)').remove(); + var cartlist = $(data).find("cartList"); + var carts = cartlist.children(); + carts.each(function() { + var cut = $(this).find("cutList").get(0); + cart = { + number: $(this).find('number').text(), + title: $(this).find('title').text(), + length: $(cut).find('length').text(), + imported: new Date($(cut).find('originDatetime').text()), + playcnt: new Date($(cut).find('playCounter').text()), + lastplayed: new Date($(cut).find('lastPlayDatetime').text()), + }; + group_carts.push(cart); + } + ); + + updateShowListing(); + } + + function updateShowCartList(data, status, req) { + show_carts = []; + var cartlist = $(data).find("logList"); + var carts = cartlist.children(); + carts.each(function() { + if($(this).find('groupName').text() == current_show.group) { + show_carts.push($(this).find('cartNumber').text()); + } + } + ); + + group_carts = []; + data = { COMMAND: 6, LOGIN_NAME: username, PASSWORD: token, GROUP_NAME: current_show.group, INCLUDE_CUTS: 1 }; + $.post("/rd-bin/rdxport.cgi", data, updateGroupCartList, "xml"); + } + function showSelectedShow() { var id = $('#show-selector option:selected').attr('value'); - var show = $.grep(shows_list, function(elem) { return elem.id == id; })[0]; - $('#show-title').text(show.title); - $('#show-dow').text(weekday[show.dow]); - $('#show-rhythm').text(show.rhythm); - $('#show-starttime').text(show.starttime); - $('#show-length').text(show.length + ' Min.'); + current_show = $.grep(shows_list, function(elem) { return elem.id == id; })[0]; + $('#show-title').text(current_show.title); + $('#show-dow').text(weekday[current_show.dow]); + $('#show-rhythm').text(current_show.rhythm); + $('#show-starttime').text(current_show.starttime); + $('#show-length').text(current_show.length + ' Min.'); + + show_carts = []; + data = { COMMAND: 22, LOGIN_NAME: username, PASSWORD: token, NAME: current_show.log }; + $.post("/rd-bin/rdxport.cgi", data, updateShowCartList, "xml"); } function updateShowsList(data, status, req) { @@ -89,11 +142,10 @@ shows_list.push(show); } } - ) - showSelectedShow() + ); + showSelectedShow(); } - var shows_list = []; function app_shows_init() { shows_list = []; data = { LOGIN_NAME: username, PASSWORD: token }; @@ -274,7 +326,7 @@
- +
-- cgit v0.10.2
Cart #