diff options
author | Christian Pointner <equinox@helsinki.at> | 2014-09-20 02:49:19 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2014-09-20 02:49:19 (GMT) |
commit | 53967167a2255704e8ed5111abeec9cdc6321dc3 (patch) | |
tree | 7142c08df407085aeb341493877ffe73e8a5c742 /index.html | |
parent | 9c826333ad5ff390d207122acf0466e7361924f7 (diff) |
improved concurrency
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -85,8 +85,6 @@ group_carts.push(cart); } ); - - updateShowListing(); } function updateShowCartList(data, status, req) { @@ -94,13 +92,12 @@ var cartlist = $(data).find("logList"); var carts = cartlist.children(); carts.each(function() { - show_carts.push($(this).find('cartNumber').text()); + var number = $(this).find('cartNumber').text(); + if(number >= 100000) { // TODO: hardcoded value.... + show_carts.push(number); + } } ); - - 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() { @@ -114,9 +111,22 @@ show_carts = []; data = { COMMAND: 22, LOGIN_NAME: username, PASSWORD: token, NAME: current_show.log }; - $.post("/rd-bin/rdxport.cgi", data, updateShowCartList, "xml"); + scd = $.post("/rd-bin/rdxport.cgi", data, updateShowCartList, "xml"); + + group_carts = []; + data = { COMMAND: 6, LOGIN_NAME: username, PASSWORD: token, GROUP_NAME: current_show.group, INCLUDE_CUTS: 1 }; + gcd = $.post("/rd-bin/rdxport.cgi", data, updateGroupCartList, "xml"); + + $.when(scd, gcd).done( + function(scres, gcres) { + if(scres[1] == 'success' && gcres[1] == 'success') { + updateShowListing(); + } + } + ); } + function updateShowsList(data, status, req) { shows_list = []; $('#show-selector').find('option').remove(); |