diff --git a/README.md b/README.md index b0ed063..9bbca1b 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,6 @@ You just need to enter on the keyboard the code you have set into the ext Type back the code on the keyboard and the code will be removed from the current page. -## Test - -To test the code, you can run the index.js file located in the "test" folder. - ## Options
@@ -39,9 +35,11 @@ To test the code, you can run the index.js file located in the "test" fol
- Api key\*: the openai api key.
- Code\*: code that you will need to inject/remove the code.
- Langage: the langage you want chatgpt reply (if it's not set it will take the question langage).
+- GPT Model: the gpt model you want to use (by default it's "gpt-3.5-turbo").
- Cursor indication: show a pointer cursor and a hourglass to know when the request is finished.
- Title indication: show some informations into the title to know for example if the code have been injected.

+- Infinite try: click as much as you want on the question (don't forget to reset the question).
- Console logs: show logs into the console.
- Typing effect: create a typing effect for text. Type any text and it will be replaced by the correct one. If you want to stop it press Backspace key.
@@ -85,3 +83,7 @@ To test the code, you can run the index.js file located in the "test" fol
To know if the answer has been copied to the clipboard, you can look at the title of the page which will become "Copied to clipboard" for 3 seconds.

+
+## Test
+
+To test the code, you can run the index.js file located in the "test" folder.
diff --git a/assets/logs.png b/assets/logs.png
index fc0b8cd..bd62287 100644
Binary files a/assets/logs.png and b/assets/logs.png differ
diff --git a/assets/popup.png b/assets/popup.png
index f73dbf6..21a20c9 100644
Binary files a/assets/popup.png and b/assets/popup.png differ
diff --git a/extension/moodle-gpt.js b/extension/moodle-gpt.js
index 72711cc..b48f02b 100644
--- a/extension/moodle-gpt.js
+++ b/extension/moodle-gpt.js
@@ -34,7 +34,7 @@ chrome.storage.sync.get(["moodleGPT"]).then(function (storage) {
for (const listener of listeners) {
if (config.cursor) listener.element.style.cursor = "initial";
listener.element.removeEventListener("click", listener.fn, {
- once: true,
+ once: !config.infinite,
});
}
if (config.title) titleIndications("Removed");
@@ -54,7 +54,7 @@ chrome.storage.sync.get(["moodleGPT"]).then(function (storage) {
if (config.cursor) hiddenButton.style.cursor = "pointer";
const fn = reply.bind(null, hiddenButton, form, query);
listeners.push({ element: hiddenButton, fn });
- hiddenButton.addEventListener("click", fn, { once: true });
+ hiddenButton.addEventListener("click", fn, { once: !config.infinite });
}
if (config.title) titleIndications("Injected");
@@ -87,7 +87,8 @@ chrome.storage.sync.get(["moodleGPT"]).then(function (storage) {
Authorization: `Bearer ${config.apiKey}`,
},
body: JSON.stringify({
- model: "gpt-3.5-turbo",
+ model:
+ config.model && config.model !== "" ? config.model : "gpt-3.5-turbo",
messages: [{ role: "user", content: question }],
temperature: 0.8,
top_p: 1.0,
@@ -105,7 +106,7 @@ chrome.storage.sync.get(["moodleGPT"]).then(function (storage) {
*/
class Logs {
static question(text) {
- const css = "color: blue";
+ const css = "color: cyan";
console.log("%c[QUESTION]: %s", css, text);
}
@@ -143,7 +144,7 @@ chrome.storage.sync.get(["moodleGPT"]).then(function (storage) {
: "the following question langage"
} and only show the result:
${question}
- (If you have to choose between multiple results only show the corrects one and seprate responses with new line)`;
+ (If you have to choose between multiple results only show the corrects one and separate them with new line)`;
const response = await getChatGPTResponse(finalQuestion);
@@ -152,7 +153,8 @@ chrome.storage.sync.get(["moodleGPT"]).then(function (storage) {
Logs.response(response);
}
- if (config.cursor) hiddenButton.style.cursor = "initial";
+ if (config.cursor)
+ hiddenButton.style.cursor = config.infinite ? "pointer" : "initial";
//if we dont find the input we copy into the clipboard
if (inputList.length === 0) {
diff --git a/extension/popup/index.html b/extension/popup/index.html
index 318e85b..527c05c 100644
--- a/extension/popup/index.html
+++ b/extension/popup/index.html
@@ -19,42 +19,63 @@
>