summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/bundle.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/www/js/bundle.js b/www/js/bundle.js
index 7aa4b78..02b7f7c 100644
--- a/www/js/bundle.js
+++ b/www/js/bundle.js
@@ -23,6 +23,8 @@
'use strict';
function Clock() {
+ this.draw_callbacks = $.Callbacks('unique');
+
this.last_message = { t1: 0, t2: 0, t3: 0, t4: 0, tz_offset: 3600 };
this.clock_offset = 0;
this.clock_rtt = 0;
@@ -47,7 +49,11 @@ function Clock() {
time_str += (rdtime.getUTCMinutes() > 9 ? ':' : ':0') + rdtime.getUTCMinutes();
time_str += (rdtime.getUTCSeconds() > 9 ? ':' : ':0') + rdtime.getUTCSeconds();
- console.log([date_str, time_str, get_rd_week(rdtime_ms)]);
+ this.draw_callbacks.fireWith(window, [date_str, time_str, get_rd_week(rdtime_ms)]);
+ };
+
+ this.addCallback = function (cb) {
+ this.draw_callbacks.add(cb);
};
this.ntp_update = function (event) {
@@ -115,6 +121,7 @@ clock.start();
var ClockView = React.createClass({
displayName: 'ClockView',
+
render: function () {
return React.createElement(
'p',