Update script.js
Browse files
script.js
CHANGED
|
@@ -151,13 +151,13 @@ function toggleSpeak() {
|
|
| 151 |
}
|
| 152 |
|
| 153 |
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
|
| 162 |
|
| 163 |
function startNewChat() {
|
|
@@ -181,7 +181,7 @@ function startNewChat() {
|
|
| 181 |
|
| 182 |
// Text-to-Speech function
|
| 183 |
function speakText(text, language) {
|
| 184 |
-
|
| 185 |
console.log('Speech is disabled.');
|
| 186 |
return; // Exit if speech is disabled
|
| 187 |
}
|
|
|
|
| 151 |
}
|
| 152 |
|
| 153 |
|
| 154 |
+
Close the modal when clicking outside of it
|
| 155 |
+
window.onclick = function(event) {
|
| 156 |
+
const modal = document.getElementById("settingsModal");
|
| 157 |
+
if (event.target === modal) {
|
| 158 |
+
closeSettings();
|
| 159 |
+
}
|
| 160 |
+
}
|
| 161 |
|
| 162 |
|
| 163 |
function startNewChat() {
|
|
|
|
| 181 |
|
| 182 |
// Text-to-Speech function
|
| 183 |
function speakText(text, language) {
|
| 184 |
+
if (!isSpeakEnabled) {
|
| 185 |
console.log('Speech is disabled.');
|
| 186 |
return; // Exit if speech is disabled
|
| 187 |
}
|