Commit 25fa2ec6 by Lee Munkyeong

Merge branch 'feature/finish_all_collaboration' into 'develop'

Feature/finish all collaboration

See merge request !169
parents 5ab391a4 fee04e09
...@@ -2621,13 +2621,31 @@ CHAT_UI.joinCollaboration = function(collaborationType, meetingId = 0) { ...@@ -2621,13 +2621,31 @@ 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 (collaborationType == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) { if (collaborationType == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) {
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);
} }
} }
......
...@@ -204,6 +204,16 @@ function setSocketAction () { ...@@ -204,6 +204,16 @@ function setSocketAction () {
} }
let type; let type;
let collaborationType; let collaborationType;
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;
}
if ( message.text.includes(messageSeperator) ) { if ( message.text.includes(messageSeperator) ) {
let text = message.text.split(messageSeperator); let text = message.text.split(messageSeperator);
message.text = text[0]; message.text = text[0];
......
...@@ -68,4 +68,5 @@ const HOST_REQUEST_FLG = { ...@@ -68,4 +68,5 @@ const HOST_REQUEST_FLG = {
} }
const messageSeperator = "<::split>"; const messageSeperator = "<::split>";
const dataMessageScheme = "::NOT_MESSAGE"; const DATA_MESSAGE_SCHEME = "::NOT_MESSAGE";
const FINISH_ALL_COLLABORATION_SIGNAL = "::ALL_COLLABORATION_END";
...@@ -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" : "네트워크신호가 약합니다. 협업을 정리하겠습니다."
......
...@@ -119,7 +119,12 @@ $(function () { ...@@ -119,7 +119,12 @@ $(function () {
console.log("=============> READY : ready for coview api"); console.log("=============> READY : ready for coview api");
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") {
...@@ -132,6 +137,7 @@ $(function () { ...@@ -132,6 +137,7 @@ $(function () {
} }
if (CHAT_UTIL.isAndroid() && data.payload.collaborationType == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) { if (CHAT_UTIL.isAndroid() && data.payload.collaborationType == COLLABORATION_TYPE.DOCUMENT && 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 {
...@@ -182,6 +188,7 @@ $(function () { ...@@ -182,6 +188,7 @@ $(function () {
var isAndroid = data.payload.isAndroid; var isAndroid = data.payload.isAndroid;
var isAble = data.payload.isAble var isAble = data.payload.isAble
if (g_isMainMan && isAndroid && !isAble && joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) { if (g_isMainMan && isAndroid && !isAble && 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));
...@@ -199,6 +206,7 @@ $(function () { ...@@ -199,6 +206,7 @@ $(function () {
webkit.messageHandlers.setHostRequestFlg.postMessage(HOST_REQUEST_FLG.DOING); webkit.messageHandlers.setHostRequestFlg.postMessage(HOST_REQUEST_FLG.DOING);
} }
if (g_isMainMan) { if (g_isMainMan) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
if(confirm(getLocalizedString('norify_request_host_change', data.payload.hostId))) { if(confirm(getLocalizedString('norify_request_host_change', data.payload.hostId))) {
Coview_changeHost(getFermiLoginId(data.payload.hostId)); Coview_changeHost(getFermiLoginId(data.payload.hostId));
if (CHAT_UTIL.isAndroid()) { if (CHAT_UTIL.isAndroid()) {
...@@ -573,6 +581,11 @@ function Coview_exitCollaboration(isDocument = false) { ...@@ -573,6 +581,11 @@ 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 {
...@@ -587,7 +600,7 @@ function Coview_finishCollaboration() { ...@@ -587,7 +600,7 @@ function Coview_finishCollaboration() {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.finishCollaboration.postMessage({}); webkit.messageHandlers.finishCollaboration.postMessage({});
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
android.finishCollaboration() android.finishCollaboration();
} }
}; };
isLeaved = true; isLeaved = true;
......
...@@ -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