From cf9496688f932aaa05f4a7049ea7bc3798322671 Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Wed, 17 May 2023 14:47:13 -0400 Subject: [PATCH] allow NcML preview to work with drafts #25 --- previewers/betatest/js/ncml.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/previewers/betatest/js/ncml.js b/previewers/betatest/js/ncml.js index 993e72d..15ef09a 100644 --- a/previewers/betatest/js/ncml.js +++ b/previewers/betatest/js/ncml.js @@ -9,7 +9,12 @@ function translateBaseHtmlPage() { function writeContent(fileUrl, file, title, authors) { addStandardPreviewHeader(file, title, authors); - var ncmlUrl = queryParams.get("siteUrl") + "/api/access/datafile/" + queryParams.get("fileid") + "/auxiliary/NcML/0.1"; + var apiTokenOptional = ""; + var apiToken = queryParams.get("key"); + if (apiToken != null) { + apiTokenOptional = "?key=" + apiToken; + } + var ncmlUrl = queryParams.get("siteUrl") + "/api/access/datafile/" + queryParams.get("fileid") + "/auxiliary/NcML/0.1" + apiTokenOptional; // copied from text.js var whiteList = { a: ["title"],