From 865506181706e96f46ff8a324a3c415a8b836c0e Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 2 Jun 2018 15:43:22 +0200 Subject: [PATCH] Rename in JS/CSS: storage_ => umap_ storage- => umap- --- Makefile | 2 +- umap/static/umap/default.css | 88 +++--- umap/static/umap/js/umap.controls.js | 78 ++--- umap/static/umap/js/umap.core.js | 20 +- umap/static/umap/js/umap.features.js | 88 +++--- umap/static/umap/js/umap.forms.js | 14 +- umap/static/umap/js/umap.icon.js | 8 +- umap/static/umap/js/umap.js | 66 ++-- umap/static/umap/js/umap.layer.js | 55 ++-- umap/static/umap/js/umap.popup.js | 14 +- umap/static/umap/js/umap.slideshow.js | 8 +- umap/static/umap/js/umap.tableeditor.js | 10 +- umap/static/umap/js/umap.ui.js | 32 +- umap/static/umap/js/umap.xhr.js | 4 +- umap/static/umap/storage.css | 390 ++++++++++++------------ umap/static/umap/test/Controls.js | 12 +- umap/static/umap/test/DataLayer.js | 50 +-- umap/static/umap/test/Feature.js | 36 +-- umap/static/umap/test/Map.js | 72 ++--- umap/static/umap/test/Polygon.js | 8 +- umap/static/umap/test/Polyline.js | 8 +- umap/static/umap/test/TableEditor.js | 24 +- umap/static/umap/test/_pre.js | 12 +- umap/static/umap/umap.css | 12 +- umap/templatetags/umap_tags.py | 6 +- umap/tests/base.py | 2 +- umap/tests/test_datalayer_views.py | 4 +- umap/views.py | 6 +- 28 files changed, 566 insertions(+), 563 deletions(-) diff --git a/Makefile b/Makefile index a93c62f9..ed31d91f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ test: - py.test -xv + py.test -xv umap/tests/ develop: python setup.py develop compilemessages: diff --git a/umap/static/umap/default.css b/umap/static/umap/default.css index c1977041..8224c70d 100644 --- a/umap/static/umap/default.css +++ b/umap/static/umap/default.css @@ -224,10 +224,10 @@ input.switch:checked ~ label:after { .button-bar { margin-top: 5px; } -.storage-multiplechoice input[type='radio'] { +.umap-multiplechoice input[type='radio'] { display: none; } -.storage-multiplechoice label { +.umap-multiplechoice label { border: 1px solid #374E75; cursor: pointer; background-color: #c9c9c7; @@ -237,14 +237,14 @@ input.switch:checked ~ label:after { width: calc(100% / 3); display: inline-block; } -.storage-multiplechoice.by4 label { +.umap-multiplechoice.by4 label { width: calc(100% / 4); } -.dark .storage-multiplechoice label { +.dark .umap-multiplechoice label { border: 1px solid black; background-color: #2c3233; } -.storage-multiplechoice input[type='radio']:checked + label { +.umap-multiplechoice input[type='radio']:checked + label { background-color: #215d9c; box-shadow: inset 0 0 6px 0px #2c3233; color: #ededed; @@ -317,7 +317,7 @@ i.info { .leaflet-ui-container { overflow-x: hidden; } -#storage-ui-container { +#umap-ui-container { width: 400px; position: fixed; top: 0; @@ -331,57 +331,57 @@ i.info { opacity: 0.98; cursor: initial; } -#storage-ui-container.dark { +#umap-ui-container.dark { border-left: 1px solid #222; background-color: #323737; color: #efefef; } -#storage-ui-container.fullwidth { +#umap-ui-container.fullwidth { width: 100%; z-index: 10000; padding-left: 0; padding-right: 0; transition: all .7s; } -.storage-edit-enabled #storage-ui-container { +.umap-edit-enabled #umap-ui-container { top: 46px; } -.storage-caption-bar-enabled #storage-ui-container { +.umap-caption-bar-enabled #umap-ui-container { bottom: 46px; } -.storage-ui #storage-ui-container { +.umap-ui #umap-ui-container { right: 0; } .leaflet-top, .leaflet-right { transition: all .7s; } -.storage-ui .leaflet-right { +.umap-ui .leaflet-right { right: 400px; } -#storage-ui-container, -#storage-alert-container, -#storage-tooltip-container { +#umap-ui-container, +#umap-alert-container, +#umap-tooltip-container { -moz-box-sizing:border-box; -webkit-box-sizing:border-box; box-sizing: border-box; } -#storage-ui-container .storage-popup-content img { +#umap-ui-container .umap-popup-content img { /* See https://github.com/Leaflet/Leaflet/commit/61d746818b99d362108545c151a27f09d60960ee#commitcomment-6061847 */ max-width: 99% !important; } -#storage-ui-container .storage-popup-content { +#umap-ui-container .umap-popup-content { max-height: inherit; } -#storage-ui-container .body { +#umap-ui-container .body { clear: both; height: calc(100% - 46px); /* Minus size of toolbox */ } -#storage-ui-container .toolbox { +#umap-ui-container .toolbox { padding: 5px 0; overflow: hidden; } -#storage-ui-container .toolbox li { +#umap-ui-container .toolbox li { color: #2e3436; line-height: 32px; cursor: pointer; @@ -391,19 +391,19 @@ i.info { border: 1px solid #b6b6b3; border-radius: 2px; } -#storage-ui-container.dark .toolbox li { +#umap-ui-container.dark .toolbox li { color: #d3dfeb; border: 1px solid #202425; } -#storage-ui-container .toolbox li:hover { +#umap-ui-container .toolbox li:hover { color: #2e3436; background-color: #d4d4d2; } -#storage-ui-container.dark .toolbox li:hover { +#umap-ui-container.dark .toolbox li:hover { color: #eeeeec; background-color: #353c3e; } -#storage-ui-container .toolbox li + li { +#umap-ui-container .toolbox li + li { margin-right: 5px; margin-left: 5px; } @@ -417,7 +417,7 @@ i.info { /* *********** */ /* Alerts */ /* *********** */ -#storage-alert-container { +#umap-alert-container { min-height: 46px; line-height: 46px; padding-left: 10px; @@ -435,35 +435,35 @@ i.info { z-index: 1002; border-radius: 2px; } -#storage-alert-container.error { +#umap-alert-container.error { background-color: #c60f13; } -.storage-alert #storage-alert-container { +.umap-alert #umap-alert-container { visibility: visible; top: 23px; } -.storage-alert .storage-action { +.umap-alert .umap-action { margin-left: 10px; background-color: #fff; color: #999; padding: 5px; border-radius: 4px; } -.storage-alert .storage-action:hover { +.umap-alert .umap-action:hover { color: #000; } -.storage-alert .error .storage-action { +.umap-alert .error .umap-action { background-color: #666; color: #eee; } -.storage-alert .error .storage-action:hover { +.umap-alert .error .umap-action:hover { color: #fff; } /* *********** */ /* Tooltip */ /* *********** */ -#storage-tooltip-container { +#umap-tooltip-container { line-height: 20px; padding: 5px 10px; width: auto; @@ -478,10 +478,10 @@ i.info { font-weight: normal; max-width: 300px; } -.storage-tooltip #storage-tooltip-container { +.umap-tooltip #umap-tooltip-container { display: block; } -#storage-tooltip-container.tooltip-top:after { +#umap-tooltip-container.tooltip-top:after { top: 100%; left: calc(50% - 11px); border: solid transparent; @@ -494,7 +494,7 @@ i.info { border-width: 11px; margin-left: calc(-50% + 21px); } -#storage-tooltip-container.tooltip.tooltip-left:after { +#umap-tooltip-container.tooltip.tooltip-left:after { left: 100%; top: 50%; border: solid transparent; @@ -514,7 +514,7 @@ i.info { /* *********** */ /* Close link */ /* *********** */ -.storage-close-icon { +.umap-close-icon { background-repeat: no-repeat; background-image: url('./img/16.png'); background-position: -52px -9px; @@ -522,25 +522,25 @@ i.info { padding: 0 10px; vertical-align: middle; } -.dark .storage-close-icon { +.dark .umap-close-icon { background-image: url('./img/16-white.png'); } -.dark .storage-close-link { +.dark .umap-close-link { border: 1px solid #202425; color: #eeeeec; padding: 0 7px; line-height: 32px; background-color: #323737; } -.dark .storage-close-link:hover { +.dark .umap-close-link:hover { background-color: #2e3436; } -.storage-alert .storage-close-link { +.umap-alert .umap-close-link { color: #fff; float: right; padding-right: 10px; } -.storage-alert .storage-close-icon { +.umap-alert .umap-close-icon { background-position: -128px -90px; } @@ -549,7 +549,7 @@ i.info { /* Mobile */ /* *********** */ @media all and (orientation:portrait) { - .storage-ui #storage-ui-container { + .umap-ui #umap-ui-container { height: 50%; max-height: 400px; width: 100%; @@ -558,10 +558,10 @@ i.info { right: 0; left: 0; } - .storage-ui .leaflet-right { + .umap-ui .leaflet-right { right: 0; } - #storage-alert-container { + #umap-alert-container { width: 100%; left: 0; right: 0; diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index 811e3ab2..f56d5e6c 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -97,7 +97,7 @@ L.U.DrawMarkerAction = L.U.BaseAction.extend({ options: { helpMenu: true, - className: 'storage-draw-marker dark', + className: 'umap-draw-marker dark', tooltip: L._('Draw a marker') }, @@ -111,7 +111,7 @@ L.U.DrawPolylineAction = L.U.BaseAction.extend({ options: { helpMenu: true, - className: 'storage-draw-polyline dark', + className: 'umap-draw-polyline dark', tooltip: L._('Draw a polyline') }, @@ -125,7 +125,7 @@ L.U.DrawPolygonAction = L.U.BaseAction.extend({ options: { helpMenu: true, - className: 'storage-draw-polygon dark', + className: 'umap-draw-polygon dark', tooltip: L._('Draw a polygon') }, @@ -138,7 +138,7 @@ L.U.DrawPolygonAction = L.U.BaseAction.extend({ L.U.AddPolylineShapeAction = L.U.BaseAction.extend({ options: { - className: 'storage-draw-polyline-multi dark', + className: 'umap-draw-polyline-multi dark', tooltip: L._('Add a line to the current multi') }, @@ -151,7 +151,7 @@ L.U.AddPolylineShapeAction = L.U.BaseAction.extend({ L.U.AddPolygonShapeAction = L.U.AddPolylineShapeAction.extend({ options: { - className: 'storage-draw-polygon-multi dark', + className: 'umap-draw-polygon-multi dark', tooltip: L._('Add a polygon to the current multi') } @@ -184,7 +184,7 @@ L.U.CreateHoleAction = L.U.BaseFeatureAction.extend({ options: { toolbarIcon: { - className: 'storage-new-hole', + className: 'umap-new-hole', tooltip: L._('Start a hole here') } }, @@ -199,7 +199,7 @@ L.U.ToggleEditAction = L.U.BaseFeatureAction.extend({ options: { toolbarIcon: { - className: 'storage-toggle-edit', + className: 'umap-toggle-edit', tooltip: L._('Toggle edit mode (shift-click)') } }, @@ -215,13 +215,13 @@ L.U.DeleteFeatureAction = L.U.BaseFeatureAction.extend({ options: { toolbarIcon: { - className: 'storage-delete-all', + className: 'umap-delete-all', tooltip: L._('Delete this feature') } }, postInit: function () { - if (!this.feature.isMulti()) this.options.toolbarIcon.className = 'storage-delete-one-of-one'; + if (!this.feature.isMulti()) this.options.toolbarIcon.className = 'umap-delete-one-of-one'; }, onClick: function (e) { @@ -234,7 +234,7 @@ L.U.DeleteShapeAction = L.U.BaseFeatureAction.extend({ options: { toolbarIcon: { - className: 'storage-delete-one-of-multi', + className: 'umap-delete-one-of-multi', tooltip: L._('Delete this shape') } }, @@ -249,7 +249,7 @@ L.U.ExtractShapeFromMultiAction = L.U.BaseFeatureAction.extend({ options: { toolbarIcon: { - className: 'storage-extract-shape-from-multi', + className: 'umap-extract-shape-from-multi', tooltip: L._('Extract shape to separate feature') } }, @@ -273,7 +273,7 @@ L.U.DeleteVertexAction = L.U.BaseVertexAction.extend({ options: { toolbarIcon: { - className: 'storage-delete-vertex', + className: 'umap-delete-vertex', tooltip: L._('Delete this vertex (Alt-click)') } }, @@ -288,7 +288,7 @@ L.U.SplitLineAction = L.U.BaseVertexAction.extend({ options: { toolbarIcon: { - className: 'storage-split-line', + className: 'umap-split-line', tooltip: L._('Split line') } }, @@ -303,7 +303,7 @@ L.U.ContinueLineAction = L.U.BaseVertexAction.extend({ options: { toolbarIcon: { - className: 'storage-continue-line', + className: 'umap-continue-line', tooltip: L._('Continue line') } }, @@ -360,7 +360,7 @@ L.U.EditControl = L.Control.extend({ }, onAdd: function (map) { - var container = L.DomUtil.create('div', 'leaflet-control-edit-enable storage-control'), + var container = L.DomUtil.create('div', 'leaflet-control-edit-enable umap-control'), edit = L.DomUtil.create('a', '', container); edit.href = '#'; edit.title = L._('Enable editing') + ' (Ctrl-E)'; @@ -381,7 +381,7 @@ L.Control.Embed = L.Control.extend({ }, onAdd: function (map) { - var container = L.DomUtil.create('div', 'leaflet-control-embed storage-control'); + var container = L.DomUtil.create('div', 'leaflet-control-embed umap-control'); var link = L.DomUtil.create('a', '', container); link.href = '#'; @@ -404,8 +404,8 @@ L.U.MoreControls = L.Control.extend({ onAdd: function () { var container = L.DomUtil.create('div', ''), - more = L.DomUtil.create('a', 'storage-control-more storage-control-text', container), - less = L.DomUtil.create('a', 'storage-control-less storage-control-text', container); + more = L.DomUtil.create('a', 'umap-control-more umap-control-text', container), + less = L.DomUtil.create('a', 'umap-control-less umap-control-text', container); more.href = '#'; more.title = L._('More controls'); @@ -426,7 +426,7 @@ L.U.MoreControls = L.Control.extend({ toggle: function () { var pos = this.getPosition(), corner = this._map._controlCorners[pos], - className = 'storage-more-controls'; + className = 'umap-more-controls'; if (L.DomUtil.hasClass(corner, className)) L.DomUtil.removeClass(corner, className); else L.DomUtil.addClass(corner, className); } @@ -452,15 +452,15 @@ L.U.DataLayersControl = L.Control.extend({ }, _initLayout: function (map) { - var container = this._container = L.DomUtil.create('div', 'leaflet-control-browse storage-control'), - actions = L.DomUtil.create('div', 'storage-browse-actions', container); - this._datalayers_container = L.DomUtil.create('ul', 'storage-browse-datalayers', actions); + var container = this._container = L.DomUtil.create('div', 'leaflet-control-browse umap-control'), + actions = L.DomUtil.create('div', 'umap-browse-actions', container); + this._datalayers_container = L.DomUtil.create('ul', 'umap-browse-datalayers', actions); - var link = L.DomUtil.create('a', 'storage-browse-link', actions); + var link = L.DomUtil.create('a', 'umap-browse-link', actions); link.href = '#'; link.title = link.innerHTML = L._('Browse data'); - var toggle = L.DomUtil.create('a', 'storage-browse-toggle', container); + var toggle = L.DomUtil.create('a', 'umap-browse-toggle', container); toggle.href = '#'; L.DomEvent @@ -539,7 +539,7 @@ L.U.DataLayersControl = L.Control.extend({ openPanel: function () { if (!this.map.editEnabled) return; - var container = L.DomUtil.create('ul', 'storage-browse-datalayers'); + var container = L.DomUtil.create('ul', 'umap-browse-datalayers'); this.map.eachDataLayerReverse(function (datalayer) { this.addDataLayer(container, datalayer, true); }, this); @@ -642,11 +642,11 @@ L.U.DataLayer.addInitHook(function () { L.U.Map.include({ _openBrowser: function () { - var browserContainer = L.DomUtil.create('div', 'storage-browse-data'), - title = L.DomUtil.add('h3', 'storage-browse-title', browserContainer, this.options.name), + var browserContainer = L.DomUtil.create('div', 'umap-browse-data'), + title = L.DomUtil.add('h3', 'umap-browse-title', browserContainer, this.options.name), filter = L.DomUtil.create('input', '', browserContainer), filterValue = '', - featuresContainer = L.DomUtil.create('div', 'storage-browse-features', browserContainer), + featuresContainer = L.DomUtil.create('div', 'umap-browse-features', browserContainer), filterKeys = (this.options.filterKey || this.options.sortKey || 'name').split(','); filter.type = 'text'; filter.placeholder = L._('Filter…'); @@ -682,7 +682,7 @@ L.U.Map.include({ var append = function (datalayer) { var container = L.DomUtil.create('div', datalayer.getHidableClass(), featuresContainer), headline = L.DomUtil.create('h5', '', container); - container.id = 'browse_data_datalayer_' + datalayer.storage_id; + container.id = 'browse_data_datalayer_' + datalayer.umap_id; datalayer.renderToolbox(headline); L.DomUtil.add('span', '', headline, datalayer.options.name); var ul = L.DomUtil.create('ul', '', container); @@ -717,7 +717,7 @@ L.U.Map.include({ L.bind(appendAll, this)(); L.DomEvent.on(filter, 'input', appendAll, this); var link = L.DomUtil.create('li', ''); - L.DomUtil.create('i', 'storage-icon-16 storage-caption', link); + L.DomUtil.create('i', 'umap-icon-16 umap-caption', link); var label = L.DomUtil.create('span', '', link); label.innerHTML = label.title = L._('About'); L.DomEvent.on(link, 'click', this.displayCaption, this); @@ -734,7 +734,7 @@ L.U.TileLayerControl = L.Control.extend({ }, onAdd: function () { - var container = L.DomUtil.create('div', 'leaflet-control-tilelayers storage-control'); + var container = L.DomUtil.create('div', 'leaflet-control-tilelayers umap-control'); var link = L.DomUtil.create('a', '', container); link.href = '#'; @@ -749,7 +749,7 @@ L.U.TileLayerControl = L.Control.extend({ }, openSwitcher: function (options) { - this._tilelayers_container = L.DomUtil.create('ul', 'storage-tilelayer-switcher-container'); + this._tilelayers_container = L.DomUtil.create('ul', 'umap-tilelayer-switcher-container'); this.buildList(options); }, @@ -810,7 +810,7 @@ L.U.LocateControl = L.Control.extend({ }, onAdd: function (map) { - var container = L.DomUtil.create('div', 'leaflet-control-locate storage-control'), + var container = L.DomUtil.create('div', 'leaflet-control-locate umap-control'), link = L.DomUtil.create('a', '', container); link.href = '#'; link.title = L._('Center map on your location'); @@ -880,7 +880,7 @@ L.U.SearchControl = L.Control.extend({ }, onAdd: function (map) { - var container = L.DomUtil.create('div', 'leaflet-control-search storage-control'), + var container = L.DomUtil.create('div', 'leaflet-control-search umap-control'), self = this; L.DomEvent.disableClickPropagation(container); @@ -949,18 +949,18 @@ L.Control.MiniMap.include({ L.Control.Loading.include({ onAdd: function (map) { - this._container = L.DomUtil.create('div', 'storage-loader', map._controlContainer); + this._container = L.DomUtil.create('div', 'umap-loader', map._controlContainer); map.on('baselayerchange', this._layerAdd, this); this._addMapListeners(map); this._map = map; }, _showIndicator: function () { - L.DomUtil.addClass(this._map._container, 'storage-loading'); + L.DomUtil.addClass(this._map._container, 'umap-loading'); }, _hideIndicator: function() { - L.DomUtil.removeClass(this._map._container, 'storage-loading'); + L.DomUtil.removeClass(this._map._container, 'umap-loading'); } }); @@ -1029,8 +1029,8 @@ L.U.IframeExporter = L.Class.extend({ var datalayers = []; if (this.options.keepCurrentDatalayers) { this.map.eachDataLayer(function (datalayer) { - if (datalayer.isVisible() && datalayer.storage_id) { - datalayers.push(datalayer.storage_id); + if (datalayer.isVisible() && datalayer.umap_id) { + datalayers.push(datalayer.umap_id); } }); this.queryString.datalayers = datalayers.join(','); diff --git a/umap/static/umap/js/umap.core.js b/umap/static/umap/js/umap.core.js index 6347c92d..b05aab43 100644 --- a/umap/static/umap/js/umap.core.js +++ b/umap/static/umap/js/umap.core.js @@ -295,13 +295,13 @@ L.U.Help = L.Class.extend({ initialize: function (map) { this.map = map; - this.box = L.DomUtil.create('div', 'storage-help-box with-transition dark', document.body); - var closeLink = L.DomUtil.create('a', 'storage-close-link', this.box); + this.box = L.DomUtil.create('div', 'umap-help-box with-transition dark', document.body); + var closeLink = L.DomUtil.create('a', 'umap-close-link', this.box); closeLink.href = '#'; - L.DomUtil.add('i', 'storage-close-icon', closeLink); + L.DomUtil.add('i', 'umap-close-icon', closeLink); var label = L.DomUtil.create('span', '', closeLink); label.title = label.innerHTML = L._('Close'); - this.content = L.DomUtil.create('div', 'storage-help-content', this.box); + this.content = L.DomUtil.create('div', 'umap-help-content', this.box); L.DomEvent.on(closeLink, 'click', this.hide, this); }, @@ -317,17 +317,17 @@ L.U.Help = L.Class.extend({ this.content.innerHTML = ''; for (var i = 0, name; i < arguments.length; i++) { name = arguments[i]; - L.DomUtil.add('div', 'storage-help-entry', this.content, this.resolve(name)); + L.DomUtil.add('div', 'umap-help-entry', this.content, this.resolve(name)); } - L.DomUtil.addClass(document.body, 'storage-help-on'); + L.DomUtil.addClass(document.body, 'umap-help-on'); }, hide: function () { - L.DomUtil.removeClass(document.body, 'storage-help-on'); + L.DomUtil.removeClass(document.body, 'umap-help-on'); }, visible: function () { - return L.DomUtil.hasClass(document.body, 'storage-help-on') + return L.DomUtil.hasClass(document.body, 'umap-help-on') }, resolve: function (name) { @@ -335,7 +335,7 @@ L.U.Help = L.Class.extend({ }, button: function (container, entries) { - var helpButton = L.DomUtil.create('a', 'storage-help-button', container); + var helpButton = L.DomUtil.create('a', 'umap-help-button', container); helpButton.href = '#'; if (entries) { L.DomEvent @@ -352,7 +352,7 @@ L.U.Help = L.Class.extend({ var container = L.DomUtil.create('div', ''), self = this, title = L.DomUtil.create('h3', '', container), - actionsContainer = L.DomUtil.create('ul', 'storage-edit-actions', container); + actionsContainer = L.DomUtil.create('ul', 'umap-edit-actions', container); var addAction = function (action) { var actionContainer = L.DomUtil.add('li', '', actionsContainer); L.DomUtil.add('i', action.options.className, actionContainer), diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index a92f5316..7ed6311b 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -9,7 +9,7 @@ L.U.FeatureMixin = { } // DataLayer the marker belongs to this.datalayer = options.datalayer || null; - this.properties = {_storage_options: {}}; + this.properties = {_umap_options: {}}; if (options.geojson) { this.populate(options.geojson); } @@ -47,8 +47,8 @@ L.U.FeatureMixin = { view: function(e) { if (this.map.editEnabled) return; - var outlink = this.properties._storage_options.outlink, - target = this.properties._storage_options.outlinkTarget + var outlink = this.properties._umap_options.outlink, + target = this.properties._umap_options.outlinkTarget if (outlink) { switch (target) { case 'self': @@ -58,7 +58,7 @@ L.U.FeatureMixin = { window.top.location = outlink; break; default: - var win = window.open(this.properties._storage_options.outlink); + var win = window.open(this.properties._umap_options.outlink); } return; } @@ -92,7 +92,7 @@ L.U.FeatureMixin = { properties.unshift('properties.name'); builder = new L.U.FormBuilder(this, properties, { - id: 'storage-feature-properties', + id: 'umap-feature-properties', callback: this.resetTooltip } ); @@ -106,7 +106,7 @@ L.U.FeatureMixin = { }, getAdvancedEditActions: function (container) { - var deleteLink = L.DomUtil.create('a', 'button storage-delete', container); + var deleteLink = L.DomUtil.create('a', 'button umap-delete', container); deleteLink.href = '#'; deleteLink.innerHTML = L._('Delete'); L.DomEvent.on(deleteLink, 'click', function (e) { @@ -118,7 +118,7 @@ L.U.FeatureMixin = { appendEditFieldsets: function (container) { var optionsFields = this.getShapeOptions(); var builder = new L.U.FormBuilder(this, optionsFields, { - id: 'storage-feature-shape-properties', + id: 'umap-feature-shape-properties', callback: this._redraw }); var shapeProperties = L.DomUtil.createFieldset(container, L._('Shape properties')); @@ -126,7 +126,7 @@ L.U.FeatureMixin = { var advancedOptions = this.getAdvancedOptions(); var builder = new L.U.FormBuilder(this, advancedOptions, { - id: 'storage-feature-advanced-properties', + id: 'umap-feature-advanced-properties', callback: this._redraw }); var advancedProperties = L.DomUtil.createFieldset(container, L._('Advanced properties')); @@ -143,11 +143,11 @@ L.U.FeatureMixin = { getInteractionOptions: function () { return [ - 'properties._storage_options.popupTemplate', - 'properties._storage_options.showLabel', - 'properties._storage_options.labelDirection', - 'properties._storage_options.labelHover', - 'properties._storage_options.labelInteractive' + 'properties._umap_options.popupTemplate', + 'properties._umap_options.showLabel', + 'properties._umap_options.labelDirection', + 'properties._umap_options.labelHover', + 'properties._umap_options.labelInteractive' ]; }, @@ -204,11 +204,11 @@ L.U.FeatureMixin = { populate: function (feature) { this.properties = L.extend({}, feature.properties); - this.properties._storage_options = L.extend({}, this.properties._storage_options); + this.properties._umap_options = L.extend({}, this.properties._storage_options, this.properties._umap_options); // Retrocompat - if (this.properties._storage_options.clickable === false) { - this.properties._storage_options.interactive = false; - delete this.properties._storage_options.clickable; + if (this.properties._umap_options.clickable === false) { + this.properties._umap_options.interactive = false; + delete this.properties._umap_options.clickable; } }, @@ -227,8 +227,8 @@ L.U.FeatureMixin = { if (typeof this.staticOptions[option] !== 'undefined') { value = this.staticOptions[option]; } - else if (L.Util.usableOption(this.properties._storage_options, option)) { - value = this.properties._storage_options[option]; + else if (L.Util.usableOption(this.properties._umap_options, option)) { + value = this.properties._umap_options[option]; } else if (this.datalayer) { value = this.datalayer.getOption(option); @@ -271,9 +271,9 @@ L.U.FeatureMixin = { cloneProperties: function () { var properties = L.extend({}, this.properties); - properties._storage_options = L.extend({}, properties._storage_options); - if (Object.keys && Object.keys(properties._storage_options).length === 0) { - delete properties._storage_options; // It can make a difference on big data sets + properties._umap_options = L.extend({}, properties._umap_options); + if (Object.keys && Object.keys(properties._umap_options).length === 0) { + delete properties._umap_options; // It can make a difference on big data sets } return properties; }, @@ -361,7 +361,7 @@ L.U.FeatureMixin = { text: L._('Edit this feature'), callback: this.edit, context: this, - iconCls: 'storage-edit' + iconCls: 'umap-edit' } ); } @@ -370,13 +370,13 @@ L.U.FeatureMixin = { text: L._('Edit feature\'s layer'), callback: this.datalayer.edit, context: this.datalayer, - iconCls: 'storage-edit' + iconCls: 'umap-edit' }, { text: L._('Delete this feature'), callback: this.confirmDelete, context: this, - iconCls: 'storage-delete' + iconCls: 'umap-delete' } ); return items; @@ -515,15 +515,15 @@ L.U.Marker = L.Marker.extend({ getShapeOptions: function () { return [ - 'properties._storage_options.color', - 'properties._storage_options.iconClass', - 'properties._storage_options.iconUrl' + 'properties._umap_options.color', + 'properties._umap_options.iconClass', + 'properties._umap_options.iconUrl' ]; }, getAdvancedOptions: function () { return [ - 'properties._storage_options.zoomTo' + 'properties._umap_options.zoomTo' ]; }, @@ -609,17 +609,17 @@ L.U.PathMixin = { getShapeOptions: function () { return [ - 'properties._storage_options.color', - 'properties._storage_options.opacity', - 'properties._storage_options.weight' + 'properties._umap_options.color', + 'properties._umap_options.opacity', + 'properties._umap_options.weight' ]; }, getAdvancedOptions: function () { return [ - 'properties._storage_options.smoothFactor', - 'properties._storage_options.dashArray', - 'properties._storage_options.zoomTo' + 'properties._umap_options.smoothFactor', + 'properties._umap_options.dashArray', + 'properties._umap_options.zoomTo' ]; }, @@ -869,7 +869,7 @@ L.U.Polyline = L.Polyline.extend({ getAdvancedEditActions: function (container) { L.U.FeatureMixin.getAdvancedEditActions.call(this, container); - var toPolygon = L.DomUtil.create('a', 'button storage-to-polygon', container); + var toPolygon = L.DomUtil.create('a', 'button umap-to-polygon', container); toPolygon.href = '#'; toPolygon.innerHTML = L._('Transform to polygon'); L.DomEvent.on(toPolygon, 'click', this.toPolygon, this); @@ -948,19 +948,19 @@ L.U.Polygon = L.Polygon.extend({ getShapeOptions: function () { var options = L.U.PathMixin.getShapeOptions(); - options.push('properties._storage_options.stroke', - 'properties._storage_options.fill', - 'properties._storage_options.fillColor', - 'properties._storage_options.fillOpacity' + options.push('properties._umap_options.stroke', + 'properties._umap_options.fill', + 'properties._umap_options.fillColor', + 'properties._umap_options.fillOpacity' ); return options; }, getInteractionOptions: function () { var options = [ - ['properties._storage_options.interactive', {handler: 'Switch', label: L._('Allow interactions'), helpEntries: 'interactive', inheritable: true}], - ['properties._storage_options.outlink', {label: L._('Link to…'), helpEntries: 'outlink', placeholder: 'http://...', inheritable: true}], - ['properties._storage_options.outlinkTarget', {handler: 'OutlinkTarget', label: L._('Open link in…'), inheritable: true}] + ['properties._umap_options.interactive', {handler: 'Switch', label: L._('Allow interactions'), helpEntries: 'interactive', inheritable: true}], + ['properties._umap_options.outlink', {label: L._('Link to…'), helpEntries: 'outlink', placeholder: 'http://...', inheritable: true}], + ['properties._umap_options.outlinkTarget', {handler: 'OutlinkTarget', label: L._('Open link in…'), inheritable: true}] ]; return options.concat(L.U.FeatureMixin.getInteractionOptions()); }, @@ -1004,7 +1004,7 @@ L.U.Polygon = L.Polygon.extend({ getAdvancedEditActions: function (container) { L.U.FeatureMixin.getAdvancedEditActions.call(this, container); - var toPolyline = L.DomUtil.create('a', 'button storage-to-polyline', container); + var toPolyline = L.DomUtil.create('a', 'button umap-to-polyline', container); toPolyline.href = '#'; toPolyline.innerHTML = L._('Transform to lines'); L.DomEvent.on(toPolyline, 'click', this.toPolyline, this); diff --git a/umap/static/umap/js/umap.forms.js b/umap/static/umap/js/umap.forms.js index 484f336a..428c980a 100644 --- a/umap/static/umap/js/umap.forms.js +++ b/umap/static/umap/js/umap.forms.js @@ -126,7 +126,7 @@ L.FormBuilder.ColorPicker = L.FormBuilder.Input.extend({ build: function () { L.FormBuilder.Input.prototype.build.call(this); this.input.placeholder = this.options.placeholder || L._('Inherit'); - this.container = L.DomUtil.create('div', 'storage-color-picker', this.extendedContainer); + this.container = L.DomUtil.create('div', 'umap-color-picker', this.extendedContainer); this.container.style.display = 'none'; for (var idx in this.colors) { this.addColor(this.colors[idx]); @@ -356,9 +356,9 @@ L.FormBuilder.IconUrl = L.FormBuilder.Input.extend({ build: function () { L.FormBuilder.Input.prototype.build.call(this); - this.parentContainer = L.DomUtil.create('div', 'storage-form-iconfield', this.parentNode); + this.parentContainer = L.DomUtil.create('div', 'umap-form-iconfield', this.parentNode); this.buttonsContainer = L.DomUtil.create('div', '', this.parentContainer); - this.pictogramsContainer = L.DomUtil.create('div', 'storage-pictogram-list', this.parentContainer); + this.pictogramsContainer = L.DomUtil.create('div', 'umap-pictogram-list', this.parentContainer); this.input.type = 'hidden'; this.input.placeholder = L._('Url'); this.udpatePreview(); @@ -367,7 +367,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.Input.extend({ udpatePreview: function () { if (this.value() && this.value().indexOf('{') === -1) { // Do not try to render URL with variables - var img = L.DomUtil.create('img', '', L.DomUtil.create('div', 'storage-icon-choice', this.buttonsContainer)); + var img = L.DomUtil.create('img', '', L.DomUtil.create('div', 'umap-icon-choice', this.buttonsContainer)); img.src = this.value(); L.DomEvent.on(img, 'click', this.fetchIconList, this); } @@ -380,7 +380,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.Input.extend({ }, addIconPreview: function (pictogram) { - var baseClass = 'storage-icon-choice', + var baseClass = 'umap-icon-choice', value = pictogram.src, className = value === this.value() ? baseClass + ' selected' : baseClass, container = L.DomUtil.create('div', className, this.pictogramsContainer), @@ -486,7 +486,7 @@ L.FormBuilder.Switch = L.FormBuilder.CheckBox.extend({ L.FormBuilder.MultiChoice = L.FormBuilder.Element.extend({ default: 'null', - className: 'storage-multiplechoice', + className: 'umap-multiplechoice', clear: function () { var checked = this.container.querySelector('input[type="radio"]:checked'); @@ -604,7 +604,7 @@ L.FormBuilder.Range = L.FormBuilder.Input.extend({ L.U.FormBuilder = L.FormBuilder.extend({ options: { - className: 'storage-form' + className: 'umap-form' }, defaultOptions: { diff --git a/umap/static/umap/js/umap.icon.js b/umap/static/umap/js/umap.icon.js index 4086bd17..87cbb1c9 100644 --- a/umap/static/umap/js/umap.icon.js +++ b/umap/static/umap/js/umap.icon.js @@ -40,7 +40,7 @@ L.U.Icon.Default = L.U.Icon.extend({ iconAnchor: new L.Point(16, 40), popupAnchor: new L.Point(0, -40), tooltipAnchor: new L.Point(16, -24), - className: 'storage-div-icon' + className: 'umap-div-icon' }, initialize: function(map, options) { @@ -75,7 +75,7 @@ L.U.Icon.Circle = L.U.Icon.extend({ iconAnchor: new L.Point(6, 6), popupAnchor: new L.Point(0, -6), tooltipAnchor: new L.Point(6, 0), - className: 'storage-circle-icon' + className: 'umap-circle-icon' }; options = L.Util.extend({}, default_options, options); L.U.Icon.prototype.initialize.call(this, map, options); @@ -101,7 +101,7 @@ L.U.Icon.Drop = L.U.Icon.Default.extend({ iconAnchor: new L.Point(16, 42), popupAnchor: new L.Point(0, -42), tooltipAnchor: new L.Point(16, -24), - className: 'storage-drop-icon' + className: 'umap-drop-icon' } }); @@ -110,7 +110,7 @@ L.U.Icon.Ball = L.U.Icon.Default.extend({ iconAnchor: new L.Point(8, 30), popupAnchor: new L.Point(0, -28), tooltipAnchor: new L.Point(8, -23), - className: 'storage-ball-icon' + className: 'umap-ball-icon' }, createIcon: function() { diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index aafd2271..4e9ce433 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -179,7 +179,7 @@ L.U.Map.include({ }, this); // Creation mode - if (!this.options.storage_id) { + if (!this.options.umap_id) { this.isDirty = true; this.options.name = L._('Untitled map'); this.options.allowEdit = true; @@ -260,8 +260,8 @@ L.U.Map.include({ }, renderControls: function () { - L.DomUtil.classIf(document.body, 'storage-caption-bar-enabled', this.options.captionBar || (this.options.slideshow && this.options.slideshow.active)); - L.DomUtil.classIf(document.body, 'storage-slideshow-enabled', this.options.slideshow && this.options.slideshow.active); + L.DomUtil.classIf(document.body, 'umap-caption-bar-enabled', this.options.captionBar || (this.options.slideshow && this.options.slideshow.active)); + L.DomUtil.classIf(document.body, 'umap-slideshow-enabled', this.options.slideshow && this.options.slideshow.active); for (var i in this._controls) { this.removeControl(this._controls[i]); } @@ -566,9 +566,9 @@ L.U.Map.include({ }, renderShareBox: function () { - var container = L.DomUtil.create('div', 'storage-share'), + var container = L.DomUtil.create('div', 'umap-share'), embedTitle = L.DomUtil.add('h4', '', container, L._('Embed the map')), - iframe = L.DomUtil.create('textarea', 'storage-share-iframe', container), + iframe = L.DomUtil.create('textarea', 'umap-share-iframe', container), option; var UIFields = [ ['dimensions.width', {handler: 'Input', label: L._('width')}], @@ -599,7 +599,7 @@ L.U.Map.include({ if (this.options.shortUrl) { L.DomUtil.create('hr', '', container); L.DomUtil.add('h4', '', container, L._('Short URL')); - var shortUrl = L.DomUtil.create('input', 'storage-short-url', container); + var shortUrl = L.DomUtil.create('input', 'umap-short-url', container); shortUrl.type = 'text'; shortUrl.value = this.options.shortUrl; } @@ -677,8 +677,8 @@ L.U.Map.include({ }, updatePermissions: function () { - if (!this.options.storage_id) return this.ui.alert({content: L._('Please save the map before'), level: 'info'}); - var url = L.Util.template(this.options.urls.map_update_permissions, {'map_id': this.options.storage_id}); + if (!this.options.umap_id) return this.ui.alert({content: L._('Please save the map before'), level: 'info'}); + var url = L.Util.template(this.options.urls.map_update_permissions, {'map_id': this.options.umap_id}); this.get(url, { listen_form: {'id': 'map_edit'}, className: 'dark' @@ -686,7 +686,7 @@ L.U.Map.include({ }, importPanel: function () { - var container = L.DomUtil.create('div', 'storage-upload'), + var container = L.DomUtil.create('div', 'umap-upload'), title = L.DomUtil.create('h4', '', container), presetBox = L.DomUtil.create('div', 'formbox', container), presetSelect = L.DomUtil.create('select', '', presetBox), @@ -859,18 +859,18 @@ L.U.Map.include({ }, displayCaption: function () { - var container = L.DomUtil.create('div', 'storage-caption'), + var container = L.DomUtil.create('div', 'umap-caption'), title = L.DomUtil.create('h3', '', container); title.innerHTML = this.options.name; if (this.options.author && this.options.author.name && this.options.author.link) { - var authorContainer = L.DomUtil.add('h5', 'storage-map-author', container, L._('by') + ' '), + var authorContainer = L.DomUtil.add('h5', 'umap-map-author', container, L._('by') + ' '), author = L.DomUtil.create('a'); author.href = this.options.author.link; author.innerHTML = this.options.author.name; authorContainer.appendChild(author); } if (this.options.description) { - var description = L.DomUtil.create('div', 'storage-map-description', container); + var description = L.DomUtil.create('div', 'umap-map-description', container); description.innerHTML = L.Util.toHTML(this.options.description); } var datalayerContainer = L.DomUtil.create('div', 'datalayer-container', container); @@ -918,7 +918,7 @@ L.U.Map.include({ }; umapCredit.innerHTML = L._('Powered by Leaflet and Django, glued by uMap project.', urls); var browser = L.DomUtil.create('li', ''); - L.DomUtil.create('i', 'storage-icon-16 storage-list', browser); + L.DomUtil.create('i', 'umap-icon-16 umap-list', browser); var label = L.DomUtil.create('span', '', browser); label.innerHTML = label.title = L._('Browse data'); L.DomEvent.on(browser, 'click', this.openBrowser, this); @@ -969,7 +969,7 @@ L.U.Map.include({ }, checkDirty: function () { - L.DomUtil.classIf(this._container, 'storage-is-dirty', this.isDirty); + L.DomUtil.classIf(this._container, 'umap-is-dirty', this.isDirty); }, addDirtyDatalayer: function (datalayer) { @@ -1081,9 +1081,9 @@ L.U.Map.include({ data: formData, callback: function (data) { var duration = 3000; - if (!this.options.storage_id) { + if (!this.options.umap_id) { duration = 100000; // we want a longer message at map creation (TODO UGLY) - this.options.storage_id = data.id; + this.options.umap_id = data.id; if (history && history.pushState) history.pushState({}, this.options.name, data.url); else window.location = data.url; } @@ -1101,7 +1101,7 @@ L.U.Map.include({ }, getEditUrl: function() { - return L.Util.template(this.options.urls.map_update, {'map_id': this.options.storage_id}); + return L.Util.template(this.options.urls.map_update, {'map_id': this.options.umap_id}); }, getCreateUrl: function() { @@ -1109,7 +1109,7 @@ L.U.Map.include({ }, getSaveUrl: function () { - return (this.options.storage_id && this.getEditUrl()) || this.getCreateUrl(); + return (this.options.umap_id && this.getEditUrl()) || this.getCreateUrl(); }, geometry: function() { @@ -1145,8 +1145,8 @@ L.U.Map.include({ return this.createDataLayer(); }, - getDataLayerByStorageId: function (storage_id) { - return this.findDataLayer(function (d) { return d.storage_id == storage_id; }); + getDataLayerByUmapId: function (umap_id) { + return this.findDataLayer(function (d) { return d.umap_id == umap_id; }); }, edit: function () { @@ -1331,20 +1331,20 @@ L.U.Map.include({ var advancedActions = L.DomUtil.createFieldset(container, L._('Advanced actions')); var advancedButtons = L.DomUtil.create('div', 'button-bar', advancedActions); - var del = L.DomUtil.create('a', 'button third storage-delete', advancedButtons); + var del = L.DomUtil.create('a', 'button third umap-delete', advancedButtons); del.href = '#'; del.innerHTML = L._('Delete'); L.DomEvent .on(del, 'click', L.DomEvent.stop) .on(del, 'click', this.del, this); - var clone = L.DomUtil.create('a', 'button third storage-clone', advancedButtons); + var clone = L.DomUtil.create('a', 'button third umap-clone', advancedButtons); clone.href = '#'; clone.innerHTML = L._('Clone'); clone.title = L._('Clone this map'); L.DomEvent .on(clone, 'click', L.DomEvent.stop) .on(clone, 'click', this.clone, this); - var empty = L.DomUtil.create('a', 'button third storage-empty', advancedButtons); + var empty = L.DomUtil.create('a', 'button third umap-empty', advancedButtons); empty.href = '#'; empty.innerHTML = L._('Empty'); empty.title = L._('Delete all layers'); @@ -1355,14 +1355,14 @@ L.U.Map.include({ }, enableEdit: function() { - L.DomUtil.addClass(document.body, 'storage-edit-enabled'); + L.DomUtil.addClass(document.body, 'umap-edit-enabled'); this.editEnabled = true; this.fire('edit:enabled'); }, disableEdit: function() { if (this.isDirty) return; - L.DomUtil.removeClass(document.body, 'storage-edit-enabled'); + L.DomUtil.removeClass(document.body, 'umap-edit-enabled'); this.editedFeature = null; this.editEnabled = false; this.fire('edit:disabled'); @@ -1373,20 +1373,20 @@ L.U.Map.include({ }, initCaptionBar: function () { - var container = L.DomUtil.create('div', 'storage-caption-bar', this._controlContainer), + var container = L.DomUtil.create('div', 'umap-caption-bar', this._controlContainer), name = L.DomUtil.create('h3', '', container); L.DomEvent.disableClickPropagation(container); if (this.options.author && this.options.author.name && this.options.author.link) { - var authorContainer = L.DomUtil.add('span', 'storage-map-author', container, ' ' + L._('by') + ' '), + var authorContainer = L.DomUtil.add('span', 'umap-map-author', container, ' ' + L._('by') + ' '), author = L.DomUtil.create('a'); author.href = this.options.author.link; author.innerHTML = this.options.author.name; authorContainer.appendChild(author); } - var about = L.DomUtil.add('a', 'storage-about-link', container, ' — ' + L._('About')); + var about = L.DomUtil.add('a', 'umap-about-link', container, ' — ' + L._('About')); about.href = '#'; L.DomEvent.on(about, 'click', this.displayCaption, this); - var browser = L.DomUtil.add('a', 'storage-open-browser-link', container, ' | ' + L._('Browse data')); + var browser = L.DomUtil.add('a', 'umap-open-browser-link', container, ' | ' + L._('Browse data')); browser.href = '#'; L.DomEvent.on(browser, 'click', L.DomEvent.stop) .on(browser, 'click', this.openBrowser, this); @@ -1401,9 +1401,9 @@ L.U.Map.include({ }, initEditBar: function () { - var container = L.DomUtil.create('div', 'storage-main-edit-toolbox with-transition dark', this._controlContainer), + var container = L.DomUtil.create('div', 'umap-main-edit-toolbox with-transition dark', this._controlContainer), title = L.DomUtil.add('h3', '', container, L._('Editing') + ' '), - name = L.DomUtil.create('a', 'storage-click-to-edit', title), + name = L.DomUtil.create('a', 'umap-click-to-edit', title), setName = function () { name.innerHTML = this.getDisplayName(); }; @@ -1461,14 +1461,14 @@ L.U.Map.include({ del: function () { if (confirm(L._('Are you sure you want to delete this map?'))) { - var url = L.Util.template(this.options.urls.map_delete, {'map_id': this.options.storage_id}); + var url = L.Util.template(this.options.urls.map_delete, {'map_id': this.options.umap_id}); this.post(url); } }, clone: function () { if (confirm(L._('Are you sure you want to clone this map and all its datalayers?'))) { - var url = L.Util.template(this.options.urls.map_clone, {'map_id': this.options.storage_id}); + var url = L.Util.template(this.options.urls.map_clone, {'map_id': this.options.umap_id}); this.post(url); } }, diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index 69f464db..af8a5214 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -194,19 +194,19 @@ L.U.DataLayer = L.Class.extend({ catch (e) { // Certainly IE8, which has a limited version of defineProperty } - this.setStorageId(data.id); + this.setUmapId(data.id); this.setOptions(data); this.backupOptions(); this.connectToMap(); if (this.displayedOnLoad()) this.show(); - if (!this.storage_id) this.isDirty = true; + if (!this.umap_id) this.isDirty = true; this.onceLoaded(function () { this.map.on('moveend', this.fetchRemoteData, this); }); }, displayedOnLoad: function () { - return ((this.map.datalayersOnLoad && this.storage_id && this.map.datalayersOnLoad.indexOf(this.storage_id.toString()) !== -1) || + return ((this.map.datalayersOnLoad && this.umap_id && this.map.datalayersOnLoad.indexOf(this.umap_id.toString()) !== -1) || (!this.map.datalayersOnLoad && this.options.displayOnLoad)); }, @@ -255,7 +255,7 @@ L.U.DataLayer = L.Class.extend({ }, fetchData: function () { - if (!this.storage_id) return; + if (!this.umap_id) return; this.map.get(this._dataUrl(), { callback: function (geojson, response) { this._etag = response.getResponseHeader('ETag'); @@ -275,7 +275,8 @@ L.U.DataLayer = L.Class.extend({ }, fromUmapGeoJSON: function (geojson) { - if (geojson._storage) this.setOptions(geojson._storage); + if (geojson._storage) geojson._umap_options = geojson._storage; // Retrocompat + if (geojson._umap_options) this.setOptions(geojson._umap_options); if (this.isRemoteLayer()) this.fetchRemoteData(); else this.fromGeoJSON(geojson); this._loaded = true; @@ -344,16 +345,16 @@ L.U.DataLayer = L.Class.extend({ }, isLoaded: function () { - return !this.storage_id || this._loaded; + return !this.umap_id || this._loaded; }, hasDataLoaded: function () { - return !this.storage_id || this._geojson !== null; + return !this.umap_id || this._geojson !== null; }, - setStorageId: function (id) { + setUmapId: function (id) { // Datalayer is null when listening creation form - if (!this.storage_id && id) this.storage_id = id; + if (!this.umap_id && id) this.umap_id = id; }, backupOptions: function () { @@ -385,7 +386,7 @@ L.U.DataLayer = L.Class.extend({ _dataUrl: function() { var template = this.map.options.urls.datalayer_view; - return L.Util.template(template, {'pk': this.storage_id, 'map_id': this.map.options.storage_id}); + return L.Util.template(template, {'pk': this.umap_id, 'map_id': this.map.options.umap_id}); }, isRemoteLayer: function () { @@ -437,6 +438,7 @@ L.U.DataLayer = L.Class.extend({ // otherwise the layer becomes uneditable. this.geojsonToFeatures(geojson); } catch (err) { + console.log("Error with DataLayer", this.umap_id); console.error(err); } }, @@ -611,15 +613,15 @@ L.U.DataLayer = L.Class.extend({ }, getEditUrl: function() { - return L.Util.template(this.map.options.urls.datalayer_update, {'map_id': this.map.options.storage_id, 'pk': this.storage_id}); + return L.Util.template(this.map.options.urls.datalayer_update, {'map_id': this.map.options.umap_id, 'pk': this.umap_id}); }, getCreateUrl: function() { - return L.Util.template(this.map.options.urls.datalayer_create, {'map_id': this.map.options.storage_id}); + return L.Util.template(this.map.options.urls.datalayer_create, {'map_id': this.map.options.umap_id}); }, getSaveUrl: function () { - return (this.storage_id && this.getEditUrl()) || this.getCreateUrl(); + return (this.umap_id && this.getEditUrl()) || this.getCreateUrl(); }, getColor: function () { @@ -627,16 +629,16 @@ L.U.DataLayer = L.Class.extend({ }, getDeleteUrl: function () { - return L.Util.template(this.map.options.urls.datalayer_delete, {'pk': this.storage_id, 'map_id': this.map.options.storage_id}); + return L.Util.template(this.map.options.urls.datalayer_delete, {'pk': this.umap_id, 'map_id': this.map.options.umap_id}); }, getVersionsUrl: function () { - return L.Util.template(this.map.options.urls.datalayer_versions, {'pk': this.storage_id, 'map_id': this.map.options.storage_id}); + return L.Util.template(this.map.options.urls.datalayer_versions, {'pk': this.umap_id, 'map_id': this.map.options.umap_id}); }, getVersionUrl: function (name) { - return L.Util.template(this.map.options.urls.datalayer_version, {'pk': this.storage_id, 'map_id': this.map.options.storage_id, name: name}); + return L.Util.template(this.map.options.urls.datalayer_version, {'pk': this.umap_id, 'map_id': this.map.options.umap_id, name: name}); }, _delete: function () { @@ -674,7 +676,7 @@ L.U.DataLayer = L.Class.extend({ }, reset: function () { - if (!this.storage_id) this.erase(); + if (!this.umap_id) this.erase(); this.resetOptions(); this.parentPane.appendChild(this.pane); @@ -795,7 +797,7 @@ L.U.DataLayer = L.Class.extend({ var advancedActions = L.DomUtil.createFieldset(container, L._('Advanced actions')); var advancedButtons = L.DomUtil.create('div', 'button-bar', advancedActions); - var deleteLink = L.DomUtil.create('a', 'button third delete_datalayer_button storage-delete', advancedButtons); + var deleteLink = L.DomUtil.create('a', 'button third delete_datalayer_button umap-delete', advancedButtons); deleteLink.innerHTML = L._('Delete'); deleteLink.href = '#'; L.DomEvent.on(deleteLink, 'click', L.DomEvent.stop) @@ -804,13 +806,13 @@ L.U.DataLayer = L.Class.extend({ this.map.ui.closePanel(); }, this); if (!this.isRemoteLayer()) { - var emptyLink = L.DomUtil.create('a', 'button third storage-empty', advancedButtons); + var emptyLink = L.DomUtil.create('a', 'button third umap-empty', advancedButtons); emptyLink.innerHTML = L._('Empty'); emptyLink.href = '#'; L.DomEvent.on(emptyLink, 'click', L.DomEvent.stop) .on(emptyLink, 'click', this.empty, this); } - var cloneLink = L.DomUtil.create('a', 'button third storage-clone', advancedButtons); + var cloneLink = L.DomUtil.create('a', 'button third umap-clone', advancedButtons); cloneLink.innerHTML = L._('Clone'); cloneLink.href = '#'; L.DomEvent.on(cloneLink, 'click', L.DomEvent.stop) @@ -832,7 +834,7 @@ L.U.DataLayer = L.Class.extend({ var appendVersion = function (data) { var date = new Date(parseInt(data.at, 10)); var content = date.toLocaleFormat() + ' (' + parseInt(data.size) / 1000 + 'Kb)'; - var el = L.DomUtil.create('div', 'storage-datalayer-version', versionsContainer); + var el = L.DomUtil.create('div', 'umap-datalayer-version', versionsContainer); var a = L.DomUtil.create('a', '', el); L.DomUtil.add('span', '', el, content); a.href = '#'; @@ -860,7 +862,8 @@ L.U.DataLayer = L.Class.extend({ if (!confirm(L._('Are you sure you want to restore this version?'))) return; this.map.xhr.get(this.getVersionUrl(version), { callback: function (geojson) { - if (geojson._storage) this.setOptions(geojson._storage); + if (geojson._storage) geojson._umap_options = geojson._storage; // Retrocompat. + if (geojson._umap_options) this.setOptions(geojson._umap_options); this.empty(); if (this.isRemoteLayer()) this.fetchRemoteData(); else this.addData(geojson); @@ -951,13 +954,13 @@ L.U.DataLayer = L.Class.extend({ return { type: 'FeatureCollection', features: this.isRemoteLayer() ? [] : this.featuresToGeoJSON(), - _storage: this.options + _umap_options: this.options }; }, metadata: function () { return { - id: this.storage_id, + id: this.umap_id, name: this.options.name, displayOnLoad: this.options.displayOnLoad } @@ -983,7 +986,7 @@ L.U.DataLayer = L.Class.extend({ callback: function (data, response) { this._geojson = geojson; this._etag = response.getResponseHeader('ETag'); - this.setStorageId(data.id); + this.setUmapId(data.id); this.updateOptions(data); this.backupOptions(); this.connectToMap(); @@ -1002,7 +1005,7 @@ L.U.DataLayer = L.Class.extend({ this.isDirty = false; this.map.continueSaving(); } - if (!this.storage_id) return callback.call(this); + if (!this.umap_id) return callback.call(this); this.map.xhr.post(this.getDeleteUrl(), { callback: callback, context: this diff --git a/umap/static/umap/js/umap.popup.js b/umap/static/umap/js/umap.popup.js index afedd6fa..99491bd7 100644 --- a/umap/static/umap/js/umap.popup.js +++ b/umap/static/umap/js/umap.popup.js @@ -6,7 +6,7 @@ L.U.Popup = L.Popup.extend({ initialize: function (feature) { this.feature = feature; - this.container = L.DomUtil.create('div', 'storage-popup'); + this.container = L.DomUtil.create('div', 'umap-popup'); this.format(); L.Popup.prototype.initialize.call(this, {}, feature); this.setContent(this.container); @@ -52,7 +52,7 @@ L.U.Popup = L.Popup.extend({ renderFooter: function () { if (this.hasFooter()) { - var footer = L.DomUtil.create('ul', 'storage-popup-footer', this.container), + var footer = L.DomUtil.create('ul', 'umap-popup-footer', this.container), previousLi = L.DomUtil.create('li', 'previous', footer), zoomLi = L.DomUtil.create('li', 'zoom', footer), nextLi = L.DomUtil.create('li', 'next', footer), @@ -81,7 +81,7 @@ L.U.Popup = L.Popup.extend({ var title = this.renderTitle(); if (title) this.container.appendChild(title); var body = this.renderBody(); - if (body) L.DomUtil.add('div', 'storage-popup-content', this.container, body); + if (body) L.DomUtil.add('div', 'umap-popup-content', this.container, body); this.renderFooter(); }, @@ -98,7 +98,7 @@ L.U.Popup = L.Popup.extend({ L.U.Popup.Large = L.U.Popup.extend({ options: { maxWidth: 500, - className: 'storage-popup-large' + className: 'umap-popup-large' } }); @@ -150,7 +150,7 @@ L.U.Popup.GeoRSSImage = L.U.Popup.BaseWithTitle.extend({ options: { minWidth: 300, maxWidth: 500, - className: 'storage-popup-large storage-georss-image' + className: 'umap-popup-large umap-georss-image' }, renderBody: function () { @@ -174,7 +174,7 @@ L.U.Popup.GeoRSSImage = L.U.Popup.BaseWithTitle.extend({ L.U.Popup.GeoRSSLink = L.U.Popup.extend({ options: { - className: 'storage-georss-link' + className: 'umap-georss-link' }, renderBody: function () { @@ -195,7 +195,7 @@ L.U.Popup.SimplePanel = L.U.Popup.extend({ allButton: function () { var button = L.DomUtil.create('li', ''); - L.DomUtil.create('i', 'storage-icon-16 storage-list', button); + L.DomUtil.create('i', 'umap-icon-16 umap-list', button); var label = L.DomUtil.create('span', '', button); label.innerHTML = label.title = L._('See all'); L.DomEvent.on(button, 'click', this.feature.map.openBrowser, this.feature.map); diff --git a/umap/static/umap/js/umap.slideshow.js b/umap/static/umap/js/umap.slideshow.js index 1c7b6c89..610dc4f2 100644 --- a/umap/static/umap/js/umap.slideshow.js +++ b/umap/static/umap/js/umap.slideshow.js @@ -1,7 +1,7 @@ L.U.Slideshow = L.Class.extend({ statics: { - CLASSNAME: 'storage-slideshow-active' + CLASSNAME: 'umap-slideshow-active' }, options: { @@ -68,7 +68,7 @@ L.U.Slideshow = L.Class.extend({ var time = parseInt(this.options.delay, 10); if (!time) return; var css = 'rotation ' + time / 1000 + 's infinite linear', - spinners = document.querySelectorAll('.storage-slideshow-toolbox .play .spinner'); + spinners = document.querySelectorAll('.umap-slideshow-toolbox .play .spinner'); for (var i = 0; i < spinners.length; i++) { spinners[i].style.animation = css; spinners[i].style['-webkit-animation'] = css; @@ -79,7 +79,7 @@ L.U.Slideshow = L.Class.extend({ resetSpinners: function () { // Make that animnation is coordinated with user actions - var spinners = document.querySelectorAll('.storage-slideshow-toolbox .play .spinner'), + var spinners = document.querySelectorAll('.umap-slideshow-toolbox .play .spinner'), el, newOne; for (var i = 0; i < spinners.length; i++) { el = spinners[i]; @@ -134,7 +134,7 @@ L.U.Slideshow = L.Class.extend({ }, renderToolbox: function (container) { - var box = L.DomUtil.create('ul', 'storage-slideshow-toolbox'), + var box = L.DomUtil.create('ul', 'umap-slideshow-toolbox'), play = L.DomUtil.create('li', 'play', box), stop = L.DomUtil.create('li', 'stop', box), prev = L.DomUtil.create('li', 'prev', box), diff --git a/umap/static/umap/js/umap.tableeditor.js b/umap/static/umap/js/umap.tableeditor.js index fd054d9c..192978ed 100644 --- a/umap/static/umap/js/umap.tableeditor.js +++ b/umap/static/umap/js/umap.tableeditor.js @@ -18,8 +18,8 @@ L.U.TableEditor = L.Class.extend({ renderHeader: function (property) { var container = L.DomUtil.create('div', 'tcell', this.header), title = L.DomUtil.add('span', '', container, property), - del = L.DomUtil.create('i', 'storage-delete', container), - rename = L.DomUtil.create('i', 'storage-edit', container); + del = L.DomUtil.create('i', 'umap-delete', container), + rename = L.DomUtil.create('i', 'umap-edit', container); del.title = L._('Delete this property on all the features'); rename.title = L._('Rename this property on all the features'); var doDelete = function () { @@ -50,7 +50,7 @@ L.U.TableEditor = L.Class.extend({ renderRow: function (feature) { var builder = new L.U.FormBuilder(feature, this.field_properties, { - id: 'storage-feature-properties_' + L.stamp(feature), + id: 'umap-feature-properties_' + L.stamp(feature), className: 'trow', callback: feature.resetTooltip } @@ -81,7 +81,7 @@ L.U.TableEditor = L.Class.extend({ this.body.innerHTML = ''; this.datalayer.eachLayer(this.renderRow, this); var addButton = L.DomUtil.create('li', 'add-property'); - L.DomUtil.create('i', 'storage-icon-16 storage-add', addButton); + L.DomUtil.create('i', 'umap-icon-16 umap-add', addButton); var label = L.DomUtil.create('span', '', addButton); label.innerHTML = label.title = L._('Add a new property'); var addProperty = function () { @@ -91,7 +91,7 @@ L.U.TableEditor = L.Class.extend({ this.edit(); }; L.DomEvent.on(addButton, 'click', addProperty, this); - var className = (this.properties.length > 2) ? 'storage-table-editor fullwidth dark' : 'storage-table-editor dark'; + var className = (this.properties.length > 2) ? 'umap-table-editor fullwidth dark' : 'umap-table-editor dark'; this.datalayer.map.ui.openPanel({data: {html: this.table}, className: className, actions: [addButton]}); this.datalayer.map.fire('dataload', {id: id}); } diff --git a/umap/static/umap/js/umap.ui.js b/umap/static/umap/js/umap.ui.js index 567c58e1..a664cb30 100644 --- a/umap/static/umap/js/umap.ui.js +++ b/umap/static/umap/js/umap.ui.js @@ -15,11 +15,11 @@ L.U.UI = L.Evented.extend({ L.DomEvent.on(this.container, 'mousewheel', L.DomEvent.stopPropagation); L.DomEvent.on(this.container, 'MozMousePixelScroll', L.DomEvent.stopPropagation); this._panel = L.DomUtil.create('div', '', this.container); - this._panel.id = 'storage-ui-container'; + this._panel.id = 'umap-ui-container'; this._alert = L.DomUtil.create('div', 'with-transition', this.container); - this._alert.id = 'storage-alert-container'; + this._alert.id = 'umap-alert-container'; this._tooltip = L.DomUtil.create('div', '', this.container); - this._tooltip.id = 'storage-tooltip-container'; + this._tooltip.id = 'umap-tooltip-container'; }, resetPanelClassName: function () { @@ -36,8 +36,8 @@ L.U.UI = L.Evented.extend({ var body = L.DomUtil.create('div', 'body', this._panel); if (e.data.html.nodeType && e.data.html.nodeType === 1) body.appendChild(e.data.html); else body.innerHTML = e.data.html; - var closeLink = L.DomUtil.create('li', 'storage-close-link', actionsContainer); - L.DomUtil.add('i', 'storage-close-icon', closeLink); + var closeLink = L.DomUtil.create('li', 'umap-close-link', actionsContainer); + L.DomUtil.add('i', 'umap-close-icon', closeLink); var label = L.DomUtil.create('span', '', closeLink); label.title = label.innerHTML = L._('Close'); if (e.actions) { @@ -46,26 +46,26 @@ L.U.UI = L.Evented.extend({ } } if (e.className) L.DomUtil.addClass(this._panel, e.className); - if (L.DomUtil.hasClass(this.parent, 'storage-ui')) { + if (L.DomUtil.hasClass(this.parent, 'umap-ui')) { // Already open. this.fire('panel:ready'); } else { L.DomEvent.once(this._panel, 'transitionend', function (e) { this.fire('panel:ready'); }, this); - L.DomUtil.addClass(this.parent, 'storage-ui'); + L.DomUtil.addClass(this.parent, 'umap-ui'); } L.DomEvent.on(closeLink, 'click', this.closePanel, this); }, closePanel: function () { this.resetPanelClassName(); - L.DomUtil.removeClass(this.parent, 'storage-ui'); + L.DomUtil.removeClass(this.parent, 'umap-ui'); this.fire('panel:closed'); }, alert: function (e) { - if (L.DomUtil.hasClass(this.parent, 'storage-alert')) this.ALERTS.push(e); + if (L.DomUtil.hasClass(this.parent, 'umap-alert')) this.ALERTS.push(e); else this.popAlert(e); }, @@ -78,19 +78,19 @@ L.U.UI = L.Evented.extend({ var timeoutID, level_class = e.level && e.level == 'info'? 'info': 'error'; this._alert.innerHTML = ''; - L.DomUtil.addClass(this.parent, 'storage-alert'); + L.DomUtil.addClass(this.parent, 'umap-alert'); L.DomUtil.addClass(this._alert, level_class); var close = function () { if (timeoutID !== this.ALERT_ID) { return;} // Another alert has been forced this._alert.innerHTML = ''; - L.DomUtil.removeClass(this.parent, 'storage-alert'); + L.DomUtil.removeClass(this.parent, 'umap-alert'); L.DomUtil.removeClass(this._alert, level_class); if (timeoutID) window.clearTimeout(timeoutID); this.popAlert(); }; - var closeLink = L.DomUtil.create('a', 'storage-close-link', this._alert); + var closeLink = L.DomUtil.create('a', 'umap-close-link', this._alert); closeLink.href = '#'; - L.DomUtil.add('i', 'storage-close-icon', closeLink); + L.DomUtil.add('i', 'umap-close-icon', closeLink); var label = L.DomUtil.create('span', '', closeLink); label.title = label.innerHTML = L._('Close'); L.DomEvent.on(closeLink, 'click', L.DomEvent.stop) @@ -100,7 +100,7 @@ L.U.UI = L.Evented.extend({ var action, el; for (var i = 0; i < e.actions.length; i++) { action = e.actions[i]; - el = L.DomUtil.element('a', {'className': 'storage-action'}, this._alert); + el = L.DomUtil.element('a', {'className': 'umap-action'}, this._alert); el.href = '#'; el.innerHTML = action.label; L.DomEvent.on(el, 'click', L.DomEvent.stop) @@ -114,7 +114,7 @@ L.U.UI = L.Evented.extend({ tooltip: function (e) { this.TOOLTIP_ID = Math.random(); var id = this.TOOLTIP_ID; - L.DomUtil.addClass(this.parent, 'storage-tooltip'); + L.DomUtil.addClass(this.parent, 'umap-tooltip'); if (e.anchor && e.position === 'top') this.anchorTooltipTop(e.anchor); else if (e.anchor && e.position === 'left') this.anchorTooltipLeft(e.anchor); else this.anchorTooltipAbsolute(); @@ -146,7 +146,7 @@ L.U.UI = L.Evented.extend({ closeTooltip: function (id) { if (id && id !== this.TOOLTIP_ID) return; this._tooltip.innerHTML = ''; - L.DomUtil.removeClass(this.parent, 'storage-tooltip'); + L.DomUtil.removeClass(this.parent, 'umap-tooltip'); }, getPosition: function (el) { diff --git a/umap/static/umap/js/umap.xhr.js b/umap/static/umap/js/umap.xhr.js index 1d4fa56d..7e625784 100644 --- a/umap/static/umap/js/umap.xhr.js +++ b/umap/static/umap/js/umap.xhr.js @@ -251,7 +251,7 @@ L.U.Xhr = L.Evented.extend({ } }); // Auth links - var links = document.getElementsByClassName('storage-login-popup'); + var links = document.getElementsByClassName('umap-login-popup'); Object.keys(links).forEach(function (el) { var link = links[el]; L.DomEvent @@ -259,7 +259,7 @@ L.U.Xhr = L.Evented.extend({ .on(link, 'click', function () { self.ui.closePanel(); var win = window.open(link.href); - window.storage_proceed = function () { + window.umap_proceed = function () { proceed(); win.close(); }; diff --git a/umap/static/umap/storage.css b/umap/static/umap/storage.css index df32d198..277561ba 100644 --- a/umap/static/umap/storage.css +++ b/umap/static/umap/storage.css @@ -25,7 +25,7 @@ /* *********** */ .leaflet-control-zoom, -.storage-control { +.umap-control { background: none no-repeat scroll center center #F8F8F9; border-radius: 4px; border: 1px solid #bbb; @@ -40,7 +40,7 @@ background-position: 0 -32px; } .leaflet-measure-control a, -.storage-control a { +.umap-control a { background-position: 50% 50%; background-repeat: no-repeat; display: block; @@ -50,19 +50,19 @@ background-image: url('./img/24.png'); } .leaflet-control.display-on-more, -a.storage-control-less { +a.umap-control-less { display: none; } -.storage-control-more, -.storage-control-less { +.umap-control-more, +.umap-control-less { background-image: url('./img/16-white.png'); background-position: -160px -210px; } -.storage-more-controls .display-on-more, -.storage-more-controls .storage-control-less { +.umap-more-controls .display-on-more, +.umap-more-controls .umap-control-less { display: block; } -.storage-more-controls .storage-control-more { +.umap-more-controls .umap-control-more { display: none; } .leaflet-control-embed a { @@ -84,7 +84,7 @@ a.storage-control-less { .leaflet-control-search a.loading { background-image: url('./img/search.gif'); } -a.storage-control-text { +a.umap-control-text { float: right; margin: 0; width: 36px; @@ -160,8 +160,8 @@ ul.photon-autocomplete { cursor: crosshair; } .leaflet-control-toolbar > li > .leaflet-toolbar-icon, -.storage-toolbar a, -.storage-toolbar a:hover { +.umap-toolbar a, +.umap-toolbar a:hover { height: 40px; width: 40px; display: none; @@ -180,54 +180,54 @@ ul.photon-autocomplete { .leaflet-control-toolbar .leaflet-toolbar-icon.dark:hover { background-color: #353c3e; } -.storage-toolbar { +.umap-toolbar { margin-top: 0; } .update-map-extent, -.leaflet-container .storage-toolbar .update-map-extent { +.leaflet-container .umap-toolbar .update-map-extent { background-position: 0 -40px; } -.storage-toolbar .update-map-tilelayers, +.umap-toolbar .update-map-tilelayers, .update-map-tilelayers { background-position: -80px 0; } .manage-datalayers { background-position: -40px -80px; } -.storage-toolbar .update-map-permissions, +.umap-toolbar .update-map-permissions, .update-map-permissions { background-position: -40px -40px; } -.storage-toolbar .upload-data, +.umap-toolbar .upload-data, .upload-data { background-position: -160px 0; } -.storage-toolbar .update-map-settings, +.umap-toolbar .update-map-settings, .update-map-settings { background-position: -120px 0; } -.storage-draw-marker, -.storage-toolbar .storage-draw-marker { +.umap-draw-marker, +.umap-toolbar .umap-draw-marker { background-position: -160px -40px; } -.storage-draw-polyline, -.storage-toolbar .storage-draw-polyline { +.umap-draw-polyline, +.umap-toolbar .umap-draw-polyline { background-position: -120px -40px; } -.storage-draw-polyline-multi, -.storage-toolbar .storage-draw-polyline-multi { +.umap-draw-polyline-multi, +.umap-toolbar .umap-draw-polyline-multi { background-position: -42px -162px; } -.storage-draw-polygon, -.storage-toolbar .storage-draw-polygon { +.umap-draw-polygon, +.umap-toolbar .umap-draw-polygon { background-position: -80px -40px; } -.storage-draw-polygon-multi, -.storage-toolbar .storage-draw-polygon-multi { +.umap-draw-polygon-multi, +.umap-toolbar .umap-draw-polygon-multi { background-position: -2px -162px; } -.storage-edit-enabled .leaflet-control-toolbar > li > .leaflet-toolbar-icon, -.storage-edit-enabled .storage-toolbar a { +.umap-edit-enabled .leaflet-control-toolbar > li > .leaflet-toolbar-icon, +.umap-edit-enabled .umap-toolbar a { display: block; } @@ -258,7 +258,7 @@ ul.photon-autocomplete { /* ********************************* */ /* Help Lightbox */ /* ********************************* */ -.storage-help-box { +.umap-help-box { z-index: 10001; position: absolute; margin: 0 calc(50% - 500px/2); @@ -271,10 +271,10 @@ ul.photon-autocomplete { visibility: hidden; top: -100%; } -.storage-help-box .storage-close-link { +.umap-help-box .umap-close-link { float: right; } -.storage-help-button { +.umap-help-button { display: inline-block; width: 16px; height: 16px; @@ -284,14 +284,14 @@ ul.photon-autocomplete { background-image: url('./img/16.png'); vertical-align: middle; } -.dark .storage-help-button { +.dark .umap-help-button { background-image: url('./img/16-white.png'); } -.storage-help-on .storage-help-box { +.umap-help-on .umap-help-box { visibility: visible; top: 100px; } -.storage-help-entry + .storage-help-entry { +.umap-help-entry + .umap-help-entry { margin-top: 10px; border-top: 1px solid #aaa; padding-top: 10px; @@ -332,29 +332,29 @@ ul.photon-autocomplete { cursor: not-allowed; background-color: #215d9c; } -.storage-is-dirty a.leaflet-control-edit-save { +.umap-is-dirty a.leaflet-control-edit-save { opacity: 1; cursor: pointer; } .leaflet-container a.leaflet-control-edit-save, .leaflet-container a.leaflet-control-edit-cancel, .leaflet-container a.leaflet-control-edit-disable, -.storage-edit-enabled .leaflet-control-edit-enable { +.umap-edit-enabled .leaflet-control-edit-enable { display: none; } -.storage-edit-enabled a.leaflet-control-edit-save, -.storage-edit-enabled a.leaflet-control-edit-disable, -.storage-edit-enabled .storage-is-dirty a.leaflet-control-edit-cancel { +.umap-edit-enabled a.leaflet-control-edit-save, +.umap-edit-enabled a.leaflet-control-edit-disable, +.umap-edit-enabled .umap-is-dirty a.leaflet-control-edit-cancel { display: inline-block; } -.storage-is-dirty a.leaflet-control-edit-disable { +.umap-is-dirty a.leaflet-control-edit-disable { display: none; } -.storage-click-to-edit { +.umap-click-to-edit { color: #4a90d9; font-weight: bold; } -.storage-click-to-edit:after { +.umap-click-to-edit:after { content: "\00a0"; background-repeat: no-repeat; background-position: center center; @@ -364,16 +364,16 @@ ul.photon-autocomplete { display: inline-block; background-position: -82px -82px; } -.storage-click-to-edit:hover:after { +.umap-click-to-edit:hover:after { background-image: url('./img/16.png'); } -.dark .storage-click-to-edit:hover:after { +.dark .umap-click-to-edit:hover:after { background-image: url('./img/16-white.png'); } -.storage-caption-bar { +.umap-caption-bar { display: none; } -.storage-main-edit-toolbox { +.umap-main-edit-toolbox { top: -46px; position: absolute; width: 100%; @@ -390,20 +390,20 @@ ul.photon-autocomplete { opacity: 0.98; color: #efefef; } -.storage-edit-enabled .storage-main-edit-toolbox { +.umap-edit-enabled .umap-main-edit-toolbox { top: 0; } -.storage-edit-enabled .storage-caption-bar { +.umap-edit-enabled .umap-caption-bar { display: none; } -.storage-caption-bar h3, -.storage-main-edit-toolbox h3 { +.umap-caption-bar h3, +.umap-main-edit-toolbox h3 { display: inline; } -.storage-edit-enabled .leaflet-top { +.umap-edit-enabled .leaflet-top { top: 48px; } -.storage-caption-bar-enabled .storage-caption-bar { +.umap-caption-bar-enabled .umap-caption-bar { display: block; height: 46px; background-color: #fff; @@ -420,20 +420,20 @@ ul.photon-autocomplete { opacity: 0.93; z-index: 1000; } -.storage-caption-bar-enabled .leaflet-bottom { +.umap-caption-bar-enabled .leaflet-bottom { bottom: 46px; } -.storage-help { +.umap-help { font-style: italic; } -.storage-slideshow-toolbox { +.umap-slideshow-toolbox { float: right; display: none; } -.storage-slideshow-enabled .storage-slideshow-toolbox { +.umap-slideshow-enabled .umap-slideshow-toolbox { display: inline-block; } -.storage-slideshow-toolbox li { +.umap-slideshow-toolbox li { display: inline-block; cursor: pointer; font-size: 1.5em; @@ -445,34 +445,34 @@ ul.photon-autocomplete { vertical-align: middle; text-align: center; } -.storage-slideshow-toolbox li + li { +.umap-slideshow-toolbox li + li { border-left: 1px solid #aaa; } -.storage-slideshow-toolbox li:hover { +.umap-slideshow-toolbox li:hover { background-color: #666; } -.storage-slideshow-active .storage-slideshow-toolbox .play, -.storage-slideshow-toolbox .play { +.umap-slideshow-active .umap-slideshow-toolbox .play, +.umap-slideshow-toolbox .play { width: 100px; text-align: left; padding-left: 20px; } -.storage-slideshow-toolbox .play:after { +.umap-slideshow-toolbox .play:after { content: ' ▶'; } -.storage-slideshow-active .storage-slideshow-toolbox .play:after { +.umap-slideshow-active .umap-slideshow-toolbox .play:after { content: ' ❚❚'; } -.storage-slideshow-toolbox .stop:before { +.umap-slideshow-toolbox .stop:before { content: '■'; } -.storage-slideshow-toolbox .next:before { +.umap-slideshow-toolbox .next:before { content: '➡'; } -.storage-slideshow-toolbox .prev:before { +.umap-slideshow-toolbox .prev:before { content: '⬅'; } -.storage-slideshow-toolbox .play div { +.umap-slideshow-toolbox .play div { height: 20px; width: 20px; margin: 0px auto; @@ -506,14 +506,14 @@ ul.photon-autocomplete { from {transform: rotate(0deg);} to {transform: rotate(359deg);} } -.storage-slideshow-active .storage-slideshow-toolbox .play .spinner { +.umap-slideshow-active .umap-slideshow-toolbox .play .spinner { visibility: visible; } -.storage-datalayer-version { +.umap-datalayer-version { padding: 5px 0; border-bottom: 1px solid #202425; } -.storage-datalayer-version a { +.umap-datalayer-version a { display: inline-block; width: 20px; height: 20px; @@ -533,28 +533,28 @@ ul.photon-autocomplete { /* Datalayers Control */ /* ********************************* */ -.leaflet-control-browse .storage-browse-toggle { +.leaflet-control-browse .umap-browse-toggle { background-image: url('./img/24.png'); width: 36px; height: 36px; background-position: -41px -81px; } -.leaflet-control-browse .storage-browse-actions { +.leaflet-control-browse .umap-browse-actions { background-color: #fff; padding: 10px; display: none; line-height: 24px; border-radius: 2px; } -.leaflet-control-browse .storage-browse-datalayers { +.leaflet-control-browse .umap-browse-datalayers { max-height: 10em; overflow-y: auto; } .search-result-tools i, .leaflet-inplace-toolbar a, -.storage-browse-features i, -.storage-caption i, -.storage-browse-datalayers i { +.umap-browse-features i, +.umap-caption i, +.umap-browse-datalayers i { background-repeat: no-repeat; background-image: url('./../src/img/16.png'); display: inline; @@ -564,10 +564,10 @@ ul.photon-autocomplete { line-height: 24px; vertical-align: middle; } -.dark .storage-browse-datalayers i { +.dark .umap-browse-datalayers i { background-image: url('./../src/img/16-white.png'); } -.storage-browse-datalayers li[draggable] .drag-handle { +.umap-browse-datalayers li[draggable] .drag-handle { float: right; background-position: -130px -130px; margin-right: 5px; @@ -583,7 +583,7 @@ ul.photon-autocomplete { .leaflet-inplace-toolbar a:hover { background-color: #353c3e!important; } -.leaflet-control-browse .storage-browse-datalayers .off i { +.leaflet-control-browse .umap-browse-datalayers .off i { cursor: inherit; } .layer-toggle { @@ -608,7 +608,7 @@ ul.photon-autocomplete { .layer-edit { background-position: -90px -89px; } -.storage-toggle-edit { +.umap-toggle-edit { background-position: -85px -85px; } .off .layer-table-edit { @@ -623,50 +623,50 @@ ul.photon-autocomplete { .off .layer-delete { background-position: -209px -208px; } -.storage-new-hole { +.umap-new-hole { background-position: -125px -165px; } -.storage-delete-all { +.umap-delete-all { background-position: -204px -85px; } -.storage-delete-one-of-multi { +.umap-delete-one-of-multi { background-position: -165px -125px; } -.storage-delete-one-of-one { +.umap-delete-one-of-one { background-position: -204px -86px; } -.storage-delete-vertex { +.umap-delete-vertex { background-position: -205px -165px; } -.storage-continue-line { +.umap-continue-line { background-position: -165px -5px; } -.storage-split-line { +.umap-split-line { background-position: -205px -45px; } -.storage-extract-shape-from-multi{ +.umap-extract-shape-from-multi{ background-position: -205px -5px; } -.storage-browse-features .feature-title, -.leaflet-control-browse .storage-browse-actions .layer-title { +.umap-browse-features .feature-title, +.leaflet-control-browse .umap-browse-actions .layer-title { width: inherit; cursor: inherit; padding-left: 6px; } -.storage-browse-features .feature-title { +.umap-browse-features .feature-title { font-size: 12px; cursor: pointer; } -.leaflet-control-browse .storage-browse-actions .off .layer-title { +.leaflet-control-browse .umap-browse-actions .off .layer-title { color: rgb(179, 179, 179); } .leaflet-control-browse.expanded > a { display: none; } -.leaflet-control-browse.expanded .storage-browse-actions { +.leaflet-control-browse.expanded .umap-browse-actions { display: block; } -.leaflet-control-browse a.storage-browse-link { +.leaflet-control-browse a.umap-browse-link { background-image: none; background-color: rgb(68, 68, 68); color: white; @@ -681,7 +681,7 @@ ul.photon-autocomplete { border-radius: 2px; } a.add-datalayer:before, -.leaflet-control-browse a.storage-browse-link:before { +.leaflet-control-browse a.umap-browse-link:before { background-image: url('./img/16.png'); background-repeat: no-repeat; background-position: -92px -168px; @@ -695,10 +695,10 @@ a.add-datalayer:before { background-position: -45px -45px; } a.add-datalayer:hover, -.leaflet-control-browse a.storage-browse-link:hover { +.leaflet-control-browse a.umap-browse-link:hover { background-color: rgb(99, 99, 99); } -.storage-browse-data .off .feature { +.umap-browse-data .off .feature { display: none; } @@ -707,12 +707,12 @@ a.add-datalayer:hover, /* Features browser panel */ /* ********************************* */ -.storage-browse-features > div { +.umap-browse-features > div { border: 1px solid #d3d3d3; margin-bottom: 14px; border-radius: 2px; } -.storage-browse-features h5 { +.umap-browse-features h5 { height: 30px; line-height: 30px; background-color: #eeeee0; @@ -721,19 +721,19 @@ a.add-datalayer:hover, overflow: hidden; padding-left: 5px; } -.storage-browse-features h5 span { +.umap-browse-features h5 span { margin-left: 10px; } -.storage-browse-features li { +.umap-browse-features li { padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.storage-browse-features li:nth-child(even) { +.umap-browse-features li:nth-child(even) { background-color: #f8f8f3; } -.storage-browse-features .feature-color { +.umap-browse-features .feature-color { box-shadow: 0 0 4px 0 black inset; background-size: 70% 70%; border: 4px solid #f8f8f3; @@ -746,32 +746,32 @@ a.add-datalayer:hover, padding: 0; width: 24px; } -.storage-browse-features .polygon .feature-color, -.storage-browse-features .polyline .feature-color { +.umap-browse-features .polygon .feature-color, +.umap-browse-features .polyline .feature-color { box-shadow: 0 0 4px 0 black inset; background-image: url('./img/24.png'); background-size: 500%; } -.storage-browse-features .polyline .feature-color { +.umap-browse-features .polyline .feature-color { background-position: -48px -16px; } -.storage-browse-features .polygon .feature-color { +.umap-browse-features .polygon .feature-color { background-position: -32px -16px; } .show-on-edit { display: none!important; } -.storage-edit-enabled .show-on-edit { +.umap-edit-enabled .show-on-edit { display: inline-block!important; } -.storage-edit-enabled .show-on-edit.inline { +.umap-edit-enabled .show-on-edit.inline { display: inline!important; } -.storage-edit-enabled .show-on-edit.block { +.umap-edit-enabled .show-on-edit.block { display: block!important; } -.storage-browse-description { +.umap-browse-description { font-size: 0.9em; margin-bottom: 14px; } @@ -780,53 +780,53 @@ a.add-datalayer:hover, /* ********************************* */ /* Table Editor */ /* ********************************* */ -#storage-ui-container.storage-table-editor { +#umap-ui-container.umap-table-editor { padding-left: 0; padding-right: 0; } -#storage-ui-container.storage-table-editor .toolbox li { +#umap-ui-container.umap-table-editor .toolbox li { float: left; } -.storage-table-editor .storage-close-link { +.umap-table-editor .umap-close-link { right: auto; left: 20px; } -.storage-table-editor .table { +.umap-table-editor .table { display: table; width: 100%; white-space: nowrap; table-layout: fixed; } -.storage-table-editor .tbody { +.umap-table-editor .tbody { display: table-row-group; } -.storage-table-editor .thead, -.storage-table-editor .trow { +.umap-table-editor .thead, +.umap-table-editor .trow { display: table-row; } -.storage-table-editor .tcell { +.umap-table-editor .tcell { display: table-cell; width: 200px; } -.storage-table-editor .thead { +.umap-table-editor .thead { text-align: center; height: 48px; line-height: 48px; background-color: #2c3133; } -.storage-table-editor .thead .tcell { +.umap-table-editor .thead .tcell { border-left: 1px solid #0b0c0c; } -.storage-table-editor .tbody .trow input { +.umap-table-editor .tbody .trow input { margin: 0; border-right: none; display: inline; } -.storage-table-editor .tbody .trow + .trow input { +.umap-table-editor .tbody .trow + .trow input { border-top: none; } -.storage-table-editor .thead i { +.umap-table-editor .thead i { display: none; width: 50%; cursor: pointer; @@ -834,16 +834,16 @@ a.add-datalayer:hover, height: 24px; line-height: 24px; } -.storage-table-editor .thead i:before { +.umap-table-editor .thead i:before { width: 40px; } -.storage-table-editor .thead .tcell:hover i { +.umap-table-editor .thead .tcell:hover i { display: inline-block; } -.storage-table-editor .thead .tcell i:hover { +.umap-table-editor .thead .tcell i:hover { background-color: #33393b; } -.storage-table-editor .thead .tcell:hover span { +.umap-table-editor .thead .tcell:hover span { display: none; } .remotelayer .layer-table-edit { @@ -853,22 +853,22 @@ a.add-datalayer:hover, /* ********************************* */ /* Icons */ /* ********************************* */ -.storage-icon-16 { +.umap-icon-16 { background-repeat: no-repeat; background-image: url('./../src/img/16.png'); display: inline; padding: 0 10px; } -.storage-add { +.umap-add { background-position: -12px -49px; } -.storage-list { +.umap-list { background-position: -52px -168px; } -.storage-list-white { +.umap-list-white { background-position: -92px -168px; } -.storage-caption { +.umap-caption { background-position: -170px -49px; } @@ -876,10 +876,10 @@ a.add-datalayer:hover, /* Tilelayer switcher */ /* ********************************* */ -.storage-tilelayer-switcher-container { +.umap-tilelayer-switcher-container { margin-top: 10px; } -.storage-tilelayer-switcher-container li { +.umap-tilelayer-switcher-container li { border: 1px solid rgb(116, 116, 116); border-radius: 4px 4px 4px 4px; margin-bottom: 14px; @@ -891,7 +891,7 @@ a.add-datalayer:hover, margin-left: auto; margin-right: auto; } -.storage-tilelayer-switcher-container li div { +.umap-tilelayer-switcher-container li div { background-color: rgb(116, 116, 116); bottom: 0; color: rgb(247, 246, 241); @@ -903,8 +903,8 @@ a.add-datalayer:hover, width: 100%; text-align: center; } -.storage-tilelayer-switcher-container li:hover div:before, -.storage-tilelayer-switcher-container .selected div:before { +.umap-tilelayer-switcher-container li:hover div:before, +.umap-tilelayer-switcher-container .selected div:before { content: "✓"; font-size: 1.3em; line-height: 56px; @@ -912,7 +912,7 @@ a.add-datalayer:hover, position: absolute; left: 7px; } -.storage-tilelayer-switcher-container li img { +.umap-tilelayer-switcher-container li img { display: block; max-width: 100%; } @@ -934,13 +934,13 @@ a.add-datalayer:hover, /* ********************************* */ /* Popup */ /* ********************************* */ -.storage-popup { +.umap-popup { display: flex; flex-flow: column nowrap; height:100%; } -.storage-popup-footer { +.umap-popup-footer { background-color: rgb(68, 68, 68); color: white; display: table; @@ -950,7 +950,7 @@ a.add-datalayer:hover, border-radius: 2px; max-height: 24px; } -.storage-popup-footer li { +.umap-popup-footer li { line-height: 24px; height: 24px; display: table-cell; @@ -958,7 +958,7 @@ a.add-datalayer:hover, cursor: pointer; text-align: center; } -.storage-popup-footer li:before { +.umap-popup-footer li:before { display: inline-block; width: 16px; height: 16px; @@ -968,13 +968,13 @@ a.add-datalayer:hover, vertical-align: middle; content: " "; } -.storage-popup-footer li.zoom:before { +.umap-popup-footer li.zoom:before { background-position: -12px -170px; } -.storage-popup-footer li.previous:before { +.umap-popup-footer li.previous:before { background-position: -52px -130px; } -.storage-popup-footer li.next:before { +.umap-popup-footer li.next:before { background-position: -12px -130px; } @@ -982,7 +982,7 @@ a.add-datalayer:hover, /* ************* */ /* Marker's Icon */ /* ************* */ -.storage-div-icon .icon_container { +.umap-div-icon .icon_container { background-color: white; border-radius: 4px 4px 4px 4px; height: 32px; @@ -993,11 +993,11 @@ a.add-datalayer:hover, text-align: center; line-height: 32px; } -.storage-div-icon .icon_container img { +.umap-div-icon .icon_container img { vertical-align: middle; max-width: 24px!important; /* leaflet.css has !important, so... */ } -.storage-div-icon .icon_arrow { +.umap-div-icon .icon_arrow { border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid #2270b5; @@ -1008,7 +1008,7 @@ a.add-datalayer:hover, opacity: 0.9; /*box-shadow: 4px 8px 6px -3px black;*/ } -.storage-drop-icon .icon_arrow { +.umap-drop-icon .icon_arrow { border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 16px solid #2270B5; @@ -1018,7 +1018,7 @@ a.add-datalayer:hover, top: -4px; width: 0; } -.storage-drop-icon .icon_container { +.umap-drop-icon .icon_container { background-color: #2470B5; border-radius: 16px 16px 16px 16px; box-shadow: 6px 13px 8px -4px black; @@ -1028,17 +1028,17 @@ a.add-datalayer:hover, text-align: center; width: 32px; } -.storage-drop-icon .icon_container img { +.umap-drop-icon .icon_container img { vertical-align: middle; max-width: 24px !important; } -.storage-circle-icon { +.umap-circle-icon { border: 1px solid white; border-radius: 10px 10px 10px 10px; height: 12px; width: 12px; } -.storage-ball-icon .icon_container { +.umap-ball-icon .icon_container { background-color: darkblue; background: radial-gradient(circle at 6px 38% , white -4px, darkblue 8px) repeat scroll 0 0 transparent; border-radius: 8px 8px 8px 8px; @@ -1048,7 +1048,7 @@ a.add-datalayer:hover, text-align: center; width: 16px; } -.storage-ball-icon .icon_arrow { +.umap-ball-icon .icon_arrow { background-color: black; height: 16px; left: 7px; @@ -1057,7 +1057,7 @@ a.add-datalayer:hover, top: -1px; width: 2px; } -.storage-edit-enabled .readonly { +.umap-edit-enabled .readonly { cursor: not-allowed; } @@ -1066,9 +1066,9 @@ a.add-datalayer:hover, /* Forms utils */ /* ********************************* */ -.storage-delete:before, .storage-empty:before, .storage-to-polygon:before, -.storage-clone:before, .storage-edit:before, -.storage-to-polyline:before { +.umap-delete:before, .umap-empty:before, .umap-to-polygon:before, +.umap-clone:before, .umap-edit:before, +.umap-to-polyline:before { background-repeat: no-repeat; text-indent: 38px; height: 24px; @@ -1078,37 +1078,37 @@ a.add-datalayer:hover, vertical-align: bottom; content: " "; } -.dark .storage-delete:before, .dark .storage-empty:before, -.dark .storage-to-polygon:before, -.dark .storage-clone:before, -.dark .storage-edit:before, -.dark .storage-to-polyline:before { +.dark .umap-delete:before, .dark .umap-empty:before, +.dark .umap-to-polygon:before, +.dark .umap-clone:before, +.dark .umap-edit:before, +.dark .umap-to-polyline:before { background-image: url('./img/24-white.png'); vertical-align: middle; } -.storage-to-polygon:before { +.umap-to-polygon:before { background-position: -80px -48px; } -.storage-to-polyline:before { +.umap-to-polyline:before { background-position: -120px -48px; } -.storage-clone:before { +.umap-clone:before { background-position: -160px -88px; } -.storage-delete:before { +.umap-delete:before { background-position: -40px -8px; } -.storage-edit:before { +.umap-edit:before { background-position: -6px -6px; } -.storage-empty:before { +.umap-empty:before { background-position: -160px -126px; } -.storage-edit-actions { +.umap-edit-actions { padding-top: 5px; clear: both; } -.storage-edit-actions li { +.umap-edit-actions li { height: 36px; line-height: 36px; cursor: pointer; @@ -1116,31 +1116,31 @@ a.add-datalayer:hover, border-radius: 2px; border: 1px solid #222; } -.storage-edit-actions li i { +.umap-edit-actions li i { background-image: url('./img/24-white.png'); background-repeat: no-repeat; display: table-cell; width: 36px; height: 36px; } -.storage-edit-actions li span { +.umap-edit-actions li span { display: table-cell; vertical-align: middle; } -.storage-edit-actions li:hover { +.umap-edit-actions li:hover { background-color: #353c3e; } -.storage-form-iconfield { +.umap-form-iconfield { position: relative; overflow: hidden; padding-bottom: 5px; padding-top: 5px; line-height: 30px; } -.storage-icon-list, .storage-pictogram-list { +.umap-icon-list, .umap-pictogram-list { clear: both; } -.storage-icon-choice { +.umap-icon-choice { display: block; float: left; width: 30px; @@ -1154,27 +1154,27 @@ a.add-datalayer:hover, margin-bottom: 5px; margin-right: 5px; } -.storage-icon-choice img { +.umap-icon-choice img { vertical-align: middle; max-width: 24px; } -.storage-icon-choice:hover, -.storage-icon-choice.selected, -.storage-color-picker span:hover { +.umap-icon-choice:hover, +.umap-icon-choice.selected, +.umap-color-picker span:hover { box-shadow: 0 0 4px 0 black; } -.storage-icon-choice .leaflet-marker-icon { +.umap-icon-choice .leaflet-marker-icon { bottom: 0; left: 30px; position: absolute; } -.storage-color-picker { +.umap-color-picker { clear: both; margin-bottom: 20px; overflow: hidden; display: none; } -.storage-color-picker span { +.umap-color-picker span { width: 20px; height: 20px; display: block; @@ -1187,7 +1187,7 @@ a.add-datalayer:hover, /* ********************************* */ /* Ajax loader */ /* ********************************* */ -.storage-loading .storage-loader +.umap-loading .umap-loader { display: block; -webkit-animation: shift-rightwards 3s ease-in-out infinite; @@ -1200,7 +1200,7 @@ a.add-datalayer:hover, -o-animation-delay: .2s; animation-delay: .2s; } -.storage-loader +.umap-loader { position: absolute; display: none; @@ -1381,14 +1381,14 @@ a.add-datalayer:hover, .leaflet-popup-content-wrapper { border-radius: 4px; } -.storage-popup-content { +.umap-popup-content { max-height: 500px; flex-grow: 1; overflow-y: auto; overflow-x: hidden; margin-bottom: 14px; } -.storage-popup-content iframe { +.umap-popup-content iframe { min-width: 300px; } .leaflet-popup-content h3 { @@ -1406,16 +1406,16 @@ a.add-datalayer:hover, .leaflet-contextmenu-icon { display: none; } -.storage-popup-content img, -.storage-popup-content iframe { +.umap-popup-content img, +.umap-popup-content iframe { max-width: 300px !important; } -.storage-popup-large iframe, -.storage-popup-large img { +.umap-popup-large iframe, +.umap-popup-large img { /* See https://github.com/Leaflet/Leaflet/commit/61d746818b99d362108545c151a27f09d60960ee#commitcomment-6061847 */ max-width: 500px !important; } -.storage-georss-link .popup-title { +.umap-georss-link .popup-title { text-align: center; } .leaflet-inplace-toolbar { diff --git a/umap/static/umap/test/Controls.js b/umap/static/umap/test/Controls.js index a1daf55d..a0611f65 100644 --- a/umap/static/umap/test/Controls.js +++ b/umap/static/umap/test/Controls.js @@ -3,9 +3,9 @@ describe('L.Utorage.Controls', function(){ before(function () { this.server = sinon.fakeServer.create(); this.server.respondWith('/datalayer/62/', JSON.stringify(RESPONSES.datalayer62_GET)); - this.map = initMap({storage_id: 99}); + this.map = initMap({umap_id: 99}); this.server.respond(); - this.datalayer = this.map.getDataLayerByStorageId(62); + this.datalayer = this.map.getDataLayerByUmapId(62); }); after(function () { this.server.restore(); @@ -15,10 +15,10 @@ describe('L.Utorage.Controls', function(){ describe('#databrowser()', function(){ it('should be opened at datalayer button click', function() { - var button = qs('.storage-browse-actions .storage-browse-link'); + var button = qs('.umap-browse-actions .umap-browse-link'); assert.ok(button); happen.click(button); - assert.ok(qs('#storage-ui-container .storage-browse-data')); + assert.ok(qs('#umap-ui-container .umap-browse-data')); }); it('should contain datalayer section', function() { @@ -34,14 +34,14 @@ describe('L.Utorage.Controls', function(){ window.confirm = function () {return true;}; enableEdit(); happen.once(qs('path[fill="DarkBlue"]'), {type: 'contextmenu'}); - happen.click(qs('.leaflet-contextmenu .storage-delete')); + happen.click(qs('.leaflet-contextmenu .umap-delete')); assert.equal(qsa('#browse_data_datalayer_62 ul li').length, 2); window.confirm = oldConfirm; }); it('should redraw datalayer\'s features list on edit cancel', function() { clickCancel(); - happen.click(qs('.storage-browse-actions .storage-browse-link')); + happen.click(qs('.umap-browse-actions .umap-browse-link')); assert.equal(qsa('#browse_data_datalayer_62 ul li').length, 3); }); diff --git a/umap/static/umap/test/DataLayer.js b/umap/static/umap/test/DataLayer.js index c19933b7..cff8591c 100644 --- a/umap/static/umap/test/DataLayer.js +++ b/umap/static/umap/test/DataLayer.js @@ -4,8 +4,8 @@ describe('L.DataLayer', function () { before(function () { this.server = sinon.fakeServer.create(); this.server.respondWith('GET', '/datalayer/62/', JSON.stringify(RESPONSES.datalayer62_GET)); - this.map = initMap({storage_id: 99}); - this.datalayer = this.map.getDataLayerByStorageId(62); + this.map = initMap({umap_id: 99}); + this.datalayer = this.map.getDataLayerByUmapId(62); this.server.respond(); enableEdit(); }); @@ -44,8 +44,8 @@ describe('L.DataLayer', function () { it('should build a form on edit button click', function () { happen.click(editButton); - form = qs('form.storage-form'); - input = qs('form.storage-form input[name="name"]'); + form = qs('form.umap-form'); + input = qs('form.umap-form input[name="name"]'); assert.ok(form); assert.ok(input); }); @@ -85,15 +85,15 @@ describe('L.DataLayer', function () { this.server.respondWith('POST', '/map/99/update/settings/', JSON.stringify({id: 99})); this.server.respondWith('POST', '/map/99/datalayer/update/62/', [412, {}, '']); happen.click(editButton); - input = qs('form.storage-form input[name="name"]'); + input = qs('form.umap-form input[name="name"]'); input.value = 'a new name'; happen.once(input, {type: 'input'}); clickSave(); this.server.respond(); this.server.respond(); - assert(L.DomUtil.hasClass(this.map._container, 'storage-alert')); + assert(L.DomUtil.hasClass(this.map._container, 'umap-alert')); assert.notEqual(this.map.dirty_datalayers.indexOf(this.datalayer), -1); - forceButton = qs('#storage-alert-container .storage-action'); + forceButton = qs('#umap-alert-container .umap-action'); assert.ok(forceButton); }); @@ -102,7 +102,7 @@ describe('L.DataLayer', function () { happen.click(forceButton); this.server.flush(); this.server.respond('POST', '/map/99/datalayer/update/62/', JSON.stringify(defaultDatalayerData())); - assert.notOk(qs('#storage-alert-container .storage-action')); + assert.notOk(qs('#umap-alert-container .umap-action')); assert(this.map.continueSaving.calledOnce); this.map.continueSaving.restore(); assert.equal(this.map.dirty_datalayers.indexOf(this.datalayer), -1); @@ -121,14 +121,14 @@ describe('L.DataLayer', function () { }); it('should have a new layer button', function () { - newLayerButton = qs('#storage-ui-container .add-datalayer'); + newLayerButton = qs('#umap-ui-container .add-datalayer'); assert.ok(newLayerButton); }); it('should build a form on new layer button click', function () { happen.click(newLayerButton); - form = qs('form.storage-form'); - input = qs('form.storage-form input[name="name"]'); + form = qs('form.umap-form'); + input = qs('form.umap-form input[name="name"]'); assert.ok(form); assert.ok(input); }); @@ -153,15 +153,15 @@ describe('L.DataLayer', function () { assert.equal(newDatalayer.options.name, new_name); }); - it('should set storage_id on save callback', function () { - assert.notOk(newDatalayer.storage_id); + it('should set umap_id on save callback', function () { + assert.notOk(newDatalayer.umap_id); this.server.flush(); this.server.respondWith('POST', '/map/99/update/settings/', JSON.stringify({id: 99})); this.server.respondWith('POST', '/map/99/datalayer/create/', JSON.stringify(defaultDatalayerData({id: 63}))); clickSave(); this.server.respond(); this.server.respond(); // First respond will then trigger another Xhr request (continueSaving) - assert.equal(newDatalayer.storage_id, 63); + assert.equal(newDatalayer.umap_id, 63); }); it('should have unset map dirty', function () { @@ -176,7 +176,7 @@ describe('L.DataLayer', function () { it('should call update if we edit again', function () { happen.click(editButton); assert.notOk(this.map.isDirty); - input = qs('form.storage-form input[name="name"]'); + input = qs('form.umap-form input[name="name"]'); input.value = 'a new name again but we don\'t care which'; happen.once(input, {type: 'input'}); assert.ok(this.map.isDirty); @@ -200,8 +200,8 @@ describe('L.DataLayer', function () { it('should change icon class', function () { happen.click(qs('[data-id="' + this.datalayer._leaflet_id +'"] .layer-edit')); changeSelectValue(qs('form#datalayer-advanced-properties select[name=iconClass]'), 'Circle'); - assert.notOk(qs('div.storage-div-icon')); - assert.ok(qs('div.storage-circle-icon')); + assert.notOk(qs('div.umap-div-icon')); + assert.ok(qs('div.umap-circle-icon')); clickCancel(); }); @@ -210,18 +210,18 @@ describe('L.DataLayer', function () { describe('#show/hide', function () { it('should hide features on hide', function () { - assert.ok(qs('div.storage-div-icon')); + assert.ok(qs('div.umap-div-icon')); assert.ok(qs('path[fill="none"]')); this.datalayer.hide(); - assert.notOk(qs('div.storage-div-icon')); + assert.notOk(qs('div.umap-div-icon')); assert.notOk(qs('path[fill="none"]')); }); it('should show features on show', function () { - assert.notOk(qs('div.storage-div-icon')); + assert.notOk(qs('div.umap-div-icon')); assert.notOk(qs('path[fill="none"]')); this.datalayer.show(); - assert.ok(qs('div.storage-div-icon')); + assert.ok(qs('div.umap-div-icon')); assert.ok(qs('path[fill="none"]')); }); @@ -232,7 +232,7 @@ describe('L.DataLayer', function () { it('should clone everything but the id and the name', function () { enableEdit(); var clone = this.datalayer.clone(); - assert.notOk(clone.storage_id); + assert.notOk(clone.umap_id); assert.notEqual(clone.options.name, this.datalayer.name); assert.ok(clone.options.name); assert.equal(clone.options.color, this.datalayer.options.color); @@ -267,16 +267,16 @@ describe('L.DataLayer', function () { }, 'type': 'Feature', 'id': 1807, - 'properties': {_storage_options: {}, name: 'new point from restore'} + 'properties': {_umap_options: {}, name: 'new point from restore'} }); - geojson._storage.color = 'Chocolate'; + geojson._umap_options.color = 'Chocolate'; this.server.respondWith('GET', '/datalayer/62/olderversion.geojson', JSON.stringify(geojson)); sinon.spy(window, 'confirm'); this.datalayer.restore('olderversion.geojson'); this.server.respond(); assert(window.confirm.calledOnce); window.confirm.restore(); - assert.equal(this.datalayer.storage_id, 62); + assert.equal(this.datalayer.umap_id, 62); assert.ok(this.datalayer.isDirty); assert.equal(this.datalayer._index.length, 4); assert.ok(qs('path[fill="Chocolate"]')); diff --git a/umap/static/umap/test/Feature.js b/umap/static/umap/test/Feature.js index 52e4ebe9..afc7bd73 100644 --- a/umap/static/umap/test/Feature.js +++ b/umap/static/umap/test/Feature.js @@ -3,8 +3,8 @@ describe('L.Utorage.FeatureMixin', function () { before(function () { this.server = sinon.fakeServer.create(); this.server.respondWith('GET', '/datalayer/62/', JSON.stringify(RESPONSES.datalayer62_GET)); - this.map = initMap({storage_id: 99}); - this.datalayer = this.map.getDataLayerByStorageId(62); + this.map = initMap({umap_id: 99}); + this.datalayer = this.map.getDataLayerByUmapId(62); this.server.respond(); }); after(function () { @@ -36,24 +36,24 @@ describe('L.Utorage.FeatureMixin', function () { happen.click(qs('path[fill="DarkRed"]')); var toolbar = qs('ul.leaflet-inplace-toolbar'); assert.ok(toolbar); - link = qs('a.storage-toggle-edit', toolbar); + link = qs('a.umap-toggle-edit', toolbar); assert.ok(link); }); it('should open a form on popup toolbar toggle edit click', function () { happen.click(link); - var form = qs('form#storage-feature-properties'); - var input = qs('form#storage-feature-properties input[name="name"]'); + var form = qs('form#umap-feature-properties'); + var input = qs('form#umap-feature-properties input[name="name"]'); assert.ok(form); assert.ok(input); }); - it('should not handle _storage_options has normal property', function () { - assert.notOk(qs('form#storage-feature-properties input[name="_storage_options"]')); + it('should not handle _umap_options has normal property', function () { + assert.notOk(qs('form#umap-feature-properties input[name="_umap_options"]')); }); it('should give precedence to feature style over datalayer styles', function () { - var input = qs('#storage-ui-container form input[name="color"]'); + var input = qs('#umap-ui-container form input[name="color"]'); assert.ok(input); changeInputValue(input, 'DarkGreen'); assert.notOk(qs('path[fill="DarkRed"]')); @@ -64,9 +64,9 @@ describe('L.Utorage.FeatureMixin', function () { it('should remove stroke if set to no', function () { assert.notOk(qs('path[stroke="none"]')); - var defineButton = qs('#storage-feature-shape-properties .formbox:nth-child(4) .define'); + var defineButton = qs('#umap-feature-shape-properties .formbox:nth-child(4) .define'); happen.click(defineButton); - var input = qs('#storage-feature-shape-properties input[name="stroke"]'); + var input = qs('#umap-feature-shape-properties input[name="stroke"]'); assert.ok(input); input.checked = false; happen.once(input, {type: 'change'}); @@ -76,7 +76,7 @@ describe('L.Utorage.FeatureMixin', function () { it('should not override already set style on features', function () { happen.click(qs('#browse_data_toggle_' + L.stamp(this.datalayer) + ' .layer-edit')); - changeInputValue(qs('#storage-ui-container form input[name=color]'), 'Chocolate'); + changeInputValue(qs('#umap-ui-container form input[name=color]'), 'Chocolate'); assert.notOk(qs('path[fill="DarkBlue"]')); assert.notOk(qs('path[fill="DarkRed"]')); assert.notOk(qs('path[fill="Chocolate"]')); @@ -95,7 +95,7 @@ describe('L.Utorage.FeatureMixin', function () { enableEdit(); assert.notOk(this.map.editedFeature); happen.click(qs('path[fill="DarkBlue"]')); - happen.click(qs('ul.leaflet-inplace-toolbar a.storage-toggle-edit')); + happen.click(qs('ul.leaflet-inplace-toolbar a.umap-toggle-edit')); assert.ok(this.map.editedFeature); disableEdit(); }); @@ -104,7 +104,7 @@ describe('L.Utorage.FeatureMixin', function () { enableEdit(); assert.notOk(this.map.editedFeature); happen.click(qs('path[fill="DarkBlue"]')); - happen.click(qs('ul.leaflet-inplace-toolbar a.storage-toggle-edit')); + happen.click(qs('ul.leaflet-inplace-toolbar a.umap-toggle-edit')); assert.ok(this.map.editedFeature); this.map.displayCaption(); window.setTimeout(function () { @@ -136,12 +136,12 @@ describe('L.Utorage.FeatureMixin', function () { assert.equal(poly.getLatLngs()[0].length, 6); }); - it('should remove empty _storage_options from exported geojson', function () { + it('should remove empty _umap_options from exported geojson', function () { setFeatures(this.datalayer); assert.ok(poly); assert.deepEqual(poly.toGeoJSON().properties, {name: 'name poly'}); assert.ok(marker); - assert.deepEqual(marker.toGeoJSON().properties, {_storage_options: {color: 'OliveDrab'}, name: 'test'}); + assert.deepEqual(marker.toGeoJSON().properties, {_umap_options: {color: 'OliveDrab'}, name: 'test'}); }); }); @@ -151,11 +151,11 @@ describe('L.Utorage.FeatureMixin', function () { it('should change style on datalayer select change', function () { enableEdit(); happen.click(qs('.manage-datalayers')); - happen.click(qs('#storage-ui-container .add-datalayer')); - changeInputValue(qs('form.storage-form input[name="name"]'), 'New layer'); + happen.click(qs('#umap-ui-container .add-datalayer')); + changeInputValue(qs('form.umap-form input[name="name"]'), 'New layer'); changeInputValue(qs('form#datalayer-advanced-properties input[name=color]'), 'MediumAquaMarine'); happen.click(qs('path[fill="DarkBlue"]')); - happen.click(qs('ul.leaflet-inplace-toolbar a.storage-toggle-edit')); + happen.click(qs('ul.leaflet-inplace-toolbar a.umap-toggle-edit')); var select = qs('select[name=datalayer]'); select.selectedIndex = 0; happen.once(select, {type: 'change'}); diff --git a/umap/static/umap/test/Map.js b/umap/static/umap/test/Map.js index ed26ebec..dd790df2 100644 --- a/umap/static/umap/test/Map.js +++ b/umap/static/umap/test/Map.js @@ -4,11 +4,11 @@ describe('L.Utorage.Map', function(){ this.server = sinon.fakeServer.create(); this.server.respondWith('/datalayer/62/', JSON.stringify(RESPONSES.datalayer62_GET)); this.options = { - storage_id: 99 + umap_id: 99 }; - this.map = initMap({storage_id: 99}); + this.map = initMap({umap_id: 99}); this.server.respond(); - this.datalayer = this.map.getDataLayerByStorageId(62); + this.datalayer = this.map.getDataLayerByUmapId(62); }); after(function () { this.server.restore(); @@ -19,7 +19,7 @@ describe('L.Utorage.Map', function(){ describe('#init()', function(){ it('should be initialized', function(){ - assert.equal(this.map.options.storage_id, 99); + assert.equal(this.map.options.umap_id, 99); }); it('should have created the edit button', function(){ @@ -31,7 +31,7 @@ describe('L.Utorage.Map', function(){ }); it('should have datalayer actions div', function(){ - assert.ok(qs('div.storage-browse-actions')); + assert.ok(qs('div.umap-browse-actions')); }); it('should have icon container div', function(){ @@ -47,7 +47,7 @@ describe('L.Utorage.Map', function(){ it('enable edit on click on toggle button', function () { var el = qs('div.leaflet-control-edit-enable a'); happen.click(el); - assert.isTrue(L.DomUtil.hasClass(document.body, 'storage-edit-enabled')); + assert.isTrue(L.DomUtil.hasClass(document.body, 'umap-edit-enabled')); }); it('should have only one datalayer in its index', function () { @@ -62,8 +62,8 @@ describe('L.Utorage.Map', function(){ var button = qs('a.update-map-settings'); assert.ok(button); happen.click(button); - form = qs('form.storage-form'); - input = qs('form[class="storage-form"] input[name="name"]'); + form = qs('form.umap-form'); + input = qs('form[class="umap-form"] input[name="name"]'); assert.ok(form); assert.ok(input); done(); @@ -81,7 +81,7 @@ describe('L.Utorage.Map', function(){ }); it('should have added dirty class on map container', function () { - assert.ok(L.DomUtil.hasClass(this.map._container, 'storage-is-dirty')); + assert.ok(L.DomUtil.hasClass(this.map._container, 'umap-is-dirty')); }); }); @@ -105,7 +105,7 @@ describe('L.Utorage.Map', function(){ var button = qs('a.update-map-settings'); assert.ok(button, 'update map info button exists'); happen.click(button); - var deleteLink = qs('a.storage-delete'); + var deleteLink = qs('a.umap-delete'); assert.ok(deleteLink, 'delete map button exists'); sinon.spy(window, 'confirm'); this.server.respondWith('POST', path, JSON.stringify({redirect: '#'})); @@ -123,11 +123,11 @@ describe('L.Utorage.Map', function(){ it('should build a form on click', function () { happen.click(qs('a.upload-data')); - fileInput = qs('.storage-upload input[type="file"]'); - textarea = qs('.storage-upload textarea'); - submit = qs('.storage-upload input[type="button"]'); - formatSelect = qs('.storage-upload select[name="format"]'); - layerSelect = qs('.storage-upload select[name="datalayer"]'); + fileInput = qs('.umap-upload input[type="file"]'); + textarea = qs('.umap-upload textarea'); + submit = qs('.umap-upload input[type="button"]'); + formatSelect = qs('.umap-upload select[name="format"]'); + layerSelect = qs('.umap-upload select[name="datalayer"]'); assert.ok(fileInput); assert.ok(submit); assert.ok(textarea); @@ -147,9 +147,9 @@ describe('L.Utorage.Map', function(){ it('should import kml from textarea', function () { this.datalayer.empty() happen.click(qs('a.upload-data')); - textarea = qs('.storage-upload textarea'); - submit = qs('.storage-upload input[type="button"]'); - formatSelect = qs('.storage-upload select[name="format"]'); + textarea = qs('.umap-upload textarea'); + submit = qs('.umap-upload input[type="button"]'); + formatSelect = qs('.umap-upload select[name="format"]'); assert.equal(this.datalayer._index.length, 0); textarea.value = kml_example; changeSelectValue(formatSelect, 'kml'); @@ -160,9 +160,9 @@ describe('L.Utorage.Map', function(){ it('should import gpx from textarea', function () { this.datalayer.empty() happen.click(qs('a.upload-data')); - textarea = qs('.storage-upload textarea'); - submit = qs('.storage-upload input[type="button"]'); - formatSelect = qs('.storage-upload select[name="format"]'); + textarea = qs('.umap-upload textarea'); + submit = qs('.umap-upload input[type="button"]'); + formatSelect = qs('.umap-upload select[name="format"]'); assert.equal(this.datalayer._index.length, 0); textarea.value = gpx_example; changeSelectValue(formatSelect, 'gpx'); @@ -173,9 +173,9 @@ describe('L.Utorage.Map', function(){ it('should import csv from textarea', function () { this.datalayer.empty() happen.click(qs('a.upload-data')); - textarea = qs('.storage-upload textarea'); - submit = qs('.storage-upload input[type="button"]'); - formatSelect = qs('.storage-upload select[name="format"]'); + textarea = qs('.umap-upload textarea'); + submit = qs('.umap-upload input[type="button"]'); + formatSelect = qs('.umap-upload select[name="format"]'); assert.equal(this.datalayer._index.length, 0); textarea.value = csv_example; changeSelectValue(formatSelect, 'csv'); @@ -185,10 +185,10 @@ describe('L.Utorage.Map', function(){ it('should replace content if asked so', function () { happen.click(qs('a.upload-data')); - textarea = qs('.storage-upload textarea'); - submit = qs('.storage-upload input[type="button"]'); - formatSelect = qs('.storage-upload select[name="format"]'); - clearFlag = qs('.storage-upload input[name="clear"]'); + textarea = qs('.umap-upload textarea'); + submit = qs('.umap-upload input[type="button"]'); + formatSelect = qs('.umap-upload select[name="format"]'); + clearFlag = qs('.umap-upload input[name="clear"]'); clearFlag.checked = true; assert.equal(this.datalayer._index.length, 1); textarea.value = csv_example; @@ -201,7 +201,7 @@ describe('L.Utorage.Map', function(){ it('should import GeometryCollection from textarea', function () { this.datalayer.empty() textarea.value = '{"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-80.66080570220947,35.04939206472683]},{"type": "Polygon","coordinates": [[[-80.66458225250244,35.04496519190309],[-80.66344499588013,35.04603679820616],[-80.66258668899536,35.045580049697556],[-80.66387414932251,35.044280059194946],[-80.66458225250244,35.04496519190309]]]},{"type": "LineString","coordinates": [[-80.66237211227417,35.05950973022538],[-80.66269397735596,35.0592638296087],[-80.66284418106079,35.05893010615862],[-80.66308021545409,35.05833291342246],[-80.66359519958496,35.057753281001425],[-80.66387414932251,35.05740198662245],[-80.66441059112549,35.05703312589789],[-80.66486120223999,35.056787217822475],[-80.66541910171509,35.05650617911516],[-80.66563367843628,35.05631296444281],[-80.66601991653441,35.055891403570705],[-80.66619157791138,35.05545227534804],[-80.66619157791138,35.05517123204622],[-80.66625595092773,35.05489018777713],[-80.6662130355835,35.054222703761525],[-80.6662130355835,35.05392409072499],[-80.66595554351807,35.05290528508858],[-80.66569805145262,35.052044560077285],[-80.66550493240356,35.0514824490509],[-80.665762424469,35.05048117920187],[-80.66617012023926,35.04972582715769],[-80.66651344299316,35.049286665781096],[-80.66692113876343,35.0485313026898],[-80.66700696945189,35.048215102112344],[-80.66707134246826,35.04777593261294],[-80.66704988479614,35.04738946150025],[-80.66696405410767,35.04698542156371],[-80.66681385040283,35.046353007216055],[-80.66659927368164,35.04596652937105],[-80.66640615463257,35.04561518428889],[-80.6659984588623,35.045193568195565],[-80.66552639007568,35.044877354697526],[-80.6649899482727,35.04454357245502],[-80.66449642181396,35.04417465365292],[-80.66385269165039,35.04387600387859],[-80.66303730010986,35.043717894732545]]}]}'; - formatSelect = qs('.storage-upload select[name="format"]'); + formatSelect = qs('.umap-upload select[name="format"]'); changeSelectValue(formatSelect, 'geojson'); happen.click(submit); assert.equal(this.datalayer._index.length, 3); @@ -234,11 +234,11 @@ describe('L.Utorage.Map', function(){ this.map.save = function(){}; happen.click(qs('a.upload-data')); var initialLayerCount = Object.keys(this.map.datalayers).length; - formatSelect = qs('.storage-upload select[name="format"]'); - textarea = qs('.storage-upload textarea'); - textarea.value = '{ "type": "umap", "geometry": { "type": "Point", "coordinates": [3.0528, 50.6269] }, "properties": { "storage_id": 666, "longCredit": "the illustrious mapmaker", "shortCredit": "the mapmaker", "slideshow": {}, "captionBar": true, "dashArray": "5,5", "fillOpacity": "0.5", "fillColor": "Crimson", "fill": true, "weight": "2", "opacity": "0.9", "smoothFactor": "1", "iconClass": "Drop", "color": "Red", "limitBounds": {}, "tilelayer": { "maxZoom": 18, "url_template": "http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg", "minZoom": 0, "attribution": "Map tiles by [[http://stamen.com|Stamen Design]], under [[http://creativecommons.org/licenses/by/3.0|CC BY 3.0]]. Data by [[http://openstreetmap.org|OpenStreetMap]], under [[http://creativecommons.org/licenses/by-sa/3.0|CC BY SA]].", "name": "Watercolor" }, "licence": { "url": "", "name": "No licence set" }, "description": "Map description", "name": "Imported map", "tilelayersControl": true, "onLoadPanel": "caption", "displayPopupFooter": true, "miniMap": true, "moreControl": true, "scaleControl": true, "zoomControl": true, "scrollWheelZoom": true, "datalayersControl": true, "zoom": 6 }, "layers": [{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [4.2939, 50.8893], [4.2441, 50.8196], [4.3869, 50.7642], [4.4813, 50.7929], [4.413, 50.9119], [4.2939, 50.8893] ] ] }, "properties": { "name": "Bruxelles", "description": "polygon" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [3.0528, 50.6269] }, "properties": { "_storage_options": { "color": "Orange" }, "name": "Lille", "description": "une ville" } }], "_storage": { "displayOnLoad": true, "name": "Cities", "id": 108, "remoteData": {}, "description": "A layer with some cities", "color": "Navy", "iconClass": "Drop", "smoothFactor": "1", "dashArray": "5,1", "fillOpacity": "0.5", "fillColor": "Blue", "fill": true } }, { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [1.7715, 50.9255], [1.6589, 50.9696], [1.4941, 51.0128], [1.4199, 51.0638], [1.2881, 51.1104] ] }, "properties": { "_storage_options": { "weight": "4" }, "name": "tunnel sous la Manche" } }], "_storage": { "displayOnLoad": true, "name": "Tunnels", "id": 109, "remoteData": {} } }]}'; + formatSelect = qs('.umap-upload select[name="format"]'); + textarea = qs('.umap-upload textarea'); + textarea.value = '{ "type": "umap", "geometry": { "type": "Point", "coordinates": [3.0528, 50.6269] }, "properties": { "umap_id": 666, "longCredit": "the illustrious mapmaker", "shortCredit": "the mapmaker", "slideshow": {}, "captionBar": true, "dashArray": "5,5", "fillOpacity": "0.5", "fillColor": "Crimson", "fill": true, "weight": "2", "opacity": "0.9", "smoothFactor": "1", "iconClass": "Drop", "color": "Red", "limitBounds": {}, "tilelayer": { "maxZoom": 18, "url_template": "http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg", "minZoom": 0, "attribution": "Map tiles by [[http://stamen.com|Stamen Design]], under [[http://creativecommons.org/licenses/by/3.0|CC BY 3.0]]. Data by [[http://openstreetmap.org|OpenStreetMap]], under [[http://creativecommons.org/licenses/by-sa/3.0|CC BY SA]].", "name": "Watercolor" }, "licence": { "url": "", "name": "No licence set" }, "description": "Map description", "name": "Imported map", "tilelayersControl": true, "onLoadPanel": "caption", "displayPopupFooter": true, "miniMap": true, "moreControl": true, "scaleControl": true, "zoomControl": true, "scrollWheelZoom": true, "datalayersControl": true, "zoom": 6 }, "layers": [{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [4.2939, 50.8893], [4.2441, 50.8196], [4.3869, 50.7642], [4.4813, 50.7929], [4.413, 50.9119], [4.2939, 50.8893] ] ] }, "properties": { "name": "Bruxelles", "description": "polygon" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [3.0528, 50.6269] }, "properties": { "_umap_options": { "color": "Orange" }, "name": "Lille", "description": "une ville" } }], "_umap_options": { "displayOnLoad": true, "name": "Cities", "id": 108, "remoteData": {}, "description": "A layer with some cities", "color": "Navy", "iconClass": "Drop", "smoothFactor": "1", "dashArray": "5,1", "fillOpacity": "0.5", "fillColor": "Blue", "fill": true } }, { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [1.7715, 50.9255], [1.6589, 50.9696], [1.4941, 51.0128], [1.4199, 51.0638], [1.2881, 51.1104] ] }, "properties": { "_umap_options": { "weight": "4" }, "name": "tunnel sous la Manche" } }], "_umap_options": { "displayOnLoad": true, "name": "Tunnels", "id": 109, "remoteData": {} } }]}'; formatSelect.value = 'umap'; - submit = qs('.storage-upload input[type="button"]'); + submit = qs('.umap-upload input[type="button"]'); happen.click(submit); assert.equal(Object.keys(this.map.datalayers).length, initialLayerCount + 2); assert.equal(this.map.options.name, "Imported map"); @@ -261,11 +261,11 @@ describe('L.Utorage.Map', function(){ }); it('should only import options on the whitelist (umap format import)', function () { - assert.equal(this.map.options.storage_id, 99); + assert.equal(this.map.options.umap_id, 99); }); it('should update title bar (umap format import)', function () { - var title = qs("#map div.storage-main-edit-toolbox h3 a.storage-click-to-edit"); + var title = qs("#map div.umap-main-edit-toolbox h3 a.umap-click-to-edit"); assert.equal(title.innerHTML, "Imported map"); }); @@ -276,7 +276,7 @@ describe('L.Utorage.Map', function(){ it('should update the tilelayer switcher control (umap format import)', function () { //The tilelayer in the imported data isn't in the tilelayer list (set in _pre.js), there should be no selection on the tilelayer switcher - var selectedLayer = qs(".storage-tilelayer-switcher-container li.selected"); + var selectedLayer = qs(".umap-tilelayer-switcher-container li.selected"); assert.equal(selectedLayer, null); }); diff --git a/umap/static/umap/test/Polygon.js b/umap/static/umap/test/Polygon.js index 317181ea..0264afde 100644 --- a/umap/static/umap/test/Polygon.js +++ b/umap/static/umap/test/Polygon.js @@ -2,7 +2,7 @@ describe('L.Utorage.Polygon', function () { var p2ll, map; before(function () { - this.map = map = initMap({storage_id: 99}); + this.map = map = initMap({umap_id: 99}); enableEdit(); p2ll = function (x, y) { return map.containerPointToLatLng([x, y]); @@ -175,20 +175,20 @@ describe('L.Utorage.Polygon', function () { describe('#addShape', function () { it('"add shape" control should not be visible by default', function () { - assert.notOk(qs('.storage-draw-polygon-multi')); + assert.notOk(qs('.umap-draw-polygon-multi')); }); it('"add shape" control should be visible when editing a Polygon', function () { var layer = new L.U.Polygon(this.map, [p2ll(100, 100), p2ll(100, 200)], {datalayer: this.datalayer}).addTo(this.datalayer); layer.edit(); - assert.ok(qs('.storage-draw-polygon-multi')); + assert.ok(qs('.umap-draw-polygon-multi')); }); it('"add shape" control should extend the same multi', function () { var layer = new L.U.Polygon(this.map, [p2ll(100, 150), p2ll(150, 200), p2ll(200, 100)], {datalayer: this.datalayer}).addTo(this.datalayer); layer.edit(); assert.notOk(layer.isMulti()); - happen.click(qs('.storage-draw-polygon-multi')); + happen.click(qs('.umap-draw-polygon-multi')); happen.at('mousedown', 300, 300); happen.at('mouseup', 300, 300); happen.at('mousedown', 350, 300); diff --git a/umap/static/umap/test/Polyline.js b/umap/static/umap/test/Polyline.js index 708f672d..c92b19d0 100644 --- a/umap/static/umap/test/Polyline.js +++ b/umap/static/umap/test/Polyline.js @@ -2,7 +2,7 @@ describe('L.Utorage.Polyline', function () { var p2ll, map; before(function () { - this.map = map = initMap({storage_id: 99}); + this.map = map = initMap({umap_id: 99}); enableEdit(); p2ll = function (x, y) { return map.containerPointToLatLng([x, y]); @@ -191,20 +191,20 @@ describe('L.Utorage.Polyline', function () { describe('#addShape', function () { it('"add shape" control should not be visible by default', function () { - assert.notOk(qs('.storage-draw-polyline-multi')); + assert.notOk(qs('.umap-draw-polyline-multi')); }); it('"add shape" control should be visible when editing a Polyline', function () { var layer = new L.U.Polyline(this.map, [p2ll(100, 100), p2ll(100, 200)], {datalayer: this.datalayer}).addTo(this.datalayer); layer.edit(); - assert.ok(qs('.storage-draw-polyline-multi')); + assert.ok(qs('.umap-draw-polyline-multi')); }); it('"add shape" control should extend the same multi', function () { var layer = new L.U.Polyline(this.map, [p2ll(100, 100), p2ll(100, 200)], {datalayer: this.datalayer}).addTo(this.datalayer); layer.edit(); assert.notOk(layer.isMulti()); - happen.click(qs('.storage-draw-polyline-multi')); + happen.click(qs('.umap-draw-polyline-multi')); happen.at('mousemove', 300, 300); happen.at('click', 300, 300); happen.at('mousemove', 350, 300); diff --git a/umap/static/umap/test/TableEditor.js b/umap/static/umap/test/TableEditor.js index cd202df4..6672c16a 100644 --- a/umap/static/umap/test/TableEditor.js +++ b/umap/static/umap/test/TableEditor.js @@ -4,8 +4,8 @@ describe('L.TableEditor', function () { before(function () { this.server = sinon.fakeServer.create(); this.server.respondWith('GET', '/datalayer/62/', JSON.stringify(RESPONSES.datalayer62_GET)); - this.map = initMap({storage_id: 99}); - this.datalayer = this.map.getDataLayerByStorageId(62); + this.map = initMap({umap_id: 99}); + this.datalayer = this.map.getDataLayerByUmapId(62); this.server.respond(); enableEdit(); }); @@ -25,9 +25,9 @@ describe('L.TableEditor', function () { it('should open table button click', function () { happen.click(button); - expect(qs('#storage-ui-container div.table')).to.be.ok; - expect(qsa('#storage-ui-container div.table form').length).to.eql(3); // One per feature. - expect(qsa('#storage-ui-container div.table input').length).to.eql(3); // One per feature and per property. + expect(qs('#umap-ui-container div.table')).to.be.ok; + expect(qsa('#umap-ui-container div.table form').length).to.eql(3); // One per feature. + expect(qsa('#umap-ui-container div.table input').length).to.eql(3); // One per feature and per property. }); }); @@ -45,15 +45,15 @@ describe('L.TableEditor', function () { }; var oldPrompt = window.prompt; window.prompt = newPrompt; - var button = qs('#storage-ui-container .add-property'); + var button = qs('#umap-ui-container .add-property'); expect(button).to.be.ok; happen.click(button); - expect(qsa('#storage-ui-container div.table input').length).to.eql(6); // One per feature and per property. + expect(qsa('#umap-ui-container div.table input').length).to.eql(6); // One per feature and per property. window.prompt = oldPrompt; }); it('should populate feature property on fill', function () { - var input = qs('form#storage-feature-properties_' + L.stamp(feature) + ' input[name=newprop]'); + var input = qs('form#umap-feature-properties_' + L.stamp(feature) + ' input[name=newprop]'); changeInputValue(input, 'the value'); expect(feature.properties.newprop).to.eql('the value'); }); @@ -64,10 +64,10 @@ describe('L.TableEditor', function () { }; var oldPrompt = window.prompt; window.prompt = newPrompt; - var button = qs('#storage-ui-container div.thead div.tcell:last-of-type .storage-edit'); + var button = qs('#umap-ui-container div.thead div.tcell:last-of-type .umap-edit'); expect(button).to.be.ok; happen.click(button); - expect(qsa('#storage-ui-container div.table input').length).to.eql(6); + expect(qsa('#umap-ui-container div.table input').length).to.eql(6); expect(feature.properties.newprop).to.be.undefined; expect(feature.properties.newname).to.eql('the value'); window.prompt = oldPrompt; @@ -80,11 +80,11 @@ describe('L.TableEditor', function () { }; oldConfirm = window.confirm; window.confirm = newConfirm; - var button = qs('#storage-ui-container div.thead div.tcell:last-of-type .storage-delete'); + var button = qs('#umap-ui-container div.thead div.tcell:last-of-type .umap-delete'); expect(button).to.be.ok; happen.click(button); FEATURE = feature; - expect(qsa('#storage-ui-container div.table input').length).to.eql(3); + expect(qsa('#umap-ui-container div.table input').length).to.eql(3); expect(feature.properties.newname).to.be.undefined; window.confirm = oldConfirm; }); diff --git a/umap/static/umap/test/_pre.js b/umap/static/umap/test/_pre.js index 0db7532e..63e88c82 100644 --- a/umap/static/umap/test/_pre.js +++ b/umap/static/umap/test/_pre.js @@ -59,8 +59,8 @@ var changeSelectValue = function (path_or_select, value) { return path_or_select; } var cleanAlert = function () { - L.DomUtil.removeClass(qs('#map'), 'storage-alert'); - L.DomUtil.get('storage-alert-container').innerHTML = ''; + L.DomUtil.removeClass(qs('#map'), 'umap-alert'); + L.DomUtil.get('umap-alert-container').innerHTML = ''; UI_ALERT_ID = null; // Prevent setTimeout to be called }; var defaultDatalayerData = function (custom) { @@ -91,7 +91,7 @@ function initMap (options) { }, "type": "Feature", "properties": { - "storage_id": 42, + "umap_id": 42, "datalayers": [], "urls": { "map": "/map/{slug}_{pk}", @@ -184,7 +184,7 @@ var RESPONSES = { 'datalayer62_GET': { "crs": null, "type": "FeatureCollection", - "_storage": defaultDatalayerData(), + "_umap_options": defaultDatalayerData(), "features": [{ "geometry": { "type": "Point", @@ -192,7 +192,7 @@ var RESPONSES = { }, "type": "Feature", "id": 1807, - "properties": {_storage_options: {color: "OliveDrab"}, name: "test"} + "properties": {_umap_options: {color: "OliveDrab"}, name: "test"} }, { "geometry": { @@ -200,7 +200,7 @@ var RESPONSES = { "coordinates": [[-0.5712890625, 54.47642158429295], [0.439453125, 54.610254981579146], [1.724853515625, 53.44880683542759], [4.163818359375, 53.98839506479995], [5.306396484375, 53.533778184257805], [6.591796875, 53.70971358510174], [7.042236328124999, 53.35055131839989]] }, "type": "Feature", - "id": 20, "properties": {"_storage_options": {"fill": false}, "name": "test"} + "id": 20, "properties": {"_umap_options": {"fill": false}, "name": "test"} }, { "geometry": { diff --git a/umap/static/umap/umap.css b/umap/static/umap/umap.css index 25332167..1f01826b 100644 --- a/umap/static/umap/umap.css +++ b/umap/static/umap/umap.css @@ -192,19 +192,19 @@ input:-moz-placeholder, :-moz-placeholder { color: #a5a5a5; } -#storage-ui-container textarea { +#umap-ui-container textarea { height: 100px; margin-bottom: 14px; } -#storage-ui-container select { +#umap-ui-container select { margin-bottom: 10px; } -#storage-ui-container.warning .button { +#umap-ui-container.warning .button { background-color: #c60f13; border: 1px solid #7f0a0c; } -#storage-ui-container.warning .button:hover { +#umap-ui-container.warning .button:hover { background-color: #970b0e; } @@ -479,7 +479,7 @@ ul.umap-autocomplete { /* **************************** */ /* Override Leaflet.Storage */ /* **************************** */ -body.content #storage-ui-container { +body.content #umap-ui-container { /* width: 100%; top: 0; right: 0; @@ -491,7 +491,7 @@ body.content #storage-ui-container { #id_editors + br + span.helptext { display: none; } -.storage-loader { +.umap-loader { background-color: #79c1c0 !important; } .leaflet-container a.button { diff --git a/umap/templatetags/umap_tags.py b/umap/templatetags/umap_tags.py index 22764199..be620533 100644 --- a/umap/templatetags/umap_tags.py +++ b/umap/templatetags/umap_tags.py @@ -42,12 +42,12 @@ def map_fragment(map_instance, **kwargs): 'hash': False, 'attributionControl': False, 'scrollWheelZoom': False, - 'storageAttributionControl': False, + 'umapAttributionControl': False, 'noControl': True, - 'storage_id': map_instance.pk, + 'umap_id': map_instance.pk, 'onLoadPanel': "none", 'captionBar': False, - 'default_iconUrl': "%sstorage/src/img/marker.png" % settings.STATIC_URL, + 'default_iconUrl': "%sumap/img/marker.png" % settings.STATIC_URL, 'slideshow': {} }) map_settings['properties'].update(kwargs) diff --git a/umap/tests/base.py b/umap/tests/base.py index 820425e6..b2c64942 100644 --- a/umap/tests/base.py +++ b/umap/tests/base.py @@ -81,7 +81,7 @@ class DataLayerFactory(factory.DjangoModelFactory): name = "test datalayer" description = "test description" display_on_load = True - geojson = factory.django.FileField(data="""{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[13.68896484375,48.55297816440071]},"properties":{"_storage_options":{"color":"DarkCyan","iconClass":"Ball"},"name":"Here","description":"Da place anonymous again 755"}}],"_storage":{"displayOnLoad":true,"name":"Donau","id":926}}""") # noqa + geojson = factory.django.FileField(data="""{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[13.68896484375,48.55297816440071]},"properties":{"_umap_options":{"color":"DarkCyan","iconClass":"Ball"},"name":"Here","description":"Da place anonymous again 755"}}],"_umap_options":{"displayOnLoad":true,"name":"Donau","id":926}}""") # noqa class Meta: model = DataLayer diff --git a/umap/tests/test_datalayer_views.py b/umap/tests/test_datalayer_views.py index 3727bc80..b3689115 100644 --- a/umap/tests/test_datalayer_views.py +++ b/umap/tests/test_datalayer_views.py @@ -17,7 +17,7 @@ def post_data(): "name": 'name', "display_on_load": True, "rank": 0, - "geojson": '{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-3.1640625,53.014783245859235],[-3.1640625,51.86292391360244],[-0.50537109375,51.385495069223204],[1.16455078125,52.38901106223456],[-0.41748046875,53.91728101547621],[-2.109375,53.85252660044951],[-3.1640625,53.014783245859235]]]},"properties":{"_storage_options":{},"name":"Ho god, sounds like a polygouine"}},{"type":"Feature","geometry":{"type":"LineString","coordinates":[[1.8017578124999998,51.16556659836182],[-0.48339843749999994,49.710272582105695],[-3.1640625,50.0923932109388],[-5.60302734375,51.998410382390325]]},"properties":{"_storage_options":{},"name":"Light line"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[0.63720703125,51.15178610143037]},"properties":{"_storage_options":{},"name":"marker he"}}],"_storage":{"displayOnLoad":true,"name":"new name","id":1668,"remoteData":{},"color":"LightSeaGreen","description":"test"}}' # noqa + "geojson": '{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-3.1640625,53.014783245859235],[-3.1640625,51.86292391360244],[-0.50537109375,51.385495069223204],[1.16455078125,52.38901106223456],[-0.41748046875,53.91728101547621],[-2.109375,53.85252660044951],[-3.1640625,53.014783245859235]]]},"properties":{"_umap_options":{},"name":"Ho god, sounds like a polygouine"}},{"type":"Feature","geometry":{"type":"LineString","coordinates":[[1.8017578124999998,51.16556659836182],[-0.48339843749999994,49.710272582105695],[-3.1640625,50.0923932109388],[-5.60302734375,51.998410382390325]]},"properties":{"_umap_options":{},"name":"Light line"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[0.63720703125,51.15178610143037]},"properties":{"_umap_options":{},"name":"marker he"}}],"_umap_options":{"displayOnLoad":true,"name":"new name","id":1668,"remoteData":{},"color":"LightSeaGreen","description":"test"}}' # noqa } @@ -30,7 +30,7 @@ def test_get(client, settings, datalayer): assert response['Cache-Control'] is not None assert 'Content-Encoding' not in response j = json.loads(response.content.decode()) - assert '_storage' in j + assert '_umap_options' in j assert 'features' in j assert j['type'] == 'FeatureCollection' diff --git a/umap/views.py b/umap/views.py index 57dc7f09..d9f2843b 100644 --- a/umap/views.py +++ b/umap/views.py @@ -356,7 +356,7 @@ class MapDetailMixin(object): 'tilelayers': self.get_tilelayers(), 'allowEdit': self.is_edit_allowed(), 'default_iconUrl': "%sumap/img/marker.png" % settings.STATIC_URL, # noqa - 'storage_id': self.get_storage_id(), + 'umap_id': self.get_umap_id(), 'licences': dict((l.name, l.json) for l in Licence.objects.all()), } if self.get_short_url(): @@ -388,7 +388,7 @@ class MapDetailMixin(object): def is_edit_allowed(self): return True - def get_storage_id(self): + def get_umap_id(self): return None def get_geojson(self): @@ -433,7 +433,7 @@ class MapView(MapDetailMixin, DetailView): def is_edit_allowed(self): return self.object.can_edit(self.request.user, self.request) - def get_storage_id(self): + def get_umap_id(self): return self.object.pk def get_short_url(self):