From 0daeded711aac120bf9b7145749913c100a8825e Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 18 Jun 2024 21:56:34 +0200 Subject: [PATCH 01/32] chatgpt_getFromDOM returns an HTML string for the last answer --- js/mzta-chatgpt.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js index 9d2f3d28..b4be585f 100644 --- a/js/mzta-chatgpt.js +++ b/js/mzta-chatgpt.js @@ -79,10 +79,24 @@ async function chatgpt_getFromDOM(pos) { } // Extract the new HTML string responseDivs[responseDivs.length - 1].innerHTML = doc.body.innerHTML; - response = responseDivs[responseDivs.length - 1].textContent; + //response = responseDivs[responseDivs.length - 1].textContent; + response = responseDivs[responseDivs.length - 1].innerHTML; + const parser2 = new DOMParser(); + const doc2 = parser2.parseFromString(response, 'text/html'); + + // Get all elements in the parsed document + const allElements = doc2.body.querySelectorAll('*'); + + // Tags to exclude + const excludeTags = ['div', 'text', 'svg', 'path', 'button']; + // Filter out elements that should be excluded + const keepElements = Array.from(allElements).filter(element => !excludeTags.includes(element.tagName.toLowerCase())); + + // Create a new HTML string containing all non-div elements in order + response = keepElements.map(element => element.outerHTML).join(''); //console.log('chatgpt_getFromDOM: '+response); //console.log('chatgpt_getFromDOM: [HTML] ' + responseDivs[responseDivs.length - 1].innerHTML.replace(/]*>/gi, '').replace(/<\\/div>/gi, '').replace(/]*>/gi, '').replace(/<\\/svg>/gi, '').replace(/]*>/gi, '').replace(/<\\/path>/gi, '').replace(/]*>/gi, '').replace(/<\\/text>/gi, '').replace(/]*>/gi, '').replace(/<\\/span>/gi, '').replace(/]*>/gi, '').replace(/<\\/button>/gi, '')); - } else { // get nth response + } else { // get nth response --- HERE ONLY TEXT FROM RESPONSE, NO HTML const nthOfResponse = ( // Calculate base number @@ -109,7 +123,7 @@ async function chatgpt_getFromDOM(pos) { } response = response.replace(/^ChatGPT(?:ChatGPT)?/, ''); // strip sender name response = response.trim().replace(/^"|"$/g, ''); // strip quotation marks - //console.log('chatgpt_getFromDOM: ' + response); + console.log('>>>>>>>>>>>>>> chatgpt_getFromDOM: ' + JSON.stringify(response)); } return response; } From 2e076d7b7bef2ce8c59b440b64599947220d8e47 Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 18 Jun 2024 21:57:01 +0200 Subject: [PATCH 02/32] removed makeParagraphs, using an html string directly --- js/mzta-compose-script.js | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/js/mzta-compose-script.js b/js/mzta-compose-script.js index a5d4077a..7188ff87 100644 --- a/js/mzta-compose-script.js +++ b/js/mzta-compose-script.js @@ -16,24 +16,6 @@ * along with this program. If not, see . */ -// Some methods are a modified version derived from https://github.com/ali-raheem/Aify/blob/13ff87583bc520fb80f555ab90a90c5c9df797a7/plugin/content_scripts/compose.js - -const makeParagraphs = (text, func) => { - const chunks = text.split(/\n{2,}/); - if (chunks.length == 1) { - return func(document.createTextNode(text)); - } - const paragraphs = chunks.map((t) => { - const p = document.createElement("p"); - p.innerText = t; - return p; - }); - for (let i = paragraphs.length - 1; i >= 0; i--) { - func(paragraphs[i]); - } -}; - - browser.runtime.onMessage.addListener(async (message) => { switch (message.command) { case "getSelectedText": @@ -50,9 +32,10 @@ switch (message.command) { } const r = sel.getRangeAt(0); r.deleteContents(); - makeParagraphs(message.text, function (p) { - r.insertNode(p); - }); + const parser = new DOMParser(); + const doc = parser.parseFromString(message.text, 'text/html'); + console.log(JSON.stringify(doc)); + r.insertNode(doc.body); browser.runtime.sendMessage({command: "compose_reloadBody", tabId: message.tabId}); break; From 367871eb3de6535da23f47ed8f2c115be1841965 Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 18 Jun 2024 22:00:10 +0200 Subject: [PATCH 03/32] version set to 1.1.4pre1 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 59b48e64..f6267c26 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "ThunderAI", "description": "__MSG_extensionDescription__", - "version": "1.1.3", + "version": "1.1.4pre1", "author": "Mic (m@micz.it)", "homepage_url": "https://micz.it/thunderbird-addon-thunderai/", "browser_specific_settings": { From faabd69924852daeafcd73a922bbea5e99d0d1eb Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 18 Jun 2024 22:01:15 +0200 Subject: [PATCH 04/32] removed useless import --- mzta-background.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mzta-background.js b/mzta-background.js index 1f2eefcb..bcb782b1 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -19,7 +19,7 @@ import { mzta_script } from './js/mzta-chatgpt.js'; import { prefs_default } from './options/mzta-options-default.js'; import { mzta_Menus } from './js/mzta-menus.js'; -import { getCurrentIdentity, getOriginalBody, reloadBody, replaceBody, setBody } from './js/mzta-utils.js'; +import { getCurrentIdentity, getOriginalBody, replaceBody, setBody } from './js/mzta-utils.js'; var createdWindowID = null; var original_html = ''; @@ -69,6 +69,7 @@ messenger.runtime.onMessage.addListener(async (message, sender, sendResponse) => return true; case 'chatgpt_replyMessage': const paragraphsHtmlString = message.text; + console.log(">>>>>>>>>>>> paragraphsHtmlString: " + paragraphsHtmlString); let prefs = await browser.storage.sync.get({reply_type: 'reply_all'}); //console.log('reply_type: ' + prefs.reply_type); let replyType = 'replyToAll'; From 8b01b2fa7ff846e346f7d7a0192f23d39e0c1fa9 Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 18 Jun 2024 22:08:16 +0200 Subject: [PATCH 05/32] removed debug console.log --- js/mzta-compose-script.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/mzta-compose-script.js b/js/mzta-compose-script.js index 7188ff87..12617313 100644 --- a/js/mzta-compose-script.js +++ b/js/mzta-compose-script.js @@ -34,7 +34,6 @@ switch (message.command) { r.deleteContents(); const parser = new DOMParser(); const doc = parser.parseFromString(message.text, 'text/html'); - console.log(JSON.stringify(doc)); r.insertNode(doc.body); browser.runtime.sendMessage({command: "compose_reloadBody", tabId: message.tabId}); break; From 129b2998fcdede1da204bb6597c239a7a76292eb Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 18 Jun 2024 23:07:57 +0200 Subject: [PATCH 06/32] insertText renamed to insertHtml is now inserting Html elements instead of plain text --- js/mzta-utils.js | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/js/mzta-utils.js b/js/mzta-utils.js index 8ba040b9..66f81f10 100644 --- a/js/mzta-utils.js +++ b/js/mzta-utils.js @@ -78,11 +78,11 @@ export async function setBody(tabId, fullHtmlBody){ await messenger.compose.setComposeDetails(tabId, {body: fullHtmlBody}); } -export async function replaceBody(tabId, text){ +export async function replaceBody(tabId, replyHtml) { let composeDetails = await messenger.compose.getComposeDetails(tabId); let originalHtmlBody = composeDetails.body; //console.log('originalHtmlBody: ' + originalHtmlBody); - let fullBody = insertText(text, originalHtmlBody); + let fullBody = insertHtml(replyHtml, originalHtmlBody); //console.log('fullBody: ' + fullBody); await messenger.compose.setComposeDetails(tabId, {body: fullBody}); } @@ -90,9 +90,10 @@ export async function replaceBody(tabId, text){ // The following methods are a modified version derived from https://github.com/ali-raheem/Aify/blob/13ff87583bc520fb80f555ab90a90c5c9df797a7/plugin/content_scripts/compose.js -const insertText = function (text, fullBody_string) { +const insertHtml = function (replyHtml, fullBody_string) { const parser = new DOMParser(); let fullBody = parser.parseFromString(fullBody_string, "text/html"); + let reply = parser.parseFromString(replyHtml, "text/html"); // looking for the first quoted mail or the signature, which come first in case of "signature above the quote". const prefix_quote = fullBody.getElementsByClassName("moz-cite-prefix"); @@ -119,25 +120,16 @@ const insertText = function (text, fullBody_string) { } let final_p = document.createElement("p"); - final_p.innerHTML = "



"; + let br1 = document.createElement("br"); + let br2 = document.createElement("br"); + final_p.appendChild(br1); + final_p.appendChild(br2); fullBody.body.insertBefore(final_p, fullBody.body.firstChild); - makeParagraphs(text, function (p) { - fullBody.body.insertBefore(p, fullBody.body.firstChild); + //fullBody.body.insertBefore(reply, fullBody.body.firstChild); + let fragment = document.createDocumentFragment(); + Array.from(reply.body.childNodes).forEach(node => { + fragment.appendChild(node); }); + fullBody.body.insertBefore(fragment, fullBody.body.firstChild); return fullBody.body.innerHTML; -} - -const makeParagraphs = (text, func) => { - const chunks = text.split(/\n{2,}/); - if (chunks.length == 1) { - return func(document.createTextNode(text)); - } - const paragraphs = chunks.map((t) => { - const p = document.createElement("p"); - p.innerText = t; - return p; - }); - for (let i = paragraphs.length - 1; i >= 0; i--) { - func(paragraphs[i]); - } -}; \ No newline at end of file +} \ No newline at end of file From 7d1a86c47ad5ce24bf25857db87c1c86dcc2d989 Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 18 Jun 2024 23:08:38 +0200 Subject: [PATCH 07/32] readme updated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92df917e..3a025b43 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,6 @@ ThunderAI's changes are logged [here](CHANGELOG.md).
Thanks to:
  • chatgpt.js for providing methods to interact with the ChatGTP frontend.
  • -
  • Aify for inspiration and certains methods to process the text from ChatGPT.
  • +
  • Aify for inspiration.
