'
+ '
'
+ '
'
@@ -627,7 +628,13 @@ function tlDraw() {
html += '
';
html += '
';
for (var t = 0; t <= dur; t += 8) {
- html += '' + t + 's';
+ // The end labels are centred on the track edges, so half of each falls
+ // outside it. Pin the first left and the last right instead.
+ var pos = (t / dur) * 100;
+ var style = t === 0 ? 'left:2px;transform:none'
+ : (t >= dur ? 'right:2px;left:auto;transform:none'
+ : 'left:' + pos.toFixed(2) + '%');
+ html += '' + t + 's';
}
html += '
';
tl.innerHTML = html;
@@ -793,7 +800,19 @@ async function loadEdl(p) {
}
function bindPost() {
- if (document.getElementById("tl")) loadEdl((DATA && DATA.project) || {});
+ // The editing bay is opt-in. Most people want to watch the thing and leave.
+ var eo = document.getElementById("edlopen");
+ if (eo) eo.onclick = function () {
+ var w = document.getElementById("edlwrap");
+ var open = w.style.display === "none";
+ w.style.display = open ? "" : "none";
+ this.textContent = open ? "Close the video editor" : "Open the video editor";
+ if (open) {
+ if (!EDL) loadEdl((DATA && DATA.project) || {});
+ else tlDraw();
+ w.scrollIntoView({ behavior: "smooth", block: "start" });
+ }
+ };
var sb = document.getElementById("seams");
function paintSeams(r) {
var el = document.getElementById("seamout");