summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-07-17 20:53:56 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-07-17 20:53:56 (GMT)
commite500e23e0e333d9d7fc6bcd4bd915a5d641531c0 (patch)
tree3fa5fe96019739a885493237e5897792f0a5d4a9
parente3d491b0f97dae84336d5b3c60ceb7206af20c92 (diff)
some cleanups
-rw-r--r--www/js/apps.js2
-rw-r--r--www/js/utils.js13
2 files changed, 9 insertions, 6 deletions
diff --git a/www/js/apps.js b/www/js/apps.js
index 5df0dba..8f30ef0 100644
--- a/www/js/apps.js
+++ b/www/js/apps.js
@@ -42,7 +42,7 @@ function apps_select(app) {
$('#app-jingles').show();
$('#nav-btn-jingles').addClass('active');
- musicpools_init();
+ jingles_init();
break;
default:
$('#app-jingles').hide();
diff --git a/www/js/utils.js b/www/js/utils.js
index fbcf709..74614f0 100644
--- a/www/js/utils.js
+++ b/www/js/utils.js
@@ -128,6 +128,7 @@ function Clock(draw_callback) {
this.clock_offset = 0;
this.redraw = function() {
+// console.log("redraw called");
var rdtime_ms = (+new Date()) + (this.last_update.tz_offset * 1000) + this.clock_offset;
var rdtime = new Date(rdtime_ms);
@@ -142,9 +143,10 @@ function Clock(draw_callback) {
}
this.update = function(event) {
- var update = JSON.parse(event.data);
- this.last_update = update;
- this.clock_offset = (update.timestamp*1000) - (+new Date()) ;
+ var update = JSON.parse(event.data);
+ this.last_update = update;
+ this.clock_offset = (update.timestamp*1000) - (+new Date()) ;
+// console.log("got new timeupdate from rhrdtime: new offset = " + this.clock_offset + " ms");
}
this.start = function() {
@@ -153,7 +155,8 @@ function Clock(draw_callback) {
this.interval = setInterval(this.redraw.bind(this), 500);
}
this.stop = function() {
- clearInterval(this.interval)
- delete this.interval
+ clearInterval(this.interval);
+ delete this.interval;
+ this.sock.close();
}
}