integrate spec.lbry.io as iframed page at /spec. Fixes #11. #233

Merged
lyoshenka merged 6 commits from spec into master 2019-01-25 17:43:02 +01:00
Showing only changes of commit 94108e122b - Show all commits

View file

@ -12,21 +12,23 @@ import html from "choo/html";
export default state => {
state.hideFooter = true;
return html`
<div style="width:100%; height:calc(100vh - 67px)"> <!-- 67px = height of nav. this avoids second scrollbar -->
<iframe id="spec" style="width:100%; height:100%;"></iframe>
<div style="width: 100%; height: calc(100vh - 67px)"> <!-- 67px = height of nav. this avoids second scrollbar -->
<iframe id="spec" style="width: 100%; height: 100%;"></iframe>
</div>
<script>
const specDomain = "https://spec.lbry.io";
const spec = document.getElementById("spec");
spec.src = specDomain + window.location.hash;
window.addEventListener("message", event => {
if (event.origin != specDomain || event.source != spec.contentWindow) { // security
if (event.origin !== specDomain || event.source !== spec.contentWindow) // security
return;
}
const url = window.location.href.substr(0, window.location.href.lastIndexOf('#'));
history.replaceState(null, null, url+"#"+event.data);
const url = window.location.href.substr(0, window.location.href.lastIndexOf("#"));
history.replaceState(null, null, url + "#" + event.data);
});
</script>
`;