summaryrefslogtreecommitdiff
path: root/public/static/js/travelynx-actions.js
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-02 10:05:15 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-02 10:05:15 +0200
commit3de5de7db2b7eebe000c6534bfd020405921ccdc (patch)
treec57f9ea7cddbd99f21dd1a16760ddeabdc0079ce /public/static/js/travelynx-actions.js
parent1bf128936d1af615bcbbf6aeb6d6ce5ab8179975 (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.js25
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);
}
});