Add a download button, improve share functionality for custom themes

This commit is contained in:
Pieter Vander Vennet 2022-04-18 02:39:30 +02:00
parent 303ccfa322
commit 6ad64e3f70
10 changed files with 64 additions and 40 deletions

View file

@ -756,7 +756,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
* Triggers a 'download file' popup which will download the contents
*/
public static offerContentsAsDownloadableFile(contents: string | Blob, fileName: string = "download.txt",
options?: { mimetype: string | "text/plain" | "text/csv" | "application/vnd.geo+json" | "{gpx=application/gpx+xml}" }) {
options?: { mimetype: string | "text/plain" | "text/csv" | "application/vnd.geo+json" | "{gpx=application/gpx+xml}" | "application/json" }) {
const element = document.createElement("a");
let file;
if (typeof (contents) === "string") {