diff --git a/index.html b/index.html index 3124944..da4daaf 100644 --- a/index.html +++ b/index.html @@ -232,12 +232,24 @@ Attach Image + + + + + Take Photo + Attach Video + + + + + Record Video + @@ -247,8 +259,10 @@ - - + + + + @@ -397,12 +411,24 @@ Attach Image + + + + + Take Photo + Attach Video + + + + + Record Video + @@ -412,8 +438,10 @@ - - + + + + @@ -1709,7 +1737,9 @@ const attachmentMenuBtn = document.getElementById('attachmentMenuBtn'); const attachmentMenu = document.getElementById('attachmentMenu'); const imageInput = document.getElementById('imageInput'); + const imageCameraInput = document.getElementById('imageCameraInput'); const videoInput = document.getElementById('videoInput'); + const videoCameraInput = document.getElementById('videoCameraInput'); const fileInput = document.getElementById('fileInput'); attachmentMenuBtn.addEventListener('click', (e) => { @@ -1722,18 +1752,28 @@ imageInput.click(); }); + document.getElementById('takePhotoBtn').addEventListener('click', () => { + attachmentMenu.classList.add('hidden'); + imageCameraInput.click(); + }); + document.getElementById('attachVideoBtn').addEventListener('click', () => { attachmentMenu.classList.add('hidden'); videoInput.click(); }); + document.getElementById('recordVideoBtn').addEventListener('click', () => { + attachmentMenu.classList.add('hidden'); + videoCameraInput.click(); + }); + document.getElementById('attachFileBtn').addEventListener('click', () => { attachmentMenu.classList.add('hidden'); fileInput.click(); }); // File input change handlers - [imageInput, videoInput, fileInput].forEach(input => { + [imageInput, imageCameraInput, videoInput, videoCameraInput, fileInput].forEach(input => { input.addEventListener('change', (e) => { pendingNoteAttachments.push(...Array.from(e.target.files || [])); renderNoteAttachmentsList(); @@ -1744,7 +1784,9 @@ e.preventDefault(); pendingNoteAttachments = []; imageInput.value = ''; + imageCameraInput.value = ''; videoInput.value = ''; + videoCameraInput.value = ''; fileInput.value = ''; renderNoteAttachmentsList(); }); @@ -1760,7 +1802,9 @@ const conversationAttachmentMenuBtn = document.getElementById('conversationAttachmentMenuBtn'); const conversationAttachmentMenu = document.getElementById('conversationAttachmentMenu'); const conversationImageInput = document.getElementById('conversationImageInput'); + const conversationImageCameraInput = document.getElementById('conversationImageCameraInput'); const conversationVideoInput = document.getElementById('conversationVideoInput'); + const conversationVideoCameraInput = document.getElementById('conversationVideoCameraInput'); const conversationFileInput = document.getElementById('conversationFileInput'); conversationAttachmentMenuBtn.addEventListener('click', (e) => { @@ -1773,18 +1817,28 @@ conversationImageInput.click(); }); + document.getElementById('conversationTakePhotoBtn').addEventListener('click', () => { + conversationAttachmentMenu.classList.add('hidden'); + conversationImageCameraInput.click(); + }); + document.getElementById('conversationAttachVideoBtn').addEventListener('click', () => { conversationAttachmentMenu.classList.add('hidden'); conversationVideoInput.click(); }); + document.getElementById('conversationRecordVideoBtn').addEventListener('click', () => { + conversationAttachmentMenu.classList.add('hidden'); + conversationVideoCameraInput.click(); + }); + document.getElementById('conversationAttachFileBtn').addEventListener('click', () => { conversationAttachmentMenu.classList.add('hidden'); conversationFileInput.click(); }); // File input change handlers for conversation - [conversationImageInput, conversationVideoInput, conversationFileInput].forEach(input => { + [conversationImageInput, conversationImageCameraInput, conversationVideoInput, conversationVideoCameraInput, conversationFileInput].forEach(input => { input.addEventListener('change', (e) => { pendingConversationAttachments.push(...Array.from(e.target.files || [])); renderConversationAttachmentsList(); @@ -1795,7 +1849,9 @@ e.preventDefault(); pendingConversationAttachments = []; conversationImageInput.value = ''; + conversationImageCameraInput.value = ''; conversationVideoInput.value = ''; + conversationVideoCameraInput.value = ''; conversationFileInput.value = ''; renderConversationAttachmentsList(); }); @@ -1986,7 +2042,9 @@ await clearAudio(); pendingNoteAttachments = []; document.getElementById('imageInput').value = ''; + document.getElementById('imageCameraInput').value = ''; document.getElementById('videoInput').value = ''; + document.getElementById('videoCameraInput').value = ''; document.getElementById('fileInput').value = ''; renderNoteAttachmentsList(); document.getElementById('noteText').value = '';