Files
Cue-View/plugins/eos/template.ejs
T
2026-04-06 20:57:28 +01:00

60 lines
2.5 KiB
Plaintext

<header>
<h1><%= listName %></h1>
<h2>Eos <%= data.EOS.version %></h2>
</header>
<% for(var i in data.EOS.cueLists){ %>
<% if(data.cueListFilter == i || data.cueListFilter.length==0){ %>
<div class="list_container">
<div class="list_name">List <%= i %></div>
<table cellspacing="0">
<tr>
<th width="70px">Cue</th>
<th width="30px">Int Up</th>
<th width="30px">Int Down</th>
<th width="40px" class="hide-medium">Focus</th>
<th width="40px" class="hide-medium">Color</th>
<th width="40px" class="hide-medium">Beam</th>
<th width="40px" class="hide-small">Dur</th>
<th width="20px" class="hide-small">M</th>
<th width="20px" class="hide-small">B</th>
<th width="20px" class="hide-small">A</th>
<th width="70px" class="hide-small">Fw/Hg</th>
<th width="150px">Label</th>
<th width="10px" class="hide-medium">Ext Links</th>
</tr>
<% var cues = Object.keys(data.EOS.cueLists[i]).sort(function(a, b){return Number(a)-Number(b)}) %>
<% var activeCueByList = data.EOS.activeCueByList || {} %>
<% var progressByList = data.EOS.progressByList || {} %>
<% var activeCueNumber = (activeCueByList[i] !== undefined) ? (activeCueByList[i] + "") : undefined %>
<% var progressState = progressByList[i] || {} %>
<% var progressCueNumber = (progressState.cueNumber !== undefined && progressState.cueNumber !== null) ? (progressState.cueNumber + "") : undefined %>
<% var hasCueRemaining = (progressState.cueRemainingMs !== undefined && progressState.cueRemainingMs !== null) %>
<% var hasFollowHangRemaining = (progressState.followHangRemainingMs !== undefined && progressState.followHangRemainingMs !== null) %>
<% for(var j=0; j<cues.length; j++){ %>
<% var q = data.EOS.cueLists[i][cues[j]] %>
<% var isComplete = (activeCueNumber !== undefined && cues[j] == activeCueNumber) %>
<% var isRunning = isComplete && hasCueRemaining && progressCueNumber === cues[j] && progressState.cueRemainingMs > 0 %>
<% var remainingDuration = isRunning ? progressState.cueRemainingMs : null %>
<% var followHangRemainingDuration = (isComplete && !isRunning && hasFollowHangRemaining && progressState.followHangRemainingMs > 0) ? progressState.followHangRemainingMs : null %>
<%= templates.cue({
q: q,
cues: cues,
cueNumber: cues[j],
isActive: isComplete,
isComplete: isComplete,
isRunning: isRunning,
remainingDuration: remainingDuration,
followHangRemainingDuration: followHangRemainingDuration
}) %>
<% } %>
</table>
</div>
<% } %>
<% } %>