-
-
+
+
+
+
-
-
-
+
-
-
-
-
+
+
+
+
@@ -791,6 +791,7 @@
게임 룰
}
}
+
//
// $.get(`/v1/chatrooms/${roomId}/${nickname}`,
// function (result) {
@@ -823,10 +824,62 @@
게임 룰
//
// });
+ // 방 정보 모달 열기
function openRoomDetail() {
- $('#roomDetailModal').modal('show'); // 모달 열기
+ $('#roomDetailModal').modal('show');
+
+ $.get(`/v1/chatroom/${roomId}`,
+ function (response) {
+
+ const rawRoomInfo = response.data
+ $('#room-name').attr('value', rawRoomInfo.title)
+ $('#room-capacity').attr('value', rawRoomInfo.capacity)
+ $('#room-password').attr('value', rawRoomInfo.password)
+ if (rawRoomInfo.close === true) {
+ $("#room-close").attr('style', "font-weight: bold; border: 2px solid #495057;")
+ } else {
+ $("#room-open").attr('style', "font-weight: bold; border: 2px solid #495057;")
+ }
+ })
+ }
+
+
+ /* 방 정보 모달 닫기 */
+ function roomInfoClose() {
+ $('#roomDetailModal').modal('hide');
+ event.preventDefault();
}
+ /* 방 정보 모달 > 비밀방 클릭 시 */
+ function roomCloseBtnPressed() {
+ $("#room-close").attr('style', "font-weight: bold; border: 2px solid #495057;")
+ $("#room-open").attr('style', "font-weight: normal;")
+ $("#room-password").attr('disabled', false)
+
+ }
+
+ /* 방 정보 모달 > 공개방 클릭 시 */
+ function roomOpenBtnPressed() {
+ $("#room-close").attr('style', "font-weight: normal;")
+ $("#room-open").attr('style', "font-weight: bold; border: 2px solid #495057;")
+ $("#room-password").attr('disabled', true)
+ }
+
+
+ // 채팅방 타이틀 가져오기
+ $.get(`/v1/chatroom/${roomId}`,
+ function (result) {
+ // 채팅방 타이틀
+ $("#chatroomTitle").text(result.data.title);
+
+ // // +채팅방 정보 로그
+ // console.log("title" + result.data.title)
+ // console.log("capacity" + result.data.capacity)
+ // console.log("roomPassword" + result.data.password)
+ // console.log("isClose" + result.data.close) // boolean
+ });
+
+
// 나가기 버튼
function leave() {
const leave = document.getElementById('leave-btn');
@@ -849,6 +902,8 @@
게임 룰
$('#gameRuleDetailModal').modal('hide');
}
+
+
/* 내 직업 설명 모달 열기 */
function myRoleOpen() {
$('#myRoleDetailModal').modal('show');
@@ -879,6 +934,7 @@
게임 룰
$('#myRoleDetailModal').modal('hide');
}
+