improved the info message. see #65

This commit is contained in:
mic 2024-07-16 00:21:41 +02:00
parent 8b0c997938
commit 7fdc88a283
3 changed files with 13 additions and 3 deletions

View file

@ -55,6 +55,14 @@
"message": "The default prompts are not editable. You can disable them, then copy the prompt text and paste it into a new one to create a modified version.",
"description": ""
},
"customPrompts_managePrompts_info_default_2": {
"message": "You can import and export the prompts. Existing prompts with the same ID will be overwritten. Prompts with new IDs will be added.",
"description": ""
},
"customPrompts_managePrompts_info_default_3": {
"message": "If everything is correct after the import, click on the 'Save All' button.",
"description": ""
},
"customPrompts_start_saving": {
"message": "Saving prompts...",
"description": ""
@ -352,7 +360,7 @@
"description": ""
},
"importPrompts_confirmText": {
"message": "You are about to import new prompts. Existing prompts with the same ID will be overwritten. Prompts with new IDs will be added. If everything is correct after the import, click on the 'Save All' button.",
"message": "You are about to import new prompts.",
"description": ""
},
"customPrompts_start_import": {

View file

@ -8,7 +8,9 @@
<body>
<div>
<h1>__MSG_customPrompts_managePrompts__</h1>
<p>__MSG_customPrompts_managePrompts_info_default__
<p>__MSG_customPrompts_managePrompts_info_default__<br>
__MSG_customPrompts_managePrompts_info_default_2__<br>
__MSG_customPrompts_managePrompts_info_default_3__
<br><a href="https://micz.it/thunderbird-addon-thunderai/custom-prompts/">__MSG_customPrompts_managePrompts_help__</a></p>
</div>
<div id="import_export">

View file

@ -320,7 +320,7 @@ document.addEventListener('DOMContentLoaded', async () => {
});
function importPrompts() {
if(confirm(browser.i18n.getMessage("importPrompts_confirmText"))) {
if(confirm(browser.i18n.getMessage("importPrompts_confirmText") + '\n' + browser.i18n.getMessage("customPrompts_managePrompts_info_default_2") + '\n' + browser.i18n.getMessage("customPrompts_managePrompts_info_default_3"))) {
//ask the user to choose a JSON file, and then read it, check if the serialized JSON is valid as generated from exportPrompts(), and if so, add it to the list
const input = document.createElement('input');
input.type = 'file';