diff --git a/trailer.html b/trailer.html index a3749ef..d5c52ee 100644 --- a/trailer.html +++ b/trailer.html @@ -1516,7 +1516,10 @@ return '
' + esc(s.id) + '
' + '

' + esc(s.title || "") + '

' + '
' + esc(s.setting || "") + ' · ' - + Number(s.edit_seconds || 0).toFixed(1) + 's' + + ' s ' + + '' + + '' + + '' + (s.scene ? ' · ' + esc(s.scene) + '' : '') + (s.day ? ' · ' + esc(s.day) + '' : '') + '
' @@ -1570,6 +1573,22 @@ else el.disabled = false; return; } + if ((el = hit("data-estsecs"))) { + var esid = el.getAttribute("data-estsecs"); + r = await act("estimate_seconds", { draft_id: CUR, shot_id: esid }); + if (r) { + var inp = document.querySelector('[data-secs="' + esid + '"]'), nt = document.querySelector('[data-secsnote="' + esid + '"]'); + if (inp) inp.value = Number(r.suggested).toFixed(1); + if (nt) nt.textContent = " suggested " + Number(r.suggested).toFixed(1) + " s (" + r.why + "; now " + Number(r.current).toFixed(1) + " s) - press Set length to keep it"; + } + return; + } + if ((el = hit("data-setsecs"))) { + var ssid = el.getAttribute("data-setsecs"), sinp = document.querySelector('[data-secs="' + ssid + '"]'); + r = await act("set_seconds", { draft_id: CUR, shot_id: ssid, seconds: sinp ? sinp.value : "" }); + if (r) { showMsg("msg", "Shot " + ssid + " is now " + Number(r.seconds).toFixed(1) + " s." + (PKG.shots.some(function (x) { return x.id === ssid && x.clip_url; }) ? " The clip was filmed at the old length; make the shot again to refilm." : ""), "ok"); await refresh(); } + return; + } if ((el = hit("data-bgedit"))) { BGEDIT = el.getAttribute("data-bgedit"); openTab(CUR); return; } if ((el = hit("data-bgcancel"))) { BGEDIT = null; openTab(CUR); return; } if ((el = hit("data-bggen"))) {