chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2025-03-17 02:54:12 +01:00
parent 92352ed274
commit 535e36a006
68 changed files with 2734 additions and 382 deletions

View file

@ -98,10 +98,10 @@ export default class ThemeConfig implements ThemeInformation {
public readonly enableCache: boolean
public readonly popups: Readonly<{
id: string,
dismissible?: boolean,
condition: TagsFilter,
title: TagRenderingConfig,
id: string
dismissible?: boolean
condition: TagsFilter
title: TagRenderingConfig
body: TagRenderingConfig[]
}>[]
@ -205,7 +205,7 @@ export default class ThemeConfig implements ThemeInformation {
icon: "./assets/svg/pop-out.svg",
href: "https://{basepath}/{theme}.html?lat={lat}&lon={lon}&z={zoom}&language={language}",
newTab: true,
requirements: ["iframe", "no-welcome-message"]
requirements: ["iframe", "no-welcome-message"],
},
context + ".extraLink"
)
@ -213,7 +213,7 @@ export default class ThemeConfig implements ThemeInformation {
this.popups = (json.popup ?? []).map((p, i) => {
const ctx = context + ".popup." + i
if (!p.id) {
throw (ctx + ": an id is required")
throw ctx + ": an id is required"
}
const body: TagRenderingConfigJson[] = Array.isArray(p.body) ? p.body : [p.body]
return {
@ -221,7 +221,7 @@ export default class ThemeConfig implements ThemeInformation {
dismissible: p.dismissible ?? false,
condition: TagUtils.Tag(p.condition),
title: new TagRenderingConfig(p.title, ctx + ".title"),
body: body.map((body, i) => new TagRenderingConfig(body, ctx + ".body." + i))
body: body.map((body, i) => new TagRenderingConfig(body, ctx + ".body." + i)),
}
})
@ -378,7 +378,7 @@ export default class ThemeConfig implements ThemeInformation {
// The 'favourite'-layer contains pretty much all images as it bundles all layers, so we exclude it
const jsonNoFavourites = {
...json,
layers: json.layers.filter((l) => l["id"] !== "favourite")
layers: json.layers.filter((l) => l["id"] !== "favourite"),
}
const usedImages = jsonNoFavourites._usedImages
usedImages.sort()