diff --git a/script.html b/script.html index c4f8870..e117965 100644 --- a/script.html +++ b/script.html @@ -295,6 +295,7 @@ function render(r) { + '' + '
' + + '' + ''; } @@ -799,7 +800,185 @@ async function loadEdl(p) { }; } +// Every film keeps the take it replaced. Without this, a re-film to fix one +// thing could quietly make another worse with no way back. +async function loadTakes() { + var el = document.getElementById("takes"); + if (!el) return; + var r = await api("list_versions", { email: email, project_id: pid }); + if (!r.ok || !(r.versions || []).length) { el.innerHTML = ""; return; } + el.innerHTML = '' + esc(r.status_text || "") + ' ' + + 'Bringing one back keeps the one you are leaving.
' + + '' + esc(r.status_text || "") + '
' + + (r.seams || []).map(function (x) { + var col = x.verdict === "smooth" ? "var(--good)" + : (x.verdict === "visible" ? "var(--accent2)" : "var(--bad)"); + return '' + esc(r.status_text || "Measuring…") + '
'; + var waited = 0; + var t = setInterval(async function () { + waited += 4; + var g = await api("seam_report", { email: email, project_id: pid }); + if (g.ok && !g.pending) { + clearInterval(t); + sb.disabled = false; sb.textContent = "Measure the joins"; + paintSeams(g); + return; + } + if (waited > 180) { + clearInterval(t); + sb.disabled = false; sb.textContent = "Measure the joins"; + showMsg("msg", "Measuring is taking unusually long."); + } + }, 4000); + return; + } + sb.disabled = false; sb.textContent = "Measure the joins"; + if (!r.seams || !r.seams.length) { + el.innerHTML = '' + esc(r.status_text || "Nothing to measure.") + '
'; + return; + } + el.innerHTML = '' + esc(r.status_text || "") + '
' + + r.seams.map(function (x) { + var col = x.verdict === "smooth" ? "var(--good)" + : (x.verdict === "visible" ? "var(--accent2)" : "var(--bad)"); + return '