Skip to content

Commit

Permalink
Bugfix: Current and All Sky not updating
Browse files Browse the repository at this point in the history
  • Loading branch information
ugyballoons committed Aug 30, 2023
1 parent 3342182 commit 913cc02
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
17 changes: 9 additions & 8 deletions src/js/pages/current.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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')
})
}
})
Expand Down
3 changes: 1 addition & 2 deletions src/rubintv/templates/cameras/allsky-movie.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
</span>
</h3>
</div>
<div class="video-with-overlay">
<div>
<video width="100%" controls autoplay loop>
<source src="{{ movie.url }}" type="video/mp4">
</video>
<img src="{{ url('static', filename='images/allsky-cardinals.svg') }}">
</div>
<div class="desc">{{ movie.name }}</div>
8 changes: 0 additions & 8 deletions src/sass/style.sass
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,6 @@ section
position: sticky
top: 3em

.video-with-overlay
position: relative
img
position: absolute
top: 0
left: 0
pointer-events: none

.event-info
display: flex
flex-direction: row
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const TerserPlugin = require('terser-webpack-plugin')

const pagesWithHeartbeats = [
'auxtel',
'allsky',
'startracker',
'admin'
].reduce((pages, page) => ({
Expand Down

0 comments on commit 913cc02

Please sign in to comment.