mirror of
https://github.com/ivabus/www
synced 2024-11-22 16:45:05 +03:00
Merge pull request #191 from teaxyz/+linkableWhitePapers
+linkableWhitePapers
This commit is contained in:
commit
78880d684f
1 changed files with 9 additions and 11 deletions
|
@ -97,23 +97,21 @@
|
||||||
}
|
}
|
||||||
const adobeDCView = getAdobeDcView();
|
const adobeDCView = getAdobeDcView();
|
||||||
|
|
||||||
adobeDCView.previewFile({
|
const hash = window.location.hash.replace(/^#/, '_')
|
||||||
content:{
|
const suffix = versions.find(v => v[1] === hash) || ''
|
||||||
location: {
|
viewWhitepaper(suffix)
|
||||||
url: getWhitePaperUrl(),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
metaData:{
|
|
||||||
fileName: "tea.white-paper.pdf"
|
|
||||||
}
|
|
||||||
}, { embedMode: "IN_LINE" });
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('test:', error);
|
console.error('test:', error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function viewWhitepaper(suffix) {
|
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 adobeDCView = getAdobeDcView();
|
||||||
const url = getWhitePaperUrl(suffix);
|
const url = getWhitePaperUrl(suffix);
|
||||||
adobeDCView.previewFile({
|
adobeDCView.previewFile({
|
||||||
|
|
Loading…
Reference in a new issue