correctly showing connection info. see #730

This commit is contained in:
Mic 2026-04-02 00:04:00 +02:00
parent c1396ebfb4
commit 28e61d7a40
3 changed files with 25 additions and 1 deletions

View file

@ -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\".", "message": "You can change the shortcut clicking on the cogwheel icon at the top right of this page and choosing \"Manage Extension Shortcut\".",
"description": "" "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": { "prefsDonation_1": {
"message": "Do you like this addon?", "message": "Do you like this addon?",
"description": "" "description": ""

View file

@ -272,7 +272,9 @@
<span class="conntype_chatgpt_web">__MSG_prefsInfoDesc_1__<br></span> <span class="conntype_chatgpt_web">__MSG_prefsInfoDesc_1__<br></span>
<span class="conntype_chatgpt_api">__MSG_prefsInfoDesc_2__<br></span> <span class="conntype_chatgpt_api">__MSG_prefsInfoDesc_2__<br></span>
<span class="conntype_ollama_api">__MSG_prefsInfoDesc_3__ [<a href="https://micz.it/thunderbird-addon-thunderai/ollama-cors-information/">__MSG_more_info_string__</a>]<br></span> <span class="conntype_ollama_api">__MSG_prefsInfoDesc_3__ [<a href="https://micz.it/thunderbird-addon-thunderai/ollama-cors-information/">__MSG_more_info_string__</a>]<br></span>
<span class="conntype_openai_comp_api">__MSG_prefsInfoDesc_4__</span> <span class="conntype_openai_comp_api">__MSG_prefsInfoDesc_4__<br></span>
<span class="conntype_google_gemini_api">__MSG_prefsInfoDesc_7__<br></span>
<span class="conntype_anthropic_api">__MSG_prefsInfoDesc_8__<br></span>
<br><span>__MSG_prefsInfoDesc_5__ <br><span>__MSG_prefsInfoDesc_5__
<br>__MSG_prefsInfoDesc_6__</span> <br>__MSG_prefsInfoDesc_6__</span>
</p> </p>

View file

@ -239,6 +239,18 @@ async function disable_GetCalendarEvent(){
wrong_sparks_text.style.display = (is_spark_present == 0) ? 'inline' : 'none'; 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(){ function resetMaxPromptLength(){
let maxPromptLength = document.getElementById('max_prompt_length'); let maxPromptLength = document.getElementById('max_prompt_length');
maxPromptLength.value = prefs_default.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_Summarize(prefs_opt));
conntype_select.addEventListener("change", () => disable_Translate(prefs_opt)); conntype_select.addEventListener("change", () => disable_Translate(prefs_opt));
conntype_select.addEventListener("change", disable_GetCalendarEvent); conntype_select.addEventListener("change", disable_GetCalendarEvent);
conntype_select.addEventListener("change", updateDescription);
showConnectionOptions(conntype_select); showConnectionOptions(conntype_select);
updateDescription();
disable_MaxPromptLength(); disable_MaxPromptLength();
disable_AddTags(prefs_opt); disable_AddTags(prefs_opt);
disable_SpamFilter(prefs_opt); disable_SpamFilter(prefs_opt);