From c05d0bbb44b054957cc9ee538202daec90157b6a Mon Sep 17 00:00:00 2001 From: j Date: Sat, 17 Feb 2024 10:54:05 +0000 Subject: [PATCH] merge conditional subtitle fixup from pandora --- app/static/js/item.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/static/js/item.js b/app/static/js/item.js index 57a5e2c..0cc3dcf 100644 --- a/app/static/js/item.js +++ b/app/static/js/item.js @@ -130,11 +130,13 @@ async function loadData(id, args) { ${layerData.title} `) data.layers[layer].forEach(annotation => { - annotation.value = annotation.value.replace( - /src="\//g, `src="${pandora.url.origin}/` - ).replace( - /href="\//g, `href="${pandora.url.origin}/` - ) + if (pandora.url) { + annotation.value = annotation.value.replace( + /src="\//g, `src="${pandora.url.origin}/` + ).replace( + /href="\//g, `href="${pandora.url.origin}/` + ) + } html.push(`
${annotation.value}