Merge branch 'v3.8.0' into main
This commit is contained in:
commit
64069958a2
56 changed files with 778 additions and 203 deletions
|
|
@ -1319,5 +1319,8 @@
|
|||
},
|
||||
"auto_summary_prompt": {
|
||||
"message": "Proporciona un resumen conciso del siguiente mensaje de correo electrónico. El resumen debe tener un máximo de 3-5 oraciones y capturar los puntos principales:\n\n"
|
||||
},
|
||||
"reset": {
|
||||
"message": "Reiniciar"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1353,5 +1353,8 @@
|
|||
},
|
||||
"auto_summary_prompt": {
|
||||
"message": "Veuillez fournir un résumé concis du message suivant. Le résumé doit comporter au maximum 3 à 5 phrases et capturer les points principaux :\n\n"
|
||||
},
|
||||
"reset": {
|
||||
"message": "Réinitialiser"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1111,7 +1111,7 @@
|
|||
"message": "Scegli uno dei servizi disponibili per l'API compatibile con OpenAI oppure inseriscine uno manualmente."
|
||||
},
|
||||
"prefs_OptionText_anthropic_max_tokens": {
|
||||
"message": "Numero massimo di token di Claude"
|
||||
"message": "Numero massimo di token"
|
||||
},
|
||||
"prefs_OptionText_anthropic_max_tokens_Info": {
|
||||
"message": "Il numero massimo di token da generare nell'elaborazione. Il conteggio dei token del tuo prompt, sommato a max_tokens, non può superare la lunghezza di contesto del modello."
|
||||
|
|
@ -1334,5 +1334,32 @@
|
|||
},
|
||||
"auto_summary_prompt": {
|
||||
"message": "Fornire un riassunto conciso del seguente messaggio email. Il riassunto dovrebbe essere di massimo 3-5 frasi e catturare i punti principali:\n\n"
|
||||
},
|
||||
"prompt_string": {
|
||||
"message": "Prompt"
|
||||
},
|
||||
"placeholder_mail_headers": {
|
||||
"message": "Intestazioni email"
|
||||
},
|
||||
"reset": {
|
||||
"message": "Reset"
|
||||
},
|
||||
"prefs_chatgpt_api_temperature_Info": {
|
||||
"message": "Quale temperatura di campionamento utilizzare, tra 0 e 2. Valori più alti come 0,8 renderanno l'output più casuale, mentre valori più bassi come 0,2 lo renderanno più focalizzato e deterministico."
|
||||
},
|
||||
"prefs_ollama_temperature_Info": {
|
||||
"message": "La temperatura del modello. Aumentare la temperatura farà sì che il modello risponda in modo più creativo. Il valore predefinito è 0,8. Si consiglia di utilizzare valori compresi tra 0 e 1."
|
||||
},
|
||||
"prefs_api_temperature": {
|
||||
"message": "Temperatura"
|
||||
},
|
||||
"prefs_openai_comp_temperature_Info": {
|
||||
"message": "Quale temperatura di campionamento utilizzare, tra 0 e 2. Valori più alti come 0,8 renderanno l'output più casuale, mentre valori più bassi come 0,2 lo renderanno più focalizzato e deterministico."
|
||||
},
|
||||
"prefs_google_gemini_temperature_Info": {
|
||||
"message": "Questo parametro deve essere un numero compreso tra 0.0 e 2.0. Questo valore controlla la casualità dell'output. Il valore predefinito varia a seconda del modello. Lascialo vuoto per evitare di impostare il parametro nella chiamata API."
|
||||
},
|
||||
"prefs_anthropic_temperature_Info": {
|
||||
"message": "Quantità di casualità iniettata nella risposta. Il valore predefinito è 1,0. L'intervallo va da 0,0 a 1,0. Utilizza una temperatura più vicina a 0,0 per compiti analitici o a scelta multipla, e più vicina a 1,0 per compiti creativi e generativi. Nota che, anche con una temperatura di 0,0, i risultati non saranno completamente deterministici."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,5 +85,527 @@
|
|||
},
|
||||
"auto_summary_prompt": {
|
||||
"message": "Ge en koncis sammanfattning av följande e-postmeddelande. Sammanfattningen bör vara max 3-5 meningar och fånga huvudpunkterna:\n\n"
|
||||
},
|
||||
"prompt_summarize_this": {
|
||||
"message": "Sammanfatta detta"
|
||||
},
|
||||
"prompt_translate_this": {
|
||||
"message": "Översätt detta"
|
||||
},
|
||||
"more_info_string": {
|
||||
"message": "Mer information"
|
||||
},
|
||||
"prompt_classify": {
|
||||
"message": "Klassificera"
|
||||
},
|
||||
"customPrompts_reloading_menus": {
|
||||
"message": "Laddar om menyer..."
|
||||
},
|
||||
"customPrompts_form_required_fields": {
|
||||
"message": "Obligatoriska fält"
|
||||
},
|
||||
"customPrompts_add_to_menu_reading": {
|
||||
"message": "Läser ett e-postmeddelande"
|
||||
},
|
||||
"customPrompts_add_to_menu_composing": {
|
||||
"message": "Skriver ett e-postmeddelande"
|
||||
},
|
||||
"chatgpt_win_working": {
|
||||
"message": "Arbete pågår..."
|
||||
},
|
||||
"chatgpt_win_job_completed": {
|
||||
"message": "Färdigt!"
|
||||
},
|
||||
"chatgpt_win_job_completed_select": {
|
||||
"message": "Markera den text du vill använda och klicka på knappen."
|
||||
},
|
||||
"chatgpt_win_get_answer": {
|
||||
"message": "Använd det valda svaret"
|
||||
},
|
||||
"prefs_OptionText_release_notes": {
|
||||
"message": "Versionsinformation"
|
||||
},
|
||||
"prefsInfoTitle": {
|
||||
"message": "Viktig information"
|
||||
},
|
||||
"placeholder_tags_current_email": {
|
||||
"message": "E-posttaggar"
|
||||
},
|
||||
"placeholder_tags_full_list": {
|
||||
"message": "Befintliga taggar"
|
||||
},
|
||||
"prefs_OptionText_add_tags_maxnum": {
|
||||
"message": "Maximalt antal taggar"
|
||||
},
|
||||
"prefs_OptionText_add_tags_maxnum_Info": {
|
||||
"message": "Det maximala antalet taggar som föreslås av AI:n. Ställ den på 0 om du inte vill begränsa antalet taggar."
|
||||
},
|
||||
"prompt_add_tags_maxnum": {
|
||||
"message": "Begränsa antalet taggar till"
|
||||
},
|
||||
"prefs_OptionText_add_tags_hide_exclusions": {
|
||||
"message": "Dölj uteslutna taggar"
|
||||
},
|
||||
"prefs_OptionText_add_tags_hide_exclusions_Info": {
|
||||
"message": "Om markerad kommer taggarna som finns i undantagslistan att döljas i bekräftelsedialogrutan."
|
||||
},
|
||||
"prefs_OptionText_btnManageTagsInfo": {
|
||||
"message": "Hantera tagginställningar"
|
||||
},
|
||||
"AddTags_PageTitle": {
|
||||
"message": "Hantera tagginställningar"
|
||||
},
|
||||
"AddTags_excl_list_title": {
|
||||
"message": "Undantagslista"
|
||||
},
|
||||
"AddTags_excl_list_infoline": {
|
||||
"message": "Detta är en lista över taggar som inte får läggas till i e-postmeddelanden."
|
||||
},
|
||||
"save": {
|
||||
"message": "Spara"
|
||||
},
|
||||
"reset_default": {
|
||||
"message": "Återställ till standard"
|
||||
},
|
||||
"reset": {
|
||||
"message": "Återställ"
|
||||
},
|
||||
"addtags_excl_list_infoline2": {
|
||||
"message": "Lägg till ett ord per rad, eller separera med kommatecken."
|
||||
},
|
||||
"addtags_dialog_title": {
|
||||
"message": "Lägg till taggar i e-postmeddelandet"
|
||||
},
|
||||
"addtags_exclude_tag": {
|
||||
"message": "Uteslut tagg"
|
||||
},
|
||||
"addtags_no_tags_received": {
|
||||
"message": "Inga taggar mottagna från AI:n."
|
||||
},
|
||||
"addtags_no_valid_tags": {
|
||||
"message": "Inga giltiga taggar hittades efter filtrering med undantagslistan."
|
||||
},
|
||||
"thunderai_error_title": {
|
||||
"message": "ThunderAI-fel"
|
||||
},
|
||||
"thunderai_warning_title": {
|
||||
"message": "ThunderAI-varning"
|
||||
},
|
||||
"prefs_OptionText_add_tags_first_uppercase_Info": {
|
||||
"message": "Om markerad kommer taggarna att ställas in på gemener med endast den första bokstaven som versal."
|
||||
},
|
||||
"prefs_OptionText_add_tags_first_uppercase": {
|
||||
"message": "Första bokstaven som versal"
|
||||
},
|
||||
"prompt_reply": {
|
||||
"message": "Svara på detta e-postmeddelande"
|
||||
},
|
||||
"prompt_reply_advanced": {
|
||||
"message": "Svara på denna tråd"
|
||||
},
|
||||
"prompt_reply_custom_command": {
|
||||
"message": "Svara med kommando"
|
||||
},
|
||||
"prompt_rewrite_polite": {
|
||||
"message": "Skriv om artigt"
|
||||
},
|
||||
"prompt_rewrite_formal": {
|
||||
"message": "Skriv om formellt"
|
||||
},
|
||||
"customPrompts_managePrompts": {
|
||||
"message": "Hantera promptar"
|
||||
},
|
||||
"prompt_lang": {
|
||||
"message": "Svara på"
|
||||
},
|
||||
"customPrompts_start_saving": {
|
||||
"message": "Sparar promptar..."
|
||||
},
|
||||
"customPrompts_reindexing_list": {
|
||||
"message": "Omindexerar listan..."
|
||||
},
|
||||
"customPrompts_filtering_prompts": {
|
||||
"message": "Filtrerar promptar..."
|
||||
},
|
||||
"customPrompts_saving_default_prompts": {
|
||||
"message": "Sparar standardpromptar..."
|
||||
},
|
||||
"customPrompts_saving_custom_prompts": {
|
||||
"message": "Sparar anpassade promptar..."
|
||||
},
|
||||
"customPrompts_saved": {
|
||||
"message": "Promptar sparade!"
|
||||
},
|
||||
"customPrompts_form_label_ID": {
|
||||
"message": "Id"
|
||||
},
|
||||
"customPrompts_form_label_ID_rules": {
|
||||
"message": "Måste vara unikt, med gemener och utan mellanslag"
|
||||
},
|
||||
"customPrompts_form_label_Text": {
|
||||
"message": "Prompttext"
|
||||
},
|
||||
"customPrompts_form_label_need_selected": {
|
||||
"message": "Textval behövs"
|
||||
},
|
||||
"customPrompts_form_label_need_signature": {
|
||||
"message": "Lägg alltid till signaturen"
|
||||
},
|
||||
"customPrompts_form_label_need_custom_text": {
|
||||
"message": "Be om ytterligare text"
|
||||
},
|
||||
"customPrompts_form_label_use_diff_viewer": {
|
||||
"message": "Aktivera visaren för textjämförelse"
|
||||
},
|
||||
"customPrompts_form_label_use_diff_viewer_title": {
|
||||
"message": "Textjämförelsevisaren kan väljas när åtgärden är inställd på \"Ersätt text\"."
|
||||
},
|
||||
"customPrompts_btnAddNewCommit": {
|
||||
"message": "Lägg till prompten"
|
||||
},
|
||||
"customPrompts_add_to_menu": {
|
||||
"message": "Lägg till i meny"
|
||||
},
|
||||
"customPrompts_close_button": {
|
||||
"message": "Stäng-knapp"
|
||||
},
|
||||
"customPrompts_do_reply": {
|
||||
"message": "Svara"
|
||||
},
|
||||
"customPrompts_substitute_text": {
|
||||
"message": "Ersätt text"
|
||||
},
|
||||
"chatgpt_textarea_not_found_error": {
|
||||
"message": "Det verkar som att ChatGPT-sidan tar för lång tid att ladda. Om den är klar klickar du på knappen till höger. Om problemet kvarstår kontrollerar du tjänstens status."
|
||||
},
|
||||
"chatgpt_sendbutton_not_found_error": {
|
||||
"message": "Klicka på skicka-knappen för att skicka in prompten."
|
||||
},
|
||||
"chatgpt_user_not_logged_in": {
|
||||
"message": "Du är inte inloggad på ChatGPT. Logga in med dina inloggningsuppgifter, stäng ChatGPT-fönstret och upprepa sedan åtgärden du försökte göra. Du kommer att förbli inloggad efteråt."
|
||||
},
|
||||
"chatgpt_win_model_warning": {
|
||||
"message": "Av någon anledning är det inte möjligt att verifiera om rätt modell är laddad. För tillfället kan du trycka på den blå knappen för att fortsätta."
|
||||
},
|
||||
"chatgpt_win_custom_text": {
|
||||
"message": "Infoga här den ytterligare texten för prompten."
|
||||
},
|
||||
"chatgpt_force_completion": {
|
||||
"message": "tvinga slutförande"
|
||||
},
|
||||
"prompt_this": {
|
||||
"message": "Prompt detta"
|
||||
},
|
||||
"prompt_string": {
|
||||
"message": "Prompt"
|
||||
},
|
||||
"customPrompts_managePrompts_info_default": {
|
||||
"message": "Standardpromptar kan inte redigeras. Du kan inaktivera dem och sedan kopiera prompttexten och klistra in den i en ny för att skapa en modifierad version."
|
||||
},
|
||||
"customPrompts_managePrompts_info_default_2": {
|
||||
"message": "Du kan importera och exportera promptar. Befintliga promptar med samma ID kommer att skrivas över. Promptar med nya ID:n kommer att läggas till."
|
||||
},
|
||||
"customPrompts_managePrompts_info_default_3": {
|
||||
"message": "Om allt är korrekt, klicka på knappen \"Spara alla\" efter importen."
|
||||
},
|
||||
"chatgpt_force_completion_title": {
|
||||
"message": "Klicka här för att visa knappen \"Använd senaste svar\" om ChatGPT har slutfört sitt arbete men knappen inte har visats."
|
||||
},
|
||||
"msg_prompt_too_long": {
|
||||
"message": "Texten du angav är för lång. Du måste förkorta den."
|
||||
},
|
||||
"prefs_status_page": {
|
||||
"message": "tjänstestatus"
|
||||
},
|
||||
"prefs_OptionText_chatgpt_win_text": {
|
||||
"message": "AI-chattfönstrets dimensioner"
|
||||
},
|
||||
"prefs_OptionText_default_sign_name": {
|
||||
"message": "Standardsignaturnamn"
|
||||
},
|
||||
"prefs_OptionText_default_chatgpt_lang": {
|
||||
"message": "Standardspråk för svaren"
|
||||
},
|
||||
"prefs_OptionText_reply_all": {
|
||||
"message": "Svara alla"
|
||||
},
|
||||
"prefs_OptionText_reply_sender": {
|
||||
"message": "Svara till avsändaren"
|
||||
},
|
||||
"prefs_OptionText_reply_type": {
|
||||
"message": "Svarstyp"
|
||||
},
|
||||
"prefs_OptionText_reply_type_Info": {
|
||||
"message": "Detta är standardsvarstypen som används när du svarar på ett e-postmeddelande. Du kan välja den andra typen senare i svarsdialogrutan."
|
||||
},
|
||||
"prefs_OptionText_btnManagePrompts": {
|
||||
"message": "Hantera dina promptar"
|
||||
},
|
||||
"prefs_OptionText_btnManageCustomDataPH": {
|
||||
"message": "Hantera dina dataplatshållare"
|
||||
},
|
||||
"prefsInfoDesc_1": {
|
||||
"message": "Det kan hända att ChatGPT:s webbgränssnitt ändras på ett sätt som stör hur tillägget fungerar. Kontrollera sidan \"Tjänststatus\" som är länkad längst ner på den här sidan. Kom också ihåg att första gången du använder ThunderAI måste du logga in på ChatGPT."
|
||||
},
|
||||
"prefsInfoDesc_2": {
|
||||
"message": "För att använda ChatGPT API behöver du en OpenAI ChatGPT API-nyckel och måste välja en modell."
|
||||
},
|
||||
"prefsInfoDesc_3": {
|
||||
"message": "För att använda integrationen med Ollama måste du konfigurera en lokal Ollama-server. När servern är igång anger du dess adress i det angivna fältet i applikationen. För att säkerställa korrekt kommunikation mellan ThunderAI och Ollama-servern, kom ihåg att ange OLLAMA_ORIGINS=moz-extension://*."
|
||||
},
|
||||
"prefsInfoDesc_4": {
|
||||
"message": "För att använda den här integrationen behöver du konfigurera en lokal server som är kompatibel med OpenAI API, som LM Studio. När servern är igång anger du dess adress i det angivna fältet i applikationen. För att säkerställa korrekt kommunikation mellan ThunderAI och den lokala servern, kom ihåg att ställa in CORS-inställningarna korrekt."
|
||||
},
|
||||
"prefsInfoDesc_5": {
|
||||
"message": "Kom ihåg att du kan öppna ThunderAI-menyn med kortkommandot CTRL+ALT+A."
|
||||
},
|
||||
"prefsInfoDesc_6": {
|
||||
"message": "Du kan ändra genvägen genom att klicka på kugghjulsikonen längst upp till höger på den här sidan och välja \"Hantera genväg för tillägg\"."
|
||||
},
|
||||
"prefsDonation_1": {
|
||||
"message": "Gillar du det här tillägget?"
|
||||
},
|
||||
"prefsDonation_2": {
|
||||
"message": "Överväg att göra en donation!"
|
||||
},
|
||||
"backToOptionsText": {
|
||||
"message": "Alternativ"
|
||||
},
|
||||
"TranslateText": {
|
||||
"message": "Vill du hjälpa till att översätta det här tillägget?"
|
||||
},
|
||||
"TranslateLink": {
|
||||
"message": "Ta reda på hur!"
|
||||
},
|
||||
"customPrompts_ExportAll": {
|
||||
"message": "Exportera alla promptar"
|
||||
},
|
||||
"customPrompts_Import": {
|
||||
"message": "Importera nya promptar"
|
||||
},
|
||||
"importPrompts_confirmText": {
|
||||
"message": "Du håller på att importera nya promptar."
|
||||
},
|
||||
"customPrompts_start_import": {
|
||||
"message": "Startar import av anpassade promptar..."
|
||||
},
|
||||
"customPrompts_import_completed": {
|
||||
"message": "Import av anpassade promptar är klar! Du måste klicka på knappen \"Spara alla\" för att spara dina ändringar."
|
||||
},
|
||||
"importPrompts_invalidFile": {
|
||||
"message": "Filen du försöker importera är inte en giltig fil med anpassade promptar."
|
||||
},
|
||||
"importPrompts_invalidPrompts": {
|
||||
"message": "Filen du försöker importera innehåller inga giltiga promptar."
|
||||
},
|
||||
"currently_used_prompt": {
|
||||
"message": "För närvarande använt promptnamn"
|
||||
},
|
||||
"customprompts_form_label_define_response_lang": {
|
||||
"message": "Definiera svarsspråket i prompten"
|
||||
},
|
||||
"prefs_Connection_type": {
|
||||
"message": "Anslutningstyp"
|
||||
},
|
||||
"prefs_Connection_type_ChatGPT_Web": {
|
||||
"message": "ChatGPT-webbgränssnitt"
|
||||
},
|
||||
"prefs_Connection_type_ChatGPT_API": {
|
||||
"message": "ChatGPT OpenAI API"
|
||||
},
|
||||
"prefs_ChatGPT_API_Key": {
|
||||
"message": "ChatGPT API-nyckel"
|
||||
},
|
||||
"ChatGPT_Models": {
|
||||
"message": "ChatGPT-modeller"
|
||||
},
|
||||
"ChatGPT_Models_Fetch": {
|
||||
"message": "Uppdatera listan över ChatGPT-modeller"
|
||||
},
|
||||
"ChatGPT_Models_Error_fetching": {
|
||||
"message": "Fel vid försök att hämta ChatGPT-modeller"
|
||||
},
|
||||
"Loading": {
|
||||
"message": "Laddar..."
|
||||
},
|
||||
"error": {
|
||||
"message": "ThunderAI-fel!"
|
||||
},
|
||||
"chatgpt_empty_apikey": {
|
||||
"message": "Du har inte lagt till en API-nyckel för ChatGPT API. Vänligen ange en på alternativsidan."
|
||||
},
|
||||
"chatgpt_empty_model": {
|
||||
"message": "Du har inte valt någon modell för ChatGPT API. Välj en på alternativsidan."
|
||||
},
|
||||
"chagpt_api_send_button": {
|
||||
"message": "Använda modell"
|
||||
},
|
||||
"Debug": {
|
||||
"message": "Felsök"
|
||||
},
|
||||
"prefs_OptionText_do_debug_info": {
|
||||
"message": "Aktivera felsökningssystemet"
|
||||
},
|
||||
"prefs_Connection_type_Ollama_API": {
|
||||
"message": "Ollama API (Lokal LLM)"
|
||||
},
|
||||
"prefs_Connection_type_OpenAI_Comp_API": {
|
||||
"message": "OpenAI-kompatibelt API"
|
||||
},
|
||||
"prefs_API_Host": {
|
||||
"message": "Värdadress"
|
||||
},
|
||||
"Ollama_Models": {
|
||||
"message": "Ollama-modeller"
|
||||
},
|
||||
"Ollama_Models_Fetch": {
|
||||
"message": "Uppdatera listan över Ollama-modeller"
|
||||
},
|
||||
"Ollama_Models_Error_fetching": {
|
||||
"message": "Fel vid försök att hämta Ollama-modeller"
|
||||
},
|
||||
"API_Models_Error_NoModels": {
|
||||
"message": "Inga modeller hittades"
|
||||
},
|
||||
"ollama_empty_host": {
|
||||
"message": "Du har inte lagt till en värdadress för Ollama API. Vänligen ange en på alternativsidan."
|
||||
},
|
||||
"ollama_empty_model": {
|
||||
"message": "Du har inte valt någon modell för Ollama API. Välj en på alternativsidan."
|
||||
},
|
||||
"error_connection_interrupted": {
|
||||
"message": "Anslutningen till servern avbröts oväntat"
|
||||
},
|
||||
"ollama_api_request_failed": {
|
||||
"message": "Ollama API-begäran misslyckades"
|
||||
},
|
||||
"chatgpt_api_request_failed": {
|
||||
"message": "OpenAI ChatGPT API-begäran misslyckades"
|
||||
},
|
||||
"WaitingServerResponse": {
|
||||
"message": "Väntar på serversvar"
|
||||
},
|
||||
"prefs_API_Host_Info": {
|
||||
"message": "Något liknande"
|
||||
},
|
||||
"OpenAIComp_Models": {
|
||||
"message": "OpenAI-kompatibla API-modeller"
|
||||
},
|
||||
"OpenAIComp_Models_Fetch": {
|
||||
"message": "Uppdatera listan över OpenAI-kompatibla API-modeller"
|
||||
},
|
||||
"OpenAIComp_Models_Error_fetching": {
|
||||
"message": "Fel vid försök att hämta OpenAI-kompatibla API-modeller"
|
||||
},
|
||||
"OpenAIComp_empty_host": {
|
||||
"message": "Du har inte lagt till en värdadress för OpenAI-kompatibla API:et. Vänligen ange en på alternativsidan."
|
||||
},
|
||||
"OpenAIComp_empty_model": {
|
||||
"message": "Du har inte valt en modell för OpenAI-kompatibelt API. Välj en på alternativsidan."
|
||||
},
|
||||
"OpenAIComp_api_request_failed": {
|
||||
"message": "OpenAI Comp API-begäran misslyckades"
|
||||
},
|
||||
"prefs_OpenAIComp_ChatName": {
|
||||
"message": "Chattnamn"
|
||||
},
|
||||
"prefs_OpenAIComp_ChatName_Info": {
|
||||
"message": "Detta är namnet som kommer att användas i AI-chatten."
|
||||
},
|
||||
"StorageSpace": {
|
||||
"message": "Totalt upptaget lagringsutrymme"
|
||||
},
|
||||
"SearchPrompt": {
|
||||
"message": "Sök promptar"
|
||||
},
|
||||
"prefs_OptionText_dynamic_menu_force_enter_info": {
|
||||
"message": "Om markerat, skickas den markerade prompten från menyn automatiskt genom att använda kortkommandot CTRL+ALT+A. Annars visas promptnamnet för användaren, vilket kräver ytterligare ett tryck på Enter-tangenten för att skicka den."
|
||||
},
|
||||
"prefs_OptionText_dynamic_menu_force_enter": {
|
||||
"message": "Meny: skicka omedelbart prompt"
|
||||
},
|
||||
"prefs_OptionText_dynamic_menu_order_alphabet": {
|
||||
"message": "Meny: ordna alfabetiskt"
|
||||
},
|
||||
"prefs_OptionText_dynamic_menu_order_alphabet_info": {
|
||||
"message": "Om markerat kommer promptar i menyn att ordnas alfabetiskt."
|
||||
},
|
||||
"prefs_OptionText_chatgpt_win_dims_info": {
|
||||
"message": "Ställ in värdet till 0 om du inte vill ange fönsterstorleken."
|
||||
},
|
||||
"prefs_OpenAIComp_API_Key": {
|
||||
"message": "OpenAI Comp API-nyckel"
|
||||
},
|
||||
"Optional": {
|
||||
"message": "Valfri"
|
||||
},
|
||||
"OpenChatGPTTab": {
|
||||
"message": "Öppna fliken ChatGPT"
|
||||
},
|
||||
"OpenChatGPTTab_Info": {
|
||||
"message": "Vid inloggningsproblem i ThunderAI-fönstret, öppna ChatGPT i en ny flik med knappen till höger, logga in, stäng sedan fliken och fortsätt använda ThunderAI."
|
||||
},
|
||||
"OpenChatGPTTab_Info2": {
|
||||
"message": "Om du öppnar ChatGPT Web härifrån tillämpas alla konfigurerade inställningar för modellen, projektet och den anpassade GPT:n."
|
||||
},
|
||||
"placeholder_mail_text_body": {
|
||||
"message": "Mejltext"
|
||||
},
|
||||
"placeholder_mail_html_body": {
|
||||
"message": "HTML-mejltext"
|
||||
},
|
||||
"placeholder_mail_subject": {
|
||||
"message": "Ämne för e-postmeddelande"
|
||||
},
|
||||
"placeholder_folder_name": {
|
||||
"message": "Mappnamn"
|
||||
},
|
||||
"placeholder_folder_path": {
|
||||
"message": "Mappsökväg"
|
||||
},
|
||||
"placeholder_mail_headers": {
|
||||
"message": "E-postrubriker"
|
||||
},
|
||||
"placeholder_selected_text": {
|
||||
"message": "Vald text"
|
||||
},
|
||||
"placeholder_junk_score": {
|
||||
"message": "Skräppoäng"
|
||||
},
|
||||
"placeholder_recipients": {
|
||||
"message": "Mottagare"
|
||||
},
|
||||
"placeholder_cc_list": {
|
||||
"message": "CC-lista"
|
||||
},
|
||||
"placeholder_author": {
|
||||
"message": "Författare"
|
||||
},
|
||||
"placeholder_account_email_address": {
|
||||
"message": "Kontots e-postadress"
|
||||
},
|
||||
"prefs_OptionText_placeholders_use_default_value": {
|
||||
"message": "Platshållare: använd standardvärde"
|
||||
},
|
||||
"prefs_OptionText_placeholders_use_default_value_info": {
|
||||
"message": "Om markerat kommer platshållarna att fyllas med standardvärdena när inget värde anges. Annars kommer platshållarna att behållas."
|
||||
},
|
||||
"prefs_OptionText_max_prompt_length": {
|
||||
"message": "Max promptlängd"
|
||||
},
|
||||
"prefs_OptionText_max_prompt_length_Info": {
|
||||
"message": "Detta är det maximala antalet tecken som kan användas i en prompt. Annars visas ett felmeddelande. Värdet kan inte redigeras för ChatGPT-webbgränssnittet. Ställ in det på 0 för att inaktivera kontrollen."
|
||||
},
|
||||
"prefs_OptionText_chatgpt_web_model": {
|
||||
"message": "ChatGPT webbmodell"
|
||||
},
|
||||
"prefs_OptionText_chatgpt_web_model_info": {
|
||||
"message": "Det här är modellen som kommer att tillämpas för ChatGPT:s webbgränssnitt. Om ingen modell anges eller om en felaktig modell anges, kommer standardmodellen att ställas in av ChatGPT på webbsidan. Den här inställningen fungerar inte med ett gratis ChatGPT-konto."
|
||||
},
|
||||
"prefs_OptionText_chatgpt_web_tempchat": {
|
||||
"message": "ChatGPT Web tillfällig chatt"
|
||||
},
|
||||
"prefs_OptionText_chatgpt_web_tempchat_info": {
|
||||
"message": "Om markerad kommer den tillfälliga chatten att användas i ChatGPT:s webbgränssnitt."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -23,6 +23,7 @@
|
|||
import { prefs_default, integration_options_config } from '../options/mzta-options-default.js';
|
||||
import { placeholdersUtils } from '../js/mzta-placeholders.js';
|
||||
import { getAPIsInitMessageString, convertNewlinesToBr } from '../js/mzta-utils.js';
|
||||
import { loadPrompt } from '../js/mzta-prompts.js';
|
||||
|
||||
// Get the LLM to be used
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
|
|
@ -82,6 +83,22 @@ if (worker) {
|
|||
|
||||
let prefs_api = await browser.storage.sync.get(prefsToGet);
|
||||
|
||||
if (prompt_id) {
|
||||
try {
|
||||
const prompt = await loadPrompt(prompt_id);
|
||||
if (prompt && prompt.api_type === llm) {
|
||||
for (const key in options_config) {
|
||||
const prefKey = `${integration_prefix}_${key}`;
|
||||
if (prompt[prefKey] !== undefined) {
|
||||
prefs_api[prefKey] = prompt[prefKey];
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("[ThunderAI] Error loading prompt settings:", e);
|
||||
}
|
||||
}
|
||||
|
||||
let i18nStrings = {};
|
||||
const i18n_msg_key = integration === 'openai_comp' ? 'OpenAIComp_api_request_failed' : `${integration}_api_request_failed`;
|
||||
i18nStrings[i18n_msg_key] = browser.i18n.getMessage(i18n_msg_key);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -75,9 +75,7 @@
|
|||
API Connection Type
|
||||
<api_type>: api type
|
||||
|
||||
API Model
|
||||
<api_model>: api model
|
||||
|
||||
<< All the API settings defined in the default options, with the same IDs. >>
|
||||
*/
|
||||
|
||||
const defaultPrompts = [
|
||||
|
|
@ -96,7 +94,6 @@ const defaultPrompts = [
|
|||
chatgpt_web_project: '',
|
||||
chatgpt_web_custom_gpt: '',
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "0",
|
||||
},
|
||||
|
|
@ -115,7 +112,6 @@ const defaultPrompts = [
|
|||
chatgpt_web_project: '',
|
||||
chatgpt_web_custom_gpt: '',
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "0",
|
||||
},
|
||||
|
|
@ -134,7 +130,6 @@ const defaultPrompts = [
|
|||
chatgpt_web_project: '',
|
||||
chatgpt_web_custom_gpt: '',
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "0",
|
||||
},
|
||||
|
|
@ -153,7 +148,6 @@ const defaultPrompts = [
|
|||
chatgpt_web_project: '',
|
||||
chatgpt_web_custom_gpt: '',
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "0",
|
||||
},
|
||||
|
|
@ -172,7 +166,6 @@ const defaultPrompts = [
|
|||
chatgpt_web_project: '',
|
||||
chatgpt_web_custom_gpt: '',
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "0",
|
||||
},
|
||||
|
|
@ -191,7 +184,6 @@ const defaultPrompts = [
|
|||
chatgpt_web_project: '',
|
||||
chatgpt_web_custom_gpt: '',
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "0",
|
||||
},
|
||||
|
|
@ -210,7 +202,6 @@ const defaultPrompts = [
|
|||
chatgpt_web_project: '',
|
||||
chatgpt_web_custom_gpt: '',
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "0",
|
||||
},
|
||||
|
|
@ -229,7 +220,6 @@ const defaultPrompts = [
|
|||
chatgpt_web_project: '',
|
||||
chatgpt_web_custom_gpt: '',
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "0",
|
||||
},
|
||||
|
|
@ -248,7 +238,6 @@ const defaultPrompts = [
|
|||
chatgpt_web_project: '',
|
||||
chatgpt_web_custom_gpt: '',
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "0",
|
||||
},
|
||||
|
|
@ -267,7 +256,6 @@ const defaultPrompts = [
|
|||
chatgpt_web_project: '',
|
||||
chatgpt_web_custom_gpt: '',
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "0",
|
||||
},
|
||||
|
|
@ -286,7 +274,6 @@ const specialPrompts = [
|
|||
define_response_lang: "0",
|
||||
use_diff_viewer: "0",
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "1",
|
||||
},
|
||||
|
|
@ -302,7 +289,6 @@ const specialPrompts = [
|
|||
define_response_lang: "0",
|
||||
use_diff_viewer: "0",
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "1",
|
||||
},
|
||||
|
|
@ -318,7 +304,6 @@ const specialPrompts = [
|
|||
define_response_lang: "0",
|
||||
use_diff_viewer: "0",
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "1",
|
||||
},
|
||||
|
|
@ -334,7 +319,6 @@ const specialPrompts = [
|
|||
define_response_lang: "0",
|
||||
use_diff_viewer: "0",
|
||||
api_type: '',
|
||||
api_model: '',
|
||||
is_default: "1",
|
||||
is_special: "1",
|
||||
},
|
||||
|
|
@ -440,7 +424,6 @@ async function getDefaultPrompts_withProps() {
|
|||
prompt.chatgpt_web_project = prefs._default_prompts_properties[prompt.id].chatgpt_web_project;
|
||||
prompt.chatgpt_web_custom_gpt = (prefs._default_prompts_properties[prompt.id]?.chatgpt_web_custom_gpt || '').trim();
|
||||
prompt.api_type = (prefs._default_prompts_properties[prompt.id]?.api_type || '').trim();
|
||||
prompt.api_model = (prefs._default_prompts_properties[prompt.id]?.api_model || '').trim();
|
||||
}else{
|
||||
prompt.position_display = pos;
|
||||
prompt.position_compose = pos;
|
||||
|
|
@ -475,9 +458,6 @@ async function getCustomPrompts() {
|
|||
if(prompt.api_type === undefined){
|
||||
prompt.api_type = "";
|
||||
}
|
||||
if(prompt.api_model === undefined){
|
||||
prompt.api_model = "";
|
||||
}
|
||||
});
|
||||
return prefs._custom_prompt;
|
||||
}
|
||||
|
|
@ -495,7 +475,6 @@ export async function setDefaultPromptsProperties(prompts) {
|
|||
chatgpt_web_project: (prompt.chatgpt_web_project === undefined || prompt.chatgpt_web_project === "undefined") ? "" : prompt.chatgpt_web_project,
|
||||
chatgpt_web_custom_gpt: (prompt.chatgpt_web_custom_gpt === undefined || prompt.chatgpt_web_custom_gpt === "undefined") ? "" : prompt.chatgpt_web_custom_gpt,
|
||||
api_type: (prompt.api_type === undefined || prompt.api_type === "undefined") ? "" : prompt.api_type,
|
||||
api_model: (prompt.api_model === undefined || prompt.api_model === "undefined") ? "" : prompt.api_model
|
||||
};
|
||||
});
|
||||
//console.log('>>>>>>>>>>>>>> default_prompts_properties: ' + JSON.stringify(default_prompts_properties));
|
||||
|
|
@ -590,7 +569,6 @@ export async function savePrompt(prompt) {
|
|||
|
||||
export async function clearPromptAPI(id){
|
||||
let _prompt = await loadPrompt(id);
|
||||
_prompt.api = "";
|
||||
_prompt.model = "";
|
||||
_prompt.api_type = "";
|
||||
await savePrompt(_prompt);
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -28,7 +28,6 @@
|
|||
prompt = "";
|
||||
worker = null;
|
||||
llm = "";
|
||||
custom_model = "";
|
||||
full_message = "";
|
||||
logger = null;
|
||||
do_debug = false;
|
||||
|
|
@ -38,16 +37,14 @@
|
|||
let {
|
||||
prompt = '',
|
||||
llm = '',
|
||||
custom_model = '',
|
||||
do_debug = false,
|
||||
config = {}
|
||||
} = args;
|
||||
this.prompt = prompt;
|
||||
this.llm = llm;
|
||||
this.custom_model = custom_model;
|
||||
this.config = config;
|
||||
this.logger = new taLogger('mzta_specialCommand', do_debug);
|
||||
this.do_debug = do_debug;
|
||||
this.logger = new taLogger('mzta_specialCommand', do_debug);
|
||||
|
||||
const worker_path_map = {
|
||||
chatgpt_api: './workers/model-worker-openai_responses.js',
|
||||
|
|
@ -67,7 +64,17 @@
|
|||
}
|
||||
|
||||
async initWorker() {
|
||||
const integration = this.llm.replace('_api', '');
|
||||
let integration = this.llm.replace('_api', '');
|
||||
let use_specific_api = false;
|
||||
|
||||
this.logger.log("integration: " + integration);
|
||||
|
||||
if (this.config.api_type && this.config.api_type !== '') {
|
||||
integration = this.config.api_type.replace('_api', '');
|
||||
use_specific_api = true;
|
||||
this.logger.log("use_specific_api: " + use_specific_api);
|
||||
this.logger.log("specific integration: " + integration);
|
||||
}
|
||||
const options_config = integration_options_config[integration];
|
||||
|
||||
if (!options_config) {
|
||||
|
|
@ -75,13 +82,15 @@
|
|||
throw new Error("Invalid integration type: " + integration);
|
||||
}
|
||||
|
||||
let prefsToGet = {};
|
||||
for (const key in options_config) {
|
||||
const prefsToGet = {};
|
||||
const configKeys = Object.keys(options_config);
|
||||
|
||||
for (const key of configKeys) {
|
||||
const prefKey = `${integration}_${key}`;
|
||||
prefsToGet[prefKey] = prefs_default[prefKey];
|
||||
}
|
||||
|
||||
let prefs_api = await browser.storage.sync.get(prefsToGet);
|
||||
const prefs_api = await browser.storage.sync.get(prefsToGet);
|
||||
|
||||
let workerInitMessage = {
|
||||
type: 'init',
|
||||
|
|
@ -89,24 +98,23 @@
|
|||
i18nStrings: ''
|
||||
};
|
||||
|
||||
for (const key in options_config) {
|
||||
for (const key of configKeys) {
|
||||
const prefKey = `${integration}_${key}`;
|
||||
let value = prefs_api[prefKey];
|
||||
|
||||
const configValue = this.config[prefKey];
|
||||
|
||||
if (configValue !== undefined) {
|
||||
if (typeof options_config[key] === 'boolean') {
|
||||
prefs_api[prefKey] = (configValue === true || configValue === 'true' || configValue === 1);
|
||||
} else {
|
||||
prefs_api[prefKey] = configValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (key === 'model') {
|
||||
workerInitMessage[prefKey] = this.custom_model !== '' ? this.custom_model : prefs_api[prefKey];
|
||||
} else {
|
||||
workerInitMessage[prefKey] = prefs_api[prefKey];
|
||||
if(use_specific_api){
|
||||
const configValue = this.config[prefKey];
|
||||
|
||||
if (configValue !== undefined) {
|
||||
if (typeof options_config[key] === 'boolean') {
|
||||
value = (configValue === true || configValue === 'true' || configValue === 1);
|
||||
} else {
|
||||
value = configValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
workerInitMessage[prefKey] = value;
|
||||
}
|
||||
|
||||
this.worker.postMessage(workerInitMessage);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -408,10 +408,11 @@ export async function createTag(tag) {
|
|||
let prefs_tag = await browser.storage.sync.get({ add_tags_first_uppercase: prefs_default.add_tags_first_uppercase });
|
||||
if(prefs_tag.add_tags_first_uppercase) tag = tag.toLowerCase().charAt(0).toUpperCase() + tag.toLowerCase().slice(1);
|
||||
try {
|
||||
const tagKey = '$ta-' + generateCallID(16) + '-' + sanitizeString(tag); // Ensure uniqueness with a longer random ID
|
||||
if(await isThunderbird128OrGreater()) {
|
||||
return browser.messages.tags.create('$ta-'+sanitizeString(tag), tag, generateHexColorForTag());
|
||||
return browser.messages.tags.create(tagKey, tag, generateHexColorForTag());
|
||||
}else{
|
||||
return browser.messages.createTag('$ta-'+sanitizeString(tag), tag, generateHexColorForTag());
|
||||
return browser.messages.createTag(tagKey, tag, generateHexColorForTag());
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('[ThunderAI] Error creating tag:', error);
|
||||
|
|
@ -648,7 +649,9 @@ export function getConnectionType(prefsOrType, prompt, prefixOrSpecific = null)
|
|||
}
|
||||
|
||||
if (specificType && specificType !== '') return specificType;
|
||||
if (prompt && prompt.api && prompt.api !== '') return prompt.api;
|
||||
if (prompt) {
|
||||
if (prompt.api_type && prompt.api_type !== '') return prompt.api_type;
|
||||
}
|
||||
return defaultType;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -417,6 +417,9 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_
|
|||
prefs = checkScreenDimensions(prefs);
|
||||
//console.log(">>>>>>>>>>>>>>>> prefs: " + JSON.stringify(prefs));
|
||||
// console.log(">>>>>>>>>>>>>>>> prompt_info: " + JSON.stringify(prompt_info));
|
||||
|
||||
prefs.connection_type = getConnectionType(prefs, prompt_info);
|
||||
|
||||
taLog.log("Prompt length: " + promptText.length);
|
||||
let _max_prompt_length = prefs.max_prompt_length;
|
||||
if(prefs.connection_type == 'chatgpt_web'){
|
||||
|
|
@ -1084,7 +1087,7 @@ async function processEmails(messages, addTagsAuto, spamFilter) {
|
|||
...getDynamicSettingsDefaults(['use_specific_integration', 'connection_type']),
|
||||
do_debug: prefs_default.do_debug,
|
||||
});
|
||||
|
||||
// console.log(">>>>>>>>>>>>>>>> getDynamicSettingsDefaults: " + JSON.stringify(getDynamicSettingsDefaults(['use_specific_integration', 'connection_type'])));
|
||||
for await (let message of messages) {
|
||||
let curr_fullMessage = null;
|
||||
let msg_text = null;
|
||||
|
|
@ -1126,6 +1129,7 @@ async function processEmails(messages, addTagsAuto, spamFilter) {
|
|||
specialFullPrompt_add_tags = taPromptUtils.finalizePrompt_add_tags(specialFullPrompt_add_tags, prefs_aats.add_tags_maxnum, prefs_aats.add_tags_force_lang, prefs_aats.default_chatgpt_lang, prefs_aats.add_tags_auto_uselist, prefs_aats.add_tags_auto_uselist_list);
|
||||
taLog.log("Special prompt: " + specialFullPrompt_add_tags);
|
||||
// console.log(">>>>>>>>>> curr_prompt_add_tags.model: " + curr_prompt_add_tags.model);
|
||||
// console.log(">>>>>>>>>>>>>>>>> getConnectionType add_tags:" + JSON.stringify(getConnectionType(prefs_aats, curr_prompt_add_tags, 'add_tags')));
|
||||
let cmd_addTags = new mzta_specialCommand({
|
||||
prompt: specialFullPrompt_add_tags,
|
||||
llm: getConnectionType(prefs_aats, curr_prompt_add_tags, 'add_tags'),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -163,6 +163,10 @@ div#miczTranslate{
|
|||
color: #292929;
|
||||
}
|
||||
|
||||
label:has(input[type="checkbox"]) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: rgb(35, 34, 43);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1022,7 +1022,7 @@ export async function initializeSpecificIntegrationUI({
|
|||
let prompt = await loadPrompt(promptId);
|
||||
if(!prompt) return;
|
||||
|
||||
prompt.api = conntype;
|
||||
prompt.api_type = conntype;
|
||||
|
||||
for (const [integration, options] of Object.entries(integration_options_config)) {
|
||||
for (const key of Object.keys(options)) {
|
||||
|
|
|
|||
|
|
@ -167,6 +167,9 @@ table#miczPrefs tr:last-child td {
|
|||
color: red;
|
||||
}
|
||||
|
||||
label:has(input[type="checkbox"]) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -48,11 +48,11 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
let specialPrompts = await getSpecialPrompts();
|
||||
let addtags_prompt = specialPrompts.find(prompt => prompt.id === 'prompt_add_tags');
|
||||
|
||||
if (addtags_prompt && addtags_prompt.api && addtags_prompt.api !== '') {
|
||||
if (addtags_prompt && addtags_prompt.api_type && addtags_prompt.api_type !== '') {
|
||||
let update_prefs = {};
|
||||
update_prefs['add_tags_connection_type'] = addtags_prompt.api;
|
||||
update_prefs['add_tags_connection_type'] = addtags_prompt.api_type;
|
||||
|
||||
let integration = addtags_prompt.api.replace('_api', '');
|
||||
let integration = addtags_prompt.api_type.replace('_api', '');
|
||||
if (integration_options_config && integration_options_config[integration]) {
|
||||
for (const key of Object.keys(integration_options_config[integration])) {
|
||||
if (addtags_prompt[key] !== undefined) {
|
||||
|
|
@ -344,14 +344,18 @@ async function restoreOptions() {
|
|||
let addtags_prompt = specialPrompts.find(prompt => prompt.id === 'prompt_add_tags');
|
||||
|
||||
if (addtags_prompt) {
|
||||
if (addtags_prompt.api && addtags_prompt.api !== '') {
|
||||
getting['add_tags_connection_type'] = addtags_prompt.api;
|
||||
if (addtags_prompt.api_type && addtags_prompt.api_type !== '') {
|
||||
getting['add_tags_connection_type'] = addtags_prompt.api_type;
|
||||
} else {
|
||||
getting['add_tags_connection_type'] = getting['connection_type'];
|
||||
}
|
||||
for (const [integration, options] of Object.entries(integration_options_config)) {
|
||||
for (const key of Object.keys(options)) {
|
||||
const propName = `${integration}_${key}`;
|
||||
if (addtags_prompt[propName] !== undefined) {
|
||||
if (addtags_prompt[propName] !== undefined && addtags_prompt[propName] !== '') {
|
||||
getting[`add_tags_${propName}`] = addtags_prompt[propName];
|
||||
} else {
|
||||
getting[`add_tags_${propName}`] = getting[propName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,6 +302,10 @@ input.input_additional[type="text"]{
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
label:has(input[type="checkbox"]) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: #1C1B22;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -220,9 +220,9 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
};
|
||||
}
|
||||
|
||||
document.getElementById('btnManagePrompts').addEventListener('click', () => {
|
||||
openTab('/pages/customprompts/mzta-custom-prompts.html');
|
||||
});
|
||||
// document.getElementById('btnManagePrompts').addEventListener('click', () => {
|
||||
// openTab('/pages/customprompts/mzta-custom-prompts.html');
|
||||
// });
|
||||
|
||||
}, { once: true });
|
||||
|
||||
|
|
|
|||
|
|
@ -326,6 +326,10 @@ input.input_additional[type="text"]{
|
|||
text-decoration: underline;
|
||||
}
|
||||
|
||||
label:has(input[type="checkbox"]) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: #1C1B22;
|
||||
|
|
|
|||
|
|
@ -62,15 +62,15 @@
|
|||
<td rowspan="2" class="w19">
|
||||
<label class="field_title">__MSG_customPrompts_Properties__:</label>
|
||||
<br>
|
||||
<span class="need_selected_span"><input type="checkbox" id="checkboxNeedSelectedNew" name="need_selected" class="need_selected_new" value="1" tabindex="6"> <label for="checkboxNeedSelectedNew">__MSG_customPrompts_form_label_need_selected__</label></span>
|
||||
<label for="checkboxNeedSelectedNew"><span class="need_selected_span"><input type="checkbox" id="checkboxNeedSelectedNew" name="need_selected" class="need_selected_new" value="1" tabindex="6"> __MSG_customPrompts_form_label_need_selected__</label></span>
|
||||
<br>
|
||||
<input type="checkbox" id="checkboxNeedSignatureNew" name="need_signature" value="1" tabindex="7"> <label for="checkboxNeedSignatureNew">__MSG_customPrompts_form_label_need_signature__</label>
|
||||
<label for="checkboxNeedSignatureNew"><input type="checkbox" id="checkboxNeedSignatureNew" name="need_signature" value="1" tabindex="7"> __MSG_customPrompts_form_label_need_signature__</label>
|
||||
<br>
|
||||
<span class="need_custom_text_span"><input type="checkbox" id="checkboxNeedCustomTextNew" name="need_custom_text" class="need_custom_text_new" value="1" tabindex="8"> <label for="checkboxNeedCustomTextNew">__MSG_customPrompts_form_label_need_custom_text__</label></span>
|
||||
<label for="checkboxNeedCustomTextNew"><span class="need_custom_text_span"><input type="checkbox" id="checkboxNeedCustomTextNew" name="need_custom_text" class="need_custom_text_new" value="1" tabindex="8"> __MSG_customPrompts_form_label_need_custom_text__</label></span>
|
||||
<br>
|
||||
<input type="checkbox" id="checkboxDefineResponseLangNew" name="define_response_lang" value="1" tabindex="8"> <label for="checkboxDefineResponseLangNew">__MSG_customPrompts_form_label_define_response_lang__</label>
|
||||
<label for="checkboxDefineResponseLangNew"><input type="checkbox" id="checkboxDefineResponseLangNew" name="define_response_lang" value="1" tabindex="8"> __MSG_customPrompts_form_label_define_response_lang__</label>
|
||||
<br>
|
||||
<input type="checkbox" id="checkboxUseDiffViewerNew" name="use_diff_viewer" value="1" tabindex="9" title="__MSG_customPrompts_form_label_use_diff_viewer_title__"> <label for="checkboxUseDiffViewerNew" title="__MSG_customPrompts_form_label_use_diff_viewer_title__">__MSG_customPrompts_form_label_use_diff_viewer__</label>
|
||||
<label for="checkboxUseDiffViewerNew" title="__MSG_customPrompts_form_label_use_diff_viewer_title__"><input type="checkbox" id="checkboxUseDiffViewerNew" name="use_diff_viewer" value="1" tabindex="9" title="__MSG_customPrompts_form_label_use_diff_viewer_title__"> __MSG_customPrompts_form_label_use_diff_viewer__</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -218,21 +218,6 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
});
|
||||
});
|
||||
|
||||
// switch(prefs.connection_type) {
|
||||
// case 'chatgpt_api':
|
||||
// document.getElementById('chatgpt_api').style.display = 'block';
|
||||
// break;
|
||||
// case 'ollama_api':
|
||||
// document.getElementById('ollama_api').style.display = 'block';
|
||||
// break;
|
||||
// case 'openai_comp_api':
|
||||
// document.getElementById('openai_comp_api').style.display = 'block';
|
||||
// break;
|
||||
// case 'google_gemini_api':
|
||||
// document.getElementById('google_gemini_api').style.display = 'block';
|
||||
// break;
|
||||
// }
|
||||
|
||||
const chatgptWebAdditionalPropToggle = document.getElementById('chatgpt_web_additional_info_toggle');
|
||||
chatgptWebAdditionalPropToggle.addEventListener('click', (e) => {
|
||||
e.preventDefault();
|
||||
|
|
@ -476,7 +461,7 @@ document.getElementById('btnManageCustomDataPH').addEventListener('click', () =>
|
|||
function handleEditClick(e) {
|
||||
e.preventDefault();
|
||||
const tr = e.target.parentNode.parentNode;
|
||||
const id = tr.querySelector('.id_output').value;
|
||||
const id = tr.querySelector('.id_output').value.toLowerCase();
|
||||
|
||||
// Inject Connection UI if needed
|
||||
const anchorId = `api_ui_anchor_${id}`;
|
||||
|
|
@ -516,6 +501,7 @@ function handleEditClick(e) {
|
|||
tr.querySelector('.btnDeleteItem').style.display = 'none'; // Delete btn
|
||||
showItemRowEditor(tr);
|
||||
toggleDiffviewer(e);
|
||||
toggleAdditionalPropertiesShow(tr);
|
||||
}
|
||||
|
||||
function populateConnectionUI(tr, id, prefix, selectId) {
|
||||
|
|
@ -599,50 +585,40 @@ function hideItemRowEditor(tr) {
|
|||
}
|
||||
|
||||
function toggleAdditionalPropertiesShow(tr) {
|
||||
switch(prefs.connection_type) {
|
||||
case 'chatgpt_web': {
|
||||
let element = tr.querySelector('.chatgpt_web_additional_info_show');
|
||||
let chatGPTWebModel_show = tr.querySelector('.chatgpt_web_model_show');
|
||||
let chatGPTWebProject_show = tr.querySelector('.chatgpt_web_project_show');
|
||||
let chatGPTWebCustomGPT_show = tr.querySelector('.chatgpt_web_custom_gpt_show');
|
||||
|
||||
if ((chatGPTWebModel_show.innerText !== '' && chatGPTWebModel_show.innerText !== 'undefined') ||
|
||||
(chatGPTWebProject_show.innerText !== '' && chatGPTWebProject_show.innerText !== 'undefined') ||
|
||||
(chatGPTWebCustomGPT_show.innerText !== '' && chatGPTWebCustomGPT_show.innerText !== 'undefined')) {
|
||||
element.style.display = 'flex';
|
||||
} else {
|
||||
element.style.display = 'none';
|
||||
}
|
||||
|
||||
if(chatGPTWebModel_show.innerText === '' || chatGPTWebModel_show.innerText === 'undefined') {
|
||||
chatGPTWebModel_show.parentNode.style.display = 'none';
|
||||
} else {
|
||||
chatGPTWebModel_show.parentNode.style.display = 'inline';
|
||||
}
|
||||
if(chatGPTWebProject_show.innerText === '' || chatGPTWebProject_show.innerText === 'undefined') {
|
||||
chatGPTWebProject_show.parentNode.style.display = 'none';
|
||||
} else {
|
||||
chatGPTWebProject_show.parentNode.style.display = 'inline';
|
||||
}
|
||||
if(chatGPTWebCustomGPT_show.innerText === '' || chatGPTWebCustomGPT_show.innerText === 'undefined') {
|
||||
chatGPTWebCustomGPT_show.parentNode.style.display = 'none';
|
||||
} else {
|
||||
chatGPTWebCustomGPT_show.parentNode.style.display = 'inline';
|
||||
}
|
||||
break;
|
||||
// console.log(">>>>>>>>>>>>>>>>> toggleAdditionalPropertiesShow tr.querySelector('.api_type_show').innerText: " + tr.querySelector('.api_type_show').innerText);
|
||||
let element = tr.querySelector('.chatgpt_web_additional_info_show');
|
||||
let chatGPTWebModel_show = tr.querySelector('.chatgpt_web_model_show');
|
||||
let chatGPTWebProject_show = tr.querySelector('.chatgpt_web_project_show');
|
||||
let chatGPTWebCustomGPT_show = tr.querySelector('.chatgpt_web_custom_gpt_show');
|
||||
if(prefs.connection_type == 'chatgpt_web' && tr.querySelector('.api_type_show').innerText == '') {
|
||||
if ((chatGPTWebModel_show.innerText !== '' && chatGPTWebModel_show.innerText !== 'undefined') ||
|
||||
(chatGPTWebProject_show.innerText !== '' && chatGPTWebProject_show.innerText !== 'undefined') ||
|
||||
(chatGPTWebCustomGPT_show.innerText !== '' && chatGPTWebCustomGPT_show.innerText !== 'undefined')) {
|
||||
element.style.display = 'flex';
|
||||
} else {
|
||||
element.style.display = 'none';
|
||||
}
|
||||
// case 'chatgpt_api':
|
||||
// document.getElementById('chatgpt_api').style.display = 'block';
|
||||
// break;
|
||||
// case 'ollama_api':
|
||||
// document.getElementById('ollama_api').style.display = 'block';
|
||||
// break;
|
||||
// case 'openai_comp_api':
|
||||
// document.getElementById('openai_comp_api').style.display = 'block';
|
||||
// break;
|
||||
// case 'google_gemini_api':
|
||||
// document.getElementById('google_gemini_api').style.display = 'block';
|
||||
// break;
|
||||
|
||||
if(chatGPTWebModel_show.innerText === '' || chatGPTWebModel_show.innerText === 'undefined') {
|
||||
chatGPTWebModel_show.parentNode.style.display = 'none';
|
||||
} else {
|
||||
chatGPTWebModel_show.parentNode.style.display = 'inline';
|
||||
}
|
||||
if(chatGPTWebProject_show.innerText === '' || chatGPTWebProject_show.innerText === 'undefined') {
|
||||
chatGPTWebProject_show.parentNode.style.display = 'none';
|
||||
} else {
|
||||
chatGPTWebProject_show.parentNode.style.display = 'inline';
|
||||
}
|
||||
if(chatGPTWebCustomGPT_show.innerText === '' || chatGPTWebCustomGPT_show.innerText === 'undefined') {
|
||||
chatGPTWebCustomGPT_show.parentNode.style.display = 'none';
|
||||
} else {
|
||||
chatGPTWebCustomGPT_show.parentNode.style.display = 'inline';
|
||||
}
|
||||
}else{
|
||||
element.style.display = 'none';
|
||||
chatGPTWebModel_show.parentNode.style.display = 'none';
|
||||
chatGPTWebProject_show.parentNode.style.display = 'none';
|
||||
chatGPTWebCustomGPT_show.parentNode.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -664,33 +640,18 @@ function toggleApiPropertiesShow(tr) {
|
|||
}
|
||||
|
||||
function toggleAdditionalPropertiesEditor(tr) {
|
||||
switch(prefs.connection_type) {
|
||||
case 'chatgpt_web': {
|
||||
let info_toggle = tr.querySelector('.chatgpt_web_additional_info_toggle');
|
||||
info_toggle.style.display = 'block';
|
||||
let chatGPTWebModel_show = tr.querySelector('.chatgpt_web_model_show').innerText;
|
||||
let chatGPTWebProject_show = tr.querySelector('.chatgpt_web_project_show').innerText;
|
||||
let chatGPTWebCustomGPT_show = tr.querySelector('.chatgpt_web_custom_gpt_show').innerText;
|
||||
if(prefs.connection_type == 'chatgpt_web' && tr.querySelector('.api_type_show').innerText == '') {
|
||||
let info_toggle = tr.querySelector('.chatgpt_web_additional_info_toggle');
|
||||
info_toggle.style.display = 'block';
|
||||
let chatGPTWebModel_show = tr.querySelector('.chatgpt_web_model_show').innerText;
|
||||
let chatGPTWebProject_show = tr.querySelector('.chatgpt_web_project_show').innerText;
|
||||
let chatGPTWebCustomGPT_show = tr.querySelector('.chatgpt_web_custom_gpt_show').innerText;
|
||||
|
||||
if ((chatGPTWebModel_show !== '' && chatGPTWebModel_show !== 'undefined') ||
|
||||
(chatGPTWebProject_show !== '' && chatGPTWebProject_show !== 'undefined') ||
|
||||
(chatGPTWebCustomGPT_show !== '' && chatGPTWebCustomGPT_show !== 'undefined')) {
|
||||
info_toggle.click();
|
||||
}
|
||||
break;
|
||||
if ((chatGPTWebModel_show !== '' && chatGPTWebModel_show !== 'undefined') ||
|
||||
(chatGPTWebProject_show !== '' && chatGPTWebProject_show !== 'undefined') ||
|
||||
(chatGPTWebCustomGPT_show !== '' && chatGPTWebCustomGPT_show !== 'undefined')) {
|
||||
info_toggle.click();
|
||||
}
|
||||
// case 'chatgpt_api':
|
||||
// document.getElementById('chatgpt_api').style.display = 'block';
|
||||
// break;
|
||||
// case 'ollama_api':
|
||||
// document.getElementById('ollama_api').style.display = 'block';
|
||||
// break;
|
||||
// case 'openai_comp_api':
|
||||
// document.getElementById('openai_comp_api').style.display = 'block';
|
||||
// break;
|
||||
// case 'google_gemini_api':
|
||||
// document.getElementById('google_gemini_api').style.display = 'block';
|
||||
// break;
|
||||
}
|
||||
|
||||
let api_info_toggle = tr.querySelector('.api_additional_info_toggle');
|
||||
|
|
@ -753,8 +714,7 @@ function handleCancelClick(e) {
|
|||
tr.querySelector('.chatgpt_web_project_output').value = tr.querySelector('.chatgpt_web_project_show').innerText;
|
||||
tr.querySelector('.chatgpt_web_custom_gpt_output').value = tr.querySelector('.chatgpt_web_custom_gpt_show').innerText;
|
||||
tr.querySelector('.api_additional_info_toggle').innerText = browser.i18n.getMessage('customPrompts_show_additional_info') + ' [API]';
|
||||
tr.querySelector('.api_additional_info_show').style.display = 'block';
|
||||
|
||||
toggleApiPropertiesShow(tr);
|
||||
hideItemRowEditor(tr);
|
||||
}
|
||||
|
||||
|
|
@ -803,8 +763,7 @@ function handleConfirmClick(e) {
|
|||
tr.querySelector('.action_show').innerText = tr.querySelector('.action_output').selectedOptions[0].text;
|
||||
if (newValues.api_type !== '') {
|
||||
tr.querySelector('.api_type_show').innerText = newValues.api_type;
|
||||
tr.querySelector('.api_additional_info_show').style.display = 'block';
|
||||
tr.querySelector('.api_additional_info_row').style.display = 'block';
|
||||
toggleApiPropertiesShow(tr);
|
||||
|
||||
}
|
||||
// the checkboxes update is handled directly by themselves
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ table#miczPrefs tr:last-child td {
|
|||
color: red;
|
||||
}
|
||||
|
||||
label:has(input[type="checkbox"]) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ table#miczPrefs tr:last-child td {
|
|||
color: red;
|
||||
}
|
||||
|
||||
label:has(input[type="checkbox"]) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -127,6 +127,10 @@ table#report_data th {
|
|||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
label:has(input[type="checkbox"]) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: #1C1B22;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -16,7 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { prefs_default, integration_options_config } from '../../options/mzta-options-default.js';
|
||||
import {
|
||||
prefs_default,
|
||||
integration_options_config
|
||||
} from '../../options/mzta-options-default.js';
|
||||
import { taLogger } from '../../js/mzta-logger.js';
|
||||
import {
|
||||
getSpecialPrompts,
|
||||
|
|
@ -42,6 +45,21 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
let specialPrompts = await getSpecialPrompts();
|
||||
let spamfilter_prompt = specialPrompts.find(prompt => prompt.id === 'prompt_spamfilter');
|
||||
|
||||
if (spamfilter_prompt && spamfilter_prompt.api_type && spamfilter_prompt.api_type !== '') {
|
||||
let update_prefs = {};
|
||||
update_prefs['spamfilter_connection_type'] = spamfilter_prompt.api_type;
|
||||
|
||||
let integration = spamfilter_prompt.api_type.replace('_api', '');
|
||||
if (integration_options_config && integration_options_config[integration]) {
|
||||
for (const key of Object.keys(integration_options_config[integration])) {
|
||||
if (spamfilter_prompt[key] !== undefined) {
|
||||
update_prefs[`spamfilter_${integration}_${key}`] = spamfilter_prompt[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
await browser.storage.sync.set(update_prefs);
|
||||
}
|
||||
|
||||
await initializeSpecificIntegrationUI({
|
||||
prefix: 'spamfilter',
|
||||
promptId: 'prompt_spamfilter',
|
||||
|
|
@ -313,14 +331,18 @@ async function restoreOptions() {
|
|||
let spamfilter_prompt = specialPrompts.find(prompt => prompt.id === 'prompt_spamfilter');
|
||||
|
||||
if (spamfilter_prompt) {
|
||||
if (spamfilter_prompt.api && spamfilter_prompt.api !== '') {
|
||||
getting['spamfilter_connection_type'] = spamfilter_prompt.api;
|
||||
if (spamfilter_prompt.api_type && spamfilter_prompt.api_type !== '') {
|
||||
getting['spamfilter_connection_type'] = spamfilter_prompt.api_type;
|
||||
} else {
|
||||
getting['spamfilter_connection_type'] = getting['connection_type'];
|
||||
}
|
||||
for (const [integration, options] of Object.entries(integration_options_config)) {
|
||||
for (const key of Object.keys(options)) {
|
||||
const propName = `${integration}_${key}`;
|
||||
if (spamfilter_prompt[propName] !== undefined) {
|
||||
if (spamfilter_prompt[propName] !== undefined && spamfilter_prompt[propName] !== '') {
|
||||
getting[`spamfilter_${propName}`] = spamfilter_prompt[propName];
|
||||
} else {
|
||||
getting[`spamfilter_${propName}`] = getting[propName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ThunderAI [https://micz.it/thunderbird-addon-thunderai/]
|
||||
* Copyright (C) 2024 - 2025 Mic (m@micz.it)
|
||||
* Copyright (C) 2024 - 2026 Mic (m@micz.it)
|
||||
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
Loading…
Reference in a new issue