From 762a0cf5199031e36221f1559fb08d3e13070305 Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Sat, 1 Feb 2020 17:48:18 +0000 Subject: [PATCH] Silenced a set in logupdates, and fixed moon phase thing in weather forecast --- src/v1/js/Agenda.js | 2 +- src/v1/js/Forecast.js | 2 +- src/v1/js/Nearby.js | 5 +++-- src/v1/js/NearbyList.js | 2 +- src/v1/js/News.js | 2 +- src/v1/js/NewsList.js | 2 +- src/v1/js/Traffic.js | 2 +- src/v1/js/Weather.js | 2 +- src/v1/js/WeatherAlert.js | 4 ++-- src/v1/js/libs/templates.js | 8 ++++---- 10 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/v1/js/Agenda.js b/src/v1/js/Agenda.js index 9746b8b..f0499c5 100644 --- a/src/v1/js/Agenda.js +++ b/src/v1/js/Agenda.js @@ -118,7 +118,7 @@ const AgendaModel = Backbone.Model.extend({ const time = new Date().getTime() ; - this.set('time', time); + this.set('time', time, {silent: true}); } }); diff --git a/src/v1/js/Forecast.js b/src/v1/js/Forecast.js index c8a5be9..8145eb8 100644 --- a/src/v1/js/Forecast.js +++ b/src/v1/js/Forecast.js @@ -53,7 +53,7 @@ const ForecastModel = Backbone.Model.extend({ const log = { 'lat' : this.get('latitude'), 'long': this.get('longitude'), 'time': new Date().getTime() }; - this.set('log', log); + this.set('log', log, {silent: true}); this.timerID = setTimeout( () => this.tick(), diff --git a/src/v1/js/Nearby.js b/src/v1/js/Nearby.js index 4dce401..10da299 100644 --- a/src/v1/js/Nearby.js +++ b/src/v1/js/Nearby.js @@ -38,11 +38,12 @@ const NearbyModel = Backbone.Model.extend({ ); }, 'onChange': function() { + console.log('>> Nearby:Changed: ', this); if (this.get('atHome')) { console.log('At home, so no fetching...'); this.logUpdate(); } - else + else this.throttledGetNearby(); }, 'getNearby': function() { @@ -94,7 +95,7 @@ const NearbyModel = Backbone.Model.extend({ const time = new Date().getTime() ; - this.set('time', time); + this.set('time', time, { 'silent': true }); } }); diff --git a/src/v1/js/NearbyList.js b/src/v1/js/NearbyList.js index 0056e02..dda562b 100644 --- a/src/v1/js/NearbyList.js +++ b/src/v1/js/NearbyList.js @@ -86,7 +86,7 @@ const NearbyListModel = Backbone.Model.extend({ const time = new Date().getTime() ; - this.set('time', time); + this.set('time', time, { 'silent': true }); this.timerID = setTimeout( () => this.tick(), diff --git a/src/v1/js/News.js b/src/v1/js/News.js index dabb576..5b9f98c 100644 --- a/src/v1/js/News.js +++ b/src/v1/js/News.js @@ -90,7 +90,7 @@ const NewsModel = Backbone.Model.extend({ const time = new Date().getTime() ; - this.set('time', time); + this.set('time', time, {silent: true}); this.timerID = setTimeout( () => this.tick(), diff --git a/src/v1/js/NewsList.js b/src/v1/js/NewsList.js index be38a26..68b47af 100644 --- a/src/v1/js/NewsList.js +++ b/src/v1/js/NewsList.js @@ -86,7 +86,7 @@ const NewsListModel = Backbone.Model.extend({ const time = new Date().getTime() ; - this.set('time', time); + this.set('time', time, {silent: true}); this.timerID = setTimeout( () => this.tick(), diff --git a/src/v1/js/Traffic.js b/src/v1/js/Traffic.js index 520874b..7730776 100644 --- a/src/v1/js/Traffic.js +++ b/src/v1/js/Traffic.js @@ -118,7 +118,7 @@ const TrafficModel = Backbone.Model.extend({ const time = new Date().getTime() ; - this.set('time', time); + this.set('time', time, {silent: true}); } }); diff --git a/src/v1/js/Weather.js b/src/v1/js/Weather.js index 5351b82..20b291e 100644 --- a/src/v1/js/Weather.js +++ b/src/v1/js/Weather.js @@ -129,7 +129,7 @@ const WeatherModel = Backbone.Model.extend({ const log = { 'lat' : this.get('latitude'), 'long': this.get('longitude'), 'time': new Date().getTime() }; - this.set('log', log); + this.set('log', log, { 'silent': true }); this.timerID = setTimeout( () => this.tick(), diff --git a/src/v1/js/WeatherAlert.js b/src/v1/js/WeatherAlert.js index 8f600c0..a871b76 100644 --- a/src/v1/js/WeatherAlert.js +++ b/src/v1/js/WeatherAlert.js @@ -97,7 +97,7 @@ const WeatherAlertModel = Backbone.Model.extend({ toHour(1000) ); console.log('>>WeatherAlert log', log); - this.set('log', log); + this.set('log', log, { 'silent': true }); // console.log(this); }, 'tick': function () { @@ -171,7 +171,7 @@ const WeatherAlertView = Backbone.View.extend({ console.log('>> WeatherAlert received focus msg'); if (!this.model.has('log')) { console.log('No log yet'); - + return ; } const now = new Date().getTime(); diff --git a/src/v1/js/libs/templates.js b/src/v1/js/libs/templates.js index 14f4f11..7e50c40 100644 --- a/src/v1/js/libs/templates.js +++ b/src/v1/js/libs/templates.js @@ -134,9 +134,7 @@ const templates = {

Sun & Moon

-
-
<%=moonphase %>
-
+
Sunrise
<%=sunriseTime %>
@@ -144,7 +142,9 @@ const templates = {
<%=sunsetTime %>
- +
+
<%=moonphase %>
+
`), 'templateDirections': _.template(`