From 28e61d7a402d792c936b99e80e9e26913ef5b36e Mon Sep 17 00:00:00 2001 From: Mic Date: Thu, 2 Apr 2026 00:04:00 +0200 Subject: [PATCH] correctly showing connection info. see #730 --- _locales/en/messages.json | 8 ++++++++ options/mzta-options.html | 4 +++- options/mzta-options.js | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 92e9bad0..58bab701 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -388,6 +388,14 @@ "message": "You can change the shortcut clicking on the cogwheel icon at the top right of this page and choosing \"Manage Extension Shortcut\".", "description": "" }, + "prefsInfoDesc_7": { + "message": "To use the Google Gemini API, you need a Google Gemini API Key and must choose a model.", + "description": "" + }, + "prefsInfoDesc_8": { + "message": "To use the Claude API, you need an Anthropic Claude API Key and must choose a model.", + "description": "" + }, "prefsDonation_1": { "message": "Do you like this addon?", "description": "" diff --git a/options/mzta-options.html b/options/mzta-options.html index 2d247247..139b9c8e 100644 --- a/options/mzta-options.html +++ b/options/mzta-options.html @@ -272,7 +272,9 @@ __MSG_prefsInfoDesc_1__
__MSG_prefsInfoDesc_2__
__MSG_prefsInfoDesc_3__ [__MSG_more_info_string__]
- __MSG_prefsInfoDesc_4__ + __MSG_prefsInfoDesc_4__
+ __MSG_prefsInfoDesc_7__
+ __MSG_prefsInfoDesc_8__

__MSG_prefsInfoDesc_5__
__MSG_prefsInfoDesc_6__

diff --git a/options/mzta-options.js b/options/mzta-options.js index eda0c48f..caafc539 100644 --- a/options/mzta-options.js +++ b/options/mzta-options.js @@ -239,6 +239,18 @@ async function disable_GetCalendarEvent(){ wrong_sparks_text.style.display = (is_spark_present == 0) ? 'inline' : 'none'; } +function updateDescription(){ + let conntype_select = document.getElementById("connection_type"); + let conntype = conntype_select.value; + let desc = document.getElementById("miczDescription"); + const types = ["chatgpt_web", "chatgpt_api", "ollama_api", "openai_comp_api", "google_gemini_api", "anthropic_api"]; + for(let t of types){ + desc.querySelectorAll(".conntype_" + t).forEach(el => { + el.style.display = (conntype === t) ? "" : "none"; + }); + } +} + function resetMaxPromptLength(){ let maxPromptLength = document.getElementById('max_prompt_length'); maxPromptLength.value = prefs_default.max_prompt_length; @@ -394,8 +406,10 @@ document.addEventListener('DOMContentLoaded', async () => { conntype_select.addEventListener("change", () => disable_Summarize(prefs_opt)); conntype_select.addEventListener("change", () => disable_Translate(prefs_opt)); conntype_select.addEventListener("change", disable_GetCalendarEvent); + conntype_select.addEventListener("change", updateDescription); showConnectionOptions(conntype_select); + updateDescription(); disable_MaxPromptLength(); disable_AddTags(prefs_opt); disable_SpamFilter(prefs_opt);