From 59fcf770ccf53a5e2f9edfea90695c66cff9537d Mon Sep 17 00:00:00 2001 From: Anh Nguyet Vu Date: Thu, 5 Dec 2024 10:19:10 -0800 Subject: [PATCH] Real implementation of confirmation/save via UI --- resources/public/index.html | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/resources/public/index.html b/resources/public/index.html index 8a94cd2..874fdff 100644 --- a/resources/public/index.html +++ b/resources/public/index.html @@ -176,6 +176,12 @@ } }); + function sendApproval() { + const message = "Approval granted"; + ws.send(JSON.stringify({type: 'chat', content: message})); + contentDiv.innerHTML += `
${message}
`; + } + function createAlpineCard(containerId, data) { const container = document.getElementById(containerId); @@ -186,7 +192,8 @@ const cardWrapper = document.createElement('div'); cardWrapper.setAttribute('x-data', JSON.stringify({ attributes: data, - isSaved: false + isSaved: false, + approvalSent: false })); cardWrapper.className = "max-w-sm w-full bg-white rounded-lg shadow-md p-6 text-center"; @@ -200,9 +207,10 @@ -