Commit c6bec16c by Lee Munkyeong

ホスト変更リクエスト機能追加。

parent 4151b7fe
......@@ -2764,6 +2764,7 @@ CHAT_UI.makeNameCardInCollaboration = function(shopMemberId) {
let isCollaborationHost = coview_api.getRoomUsers();
nameCardInfo.profileUrl = CHAT.getProfileImgUrl(nameCardInfo.profileUrl);
let whosHost = $("#collaboration_user_" + nameCardInfo.loginId).hasClass("host");
let namecardHtml = Mustache.render(namecardTemplate, {
shopMemberId: nameCardInfo.shopMemberId,
profileUrl: nameCardInfo.profileUrl,
......@@ -2771,7 +2772,8 @@ CHAT_UI.makeNameCardInCollaboration = function(shopMemberId) {
name: nameCardInfo.shopMemberName,
groupPathList: nameCardInfo.groupPathList,
isFavorite: nameCardInfo.isFavorite,
isHost: isCollaborationHost
isHost: isCollaborationHost,
whosHost: whosHost
});
let namecardObj = $(jQuery.parseHTML(namecardHtml)).on('click', function() {
......
......@@ -98,5 +98,6 @@ $.lang.en = {
"host_change_notify" : "host changed to %@",
"not_support_version" : "did not support this 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?"
}
......@@ -98,5 +98,6 @@ $.lang.ja = {
"host_change_notify" : "ホストが%@様に変更されました。",
"not_support_version" : "現在の端末バージョンでは利用できません。",
"err_target_android_version_not_support" : "対象ユーザの端末バージョンでは文書協業が利用できません。",
"err_not_exist_room" : "該当のルームが存在しません。"
"err_not_exist_room" : "該当のルームが存在しません。",
"norify_request_host_change" : "%@様からホスト変更リクエストがあります。\n承認しますか?"
}
\ No newline at end of file
......@@ -98,5 +98,6 @@ $.lang.ko = {
"host_change_notify" : "호스트가 %@님으로 변경되었습니다.",
"not_support_version" : "현재단말버전에서는 지원되지않는기능입니다.",
"err_target_android_version_not_support" : "해당 유저의 단말버전에서는 문서협업이 이용불가능합니다.",
"err_not_exist_room" : "해당 룸이 존재하지않습니다."
"err_not_exist_room" : "해당 룸이 존재하지않습니다.",
"norify_request_host_change" : "%@님이 호스트변경을 요청하셨습니다.\n승인하시겠습니까?"
}
......@@ -181,6 +181,10 @@ $(function () {
recordStop();
}
penOff();
} else if (data.type === "CHANGE_HOST_APPLY") {
if(confirm(getLocalizedString('norify_request_host_change',data.payload.hostId))) {
Coview_changeHost(data.payload.hostId);
}
}
});
});
......@@ -545,6 +549,14 @@ function Coview_addLoginId(loginId) {
});
}
function applyForHostChange() {
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) {
alert(getLocalizedString('not_support_version'));
return;
}
fw.sendToMsg('others', 'CHANGE_HOST_APPLY', {"hostId": CHAT.globalLoginParameter.loginId});
};
function Coview_connect_audio_collaboration() {
globalUserInfo.coWorkType = collaborationTypeKey.AUDIO;
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
......@@ -557,6 +569,7 @@ function hostSearchInterval() {
let hostName = "";
function hostSearch() {
if (g_isMainMan) {
$("#collaboration_user_" + CHAT.globalLoginParameter.loginId).addClass("host");
$('.host_contents').removeClass('none');
if (joinCollaborationType == COLLABORATION_TYPE.CAMERA) {
$('.photo_select_button').removeClass('none');
......@@ -567,6 +580,7 @@ function hostSearchInterval() {
}
if (CHAT_UTIL.isIOS()) isIos = true;
} else {
$("#collaboration_user_" + CHAT.globalLoginParameter.loginId).removeClass("host");
$('.host_contents').addClass('none');
if (joinCollaborationType == COLLABORATION_TYPE.CAMERA) {
$('.photo_select_button').addClass('none');
......
......@@ -15,7 +15,7 @@
<span>キャンセル</span>
</div>
</button>
<button type="button" class="profile_chat_btn border-0 bg_blue text_white">
<button type="button" class="profile_chat_btn border-0 bg_blue text_white" onclick="applyForHostChange();">
<div class="d-flex flex-column">
<span>リクエスト</span>
</div>
......
......@@ -48,7 +48,8 @@
</button>
{{/isHost}}
{{^isHost}}
<button type="button" class="ch_host_btn border-0 bg_grey text_white" onclick="hostChangeRequest('{{loginId}}');" disabled>
{{#whosHost}}
<button type="button" class="ch_host_btn border-0 bg_blue text_white" data-toggle="modal" data-target="#hostRequestModal" value="#profileModal2">
<div class="d-flex flex-column">
<div class="img_wrap">
<img src="icon/icon_change_host.png" alt="ホスト変更">
......@@ -56,6 +57,17 @@
<span>ホスト変更</span>
</div>
</button>
{{/whosHost}}
{{^whosHost}}
<button type="button" class="ch_host_btn border-0 bg_grey text_white" data-toggle="modal" data-target="#hostRequestModal" value="#profileModal2" disabled>
<div class="d-flex flex-column">
<div class="img_wrap">
<img src="icon/icon_change_host.png" alt="ホスト変更">
</div>
<span>ホスト変更</span>
</div>
</button>
{{/whosHost}}
{{/isHost}}
</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