From af2905dc6d1cbbcfb2d9cd2583369eebd90ced70 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 16 Sep 2024 17:04:34 +0200 Subject: [PATCH] Feat: add download as json to 'allTags'-panel (for debugging) --- src/UI/Popup/AllTagsPanel.svelte | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/UI/Popup/AllTagsPanel.svelte b/src/UI/Popup/AllTagsPanel.svelte index 86238924f1..614e88bcf0 100644 --- a/src/UI/Popup/AllTagsPanel.svelte +++ b/src/UI/Popup/AllTagsPanel.svelte @@ -2,6 +2,7 @@ import { Store, UIEventSource } from "../../Logic/UIEventSource" import SimpleMetaTaggers from "../../Logic/SimpleMetaTagger" import LayerConfig from "../../Models/ThemeConfig/LayerConfig" + import { Utils } from "../../Utils" export let tags: UIEventSource> export let tagKeys = tags.map((tgs) => (tgs === undefined ? [] : Object.keys(tgs))) @@ -31,9 +32,18 @@ const metaKeys: string[] = [].concat(...SimpleMetaTaggers.metatags.map((k) => k.keys)) let allCalculatedTags = new Set([...calculatedTags, ...metaKeys]) + + function downloadAsJson(){ + Utils.offerContentsAsDownloadableFile( + JSON.stringify(tags.data, null, " "), "tags-"+(tags.data.id ?? layer?.id ?? "")+".json" + ) + }
+
Key