X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/blobdiff_plain/4d0eef893a499d6078a60b8b703cef05e95c1092..c41b39636626c0fd80c06cec0508458c25b23873:/web/static/seepark_web.js?ds=sidebyside diff --git a/web/static/seepark_web.js b/web/static/seepark_web.js index 5cdeca5..5aaf55a 100644 --- a/web/static/seepark_web.js +++ b/web/static/seepark_web.js @@ -67,7 +67,6 @@ function dayschart(element, title, days, xtickformat) { chart.resize({ width: getwidth(element) }); - // chart.flush(); }, transition: { duration: null @@ -189,7 +188,7 @@ function loaddays(chart, element, days) { unload: true }); }; - chart.flush(); + setTimeout(function () { chart.flush(); }, 5000); } function beginend(days) { @@ -218,7 +217,7 @@ dayschart('chart_air_7', 'Die Luft (Woche)', 7, '%a %d'); dayschart('chart_air_31', 'Die Luft (Monat)', 31, '%Y-%m-%d'); dayschart('chart_air_365', 'Die Luft (Jahr)', 365, '%b %Y'); -// reload current values +// reload current values + owm script setInterval( function() { var airvalue = document.getElementById('currentairvalue'); @@ -243,6 +242,14 @@ setInterval( .catch(function(error) { console.log(error); }); + + var owmwidget = document.getElementById('openweathermap-widget-15'); + owmwidget.removeChild(owmwidget.childNodes[0]); + var owmscript = document.head.lastElementChild; + document.head.removeChild(owmscript); + var newowmscript = document.createElement('script'); + newowmscript.src = '//openweathermap.org/themes/openweathermap/assets/vendor/owm/js/weather-widget-generator.js'; + document.head.appendChild(newowmscript); }, refresh_interval );