From 924864fc7434518ee0ae688f9be9d3086ba4b3f5 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 17 Oct 2024 23:20:45 +0800 Subject: fix: don't apply dumbymap twice --- addon/index.mjs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'addon') diff --git a/addon/index.mjs b/addon/index.mjs index 77716b6..4de11e0 100644 --- a/addon/index.mjs +++ b/addon/index.mjs @@ -34,10 +34,20 @@ const simpleRender = window.mapclay.renderWith(config => ({ }, })) -window.generateMaps(document.querySelector('main') ?? document.body, { - crs: url.searchParams.get('crs') ?? 'EPSG:4326', - addBlocks, - initialLayout: 'sticky', - render: simpleRender, - autoMap: true, +if (!document.querySelector('.Dumby')) { + window.generateMaps(document.querySelector('main') ?? document.body, { + crs: url.searchParams.get('crs') ?? 'EPSG:4326', + addBlocks, + initialLayout: 'sticky', + render: simpleRender, + autoMap: true, + }) +} + +new window.MutationObserver((ms) => { + for (const m of ms) { + console.log(m) + } +}).observe(document.querySelector('#doc'), { + childList: true, }) -- cgit v1.2.3-70-g09d2 From 5867b4fb5d64ce3922e8bb2aae7d47ede1c753e8 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 17 Oct 2024 23:21:05 +0800 Subject: feat: enable JS/CSS file from jsdeliver --- addon/manifest.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addon') diff --git a/addon/manifest.json b/addon/manifest.json index 2d7b1ed..93b0b65 100644 --- a/addon/manifest.json +++ b/addon/manifest.json @@ -30,6 +30,7 @@ "activeTab", "tabs", "scripting", - "https://epsg.io/*" + "https://epsg.io/*", + "https://cdn.jsdelivr.net/*" ] } -- cgit v1.2.3-70-g09d2