Commit 43cc7cac by Kim Peace

Seperate collaboration js

parent ac2f8381
...@@ -81,14 +81,6 @@ ...@@ -81,14 +81,6 @@
</div> </div>
</main> </main>
<div class="coview_share_photo_select_bubble none">
<button id="coviewSharePhotoCamera" class="coview_share_photo_select_bubble_in_button cam">
</button>
<BR>
<button id="coviewSharePhotoGallery" class="coview_share_photo_select_bubble_in_button gal">
</button>
</div>
<!-- ユーザー追加オーバーレイ --> <!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div> <div id="add_user_list"></div>
<div id="modal_add_user_confirm"></div> <div id="modal_add_user_confirm"></div>
...@@ -161,6 +153,8 @@ ...@@ -161,6 +153,8 @@
<script src="./js/views/collaboration/collaboration-add-user.js"></script> <script src="./js/views/collaboration/collaboration-add-user.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/views/collaboration/share.js"></script> <script src="./js/views/collaboration/share.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-message-handler.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-bridge.js"></script>
<script src="./js/views/collaboration/share-bind-button-action.js"></script> <script src="./js/views/collaboration/share-bind-button-action.js"></script>
<script src="./js/views/collaboration/share-event-listener.js"></script> <script src="./js/views/collaboration/share-event-listener.js"></script>
<script src="./js/views/contact/namecard.js"></script> <script src="./js/views/contact/namecard.js"></script>
...@@ -200,7 +194,7 @@ ...@@ -200,7 +194,7 @@
} }
} }
initCollaborationUI(joinCollaborationType); updateCollaborationUI(joinCollaborationType);
globalUserInfo.coWorkType = CHAT_UTIL.getCoviewTypeFromCollaborationType(joinCollaborationType); globalUserInfo.coWorkType = CHAT_UTIL.getCoviewTypeFromCollaborationType(joinCollaborationType);
if (collaborationJoinFlg != '2') { if (collaborationJoinFlg != '2') {
CHAT_SOCKET.initialJoin(); CHAT_SOCKET.initialJoin();
......
...@@ -45,14 +45,6 @@ ...@@ -45,14 +45,6 @@
</div> </div>
</main> </main>
<div class="coview_share_photo_select_bubble none">
<button id="coviewSharePhotoCamera" class="coview_share_photo_select_bubble_in_button cam">
</button>
<BR>
<button id="coviewSharePhotoGallery" class="coview_share_photo_select_bubble_in_button gal">
</button>
</div>
<!-- ユーザー追加オーバーレイ --> <!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div> <div id="add_user_list"></div>
<div id="modal_add_user_confirm"></div> <div id="modal_add_user_confirm"></div>
...@@ -165,6 +157,8 @@ ...@@ -165,6 +157,8 @@
<script src="./js/views/collaboration/collaboration-add-user.js"></script> <script src="./js/views/collaboration/collaboration-add-user.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/views/collaboration/share.js"></script> <script src="./js/views/collaboration/share.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-message-handler.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-bridge.js"></script>
<script src="./js/views/collaboration/share-bind-button-action.js"></script> <script src="./js/views/collaboration/share-bind-button-action.js"></script>
<script src="./js/views/collaboration/share-event-listener.js"></script> <script src="./js/views/collaboration/share-event-listener.js"></script>
<script src="./js/views/contact/namecard.js"></script> <script src="./js/views/contact/namecard.js"></script>
......
...@@ -48,14 +48,6 @@ ...@@ -48,14 +48,6 @@
</div> </div>
</main> </main>
<div class="coview_share_photo_select_bubble none">
<button id="coviewSharePhotoCamera" class="coview_share_photo_select_bubble_in_button cam">
</button>
<BR>
<button id="coviewSharePhotoGallery" class="coview_share_photo_select_bubble_in_button gal">
</button>
</div>
<!-- ユーザー追加オーバーレイ --> <!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div> <div id="add_user_list"></div>
<div id="modal_add_user_confirm"></div> <div id="modal_add_user_confirm"></div>
...@@ -154,6 +146,8 @@ ...@@ -154,6 +146,8 @@
<script src="./js/views/collaboration/collaboration-add-user.js"></script> <script src="./js/views/collaboration/collaboration-add-user.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/views/collaboration/share.js"></script> <script src="./js/views/collaboration/share.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-message-handler.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-bridge.js"></script>
<script src="./js/views/collaboration/share-bind-button-action.js"></script> <script src="./js/views/collaboration/share-bind-button-action.js"></script>
<script src="./js/views/collaboration/share-event-listener.js"></script> <script src="./js/views/collaboration/share-event-listener.js"></script>
<script src="./js/views/contact/namecard.js"></script> <script src="./js/views/contact/namecard.js"></script>
......
...@@ -99,6 +99,8 @@ ...@@ -99,6 +99,8 @@
<script src="./js/views/collaboration/collaboration-add-user.js"></script> <script src="./js/views/collaboration/collaboration-add-user.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/views/collaboration/share.js"></script> <script src="./js/views/collaboration/share.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-message-handler.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-bridge.js"></script>
<script src="./js/views/collaboration/share-bind-button-action.js"></script> <script src="./js/views/collaboration/share-bind-button-action.js"></script>
<script src="./js/views/collaboration/share-event-listener.js"></script> <script src="./js/views/collaboration/share-event-listener.js"></script>
<script src="./js/views/contact/namecard.js"></script> <script src="./js/views/contact/namecard.js"></script>
......
...@@ -44,14 +44,6 @@ ...@@ -44,14 +44,6 @@
</div> </div>
</main> </main>
<div class="coview_share_photo_select_bubble none">
<button id="coviewSharePhotoCamera" class="coview_share_photo_select_bubble_in_button cam">
</button>
<BR>
<button id="coviewSharePhotoGallery" class="coview_share_photo_select_bubble_in_button gal">
</button>
</div>
<!-- ユーザー追加オーバーレイ --> <!-- ユーザー追加オーバーレイ -->
<div id="add_user_list"></div> <div id="add_user_list"></div>
<div id="modal_add_user_confirm"></div> <div id="modal_add_user_confirm"></div>
...@@ -156,6 +148,8 @@ ...@@ -156,6 +148,8 @@
<script src="./js/views/collaboration/collaboration-add-user.js"></script> <script src="./js/views/collaboration/collaboration-add-user.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/views/collaboration/share.js"></script> <script src="./js/views/collaboration/share.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-message-handler.js"></script>
<script src="./js/views/collaboration/fermi-web-socket-bridge.js"></script>
<script src="./js/views/collaboration/share-bind-button-action.js"></script> <script src="./js/views/collaboration/share-bind-button-action.js"></script>
<script src="./js/views/collaboration/share-event-listener.js"></script> <script src="./js/views/collaboration/share-event-listener.js"></script>
<script src="./js/views/contact/namecard.js"></script> <script src="./js/views/contact/namecard.js"></script>
......
#coviewShareMainBtn{
padding-top: 9px;
}
.white_board #canvasRemote { .white_board #canvasRemote {
background-color: white !important; background-color: white !important;
...@@ -32,34 +30,6 @@ ...@@ -32,34 +30,6 @@
display: none !important; display: none !important;
} }
.coview_share_dropdown_bar{
display: none;
list-style: none;
padding: unset;
margin: unset;
/* padding-top: 58px; */
background: #000;
position: absolute;
width: 100%;
top: 57px;
left: 0px;
padding-top: 10px;
}
.coview_share_dropdown_bar ul{
list-style: none;
padding: unset;
margin: unset;
}
.coview_share_dropdown_bar li{
display: inline-block;
width: 24%;
height: 75px;
line-height: 52px;
margin: unset;
padding: unset;
background: #000;
text-align: center;
}
.coview_share_dropdown_btn{ .coview_share_dropdown_btn{
background: transparent; background: transparent;
border: none; border: none;
...@@ -92,51 +62,7 @@ ...@@ -92,51 +62,7 @@
margin-top: 4px; margin-top: 4px;
color: #fff; color: #fff;
} }
.coview_share_title_name{
display: inline-block;
height: 58px;
line-height: 58px;
padding: 0;
margin: 0;
color: #fff;
}
.coview_share_photo_select_bubble{
display: none;
position: absolute;
padding: 2px;
background: #3e3e3e;
border-radius: 5px;
margin-top: 156px;
margin-left: 117px;
font-size: 12px;
}
.coview_share_photo_select_bubble:after{
border-top: 0 solid transparent;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 10px solid #3e3e3e;
content: "";
position: absolute;
top: -10px;
left: 22px;
}
.coview_share_photo_select_bubble_in_button{
width: 106px;
height: 39px;
border: none;
text-align: left;
}
.coview_share_photo_select_bubble_in_button.cam{
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.coview_share_photo_select_bubble_in_button.gal{
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-top: solid 0.7px #000;
}
.coview_share_photo_select_bubble_in_button_img{ .coview_share_photo_select_bubble_in_button_img{
width: 27%; width: 27%;
} }
...@@ -144,15 +70,6 @@ ...@@ -144,15 +70,6 @@
margin-left: 5px; margin-left: 5px;
} }
.coview_share_request{
width: 100%;
height: 4em;
background-image: linear-gradient(to top, #82b127, #30c8d2);
color: #fff;
border: none;
border-radius: 5px;
}
.coview_on_screen_btn_area { .coview_on_screen_btn_area {
display: none !important; display: none !important;
} }
......
...@@ -110,6 +110,7 @@ const TemplateURL = { ...@@ -110,6 +110,7 @@ const TemplateURL = {
"./template/template_add_user_group_path_in_collaboration.html", "./template/template_add_user_group_path_in_collaboration.html",
COLLABORATION_PROFILE: "./modal_collabo_profile.html", COLLABORATION_PROFILE: "./modal_collabo_profile.html",
COLLABORATION_OVERLAY_USER_LIST: "collaboration_overlay_user_list.html", COLLABORATION_OVERLAY_USER_LIST: "collaboration_overlay_user_list.html",
MODAL_ADD_USER_CONFIRM: "./modal_add_user_confirm.html",
}; };
const SOCKET_KEY = { const SOCKET_KEY = {
......
...@@ -5,6 +5,7 @@ var bindOnNewMessage = function () { ...@@ -5,6 +5,7 @@ var bindOnNewMessage = function () {
const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE); const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
const unwrappedMessageInfo = decodeMessage(message.text); const unwrappedMessageInfo = decodeMessage(message.text);
if ( if (
unwrappedMessageInfo == unwrappedMessageInfo ==
DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL
...@@ -34,10 +35,12 @@ var bindOnNewMessage = function () { ...@@ -34,10 +35,12 @@ var bindOnNewMessage = function () {
} }
} }
// 画像、動画の描画を待ってからスクロール if (typeof ChatRoom !== "undefined") {
setTimeout(function () { // 画像、動画の描画を待ってからスクロール
ChatRoom.scrollToBottom(); setTimeout(function () {
}, 300); ChatRoom.scrollToBottom();
}, 300);
}
}); });
}; };
......
...@@ -193,6 +193,13 @@ CHAT_SOCKET.emitCreateMessage = function (sendData, offset) { ...@@ -193,6 +193,13 @@ CHAT_SOCKET.emitCreateMessage = function (sendData, offset) {
socket.emit(SOCKET_KEY.CREATE_MESSAGE, { text: sendData }, offset); socket.emit(SOCKET_KEY.CREATE_MESSAGE, { text: sendData }, offset);
}; };
CHAT_SOCKET.emitCollaborationFinishMessage = function () {
if (socket != null && socket.connected) {
const sendData = DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL;
CHAT_SOCKET.emitCreateMessage(sendData, 0);
}
}
CHAT_SOCKET.emitGetGroupList = function (isInvite) { CHAT_SOCKET.emitGetGroupList = function (isInvite) {
socket.emit(SOCKET_KEY.GET_GROUP_LIST, isInvite); socket.emit(SOCKET_KEY.GET_GROUP_LIST, isInvite);
}; };
......
CollaborationUI.bindAddUserButton = function () { CollaborationUI.bindAddUserButton = function () {
// ユーザー招待メンバー検索 // ユーザー招待メンバー検索
$(".add_user_btn").click(function () { $(".add_user_btn").click(function () {
enableScroll(); CollaborationUI.enableScroll();
Common.showLoadingIndicator(); Common.showLoadingIndicator();
ChatManagementCommon.selectedUserList = []; ChatManagementCommon.selectedUserList = [];
CollaborationUI.refreshMyGroupForAddUserInCollaboration(); CollaborationUI.refreshMyGroupForAddUserInCollaboration();
...@@ -36,22 +36,23 @@ CollaborationUI.refreshMyGroupForAddUserInCollaboration = function () { ...@@ -36,22 +36,23 @@ CollaborationUI.refreshMyGroupForAddUserInCollaboration = function () {
$("#tabMyGroupOnAddUserInCollaboration").prop("checked", true); $("#tabMyGroupOnAddUserInCollaboration").prop("checked", true);
// グループの様式を読み込む NativeBridgeDelegate.updateContactInfo();
const groupTemplate = getTemplate(
TemplateURL.ADD_USER_GROUP_LIST_IN_COLLABORATION
);
// ユーザの様式を読み込む CollaborationUI.appendFavoriteGroupList();
const userTemplate = getTemplate(
TemplateURL.ADD_USER_USER_LIST_IN_COLLABORATION
);
const groupUserTemplate = getTemplate( CollaborationUI.appendFavoriteUserList();
TemplateURL.ADD_USER_GROUP_USER_LIST_IN_COLLABORATION
);
NativeBridgeDelegate.updateContactInfo(); CollaborationUI.appendMyGroupList();
$("#addUserInCollaboration").modal("show");
Common.dismissLoadingIndicator();
};
CollaborationUI.appendFavoriteGroupList = function () {
// グループの様式を読み込む
const groupTemplate = getTemplate(
TemplateURL.ADD_USER_GROUP_LIST_IN_COLLABORATION
);
//お気に入りグループ取得。 //お気に入りグループ取得。
const favoriteGroupList = NativeBridgeDataSource.getFavoriteGroups(); const favoriteGroupList = NativeBridgeDataSource.getFavoriteGroups();
favoriteGroupList.forEach(function (favoriteGroup) { favoriteGroupList.forEach(function (favoriteGroup) {
...@@ -63,6 +64,13 @@ CollaborationUI.refreshMyGroupForAddUserInCollaboration = function () { ...@@ -63,6 +64,13 @@ CollaborationUI.refreshMyGroupForAddUserInCollaboration = function () {
let obj = $(jQuery.parseHTML(html)).on("click", function () {}); let obj = $(jQuery.parseHTML(html)).on("click", function () {});
$("#favoriteListForAddUserInCollaboration").append(obj); $("#favoriteListForAddUserInCollaboration").append(obj);
}); });
};
CollaborationUI.appendFavoriteUserList = function () {
// ユーザの様式を読み込む
const userTemplate = getTemplate(
TemplateURL.ADD_USER_USER_LIST_IN_COLLABORATION
);
//お気に入りユーザ取得。 //お気に入りユーザ取得。
const favoriteUserList = NativeBridgeDataSource.getFavoriteUsersNotInRoom(); const favoriteUserList = NativeBridgeDataSource.getFavoriteUsersNotInRoom();
favoriteUserList.forEach(function (favoriteUser) { favoriteUserList.forEach(function (favoriteUser) {
...@@ -81,15 +89,20 @@ CollaborationUI.refreshMyGroupForAddUserInCollaboration = function () { ...@@ -81,15 +89,20 @@ CollaborationUI.refreshMyGroupForAddUserInCollaboration = function () {
}); });
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$("#favoriteListForAddUserInCollaboration").append(obj); $("#favoriteListForAddUserInCollaboration").append(obj);
};
CollaborationUI.appendMyGroupList = function () {
const groupUserTemplate = getTemplate(
TemplateURL.ADD_USER_GROUP_USER_LIST_IN_COLLABORATION
);
const myGroupList = NativeBridgeDataSource.getMyGroupUsersNotInRoom(); const myGroupList = NativeBridgeDataSource.getMyGroupUsersNotInRoom();
myGroupList.forEach(function (myGroup) { myGroupList.forEach(function (myGroup) {
myGroup.groupUserList.forEach(function (groupUser) { myGroup.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = Common.getProfileImgUrl(groupUser.profileUrl); groupUser.profileUrl = Common.getProfileImgUrl(groupUser.profileUrl);
let findObj = ChatManagementCommon.selectedUserList.find(function ( let findObj = ChatManagementCommon.selectedUserList.find(function (
shopMemberId shopMemberID
) { ) {
return shopMemberId == groupUser.shopMemberId; return shopMemberID == groupUser.shopMemberId;
}); });
if (findObj) { if (findObj) {
groupUser.checked = "checked"; groupUser.checked = "checked";
...@@ -103,19 +116,14 @@ CollaborationUI.refreshMyGroupForAddUserInCollaboration = function () { ...@@ -103,19 +116,14 @@ CollaborationUI.refreshMyGroupForAddUserInCollaboration = function () {
$("#myGroupListForAddUserInCollaboration").append(obj); $("#myGroupListForAddUserInCollaboration").append(obj);
}); });
$("#addUserInCollaboration").modal("show");
Common.dismissLoadingIndicator();
}; };
CollaborationUI.refreshAllGroupForAddUserInCollaboration = function ( CollaborationUI.refreshAllGroupForAddUserInCollaboration = function (groupID) {
paramGroupId
) {
var groupId = paramGroupId;
$(".content").removeClass("none"); $(".content").removeClass("none");
$("#tabAllGroupOnAddUserInCollaboration").prop("checked", true); $("#tabAllGroupOnAddUserInCollaboration").prop("checked", true);
NativeBridgeDelegate.updateGroupInfo(groupId); NativeBridgeDelegate.updateGroupInfo(groupID);
//画面エリアを初期化。 //画面エリアを初期化。
$("#parentGroupBtnForAddUserInCollaboration").off(); $("#parentGroupBtnForAddUserInCollaboration").off();
...@@ -125,40 +133,62 @@ CollaborationUI.refreshAllGroupForAddUserInCollaboration = function ( ...@@ -125,40 +133,62 @@ CollaborationUI.refreshAllGroupForAddUserInCollaboration = function (
$("#groupPathAreaForAddUserInCollaboration").html(""); $("#groupPathAreaForAddUserInCollaboration").html("");
//DBからグループ情報を取得。 //DBからグループ情報を取得。
var result = NativeBridgeDataSource.getGroupInfoForAddUser(groupId); const result = NativeBridgeDataSource.getGroupInfoForAddUser(groupID);
//上位グループ、トップグループ遷移ボタンのイベント追加。 //上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") { CollaborationUI.appendRootGroupAndParentGroupIfNeeded(
$("#parentGroupBtnForAddUserInCollaboration").on("click", function () { result.rootGroupId,
CollaborationUI.refreshAllGroupForAddUserInCollaboration( result.parentGroupId,
result.parentGroupId groupID
); );
});
} //該当グループのパースを表示。
if (typeof result.rootGroupId !== "undefined") { CollaborationUI.appendGroupPath(result.groupPathList);
if (paramGroupId == 0) {
groupId = result.rootGroupId; //該当グループの下位グループ表示。
} CollaborationUI.appendChildGroups(result.childGroupList);
$("#rootGroupBtnForAddUserInCollaboration").on("click", function () {
CollaborationUI.refreshAllGroupForAddUserInCollaboration( //該当グループの所属ユーザを表示。
result.rootGroupId CollaborationUI.appendUsers();
); };
});
CollaborationUI.bindOnClickParentGroup = function (parentGroupID) {
$("#parentGroupBtnForAddUserInCollaboration").on("click", function () {
CollaborationUI.refreshAllGroupForAddUserInCollaboration(parentGroupID);
});
};
CollaborationUI.bindOnClickRootGroup = function (rootGroupID) {
$("#rootGroupBtnForAddUserInCollaboration").on("click", function () {
CollaborationUI.refreshAllGroupForAddUserInCollaboration(rootGroupID);
});
};
CollaborationUI.displayRootGroupAndParentGroupIfNeeded = function (
rootGroupID,
groupID
) {
if (typeof rootGroupID !== "undefined" && paramGroupID == 0) {
groupID = rootGroupID;
} }
if (groupId == result.rootGroupId || paramGroupId == "0") {
if (groupID == rootGroupID || groupID == "0") {
$("#rootGroupAreaInCollaboration").addClass("none"); $("#rootGroupAreaInCollaboration").addClass("none");
$("#parentGroupAreaInCollaboration").addClass("none"); $("#parentGroupAreaInCollaboration").addClass("none");
} else { } else {
$("#rootGroupAreaInCollaboration").removeClass("none"); $("#rootGroupAreaInCollaboration").removeClass("none");
$("#parentGroupAreaInCollaboration").removeClass("none"); $("#parentGroupAreaInCollaboration").removeClass("none");
} }
//該当グループのパースを表示。 };
var groupPathTemplate = getTemplate(
CollaborationUI.appendGroupPath = function (groupPathList) {
const groupPathTemplate = getTemplate(
TemplateURL.ADD_USER_GROUP_PATH_IN_COLLABORATION TemplateURL.ADD_USER_GROUP_PATH_IN_COLLABORATION
); );
var groupPathCount = 0; let groupPathCount = 0;
result.groupPathList.forEach(function (groupPath) { groupPathList.forEach(function (groupPath) {
if (!(groupPathCount < result.groupPathList.length - 3)) { if (!(groupPathCount < groupPathList.length - 3)) {
let html = Mustache.render(groupPathTemplate, { let html = Mustache.render(groupPathTemplate, {
name: groupPath.groupName, name: groupPath.groupName,
id: groupPath.groupId, id: groupPath.groupId,
...@@ -168,13 +198,14 @@ CollaborationUI.refreshAllGroupForAddUserInCollaboration = function ( ...@@ -168,13 +198,14 @@ CollaborationUI.refreshAllGroupForAddUserInCollaboration = function (
} }
groupPathCount++; groupPathCount++;
}); });
};
//該当グループの下位グループ表示。 CollaborationUI.appendChildGroups = function (chidGroups) {
var groupTemplate = getTemplate( const groupTemplate = getTemplate(
TemplateURL.ADD_USER_GROUP_LIST_IN_COLLABORATION TemplateURL.ADD_USER_GROUP_LIST_IN_COLLABORATION
); );
result.childGroupList.forEach(function (childGroup) { chidGroups.forEach(function (childGroup) {
let html = Mustache.render(groupTemplate, { let html = Mustache.render(groupTemplate, {
name: childGroup.groupName, name: childGroup.groupName,
id: childGroup.groupId, id: childGroup.groupId,
...@@ -183,30 +214,47 @@ CollaborationUI.refreshAllGroupForAddUserInCollaboration = function ( ...@@ -183,30 +214,47 @@ CollaborationUI.refreshAllGroupForAddUserInCollaboration = function (
let obj = $(jQuery.parseHTML(html)).on("click", function () {}); let obj = $(jQuery.parseHTML(html)).on("click", function () {});
$("#childGroupListAreaForAddUserInCollaboration").append(obj); $("#childGroupListAreaForAddUserInCollaboration").append(obj);
}); });
};
//該当グループの所属ユーザを表示。 CollaborationUI.appendUsers = function (userList) {
var userTemplate = getTemplate( const userTemplate = getTemplate(
TemplateURL.ADD_USER_USER_LIST_IN_COLLABORATION TemplateURL.ADD_USER_USER_LIST_IN_COLLABORATION
); );
result.groupUserList.forEach(function (groupUser) { userList.forEach(function (groupUser) {
groupUser.profileUrl = Common.getProfileImgUrl(groupUser.profileUrl); groupUser.profileUrl = Common.getProfileImgUrl(groupUser.profileUrl);
let findObj = ChatManagementCommon.selectedUserList.find(function ( let findObj = ChatManagementCommon.selectedUserList.find(function (
shopMemberId shopMemberID
) { ) {
return shopMemberId == groupUser.shopMemberId; return shopMemberID == groupUser.shopMemberId;
}); });
if (findObj) { if (findObj) {
groupUser.checked = "checked"; groupUser.checked = "checked";
} }
}); });
let html = Mustache.render(userTemplate, { let html = Mustache.render(userTemplate, {
userList: result.groupUserList, userList: userList,
}); });
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$("#userInGroupListForAddUserInCollaboration").append(obj); $("#userInGroupListForAddUserInCollaboration").append(obj);
}; };
CollaborationUI.appendRootGroupAndParentGroupIfNeeded = function (
rootGroupID,
parentGroupID,
groupID
) {
if (typeof parentGroupID !== "undefined") {
CollaborationUI.bindOnClickParentGroup(parentGroupID);
}
if (typeof rootGroupID !== "undefined") {
CollaborationUI.bindOnClickRootGroup(rootGroupID);
}
CollaborationUI.displayRootGroupAndParentGroupIfNeeded(rootGroupID, groupID);
};
CollaborationUI.confirmInviteUserListInCollaboration = function () { CollaborationUI.confirmInviteUserListInCollaboration = function () {
const selectedUsers = NativeBridgeDataSource.loadSelectedUsers(); const selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") { if (selectedUsers != "") {
...@@ -216,14 +264,9 @@ CollaborationUI.confirmInviteUserListInCollaboration = function () { ...@@ -216,14 +264,9 @@ CollaborationUI.confirmInviteUserListInCollaboration = function () {
user.profileUrl = Common.getProfileImgUrl(user.profileUrl); user.profileUrl = Common.getProfileImgUrl(user.profileUrl);
}); });
var modalTemplate; const modalTemplate = getTemplate(TemplateURL.MODAL_ADD_USER_CONFIRM);
$.get(
{ url: "./modal_add_user_confirm.html", async: false }, const html = Mustache.render(modalTemplate, {
function (text) {
modalTemplate = text;
}
);
let html = Mustache.render(modalTemplate, {
userList: selectedUsers, userList: selectedUsers,
}); });
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
...@@ -231,21 +274,26 @@ CollaborationUI.confirmInviteUserListInCollaboration = function () { ...@@ -231,21 +274,26 @@ CollaborationUI.confirmInviteUserListInCollaboration = function () {
$("#modalAddUserConfirm").modal("show"); $("#modalAddUserConfirm").modal("show");
} }
CollaborationUI.bindCancelAddUserButton();
CollaborationUI.bindAddUserButton(selectedUsers);
};
CollaborationUI.bindCancelAddUserButton = function () {
$("#cancelAddUserBtn") $("#cancelAddUserBtn")
.off() .off()
.on("click", function () { .on("click", function () {
$("#modalAddUserConfirm").modal("hide"); $("#modalAddUserConfirm").modal("hide");
$("#addUserInCollaboration").modal("show"); $("#addUserInCollaboration").modal("show");
}); });
};
CollaborationUI.bindAddUserButton = function (selectedUsers) {
$("#addUserBtn") $("#addUserBtn")
.off() .off()
.on("click", function () { .on("click", function () {
Common.showLoadingIndicator(); Common.showLoadingIndicator();
let userIDList = selectedUsers.map((user) => user.shopMemberId); let userIDList = selectedUsers.map((user) => user.shopMemberId);
selectedUsers.forEach(function (user) {
userIDList.push(user.shopMemberId);
});
const commaJoinedUserIDList = userIDList.join(","); const commaJoinedUserIDList = userIDList.join(",");
const collaborationType = CHAT_UTIL.getCollaborationType( const collaborationType = CHAT_UTIL.getCollaborationType(
globalUserInfo.coWorkType globalUserInfo.coWorkType
...@@ -264,4 +312,4 @@ CollaborationUI.confirmInviteUserListInCollaboration = function () { ...@@ -264,4 +312,4 @@ CollaborationUI.confirmInviteUserListInCollaboration = function () {
CollaborationUI.toggleCategory = function (category) { CollaborationUI.toggleCategory = function (category) {
$(category).toggleClass("open"); $(category).toggleClass("open");
$(category).next().slideToggle(); $(category).next().slideToggle();
}; };
\ No newline at end of file
var CollaborationUI = {}; var CollaborationUI = {};
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
disableScroll(); CollaborationUI.disableScroll();
// メニューオーバーレイ表示 // メニューオーバーレイ表示
CollaborationUI.bindMenuButton();
// ユーザーリストオーバーレイ表示
CollaborationUI.bindDisplayUsersButton();
// モーダルonモーダル(前のモーダルを非表示に)
// ホスト変更ボタン押下イベント
CollaborationUI.bindChangeHostButton();
// 閉じるイベント
CollaborationUI.bindCloseButton();
// ユーザー追加イベント
CollaborationUI.bindInviteButton();
CollaborationUI.bindAddUserButton();
});
/*********************************
* Buttons binding events
********************************/
CollaborationUI.bindMenuButton = function () {
$(".menu_btn").click(function () { $(".menu_btn").click(function () {
var w = $(this).width(); var w = $(this).width();
$(this).toggleClass("hide"); $(this).toggleClass("hide");
$("#overlay_menu .item").toggleClass("hide"); $("#overlay_menu .item").toggleClass("hide");
}); });
};
// ユーザーリストオーバーレイ表示 CollaborationUI.bindDisplayUsersButton = function () {
$(".user_btn").click(function () { $(".user_btn").click(function () {
var w = $(this).width(); var w = $(this).width();
...@@ -21,58 +44,65 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -21,58 +44,65 @@ document.addEventListener("DOMContentLoaded", function () {
.css({ transform: "translateX(" & -w & ")" }); .css({ transform: "translateX(" & -w & ")" });
if ($(this).hasClass("hide")) { if ($(this).hasClass("hide")) {
enableScroll(); CollaborationUI.enableScroll();
} else { } else {
scrollTo(0, 0); scrollTo(0, 0);
disableScroll(); CollaborationUI.disableScroll();
} }
}); });
};
// モーダルonモーダル(前のモーダルを非表示に) CollaborationUI.bindChangeHostButton = function () {
// ホスト変更ボタン押下イベント
$(".ch_host_btn").click(function () { $(".ch_host_btn").click(function () {
const target = $(this).val(); const target = $(this).val();
changeModal(target, "changeHostModal"); const beforeModal = $(target);
const afterModal = $("#changeHostModal");
/* モーダルの切り替え */
beforeModal.modal("hide");
afterModal.modal("show");
}); });
};
/* モーダルの切り替え */ CollaborationUI.bindCloseButton = function () {
function changeModal(beforeModal, afterModal) {
$(beforeModal).modal("hide");
$(afterModal).modal("show");
}
// 閉じるイベント
$(".close_btn").click(function () { $(".close_btn").click(function () {
$("#overlay_add_user_list").addClass("none"); $("#overlay_add_user_list").addClass("none");
disableScroll(); CollaborationUI.disableScroll();
}); });
};
// ユーザー追加イベント CollaborationUI.bindInviteButton = function () {
$(".inv_btn").click(function () { $(".inv_btn").click(function () {
$("#overlay_add_user_list").addClass("none"); $("#overlay_add_user_list").addClass("none");
}); });
};
CollaborationUI.bindAddUserButton(); /*********************************
}); * Scroll Controls
********************************/
function disableScroll() { CollaborationUI.disableScroll = function () {
document.addEventListener("mousewheel", scrollControl, { passive: false }); document.addEventListener("mousewheel", CollaborationUI.scrollControl, {
document.addEventListener("touchmove", scrollControl, { passive: false }); passive: false,
} });
document.addEventListener("touchmove", CollaborationUI.scrollControl, {
passive: false,
});
};
// スクロール禁止解除 // スクロール禁止解除
function enableScroll() { CollaborationUI.enableScroll = function () {
document.removeEventListener("mousewheel", scrollControl, { document.removeEventListener("mousewheel", CollaborationUI.scrollControl, {
passive: false,
});
document.removeEventListener("touchmove", CollaborationUI.scrollControl, {
passive: false, passive: false,
}); });
document.removeEventListener("touchmove", scrollControl, { passive: false }); };
}
function scrollControl(event) { CollaborationUI.scrollControl = function (event) {
if (event.cancelable) { if (event.cancelable) {
event.preventDefault(); event.preventDefault();
} }
} };
/********************************* /*********************************
* NameCard in Collaboration * NameCard in Collaboration
...@@ -126,48 +156,6 @@ CollaborationUI.insertFavoriteUserInCollaboration = function (shopMemberId) { ...@@ -126,48 +156,6 @@ CollaborationUI.insertFavoriteUserInCollaboration = function (shopMemberId) {
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
}; };
// Display User List
CollaborationUI.refreshJoinedCollaboration = function (loginIDList) {
for (var count = 0; count < loginIDList.length; count++) {
loginIDList[count] = loginIDList[count].replaceAll(
globalUserInfo.shopName + "_",
""
);
}
Common.showLoadingIndicator();
$("#collaboration_overlay_user_list").html("");
const joinedUserListTemplate = getTemplate(
TemplateURL.COLLABORATION_OVERLAY_USER_LIST
);
const joinedUserList =
NativeBridgeDataSource.getUserListByLoginId(loginIDList);
const sortedUserList = new Array();
loginIDList.forEach(function (userId) {
joinedUserList.forEach(function (user) {
if (userId == user.loginId) {
sortedUserList.push(user);
}
});
});
sortedUserList.forEach(function (user) {
user.profileUrl = Common.getProfileImgUrl(user.profileUrl);
});
let html = Mustache.render(joinedUserListTemplate, {
joinedUserList: sortedUserList,
});
let obj = jQuery.parseHTML(html);
$("#collaboration_overlay_user_list").append(obj);
Common.dismissLoadingIndicator();
};
CollaborationUI.refreshForOffline = function () { CollaborationUI.refreshForOffline = function () {
serverInfo.isOnline = "false"; serverInfo.isOnline = "false";
if (typeof coview_api == "undefined") { if (typeof coview_api == "undefined") {
...@@ -184,3 +172,11 @@ CollaborationUI.refreshForOffline = function () { ...@@ -184,3 +172,11 @@ CollaborationUI.refreshForOffline = function () {
NativeBridgeDelegate.openCommunicationHome(); NativeBridgeDelegate.openCommunicationHome();
} }
}; };
CollaborationUI.showLoadingIndicator = function () {
$("#loadingIndicator").addClass("full_active");
};
CollaborationUI.hideLoadingIndicator = function () {
$("#loadingIndicator").removeClass("full_active");
};
var FermiWebSocketBridge = {};
// call from modal_collabo_profile.html
FermiWebSocketBridge.requestHostChange = function (loginID) {
fw.sendToMsg("others", "HOST_CHANGE_REQUEST", {
loginId: getFermiLoginId(loginID),
});
};
FermiWebSocketBridge.shareFileHost = function (collaborationType) {
fw.sendToMsg("others", "SHARE_FILE_HOST", {
collaborationType: collaborationType,
});
};
FermiWebSocketBridge.hostChangeResponse = function () {
fw.sendToMsg("others", "HOST_CHANGE_RESPONSE", {
isAndroid: deviceInfo.isAndroid(),
isAble: androidVersion >= ANDROID_SDK_VERSION.O,
loginId: currentUserInfo.loginID,
});
};
// PIP_END_REQUEST
FermiWebSocketBridge.pipEndRequest = function (loginID) {
fw.sendToMsg("others", "PIP_END_REQUEST", {
loginId: getFermiLoginId(loginID),
});
};
// HOST_REQUEST_REJECT
FermiWebSocketBridge.hostRequestReject = function (hostID) {
fw.sendToMsg("others", "HOST_REQUEST_REJECT", {
hostId: hostID,
});
};
// HOST_REQUEST_DONE
FermiWebSocketBridge.hostRequestDone = function (hostID) {
fw.sendToMsg("others", "HOST_REQUEST_DONE", {
hostId: hostID,
});
};
// GET_COLLABORATION_TYPE_RESPONSE
FermiWebSocketBridge.getCollaborationTypeResponse = function (loginID) {
fw.sendToMsg("others", "GET_COLLABORATION_TYPE_RESPONSE", {
loginId: loginID,
collaborationType: joinCollaborationType,
newMeetingId: meetingID,
});
};
// GET_COLLABORATION_TYPE
FermiWebSocketBridge.getCollaborationType = function () {
fw.sendToMsg("others", "GET_COLLABORATION_TYPE", {
loginId: globalUserInfo.loginId,
});
};
// CAPTURE_REQUEST
FermiWebSocketBridge.captureRequest = function () {
// todo: peacekim:: check if it's okay for loginID
// instead of globalUserInfo.loginId
fw.sendToMsg("others", "CAPTURE_REQUEST", {
name: currentUserInfo.loginID,
});
};
// CHANGE_COLLABORATION
FermiWebSocketBridge.changeCollaboration = function (
collaborationType,
newMeetingID
) {
fw.sendToMsg("others", "CHANGE_COLLABORATION", {
collaborationType: collaborationType,
newMeetingId: newMeetingID,
});
};
// CHANGE_HOST_APPLY
FermiWebSocketBridge.changeHostApply = function () {
fw.sendToMsg("others", "CHANGE_HOST_APPLY", {
hostId: currentUserInfo.loginID,
});
}
var FermiWebSocketMessageHandler = {};
FermiWebSocketMessageHandler.bindWebSocketMessage = function () {
fw.socket.on("message", async function (data) {
if (g_isMainMan) {
FermiWebSocketMessageHandler.handleMessagesToHost(data);
} else if (data.payload.loginId == globalUserInfo.loginId) {
// 自分自身の場合
FermiWebSocketMessageHandler.handleMessagesToSelf(data);
} else {
// global messages
FermiWebSocketMessageHandler.handleMessagesToAll(data);
}
});
};
FermiWebSocketMessageHandler.handleMessagesToHost = function (data) {
// HOSTの場合
switch (data.type) {
case "CAPTURE_REQUEST":
FermiWebSocketMessageHandler.captureRequest(data);
break;
case "HOST_CHANGE_RESPONSE":
FermiWebSocketMessageHandler.hostChangeResponse(data);
break;
case "GET_COLLABORATION_TYPE":
FermiWebSocketMessageHandler.getCollaborationType(data);
break;
case "SHARE_FILE_HOST":
if (joinCollaborationType != COLLABORATION_TYPE.CAMERA) {
FermiWebSocketMessageHandler.shareFileHost();
}
break;
default:
break;
}
};
FermiWebSocketMessageHandler.handleMessagesToSelf = function (data) {
// 自分自身の場合
switch (data.type) {
case "HOST_CHANGE_REQUEST":
FermiWebSocketMessageHandler.hostChangeRequest();
break;
case "PIP_END_REQUEST":
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
FermiWebSocketMessageHandler.pipEndRequest();
}
break;
case "GET_COLLABORATION_TYPE_RESPONSE":
FermiWebSocketMessageHandler.getCollaborationTypeResponse(data);
break;
default:
break;
}
};
FermiWebSocketMessageHandler.handleMessagesToAll = function () {
switch (data.type) {
case "CHANGE_COLLABORATION":
FermiWebSocketMessageHandler.changeCollaboration(data);
break;
case "SHARE_FILE":
if (joinCollaborationType != COLLABORATION_TYPE.CAMERA) {
FermiWebSocketMessageHandler.shareFile();
}
break;
case "API_SEND_OWNER_CHANGE_COMPLETE":
FermiWebSocketMessageHandler.apiSendOwnerChangeComplete();
break;
case "API_SEND_OWNER_CHANGE_CONFIRM":
if (joinCollaborationType == COLLABORATION_TYPE.CAMERA) {
FermiWebSocketMessageHandler.apiSendOwnerChangeConfirm();
}
break;
case "CHANGE_HOST_APPLY":
FermiWebSocketMessageHandler.changeHostApply(data);
break;
case "HOST_REQUEST_DONE":
FermiWebSocketMessageHandler.hostRequestDone();
break;
case "HOST_REQUEST_REJECT":
FermiWebSocketMessageHandler.hostRequestReject(data);
break;
case "API_WELCOME":
if (collaborationJoinFlg == "2") {
FermiWebSocketMessageHandler.apiWelcome();
}
break;
default:
break;
}
};
// CHANGE_COLLABORATION
FermiWebSocketMessageHandler.changeCollaboration = function (data) {
const newMeetingID = data.payload.newMeetingId;
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.exitMeetingRoom();
NativeBridgeDelegate.finishPIPMode(true);
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none");
}
waitMillisecond(500);
updateCanvasSize();
}
FermiWebSocketMessageHandler.updateJoinChangeCollaboration(
data.payload.collaborationType
);
joinMeetingId = newMeetingID;
updateCollaborationUI(joinCollaborationType);
NativeBridgeDelegate.joinChangedCollaboration(
joinCollaborationType,
newMeetingID
);
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.joinMeetingRoom(newMeetingID);
}
};
// SHARE_FILE
FermiWebSocketMessageHandler.shareFile = function () {
updateCollaborationUI(COLLABORATION_TYPE.CAMERA);
joinCollaborationType = COLLABORATION_TYPE.CAMERA;
FermiWebSocketBridge.shareFileHost(COLLABORATION_TYPE.CAMERA);
};
// SHARE_FILE_HOST
FermiWebSocketMessageHandler.shareFileHost = function () {
updateCollaborationUI(COLLABORATION_TYPE.CAMERA);
joinCollaborationType = COLLABORATION_TYPE.CAMERA;
};
// CAPTURE_REQUEST
FermiWebSocketMessageHandler.captureRequest = function (data) {
if (
confirm(data.payload.name + getLocalizedString("request_capture")) == false
) {
return;
}
if ($("#recordBtn .record").hasClass("disable")) {
screenLock();
recordStop(function () {
$("#screenLock").remove();
captureAndShareImage(
serverInfo.cmsURL + "/chatapi/file/uploadArchive",
data.payload.name
);
});
} else {
captureAndShareImage(
serverInfo.cmsURL + "/chatapi/file/uploadArchive",
data.payload.name
);
}
};
// HOST_CHANGE_REQUEST
FermiWebSocketMessageHandler.hostChangeRequest = function () {
FermiWebSocketBridge.hostChangeRequest();
};
// HOST_CHANGE_RESPONSE
FermiWebSocketMessageHandler.hostChangeResponse = function (data) {
const isAndroid = data.payload.isAndroid;
const isAble = data.payload.isAble;
if (
isAndroid &&
!isAble &&
joinCollaborationType == COLLABORATION_TYPE.DOCUMENT
) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
// 対象ユーザの端末バージョンでは文書協業が利用できません。
alert(getLocalizedString("err_target_android_version_not_support"));
} else {
FermiWebSocketBridge.pipEndRequest(data.payload.loginId);
waitMillisecond(500);
CoviewBridge.changeHost(getFermiLoginId(data.payload.loginId));
}
};
// PIP_END_REQUEST
FermiWebSocketMessageHandler.pipEndRequest = function () {
NativeBridgeDelegate.finishPIPMode(true);
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none");
}
};
// API_SEND_OWNER_CHANGE_COMPLETE
FermiWebSocketMessageHandler.apiSendOwnerChangeComplete = function () {
penOff();
if ($("#recordBtn .record").hasClass("disable")) {
recordStop(function () {});
}
if ($("#micBtn .voice").hasClass("disable")) {
micOff();
} else {
micOn();
}
};
// API_SEND_OWNER_CHANGE_CONFIRM
FermiWebSocketMessageHandler.apiSendOwnerChangeConfirm = function () {
waitMillisecond(500);
removeOldLocalVideo(g_localStream);
};
// CHANGE_HOST_APPLY
FermiWebSocketMessageHandler.changeHostApply = function (data) {
if (g_isMainMan) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
NativeBridgeDelegate.finishPIPMode(true);
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none");
}
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING);
waitMillisecond(500);
if (
confirm(
getLocalizedString("norify_request_host_change", data.payload.hostId)
)
) {
CoviewBridge.changeHost(getFermiLoginId(data.payload.hostId));
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
} else {
FermiWebSocketBridge.hostRequestReject(data.payload.hostId);
}
FermiWebSocketBridge.hostRequestDone(data.payload.hostId);
} else {
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING);
waitMillisecond(500);
}
};
// HOST_REQUEST_DONE
FermiWebSocketMessageHandler.hostRequestDone = function () {
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
};
// HOST_REQUEST_REJECT
FermiWebSocketMessageHandler.hostRequestReject = function (data) {
if (data.payload.hostId == currentUserInfo.loginID) {
alert("REJECT for owner user");
}
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
};
// GET_COLLABORATION_TYPE
FermiWebSocketMessageHandler.getCollaborationType = function (data) {
FermiWebSocketBridge.getCollaborationTypeResponse(data.payload.loginId);
};
// GET_COLLABORATION_TYPE_RESPONSE
FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) {
FermiWebSocketMessageHandler.updateJoinChangeCollaboration(
data.payload.collaborationType
);
joinMeetingId = data.payload.newMeetingId;
updateCollaborationUI(joinCollaborationType);
NativeBridgeDelegate.joinChangedCollaboration(
joinCollaborationType,
data.payload.newMeetingId
);
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.joinMeetingRoom(data.payload.newMeetingId);
}
};
// API_WELCOME
FermiWebSocketMessageHandler.apiWelcome = function () {
FermiWebSocketBridge.getCollaborationType();
collaborationJoinFlg = "1";
isInvited = InvitedFlag.INVITED;
};
FermiWebSocketMessageHandler.updateJoinChangeCollaboration = function (
collaborationType
) {
if (
deviceInfo.isAndroid() &&
collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O
) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
alert(getLocalizedString("not_support_version"));
joinCollaborationType = COLLABORATION_TYPE.CAMERA;
} else {
joinCollaborationType = collaborationType;
}
};
CollaborationUI.bindShareMainButton = function () { /**************************
$("#coviewShareMainBtn").on("click", function (e) { * Toggle Feature Buttons
e.stopPropagation(); **************************/
if ($(".coview_share_dropdown_bar").is(":visible") == true) {
CollaborationUI.shareDropdownHide();
if ($(".coview_share_photo_select_bubble").is(":visible") == true) {
$(".coview_share_photo_select_bubble").slideUp();
}
} else {
$(".coview_share_dropdown_bar").slideDown();
}
});
};
CollaborationUI.bindShareCloseButton = function () {
$("#coviewShareCloseButton").on("click", function (e) {
coview_api.LeaveRoom();
$(".coview_share_area").hide();
});
};
CollaborationUI.bindBodyClockEvent = function () {
$("body").on("click", function () {
CollaborationUI.shareDropdownHide();
if ($(".coview_share_photo_select_bubble").is(":visible") == true) {
$(".coview_share_photo_select_bubble").slideUp();
} else {
$(".coview_share_dropdown_bar").slideDown();
}
});
};
CollaborationUI.bindShareRequestButton = function () {
$(document).on("click", ".coview_share_request", function () {
console.log("peacekim:: DOMContentLoaded - globalUserInfo", globalUserInfo);
if ($(this).hasClass(CollaborationTypeKey.VIDEO) == true) {
globalUserInfo.coWorkType = CollaborationTypeKey.VIDEO;
$(".coview_share_title_name").text("LIVE");
} else if ($(this).hasClass(CollaborationTypeKey.CAMERA) == true) {
globalUserInfo.coWorkType = CollaborationTypeKey.CAMERA;
$(".coview_share_title_name").text("ライブラリ");
} else if ($(this).hasClass(CollaborationTypeKey.AUDIO) == true) {
globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO;
$(".coview_share_title_name").text("音声通話");
}
coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
CollaborationUI.moveToVideoShareArea();
});
};
CollaborationUI.bindShareChat = function () {
$("#coviewShareChat").on("click", function () {
console.log("peacekim:: ON click coviewShareChat");
});
};
CollaborationUI.bindSharePhotoTapped = function () {
$("#coviewSharePhoto").on("click", function (e) {
e.stopPropagation();
console.log("peacekim:: ON click coviewSharePhoto");
if ($(".coview_share_photo_select_bubble").is(":visible") == true) {
$(".coview_share_photo_select_bubble").slideUp();
} else {
$(".coview_share_photo_select_bubble").slideDown();
}
});
};
CollaborationUI.bindSharePhotoCameraTapped = function () {
$("#coviewSharePhotoCamera").on("click", function () {
$(".coview_share_photo_select_bubble").hide();
globalUserInfo.coWorkType = CollaborationTypeKey.CAMERA;
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
CollaborationUI.moveToVideoShareArea();
$(".coview_share_title_name").text("カメラ");
});
};
CollaborationUI.bindSharePhotoLibraryTapped = function () {
$("#coviewSharePhotoGallery").on("click", function () {
$(".coview_share_photo_select_bubble").hide();
globalUserInfo.coWorkType = "gallery";
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
CollaborationUI.moveToVideoShareArea();
$(".coview_share_title_name").text("ライブラリ");
});
};
CollaborationUI.bindShareAudioTapped = function () {
$("#coviewShareAudio").on("click", function () {
CollaborationUI.connectAudioCollaboration();
});
};
CollaborationUI.bindShareLive = function () {
$("#coviewShareLive").on("click", function () {
console.log("peacekim:: ON click coviewShareLive");
globalUserInfo.coWorkType = "video";
console.log("peacekim:: globalUserInfo", globalUserInfo);
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
CollaborationUI.moveToVideoShareArea();
$(".coview_share_title_name").text("LIVE");
});
};
CollaborationUI.shareDropdownHide = function () {
$(".coview_share_dropdown_bar").slideUp();
$(".coview_share_photo_select_bubble").slideUp();
};
CollaborationUI.connectAudioCollaboration = function () {
globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO;
coview_api.deleteRoom(globalUserInfo.roomId);
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
CollaborationUI.moveToVideoShareArea();
CollaborationUI.moveToAudioShareArea();
$(".coview_share_title_name").text("音声通話");
};
CollaborationUI.moveToVideoShareArea = function () {
$("#loadingIndicator").addClass("full_active");
$(".coview_share_area").show();
$("#collabo_main").removeClass("none");
};
CollaborationUI.moveToAudioShareArea = function () {
$(".coview_share_area").addClass("none");
$("#collabo_main").removeClass("none");
$(".talking_area").removeClass("none");
};
function togglePen() { function togglePen() {
$("#coviewPenCtrBtn").click(); $("#coviewPenCtrBtn").click();
if ($("#penBtn .pen").hasClass("disable")) { if ($("#penBtn .pen").hasClass("disable")) {
...@@ -174,9 +38,7 @@ function toggleCapture() { ...@@ -174,9 +38,7 @@ function toggleCapture() {
} }
function toggleCaptureRequest() { function toggleCaptureRequest() {
fw.sendToMsg("others", "CAPTURE_REQUEST", { FermiWebSocketBridge.captureRequest();
name: currentUserInfo.loginID,
});
} }
function micOn() { function micOn() {
...@@ -283,3 +145,12 @@ function mainManRecordWithCollaboration(action, url, callback) { ...@@ -283,3 +145,12 @@ function mainManRecordWithCollaboration(action, url, callback) {
}); });
}, 1000); }, 1000);
} }
function postRecords() {}
// div削除関数
function deleteDOMObject(id_name) {
const dom_obj = document.getElementById(id_name);
const dom_obj_parent = dom_obj.parentNode;
dom_obj_parent.removeChild(dom_obj);
}
var CoviewBridge = {}; var CoviewBridge = {};
var CollaborationFeature = {};
CoviewBridge.bindReadyEvent = function () { CoviewBridge.bindReadyEvent = function () {
coview_api.addEventListener("ready", function () { coview_api.addEventListener("ready", function () {
console.log("peacekim:: =============> READY : ready for coview api"); CoviewBridge.addLoginId(globalUserInfo.loginId);
Coview_addLoginId(globalUserInfo.loginId);
coview_api.Login(globalUserInfo.loginId); coview_api.Login(globalUserInfo.loginId);
initCollaborationUI(joinCollaborationType); updateCollaborationUI(joinCollaborationType);
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE); NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
fw.socket.on("message", async function (data) { FermiWebSocketMessageHandler.bindWebSocketMessage();
console.log("peacekim:: ====> message::data: ", data);
if (data.type === "CHANGE_COLLABORATION") {
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.exitMeetingRoom();
NativeBridgeDelegate.finishPIPMode(true);
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none");
}
await new Promise((done) => setTimeout(() => done(), 500));
updateCanvasSize();
}
if (
deviceInfo.isAndroid() &&
data.payload.collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O
) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
alert(getLocalizedString("not_support_version"));
joinCollaborationType = COLLABORATION_TYPE.CAMERA;
} else {
joinCollaborationType = data.payload.collaborationType;
}
joinMeetingId = data.payload.newMeetingId;
initCollaborationUI(joinCollaborationType);
NativeBridgeDelegate.joinChangedCollaboration(
joinCollaborationType,
data.payload.newMeetingId
);
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.joinMeetingRoom(data.payload.newMeetingId);
}
} else if (data.type === "SHARE_FILE") {
if (joinCollaborationType != COLLABORATION_TYPE.CAMERA) {
initCollaborationUI(COLLABORATION_TYPE.CAMERA);
joinCollaborationType = COLLABORATION_TYPE.CAMERA;
fw.sendToMsg("others", "SHARE_FILE_HOST", {
collaborationType: COLLABORATION_TYPE.CAMERA,
});
}
} else if (data.type === "SHARE_FILE_HOST") {
if (joinCollaborationType != COLLABORATION_TYPE.CAMERA && g_isMainMan) {
initCollaborationUI(COLLABORATION_TYPE.CAMERA);
joinCollaborationType = COLLABORATION_TYPE.CAMERA;
}
} else if (data.type === "CAPTURE_REQUEST" && g_isMainMan) {
if (
confirm(data.payload.name + getLocalizedString("request_capture"))
) {
if ($("#recordBtn .record").hasClass("disable")) {
screenLock();
recordStop(function () {
$("#screenLock").remove();
captureAndShareImage(
serverInfo.cmsURL + "/chatapi/file/uploadArchive",
data.payload.name
);
});
} else {
captureAndShareImage(
serverInfo.cmsURL + "/chatapi/file/uploadArchive",
data.payload.name
);
}
}
} else if (data.type === "HOST_CHANGE_REQUEST") {
if (data.payload.loginId == globalUserInfo.loginId) {
fw.sendToMsg("others", "HOST_CHANGE_RESPONSE", {
isAndroid: deviceInfo.isAndroid(),
isAble: androidVersion >= ANDROID_SDK_VERSION.O,
loginId: currentUserInfo.loginID,
});
}
} else if (data.type === "HOST_CHANGE_RESPONSE") {
var isAndroid = data.payload.isAndroid;
var isAble = data.payload.isAble;
if (
g_isMainMan &&
isAndroid &&
!isAble &&
joinCollaborationType == COLLABORATION_TYPE.DOCUMENT
) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
alert(getLocalizedString("err_target_android_version_not_support"));
} else if (g_isMainMan) {
fw.sendToMsg("others", "PIP_END_REQUEST", {
loginId: getFermiLoginId(data.payload.loginId),
});
await new Promise((done) => setTimeout(() => done(), 500));
Coview_changeHost(getFermiLoginId(data.payload.loginId));
}
} else if (data.type === "PIP_END_REQUEST") {
if (
data.payload.loginId == globalUserInfo.loginId &&
joinCollaborationType == COLLABORATION_TYPE.DOCUMENT
) {
NativeBridgeDelegate.finishPIPMode(true);
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none");
}
}
} else if (data.type === "API_SEND_OWNER_CHANGE_COMPLETE") {
penOff();
if ($("#recordBtn .record").hasClass("disable")) {
recordStop(function () {
console.log("peacekim:: ホスト変更によりレコードを終了しました");
});
}
if ($("#micBtn .voice").hasClass("disable")) {
micOff();
} else {
micOn();
}
} else if (data.type === "API_SEND_OWNER_CHANGE_CONFIRM") {
if (joinCollaborationType == COLLABORATION_TYPE.CAMERA) {
await new Promise((done) => setTimeout(() => done(), 500));
removeOldLocalVideo(g_localStream);
}
} else if (data.type === "CHANGE_HOST_APPLY") {
if (g_isMainMan) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
NativeBridgeDelegate.finishPIPMode(true);
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none");
}
}
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING);
await new Promise((done) => setTimeout(() => done(), 500));
if (g_isMainMan) {
if (
confirm(
getLocalizedString(
"norify_request_host_change",
data.payload.hostId
)
)
) {
Coview_changeHost(getFermiLoginId(data.payload.hostId));
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
} else {
fw.sendToMsg("others", "HOST_REQUEST_REJECT", {
hostId: data.payload.hostId,
});
}
fw.sendToMsg("others", "HOST_REQUEST_DONE", {
hostId: data.payload.hostId,
});
}
} else if (data.type === "HOST_REQUEST_DONE") {
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
} else if (data.type === "HOST_REQUEST_REJECT") {
if (data.payload.hostId == currentUserInfo.loginID) {
alert("REJECT for owner user");
}
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
} else if (data.type === "GET_COLLABORATION_TYPE" && g_isMainMan) {
fw.sendToMsg("others", "GET_COLLABORATION_TYPE_RESPONSE", {
loginId: data.payload.loginId,
collaborationType: joinCollaborationType,
newMeetingId: joinMeetingId,
});
} else if (data.type === "GET_COLLABORATION_TYPE_RESPONSE") {
console.log("peacekim:: t1 " + data.payload.newMeetingId);
if (data.payload.loginId == globalUserInfo.loginId) {
if (
deviceInfo.isAndroid() &&
data.payload.collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O
) {
coview_api.HeartBeatUser(globalUserInfo.loginId);
alert(getLocalizedString("not_support_version"));
joinCollaborationType = COLLABORATION_TYPE.CAMERA;
} else {
joinCollaborationType = data.payload.collaborationType;
}
joinMeetingId = data.payload.newMeetingId;
initCollaborationUI(joinCollaborationType);
NativeBridgeDelegate.joinChangedCollaboration(
joinCollaborationType,
data.payload.newMeetingId
);
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.joinMeetingRoom(data.payload.newMeetingId);
}
}
} else if (data.type === "API_WELCOME") {
if (collaborationJoinFlg == "2") {
fw.sendToMsg("others", "GET_COLLABORATION_TYPE", {
loginId: globalUserInfo.loginId,
});
collaborationJoinFlg = "1";
isInvited = InvitedFlag.INVITED;
}
}
});
}); });
}; };
CoviewBridge.bindStartEvent = function () { CoviewBridge.bindStartEvent = function () {
coview_api.addEventListener("start", function () { coview_api.addEventListener("start", function () {
console.log("peacekim:: =============> START : share start"); CollaborationFeature.enableScrollLock();
scrollLockON(); CollaborationUI.hideLoadingIndicator();
$("#loadingIndicator").removeClass("full_active");
}); });
}; };
CollaborationFeature.scrollLock = function (e) {
if (deviceInfo.isiOS()) {
if (
$(e.target).closest(".add_user_modal").length > 0 ||
$(e.target).closest("#overlay_user_list").length > 0 ||
$(e.target).closest(".pip_indicator").length > 0
) {
e.stopPropagation();
} else {
e.preventDefault();
}
}
};
CollaborationFeature.enableScrollLock = function () {
document
.getElementById("collabo_main")
.addEventListener("touchmove", CollaborationFeature.scrollLock, {
passive: false,
});
};
CollaborationFeature.disableScrollLock = function () {
document
.getElementById("collabo_main")
.removeEventListener("touchmove", CollaborationFeature.scrollLock, {
passive: false,
});
};
CoviewBridge.bindAllByeEvent = function () { CoviewBridge.bindAllByeEvent = function () {
coview_api.addEventListener("allbye", function () { coview_api.addEventListener("allbye", function () {
requestCollaborationFinish(); CHAT_SOCKET.emitCollaborationFinishMessage();
var isDocument = false;
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
isDocument = true;
}
if (deviceInfo.isAndroid()) { if (deviceInfo.isAndroid()) {
android.setExitHostAlert(); android.setExitHostAlert();
} }
if (isDocument) { if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.exitMeetingRoom(); NativeBridgeDelegate.exitMeetingRoom();
} }
if (isInvited == InvitedFlag.NONE) { if (isInvited == InvitedFlag.NONE) {
...@@ -240,34 +62,27 @@ CoviewBridge.bindAllByeEvent = function () { ...@@ -240,34 +62,27 @@ CoviewBridge.bindAllByeEvent = function () {
} else { } else {
NativeBridgeDelegate.openCommunicationHome(); NativeBridgeDelegate.openCommunicationHome();
} }
console.log("peacekim:: =============> HOST BYE : share hostbye");
// TODO: peacekim:: check not to need this method for android // TODO: peacekim:: check not to need this method for android
if (deviceInfo.isiOS()) { if (deviceInfo.isiOS()) {
NativeBridgeDelegate.showExitHostAlert(); NativeBridgeDelegate.showExitHostAlert();
return; return;
} }
$("#loadingIndicator").removeClass("full_active"); CollaborationUI.hideLoadingIndicator();
}); });
}; };
CoviewBridge.bindGuestByeEvent = function () { CoviewBridge.bindGuestByeEvent = function () {
coview_api.addEventListener("guestbye", function () { coview_api.addEventListener("guestbye", function () {
console.log(" peacekim::=============> GUEST BYE : share guestbye"); CollaborationUI.hideLoadingIndicator();
$("#loadingIndicator").removeClass("full_active");
}); });
}; };
CoviewBridge.bindDestroyEvent = function () { CoviewBridge.bindDestroyEvent = function () {
coview_api.addEventListener("destroy", function () { coview_api.addEventListener("destroy", function () {
requestCollaborationFinish(); CHAT_SOCKET.emitCollaborationFinishMessage();
console.log("peacekim:: =============> DESTROY : share destroy");
alert(getLocalizedString("inform_exit_host_collaboration")); alert(getLocalizedString("inform_exit_host_collaboration"));
var isDocument = false; Coview_exitCollaboration();
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) { CollaborationUI.hideLoadingIndicator();
isDocument = true;
}
Coview_exitCollaboration(isDocument);
$("#loadingIndicator").removeClass("full_active");
}); });
}; };
...@@ -299,7 +114,7 @@ CoviewBridge.bindMessageEvent = function () { ...@@ -299,7 +114,7 @@ CoviewBridge.bindMessageEvent = function () {
await deleteRoomApi(globalUserInfo.roomId) await deleteRoomApi(globalUserInfo.roomId)
); );
if (deleteRoomResult.resultCode == 200) { if (deleteRoomResult.resultCode == 200) {
await new Promise((done) => setTimeout(() => done(), 3000)); waitMillisecond(3000);
} }
coview_api.CreateRoom( coview_api.CreateRoom(
globalUserInfo.roomId, globalUserInfo.roomId,
...@@ -313,7 +128,7 @@ CoviewBridge.bindMessageEvent = function () { ...@@ -313,7 +128,7 @@ CoviewBridge.bindMessageEvent = function () {
isInvited = InvitedFlag.INVITED; isInvited = InvitedFlag.INVITED;
coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType); coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
} }
CollaborationUI.moveToVideoShareArea(); moveToVideoShareArea();
break; break;
case "CreateRoomResponse": case "CreateRoomResponse":
...@@ -352,7 +167,7 @@ CoviewBridge.bindMessageEvent = function () { ...@@ -352,7 +167,7 @@ CoviewBridge.bindMessageEvent = function () {
alert(getLocalizedString("not_exist_sharing_call")); alert(getLocalizedString("not_exist_sharing_call"));
coview_api.LeaveRoom(); coview_api.LeaveRoom();
$(".coview_share_area").hide(); $(".coview_share_area").hide();
$("#loadingIndicator").removeClass("full_active"); CollaborationUI.hideLoadingIndicator();
NativeBridgeDelegate.joinRoom(roomInfo.roomID, roomInfo.roomName); NativeBridgeDelegate.joinRoom(roomInfo.roomID, roomInfo.roomName);
} }
break; break;
...@@ -406,31 +221,29 @@ CoviewBridge.bindMessageEvent = function () { ...@@ -406,31 +221,29 @@ CoviewBridge.bindMessageEvent = function () {
}); });
}; };
function Coview_changeHost(userId) { CoviewBridge.changeHost = function (userID) {
console.log("peacekim:: Change Host To " + userId); // call in agent_app.js
changeOwnerSend(userId); changeOwnerSend(userID);
} };
function Coview_addLoginId(loginId) { CoviewBridge.addLoginId = function (loginID) {
console.log("peacekim:: addUser loginId = " + loginId);
const url = "https://biztaskyell.abookcloud.com/auth/getuser"; const url = "https://biztaskyell.abookcloud.com/auth/getuser";
$.ajax({ $.ajax({
url: url, url: url,
method: "post", method: "post",
data: { data: {
id: loginId, id: loginID,
}, },
success: function (result) { success: function (result) {
console.log("peacekim:: t3 result", result);
if (result.statusCode != 200) { if (result.statusCode != 200) {
coview_api.addUser(loginId); coview_api.addUser(loginID);
} }
}, },
error: function (err) { error: function (err) {
console.log(err.toString()); console.error(err.toString());
}, },
}); });
} };
function hostSearchInterval() { function hostSearchInterval() {
let hostName = ""; let hostName = "";
...@@ -581,7 +394,6 @@ function captureAndShareImage(urls, changeHostName) { ...@@ -581,7 +394,6 @@ function captureAndShareImage(urls, changeHostName) {
SendFileShare(uploadFileName); SendFileShare(uploadFileName);
$("#coviewCaptureCtrBtn").hide(); $("#coviewCaptureCtrBtn").hide();
$("#coviewRecCtrBtn").hide(); $("#coviewRecCtrBtn").hide();
$(".coview_share_title_name").text("LIVE(CAPTURE IMAGE)");
$(".coview_on_media_btn_back").show(); $(".coview_on_media_btn_back").show();
//アーカイブ保存。 //アーカイブ保存。
ArchiveFileManage(blob, uploadFileName, urls); ArchiveFileManage(blob, uploadFileName, urls);
...@@ -598,13 +410,12 @@ function getReplacedLoginId(loginId) { ...@@ -598,13 +410,12 @@ function getReplacedLoginId(loginId) {
return loginId.replaceAll(globalUserInfo.shopName + "_", ""); return loginId.replaceAll(globalUserInfo.shopName + "_", "");
} }
function Coview_exitCollaboration() {
function Coview_exitCollaboration(isDocument = false) { CollaborationFeature.disableScrollLock();
scrollLockOFF();
if (g_isMainMan) { if (g_isMainMan) {
requestCollaborationFinish(); CHAT_SOCKET.emitCollaborationFinishMessage();
} }
if (isDocument) { if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.exitMeetingRoom(); NativeBridgeDelegate.exitMeetingRoom();
} }
if ($("#recordBtn .record").hasClass("disable")) { if ($("#recordBtn .record").hasClass("disable")) {
...@@ -628,3 +439,51 @@ function Coview_finishCollaboration() { ...@@ -628,3 +439,51 @@ function Coview_finishCollaboration() {
NativeBridgeDelegate.openCommunicationHome(); NativeBridgeDelegate.openCommunicationHome();
} }
} }
// Display User List
CollaborationUI.refreshJoinedCollaboration = function (loginIDList) {
for (var count = 0; count < loginIDList.length; count++) {
loginIDList[count] = loginIDList[count].replaceAll(
globalUserInfo.shopName + "_",
""
);
}
Common.showLoadingIndicator();
$("#collaboration_overlay_user_list").html("");
const joinedUserListTemplate = getTemplate(
TemplateURL.COLLABORATION_OVERLAY_USER_LIST
);
const joinedUserList =
NativeBridgeDataSource.getUserListByLoginId(loginIDList);
const sortedUserList = new Array();
loginIDList.forEach(function (userId) {
joinedUserList.forEach(function (user) {
if (userId == user.loginId) {
sortedUserList.push(user);
}
});
});
sortedUserList.forEach(function (user) {
user.profileUrl = Common.getProfileImgUrl(user.profileUrl);
});
let html = Mustache.render(joinedUserListTemplate, {
joinedUserList: sortedUserList,
});
let obj = jQuery.parseHTML(html);
$("#collaboration_overlay_user_list").append(obj);
Common.dismissLoadingIndicator();
};
function moveToVideoShareArea() {
CollaborationUI.showLoadingIndicator();
$(".coview_share_area").show();
$("#collabo_main").removeClass("none");
}
...@@ -16,30 +16,6 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -16,30 +16,6 @@ document.addEventListener("DOMContentLoaded", function () {
coview_api_key: "8dda7092c5820d663", coview_api_key: "8dda7092c5820d663",
}); });
// special button IN Chat ui
CollaborationUI.bindShareMainButton();
CollaborationUI.bindShareCloseButton();
CollaborationUI.bindBodyClockEvent();
CollaborationUI.bindShareRequestButton();
/* --------------------------------------------------- */
/* Video, photo, chat, doc */
/* --------------------------------------------------- */
CollaborationUI.bindShareChat();
CollaborationUI.bindSharePhotoTapped();
CollaborationUI.bindSharePhotoCameraTapped();
CollaborationUI.bindSharePhotoLibraryTapped();
CollaborationUI.bindShareAudioTapped();
CollaborationUI.bindShareLive();
// todo: peacekim::
CoviewBridge.bindReadyEvent(); CoviewBridge.bindReadyEvent();
CoviewBridge.bindStartEvent(); CoviewBridge.bindStartEvent();
...@@ -54,20 +30,20 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -54,20 +30,20 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
// call from collaboration_overlay_menu.html and collaboration.html // call from collaboration_overlay_menu.html and collaboration.html
function changeCollaboration(changeCollaborationType) { function changeCollaboration(collaborationType) {
recordStop(function () { recordStop(function () {
var newMeetingId = 0; var newMeetingId = 0;
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) { if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.exitMeetingRoom(); NativeBridgeDelegate.exitMeetingRoom();
} }
NativeBridgeDelegate.setJoinCollaborationType( NativeBridgeDelegate.setJoinCollaborationType(
changeCollaborationType, collaborationType,
androidVersion androidVersion
); );
joinCollaborationType = changeCollaborationType; joinCollaborationType = collaborationType;
initCollaborationUI(changeCollaborationType); updateCollaborationUI(collaborationType);
switch (changeCollaborationType) { switch (collaborationType) {
case COLLABORATION_TYPE.AUDIO: case COLLABORATION_TYPE.AUDIO:
coview_api.ChangeCollaboration("audio"); coview_api.ChangeCollaboration("audio");
break; break;
...@@ -93,46 +69,17 @@ function changeCollaboration(changeCollaborationType) { ...@@ -93,46 +69,17 @@ function changeCollaboration(changeCollaborationType) {
micOn(); micOn();
} }
NativeBridgeDelegate.changeCollaboration( NativeBridgeDelegate.changeCollaboration(collaborationType, newMeetingId);
changeCollaborationType,
newMeetingId
);
joinMeetingId = newMeetingId; joinMeetingId = newMeetingId;
fw.sendToMsg("others", "CHANGE_COLLABORATION", {
collaborationType: changeCollaborationType, FermiWebSocketBridge.changeCollaboration();
newMeetingId: newMeetingId,
});
}); });
} }
var scrollLock = function (e) {
if (deviceInfo.isiOS()) {
if (
$(e.target).closest(".add_user_modal").length > 0 ||
$(e.target).closest("#overlay_user_list").length > 0 ||
$(e.target).closest(".pip_indicator").length > 0
) {
e.stopPropagation();
} else {
e.preventDefault();
}
}
};
let collaboScreen = document.getElementById("collabo_main");
function scrollLockON() {
collaboScreen.addEventListener("touchmove", scrollLock, { passive: false });
}
function scrollLockOFF() {
collaboScreen.removeEventListener("touchmove", scrollLock, {
passive: false,
});
}
async function initCollaborationUI(changeCollaborationType) { async function updateCollaborationUI(collaborationType) {
$("#coviewEraserCtrBtn").click(); $("#coviewEraserCtrBtn").click();
if ($(".user_btn").hasClass("hide")) { if ($(".user_btn").hasClass("hide")) {
$(".user_btn").click(); $(".user_btn").click();
...@@ -140,6 +87,7 @@ async function initCollaborationUI(changeCollaborationType) { ...@@ -140,6 +87,7 @@ async function initCollaborationUI(changeCollaborationType) {
if ($(".menu_btn").hasClass("hide")) { if ($(".menu_btn").hasClass("hide")) {
$(".menu_btn").click(); $(".menu_btn").click();
} }
const roomType = NativeBridgeDataSource.getRoomType(); const roomType = NativeBridgeDataSource.getRoomType();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$(".add_user_btn").removeClass("none"); $(".add_user_btn").removeClass("none");
...@@ -147,7 +95,7 @@ async function initCollaborationUI(changeCollaborationType) { ...@@ -147,7 +95,7 @@ async function initCollaborationUI(changeCollaborationType) {
$("link[href='./css/collaboration_board.css']").remove(); $("link[href='./css/collaboration_board.css']").remove();
switch (changeCollaborationType) { switch (collaborationType) {
case COLLABORATION_TYPE.AUDIO: case COLLABORATION_TYPE.AUDIO:
$(".collaboration_contents").addClass("none"); $(".collaboration_contents").addClass("none");
$(".voice_contents").removeClass("none"); $(".voice_contents").removeClass("none");
...@@ -193,17 +141,7 @@ function applyForHostChange() { ...@@ -193,17 +141,7 @@ function applyForHostChange() {
} }
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING); NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING);
FermiWebSocketBridge.changeHostApply();
fw.sendToMsg("others", "CHANGE_HOST_APPLY", {
hostId: currentUserInfo.loginID,
});
}
// call from modal_collabo_profile.html
function hostChangeRequest(loginId) {
fw.sendToMsg("others", "HOST_CHANGE_REQUEST", {
loginId: getFermiLoginId(loginId),
});
} }
function getFermiLoginId(loginId) { function getFermiLoginId(loginId) {
...@@ -228,20 +166,6 @@ function screenLock() { ...@@ -228,20 +166,6 @@ function screenLock() {
objBody.appendChild(element); objBody.appendChild(element);
} }
// div削除関数
function deleteDOMObject(id_name) {
const dom_obj = document.getElementById(id_name);
const dom_obj_parent = dom_obj.parentNode;
dom_obj_parent.removeChild(dom_obj);
}
function requestCollaborationFinish() {
if (socket != null && socket.connected) {
const sendData = DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL;
CHAT_SOCKET.emitCreateMessage(sendData, 0);
}
}
async function waitMillisecond(millesecond) { async function waitMillisecond(millesecond) {
await new Promise((done) => setTimeout(() => done(), millesecond)); await new Promise((done) => setTimeout(() => done(), millesecond));
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<span>キャンセル</span> <span>キャンセル</span>
</div> </div>
</button> </button>
<button type="button" onclick="Coview_changeHost({{shopMemberId}});" class="profile_chat_btn border-0 bg_blue text_white"> <button type="button" onclick="CoviewBridge.changeHost({{shopMemberId}});" class="profile_chat_btn border-0 bg_blue text_white">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<span>引き渡し</span> <span>引き渡し</span>
</div> </div>
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
{{/isFavorite}} {{/isFavorite}}
{{#isHost}} {{#isHost}}
<button type="button" class="ch_host_btn border-0 bg_green text_white" <button type="button" class="ch_host_btn border-0 bg_green text_white"
onclick="hostChangeRequest('{{loginId}}');"> onclick="FermiWebSocketBridge.requestHostChange('{{loginId}}');">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
<img src="icon/icon_change_host.png" alt="ホスト変更"> <img src="icon/icon_change_host.png" alt="ホスト変更">
......
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