Chore: housekeeping

This commit is contained in:
Pieter Vander Vennet 2023-07-28 01:02:31 +02:00
parent 89027ed516
commit 7d51c94e1f
21 changed files with 622 additions and 427 deletions

View file

@ -15,6 +15,7 @@ Fallback layer with items on which climbing _might_ be possible. It is loaded wh
- This layer is shown at zoomlevel **19** and higher - This layer is shown at zoomlevel **19** and higher
- This layer is needed as dependency for layer [climbing_route](#climbing_route)

View file

@ -15,6 +15,7 @@ A single climbing route and its properties. Some properties are derived from the
- This layer is shown at zoomlevel **18** and higher - This layer is shown at zoomlevel **18** and higher
- This layer will automatically load [climbing_opportunity](./climbing_opportunity.md) into the layout as it depends on it: a preset snaps to this layer (presets[0])
- This layer is needed as dependency for layer [climbing_area](#climbing_area) - This layer is needed as dependency for layer [climbing_area](#climbing_area)

View file

@ -26,6 +26,7 @@ Available languages:
- en - en
- de
This document is autogenerated from [assets/themes/elongated_coin/elongated_coin.json](https://github.com/pietervdvn/MapComplete/blob/develop/assets/themes/elongated_coin/elongated_coin.json) This document is autogenerated from [assets/themes/elongated_coin/elongated_coin.json](https://github.com/pietervdvn/MapComplete/blob/develop/assets/themes/elongated_coin/elongated_coin.json)

View file

@ -27,6 +27,7 @@ Available languages:
- en - en
- nl - nl
- de
This document is autogenerated from [assets/themes/vending_machine/vending_machine.json](https://github.com/pietervdvn/MapComplete/blob/develop/assets/themes/vending_machine/vending_machine.json) This document is autogenerated from [assets/themes/vending_machine/vending_machine.json](https://github.com/pietervdvn/MapComplete/blob/develop/assets/themes/vending_machine/vending_machine.json)

View file

@ -247,7 +247,7 @@
{{service_item {{service_item
|name= [https://mapcomplete.osm.be/elongated_coin elongated_coin] |name= [https://mapcomplete.osm.be/elongated_coin elongated_coin]
|region= Worldwide |region= Worldwide
|lang= {{#language:en|en}} |lang= {{#language:en|en}}, {{#language:de|en}}
|descr= A MapComplete theme: Find penny presses to create your own elongated coins |descr= A MapComplete theme: Find penny presses to create your own elongated coins
|material= {{yes|[https://mapcomplete.osm.be/ Yes]}} |material= {{yes|[https://mapcomplete.osm.be/ Yes]}}
|image= MapComplete_Screenshot.png |image= MapComplete_Screenshot.png
@ -499,7 +499,7 @@
{{service_item {{service_item
|name= [https://mapcomplete.osm.be/vending_machine vending_machine] |name= [https://mapcomplete.osm.be/vending_machine vending_machine]
|region= Worldwide |region= Worldwide
|lang= {{#language:en|en}}, {{#language:nl|en}} |lang= {{#language:en|en}}, {{#language:nl|en}}, {{#language:de|en}}
|descr= A MapComplete theme: Find vending machines for everything |descr= A MapComplete theme: Find vending machines for everything
|material= {{yes|[https://mapcomplete.osm.be/ Yes]}} |material= {{yes|[https://mapcomplete.osm.be/ Yes]}}
|image= MapComplete_Screenshot.png |image= MapComplete_Screenshot.png

View file

@ -1,19 +1,13 @@
{ {
"id": "mapcomplete-changes", "id": "mapcomplete-changes",
"title": { "title": {
"en": "Changes made with MapComplete", "en": "Changes made with MapComplete"
"de": "Mit MapComplete erstellte Änderungen",
"nl": "Wijzigingen gemaakt met MapComplete"
}, },
"shortDescription": { "shortDescription": {
"en": "Show changes made with MapComplete", "en": "Shows changes made by MapComplete"
"de": "Mit MapComplete erstellte Änderungen anzeigen",
"nl": "Toon wijzigingen gemaakt met MapComplete"
}, },
"description": { "description": {
"en": "This maps shows all the changes made with MapComplete", "en": "This maps shows all the changes made with MapComplete"
"de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen",
"nl": "Deze kaart toont alle wijzigingen die met MapComplete gemaakt werden"
}, },
"icon": "./assets/svg/logo.svg", "icon": "./assets/svg/logo.svg",
"hideFromOverview": true, "hideFromOverview": true,
@ -26,9 +20,7 @@
{ {
"id": "mapcomplete-changes", "id": "mapcomplete-changes",
"name": { "name": {
"en": "Changeset centers", "en": "Changeset centers"
"de": "Zentrum der Änderungssätze",
"nl": "Centerpunt van changeset"
}, },
"minzoom": 0, "minzoom": 0,
"source": { "source": {
@ -39,51 +31,41 @@
}, },
"title": { "title": {
"render": { "render": {
"en": "Changeset for {theme}", "en": "Changeset for {theme}"
"de": "Änderungssatz für {theme}"
} }
}, },
"description": { "description": {
"en": "Show all MapComplete changes", "en": "Shows all MapComplete changes"
"de": "Alle MapComplete-Änderungen anzeigen",
"nl": "Toon alle MapComplete wijzigingen"
}, },
"tagRenderings": [ "tagRenderings": [
{ {
"id": "show_changeset_id", "id": "show_changeset_id",
"render": { "render": {
"en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>", "en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
"de": "Änderungssatz <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
} }
}, },
{ {
"id": "contributor", "id": "contributor",
"question": { "question": {
"en": "Which contributor made this change?", "en": "What contributor did make this change?"
"de": "Welcher Mitwirkende hat diese Änderung vorgenommen?",
"nl": "Welke bijdrager maakte deze wijziging?"
}, },
"freeform": { "freeform": {
"key": "user" "key": "user"
}, },
"render": { "render": {
"en": "Change made by <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>", "en": "Change made by <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>"
"de": "Änderung gemacht von <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>",
"nl": "Wijziging gemaakt door <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>"
} }
}, },
{ {
"id": "theme-id", "id": "theme-id",
"question": { "question": {
"en": "What theme was used to make this change?", "en": "What theme was used to make this change?"
"de": "Welches Thema wurde für diese Änderung verwendet?"
}, },
"freeform": { "freeform": {
"key": "theme" "key": "theme"
}, },
"render": { "render": {
"en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>", "en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
"de": "Geändert mit Thema <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
} }
}, },
{ {
@ -92,27 +74,19 @@
"key": "locale" "key": "locale"
}, },
"question": { "question": {
"en": "What locale (language) was this change made in?", "en": "What locale (language) was this change made in?"
"de": "In welcher Sprache wurde diese Änderung vorgenommen?",
"nl": "In welke locale (taal) werd deze wijziging gemaakt?"
}, },
"render": { "render": {
"en": "User locale is {locale}", "en": "User locale is {locale}"
"de": "Usersprache ist {locale}",
"nl": "De gebruikerstaal is {locale}"
} }
}, },
{ {
"id": "host", "id": "host",
"render": { "render": {
"en": "Change made with <a href='{host}'>{host}</a>", "en": "Change with with <a href='{host}'>{host}</a>"
"de": "Änderung vorgenommen mit <a href='{host}'>{host}</a>",
"nl": "Wijziging gemaakt met <a href='{host}'>{host}</a>"
}, },
"question": { "question": {
"en": "What host (website) was this change made with?", "en": "What host (website) was this change made with?"
"de": "Mit welchem Host / welcher Website wurde diese Änderung gemacht?",
"nl": "Met welke host (website) werd deze wijziging gemaakt?"
}, },
"freeform": { "freeform": {
"key": "host" "key": "host"
@ -133,12 +107,10 @@
{ {
"id": "version", "id": "version",
"question": { "question": {
"en": "What version of MapComplete was used to make this change?", "en": "What version of MapComplete was used to make this change?"
"de": "Mit welcher Version von MapComplete wurde diese Änderung gemacht?"
}, },
"render": { "render": {
"en": "Made with {editor}", "en": "Made with {editor}"
"de": "Erstellt mit {editor}"
}, },
"freeform": { "freeform": {
"key": "editor" "key": "editor"
@ -480,9 +452,7 @@
} }
], ],
"question": { "question": {
"en": "Theme name contains {search}", "en": "Themename contains {search}"
"de": "Themenname enthält {search}",
"nl": "Themenaam bevat {search}"
} }
} }
] ]
@ -498,9 +468,7 @@
} }
], ],
"question": { "question": {
"en": "Made by contributor {search}", "en": "Made by contributor {search}"
"de": "Erstellt von {search}",
"nl": "Gemaakt door bijdrager {search}"
} }
} }
] ]
@ -516,9 +484,7 @@
} }
], ],
"question": { "question": {
"en": "<b>Not</b> made by contributor {search}", "en": "<b>Not</b> made by contributor {search}"
"de": "<b>Nicht</b> erstellt von {search}",
"nl": "<b>Niet</b> gemaakt door bijdrager {search}"
} }
} }
] ]
@ -535,9 +501,7 @@
} }
], ],
"question": { "question": {
"en": "Made before {search}", "en": "Made before {search}"
"de": "Erstellt vor {search}",
"nl": "Gemaakt voor {search}"
} }
} }
] ]
@ -554,9 +518,7 @@
} }
], ],
"question": { "question": {
"en": "Made after {search}", "en": "Made after {search}"
"de": "Erstellt nach {search}",
"nl": "Gemaakt na {search}"
} }
} }
] ]
@ -572,9 +534,7 @@
} }
], ],
"question": { "question": {
"en": "User language (iso-code) {search}", "en": "User language (iso-code) {search}"
"de": "Benutzersprache (ISO-Code) {search}",
"nl": "De taal van de bijdrager is {search}"
} }
} }
] ]
@ -590,9 +550,7 @@
} }
], ],
"question": { "question": {
"en": "Made with host {search}", "en": "Made with host {search}"
"de": "Erstellt mit Host {search}",
"nl": "Gemaakt met host {search}"
} }
} }
] ]
@ -603,9 +561,7 @@
{ {
"osmTags": "add-image>0", "osmTags": "add-image>0",
"question": { "question": {
"en": "Changeset added at least one image", "en": "Changeset added at least one image"
"de": "Changeset fügte mindestens ein Bild hinzu",
"nl": "Changeset bevat minstens één afbeelding"
} }
} }
] ]
@ -620,8 +576,7 @@
{ {
"id": "link_to_more", "id": "link_to_more",
"render": { "render": {
"en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>", "en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>"
"de": "Mehr Statistiken gibt es <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a>"
} }
}, },
{ {

16
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "mapcomplete", "name": "mapcomplete",
"version": "0.31.0", "version": "0.31.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "mapcomplete", "name": "mapcomplete",
"version": "0.31.0", "version": "0.31.1",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"dependencies": { "dependencies": {
"@rgossiaux/svelte-headlessui": "^1.0.2", "@rgossiaux/svelte-headlessui": "^1.0.2",
@ -4511,9 +4511,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001516", "version": "1.0.30001517",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001516.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz",
"integrity": "sha512-Wmec9pCBY8CWbmI4HsjBeQLqDTqV91nFVR83DnZpYyRnPI1wePDsTg0bGLPC5VU/3OIZV1fmxEea1b+tFKe86g==", "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -15736,9 +15736,9 @@
"integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==" "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA=="
}, },
"caniuse-lite": { "caniuse-lite": {
"version": "1.0.30001516", "version": "1.0.30001517",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001516.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz",
"integrity": "sha512-Wmec9pCBY8CWbmI4HsjBeQLqDTqV91nFVR83DnZpYyRnPI1wePDsTg0bGLPC5VU/3OIZV1fmxEea1b+tFKe86g==", "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==",
"dev": true "dev": true
}, },
"canvg": { "canvg": {

View file

@ -1,14 +1,14 @@
import {Store, UIEventSource} from "../Logic/UIEventSource" import { Store, UIEventSource } from "../Logic/UIEventSource"
import LayerConfig from "./ThemeConfig/LayerConfig" import LayerConfig from "./ThemeConfig/LayerConfig"
import {OsmConnection} from "../Logic/Osm/OsmConnection" import { OsmConnection } from "../Logic/Osm/OsmConnection"
import {LocalStorageSource} from "../Logic/Web/LocalStorageSource" import { LocalStorageSource } from "../Logic/Web/LocalStorageSource"
import {QueryParameters} from "../Logic/Web/QueryParameters" import { QueryParameters } from "../Logic/Web/QueryParameters"
import {FilterConfigOption} from "./ThemeConfig/FilterConfig" import { FilterConfigOption } from "./ThemeConfig/FilterConfig"
import {TagsFilter} from "../Logic/Tags/TagsFilter" import { TagsFilter } from "../Logic/Tags/TagsFilter"
import {Utils} from "../Utils" import { Utils } from "../Utils"
import {TagUtils} from "../Logic/Tags/TagUtils" import { TagUtils } from "../Logic/Tags/TagUtils"
import {And} from "../Logic/Tags/And" import { And } from "../Logic/Tags/And"
import {GlobalFilter} from "./GlobalFilter" import { GlobalFilter } from "./GlobalFilter"
export default class FilteredLayer { export default class FilteredLayer {
/** /**

View file

@ -1,6 +1,6 @@
import BaseUIElement from "../BaseUIElement" import BaseUIElement from "../BaseUIElement"
import {InputElement} from "./InputElement" import { InputElement } from "./InputElement"
import {UIEventSource} from "../../Logic/UIEventSource" import { UIEventSource } from "../../Logic/UIEventSource"
/** /**
* @deprecated * @deprecated
@ -67,20 +67,18 @@ export default class FileSelectorButton extends InputElement<FileList> {
if (actualInputElement.files !== null) { if (actualInputElement.files !== null) {
self._value.setData(actualInputElement.files) self._value.setData(actualInputElement.files)
} }
actualInputElement.classList.remove("glowing-shadow"); actualInputElement.classList.remove("glowing-shadow")
e.preventDefault() e.preventDefault()
}) })
el.appendChild(actualInputElement) el.appendChild(actualInputElement)
function setDrawAttention(isOn: boolean){ function setDrawAttention(isOn: boolean) {
if(isOn){ if (isOn) {
label.classList.add("glowing-shadow") label.classList.add("glowing-shadow")
} else {
}else{
label.classList.remove("glowing-shadow") label.classList.remove("glowing-shadow")
} }
} }
@ -90,10 +88,9 @@ export default class FileSelectorButton extends InputElement<FileList> {
setDrawAttention(true) setDrawAttention(true)
// Style the drag-and-drop as a "copy file" operation. // Style the drag-and-drop as a "copy file" operation.
event.dataTransfer.dropEffect = "copy" event.dataTransfer.dropEffect = "copy"
}) })
window.document.addEventListener("dragenter", () =>{ window.document.addEventListener("dragenter", () => {
setDrawAttention(true) setDrawAttention(true)
}) })
@ -101,7 +98,6 @@ export default class FileSelectorButton extends InputElement<FileList> {
setDrawAttention(false) setDrawAttention(false)
}) })
el.addEventListener("drop", (event) => { el.addEventListener("drop", (event) => {
event.stopPropagation() event.stopPropagation()
event.preventDefault() event.preventDefault()

View file

@ -1,17 +1,16 @@
<script lang="ts"> <script lang="ts">
import {onDestroy, onMount} from "svelte" import { onDestroy, onMount } from "svelte"
import * as maplibre from "maplibre-gl" import * as maplibre from "maplibre-gl"
import type {Map} from "maplibre-gl" import type { Map } from "maplibre-gl"
import type {Readable, Writable} from "svelte/store" import type { Readable, Writable } from "svelte/store"
import {get, writable} from "svelte/store" import { get, writable } from "svelte/store"
import {AvailableRasterLayers} from "../../Models/RasterLayers" import { AvailableRasterLayers } from "../../Models/RasterLayers"
import {Utils} from "../../Utils"; import { Utils } from "../../Utils"
/** /**
* The 'MaplibreMap' maps various event sources onto MapLibre. * The 'MaplibreMap' maps various event sources onto MapLibre.
*/ */
/** /**
* Beware: this map will _only_ be set by this component * Beware: this map will _only_ be set by this component
* It should thus be treated as a 'store' by external parties * It should thus be treated as a 'store' by external parties
@ -20,24 +19,22 @@
let container: HTMLElement let container: HTMLElement
export let attribution = false export let attribution = false
export let center: {lng: number, lat: number} | Readable<{ lng: number; lat: number }> = writable({lng: 0, lat: 0}) export let center: { lng: number; lat: number } | Readable<{ lng: number; lat: number }> =
writable({ lng: 0, lat: 0 })
export let zoom: Readable<number> = writable(1) export let zoom: Readable<number> = writable(1)
const styleUrl = AvailableRasterLayers.maplibre.properties.url const styleUrl = AvailableRasterLayers.maplibre.properties.url
let _map: Map let _map: Map
onMount(() => { onMount(() => {
let _center: { lng: number; lat: number }
let _center: {lng: number, lat: number} if (typeof center["lng"] === "number" && typeof center["lat"] === "number") {
if(typeof center["lng"] === "number" && typeof center["lat"] === "number"){ _center = <any>center
_center = <any> center } else {
}else{ _center = get(<any>center)
_center = get(<any> center)
} }
_map = new maplibre.Map({ _map = new maplibre.Map({
container, container,
style: styleUrl, style: styleUrl,
@ -46,34 +43,31 @@
maxZoom: 24, maxZoom: 24,
interactive: true, interactive: true,
attributionControl: false, attributionControl: false,
})
});
_map.on("load", function () { _map.on("load", function () {
_map.resize() _map.resize()
}) })
map.set(_map) map.set(_map)
}) })
onDestroy(async () => { onDestroy(async () => {
await Utils.waitFor(250); await Utils.waitFor(250)
if (_map) _map.remove(); if (_map) _map.remove()
map = null; map = null
}); })
</script> </script>
<svelte:head> <svelte:head>
<link <link href="./maplibre-gl.css" rel="stylesheet" />
href="./maplibre-gl.css"
rel="stylesheet"
/>
</svelte:head> </svelte:head>
<div bind:this={container} class="map" id="map" style=" position: relative; <div
bind:this={container}
class="map"
id="map"
style=" position: relative;
top: 0; top: 0;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 100%;"></div> height: 100%;"
/>

View file

@ -161,13 +161,16 @@ class PointRenderingLayer {
}) })
} }
const marker = new Marker({ element: el}).setLngLat(loc).setOffset(iconAnchor).addTo(this._map) const marker = new Marker({ element: el })
.setLngLat(loc)
.setOffset(iconAnchor)
.addTo(this._map)
store store
.map((tags) => this._config.pitchAlignment.GetRenderValue(tags).Subs(tags).txt) .map((tags) => this._config.pitchAlignment.GetRenderValue(tags).Subs(tags).txt)
.addCallbackAndRun((pitchAligment) => marker.setPitchAlignment(<any> pitchAligment)) .addCallbackAndRun((pitchAligment) => marker.setPitchAlignment(<any>pitchAligment))
store store
.map((tags) => this._config.rotationAlignment.GetRenderValue(tags).Subs(tags).txt) .map((tags) => this._config.rotationAlignment.GetRenderValue(tags).Subs(tags).txt)
.addCallbackAndRun((pitchAligment) => marker.setRotationAlignment(<any> pitchAligment)) .addCallbackAndRun((pitchAligment) => marker.setRotationAlignment(<any>pitchAligment))
if (feature.geometry.type === "Point") { if (feature.geometry.type === "Point") {
// When the tags get 'pinged', check that the location didn't change // When the tags get 'pinged', check that the location didn't change
store.addCallbackAndRunD(() => { store.addCallbackAndRunD(() => {
@ -458,7 +461,6 @@ export default class ShowDataLayer {
features: FeatureSource, features: FeatureSource,
doShowLayer?: Store<boolean> doShowLayer?: Store<boolean>
): ShowDataLayer { ): ShowDataLayer {
return new ShowDataLayer(map, { return new ShowDataLayer(map, {
layer: ShowDataLayer.rangeLayer, layer: ShowDataLayer.rangeLayer,
features, features,

View file

@ -38,7 +38,7 @@
} }
</script> </script>
<div class="inline-flex flex-col w-full"> <div class="inline-flex w-full flex-col">
{#if inline} {#if inline}
<Inline key={config.freeform.key} {tags} template={config.render}> <Inline key={config.freeform.key} {tags} template={config.render}>
<ValidatedInput <ValidatedInput

View file

@ -413,7 +413,7 @@
<div class="flex" slot="title2"> <div class="flex" slot="title2">
<ToSvelte construct={Svg.community_svg().SetClass("w-6 h-6")} /> <ToSvelte construct={Svg.community_svg().SetClass("w-6 h-6")} />
<Tr t={Translations.t.communityIndex.title}/> <Tr t={Translations.t.communityIndex.title} />
</div> </div>
<div class="m-2" slot="content2"> <div class="m-2" slot="content2">
<CommunityIndexView location={state.mapProperties.location} /> <CommunityIndexView location={state.mapProperties.location} />

View file

@ -1,5 +1,5 @@
import colors from "./assets/colors.json" import colors from "./assets/colors.json"
import {HTMLElement} from "node-html-parser" import { HTMLElement } from "node-html-parser"
export class Utils { export class Utils {
/** /**
@ -459,7 +459,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
let match = txt.match(regex) let match = txt.match(regex)
if(!match){ if (!match) {
return txt return txt
} }
let result = "" let result = ""
@ -502,7 +502,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
result += normal + v result += normal + v
match = leftover.match(regex) match = leftover.match(regex)
if(!match){ if (!match) {
result += leftover result += leftover
} }
} }
@ -699,10 +699,10 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
if (Array.isArray(leaf)) { if (Array.isArray(leaf)) {
for (let i = 0; i < (<any[]>leaf).length; i++) { for (let i = 0; i < (<any[]>leaf).length; i++) {
const l = (<any[]>leaf)[i] const l = (<any[]>leaf)[i]
collectedList.push({leaf: l, path: [...travelledPath, "" + i]}) collectedList.push({ leaf: l, path: [...travelledPath, "" + i] })
} }
} else { } else {
collectedList.push({leaf, path: travelledPath}) collectedList.push({ leaf, path: travelledPath })
} }
return collectedList return collectedList
} }
@ -780,7 +780,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
}) })
} }
const cp = {...json} const cp = { ...json }
for (const key in json) { for (const key in json) {
cp[key] = Utils.WalkJson(json[key], f, isLeaf, [...path, key]) cp[key] = Utils.WalkJson(json[key], f, isLeaf, [...path, key])
} }
@ -910,11 +910,11 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
const xhr = new XMLHttpRequest() const xhr = new XMLHttpRequest()
xhr.onload = () => { xhr.onload = () => {
if (xhr.status == 200) { if (xhr.status == 200) {
resolve({content: xhr.response}) resolve({ content: xhr.response })
} else if (xhr.status === 302) { } else if (xhr.status === 302) {
resolve({redirect: xhr.getResponseHeader("location")}) resolve({ redirect: xhr.getResponseHeader("location") })
} else if (xhr.status === 509 || xhr.status === 429) { } else if (xhr.status === 509 || xhr.status === 429) {
resolve({error: "rate limited", url, statuscode: xhr.status}) resolve({ error: "rate limited", url, statuscode: xhr.status })
} else { } else {
resolve({ resolve({
error: "other error: " + xhr.statusText, error: "other error: " + xhr.statusText,
@ -987,7 +987,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
url, url,
headers headers
) )
Utils._download_cache.set(url, {promise, timestamp: new Date().getTime()}) Utils._download_cache.set(url, { promise, timestamp: new Date().getTime() })
return await promise return await promise
} }
@ -1006,11 +1006,11 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
const injected = Utils.injectedDownloads[url] const injected = Utils.injectedDownloads[url]
if (injected !== undefined) { if (injected !== undefined) {
console.log("Using injected resource for test for URL", url) console.log("Using injected resource for test for URL", url)
return new Promise((resolve, _) => resolve({content: injected})) return new Promise((resolve, _) => resolve({ content: injected }))
} }
const result = await Utils.downloadAdvanced( const result = await Utils.downloadAdvanced(
url, url,
Utils.Merge({accept: "application/json"}, headers ?? {}) Utils.Merge({ accept: "application/json" }, headers ?? {})
) )
if (result["error"] !== undefined) { if (result["error"] !== undefined) {
return <{ error: string; url: string; statuscode?: number }>result return <{ error: string; url: string; statuscode?: number }>result
@ -1018,12 +1018,12 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
const data = result["content"] const data = result["content"]
try { try {
if (typeof data === "string") { if (typeof data === "string") {
return {content: JSON.parse(data)} return { content: JSON.parse(data) }
} }
return {content: data} return { content: data }
} catch (e) { } catch (e) {
console.error("Could not parse ", data, "due to", e, "\n", e.stack) console.error("Could not parse ", data, "due to", e, "\n", e.stack)
return {error: "malformed", url} return { error: "malformed", url }
} }
} }
@ -1047,7 +1047,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
const element = document.createElement("a") const element = document.createElement("a")
let file let file
if (typeof contents === "string") { if (typeof contents === "string") {
file = new Blob([contents], {type: options?.mimetype ?? "text/plain"}) file = new Blob([contents], { type: options?.mimetype ?? "text/plain" })
} else { } else {
file = contents file = contents
} }
@ -1318,7 +1318,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
if (match == undefined) { if (match == undefined) {
return undefined return undefined
} }
return {r: Number(match[1]), g: Number(match[2]), b: Number(match[3])} return { r: Number(match[1]), g: Number(match[2]), b: Number(match[3]) }
} }
if (!hex.startsWith("#")) { if (!hex.startsWith("#")) {
@ -1378,7 +1378,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
if (inView) { if (inView) {
return return
} }
element.scrollIntoView({behavior: "smooth", block: "nearest"}) element.scrollIntoView({ behavior: "smooth", block: "nearest" })
} }
public static findParentWithScrolling(element: HTMLBaseElement): HTMLBaseElement { public static findParentWithScrolling(element: HTMLBaseElement): HTMLBaseElement {
@ -1470,12 +1470,12 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
const postParts = prepart.split("}") const postParts = prepart.split("}")
if (postParts.length === 1) { if (postParts.length === 1) {
// This was a normal part // This was a normal part
spec.push({message: postParts[0]}) spec.push({ message: postParts[0] })
} else { } else {
const [subs, message] = postParts const [subs, message] = postParts
spec.push({subs}) spec.push({ subs })
if (message !== "") { if (message !== "") {
spec.push({message}) spec.push({ message })
} }
} }
} }

View file

@ -1,11 +1,11 @@
{ {
"contributors": [ "contributors": [
{ {
"commits": 5753, "commits": 5819,
"contributor": "Pieter Vander Vennet" "contributor": "Pieter Vander Vennet"
}, },
{ {
"commits": 371, "commits": 384,
"contributor": "Robin van der Linde" "contributor": "Robin van der Linde"
}, },
{ {

View file

@ -10,7 +10,7 @@
"fr": "français", "fr": "français",
"gl": "lingua galega", "gl": "lingua galega",
"hu": "magyar", "hu": "magyar",
"id": "bahasa Indonesia", "id": "Bahasa Indonesia",
"it": "italiano", "it": "italiano",
"ja": "日本語", "ja": "日本語",
"nb_NO": "bokmål", "nb_NO": "bokmål",

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,11 @@
{ {
"contributors": [ "contributors": [
{ {
"commits": 283, "commits": 286,
"contributor": "kjon" "contributor": "kjon"
}, },
{ {
"commits": 275, "commits": 276,
"contributor": "Pieter Vander Vennet" "contributor": "Pieter Vander Vennet"
}, },
{ {
@ -53,7 +53,7 @@
"contributor": "Reza Almanda" "contributor": "Reza Almanda"
}, },
{ {
"commits": 23, "commits": 24,
"contributor": "Lucas" "contributor": "Lucas"
}, },
{ {
@ -204,6 +204,10 @@
"commits": 6, "commits": 6,
"contributor": "lvgx" "contributor": "lvgx"
}, },
{
"commits": 5,
"contributor": "deep map"
},
{ {
"commits": 5, "commits": 5,
"contributor": "Piotr Strebski" "contributor": "Piotr Strebski"
@ -272,6 +276,10 @@
"commits": 4, "commits": 4,
"contributor": "Jan Zabel" "contributor": "Jan Zabel"
}, },
{
"commits": 3,
"contributor": "Emory Shaw"
},
{ {
"commits": 3, "commits": 3,
"contributor": "Alexey Lutskyi" "contributor": "Alexey Lutskyi"
@ -328,10 +336,6 @@
"commits": 3, "commits": 3,
"contributor": "SiegbjornSitumeang" "contributor": "SiegbjornSitumeang"
}, },
{
"commits": 2,
"contributor": "Emory Shaw"
},
{ {
"commits": 2, "commits": 2,
"contributor": "lmagreault" "contributor": "lmagreault"
@ -440,10 +444,6 @@
"commits": 1, "commits": 1,
"contributor": "Stéphane De Greef" "contributor": "Stéphane De Greef"
}, },
{
"commits": 1,
"contributor": "deep map"
},
{ {
"commits": 1, "commits": 1,
"contributor": "Falk Rund" "contributor": "Falk Rund"