The specific references are described in the corresponding source files. From 0750aed36e72b93d1ae8f266f98ce7f7dbfbd8b1 Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 18 Jun 2024 23:41:23 +0200 Subject: [PATCH 08/32] no more waiting for the tab to load --- mzta-background.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mzta-background.js b/mzta-background.js index bcb782b1..c8f1416b 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -157,7 +157,7 @@ async function openChatGPT(promptText, action, curr_tabId, do_custom_text = 0) { const createdTab = newWindow.tabs[0]; // Wait for tab loaded. - await new Promise(resolve => { + /*await new Promise(resolve => { const tabIsLoaded = tab => { return tab.status == "complete" && tab.url != "about:blank"; }; @@ -173,7 +173,7 @@ async function openChatGPT(promptText, action, curr_tabId, do_custom_text = 0) { } else { browser.tabs.onUpdated.addListener(listener); } - }); + });*/ let pre_script = `let mztaStatusPageDesc="`+ browser.i18n.getMessage("prefs_status_page") +`"; let mztaForceCompletionDesc="`+ browser.i18n.getMessage("chatgpt_force_completion") +`"; From f43200370ef82dd9b1d21b91c34b6373ee64d62a Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 18 Jun 2024 23:41:53 +0200 Subject: [PATCH 09/32] iteration only on first level childNodes --- js/mzta-utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/mzta-utils.js b/js/mzta-utils.js index 66f81f10..1e5e9bfc 100644 --- a/js/mzta-utils.js +++ b/js/mzta-utils.js @@ -128,7 +128,9 @@ const insertHtml = function (replyHtml, fullBody_string) { //fullBody.body.insertBefore(reply, fullBody.body.firstChild); let fragment = document.createDocumentFragment(); Array.from(reply.body.childNodes).forEach(node => { - fragment.appendChild(node); + if (node.parentNode === reply.body) { + fragment.appendChild(node.cloneNode(true)); + } }); fullBody.body.insertBefore(fragment, fullBody.body.firstChild); return fullBody.body.innerHTML; From 61c10638cd253847c238df9a93c4872c2554a5a2 Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 19 Jun 2024 21:50:46 +0200 Subject: [PATCH 10/32] commented out some console.log debug lines --- mzta-background.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mzta-background.js b/mzta-background.js index c8f1416b..87689dd4 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -69,7 +69,7 @@ messenger.runtime.onMessage.addListener(async (message, sender, sendResponse) => return true; case 'chatgpt_replyMessage': const paragraphsHtmlString = message.text; - console.log(">>>>>>>>>>>> paragraphsHtmlString: " + paragraphsHtmlString); + //console.log(">>>>>>>>>>>> paragraphsHtmlString: " + paragraphsHtmlString); let prefs = await browser.storage.sync.get({reply_type: 'reply_all'}); //console.log('reply_type: ' + prefs.reply_type); let replyType = 'replyToAll'; @@ -101,7 +101,7 @@ messenger.runtime.onMessage.addListener(async (message, sender, sendResponse) => const listener = (tabId, changeInfo, updatedTab) => { if (tabIsLoaded(updatedTab)) { browser.tabs.onUpdated.removeListener(listener); - console.log(">>>>>>>>>>>> reply_tab: " + tabId); + //console.log(">>>>>>>>>>>> reply_tab: " + tabId); resolve(); } } From caa2f0603c1c5a41c143a43e69c82f1175ab7996 Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 19 Jun 2024 21:51:44 +0200 Subject: [PATCH 11/32] keeping the format from the chatgpt response. see #70 --- js/mzta-chatgpt.js | 84 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 64 insertions(+), 20 deletions(-) diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js index b4be585f..3fc54de6 100644 --- a/js/mzta-chatgpt.js +++ b/js/mzta-chatgpt.js @@ -73,28 +73,27 @@ async function chatgpt_getFromDOM(pos) { let parser = new DOMParser(); let doc = parser.parseFromString(responseDivs[responseDivs.length - 1].innerHTML, 'text/html'); // Select the div with class 'empty:hidden' - let divToRemove = doc.querySelector('div.empty\\\\:hidden'); - if (divToRemove) { - divToRemove.remove(); - } - // Extract the new HTML string - responseDivs[responseDivs.length - 1].innerHTML = doc.body.innerHTML; - //response = responseDivs[responseDivs.length - 1].textContent; - response = responseDivs[responseDivs.length - 1].innerHTML; - const parser2 = new DOMParser(); - const doc2 = parser2.parseFromString(response, 'text/html'); - - // Get all elements in the parsed document - const allElements = doc2.body.querySelectorAll('*'); - + // let divToRemove = doc.querySelector('div.empty\\\\:hidden'); + // if (divToRemove) { + // divToRemove.remove(); + // } + // // Extract the new HTML string + // responseDivs[responseDivs.length - 1].innerHTML = doc.body.innerHTML; + // //response = responseDivs[responseDivs.length - 1].textContent; + // response = responseDivs[responseDivs.length - 1].innerHTML; + // console.log('chatgpt_getFromDOM original response: '+ response); + // const parser2 = new DOMParser(); + // const doc2 = parser2.parseFromString(response, 'text/html'); // Tags to exclude + //console.log(">>>>>>>>> doc.body.innerHTML original: " + doc.body.innerHTML); const excludeTags = ['div', 'text', 'svg', 'path', 'button']; - // Filter out elements that should be excluded - const keepElements = Array.from(allElements).filter(element => !excludeTags.includes(element.tagName.toLowerCase())); + const includeTags = ['p', 'ul']; + // removeTags(doc.body, excludeTags); + response = removeTagsAndReturnHTML(doc.body, excludeTags, includeTags) + //console.log(">>>>>>>>> doc.body.innerHTML final: " + doc.body.innerHTML); + // response = doc.body.innerHTML; - // Create a new HTML string containing all non-div elements in order - response = keepElements.map(element => element.outerHTML).join(''); - //console.log('chatgpt_getFromDOM: '+response); + //console.log('chatgpt_getFromDOM final response: '+response); //console.log('chatgpt_getFromDOM: [HTML] ' + responseDivs[responseDivs.length - 1].innerHTML.replace(/]*>/gi, '').replace(/<\\/div>/gi, '').replace(/]*>/gi, '').replace(/<\\/svg>/gi, '').replace(/]*>/gi, '').replace(/<\\/path>/gi, '').replace(/]*>/gi, '').replace(/<\\/text>/gi, '').replace(/]*>/gi, '').replace(/<\\/span>/gi, '').replace(/]*>/gi, '').replace(/<\\/button>/gi, '')); } else { // get nth response --- HERE ONLY TEXT FROM RESPONSE, NO HTML const nthOfResponse = ( @@ -123,7 +122,7 @@ async function chatgpt_getFromDOM(pos) { } response = response.replace(/^ChatGPT(?:ChatGPT)?/, ''); // strip sender name response = response.trim().replace(/^"|"$/g, ''); // strip quotation marks - console.log('>>>>>>>>>>>>>> chatgpt_getFromDOM: ' + JSON.stringify(response)); + //console.log('>>>>>>>>>>>>>> chatgpt_getFromDOM: ' + JSON.stringify(response)); } return response; } @@ -351,6 +350,51 @@ async function doProceed(message, customText = ''){ operation_done(); } +function removeTagsAndReturnHTML(rootElement, removeTags, preserveTags) { + removeTags.forEach(tag => { + const elements = rootElement.getElementsByTagName(tag); + while (elements.length > 0) { + const element = elements[0]; + // Preserve specified tags and their children + preserveTags.forEach(preserveTag => { + const preservedElements = element.getElementsByTagName(preserveTag); + while (preservedElements.length > 0) { + const preservedElement = preservedElements[0]; + element.parentNode.insertBefore(preservedElement, element); + } + }); + // Remove the element and all its remaining children + element.parentNode.removeChild(element); + } + }); + + replaceNewlinesWithBr(rootElement); + + // Return the updated HTML as a string + return rootElement.innerHTML; + } + + // Replace newline characters with
tags + function replaceNewlinesWithBr(node) { + for (let child of Array.from(node.childNodes)) { + if (child.nodeType === Node.TEXT_NODE) { + const parts = child.textContent.split('\\n'); + if (parts.length > 1) { + const fragment = document.createDocumentFragment(); + parts.forEach((part, index) => { + fragment.appendChild(document.createTextNode(part)); + if (index < parts.length - 1) { + fragment.appendChild(document.createElement('br')); + } + }); + child.parentNode.replaceChild(fragment, child); + } + } else if (child.nodeType === Node.ELEMENT_NODE) { + replaceNewlinesWithBr(child); + } + } + } + // In the content script browser.runtime.onMessage.addListener((message, sender, sendResponse) => { if (message.command === "chatgpt_send") { From 2478774e68e7488b66fded145633081f591fce7e Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 25 Jun 2024 20:59:09 +0200 Subject: [PATCH 12/32] version set to 1.1.4pre2 --- CHANGELOG.md | 5 +++++ manifest.json | 2 +- options/mzta-release-notes.html | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4673c2b7..d084232e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ +

Version 1.1.4pre2 - ??/??/2024

+
    +
  • ...
  • +
+

Version 1.1.3 - 18/06/2024

  • Fixed a bug in replying to a message [#70].
  • diff --git a/manifest.json b/manifest.json index f6267c26..4c1bf6af 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "ThunderAI", "description": "__MSG_extensionDescription__", - "version": "1.1.4pre1", + "version": "1.1.4pre2", "author": "Mic (m@micz.it)", "homepage_url": "https://micz.it/thunderbird-addon-thunderai/", "browser_specific_settings": { diff --git a/options/mzta-release-notes.html b/options/mzta-release-notes.html index 5ae0af11..92c0dd9e 100644 --- a/options/mzta-release-notes.html +++ b/options/mzta-release-notes.html @@ -7,7 +7,11 @@

    ThunderAI Release Notes

    -

    Version 1.1.3 - 18/06/2024

    +

    Version 1.1.4pre2 - ??/??/2024

    +
      +
    • ...
    • +
    +

    Version 1.1.3 - 18/06/2024

    • Fixed a bug in replying to a message [#70].
    From d71301f9e16fdb7e93d8bc862774fea5d1b3e23c Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 25 Jun 2024 22:59:28 +0200 Subject: [PATCH 13/32] working on fixing #70 --- js/mzta-chatgpt.js | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js index 3fc54de6..a006a188 100644 --- a/js/mzta-chatgpt.js +++ b/js/mzta-chatgpt.js @@ -352,27 +352,35 @@ async function doProceed(message, customText = ''){ function removeTagsAndReturnHTML(rootElement, removeTags, preserveTags) { removeTags.forEach(tag => { - const elements = rootElement.getElementsByTagName(tag); - while (elements.length > 0) { - const element = elements[0]; - // Preserve specified tags and their children - preserveTags.forEach(preserveTag => { - const preservedElements = element.getElementsByTagName(preserveTag); - while (preservedElements.length > 0) { - const preservedElement = preservedElements[0]; - element.parentNode.insertBefore(preservedElement, element); - } - }); - // Remove the element and all its remaining children - element.parentNode.removeChild(element); - } + const elements = rootElement.getElementsByTagName(tag); + while (elements.length > 0) { + const element = elements[0]; + const fragment = document.createDocumentFragment(); + + // Preserve specified tags and their children in the correct order + let child = element.firstChild; + while (child) { + console.log(">>>>>>>>>>>> ciclo child: " + child.tagName.toLowerCase()); + const nextSibling = child.nextSibling; + if (preserveTags.includes(child.tagName.toLowerCase())) { + console.log(">>>>>>>>>>>> preserve: " + child.tagName.toLowerCase()); + fragment.appendChild(child); + } + child = nextSibling; + } + + // Append preserved elements back to the parent of the removed element + element.parentNode.insertBefore(fragment, element); + + // Remove the element and all its remaining children + element.parentNode.removeChild(element); + } }); replaceNewlinesWithBr(rootElement); - // Return the updated HTML as a string return rootElement.innerHTML; - } +} // Replace newline characters with
    tags function replaceNewlinesWithBr(node) { From 7f0a50be42cf0d3326d6904f03f875445bfb4e1b Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 26 Jun 2024 22:22:57 +0200 Subject: [PATCH 14/32] correctly preservig formatting. see #70 --- js/mzta-chatgpt.js | 78 ++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js index a006a188..5452e7c3 100644 --- a/js/mzta-chatgpt.js +++ b/js/mzta-chatgpt.js @@ -350,58 +350,62 @@ async function doProceed(message, customText = ''){ operation_done(); } + function removeTagsAndReturnHTML(rootElement, removeTags, preserveTags) { - removeTags.forEach(tag => { - const elements = rootElement.getElementsByTagName(tag); - while (elements.length > 0) { - const element = elements[0]; - const fragment = document.createDocumentFragment(); + const fragment = document.createDocumentFragment(); - // Preserve specified tags and their children in the correct order - let child = element.firstChild; - while (child) { - console.log(">>>>>>>>>>>> ciclo child: " + child.tagName.toLowerCase()); - const nextSibling = child.nextSibling; - if (preserveTags.includes(child.tagName.toLowerCase())) { - console.log(">>>>>>>>>>>> preserve: " + child.tagName.toLowerCase()); - fragment.appendChild(child); - } - child = nextSibling; + function handleElement(element) { + let child = element.firstChild; + while (child) { + const nextSibling = child.nextSibling; + if (preserveTags.includes(child.nodeName.toLowerCase())) { + //console.log(">>>>>>>>>>>> preserve child: " + child.tagName.toLowerCase()); + fragment.appendChild(child); + } else if (child.nodeType === Node.ELEMENT_NODE) { + //console.log(">>>>>>>>>>>> handleElement(child): " + child.tagName.toLowerCase()); + handleElement(child); } - - // Append preserved elements back to the parent of the removed element - element.parentNode.insertBefore(fragment, element); - - // Remove the element and all its remaining children - element.parentNode.removeChild(element); + child = nextSibling; } + } + + removeTags.forEach(tag => { + const elements = Array.from(rootElement.getElementsByTagName(tag)); + elements.forEach(element => { + handleElement(element); + element.parentNode.insertBefore(fragment.cloneNode(true), element); + element.parentNode.removeChild(element); + //console.log(">>>>>>>>>>>> removeChild: " + element.tagName.toLowerCase()); + }); }); replaceNewlinesWithBr(rootElement); + //console.log(">>>>>>>>>>>> rootElement.innerHTML: " + rootElement.innerHTML); // Return the updated HTML as a string return rootElement.innerHTML; } - // Replace newline characters with
    tags - function replaceNewlinesWithBr(node) { +// Replace newline characters with
    tags +function replaceNewlinesWithBr(node) { for (let child of Array.from(node.childNodes)) { - if (child.nodeType === Node.TEXT_NODE) { - const parts = child.textContent.split('\\n'); - if (parts.length > 1) { - const fragment = document.createDocumentFragment(); - parts.forEach((part, index) => { - fragment.appendChild(document.createTextNode(part)); - if (index < parts.length - 1) { - fragment.appendChild(document.createElement('br')); + if (child.nodeType === Node.TEXT_NODE) { + const parts = child.textContent.split('\\n'); + if (parts.length > 1) { + const fragment = document.createDocumentFragment(); + parts.forEach((part, index) => { + fragment.appendChild(document.createTextNode(part)); + if (index < parts.length - 1) { + fragment.appendChild(document.createElement('br')); + } + }); + child.parentNode.replaceChild(fragment, child); } - }); - child.parentNode.replaceChild(fragment, child); + } else if (child.nodeType === Node.ELEMENT_NODE) { + replaceNewlinesWithBr(child); } - } else if (child.nodeType === Node.ELEMENT_NODE) { - replaceNewlinesWithBr(child); - } } - } +} + // In the content script browser.runtime.onMessage.addListener((message, sender, sendResponse) => { From 5b9b1bf662dfdc6648f72b9fedbcccfe4087b35e Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 26 Jun 2024 22:30:44 +0200 Subject: [PATCH 15/32] added an info text to the custom prompts page. fixes #74 --- _locales/de/messages.json | 5 +++++ _locales/en/messages.json | 5 +++++ _locales/fr/messages.json | 5 +++++ _locales/it/messages.json | 4 ++++ customprompts/mzta-custom-prompts.html | 3 ++- 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/_locales/de/messages.json b/_locales/de/messages.json index ce3d8fc1..b0f75a8f 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -63,6 +63,11 @@ "message": "Informationen", "description": "" }, + + "customPrompts_managePrompts_info_default": { + "message": "Die Standard-Eingabeaufforderungen sind nicht bearbeitbar. Sie können sie deaktivieren, dann den Text der Eingabeaufforderung kopieren und in eine neue einfügen, um eine modifizierte Version zu erstellen.", + "description": "" + }, "customPrompts_start_saving": { "message": "Eingabeaufforderungen werden gespeichert...", diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 33f7ea3e..8f0be474 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -64,6 +64,11 @@ "description": "" }, + "customPrompts_managePrompts_info_default": { + "message": "The default prompts are not editable. You can disable them, then copy the prompt text and paste it into a new one to create a modified version.", + "description": "" + }, + "customPrompts_start_saving": { "message": "Saving prompts...", "description": "" diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index aced1498..a632d9bc 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -63,6 +63,11 @@ "message": "Informations", "description": "" }, + + "customPrompts_managePrompts_info_default": { + "message": "Les invites par défaut ne sont pas modifiables. Vous pouvez les désactiver, puis copier le texte de l'invite et le coller dans une nouvelle pour créer une version modifiée.", + "description": "" + }, "customPrompts_start_saving": { "message": "Enregistrement des prompts...", diff --git a/_locales/it/messages.json b/_locales/it/messages.json index 1615048d..76573884 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -67,6 +67,10 @@ "message": "Salvataggio prompt di base...", "description": "" }, + "customPrompts_managePrompts_info_default": { + "message": "I prompt predefiniti non sono modificabili. Puoi disattivarli, quindi copiare il testo del prompt e incollarlo in uno nuovo per crearne una versione modificata.", + "description": "" + }, "customPrompts_saving_custom_prompts": { "message": "Salvataggio prompt personalizzati...", "description": "" diff --git a/customprompts/mzta-custom-prompts.html b/customprompts/mzta-custom-prompts.html index a8f33596..60898e93 100644 --- a/customprompts/mzta-custom-prompts.html +++ b/customprompts/mzta-custom-prompts.html @@ -8,7 +8,8 @@

    __MSG_customPrompts_managePrompts__

    -

    __MSG_customPrompts_managePrompts_help__

    +

    __MSG_customPrompts_managePrompts_info_default__ +
    __MSG_customPrompts_managePrompts_help__

    From 85f3fd7f5c88231d12027fa4ed3373e7ff8e2235 Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 26 Jun 2024 22:37:51 +0200 Subject: [PATCH 16/32] improved model warning message. fixes #76 --- _locales/de/messages.json | 2 +- _locales/en/messages.json | 2 +- _locales/fr/messages.json | 2 +- _locales/it/messages.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_locales/de/messages.json b/_locales/de/messages.json index b0f75a8f..ca1093fb 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -275,7 +275,7 @@ }, "chatgpt_win_model_warning": { - "message": "Sie haben die Option zur Verwendung von ChatGPT-4 eingestellt, aber es scheint, dass es nicht korrekt geladen wird. Haben Sie das richtige Modell oben ausgewählt?", + "message": "Sie haben die Option zur Verwendung von ChatGPT-4 eingestellt, aber es scheint, dass es nicht korrekt geladen wird. Haben Sie oben das Modell 4 oder 4o gewählt?", "description": "" }, diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 8f0be474..c710aca3 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -275,7 +275,7 @@ }, "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?", + "message": "You have set the option to use ChatGPT-4, but it seems that it is not loading correctly. Have you chosen the model 4 or 4o at the top?", "description": "" }, diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index a632d9bc..fe61f94d 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -275,7 +275,7 @@ }, "chatgpt_win_model_warning": { - "message": "Vous avez choisi l'option d'utiliser ChatGPT-4, mais il semble qu'il ne se charge pas correctement. Avez-vous choisi le bon modèle en haut?", + "message": "Vous avez choisi l'option d'utiliser ChatGPT-4, mais il semble qu'il ne se charge pas correctement. Avez-vous choisi le modèle 4 ou 4o en haut ?", "description": "" }, diff --git a/_locales/it/messages.json b/_locales/it/messages.json index 76573884..b384c94f 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -212,7 +212,7 @@ "description": "" }, "chatgpt_win_model_warning": { - "message": "Hai impostato l'opzione per utilizzare ChatGPT-4, ma sembra che non si stia caricando. Hai selezionato correttamente il modello in alto?", + "message": "Hai impostato l'opzione per utilizzare ChatGPT-4, ma sembra che non si stia caricando. Hai selezionato il modello 4 o 4o in alto?", "description": "" }, "chatgpt_win_custom_text": { From 5e8ca20a6998dbab4e6aac98ce71c3eaf5d7a6bc Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 26 Jun 2024 22:39:06 +0200 Subject: [PATCH 17/32] fixed spacing before ? and ! in the fr locale --- _locales/fr/messages.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index fe61f94d..1aabc241 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -1,6 +1,6 @@ { "extensionDescription": { - "message": "Utilisez ChatGPT pour améliorer vos emails!", + "message": "Utilisez ChatGPT pour améliorer vos emails !", "description": "Description de l'extension." }, @@ -50,7 +50,7 @@ }, "prompt_selection_needed": { - "message": "Pour continuer, vous devez sélectionner du texte!", + "message": "Pour continuer, vous devez sélectionner du texte !", "description": "" }, @@ -100,7 +100,7 @@ }, "customPrompts_saved": { - "message": "prompts enregistrées!", + "message": "prompts enregistrées !", "description": "" }, @@ -175,12 +175,12 @@ }, "customPrompts_btnDelete_confirmText": { - "message": "Êtes-vous sûr de vouloir supprimer cet élément?", + "message": "Êtes-vous sûr de vouloir supprimer cet élément ?", "description": "" }, "customPrompts_unsaved_changes": { - "message": "Il y a des modifications non enregistrées!", + "message": "Il y a des modifications non enregistrées !", "description": "" }, @@ -245,7 +245,7 @@ }, "chatgpt_win_job_completed": { - "message": "Terminé!", + "message": "Terminé !", "description": "" }, @@ -395,12 +395,12 @@ }, "prefsDonation_1": { - "message": "Aimez-vous cet addon?", + "message": "Aimez-vous cet addon ?", "description": "" }, "prefsDonation_2": { - "message": "Envisagez de faire un don!", + "message": "Envisagez de faire un don !", "description": "" }, From d3fc64c4d92703dc9f0a82191a1b64927c324855 Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 26 Jun 2024 22:44:58 +0200 Subject: [PATCH 18/32] release notes updated --- CHANGELOG.md | 6 ++++-- options/mzta-release-notes.html | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d084232e..9410ea18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,14 @@

    Version 1.1.4pre2 - ??/??/2024

      -
    • ...
    • +
    • Importing text with formatting from ChatGPT [#70].
    • +
    • Improve the message warning to choose the right model [#76].
    • +
    • Added a description in the Custom Prompts page about default prompts [#74].

    Version 1.1.3 - 18/06/2024

      -
    • Fixed a bug in replying to a message [#70].
    • +
    • Fixed a bug in replying to a message [#71].

    Version 1.1.2 - 23/05/2024

    diff --git a/options/mzta-release-notes.html b/options/mzta-release-notes.html index 92c0dd9e..f1ee22f7 100644 --- a/options/mzta-release-notes.html +++ b/options/mzta-release-notes.html @@ -8,9 +8,11 @@

    ThunderAI Release Notes

    Version 1.1.4pre2 - ??/??/2024

    -
      -
    • ...
    • -
    +
      +
    • Importing text with formatting from ChatGPT [#70].
    • +
    • Improve the message warning to choose the right model [#76].
    • +
    • Added a description in the Custom Prompts page about default prompts [#74].
    • +

    Version 1.1.3 - 18/06/2024

    • Fixed a bug in replying to a message [#70].
    • From 7a4d6bfe8c903ab769d9c16fc9435132d791484a Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 26 Jun 2024 22:56:38 +0200 Subject: [PATCH 19/32] readded code to wait for the tab to be fully loaded --- mzta-background.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mzta-background.js b/mzta-background.js index 87689dd4..92831bdb 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -157,7 +157,7 @@ async function openChatGPT(promptText, action, curr_tabId, do_custom_text = 0) { const createdTab = newWindow.tabs[0]; // Wait for tab loaded. - /*await new Promise(resolve => { + await new Promise(resolve => { const tabIsLoaded = tab => { return tab.status == "complete" && tab.url != "about:blank"; }; @@ -173,7 +173,7 @@ async function openChatGPT(promptText, action, curr_tabId, do_custom_text = 0) { } else { browser.tabs.onUpdated.addListener(listener); } - });*/ + }); let pre_script = `let mztaStatusPageDesc="`+ browser.i18n.getMessage("prefs_status_page") +`"; let mztaForceCompletionDesc="`+ browser.i18n.getMessage("chatgpt_force_completion") +`"; From 23151b8da3f5ee2fca75c4bd6dcdd39bd783f2b8 Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 26 Jun 2024 23:07:53 +0200 Subject: [PATCH 20/32] chatpgt_keep_formatting option added. see #77 --- _locales/de/messages.json | 10 ++++++++++ _locales/en/messages.json | 10 ++++++++++ _locales/fr/messages.json | 10 ++++++++++ _locales/it/messages.json | 8 ++++++++ options/mzta-options-default.js | 1 + options/mzta-options.html | 11 +++++++++++ 6 files changed, 50 insertions(+) diff --git a/_locales/de/messages.json b/_locales/de/messages.json index ca1093fb..4064cbd4 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -358,6 +358,16 @@ "message": "Antworttyp", "description": "" }, + + "prefs_OptionText_chatpgt_keep_formatting": { + "message": "Behalte die Formatierung bei", + "description": "" + }, + + "prefs_OptionText_chatpgt_keep_formatting_info": { + "message": "Behalte die Formatierung und die Zahlen oder Aufzählungspunkte aus der ChatGPT-Antwort bei.", + "description": "" + }, "prefs_OptionText_chatpgt_use_gpt4": { "message": "Verwenden Sie ChatGPT-4", diff --git a/_locales/en/messages.json b/_locales/en/messages.json index c710aca3..2835cd09 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -359,6 +359,16 @@ "description": "" }, + "prefs_OptionText_chatpgt_keep_formatting": { + "message": "Keep formatting", + "description": "" + }, + + "prefs_OptionText_chatpgt_keep_formatting_info": { + "message": "Keep the formatting and numeral or bullet points from the ChatGPT response.", + "description": "" + }, + "prefs_OptionText_chatpgt_use_gpt4": { "message": "Use ChatGPT-4", "description": "" diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index 1aabc241..c5c6767c 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -358,6 +358,16 @@ "message": "Type de réponse", "description": "" }, + + "prefs_OptionText_chatpgt_keep_formatting": { + "message": "Conserver la mise en forme", + "description": "" + }, + + "prefs_OptionText_chatpgt_keep_formatting_info": { + "message": "Conservez la mise en forme et les numéros ou les puces de la réponse de ChatGPT.", + "description": "" + }, "prefs_OptionText_chatpgt_use_gpt4": { "message": "Utiliser ChatGPT-4", diff --git a/_locales/it/messages.json b/_locales/it/messages.json index b384c94f..1d436f7a 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -287,6 +287,14 @@ "message": "Modalità di risposta", "description": "" }, + "prefs_OptionText_chatpgt_keep_formatting": { + "message": "Mantieni la formattazione", + "description": "" + }, + "prefs_OptionText_chatpgt_keep_formatting_info": { + "message": "Mantieni la formattazione del testo e gli elenchi puntati e numerati della risposta di ChatGPT.", + "description": "" + }, "prefs_OptionText_chatpgt_use_gpt4": { "message": "Usa il modello ChatGPT-4", "description": "" diff --git a/options/mzta-options-default.js b/options/mzta-options-default.js index 4cfc2112..9a8df7fc 100644 --- a/options/mzta-options-default.js +++ b/options/mzta-options-default.js @@ -20,4 +20,5 @@ export const prefs_default = { chatgpt_win_height: 800, chatgpt_win_width: 700, chatpgt_use_gpt4: false, + chatpgt_keep_formatting: false, } \ No newline at end of file diff --git a/options/mzta-options.html b/options/mzta-options.html index 9896bba0..c4f9689d 100644 --- a/options/mzta-options.html +++ b/options/mzta-options.html @@ -59,6 +59,17 @@ + + + + + + From 141e23692350bd5db713d0f4b72de356ae5e8be0 Mon Sep 17 00:00:00 2001 From: Mic Date: Thu, 27 Jun 2024 18:27:41 +0200 Subject: [PATCH 24/32] using chatgpt_keep_formatting. fixes #77 --- js/mzta-chatgpt.js | 39 +++++++++++++++++++-------------------- mzta-background.js | 2 ++ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js index 5452e7c3..d92f824d 100644 --- a/js/mzta-chatgpt.js +++ b/js/mzta-chatgpt.js @@ -72,27 +72,26 @@ async function chatgpt_getFromDOM(pos) { // Removing the new buttons that let the user change model and insert a number (4 or 3.5 at the end of the text) let parser = new DOMParser(); let doc = parser.parseFromString(responseDivs[responseDivs.length - 1].innerHTML, 'text/html'); + if(!mztaKeepFormatting) { // Return only TEXT // Select the div with class 'empty:hidden' - // let divToRemove = doc.querySelector('div.empty\\\\:hidden'); - // if (divToRemove) { - // divToRemove.remove(); - // } - // // Extract the new HTML string - // responseDivs[responseDivs.length - 1].innerHTML = doc.body.innerHTML; - // //response = responseDivs[responseDivs.length - 1].textContent; - // response = responseDivs[responseDivs.length - 1].innerHTML; - // console.log('chatgpt_getFromDOM original response: '+ response); - // const parser2 = new DOMParser(); - // const doc2 = parser2.parseFromString(response, 'text/html'); - // Tags to exclude - //console.log(">>>>>>>>> doc.body.innerHTML original: " + doc.body.innerHTML); - const excludeTags = ['div', 'text', 'svg', 'path', 'button']; - const includeTags = ['p', 'ul']; - // removeTags(doc.body, excludeTags); - response = removeTagsAndReturnHTML(doc.body, excludeTags, includeTags) - //console.log(">>>>>>>>> doc.body.innerHTML final: " + doc.body.innerHTML); - // response = doc.body.innerHTML; - + let divToRemove = doc.querySelector('div.empty\\\\:hidden'); + if (divToRemove) { + divToRemove.remove(); + } + // Extract the new HTML string + responseDivs[responseDivs.length - 1].innerHTML = doc.body.innerHTML; + response = responseDivs[responseDivs.length - 1].textContent; + // response = responseDivs[responseDivs.length - 1].innerHTML; + } else { // Return HTML + // Tags to exclude + //console.log(">>>>>>>>> doc.body.innerHTML original: " + doc.body.innerHTML); + const excludeTags = ['div', 'text', 'svg', 'path', 'button']; + const includeTags = ['p', 'ul']; + // removeTags(doc.body, excludeTags); + response = removeTagsAndReturnHTML(doc.body, excludeTags, includeTags) + //console.log(">>>>>>>>> doc.body.innerHTML final: " + doc.body.innerHTML); + // response = doc.body.innerHTML; + } //console.log('chatgpt_getFromDOM final response: '+response); //console.log('chatgpt_getFromDOM: [HTML] ' + responseDivs[responseDivs.length - 1].innerHTML.replace(/]*>/gi, '').replace(/<\\/div>/gi, '').replace(/]*>/gi, '').replace(/<\\/svg>/gi, '').replace(/]*>/gi, '').replace(/<\\/path>/gi, '').replace(/]*>/gi, '').replace(/<\\/text>/gi, '').replace(/]*>/gi, '').replace(/<\\/span>/gi, '').replace(/]*>/gi, '').replace(/<\\/button>/gi, '')); } else { // get nth response --- HERE ONLY TEXT FROM RESPONSE, NO HTML diff --git a/mzta-background.js b/mzta-background.js index 92831bdb..9c3e886a 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -139,6 +139,7 @@ messenger.runtime.onMessage.addListener(async (message, sender, sendResponse) => async function openChatGPT(promptText, action, curr_tabId, do_custom_text = 0) { let prefs = await browser.storage.sync.get(prefs_default); prefs = checkScreenDimensions(prefs); + //console.log(">>>>>>>>>>>>>>>> prefs: " + JSON.stringify(prefs)); console.log('[ThunderAI] Prompt length: ' + promptText.length); if(promptText.length > 30000 ){ // Prompt too long for ChatGPT @@ -179,6 +180,7 @@ async function openChatGPT(promptText, action, curr_tabId, do_custom_text = 0) { let mztaForceCompletionDesc="`+ browser.i18n.getMessage("chatgpt_force_completion") +`"; let mztaForceCompletionTitle="`+ browser.i18n.getMessage("chatgpt_force_completion_title") +`"; let mztaDoCustomText=`+ do_custom_text +`; + let mztaKeepFormatting=`+ prefs.chatgpt_keep_formatting +`; `; browser.tabs.executeScript(createdTab.id, { code: pre_script + mzta_script, matchAboutBlank: false }) From 63969b5b35f83ddbede80d89074ed1e61ff3da0c Mon Sep 17 00:00:00 2001 From: Mic Date: Thu, 27 Jun 2024 18:44:08 +0200 Subject: [PATCH 25/32] release notes updated --- CHANGELOG.md | 8 ++++---- options/mzta-release-notes.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9410ea18..e5a2f379 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,10 @@

      Version 1.1.4pre2 - ??/??/2024

        -
      • Importing text with formatting from ChatGPT [#70].
      • -
      • Improve the message warning to choose the right model [#76].
      • -
      • Added a description in the Custom Prompts page about default prompts [#74].
      • -
      +
    • Added an option to import text with formatting from ChatGPT, set to false by default [#70], [#77].
    • +
    • Improve the message warning to choose the right model [#76].
    • +
    • Added a description in the Custom Prompts page about default prompts [#74].
    • +

    Version 1.1.3 - 18/06/2024

      diff --git a/options/mzta-release-notes.html b/options/mzta-release-notes.html index f1ee22f7..43b601fd 100644 --- a/options/mzta-release-notes.html +++ b/options/mzta-release-notes.html @@ -9,7 +9,7 @@

      ThunderAI Release Notes

      Version 1.1.4pre2 - ??/??/2024

        -
      • Importing text with formatting from ChatGPT [#70].
      • +
      • Added an option to import text with formatting from ChatGPT, set to false by default [#70], [#77].
      • Improve the message warning to choose the right model [#76].
      • Added a description in the Custom Prompts page about default prompts [#74].
      From a263b42eded8027f28f2d2b4866154532d7a3b50 Mon Sep 17 00:00:00 2001 From: Mic Date: Thu, 27 Jun 2024 18:48:07 +0200 Subject: [PATCH 26/32] capitalized "Service Status" in the option page --- options/mzta-options.css | 1 + 1 file changed, 1 insertion(+) diff --git a/options/mzta-options.css b/options/mzta-options.css index 27483aea..5bdff4b4 100644 --- a/options/mzta-options.css +++ b/options/mzta-options.css @@ -61,6 +61,7 @@ div#miczStatusPage{ left: 0px; bottom: 2px; padding: 2px 0px 0px 5px; + text-transform: capitalize; } div#miczDescription h1{ From 8b83a297b957bcf5f927bfe1521a65536d5d001f Mon Sep 17 00:00:00 2001 From: Mic Date: Thu, 27 Jun 2024 19:01:24 +0200 Subject: [PATCH 27/32] translate link added to the options page. fixes #68 --- _locales/de/messages.json | 9 +++++++++ _locales/en/messages.json | 10 ++++++++++ _locales/fr/messages.json | 9 +++++++++ _locales/it/messages.json | 8 ++++++++ options/mzta-options.css | 8 ++++++++ options/mzta-options.html | 1 + 6 files changed, 45 insertions(+) diff --git a/_locales/de/messages.json b/_locales/de/messages.json index 4064cbd4..99acb32d 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -417,6 +417,15 @@ "backToOptionsText": { "message": "Optionen", "description": "" + }, + "TranslateText": { + "message": "Möchtest du helfen, dieses Add-on zu übersetzen?", + "description": "" + }, + + "TranslateLink": { + "message": "Finde es heraus!", + "description": "" } } \ No newline at end of file diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 2835cd09..2f42ee7f 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -417,5 +417,15 @@ "backToOptionsText": { "message": "Options", "description": "" + }, + + "TranslateText": { + "message": "Do you want to help translate this addon?", + "description": "" + }, + + "TranslateLink": { + "message": "Find out how!", + "description": "" } } diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index c5c6767c..ff59e670 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -417,6 +417,15 @@ "backToOptionsText": { "message": "Options", "description": "" + }, + "TranslateText": { + "message": "Voulez-vous aider à traduire cet addon ?", + "description": "" + }, + + "TranslateLink": { + "message": "Découvrez comment !", + "description": "" } } \ No newline at end of file diff --git a/_locales/it/messages.json b/_locales/it/messages.json index 1d436f7a..6808acfb 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -334,5 +334,13 @@ "backToOptionsText": { "message": "Opzioni", "description": "" + }, + "TranslateText": { + "message": "Vuoi aiutare a tradurre questo addon?", + "description": "" + }, + "TranslateLink": { + "message": "Scopri come!", + "description": "" } } \ No newline at end of file diff --git a/options/mzta-options.css b/options/mzta-options.css index 5bdff4b4..92c96f24 100644 --- a/options/mzta-options.css +++ b/options/mzta-options.css @@ -91,4 +91,12 @@ span.dims_label{ text-align: center; width: 100%; margin: 10px 0px; +} + +div#miczTranslate{ + width: 100%; + text-align: center; + font-size: 14px; + font-weight: bold; + margin-bottom: 1em; } \ No newline at end of file diff --git a/options/mzta-options.html b/options/mzta-options.html index a4afa19f..67e54083 100644 --- a/options/mzta-options.html +++ b/options/mzta-options.html @@ -91,6 +91,7 @@ __MSG_prefsInfoDesc_2__
      __MSG_prefsInfoDesc_3__

      +
      __MSG_TranslateText__ __MSG_TranslateLink__
      __MSG_prefsDonation_1__
      __MSG_prefsDonation_2__
      From b6309aad046c5c3fa3e13ca22aff2d210c5034e2 Mon Sep 17 00:00:00 2001 From: Mic Date: Thu, 27 Jun 2024 19:03:39 +0200 Subject: [PATCH 28/32] release notes updated --- CHANGELOG.md | 5 +++-- options/mzta-release-notes.html | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5a2f379..a48f556b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,9 @@

      Version 1.1.4pre2 - ??/??/2024

      • Added an option to import text with formatting from ChatGPT, set to false by default [#70], [#77].
      • -
      • Improve the message warning to choose the right model [#76].
      • -
      • Added a description in the Custom Prompts page about default prompts [#74].
      • +
      • Improve the message warning to choose the right model [#76].
      • +
      • Added a description in the Custom Prompts page about default prompts [#74].
      • +
      • Added a link to the translate page in the options window [#68].

      Version 1.1.3 - 18/06/2024

      diff --git a/options/mzta-release-notes.html b/options/mzta-release-notes.html index 43b601fd..b0c680c9 100644 --- a/options/mzta-release-notes.html +++ b/options/mzta-release-notes.html @@ -12,6 +12,7 @@
    • Added an option to import text with formatting from ChatGPT, set to false by default [#70], [#77].
    • Improve the message warning to choose the right model [#76].
    • Added a description in the Custom Prompts page about default prompts [#74].
    • +
    • Added a link to the translate page in the options window [#68].

    Version 1.1.3 - 18/06/2024

      From aeacb536e9f183c3f4c916a0bf2ba67095a92d69 Mon Sep 17 00:00:00 2001 From: mic Date: Thu, 27 Jun 2024 20:48:16 +0200 Subject: [PATCH 29/32] removed empty lines --- _locales/de/messages.json | 773 +++++++++++++++++--------------------- _locales/en/messages.json | 87 +---- _locales/fr/messages.json | 773 +++++++++++++++++--------------------- 3 files changed, 689 insertions(+), 944 deletions(-) diff --git a/_locales/de/messages.json b/_locales/de/messages.json index 99acb32d..c4fba4f3 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -1,431 +1,346 @@ { - "extensionDescription": { - "message": "Verwenden Sie ChatGPT, um Ihre E-Mails zu verbessern!", - "description": "Beschreibung der Erweiterung." - }, - - "menu_title": { - "message": "KI", - "description": "" - }, - - "prompt_lang": { - "message": "Antwort in ", - "description": "" - }, - - "prompt_reply": { - "message": "Darauf antworten", - "description": "" - }, - - "prompt_rewrite_polite": { - "message": "Höflich umschreiben", - "description": "" - }, - - "prompt_rewrite_formal": { - "message": "Formal umschreiben", - "description": "" - }, - - "prompt_classify": { - "message": "Klassifizieren", - "description": "" - }, - - "prompt_summarize_this": { - "message": "Zusammenfassen", - "description": "" - }, - - "prompt_translate_this": { - "message": "Übersetzen", - "description": "" - }, - - "prompt_this": { - "message": "Auffordern", - "description": "" - }, - - "prompt_selection_needed": { - "message": "Um fortzufahren, müssen Sie einen Text auswählen!", - "description": "" - }, - - "customPrompts_managePrompts": { - "message": "Eingabeaufforderungen verwalten", - "description": "" - }, - - "customPrompts_managePrompts_help": { - "message": "Informationen", - "description": "" - }, - - "customPrompts_managePrompts_info_default": { - "message": "Die Standard-Eingabeaufforderungen sind nicht bearbeitbar. Sie können sie deaktivieren, dann den Text der Eingabeaufforderung kopieren und in eine neue einfügen, um eine modifizierte Version zu erstellen.", - "description": "" - }, - - "customPrompts_start_saving": { - "message": "Eingabeaufforderungen werden gespeichert...", - "description": "" - }, - - "customPrompts_reindexing_list": { - "message": "Liste wird neu indiziert...", - "description": "" - }, - - "customPrompts_filtering_prompts": { - "message": "Eingabeaufforderungen werden gefiltert...", - "description": "" - }, - - "customPrompts_saving_default_prompts": { - "message": "Standard-Eingabeaufforderungen werden gespeichert...", - "description": "" - }, - - "customPrompts_saving_custom_prompts": { - "message": "Benutzerdefinierte Eingabeaufforderungen werden gespeichert...", - "description": "" - }, - - "customPrompts_reloading_menus": { - "message": "Menüs werden neu geladen...", - "description": "" - }, - - "customPrompts_saved": { - "message": "Eingabeaufforderungen gespeichert!", - "description": "" - }, - - "customPrompts_form_label_ID": { - "message": "ID", - "description": "" - }, - - "customPrompts_form_label_ID_rules": { - "message": "Muss eindeutig, kleingeschrieben und ohne Leerzeichen sein", - "description": "" - }, - - "customPrompts_form_label_Name": { - "message": "Name", - "description": "" - }, - - "customPrompts_form_label_Text": { - "message": "Eingabeaufforderungstext", - "description": "" - }, - - "customPrompts_form_label_Action": { - "message": "Aktion", - "description": "" - }, - - "customPrompts_form_label_need_selected": { - "message": "Textauswahl erforderlich", - "description": "" - }, - - "customPrompts_form_label_need_signature": { - "message": "Immer die Signatur hinzufügen", - "description": "" - }, - - "customPrompts_form_label_need_custom_text": { - "message": "Nach zusätzlichem Text fragen", - "description": "" - }, - - "customPrompts_form_label_enabled": { - "message": "Aktiviert", - "description": "" - }, - - "customPrompts_form_required_fields": { - "message": "Erforderliche Felder", - "description": "" - }, - - "customPrompts_btnEdit": { - "message": "Bearbeiten", - "description": "" - }, - - "customPrompts_btnCancel": { - "message": "Abbrechen", - "description": "" - }, - - "customPrompts_btnOK": { - "message": "OK", - "description": "" - }, - - "customPrompts_btnDelete": { - "message": "Löschen", - "description": "" - }, - - "customPrompts_btnDelete_confirmText": { - "message": "Sind Sie sicher, dass Sie dieses Element löschen möchten?", - "description": "" - }, - - "customPrompts_unsaved_changes": { - "message": "Es gibt ungespeicherte Änderungen!", - "description": "" - }, - - "customPrompts_btnSaveAll": { - "message": "Alle speichern", - "description": "" - }, - - "customPrompts_save_button": { - "message": "Speichern", - "description": "" - }, - - "customPrompts_btnNew": { - "message": "Neu hinzufügen", - "description": "" - }, - - "customPrompts_btnAddNewCommit": { - "message": "Eingabeaufforderung hinzufügen", - "description": "" - }, - - "customPrompts_add_to_menu": { - "message": "Zum Menü hinzufügen", - "description": "" - }, - - "customPrompts_add_to_menu_always": { - "message": "Immer", - "description": "" - }, - - "customPrompts_add_to_menu_reading": { - "message": "E-Mail lesen", - "description": "" - }, - - "customPrompts_add_to_menu_composing": { - "message": "E-Mail verfassen", - "description": "" - }, - - "customPrompts_close_button": { - "message": "Schließen", - "description": "" - }, - - "customPrompts_do_reply": { - "message": "Antworten", - "description": "" - }, - - "customPrompts_substitute_text": { - "message": "Text ersetzen", - "description": "" - }, - - "chatgpt_win_working": { - "message": "Arbeit in Arbeit...", - "description": "" - }, - - "chatgpt_win_job_completed": { - "message": "Abgeschlossen!", - "description": "" - }, - - "chatgpt_win_get_answer": { - "message": "Letzte Antwort verwenden", - "description": "" - }, - - "chatgpt_win_close": { - "message": "Schließen", - "description": "" - }, - - "chatgpt_textarea_not_found_error": { - "message": "Es gibt einen Fehler beim Senden der Eingabeaufforderung an ChatGPT. Bitte versuchen Sie es erneut. Wenn das Problem weiterhin besteht, überprüfen Sie bitte den Dienststatus.", - "description": "" - }, - - "chatgpt_sendbutton_not_found_error": { - "message": "Klicken Sie auf die Schaltfläche „Senden“, um die Eingabeaufforderung zu übermitteln.", - "description": "" - }, - - "chatgpt_user_not_logged_in": { - "message": "Sie sind nicht bei ChatGPT angemeldet. Bitte melden Sie sich mit Ihren Anmeldeinformationen an, schließen Sie das ChatGPT-Fenster und wiederholen Sie dann die Aktion, die Sie versucht haben. Danach bleiben Sie angemeldet.", - "description": "" - }, - - "chatgpt_win_model_warning": { - "message": "Sie haben die Option zur Verwendung von ChatGPT-4 eingestellt, aber es scheint, dass es nicht korrekt geladen wird. Haben Sie oben das Modell 4 oder 4o gewählt?", - "description": "" - }, - - "chatgpt_win_custom_text": { - "message": "Fügen Sie hier den zusätzlichen Text für die Eingabeaufforderung ein.", - "description": "" - }, - - "chatgpt_win_send": { - "message": "Senden", - "description": "" - }, - - "chatgpt_use_gpt35": { - "message": "Verwenden Sie GPT3.5", - "description": "" - }, - - "chatgpt_force_completion": { - "message": "Abschluss erzwingen", - "description": "" - }, - - "chatgpt_force_completion_title": { - "message": "Klicken Sie hier, um die Schaltfläche „Letzte Antwort verwenden“ anzuzeigen, wenn ChatGPT seine Arbeit abgeschlossen hat, die Schaltfläche jedoch nicht erschienen ist.", - "description": "" - }, - - "msg_prompt_too_long": { - "message": "Der eingegebene Text ist zu lang. Sie müssen ihn verkürzen, um ChatGPT zu verwenden.", - "description": "" - }, - - "prefs_OptionText_release_notes": { - "message": "Versionshinweise", - "description": "" - }, - - "prefs_status_page": { - "message": "Dienststatus", - "description": "" - }, - - "prefs_OptionText_chatgpt_win_text": { - "message": "ChatGPT-Fensterabmessungen", - "description": "" - }, - - "prefs_OptionText_chatgpt_win_height": { - "message": "Höhe", - "description": "" - }, - - "prefs_OptionText_chatgpt_win_width": { - "message": "Breite", - "description": "" - }, - - "prefs_OptionText_default_sign_name": { - "message": "Standard-Signaturname", - "description": "" - }, - - "prefs_OptionText_default_chatgpt_lang": { - "message": "Standardsprache für ChatGPT-Antworten", - "description": "" - }, - - "prefs_OptionText_reply_all": { - "message": "Allen antworten", - "description": "" - }, - - "prefs_OptionText_reply_sender": { - "message": "Absender antworten", - "description": "" - }, - - "prefs_OptionText_reply_type": { - "message": "Antworttyp", - "description": "" - }, - - "prefs_OptionText_chatpgt_keep_formatting": { - "message": "Behalte die Formatierung bei", - "description": "" - }, - - "prefs_OptionText_chatpgt_keep_formatting_info": { - "message": "Behalte die Formatierung und die Zahlen oder Aufzählungspunkte aus der ChatGPT-Antwort bei.", - "description": "" - }, - - "prefs_OptionText_chatpgt_use_gpt4": { - "message": "Verwenden Sie ChatGPT-4", - "description": "" - }, - - "prefs_OptionText_chatpgt_use_gpt4_info": { - "message": "Nachdem Sie diese Option geändert haben, müssen Sie beim ersten Gebrauch das richtige Modell auswählen.", - "description": "" - }, - - "prefs_OptionText_btnManagePrompts": { - "message": "Verwalten Sie Ihre Eingabeaufforderungen", - "description": "" - }, - - "prefsInfoTitle": { - "message": "Wichtige Informationen", - "description": "" - }, - - "prefsInfoDesc_1": { - "message": "Es ist nicht mehr möglich, den Verlauf der ChatGPT-Chats zu deaktivieren. Daher gibt es keine Möglichkeit, zu verhindern, dass Anfragen, die über dieses Addon gestellt werden, in Ihrem ChatGPT-Chatverlauf erscheinen.", - "description": "" - }, - - "prefsInfoDesc_2": { - "message": "Wenn eine weiße Seite erscheint, wenn das ChatGPT-Fenster geöffnet wird, bedeutet dies, dass es ein Problem beim Laden der ChatGPT-Seite gibt, das nicht mit der Verwendung dieses Add-Ons zusammenhängt.", - "description": "" - }, - - "prefsInfoDesc_3": { - "message": " ", - "description": "" - }, - - "prefsDonation_1": { - "message": "Gefällt Ihnen dieses Addon?", - "description": "" - }, - - "prefsDonation_2": { - "message": "Überlegen Sie, eine Spende zu machen!", - "description": "" - }, - - "backToOptionsText": { - "message": "Optionen", - "description": "" - }, - "TranslateText": { - "message": "Möchtest du helfen, dieses Add-on zu übersetzen?", - "description": "" - }, - - "TranslateLink": { - "message": "Finde es heraus!", - "description": "" - } + "extensionDescription": { + "message": "Verwenden Sie ChatGPT, um Ihre E-Mails zu verbessern!", + "description": "Beschreibung der Erweiterung." + }, + "menu_title": { + "message": "KI", + "description": "" + }, + "prompt_lang": { + "message": "Antwort in ", + "description": "" + }, + "prompt_reply": { + "message": "Darauf antworten", + "description": "" + }, + "prompt_rewrite_polite": { + "message": "Höflich umschreiben", + "description": "" + }, + "prompt_rewrite_formal": { + "message": "Formal umschreiben", + "description": "" + }, + "prompt_classify": { + "message": "Klassifizieren", + "description": "" + }, + "prompt_summarize_this": { + "message": "Zusammenfassen", + "description": "" + }, + "prompt_translate_this": { + "message": "Übersetzen", + "description": "" + }, + "prompt_this": { + "message": "Auffordern", + "description": "" + }, + "prompt_selection_needed": { + "message": "Um fortzufahren, müssen Sie einen Text auswählen!", + "description": "" + }, + "customPrompts_managePrompts": { + "message": "Eingabeaufforderungen verwalten", + "description": "" + }, + "customPrompts_managePrompts_help": { + "message": "Informationen", + "description": "" + }, + "customPrompts_managePrompts_info_default": { + "message": "Die Standard-Eingabeaufforderungen sind nicht bearbeitbar. Sie können sie deaktivieren, dann den Text der Eingabeaufforderung kopieren und in eine neue einfügen, um eine modifizierte Version zu erstellen.", + "description": "" + }, + "customPrompts_start_saving": { + "message": "Eingabeaufforderungen werden gespeichert...", + "description": "" + }, + "customPrompts_reindexing_list": { + "message": "Liste wird neu indiziert...", + "description": "" + }, + "customPrompts_filtering_prompts": { + "message": "Eingabeaufforderungen werden gefiltert...", + "description": "" + }, + "customPrompts_saving_default_prompts": { + "message": "Standard-Eingabeaufforderungen werden gespeichert...", + "description": "" + }, + "customPrompts_saving_custom_prompts": { + "message": "Benutzerdefinierte Eingabeaufforderungen werden gespeichert...", + "description": "" + }, + "customPrompts_reloading_menus": { + "message": "Menüs werden neu geladen...", + "description": "" + }, + "customPrompts_saved": { + "message": "Eingabeaufforderungen gespeichert!", + "description": "" + }, + "customPrompts_form_label_ID": { + "message": "ID", + "description": "" + }, + "customPrompts_form_label_ID_rules": { + "message": "Muss eindeutig, kleingeschrieben und ohne Leerzeichen sein", + "description": "" + }, + "customPrompts_form_label_Name": { + "message": "Name", + "description": "" + }, + "customPrompts_form_label_Text": { + "message": "Eingabeaufforderungstext", + "description": "" + }, + "customPrompts_form_label_Action": { + "message": "Aktion", + "description": "" + }, + "customPrompts_form_label_need_selected": { + "message": "Textauswahl erforderlich", + "description": "" + }, + "customPrompts_form_label_need_signature": { + "message": "Immer die Signatur hinzufügen", + "description": "" + }, + "customPrompts_form_label_need_custom_text": { + "message": "Nach zusätzlichem Text fragen", + "description": "" + }, + "customPrompts_form_label_enabled": { + "message": "Aktiviert", + "description": "" + }, + "customPrompts_form_required_fields": { + "message": "Erforderliche Felder", + "description": "" + }, + "customPrompts_btnEdit": { + "message": "Bearbeiten", + "description": "" + }, + "customPrompts_btnCancel": { + "message": "Abbrechen", + "description": "" + }, + "customPrompts_btnOK": { + "message": "OK", + "description": "" + }, + "customPrompts_btnDelete": { + "message": "Löschen", + "description": "" + }, + "customPrompts_btnDelete_confirmText": { + "message": "Sind Sie sicher, dass Sie dieses Element löschen möchten?", + "description": "" + }, + "customPrompts_unsaved_changes": { + "message": "Es gibt ungespeicherte Änderungen!", + "description": "" + }, + "customPrompts_btnSaveAll": { + "message": "Alle speichern", + "description": "" + }, + "customPrompts_save_button": { + "message": "Speichern", + "description": "" + }, + "customPrompts_btnNew": { + "message": "Neu hinzufügen", + "description": "" + }, + "customPrompts_btnAddNewCommit": { + "message": "Eingabeaufforderung hinzufügen", + "description": "" + }, + "customPrompts_add_to_menu": { + "message": "Zum Menü hinzufügen", + "description": "" + }, + "customPrompts_add_to_menu_always": { + "message": "Immer", + "description": "" + }, + "customPrompts_add_to_menu_reading": { + "message": "E-Mail lesen", + "description": "" + }, + "customPrompts_add_to_menu_composing": { + "message": "E-Mail verfassen", + "description": "" + }, + "customPrompts_close_button": { + "message": "Schließen", + "description": "" + }, + "customPrompts_do_reply": { + "message": "Antworten", + "description": "" + }, + "customPrompts_substitute_text": { + "message": "Text ersetzen", + "description": "" + }, + "chatgpt_win_working": { + "message": "Arbeit in Arbeit...", + "description": "" + }, + "chatgpt_win_job_completed": { + "message": "Abgeschlossen!", + "description": "" + }, + "chatgpt_win_get_answer": { + "message": "Letzte Antwort verwenden", + "description": "" + }, + "chatgpt_win_close": { + "message": "Schließen", + "description": "" + }, + "chatgpt_textarea_not_found_error": { + "message": "Es gibt einen Fehler beim Senden der Eingabeaufforderung an ChatGPT. Bitte versuchen Sie es erneut. Wenn das Problem weiterhin besteht, überprüfen Sie bitte den Dienststatus.", + "description": "" + }, + "chatgpt_sendbutton_not_found_error": { + "message": "Klicken Sie auf die Schaltfläche „Senden“, um die Eingabeaufforderung zu übermitteln.", + "description": "" + }, + "chatgpt_user_not_logged_in": { + "message": "Sie sind nicht bei ChatGPT angemeldet. Bitte melden Sie sich mit Ihren Anmeldeinformationen an, schließen Sie das ChatGPT-Fenster und wiederholen Sie dann die Aktion, die Sie versucht haben. Danach bleiben Sie angemeldet.", + "description": "" + }, + "chatgpt_win_model_warning": { + "message": "Sie haben die Option zur Verwendung von ChatGPT-4 eingestellt, aber es scheint, dass es nicht korrekt geladen wird. Haben Sie oben das Modell 4 oder 4o gewählt?", + "description": "" + }, + "chatgpt_win_custom_text": { + "message": "Fügen Sie hier den zusätzlichen Text für die Eingabeaufforderung ein.", + "description": "" + }, + "chatgpt_win_send": { + "message": "Senden", + "description": "" + }, + "chatgpt_use_gpt35": { + "message": "Verwenden Sie GPT3.5", + "description": "" + }, + "chatgpt_force_completion": { + "message": "Abschluss erzwingen", + "description": "" + }, + "chatgpt_force_completion_title": { + "message": "Klicken Sie hier, um die Schaltfläche „Letzte Antwort verwenden“ anzuzeigen, wenn ChatGPT seine Arbeit abgeschlossen hat, die Schaltfläche jedoch nicht erschienen ist.", + "description": "" + }, + "msg_prompt_too_long": { + "message": "Der eingegebene Text ist zu lang. Sie müssen ihn verkürzen, um ChatGPT zu verwenden.", + "description": "" + }, + "prefs_OptionText_release_notes": { + "message": "Versionshinweise", + "description": "" + }, + "prefs_status_page": { + "message": "Dienststatus", + "description": "" + }, + "prefs_OptionText_chatgpt_win_text": { + "message": "ChatGPT-Fensterabmessungen", + "description": "" + }, + "prefs_OptionText_chatgpt_win_height": { + "message": "Höhe", + "description": "" + }, + "prefs_OptionText_chatgpt_win_width": { + "message": "Breite", + "description": "" + }, + "prefs_OptionText_default_sign_name": { + "message": "Standard-Signaturname", + "description": "" + }, + "prefs_OptionText_default_chatgpt_lang": { + "message": "Standardsprache für ChatGPT-Antworten", + "description": "" + }, + "prefs_OptionText_reply_all": { + "message": "Allen antworten", + "description": "" + }, + "prefs_OptionText_reply_sender": { + "message": "Absender antworten", + "description": "" + }, + "prefs_OptionText_reply_type": { + "message": "Antworttyp", + "description": "" + }, + "prefs_OptionText_chatpgt_keep_formatting": { + "message": "Behalte die Formatierung bei", + "description": "" + }, + "prefs_OptionText_chatpgt_keep_formatting_info": { + "message": "Behalte die Formatierung und die Zahlen oder Aufzählungspunkte aus der ChatGPT-Antwort bei.", + "description": "" + }, + "prefs_OptionText_chatpgt_use_gpt4": { + "message": "Verwenden Sie ChatGPT-4", + "description": "" + }, + "prefs_OptionText_chatpgt_use_gpt4_info": { + "message": "Nachdem Sie diese Option geändert haben, müssen Sie beim ersten Gebrauch das richtige Modell auswählen.", + "description": "" + }, + "prefs_OptionText_btnManagePrompts": { + "message": "Verwalten Sie Ihre Eingabeaufforderungen", + "description": "" + }, + "prefsInfoTitle": { + "message": "Wichtige Informationen", + "description": "" + }, + "prefsInfoDesc_1": { + "message": "Es ist nicht mehr möglich, den Verlauf der ChatGPT-Chats zu deaktivieren. Daher gibt es keine Möglichkeit, zu verhindern, dass Anfragen, die über dieses Addon gestellt werden, in Ihrem ChatGPT-Chatverlauf erscheinen.", + "description": "" + }, + "prefsInfoDesc_2": { + "message": "Wenn eine weiße Seite erscheint, wenn das ChatGPT-Fenster geöffnet wird, bedeutet dies, dass es ein Problem beim Laden der ChatGPT-Seite gibt, das nicht mit der Verwendung dieses Add-Ons zusammenhängt.", + "description": "" + }, + "prefsInfoDesc_3": { + "message": " ", + "description": "" + }, + "prefsDonation_1": { + "message": "Gefällt Ihnen dieses Addon?", + "description": "" + }, + "prefsDonation_2": { + "message": "Überlegen Sie, eine Spende zu machen!", + "description": "" + }, + "backToOptionsText": { + "message": "Optionen", + "description": "" + }, + "TranslateText": { + "message": "Möchtest du helfen, dieses Add-on zu übersetzen?", + "description": "" + }, + "TranslateLink": { + "message": "Finde es heraus!", + "description": "" } - \ No newline at end of file +} \ No newline at end of file diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 2f42ee7f..03b4400d 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -3,429 +3,344 @@ "message": "Use ChatGPT to enhance you emails!", "description": "Description of the extension." }, - "menu_title": { "message": "AI", "description": "" }, - "prompt_lang": { "message": "Reply in ", "description": "" }, - "prompt_reply": { "message": "Reply to this", "description": "" }, - "prompt_rewrite_polite": { "message": "Rewrite polite", "description": "" }, - "prompt_rewrite_formal": { "message": "Rewrite formal", "description": "" }, - "prompt_classify": { "message": "Classify", "description": "" }, - "prompt_summarize_this": { "message": "Summarize this", "description": "" }, - "prompt_translate_this": { "message": "Translate this", "description": "" }, - "prompt_this": { "message": "Prompt this", "description": "" }, - "prompt_selection_needed": { "message": "To proceed, you need to select some text!", "description": "" }, - "customPrompts_managePrompts": { "message": "Manage Prompts", "description": "" }, - "customPrompts_managePrompts_help": { "message": "More info", "description": "" }, - "customPrompts_managePrompts_info_default": { "message": "The default prompts are not editable. You can disable them, then copy the prompt text and paste it into a new one to create a modified version.", "description": "" }, - "customPrompts_start_saving": { "message": "Saving prompts...", "description": "" }, - "customPrompts_reindexing_list": { "message": "Reindexing list...", "description": "" }, - "customPrompts_filtering_prompts": { "message": "Filtering prompts...", "description": "" }, - "customPrompts_saving_default_prompts": { "message": "Saving default prompts...", "description": "" }, - "customPrompts_saving_custom_prompts": { "message": "Saving custom prompts...", "description": "" }, - "customPrompts_reloading_menus": { "message": "Reloading menus...", "description": "" }, - "customPrompts_saved": { "message": "Prompts saved!", "description": "" }, - "customPrompts_form_label_ID": { "message": "ID", "description": "" }, - "customPrompts_form_label_ID_rules": { "message": "Must be unique, lowercase and without spaces", "description": "" }, - "customPrompts_form_label_Name": { "message": "Name", "description": "" }, - "customPrompts_form_label_Text": { "message": "Prompt Text", "description": "" }, - "customPrompts_form_label_Action": { "message": "Action", "description": "" }, - "customPrompts_form_label_need_selected": { "message": "Text selection needed", "description": "" }, - "customPrompts_form_label_need_signature": { "message": "Always add the signature", "description": "" }, - "customPrompts_form_label_need_custom_text": { "message": "Ask for additional text", "description": "" }, - "customPrompts_form_label_enabled": { "message": "Enabled", "description": "" }, - "customPrompts_form_required_fields": { "message": "Required fields", "description": "" }, - "customPrompts_btnEdit": { "message": "Edit", "description": "" }, - "customPrompts_btnCancel": { "message": "Cancel", "description": "" }, - "customPrompts_btnOK": { "message": "OK", "description": "" }, - "customPrompts_btnDelete": { "message": "Delete", "description": "" }, - "customPrompts_btnDelete_confirmText": { "message": "Are you sure you want to delete this item?", "description": "" }, - "customPrompts_unsaved_changes": { "message": "There are unsaved changes!", "description": "" }, - "customPrompts_btnSaveAll": { "message": "Save All", "description": "" }, - "customPrompts_save_button": { "message": "Save", "description": "" }, - "customPrompts_btnNew": { "message": "Add New", "description": "" }, - "customPrompts_btnAddNewCommit": { "message": "Add the Prompt", "description": "" }, - "customPrompts_add_to_menu": { "message": "Add to menu", "description": "" }, - "customPrompts_add_to_menu_always": { "message": "Always", "description": "" }, - "customPrompts_add_to_menu_reading": { "message": "Reading an email", "description": "" }, - "customPrompts_add_to_menu_composing": { "message": "Composing an email", "description": "" }, - "customPrompts_close_button": { "message": "Close button", "description": "" }, - "customPrompts_do_reply": { "message": "Do reply", "description": "" }, - "customPrompts_substitute_text": { "message": "Substitute text", "description": "" }, - "chatgpt_win_working": { "message": "Work in progress...", "description": "" }, - "chatgpt_win_job_completed": { "message": "Completed!", "description": "" }, - "chatgpt_win_get_answer": { "message": "Use last answer", "description": "" }, - "chatgpt_win_close": { "message": "Close", "description": "" }, - "chatgpt_textarea_not_found_error": { "message": "There is an error sending the prompt to ChatGPT, please retry. If the problem persists, please check the service status.", "description": "" }, - "chatgpt_sendbutton_not_found_error": { "message": "Click the send button to submit the prompt.", "description": "" }, - "chatgpt_user_not_logged_in": { "message": "You are not logged in to ChatGPT. Please log in with your credentials, close the ChatGPT window, and then repeat the action you attempted. You will remain logged in afterwards.", "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 model 4 or 4o at the top?", "description": "" }, - "chatgpt_win_custom_text": { "message": "Insert here the additional text for the prompt.", "description": "" }, - "chatgpt_win_send": { "message": "Send", "description": "" }, - "chatgpt_use_gpt35": { "message": "Use GPT3.5", "description": "" }, - "chatgpt_force_completion": { "message": "force completion", "description": "" }, - "chatgpt_force_completion_title": { "message": "Click here to display the 'Use last answer' button if ChatGPT has finished its work but the button has not appeared.", "description": "" }, - "msg_prompt_too_long": { "message": "The text you provided is too long. You need to reduce it to use ChatGPT.", "description": "" }, - "prefs_OptionText_release_notes": { "message": "Release Notes", "description": "" }, - "prefs_status_page": { "message": "service status", "description": "" }, - "prefs_OptionText_chatgpt_win_text": { "message": "ChatGPT window dimensions", "description": "" }, - "prefs_OptionText_chatgpt_win_height": { "message": "Height", "description": "" }, - "prefs_OptionText_chatgpt_win_width": { "message": "Width", "description": "" }, - "prefs_OptionText_default_sign_name": { "message": "Default signature name", "description": "" }, - "prefs_OptionText_default_chatgpt_lang": { "message": "Default language for ChatGPT responses", "description": "" }, - "prefs_OptionText_reply_all": { "message": "Reply to All", "description": "" }, - "prefs_OptionText_reply_sender": { "message": "Reply to Sender", "description": "" }, - "prefs_OptionText_reply_type": { "message": "Reply type", "description": "" }, - "prefs_OptionText_chatpgt_keep_formatting": { "message": "Keep formatting", "description": "" }, - "prefs_OptionText_chatpgt_keep_formatting_info": { "message": "Keep the formatting and numeral or bullet points from the ChatGPT response.", "description": "" }, - "prefs_OptionText_chatpgt_use_gpt4": { "message": "Use ChatGPT-4", "description": "" }, - "prefs_OptionText_chatpgt_use_gpt4_info": { "message": "After changing this option, you have to choose the right model the first time you use it.", "description": "" }, - "prefs_OptionText_btnManagePrompts": { "message": "Manage your prompts", "description": "" }, - "prefsInfoTitle": { "message": "Important Information", "description": "" }, - "prefsInfoDesc_1": { "message": "It is no longer possible to disable the history of ChatGPT chats. Therefore, there is no way to prevent requests made through this addon from appearing in your ChatGPT chat history.", "description": "" }, - "prefsInfoDesc_2": { "message": "If a white page appears when opening the ChatGPT window, it means there is a problem loading the ChatGPT page, not related to the use of this add-on.", "description": "" }, - "prefsInfoDesc_3": { "message": " ", "description": "" }, - "prefsDonation_1": { "message": "Do you like this addon?", "description": "" }, - "prefsDonation_2": { "message": "Consider to make a donation!", "description": "" }, - "backToOptionsText": { "message": "Options", "description": "" }, - "TranslateText": { "message": "Do you want to help translate this addon?", "description": "" }, - "TranslateLink": { "message": "Find out how!", "description": "" } -} +} \ No newline at end of file diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index ff59e670..7f38cda4 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -1,431 +1,346 @@ { - "extensionDescription": { - "message": "Utilisez ChatGPT pour améliorer vos emails !", - "description": "Description de l'extension." - }, - - "menu_title": { - "message": "IA", - "description": "" - }, - - "prompt_lang": { - "message": "Répondre en ", - "description": "" - }, - - "prompt_reply": { - "message": "Répondre à ceci", - "description": "" - }, - - "prompt_rewrite_polite": { - "message": "Réécrire de manière polie", - "description": "" - }, - - "prompt_rewrite_formal": { - "message": "Réécrire de manière formelle", - "description": "" - }, - - "prompt_classify": { - "message": "Classer", - "description": "" - }, - - "prompt_summarize_this": { - "message": "Résumer ceci", - "description": "" - }, - - "prompt_translate_this": { - "message": "Traduire ceci", - "description": "" - }, - - "prompt_this": { - "message": "Proposer ceci", - "description": "" - }, - - "prompt_selection_needed": { - "message": "Pour continuer, vous devez sélectionner du texte !", - "description": "" - }, - - "customPrompts_managePrompts": { - "message": "Gérer les prompts", - "description": "" - }, - - "customPrompts_managePrompts_help": { - "message": "Informations", - "description": "" - }, - - "customPrompts_managePrompts_info_default": { - "message": "Les invites par défaut ne sont pas modifiables. Vous pouvez les désactiver, puis copier le texte de l'invite et le coller dans une nouvelle pour créer une version modifiée.", - "description": "" - }, - - "customPrompts_start_saving": { - "message": "Enregistrement des prompts...", - "description": "" - }, - - "customPrompts_reindexing_list": { - "message": "Réindexation de la liste...", - "description": "" - }, - - "customPrompts_filtering_prompts": { - "message": "Filtrage des prompts...", - "description": "" - }, - - "customPrompts_saving_default_prompts": { - "message": "Enregistrement des prompts par défaut...", - "description": "" - }, - - "customPrompts_saving_custom_prompts": { - "message": "Enregistrement des prompts personnalisées...", - "description": "" - }, - - "customPrompts_reloading_menus": { - "message": "Rechargement des menus...", - "description": "" - }, - - "customPrompts_saved": { - "message": "prompts enregistrées !", - "description": "" - }, - - "customPrompts_form_label_ID": { - "message": "ID", - "description": "" - }, - - "customPrompts_form_label_ID_rules": { - "message": "Doit être unique, en minuscules et sans espaces", - "description": "" - }, - - "customPrompts_form_label_Name": { - "message": "Nom", - "description": "" - }, - - "customPrompts_form_label_Text": { - "message": "Texte de la proposition", - "description": "" - }, - - "customPrompts_form_label_Action": { - "message": "Action", - "description": "" - }, - - "customPrompts_form_label_need_selected": { - "message": "Sélection de texte nécessaire", - "description": "" - }, - - "customPrompts_form_label_need_signature": { - "message": "Toujours ajouter la signature", - "description": "" - }, - - "customPrompts_form_label_need_custom_text": { - "message": "Demander du texte supplémentaire", - "description": "" - }, - - "customPrompts_form_label_enabled": { - "message": "Activé", - "description": "" - }, - - "customPrompts_form_required_fields": { - "message": "Champs obligatoires", - "description": "" - }, - - "customPrompts_btnEdit": { - "message": "Modifier", - "description": "" - }, - - "customPrompts_btnCancel": { - "message": "Annuler", - "description": "" - }, - - "customPrompts_btnOK": { - "message": "OK", - "description": "" - }, - - "customPrompts_btnDelete": { - "message": "Supprimer", - "description": "" - }, - - "customPrompts_btnDelete_confirmText": { - "message": "Êtes-vous sûr de vouloir supprimer cet élément ?", - "description": "" - }, - - "customPrompts_unsaved_changes": { - "message": "Il y a des modifications non enregistrées !", - "description": "" - }, - - "customPrompts_btnSaveAll": { - "message": "Tout enregistrer", - "description": "" - }, - - "customPrompts_save_button": { - "message": "Enregistrer", - "description": "" - }, - - "customPrompts_btnNew": { - "message": "Ajouter nouveau", - "description": "" - }, - - "customPrompts_btnAddNewCommit": { - "message": "Ajouter la proposition", - "description": "" - }, - - "customPrompts_add_to_menu": { - "message": "Ajouter au menu", - "description": "" - }, - - "customPrompts_add_to_menu_always": { - "message": "Toujours", - "description": "" - }, - - "customPrompts_add_to_menu_reading": { - "message": "Lors de la lecture d'un email", - "description": "" - }, - - "customPrompts_add_to_menu_composing": { - "message": "Lors de la rédaction d'un email", - "description": "" - }, - - "customPrompts_close_button": { - "message": "Bouton de fermeture", - "description": "" - }, - - "customPrompts_do_reply": { - "message": "Faire une réponse", - "description": "" - }, - - "customPrompts_substitute_text": { - "message": "Remplacer le texte", - "description": "" - }, - - "chatgpt_win_working": { - "message": "Travail en cours...", - "description": "" - }, - - "chatgpt_win_job_completed": { - "message": "Terminé !", - "description": "" - }, - - "chatgpt_win_get_answer": { - "message": "Utiliser la dernière réponse", - "description": "" - }, - - "chatgpt_win_close": { - "message": "Fermer", - "description": "" - }, - - "chatgpt_textarea_not_found_error": { - "message": "Il y a une erreur lors de l'envoi de la proposition à ChatGPT, veuillez réessayer. Si le problème persiste, veuillez vérifier le statut du service.", - "description": "" - }, - - "chatgpt_sendbutton_not_found_error": { - "message": "Cliquez sur le bouton d'envoi pour soumettre la proposition.", - "description": "" - }, - - "chatgpt_user_not_logged_in": { - "message": "Vous n'êtes pas connecté à ChatGPT. Veuillez vous connecter avec vos identifiants, fermer la fenêtre ChatGPT, puis répéter l'action que vous avez tentée. Vous resterez connecté par la suite.", - "description": "" - }, - - "chatgpt_win_model_warning": { - "message": "Vous avez choisi l'option d'utiliser ChatGPT-4, mais il semble qu'il ne se charge pas correctement. Avez-vous choisi le modèle 4 ou 4o en haut ?", - "description": "" - }, - - "chatgpt_win_custom_text": { - "message": "Insérez ici le texte supplémentaire pour la proposition.", - "description": "" - }, - - "chatgpt_win_send": { - "message": "Envoyer", - "description": "" - }, - - "chatgpt_use_gpt35": { - "message": "Utiliser GPT3.5", - "description": "" - }, - - "chatgpt_force_completion": { - "message": "forcer l'achèvement", - "description": "" - }, - - "chatgpt_force_completion_title": { - "message": "Cliquez ici pour afficher le bouton 'Utiliser la dernière réponse' si ChatGPT a terminé son travail mais que le bouton n'est pas apparu.", - "description": "" - }, - - "msg_prompt_too_long": { - "message": "Le texte que vous avez fourni est trop long. Vous devez le réduire pour utiliser ChatGPT.", - "description": "" - }, - - "prefs_OptionText_release_notes": { - "message": "Notes de version", - "description": "" - }, - - "prefs_status_page": { - "message": "statut du service", - "description": "" - }, - - "prefs_OptionText_chatgpt_win_text": { - "message": "Dimensions de la fenêtre ChatGPT", - "description": "" - }, - - "prefs_OptionText_chatgpt_win_height": { - "message": "Hauteur", - "description": "" - }, - - "prefs_OptionText_chatgpt_win_width": { - "message": "Largeur", - "description": "" - }, - - "prefs_OptionText_default_sign_name": { - "message": "Nom de la signature par défaut", - "description": "" - }, - - "prefs_OptionText_default_chatgpt_lang": { - "message": "Langue par défaut pour les réponses de ChatGPT", - "description": "" - }, - - "prefs_OptionText_reply_all": { - "message": "Répondre à tous", - "description": "" - }, - - "prefs_OptionText_reply_sender": { - "message": "Répondre à l'expéditeur", - "description": "" - }, - - "prefs_OptionText_reply_type": { - "message": "Type de réponse", - "description": "" - }, - - "prefs_OptionText_chatpgt_keep_formatting": { - "message": "Conserver la mise en forme", - "description": "" - }, - - "prefs_OptionText_chatpgt_keep_formatting_info": { - "message": "Conservez la mise en forme et les numéros ou les puces de la réponse de ChatGPT.", - "description": "" - }, - - "prefs_OptionText_chatpgt_use_gpt4": { - "message": "Utiliser ChatGPT-4", - "description": "" - }, - - "prefs_OptionText_chatpgt_use_gpt4_info": { - "message": "Après avoir changé cette option, vous devez choisir le bon modèle la première fois que vous l'utilisez.", - "description": "" - }, - - "prefs_OptionText_btnManagePrompts": { - "message": "Gérer vos prompts", - "description": "" - }, - - "prefsInfoTitle": { - "message": "Informations importantes", - "description": "" - }, - - "prefsInfoDesc_1": { - "message": "Il n'est plus possible de désactiver l'historique des chats ChatGPT. Par conséquent, il n'y a aucun moyen d'empêcher les demandes effectuées via cet addon d'apparaître dans l'historique de vos chats ChatGPT.", - "description": "" - }, - - "prefsInfoDesc_2": { - "message": "Si une page blanche apparaît lors de l'ouverture de la fenêtre ChatGPT, cela signifie qu'il y a un problème de chargement de la page ChatGPT, non lié à l'utilisation de cet addon.", - "description": "" - }, - - "prefsInfoDesc_3": { - "message": " ", - "description": "" - }, - - "prefsDonation_1": { - "message": "Aimez-vous cet addon ?", - "description": "" - }, - - "prefsDonation_2": { - "message": "Envisagez de faire un don !", - "description": "" - }, - - "backToOptionsText": { - "message": "Options", - "description": "" - }, - "TranslateText": { - "message": "Voulez-vous aider à traduire cet addon ?", - "description": "" - }, - - "TranslateLink": { - "message": "Découvrez comment !", - "description": "" - } + "extensionDescription": { + "message": "Utilisez ChatGPT pour améliorer vos emails !", + "description": "Description de l'extension." + }, + "menu_title": { + "message": "IA", + "description": "" + }, + "prompt_lang": { + "message": "Répondre en ", + "description": "" + }, + "prompt_reply": { + "message": "Répondre à ceci", + "description": "" + }, + "prompt_rewrite_polite": { + "message": "Réécrire de manière polie", + "description": "" + }, + "prompt_rewrite_formal": { + "message": "Réécrire de manière formelle", + "description": "" + }, + "prompt_classify": { + "message": "Classer", + "description": "" + }, + "prompt_summarize_this": { + "message": "Résumer ceci", + "description": "" + }, + "prompt_translate_this": { + "message": "Traduire ceci", + "description": "" + }, + "prompt_this": { + "message": "Proposer ceci", + "description": "" + }, + "prompt_selection_needed": { + "message": "Pour continuer, vous devez sélectionner du texte !", + "description": "" + }, + "customPrompts_managePrompts": { + "message": "Gérer les prompts", + "description": "" + }, + "customPrompts_managePrompts_help": { + "message": "Informations", + "description": "" + }, + "customPrompts_managePrompts_info_default": { + "message": "Les invites par défaut ne sont pas modifiables. Vous pouvez les désactiver, puis copier le texte de l'invite et le coller dans une nouvelle pour créer une version modifiée.", + "description": "" + }, + "customPrompts_start_saving": { + "message": "Enregistrement des prompts...", + "description": "" + }, + "customPrompts_reindexing_list": { + "message": "Réindexation de la liste...", + "description": "" + }, + "customPrompts_filtering_prompts": { + "message": "Filtrage des prompts...", + "description": "" + }, + "customPrompts_saving_default_prompts": { + "message": "Enregistrement des prompts par défaut...", + "description": "" + }, + "customPrompts_saving_custom_prompts": { + "message": "Enregistrement des prompts personnalisées...", + "description": "" + }, + "customPrompts_reloading_menus": { + "message": "Rechargement des menus...", + "description": "" + }, + "customPrompts_saved": { + "message": "prompts enregistrées !", + "description": "" + }, + "customPrompts_form_label_ID": { + "message": "ID", + "description": "" + }, + "customPrompts_form_label_ID_rules": { + "message": "Doit être unique, en minuscules et sans espaces", + "description": "" + }, + "customPrompts_form_label_Name": { + "message": "Nom", + "description": "" + }, + "customPrompts_form_label_Text": { + "message": "Texte de la proposition", + "description": "" + }, + "customPrompts_form_label_Action": { + "message": "Action", + "description": "" + }, + "customPrompts_form_label_need_selected": { + "message": "Sélection de texte nécessaire", + "description": "" + }, + "customPrompts_form_label_need_signature": { + "message": "Toujours ajouter la signature", + "description": "" + }, + "customPrompts_form_label_need_custom_text": { + "message": "Demander du texte supplémentaire", + "description": "" + }, + "customPrompts_form_label_enabled": { + "message": "Activé", + "description": "" + }, + "customPrompts_form_required_fields": { + "message": "Champs obligatoires", + "description": "" + }, + "customPrompts_btnEdit": { + "message": "Modifier", + "description": "" + }, + "customPrompts_btnCancel": { + "message": "Annuler", + "description": "" + }, + "customPrompts_btnOK": { + "message": "OK", + "description": "" + }, + "customPrompts_btnDelete": { + "message": "Supprimer", + "description": "" + }, + "customPrompts_btnDelete_confirmText": { + "message": "Êtes-vous sûr de vouloir supprimer cet élément ?", + "description": "" + }, + "customPrompts_unsaved_changes": { + "message": "Il y a des modifications non enregistrées !", + "description": "" + }, + "customPrompts_btnSaveAll": { + "message": "Tout enregistrer", + "description": "" + }, + "customPrompts_save_button": { + "message": "Enregistrer", + "description": "" + }, + "customPrompts_btnNew": { + "message": "Ajouter nouveau", + "description": "" + }, + "customPrompts_btnAddNewCommit": { + "message": "Ajouter la proposition", + "description": "" + }, + "customPrompts_add_to_menu": { + "message": "Ajouter au menu", + "description": "" + }, + "customPrompts_add_to_menu_always": { + "message": "Toujours", + "description": "" + }, + "customPrompts_add_to_menu_reading": { + "message": "Lors de la lecture d'un email", + "description": "" + }, + "customPrompts_add_to_menu_composing": { + "message": "Lors de la rédaction d'un email", + "description": "" + }, + "customPrompts_close_button": { + "message": "Bouton de fermeture", + "description": "" + }, + "customPrompts_do_reply": { + "message": "Faire une réponse", + "description": "" + }, + "customPrompts_substitute_text": { + "message": "Remplacer le texte", + "description": "" + }, + "chatgpt_win_working": { + "message": "Travail en cours...", + "description": "" + }, + "chatgpt_win_job_completed": { + "message": "Terminé !", + "description": "" + }, + "chatgpt_win_get_answer": { + "message": "Utiliser la dernière réponse", + "description": "" + }, + "chatgpt_win_close": { + "message": "Fermer", + "description": "" + }, + "chatgpt_textarea_not_found_error": { + "message": "Il y a une erreur lors de l'envoi de la proposition à ChatGPT, veuillez réessayer. Si le problème persiste, veuillez vérifier le statut du service.", + "description": "" + }, + "chatgpt_sendbutton_not_found_error": { + "message": "Cliquez sur le bouton d'envoi pour soumettre la proposition.", + "description": "" + }, + "chatgpt_user_not_logged_in": { + "message": "Vous n'êtes pas connecté à ChatGPT. Veuillez vous connecter avec vos identifiants, fermer la fenêtre ChatGPT, puis répéter l'action que vous avez tentée. Vous resterez connecté par la suite.", + "description": "" + }, + "chatgpt_win_model_warning": { + "message": "Vous avez choisi l'option d'utiliser ChatGPT-4, mais il semble qu'il ne se charge pas correctement. Avez-vous choisi le modèle 4 ou 4o en haut ?", + "description": "" + }, + "chatgpt_win_custom_text": { + "message": "Insérez ici le texte supplémentaire pour la proposition.", + "description": "" + }, + "chatgpt_win_send": { + "message": "Envoyer", + "description": "" + }, + "chatgpt_use_gpt35": { + "message": "Utiliser GPT3.5", + "description": "" + }, + "chatgpt_force_completion": { + "message": "forcer l'achèvement", + "description": "" + }, + "chatgpt_force_completion_title": { + "message": "Cliquez ici pour afficher le bouton 'Utiliser la dernière réponse' si ChatGPT a terminé son travail mais que le bouton n'est pas apparu.", + "description": "" + }, + "msg_prompt_too_long": { + "message": "Le texte que vous avez fourni est trop long. Vous devez le réduire pour utiliser ChatGPT.", + "description": "" + }, + "prefs_OptionText_release_notes": { + "message": "Notes de version", + "description": "" + }, + "prefs_status_page": { + "message": "statut du service", + "description": "" + }, + "prefs_OptionText_chatgpt_win_text": { + "message": "Dimensions de la fenêtre ChatGPT", + "description": "" + }, + "prefs_OptionText_chatgpt_win_height": { + "message": "Hauteur", + "description": "" + }, + "prefs_OptionText_chatgpt_win_width": { + "message": "Largeur", + "description": "" + }, + "prefs_OptionText_default_sign_name": { + "message": "Nom de la signature par défaut", + "description": "" + }, + "prefs_OptionText_default_chatgpt_lang": { + "message": "Langue par défaut pour les réponses de ChatGPT", + "description": "" + }, + "prefs_OptionText_reply_all": { + "message": "Répondre à tous", + "description": "" + }, + "prefs_OptionText_reply_sender": { + "message": "Répondre à l'expéditeur", + "description": "" + }, + "prefs_OptionText_reply_type": { + "message": "Type de réponse", + "description": "" + }, + "prefs_OptionText_chatpgt_keep_formatting": { + "message": "Conserver la mise en forme", + "description": "" + }, + "prefs_OptionText_chatpgt_keep_formatting_info": { + "message": "Conservez la mise en forme et les numéros ou les puces de la réponse de ChatGPT.", + "description": "" + }, + "prefs_OptionText_chatpgt_use_gpt4": { + "message": "Utiliser ChatGPT-4", + "description": "" + }, + "prefs_OptionText_chatpgt_use_gpt4_info": { + "message": "Après avoir changé cette option, vous devez choisir le bon modèle la première fois que vous l'utilisez.", + "description": "" + }, + "prefs_OptionText_btnManagePrompts": { + "message": "Gérer vos prompts", + "description": "" + }, + "prefsInfoTitle": { + "message": "Informations importantes", + "description": "" + }, + "prefsInfoDesc_1": { + "message": "Il n'est plus possible de désactiver l'historique des chats ChatGPT. Par conséquent, il n'y a aucun moyen d'empêcher les demandes effectuées via cet addon d'apparaître dans l'historique de vos chats ChatGPT.", + "description": "" + }, + "prefsInfoDesc_2": { + "message": "Si une page blanche apparaît lors de l'ouverture de la fenêtre ChatGPT, cela signifie qu'il y a un problème de chargement de la page ChatGPT, non lié à l'utilisation de cet addon.", + "description": "" + }, + "prefsInfoDesc_3": { + "message": " ", + "description": "" + }, + "prefsDonation_1": { + "message": "Aimez-vous cet addon ?", + "description": "" + }, + "prefsDonation_2": { + "message": "Envisagez de faire un don !", + "description": "" + }, + "backToOptionsText": { + "message": "Options", + "description": "" + }, + "TranslateText": { + "message": "Voulez-vous aider à traduire cet addon ?", + "description": "" + }, + "TranslateLink": { + "message": "Découvrez comment !", + "description": "" } - \ No newline at end of file +} \ No newline at end of file From 49d52abac8140c3afd73dcecceb91f9708cb7f81 Mon Sep 17 00:00:00 2001 From: mic Date: Thu, 27 Jun 2024 21:18:00 +0200 Subject: [PATCH 30/32] correctly working with plain text response. really fixing #77 --- js/mzta-chatgpt.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js index d92f824d..a0cbcd5c 100644 --- a/js/mzta-chatgpt.js +++ b/js/mzta-chatgpt.js @@ -81,6 +81,15 @@ async function chatgpt_getFromDOM(pos) { // Extract the new HTML string responseDivs[responseDivs.length - 1].innerHTML = doc.body.innerHTML; response = responseDivs[responseDivs.length - 1].textContent; + response = response.replace(/^ChatGPT(?:ChatGPT)?/, ''); // strip sender name + response = response.trim().replace(/^"|"$/g, ''); // strip quotation marks + response = "

      " + response + "

      "; + //console.log(">>>>>>>>> response: " + JSON.stringify(response)); + let parser_2 = new DOMParser(); + let doc_response = parser_2.parseFromString(response, 'text/html'); + //console.log(">>>>>>>>> doc_response: " + JSON.stringify(doc_response.body.innerHTML)); + replaceNewlinesWithBr(doc_response.body) + response = doc_response.body.innerHTML; // response = responseDivs[responseDivs.length - 1].innerHTML; } else { // Return HTML // Tags to exclude @@ -119,8 +128,6 @@ async function chatgpt_getFromDOM(pos) { ); response = responseDivs[nthOfResponse - 1].textContent; } - response = response.replace(/^ChatGPT(?:ChatGPT)?/, ''); // strip sender name - response = response.trim().replace(/^"|"$/g, ''); // strip quotation marks //console.log('>>>>>>>>>>>>>> chatgpt_getFromDOM: ' + JSON.stringify(response)); } return response; From ee78f774eaa3f31aad75c271f1ea3dd57aba3e09 Mon Sep 17 00:00:00 2001 From: mic Date: Thu, 27 Jun 2024 21:21:27 +0200 Subject: [PATCH 31/32] version se to 1.1.4pre3 --- CHANGELOG.md | 2 +- manifest.json | 2 +- options/mzta-release-notes.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a48f556b..2d204534 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ -

      Version 1.1.4pre2 - ??/??/2024

      +

      Version 1.1.4pre3 - ??/??/2024

      • Added an option to import text with formatting from ChatGPT, set to false by default [#70], [#77].
      • Improve the message warning to choose the right model [#76].
      • diff --git a/manifest.json b/manifest.json index 4c1bf6af..f8b55291 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "ThunderAI", "description": "__MSG_extensionDescription__", - "version": "1.1.4pre2", + "version": "1.1.4pre3", "author": "Mic (m@micz.it)", "homepage_url": "https://micz.it/thunderbird-addon-thunderai/", "browser_specific_settings": { diff --git a/options/mzta-release-notes.html b/options/mzta-release-notes.html index b0c680c9..0f1b7aa3 100644 --- a/options/mzta-release-notes.html +++ b/options/mzta-release-notes.html @@ -7,7 +7,7 @@

        ThunderAI Release Notes

        -

        Version 1.1.4pre2 - ??/??/2024

        +

        Version 1.1.4pre3 - ??/??/2024

        • Added an option to import text with formatting from ChatGPT, set to false by default [#70], [#77].
        • Improve the message warning to choose the right model [#76].
        • From fee9133d1b177f22274e4af29fcf11aff219cefd Mon Sep 17 00:00:00 2001 From: mic Date: Fri, 28 Jun 2024 21:35:46 +0200 Subject: [PATCH 32/32] version set to 1.1.4 --- CHANGELOG.md | 2 +- manifest.json | 2 +- options/mzta-release-notes.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d204534..3374d609 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ -

          Version 1.1.4pre3 - ??/??/2024

          +

          Version 1.1.4 - 28/06/2024

          • Added an option to import text with formatting from ChatGPT, set to false by default [#70], [#77].
          • Improve the message warning to choose the right model [#76].
          • diff --git a/manifest.json b/manifest.json index f8b55291..6e17b005 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "ThunderAI", "description": "__MSG_extensionDescription__", - "version": "1.1.4pre3", + "version": "1.1.4", "author": "Mic (m@micz.it)", "homepage_url": "https://micz.it/thunderbird-addon-thunderai/", "browser_specific_settings": { diff --git a/options/mzta-release-notes.html b/options/mzta-release-notes.html index 0f1b7aa3..911ec50c 100644 --- a/options/mzta-release-notes.html +++ b/options/mzta-release-notes.html @@ -7,7 +7,7 @@

            ThunderAI Release Notes

            -

            Version 1.1.4pre3 - ??/??/2024

            +

            Version 1.1.4 - 28/06/2024

            • Added an option to import text with formatting from ChatGPT, set to false by default [#70], [#77].
            • Improve the message warning to choose the right model [#76].