aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-12-22 04:45:45 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-12-22 04:45:45 +0200
commitf0be1d4485228edbe096dde4fa82a5d5ab1f5176 (patch)
tree09b166f04c41df26d3ffbf3970773a64251fdec4
parent8dd45fe02ef44fae11bee385d6d226c471b99d26 (diff)
downloadarching-kaos-web-ui-f0be1d4485228edbe096dde4fa82a5d5ab1f5176.tar.gz
arching-kaos-web-ui-f0be1d4485228edbe096dde4fa82a5d5ab1f5176.tar.bz2
arching-kaos-web-ui-f0be1d4485228edbe096dde4fa82a5d5ab1f5176.zip
New utility function to offer data for downloading
-rw-r--r--src/css/akn.css1
-rw-r--r--src/js/utils.js9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/css/akn.css b/src/css/akn.css
index e034628..a3e2da1 100644
--- a/src/css/akn.css
+++ b/src/css/akn.css
@@ -204,6 +204,7 @@ select {
}
article {
+ font-family: monospace;
border: none;
border-radius: 40px;
border-left: 2px dashed #672178;
diff --git a/src/js/utils.js b/src/js/utils.js
index 74f3cfa..a952328 100644
--- a/src/js/utils.js
+++ b/src/js/utils.js
@@ -26,4 +26,13 @@ export function debugLog(message)
{
if (showDebug) console.log(message);
}
+
+export function offerDownloadableData(data)
+{
+ var link = document.createElement('a');
+ link.download = 'data';
+ var blob = new Blob([data]); // , {type: 'text/plain'}
+ link.href = window.URL.createObjectURL(blob);
+ link.click();
+}
// @license-end