diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-05-02 10:05:15 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-05-02 10:05:15 +0200 |
commit | 3de5de7db2b7eebe000c6534bfd020405921ccdc (patch) | |
tree | c57f9ea7cddbd99f21dd1a16760ddeabdc0079ce /public/static/js/travelynx-actions.js | |
parent | 1bf128936d1af615bcbbf6aeb6d6ce5ab8179975 (diff) |
Finish public-facing exposed user status (opt-in)
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); } }); |