Commit 6e009873 by Kim Peace

Removed CHAT_UI and CHAT js

parent 51b89259
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<script> <script>
window.addEventListener('DOMContentLoaded', function () { window.addEventListener('DOMContentLoaded', function () {
CHAT_UI.refreshArchiveScreen(); ArchiveUI.refreshArchiveScreen();
}); });
</script> </script>
</head> </head>
...@@ -149,12 +149,8 @@ ...@@ -149,12 +149,8 @@
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
NativeBridgeDelegate.getLoginParameter(); ArchiveUI.refreshArchiveScreen();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam() {
CHAT_UI.refreshArchiveScreen();
};
</script> </script>
</body> </body>
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<h2 class="ttl" id="archiveSaveUser">SaveUser</h2> <h2 class="ttl" id="archiveSaveUser">SaveUser</h2>
<div class="d-flex flex-row"> <div class="d-flex flex-row">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<img src="{{profileImage}}" alt="プロフィール画像" onclick="CHAT_UI.makeNameCard({{userId}})" > <img src="{{profileImage}}" alt="プロフィール画像" onclick="Namecard.makeNameCard({{userId}})" >
<p>{{userName}}</p> <p>{{userName}}</p>
</div> </div>
</div> </div>
...@@ -124,12 +124,7 @@ ...@@ -124,12 +124,7 @@
<script> <script>
var archiveId; var archiveId;
NativeBridgeDelegate.getLoginParameter(); ArchiveUI.refreshArchiveDetailScreen(archiveId);
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam() {
CHAT_UI.refreshArchiveDetailScreen(archiveId);
};
window.addEventListener('DOMContentLoaded', function () { window.addEventListener('DOMContentLoaded', function () {
var urlPrm = new Object; var urlPrm = new Object;
...@@ -140,7 +135,7 @@ ...@@ -140,7 +135,7 @@
if (typeof (android) != "undefined") { if (typeof (android) != "undefined") {
} else { } else {
CHAT_UI.refreshArchiveDetailScreen(urlPrm.archiveId); ArchiveUI.refreshArchiveDetailScreen(urlPrm.archiveId);
} }
}); });
</script> </script>
......
...@@ -129,23 +129,19 @@ ...@@ -129,23 +129,19 @@
String.prototype.replaceAll = function (org, dest) { String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
} }
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
NativeBridgeDelegate.getLoginParameter(); if (deviceInfo.isAndroid()) {
NativeBridgeDelegate.getGlobalParameter(); var needHostAlert = android.getExitHostAlert();
if (needHostAlert) {
alert(getLocalizedString("inform_exit_host_collaboration"));
}
}
ChatList.refreshRoomList(ChatRoomType.GROUP);
NativeBridgeDelegate.saveSelectedUserList(""); NativeBridgeDelegate.saveSelectedUserList("");
function getGlobalParam() { Common.dismissLoadingIndicator();
if (deviceInfo.isAndroid()) {
var needHostAlert = android.getExitHostAlert();
if (needHostAlert) {
alert(getLocalizedString("inform_exit_host_collaboration"));
}
}
ChatList.refreshRoomList(ChatRoomType.GROUP);
Common.dismissLoadingIndicator();
};
</script> </script>
</body> </body>
......
...@@ -160,24 +160,20 @@ ...@@ -160,24 +160,20 @@
return this.split(org).join(dest); return this.split(org).join(dest);
} }
NativeBridgeDelegate.getLoginParameter(); const selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
NativeBridgeDelegate.getGlobalParameter(); if (selectedUsers != "") {
selectedUsers.forEach(function (user) {
function getGlobalParam() { ChatManagementCommon.selectedUserList.push(user.shopMemberId);
const selectedUsers = NativeBridgeDataSource.loadSelectedUsers(); })
if (selectedUsers != "") {
selectedUsers.forEach(function (user) {
ChatManagementCommon.selectedUserList.push(user.shopMemberId);
})
};
if (ChatManagementCommon.selectedUserList.length > 0) {
$('.select_member_num').text(ChatManagementCommon.selectedUserList.length);
} else {
$('.select_member_num').text('0');
}
CHAT_UI.refreshMyGroupForAddUser();
}; };
if (ChatManagementCommon.selectedUserList.length > 0) {
$('.select_member_num').text(ChatManagementCommon.selectedUserList.length);
} else {
$('.select_member_num').text('0');
}
ChatAddUser.refreshMyGroupForAddUser();
</script> </script>
</body> </body>
......
...@@ -88,12 +88,9 @@ ...@@ -88,12 +88,9 @@
String.prototype.replaceAll = function (org, dest) { String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
} }
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam() { ChatManagementCommon.showAddUserConfirmView();
ChatManagementCommon.showAddUserConfirmView();
};
</script> </script>
</body> </body>
......
...@@ -88,11 +88,7 @@ ...@@ -88,11 +88,7 @@
return this.split(org).join(dest); return this.split(org).join(dest);
} }
let roomId = 0; let roomId = 0;
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam() { };
</script> </script>
</body> </body>
......
...@@ -160,25 +160,20 @@ ...@@ -160,25 +160,20 @@
String.prototype.replaceAll = function (org, dest) { String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
} }
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam() { if (NativeBridgeDataSource.loadSelectedUsers() != "") {
if (NativeBridgeDataSource.loadSelectedUsers() != "") { let selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
let selectedUsers = NativeBridgeDataSource.loadSelectedUsers(); selectedUsers.forEach(function (user) {
selectedUsers.forEach(function (user) { ChatManagementCommon.selectedUserList.push(user.shopMemberId);
ChatManagementCommon.selectedUserList.push(user.shopMemberId); })
})
};
if (ChatManagementCommon.selectedUserList.length > 0) {
$('.select_member_num').text(ChatManagementCommon.selectedUserList.length);
} else {
$('.select_member_num').text('0');
}
CHAT_UI.refreshMyGroupForMakeRoom();
}; };
if (ChatManagementCommon.selectedUserList.length > 0) {
$('.select_member_num').text(ChatManagementCommon.selectedUserList.length);
} else {
$('.select_member_num').text('0');
}
ChatMakeRoom.refreshMyGroupForMakeRoom();
</script> </script>
</body> </body>
......
...@@ -96,14 +96,9 @@ ...@@ -96,14 +96,9 @@
return this.split(org).join(dest); return this.split(org).join(dest);
} }
NativeBridgeDelegate.getLoginParameter(); ChatManagementCommon.showMakeRoomConfirmView();
NativeBridgeDelegate.getGlobalParameter();
$("#newRoomName").attr("placeholder", getLocalizedString("newRoomName")); $("#newRoomName").attr("placeholder", getLocalizedString("newRoomName"));
function getGlobalParam() {
ChatManagementCommon.showMakeRoomConfirmView();
};
</script> </script>
</body> </body>
......
...@@ -92,39 +92,39 @@ ...@@ -92,39 +92,39 @@
<input type="text" name="message" class="message_input_form" id="messageInput" placeholder="メッセージを入力してください" <input type="text" name="message" class="message_input_form" id="messageInput" placeholder="メッセージを入力してください"
maxlength="600"> maxlength="600">
<button type="button" name="button" class="message_input_send none" id="messageSend" <button type="button" name="button" class="message_input_send none" id="messageSend"
onclick="CHAT_UI.sendMessage(this);">送信</button> onclick="ChatRoom.sendMessage(this);">送信</button>
</div> </div>
</div> </div>
<!-- フッター下 --> <!-- フッター下 -->
<div class="footer_content_b"> <div class="footer_content_b">
<div class="d-flex flex-row justify-content-around h-100"> <div class="d-flex flex-row justify-content-around h-100">
<div class="footer_item"> <div class="footer_item">
<a href="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.AUDIO);"> <a href="javascript:ChatRoom.startCollaboration(COLLABORATION_TYPE.AUDIO);">
<img src="icon/icon_phone.png" alt="通話アイコン"> <img src="icon/icon_phone.png" alt="通話アイコン">
<p>通話</p> <p>通話</p>
</a> </a>
</div> </div>
<div class="footer_item"> <div class="footer_item">
<a href="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.DOCUMENT);"> <a href="javascript:ChatRoom.startCollaboration(COLLABORATION_TYPE.DOCUMENT);">
<img src="icon/icon_paste.png" alt="文書アイコン"> <img src="icon/icon_paste.png" alt="文書アイコン">
<p>文書</p> <p>文書</p>
</a> </a>
</div> </div>
<div class="footer_item"> <div class="footer_item">
<a href="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.CAMERA);"> <a href="javascript:ChatRoom.startCollaboration(COLLABORATION_TYPE.CAMERA);">
<img src="icon/icon_photo.png" alt="画像アイコン"> <img src="icon/icon_photo.png" alt="画像アイコン">
<p>画像</p> <p>画像</p>
</a> </a>
</div> </div>
<div class="footer_item"> <div class="footer_item">
<a href="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.VIDEO);"> <a href="javascript:ChatRoom.startCollaboration(COLLABORATION_TYPE.VIDEO);">
<img src="icon/icon_movie.png" alt="動画アイコン"> <img src="icon/icon_movie.png" alt="動画アイコン">
<p>動画</p> <p>動画</p>
</a> </a>
</div> </div>
<!--リリース後開発予定--> <!--リリース後開発予定-->
<div class="footer_item"> <div class="footer_item">
<a href="javascript:CHAT_UI.startCollaboration(COLLABORATION_TYPE.BOARD);"> <a href="javascript:ChatRoom.startCollaboration(COLLABORATION_TYPE.BOARD);">
<img src="icon/icon_whiteboard_gray.png" alt="ホワイトボードアイコン"> <img src="icon/icon_whiteboard_gray.png" alt="ホワイトボードアイコン">
<p>ボード</p> <p>ボード</p>
</a> </a>
...@@ -187,24 +187,20 @@ ...@@ -187,24 +187,20 @@
$("#chatMenuModal").load("./modal_chat_menu.html"); $("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
NativeBridgeDelegate.getLoginParameter(); if (deviceInfo.isAndroid()) {
NativeBridgeDelegate.getGlobalParameter(); const needHostAlert = android.getExitHostAlert();
if (needHostAlert) {
alert(getLocalizedString("inform_exit_host_collaboration"));
}
}
ChatRoom.loadMessages(roomInfo.roomID, roomInfo.roomName);
NativeBridgeDelegate.saveSelectedUserList(""); NativeBridgeDelegate.saveSelectedUserList("");
if (typeof (android) != "undefined") { if (typeof (android) != "undefined") {
androidVersion = android.getAndroidVersion(); androidVersion = android.getAndroidVersion();
} }
function getGlobalParam() {
if (deviceInfo.isAndroid()) {
var needHostAlert = android.getExitHostAlert();
if (needHostAlert) {
alert(getLocalizedString("inform_exit_host_collaboration"));
}
}
CHAT_UI.loadMessages(roomInfo.roomID, roomInfo.roomName);
};
</script> </script>
</body> </body>
......
...@@ -179,14 +179,32 @@ ...@@ -179,14 +179,32 @@
let joinMeetingId = 0; let joinMeetingId = 0;
let androidVersion = 0; let androidVersion = 0;
NativeBridgeDelegate.getLoginParameter();
NativeBridgeDelegate.getGlobalParameter();
const roomType = NativeBridgeDataSource.getRoomType(); const roomType = NativeBridgeDataSource.getRoomType();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
joinCollaborationType = NativeBridgeDataSource.getJoinCollaborationType();
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
if (deviceInfo.isAndroid()) {
androidVersion = android.getAndroidVersion();
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) {
alert(getLocalizedString('not_support_version'));
if (typeof android != "undefined") {
NativeBridgeDelegate.openCommunicationHome();
NativeBridgeDelegate.openCommunicationHome();
NativeBridgeDelegate.openCommunicationHome();
}
}
}
initCollaborationUI(joinCollaborationType);
globalUserInfo.coWorkType = CHAT_UTIL.getCoviewTypeFromCollaborationType(joinCollaborationType);
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.initialJoin();
}
function startPipMode() { function startPipMode() {
NativeBridgeDelegate.startPIPMode(); NativeBridgeDelegate.startPIPMode();
} }
...@@ -194,30 +212,6 @@ ...@@ -194,30 +212,6 @@
String.prototype.replaceAll = function (org, dest) { String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
} }
async function getGlobalParam() {
joinCollaborationType = NativeBridgeDataSource.getJoinCollaborationType();
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
if (deviceInfo.isAndroid()) {
androidVersion = android.getAndroidVersion();
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) {
alert(getLocalizedString('not_support_version'));
if (typeof android != "undefined") {
NativeBridgeDelegate.openCommunicationHome();
NativeBridgeDelegate.openCommunicationHome();
NativeBridgeDelegate.openCommunicationHome();
}
}
}
initCollaborationUI(joinCollaborationType);
globalUserInfo.coWorkType = CHAT_UTIL.getCoviewTypeFromCollaborationType(joinCollaborationType);
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.initialJoin();
}
};
</script> </script>
</body> </body>
......
...@@ -115,19 +115,15 @@ ...@@ -115,19 +115,15 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
NativeBridgeDelegate.getLoginParameter(); collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
NativeBridgeDelegate.getGlobalParameter();
globalUserInfo.coWorkType = CollaborationTypeKey.DOCUMENT;
CHAT_SOCKET.initialJoin();
function finishPipMode() { function finishPipMode() {
NativeBridgeDelegate.finishPIPMode(); NativeBridgeDelegate.finishPIPMode();
} }
async function getGlobalParam() {
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.DOCUMENT;
CHAT_SOCKET.initialJoin();
};
</script> </script>
</body> </body>
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<div class="user_list d-flex flex-wrap"> <div class="user_list d-flex flex-wrap">
{{#joinedUserList}} {{#joinedUserList}}
<div class="user_item " id="collaboration_user_{{loginId}}"> <div class="user_item " id="collaboration_user_{{loginId}}">
<a href="#" data-toggle="modal" data-target="#profileModal1" onclick="CHAT_UI.makeNameCardInCollaboration({{shopMemberId}})"> <a href="#" data-toggle="modal" data-target="#profileModal1"
onclick="Namecard.makeNameCardInCollaboration({{shopMemberId}})">
<div class="img_wrap"><img src="{{profileUrl}}" alt="this.src='./img/noImage.png'" /></div> <div class="img_wrap"><img src="{{profileUrl}}" alt="this.src='./img/noImage.png'" /></div>
<span class="name">{{shopMemberName}}</span> <span class="name">{{shopMemberName}}</span>
</a> </a>
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
<script src="./js/Models/userinfo.js"></script> <script src="./js/Models/userinfo.js"></script>
<script src="./js/Models/roominfo.js"></script> <script src="./js/Models/roominfo.js"></script>
<script src="./js/Models/socket-joininfo.js"></script> <script src="./js/Models/socket-joininfo.js"></script>
<!-- Socket --> <!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script> <script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script> <script src="./js/sockets/chat-websocket-message.js"></script>
...@@ -178,22 +178,18 @@ ...@@ -178,22 +178,18 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
NativeBridgeDelegate.getLoginParameter(); collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
NativeBridgeDelegate.getGlobalParameter();
globalUserInfo.coWorkType = CollaborationTypeKey.CAMERA;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.initialJoin();
}
const roomType = NativeBridgeDataSource.getRoomType(); const roomType = NativeBridgeDataSource.getRoomType();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
async function getGlobalParam() {
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.CAMERA;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.initialJoin();
}
};
</script> </script>
</body> </body>
......
...@@ -168,22 +168,18 @@ ...@@ -168,22 +168,18 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
NativeBridgeDelegate.getLoginParameter(); collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
NativeBridgeDelegate.getGlobalParameter();
globalUserInfo.coWorkType = CollaborationTypeKey.VIDEO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.initialJoin();
}
const roomType = NativeBridgeDataSource.getRoomType(); const roomType = NativeBridgeDataSource.getRoomType();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
async function getGlobalParam() {
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.VIDEO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.initialJoin();
}
};
</script> </script>
</html> </html>
\ No newline at end of file
...@@ -109,25 +109,17 @@ ...@@ -109,25 +109,17 @@
$("#collaboration_voice_overlay_menu").load("./collaboration_voice_overlay_menu.html"); $("#collaboration_voice_overlay_menu").load("./collaboration_voice_overlay_menu.html");
$("#add_user_list").load("./modal_add_user_list.html"); $("#add_user_list").load("./modal_add_user_list.html");
let collaborationJoinFlg = 0; collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO;
NativeBridgeDelegate.getLoginParameter(); if (collaborationJoinFlg != '2') {
NativeBridgeDelegate.getGlobalParameter(); CHAT_SOCKET.initialJoin();
}
const roomType = NativeBridgeDataSource.getRoomType(); const roomType = NativeBridgeDataSource.getRoomType();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
async function getGlobalParam() {
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.initialJoin();
}
};
</script> </script>
</body> </body>
......
...@@ -169,23 +169,17 @@ ...@@ -169,23 +169,17 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
NativeBridgeDelegate.getLoginParameter(); globalUserInfo.coWorkType = CollaborationTypeKey.BOARD;
NativeBridgeDelegate.getGlobalParameter(); if (collaborationJoinFlg != '2') {
CHAT_SOCKET.initialJoin();
}
const roomType = NativeBridgeDataSource.getRoomType(); const roomType = NativeBridgeDataSource.getRoomType();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
async function getGlobalParam() {
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.BOARD;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.initialJoin();
}
};
</script> </script>
</body> </body>
......
...@@ -210,20 +210,15 @@ ...@@ -210,20 +210,15 @@
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
NativeBridgeDelegate.getLoginParameter(); const groupID = NativeBridgeDataSource.getToMoveGroupId();
NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam() { if (groupID != "" && groupID != undefined) {
Contact.refreshAllGroupSearch(groupID);
NativeBridgeDelegate.setToMoveGroupId("");
} else {
Contact.refreshContactScreen();
}
const groupID = NativeBridgeDataSource.getToMoveGroupId();
if (groupID != "" && groupID != undefined) {
CHAT_UI.refreshAllGroupSearch(groupID);
NativeBridgeDelegate.setToMoveGroupId("");
} else {
CHAT_UI.refreshContactScreen();
}
};
</script> </script>
</body> </body>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</a> </a>
</div> </div>
<div class="footer_item mx-md-3 collaboration_contents picture_contents video_contents document_contents board_contents"> <div class="footer_item mx-md-3 collaboration_contents picture_contents video_contents document_contents board_contents">
<a href="javascript:eraserToggle();"> <a href="javascript:toggleEraser();">
<div class="d-flex flex-column justify-content-center" id="eraserBtn"> <div class="d-flex flex-column justify-content-center" id="eraserBtn">
<div class="t-icon delete my-0"></div> <div class="t-icon delete my-0"></div>
<span class="text-white txt">削除</span> <span class="text-white txt">削除</span>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</a> </a>
</div> </div>
<div class="footer_item mx-md-3 collaboration_contents video_contents_host"> <div class="footer_item mx-md-3 collaboration_contents video_contents_host">
<a href="javascript:captureToggle();"> <a href="javascript:toggleCapture();">
<div class="d-flex flex-column justify-content-center" id="captureBtn"> <div class="d-flex flex-column justify-content-center" id="captureBtn">
<div class="t-icon capture my-0"></div> <div class="t-icon capture my-0"></div>
<span class="text-white txt">キャプチャ</span> <span class="text-white txt">キャプチャ</span>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</a> </a>
</div> </div>
<div class="footer_item mx-md-3 collaboration_contents video_contents_user"> <div class="footer_item mx-md-3 collaboration_contents video_contents_user">
<a href="javascript:captureRequestToggle();"> <a href="javascript:toggleCaptureRequest();">
<div class="d-flex flex-column justify-content-center" id="captureRequestBtn"> <div class="d-flex flex-column justify-content-center" id="captureRequestBtn">
<div class="t-icon capture my-0"></div> <div class="t-icon capture my-0"></div>
<span class="text-white txt">キャプチャリクエスト</span> <span class="text-white txt">キャプチャリクエスト</span>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</a> </a>
</div> </div>
<div class="footer_item mx-md-3"> <div class="footer_item mx-md-3">
<a href="javascript:micTogle();"> <a href="javascript:toggleMic();">
<div class="d-flex flex-column justify-content-center" id="micBtn"> <div class="d-flex flex-column justify-content-center" id="micBtn">
<div class="t-icon voice my-0"></div> <div class="t-icon voice my-0"></div>
<span class="text-white txt">マイク</span> <span class="text-white txt">マイク</span>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</a> </a>
</div> </div>
<div class="footer_item mx-md-3 none host_contents"> <div class="footer_item mx-md-3 none host_contents">
<a href="javascript:recordTogle();"> <a href="javascript:toggleRecord();">
<div class="d-flex flex-column justify-content-center" id="recordBtn"> <div class="d-flex flex-column justify-content-center" id="recordBtn">
<div class="t-icon record my-0"></div> <div class="t-icon record my-0"></div>
<span class="text-white txt">録音</span> <span class="text-white txt">録音</span>
......
...@@ -74,22 +74,45 @@ var Common = {}; ...@@ -74,22 +74,45 @@ var Common = {};
//loadingIndicatorを表示 //loadingIndicatorを表示
Common.showLoadingIndicator = function () { Common.showLoadingIndicator = function () {
var h = $(window).height(); const h = $(window).height();
$("#loader-bg ,#loader").height(h).css("display", "block"); $("#loader-bg ,#loader").height(h).css("display", "block");
}; };
//loadingIndicatorを表示しない //loadingIndicatorを表示しない
Common.dismissLoadingIndicator = function () { Common.dismissLoadingIndicator = function () {
var h = $(window).height(); const h = $(window).height();
$("#loader-bg ,#loader").height(h).css("display", "none"); $("#loader-bg ,#loader").height(h).css("display", "none");
}; };
Common.refreshForOnline = function () { Common.refreshForOnline = function () {
serverInfo.isOnline = "true";
$(".footer_item a").removeClass("ui-state-disabled"); $(".footer_item a").removeClass("ui-state-disabled");
if (ChatList != "undefined") {
ChatList.refreshForOnline();
}
if (ChatRoom != "undefined") {
ChatRoom.refreshForOnline();
}
if (Namecard != "undefined") {
Namecard.refreshForOnline();
}
}; };
Common.refreshForOffline = function () { Common.refreshForOffline = function () {
$(".footer_item a").addClass("ui-state-disabled"); serverInfo.isOnline = "false";
$(".footer_item a").addClass("ui-state-disabled");
if (ChatList != "undefined") {
ChatList.refreshForOffline();
}
if (ChatRoom != "undefined") {
ChatRoom.refreshForOffline();
}
if (CollaborationUI != "undefined") {
CollaborationUI.refreshForOffline();
}
if (Namecard != "undefined") {
Namecard.refreshForOffline();
}
}; };
// #36170 画像パスが存在しない場合はデフォルトの画像を返す // #36170 画像パスが存在しない場合はデフォルトの画像を返す
...@@ -99,7 +122,7 @@ Common.getProfileImgUrl = function (path) { ...@@ -99,7 +122,7 @@ Common.getProfileImgUrl = function (path) {
return "./img/noImage.png"; return "./img/noImage.png";
} else { } else {
if (path.includes("/mnt")) { if (path.includes("/mnt")) {
var userInfo = path.split("/").reverse(); const userInfo = path.split("/").reverse();
return ( return (
serverInfo.cmsURL + serverInfo.cmsURL +
"/chatapi/user?profileFileName=" + "/chatapi/user?profileFileName=" +
...@@ -114,4 +137,4 @@ Common.getProfileImgUrl = function (path) { ...@@ -114,4 +137,4 @@ Common.getProfileImgUrl = function (path) {
return path; return path;
} }
} }
}; };
\ No newline at end of file
...@@ -124,22 +124,6 @@ NativeBridgeDelegate.inviteUsers = function (userIDList) { ...@@ -124,22 +124,6 @@ NativeBridgeDelegate.inviteUsers = function (userIDList) {
} }
}; };
NativeBridgeDelegate.getLoginParameter = function () {
if (typeof android != "undefined") {
android.getLoginParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
}
};
NativeBridgeDelegate.getGlobalParameter = function () {
if (typeof android != "undefined") {
android.getGlobalParameter();
} else {
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
};
NativeBridgeDelegate.saveSelectedUserList = function (selectedUserList) { NativeBridgeDelegate.saveSelectedUserList = function (selectedUserList) {
if (typeof android != "undefined") { if (typeof android != "undefined") {
android.saveSelectedUserList(selectedUserList); android.saveSelectedUserList(selectedUserList);
...@@ -377,14 +361,8 @@ ReverseDelegate.leaveRoom = function () { ...@@ -377,14 +361,8 @@ ReverseDelegate.leaveRoom = function () {
CHAT_SOCKET.emitLeaveRoom(); CHAT_SOCKET.emitLeaveRoom();
}; };
// 該当チャットルームに参加するためログイン情報をサーバに渡す
getLoginParameter = function () {
Common.dismissLoadingIndicator();
};
// for android call // for android call
CHAT_UI.displayExistRoom = function (roomId) { ReverseDelegate.displayExistRoom = function (roomId) {
if (confirm("error_already_exist_same_user")) { if (confirm("error_already_exist_same_user")) {
NativeBridgeDelegate.joinRoom(roomId); NativeBridgeDelegate.joinRoom(roomId);
} }
......
...@@ -37,7 +37,7 @@ var bindOnNewMessage = function () { ...@@ -37,7 +37,7 @@ var bindOnNewMessage = function () {
// 画像、動画の描画を待ってからスクロール // 画像、動画の描画を待ってからスクロール
setTimeout(function () { setTimeout(function () {
CHAT_UI.scrollToBottom(); ChatRoom.scrollToBottom();
}, 300); }, 300);
}); });
}; };
......
...@@ -49,10 +49,6 @@ var bindOnConnect = function () { ...@@ -49,10 +49,6 @@ var bindOnConnect = function () {
socket.on(SOCKET_KEY.CONNECT, function () { socket.on(SOCKET_KEY.CONNECT, function () {
// socketが接続されたらチャット画面で画面を更新する // socketが接続されたらチャット画面で画面を更新する
$(".overlay").removeClass("active undismissable"); $(".overlay").removeClass("active undismissable");
// loadingIndicatorを表示
Common.showLoadingIndicator();
NativeBridgeDelegate.getLoginParameter();
Common.dismissLoadingIndicator();
}); });
}; };
...@@ -135,13 +131,9 @@ var bindOnShowServerError = function () { ...@@ -135,13 +131,9 @@ var bindOnShowServerError = function () {
var bindOnRetryJoinProcess = function () { var bindOnRetryJoinProcess = function () {
socket.on(SOCKET_KEY.RETRY_JOIN_PROCESS, function () { socket.on(SOCKET_KEY.RETRY_JOIN_PROCESS, function () {
if (deviceInfo.isiOS() || deviceInfo.isAndroid()) { currentUserInfo.configureLanguage();
NativeBridgeDelegate.getLoginParameter(); // webでのsocket connect
} else { CHAT_SOCKET.emitJoin(params, true, true);
currentUserInfo.configureLanguage();
// webでのsocket connect
CHAT_SOCKET.emitJoin(params, true, true);
}
}); });
}; };
...@@ -215,7 +207,7 @@ CHAT_SOCKET.saveRoomInfo = function (roomID, roomName) { ...@@ -215,7 +207,7 @@ CHAT_SOCKET.saveRoomInfo = function (roomID, roomName) {
NativeBridgeDelegate.saveVisitRoomInfo(roomID, roomName); NativeBridgeDelegate.saveVisitRoomInfo(roomID, roomName);
}; };
CHAT_SOCKET.initialJoin = function() { CHAT_SOCKET.initialJoin = function () {
CHAT_SOCKET.connectSocket(); CHAT_SOCKET.connectSocket();
const joinInfo = new JoinInfo( const joinInfo = new JoinInfo(
currentUserInfo.sid, currentUserInfo.sid,
...@@ -226,4 +218,4 @@ CHAT_SOCKET.initialJoin = function() { ...@@ -226,4 +218,4 @@ CHAT_SOCKET.initialJoin = function() {
currentUserInfo.shopMembeID currentUserInfo.shopMembeID
); );
CHAT_SOCKET.emitJoin(joinInfo, false, false); CHAT_SOCKET.emitJoin(joinInfo, false, false);
} };
var chatMediaHandler = {}; var ChatMediaHandler = {};
/** /**
* Image Upload * Image Upload
...@@ -25,7 +25,7 @@ $("#image-form").on("submit", function (e) { ...@@ -25,7 +25,7 @@ $("#image-form").on("submit", function (e) {
var fd = new FormData($(this)[0]); var fd = new FormData($(this)[0]);
console.log($(this)[0]); console.log($(this)[0]);
//画像の大きさが500pixelより大きかったら、thumbnailを生成 //画像の大きさが500pixelより大きかったら、thumbnailを生成
CHAT.createThumbnailAndUpload( ChatMediaHandler.createThumbnailAndUpload(
file, file,
function (resizeFile, thumbnailCreated) { function (resizeFile, thumbnailCreated) {
if (resizeFile && thumbnailCreated) { if (resizeFile && thumbnailCreated) {
...@@ -34,7 +34,7 @@ $("#image-form").on("submit", function (e) { ...@@ -34,7 +34,7 @@ $("#image-form").on("submit", function (e) {
} }
// イメージをアップロード // イメージをアップロード
CHAT.uploadImage(fd); ChatMediaHandler.uploadImage(fd);
} }
); );
} }
...@@ -66,27 +66,27 @@ $("#video-form").on("submit", function (e) { ...@@ -66,27 +66,27 @@ $("#video-form").on("submit", function (e) {
if (!file.type.includes("image")) { if (!file.type.includes("image")) {
// video 保存 // video 保存
// CHAT.createVideoThumbnailAndUpload(file, function(resizeFile, thumbnailCreated) { // ChatMediaHandler.createVideoThumbnailAndUpload(file, function(resizeFile, thumbnailCreated) {
// if(resizeFile && thumbnailCreated) { // if(resizeFile && thumbnailCreated) {
// //ただ、画像の大きさが500pixel以下の場合はthumbnailは生成されない // //ただ、画像の大きさが500pixel以下の場合はthumbnailは生成されない
// fd.append('thumb', resizeFile) // fd.append('thumb', resizeFile)
// } // }
// CHAT.uploadImage(fd); // ChatMediaHandler.uploadImage(fd);
// }) // })
CHAT.uploadImage(fd); ChatMediaHandler.uploadImage(fd);
return; return;
} }
} }
}); });
// this method call from android only for now // this method call from android only for now
CHAT_UI.videoEncodeFail = function () { ChatMediaHandler.videoEncodeFail = function () {
alert(getLocalizedString("error_send_video")); alert(getLocalizedString("error_send_video"));
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
}; };
// this method call from android only for now // this method call from android only for now
CHAT_UI.videoEncodeEnd = function (encodedUri) { ChatMediaHandler.videoEncodeEnd = function (encodedUri) {
var fileName = encodedUri.split("/")[encodedUri.split("/").length - 1]; var fileName = encodedUri.split("/")[encodedUri.split("/").length - 1];
var fileURL = "file:" + encodedUri; var fileURL = "file:" + encodedUri;
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
...@@ -182,7 +182,7 @@ CHAT_UI.videoEncodeEnd = function (encodedUri) { ...@@ -182,7 +182,7 @@ CHAT_UI.videoEncodeEnd = function (encodedUri) {
// Video のサムネイルファイル生成する // Video のサムネイルファイル生成する
CHAT.createVideoThumbnailAndUpload = function (sourceImage, callback) { ChatMediaHandler.createVideoThumbnailAndUpload = function (sourceImage, callback) {
var fileReader = new FileReader(); var fileReader = new FileReader();
fileReader.onload = function () { fileReader.onload = function () {
...@@ -241,7 +241,7 @@ CHAT.createVideoThumbnailAndUpload = function (sourceImage, callback) { ...@@ -241,7 +241,7 @@ CHAT.createVideoThumbnailAndUpload = function (sourceImage, callback) {
// Ajaxでイメージをアップロードする // Ajaxでイメージをアップロードする
CHAT.uploadImage = function (formData) { ChatMediaHandler.uploadImage = function (formData) {
formData.append("roomId", roomInfo.roomID); formData.append("roomId", roomInfo.roomID);
formData.append("sid", currentUserInfo.sid); formData.append("sid", currentUserInfo.sid);
jQuery jQuery
...@@ -381,7 +381,7 @@ CHAT.uploadImage = function (formData) { ...@@ -381,7 +381,7 @@ CHAT.uploadImage = function (formData) {
// Thumbnailのファイルを生成する。 // Thumbnailのファイルを生成する。
CHAT.createThumbnailAndUpload = function (sourceImage, callback) { ChatMediaHandler.createThumbnailAndUpload = function (sourceImage, callback) {
const fileReader = new FileReader(); const fileReader = new FileReader();
const img = new Image(); const img = new Image();
fileReader.onloadend = function () { fileReader.onloadend = function () {
......
// 名前空間 // 名前空間
var ARCHIVE_UI = {}; var ArchiveUI = {};
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
// アーカイブ検索 // アーカイブ検索
...@@ -8,7 +8,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -8,7 +8,7 @@ document.addEventListener("DOMContentLoaded", function () {
bindiOSKeyBoardEvent(); bindiOSKeyBoardEvent();
}); });
ARCHIVE_UI.refreshSearchScreen = function (keyword) { ArchiveUI.refreshSearchScreen = function (keyword) {
const archiveList = NativeBridgeDataSource.getArchiveByName(keyword); const archiveList = NativeBridgeDataSource.getArchiveByName(keyword);
const typeImage = getArchiveTypeIconURL(archive.archiveType); const typeImage = getArchiveTypeIconURL(archive.archiveType);
...@@ -77,7 +77,7 @@ var bindArchiveSearch = function () { ...@@ -77,7 +77,7 @@ var bindArchiveSearch = function () {
} }
$(".overlay_src_msg").empty(); $(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword); ArchiveUI.refreshSearchScreen(keyword);
if (enterKeyPressed) { if (enterKeyPressed) {
searchInput.blur(); searchInput.blur();
...@@ -93,7 +93,7 @@ var bindiOSKeyBoardEvent = function () { ...@@ -93,7 +93,7 @@ var bindiOSKeyBoardEvent = function () {
if (deviceInfo.isiOS()) { if (deviceInfo.isiOS()) {
var keyword = searchInput.val(); var keyword = searchInput.val();
$(".overlay_src_msg").empty(); $(".overlay_src_msg").empty();
ARCHIVE_UI.refreshSearchScreen(keyword); ArchiveUI.refreshSearchScreen(keyword);
} }
}); });
}; };
...@@ -113,26 +113,60 @@ var renderArchiveTemplate = function ( ...@@ -113,26 +113,60 @@ var renderArchiveTemplate = function (
}); });
}; };
// アーカイブ詳細 /*****************
CHAT_UI.refreshArchiveDetailScreen = function (archiveId) { * アーカイブ詳細
****************/
ArchiveUI.refreshArchiveDetailScreen = function (archiveId) {
// loadingIndicatorを表示 // loadingIndicatorを表示
Common.showLoadingIndicator(); Common.showLoadingIndicator();
// 初期化 // 初期化
$("#archiveDetail").html(""); $("#archiveDetail").html("");
// アーカイブ詳細の様式を読み込む
const archiveDetailTemplate = $("#archive-detail-template").html();
if (serverInfo.isOnline == "true") { if (serverInfo.isOnline == "true") {
NativeBridgeDelegate.updateArchiveDetail(archiveId); NativeBridgeDelegate.updateArchiveDetail(archiveId);
} }
// アーカイブ詳細取得 // アーカイブ詳細取得
const archive = NativeBridgeDataSource.getArchiveDetail(archiveId); const archive = NativeBridgeDataSource.getArchiveDetail(archiveId);
// template archive detail
appendArchiveDetailScreen(archive);
// setup player
appendPlayer(archive);
// append attended users
appendAttendUsers(archive.attendUserIds);
// set languages
currentUserInfo.configureLanguage();
// TODO: peacekim:: check localization works or not
$(".ttl_detail").text(getLocalizedString("detail"));
$("#archiveFileName").text(getLocalizedString("archiveFileName"));
$("#archiveInsertDate").text(getLocalizedString("archiveInsertDate"));
$("#archiveRoomName").text(getLocalizedString("archiveRoomName"));
$("#archiveSaveUser").text(getLocalizedString("archiveSaveUser"));
$("#archiveAttendUser").text(getLocalizedString("archiveAttendUser"));
// チャットルームへのリンク付け
document.getElementById("joinChatRoom").onclick = function () {
NativeBridgeDelegate.joinRoom(archive.roomId, archive.roomName);
};
// loadingIndicatorを非表示
Common.dismissLoadingIndicator();
};
var appendArchiveDetailScreen = function (archive) {
// 保存ユーザ情報を取得 // 保存ユーザ情報を取得
const userInfo = NativeBridgeDataSource.getUserInfo(archive.saveUserId); const userInfo = NativeBridgeDataSource.getUserInfo(archive.saveUserId);
userInfo.profileUrl = Common.getProfileImgUrl(userInfo.profileUrl); userInfo.profileUrl = Common.getProfileImgUrl(userInfo.profileUrl);
// アーカイブ詳細の様式を読み込む
const archiveDetailTemplate = $("#archive-detail-template").html();
// アーカイブ情報を表示 // アーカイブ情報を表示
const html = Mustache.render(archiveDetailTemplate, { const html = Mustache.render(archiveDetailTemplate, {
fileName: archive.archiveName, fileName: archive.archiveName,
...@@ -146,9 +180,11 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) { ...@@ -146,9 +180,11 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
var obj = $(jQuery.parseHTML(html)).on("click", function () {}); var obj = $(jQuery.parseHTML(html)).on("click", function () {});
$("#archiveDetail").append(obj); $("#archiveDetail").append(obj);
};
var appendPlayer = function (archive) {
// プレイヤーの切り替え // プレイヤーの切り替え
const archiveFilePath = CHAT.createGetDataUrl( const archiveFilePath = ArchiveUI.createGetDataUrl(
archive.filePath, archive.filePath,
archive.roomId archive.roomId
); );
...@@ -156,50 +192,15 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) { ...@@ -156,50 +192,15 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
switch (archive.archiveType) { switch (archive.archiveType) {
case "0": // 画像 case "0": // 画像
case 0: case 0:
$("#archive_player").prepend( appendImageTypePlayer(archiveFilePath);
'<img class="archive_player" src="' + archiveFilePath + '" />'
);
break; break;
case "1": // 動画 case "1": // 動画
case 1: case 1:
if (deviceInfo.isiOS()) { appendVideoTypePlayer(archiveFilePath);
$("#archive_player").prepend(
'<video class="archive_player" controls autoplay muted playsinline controlsList="nodownload"><source src="' +
archiveFilePath +
'" type="video/mp4"><source src="' +
archiveFilePath +
'" type="video/ogv"><source src="' +
archiveFilePath +
'" type="video/webm"></video>'
);
} else {
$("#archive_player").prepend(
'<video class="archive_player" src=' +
archiveFilePath +
' controls autoplay muted playsinline controlsList="nodownload"></video>'
);
}
break; break;
case "2": // 音声 case "2": // 音声
case 2: case 2:
if (deviceInfo.isiOS()) { appendVoiceTypePlayer(archiveFilePath);
$("#archive_player").prepend(
'<audio class="archive_audio_player" controls controlsList="nodownload"><source src="' +
archiveFilePath +
'" type="audio/wav"><source src="' +
archiveFilePath +
'" type="audio/ogg"></audio>'
);
} else {
$("#archive_player").prepend(
'<audio class="archive_audio_player" src=' +
archiveFilePath +
' controls controlsList="nodownload"></audio>'
);
}
$("#archive_player").prepend(
'<img class="archive_player" src=' + "./img/capture.png" + " />"
);
break; break;
case "3": // 文書 case "3": // 文書
case 3: case 3:
...@@ -208,7 +209,56 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) { ...@@ -208,7 +209,56 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
default: default:
// リリースに文書とその他は含めないため今回は非表示 // リリースに文書とその他は含めないため今回は非表示
} }
};
var appendImageTypePlayer = function (filePath) {
$("#archive_player").prepend(
'<img class="archive_player" src="' + filePath + '" />'
);
};
var appendVideoTypePlayer = function (filePath) {
if (deviceInfo.isiOS()) {
$("#archive_player").prepend(
'<video class="archive_player" controls autoplay muted playsinline controlsList="nodownload"><source src="' +
filePath +
'" type="video/mp4"><source src="' +
filePath +
'" type="video/ogv"><source src="' +
filePath +
'" type="video/webm"></video>'
);
} else {
$("#archive_player").prepend(
'<video class="archive_player" src=' +
filePath +
' controls autoplay muted playsinline controlsList="nodownload"></video>'
);
}
};
var appendVoiceTypePlayer = function (filePath) {
if (deviceInfo.isiOS()) {
$("#archive_player").prepend(
'<audio class="archive_audio_player" controls controlsList="nodownload"><source src="' +
filePath +
'" type="audio/wav"><source src="' +
filePath +
'" type="audio/ogg"></audio>'
);
} else {
$("#archive_player").prepend(
'<audio class="archive_audio_player" src=' +
filePath +
' controls controlsList="nodownload"></audio>'
);
}
$("#archive_player").prepend(
'<img class="archive_player" src=' + "./img/capture.png" + " />"
);
};
var appendAttendUsers = function (attendedUserList) {
// ユーザの様式を読み込む // ユーザの様式を読み込む
const archiveUserTemplate = $("#archive-user-template").html(); const archiveUserTemplate = $("#archive-user-template").html();
...@@ -232,31 +282,14 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) { ...@@ -232,31 +282,14 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
const obj = $(jQuery.parseHTML(html)).on("click", function () { const obj = $(jQuery.parseHTML(html)).on("click", function () {
// ネームカード表示 // ネームカード表示
CHAT_UI.makeNameCard(user); Namecard.makeNameCard(user);
}); });
$("#attendUser").append(obj); $("#attendUser").append(obj);
}); });
currentUserInfo.configureLanguage();
// TODO: peacekim:: check localization works or not
$(".ttl_detail").text(getLocalizedString("detail"));
$("#archiveFileName").text(getLocalizedString("archiveFileName"));
$("#archiveInsertDate").text(getLocalizedString("archiveInsertDate"));
$("#archiveRoomName").text(getLocalizedString("archiveRoomName"));
$("#archiveSaveUser").text(getLocalizedString("archiveSaveUser"));
$("#archiveAttendUser").text(getLocalizedString("archiveAttendUser"));
// チャットルームへのリンク付け
document.getElementById("joinChatRoom").onclick = function () {
NativeBridgeDelegate.joinRoom(archive.roomId, archive.roomName);
};
// loadingIndicatorを非表示
Common.dismissLoadingIndicator();
}; };
CHAT.createGetDataUrl = function (fileName, roomId) { ArchiveUI.createGetDataUrl = function (fileName, roomId) {
var filePath = var filePath =
serverInfo.cmsURL + serverInfo.cmsURL +
"/chatapi/file/getImage?sid=" + "/chatapi/file/getImage?sid=" +
...@@ -269,7 +302,7 @@ CHAT.createGetDataUrl = function (fileName, roomId) { ...@@ -269,7 +302,7 @@ CHAT.createGetDataUrl = function (fileName, roomId) {
}; };
// アーカイブ一覧 // アーカイブ一覧
CHAT_UI.refreshArchiveScreen = function () { ArchiveUI.refreshArchiveScreen = function () {
// loadingIndicatorを表示 // loadingIndicatorを表示
Common.showLoadingIndicator(); Common.showLoadingIndicator();
......
...@@ -9,6 +9,10 @@ $("#tabGroup").on("click", function (e) { ...@@ -9,6 +9,10 @@ $("#tabGroup").on("click", function (e) {
}); });
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
bindChatSearch();
});
var bindChatSearch = function () {
const chatSearchInput = $('#chat .search_form input[type="search"]'); const chatSearchInput = $('#chat .search_form input[type="search"]');
const chatSearchCancel = $("#chat .search_form .cancel"); const chatSearchCancel = $("#chat .search_form .cancel");
chatSearchInput.click(function () { chatSearchInput.click(function () {
...@@ -25,7 +29,8 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -25,7 +29,8 @@ document.addEventListener("DOMContentLoaded", function () {
chatSearchInput.keyup(function (e) { chatSearchInput.keyup(function (e) {
var rooms; var rooms;
var keyword = chatSearchInput.val(); var keyword = chatSearchInput.val();
if (e.KeyCode == 13 || e.key == "Enter") { const enterKeyPressed = e.KeyCode == 13 || e.key == "Enter";
if (enterKeyPressed) {
if (keyword.length != 0 && keyword != "") { if (keyword.length != 0 && keyword != "") {
chatSearchInput.blur(); chatSearchInput.blur();
return; return;
...@@ -34,24 +39,22 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -34,24 +39,22 @@ document.addEventListener("DOMContentLoaded", function () {
$(".overlay_src_msg").empty(); $(".overlay_src_msg").empty();
return; return;
} }
CHAT.searchRoom(keyword, rooms); ChatList.searchRoom(keyword, rooms);
if (e.KeyCode == 13 || e.key == "Enter") { if (enterKeyPressed) {
chatSearchInput.blur(); chatSearchInput.blur();
return; return;
} }
}); });
// iOSキーボード変換検知用 // iOSキーボード変換検知用
chatSearchInput.on( chatSearchInput.on("compositionend", function () {
"compositionend", if (deviceInfo.isIOS()) {
function () { var rooms;
if (deviceInfo.isIOS()) { var keyword = chatSearchInput.val();
var rooms; ChatList.searchRoom(keyword, rooms);
var keyword = chatSearchInput.val();
CHAT.searchRoom(keyword, rooms);
}
} }
); });
}); };
ChatList.refreshRoomList = function (roomType) { ChatList.refreshRoomList = function (roomType) {
if (serverInfo.isOnline == "true") { if (serverInfo.isOnline == "true") {
...@@ -81,82 +84,15 @@ ChatList.refreshRoomList = function (roomType) { ...@@ -81,82 +84,15 @@ ChatList.refreshRoomList = function (roomType) {
$("#dmChatList").empty(); $("#dmChatList").empty();
let roomListTitle = getLocalizedString("roomListTitle"); let roomListTitle = getLocalizedString("roomListTitle");
$("#chatTitle").text(roomListTitle); $("#chatTitle").text(roomListTitle);
if (rooms.length === 0) { if (rooms.length === 0) {
// 検索結果がない場合のメッセージを追加 addEmptyRoomListLabel(roomType);
let emptyListString = getLocalizedString("roomListEmptyString");
switch (roomType) {
case ChatRoomType.GROUP:
$("#groupChatList").append(
`<center class="text-secondary">${emptyListString}</center>`
);
break;
case ChatRoomType.DM:
$("#dmChatList").append(
`<center class="text-secondary">${emptyListString}</center>`
);
break;
default:
}
} }
var template = getTemplate(TemplateURL.ROOM_LIST); const template = getTemplate(TemplateURL.ROOM_LIST);
rooms.forEach(function (room) { rooms.forEach(function (room) {
room.profileImagePath = "./images/user-profile.png"; let html = renderRoom(template, room);
if (room.message) {
room.message = room.message.toString();
} else {
room.message = getLocalizedString("noMessages");
}
var displayMsg;
//TODO 協業の場合処理追加必要
switch (room.messageType) {
case MessageType.TEXT:
displayMsg = room.message;
break;
case MessageType.IMAGE:
displayMsg = getLocalizedString("image");
break;
case MessageType.VIDEO:
displayMsg = getLocalizedString("video");
break;
case MessageType.COMMUNICATIONSTART:
displayMsg = getLocalizedString("collaboration_start");
break;
case MessageType.COMMUNICATIONEND:
displayMsg = getLocalizedString("collaboration_end");
break;
default:
break;
}
var attendUserName = [];
room.attendUsers.forEach(function (user) {
user.profileUrl = Common.getProfileImgUrl(user.profileUrl);
attendUserName.push(user.shopMemberName);
});
var thumbnailCount =
room.attendUsers.length > 4 ? 4 : room.attendUsers.length;
if (room.chatRoomName == "") {
room.chatRoomName = attendUserName.join(", ");
}
var unreadMessageCount = room.unreadCount == 0 ? "" : room.unreadCount;
if (unreadMessageCount > 999) {
unreadMessageCount = "999+";
}
let html = Mustache.render(template, {
thumbnailCount: thumbnailCount,
roomName: room.chatRoomName,
roomId: room.chatRoomId,
profileImage: room.profileImagePath,
lastMessage: displayMsg,
time: room.insertDate
? CHAT_UTIL.formatDate(room.insertDate).createdAt
: "",
unreadMsgCnt: unreadMessageCount,
userCnt: room.attendUsers.length + 1,
attendUsers: room.attendUsers,
});
// Click event // Click event
let obj = $(jQuery.parseHTML(html)).on("click", function () { let obj = $(jQuery.parseHTML(html)).on("click", function () {
//TODO ルームに入る処理追加必要 //TODO ルームに入る処理追加必要
...@@ -170,15 +106,52 @@ ChatList.refreshRoomList = function (roomType) { ...@@ -170,15 +106,52 @@ ChatList.refreshRoomList = function (roomType) {
$("#dmChatList").append(obj); $("#dmChatList").append(obj);
break; break;
default: default:
break;
} }
}); });
console.log("DONE");
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
}; };
var addEmptyRoomListLabel = function (roomType) {
// 検索結果がない場合のメッセージを追加
const emptyListString = getLocalizedString("roomListEmptyString");
switch (roomType) {
case ChatRoomType.GROUP:
$("#groupChatList").append(
`<center class="text-secondary">${emptyListString}</center>`
);
break;
case ChatRoomType.DM:
$("#dmChatList").append(
`<center class="text-secondary">${emptyListString}</center>`
);
break;
default:
}
};
var getDefaultChatRoomName = function (roomAttendUsers) {
let attendUserName = [];
roomAttendUsers.forEach(function (user) {
user.profileUrl = Common.getProfileImgUrl(user.profileUrl);
attendUserName.push(user.shopMemberName);
});
return attendUserName.join(", ");
};
var getUnreadCount = function (roomUnreadCount) {
if (roomUnreadCount == 0) {
return "";
} else if (roomUnreadCount > 999) {
return "999+";
}
return roomUnreadCount;
};
// チャットルーム検索 // チャットルーム検索
CHAT.searchRoom = function (keyword, rooms) { ChatList.searchRoom = function (keyword, rooms) {
const overlayMessage = $(".overlay_src_msg"); const overlayMessage = $(".overlay_src_msg");
overlayMessage.empty(); overlayMessage.empty();
rooms = NativeBridgeDataSource.getRoomList(ChatRoomType.ALL, keyword); rooms = NativeBridgeDataSource.getRoomList(ChatRoomType.ALL, keyword);
...@@ -187,11 +160,7 @@ CHAT.searchRoom = function (keyword, rooms) { ...@@ -187,11 +160,7 @@ CHAT.searchRoom = function (keyword, rooms) {
var template = getTemplate(TemplateURL.ROOM_LIST); var template = getTemplate(TemplateURL.ROOM_LIST);
rooms.forEach(function (room) { rooms.forEach(function (room) {
room.profileImagePath = "./images/user-profile.png"; let html = renderRoom(template, room);
const roomMessage = getRoomMessage(room.message);
const displayMessage = getDisplayMessage(room.messageType, roomMessage);
let html = renderRoom(template, room, displayMessage);
// Click event // Click event
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
...@@ -227,24 +196,25 @@ var getDisplayMessage = function (messageType, roomMessage) { ...@@ -227,24 +196,25 @@ var getDisplayMessage = function (messageType, roomMessage) {
case MessageType.COMMUNICATIONEND: case MessageType.COMMUNICATIONEND:
return getLocalizedString("collaboration_end"); return getLocalizedString("collaboration_end");
default: default:
return ""; return roomMessage;
} }
}; };
var renderRoom = function (template, room, displayMessage) { var renderRoom = function (template, room) {
var attendUserName = []; room.profileImagePath = "./images/user-profile.png";
room.attendUsers.forEach(function (user) { const roomMessage = getRoomMessage(room.message);
user.profileUrl = Common.getProfileImgUrl(user.profileUrl); const displayMessage = getDisplayMessage(room.messageType, roomMessage);
attendUserName.push(user.shopMemberName);
});
const thumbnailCount = const thumbnailCount =
room.attendUsers.length > 4 ? 4 : room.attendUsers.length; room.attendUsers.length > 4 ? 4 : room.attendUsers.length;
const time = room.insertDate const time = room.insertDate
? CHAT_UTIL.formatDate(room.insertDate).createdAt ? CHAT_UTIL.formatDate(room.insertDate).createdAt
: ""; : "";
if (room.chatRoomName == "") { if (room.chatRoomName == "") {
room.chatRoomName = attendUserName.join(", "); room.chatRoomName = getDefaultChatRoomName(room.attendUsers);
} }
const messageUnreadCount = getUnreadCount(room.unreadCount);
return Mustache.render(template, { return Mustache.render(template, {
thumbnailCount: thumbnailCount, thumbnailCount: thumbnailCount,
roomName: room.chatRoomName, roomName: room.chatRoomName,
...@@ -252,24 +222,22 @@ var renderRoom = function (template, room, displayMessage) { ...@@ -252,24 +222,22 @@ var renderRoom = function (template, room, displayMessage) {
profileImage: room.profileImagePath, profileImage: room.profileImagePath,
lastMessage: displayMessage, lastMessage: displayMessage,
time: time, time: time,
unreadMsgCnt: room.unreadCount == 0 ? "" : room.unreadCount, unreadMsgCnt: messageUnreadCount,
userCnt: room.attendUsers.length + 1, userCnt: room.attendUsers.length + 1,
attendUsers: room.attendUsers, attendUsers: room.attendUsers,
}); });
}; };
CHAT_UI.refreshForOnline = function () { ChatList.refreshForOnline = function () {
serverInfo.isOnline = "true"; $(".craeteRoomButton").off("click", ChatList.offlineHandler);
$(".craeteRoomButton").off("click", CHAT_UI.offlineHandler);
$(".craeteRoomButton").css("opacity", "1.0"); $(".craeteRoomButton").css("opacity", "1.0");
}; };
CHAT_UI.refreshForOffline = function () { ChatList.refreshForOffline = function () {
serverInfo.isOnline = "false"; $(".craeteRoomButton").on("click", ChatList.offlineHandler);
$(".craeteRoomButton").on("click", CHAT_UI.offlineHandler);
$(".craeteRoomButton").css("opacity", "0.3"); $(".craeteRoomButton").css("opacity", "0.3");
} };
CHAT_UI.offlineHandler = function (e) { ChatList.offlineHandler = function (e) {
e.preventDefault(); e.preventDefault();
}; };
...@@ -146,21 +146,20 @@ var renderUserTemplate = function (userTemplate, userList) { ...@@ -146,21 +146,20 @@ var renderUserTemplate = function (userTemplate, userList) {
}; };
$("#addUserConfirmBtn").on("click", function (e) { $("#addUserConfirmBtn").on("click", function (e) {
const selectedUserList = const selectedUserList = ChatManagementCommon.selectedUserList.join(",");
ChatManagementCommon.selectedUserList.join(",");
NativeBridgeDelegate.saveSelectedUserList(selectedUserList); NativeBridgeDelegate.saveSelectedUserList(selectedUserList);
$("#addUserForm").submit(); $("#addUserForm").submit();
}); });
$("#tabAllGroupOnAddUser").on("click", function (e) { $("#tabAllGroupOnAddUser").on("click", function (e) {
CHAT_UI.refreshAllGroupForAddUser("0"); ChatAddUser.refreshAllGroupForAddUser("0");
}); });
$("#tabMyGroupOnAddUser").on("click", function (e) { $("#tabMyGroupOnAddUser").on("click", function (e) {
CHAT_UI.refreshMyGroupForAddUser(); ChatAddUser.refreshMyGroupForAddUser();
}); });
CHAT_UI.refreshMyGroupForAddUser = function () { ChatAddUser.refreshMyGroupForAddUser = function () {
$(".modal-backdrop").remove(); $(".modal-backdrop").remove();
$("#favoriteListForMakeRoom").html(""); $("#favoriteListForMakeRoom").html("");
$("#myGroupListForMakeRoom").html(""); $("#myGroupListForMakeRoom").html("");
...@@ -168,17 +167,21 @@ CHAT_UI.refreshMyGroupForAddUser = function () { ...@@ -168,17 +167,21 @@ CHAT_UI.refreshMyGroupForAddUser = function () {
let contactListTitle = getLocalizedString("userSearch"); let contactListTitle = getLocalizedString("userSearch");
$("#title").text(contactListTitle); $("#title").text(contactListTitle);
// グループの様式を読み込む
var groupTemplate = getTemplate(TemplateURL.ADD_USER_GROUP_LIST);
// ユーザの様式を読み込む
var userTemplate = getTemplate(TemplateURL.ADD_USER_USER_LIST);
var groupUserTemplate = getTemplate(TemplateURL.ADD_USER_GROUP_USER_LIST);
NativeBridgeDelegate.updateContactInfo(); NativeBridgeDelegate.updateContactInfo();
//お気に入りグループ取得。 // お気に入りグループ表示
var favoriteGroupList = NativeBridgeDataSource.getFavoriteGroups(); ChatAddUser.appendFavoriteGroup();
// お気に入りユーザー表示
ChatAddUser.appendFavoriteUser();
// マイグループ表示
ChatAddUser.appendMyGroupList();
};
ChatAddUser.appendFavoriteGroup = function () {
// グループの様式を読み込む
const groupTemplate = getTemplate(TemplateURL.ADD_USER_GROUP_LIST);
// お気に入りグループ取得。
const favoriteGroupList = NativeBridgeDataSource.getFavoriteGroups();
favoriteGroupList.forEach(function (favoriteGroup) { favoriteGroupList.forEach(function (favoriteGroup) {
let html = Mustache.render(groupTemplate, { let html = Mustache.render(groupTemplate, {
name: favoriteGroup.groupName, name: favoriteGroup.groupName,
...@@ -188,8 +191,13 @@ CHAT_UI.refreshMyGroupForAddUser = function () { ...@@ -188,8 +191,13 @@ CHAT_UI.refreshMyGroupForAddUser = function () {
let obj = $(jQuery.parseHTML(html)).on("click", function () {}); let obj = $(jQuery.parseHTML(html)).on("click", function () {});
$("#favoriteListForMakeRoom").append(obj); $("#favoriteListForMakeRoom").append(obj);
}); });
};
ChatAddUser.appendFavoriteUser = function () {
// ユーザの様式を読み込む
const userTemplate = getTemplate(TemplateURL.ADD_USER_USER_LIST);
//お気に入りユーザ取得。 //お気に入りユーザ取得。
var favoriteUserList = NativeBridgeDataSource.getFavoriteUsersNotInRoom(); const favoriteUserList = NativeBridgeDataSource.getFavoriteUsersNotInRoom();
favoriteUserList.forEach(function (favoriteUser) { favoriteUserList.forEach(function (favoriteUser) {
favoriteUser.profileUrl = Common.getProfileImgUrl(favoriteUser.profileUrl); favoriteUser.profileUrl = Common.getProfileImgUrl(favoriteUser.profileUrl);
let findObj = ChatManagementCommon.selectedUserList.find(function ( let findObj = ChatManagementCommon.selectedUserList.find(function (
...@@ -206,8 +214,11 @@ CHAT_UI.refreshMyGroupForAddUser = function () { ...@@ -206,8 +214,11 @@ CHAT_UI.refreshMyGroupForAddUser = function () {
}); });
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$("#favoriteListForMakeRoom").append(obj); $("#favoriteListForMakeRoom").append(obj);
};
var myGroupList = NativeBridgeDataSource.getMyGroupUsersNotInRoom(); ChatAddUser.appendMyGroupList = function () {
const groupUserTemplate = getTemplate(TemplateURL.ADD_USER_GROUP_USER_LIST);
const myGroupList = NativeBridgeDataSource.getMyGroupUsersNotInRoom();
myGroupList.forEach(function (myGroup) { myGroupList.forEach(function (myGroup) {
myGroup.groupUserList.forEach(function (groupUser) { myGroup.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = Common.getProfileImgUrl(groupUser.profileUrl); groupUser.profileUrl = Common.getProfileImgUrl(groupUser.profileUrl);
...@@ -230,44 +241,40 @@ CHAT_UI.refreshMyGroupForAddUser = function () { ...@@ -230,44 +241,40 @@ CHAT_UI.refreshMyGroupForAddUser = function () {
}); });
}; };
CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) { ChatAddUser.refreshAllGroupForAddUser = function (paramGroupId) {
var groupId = paramGroupId;
$(".cancel").addClass("none"); $(".cancel").addClass("none");
$(".search_form input").removeClass("focus"); $(".search_form input").removeClass("focus");
$(".search_form input").val(""); $(".search_form input").val("");
$(".search_form form").removeClass(); $(".search_form form").removeClass();
$(".content").removeClass("none"); $(".content").removeClass("none");
$(".overlay_src_msg").empty(); $(".overlay_src_msg").empty();
$("#tabAllGroupOnAddUser").prop("checked", true); $("#tabAllGroupOnAddUser").prop("checked", true);
let groupId = paramGroupId;
//オンライン状態であればサーバから情報更新。 //オンライン状態であればサーバから情報更新。
NativeBridgeDelegate.updateGroupInfo(groupId); NativeBridgeDelegate.updateGroupInfo(groupId);
//画面エリアを初期化。 //画面エリアを初期化。
$("#parentGroupBtnForAddUser").off(); initialzScreen();
$("#rootGroupBtnForAddUser").off();
$("#childGroupListAreaForAddUser").html("");
$("#userInGroupListForAddUser").html("");
$("#groupPathAreaForAddUser").html("");
//DBからグループ情報を取得。 //DBからグループ情報を取得。
var result = NativeBridgeDataSource.getGroupInfoForAddUser(groupId); const result = NativeBridgeDataSource.getGroupInfoForAddUser(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。 //上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") { if (typeof result.parentGroupId !== "undefined") {
$("#parentGroupBtnForAddUser").on("click", function () { $("#parentGroupBtnForAddUser").on("click", function () {
CHAT_UI.refreshAllGroupForAddUser(result.parentGroupId); ChatAddUser.refreshAllGroupForAddUser(result.parentGroupId);
}); });
} }
if (typeof result.rootGroupId !== "undefined") { if (typeof result.rootGroupId !== "undefined") {
if (paramGroupId == 0) { if (paramGroupId == 0) {
groupId = result.rootGroupId; groupId = result.rootGroupId;
} }
$("#rootGroupBtnForAddUser").on("click", function () { $("#rootGroupBtnForAddUser").on("click", function () {
CHAT_UI.refreshAllGroupForAddUser(result.rootGroupId); ChatAddUser.refreshAllGroupForAddUser(result.rootGroupId);
}); });
} }
if (groupId == result.rootGroupId || paramGroupId == "0") { if (groupId == result.rootGroupId || paramGroupId == "0") {
$("#rootGroupArea").addClass("none"); $("#rootGroupArea").addClass("none");
$("#parentGroupArea").addClass("none"); $("#parentGroupArea").addClass("none");
...@@ -275,11 +282,30 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) { ...@@ -275,11 +282,30 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) {
$("#rootGroupArea").removeClass("none"); $("#rootGroupArea").removeClass("none");
$("#parentGroupArea").removeClass("none"); $("#parentGroupArea").removeClass("none");
} }
//該当グループのパースを表示。 //該当グループのパースを表示。
var groupPathTemplate = getTemplate(TemplateURL.ADD_USER_GROUP_PATH); appendGroupPath(result.groupPathList);
var groupPathCount = 0;
result.groupPathList.forEach(function (groupPath) { //該当グループの下位グループ表示。
if (!(groupPathCount < result.groupPathList.length - 3)) { appendGroupInGroup(result.childGroupList);
//該当グループの所属ユーザを表示。
appendUserInGroup(result.groupUserList);
};
var initialzScreen = function () {
$("#parentGroupBtnForAddUser").off();
$("#rootGroupBtnForAddUser").off();
$("#childGroupListAreaForAddUser").html("");
$("#userInGroupListForAddUser").html("");
$("#groupPathAreaForAddUser").html("");
};
var appendGroupPath = function (groupPathList) {
const groupPathTemplate = getTemplate(TemplateURL.ADD_USER_GROUP_PATH);
let groupPathCount = 0;
groupPathList.forEach(function (groupPath) {
if (!(groupPathCount < groupPathList.length - 3)) {
let html = Mustache.render(groupPathTemplate, { let html = Mustache.render(groupPathTemplate, {
name: groupPath.groupName, name: groupPath.groupName,
id: groupPath.groupId, id: groupPath.groupId,
...@@ -289,11 +315,12 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) { ...@@ -289,11 +315,12 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) {
} }
groupPathCount++; groupPathCount++;
}); });
};
//該当グループの下位グループ表示。 var appendGroupInGroup = function (childGroupList) {
var groupTemplate = getTemplate(TemplateURL.ADD_USER_GROUP_LIST); const groupTemplate = getTemplate(TemplateURL.ADD_USER_GROUP_LIST);
result.childGroupList.forEach(function (childGroup) { childGroupList.forEach(function (childGroup) {
let html = Mustache.render(groupTemplate, { let html = Mustache.render(groupTemplate, {
name: childGroup.groupName, name: childGroup.groupName,
id: childGroup.groupId, id: childGroup.groupId,
...@@ -302,10 +329,11 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) { ...@@ -302,10 +329,11 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) {
let obj = $(jQuery.parseHTML(html)).on("click", function () {}); let obj = $(jQuery.parseHTML(html)).on("click", function () {});
$("#childGroupListAreaForAddUser").append(obj); $("#childGroupListAreaForAddUser").append(obj);
}); });
};
//該当グループの所属ユーザを表示。 var appendUserInGroup = function (groupUserList) {
const userTemplate = getTemplate(TemplateURL.ADD_USER_USER_LIST); const userTemplate = getTemplate(TemplateURL.ADD_USER_USER_LIST);
result.groupUserList.forEach(function (groupUser) { groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = Common.getProfileImgUrl(groupUser.profileUrl); groupUser.profileUrl = Common.getProfileImgUrl(groupUser.profileUrl);
let findObj = ChatManagementCommon.selectedUserList.find(function ( let findObj = ChatManagementCommon.selectedUserList.find(function (
shopMemberId shopMemberId
...@@ -317,7 +345,7 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) { ...@@ -317,7 +345,7 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) {
} }
}); });
let html = Mustache.render(userTemplate, { let html = Mustache.render(userTemplate, {
userList: result.groupUserList, userList: groupUserList,
}); });
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$("#userInGroupListForAddUser").append(obj); $("#userInGroupListForAddUser").append(obj);
......
// 名前空間 // 名前空間
var CHAT_MAKE_ROOM = {}; var ChatMakeRoom = {};
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
// メンバー検索 // メンバー検索
...@@ -12,7 +12,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -12,7 +12,7 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
// メンバー検索 // メンバー検索
CHAT_MAKE_ROOM.searchUser = function (keyword) { ChatMakeRoom.searchUser = function (keyword) {
const overlayMessage = $(".overlay_src_msg"); const overlayMessage = $(".overlay_src_msg");
const isAllGroup = $("#tabAllGroupOnMakeRoom").is(":checked"); const isAllGroup = $("#tabAllGroupOnMakeRoom").is(":checked");
let hasNoData = false; let hasNoData = false;
...@@ -31,15 +31,15 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) { ...@@ -31,15 +31,15 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
}); });
//ユーザデータ検索 //ユーザデータ検索
var userList = NativeBridgeDataSource.getAllGroupShopMemberByName(keyword); const userList = NativeBridgeDataSource.getAllGroupShopMemberByName(keyword);
searchUserData(userList); searchUserData(userList);
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST); var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList); let html = renderUser(userTemplate, userList);
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
overlayMessage.append(obj); overlayMessage.append(obj);
hasNoData = groupList.length == 0 && userList.length == 0; hasNoData = groupList.length == 0 && userList.length == 0;
//連絡先画面 } else { // 連絡先画面
} else {
const userList = NativeBridgeDataSource.getMyGroupShopMemberByName(keyword); const userList = NativeBridgeDataSource.getMyGroupShopMemberByName(keyword);
searchUserData(userList); searchUserData(userList);
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST); var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
...@@ -79,7 +79,7 @@ var searchMember = function () { ...@@ -79,7 +79,7 @@ var searchMember = function () {
$(".overlay_src_msg").empty(); $(".overlay_src_msg").empty();
return false; return false;
} }
CHAT_MAKE_ROOM.searchUser(keyword); ChatMakeRoom.searchUser(keyword);
if (enterKeyPressed) { if (enterKeyPressed) {
searchInput.blur(); searchInput.blur();
return; return;
...@@ -92,7 +92,7 @@ var bindiOSKeyBoardEvent = function () { ...@@ -92,7 +92,7 @@ var bindiOSKeyBoardEvent = function () {
searchInput.on("compositionend", function () { searchInput.on("compositionend", function () {
if (deviceInfo.isiOS()) { if (deviceInfo.isiOS()) {
var keyword = searchInput.val(); var keyword = searchInput.val();
CHAT_MAKE_ROOM.searchUser(keyword); ChatMakeRoom.searchUser(keyword);
} }
}); });
}; };
...@@ -139,14 +139,14 @@ $("#makeRoomConfirmBtn").on("click", function (e) { ...@@ -139,14 +139,14 @@ $("#makeRoomConfirmBtn").on("click", function (e) {
}); });
$("#tabAllGroupOnMakeRoom").on("click", function (e) { $("#tabAllGroupOnMakeRoom").on("click", function (e) {
ChatManagementCommon.refreshAllGroupForMakeRoom("0"); ChatMakeRoom.refreshAllGroupForMakeRoom("0");
}); });
$("#tabMyGroupOnMakeRoom").on("click", function (e) { $("#tabMyGroupOnMakeRoom").on("click", function (e) {
CHAT_UI.refreshMyGroupForMakeRoom(); ChatMakeRoom.refreshMyGroupForMakeRoom();
}); });
CHAT_UI.refreshMyGroupForMakeRoom = function () { ChatMakeRoom.refreshMyGroupForMakeRoom = function () {
$(".modal-backdrop").remove(); $(".modal-backdrop").remove();
$("#favoriteListForMakeRoom").html(""); $("#favoriteListForMakeRoom").html("");
$("#myGroupListForMakeRoom").html(""); $("#myGroupListForMakeRoom").html("");
...@@ -216,3 +216,99 @@ CHAT_UI.refreshMyGroupForMakeRoom = function () { ...@@ -216,3 +216,99 @@ CHAT_UI.refreshMyGroupForMakeRoom = function () {
$("#myGroupListForMakeRoom").append(obj); $("#myGroupListForMakeRoom").append(obj);
}); });
}; };
ChatMakeRoom.refreshAllGroupForMakeRoom = function (paramGroupId) {
var groupId = paramGroupId;
$(".cancel").addClass("none");
$(".search_form input").removeClass("focus");
$(".search_form input").val("");
$(".search_form form").removeClass();
$(".content").removeClass("none");
$(".overlay_src_msg").empty();
$("#tabAllGroupOnMakeRoom").prop("checked", true);
//オンライン状態であればサーバから情報更新。
NativeBridgeDelegate.updateGroupInfo(groupId);
//画面エリアを初期化。
$("#parentGroupBtnForMakeRoom").off();
$("#rootGroupBtnForMakeRoom").off();
$("#childGroupListAreaForMakeRoom").html("");
$("#userInGroupListForMakeRoom").html("");
$("#groupPathAreaForMakeRoom").html("");
//DBからグループ情報を取得。
var result = NativeBridgeDataSource.getGroupInfo(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") {
$("#parentGroupBtnForMakeRoom").on("click", function () {
ChatMakeRoom.refreshAllGroupForMakeRoom(result.parentGroupId);
});
}
if (typeof result.rootGroupId !== "undefined") {
if (paramGroupId == 0) {
groupId = result.rootGroupId;
}
$("#rootGroupBtnForMakeRoom").on("click", function () {
ChatMakeRoom.refreshAllGroupForMakeRoom(result.rootGroupId);
});
}
if (groupId == result.rootGroupId || paramGroupId == "0") {
$("#rootGroupArea").addClass("none");
$("#parentGroupArea").addClass("none");
} else {
$("#rootGroupArea").removeClass("none");
$("#parentGroupArea").removeClass("none");
}
//該当グループのパースを表示。
var groupPathTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_PATH);
var groupPathCount = 0;
result.groupPathList.forEach(function (groupPath) {
if (!(groupPathCount < result.groupPathList.length - 3)) {
let html = Mustache.render(groupPathTemplate, {
name: groupPath.groupName,
id: groupPath.groupId,
});
let obj = jQuery.parseHTML(html);
$("#groupPathAreaForMakeRoom").append(obj);
}
groupPathCount++;
});
//該当グループの下位グループ表示。
var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
result.childGroupList.forEach(function (childGroup) {
let html = Mustache.render(groupTemplate, {
name: childGroup.groupName,
id: childGroup.groupId,
});
let obj = $(jQuery.parseHTML(html)).on("click", function () {});
$("#childGroupListAreaForMakeRoom").append(obj);
});
//該当グループの所属ユーザを表示。
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
result.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = Common.getProfileImgUrl(groupUser.profileUrl);
let findObj = ChatManagementCommon.selectedUserList.find(function (
shopMemberId
) {
return shopMemberId == groupUser.shopMemberId;
});
if (findObj) {
groupUser.checked = "checked";
}
});
let html = Mustache.render(userTemplate, {
userList: result.groupUserList,
});
let obj = jQuery.parseHTML(html);
$("#userInGroupListForMakeRoom").append(obj);
};
\ No newline at end of file
...@@ -155,101 +155,6 @@ ChatManagementCommon.showAddUserConfirmView = function () { ...@@ -155,101 +155,6 @@ ChatManagementCommon.showAddUserConfirmView = function () {
}); });
}; };
ChatManagementCommon.refreshAllGroupForMakeRoom = function (paramGroupId) {
var groupId = paramGroupId;
$(".cancel").addClass("none");
$(".search_form input").removeClass("focus");
$(".search_form input").val("");
$(".search_form form").removeClass();
$(".content").removeClass("none");
$(".overlay_src_msg").empty();
$("#tabAllGroupOnMakeRoom").prop("checked", true);
//オンライン状態であればサーバから情報更新。
NativeBridgeDelegate.updateGroupInfo(groupId);
//画面エリアを初期化。
$("#parentGroupBtnForMakeRoom").off();
$("#rootGroupBtnForMakeRoom").off();
$("#childGroupListAreaForMakeRoom").html("");
$("#userInGroupListForMakeRoom").html("");
$("#groupPathAreaForMakeRoom").html("");
//DBからグループ情報を取得。
var result = NativeBridgeDataSource.getGroupInfo(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") {
$("#parentGroupBtnForMakeRoom").on("click", function () {
ChatManagementCommon.refreshAllGroupForMakeRoom(result.parentGroupId);
});
}
if (typeof result.rootGroupId !== "undefined") {
if (paramGroupId == 0) {
groupId = result.rootGroupId;
}
$("#rootGroupBtnForMakeRoom").on("click", function () {
CHAChatManagementCommon_UI.refreshAllGroupForMakeRoom(result.rootGroupId);
});
}
if (groupId == result.rootGroupId || paramGroupId == "0") {
$("#rootGroupArea").addClass("none");
$("#parentGroupArea").addClass("none");
} else {
$("#rootGroupArea").removeClass("none");
$("#parentGroupArea").removeClass("none");
}
//該当グループのパースを表示。
var groupPathTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_PATH);
var groupPathCount = 0;
result.groupPathList.forEach(function (groupPath) {
if (!(groupPathCount < result.groupPathList.length - 3)) {
let html = Mustache.render(groupPathTemplate, {
name: groupPath.groupName,
id: groupPath.groupId,
});
let obj = jQuery.parseHTML(html);
$("#groupPathAreaForMakeRoom").append(obj);
}
groupPathCount++;
});
//該当グループの下位グループ表示。
var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
result.childGroupList.forEach(function (childGroup) {
let html = Mustache.render(groupTemplate, {
name: childGroup.groupName,
id: childGroup.groupId,
});
let obj = $(jQuery.parseHTML(html)).on("click", function () {});
$("#childGroupListAreaForMakeRoom").append(obj);
});
//該当グループの所属ユーザを表示。
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
result.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = Common.getProfileImgUrl(groupUser.profileUrl);
let findObj = ChatManagementCommon.selectedUserList.find(function (
shopMemberId
) {
return shopMemberId == groupUser.shopMemberId;
});
if (findObj) {
groupUser.checked = "checked";
}
});
let html = Mustache.render(userTemplate, {
userList: result.groupUserList,
});
let obj = jQuery.parseHTML(html);
$("#userInGroupListForMakeRoom").append(obj);
};
ChatManagementCommon.checkForMakeChat = function (checkMemberId) { ChatManagementCommon.checkForMakeChat = function (checkMemberId) {
let findObj = ChatManagementCommon.selectedUserList.find(function ( let findObj = ChatManagementCommon.selectedUserList.find(function (
shopMemberId shopMemberId
......
var CollaborationUI = {};
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
no_scroll(); disableScroll();
// メニューオーバーレイ表示 // メニューオーバーレイ表示
$(".menu_btn").click(function () { $(".menu_btn").click(function () {
...@@ -19,17 +21,17 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -19,17 +21,17 @@ document.addEventListener("DOMContentLoaded", function () {
.css({ transform: "translateX(" & -w & ")" }); .css({ transform: "translateX(" & -w & ")" });
if ($(this).hasClass("hide")) { if ($(this).hasClass("hide")) {
return_scroll(); enableScroll();
} else { } else {
scrollTo(0, 0); scrollTo(0, 0);
no_scroll(); disableScroll();
} }
}); });
// モーダルonモーダル(前のモーダルを非表示に) // モーダルonモーダル(前のモーダルを非表示に)
// ホスト変更ボタン押下イベント // ホスト変更ボタン押下イベント
$(".ch_host_btn").click(function () { $(".ch_host_btn").click(function () {
var target = $(this).val(); const target = $(this).val();
changeModal(target, "changeHostModal"); changeModal(target, "changeHostModal");
}); });
...@@ -42,7 +44,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -42,7 +44,7 @@ document.addEventListener("DOMContentLoaded", function () {
// 閉じるイベント // 閉じるイベント
$(".close_btn").click(function () { $(".close_btn").click(function () {
$("#overlay_add_user_list").addClass("none"); $("#overlay_add_user_list").addClass("none");
no_scroll(); disableScroll();
}); });
// ユーザー追加イベント // ユーザー追加イベント
...@@ -52,10 +54,10 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -52,10 +54,10 @@ document.addEventListener("DOMContentLoaded", function () {
// ユーザー招待メンバー検索 // ユーザー招待メンバー検索
$(".add_user_btn").click(function () { $(".add_user_btn").click(function () {
return_scroll(); enableScroll();
Common.showLoadingIndicator(); Common.showLoadingIndicator();
ChatManagementCommon.selectedUserList = []; ChatManagementCommon.selectedUserList = [];
CHAT_UI.refreshMyGroupForAddUserInCollaboration(); CollaborationUI.refreshMyGroupForAddUserInCollaboration();
$("#addUserConfirmBtnInCollaboration") $("#addUserConfirmBtnInCollaboration")
.off() .off()
.on("click", function () { .on("click", function () {
...@@ -63,7 +65,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -63,7 +65,7 @@ document.addEventListener("DOMContentLoaded", function () {
const selectedUserList = const selectedUserList =
ChatManagementCommon.selectedUserList.join(","); ChatManagementCommon.selectedUserList.join(",");
NativeBridgeDelegate.saveSelectedUserList(selectedUserList); NativeBridgeDelegate.saveSelectedUserList(selectedUserList);
CHAT_UI.confirmInviteUserListInCollaboration(); CollaborationUI.confirmInviteUserListInCollaboration();
}); });
}); });
}); });
...@@ -75,12 +77,12 @@ function penOff() { ...@@ -75,12 +77,12 @@ function penOff() {
} }
} }
function no_scroll() { function disableScroll() {
document.addEventListener("mousewheel", scroll_control, { passive: false }); document.addEventListener("mousewheel", scroll_control, { passive: false });
document.addEventListener("touchmove", scroll_control, { passive: false }); document.addEventListener("touchmove", scroll_control, { passive: false });
} }
// スクロール禁止解除 // スクロール禁止解除
function return_scroll() { function enableScroll() {
document.removeEventListener("mousewheel", scroll_control, { document.removeEventListener("mousewheel", scroll_control, {
passive: false, passive: false,
}); });
...@@ -92,13 +94,12 @@ function scroll_control(event) { ...@@ -92,13 +94,12 @@ function scroll_control(event) {
} }
} }
CHAT_UI.confirmInviteUserListInCollaboration = function () { CollaborationUI.confirmInviteUserListInCollaboration = function () {
var selectedUsers = NativeBridgeDataSource.loadSelectedUsers(); const selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") { if (selectedUsers != "") {
$("#selectedUserListinCollaboration").html(""); $("#selectedUserListinCollaboration").html("");
var selectedUserList = NativeBridgeDataSource.loadSelectedUsers(); selectedUsers.forEach(function (user) {
selectedUserList.forEach(function (user) {
user.profileUrl = Common.getProfileImgUrl(user.profileUrl); user.profileUrl = Common.getProfileImgUrl(user.profileUrl);
}); });
...@@ -110,13 +111,13 @@ CHAT_UI.confirmInviteUserListInCollaboration = function () { ...@@ -110,13 +111,13 @@ CHAT_UI.confirmInviteUserListInCollaboration = function () {
} }
); );
let html = Mustache.render(modalTemplate, { let html = Mustache.render(modalTemplate, {
userList: selectedUserList, userList: selectedUsers,
}); });
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$("#modal_add_user_confirm").html(obj); $("#modal_add_user_confirm").html(obj);
$("#modalAddUserConfirm").modal("show"); $("#modalAddUserConfirm").modal("show");
} else {
} }
$("#cancelAddUserBtn") $("#cancelAddUserBtn")
.off() .off()
.on("click", function () { .on("click", function () {
...@@ -129,11 +130,11 @@ CHAT_UI.confirmInviteUserListInCollaboration = function () { ...@@ -129,11 +130,11 @@ CHAT_UI.confirmInviteUserListInCollaboration = function () {
.off() .off()
.on("click", function () { .on("click", function () {
Common.showLoadingIndicator(); Common.showLoadingIndicator();
let userIdList = new Array(); let userIDList = selectedUsers.map((user) => user.shopMemberId);
selectedUserList.forEach(function (user) { selectedUsers.forEach(function (user) {
userIdList.push(user.shopMemberId); userIDList.push(user.shopMemberId);
}); });
const commaJoinedUserIDList = userIdList.join(","); const commaJoinedUserIDList = userIDList.join(",");
const collaborationType = CHAT_UTIL.getCollaborationType( const collaborationType = CHAT_UTIL.getCollaborationType(
globalUserInfo.coWorkType globalUserInfo.coWorkType
); );
...@@ -149,18 +150,16 @@ CHAT_UI.confirmInviteUserListInCollaboration = function () { ...@@ -149,18 +150,16 @@ CHAT_UI.confirmInviteUserListInCollaboration = function () {
}; };
$("#tabMyGroupOnAddUserInCollaboration").on("click", function (e) { $("#tabMyGroupOnAddUserInCollaboration").on("click", function (e) {
CHAT_UI.refreshMyGroupForAddUserInCollaboration(); CollaborationUI.refreshMyGroupForAddUserInCollaboration();
}); });
$("#tabAllGroupOnAddUserInCollaboration").on("click", function (e) { $("#tabAllGroupOnAddUserInCollaboration").on("click", function (e) {
CHAT_UI.refreshAllGroupForAddUserInCollaboration("0"); CollaborationUI.refreshAllGroupForAddUserInCollaboration("0");
}); });
CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () { CollaborationUI.refreshMyGroupForAddUserInCollaboration = function () {
if (ChatManagementCommon.selectedUserList.length > 0) { if (ChatManagementCommon.selectedUserList.length > 0) {
$(".select_member_num").text( $(".select_member_num").text(ChatManagementCommon.selectedUserList.length);
ChatManagementCommon.selectedUserList.length
);
} else { } else {
$(".select_member_num").text("0"); $(".select_member_num").text("0");
} }
...@@ -240,7 +239,9 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () { ...@@ -240,7 +239,9 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
}; };
CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) { CollaborationUI.refreshAllGroupForAddUserInCollaboration = function (
paramGroupId
) {
var groupId = paramGroupId; var groupId = paramGroupId;
$(".content").removeClass("none"); $(".content").removeClass("none");
...@@ -260,7 +261,9 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) { ...@@ -260,7 +261,9 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) {
//上位グループ、トップグループ遷移ボタンのイベント追加。 //上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") { if (typeof result.parentGroupId !== "undefined") {
$("#parentGroupBtnForAddUserInCollaboration").on("click", function () { $("#parentGroupBtnForAddUserInCollaboration").on("click", function () {
CHAT_UI.refreshAllGroupForAddUserInCollaboration(result.parentGroupId); CollaborationUI.refreshAllGroupForAddUserInCollaboration(
result.parentGroupId
);
}); });
} }
if (typeof result.rootGroupId !== "undefined") { if (typeof result.rootGroupId !== "undefined") {
...@@ -268,7 +271,9 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) { ...@@ -268,7 +271,9 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) {
groupId = result.rootGroupId; groupId = result.rootGroupId;
} }
$("#rootGroupBtnForAddUserInCollaboration").on("click", function () { $("#rootGroupBtnForAddUserInCollaboration").on("click", function () {
CHAT_UI.refreshAllGroupForAddUserInCollaboration(result.rootGroupId); CollaborationUI.refreshAllGroupForAddUserInCollaboration(
result.rootGroupId
);
}); });
} }
if (groupId == result.rootGroupId || paramGroupId == "0") { if (groupId == result.rootGroupId || paramGroupId == "0") {
...@@ -334,7 +339,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) { ...@@ -334,7 +339,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) {
$("#userInGroupListForAddUserInCollaboration").append(obj); $("#userInGroupListForAddUserInCollaboration").append(obj);
}; };
CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) { Namecard.makeNameCardInCollaboration = function (shopMemberId) {
if (currentUserInfo.shopMemberId == shopMemberId) { if (currentUserInfo.shopMemberId == shopMemberId) {
return; return;
} }
...@@ -371,20 +376,20 @@ CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) { ...@@ -371,20 +376,20 @@ CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) {
$("#userNameCardInCollaboration").modal("show"); $("#userNameCardInCollaboration").modal("show");
}; };
CHAT_UI.removeFavoriteUserInCollaboration = function (shopMemberId) { CollaborationUI.removeFavoriteUserInCollaboration = function (shopMemberId) {
Common.showLoadingIndicator(); Common.showLoadingIndicator();
$("#userNameCardInCollaboration").modal("hide"); $("#userNameCardInCollaboration").modal("hide");
NativeBridgeDataSource.removeFavoriteUser(shopMemberId); NativeBridgeDataSource.removeFavoriteUser(shopMemberId);
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
}; };
CHAT_UI.insertFavoriteUserInCollaboration = function (shopMemberId) { CollaborationUI.insertFavoriteUserInCollaboration = function (shopMemberId) {
$("#userNameCardInCollaboration").modal("hide"); $("#userNameCardInCollaboration").modal("hide");
NativeBridgeDataSource.addFavoriteUser(shopMemberId); NativeBridgeDataSource.addFavoriteUser(shopMemberId);
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
}; };
CHAT_UI.refreshJoinedCollaboration = function (loginIdList) { CollaborationUI.refreshJoinedCollaboration = function (loginIdList) {
for (var count = 0; count < loginIdList.length; count++) { for (var count = 0; count < loginIdList.length; count++) {
loginIdList[count] = loginIdList[count].replaceAll( loginIdList[count] = loginIdList[count].replaceAll(
globalUserInfo.shopName + "_", globalUserInfo.shopName + "_",
...@@ -428,12 +433,12 @@ CHAT_UI.refreshJoinedCollaboration = function (loginIdList) { ...@@ -428,12 +433,12 @@ CHAT_UI.refreshJoinedCollaboration = function (loginIdList) {
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
}; };
CHAT_UI.toggleCategory = function (category) { CollaborationUI.toggleCategory = function (category) {
$(category).toggleClass("open"); $(category).toggleClass("open");
$(category).next().slideToggle(); $(category).next().slideToggle();
}; };
CHAT_UI.refreshForOffline = function () { CollaborationUI.refreshForOffline = function () {
serverInfo.isOnline = "false"; serverInfo.isOnline = "false";
if (typeof coview_api == "undefined") { if (typeof coview_api == "undefined") {
return; return;
......
...@@ -449,8 +449,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -449,8 +449,7 @@ document.addEventListener("DOMContentLoaded", function () {
CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType); CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType);
} }
CHAT_SOCKET.emitCreateMessage(coviewInviteMessage, 0); CHAT_SOCKET.emitCreateMessage(coviewInviteMessage, 0);
} else { }
}
break; break;
case "joinRoomInfoResponse": case "joinRoomInfoResponse":
if (json.resultCode == 200) { if (json.resultCode == 200) {
...@@ -468,7 +467,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -468,7 +467,7 @@ document.addEventListener("DOMContentLoaded", function () {
for (let key in g_participants) { for (let key in g_participants) {
loginIdList.push(key); loginIdList.push(key);
} }
CHAT_UI.refreshJoinedCollaboration(loginIdList); CollaborationUI.refreshJoinedCollaboration(loginIdList);
} else { } else {
} }
break; break;
...@@ -476,13 +475,13 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -476,13 +475,13 @@ document.addEventListener("DOMContentLoaded", function () {
for (let key in g_participants) { for (let key in g_participants) {
loginIdList.push(key); loginIdList.push(key);
} }
CHAT_UI.refreshJoinedCollaboration(loginIdList); CollaborationUI.refreshJoinedCollaboration(loginIdList);
break; break;
case "RoomMemberLeavedEvent": case "RoomMemberLeavedEvent":
for (let key in g_participants) { for (let key in g_participants) {
loginIdList.push(key); loginIdList.push(key);
} }
CHAT_UI.refreshJoinedCollaboration(loginIdList); CollaborationUI.refreshJoinedCollaboration(loginIdList);
break; break;
case "HostRequest": case "HostRequest":
// to be called by // to be called by
...@@ -625,22 +624,18 @@ async function initCollaborationUI(changeCollaborationType) { ...@@ -625,22 +624,18 @@ async function initCollaborationUI(changeCollaborationType) {
$(".collaboration_contents").addClass("none"); $(".collaboration_contents").addClass("none");
$(".voice_contents").removeClass("none"); $(".voice_contents").removeClass("none");
break; break;
case COLLABORATION_TYPE.CAMERA: case COLLABORATION_TYPE.CAMERA:
$(".collaboration_contents").addClass("none"); $(".collaboration_contents").addClass("none");
$(".picture_contents").removeClass("none"); $(".picture_contents").removeClass("none");
break; break;
case COLLABORATION_TYPE.VIDEO: case COLLABORATION_TYPE.VIDEO:
$(".collaboration_contents").addClass("none"); $(".collaboration_contents").addClass("none");
$(".video_contents").removeClass("none"); $(".video_contents").removeClass("none");
break; break;
case COLLABORATION_TYPE.DOCUMENT: case COLLABORATION_TYPE.DOCUMENT:
$(".collaboration_contents").addClass("none"); $(".collaboration_contents").addClass("none");
$(".document_contents").removeClass("none"); $(".document_contents").removeClass("none");
break; break;
case COLLABORATION_TYPE.BOARD: case COLLABORATION_TYPE.BOARD:
$(".collaboration_contents").addClass("none"); $(".collaboration_contents").addClass("none");
$(".board_contents").removeClass("none"); $(".board_contents").removeClass("none");
...@@ -690,7 +685,7 @@ function Coview_changeHost(userId) { ...@@ -690,7 +685,7 @@ function Coview_changeHost(userId) {
function Coview_addLoginId(loginId) { function Coview_addLoginId(loginId) {
console.log("addUser loginId = " + loginId); console.log("addUser loginId = " + loginId);
var url = "https://biztaskyell.abookcloud.com/auth/getuser"; const url = "https://biztaskyell.abookcloud.com/auth/getuser";
$.ajax({ $.ajax({
url: url, url: url,
method: "post", method: "post",
...@@ -819,8 +814,8 @@ function captureAndShareImage(urls, changeHostName) { ...@@ -819,8 +814,8 @@ function captureAndShareImage(urls, changeHostName) {
addCaptureEffect(); addCaptureEffect();
$(this).removeClass("on"); $(this).removeClass("on");
var w, h; var w, h;
var video = document.getElementById("localVideo"); const video = document.getElementById("localVideo");
var canvas = document.createElement("canvas"); const canvas = document.createElement("canvas");
if (clientOrientaionState == 1) { if (clientOrientaionState == 1) {
canvas.width = w = 680; canvas.width = w = 680;
canvas.height = h = 515; canvas.height = h = 515;
...@@ -829,10 +824,11 @@ function captureAndShareImage(urls, changeHostName) { ...@@ -829,10 +824,11 @@ function captureAndShareImage(urls, changeHostName) {
canvas.height = h = 515; canvas.height = h = 515;
} }
if (canvas.getContext) { if (canvas.getContext) {
var ctx = canvas.getContext("2d"); const ctx = canvas.getContext("2d");
ctx.drawImage(video, 0, 0, w, h); ctx.drawImage(video, 0, 0, w, h);
ctx.drawImage(document.getElementById("canvasRemote"), 0, 0, w, h); ctx.drawImage(document.getElementById("canvasRemote"), 0, 0, w, h);
} }
canvas.toBlob(function (blob) { canvas.toBlob(function (blob) {
var newImg = document.createElement("img"); var newImg = document.createElement("img");
var url = URL.createObjectURL(blob); var url = URL.createObjectURL(blob);
...@@ -915,14 +911,6 @@ function captureAndShareImage(urls, changeHostName) { ...@@ -915,14 +911,6 @@ function captureAndShareImage(urls, changeHostName) {
}); });
} }
function toolToggle() {
if ($("#collabo_footer_menu").hasClass("hide")) {
$("#collabo_footer_menu").removeClass("hide");
} else {
$("#collabo_footer_menu").addClass("hide");
}
}
function micOn() { function micOn() {
coview_api.MicMuteControl("off"); coview_api.MicMuteControl("off");
$("#micBtn .voice").removeClass("disable"); $("#micBtn .voice").removeClass("disable");
...@@ -933,7 +921,7 @@ function micOff() { ...@@ -933,7 +921,7 @@ function micOff() {
$("#micBtn .voice").addClass("disable"); $("#micBtn .voice").addClass("disable");
} }
function micTogle() { function toggleMic() {
if ($("#micBtn .voice").hasClass("disable")) { if ($("#micBtn .voice").hasClass("disable")) {
micOn(); micOn();
} else { } else {
...@@ -955,7 +943,7 @@ function recordFinished() { ...@@ -955,7 +943,7 @@ function recordFinished() {
delete_dom_obj("screenLock"); delete_dom_obj("screenLock");
} }
function recordTogle() { function toggleRecord() {
if (!$("#recordBtn .record").hasClass("disable")) { if (!$("#recordBtn .record").hasClass("disable")) {
recordStart(); recordStart();
} else { } else {
...@@ -975,14 +963,14 @@ function recordStop(callback) { ...@@ -975,14 +963,14 @@ function recordStop(callback) {
screenLock(); screenLock();
// アーカイブ保存処理 // アーカイブ保存処理
MainManRecordWithCollaboration( mainManRecordWithCollaboration(
"stop", "stop",
serverInfo.cmsURL + "/chatapi/file/uploadArchive", serverInfo.cmsURL + "/chatapi/file/uploadArchive",
callback callback
); );
} }
function MainManRecordWithCollaboration(action, url, callback) { function mainManRecordWithCollaboration(action, url, callback) {
try { try {
mediaRecorder.stop(); mediaRecorder.stop();
} catch (exeption) { } catch (exeption) {
...@@ -995,7 +983,7 @@ function MainManRecordWithCollaboration(action, url, callback) { ...@@ -995,7 +983,7 @@ function MainManRecordWithCollaboration(action, url, callback) {
console.log("Recoding File upload.."); console.log("Recoding File upload..");
const blob = new Blob(recordedBlobs, { type: "video/webm" }); const blob = new Blob(recordedBlobs, { type: "video/webm" });
console.log(blob); console.log(blob);
var uploadFileName = "record_" + g_webroom + "_" + g_shareCount + ".webm"; const uploadFileName = "record_" + g_webroom + "_" + g_shareCount + ".webm";
g_shareCount++; g_shareCount++;
var formData = new FormData(); var formData = new FormData();
formData.append("fileData", blob, uploadFileName); formData.append("fileData", blob, uploadFileName);
...@@ -1031,7 +1019,7 @@ function MainManRecordWithCollaboration(action, url, callback) { ...@@ -1031,7 +1019,7 @@ function MainManRecordWithCollaboration(action, url, callback) {
function screenLock() { function screenLock() {
// ロック用のdivを生成 // ロック用のdivを生成
var element = document.createElement("div"); const element = document.createElement("div");
element.id = "screenLock"; element.id = "screenLock";
// ロック用のスタイル // ロック用のスタイル
...@@ -1043,14 +1031,14 @@ function screenLock() { ...@@ -1043,14 +1031,14 @@ function screenLock() {
element.style.zIndex = "9999"; element.style.zIndex = "9999";
element.style.opacity = "0"; element.style.opacity = "0";
var objBody = document.getElementsByTagName("body").item(0); const objBody = document.getElementsByTagName("body").item(0);
objBody.appendChild(element); objBody.appendChild(element);
} }
// div削除関数 // div削除関数
function delete_dom_obj(id_name) { function delete_dom_obj(id_name) {
var dom_obj = document.getElementById(id_name); const dom_obj = document.getElementById(id_name);
var dom_obj_parent = dom_obj.parentNode; const dom_obj_parent = dom_obj.parentNode;
dom_obj_parent.removeChild(dom_obj); dom_obj_parent.removeChild(dom_obj);
} }
...@@ -1073,13 +1061,16 @@ function penToggle() { ...@@ -1073,13 +1061,16 @@ function penToggle() {
$("#penBtn .pen").addClass("disable"); $("#penBtn .pen").addClass("disable");
} }
} }
function photo_open_place_holderToggle() { function photo_open_place_holderToggle() {
$("#open_file_upload").trigger("click"); $("#open_file_upload").trigger("click");
} }
function eraserToggle() {
function toggleEraser() {
$("#coviewEraserCtrBtn").click(); $("#coviewEraserCtrBtn").click();
} }
function captureToggle() {
function toggleCapture() {
if ($("#recordBtn").hasClass("bg_red")) { if ($("#recordBtn").hasClass("bg_red")) {
screenLock(); screenLock();
recordStop(function () { recordStop(function () {
...@@ -1090,7 +1081,8 @@ function captureToggle() { ...@@ -1090,7 +1081,8 @@ function captureToggle() {
coview_api.Capture(serverInfo.cmsURL + "/chatapi/file/uploadArchive"); coview_api.Capture(serverInfo.cmsURL + "/chatapi/file/uploadArchive");
} }
} }
function captureRequestToggle() {
function toggleCaptureRequest() {
fw.sendToMsg("others", "CAPTURE_REQUEST", { fw.sendToMsg("others", "CAPTURE_REQUEST", {
name: currentUserInfo.loginId, name: currentUserInfo.loginId,
}); });
......
var Namecard = {}; var Namecard = {};
// archive_detail.html Namecard.makeNameCard = function (shopMemberId) {
// collaboration_overlay_user_list.html
// >> collaboration.js
// archive.js
// collaboration.js
// template_chatroom_user_list.html (CHATROOM_USER_LIST)
// >> chat-room.js
// template_group_user_list.html (GROUP_USER_LIST)
// >> contact.js
// template_user_list.html
// >> chat-room.js, contact.js
// template_user_message.html
// >> chat-websocket-message.js
// >> chat-room.js
CHAT_UI.makeNameCard = function (shopMemberId) {
if (currentUserInfo.shopMemberId == shopMemberId) { if (currentUserInfo.shopMemberId == shopMemberId) {
return; return;
} }
var nameCardInfo = NativeBridgeDataSource.getNameCardData(shopMemberId); const nameCardInfo = NativeBridgeDataSource.getNameCardData(shopMemberId);
var 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);
let namecardHtml = Mustache.render(namecardTemplate, { let namecardHTML = Mustache.render(namecardTemplate, {
shopMemberId: nameCardInfo.shopMemberId, shopMemberId: nameCardInfo.shopMemberId,
profileUrl: nameCardInfo.profileUrl, profileUrl: nameCardInfo.profileUrl,
name: nameCardInfo.shopMemberName, name: nameCardInfo.shopMemberName,
...@@ -33,7 +19,7 @@ CHAT_UI.makeNameCard = function (shopMemberId) { ...@@ -33,7 +19,7 @@ CHAT_UI.makeNameCard = function (shopMemberId) {
isFavorite: nameCardInfo.isFavorite, isFavorite: nameCardInfo.isFavorite,
}); });
let namecardObj = $(jQuery.parseHTML(namecardHtml)).on( let namecardObj = $(jQuery.parseHTML(namecardHTML)).on(
"click", "click",
function () {} function () {}
); );
...@@ -43,7 +29,7 @@ CHAT_UI.makeNameCard = function (shopMemberId) { ...@@ -43,7 +29,7 @@ CHAT_UI.makeNameCard = function (shopMemberId) {
}; };
// template_user_name_card.html // template_user_name_card.html
CHAT_UI.startChat = function (userShopMemberId, userName) { Namecard.startChat = function (userShopMemberId, userName) {
Common.showLoadingIndicator(); Common.showLoadingIndicator();
var userIdList = []; var userIdList = [];
userIdList.push(userShopMemberId); userIdList.push(userShopMemberId);
...@@ -60,16 +46,16 @@ CHAT_UI.startChat = function (userShopMemberId, userName) { ...@@ -60,16 +46,16 @@ CHAT_UI.startChat = function (userShopMemberId, userName) {
}; };
// template_user_name_card.html // template_user_name_card.html
CHAT_UI.startVoice = function (userShopMemberId, userName) { Namecard.startVoice = function (userShopMemberId, userName) {
Common.showLoadingIndicator(); Common.showLoadingIndicator();
var 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(","),
newRoomName, newRoomName,
MakeRoomFlag.NAME_CARD, MakeRoomFlag.NAME_CARD,
true true
...@@ -80,18 +66,18 @@ CHAT_UI.startVoice = function (userShopMemberId, userName) { ...@@ -80,18 +66,18 @@ CHAT_UI.startVoice = function (userShopMemberId, userName) {
// >> chat-room.js // >> chat-room.js
// >> contact.js // >> contact.js
// template_user_list.html // template_user_list.html
CHAT_UI.favoriteUserChange = function (shopMemberId, star) { Namecard.favoriteUserChange = function (shopMemberId, star) {
if ($(star).hasClass("active")) { if ($(star).hasClass("active")) {
CHAT_UI.removeFavoriteUser(shopMemberId); Namecard.removeFavoriteUser(shopMemberId);
} else if ($(star).hasClass("disable")) { } else if ($(star).hasClass("disable")) {
CHAT_UI.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
CHAT_UI.removeFavoriteUser = function (shopMemberId) { Namecard.removeFavoriteUser = function (shopMemberId) {
Common.showLoadingIndicator(); Common.showLoadingIndicator();
$("#userNameCard").modal("hide"); $("#userNameCard").modal("hide");
$("#myNameCard").modal("hide"); $("#myNameCard").modal("hide");
...@@ -106,10 +92,9 @@ CHAT_UI.removeFavoriteUser = function (shopMemberId) { ...@@ -106,10 +92,9 @@ CHAT_UI.removeFavoriteUser = function (shopMemberId) {
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
}; };
// modal_collabo_profile.html // template_user_name_card.html (USER_NAME_CARD)
// collaboration.js // >> Namecard.makeNameCard()
// template_user_name_card.html Namecard.insertFavoriteUser = function (shopMemberId) {
CHAT_UI.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);
...@@ -123,114 +108,10 @@ CHAT_UI.insertFavoriteUser = function (shopMemberId) { ...@@ -123,114 +108,10 @@ CHAT_UI.insertFavoriteUser = function (shopMemberId) {
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
}; };
Namecard.refreshForOnline = function () {
// contact.html
// contact.js
// template_group_list.html (GROUP_LIST)
// >> contact.js
// template_group_path.html (GROUP_PATH)
// >> self
// template_user_name_card.html
// >> CHAT_UI.makeNameCard
//全グループ検索画面表示。
CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
var groupId = paramGroupId;
if (window.location.pathname.includes("chat_room")) {
if (groupId == "") return;
NativeBridgeDelegate.setToMoveGroupId(groupId);
window.location.href = "contact.html";
}
Common.showLoadingIndicator();
$("#userNameCard").modal("hide");
$(".cancel").addClass("none");
$(".search_form input").removeClass("focus");
$(".search_form input").val("");
$(".search_form form").removeClass();
$(".content").removeClass("none");
$(".overlay_src_msg").empty();
$("#contactSearch").attr(
"placeholder",
getLocalizedString("searchUserAndGroup")
);
$("#tabAllGroup").prop("checked", true);
//オンライン状態であればサーバから情報更新。
NativeBridgeDelegate.updateGroupInfo(groupId);
//画面エリアを初期化。
$("#rootGroupBtn").off();
$("#parentGroupBtn").off();
$("#childGroupListArea").html("");
$("#userInGroupList").html("");
$("#groupPathArea").html("");
//DBからグループ情報を取得。
var result = NativeBridgeDataSource.getGroupInfo(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") {
$("#parentGroupBtn").on("click", function () {
CHAT_UI.refreshAllGroupSearch(result.parentGroupId);
});
}
if (typeof result.rootGroupId !== "undefined") {
if (paramGroupId == 0) {
groupId = result.rootGroupId;
}
$("#rootGroupBtn").on("click", function () {
CHAT_UI.refreshAllGroupSearch(result.rootGroupId);
});
}
if (groupId == result.rootGroupId || paramGroupId == "0") {
$("#rootGroupArea").addClass("none");
$("#parentGroupArea").addClass("none");
} else {
$("#rootGroupArea").removeClass("none");
$("#parentGroupArea").removeClass("none");
}
//該当グループのパースを表示。
const groupPathTemplate = getTemplate(TemplateURL.GROUP_PATH);
result.groupPathList.forEach(function (groupPath) {
let html = Mustache.render(groupPathTemplate, {
name: groupPath.groupName,
id: groupPath.groupId,
});
let obj = jQuery.parseHTML(html);
$("#groupPathArea").append(obj);
});
//該当グループの下位グループ表示。
const groupTemplate = getTemplate(TemplateURL.GROUP_LIST);
result.childGroupList.forEach(function (childGroup) {
let html = Mustache.render(groupTemplate, {
name: childGroup.groupName,
id: childGroup.groupId,
isFavorite: childGroup.isFavorite,
});
let obj = $(jQuery.parseHTML(html)).on("click", function () {});
$("#childGroupListArea").append(obj);
});
//該当グループの所属ユーザを表示。
const userTemplate = getTemplate(TemplateURL.USER_LIST);
result.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = Common.getProfileImgUrl(groupUser.profileUrl);
});
let html = Mustache.render(userTemplate, {
userList: result.groupUserList,
});
let obj = jQuery.parseHTML(html);
$("#userInGroupList").append(obj);
Common.dismissLoadingIndicator();
};
CHAT_UI.refreshForOnline = function () {
$("#favoriteButton").prop("disabled", false); $("#favoriteButton").prop("disabled", false);
}; };
CHAT_UI.refreshForOffline = function () { Namecard.refreshForOffline = function () {
$("#favoriteButton").prop("disabled", true); $("#favoriteButton").prop("disabled", true);
}; };
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
</div><!-- .row --> </div><!-- .row -->
</nav><!-- nav --> </nav><!-- nav -->
<div class="content tabs"> <div class="content tabs">
<input id="tabMyGroupOnAddUserInCollaboration" type="radio" name="tab_item" checked onclick="CHAT_UI.refreshMyGroupForAddUserInCollaboration();"> <input id="tabMyGroupOnAddUserInCollaboration" type="radio" name="tab_item" checked onclick="CollaborationUI.refreshMyGroupForAddUserInCollaboration();">
<label class="tab_item m-0" for="tabMyGroupOnAddUserInCollaboration">マイグループ</label> <label class="tab_item m-0" for="tabMyGroupOnAddUserInCollaboration">マイグループ</label>
<input id="tabAllGroupOnAddUserInCollaboration" type="radio" name="tab_item" onclick="CHAT_UI.refreshAllGroupForAddUserInCollaboration('0');"> <input id="tabAllGroupOnAddUserInCollaboration" type="radio" name="tab_item" onclick="CollaborationUI.refreshAllGroupForAddUserInCollaboration('0');">
<label class="tab_item m-0" for="tabAllGroupOnAddUserInCollaboration">全グループ</label> <label class="tab_item m-0" for="tabAllGroupOnAddUserInCollaboration">全グループ</label>
<div class="tab_content" id="tab1_content" style="height: 100vh; overflow:scroll;"> <div class="tab_content" id="tab1_content" style="height: 100vh; overflow:scroll;">
<div class="chat_list"> <div class="chat_list">
<!-- お気に入りグループ --> <!-- お気に入りグループ -->
<div class="category" onclick="CHAT_UI.toggleCategory(this);"><div class="category_name"><span>お気に入り</span></div></div> <div class="category" onclick="CollaborationUI.toggleCategory(this);"><div class="category_name"><span>お気に入り</span></div></div>
<div id="favoriteListForAddUserInCollaboration"></div> <div id="favoriteListForAddUserInCollaboration"></div>
<div id="myGroupListForAddUserInCollaboration"></div> <div id="myGroupListForAddUserInCollaboration"></div>
</div> </div>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="modal-footer border-0 justify-content-center"> <div class="modal-footer border-0 justify-content-center">
{{#isFavorite}} {{#isFavorite}}
<button type="button" class="border-0 bg_navy" <button type="button" class="border-0 bg_navy"
onclick="CHAT_UI.removeFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton"> onclick="CollaborationUI.removeFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
<img src="icon/icon_profile_favorite.png" alt="お気に入り"> <img src="icon/icon_profile_favorite.png" alt="お気に入り">
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
{{/isFavorite}} {{/isFavorite}}
{{^isFavorite}} {{^isFavorite}}
<button type="button" class="border-0 bg_navy" <button type="button" class="border-0 bg_navy"
onclick="CHAT_UI.insertFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton"> onclick="CollaborationUI.insertFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
<img src="icon/icon_profile_favorite_white.png" alt="お気に入り"> <img src="icon/icon_profile_favorite_white.png" alt="お気に入り">
......
<li class="d-flex align-items-center" style="border-bottom: 1px solid #e2e8f0;"> <li class="d-flex align-items-center" style="border-bottom: 1px solid #e2e8f0;">
<a href="#" class="w-100" onclick="CHAT_UI.refreshAllGroupForAddUser({{id}});"> <a href="#" class="w-100" onclick="ChatAddUser.refreshAllGroupForAddUser({{id}});">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thumbnail-icon"> <div class="thumbnail-icon">
......
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
<a href="#" class="w-100" onclick="CHAT_UI.refreshAllGroupForAddUserInCollaboration({{id}});"> <a href="#" class="w-100" onclick="CollaborationUI.refreshAllGroupForAddUserInCollaboration({{id}});">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thumbnail-icon"> <div class="thumbnail-icon">
......
<a href="#" class="breadcrumb_item" onclick="CHAT_UI.refreshAllGroupForAddUser({{id}});"><span>{{name}}</span></a> <a href="#" class="breadcrumb_item" onclick="ChatAddUser.refreshAllGroupForAddUser({{id}});"><span>{{name}}</span></a>
\ No newline at end of file \ No newline at end of file
<a href="#" class="breadcrumb_item" onclick="CHAT_UI.refreshAllGroupForAddUserInCollaboration({{id}});"><span>{{name}}</span></a> <a href="#" class="breadcrumb_item" onclick="CollaborationUI.refreshAllGroupForAddUserInCollaboration({{id}});"><span>{{name}}</span></a>
\ No newline at end of file \ No newline at end of file
<div class="category" onclick="CHAT_UI.toggleCategory(this);"> <div class="category" onclick="CollaborationUI.toggleCategory(this);">
<div class="category_name"><span>{{groupName}}</span></div> <div class="category_name"><span>{{groupName}}</span></div>
</div> </div>
<ul class="p-0 chat_make_room_list"> <ul class="p-0 chat_make_room_list">
......
<div class="category" onclick="CHAT_UI.toggleCategory(this);"> <div class="category" onclick="CollaborationUI.toggleCategory(this);">
<div class="category_name"><span>{{groupName}}</span></div> <div class="category_name"><span>{{groupName}}</span></div>
</div> </div>
<ul class="p-0 chat_make_room_list"> <ul class="p-0 chat_make_room_list">
......
{{#userList}} {{#userList}}
<div class="user_item"> <div class="user_item">
<a href="javascript:return false;" onclick="CHAT_UI.makeNameCard({{shopMemberId}})"> <a href="javascript:return false;" onclick="Namecard.makeNameCard({{shopMemberId}})">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
<img src="{{profileUrl}}" onError="this.src='./img/noImage.png'"> <img src="{{profileUrl}}" onError="this.src='./img/noImage.png'">
......
<li class="d-flex align-items-center" style="border-bottom: 1px solid #e2e8f0;"> <li class="d-flex align-items-center" style="border-bottom: 1px solid #e2e8f0;">
<a href="#" class="w-100" onclick="CHAT_UI.refreshAllGroupSearch({{id}});"> <a href="#" class="w-100" onclick="Contact.refreshAllGroupSearch({{id}});">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thumbnail-icon"> <div class="thumbnail-icon">
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<div class="chat_item_r"> <div class="chat_item_r">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
{{#isFavorite}} {{#isFavorite}}
<span class="star active group_{{id}}" onclick="CHAT_UI.favoriteGroupChange({{id}},this)"></span> <span class="star active group_{{id}}" onclick="Contact.favoriteGroupChange({{id}},this)"></span>
{{/isFavorite}} {{/isFavorite}}
{{^isFavorite}} {{^isFavorite}}
<span class="star disable group_{{id}}" onclick="CHAT_UI.favoriteGroupChange({{id}},this)"></span> <span class="star disable group_{{id}}" onclick="Contact.favoriteGroupChange({{id}},this)"></span>
{{/isFavorite}} {{/isFavorite}}
</div> </div>
</div> </div>
......
<a href="#" class="breadcrumb_item" onclick="CHAT_UI.refreshAllGroupSearch({{id}});"><span>{{name}}</span></a> <a href="#" class="breadcrumb_item" onclick="Contact.refreshAllGroupSearch({{id}});"><span>{{name}}</span></a>
\ No newline at end of file \ No newline at end of file
<div class="category" onclick="CHAT_UI.toggleCategory(this);"><div class="category_name"><span>{{groupName}}</span></div></div> <div class="category" onclick="CollaborationUI.toggleCategory(this);"><div class="category_name"><span>{{groupName}}</span></div></div>
<ul class="p-0 chat_make_room_list"> <ul class="p-0 chat_make_room_list">
{{#groupUserList}} {{#groupUserList}}
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
<a href="javascript:return false;" onclick="CHAT_UI.makeNameCard({{shopMemberId}})" style="width: 100%;"> <a href="javascript:return false;" onclick="Namecard.makeNameCard({{shopMemberId}})" style="width: 100%;">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thumbnail"> <div class="thumbnail">
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
<div class="chat_item_r"> <div class="chat_item_r">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
{{#isFavorite}} {{#isFavorite}}
<span class="star active shopmember_{{shopMemberId}}" onclick="CHAT_UI.favoriteUserChange({{shopMemberId}},this)"></span> <span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span>
{{/isFavorite}} {{/isFavorite}}
{{^isFavorite}} {{^isFavorite}}
<span class="star disable shopmember_{{shopMemberId}}" onclick="CHAT_UI.favoriteUserChange({{shopMemberId}},this)"></span> <span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span>
{{/isFavorite}} {{/isFavorite}}
</div> </div>
</div> </div>
......
<li class="d-flex align-items-center" style="border-bottom: 1px solid #e2e8f0;"> <li class="d-flex align-items-center" style="border-bottom: 1px solid #e2e8f0;">
<a href="#" class="w-100" onclick="ChatManagementCommon.refreshAllGroupForMakeRoom({{id}});"> <a href="#" class="w-100" onclick="ChatMakeRoom.refreshAllGroupForMakeRoom({{id}});">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thumbnail-icon"> <div class="thumbnail-icon">
......
<a href="#" class="breadcrumb_item" onclick="ChatManagementCommon.refreshAllGroupForMakeRoom({{id}});"><span>{{name}}</span></a> <a href="#" class="breadcrumb_item" onclick="ChatMakeRoom.refreshAllGroupForMakeRoom({{id}});"><span>{{name}}</span></a>
\ No newline at end of file \ No newline at end of file
<div class="category" onclick="CHAT_UI.toggleCategory(this);"> <div class="category" onclick="CollaborationUI.toggleCategory(this);">
<div class="category_name"><span>{{groupName}}</span></div> <div class="category_name"><span>{{groupName}}</span></div>
</div> </div>
<ul class="p-0 chat_make_room_list"> <ul class="p-0 chat_make_room_list">
......
<ul class="p-0 chat_make_room_list" style="margin-top: 0px !important;border-top: none !important;"> <ul class="p-0 chat_make_room_list" style="margin-top: 0px !important;border-top: none !important;">
{{#userList}} {{#userList}}
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
<a href="javascript:return false;" onclick="CHAT_UI.makeNameCard({{shopMemberId}})" style="width: 100%;"> <a href="javascript:return false;" onclick="Namecard.makeNameCard({{shopMemberId}})" style="width: 100%;">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thumbnail"> <div class="thumbnail">
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
<div class="chat_item_r"> <div class="chat_item_r">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
{{#isFavorite}} {{#isFavorite}}
<span class="star active shopmember_{{shopMemberId}}" onclick="CHAT_UI.favoriteUserChange({{shopMemberId}},this)"></span> <span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span>
{{/isFavorite}} {{/isFavorite}}
{{^isFavorite}} {{^isFavorite}}
<span class="star disable shopmember_{{shopMemberId}}" onclick="CHAT_UI.favoriteUserChange({{shopMemberId}},this)"></span> <span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span>
{{/isFavorite}} {{/isFavorite}}
</div> </div>
</div> </div>
......
<div class="room_left chat_message" data-messageid="{{messageId}}"> <div class="room_left chat_message" data-messageid="{{messageId}}">
<figure> <figure>
<a href="#" data-toggle="modal" data-target="#profileModal1"> <a href="#" data-toggle="modal" data-target="#profileModal1">
<img src="{{profileImage}}" onError="this.src='./img/noImage.png'" onclick="CHAT_UI.makeNameCard({{shopMemberId}})"> <img src="{{profileImage}}" onError="this.src='./img/noImage.png'" onclick="Namecard.makeNameCard({{shopMemberId}})">
</a> </a>
</figure> </figure>
<div class="room_left-text"> <div class="room_left-text">
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
</div> </div>
<div class="modal-body" id="userNameCard-scroll"> <div class="modal-body" id="userNameCard-scroll">
{{#groupPathList}} {{#groupPathList}}
<li onclick="CHAT_UI.refreshAllGroupSearch({{groupId}});"><b>{{groupPath}}</b></li> <li onclick="Contact.refreshAllGroupSearch({{groupId}});"><b>{{groupPath}}</b></li>
{{/groupPathList}} {{/groupPathList}}
</div> </div>
<div class="modal-footer border-0 justify-content-center"> <div class="modal-footer border-0 justify-content-center">
{{#isFavorite}} {{#isFavorite}}
<button type="button" class="border-0 bg_navy" onclick="CHAT_UI.removeFavoriteUser({{shopMemberId}})" <button type="button" class="border-0 bg_navy" onclick="Namecard.removeFavoriteUser({{shopMemberId}})"
id="favoriteButton"> id="favoriteButton">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</button> </button>
{{/isFavorite}} {{/isFavorite}}
{{^isFavorite}} {{^isFavorite}}
<button type="button" class="border-0 bg_navy" onclick="CHAT_UI.insertFavoriteUser({{shopMemberId}})" <button type="button" class="border-0 bg_navy" onclick="Namecard.insertFavoriteUser({{shopMemberId}})"
id="favoriteButton"> id="favoriteButton">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</div> </div>
</button> </button>
{{/isFavorite}} {{/isFavorite}}
<button type="button" class="border-0 bg_green" onclick="CHAT_UI.startVoice('{{shopMemberId}}','{{name}}');"> <button type="button" class="border-0 bg_green" onclick="Namecard.startVoice('{{shopMemberId}}','{{name}}');">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
<img src="icon/icon_profile_phone.png" alt="通話"> <img src="icon/icon_profile_phone.png" alt="通話">
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<span>通話</span> <span>通話</span>
</div> </div>
</button> </button>
<button type="button" class="border-0 bg_blue" onclick="CHAT_UI.startChat('{{shopMemberId}}','{{name}}');"> <button type="button" class="border-0 bg_blue" onclick="Namecard.startChat('{{shopMemberId}}','{{name}}');">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
<img src="icon/icon_profile_chat.png" alt="チャット"> <img src="icon/icon_profile_chat.png" alt="チャット">
......
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