Dosiero demo: ES module

Demo only. Everything you upload is visible to every other visitor of this demo, and is deleted again within minutes. Actions are logged, including your IP address. Do not upload anything private, unlawful, or that you are not entitled to share.

The simplest way in: an empty <iframe> and an ES module import. The manager builds its own document inside that iframe, so nothing it draws can collide with the styles of the hosting page — and nothing on the hosting page reaches into it either.

Integration

This is the whole page, minus the prose:

<iframe id="iframe1" style="width:100%;max-width:900px;height:300px"></iframe>

<script type="module">
    import {Dosiero} from '/dosiero/dosiero.min.mjs';

    document.addEventListener('DOMContentLoaded', () => {
        new Dosiero({
            mode: 'iframe',
            endpoint: window.location.origin + '/endpoint/index.php',
            iframe: document.getElementById('iframe1'),
        }).open();
    });
</script>

Three options are all that is required: mode, the endpoint your server connector answers on, and the iframe to render into. Creating the instance only validates the configuration — open() is what builds the manager and asks the server for the storages, so you can construct early and open later.

No stylesheet is named anywhere. The manager derives the location of its own theme from the URL the module was loaded from, so dist/ can sit anywhere — under the webroot as here, in node_modules, or on a CDN — without being configured. Pass assetsUrl only when a bundler has moved the code away from the files it ships with.

back