Interface HTML/JS Puzzle
Posted: Sat 15 Apr 2017 2:44 pm
I completed my last two CmX goals by getting the interface to go wide screen and lastly to add wind run and storm rain under their respective gauges on the gauge page. I wanted this because I leave the rPi browser set to the gauges page in full screen mode and often glance at it on my TV and don't have a mouse handy to get the wind run and storm rain from the tooltips.
Info: I added " StormRain: inp.StormRain.toString()," to gaugefeed.js and dashboard.js (dashboard.js because I also display storm rain there)(wind run entries are already there by default). The storm rain that I added to the rain gauge tooltip works and the wind run already in the wind direction tooltip works. However, the data will does not show up under the gauges like I want.
I added "<script src="js/dashboard.js"></script> " to gauges.html and it works.
So the puzzle: What is in dashboard.js that isn't in gaugefeed.js that is making it work like this? Although it works this way, loading dashboard.js as well as gaugefeed.js slows the load time of the page noticeably and I think it may cause the needles to be a tad sluggish.
Thanks - Herb
Edit: Just had a thought that it may be due to how I am adding the info below the gauges - I am using this:
Info: I added " StormRain: inp.StormRain.toString()," to gaugefeed.js and dashboard.js (dashboard.js because I also display storm rain there)(wind run entries are already there by default). The storm rain that I added to the rain gauge tooltip works and the wind run already in the wind direction tooltip works. However, the data will does not show up under the gauges like I want.
I added "<script src="js/dashboard.js"></script> " to gauges.html and it works.
So the puzzle: What is in dashboard.js that isn't in gaugefeed.js that is making it work like this? Although it works this way, loading dashboard.js as well as gaugefeed.js slows the load time of the page noticeably and I think it may cause the needles to be a tad sluggish.
Thanks - Herb
Edit: Just had a thought that it may be due to how I am adding the info below the gauges - I am using this:
Code: Select all
<p>Run: <span id="WindRunToday">-.-</span> miles</span><br>