From 092f3c1cd16d943008c7aa207514c11807bb6b5a Mon Sep 17 00:00:00 2001 From: j Date: Sat, 9 Dec 2023 13:20:59 +0000 Subject: [PATCH] extend subtitles for edits too --- app/static/js/edits.js | 15 ++++++++++++++- app/static/js/item.js | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/static/js/edits.js b/app/static/js/edits.js index 25fa002..6dcb1f5 100644 --- a/app/static/js/edits.js +++ b/app/static/js/edits.js @@ -197,6 +197,15 @@ async function loadEdit(id, args) { }) }) }) + if (data.layers[pandora.subtitleLayer]) { + var previous; + data.layers[pandora.subtitleLayer].forEach(annotation => { + if (previous) { + previous.out = annotation['in'] + } + previous = annotation + }) + } var value = [] pandora.layerKeys.forEach(layer => { if (!data.layers[layer]) { @@ -215,7 +224,11 @@ async function loadEdit(id, args) { `) }) - value.push('
' + html.join('\n') + '
') + var layerClass = "" + if (layerData.isSubtitles) { + layerClass = " is-subtitles" + } + value.push('
' + html.join('\n') + '
') }) data.value = value.join('\n') diff --git a/app/static/js/item.js b/app/static/js/item.js index 02c0c50..abd1ef9 100644 --- a/app/static/js/item.js +++ b/app/static/js/item.js @@ -112,7 +112,6 @@ async function loadData(id, args) { duration: duration }) }) - var value = [] if (data.layers[pandora.subtitleLayer]) { var previous; data.layers[pandora.subtitleLayer].forEach(annotation => { @@ -122,6 +121,7 @@ async function loadData(id, args) { previous = annotation }) } + var value = [] Object.keys(data.layers).forEach(layer => { var html = [] var layerData = getObjectById(pandora.site.layers, layer)