spec/_layouts/spec.html

108 lines
3.4 KiB
HTML
Raw Normal View History

2018-12-25 21:20:18 +01:00
<!DOCTYPE html>
<html>
<head>
<title>{{ site.title }}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
2019-01-02 16:12:39 +01:00
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,700|Source+Code+Pro:400" rel="stylesheet">
2018-12-25 21:20:18 +01:00
<link rel="stylesheet" type="text/css" href="/assets/normalize.css">
<link rel="stylesheet" type="text/css" href="/assets/tocbot.css">
<link rel="stylesheet" type="text/css" href="/assets/style.css">
2019-02-08 15:36:40 +01:00
<link rel="stylesheet" type="text/css" href="/assets/print.css" media="print">
2018-12-25 21:20:18 +01:00
</head>
<body>
<main>
<h1>LBRY: A Decentralized Digital Content Marketplace</h1>
2019-02-08 15:36:40 +01:00
<div class="byline">
2019-03-18 19:27:55 +01:00
Alex Grintsvayg (<a href="mailto:grin@lbry.com">grin@lbry.com</a>), Jeremy Kauffman (<a href="mailto:jeremy@lbry.com">jeremy@lbry.com</a>)
2019-02-08 15:36:40 +01:00
</div>
<a href="/lbry-spec.pdf" class="pdf-hide" target="_blank" rel="noopener">PDF Version</a>
2019-01-31 18:32:37 +01:00
<div class="toc-menu pdf-hide">Menu</div>
<nav class="toc pdf-hide"></nav>
2018-12-25 21:20:18 +01:00
<div id="content">
{{ content }}
</div>
</main>
<script src="/assets/tocbot.min.js"></script>
<script>
function ready(fn) {
if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
function toggleClass(el, className) {
if (el.classList) {
el.classList.toggle(className);
} else {
var classes = el.className.split(' ');
var existingIndex = classes.indexOf(className);
if (existingIndex >= 0)
classes.splice(existingIndex, 1);
else
classes.push(className);
el.className = classes.join(' ');
}
}
ready(function() {
// Handle external links
const links = document.links;
for (var i = 0; i < links.length; i++) {
2019-02-08 15:36:40 +01:00
if (links[i].hostname != window.location.hostname && !links[i].href.startsWith("javascript:") && !links[i].href.startsWith("mailto:")) {
2018-12-25 21:20:18 +01:00
links[i].target = '_blank';
links[i].className += ' external-link';
links[i].rel = "noopener";
}
}
// TOCbot
var options = {
tocSelector: '.toc',
contentSelector: '#content',
headingSelector: 'h2, h3, h4, h5, h6',
collapseDepth: 3,
positionFixedSelector: ".toc",
2019-01-24 20:03:42 +01:00
onClick: (e) => { // put anchor into url on toc link click, and send to parent window if this is iframed
history.replaceState(null,null,e.target.href);
if (window.parent) {
window.parent.postMessage(e.target.href.substr(e.target.href.lastIndexOf('#')+1), "*");
}
},
2018-12-25 21:20:18 +01:00
};
tocbot.init(options);
document.querySelector('.toc-menu').addEventListener("click", function() {
toggleClass(document.querySelector('.toc'), "open");
});
document.querySelectorAll('pre').forEach((e) => {
if (e.scrollWidth > e.clientWidth /* && e.clientHeight < 30*/) {
toggleClass(e, "has-scroll");
}
});
2018-12-25 21:20:18 +01:00
// need this part to fix toc offset height if content above toc changes height
var resizeTimer;
window.addEventListener('resize', function(e) {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
o = options;
o.fixedSidebarOffset = "auto";
tocbot.refresh(o);
}, 250);
});
})
</script>
</body>
</html>