Mercurial Hosting > chat
comparison src/chat.js @ 83:a47036fd0158
group chat
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Tue, 11 Mar 2025 13:56:59 -0600 |
| parents | a0d3477d5694 |
| children | 83fb90276334 |
comparison
equal
deleted
inserted
replaced
| 82:0bc5e0d098f7 | 83:a47036fd0158 |
|---|---|
| 302 } | 302 } |
| 303 | 303 |
| 304 function gotoInvite(el) { | 304 function gotoInvite(el) { |
| 305 let email = document.querySelector('dialog[invite] span[email]').textContent; | 305 let email = document.querySelector('dialog[invite] span[email]').textContent; |
| 306 closeModal(el); | 306 closeModal(el); |
| 307 location = `chat?with=${email}`; | 307 location = `chat?with=${encodeURIComponent(email)}`; |
| 308 ajax(`save_post.js?post=${currentPostId}`,`content=${encodeURIComponent(text)}`); | 308 ajax(`save_post.js?post=${currentPostId}`,`content=${encodeURIComponent(text)}`); |
| 309 } | 309 } |
| 310 | 310 |
| 311 function uploadFile() { | 311 function uploadFile() { |
| 312 document.querySelector('input[type="file"]').click(); | 312 document.querySelector('input[type="file"]').click(); |
| 441 function closeReply() { | 441 function closeReply() { |
| 442 let div = document.querySelector('div[reply]'); | 442 let div = document.querySelector('div[reply]'); |
| 443 div.setAttribute('hidden',''); | 443 div.setAttribute('hidden',''); |
| 444 div.setAttribute('reply',''); | 444 div.setAttribute('reply',''); |
| 445 } | 445 } |
| 446 | |
| 447 function openAddToChat() { | |
| 448 let dialog = document.querySelector('dialog[add]'); | |
| 449 dialog.querySelector('input[name=email]').value = ''; | |
| 450 openModal(dialog); | |
| 451 } | |
| 452 | |
| 453 function addToChat() { | |
| 454 let dialog = document.querySelector('dialog[add]'); | |
| 455 let email = dialog.querySelector('input[name=email]').value; | |
| 456 ajax(`add_to_chat.js?chat=${currentChatId}&email=${encodeURIComponent(email)}`); | |
| 457 } | |
| 458 | |
| 459 function addToChatError(msg) { | |
| 460 let dialog = document.querySelector('dialog[add]'); | |
| 461 dialog.querySelector('span[error]').textContent = msg; | |
| 462 } |
