Commit 5ce6e415 by Kim Peace

Fixed for chat room socket connection url

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