From 4b34a7d300ffb0770607c56adf0a4733e0870f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 8 Jan 2024 19:14:10 +0100 Subject: [PATCH] merge index.js with global.js --- umap/static/umap/js/modules/global.js | 7 +- umap/static/umap/js/modules/index.js | 6 -- umap/static/umap/test/index.html | 1 - umap/templates/umap/content.html | 2 +- umap/templates/umap/js.html | 111 +++++++++++++------------- umap/templates/umap/map_fragment.html | 2 +- umap/templates/umap/map_init.html | 2 +- 7 files changed, 63 insertions(+), 68 deletions(-) delete mode 100644 umap/static/umap/js/modules/index.js diff --git a/umap/static/umap/js/modules/global.js b/umap/static/umap/js/modules/global.js index a9485375..51ba37d0 100644 --- a/umap/static/umap/js/modules/global.js +++ b/umap/static/umap/js/modules/global.js @@ -1,5 +1,8 @@ import * as L from '../../vendors/leaflet/leaflet-src.esm.js' +import URLs from './urls.js' +// Import modules and export them to the global scope. +// For the not yet module-compatible JS out there. -// Exposes the modules to the window global scope, it's expected by leaflet plugins -// in a writeable form. +// Copy the leaflet module, it's expected by leaflet plugins to be writeable. window.L = { ...L } +window.umap = { URLs } diff --git a/umap/static/umap/js/modules/index.js b/umap/static/umap/js/modules/index.js deleted file mode 100644 index c9f37269..00000000 --- a/umap/static/umap/js/modules/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import URLs from './urls.js' - -// expose the modules to the window.umap global scope -window.umap = { URLs } - -export { URLs } diff --git a/umap/static/umap/test/index.html b/umap/static/umap/test/index.html index 0d643766..d809370f 100644 --- a/umap/static/umap/test/index.html +++ b/umap/static/umap/test/index.html @@ -29,7 +29,6 @@ - diff --git a/umap/templates/umap/content.html b/umap/templates/umap/content.html index 2dd3d64a..29cc8329 100644 --- a/umap/templates/umap/content.html +++ b/umap/templates/umap/content.html @@ -38,7 +38,7 @@ {% block bottom_js %} {{ block.super }} - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + {% endcompress %} {% if locale %}{% endif %} {% compress js %} - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + {% endcompress %} diff --git a/umap/templates/umap/map_fragment.html b/umap/templates/umap/map_fragment.html index 5ff40350..9aef37c9 100644 --- a/umap/templates/umap/map_fragment.html +++ b/umap/templates/umap/map_fragment.html @@ -3,7 +3,7 @@ diff --git a/umap/templates/umap/map_init.html b/umap/templates/umap/map_init.html index c7e36560..61b8a6bc 100644 --- a/umap/templates/umap/map_init.html +++ b/umap/templates/umap/map_init.html @@ -2,7 +2,7 @@