mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-15 21:04:46 +01:00
chore (rewrite): iframe page cleanup
This commit is contained in:
parent
68dce10346
commit
465b9fc92a
1 changed files with 3 additions and 11 deletions
|
|
@ -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=";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue