From 0b0adb0a3a7df7ac92a00f2c86a133427776094e Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 17 Apr 2024 23:51:35 +0200 Subject: [PATCH] Waiting for CahtGPT4 to load if the option is active. Related to #27 --- _locales/en/messages.json | 5 ++++ _locales/it/messages.json | 5 ++++ js/mzta-chatgpt.js | 53 +++++++++++++++++++++++++++++++++------ 3 files changed, 56 insertions(+), 7 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 26e937bf..e118faa6 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -79,6 +79,11 @@ "description": "" }, + "chatgpt_win_model_warning": { + "message": "You have set the option to use ChatGPT-4, but it seems that it is not loading correctly. Have you chosen the right model at the top?", + "description": "" + }, + "msg_prompt_too_long": { "message": "The text you provided is too long. You need to reduce it to use ChatGPT.", "description": "" diff --git a/_locales/it/messages.json b/_locales/it/messages.json index 30dfb118..7f3bad88 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -79,6 +79,11 @@ "description": "" }, + "chatgpt_win_model_warnings": { + "message": "Hai impostato l'opzione per utilizzare ChatGPT-4, ma sembra che non si stia caricando. Hai selezionato correttamente l'opzione in alto?", + "description": "" + }, + "msg_prompt_too_long": { "message": "Il testo che vuoi inviare a ChatGPT รจ troppo lungo. Devi ridurlo per poter procedere.", "description": "" diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js index 20aa2c7c..e1639b6d 100644 --- a/js/mzta-chatgpt.js +++ b/js/mzta-chatgpt.js @@ -113,24 +113,31 @@ function addCustomDiv(prompt_action,tabId) { style.innerHTML += "#mzta-ok_btn {background-color: #007bff;border: none;color: white;padding: 8px 15px;text-align: center;text-decoration: none;display: inline-block;font-size: 16px;margin: 4px 2px;transition-duration: 0.4s;cursor: pointer;border-radius: 5px;}"; style.innerHTML += "#mzta-ok_btn:hover {background-color: #0056b3;color: white;}"; style.innerHTML += "#mzta-loading{height:50px;display:inline-block;}"; + style.innerHTML += "#mzta-model_warn{height:50px;position:absolute;top:0px;right:3px;width:30%;text-align:right;font-size:12px;color:red;display:none;}"; // Add