2019-01-24 20:09:52 +01:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// I M P O R T
|
|
|
|
|
|
|
|
import html from "choo/html";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// E X P O R T
|
|
|
|
|
|
|
|
export default state => {
|
|
|
|
state.hideFooter = true;
|
2019-02-07 18:50:04 +01:00
|
|
|
state.lbry = {
|
|
|
|
title: "LBRY Specification",
|
|
|
|
description: "A detailed specification of the LBRY protocol. Learn exactly what LBRY is and how it works!"
|
|
|
|
};
|
2019-01-25 17:38:07 +01:00
|
|
|
|
2019-01-24 20:09:52 +01:00
|
|
|
return html`
|
2019-02-20 00:55:06 +01:00
|
|
|
<frame-viewer>
|
|
|
|
<iframe id="spec"></iframe>
|
|
|
|
</frame-viewer>
|
2019-01-25 17:38:07 +01:00
|
|
|
|
2019-01-24 20:09:52 +01:00
|
|
|
<script>
|
|
|
|
const specDomain = "https://spec.lbry.io";
|
|
|
|
const spec = document.getElementById("spec");
|
|
|
|
spec.src = specDomain + window.location.hash;
|
2019-01-30 00:29:14 +01:00
|
|
|
|
2019-02-07 18:50:04 +01:00
|
|
|
document.querySelector("body").style["overflow-y"] = "hidden";
|
|
|
|
|
2019-01-24 20:09:52 +01:00
|
|
|
window.addEventListener("message", event => {
|
2019-01-25 17:38:07 +01:00
|
|
|
if (event.origin !== specDomain || event.source !== spec.contentWindow) // security
|
2019-01-24 20:09:52 +01:00
|
|
|
return;
|
2019-01-25 17:38:07 +01:00
|
|
|
|
2019-01-30 00:29:14 +01:00
|
|
|
const url = window.location.href.substr(0, window.location.href.lastIndexOf("#"));
|
2019-01-25 17:38:07 +01:00
|
|
|
history.replaceState(null, null, url + "#" + event.data);
|
2019-01-24 20:09:52 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
`;
|
|
|
|
};
|