diff options
-rw-r--r-- | www/index.html | 2 | ||||
-rw-r--r-- | www/js/clock.js | 12 |
2 files changed, 3 insertions, 11 deletions
diff --git a/www/index.html b/www/index.html index 9042849..61c228a 100644 --- a/www/index.html +++ b/www/index.html @@ -25,8 +25,6 @@ <script type="text/javascript"> clock_init(); - drawClock('Do, 1.1.1970', '00:00:00', 0); - clock_add_callback(drawClock); </script> </body> diff --git a/www/js/clock.js b/www/js/clock.js index a99b5f8..59f53de 100644 --- a/www/js/clock.js +++ b/www/js/clock.js @@ -43,10 +43,6 @@ function Clock() { 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) { var t4 = (+new Date()); @@ -110,13 +106,11 @@ var clock = new Clock(); function clock_init() { clock.start(); + clock_draw('Do, 1.1.1970', '00:00:00', 0); + clock.addCallback(clock_draw); } -function clock_add_callback(cb) { - clock.addCallback(cb); -} - -function drawClock(date, time, week) { +function clock_draw(date, time, week) { $('#clock span.clock-date').text(date); $('#clock span.clock-time').text(time); var weekspan = $('#clock span.current-week').removeClass().addClass('current-week').addClass('label'); |