(text)
| 358 | } |
| 359 | } |
| 360 | function Helper_SendMessage(text){ |
| 361 | // Put message in textarea |
| 362 | var textarea = document.querySelector("textarea"); |
| 363 | if (!textarea) return; |
| 364 | textarea.focus(); |
| 365 | // fix the send message can't be clicked due to recognition input without keybord input. |
| 366 | textarea.parentNode.querySelector("button").disabled =false; |
| 367 | var existingText = textarea.value; |
| 368 | |
| 369 | // Is there already existing text? |
| 370 | if (!existingText) textarea.value = text; |
| 371 | else textarea.value = existingText + " " + text; |
| 372 | |
| 373 | // Change height in case |
| 374 | var fullText = existingText + " " + text; |
| 375 | var rows = Math.ceil(fullText.length / 88); |
| 376 | var height = rows * 24; |
| 377 | textarea.style.height = height + "px"; |
| 378 | |
| 379 | } |
| 380 | // Check for new messages the ChatGPT bot has sent. |
| 381 | // If a new message is found, it will be read out loud. |
| 382 | function Helper_CheckNewMessages(){ |
no outgoing calls
no test coverage detected