From eb3dbc2c73fee7cb17273fbc77ffafd74697e80f Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 4 Feb 2025 21:52:10 +0100 Subject: [PATCH] add_tags_auto_only_inbox option added. see #237 --- _locales/en/messages.json | 8 ++++++++ options/mzta-options-default.js | 1 + pages/addtags/mzta-add-tags.css | 2 +- pages/addtags/mzta-add-tags.html | 9 +++++++++ pages/addtags/mzta-add-tags.js | 6 +++--- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index a801908c..ff26dcf3 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1034,5 +1034,13 @@ "prefs_OptionText_add_tags_auto_force_existing_Info": { "message": "If checked, the AI will add only existing tags to newly received emails, and won't create new tags.", "description": "" + }, + "prefs_OptionText_add_tags_auto_only_inbox": { + "message": "Only add tags to inbox emails", + "description": "" + }, + "prefs_OptionText_add_tags_auto_only_inbox_Info": { + "message": "If checked, the AI will only add tags to emails received in the inbox folder.", + "description": "" } } \ No newline at end of file diff --git a/options/mzta-options-default.js b/options/mzta-options-default.js index 6c804352..49724479 100644 --- a/options/mzta-options-default.js +++ b/options/mzta-options-default.js @@ -48,5 +48,6 @@ export const prefs_default = { add_tags_force_lang: true, add_tags_auto: false, add_tags_auto_force_existing: false, + add_tags_auto_only_inbox: true, get_calendar_event: true, } \ No newline at end of file diff --git a/pages/addtags/mzta-add-tags.css b/pages/addtags/mzta-add-tags.css index dd2f01a8..2899916f 100644 --- a/pages/addtags/mzta-add-tags.css +++ b/pages/addtags/mzta-add-tags.css @@ -27,7 +27,7 @@ justify-content: space-between; } -#addtags_info_additional_statements, #add_tags_auto_force_existing_tr{ +#addtags_info_additional_statements, #add_tags_auto_force_existing_tr, #add_tags_auto_only_inbox_tr{ display: none; } diff --git a/pages/addtags/mzta-add-tags.html b/pages/addtags/mzta-add-tags.html index b6b8c94c..7d15a704 100644 --- a/pages/addtags/mzta-add-tags.html +++ b/pages/addtags/mzta-add-tags.html @@ -67,6 +67,15 @@ + + __MSG_prefs_OptionText_add_tags_auto_only_inbox__ + + + +
__MSG_AddTags_prompt_text_title__ diff --git a/pages/addtags/mzta-add-tags.js b/pages/addtags/mzta-add-tags.js index 06d9119d..ba24ca7d 100644 --- a/pages/addtags/mzta-add-tags.js +++ b/pages/addtags/mzta-add-tags.js @@ -55,13 +55,13 @@ document.addEventListener('DOMContentLoaded', async () => { let add_tags_auto_el = document.getElementById('add_tags_auto'); let add_tags_auto_force_existing_tr = document.getElementById('add_tags_auto_force_existing_tr'); + let add_tags_auto_only_inbox_tr = document.getElementById('add_tags_auto_only_inbox_tr'); add_tags_auto_el.addEventListener('click', (event) => { add_tags_auto_force_existing_tr.style.display = event.target.checked ? 'table-row' : 'none'; - if(!event.target.checked){ - document.getElementById('add_tags_auto_force_existing').checked = false; - } + add_tags_auto_only_inbox_tr.style.display = event.target.checked ? 'table-row' : 'none'; }); add_tags_auto_force_existing_tr.style.display = add_tags_auto_el.checked ? 'table-row' : 'none'; + add_tags_auto_only_inbox_tr.style.display = add_tags_auto_el.checked ? 'table-row' : 'none'; addtags_reset_btn.addEventListener('click', () => { addtags_textarea.value = browser.i18n.getMessage('prompt_add_tags_full_text');