From 0b69b87e9b3010eb4ff5e8af6c37a50fd948599b Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 11 May 2019 18:17:06 +0200 Subject: [PATCH 1/2] add follow checkbox to timeline --- www/js/hugvey_timeline.js | 23 ++++++++++++++++++++--- www/timeline.html | 7 ++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/www/js/hugvey_timeline.js b/www/js/hugvey_timeline.js index 4b9c94a..41a19b1 100644 --- a/www/js/hugvey_timeline.js +++ b/www/js/hugvey_timeline.js @@ -38,14 +38,31 @@ class Timeline{ startDate.setMinutes(startDate.getMinutes()-1); let endDate = new Date(); endDate.setMinutes(endDate.getMinutes()+20); - setTimeout(function(){ - tl.setWindow(startDate, endDate); - }, 500); + + +//follow the timeline or not if checkbox is checked +setTimeout(function(){ + tl.setWindow(startDate, endDate); +}, 500); + +this.moveInterval = setInterval(function(){ + // skip movement if not visible + tl.moveTo(new Date()); +}, 1000); + +var checkbox = document.getElementById('follow_checkbox') + +checkbox.addEventListener('change', (event) => { + if (event.target.checked) { this.moveInterval = setInterval(function(){ // skip movement if not visible tl.moveTo(new Date()); }, 1000); + } else { + clearInterval(this.moveInterval) + } +}) ws.addEventListener( 'message', this); diff --git a/www/timeline.html b/www/timeline.html index f960c35..3eaea8d 100644 --- a/www/timeline.html +++ b/www/timeline.html @@ -31,7 +31,7 @@ background-color: greenyellow; border-color: green; } - + .vis-text,.vis-labelset .vis-label { color: #999; } @@ -71,8 +71,9 @@ font-size: 4.5pt; + Follow timeline
- + - \ No newline at end of file + From c5b3ec385b45c6d89bb1d32096fec5c89ee9655d Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 11 May 2019 20:21:42 +0200 Subject: [PATCH 2/2] added sox to requirements --- requirements.server.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.server.txt b/requirements.server.txt index a3c4869..b8566e9 100644 --- a/requirements.server.txt +++ b/requirements.server.txt @@ -9,5 +9,5 @@ cutelog tornado shortuuid python-osc - +sox