diff --git a/app/client.imba b/app/client.imba index 86a9f25..bbf75b1 100644 --- a/app/client.imba +++ b/app/client.imba @@ -135,7 +135,7 @@ tag app loading_import = no def handle_click_export - download_json_file JSON.stringify(state.links) + download_json_file JSON.stringify(state.links), "fuzzyhome_" def handle_paste e return if state.query.length > 0 diff --git a/app/utils/download.imba b/app/utils/download.imba index 0c3a28d..c7250cb 100644 --- a/app/utils/download.imba +++ b/app/utils/download.imba @@ -4,10 +4,10 @@ def get_datetime_string let time = obj[4].split(":").join("-") "{date}_{time}" -export default def download_json_file data +export default def download_json_file data, prefix="" let element = document.createElement 'a' element.setAttribute 'href', 'data:text/plain;charset=utf-8,' + window.encodeURIComponent(data) - element.setAttribute 'download', "{get_datetime_string!}.json" + element.setAttribute 'download', "{prefix}{get_datetime_string!}.json" element.style.display = 'none' document.body.appendChild element element.click! diff --git a/package.json b/package.json index 088a80a..1ab8b6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fuzzyhome", - "version": "0.0.19", + "version": "0.0.20", "scripts": { "start": "imba run -SMH --baseurl . -w server.imba", "build-app": "imba build -SMH --baseurl . server.imba", diff --git a/sw.imba b/sw.imba index 0f6c6b0..2303799 100644 --- a/sw.imba +++ b/sw.imba @@ -1,7 +1,7 @@ let p = console.log const app_prefix = "fuzzyhome_cache" -const version = "0.0.19" +const version = "0.0.20" const cache_name = "{app_prefix}-{version}"