diff options
Diffstat (limited to 'public/static/js/travelynx-actions.js')
-rw-r--r-- | public/static/js/travelynx-actions.js | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js index 015a35d..cb4f975 100644 --- a/public/static/js/travelynx-actions.js +++ b/public/static/js/travelynx-actions.js @@ -21,10 +21,23 @@ function tvly_update() { $.get('/ajax/status_card.html', function(data) { $('.statuscol').html(data); tvly_reg_handlers(); - setTimeout(tvly_update, 15000); + setTimeout(tvly_update, 20000); }).fail(function() { $('.sync-failed-marker').css('display', 'block'); - setTimeout(tvly_update, 15000); + setTimeout(tvly_update, 20000); + }); +} +function tvly_update_public() { + var user_name; + $('.publicstatuscol').each(function() { + user_name = $(this).data('user'); + }); + $.get('/ajax/status/' + user_name + '.html', function(data) { + $('.publicstatuscol').html(data); + setTimeout(tvly_update_public, 20000); + }).fail(function() { + $('.sync-failed-marker').css('display', 'block'); + setTimeout(tvly_update_public, 20000); }); } function tvly_reg_handlers() { @@ -92,6 +105,12 @@ function tvly_reg_handlers() { $(document).ready(function() { tvly_reg_handlers(); if ($('.statuscol .autorefresh').length) { - setTimeout(tvly_update, 15000); + setTimeout(tvly_update, 20000); + } +}); +$(document).ready(function() { + tvly_reg_handlers(); + if ($('.publicstatuscol .autorefresh').length) { + setTimeout(tvly_update_public, 20000); } }); |