From c4dd7a244ae43d06b2b49acb2c938d948f0122a8 Mon Sep 17 00:00:00 2001 From: mic Date: Thu, 6 Feb 2025 21:57:06 +0100 Subject: [PATCH] thunderai_def_sign and thunderai_def_lang palceholders added. fixes #248 --- _locales/en/messages.json | 8 ++++++++ js/mzta-menus.js | 8 ++++++++ js/mzta-placeholders.js | 14 ++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index ff26dcf3..acafc53d 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1042,5 +1042,13 @@ "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": "" + }, + "placeholder_thunderai_def_sign": { + "message": "Default signature as defined in ThunderAI options.", + "description": "" + }, + "thunderai_def_lang": { + "message": "Default language as defined in ThunderAI options.", + "description": "" } } \ No newline at end of file diff --git a/js/mzta-menus.js b/js/mzta-menus.js index efdf6344..7386bf0d 100644 --- a/js/mzta-menus.js +++ b/js/mzta-menus.js @@ -188,6 +188,14 @@ export class mzta_Menus { case 'tags_full_list': finalSubs['tags_full_list'] = tags_full_list[0]; break; + case 'thunderai_def_sign': + let prefs_def_sign = await browser.storage.sync.get({default_sign_name: ''}); + finalSubs['thunderai_def_sign'] = prefs_def_sign.default_sign_name; + break; + case 'thunderai_def_lang': + let prefs_def_lang = await browser.storage.sync.get({default_chatgpt_lang: ''}); + finalSubs['thunderai_def_lang'] = prefs_def_lang.default_chatgpt_lang; + break; default: // TODO Manage custom placeholders https://github.com/micz/ThunderAI/issues/156 break; } diff --git a/js/mzta-placeholders.js b/js/mzta-placeholders.js index 11b9a51b..9cf612d5 100644 --- a/js/mzta-placeholders.js +++ b/js/mzta-placeholders.js @@ -131,6 +131,20 @@ const defaultPlaceholders = [ type: 0, is_default: "1", }, + { + id: 'thunderai_def_sign', + name: "__MSG_placeholder_thunderai_def_sign__", + default_value: "", + type: 0, + is_default: "1", + }, + { + id: 'thunderai_def_lang', + name: "__MSG_placeholder_thunderai_def_lang__", + default_value: "", + type: 0, + is_default: "1", + }, ];