add_tags_auto_only_inbox option added. see #237

This commit is contained in:
mic 2025-02-04 21:52:10 +01:00
parent c8f6729366
commit eb3dbc2c73
5 changed files with 22 additions and 4 deletions

View file

@ -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": ""
}
}

View file

@ -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,
}

View file

@ -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;
}

View file

@ -67,6 +67,15 @@
</label>
</td>
</tr>
<tr class="add_tags_tr" id="add_tags_auto_only_inbox_tr">
<td><span>__MSG_prefs_OptionText_add_tags_auto_only_inbox__</span></td>
<td>
<label>
<input type="checkbox" id="add_tags_auto_only_inbox" name="add_tags_auto_only_inbox" class="option-input" />
__MSG_prefs_OptionText_add_tags_auto_only_inbox_Info__
</label>
</td>
</tr>
</table>
<div id="addtags_prompt_container">
<span class="section_title">__MSG_AddTags_prompt_text_title__</span><span id="addtags_prompt_unsaved" class="unsaved hidden"> __MSG_customPrompts_unsaved_changes__</span>

View file

@ -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');