mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
chore: remove unused imports from global.js
This commit is contained in:
parent
b49f3d7633
commit
51e41b7bce
5 changed files with 12 additions and 59 deletions
|
@ -1,37 +1,13 @@
|
||||||
import {
|
import { uMapAlert as Alert } from '../components/alerts/alert.js'
|
||||||
uMapAlert as Alert,
|
import { AjaxAutocomplete, AjaxAutocompleteMultiple } from './autocomplete.js'
|
||||||
uMapAlertCreation as AlertCreation,
|
|
||||||
} from '../components/alerts/alert.js'
|
|
||||||
import {
|
|
||||||
AjaxAutocomplete,
|
|
||||||
AjaxAutocompleteMultiple,
|
|
||||||
AutocompleteDatalist,
|
|
||||||
} from './autocomplete.js'
|
|
||||||
import Browser from './browser.js'
|
|
||||||
import Caption from './caption.js'
|
|
||||||
import ContextMenu from './ui/contextmenu.js'
|
|
||||||
import Facets from './facets.js'
|
|
||||||
import { Formatter } from './formatter.js'
|
|
||||||
import Help from './help.js'
|
import Help from './help.js'
|
||||||
import Importer from './importer.js'
|
import { ServerRequest } from './request.js'
|
||||||
import Orderable from './orderable.js'
|
|
||||||
import { HTTPError, NOKError, Request, RequestError, ServerRequest } from './request.js'
|
|
||||||
import Rules from './rules.js'
|
|
||||||
import { SCHEMA } from './schema.js'
|
import { SCHEMA } from './schema.js'
|
||||||
import Share from './share.js'
|
|
||||||
import Slideshow from './slideshow.js'
|
|
||||||
import { SyncEngine } from './sync/engine.js'
|
|
||||||
import Dialog from './ui/dialog.js'
|
|
||||||
import { EditPanel, FullPanel, Panel } from './ui/panel.js'
|
|
||||||
import Tooltip from './ui/tooltip.js'
|
|
||||||
import URLs from './urls.js'
|
|
||||||
import * as Utils from './utils.js'
|
import * as Utils from './utils.js'
|
||||||
import * as Icon from './rendering/icon.js'
|
import * as Icon from './rendering/icon.js'
|
||||||
import { DataLayer, LAYER_TYPES } from './data/layer.js'
|
import { LAYER_TYPES } from './data/layer.js'
|
||||||
import { DataLayerPermissions, MapPermissions } from './permissions.js'
|
|
||||||
import { Point, LineString, Polygon } from './data/features.js'
|
import { Point, LineString, Polygon } from './data/features.js'
|
||||||
import { LeafletMarker, LeafletPolyline, LeafletPolygon } from './rendering/ui.js'
|
import { LeafletMarker, LeafletPolyline, LeafletPolygon } from './rendering/ui.js'
|
||||||
import * as SAVEMANAGER from './saving.js'
|
|
||||||
|
|
||||||
// Import modules and export them to the global scope.
|
// Import modules and export them to the global scope.
|
||||||
// For the not yet module-compatible JS out there.
|
// For the not yet module-compatible JS out there.
|
||||||
|
@ -39,45 +15,18 @@ import * as SAVEMANAGER from './saving.js'
|
||||||
// By alphabetic order
|
// By alphabetic order
|
||||||
window.U = {
|
window.U = {
|
||||||
Alert,
|
Alert,
|
||||||
AlertCreation,
|
|
||||||
AjaxAutocomplete,
|
AjaxAutocomplete,
|
||||||
AjaxAutocompleteMultiple,
|
AjaxAutocompleteMultiple,
|
||||||
AutocompleteDatalist,
|
|
||||||
Browser,
|
|
||||||
Caption,
|
|
||||||
ContextMenu,
|
|
||||||
DataLayer,
|
|
||||||
DataLayerPermissions,
|
|
||||||
Dialog,
|
|
||||||
EditPanel,
|
|
||||||
Facets,
|
|
||||||
Formatter,
|
|
||||||
FullPanel,
|
|
||||||
Help,
|
Help,
|
||||||
HTTPError,
|
|
||||||
Icon,
|
Icon,
|
||||||
Importer,
|
|
||||||
LAYER_TYPES,
|
LAYER_TYPES,
|
||||||
LeafletMarker,
|
LeafletMarker,
|
||||||
LeafletPolygon,
|
LeafletPolygon,
|
||||||
LeafletPolyline,
|
LeafletPolyline,
|
||||||
LineString,
|
LineString,
|
||||||
MapPermissions,
|
|
||||||
NOKError,
|
|
||||||
Orderable,
|
|
||||||
Panel,
|
|
||||||
Point,
|
Point,
|
||||||
Polygon,
|
Polygon,
|
||||||
Request,
|
|
||||||
RequestError,
|
|
||||||
Rules,
|
|
||||||
SAVEMANAGER,
|
|
||||||
SCHEMA,
|
SCHEMA,
|
||||||
ServerRequest,
|
ServerRequest,
|
||||||
Share,
|
|
||||||
Slideshow,
|
|
||||||
SyncEngine,
|
|
||||||
Tooltip,
|
|
||||||
URLs,
|
|
||||||
Utils,
|
Utils,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { DomEvent, DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomEvent, DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { translate } from './i18n.js'
|
import { translate } from './i18n.js'
|
||||||
import * as Utils from './utils.js'
|
import * as Utils from './utils.js'
|
||||||
|
import Dialog from './ui/dialog.js'
|
||||||
|
|
||||||
const SHORTCUTS = {
|
const SHORTCUTS = {
|
||||||
DRAW_MARKER: {
|
DRAW_MARKER: {
|
||||||
|
@ -166,7 +167,7 @@ const ENTRIES = {
|
||||||
export default class Help {
|
export default class Help {
|
||||||
constructor(umap) {
|
constructor(umap) {
|
||||||
this.umap = umap
|
this.umap = umap
|
||||||
this.dialog = new U.Dialog({ className: 'dark', accept: false, cancel: false })
|
this.dialog = new Dialog({ className: 'dark', accept: false, cancel: false })
|
||||||
this.isMacOS = /mac/i.test(
|
this.isMacOS = /mac/i.test(
|
||||||
// eslint-disable-next-line compat/compat -- Fallback available.
|
// eslint-disable-next-line compat/compat -- Fallback available.
|
||||||
navigator.userAgentData ? navigator.userAgentData.platform : navigator.platform
|
navigator.userAgentData ? navigator.userAgentData.platform : navigator.platform
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { translate } from '../i18n.js'
|
||||||
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
||||||
import * as Utils from '../utils.js'
|
import * as Utils from '../utils.js'
|
||||||
import * as Icon from './icon.js'
|
import * as Icon from './icon.js'
|
||||||
|
import ContextMenu from '../ui/contextmenu.js'
|
||||||
|
|
||||||
// Those options are not saved on the server, so they can live here
|
// Those options are not saved on the server, so they can live here
|
||||||
// instead of in umap.properties
|
// instead of in umap.properties
|
||||||
|
@ -203,7 +204,7 @@ const ControlsMixin = {
|
||||||
</button>
|
</button>
|
||||||
`)
|
`)
|
||||||
rightContainer.appendChild(button)
|
rightContainer.appendChild(button)
|
||||||
const menu = new U.ContextMenu({ className: 'dark', fixed: true })
|
const menu = new ContextMenu({ className: 'dark', fixed: true })
|
||||||
const actions = [
|
const actions = [
|
||||||
{
|
{
|
||||||
label: translate('New map'),
|
label: translate('New map'),
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { DomEvent, DomUtil, stamp } from '../../vendors/leaflet/leaflet-src.esm.
|
||||||
import { translate } from './i18n.js'
|
import { translate } from './i18n.js'
|
||||||
import * as Utils from './utils.js'
|
import * as Utils from './utils.js'
|
||||||
import { AutocompleteDatalist } from './autocomplete.js'
|
import { AutocompleteDatalist } from './autocomplete.js'
|
||||||
|
import Orderable from './orderable.js'
|
||||||
|
|
||||||
const EMPTY_VALUES = ['', undefined, null]
|
const EMPTY_VALUES = ['', undefined, null]
|
||||||
|
|
||||||
|
@ -236,7 +237,7 @@ export default class Rules {
|
||||||
rule.renderToolbox(DomUtil.create('li', 'orderable', ul))
|
rule.renderToolbox(DomUtil.create('li', 'orderable', ul))
|
||||||
}
|
}
|
||||||
|
|
||||||
const orderable = new U.Orderable(ul, this.onReorder.bind(this))
|
const orderable = new Orderable(ul, this.onReorder.bind(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
DomUtil.createButton('umap-add', body, translate('Add rule'), this.addRule, this)
|
DomUtil.createButton('umap-add', body, translate('Add rule'), this.addRule, this)
|
||||||
|
|
|
@ -32,6 +32,7 @@ import {
|
||||||
uMapAlertCreation as AlertCreation,
|
uMapAlertCreation as AlertCreation,
|
||||||
uMapAlert as Alert,
|
uMapAlert as Alert,
|
||||||
} from '../components/alerts/alert.js'
|
} from '../components/alerts/alert.js'
|
||||||
|
import Orderable from './orderable.js'
|
||||||
|
|
||||||
export default class Umap extends ServerStored {
|
export default class Umap extends ServerStored {
|
||||||
constructor(element, geojson) {
|
constructor(element, geojson) {
|
||||||
|
@ -1382,7 +1383,7 @@ export default class Umap extends ServerStored {
|
||||||
})
|
})
|
||||||
this.indexDatalayers()
|
this.indexDatalayers()
|
||||||
}
|
}
|
||||||
const orderable = new U.Orderable(ul, onReorder)
|
const orderable = new Orderable(ul, onReorder)
|
||||||
|
|
||||||
const bar = DomUtil.create('div', 'button-bar', container)
|
const bar = DomUtil.create('div', 'button-bar', container)
|
||||||
DomUtil.createButton(
|
DomUtil.createButton(
|
||||||
|
|
Loading…
Reference in a new issue