chore (rewrite): iframe page cleanup

This commit is contained in:
MickaelK 2024-04-06 00:29:49 +11:00
parent 68dce10346
commit 465b9fc92a

View file

@ -2,14 +2,14 @@ import { createElement } from "../../lib/skeleton/index.js";
import rxjs, { effect } from "../../lib/rx.js";
import { loadCSS } from "../../helpers/loader.js";
import assert from "../../lib/assert.js";
import ctrlError from "../ctrl_error.js";
import { getDownloadUrl } from "./common.js";
export default function(render, opts = {}) {
const { endpoint = null } = opts;
const $page = createElement(`
<div class="component_appframe">
<iframe src="${getFrameUrl(endpoint)}"></iframe>
<iframe src="${getDownloadUrl()}"></iframe>
</div>
`);
render($page);
@ -27,16 +27,8 @@ export default function(render, opts = {}) {
}
}),
));
effect(rxjs.of(assert.truthy(endpoint)).pipe(
rxjs.catchError(ctrlError()),
));
}
export function init() {
return loadCSS(import.meta.url, "./application_iframe.css");
}
function getFrameUrl(endpoint) {
return endpoint + "?path=/home/mickael/Downloads/office.docx" + "&share=";
}