diff --git a/script.html b/script.html index cdd9f65..ae2ac0b 100644 --- a/script.html +++ b/script.html @@ -69,14 +69,33 @@ function shotHtml(s, locked) { ? 'Shot ' + s.index + ' opening frame' : '
No opening frame yet.
Set the scene, then make one.
'; + var cont = s.source === "previous" && s.index > 1; + + var toggle = s.index > 1 + ? '
' + + 'Start from a photo' + + 'Continue from shot ' + (s.index - 1) + '' + + '
' + : ''; + + var settingLabel = cont + ? '' + : ''; + + var picker = cont + ? '

Continues the previous shot. Filming uses that shot’s ' + + 'real last frame; the still here is a preview of the camera move.

' + : '' + + ''; + var controls = locked ? '' : - '' + toggle + + settingLabel + '' + '' + '' + '
' - + '
' - + '
' + + '
' + picker + '
' + '
' + '
' @@ -171,6 +190,20 @@ function wire(locked) { }); }); + // Switching source changes which fields apply, so redraw the card after. + [].forEach.call(document.querySelectorAll("[data-srcgrp]"), function (g) { + g.addEventListener("click", async function (e) { + var c = e.target.closest("[data-src]"); + if (!c) return; + var idx = parseInt(g.getAttribute("data-srcgrp"), 10); + var r = await api("update_shot", { email: email, project_id: pid, index: idx, + source: c.getAttribute("data-src") }); + if (!r.ok) { showMsg("msg", r.error || "Could not change that."); return; } + hideMsg("msg"); + load(); + }); + }); + [].forEach.call(document.querySelectorAll("[data-make]"), function (b) { b.addEventListener("click", async function () { hideMsg("msg");