Commit 5ce6e415 by Kim Peace

Fixed for chat room socket connection url

parent 51c13e76
......@@ -8,15 +8,15 @@ NativeBridgeDataSource.getMyUserInfo = function () {
var CurrentUserInfo = class {
sid;
loginId;
loginID;
shopName;
shopMemberId;
shopMemberID;
languageCode;
constructor(userInfo) {
this.sid = userInfo.sid;
this.loginId = userInfo.loginId;
this.loginID = userInfo.loginId;
this.shopName = userInfo.shopName;
this.shopMemberId = userInfo.shopMemberId;
this.shopMemberID = userInfo.shopMemberId;
if (userInfo.languageCode == undefined) {
userInfo.languageCode = "jp";
}
......
......@@ -2,7 +2,6 @@ var bindOnNewMessage = function () {
// New Message
// #36170
socket.on(SOCKET_KEY.NEW_MESSAGE, function (message, roomId, roomName) {
console.log(message);
const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
const unwrappedMessageInfo = decodeMessage(message.text);
......
......@@ -215,7 +215,7 @@ CHAT_SOCKET.initialJoin = function () {
currentUserInfo.shopName,
roomInfo.roomID,
roomInfo.roomName,
currentUserInfo.shopMembeID
currentUserInfo.shopMemberID
);
CHAT_SOCKET.emitJoin(joinInfo, false, false);
};
......@@ -48,6 +48,14 @@ ChatRoom.renderMessageForSearchMessage = function (message) {
/***********************
* Send Messages
***********************/
// Input recognize
$("#messageInput").on("keypress", function (event) {
if (event.which == 13) {
// Enterキーの処理
$("#messageSend").click();
}
});
ChatRoom.sendMessage = function (e) {
const messageTextBox = $("#messageInput");
const message =
......@@ -112,9 +120,6 @@ ChatRoom.configureRoomMenu = function () {
};
ChatRoom.appendAttendedUsers = function (roomID) {
console.log(
"peacekim:: ChatRoom.appendAttendedUsers start with RoomID: " + roomID
);
const topUserListTemplate = getTemplate(TemplateURL.CHATROOM_USER_LIST);
const filterUserListTemplate = getTemplate(
TemplateURL.CHATROOM_USER_FILTER_LIST
......
......@@ -117,14 +117,6 @@ $(window).on("scroll", function () {
startPos = winScrollTop;
});
//メッセージ送信
$("#messageInput").on("keypress", function (event) {
if (event.which == 13) {
// Enterキーの処理
$("#messageSend").click();
}
});
//上にスクロールすると新しいメッセージを呼ぶ処理。
$("#messages").scroll(function () {
if ($(this).scrollTop() === 0) {
......
......@@ -38,7 +38,7 @@ ChatManagementCommon.showMakeRoomConfirmView = function () {
// 参加ユーザ名でルーム名を生成
let newRoomName =
currentUserInfo.loginId + "," + userNameList.join(",");
currentUserInfo.loginID + "," + userNameList.join(",");
NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM,
userIdList.join(","),
......
......@@ -340,7 +340,7 @@ CollaborationUI.refreshAllGroupForAddUserInCollaboration = function (
};
Namecard.makeNameCardInCollaboration = function (shopMemberId) {
if (currentUserInfo.shopMemberId == shopMemberId) {
if (currentUserInfo.shopMemberID == shopMemberId) {
return;
}
var nameCardInfo = NativeBridgeDataSource.getNameCardData(shopMemberId);
......
......@@ -196,7 +196,7 @@ document.addEventListener("DOMContentLoaded", function () {
fw.sendToMsg("others", "HOST_CHANGE_RESPONSE", {
isAndroid: deviceInfo.isAndroid(),
isAble: androidVersion >= ANDROID_SDK_VERSION.O,
loginId: currentUserInfo.loginId,
loginId: currentUserInfo.loginID,
});
}
} else if (data.type === "HOST_CHANGE_RESPONSE") {
......@@ -279,7 +279,7 @@ document.addEventListener("DOMContentLoaded", function () {
} else if (data.type === "HOST_REQUEST_DONE") {
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
} else if (data.type === "HOST_REQUEST_REJECT") {
if (data.payload.hostId == currentUserInfo.loginId) {
if (data.payload.hostId == currentUserInfo.loginID) {
alert("REJECT for owner user");
}
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
......@@ -722,7 +722,7 @@ function applyForHostChange() {
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING);
fw.sendToMsg("others", "CHANGE_HOST_APPLY", {
hostId: currentUserInfo.loginId,
hostId: currentUserInfo.loginID,
});
}
......@@ -739,7 +739,7 @@ function hostSearchInterval() {
let hostName = "";
function hostSearch() {
if (g_isMainMan) {
$("#collaboration_user_" + currentUserInfo.loginId).addClass("host");
$("#collaboration_user_" + currentUserInfo.loginID).addClass("host");
$(".host_contents").removeClass("none");
if (joinCollaborationType == COLLABORATION_TYPE.CAMERA) {
$(".photo_select_button").removeClass("none");
......@@ -750,7 +750,7 @@ function hostSearchInterval() {
}
if (deviceInfo.isiOS()) isIos = true;
} else {
$("#collaboration_user_" + currentUserInfo.loginId).removeClass("host");
$("#collaboration_user_" + currentUserInfo.loginID).removeClass("host");
$(".host_contents").addClass("none");
if (joinCollaborationType == COLLABORATION_TYPE.CAMERA) {
$(".photo_select_button").addClass("none");
......@@ -773,12 +773,12 @@ function hostSearchInterval() {
} else {
if (hostName == "") {
if (
!$("#collaboration_user_" + currentUserInfo.loginId).hasClass(
!$("#collaboration_user_" + currentUserInfo.loginID).hasClass(
"host"
) &&
coview_api.getRoomUsers()
) {
$("#collaboration_user_" + currentUserInfo.loginId).addClass("host");
$("#collaboration_user_" + currentUserInfo.loginID).addClass("host");
}
} else {
if (
......@@ -1084,6 +1084,6 @@ function toggleCapture() {
function toggleCaptureRequest() {
fw.sendToMsg("others", "CAPTURE_REQUEST", {
name: currentUserInfo.loginId,
name: currentUserInfo.loginID,
});
}
......@@ -103,7 +103,7 @@ Contact.renderGroupList = function (url, groupName, groupID, isFavorite) {
});
};
Contact.ppendUserList = function (userList) {
Contact.appendUserList = function (userList) {
userList.forEach(function (user) {
user.profileUrl = Common.getProfileImgUrl(user.profileUrl);
});
......
var Namecard = {};
Namecard.makeNameCard = function (shopMemberId) {
if (currentUserInfo.shopMemberId == shopMemberId) {
Namecard.makeNameCard = function (shopMemberID) {
if (currentUserInfo.shopMemberID == shopMemberID) {
return;
}
const nameCardInfo = NativeBridgeDataSource.getNameCardData(shopMemberId);
const nameCardInfo = NativeBridgeDataSource.getNameCardData(shopMemberID);
const namecardTemplate = getTemplate(TemplateURL.USER_NAME_CARD);
nameCardInfo.profileUrl = Common.getProfileImgUrl(nameCardInfo.profileUrl);
......@@ -29,16 +29,16 @@ Namecard.makeNameCard = function (shopMemberId) {
};
// template_user_name_card.html
Namecard.startChat = function (userShopMemberId, userName) {
Namecard.startChat = function (userShopMemberID, userName) {
Common.showLoadingIndicator();
var userIdList = [];
userIdList.push(userShopMemberId);
var userIDList = [];
userIDList.push(userShopMemberID);
// 参加ユーザ名でルーム名を生成
let newRoomName = currentUserInfo.loginId + "," + userName;
let newRoomName = currentUserInfo.loginID + "," + userName;
NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM,
userIdList.join(","),
userIDList.join(","),
newRoomName,
MakeRoomFlag.NAME_CARD,
false
......@@ -46,13 +46,13 @@ Namecard.startChat = function (userShopMemberId, userName) {
};
// template_user_name_card.html
Namecard.startVoice = function (userShopMemberId, userName) {
Namecard.startVoice = function (userShopMemberID, userName) {
Common.showLoadingIndicator();
let userIDList = [];
userIDList.push(userShopMemberId);
userIDList.push(userShopMemberID);
// 参加ユーザ名でルーム名を生成
let newRoomName = currentUserInfo.loginId + "," + userName;
let newRoomName = currentUserInfo.loginID + "," + userName;
NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM,
userIDList.join(","),
......@@ -66,44 +66,44 @@ Namecard.startVoice = function (userShopMemberId, userName) {
// >> chat-room.js
// >> contact.js
// template_user_list.html
Namecard.favoriteUserChange = function (shopMemberId, star) {
Namecard.favoriteUserChange = function (shopMemberID, star) {
if ($(star).hasClass("active")) {
Namecard.removeFavoriteUser(shopMemberId);
Namecard.removeFavoriteUser(shopMemberID);
} else if ($(star).hasClass("disable")) {
Namecard.insertFavoriteUser(shopMemberId);
Namecard.insertFavoriteUser(shopMemberID);
}
};
// modal_collabo_profile.html
// collaboration.js
// template_user_name_card.html
Namecard.removeFavoriteUser = function (shopMemberId) {
Namecard.removeFavoriteUser = function (shopMemberID) {
Common.showLoadingIndicator();
$("#userNameCard").modal("hide");
$("#myNameCard").modal("hide");
const result = NativeBridgeDataSource.removeFavoriteUser(shopMemberId);
const result = NativeBridgeDataSource.removeFavoriteUser(shopMemberID);
if (result) {
$(".shopmember_" + shopMemberId).removeClass("active");
$(".shopmember_" + shopMemberId).addClass("disable");
$(".shopmember_" + shopMemberID).removeClass("active");
$(".shopmember_" + shopMemberID).addClass("disable");
} else {
$(".shopmember_" + shopMemberId).addClass("active");
$(".shopmember_" + shopMemberId).removeClass("disable");
$(".shopmember_" + shopMemberID).addClass("active");
$(".shopmember_" + shopMemberID).removeClass("disable");
}
Common.dismissLoadingIndicator();
};
// template_user_name_card.html (USER_NAME_CARD)
// >> Namecard.makeNameCard()
Namecard.insertFavoriteUser = function (shopMemberId) {
Namecard.insertFavoriteUser = function (shopMemberID) {
$("#userNameCard").modal("hide");
$("#myNameCard").modal("hide");
const result = NativeBridgeDataSource.addFavoriteUser(shopMemberId);
const result = NativeBridgeDataSource.addFavoriteUser(shopMemberID);
if (result) {
$(".shopmember_" + shopMemberId).removeClass("disable");
$(".shopmember_" + shopMemberId).addClass("active");
$(".shopmember_" + shopMemberID).removeClass("disable");
$(".shopmember_" + shopMemberID).addClass("active");
} else {
$(".shopmember_" + shopMemberId).addClass("disable");
$(".shopmember_" + shopMemberId).removeClass("active");
$(".shopmember_" + shopMemberID).addClass("disable");
$(".shopmember_" + shopMemberID).removeClass("active");
}
Common.dismissLoadingIndicator();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment