diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 48cd1b80..480e90cf 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1151,6 +1151,14 @@ "message": "If checked, the AI will only add tags to emails received in the inbox folder.", "description": "" }, + "prefs_OptionText_add_tags_use_specific_integration": { + "message": "Use specific Model and API", + "description": "" + }, + "prefs_OptionText_add_tags_use_specific_integration_Info": { + "message": "If checked, the Model and API specified below will be used for adding tags to emails, regardless the one choosen in the ThunderAI options page.", + "description": "" + }, "placeholder_thunderai_def_sign": { "message": "Default signature as defined in ThunderAI options.", "description": "" diff --git a/js/mzta-utils.js b/js/mzta-utils.js index 4f55343c..f0d428f1 100644 --- a/js/mzta-utils.js +++ b/js/mzta-utils.js @@ -364,7 +364,7 @@ export function generateCallID(length = 10) { return result; } -export function populateConnectionTypeOptions(selectId) { +export function populateConnectionTypeOptions(selectId, no_chatgpt_web = false) { const selectEl = document.getElementById(selectId); if (!selectEl) return; @@ -381,7 +381,7 @@ export function populateConnectionTypeOptions(selectId) { selectEl.innerHTML = ''; - for (const opt of options) { + for (const opt of options.filter(o => !(no_chatgpt_web && o.value === 'chatgpt_web'))) { const optionEl = document.createElement('option'); optionEl.value = opt.value; optionEl.textContent = browser.i18n.getMessage(opt.msgKey) || opt.msgKey; diff --git a/options/mzta-options-default.js b/options/mzta-options-default.js index e1aeb908..96ef973b 100644 --- a/options/mzta-options-default.js +++ b/options/mzta-options-default.js @@ -66,6 +66,8 @@ export const prefs_default = { add_tags_auto_uselist_list: '', add_tags_context_menu: true, add_tags_enabled_accounts: [], + add_tags_use_specific_integration: false, + add_tags_connection_type: '', get_calendar_event: true, get_task: true, calendar_enforce_timezone: false, diff --git a/pages/addtags/mzta-add-tags.css b/pages/addtags/mzta-add-tags.css index 070f3bdf..ee43e00c 100644 --- a/pages/addtags/mzta-add-tags.css +++ b/pages/addtags/mzta-add-tags.css @@ -43,7 +43,12 @@ background-color: #e9ffdf; } -tr.add_tags_auto_sub td{ +.specific_integration{ + background-color: #dfeaff; +} + +tr.add_tags_auto_sub td, +tr.specific_integration_sub td{ padding-left: 0.8em !important; } @@ -159,4 +164,8 @@ table#miczPrefs tr:last-child td { .add_tags_auto{ background-color: #415c35; } + + .specific_integration{ + background-color: #2E3A4F; + } } \ No newline at end of file diff --git a/pages/addtags/mzta-add-tags.html b/pages/addtags/mzta-add-tags.html index bf9d8c53..0f525f84 100644 --- a/pages/addtags/mzta-add-tags.html +++ b/pages/addtags/mzta-add-tags.html @@ -13,6 +13,25 @@
__MSG_AddTags_prompt_prefs_title__
+ + + + + + + +
__MSG_prefs_OptionText_add_tags_use_specific_integration__ + + +
__MSG_prefs_Connection_type__ + + +
__MSG_prefs_OptionText_add_tags_maxnum__ diff --git a/pages/addtags/mzta-add-tags.js b/pages/addtags/mzta-add-tags.js index 7205bc28..9fc4113b 100644 --- a/pages/addtags/mzta-add-tags.js +++ b/pages/addtags/mzta-add-tags.js @@ -22,7 +22,7 @@ import { getSpecialPrompts, setSpecialPrompts } from "../../js/mzta-prompts.js"; import { getPlaceholders } from "../../js/mzta-placeholders.js"; import { textareaAutocomplete } from "../../js/mzta-placeholders-autocomplete.js"; import { addTags_getExclusionList, addTags_setExclusionList } from "../../js/mzta-addatags-exclusion-list.js"; -import { getAccountsList, normalizeStringList } from "../../js/mzta-utils.js"; +import { getAccountsList, normalizeStringList, populateConnectionTypeOptions } from "../../js/mzta-utils.js"; let autocompleteSuggestions = []; let taLog = new taLogger("mzta-addtags-page",true); @@ -30,6 +30,7 @@ let taLog = new taLogger("mzta-addtags-page",true); document.addEventListener('DOMContentLoaded', async () => { i18n.updateDocument(); + populateConnectionTypeOptions('add_tags_connection_type', true); await restoreOptions(); document.querySelectorAll(".option-input").forEach(element => {