pdf button. Fixes #6

This commit is contained in:
Alex Grintsvayg 2019-01-31 12:32:37 -05:00
parent 94c1124bd0
commit 158d7614a5
No known key found for this signature in database
GPG key ID: AEB3F089F86A22B5

View file

@ -13,8 +13,11 @@
<main> <main>
<h1>LBRY: A Decentralized Digital Content Marketplace</h1> <h1>LBRY: A Decentralized Digital Content Marketplace</h1>
<div class="toc-menu">Menu</div> <a href="javascript:;" class="pdf-hide" onclick="this.setAttribute('href', 'https://v2.convertapi.com/convert/web/to/pdf?secret=9XShsyNjNpjmaIz2&hideelements=.pdf-hide&download=attachment&url=' + encodeURI(window.location))">
<nav class="toc"></nav> Save as PDF
</a>
<div class="toc-menu pdf-hide">Menu</div>
<nav class="toc pdf-hide"></nav>
<div id="content"> <div id="content">
{{ content }} {{ content }}
</div> </div>
@ -50,7 +53,7 @@
// Handle external links // Handle external links
const links = document.links; const links = document.links;
for (var i = 0; i < links.length; i++) { for (var i = 0; i < links.length; i++) {
if (links[i].hostname != window.location.hostname) { if (links[i].hostname != window.location.hostname && !links[i].href.startsWith("javascript:")) {
links[i].target = '_blank'; links[i].target = '_blank';
links[i].className += ' external-link'; links[i].className += ' external-link';
links[i].rel = "noopener"; links[i].rel = "noopener";