From 8df1f86ab9257d1acd87644d54bf51c704b445c1 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 9 Jun 2024 14:49:30 +0100 Subject: [PATCH] Remove the download modal I have not used this once since adding it. Just use the API directly. --- README.md | 1 - package-lock.json | 19 ---- package.json | 1 - src/App.vue | 4 +- src/components/AppHeader.vue | 15 ---- src/components/modals/DownloadModal.vue | 110 ------------------------ src/locales/cs-CZ.json | 2 - src/locales/da-DK.json | 2 - src/locales/de-DE.json | 2 - src/locales/en-GB.json | 2 - src/locales/en-US.json | 2 - src/locales/es-ES.json | 2 - src/locales/fr-FR.json | 2 - src/locales/sk-SK.json | 2 - src/locales/tr-TR.json | 2 - src/util.js | 18 ---- 16 files changed, 1 insertion(+), 185 deletions(-) delete mode 100644 src/components/modals/DownloadModal.vue diff --git a/README.md b/README.md index 6602526..34c9010 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ pages, this is a more advanced interface with more functionality, all in one pla - Display data in a specific date and time range - Filter by user or specific device - Calculation of distance travelled -- Download selected location data as JSON - Highly customisable ## Installation diff --git a/package-lock.json b/package-lock.json index 60ea0ba..f4984d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "2.12.0", "license": "MIT", "dependencies": { - "clipboard-copy": "^4.0.1", "deepmerge": "^4.3.1", "leaflet": "^1.9.4", "leaflet.heat": "^0.2.0", @@ -1573,24 +1572,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/clipboard-copy": { - "version": "4.0.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/color-convert": { "version": "2.0.1", "dev": true, diff --git a/package.json b/package.json index 243e1e1..e5bbcfb 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "test": "vitest run" }, "dependencies": { - "clipboard-copy": "^4.0.1", "deepmerge": "^4.3.1", "leaflet": "^1.9.4", "leaflet.heat": "^0.2.0", diff --git a/src/App.vue b/src/App.vue index ea1c2b3..93ee04b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,7 +4,6 @@
- @@ -16,12 +15,11 @@ import { mapActions } from "vuex"; import * as types from "@/store/mutation-types"; import { log } from "@/logging"; import AppHeader from "@/components/AppHeader.vue"; -import DownloadModal from "@/components/modals/DownloadModal.vue"; import InformationModal from "@/components/modals/InformationModal.vue"; import LoadingModal from "@/components/modals/LoadingModal.vue"; export default { - components: { AppHeader, DownloadModal, InformationModal, LoadingModal }, + components: { AppHeader, InformationModal, LoadingModal }, created() { document.documentElement.style.setProperty( "--color-primary", diff --git a/src/components/AppHeader.vue b/src/components/AppHeader.vue index ef7ab01..2f4d7dc 100644 --- a/src/components/AppHeader.vue +++ b/src/components/AppHeader.vue @@ -135,19 +135,6 @@ {{ humanReadableDistance(elevationLoss) }} - - - - - - - diff --git a/src/locales/cs-CZ.json b/src/locales/cs-CZ.json index f4beda5..641c624 100644 --- a/src/locales/cs-CZ.json +++ b/src/locales/cs-CZ.json @@ -12,7 +12,6 @@ "Select device": "Zvolit zařízení", "Distance travelled": "Procestovaná vzdálenost", "Elevation gain / loss": "Výškový výstup / pokles", - "Download raw data": "Stáhnout čisté údaje", "Information": "Informace", "Show last known locations": "Zobrazit naposledy známé polohy", "Show location history (line)": "Zobrazit historii poloh (čára)", @@ -20,7 +19,6 @@ "Show location heatmap": "Zobrazit tepelnou mapu poloh", "Minify JSON": "Zminimalizovat JSON", "Copy to clipboard": "Zkopírovat do schránky", - "Download": "Stáhnout", "Loading version...": "Nahrávám verzi...", "OwnTracks website": "Web Stránka OwnTracks", "OwnTracks documentation": "Dokumentace OwnTracks", diff --git a/src/locales/da-DK.json b/src/locales/da-DK.json index e0d26e1..e4b4398 100644 --- a/src/locales/da-DK.json +++ b/src/locales/da-DK.json @@ -12,7 +12,6 @@ "Select device": "Vælg enhed", "Distance travelled": "Afstand rejst", "Elevation gain / loss": "Højde vundet / tabt", - "Download raw data": "Download rå data", "Information": "Information", "Show last known locations": "Vis sidst kendte positioner", "Show location history (line)": "Vis positionshistorik (linje)", @@ -20,7 +19,6 @@ "Show location heatmap": "Vis positions-heatmap", "Minify JSON": "Minificér JSON", "Copy to clipboard": "Kopiér til udklipsholder", - "Download": "Download", "Loading version...": "Indlæser version...", "OwnTracks website": "OwnTracks hjemmeside", "OwnTracks documentation": "OwnTracks dokumentation", diff --git a/src/locales/de-DE.json b/src/locales/de-DE.json index 99cdcc3..1ee0e5e 100644 --- a/src/locales/de-DE.json +++ b/src/locales/de-DE.json @@ -12,7 +12,6 @@ "Select device": "Gerät auswählen", "Distance travelled": "Gereiste Entfernung", "Elevation gain / loss": "Höhengewinn / -verlust", - "Download raw data": "Rohdaten herunterladen", "Information": "Information", "Show last known locations": "Zeige letzte bekannte Standorte", "Show location history (line)": "Zeige Standortverlauf (Linie)", @@ -20,7 +19,6 @@ "Show location heatmap": "Zeige Standort-Heatmap", "Minify JSON": "JSON minimieren", "Copy to clipboard": "In die Zwischenablage kopieren", - "Download": "Herunterladen", "Loading version...": "Version wird abgerufen...", "OwnTracks website": "OwnTracks Webseite", "OwnTracks documentation": "OwnTracks Dokumentation", diff --git a/src/locales/en-GB.json b/src/locales/en-GB.json index 9ba78ed..687f9fd 100644 --- a/src/locales/en-GB.json +++ b/src/locales/en-GB.json @@ -12,7 +12,6 @@ "Select device": "Select device", "Distance travelled": "Distance travelled", "Elevation gain / loss": "Elevation gain / loss", - "Download raw data": "Download raw data", "Information": "Information", "Show last known locations": "Show last known locations", "Show location history (line)": "Show location history (line)", @@ -20,7 +19,6 @@ "Show location heatmap": "Show location heatmap", "Minify JSON": "Minify JSON", "Copy to clipboard": "Copy to clipboard", - "Download": "Download", "Loading version...": "Loading version...", "OwnTracks website": "OwnTracks website", "OwnTracks documentation": "OwnTracks documentation", diff --git a/src/locales/en-US.json b/src/locales/en-US.json index cbf5e6a..4b70111 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -12,7 +12,6 @@ "Select device": "Select device", "Distance travelled": "Distance traveled", "Elevation gain / loss": "Elevation gain / loss", - "Download raw data": "Download raw data", "Information": "Information", "Show last known locations": "Show last known locations", "Show location history (line)": "Show location history (line)", @@ -20,7 +19,6 @@ "Show location heatmap": "Show location heatmap", "Minify JSON": "Minify JSON", "Copy to clipboard": "Copy to clipboard", - "Download": "Download", "Loading version...": "Loading version...", "OwnTracks website": "OwnTracks website", "OwnTracks documentation": "OwnTracks documentation", diff --git a/src/locales/es-ES.json b/src/locales/es-ES.json index bf4b221..89cacfb 100644 --- a/src/locales/es-ES.json +++ b/src/locales/es-ES.json @@ -12,7 +12,6 @@ "Select device": "Seleccionar dispositivo", "Distance travelled": "Distancia recorrida", "Elevation gain / loss": "Aumento / disminución de la altura", - "Download raw data": "Descargar datos en crudo", "Information": "Información", "Show last known locations": "Mostrar última ubicación conocida", "Show location history (line)": "Mostrar historial (línea)", @@ -20,7 +19,6 @@ "Show location heatmap": "Mostra mapa de calor", "Minify JSON": "Reducir JSON", "Copy to clipboard": "Copiar al portapapeles", - "Download": "Descarga", "Loading version...": "Cargando versión...", "OwnTracks website": "OwnTracks - Sitio web", "OwnTracks documentation": "OwnTracks - documentación", diff --git a/src/locales/fr-FR.json b/src/locales/fr-FR.json index 155a91c..44e9746 100644 --- a/src/locales/fr-FR.json +++ b/src/locales/fr-FR.json @@ -12,7 +12,6 @@ "Select device": "Sélectionner un appareil", "Distance travelled": "Distance parcourue", "Elevation gain / loss": "Augmentation / diminution de l'altitude", - "Download raw data": "Télécharger les données brutes", "Information": "Informations", "Show last known locations": "Afficher les dernières localisations connues", "Show location history (line)": "Afficher l'historique de localisation (lignes)", @@ -20,7 +19,6 @@ "Show location heatmap": "Afficher la carte de fréquentation", "Minify JSON": "Minifier JSON", "Copy to clipboard": "Copier dans le presse-papier", - "Download": "Télécharger", "Loading version...": "Chargement de la version...", "OwnTracks website": "Site d'OwnTracks", "OwnTracks documentation": "Documentation d'OwnTracks", diff --git a/src/locales/sk-SK.json b/src/locales/sk-SK.json index e6f0aac..b6ae42c 100644 --- a/src/locales/sk-SK.json +++ b/src/locales/sk-SK.json @@ -12,7 +12,6 @@ "Select device": "Zvoliť zariadenie", "Distance travelled": "Prejdená vzdialenosť", "Elevation gain / loss": "Výškový výstup / pokles", - "Download raw data": "Stiahnuť surové údaje", "Information": "Informácie", "Show last known locations": "Zobraziť posledné známe polohy", "Show location history (line)": "Zobraziť históriu polôh (čiara)", @@ -20,7 +19,6 @@ "Show location heatmap": "Zobraziť tepelnú mapu polôh", "Minify JSON": "Zostručniť JSON", "Copy to clipboard": "Skopírovať do schránky", - "Download": "Stiahnuť", "Loading version...": "Nahrávam verziu...", "OwnTracks website": "Web Stránka OwnTracks", "OwnTracks documentation": "Dokumentácia OwnTracks", diff --git a/src/locales/tr-TR.json b/src/locales/tr-TR.json index bff1873..5181c98 100644 --- a/src/locales/tr-TR.json +++ b/src/locales/tr-TR.json @@ -12,7 +12,6 @@ "Select device": "Cihaz Seç", "Distance travelled": "Gidilen mesafe", "Elevation gain / loss": "Yükseklik kazancı / kaybı", - "Download raw data": "Ham verileri indir", "Information": "Bilgi", "Show last known locations": "Bilinen son yerleri göster", "Show location history (line)": "Konum geçmişini göster (çizgi)", @@ -20,7 +19,6 @@ "Show location heatmap": "Konum ısı haritasını göster", "Minify JSON": "JSON'u Küçült", "Copy to clipboard": "Panoya kopyala", - "Download": "İndir", "Loading version...": "Versiyon yükleniyor...", "OwnTracks website": "OwnTracks internet sitesi", "OwnTracks documentation": "OwnTracks dokümanı", diff --git a/src/util.js b/src/util.js index 4f85963..c92af42 100644 --- a/src/util.js +++ b/src/util.js @@ -64,24 +64,6 @@ export const distanceBetweenCoordinates = (c1, c2) => { return d; }; -/** - * Let the user download a string as file. - * - * @param {String} text Content of the file - * @param {String} filename Suggested filename for the browser - * @param {String} [mimeType] Content mime type - */ -export const download = (text, filename, mimeType = "text/plain") => { - const dataUrl = `data:${mimeType},${encodeURIComponent(text)}`; - const element = document.createElement("a"); - element.href = dataUrl; - element.download = filename; - element.style.display = "none"; - document.body.appendChild(element); - element.click(); - document.body.removeChild(element); -}; - /** * Format a distance in meters into a human-readable string with unit. *