summaryrefslogtreecommitdiffstats
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/script.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/static/script.js b/static/script.js
index d96650c..9513d59 100644
--- a/static/script.js
+++ b/static/script.js
@@ -1,3 +1,5 @@
+var current_id = '';
+var ids = [];
var player;
var litColor = '#eee';
var dimmedColor = '#555';
@@ -28,7 +30,18 @@ function getUpdates() {
dataType: 'json',
data: {pid: pid, timestamp: timestamp},
success: handleUpdates,
- complete: getUpdates
+ error: function (_, textStatus) {
+ switch (textStatus) {
+ case 'abort':
+ return;
+ case 'error':
+ case 'parsererror':
+ setTimeout(getUpdates, 1000);
+ return;
+ default:
+ getUpdates();
+ }
+ }
});
}
@@ -55,6 +68,7 @@ function handleUpdates(data) {
break;
}
}
+ getUpdates();
}
function drawBar(id) {