Repair the corrupted script block
The previous commit's replacement text contained the sequence "$'", which the patch tool treats as a substitution token meaning "everything after the match". It injected a duplicate copy of the rest of the file and left script.html with a syntax error, so the page showed only "Loading...". This closes the broken string and reopens bindPost so the duplicated tail that follows becomes its legitimate body. A second patch removes the leftover.
This commit is contained in:
parent
862b864fce
commit
6518c19b94
1 changed files with 23 additions and 1 deletions
24
script.html
24
script.html
|
|
@ -817,7 +817,29 @@ async function loadTakes() {
|
||||||
+ 'style="width:100%;aspect-ratio:9/16;border-radius:9px;border:1px solid var(--line);background:#000;display:block"></video>'
|
+ 'style="width:100%;aspect-ratio:9/16;border-radius:9px;border:1px solid var(--line);background:#000;display:block"></video>'
|
||||||
+ '<div class="foot" style="margin-top:6px">' + esc(when(v.at) || "earlier")
|
+ '<div class="foot" style="margin-top:6px">' + esc(when(v.at) || "earlier")
|
||||||
+ (v.voice_name ? ' · ' + esc(v.voice_name) : '')
|
+ (v.voice_name ? ' · ' + esc(v.voice_name) : '')
|
||||||
+ (v.cost_usd ? ' ·
|
+ (v.cost_usd ? ' · $' + Number(v.cost_usd).toFixed(2) : '') + '</div>'
|
||||||
|
+ (v.note ? '<div class="foot" style="opacity:.7">' + esc(v.note) + '</div>' : '')
|
||||||
|
+ '<button type="button" class="btn ghost" data-restore="' + i + '" '
|
||||||
|
+ 'style="margin-top:8px;width:100%">Use this one</button>'
|
||||||
|
+ '</div>';
|
||||||
|
}).join("")
|
||||||
|
+ '</div>';
|
||||||
|
[].forEach.call(el.querySelectorAll("[data-restore]"), function (b) {
|
||||||
|
b.onclick = async function () {
|
||||||
|
if (!confirm("Bring that take back as the current video? The one you are leaving is kept.")) return;
|
||||||
|
b.disabled = true; b.textContent = "Restoring…";
|
||||||
|
var s = await api("restore_version", { email: email, project_id: pid,
|
||||||
|
index: parseInt(b.getAttribute("data-restore"), 10) });
|
||||||
|
if (!s.ok) { b.disabled = false; b.textContent = "Use this one"; showMsg("msg", s.error || "Could not restore that."); return; }
|
||||||
|
showMsg("msg", s.status_text || "Restored.", "ok");
|
||||||
|
load();
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function bindPost() {
|
||||||
|
loadTakes();
|
||||||
|
// The editing bay is opt-in. Most people want to watch the thing and leave.
|
||||||
var eo = document.getElementById("edlopen");
|
var eo = document.getElementById("edlopen");
|
||||||
if (eo) eo.onclick = function () {
|
if (eo) eo.onclick = function () {
|
||||||
var w = document.getElementById("edlwrap");
|
var w = document.getElementById("edlwrap");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue