Clean up debug code, keep Send button

Root cause found: uncloseai extension was clobbering window.sendMessage.
Fixed in uncloseai.com repo by namespacing under window.uncloseai.
This commit is contained in:
russell@unturf.com 2026-02-23 19:55:55 -05:00
parent c06b3706f2
commit d7fcfc8935

View file

@ -16,29 +16,10 @@
<div id="chat"></div>
<!-- Form for sending messages -->
<form id="message-form" onsubmit="return false;">
<form id="message-form">
<textarea id="message" placeholder="Type your message..."></textarea>
<button type="button" id="send-button" onclick="try{sendMessage();}catch(e){document.getElementById('chat').innerHTML+='<div style=color:red>Send error: '+e.message+'</div>';}">Send</button>
<button type="button" id="send-button" onclick="sendMessage()">Send</button>
</form>
<script>
// Self-contained send logic — runs immediately after form exists
(function(){
var ta = document.getElementById('message');
if(!ta) return;
ta.addEventListener('keydown', function(e){
if(e.key === 'Enter' && !e.shiftKey){
e.preventDefault();
try {
sendMessage();
} catch(err) {
// Show error visibly in chat
var chat = document.getElementById('chat');
if(chat) chat.innerHTML += '<div style="color:red">Send error: ' + err.message + '</div>';
}
}
});
})();
</script>
</div>
<div class="utility-belt">