diff --git a/app/static/js/item.js b/app/static/js/item.js index a9f838b..02c0c50 100644 --- a/app/static/js/item.js +++ b/app/static/js/item.js @@ -113,6 +113,15 @@ async function loadData(id, args) { }) }) var value = [] + if (data.layers[pandora.subtitleLayer]) { + var previous; + data.layers[pandora.subtitleLayer].forEach(annotation => { + if (previous) { + previous.out = annotation['in'] + } + previous = annotation + }) + } Object.keys(data.layers).forEach(layer => { var html = [] var layerData = getObjectById(pandora.site.layers, layer) @@ -132,7 +141,11 @@ async function loadData(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/main.js b/app/static/js/main.js index 56a00b1..344476f 100644 --- a/app/static/js/main.js +++ b/app/static/js/main.js @@ -108,6 +108,7 @@ pandoraAPI("init").then(response => { if (subtitleLayer) { layerKeys.push(subtitleLayer.id) } + pandora.subtitleLayer = subtitleLayer.id pandora.site.layers.map(layer => { return layer.id }).filter(layer => {