From 5070494ed0ab6361fd3a27dd1018b15560cd7c18 Mon Sep 17 00:00:00 2001 From: mic Date: Mon, 14 Apr 2025 22:40:24 +0200 Subject: [PATCH] Add 'empty' placeholder to prevent automatic text appending in prompts. See #345 and #339 --- _locales/en/messages.json | 4 ++++ js/mzta-placeholders.js | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 9de3d97d..7a558982 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1099,6 +1099,10 @@ "message": "Default language as defined in ThunderAI options.", "description": "" }, + "empty": { + "message": "This placeholder doesn't add any text, but it prevents the email body from being automatically appended at the end of the prompt.", + "description": "" + }, "prefs_OptionText_spamfilter": { "message": "Automatic Spam Filter", "description": "" diff --git a/js/mzta-placeholders.js b/js/mzta-placeholders.js index 02f8a513..363feee2 100644 --- a/js/mzta-placeholders.js +++ b/js/mzta-placeholders.js @@ -175,6 +175,13 @@ const defaultPlaceholders = [ type: 0, is_default: "1", }, + { + id: 'empty', + name: "__MSG_placeholder_empty__", + default_value: "", + type: 0, + is_default: "1", + }, ]; @@ -358,6 +365,9 @@ export const placeholdersUtils = { let prefs_def_lang = await browser.storage.sync.get({default_chatgpt_lang: ''}); finalSubs['thunderai_def_lang'] = placeholdersUtils.failSafePlaceholders(prefs_def_lang.default_chatgpt_lang); break; + case 'empty': + finalSubs['empty'] = ''; + break; default: // TODO Manage custom placeholders https://github.com/micz/ThunderAI/issues/156 break; }