Commit 493cf8aa by Kim Peace

Merge branch 'develop' into refactoring/prettier

# Conflicts:
#	public_new/js/chat-ui.js
#	public_new/js/chat-websocket.js
#	public_new/js/constant.js
#	public_new/js/share.js
parents 4b4ba6b6 ffd124dc
...@@ -2810,9 +2810,7 @@ CHAT_UI.joinCollaboration = function (collaborationType, meetingId = 0) { ...@@ -2810,9 +2810,7 @@ CHAT_UI.joinCollaboration = function (collaborationType, meetingId = 0) {
}; };
CHAT_UI.startCollaboration = function (collaborationType) { CHAT_UI.startCollaboration = function (collaborationType) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isAndroid()) {
webkit.messageHandlers.startCollaboration.postMessage(collaborationType);
} else if (CHAT_UTIL.isAndroid()) {
if ( if (
collaborationType == COLLABORATION_TYPE.DOCUMENT && collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O androidVersion < ANDROID_SDK_VERSION.O
...@@ -2820,6 +2818,30 @@ CHAT_UI.startCollaboration = function (collaborationType) { ...@@ -2820,6 +2818,30 @@ CHAT_UI.startCollaboration = function (collaborationType) {
alert(getLocalizedString("not_support_version")); alert(getLocalizedString("not_support_version"));
return; return;
} }
}
if ($(".collabo_area.start").length != 0) {
if (!confirm(getLocalizedString("already_exist_collaboration"))) {
CHAT_UI.dismissLoadingIndicator();
return;
}
socket.emit(
"createMessage",
{
text: DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL,
},
0
);
if (CHAT_UTIL.isIOS()) {
//TODO ルーム全協業終了API
} else if (CHAT_UTIL.isAndroid()) {
android.finishAllCollaboration();
}
}
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.startCollaboration.postMessage(collaborationType);
} else if (CHAT_UTIL.isAndroid()) {
android.startCollaboration(collaborationType); android.startCollaboration(collaborationType);
} }
}; };
......
...@@ -169,7 +169,9 @@ function setSocketAction() { ...@@ -169,7 +169,9 @@ function setSocketAction() {
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE); var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE); var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
var systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE); var systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
var openCollaborationMessageTemplate = getTemplate(TemplateURL.OPEN_COLLABORATION_MESSAGE); var openCollaborationMessageTemplate = getTemplate(
TemplateURL.OPEN_COLLABORATION_MESSAGE
);
let template = userMessageTemplate; let template = userMessageTemplate;
if (message.id === socket.id) { if (message.id === socket.id) {
...@@ -183,6 +185,22 @@ function setSocketAction() { ...@@ -183,6 +185,22 @@ function setSocketAction() {
} catch (e) { } catch (e) {
message.text = message.text; message.text = message.text;
} }
if (message.text == DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL) {
$(".collabo_area.start").each(function (index, collaborationMessage) {
$(collaborationMessage).removeClass("start");
$(collaborationMessage).addClass("end");
$(collaborationMessage).addClass("disable");
$(collaborationMessage)
.find(".collaboation_join_button")
.attr("disabled", "disabled");
$(collaborationMessage)
.find(".collaboration_join_message")
.text(getLocalizedString("message_ended"));
});
return;
}
let type; let type;
let collaborationType; let collaborationType;
if (message.text.includes(messageSeperator)) { if (message.text.includes(messageSeperator)) {
...@@ -211,6 +229,7 @@ function setSocketAction() { ...@@ -211,6 +229,7 @@ function setSocketAction() {
android.getUserInfoList(message.userId) android.getUserInfoList(message.userId)
); );
} }
userInCollaboration.forEach(function (user) { userInCollaboration.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
}); });
......
...@@ -55,7 +55,8 @@ const HostRequestFlag = { ...@@ -55,7 +55,8 @@ const HostRequestFlag = {
}; };
const messageSeperator = "<::split>"; const messageSeperator = "<::split>";
const dataMessageScheme = "::NOT_MESSAGE"; const DATA_MESSAGE_SCHEME = "::NOT_MESSAGE";
const FINISH_ALL_COLLABORATION_SIGNAL = "::ALL_COLLABORATION_END";
const TemplateURL = { const TemplateURL = {
GROUP_PATH: "./template/template_group_path.html", GROUP_PATH: "./template/template_group_path.html",
......
...@@ -61,6 +61,7 @@ $.lang.en = { ...@@ -61,6 +61,7 @@ $.lang.en = {
"groupChatRoom":"Group", "groupChatRoom":"Group",
"myGroup":"My Group", "myGroup":"My Group",
"allGroup":"All Group", "allGroup":"All Group",
"message_ended" : "End",
"returnToRootGroup":"Return to Root Group", "returnToRootGroup":"Return to Root Group",
"returnToParentGroup":"Return to Parent Group", "returnToParentGroup":"Return to Parent Group",
"quickBtn":"Quick Button", "quickBtn":"Quick Button",
...@@ -100,6 +101,7 @@ $.lang.en = { ...@@ -100,6 +101,7 @@ $.lang.en = {
"err_target_android_version_not_support" : "did not support document collaboration on this user's device version.", "err_target_android_version_not_support" : "did not support document collaboration on this user's device version.",
"err_not_exist_room" : "this room is not exist.", "err_not_exist_room" : "this room is not exist.",
"norify_request_host_change" : "%@ request host permission \ndo you want to approve?", "norify_request_host_change" : "%@ request host permission \ndo you want to approve?",
"already_exist_collaboration" : "already exist collaboration. do you want finish already exist collaboration and start new one?",
"error_send_video": "Fail to send.", "error_send_video": "Fail to send.",
"already_processing_host_request" : "already processing host request", "already_processing_host_request" : "already processing host request",
"err_weak_network_exit_collaboration" : "network is weak. end Collaboration" "err_weak_network_exit_collaboration" : "network is weak. end Collaboration"
......
...@@ -61,6 +61,7 @@ $.lang.ja = { ...@@ -61,6 +61,7 @@ $.lang.ja = {
"groupChatRoom":"グループ", "groupChatRoom":"グループ",
"myGroup":"マイグループ", "myGroup":"マイグループ",
"allGroup":"全グループ", "allGroup":"全グループ",
"message_ended" : "終了しました",
"returnToRootGroup":"トップグループに戻る", "returnToRootGroup":"トップグループに戻る",
"returnToParentGroup":"上位グループに戻る", "returnToParentGroup":"上位グループに戻る",
"quickBtn":"クイックボタン", "quickBtn":"クイックボタン",
...@@ -100,6 +101,7 @@ $.lang.ja = { ...@@ -100,6 +101,7 @@ $.lang.ja = {
"err_target_android_version_not_support" : "対象ユーザの端末バージョンでは文書協業が利用できません。", "err_target_android_version_not_support" : "対象ユーザの端末バージョンでは文書協業が利用できません。",
"err_not_exist_room" : "該当のルームが存在しません。", "err_not_exist_room" : "該当のルームが存在しません。",
"norify_request_host_change" : "%@様からホスト変更リクエストがあります。\n承認しますか?", "norify_request_host_change" : "%@様からホスト変更リクエストがあります。\n承認しますか?",
"already_exist_collaboration" : "現在進行中の協業があります。進行中の協業を終了し、新たな協業を開始しますか?",
"error_send_video": "送信に失敗しました。", "error_send_video": "送信に失敗しました。",
"already_processing_host_request" : "既にホストリクエストが進行中です。", "already_processing_host_request" : "既にホストリクエストが進行中です。",
"err_weak_network_exit_collaboration" : "ネットワーク信号が弱いです。協業を終了します。" "err_weak_network_exit_collaboration" : "ネットワーク信号が弱いです。協業を終了します。"
......
...@@ -61,6 +61,7 @@ $.lang.ko = { ...@@ -61,6 +61,7 @@ $.lang.ko = {
"groupChatRoom":"그룹", "groupChatRoom":"그룹",
"myGroup":"내그룹", "myGroup":"내그룹",
"allGroup":"전그룹", "allGroup":"전그룹",
"message_ended" : "종료되었습니다.",
"returnToRootGroup":"최상위그룹으로 돌아가기", "returnToRootGroup":"최상위그룹으로 돌아가기",
"returnToParentGroup":"상위그룹으로 돌아가기", "returnToParentGroup":"상위그룹으로 돌아가기",
"quickBtn":"퀵버튼", "quickBtn":"퀵버튼",
...@@ -100,6 +101,7 @@ $.lang.ko = { ...@@ -100,6 +101,7 @@ $.lang.ko = {
"err_target_android_version_not_support" : "해당 유저의 단말버전에서는 문서협업이 이용불가능합니다.", "err_target_android_version_not_support" : "해당 유저의 단말버전에서는 문서협업이 이용불가능합니다.",
"err_not_exist_room" : "해당 룸이 존재하지않습니다.", "err_not_exist_room" : "해당 룸이 존재하지않습니다.",
"norify_request_host_change" : "%@님이 호스트변경을 요청하셨습니다.\n승인하시겠습니까?", "norify_request_host_change" : "%@님이 호스트변경을 요청하셨습니다.\n승인하시겠습니까?",
"already_exist_collaboration" : "현재 진행중인 협업이 있습니다. 진행중인 협업을 강제종료하고 새로 개시하시겠습니까?",
"error_send_video": "전송에 실패했습니다.", "error_send_video": "전송에 실패했습니다.",
"already_processing_host_request" : "이미 호스트요청이 진행중입니다.", "already_processing_host_request" : "이미 호스트요청이 진행중입니다.",
"err_weak_network_exit_collaboration" : "네트워크신호가 약합니다. 협업을 정리하겠습니다." "err_weak_network_exit_collaboration" : "네트워크신호가 약합니다. 협업을 정리하겠습니다."
......
...@@ -120,6 +120,13 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -120,6 +120,13 @@ document.addEventListener("DOMContentLoaded", function () {
Coview_addLoginId(globalUserInfo.loginId); Coview_addLoginId(globalUserInfo.loginId);
coview_api.Login(globalUserInfo.loginId); coview_api.Login(globalUserInfo.loginId);
initCollaborationUI(joinCollaborationType); initCollaborationUI(joinCollaborationType);
if (CHAT_UTIL.isAndroid()) {
android.setHostRequestFlg(HOST_REQUEST_FLG.DONE);
} else {
webkit.messageHandlers.setHostRequestFlg.postMessage(
HOST_REQUEST_FLG.DONE
);
}
fw.socket.on("message", async function (data) { fw.socket.on("message", async function (data) {
console.log("====> message::data: ", data); console.log("====> message::data: ", data);
if (data.type === "CHANGE_COLLABORATION") { if (data.type === "CHANGE_COLLABORATION") {
...@@ -136,6 +143,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -136,6 +143,7 @@ document.addEventListener("DOMContentLoaded", function () {
data.payload.collaborationType == COLLABORATION_TYPE.DOCUMENT && data.payload.collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O androidVersion < ANDROID_SDK_VERSION.O
) { ) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
alert(getLocalizedString("not_support_version")); alert(getLocalizedString("not_support_version"));
joinCollaborationType = COLLABORATION_TYPE.CAMERA; joinCollaborationType = COLLABORATION_TYPE.CAMERA;
} else { } else {
...@@ -213,6 +221,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -213,6 +221,7 @@ document.addEventListener("DOMContentLoaded", function () {
!isAble && !isAble &&
joinCollaborationType == COLLABORATION_TYPE.DOCUMENT joinCollaborationType == COLLABORATION_TYPE.DOCUMENT
) { ) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
alert(getLocalizedString("err_target_android_version_not_support")); alert(getLocalizedString("err_target_android_version_not_support"));
} else if (g_isMainMan) { } else if (g_isMainMan) {
Coview_changeHost(getFermiLoginId(data.payload.loginId)); Coview_changeHost(getFermiLoginId(data.payload.loginId));
...@@ -232,6 +241,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -232,6 +241,7 @@ document.addEventListener("DOMContentLoaded", function () {
); );
} }
if (g_isMainMan) { if (g_isMainMan) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
if ( if (
confirm( confirm(
getLocalizedString( getLocalizedString(
...@@ -341,6 +351,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -341,6 +351,7 @@ document.addEventListener("DOMContentLoaded", function () {
} }
} }
} else if (collaborationJoinFlg == "0") { } else if (collaborationJoinFlg == "0") {
coview_api.deleteRoom(globalUserInfo.roomId);
coview_api.CreateRoom( coview_api.CreateRoom(
globalUserInfo.roomId, globalUserInfo.roomId,
globalUserInfo.coWorkType globalUserInfo.coWorkType
...@@ -644,6 +655,16 @@ function Coview_exitCollaboration(isDocument = false) { ...@@ -644,6 +655,16 @@ function Coview_exitCollaboration(isDocument = false) {
android.exitMeetingRoom(); android.exitMeetingRoom();
} }
} }
if (socket != null && socket.connected) {
socket.emit(
"createMessage",
{
text: DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL,
},
0
);
}
if ($("#recordBtn").hasClass("bg_red")) { if ($("#recordBtn").hasClass("bg_red")) {
recordStop(Coview_finishCollaboration); recordStop(Coview_finishCollaboration);
} else { } else {
...@@ -732,6 +753,7 @@ function applyForHostChange() { ...@@ -732,6 +753,7 @@ function applyForHostChange() {
function Coview_connect_audio_collaboration() { function Coview_connect_audio_collaboration() {
globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO; globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO;
coview_api.deleteRoom(globalUserInfo.roomId);
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType); coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
Coview_moveToVideoShareArea(); Coview_moveToVideoShareArea();
......
...@@ -9,7 +9,12 @@ ...@@ -9,7 +9,12 @@
<span>{{createdAtDay}}</span><span>{{createdAtTime}}</span> <span>{{createdAtDay}}</span><span>{{createdAtTime}}</span>
{{/isToday}} {{/isToday}}
</div> </div>
<div class="collabo_area {{#isEnded}} disable {{/isEnded}}"> {{#isEnded}}
<div class="collabo_area end disable">
{{/isEnded}}
{{^isEnded}}
<div class="collabo_area start">
{{/isEnded}}
<div class="collabo_desc"> <div class="collabo_desc">
<div class="collabo_room_name d-flex flex-row"> <div class="collabo_room_name d-flex flex-row">
<span>{{roomName}}</span> <span>{{roomName}}</span>
...@@ -27,13 +32,13 @@ ...@@ -27,13 +32,13 @@
</div> </div>
</div> </div>
<div class="collabo_btn"> <div class="collabo_btn">
<button type="button" name="button" onclick="CHAT_UI.joinCollaboration({{collaborationType}}, {{meetingId}})" {{#isEnded}} disabled {{/isEnded}}> <button class="collaboation_join_button" type="button" name="button" onclick="CHAT_UI.joinCollaboration({{collaborationType}}, {{meetingId}})" {{#isEnded}} disabled {{/isEnded}}>
<img src="icon/icon_profile_phone.png" alt="通話"> <img src="icon/icon_profile_phone.png" alt="通話">
{{#isEnded}} {{#isEnded}}
<span>終了しました</span> <span class="collaboration_join_message">終了しました</span>
{{/isEnded}} {{/isEnded}}
{{^isEnded}} {{^isEnded}}
<span>参加する</span> <span class="collaboration_join_message">参加する</span>
{{/isEnded}} {{/isEnded}}
</button> </button>
</div> </div>
......
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