Commit 44d8dd9c by Kang Donghun

協業内ユーザー招待機能実装

parent 6644d05e
......@@ -25,7 +25,7 @@
<div class="d-flex align-items-center h-100">
<div class="collabo_nav_l text-left w-100">
</div>
<div class="collabo_nav_r none">
<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 menu_btn"></button>-->
......@@ -53,6 +53,7 @@
<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_collabo_change_host"></div>
......@@ -93,6 +94,7 @@
$("#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");
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
......
......@@ -1425,15 +1425,6 @@ $('#addUserConfirmBtn').on('click', function(e) {
$('#addUserForm').submit();
});
$('#addUserConfirmBtnInCollaboration').on('click', function(e) {
if (typeof(android) != "undefined") {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
} else {
webkit.messageHandlers.saveSelectedUserList.postMessage(CHAT.globalSelectedUserList.join(","));
}
$('#addUserFormInCollaboration').submit();
});
CHAT_UI.roomDisplayOff = function() {
if (typeof(android) != "undefined") {
android.roomDisplayOff();
......@@ -1645,8 +1636,6 @@ CHAT_UI.refreshAllGroupSearch = function(paramGroupId) {
CHAT_UI.dismissLoadingIndicator();
}
CHAT_UI.startChat = function(userShopMemberId,userName) {
CHAT_UI.showLoadingIndicator();
var userIdList = [];
......@@ -1659,13 +1648,22 @@ CHAT_UI.startChat = function(userShopMemberId,userName) {
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.NAME_CARD});
}
CHAT_UI.hideNamecard(nameCardAreaId.USER);
};
CHAT_UI.startVoice = function() {
};
CHAT_UI.startVoice = function(userShopMemberId, userName) {
CHAT_UI.showLoadingIndicator();
var userIdList = [];
userIdList.push(userShopMemberId);
// 参加ユーザ名でルーム名を生成
let newRoomName = CHAT.globalLoginParameter.loginId + ',' +userName;
if (typeof(android) != "undefined") {
android.createChatRoom(chatRoomType.DM, userIdList.join(','),newRoomName, makeRoomFlg.NAME_CARD);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.NAME_CARD});
}
CHAT_UI.startCollaboration(collaborationType.AUDIO);
}
CHAT_UI.makeNameCard = function(shopMemberId) {
if (CHAT.globalLoginParameter.shopMemberId == shopMemberId) {
......@@ -2224,7 +2222,7 @@ CHAT_UI.showAddUserConfirmView = function() {
userIdList.push(user.shopMemberId);
})
if (typeof(android) != "undefined") {
android.inviteUsers(userIdList.join(','));
android.inviteUsers(userIdList.join(','), false);
} else {
webkit.messageHandlers.inviteUsers.postMessage({"userIdList": userIdList.join(',')});
}
......@@ -2322,7 +2320,7 @@ CHAT_UI.refreshMyGroupForAddUser = function() {
});
$('#myGroupListForMakeRoom').append(obj);
})
});
}
CHAT_UI.refreshAllGroupForAddUser = function(paramGroupId) {
......@@ -2539,12 +2537,6 @@ CHAT_UI.refreshJoinedCollaboration = function(loginIdList, hostName) {
}
CHAT_UI.refreshMyGroupForAddUserInCollaboration = function() {
if (CHAT_DB.loadSelectedUsers() != "") {
let selectedUsers = CHAT_DB.loadSelectedUsers();
selectedUsers.forEach(function(user) {
CHAT.globalSelectedUserList.push(user.shopMemberId);
})
};
if (CHAT.globalSelectedUserList.length > 0) {
$('.select_member_num').text(CHAT.globalSelectedUserList.length);
} else {
......@@ -2557,20 +2549,20 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function() {
// グループの様式を読み込む
var groupTemplate;
$.get({ url: "./template/template_add_user_group_list.html", async: false }
$.get({ url: "./template/template_add_user_group_list_in_collaboration.html", async: false }
, function(text) {
groupTemplate = text;
});
// ユーザの様式を読み込む
var userTemplate;
$.get({ url: "./template/template_add_user_user_list.html", async: false }
$.get({ url: "./template/template_add_user_user_list_in_collaboration.html", async: false }
, function(text) {
userTemplate = text;
});
var groupUserTemplate;
$.get({ url: "./template/template_add_user_group_user_list.html", async: false }
$.get({ url: "./template/template_add_user_group_user_list_in_collaboration.html", async: false }
, function(text) {
groupUserTemplate = text;
});
......@@ -2638,8 +2630,8 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function() {
});
$('#myGroupListForAddUserInCollaboration').append(obj);
$('#addUserInCollaboration').modal('show');
});
$('#addUserInCollaboration').modal('show');
CHAT_UI.dismissLoadingIndicator();
}
......@@ -2668,7 +2660,6 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function(paramGroupId) {
//DBからグループ情報を取得。
var result = CHAT_DB.getGroupInfoForAddUser(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== 'undefined') {
$('#parentGroupBtnForAddUserInCollaboration').on('click', function() {
......@@ -2690,7 +2681,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function(paramGroupId) {
}
//該当グループのパースを表示。
var groupPathTemplate;
$.get({ url: "./template/template_add_user_group_path.html", async: false }
$.get({ url: "./template/template_add_user_group_path_in_collaboration.html", async: false }
, function(text) {
groupPathTemplate = text;
});
......@@ -2710,7 +2701,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function(paramGroupId) {
//該当グループの下位グループ表示。
var groupTemplate;
$.get({ url: "./template/template_add_user_group_list.html", async: false }
$.get({ url: "./template/template_add_user_group_list_in_collaboration.html", async: false }
, function(text) {
groupTemplate = text;
});
......@@ -2729,7 +2720,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function(paramGroupId) {
//該当グループの所属ユーザを表示。
var userTemplate;
$.get({ url: "./template/template_add_user_user_list.html", async: false }
$.get({ url: "./template/template_add_user_user_list_in_collaboration.html", async: false }
, function(text) {
userTemplate = text;
});
......@@ -2781,6 +2772,7 @@ CHAT_UI.makeNameCardInCollaboration = function(shopMemberId, isCollaborationHost
let namecardHtml = Mustache.render(namecardTemplate, {
shopMemberId: nameCardInfo.shopMemberId,
profileUrl: nameCardInfo.profileUrl,
loginId: nameCardInfo.loginId,
name: nameCardInfo.shopMemberName,
groupPathList: nameCardInfo.groupPathList,
isFavorite: nameCardInfo.isFavorite,
......@@ -2815,4 +2807,44 @@ CHAT_UI.insertFavoriteUserInCollaboration = function(shopMemberId) {
result = CHAT_DB.addFavoriteUser(shopMemberId);
}
CHAT_UI.dismissLoadingIndicator();
};
\ No newline at end of file
};
CHAT_UI.confirmInviteUserListInCollaboration = function() {
var selectedUsers = CHAT_DB.loadSelectedUsers();
if (selectedUsers != "") {
$('#selectedUserListinCollaboration').html('');
var selectedUserList = CHAT_DB.loadSelectedUsers();
selectedUserList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
var modalTemplate;
$.get({ url: "./modal_add_user_confirm.html", async: false }
, function(text) {
modalTemplate = text;
});
let html = Mustache.render(modalTemplate, {
userList: selectedUserList
});
let obj = jQuery.parseHTML(html);
$('#modal_add_user_confirm').html(obj);
$('#modalAddUserConfirm').modal('show');
} else {
}
$("#addUserBtn").off().on('click', function() {
CHAT_UI.showLoadingIndicator();
let userIdList = new Array();
selectedUserList.forEach(function(user){
userIdList.push(user.shopMemberId);
})
if (typeof(android) != "undefined") {
android.inviteUsers(userIdList.join(','), true);
} else {
webkit.messageHandlers.inviteUsers.postMessage({"userIdList": userIdList.join(',')});
}
$('#modalAddUserConfirm').modal('hide');
});
}
\ No newline at end of file
......@@ -77,7 +77,16 @@ $(function () {
// ユーザー招待メンバー検索
$(".add_user_btn").click(function () {
CHAT_UI.showLoadingIndicator();
CHAT.globalSelectedUserList = [];
CHAT_UI.refreshMyGroupForAddUserInCollaboration();
$('#addUserConfirmBtnInCollaboration').off().on('click', function() {
if (typeof(android) != "undefined") {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
} else {
webkit.messageHandlers.saveSelectedUserList.postMessage(CHAT.globalSelectedUserList.join(","));
}
CHAT_UI.confirmInviteUserListInCollaboration();
});
});
$('#penBtn').click(function () {
......
......@@ -45,15 +45,6 @@ $(function() {
});
$("#coviewShareCloseButton").on("click", function(e) {
coview_api.LeaveRoom();
$(".coview_share_area").hide();
});
$("body").on("click", function() {
Coview_shareDropdownHide();
});
$(document).on("click", ".coview_share_request", function() {
console.log("globalUserInfo", globalUserInfo);
if ($(this).hasClass(collaborationTypeKey.VIDEO) == true) {
......@@ -111,11 +102,7 @@ $(function() {
});
$("#coviewShareAudio").on("click", function() {
globalUserInfo.coWorkType = collaborationTypeKey.AUDIO;
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
Coview_moveToVideoShareArea();
$(".coview_share_title_name").text("音声通話");
Coview_connect_audio_collaboration();
})
......@@ -138,6 +125,7 @@ $(function() {
coview_api.addEventListener ("ready", function () {
console.log("=============> READY : ready for coview api");
Coview_addLoginId(globalUserInfo.loginId);
coview_api.Login(globalUserInfo.loginId);
});
......@@ -231,12 +219,20 @@ function Coview_exitCollaboration() {
CHAT_UI.joinRoom(CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.name);
}
function Coview_changeHost(shopMemberId) {
console.log("Change Host To " + shopMemberId);
coview_api.HostChange(shopMemberId);
function Coview_changeHost(userId) {
console.log("Change Host To " + userId);
changeOwnerSend(userId);
}
function Coview_addLoginId(loginId) {
console.log("addUser loginId = " + loginId);
coview_api.addUser(loginId);
}
\ No newline at end of file
}
function Coview_connect_audio_collaboration() {
globalUserInfo.coWorkType = collaborationTypeKey.AUDIO;
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
Coview_moveToVideoShareArea();
$(".coview_share_title_name").text("音声通話");
}
<div class="modal fade add_user_confirm_modal" id="modalAddUserConfirm" tabindex="-1" role="dialog"
aria-labelledby="modalAddUserConfirm" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header border-0 pb-0">
<span>ユーザー招待</span>
</div>
<div class="modal-body">
<div class="chat_list">
<h2>参加者</h2>
<ul class="p-0 chat_make_room_list">
<div id="selectedUserListinCollaboration">
{{#userList}}
<ul class="p-0 chat_make_room_list">
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l">
<div class="thumbnail">
<div class="img_wrap"><img src="{{profileUrl}}" onError="this.src='./img/noImage.png'"/></div>
</div>
</div>
<div class="chat_item_m px-0">
<div class="d-flex flex-column">
<div class="chat_item_t">
<span class="chat_item_ttl">{{shopMemberName}}</span>
</div>
</div>
</div>
</div>
</li>
</ul>
{{/userList}}
</div>
</ul>
</div>
</div>
<div class="modal-footer border-0 justify-content-center">
<button type="button" class="profile_favorite_btn bg_white border_gray text_blue" data-dismiss="modal"
aria-label="Close">
<div class="d-flex flex-column">
<span>キャンセル</span>
</div>
</button>
<button type="button" id="addUserBtn" class="profile_chat_btn border-0 bg_blue text_white">
<div class="d-flex flex-column">
<span>招待</span>
</div>
</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -5,24 +5,24 @@
<form id="addUserFormInCollaboration" action="chat_add_user_confirm.html" method="post">
<!-- ユーザー検索 -->
<!-- タブ -->
<div class="content tabs">
<nav class="nav-modal-add-user">
<div class="row h-100 align-items-center">
<div class="col-4 pr-0">
<div class="nav-item">
<a href="#" class="close_btn" class="close" data-dismiss="modal" aria-label="Close">閉じる</a>
</div>
<nav class="nav-modal-add-user">
<div class="row h-100 align-items-center">
<div class="col-4 pr-0">
<div class="nav-item">
<a href="#" class="close_btn" class="close" data-dismiss="modal" aria-label="Close">閉じる</a>
</div>
<div class="col-4 p-0">
<div class="nav-item p-0">
<h1 class="nav-ttl">ユーザー選択</h1>
</div>
</div>
<div class="col-4 p-0">
<div class="nav-item p-0">
<h1 class="nav-ttl">ユーザー選択</h1>
</div>
</div><!-- .row -->
</nav><!-- nav -->
<input id="tabMyGroupOnAddUserInCollaboration" type="radio" name="tab_item" checked>
</div>
</div><!-- .row -->
</nav><!-- nav -->
<div class="content tabs">
<input id="tabMyGroupOnAddUserInCollaboration" type="radio" name="tab_item" checked onclick="CHAT_UI.refreshMyGroupForAddUserInCollaboration();">
<label class="tab_item" for="tabMyGroupOnAddUserInCollaboration">マイグループ</label>
<input id="tabAllGroupOnAddUserInCollaboration" type="radio" name="tab_item">
<input id="tabAllGroupOnAddUserInCollaboration" type="radio" name="tab_item" onclick="CHAT_UI.refreshAllGroupForAddUserInCollaboration('0');">
<label class="tab_item" for="tabAllGroupOnAddUserInCollaboration">全グループ</label>
<div class="tab_content" id="tab1_content">
<div class="chat_list">
......@@ -80,7 +80,7 @@
</div>
</div>
<!-- ルーム解説ボタン -->
<div class="make_room_confirm_btn content" id="addUserConfirmBtnInCollaboration">
<div class="add_user_confirm_btn content" id="addUserConfirmBtnInCollaboration">
<button type="button" name="button" id="buttonAddUser">
確認<br>
<span class="select_member_num"></span><span class="select_member">名 選択中</span></button>
......
......@@ -13,7 +13,7 @@
</div>
<div class="modal-body">
{{#groupPathList}}
<li onclick="CHAT_UI.refreshAllGroupSearch({{groupId}});"><b>{{groupPath}}</b></li>
<li onclick="return false;"><b>{{groupPath}}</b></li>
{{/groupPathList}}
</div>
<div class="modal-footer border-0 justify-content-center">
......@@ -38,8 +38,7 @@
</button>
{{/isFavorite}}
<!-- {{^isHost}}-->
<button type="button" class="ch_host_btn border-0 bg_grey text_white" data-toggle="modal"
data-target="#changeHostModal" value="#profileModal1" 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="img_wrap">
<img src="icon/icon_change_host.png" alt="ホスト変更">
......
<li class="d-flex align-items-center">
<a href="#" class="w-100" onclick="CHAT_UI.refreshAllGroupForAddUserInCollaboration({{id}});">
<div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l">
<div class="thumbnail">
<img src="icon/icon_folder.png" alt="フォルダ" />
</div>
</div>
<div class="chat_item_m px-0">
<div class="d-flex flex-column">
<div class="chat_item_t">
<span class="chat_item_ttl">{{name}}</span>
</div>
</div>
</div>
</div>
</a>
</li>
\ No newline at end of file
<a href="#" class="breadcrumb_item" onclick="CHAT_UI.refreshAllGroupForAddUserInCollaboration({{id}});"><span>{{name}}</span></a>
\ No newline at end of file
<div class="category" onclick="CHAT_UI.toggleCategory(this);"><div class="category_name"><span>{{groupName}}</span></div></div>
<ul class="p-0 chat_make_room_list">
{{#groupUserList}}
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100" onclick="CHAT_UI.checkForMakeChat({{shopMemberId}});" >
<div class="chat_item_l_chk">
<div class="checkbox">
<label>
<input type="checkbox" id="checkbox{{shopMemberId}}" name="checkbox[]" class="checkbox-input checkbox{{shopMemberId}}" onclick="CHAT_UI.checkForMakeChat({{shopMemberId}});" {{checked}}>
<span class="checkbox-parts"></span>
</label>
</div>
</div>
<div class="chat_item_l">
<div class="thumbnail">
<div class="img_wrap"><img src="{{profileUrl}}" onError="this.src='./img/noImage.png'"/></div>
</div>
</div>
<div class="chat_item_m">
<div class="d-flex flex-column">
<div class="chat_item_t">
<span class="chat_item_ttl">{{shopMemberName}}</span>
</div>
</div>
</div>
</div>
</li>
{{/groupUserList}}
</ul>
\ No newline at end of file
<ul class="p-0 chat_make_room_list">
{{#userList}}
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100" onclick="CHAT_UI.checkForMakeChat({{shopMemberId}});" >
<div class="chat_item_l_chk">
<div class="checkbox">
<label>
<input type="checkbox" id="checkbox{{shopMemberId}}" name="checkbox[]" class="checkbox-input checkbox{{shopMemberId}}" onclick="CHAT_UI.checkForMakeChat({{shopMemberId}});" {{checked}}>
<span class="checkbox-parts"></span>
</label>
</div>
</div>
<div class="chat_item_l">
<div class="thumbnail">
<div class="img_wrap"><img src="{{profileUrl}}" onError="this.src='./img/noImage.png'" /></div>
</div>
</div>
<div class="chat_item_m">
<div class="d-flex flex-column">
<div class="chat_item_t">
<span class="chat_item_ttl">{{shopMemberName}}</span>
</div>
</div>
</div>
</div>
</li>
{{/userList}}
</ul>
\ No newline at end of file
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