Commit a8ed1675 by Lee Munkyeong

Merge branch 'release_sp3' of gitlab.agentec.jp:abookCommunication/chat_webview…

Merge branch 'release_sp3' of gitlab.agentec.jp:abookCommunication/chat_webview into features/release_sp3_collaboration_document

# Conflicts:
#	public_new/js/share.js
parents 8da086e4 7ffcdc67
......@@ -27,6 +27,7 @@
<div class="collabo_nav_r">
<div class="text-right d-flex align-items-center">
<button type="button" name="button" class="btn user_btn"></button>
<button type="button" name="button" class="btn add_user_btn none"></button>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="Coview_exitCollaboration();"></button> -->
</div>
</div>
......@@ -53,6 +54,7 @@
<!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div>
<div id="modal_add_user_confirm" ></div>
<!-- オーバーレイ メニュー -->
<div id="collaboration_picture_overlay_menu"></div>
......@@ -118,7 +120,6 @@
</footer>
<!-- フッター -->
<div id="footer_collabo"></div>
<div id="loadingArea"></div>
<script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/socket.io.js"></script>
......@@ -135,7 +136,6 @@
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script>
<script src="./js/loading.js"></script>
<script src="./js/language.js"></script>
<script src="./js/language_ko.js" charset="UTF-8"></script>
<script src="./js/language_ja.js" charset="UTF-8"></script>
......@@ -149,8 +149,8 @@
$("#modal_collabo_change_host").load("./modal_collabo_change_host.html");
$("#modal_collabo_capture").load("./modal_collabo_capture.html");
$("#modal_collabo_profile2").load("./modal_collabo_profile2.html");
$("#loadingArea").load("./loading.html");
$("#collaboration_picture_overlay_menu").load("./collaboration_picture_overlay_menu.html");
$("#add_user_list").load("./modal_add_user_list.html");
$("#zoom").load("./zoom.html");
let CHAT_SERVER_URL = '';
......@@ -160,13 +160,20 @@
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
let roomType;
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType();
}
if (roomType == chatRoomType.DM) {
$('.add_user_btn').removeClass('none');
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
......@@ -182,9 +189,11 @@
console.log(collaborationJoinFlg);
}
globalUserInfo.coWorkType = collaborationTypeKey.CAMERA;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() {
});
}
};
</script>
</body>
......
......@@ -26,6 +26,7 @@
<div class="collabo_nav_r">
<div class="text-right d-flex align-items-center">
<button type="button" name="button" class="btn user_btn"></button>
<button type="button" name="button" class="btn add_user_btn none"></button>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="Coview_exitCollaboration();"></button> -->
</div>
</div>
......@@ -52,6 +53,7 @@
<!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div>
<div id="modal_add_user_confirm" ></div>
<!-- オーバーレイ メニュー -->
<div id="collaboration_video_overlay_menu"></div>
......@@ -112,7 +114,6 @@
</footer>
<!-- フッター -->
<div id="footer_collabo"></div>
<div id="loadingArea"></div>
<script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/socket.io.js"></script>
......@@ -128,7 +129,6 @@
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script>
<script src="./js/loading.js"></script>
<script src="./js/chat-db.js"></script>
<script src="./js/language.js"></script>
<script src="./js/language_ko.js" charset="UTF-8"></script>
......@@ -144,8 +144,8 @@
$("#modal_collabo_change_host").load("./modal_collabo_change_host.html");
$("#modal_collabo_capture").load("./modal_collabo_capture.html");
$("#modal_collabo_profile2").load("./modal_collabo_profile2.html");
$("#loadingArea").load("./loading.html");
$("#collaboration_video_overlay_menu").load("./collaboration_video_overlay_menu.html");
$("#add_user_list").load("./modal_add_user_list.html");
$("#zoom").load("./zoom.html");
let CHAT_SERVER_URL = '';
......@@ -155,13 +155,20 @@
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
let roomType;
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType();
}
if (roomType == chatRoomType.DM) {
$('.add_user_btn').removeClass('none');
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
......@@ -177,9 +184,11 @@
console.log(collaborationJoinFlg);
}
globalUserInfo.coWorkType = collaborationTypeKey.VIDEO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() {
});
}
};
</script>
</html>
\ No newline at end of file
......@@ -27,7 +27,7 @@
</div>
<div class="collabo_nav_r">
<div class="text-right d-flex align-items-center">
<button type="button" name="button" class="btn add_user_btn"></button>
<button type="button" name="button" class="btn add_user_btn none"></button>
<!--<button type="button" name="button" class="btn menu_btn"></button>-->
</div>
</div>
......@@ -52,17 +52,16 @@
<!-- プロフィールモーダル -->
<div id="userProfileModalInCollaboration"></div>
<div id="modal_collabo_profile2"></div>
<!-- ユーザー追加オーバーレイ -->
<div id="add_user_list" ></div>
<div id="modal_add_user_confirm" ></div>
<div id="modal_add_user_confirm"></div>
<!-- ホスト変更モーダル -->
<div id="modal_collabo_change_host"></div>
<!-- ホストリクエストモーダル -->
<div id="modal_collabo_host_request"></div>
<!-- フッター -->
<div id="footer_collabo"></div>
<div id="loadingArea"></div>
<script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/socket.io.js"></script>
<script src="./js/libs/moment.js"></script>
......@@ -74,7 +73,6 @@
<script src="./js/constant.js"></script>
<script src="./js/collaboration.js"></script>
<script src="./js/common.js"></script>
<script src="./js/loading.js"></script>
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script>
......@@ -92,7 +90,6 @@
$("#modal_collabo_change_host").load("./modal_collabo_change_host.html");
$("#modal_collabo_capture").load("./modal_collabo_capture.html");
$("#modal_collabo_profile2").load("./modal_collabo_profile2.html");
$("#loadingArea").load("./loading.html");
$("#collaboration_voice_overlay_menu").load("./collaboration_voice_overlay_menu.html");
$("#add_user_list").load("./modal_add_user_list.html");
......@@ -103,13 +100,20 @@
let IS_MOBILE = true;
let IS_ONLINE = false;
let collaborationJoinFlg = 0;
let roomType;
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType();
}
if (roomType == chatRoomType.DM) {
$('.add_user_btn').removeClass('none');
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
......@@ -125,10 +129,11 @@
console.log(collaborationJoinFlg);
}
globalUserInfo.coWorkType = collaborationTypeKey.AUDIO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() {
});
}
};
</script>
</body>
......
......@@ -694,7 +694,7 @@ CHAT_UI.showConfirmView = function(isInvite) {
if (typeof(android) != "undefined") {
android.createChatRoom("1", userIdList.join(','), newRoomName, makeRoomFlg.MAKE_ROOM, false);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM});
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM, "isVoice": false});
}
......@@ -788,7 +788,7 @@ CHAT_UI.showConfirmView = function(isInvite) {
if (typeof(android) != "undefined") {
android.createChatRoom("1", userIdList.join(','), encodedRoomName, makeRoomFlg.MAKE_ROOM, false);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM});
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM, "isVoice": false});
}
}
}
......@@ -1637,7 +1637,7 @@ CHAT_UI.startChat = function(userShopMemberId,userName) {
if (typeof(android) != "undefined") {
android.createChatRoom(chatRoomType.DM, userIdList.join(','),newRoomName, makeRoomFlg.NAME_CARD, false);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.NAME_CARD});
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.NAME_CARD, "isVoice": false});
}
};
......@@ -1651,7 +1651,7 @@ CHAT_UI.startVoice = function(userShopMemberId, userName) {
if (typeof(android) != "undefined") {
android.createChatRoom(chatRoomType.DM, userIdList.join(','),newRoomName, makeRoomFlg.NAME_CARD, true);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.NAME_CARD});
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.NAME_CARD, "isVoice": true});
}
CHAT_UI.startCollaboration(collaborationType.AUDIO);
}
......@@ -2131,7 +2131,7 @@ CHAT_UI.showMakeRoomConfirmView = function() {
if (typeof(android) != "undefined") {
android.createChatRoom("1", userIdList.join(','), newRoomName, makeRoomFlg.MAKE_ROOM, false);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM});
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM, "isVoice": false});
}
} else if(trimmedRoomName.includes(';') || trimmedRoomName.includes('/') || trimmedRoomName.includes('?') || trimmedRoomName.includes(':') || trimmedRoomName.includes("@")
|| trimmedRoomName.includes('&') || trimmedRoomName.includes('=') || trimmedRoomName.includes("+") || trimmedRoomName.includes('$') || trimmedRoomName.includes(",") || trimmedRoomName.includes('-')
......@@ -2178,7 +2178,7 @@ CHAT_UI.showMakeRoomConfirmView = function() {
if (typeof(android) != "undefined") {
android.createChatRoom("1", userIdList.join(','), trimmedRoomName, makeRoomFlg.MAKE_ROOM, false);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": trimmedRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM});
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": trimmedRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM, "isVoice": false});
}
}
});
......@@ -2823,9 +2823,9 @@ CHAT_UI.confirmInviteUserListInCollaboration = function() {
userIdList.push(user.shopMemberId);
})
if (typeof(android) != "undefined") {
android.inviteUsers(userIdList.join(','), true);
android.inviteCollaboration(userIdList.join(','), CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType));
} else {
webkit.messageHandlers.inviteUsers.postMessage({"userIdList": userIdList.join(',')});
webkit.messageHandlers.inviteCollaboration.postMessage({"userIdList": userIdList.join(','), "collaborationType": CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType)});
}
$('#modalAddUserConfirm').modal('hide');
});
......
......@@ -175,6 +175,11 @@ function setSocketAction () {
, function(text) {
systemMessageTemplate = text;
});
var openCollaborationMessageTemplate;
$.get({ url: "./template/template_open_collaboration_message.html", async: false }
, function(text) {
openCollaborationMessageTemplate = text;
});
let template = userMessageTemplate;
if (message.id === socket.id) {
......@@ -188,13 +193,42 @@ function setSocketAction () {
} catch(e) {
message.text = message.text
}
let messageType;
let collaborationType;
if ( message.text.includes(messageSeperator) ) {
message.text = message.text.split(messageSeperator)[0];
let text = message.text.split(messageSeperator);
message.text = text[0];
messageType = text[1];
if (messageType == messageType.COMMUNICATIONSTART || messageType == messageType.COMMUNICATIONEND) {
collaborationType = text[2];
var userInCollaboration;
if (CHAT_UTIL.isIOS()) {
userInCollaboration = JSON.parse(CHAT_DB.getUserInfoList(message.userId));
} else if (CHAT_UTIL.isAndroid()) {
userInCollaboration = JSON.parse(android.getUserInfoList(message.userId));
}
userInCollaboration.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
})
template = openCollaborationMessageTemplate;
let html = Mustache.render(template, {
roomName: roomName,
userCount: 1,
userList: userInCollaboration,
insertDate: message.insertDate,
collaborationType: collaborationType,
isToday: true,
createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime,
isOtherYear: false
});
$('#messages').append(html);
} else {
var replacePath = message.text;
replacePath = replacePath.replaceAll('?fileName=', '?sid=' + CHAT.globalLoginParameter.sid + '&fileName=');
message.text = replacePath;
//TODO newMessageの際にDB格納が必要。
let html = Mustache.render(template, {
text: message.text,
from: message.from,
......@@ -207,6 +241,8 @@ function setSocketAction () {
// イメージの場合、img tagを追加する
html = message.text.includes('attachedImages') || message.text.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html;
$('#messages').append(html);
}
}
// 画像、動画の描画を待ってからスクロール
setTimeout(function () {
......
......@@ -25,7 +25,7 @@ $(function () {
$("#collabo_main").toggleClass("noscroll");
// 他のボタンを非表示
$(".add_user_btn").toggleClass("none");
// $(".add_user_btn").toggleClass("none");
$(".menu_btn").toggleClass("none");
if ($("#overlay_user_list.overlay").hasClass("noscroll")) {
......
......@@ -92,5 +92,6 @@ $.lang.en = {
"collaboration_start":"collaboration start",
"collaboration_end":"collaboration end",
"notify_not_released" : "It will be released later.",
"error_empty_room_name" : "Please input room name."
"error_empty_room_name" : "Please input room name.",
"inform_exit_host_collaboration" : "The host has terminated the collaboration."
}
......@@ -92,5 +92,6 @@ $.lang.ja = {
"collaboration_start":"協業中",
"collaboration_end":"協業終了",
"notify_not_released" : "今後リリース予定です。",
"error_empty_room_name" : "ルーム名を入力してください。"
"error_empty_room_name" : "ルーム名を入力してください。",
"inform_exit_host_collaboration" : "ホストが協業を終了しました。"
}
......@@ -92,5 +92,6 @@ $.lang.ko = {
"collaboration_start":"협업중",
"collaboration_end":"협업종료",
"notify_not_released" : "추후 공개예정입니다.",
"error_empty_room_name" : "룸명을 입력해주세요."
"error_empty_room_name" : "룸명을 입력해주세요.",
"inform_exit_host_collaboration" : "호스트가 협업을 종료하였습니다."
}
......@@ -3,6 +3,7 @@
/* --------------------------------------------------- */
let coview_api = new CoviewApi();
var isDocument = false;
let isLeaved = false;
$(function() {
var coviewApiActive = coview_api.Init(
{
......@@ -135,8 +136,25 @@ $(function() {
$("#loadingIndicator").removeClass("full_active");
});
coview_api.addEventListener ("allbye", function () {
console.log("=============> ALL BYE : share allbye");
$("#loadingIndicator").removeClass("full_active");
});
coview_api.addEventListener ("guestbye", function () {
console.log("=============> GUEST BYE : share guestbye");
$("#loadingIndicator").removeClass("full_active");
});
coview_api.addEventListener ("hostbye", function () {
console.log("=============> HOST BYE : share hostbye");
alert(getLocalizedString("inform_exit_host_collaboration"));
Coview_exitCollaboration();
$("#loadingIndicator").removeClass("full_active");
});
coview_api.addEventListener ("destroy", function () {
console.log("=============> START : share start");
console.log("=============> DESTROY : share destroy");
coview_api.LeaveRoom();
$(".coview_share_area").hide();
$("#loadingIndicator").removeClass("full_active");
......@@ -145,6 +163,7 @@ $(function() {
coview_api.addEventListener ("message", async function (event, json) {
console.log("+++ addEventListener", json);
console.log("processMessage api = ", json.api);
if (isLeaved) return;
let loginIdList = new Array();
switch (json.api){
case "LoginResponse":
......@@ -173,6 +192,8 @@ $(function() {
meetingId = android.createContentView();
}
}
} else if (collaborationJoinFlg == '2') {
coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
}
Coview_moveToVideoShareArea();
break;
......@@ -248,7 +269,16 @@ function Coview_exitCollaboration(isDocument = false) {
}
}
coview_api.LeaveRoom();
isLeaved = true;
if (collaborationJoinFlg != '2') {
CHAT_UI.joinRoom(CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.name);
} else {
if (typeof(android) != "undefined") {
android.openCommunicationHome();
} else {
webkit.messageHandlers.openCommunicationHome.postMessage({});
}
}
}
function Coview_changeHost(userId) {
......
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