diff --git a/CHANGELOG.md b/CHANGELOG.md
index b69fa898..bb667524 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,49 +1,81 @@
#  ThunderAI Release Notes
+
+
Version 1.1.0 - ??/??/2024
- A prompt can be configured to request additional text from the user.
- Added custom prompts. See more info here.
- Dark mode added.
+
+Version 1.0.10 - 17/05/2024
+
+ - Now using the new URL chatgpt.com.
+ - More improvements in handling the ChatGPT web interface.
+
+
+Version 1.0.9 - 16/05/2024
+
+ - Improved handling of different versions of the ChatGPT web interface.
+
+
+Version 1.0.8 - 15/05/2024
+
+ - Fixed changes in the ChatGPT web interface, see #57 and #62.
+ - Correctly handling the model ChatGPT-4o.
+
+
+Version 1.0.7 - 09/05/2024
+
+ - Improved the reply prompt to exclude comments and other text beside the mail text.
+ - Correctly keeping the signature in a reply even if it's above the quoted email [#45].
+
+
Version 1.0.6 - 08/05/2024
-- Correctly handling a change in the ChatGPT web interface. See issue #43
-- Added a button to force the completion to display the 'Use last answer' button if ChatGPT has finished its work but the button has not appeared.
+ - Correctly handling a change in the ChatGPT web interface [#43].
+ - Added a button to force the completion to display the 'Use last answer' button if ChatGPT has finished its work but the button has not appeared.
+
Version 1.0.5 - 03/05/2024
- - Fixed the handling of ChatGPT-4 in a large window. See issue #38
+ - Fixed the handling of ChatGPT-4 in a large window [#38].
+
Version 1.0.4 - 01/05/2024
- - Stripping the quotation marks from the response.
- - Now it is possible to undo text modifications implemented by ChatGPT (CTRL+Z on Windows). See issue #34
- - Now closing the compose window after unsaved text modifications implemented by ChatGPT triggers the usual warning message. See issue #30
- - Updated the "Important Information" section on the options page, as it is no longer possible to disable the ChatGPT chat history.
+ - Stripping the quotation marks from the response.
+ - Now it is possible to undo text modifications implemented by ChatGPT (CTRL+Z on Windows) [#34].
+ - Now closing the compose window after unsaved text modifications implemented by ChatGPT triggers the usual warning message [#30].
+ - Updated the "Important Information" section on the options page, as it is no longer possible to disable the ChatGPT chat history.
+
Version 1.0.3 - 27/04/2024
- - Using the right identity when replying to a message. See issue #31
+ - Using the right identity when replying to a message [#31].
+
Version 1.0.2 - 18/04/2024
- - New standard menus.
- - Fixed a bug in importing replies text.
- - Fixed the handling of the new change model button in the ChatGPT interface.
- - Added an option to choose between GPT-3.5 and GPT-4 Models. See issue #27
- - Added a link to the Status Page, to check if there are known issues in interacting with the ChatGPT web interface.
+ - New standard menus.
+ - Fixed a bug in importing replies text.
+ - Fixed the handling of the new change model button in the ChatGPT interface.
+ - Added an option to choose between GPT-3.5 and GPT-4 Models [#27].
+ - Added a link to the Status Page, to check if there are known issues in interacting with the ChatGPT web interface.
+
Version 1.0.1 - 13/04/2024
- - Italian addon description fixed.
- - Improved the method to open the ChatGPT window. Thanks to John Bieling.
- - Fixed a bug in replying to a message. Now the quoted text is correctly displayed.
- - Fixed a bug in the compose window. Now is correctly used only the selected text.
- - If the prompt is more than 30.000 characters, do not proceed and give a message to the user.
+ - Italian addon description fixed.
+ - Improved the method to open the ChatGPT window. Thanks to John Bieling.
+ - Fixed a bug in replying to a message. Now the quoted text is correctly displayed.
+ - Fixed a bug in the compose window. Now is correctly used only the selected text.
+ - If the prompt is more than 30.000 characters, do not proceed and give a message to the user.
+
Version 1.0 - 05/04/2024
\ No newline at end of file
+ First release.
+
diff --git a/README.md b/README.md
index 787b743b..4eda0624 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,13 @@
#  ThunderAI
+> [!IMPORTANT]
+> ## Custom Prompts are coming!
+>
+> Try this new feature in the [new pre-release version](https://github.com/micz/ThunderAI/releases/tag/v1.1.0pre3).
+
+
+
+
ThunderAI is a Thunderbird Addon that uses the capabilities of ChatGPT to enhance email management.
It enables users to analyze, write, correct, and optimize their emails, facilitating more effective and professional communication.
diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js
index 8379694d..d06ed593 100644
--- a/js/mzta-chatgpt.js
+++ b/js/mzta-chatgpt.js
@@ -107,8 +107,7 @@ async function chatgpt_getFromDOM(pos) {
);
response = responseDivs[nthOfResponse - 1].textContent;
}
- response = response.replace(/^ChatGPTChatGPT/, ''); // strip sender name
- response = response.replace(/^ChatGPT/, ''); // strip sender name
+ response = response.replace(/^ChatGPT(?:ChatGPT)?/, ''); // strip sender name
response = response.trim().replace(/^"|"$/g, ''); // strip quotation marks
//console.log('chatgpt_getFromDOM: ' + response);
}
diff --git a/js/mzta-compose-script.js b/js/mzta-compose-script.js
index b7ad0295..99d8f45e 100644
--- a/js/mzta-compose-script.js
+++ b/js/mzta-compose-script.js
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-// Some original methods are a modified version derived from https://github.com/ali-raheem/Aify/blob/13ff87583bc520fb80f555ab90a90c5c9df797a7/plugin/content_scripts/compose.js
+// 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,}/);
diff --git a/js/mzta-utils.js b/js/mzta-utils.js
index 336f2010..098e149b 100644
--- a/js/mzta-utils.js
+++ b/js/mzta-utils.js
@@ -93,15 +93,31 @@ export async function replaceBody(tabId, text){
const insertText = function (text, fullBody_string) {
const parser = new DOMParser();
let fullBody = parser.parseFromString(fullBody_string, "text/html");
- const prefix = fullBody.getElementsByClassName("moz-cite-prefix");
- if (prefix.length > 0) {
- const divider = prefix[0];
- let sibling = divider.previousSibling;
+
+ // 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");
+ const prefix_sign = fullBody.getElementsByClassName("moz-signature");
+
+ let firstElement = null;
+ if (prefix_quote.length > 0 && prefix_sign.length > 0) {
+ firstElement = prefix_quote[0].compareDocumentPosition(prefix_sign[0]) & Node.DOCUMENT_POSITION_FOLLOWING ? prefix_quote[0] : prefix_sign[0];
+ //console.log('>>>>>>>>>>>>>>> quote and signature found: ' + JSON.stringify(firstElement.innerHTML))
+ //console.log('>>>>>>>>>>>>>>> DocPosition: ' + prefix_quote[0].compareDocumentPosition(prefix_sign[0]))
+ } else if (prefix_quote.length > 0) {
+ firstElement = prefix_quote[0];
+ //console.log('>>>>>>>>>>>>>>> quote found')
+ } else if (prefix_sign.length > 0) {
+ firstElement = prefix_sign[0];
+ //console.log('>>>>>>>>>>>>>>> signature found')
+ }
+ if (firstElement) {
+ let sibling = firstElement.previousSibling;
while (sibling) {
fullBody.body.removeChild(sibling);
- sibling = divider.previousSibling;
+ sibling = firstElement.previousSibling;
}
}
+
let final_p = document.createElement("p");
final_p.innerHTML = "
";
fullBody.body.insertBefore(final_p, fullBody.body.firstChild);
diff --git a/options/mzta-release-notes.html b/options/mzta-release-notes.html
index 314b71b0..8cebe284 100644
--- a/options/mzta-release-notes.html
+++ b/options/mzta-release-notes.html
@@ -15,46 +15,76 @@
Added some error messages to handle potential changes in the ChatGPT web interface.
German translation added.
- Version 1.0.6 - 08/05/2024
-
- - Correctly handling a change in the ChatGPT web interface. See issue #43
- - Added a button to force the completion to display the 'Use last answer' button if ChatGPT has finished its work but the button has not appeared.
-
- Version 1.0.5 - 03/05/2024
-
- - Fixed the handling of ChatGPT-4 in a large window. See issue #38
-
- Version 1.0.4 - 01/05/2024
-
+
+ Version 1.0.10 - 17/05/2024
+
+ - Now using the new URL chatgpt.com.
+ - More improvements in handling the ChatGPT web interface.
+
+
+ Version 1.0.9 - 16/05/2024
+
+ - Improved handling of different versions of the ChatGPT web interface.
+
+
+ Version 1.0.8 - 15/05/2024
+
+ - Fixed changes in the ChatGPT web interface, see #57 and #62.
+ - Correctly handling the model ChatGPT-4o.
+
+
+ Version 1.0.7 - 09/05/2024
+
+ - Improved the reply prompt to exclude comments and other text beside the mail text.
+ - Correctly keeping the signature in a reply even if it's above the quoted email [#45].
+
+
+ Version 1.0.6 - 08/05/2024
+
+ - Correctly handling a change in the ChatGPT web interface [#43].
+ - Added a button to force the completion to display the 'Use last answer' button if ChatGPT has finished its work but the button has not appeared.
+
+
+ Version 1.0.5 - 03/05/2024
+
+ - Fixed the handling of ChatGPT-4 in a large window [#38].
+
+
+ Version 1.0.4 - 01/05/2024
+
- Stripping the quotation marks from the response.
- - Now it is possible to undo text modifications implemented by ChatGPT (CTRL+Z on Windows). See issue #34
- - Now closing the compose window after unsaved text modifications implemented by ChatGPT triggers the usual warning message. See issue #30
+ - Now it is possible to undo text modifications implemented by ChatGPT (CTRL+Z on Windows) [#34].
+ - Now closing the compose window after unsaved text modifications implemented by ChatGPT triggers the usual warning message [#30].
- Updated the "Important Information" section on the options page, as it is no longer possible to disable the ChatGPT chat history.
-
- Version 1.0.3 - 27/04/2024
-
- - Using the right identity when replying to a message. See issue #31
-
- Version 1.0.2 - 18/04/2024
-
- - New standard menus.
- - Fixed a bug in importing replies text.
- - Fixed the handling of the new change model button in the ChatGPT interface.
- - Added an option to choose between GPT-3.5 and GPT-4 Models. See issue #27
- - Added a link to the Status Page, to check if there are known issues in interacting with the ChatGPT web interface.
-
- Version 1.0.1 - 13/04/2024
-
- - Italian addon description fixed.
- - Improved the method to open the ChatGPT window. Thanks to John Bieling.
- - Fixed a bug in replying to a message. Now the quoted text is correctly displayed.
- - Fixed a bug in the compose window. Now is correctly used only the selected text.
- - If the prompt is more than 30.000 characters, do not proceed and give a message to the user.
-
- Version 1.0 - 05/04/2024
-
+
+
+ Version 1.0.3 - 27/04/2024
+
+ - Using the right identity when replying to a message [#31].
+
+
+ Version 1.0.2 - 18/04/2024
+
+ - New standard menus.
+ - Fixed a bug in importing replies text.
+ - Fixed the handling of the new change model button in the ChatGPT interface.
+ - Added an option to choose between GPT-3.5 and GPT-4 Models [#27].
+ - Added a link to the Status Page, to check if there are known issues in interacting with the ChatGPT web interface.
+
+
+ Version 1.0.1 - 13/04/2024
+
+ - Italian addon description fixed.
+ - Improved the method to open the ChatGPT window. Thanks to John Bieling.
+ - Fixed a bug in replying to a message. Now the quoted text is correctly displayed.
+ - Fixed a bug in the compose window. Now is correctly used only the selected text.
+ - If the prompt is more than 30.000 characters, do not proceed and give a message to the user.
+
+
+ Version 1.0 - 05/04/2024
+