umap-project 2.1.2__py3-none-any.whl → 2.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of umap-project might be problematic. Click here for more details.
- umap/__init__.py +1 -1
- umap/context_processors.py +1 -0
- umap/locale/br/LC_MESSAGES/django.mo +0 -0
- umap/locale/en/LC_MESSAGES/django.po +32 -32
- umap/locale/hu/LC_MESSAGES/django.mo +0 -0
- umap/locale/it/LC_MESSAGES/django.mo +0 -0
- umap/locale/ms/LC_MESSAGES/django.mo +0 -0
- umap/migrations/0020_alter_tilelayer_url_template.py +19 -0
- umap/migrations/0021_remove_map_description.py +16 -0
- umap/models.py +10 -6
- umap/settings/base.py +1 -0
- umap/static/umap/base.css +43 -156
- umap/static/umap/content.css +7 -25
- umap/static/umap/css/icon.css +112 -0
- umap/static/umap/css/panel.css +140 -0
- umap/static/umap/img/16-white.svg +5 -1
- umap/static/umap/img/16.svg +7 -4
- umap/static/umap/img/24-white.svg +3 -1
- umap/static/umap/img/24.svg +3 -4
- umap/static/umap/img/source/16-white.svg +176 -940
- umap/static/umap/img/source/16.svg +8 -5
- umap/static/umap/img/source/24-white.svg +5 -3
- umap/static/umap/img/source/24.svg +6 -7
- umap/static/umap/js/modules/browser.js +97 -73
- umap/static/umap/js/modules/dompurify.js +12 -0
- umap/static/umap/js/modules/facets.js +149 -0
- umap/static/umap/js/modules/global.js +9 -1
- umap/static/umap/js/modules/i18n.js +7 -0
- umap/static/umap/js/modules/orderable.js +84 -0
- umap/static/umap/js/modules/panel.js +76 -0
- umap/static/umap/js/modules/request.js +0 -1
- umap/static/umap/js/modules/schema.js +324 -223
- umap/static/umap/js/modules/urls.js +1 -16
- umap/static/umap/js/modules/utils.js +340 -0
- umap/static/umap/js/umap.autocomplete.js +40 -25
- umap/static/umap/js/umap.controls.js +248 -361
- umap/static/umap/js/umap.core.js +77 -366
- umap/static/umap/js/umap.datalayer.permissions.js +1 -1
- umap/static/umap/js/umap.features.js +65 -43
- umap/static/umap/js/umap.forms.js +128 -36
- umap/static/umap/js/umap.icon.js +11 -4
- umap/static/umap/js/umap.importer.js +78 -58
- umap/static/umap/js/umap.js +206 -192
- umap/static/umap/js/umap.layer.js +86 -46
- umap/static/umap/js/umap.permissions.js +13 -9
- umap/static/umap/js/umap.popup.js +26 -30
- umap/static/umap/js/umap.share.js +12 -9
- umap/static/umap/js/umap.tableeditor.js +4 -6
- umap/static/umap/js/umap.ui.js +10 -60
- umap/static/umap/locale/am_ET.js +243 -227
- umap/static/umap/locale/am_ET.json +21 -9
- umap/static/umap/locale/ar.js +243 -227
- umap/static/umap/locale/ar.json +21 -9
- umap/static/umap/locale/ast.js +243 -227
- umap/static/umap/locale/ast.json +21 -9
- umap/static/umap/locale/bg.js +243 -227
- umap/static/umap/locale/bg.json +21 -9
- umap/static/umap/locale/br.js +253 -237
- umap/static/umap/locale/br.json +25 -13
- umap/static/umap/locale/ca.js +243 -227
- umap/static/umap/locale/ca.json +21 -9
- umap/static/umap/locale/cs_CZ.js +243 -227
- umap/static/umap/locale/cs_CZ.json +21 -9
- umap/static/umap/locale/da.js +243 -227
- umap/static/umap/locale/da.json +21 -9
- umap/static/umap/locale/de.js +243 -227
- umap/static/umap/locale/de.json +21 -9
- umap/static/umap/locale/el.js +243 -227
- umap/static/umap/locale/el.json +21 -9
- umap/static/umap/locale/en.js +243 -234
- umap/static/umap/locale/en.json +22 -10
- umap/static/umap/locale/en_US.json +21 -9
- umap/static/umap/locale/es.js +243 -227
- umap/static/umap/locale/es.json +21 -9
- umap/static/umap/locale/et.js +243 -227
- umap/static/umap/locale/et.json +21 -9
- umap/static/umap/locale/eu.js +227 -199
- umap/static/umap/locale/eu.json +1 -1
- umap/static/umap/locale/fa_IR.js +243 -227
- umap/static/umap/locale/fa_IR.json +21 -9
- umap/static/umap/locale/fi.js +243 -227
- umap/static/umap/locale/fi.json +21 -9
- umap/static/umap/locale/fr.js +243 -234
- umap/static/umap/locale/fr.json +21 -9
- umap/static/umap/locale/gl.js +243 -227
- umap/static/umap/locale/gl.json +21 -9
- umap/static/umap/locale/he.js +243 -227
- umap/static/umap/locale/he.json +21 -9
- umap/static/umap/locale/hr.js +243 -227
- umap/static/umap/locale/hr.json +21 -9
- umap/static/umap/locale/hu.js +243 -234
- umap/static/umap/locale/hu.json +21 -9
- umap/static/umap/locale/id.js +243 -227
- umap/static/umap/locale/id.json +21 -9
- umap/static/umap/locale/is.js +243 -227
- umap/static/umap/locale/is.json +21 -9
- umap/static/umap/locale/it.js +243 -234
- umap/static/umap/locale/it.json +21 -9
- umap/static/umap/locale/ja.js +243 -227
- umap/static/umap/locale/ja.json +21 -9
- umap/static/umap/locale/ko.js +243 -227
- umap/static/umap/locale/ko.json +21 -9
- umap/static/umap/locale/lt.js +243 -227
- umap/static/umap/locale/lt.json +21 -9
- umap/static/umap/locale/ms.js +243 -234
- umap/static/umap/locale/ms.json +22 -10
- umap/static/umap/locale/nl.js +246 -230
- umap/static/umap/locale/nl.json +21 -9
- umap/static/umap/locale/no.js +243 -227
- umap/static/umap/locale/no.json +21 -9
- umap/static/umap/locale/pl.js +243 -227
- umap/static/umap/locale/pl.json +21 -9
- umap/static/umap/locale/pl_PL.json +21 -9
- umap/static/umap/locale/pt.js +243 -227
- umap/static/umap/locale/pt.json +21 -9
- umap/static/umap/locale/pt_BR.js +243 -227
- umap/static/umap/locale/pt_BR.json +21 -9
- umap/static/umap/locale/pt_PT.js +243 -227
- umap/static/umap/locale/pt_PT.json +21 -9
- umap/static/umap/locale/ro.js +243 -227
- umap/static/umap/locale/ro.json +21 -9
- umap/static/umap/locale/ru.js +243 -227
- umap/static/umap/locale/ru.json +21 -9
- umap/static/umap/locale/si.js +1 -1
- umap/static/umap/locale/si.json +1 -1
- umap/static/umap/locale/sk_SK.js +243 -227
- umap/static/umap/locale/sk_SK.json +21 -9
- umap/static/umap/locale/sl.js +243 -227
- umap/static/umap/locale/sl.json +21 -9
- umap/static/umap/locale/sr.js +243 -227
- umap/static/umap/locale/sr.json +21 -9
- umap/static/umap/locale/sv.js +243 -227
- umap/static/umap/locale/sv.json +21 -9
- umap/static/umap/locale/th_TH.js +243 -227
- umap/static/umap/locale/th_TH.json +21 -9
- umap/static/umap/locale/tr.js +243 -227
- umap/static/umap/locale/tr.json +21 -9
- umap/static/umap/locale/uk_UA.js +243 -227
- umap/static/umap/locale/uk_UA.json +21 -9
- umap/static/umap/locale/vi.js +243 -227
- umap/static/umap/locale/vi.json +21 -9
- umap/static/umap/locale/vi_VN.json +21 -9
- umap/static/umap/locale/zh.js +243 -227
- umap/static/umap/locale/zh.json +21 -9
- umap/static/umap/locale/zh_CN.json +21 -9
- umap/static/umap/locale/zh_TW.Big5.json +21 -9
- umap/static/umap/locale/zh_TW.js +243 -234
- umap/static/umap/locale/zh_TW.json +21 -9
- umap/static/umap/map.css +124 -264
- umap/static/umap/test/DataLayer.js +1 -1
- umap/static/umap/test/Feature.js +0 -226
- umap/static/umap/test/Map.js +0 -304
- umap/static/umap/test/Polygon.js +0 -256
- umap/static/umap/test/Polyline.js +0 -116
- umap/static/umap/test/TableEditor.js +10 -10
- umap/static/umap/test/Util.js +0 -521
- umap/static/umap/test/index.html +1 -5
- umap/static/umap/unittests/URLs.js +1 -1
- umap/static/umap/unittests/utils.js +610 -0
- umap/static/umap/vars.css +9 -0
- umap/static/umap/vendors/dompurify/purify.es.mjs +1525 -0
- umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +1 -0
- umap/static/umap/vendors/iconlayers/iconLayers.js +1 -1
- umap/templates/umap/css.html +2 -0
- umap/templates/umap/js.html +0 -1
- umap/templates/umap/map_detail.html +4 -0
- umap/templates/umap/map_table.html +12 -10
- umap/templatetags/umap_tags.py +5 -0
- umap/tests/conftest.py +9 -0
- umap/tests/fixtures/test_upload_data.csv +2 -1
- umap/tests/fixtures/test_upload_data.umap +171 -0
- umap/tests/fixtures/test_upload_data_osm.json +33 -0
- umap/tests/integration/conftest.py +16 -0
- umap/tests/integration/test_anonymous_owned_map.py +30 -5
- umap/tests/integration/test_basics.py +21 -0
- umap/tests/integration/test_browser.py +16 -36
- umap/tests/integration/test_choropleth.py +89 -0
- umap/tests/integration/test_collaborative_editing.py +30 -1
- umap/tests/integration/test_dashboard.py +10 -0
- umap/tests/integration/test_datalayer.py +132 -0
- umap/tests/integration/test_draw_polygon.py +363 -0
- umap/tests/integration/test_draw_polyline.py +325 -0
- umap/tests/integration/test_edit_datalayer.py +145 -6
- umap/tests/integration/test_edit_map.py +202 -0
- umap/tests/integration/test_edit_marker.py +120 -0
- umap/tests/integration/test_edit_polygon.py +122 -0
- umap/tests/integration/test_facets_browser.py +132 -11
- umap/tests/integration/test_import.py +407 -10
- umap/tests/integration/test_map.py +36 -54
- umap/tests/integration/test_map_list.py +28 -0
- umap/tests/integration/test_owned_map.py +24 -6
- umap/tests/integration/test_picto.py +25 -38
- umap/tests/integration/test_querystring.py +9 -15
- umap/tests/integration/test_slideshow.py +0 -5
- umap/tests/integration/test_statics.py +3 -2
- umap/tests/integration/test_tableeditor.py +23 -0
- umap/tests/integration/test_tilelayer.py +10 -0
- umap/tests/integration/test_view_marker.py +64 -0
- umap/tests/integration/test_view_polygon.py +59 -0
- umap/tests/integration/test_view_polyline.py +51 -0
- umap/tests/test_map_views.py +13 -0
- {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/METADATA +12 -12
- {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/RECORD +206 -187
- {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/WHEEL +1 -1
- umap/static/umap/test/Choropleth.js +0 -245
- umap/static/umap/test/Permissions.js +0 -74
- umap/static/umap/vendors/dompurify/purify.min.js +0 -3
- umap/static/umap/vendors/dompurify/purify.min.js.map +0 -1
- umap/tests/integration/test_drawing.py +0 -243
- {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/entry_points.txt +0 -0
- {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/licenses/LICENSE +0 -0
umap/static/umap/test/Util.js
CHANGED
|
@@ -1,397 +1,4 @@
|
|
|
1
1
|
describe('L.Util', function () {
|
|
2
|
-
describe('#toHTML()', function () {
|
|
3
|
-
it('should handle title', function () {
|
|
4
|
-
assert.equal(L.Util.toHTML('# A title'), '<h3>A title</h3>')
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
it('should handle title in the middle of the content', function () {
|
|
8
|
-
assert.equal(
|
|
9
|
-
L.Util.toHTML('A phrase\n## A title'),
|
|
10
|
-
'A phrase<br>\n<h4>A title</h4>'
|
|
11
|
-
)
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
it('should handle hr', function () {
|
|
15
|
-
assert.equal(L.Util.toHTML('---'), '<hr>')
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('should handle bold', function () {
|
|
19
|
-
assert.equal(L.Util.toHTML('Some **bold**'), 'Some <strong>bold</strong>')
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it('should handle italic', function () {
|
|
23
|
-
assert.equal(L.Util.toHTML('Some *italic*'), 'Some <em>italic</em>')
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
it('should handle newlines', function () {
|
|
27
|
-
assert.equal(L.Util.toHTML('two\nlines'), 'two<br>\nlines')
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
it('should not change last newline', function () {
|
|
31
|
-
assert.equal(L.Util.toHTML('two\nlines\n'), 'two<br>\nlines\n')
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('should handle two successive newlines', function () {
|
|
35
|
-
assert.equal(L.Util.toHTML('two\n\nlines\n'), 'two<br>\n<br>\nlines\n')
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('should handle links without formatting', function () {
|
|
39
|
-
assert.equal(
|
|
40
|
-
L.Util.toHTML('A simple http://osm.org link'),
|
|
41
|
-
'A simple <a href="http://osm.org" target="_blank">http://osm.org</a> link'
|
|
42
|
-
)
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
it('should handle simple link in title', function () {
|
|
46
|
-
assert.equal(
|
|
47
|
-
L.Util.toHTML('# http://osm.org'),
|
|
48
|
-
'<h3><a href="http://osm.org" target="_blank">http://osm.org</a></h3>'
|
|
49
|
-
)
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
it('should handle links with url parameter', function () {
|
|
53
|
-
assert.equal(
|
|
54
|
-
L.Util.toHTML('A simple https://osm.org/?url=https%3A//anotherurl.com link'),
|
|
55
|
-
'A simple <a href="https://osm.org/?url=https%3A//anotherurl.com" target="_blank">https://osm.org/?url=https%3A//anotherurl.com</a> link'
|
|
56
|
-
)
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
it('should handle simple link inside parenthesis', function () {
|
|
60
|
-
assert.equal(
|
|
61
|
-
L.Util.toHTML('A simple link (http://osm.org)'),
|
|
62
|
-
'A simple link (<a href="http://osm.org" target="_blank">http://osm.org</a>)'
|
|
63
|
-
)
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
it('should handle simple link with formatting', function () {
|
|
67
|
-
assert.equal(
|
|
68
|
-
L.Util.toHTML('A simple [[http://osm.org]] link'),
|
|
69
|
-
'A simple <a href="http://osm.org" target="_blank">http://osm.org</a> link'
|
|
70
|
-
)
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
it('should handle simple link with formatting and content', function () {
|
|
74
|
-
assert.equal(
|
|
75
|
-
L.Util.toHTML('A simple [[http://osm.org|link]]'),
|
|
76
|
-
'A simple <a href="http://osm.org" target="_blank">link</a>'
|
|
77
|
-
)
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
it('should handle simple link followed by a carriage return', function () {
|
|
81
|
-
assert.equal(
|
|
82
|
-
L.Util.toHTML('A simple link http://osm.org\nAnother line'),
|
|
83
|
-
'A simple link <a href="http://osm.org" target="_blank">http://osm.org</a><br>\nAnother line'
|
|
84
|
-
)
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
it('should handle target option', function () {
|
|
88
|
-
assert.equal(
|
|
89
|
-
L.Util.toHTML('A simple http://osm.org link', { target: 'self' }),
|
|
90
|
-
'A simple <a href="http://osm.org" target="_self">http://osm.org</a> link'
|
|
91
|
-
)
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
it('should handle image', function () {
|
|
95
|
-
assert.equal(
|
|
96
|
-
L.Util.toHTML('A simple image: {{http://osm.org/pouet.png}}'),
|
|
97
|
-
'A simple image: <img src="http://osm.org/pouet.png">'
|
|
98
|
-
)
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
it('should handle image without text', function () {
|
|
102
|
-
assert.equal(
|
|
103
|
-
L.Util.toHTML('{{http://osm.org/pouet.png}}'),
|
|
104
|
-
'<img src="http://osm.org/pouet.png">'
|
|
105
|
-
)
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
it('should handle image with width', function () {
|
|
109
|
-
assert.equal(
|
|
110
|
-
L.Util.toHTML('A simple image: {{http://osm.org/pouet.png|100}}'),
|
|
111
|
-
'A simple image: <img style="width:100px;min-width:100px;" src="http://osm.org/pouet.png">'
|
|
112
|
-
)
|
|
113
|
-
})
|
|
114
|
-
|
|
115
|
-
it('should handle iframe', function () {
|
|
116
|
-
assert.equal(
|
|
117
|
-
L.Util.toHTML('A simple iframe: {{{http://osm.org/pouet.html}}}'),
|
|
118
|
-
'A simple iframe: <div><iframe height="300px" width="100%" src="http://osm.org/pouet.html" frameborder="0"></iframe></div>'
|
|
119
|
-
)
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
it('should handle iframe with height', function () {
|
|
123
|
-
assert.equal(
|
|
124
|
-
L.Util.toHTML('A simple iframe: {{{http://osm.org/pouet.html|200}}}'),
|
|
125
|
-
'A simple iframe: <div><iframe height="200px" width="100%" src="http://osm.org/pouet.html" frameborder="0"></iframe></div>'
|
|
126
|
-
)
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
it('should handle iframe with height and width', function () {
|
|
130
|
-
assert.equal(
|
|
131
|
-
L.Util.toHTML('A simple iframe: {{{http://osm.org/pouet.html|200*400}}}'),
|
|
132
|
-
'A simple iframe: <div><iframe height="200px" width="400px" src="http://osm.org/pouet.html" frameborder="0"></iframe></div>'
|
|
133
|
-
)
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
it('should handle iframe with height with px', function () {
|
|
137
|
-
assert.equal(
|
|
138
|
-
L.Util.toHTML('A simple iframe: {{{http://osm.org/pouet.html|200px}}}'),
|
|
139
|
-
'A simple iframe: <div><iframe height="200px" width="100%" src="http://osm.org/pouet.html" frameborder="0"></iframe></div>'
|
|
140
|
-
)
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
it('should handle iframe with url parameter', function () {
|
|
144
|
-
assert.equal(
|
|
145
|
-
L.Util.toHTML(
|
|
146
|
-
'A simple iframe: {{{https://osm.org/?url=https%3A//anotherurl.com}}}'
|
|
147
|
-
),
|
|
148
|
-
'A simple iframe: <div><iframe height="300px" width="100%" src="https://osm.org/?url=https%3A//anotherurl.com" frameborder="0"></iframe></div>'
|
|
149
|
-
)
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
it('should handle iframe with height with px', function () {
|
|
153
|
-
assert.equal(
|
|
154
|
-
L.Util.toHTML(
|
|
155
|
-
'A double iframe: {{{https://osm.org/pouet}}}{{{https://osm.org/boudin}}}'
|
|
156
|
-
),
|
|
157
|
-
'A double iframe: <div><iframe height="300px" width="100%" src="https://osm.org/pouet" frameborder="0"></iframe></div><div><iframe height="300px" width="100%" src="https://osm.org/boudin" frameborder="0"></iframe></div>'
|
|
158
|
-
)
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
it('http link with http link as parameter as variable', function () {
|
|
162
|
-
assert.equal(
|
|
163
|
-
L.Util.toHTML(
|
|
164
|
-
'A phrase with a [[http://iframeurl.com?to=http://another.com]].'
|
|
165
|
-
),
|
|
166
|
-
'A phrase with a <a href="http://iframeurl.com?to=http://another.com" target="_blank">http://iframeurl.com?to=http://another.com</a>.'
|
|
167
|
-
)
|
|
168
|
-
})
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
describe('#escapeHTML', function () {
|
|
172
|
-
it('should escape HTML tags', function () {
|
|
173
|
-
assert.equal(L.Util.escapeHTML('<span onload="alert(oups)">'), '<span></span>')
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
it('should not escape geo: links', function () {
|
|
177
|
-
assert.equal(
|
|
178
|
-
L.Util.escapeHTML('<a href="geo:1,2"></a>'),
|
|
179
|
-
'<a href="geo:1,2"></a>'
|
|
180
|
-
)
|
|
181
|
-
})
|
|
182
|
-
|
|
183
|
-
it('should not fail with int value', function () {
|
|
184
|
-
assert.equal(L.Util.escapeHTML(25), '25')
|
|
185
|
-
})
|
|
186
|
-
|
|
187
|
-
it('should not fail with null value', function () {
|
|
188
|
-
assert.equal(L.Util.escapeHTML(null), '')
|
|
189
|
-
})
|
|
190
|
-
})
|
|
191
|
-
|
|
192
|
-
describe('#greedyTemplate', function () {
|
|
193
|
-
it('should replace simple props', function () {
|
|
194
|
-
assert.equal(
|
|
195
|
-
L.Util.greedyTemplate('A phrase with a {variable}.', { variable: 'thing' }),
|
|
196
|
-
'A phrase with a thing.'
|
|
197
|
-
)
|
|
198
|
-
})
|
|
199
|
-
|
|
200
|
-
it('should not fail when missing key', function () {
|
|
201
|
-
assert.equal(
|
|
202
|
-
L.Util.greedyTemplate('A phrase with a {missing}', {}),
|
|
203
|
-
'A phrase with a '
|
|
204
|
-
)
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
it('should process brakets in brakets', function () {
|
|
208
|
-
assert.equal(
|
|
209
|
-
L.Util.greedyTemplate('A phrase with a {{{variable}}}.', { variable: 'value' }),
|
|
210
|
-
'A phrase with a {{value}}.'
|
|
211
|
-
)
|
|
212
|
-
})
|
|
213
|
-
|
|
214
|
-
it('should not process http links', function () {
|
|
215
|
-
assert.equal(
|
|
216
|
-
L.Util.greedyTemplate('A phrase with a {{{http://iframeurl.com}}}.', {
|
|
217
|
-
'http://iframeurl.com': 'value',
|
|
218
|
-
}),
|
|
219
|
-
'A phrase with a {{{http://iframeurl.com}}}.'
|
|
220
|
-
)
|
|
221
|
-
})
|
|
222
|
-
|
|
223
|
-
it('should not accept dash', function () {
|
|
224
|
-
assert.equal(
|
|
225
|
-
L.Util.greedyTemplate('A phrase with a {var-iable}.', { 'var-iable': 'value' }),
|
|
226
|
-
'A phrase with a {var-iable}.'
|
|
227
|
-
)
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
it('should accept colon', function () {
|
|
231
|
-
assert.equal(
|
|
232
|
-
L.Util.greedyTemplate('A phrase with a {variable:fr}.', {
|
|
233
|
-
'variable:fr': 'value',
|
|
234
|
-
}),
|
|
235
|
-
'A phrase with a value.'
|
|
236
|
-
)
|
|
237
|
-
})
|
|
238
|
-
|
|
239
|
-
it('should accept arobase', function () {
|
|
240
|
-
assert.equal(
|
|
241
|
-
L.Util.greedyTemplate('A phrase with a {@variable}.', {
|
|
242
|
-
'@variable': 'value',
|
|
243
|
-
}),
|
|
244
|
-
'A phrase with a value.'
|
|
245
|
-
)
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
it('should accept space', function () {
|
|
249
|
-
assert.equal(
|
|
250
|
-
L.Util.greedyTemplate('A phrase with a {var iable}.', {
|
|
251
|
-
'var iable': 'value',
|
|
252
|
-
}),
|
|
253
|
-
'A phrase with a value.'
|
|
254
|
-
)
|
|
255
|
-
})
|
|
256
|
-
|
|
257
|
-
it('should accept non ascii chars', function () {
|
|
258
|
-
assert.equal(
|
|
259
|
-
L.Util.greedyTemplate('A phrase with a {Accessibilité} and {переменная}.', {
|
|
260
|
-
Accessibilité: 'value',
|
|
261
|
-
переменная: 'another',
|
|
262
|
-
}),
|
|
263
|
-
'A phrase with a value and another.'
|
|
264
|
-
)
|
|
265
|
-
})
|
|
266
|
-
|
|
267
|
-
it('should replace even with ignore if key is found', function () {
|
|
268
|
-
assert.equal(
|
|
269
|
-
L.Util.greedyTemplate(
|
|
270
|
-
'A phrase with a {variable:fr}.',
|
|
271
|
-
{ 'variable:fr': 'value' },
|
|
272
|
-
true
|
|
273
|
-
),
|
|
274
|
-
'A phrase with a value.'
|
|
275
|
-
)
|
|
276
|
-
})
|
|
277
|
-
|
|
278
|
-
it('should keep string when using ignore if key is not found', function () {
|
|
279
|
-
assert.equal(
|
|
280
|
-
L.Util.greedyTemplate('A phrase with a {variable:fr}.', {}, true),
|
|
281
|
-
'A phrase with a {variable:fr}.'
|
|
282
|
-
)
|
|
283
|
-
})
|
|
284
|
-
|
|
285
|
-
it('should replace nested variables', function () {
|
|
286
|
-
assert.equal(
|
|
287
|
-
L.Util.greedyTemplate('A phrase with a {fr.var}.', { fr: { var: 'value' } }),
|
|
288
|
-
'A phrase with a value.'
|
|
289
|
-
)
|
|
290
|
-
})
|
|
291
|
-
|
|
292
|
-
it('should not fail if nested variable is missing', function () {
|
|
293
|
-
assert.equal(
|
|
294
|
-
L.Util.greedyTemplate('A phrase with a {fr.var.foo}.', {
|
|
295
|
-
fr: { var: 'value' },
|
|
296
|
-
}),
|
|
297
|
-
'A phrase with a .'
|
|
298
|
-
)
|
|
299
|
-
})
|
|
300
|
-
|
|
301
|
-
it('should not fail with nested variables and no data', function () {
|
|
302
|
-
assert.equal(
|
|
303
|
-
L.Util.greedyTemplate('A phrase with a {fr.var.foo}.', {}),
|
|
304
|
-
'A phrase with a .'
|
|
305
|
-
)
|
|
306
|
-
})
|
|
307
|
-
|
|
308
|
-
it('should handle fallback value if any', function () {
|
|
309
|
-
assert.equal(
|
|
310
|
-
L.Util.greedyTemplate('A phrase with a {fr.var.bar|"default"}.', {}),
|
|
311
|
-
'A phrase with a default.'
|
|
312
|
-
)
|
|
313
|
-
})
|
|
314
|
-
|
|
315
|
-
it('should handle fallback var if any', function () {
|
|
316
|
-
assert.equal(
|
|
317
|
-
L.Util.greedyTemplate('A phrase with a {fr.var.bar|fallback}.', {
|
|
318
|
-
fallback: 'default',
|
|
319
|
-
}),
|
|
320
|
-
'A phrase with a default.'
|
|
321
|
-
)
|
|
322
|
-
})
|
|
323
|
-
|
|
324
|
-
it('should handle multiple fallbacks', function () {
|
|
325
|
-
assert.equal(
|
|
326
|
-
L.Util.greedyTemplate('A phrase with a {fr.var.bar|try.again|"default"}.', {}),
|
|
327
|
-
'A phrase with a default.'
|
|
328
|
-
)
|
|
329
|
-
})
|
|
330
|
-
|
|
331
|
-
it('should use the first defined value', function () {
|
|
332
|
-
assert.equal(
|
|
333
|
-
L.Util.greedyTemplate('A phrase with a {fr.var.bar|try.again|"default"}.', {
|
|
334
|
-
try: { again: 'please' },
|
|
335
|
-
}),
|
|
336
|
-
'A phrase with a please.'
|
|
337
|
-
)
|
|
338
|
-
})
|
|
339
|
-
|
|
340
|
-
it('should use the first defined value', function () {
|
|
341
|
-
assert.equal(
|
|
342
|
-
L.Util.greedyTemplate('A phrase with a {fr.var.bar|try.again|"default"}.', {
|
|
343
|
-
try: { again: 'again' },
|
|
344
|
-
fr: { var: { bar: 'value' } },
|
|
345
|
-
}),
|
|
346
|
-
'A phrase with a value.'
|
|
347
|
-
)
|
|
348
|
-
})
|
|
349
|
-
|
|
350
|
-
it('should support the first example from #820 when translated to final syntax', function () {
|
|
351
|
-
assert.equal(
|
|
352
|
-
L.Util.greedyTemplate('# {name} ({ele|"-"} m ü. M.)', { name: 'Portalet' }),
|
|
353
|
-
'# Portalet (- m ü. M.)'
|
|
354
|
-
)
|
|
355
|
-
})
|
|
356
|
-
|
|
357
|
-
it('should support the first example from #820 when translated to final syntax when no fallback required', function () {
|
|
358
|
-
assert.equal(
|
|
359
|
-
L.Util.greedyTemplate('# {name} ({ele|"-"} m ü. M.)', {
|
|
360
|
-
name: 'Portalet',
|
|
361
|
-
ele: 3344,
|
|
362
|
-
}),
|
|
363
|
-
'# Portalet (3344 m ü. M.)'
|
|
364
|
-
)
|
|
365
|
-
})
|
|
366
|
-
|
|
367
|
-
it('should support white space in fallback', function () {
|
|
368
|
-
assert.equal(
|
|
369
|
-
L.Util.greedyTemplate('A phrase with {var|"white space in the fallback."}', {}),
|
|
370
|
-
'A phrase with white space in the fallback.'
|
|
371
|
-
)
|
|
372
|
-
})
|
|
373
|
-
|
|
374
|
-
it('should support empty string as fallback', function () {
|
|
375
|
-
assert.equal(
|
|
376
|
-
L.Util.greedyTemplate(
|
|
377
|
-
'A phrase with empty string ("{var|""}") in the fallback.',
|
|
378
|
-
{}
|
|
379
|
-
),
|
|
380
|
-
'A phrase with empty string ("") in the fallback.'
|
|
381
|
-
)
|
|
382
|
-
})
|
|
383
|
-
|
|
384
|
-
it('should support e.g. links as fallback', function () {
|
|
385
|
-
assert.equal(
|
|
386
|
-
L.Util.greedyTemplate(
|
|
387
|
-
'A phrase with {var|"[[https://osm.org|link]]"} as fallback.',
|
|
388
|
-
{}
|
|
389
|
-
),
|
|
390
|
-
'A phrase with [[https://osm.org|link]] as fallback.'
|
|
391
|
-
)
|
|
392
|
-
})
|
|
393
|
-
})
|
|
394
|
-
|
|
395
2
|
describe('#TextColorFromBackgroundColor', function () {
|
|
396
3
|
it('should output white for black', function () {
|
|
397
4
|
document.body.style.backgroundColor = 'black'
|
|
@@ -418,132 +25,4 @@ describe('L.Util', function () {
|
|
|
418
25
|
assert.equal(L.DomUtil.TextColorFromBackgroundColor(document.body), '#000000')
|
|
419
26
|
})
|
|
420
27
|
})
|
|
421
|
-
|
|
422
|
-
describe('#flattenCoordinates()', function () {
|
|
423
|
-
it('should not alter already flat coords', function () {
|
|
424
|
-
var coords = [
|
|
425
|
-
[1, 2],
|
|
426
|
-
[3, 4],
|
|
427
|
-
]
|
|
428
|
-
assert.deepEqual(L.Util.flattenCoordinates(coords), coords)
|
|
429
|
-
})
|
|
430
|
-
|
|
431
|
-
it('should flatten nested coords', function () {
|
|
432
|
-
var coords = [
|
|
433
|
-
[
|
|
434
|
-
[1, 2],
|
|
435
|
-
[3, 4],
|
|
436
|
-
],
|
|
437
|
-
]
|
|
438
|
-
assert.deepEqual(L.Util.flattenCoordinates(coords), coords[0])
|
|
439
|
-
coords = [
|
|
440
|
-
[
|
|
441
|
-
[
|
|
442
|
-
[1, 2],
|
|
443
|
-
[3, 4],
|
|
444
|
-
],
|
|
445
|
-
],
|
|
446
|
-
]
|
|
447
|
-
assert.deepEqual(L.Util.flattenCoordinates(coords), coords[0][0])
|
|
448
|
-
})
|
|
449
|
-
|
|
450
|
-
it('should not fail on empty coords', function () {
|
|
451
|
-
var coords = []
|
|
452
|
-
assert.deepEqual(L.Util.flattenCoordinates(coords), coords)
|
|
453
|
-
})
|
|
454
|
-
})
|
|
455
|
-
|
|
456
|
-
describe('#usableOption()', function () {
|
|
457
|
-
it('should consider false', function () {
|
|
458
|
-
assert.ok(L.Util.usableOption({ key: false }, 'key'))
|
|
459
|
-
})
|
|
460
|
-
|
|
461
|
-
it('should consider 0', function () {
|
|
462
|
-
assert.ok(L.Util.usableOption({ key: 0 }, 'key'))
|
|
463
|
-
})
|
|
464
|
-
|
|
465
|
-
it('should not consider undefined', function () {
|
|
466
|
-
assert.notOk(L.Util.usableOption({}, 'key'))
|
|
467
|
-
})
|
|
468
|
-
|
|
469
|
-
it('should not consider empty string', function () {
|
|
470
|
-
assert.notOk(L.Util.usableOption({ key: '' }, 'key'))
|
|
471
|
-
})
|
|
472
|
-
|
|
473
|
-
it('should consider null', function () {
|
|
474
|
-
assert.ok(L.Util.usableOption({ key: null }, 'key'))
|
|
475
|
-
})
|
|
476
|
-
})
|
|
477
|
-
|
|
478
|
-
describe('#normalize()', function () {
|
|
479
|
-
if (
|
|
480
|
-
('should remove accents',
|
|
481
|
-
function () {
|
|
482
|
-
// French é
|
|
483
|
-
assert.equal(L.Util.normalize('aéroport'), 'aeroport')
|
|
484
|
-
// American é
|
|
485
|
-
assert.equal(L.Util.normalize('aéroport'), 'aeroport')
|
|
486
|
-
})
|
|
487
|
-
);
|
|
488
|
-
})
|
|
489
|
-
|
|
490
|
-
describe('#sortFeatures()', function () {
|
|
491
|
-
let feat1, feat2, feat3
|
|
492
|
-
before(function () {
|
|
493
|
-
feat1 = { properties: {} }
|
|
494
|
-
feat2 = { properties: {} }
|
|
495
|
-
feat3 = { properties: {} }
|
|
496
|
-
})
|
|
497
|
-
it('should sort feature from custom key', function () {
|
|
498
|
-
feat1.properties.mykey = '13. foo'
|
|
499
|
-
feat2.properties.mykey = '7. foo'
|
|
500
|
-
feat3.properties.mykey = '111. foo'
|
|
501
|
-
let features = L.Util.sortFeatures([feat1, feat2, feat3], 'mykey')
|
|
502
|
-
assert.equal(features[0], feat2)
|
|
503
|
-
assert.equal(features[1], feat1)
|
|
504
|
-
assert.equal(features[2], feat3)
|
|
505
|
-
})
|
|
506
|
-
it('should sort feature from multiple keys', function () {
|
|
507
|
-
feat1.properties.mykey = '13. foo'
|
|
508
|
-
feat2.properties.mykey = '111. foo'
|
|
509
|
-
feat3.properties.mykey = '111. foo'
|
|
510
|
-
feat1.properties.otherkey = 'C'
|
|
511
|
-
feat2.properties.otherkey = 'B'
|
|
512
|
-
feat3.properties.otherkey = 'A'
|
|
513
|
-
let features = L.Util.sortFeatures([feat1, feat2, feat3], 'mykey,otherkey')
|
|
514
|
-
assert.equal(features[0], feat1)
|
|
515
|
-
assert.equal(features[1], feat3)
|
|
516
|
-
assert.equal(features[2], feat2)
|
|
517
|
-
})
|
|
518
|
-
it('should sort feature from custom key reverse', function () {
|
|
519
|
-
feat1.properties.mykey = '13. foo'
|
|
520
|
-
feat2.properties.mykey = '7. foo'
|
|
521
|
-
feat3.properties.mykey = '111. foo'
|
|
522
|
-
let features = L.Util.sortFeatures([feat1, feat2, feat3], '-mykey')
|
|
523
|
-
assert.equal(features[0], feat3)
|
|
524
|
-
assert.equal(features[1], feat1)
|
|
525
|
-
assert.equal(features[2], feat2)
|
|
526
|
-
})
|
|
527
|
-
it('should sort feature from multiple keys with reverse', function () {
|
|
528
|
-
feat1.properties.mykey = '13. foo'
|
|
529
|
-
feat2.properties.mykey = '111. foo'
|
|
530
|
-
feat3.properties.mykey = '111. foo'
|
|
531
|
-
feat1.properties.otherkey = 'C'
|
|
532
|
-
feat2.properties.otherkey = 'B'
|
|
533
|
-
feat3.properties.otherkey = 'A'
|
|
534
|
-
let features = L.Util.sortFeatures([feat1, feat2, feat3], 'mykey,-otherkey')
|
|
535
|
-
assert.equal(features[0], feat1)
|
|
536
|
-
assert.equal(features[1], feat2)
|
|
537
|
-
assert.equal(features[2], feat3)
|
|
538
|
-
})
|
|
539
|
-
it('should sort feature with space first', function () {
|
|
540
|
-
feat1.properties.mykey = '1 foo'
|
|
541
|
-
feat2.properties.mykey = '2 foo'
|
|
542
|
-
feat3.properties.mykey = '1a foo'
|
|
543
|
-
let features = L.Util.sortFeatures([feat1, feat2, feat3], 'mykey')
|
|
544
|
-
assert.equal(features[0], feat1)
|
|
545
|
-
assert.equal(features[1], feat3)
|
|
546
|
-
assert.equal(features[2], feat2)
|
|
547
|
-
})
|
|
548
|
-
})
|
|
549
28
|
})
|
umap/static/umap/test/index.html
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<title>Umap front Tests</title>
|
|
5
5
|
<meta charset="utf-8" />
|
|
6
|
+
<script type="module" src="../js/modules/leaflet-configure.js" defer></script>
|
|
6
7
|
<script type="module" src="../js/modules/global.js" defer></script>
|
|
7
8
|
|
|
8
9
|
<script src="../vendors/editable/Path.Drag.js" defer></script>
|
|
@@ -27,7 +28,6 @@
|
|
|
27
28
|
<script src="../vendors/iconlayers/iconLayers.js" defer></script>
|
|
28
29
|
<script src="../vendors/tokml/tokml.js" defer></script>
|
|
29
30
|
<script src="../vendors/locatecontrol/L.Control.Locate.min.js" defer></script>
|
|
30
|
-
<script src="../vendors/dompurify/purify.min.js" defer></script>
|
|
31
31
|
<script src="../vendors/colorbrewer/colorbrewer.js" defer></script>
|
|
32
32
|
<script src="../vendors/simple-statistics/simple-statistics.min.js" defer></script>
|
|
33
33
|
|
|
@@ -88,15 +88,11 @@
|
|
|
88
88
|
</script>
|
|
89
89
|
<script src="./_pre.js" defer></script>
|
|
90
90
|
<script src="./Map.js" defer></script>
|
|
91
|
-
<script src="./DataLayer.js" defer></script>
|
|
92
|
-
<script src="./TableEditor.js" defer></script>
|
|
93
91
|
<script src="./Feature.js" defer></script>
|
|
94
92
|
<script src="./Marker.js" defer></script>
|
|
95
93
|
<script src="./Polyline.js" defer></script>
|
|
96
94
|
<script src="./Polygon.js" defer></script>
|
|
97
95
|
<script src="./Util.js" defer></script>
|
|
98
|
-
<script src="./Permissions.js" defer></script>
|
|
99
|
-
<script src="./Choropleth.js" defer></script>
|
|
100
96
|
<script type="module" src="./URLs.js" defer></script>
|
|
101
97
|
<style type="text/css">
|
|
102
98
|
#mocha {
|