summaryrefslogtreecommitdiff
path: root/public/static/js/travelynx-actions.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/static/js/travelynx-actions.js')
-rw-r--r--public/static/js/travelynx-actions.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js
index 583c806..b1e4d43 100644
--- a/public/static/js/travelynx-actions.js
+++ b/public/static/js/travelynx-actions.js
@@ -17,7 +17,16 @@ function tvly_run(link, req, err_callback) {
}
});
}
-$(document).ready(function() {
+function tvly_update() {
+ $.get('/ajax/status_card.html', function(data) {
+ $('.statuscol').html(data);
+ tvly_reg_handlers();
+ setTimeout(tvly_update, 15000);
+ }).fail(function() {
+ setTimeout(tvly_update, 15000);
+ });
+}
+function tvly_reg_handlers() {
$('.action-checkin').click(function() {
var link = $(this);
var req = {
@@ -78,4 +87,10 @@ $(document).ready(function() {
tvly_run(link, req);
}
});
+}
+$(document).ready(function() {
+ tvly_reg_handlers();
+ if ($('.statuscol .autorefresh').length) {
+ setTimeout(tvly_update, 15000);
+ }
});