From d3e6a7d65eb8fe28aae1a0b188d107cce9e6ee00 Mon Sep 17 00:00:00 2001 From: mic Date: Sun, 14 Jul 2024 19:04:18 +0200 Subject: [PATCH] import export buttons added. see #65 --- customprompts/mzta-custom-prompts.css | 6 ++++++ customprompts/mzta-custom-prompts.html | 4 ++++ customprompts/mzta-custom-prompts.js | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/customprompts/mzta-custom-prompts.css b/customprompts/mzta-custom-prompts.css index fd043b48..5050f446 100644 --- a/customprompts/mzta-custom-prompts.css +++ b/customprompts/mzta-custom-prompts.css @@ -169,4 +169,10 @@ table .sort.desc { #txtIdNew, .id_output{ text-transform: lowercase; +} + +#import_export{ + position: absolute; + right:10px; + top:10px; } \ No newline at end of file diff --git a/customprompts/mzta-custom-prompts.html b/customprompts/mzta-custom-prompts.html index 60898e93..6a9a8560 100644 --- a/customprompts/mzta-custom-prompts.html +++ b/customprompts/mzta-custom-prompts.html @@ -11,6 +11,10 @@

__MSG_customPrompts_managePrompts_info_default__
__MSG_customPrompts_managePrompts_help__

+
+
+ +
diff --git a/customprompts/mzta-custom-prompts.js b/customprompts/mzta-custom-prompts.js index d1a2fa5c..556645ba 100644 --- a/customprompts/mzta-custom-prompts.js +++ b/customprompts/mzta-custom-prompts.js @@ -367,6 +367,28 @@ document.addEventListener('DOMContentLoaded', async () => { }); }); + //Import Export + + const btnExportAll = document.getElementById('btnExportAll'); + btnExportAll.addEventListener('click', (e) => { + e.preventDefault(); + exportPrompts(); + }); + + function exportPrompts() { + alert("test export all"); + } + + const btnImport = document.getElementById('btnImport'); + btnImport.addEventListener('click', (e) => { + e.preventDefault(); + importPrompts(); + }); + + function importPrompts() { + alert("test import"); + } + }, { once: true });