+linkableWhitePapers

This commit is contained in:
Jacob Heider 2022-11-11 17:01:23 -05:00
parent e7ae5f5ed5
commit d5fb13f09f
No known key found for this signature in database
GPG key ID: A98011B5713535BF

View file

@ -97,23 +97,21 @@
}
const adobeDCView = getAdobeDcView();
adobeDCView.previewFile({
content:{
location: {
url: getWhitePaperUrl(),
}
},
metaData:{
fileName: "tea.white-paper.pdf"
}
}, { embedMode: "IN_LINE" });
const hash = window.location.hash.replace(/^#/, '_')
const suffix = versions.find(v => v[1] === hash) || ''
viewWhitepaper(suffix)
} catch (error) {
console.error('test:', error);
}
});
function viewWhitepaper(suffix) {
if (suffix.length) {
window.location.hash = '#' + suffix.substr(1)
} else{
// https://stackoverflow.com/questions/1397329/how-to-remove-the-hash-from-window-location-url-with-javascript-without-page-r/5298684#5298684
history.pushState("", document.title, window.location.pathname + window.location.search)
}
const adobeDCView = getAdobeDcView();
const url = getWhitePaperUrl(suffix);
adobeDCView.previewFile({