comparison src/account.html.luan @ 83:a47036fd0158

group chat
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 11 Mar 2025 13:56:59 -0600
parents e4e331539146
children 625ffdf6499d
comparison
equal deleted inserted replaced
82:0bc5e0d098f7 83:a47036fd0158
45 openModal(dialog); 45 openModal(dialog);
46 } 46 }
47 47
48 function saveUsername() { 48 function saveUsername() {
49 let dialog = document.querySelector('dialog[edit_username]'); 49 let dialog = document.querySelector('dialog[edit_username]');
50 let input = dialog.querySelector('input[name=username]'); 50 closeModal(dialog);
51 username = input.value; 51 username = dialog.querySelector('input[name=username]').value;
52 closeModal(input);
53 showUsername(); 52 showUsername();
54 ajax(`save_username.js?username=${encodeURIComponent(username)}`); 53 ajax(`save_username.js?username=${encodeURIComponent(username)}`);
55 } 54 }
56 55
57 function showNotify() { 56 function showNotify() {
68 openModal(dialog); 67 openModal(dialog);
69 } 68 }
70 69
71 function saveNotify() { 70 function saveNotify() {
72 let dialog = document.querySelector('dialog[edit_notify]'); 71 let dialog = document.querySelector('dialog[edit_notify]');
73 let input = dialog.querySelector('input[name=notify_email]'); 72 closeModal(dialog);
74 notifyEmail = input.value; 73 notifyEmail = dialog.querySelector('input[name=notify_email]').value;
75 let radio = dialog.querySelector('input[type=radio]:checked'); 74 let radio = dialog.querySelector('input[type=radio]:checked');
76 multiNotify = radio.value === 'true'; 75 multiNotify = radio.value === 'true';
77 closeModal(input);
78 showNotify(); 76 showNotify();
79 ajax(`save_notify.js?email=${encodeURIComponent(notifyEmail)}&multi=${multiNotify}`); 77 ajax(`save_notify.js?email=${encodeURIComponent(notifyEmail)}&multi=${multiNotify}`);
80 } 78 }
81 79
82 function showVoice() { 80 function showVoice() {
91 openModal(dialog); 89 openModal(dialog);
92 } 90 }
93 91
94 function saveVoice() { 92 function saveVoice() {
95 let dialog = document.querySelector('dialog[edit_voice]'); 93 let dialog = document.querySelector('dialog[edit_voice]');
96 let input = dialog.querySelector('input[name=voice]'); 94 closeModal(dialog);
97 voice = input.value; 95 voice = dialog.querySelector('input[name=voice]').value;
98 closeModal(input);
99 showVoice(); 96 showVoice();
100 ajax(`save_voice.js?url=${encodeURIComponent(voice)}`); 97 ajax(`save_voice.js?url=${encodeURIComponent(voice)}`);
101 } 98 }
102 99
103 function deleteUser() { 100 function deleteUser() {
217 <button onclick="doDeleteUser(this)">Delete</button> 214 <button onclick="doDeleteUser(this)">Delete</button>
218 </div> 215 </div>
219 </dialog> 216 </dialog>
220 <dialog url> 217 <dialog url>
221 <h2>Your chat URL</h2> 218 <h2>Your chat URL</h2>
222 <p><%= base_url() %>/chat?with=<%=user.email%></p> 219 <p><%= base_url() %>/chat?with=<%=html_encode(user.email)%></p>
223 <p>Use this URL to link to your chat so that other people can chat with you by clicking on the link.</p> 220 <p>Use this URL to link to your chat so that other people can chat with you by clicking on the link.</p>
224 <div buttons> 221 <div buttons>
225 <button onclick="closeModal(this)">Close</button> 222 <button onclick="closeModal(this)">Close</button>
226 </div> 223 </div>
227 </dialog> 224 </dialog>