From 2d12255fd81fa89af4a163915b0075654d7372e1 Mon Sep 17 00:00:00 2001 From: bourgeoa Date: Wed, 29 Apr 2026 16:27:18 +0200 Subject: [PATCH] update databrowser to CDN and reload on logout --- src/mashlib/index.js | 238 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 216 insertions(+), 22 deletions(-) diff --git a/src/mashlib/index.js b/src/mashlib/index.js index c1defe2..33b9bc0 100644 --- a/src/mashlib/index.js +++ b/src/mashlib/index.js @@ -6,38 +6,232 @@ * we return this wrapper which then fetches and renders the data. */ -/** - * Generate Mashlib databrowser HTML - * - * @param {string} resourceUrl - The URL of the resource being viewed (unused, kept for API compatibility) - * @param {string} cdnVersion - If provided, load mashlib from unpkg CDN (e.g., "2.0.0") - * @returns {string} HTML content - */ export function generateDatabrowserHtml(resourceUrl, cdnVersion = null) { if (cdnVersion) { - // CDN mode - use script.onload to ensure mashlib is fully loaded before init - // This avoids race conditions with defer + DOMContentLoaded + // CDN mode: load the matching mashlib databrowser shell template from CDN, + // then load CSS/JS from the same version while staying on this origin. const cdnBase = `https://unpkg.com/mashlib@${cdnVersion}/dist`; - return `SolidOS Web App - - -
- + return `SolidOS Web App +

Loading Mashlib…

`; } // Local mode - use defer (reliable when served locally) - return `SolidOS Web App
`; + return `SolidOS Web App
`; } /**