diff --git a/src/js/pages/current.js b/src/js/pages/current.js index 5c3e4671..48ef054b 100644 --- a/src/js/pages/current.js +++ b/src/js/pages/current.js @@ -1,13 +1,13 @@ import { _elWithAttrs, getJson, _getById } from '../modules/utils.js' window.addEventListener('DOMContentLoaded', function () { - const url = window.location.href + "_update" - const dateEl = _getById("date") - const seqEl = _getById("seqNum") - const eventLink = _getById("eventLink") - const eventImage = _getById("eventImage") + const url = window.location.href + '_update' + const dateEl = _getById('date') + const seqEl = _getById('seqNum') + const eventLink = _getById('eventLink') let currentSeq = parseInt(seqEl.innerText) let currentDate = dateEl.innerText + let eventImage = _getById('eventImage') setInterval(function () { getJson(url).then(data => { if (data.seqNum !== currentSeq || data.date !== currentDate) { @@ -16,13 +16,14 @@ window.addEventListener('DOMContentLoaded', function () { seqEl.textContent = currentSeq dateEl.textContent = currentDate eventLink.href = data.url - const newEventImage = _elWithAttrs("img", { - id: "eventImage", - class: "resp", + const newEventImage = _elWithAttrs('img', { + id: 'eventImage', + class: 'resp', src: data.url }) newEventImage.addEventListener('load', (e) => { eventImage.replaceWith(newEventImage) + eventImage = _getById('eventImage') }) } }) diff --git a/src/rubintv/templates/cameras/allsky-movie.jinja b/src/rubintv/templates/cameras/allsky-movie.jinja index 4436516f..7de112a1 100644 --- a/src/rubintv/templates/cameras/allsky-movie.jinja +++ b/src/rubintv/templates/cameras/allsky-movie.jinja @@ -10,10 +10,9 @@ -