diff --git a/package-lock.json b/package-lock.json index 930c16ca..f6c5ca40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "leaflet-contextmenu": "^1.4.0", "leaflet-editable": "^1.2.0", "leaflet-editinosm": "0.2.3", - "leaflet-formbuilder": "0.2.6", + "leaflet-formbuilder": "0.2.7", "leaflet-fullscreen": "1.0.2", "leaflet-hash": "0.2.1", "leaflet-i18n": "0.3.3", @@ -1377,9 +1377,9 @@ "integrity": "sha1-8HFmTEpSe3b3uPm87HRLJIiVwHE=" }, "node_modules/leaflet-formbuilder": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/leaflet-formbuilder/-/leaflet-formbuilder-0.2.6.tgz", - "integrity": "sha512-aBpR0PqvsFYVjPSwhPyOQGymQAmepOrZSXniwYimRSJMX7IO4TNeNv1Svwn7yiuKms7T0Y/Ib7KWnGy1c+A91Q==" + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/leaflet-formbuilder/-/leaflet-formbuilder-0.2.7.tgz", + "integrity": "sha512-5/QXEPmlSPNzl5r8rNlhcQOfI2Bx9vo/FBaBCV7o37MmZZ2jyA4aRu+6j91CnyRmKXfU5f/42E0yJva/Dwnqcw==" }, "node_modules/leaflet-fullscreen": { "version": "1.0.2", @@ -3564,9 +3564,9 @@ "integrity": "sha1-8HFmTEpSe3b3uPm87HRLJIiVwHE=" }, "leaflet-formbuilder": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/leaflet-formbuilder/-/leaflet-formbuilder-0.2.6.tgz", - "integrity": "sha512-aBpR0PqvsFYVjPSwhPyOQGymQAmepOrZSXniwYimRSJMX7IO4TNeNv1Svwn7yiuKms7T0Y/Ib7KWnGy1c+A91Q==" + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/leaflet-formbuilder/-/leaflet-formbuilder-0.2.7.tgz", + "integrity": "sha512-5/QXEPmlSPNzl5r8rNlhcQOfI2Bx9vo/FBaBCV7o37MmZZ2jyA4aRu+6j91CnyRmKXfU5f/42E0yJva/Dwnqcw==" }, "leaflet-fullscreen": { "version": "1.0.2", diff --git a/package.json b/package.json index e6dcd033..b2995e06 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "leaflet-contextmenu": "^1.4.0", "leaflet-editable": "^1.2.0", "leaflet-editinosm": "0.2.3", - "leaflet-formbuilder": "0.2.6", + "leaflet-formbuilder": "0.2.7", "leaflet-fullscreen": "1.0.2", "leaflet-hash": "0.2.1", "leaflet-i18n": "0.3.3", diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css index 05af31bf..5bc48647 100644 --- a/umap/static/umap/base.css +++ b/umap/static/umap/base.css @@ -669,6 +669,11 @@ input[type=hidden].blur + .button { /*box-shadow: inset 0 0 0 1px #215d9c;*/ color: #efefef; } +input:invalid { + border-color: red; + background-color: darkred; +} + /* *********** */ /* Alerts */ diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 784b0f3c..3b85c2ac 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -14,6 +14,7 @@ L.Map.mergeOptions({ default_popupContentTemplate: '# {name}\n{description}', default_interactive: true, default_labelDirection: 'auto', + maxZoomLimit: 20, attributionControl: false, editMode: 'advanced', embedControl: true, @@ -1502,15 +1503,26 @@ L.U.Map.include({ handler: 'BlurInput', helpText: `${L._('Supported scheme')}: http://{s}.domain.com/{z}/{x}/{y}.png`, placeholder: 'url', + type: 'url', }, ], [ 'options.tilelayer.maxZoom', - { handler: 'BlurIntInput', placeholder: L._('max zoom') }, + { + handler: 'BlurIntInput', + placeholder: L._('max zoom'), + min: 0, + max: this.options.maxZoomLimit, + }, ], [ 'options.tilelayer.minZoom', - { handler: 'BlurIntInput', placeholder: L._('min zoom') }, + { + handler: 'BlurIntInput', + placeholder: L._('min zoom'), + min: 0, + max: this.options.maxZoomLimit, + }, ], [ 'options.tilelayer.attribution', @@ -1541,15 +1553,26 @@ L.U.Map.include({ helpText: `${L._('Supported scheme')}: http://{s}.domain.com/{z}/{x}/{y}.png`, placeholder: 'url', helpText: L._('Background overlay url'), + type: 'url', }, ], [ 'options.overlay.maxZoom', - { handler: 'BlurIntInput', placeholder: L._('max zoom') }, + { + handler: 'BlurIntInput', + placeholder: L._('max zoom'), + min: 0, + max: this.options.maxZoomLimit, + }, ], [ 'options.overlay.minZoom', - { handler: 'BlurIntInput', placeholder: L._('min zoom') }, + { + handler: 'BlurIntInput', + placeholder: L._('min zoom'), + min: 0, + max: this.options.maxZoomLimit, + }, ], [ 'options.overlay.attribution',