Commit abdaede6 by Kang Donghun

Merge branch 'feature/release_sp3_change_host_function' into 'develop'

ホスト変更機能実装

See merge request !122
parents f84cf88a d1dfba50
<div class="user_list_wrap"> <div class="user_list_wrap">
<div class="user_list d-flex flex-wrap"> <div class="user_list d-flex flex-wrap">
{{#joinedUserList}} {{#joinedUserList}}
<div class="user_item {{isHost}}"> <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="CHAT_UI.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>
......
...@@ -2493,7 +2493,7 @@ CHAT_UI.startCollaboration = function(collaborationType) { ...@@ -2493,7 +2493,7 @@ CHAT_UI.startCollaboration = function(collaborationType) {
} }
CHAT_UI.refreshJoinedCollaboration = function(loginIdList, hostName) { CHAT_UI.refreshJoinedCollaboration = function(loginIdList) {
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
$('#collaboration_overlay_user_list').html(''); $('#collaboration_overlay_user_list').html('');
...@@ -2506,9 +2506,7 @@ CHAT_UI.refreshJoinedCollaboration = function(loginIdList, hostName) { ...@@ -2506,9 +2506,7 @@ CHAT_UI.refreshJoinedCollaboration = function(loginIdList, hostName) {
var joinedUserList = CHAT_DB.getUserListByLoginId(loginIdList); var joinedUserList = CHAT_DB.getUserListByLoginId(loginIdList);
joinedUserList.forEach(function(user) { joinedUserList.forEach(function(user) {
console.log("is host = " + (user.loginId == hostName));
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
user.isHost = user.loginId == hostName ? "host" : "";
}) })
let html = Mustache.render(joinedUserListTemplate, { let html = Mustache.render(joinedUserListTemplate, {
...@@ -2726,7 +2724,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function(paramGroupId) { ...@@ -2726,7 +2724,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function(paramGroupId) {
} }
CHAT_UI.makeNameCardInCollaboration = function(shopMemberId, isCollaborationHost) { CHAT_UI.makeNameCardInCollaboration = function(shopMemberId) {
if (CHAT.globalLoginParameter.shopMemberId == shopMemberId) { if (CHAT.globalLoginParameter.shopMemberId == shopMemberId) {
return; return;
} }
...@@ -2740,19 +2738,7 @@ CHAT_UI.makeNameCardInCollaboration = function(shopMemberId, isCollaborationHost ...@@ -2740,19 +2738,7 @@ CHAT_UI.makeNameCardInCollaboration = function(shopMemberId, isCollaborationHost
namecardTemplate = text; namecardTemplate = text;
}); });
if (isCollaborationHost != "host") { let isCollaborationHost = coview_api.getRoomUsers();
$.get({ url: "./modal_collabo_change_host.html", async: false }
, function(text) {
changeHostTemplate = text;
});
let changeHostHtml = Mustache.render(changeHostTemplate, {
shopMemberId: nameCardInfo.shopMemberId
});
let changeHostObj = $(jQuery.parseHTML(changeHostHtml)).on('click', function() {
});
$('#modal_collabo_profile2').html(changeHostObj);
}
nameCardInfo.profileUrl = CHAT.getProfileImgUrl(nameCardInfo.profileUrl); nameCardInfo.profileUrl = CHAT.getProfileImgUrl(nameCardInfo.profileUrl);
let namecardHtml = Mustache.render(namecardTemplate, { let namecardHtml = Mustache.render(namecardTemplate, {
shopMemberId: nameCardInfo.shopMemberId, shopMemberId: nameCardInfo.shopMemberId,
...@@ -2761,7 +2747,7 @@ CHAT_UI.makeNameCardInCollaboration = function(shopMemberId, isCollaborationHost ...@@ -2761,7 +2747,7 @@ CHAT_UI.makeNameCardInCollaboration = function(shopMemberId, isCollaborationHost
name: nameCardInfo.shopMemberName, name: nameCardInfo.shopMemberName,
groupPathList: nameCardInfo.groupPathList, groupPathList: nameCardInfo.groupPathList,
isFavorite: nameCardInfo.isFavorite, isFavorite: nameCardInfo.isFavorite,
isHost: isCollaborationHost == "host" ? true : false isHost: isCollaborationHost
}); });
let namecardObj = $(jQuery.parseHTML(namecardHtml)).on('click', function() { let namecardObj = $(jQuery.parseHTML(namecardHtml)).on('click', function() {
......
...@@ -5,7 +5,9 @@ let coview_api = new CoviewApi(); ...@@ -5,7 +5,9 @@ let coview_api = new CoviewApi();
var isDocument = false; var isDocument = false;
var isBoard = false; var isBoard = false;
let isLeaved = false; let isLeaved = false;
let timeInterval = null;
var backgroundFileName; var backgroundFileName;
$(function () { $(function () {
var coviewApiActive = coview_api.Init({ var coviewApiActive = coview_api.Init({
testSTRParam: "param1", testSTRParam: "param1",
...@@ -311,6 +313,7 @@ function Coview_exitCollaboration(isDocument = false) { ...@@ -311,6 +313,7 @@ function Coview_exitCollaboration(isDocument = false) {
android.exitMeetingRoom(); android.exitMeetingRoom();
} }
} }
clearInterval(timeInterval);
coview_api.LeaveRoom(); coview_api.LeaveRoom();
isLeaved = true; isLeaved = true;
if (collaborationJoinFlg != "2") { if (collaborationJoinFlg != "2") {
...@@ -344,3 +347,27 @@ function Coview_connect_audio_collaboration() { ...@@ -344,3 +347,27 @@ function Coview_connect_audio_collaboration() {
$(".coview_share_title_name").text("音声通話"); $(".coview_share_title_name").text("音声通話");
} }
function hostSearchInterval() {
let hostName = "";
function hostSearch() {
if (hostName != g_isMainManUsername) {
if (hostName != "") {
$("#collaboration_user_" + hostName).removeClass("host");
}
$("#collaboration_user_" + g_isMainManUsername).addClass("host");
hostName = g_isMainManUsername;
} else {
if (hostName == "") {
if (!$("#collaboration_user_" + CHAT.globalLoginParameter.loginId).hasClass("host") && coview_api.getRoomUsers()) {
$("#collaboration_user_" + CHAT.globalLoginParameter.loginId).addClass("host");
}
} else {
if (!$("#collaboration_user_" + hostName).hasClass('host')) {
$("#collaboration_user_" + hostName).addClass("host");
}
}
}
}
timeInterval = setInterval(hostSearch, 3000);
}
\ No newline at end of file
...@@ -37,7 +37,17 @@ ...@@ -37,7 +37,17 @@
</div> </div>
</button> </button>
{{/isFavorite}} {{/isFavorite}}
<!-- {{^isHost}}--> {{#isHost}}
<button type="button" class="ch_host_btn border-0 bg_green text_white" onclick="Coview_changeHost('{{loginId}}');" >
<div class="d-flex flex-column">
<div class="img_wrap">
<img src="icon/icon_change_host.png" alt="ホスト変更">
</div>
<span>ホスト変更</span>
</div>
</button>
{{/isHost}}
{{^isHost}}
<button type="button" class="ch_host_btn border-0 bg_grey text_white" onclick="Coview_changeHost('{{loginId}}');" disabled> <button type="button" class="ch_host_btn border-0 bg_grey text_white" onclick="Coview_changeHost('{{loginId}}');" disabled>
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
...@@ -46,7 +56,7 @@ ...@@ -46,7 +56,7 @@
<span>ホスト変更</span> <span>ホスト変更</span>
</div> </div>
</button> </button>
<!-- {{/isHost}}--> {{/isHost}}
</div> </div>
</div> </div>
</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