Skip to content

Commit

Permalink
fix admin js
Browse files Browse the repository at this point in the history
Signed-off-by: Seán C McCord <[email protected]>
  • Loading branch information
Ulexus committed May 4, 2022
1 parent 0ab2dad commit e977c80
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/admin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
performanceTime = new PerformanceTime()
import {PerformanceTime} from './performanceTime.js';

function triggerCue(id) {
let performanceTime = new PerformanceTime()

export function TriggerCue(id) {
fetch('/cues/'+id, {
method: 'PUT'
})
Expand All @@ -16,13 +18,13 @@ function formatMinuteSeconds(sec) {
return `${min}:${sec}`
}

window.onload = function() {
export function BindCueStatus(lastCueId, sinceLastCueId) {
setInterval(function() {
let cue = performanceTime.latestCue()
if (cue !== undefined) {
document.getElementById("lastCue").innerHTML = cue.cue
document.getElementById(lastCueId).innerHTML = cue.cue

document.getElementById("sinceLastCue").innerHTML = formatMinuteSeconds(performanceTime.sinceCue(cue.cue))
document.getElementById(sinceLastCueId).innerHTML = formatMinuteSeconds(performanceTime.sinceCue(cue.cue))
}

}, 1000)
Expand Down

0 comments on commit e977c80

Please sign in to comment.