diff --git a/thrimbletrimmer/scripts/edit.js b/thrimbletrimmer/scripts/edit.js index 1c8edf4..76353ee 100644 --- a/thrimbletrimmer/scripts/edit.js +++ b/thrimbletrimmer/scripts/edit.js @@ -1,6 +1,7 @@ var googleUser = null; var videoInfo; var currentRange = 1; +let knownTransitions = []; let globalPageState = 0; const CHAPTER_MARKER_DELIMITER = "\n==========\n"; @@ -141,6 +142,7 @@ window.addEventListener("DOMContentLoaded", async (event) => { } }); + loadTransitions(); // Intentionally not awaiting, fire and forget await loadVideoInfo(); document.getElementById("stream-time-setting-start-pad").addEventListener("click", (_event) => { @@ -361,6 +363,49 @@ window.addEventListener("DOMContentLoaded", async (event) => { }); }); + +async function loadTransitions() { + const response = await fetch("/thrimshim/transitions"); + if (!response.ok) { + addError("Failed to fetch possible transition types. This probably means the wubloader host is down."); + return; + } + knownTransitions = await response.json(); + updateTransitionTypes(); +} + +// Update the given list of transition type