Skip to content

Commit

Permalink
add private chat popup window
Browse files Browse the repository at this point in the history
  • Loading branch information
yennanliu committed Nov 16, 2023
1 parent 2460886 commit bfa6f0a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions springChatRoom/src/main/resources/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@ function updateOnlineUsers(users) {
function startChat(username) {
// Add your logic here to start a private chat with the selected user
console.log('>>> Start chat with ' + username);

// Open a popup window for the chat
const popupWindow = window.open('', '_blank', 'width=400,height=300');

// Add your logic to customize the popup window content
popupWindow.document.write('<html><head><title>Chat with ' + username + '</title></head><body>');
popupWindow.document.write('<h2>Chat with ' + username + '</h2>');
popupWindow.document.write('<p>This is the chat content. Customize it as needed.</p>');
popupWindow.document.write('</body></html>');
}

// Call the fetchUserList function to initially populate the user list
Expand Down

0 comments on commit bfa6f0a

Please sign in to comment.