Commit a5080415 by Kim Eunchul

Merge remote-tracking branch 'origin/develop' into squash/socket

# Conflicts:
#	public_new/js/sockets/chat-websocket-message.js
parents c2f50a37 b2249b95
...@@ -85,8 +85,6 @@ ...@@ -85,8 +85,6 @@
</div> </div>
</footer> </footer>
<div id="loadingArea"></div>
<!-- Library --> <!-- Library -->
<script src="./js/libs/jquery-3.3.1.min.js"></script> <script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/libs/moment.js"></script> <script src="./js/libs/moment.js"></script>
...@@ -114,8 +112,6 @@ ...@@ -114,8 +112,6 @@
<script src="./js/views/archive/archive.js"></script> <script src="./js/views/archive/archive.js"></script>
<script> <script>
$("#loadingArea").load("./loading.html");
window.addEventListener('DOMContentLoaded', function () { window.addEventListener('DOMContentLoaded', function () {
ArchiveUI.refreshArchiveScreen(); ArchiveUI.refreshArchiveScreen();
}); });
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1, user-scalable=0"> content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1, user-scalable=0">
<title>LiveTaskyell</title> <title>LiveTaskyell</title>
<link rel="stylesheet" href="./css/notosansjp.css"> <link rel="stylesheet" href="./css/notosansjp.css">
<link rel="stylesheet" href="./fontawesome/css/all.css" > <link rel="stylesheet" href="./fontawesome/css/all.css">
<link rel="stylesheet" href="./css/bootstrap.min.css"> <link rel="stylesheet" href="./css/bootstrap.min.css">
<link rel="stylesheet" href="./css/common.css"> <link rel="stylesheet" href="./css/common.css">
<link rel="stylesheet" href="./css/chat.css"> <link rel="stylesheet" href="./css/chat.css">
...@@ -97,7 +97,6 @@ ...@@ -97,7 +97,6 @@
</div> </div>
</div> </div>
</footer> </footer>
<div id="loadingArea"></div>
<!-- Library --> <!-- Library -->
<script src="./js/libs/jquery-3.3.1.min.js"></script> <script src="./js/libs/jquery-3.3.1.min.js"></script>
...@@ -126,14 +125,12 @@ ...@@ -126,14 +125,12 @@
<script src="./js/views/chats/chat-list.js"></script> <script src="./js/views/chats/chat-list.js"></script>
<script> <script>
$("#loadingArea").load("./loading.html");
if (deviceInfo.isAndroid()) { if (deviceInfo.isAndroid()) {
const needHostAlert = android.getExitHostAlert(); const needHostAlert = android.getExitHostAlert();
if (needHostAlert) { if (needHostAlert) {
alert(getLocalizedString("inform_exit_host_collaboration")); alert(getLocalizedString("inform_exit_host_collaboration"));
} }
} }
ChatList.refreshRoomList(ChatRoomType.GROUP); ChatList.refreshRoomList(ChatRoomType.GROUP);
NativeBridgeDelegate.saveSelectedUserList(""); NativeBridgeDelegate.saveSelectedUserList("");
......
...@@ -152,7 +152,6 @@ ...@@ -152,7 +152,6 @@
<!-- View --> <!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script> <script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/views/chats/management/chat-add-user.js"></script> <script src="./js/views/chats/management/chat-add-user.js"></script>
<script src="./js/common/loading.js"></script>
<script> <script>
const selectedUsers = NativeBridgeDataSource.loadSelectedUsers(); const selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
......
...@@ -82,7 +82,6 @@ ...@@ -82,7 +82,6 @@
<script src="./js/Models/userinfo.js"></script> <script src="./js/Models/userinfo.js"></script>
<!-- View --> <!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script> <script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/common/loading.js"></script>
<script> <script>
ChatManagementCommon.showAddUserConfirmView(); ChatManagementCommon.showAddUserConfirmView();
......
...@@ -154,7 +154,6 @@ ...@@ -154,7 +154,6 @@
<!-- View --> <!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script> <script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/views/chats/management/chat-make-room.js"></script> <script src="./js/views/chats/management/chat-make-room.js"></script>
<script src="./js/common/loading.js"></script>
<script> <script>
if (NativeBridgeDataSource.loadSelectedUsers() != "") { if (NativeBridgeDataSource.loadSelectedUsers() != "") {
......
...@@ -89,7 +89,6 @@ ...@@ -89,7 +89,6 @@
<script src="./js/Models/userinfo.js"></script> <script src="./js/Models/userinfo.js"></script>
<!-- View --> <!-- View -->
<script src="./js/views/chats/management/chat-management-common.js"></script> <script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/common/loading.js"></script>
<script> <script>
ChatManagementCommon.showMakeRoomConfirmView(); ChatManagementCommon.showMakeRoomConfirmView();
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<!-- コンテンツ --> <!-- コンテンツ -->
<main id="chat_room"> <main id="chat_room">
<div id="user_list" class="user_list d-flex flex-row"> </div> <div id="user_list" class="user_list d-flex flex-row hide"> </div>
<!-- フィルター --> <!-- フィルター -->
<div id="filter" class="user_list filter d-flex flex-row none"></div> <div id="filter" class="user_list filter d-flex flex-row none"></div>
<div class="chat_list none" id="searchList"> <div class="chat_list none" id="searchList">
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<!-- チャット内容 --> <!-- チャット内容 -->
<div class="room_container"> <div class="room_container">
<div class="room_contents scroll"> <div class="room_contents scroll">
<div id="messages"></div> <div id="messages" class="message_container"></div>
</div> </div>
</div> </div>
</main> </main>
...@@ -133,7 +133,6 @@ ...@@ -133,7 +133,6 @@
</div> </div>
</div> </div>
</footer> </footer>
<div id="loadingArea"></div>
<div id="userProfileModal"></div> <div id="userProfileModal"></div>
<div id="chatMenuModal"></div> <div id="chatMenuModal"></div>
<div id="pictureModal"></div> <div id="pictureModal"></div>
...@@ -173,7 +172,6 @@ ...@@ -173,7 +172,6 @@
<script src="./js/views/chats/chat-room-search.js"></script> <script src="./js/views/chats/chat-room-search.js"></script>
<script src="./js/views/chats/chat-room-message.js"></script> <script src="./js/views/chats/chat-room-message.js"></script>
<script src="./js/views/contact/namecard.js"></script> <script src="./js/views/contact/namecard.js"></script>
<script src="./js/common/loading.js"></script>
<script> <script>
function imageModal(image) { function imageModal(image) {
...@@ -183,7 +181,6 @@ ...@@ -183,7 +181,6 @@
$("#pictureModal").load("./modal_chat_picture.html"); $("#pictureModal").load("./modal_chat_picture.html");
$("#chatMenuModal").load("./modal_chat_menu.html"); $("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html");
if (deviceInfo.isAndroid()) { if (deviceInfo.isAndroid()) {
const needHostAlert = android.getExitHostAlert(); const needHostAlert = android.getExitHostAlert();
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
<div class="menu-bar menu-bar2"></div> <div class="menu-bar menu-bar2"></div>
<div class="menu-bar menu-bar3"></div> <div class="menu-bar menu-bar3"></div>
</div> </div>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="CoviewBridge.exitCollaboration();"></button> -->
</div> </div>
</div> </div>
</div> </div>
...@@ -107,7 +106,6 @@ ...@@ -107,7 +106,6 @@
<!-- フッター --> <!-- フッター -->
<div id="footer_collabo"></div> <div id="footer_collabo"></div>
<div id="loadingArea"></div>
<div class="pip_indicator none" onclick="NativeBridgeDelegate.finishPIPMode();"> <div class="pip_indicator none" onclick="NativeBridgeDelegate.finishPIPMode();">
<div style="vertical-align: middle;display: table-cell;"> <div style="vertical-align: middle;display: table-cell;">
<img src="icon/icon_end_pip.svg" alt="文書共有" style="width: 30px;height: 30px;"> <img src="icon/icon_end_pip.svg" alt="文書共有" style="width: 30px;height: 30px;">
...@@ -171,7 +169,6 @@ ...@@ -171,7 +169,6 @@
$("#collaboration_picture_overlay_menu").load("./collaboration_overlay_menu.html"); $("#collaboration_picture_overlay_menu").load("./collaboration_overlay_menu.html");
$("#add_user_list").load("./modal_add_user_list.html"); $("#add_user_list").load("./modal_add_user_list.html");
$("#zoom").load("./zoom.html"); $("#zoom").load("./zoom.html");
$("#loadingArea").load("./loading.html");
if (deviceInfo.isAndroid()) { if (deviceInfo.isAndroid()) {
if ( if (
......
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
<!-- フッター --> <!-- フッター -->
<div id="footer_collabo"></div> <div id="footer_collabo"></div>
<div id="loadingArea"></div>
<div class="pip_indicator none" onclick="NativeBridgeDelegate.finishPIPMode();"> <div class="pip_indicator none" onclick="NativeBridgeDelegate.finishPIPMode();">
<div style="vertical-align: middle;display: table-cell;">協業中</div> <div style="vertical-align: middle;display: table-cell;">協業中</div>
</div> </div>
...@@ -101,7 +100,6 @@ ...@@ -101,7 +100,6 @@
<script src="./js/views/chats/management/chat-management-common.js"></script> <script src="./js/views/chats/management/chat-management-common.js"></script>
<script src="./js/views/collaboration/collaboration.js"></script> <script src="./js/views/collaboration/collaboration.js"></script>
<script src="./js/views/collaboration/collaboration-add-user.js"></script> <script src="./js/views/collaboration/collaboration-add-user.js"></script>
<script src="./js/common/loading.js"></script>
<script src="./js/views/contact/namecard.js"></script> <script src="./js/views/contact/namecard.js"></script>
<script> <script>
...@@ -110,7 +108,6 @@ ...@@ -110,7 +108,6 @@
$("#modal_collabo_change_host").load("./modal_collabo_change_host.html"); $("#modal_collabo_change_host").load("./modal_collabo_change_host.html");
$("#modal_collabo_capture").load("./modal_collabo_capture.html"); $("#modal_collabo_capture").load("./modal_collabo_capture.html");
$("#modal_collabo_profile2").load("./modal_collabo_profile2.html"); $("#modal_collabo_profile2").load("./modal_collabo_profile2.html");
$("#loadingArea").load("./loading.html");
$("#collaboration_voice_overlay_menu").load("./collaboration_voice_overlay_menu.html"); $("#collaboration_voice_overlay_menu").load("./collaboration_voice_overlay_menu.html");
$("#add_user_list").load("./modal_add_user_list.html"); $("#add_user_list").load("./modal_add_user_list.html");
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<button type="button" name="button" class="btn user_btn"></button> <button type="button" name="button" class="btn user_btn"></button>
<button type="button" name="button" class="btn menu_btn"></button> <button type="button" name="button" class="btn menu_btn"></button>
<button type="button" name="button" class="btn add_user_btn none"></button> <button type="button" name="button" class="btn add_user_btn none"></button>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="CoviewBridge.exitCollaboration();"></button> -->
</div> </div>
</div> </div>
</div> </div>
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
<div class="menu-bar menu-bar2"></div> <div class="menu-bar menu-bar2"></div>
<div class="menu-bar menu-bar3"></div> <div class="menu-bar menu-bar3"></div>
</div> </div>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="CoviewBridge.exitCollaboration();"></button> -->
</div> </div>
</div> </div>
</div> </div>
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
<button type="button" name="button" class="btn user_btn"></button> <button type="button" name="button" class="btn user_btn"></button>
<button type="button" name="button" class="btn add_user_btn none"></button> <button type="button" name="button" class="btn add_user_btn none"></button>
<button type="button" name="button" class="btn menu_btn"></button> <button type="button" name="button" class="btn menu_btn"></button>
<!-- <button type="button" name="button" class="btn exit_btn" onclick="CoviewBridge.exitCollaboration();"></button> -->
</div> </div>
</div> </div>
</div> </div>
......
...@@ -172,7 +172,6 @@ ...@@ -172,7 +172,6 @@
</footer> </footer>
<!-- ローディング --> <!-- ローディング -->
<div id="loadingArea"></div>
<div id="myProfileModal"></div> <div id="myProfileModal"></div>
<div id="userProfileModal"></div> <div id="userProfileModal"></div>
...@@ -202,11 +201,8 @@ ...@@ -202,11 +201,8 @@
<!-- View --> <!-- View -->
<script src="./js/views/contact/contact.js"></script> <script src="./js/views/contact/contact.js"></script>
<script src="./js/views/contact/namecard.js"></script> <script src="./js/views/contact/namecard.js"></script>
<script src="./js/common/loading.js"></script>
<script> <script>
$("#loadingArea").load("./loading.html");
const groupID = NativeBridgeDataSource.getToMoveGroupId(); const groupID = NativeBridgeDataSource.getToMoveGroupId();
if (groupID != "" && groupID != undefined) { if (groupID != "" && groupID != undefined) {
......
...@@ -259,24 +259,6 @@ input[name="tab_item"] { ...@@ -259,24 +259,6 @@ input[name="tab_item"] {
font: 25px FontAwesome; font: 25px FontAwesome;
} }
/* お気に入り */
.star.active:before {
content: "\f005";
font: 30px FontAwesome;
font-family: "Font Awesome 5 Free";
font-weight: 900;
color: #F5D256;
padding: 20px;
}
.star.disable:before {
content: "\f005";
font: 30px FontAwesome;
font-family: "Font Awesome 5 Free";
font-weight: 400;
color: #707070;
padding: 20px;
}
/* メンバー選択チェックボックス */ /* メンバー選択チェックボックス */
.chat_item_l_chk { .chat_item_l_chk {
height: 100%; height: 100%;
...@@ -478,6 +460,11 @@ input[name="tab_item"] { ...@@ -478,6 +460,11 @@ input[name="tab_item"] {
margin: 0 auto; margin: 0 auto;
} }
.message_container {
display: flex;
flex-direction: column-reverse;
}
.room_container { .room_container {
padding: 0; padding: 0;
background: #f3f3f3; background: #f3f3f3;
...@@ -485,15 +472,18 @@ input[name="tab_item"] { ...@@ -485,15 +472,18 @@ input[name="tab_item"] {
margin: 20px auto; margin: 20px auto;
margin-bottom: 140px; margin-bottom: 140px;
} }
/* 会話部分 */ /* 会話部分 */
.room_contents { .room_contents {
padding: 10px; padding: 10px;
overflow: hidden; overflow: hidden;
line-height: 150%; line-height: 150%;
} }
.scroll { .scroll {
overflow-y: scroll; overflow-y: scroll;
} }
/* 相手の会話 */ /* 相手の会話 */
.room_left { .room_left {
width: fit-content; width: fit-content;
...@@ -785,24 +775,14 @@ input[name="tab_item"] { ...@@ -785,24 +775,14 @@ input[name="tab_item"] {
/**************************** modal *************************/ /**************************** modal *************************/
/* メニューモーダル */ /* メニューモーダル */
.modal-backdrop{
background-color: #F9F9F9;
}
.modal-backdrop.show{
opacity: 0.95;
}
.menu_modal .modal-dialog{ .menu_modal .modal-dialog{
max-width: 100%!important; max-width: 100%!important;
} }
.profile_modal .modal-content{
border:none!important;
background-color:transparent!important;
}
.menu_modal .modal-content{ .menu_modal .modal-content{
border:none!important; border:none!important;
background-color:transparent!important; background-color:transparent!important;
} }
.modal-content-wrap { .menu_modal .modal-content-wrap {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
pointer-events: auto; pointer-events: auto;
...@@ -811,7 +791,6 @@ input[name="tab_item"] { ...@@ -811,7 +791,6 @@ input[name="tab_item"] {
padding: 0.8rem 0.8rem!important; padding: 0.8rem 0.8rem!important;
margin: 0!important; margin: 0!important;
} }
.profile_modal button.close,
.menu_modal button.close{ .menu_modal button.close{
position: fixed; position: fixed;
top: 30px; top: 30px;
...@@ -822,7 +801,6 @@ input[name="tab_item"] { ...@@ -822,7 +801,6 @@ input[name="tab_item"] {
opacity: 0; opacity: 0;
animation: fadein .5s ease forwards; animation: fadein .5s ease forwards;
} }
.profile_modal .close,
.menu_modal .close{ .menu_modal .close{
color: #707070; color: #707070;
opacity: 1!important; opacity: 1!important;
...@@ -871,10 +849,6 @@ input[name="tab_item"] { ...@@ -871,10 +849,6 @@ input[name="tab_item"] {
opacity: 0; opacity: 0;
animation: fadein 1.5s ease forwards; animation: fadein 1.5s ease forwards;
} }
.profile_modal .modal-content.item01{
opacity: 0;
animation: fadein .5s ease forwards;
}
@keyframes fadein{ @keyframes fadein{
0%{ 0%{
opacity: 0; opacity: 0;
......
...@@ -138,6 +138,13 @@ main { ...@@ -138,6 +138,13 @@ main {
} }
/**************************** modal *************************/ /**************************** modal *************************/
/* 共通設定 */
.modal-backdrop{
background-color: #F9F9F9;
}
.modal-backdrop.show{
opacity: 0.95;
}
/* プロフィールモーダル */ /* プロフィールモーダル */
.profile_modal .modal-footer button { .profile_modal .modal-footer button {
color: #707070; color: #707070;
...@@ -203,6 +210,25 @@ main { ...@@ -203,6 +210,25 @@ main {
outline: 0; outline: 0;
box-shadow: none; box-shadow: none;
} }
/* お気に入り */
.star.active:before {
content: "\f005";
font: 30px FontAwesome;
font-family: "Font Awesome 5 Free";
font-weight: 900;
color: #F5D256;
padding: 20px;
}
.star.disable:before {
content: "\f005";
font: 30px FontAwesome;
font-family: "Font Awesome 5 Free";
font-weight: 400;
color: #707070;
padding: 20px;
}
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
/* navi */ /* navi */
.nav-ttl { .nav-ttl {
......
String.prototype.replaceAll = function (org, dest) { String.prototype.replaceAll = function (org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
} };
function includeJs(jsFilePath) { function includeJs(jsFilePath) {
var js = document.createElement("script"); var js = document.createElement("script");
...@@ -39,13 +39,11 @@ $(".home_btn").on("click", function () { ...@@ -39,13 +39,11 @@ $(".home_btn").on("click", function () {
}); });
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
var h = $(window).height(); //画面の高さを取得
// ローディング表示 // ローディング表示
$("footer a").click(function (event) { $("footer a").click(function (event) {
const a = $(this); const a = $(this);
event.preventDefault(); event.preventDefault();
$("#loader-bg ,#loader").height(h).css("display", "block"); //ローディング画像を表示 Common.showLoadingIndicator();
setTimeout(function () { setTimeout(function () {
window.location.href = a[0].href; window.location.href = a[0].href;
...@@ -74,21 +72,34 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -74,21 +72,34 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
}); });
document.addEventListener("readystatechange", () => {
switch (document.readyState) {
case "interactive":
break;
case "complete":
if (typeof initialLoading != "undefined" && initialLoading) {
break;
}
Common.dismissLoadingIndicator();
break;
}
});
var Common = {}; var Common = {};
//loadingIndicatorを表示 //loadingIndicatorを表示
Common.showLoadingIndicator = function () { Common.showLoadingIndicator = function () {
const h = $(window).height(); NativeBridgeDelegate.showLoadingIndicator();
$("#loader-bg ,#loader").height(h).css("display", "block");
}; };
//loadingIndicatorを表示しない //loadingIndicatorを表示しない
Common.dismissLoadingIndicator = function () { Common.dismissLoadingIndicator = function () {
const h = $(window).height(); NativeBridgeDelegate.hideLoadingIndicator();
$("#loader-bg ,#loader").height(h).css("display", "none");
}; };
Common.refreshForOnline = function () { Common.refreshForOnline = function () {
Common.showLoadingIndicator();
serverInfo.isOnline = true; serverInfo.isOnline = true;
$(".footer_item a").removeClass("ui-state-disabled"); $(".footer_item a").removeClass("ui-state-disabled");
if (typeof ChatList != "undefined") { if (typeof ChatList != "undefined") {
......
$(window).on("load", function () {
//読み込み完了したら実行する
$("#loader-bg").delay(900).fadeOut(800); //ローディングを隠す
$("#loader").delay(600).fadeOut(300);
});
document.addEventListener('DOMContentLoaded', function() {
setTimeout("stopload()", 3000); //いつまでもローディング状態にならないように10秒で強制表示させる
});
function stopload() {
//強制表示の関数
$("#loader-bg").delay(900).fadeOut(800);
$("#loader").delay(600).fadeOut(300);
}
...@@ -364,6 +364,22 @@ NativeBridgeDelegate.changeCollaboration = function ( ...@@ -364,6 +364,22 @@ NativeBridgeDelegate.changeCollaboration = function (
} }
}; };
NativeBridgeDelegate.showLoadingIndicator = function () {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.showLoadingIndicator.postMessage({});
} else if (deviceInfo.isAndroid()) {
android.showLoadingIndicator();
}
};
NativeBridgeDelegate.hideLoadingIndicator = function () {
if (deviceInfo.isiOS()) {
webkit.messageHandlers.hideLoadingIndicator.postMessage({});
} else if (deviceInfo.isAndroid()) {
android.hideLoadingIndicator();
}
};
var ReverseDelegate = {}; var ReverseDelegate = {};
/* reverse delegates */ /* reverse delegates */
// for android native call // for android native call
...@@ -372,9 +388,9 @@ ReverseDelegate.leaveRoom = function () { ...@@ -372,9 +388,9 @@ ReverseDelegate.leaveRoom = function () {
}; };
// for android call // for android call
ReverseDelegate.displayExistRoom = function (roomId) { ReverseDelegate.displayExistRoom = function (roomID) {
if (confirm("error_already_exist_same_user")) { if (confirm("error_already_exist_same_user")) {
NativeBridgeDelegate.joinRoom(roomId); NativeBridgeDelegate.joinRoom(roomID);
} }
return; return;
}; };
...@@ -33,7 +33,7 @@ function setSocketAction() { ...@@ -33,7 +33,7 @@ function setSocketAction() {
/* --------------------------------------------------- /* ---------------------------------------------------
* Chat Room List Tab * Chat Room List Tab
* --------------------------------------------------- */ * --------------------------------------------------- */
bindOnNewMessage(); CHAT_SOCKET.bindOnNewMessage();
bindOnNewNotification(); bindOnNewNotification();
bindOnRefreshGroupList(); bindOnRefreshGroupList();
bindOnRefreshUserListInGroup(); bindOnRefreshUserListInGroup();
...@@ -213,7 +213,7 @@ CHAT_SOCKET.emitCollaborationFinishMessage = function () { ...@@ -213,7 +213,7 @@ CHAT_SOCKET.emitCollaborationFinishMessage = function () {
const sendData = DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL; const sendData = DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL;
CHAT_SOCKET.emitCreateMessage(SOCKET_KEY.CREATE_MESSAGE, sendData); CHAT_SOCKET.emitCreateMessage(SOCKET_KEY.CREATE_MESSAGE, sendData);
} }
} };
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);
......
...@@ -10,7 +10,6 @@ $("#tabGroup").on("click", function (e) { ...@@ -10,7 +10,6 @@ $("#tabGroup").on("click", function (e) {
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
ChatList.bindChatSearch(); ChatList.bindChatSearch();
Common.dismissLoadingIndicator();
}); });
ChatList.bindChatSearch = function () { ChatList.bindChatSearch = function () {
......
...@@ -13,7 +13,7 @@ ChatRoom.appendSearchMessages = function (messages, unwrappedWorkVal = "") { ...@@ -13,7 +13,7 @@ ChatRoom.appendSearchMessages = function (messages, unwrappedWorkVal = "") {
let html = ChatRoom.renderMessageForSearchMessage(message); let html = ChatRoom.renderMessageForSearchMessage(message);
workVal = html + workVal; workVal = html + workVal;
}); });
$(".overlay_src_msg").prepend(workVal); $(".overlay_src_msg").append(workVal);
}; };
ChatRoom.renderMessageForSearchMessage = function (message) { ChatRoom.renderMessageForSearchMessage = function (message) {
...@@ -98,17 +98,14 @@ ChatRoom.loadMessages = function (joinRoomID, joinRoomName) { ...@@ -98,17 +98,14 @@ ChatRoom.loadMessages = function (joinRoomID, joinRoomName) {
let messages = NativeBridgeDataSource.getMessagesByRoomID(roomID); let messages = NativeBridgeDataSource.getMessagesByRoomID(roomID);
ChatRoom.prependMessage(messages); ChatRoom.prependMessage(messages);
// スクロール調整
let jQueryMessages = $("#messages");
ChatRoom.waitForLoadingImage(jQueryMessages, ChatRoom.scrollToBottom);
ChatRoom.waitForLoadingVideo(jQueryMessages, ChatRoom.scrollToBottom);
// iOS用スクロールoffset調整 window.addEventListener(
if (deviceInfo.isiOS()) { "load",
$(window).on("load", function () { function (event) {
ChatRoom.scrollToBottom(); ChatRoom.scrollToBottom(false);
}); },
} false
);
}; };
ChatRoom.configureRoomMenu = function () { ChatRoom.configureRoomMenu = function () {
...@@ -147,9 +144,8 @@ ChatRoom.appendAttendedUsers = function (roomID) { ...@@ -147,9 +144,8 @@ ChatRoom.appendAttendedUsers = function (roomID) {
ChatRoom.prependMessage = function (messages) { ChatRoom.prependMessage = function (messages) {
const now = new Date(); const now = new Date();
// メッセージ文字列の生成
let workVal = "";
const messageElement = $("#messages");
let checkBeforeDate = ""; let checkBeforeDate = "";
let beforeDate = ""; let beforeDate = "";
messages.forEach(function (message) { messages.forEach(function (message) {
...@@ -170,21 +166,22 @@ ChatRoom.prependMessage = function (messages) { ...@@ -170,21 +166,22 @@ ChatRoom.prependMessage = function (messages) {
const isToday = messageCreatedTime.includes(":") ? true : false; const isToday = messageCreatedTime.includes(":") ? true : false;
// 日付ラーベル表示 // 日付ラーベル表示
if (messageCreatedTime != checkBeforeDate && checkBeforeDate != "") { if (
messageCreatedTime != checkBeforeDate
&& checkBeforeDate != ""
&& !isToday
) {
const html = ChatRoom.renderDateLabelMessage(beforeDate); const html = ChatRoom.renderDateLabelMessage(beforeDate);
workVal = html + workVal; messageElement.append(html);
} }
checkBeforeDate = messageCreatedTime; checkBeforeDate = messageCreatedTime;
beforeDate = message.insertDate; beforeDate = message.insertDate;
const html = ChatRoom.renderMessage(message, isToday, isOtherYear); const html = ChatRoom.renderMessage(message, isToday, isOtherYear);
workVal = html + workVal; messageElement.append(html);
}); });
// メッセージの画面描画
$("#messages").prepend(workVal);
// messageが存在する場合、最上段にそのメッセージの日付を表示 // messageが存在する場合、最上段にそのメッセージの日付を表示
ChatRoom.appendInitialDateMessage(messages); ChatRoom.appendInitialDateMessage(messages);
}; };
...@@ -196,7 +193,7 @@ ChatRoom.appendInitialDateMessage = function (messages) { ...@@ -196,7 +193,7 @@ ChatRoom.appendInitialDateMessage = function (messages) {
messages[messages.length - 1].insertDate, messages[messages.length - 1].insertDate,
true true
); );
$("#messages").prepend(html); $("#messages").append(html);
} }
}; };
...@@ -254,7 +251,9 @@ ChatRoom.renderCollaborationMessage = function (message, isToday, isOtherYear) { ...@@ -254,7 +251,9 @@ ChatRoom.renderCollaborationMessage = function (message, isToday, isOtherYear) {
const createdAtYear = const createdAtYear =
message.insertDate.substring(0, 4) + getLocalizedString("year") + " "; message.insertDate.substring(0, 4) + getLocalizedString("year") + " ";
// 協業のタイプを数値から文字列に変換 // 協業のタイプを数値から文字列に変換
const strCollaborationType = CHAT_UTIL.getCollaborationType(collaborationInfo.collaborationType); const strCollaborationType = CHAT_UTIL.getCollaborationType(
collaborationInfo.collaborationType
);
const html = Mustache.render(collaborationMessageTemplate, { const html = Mustache.render(collaborationMessageTemplate, {
messageId: message.messageId, messageId: message.messageId,
...@@ -279,11 +278,7 @@ ChatRoom.renderCollaborationMessage = function (message, isToday, isOtherYear) { ...@@ -279,11 +278,7 @@ ChatRoom.renderCollaborationMessage = function (message, isToday, isOtherYear) {
}; };
ChatRoom.getMeetingID = function (meetingID) { ChatRoom.getMeetingID = function (meetingID) {
if (typeof meetingID != "undefined") { return typeof meetingID != "undefined" ? 0 : meetingID;
return meetingID;
} else {
return 0;
}
}; };
ChatRoom.getDisplayUserList = function (userList) { ChatRoom.getDisplayUserList = function (userList) {
......
...@@ -2,6 +2,7 @@ var beforeHeight = window.innerHeight; ...@@ -2,6 +2,7 @@ var beforeHeight = window.innerHeight;
var beforeWidth = window.innerWidth; var beforeWidth = window.innerWidth;
var beforeScroll; var beforeScroll;
var roomName = ""; var roomName = "";
var initialLoading = true;
var ChatRoom = {}; var ChatRoom = {};
window.onscroll = function () { window.onscroll = function () {
...@@ -11,20 +12,27 @@ window.onscroll = function () { ...@@ -11,20 +12,27 @@ window.onscroll = function () {
beforeScroll = window.scrollY; beforeScroll = window.scrollY;
const beforeHeight = $(".room_container").height(); const beforeHeight = $(".room_container").height();
messageCount = $(".chat_message").length; messageCount = $(".chat_message").length;
// TODO: peacekim :: check this condition
if ($(this).scrollTop() === 0 && messageCount >= PagingSize.MESSAGE) { if ($(this).scrollTop() === 0 && messageCount >= PagingSize.MESSAGE) {
if (!$("#chatLoader").is(":visible")) { setTimeout(function () {
let loader = $( if (!$("#chatLoader").is(":visible")) {
'<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>' // display loading indicator in chat message
); let loader = $(
$("#messages").prepend(loader); '<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>'
const messageID = $($(".chat_message").get(0)).data("messageid"); );
NativeBridgeDelegate.updatePreMessage(messageID); $("#messages").append(loader);
let messages = NativeBridgeDataSource.getMessagesByMessageID(messageID); // get lastest message id and update message from server via native
ChatRoom.prependMessage(messages); const messageID = $($(".chat_message").last()).data("messageid");
loader.remove(); NativeBridgeDelegate.updatePreMessage(messageID);
var afterHeight = $(".room_container").height(); let messages = NativeBridgeDataSource.getMessagesByMessageID(messageID);
window.scroll(0, afterHeight - beforeHeight); // prepend message
} ChatRoom.prependMessage(messages);
// hide loading indicator
loader.remove();
var afterHeight = $(".room_container").height();
window.scroll(0, afterHeight - beforeHeight);
}
}, 0);
} }
}; };
...@@ -37,6 +45,9 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -37,6 +45,9 @@ document.addEventListener("DOMContentLoaded", function () {
// メッセージ入力イベントバインディング // メッセージ入力イベントバインディング
ChatRoom.bindMessageInput(); ChatRoom.bindMessageInput();
// 下スクロールでユーザーリストを非表示
ChatRoom.bindUserListDisplayToggle();
}); });
ChatRoom.bindResize = function () { ChatRoom.bindResize = function () {
...@@ -103,34 +114,21 @@ ChatRoom.bindMessageInput = function () { ...@@ -103,34 +114,21 @@ ChatRoom.bindMessageInput = function () {
}; };
// 下スクロールでユーザーリストを非表示 // 下スクロールでユーザーリストを非表示
var startPos = 0; ChatRoom.bindUserListDisplayToggle = function () {
var winScrollTop = 0; let startPos = 0;
$(window).on("scroll", function () { let winScrollTop = 0;
winScrollTop = $(this).scrollTop(); $(window).on("scroll", function () {
if (winScrollTop >= startPos) { winScrollTop = $(this).scrollTop();
if (winScrollTop >= 200) { if (winScrollTop >= startPos) {
$("#chat_room .user_list").addClass("hide"); if (winScrollTop >= 200) {
} $("#chat_room .user_list").addClass("hide");
} else { }
$("#chat_room .user_list").removeClass("hide"); } else {
} $("#chat_room .user_list").removeClass("hide");
startPos = winScrollTop;
});
//上にスクロールすると新しいメッセージを呼ぶ処理。
$("#messages").scroll(function () {
if ($(this).scrollTop() === 0) {
if (!$("#chatLoader").is(":visible")) {
// 現在、メッセージの個数以前をメッセージを読み込む
// ローディングアイコンを追加する
let loader = $(
'<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>'
);
$("#messages").prepend(loader);
loader.remove();
} }
} startPos = winScrollTop;
}); });
};
// 画像の読み込みが全て終わったタイミングでコールバック実行 // 画像の読み込みが全て終わったタイミングでコールバック実行
// FIXME 追加読み込みの場合は差分の画像のみ監視すべきだが、現状新規入室時にしか対応出来ていない。 // FIXME 追加読み込みの場合は差分の画像のみ監視すべきだが、現状新規入室時にしか対応出来ていない。
...@@ -172,15 +170,19 @@ ChatRoom.waitForLoadingImage = function (div, callback) { ...@@ -172,15 +170,19 @@ ChatRoom.waitForLoadingImage = function (div, callback) {
}); });
}; };
ChatRoom.scrollToBottom = function () { ChatRoom.scrollToBottom = function (animated = true) {
const messages = $(".room_contents"); const messages = $(".room_contents");
const scrollHeight = messages.prop("scrollHeight"); const scrollHeight = messages.prop("scrollHeight");
//messages.scrollTop(scrollHeight);
$("html, body").animate( $("html, body").animate(
{ {
scrollTop: scrollHeight, scrollTop: scrollHeight,
}, },
100 animated ? 100 : 0,
function () {
initialLoading = false;
Common.dismissLoadingIndicator();
}
); );
}; };
......
CollaborationUI.initialBindAddUserButton = function () { CollaborationUI.initialBindAddUserButton = function () {
// ユーザー招待メンバー検索 // ユーザー招待メンバー検索
$(".add_user_btn").click(function () { $(".add_user_btn").click(function () {
CollaborationUI.enableScroll(); CollaborationUI.bindEnableScroll();
Common.showLoadingIndicator(); Common.showLoadingIndicator();
ChatManagementCommon.selectedUserList = []; ChatManagementCommon.selectedUserList = [];
CollaborationUI.refreshMyGroupForAddUserInCollaboration(); CollaborationUI.refreshMyGroupForAddUserInCollaboration();
......
var CollaborationUI = {}; var CollaborationUI = {};
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
CollaborationUI.disableScroll(); CollaborationUI.bindDisableScroll();
// メニューオーバーレイ表示 // メニューオーバーレイ表示
CollaborationUI.bindMenuButton(); CollaborationUI.bindMenuButton();
...@@ -42,10 +42,10 @@ CollaborationUI.bindDisplayUsersButton = function () { ...@@ -42,10 +42,10 @@ CollaborationUI.bindDisplayUsersButton = function () {
.css({ transform: "translateX(" & -w & ")" }); .css({ transform: "translateX(" & -w & ")" });
if ($(this).hasClass("hide")) { if ($(this).hasClass("hide")) {
CollaborationUI.enableScroll(); CollaborationUI.bindEnableScroll();
} else { } else {
scrollTo(0, 0); scrollTo(0, 0);
CollaborationUI.disableScroll(); CollaborationUI.bindDisableScroll();
} }
}); });
}; };
...@@ -64,7 +64,7 @@ CollaborationUI.bindChangeHostButton = function () { ...@@ -64,7 +64,7 @@ CollaborationUI.bindChangeHostButton = function () {
CollaborationUI.bindCloseButton = function () { CollaborationUI.bindCloseButton = function () {
$(".close_btn").click(function () { $(".close_btn").click(function () {
$("#overlay_add_user_list").addClass("none"); $("#overlay_add_user_list").addClass("none");
CollaborationUI.disableScroll(); CollaborationUI.bindDisableScroll();
}); });
}; };
...@@ -77,7 +77,7 @@ CollaborationUI.bindInviteButton = function () { ...@@ -77,7 +77,7 @@ CollaborationUI.bindInviteButton = function () {
/********************************* /*********************************
* Scroll Controls * Scroll Controls
********************************/ ********************************/
CollaborationUI.disableScroll = function () { CollaborationUI.bindDisableScroll = function () {
document.addEventListener("mousewheel", CollaborationUI.scrollControl, { document.addEventListener("mousewheel", CollaborationUI.scrollControl, {
passive: false, passive: false,
}); });
...@@ -87,7 +87,7 @@ CollaborationUI.disableScroll = function () { ...@@ -87,7 +87,7 @@ CollaborationUI.disableScroll = function () {
}; };
// スクロール禁止解除 // スクロール禁止解除
CollaborationUI.enableScroll = function () { CollaborationUI.bindEnableScroll = function () {
document.removeEventListener("mousewheel", CollaborationUI.scrollControl, { document.removeEventListener("mousewheel", CollaborationUI.scrollControl, {
passive: false, passive: false,
}); });
......
...@@ -15,6 +15,7 @@ FermiWebSocketBridge.shareFileHost = function (collaborationType) { ...@@ -15,6 +15,7 @@ FermiWebSocketBridge.shareFileHost = function (collaborationType) {
}; };
FermiWebSocketBridge.hostChangeResponse = function () { FermiWebSocketBridge.hostChangeResponse = function () {
// TODO: peacekim:: check loginID is for fw or not
fw.sendToMsg("others", "HOST_CHANGE_RESPONSE", { fw.sendToMsg("others", "HOST_CHANGE_RESPONSE", {
isAndroid: deviceInfo.isAndroid(), isAndroid: deviceInfo.isAndroid(),
isAble: deviceInfo.androidVersion >= ANDROID_SDK_VERSION.O, isAble: deviceInfo.androidVersion >= ANDROID_SDK_VERSION.O,
......
...@@ -69,7 +69,7 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function (data) { ...@@ -69,7 +69,7 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function (data) {
} }
break; break;
case "API_SEND_OWNER_CHANGE_COMPLETE": case "API_SEND_OWNER_CHANGE_COMPLETE":
FermiWebSocketMessageHandler.apiSendOwnerChangeComplete(); FermiWebSocketMessageHandler.apiSendOwnerChangeComplete(data);
break; break;
case "API_SEND_OWNER_CHANGE_CONFIRM": case "API_SEND_OWNER_CHANGE_CONFIRM":
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) { if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) {
...@@ -143,9 +143,8 @@ FermiWebSocketMessageHandler.shareFileHost = function () { ...@@ -143,9 +143,8 @@ FermiWebSocketMessageHandler.shareFileHost = function () {
// CAPTURE_REQUEST // CAPTURE_REQUEST
FermiWebSocketMessageHandler.captureRequest = function (data) { FermiWebSocketMessageHandler.captureRequest = function (data) {
if ( const name = data.payload.name;
confirm(data.payload.name + getLocalizedString("request_capture")) == false if (confirm(name + getLocalizedString("request_capture")) == false) {
) {
return; return;
} }
...@@ -155,13 +154,13 @@ FermiWebSocketMessageHandler.captureRequest = function (data) { ...@@ -155,13 +154,13 @@ FermiWebSocketMessageHandler.captureRequest = function (data) {
$("#screenLock").remove(); $("#screenLock").remove();
captureAndShareImage( captureAndShareImage(
serverInfo.cmsURL + "/chatapi/file/uploadArchive", serverInfo.cmsURL + "/chatapi/file/uploadArchive",
data.payload.name name
); );
}); });
} else { } else {
captureAndShareImage( captureAndShareImage(
serverInfo.cmsURL + "/chatapi/file/uploadArchive", serverInfo.cmsURL + "/chatapi/file/uploadArchive",
data.payload.name name
); );
} }
}; };
...@@ -199,7 +198,7 @@ FermiWebSocketMessageHandler.pipEndRequest = function () { ...@@ -199,7 +198,7 @@ FermiWebSocketMessageHandler.pipEndRequest = function () {
}; };
// API_SEND_OWNER_CHANGE_COMPLETE // API_SEND_OWNER_CHANGE_COMPLETE
FermiWebSocketMessageHandler.apiSendOwnerChangeComplete = function () { FermiWebSocketMessageHandler.apiSendOwnerChangeComplete = function (data) {
penOff(); penOff();
if ($("#recordBtn .record").hasClass("disable")) { if ($("#recordBtn .record").hasClass("disable")) {
recordStop(function () {}); recordStop(function () {});
...@@ -225,6 +224,7 @@ FermiWebSocketMessageHandler.changeHostApplyForNotHost = function (data) { ...@@ -225,6 +224,7 @@ FermiWebSocketMessageHandler.changeHostApplyForNotHost = function (data) {
// CHANGE_HOST_APPLY // CHANGE_HOST_APPLY
FermiWebSocketMessageHandler.changeHostApplyForHost = function (data) { FermiWebSocketMessageHandler.changeHostApplyForHost = function (data) {
const hostID = data.payload.hostId;
coview_api.HeartBeatUser(globalUserInfo.loginId); coview_api.HeartBeatUser(globalUserInfo.loginId);
NativeBridgeDelegate.finishPIPMode(true); NativeBridgeDelegate.finishPIPMode(true);
if (deviceInfo.isAndroid()) { if (deviceInfo.isAndroid()) {
...@@ -235,17 +235,13 @@ FermiWebSocketMessageHandler.changeHostApplyForHost = function (data) { ...@@ -235,17 +235,13 @@ FermiWebSocketMessageHandler.changeHostApplyForHost = function (data) {
waitMillisecond(500); waitMillisecond(500);
if ( if (confirm(getLocalizedString("norify_request_host_change", hostID))) {
confirm( CoviewBridge.changeHost(getFermiLoginId(hostID));
getLocalizedString("norify_request_host_change", data.payload.hostId)
)
) {
CoviewBridge.changeHost(getFermiLoginId(data.payload.hostId));
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE); NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
} else { } else {
FermiWebSocketBridge.hostRequestReject(data.payload.hostId); FermiWebSocketBridge.hostRequestReject(hostID);
} }
FermiWebSocketBridge.hostRequestDone(data.payload.hostId); FermiWebSocketBridge.hostRequestDone(hostID);
}; };
// HOST_REQUEST_DONE // HOST_REQUEST_DONE
...@@ -268,19 +264,19 @@ FermiWebSocketMessageHandler.getCollaborationType = function (data) { ...@@ -268,19 +264,19 @@ FermiWebSocketMessageHandler.getCollaborationType = function (data) {
// GET_COLLABORATION_TYPE_RESPONSE // GET_COLLABORATION_TYPE_RESPONSE
FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) { FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) {
FermiWebSocketMessageHandler.updateJoinChangeCollaboration( const collaborationType = data.payload.collaborationType;
data.payload.collaborationType const meetingID = data.payload.newMeetingId;
); FermiWebSocketMessageHandler.updateJoinChangeCollaboration(collaborationType);
globalUserInfo.meetingID = data.payload.newMeetingId; globalUserInfo.meetingID = meetingID;
CollaborationUI.updateScreen(globalUserInfo.collaborationType); CollaborationUI.updateScreen(globalUserInfo.collaborationType);
NativeBridgeDelegate.joinChangedCollaboration( NativeBridgeDelegate.joinChangedCollaboration(
globalUserInfo.collaborationType, globalUserInfo.collaborationType,
data.payload.newMeetingId meetingID
); );
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT) { if (globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.joinMeetingRoom(data.payload.newMeetingId); NativeBridgeDelegate.joinMeetingRoom(meetingID);
} }
}; };
......
...@@ -118,36 +118,39 @@ function mainManRecordWithCollaboration(action, url, callback) { ...@@ -118,36 +118,39 @@ function mainManRecordWithCollaboration(action, url, callback) {
formData.append("fileData", blob, uploadFileName); formData.append("fileData", blob, uploadFileName);
formData.append("sid", globalUserInfo.sid); formData.append("sid", globalUserInfo.sid);
formData.append("roomId", globalUserInfo.roomId); formData.append("roomId", globalUserInfo.roomId);
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.VIDEO) { let collaborationType =
formData.append("archiveType", 1); globalUserInfo.collaborationType == COLLABORATION_TYPE.VIDEO
} else { ? ARCHIVE_TYPE.VIDEO
formData.append("archiveType", 2); : ARCHIVE_TYPE.VOICE;
} formData.append("archiveType", collaborationType);
$.ajax({
type: "post", postRecords(url, formData, callback);
url,
data: formData,
contentType: false,
processData: false,
success: function (res) {
recordFinished();
Common.dismissLoadingIndicator();
callback();
},
error: function (err) {
recordFinished();
Common.dismissLoadingIndicator();
callback();
},
});
}, 1000); }, 1000);
} }
function postRecords() {} function postRecords(url, formData, callback) {
$.ajax({
type: "post",
url: url,
data: formData,
contentType: false,
processData: false,
success: function (res) {
recordFinished();
Common.dismissLoadingIndicator();
callback();
},
error: function (err) {
recordFinished();
Common.dismissLoadingIndicator();
callback();
},
});
}
// div削除関数 // div削除関数
function deleteDOMObject(id_name) { function deleteDOMObject(idName) {
const dom_obj = document.getElementById(id_name); const domObj = document.getElementById(idName);
const dom_obj_parent = dom_obj.parentNode; const domObjParent = domObj.parentNode;
dom_obj_parent.removeChild(dom_obj); domObjParent.removeChild(domObj);
} }
...@@ -121,7 +121,7 @@ CoviewBridge.bindMessageEvent = function () { ...@@ -121,7 +121,7 @@ CoviewBridge.bindMessageEvent = function () {
if (json.resultCode != 200) { if (json.resultCode != 200) {
break; break;
} }
CollaborationFeature.searchHostIntervally(); CollaborationFeature.updateHost();
// fall through // fall through
case "RoomMemberJoinedEvent": case "RoomMemberJoinedEvent":
// fall through // fall through
...@@ -150,6 +150,10 @@ CoviewBridge.bindMessageEvent = function () { ...@@ -150,6 +150,10 @@ CoviewBridge.bindMessageEvent = function () {
}); });
} }
break; break;
case "IceCandidateEvent": // do nothing for ice condidate event
break;
case "HeartbeatResponse": // do nothing for heartbeat response
break;
default: default:
console.debug("Unrecognized api", json); console.debug("Unrecognized api", json);
break; break;
...@@ -158,8 +162,6 @@ CoviewBridge.bindMessageEvent = function () { ...@@ -158,8 +162,6 @@ CoviewBridge.bindMessageEvent = function () {
}; };
CollaborationFeature.didReceiveLoginResponseMessage = async function () { CollaborationFeature.didReceiveLoginResponseMessage = async function () {
CollaborationFeature.searchHostIntervally();
const isDocument = const isDocument =
globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT; globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT;
const isAttendee = const isAttendee =
...@@ -171,7 +173,8 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () { ...@@ -171,7 +173,8 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () {
NativeBridgeDelegate.startContentView(); NativeBridgeDelegate.startContentView();
} else if (isHost) { } else if (isHost) {
globalUserInfo.meetingID = NativeBridgeDataSource.createContentView(); globalUserInfo.meetingID = NativeBridgeDataSource.createContentView();
if (globalUserInfo.meetingID == "-1") { //会議室作成失敗 if (globalUserInfo.meetingID == "-1") {
//会議室作成失敗
CoviewBridge.finishCollaboration(); CoviewBridge.finishCollaboration();
return; return;
} }
...@@ -182,7 +185,9 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () { ...@@ -182,7 +185,9 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () {
case COLLABORATION_JOIN_TYPE.INVITED: case COLLABORATION_JOIN_TYPE.INVITED:
// fall through // fall through
case COLLABORATION_JOIN_TYPE.ATTENDEE: case COLLABORATION_JOIN_TYPE.ATTENDEE:
// TODO:: here to update host
coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType); coview_api.JoinRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
break; break;
case COLLABORATION_JOIN_TYPE.HOST: case COLLABORATION_JOIN_TYPE.HOST:
let deleteRoomResult = JSON.parse( let deleteRoomResult = JSON.parse(
...@@ -196,9 +201,7 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () { ...@@ -196,9 +201,7 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () {
default: default:
break; break;
} }
CollaborationFeature.updateHost();
CollaborationUI.moveToVideoShareArea(); CollaborationUI.moveToVideoShareArea();
}; };
...@@ -246,26 +249,18 @@ CoviewBridge.addLoginID = function (loginID) { ...@@ -246,26 +249,18 @@ CoviewBridge.addLoginID = function (loginID) {
}); });
}; };
CollaborationFeature.searchHostIntervally = function () { CollaborationFeature.updateHost = function () {
let hostName = ""; if (g_isMainMan) {
function searchHost() { CollaborationUI.showHostButtons();
if (g_isMainMan) { } else {
CollaborationUI.showHostButtons(); CollaborationUI.hideHostButtons();
} else {
CollaborationUI.hideHostButtons();
}
CollaborationUI.showHostMark(hostName);
if (hostName != g_isMainManUsername) {
hostName = g_isMainManUsername;
}
} }
timeInterval = setInterval(searchHost, 2000);
CollaborationUI.showHostMark(g_isMainManUsername);
}; };
CollaborationUI.showHostButtons = function () { CollaborationUI.showHostButtons = function () {
$("#collaboration_user_" + currentUserInfo.loginID).addClass("host");
$(".host_contents").removeClass("none"); $(".host_contents").removeClass("none");
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) { if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) {
$(".photo_select_button").removeClass("none"); $(".photo_select_button").removeClass("none");
...@@ -277,7 +272,7 @@ CollaborationUI.showHostButtons = function () { ...@@ -277,7 +272,7 @@ CollaborationUI.showHostButtons = function () {
}; };
CollaborationUI.hideHostButtons = function () { CollaborationUI.hideHostButtons = function () {
$("#collaboration_user_" + currentUserInfo.loginID).removeClass("host");
$(".host_contents").addClass("none"); $(".host_contents").addClass("none");
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) { if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) {
$(".photo_select_button").addClass("none"); $(".photo_select_button").addClass("none");
...@@ -298,13 +293,7 @@ CollaborationUI.showHostMark = function (hostName) { ...@@ -298,13 +293,7 @@ CollaborationUI.showHostMark = function (hostName) {
const replacedMainManUserID = $( const replacedMainManUserID = $(
"#collaboration_user_" + getReplacedLoginId(g_isMainManUsername) "#collaboration_user_" + getReplacedLoginId(g_isMainManUsername)
); );
if (hostName != g_isMainManUsername) {
if (hostName != "") {
replaceHostIDDiv.removeClass("host");
}
replacedMainManUserID.addClass("host");
return;
}
if (hostName == "") { if (hostName == "") {
if (!currentUserLoginIDDiv.hasClass("host") && coview_api.getRoomUsers()) { if (!currentUserLoginIDDiv.hasClass("host") && coview_api.getRoomUsers()) {
currentUserLoginIDDiv.addClass("host"); currentUserLoginIDDiv.addClass("host");
...@@ -414,6 +403,7 @@ function getReplacedLoginId(loginId) { ...@@ -414,6 +403,7 @@ function getReplacedLoginId(loginId) {
CoviewBridge.exitCollaboration = function () { CoviewBridge.exitCollaboration = function () {
CollaborationFeature.disableScrollLock(); CollaborationFeature.disableScrollLock();
Common.showLoadingIndicator();
if (g_isMainMan) { if (g_isMainMan) {
CHAT_SOCKET.emitCollaborationFinishMessage(); CHAT_SOCKET.emitCollaborationFinishMessage();
...@@ -430,9 +420,8 @@ CoviewBridge.exitCollaboration = function () { ...@@ -430,9 +420,8 @@ CoviewBridge.exitCollaboration = function () {
}; };
CoviewBridge.finishCollaboration = function () { CoviewBridge.finishCollaboration = function () {
clearInterval(timeInterval); Common.showLoadingIndicator();
coview_api.LeaveRoom(); coview_api.LeaveRoom();
NativeBridgeDelegate.finishCollaboration(true);
if (coview_api.getRoomUsers()) { if (coview_api.getRoomUsers()) {
NativeBridgeDelegate.finishCollaboration(); NativeBridgeDelegate.finishCollaboration();
} }
...@@ -443,6 +432,7 @@ CoviewBridge.finishCollaboration = function () { ...@@ -443,6 +432,7 @@ CoviewBridge.finishCollaboration = function () {
} else { } else {
NativeBridgeDelegate.joinRoom(roomInfo.roomID, roomInfo.roomName); NativeBridgeDelegate.joinRoom(roomInfo.roomID, roomInfo.roomName);
} }
Common.dismissLoadingIndicator();
}; };
// Display User List // Display User List
...@@ -454,7 +444,6 @@ CollaborationUI.refreshJoinedCollaboration = function (loginIDList) { ...@@ -454,7 +444,6 @@ CollaborationUI.refreshJoinedCollaboration = function (loginIDList) {
); );
} }
Common.showLoadingIndicator();
$("#collaboration_overlay_user_list").html(""); $("#collaboration_overlay_user_list").html("");
const joinedUserListTemplate = getTemplate( const joinedUserListTemplate = getTemplate(
...@@ -484,7 +473,7 @@ CollaborationUI.refreshJoinedCollaboration = function (loginIDList) { ...@@ -484,7 +473,7 @@ CollaborationUI.refreshJoinedCollaboration = function (loginIDList) {
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$("#collaboration_overlay_user_list").append(obj); $("#collaboration_overlay_user_list").append(obj);
Common.dismissLoadingIndicator(); CollaborationFeature.updateHost();
}; };
CollaborationUI.moveToVideoShareArea = function () { CollaborationUI.moveToVideoShareArea = function () {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
/* --------------------------------------------------- */ /* --------------------------------------------------- */
let coview_api = new CoviewApi(); let coview_api = new CoviewApi();
var isBoard = false; var isBoard = false;
let timeInterval = null;
var backgroundFileName; var backgroundFileName;
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
......
<div id="loader-bg" class="loading-indicator">
<div id="loader" class="loading-indicator">
<div class="sp sp-circle"></div>
</div>
</div>
\ No newline at end of file
<div class="modal profile_modal" id="profileModal1" tabindex="-1" role="dialog" aria-labelledby="profileModal1" <div class="modal fade profile_modal" id="profileModal1" tabindex="-1" role="dialog" aria-labelledby="profileModal1"
aria-hidden="true"> aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header border-0"> <div class="modal-header border-0">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" style="font-size:40px;">&times;</span>
</button>
<div class="profile_desc d-flex flex-row"> <div class="profile_desc d-flex flex-row">
<img src="img/noImage.svg" alt="プロフィール画像"> <img src="img/noImage.svg" alt="プロフィール画像">
<div class="prifile_name"><span>名前 名前</span></div> <div class="prifile_name"><span>名前 名前</span></div>
</div> </div>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" style="font-size:40px;">&times;</span>
</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p> <p>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="img_wrap"> <div class="img_wrap">
<img src="img/capture.svg" alt="キャプチャ画像"> <img src="icon/icon_collabo_capture.svg" alt="キャプチャ画像">
</div> </div>
<p>filename.jpg</p> <p>filename.jpg</p>
</div> </div>
......
<div class="modal profile_modal w_50" id="userNameCardInCollaboration" tabindex="-1" role="dialog" <div class="modal fade profile_modal w_50" id="userNameCardInCollaboration" tabindex="-1" role="dialog"
aria-labelledby="userNameCardInCollaboration" aria-hidden="true"> aria-labelledby="userNameCardInCollaboration" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content-wrap d-flex align-items-center"> <div class="modal-content-wrap d-flex align-items-center m-auto">
<div class="modal-content item01"> <div class="modal-content">
<div class="modal-header border-0"> <div class="modal-header border-0">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" style="font-size:40px;">&times;</span>
</button>
<div class="profile_desc_ d-flex flex-row"> <div class="profile_desc_ d-flex flex-row">
<img src="{{profileUrl}}" onError="this.src='./img/noImage.png'" /> <img src="{{profileUrl}}" onError="this.src='./img/noImage.png'" />
<div class="profile_name d-flex justify-content-center align-items-center"><span>{{name}}</span></div> <div class="profile_name d-flex justify-content-center align-items-center"><span>{{name}}</span></div>
</div> </div>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" style="font-size:40px;">&times;</span>
</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
{{#groupPathList}} {{#groupPathList}}
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="img_wrap"> <div class="img_wrap">
<img src="img/capture.svg" alt="キャプチャ画像"> <img src="icon/icon_collabo_capture.svg" alt="キャプチャ画像">
</div> </div>
<p>filename.jpg</p> <p>filename.jpg</p>
</div> </div>
......
<div class="modal profile_modal" id="myNameCard" tabindex="-1" role="dialog" aria-labelledby="myNameCard" aria-hidden="true"> <div class="modal fade profile_modal" id="myNameCard" tabindex="-1" role="dialog" aria-labelledby="myNameCard" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content-wrap d-flex align-items-center"> <div class="modal-content-wrap d-flex align-items-center m-auto">
<div class="modal-content item01"> <div class="modal-content">
<div class="modal-header border-0"> <div class="modal-header border-0">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" style="font-size:40px;">&times;</span>
</button>
<div class="profile_desc d-flex flex-row"> <div class="profile_desc d-flex flex-row">
<img src="{{profileImage}}" onError="this.src='./img/noImage.png'"> <img src="{{profileImage}}" onError="this.src='./img/noImage.png'">
<div class="profile_name d-flex justify-content-center align-items-center"><span>{{name}}</span></div> <div class="profile_name d-flex justify-content-center align-items-center"><span>{{name}}</span></div>
</div> </div>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" style="font-size:40px;">&times;</span>
</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
{{#groupPathList}} {{#groupPathList}}
......
<div class="modal profile_modal" id="userNameCard" tabindex="-1" role="dialog" aria-labelledby="userNameCard" <div class="modal fade profile_modal" id="userNameCard" tabindex="-1" role="dialog" aria-labelledby="userNameCard"
aria-hidden="true"> aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content-wrap d-flex align-items-center"> <div class="modal-content-wrap d-flex align-items-center m-auto">
<div class="modal-content item01"> <div class="modal-content">
<div class="modal-header border-0"> <div class="modal-header border-0">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" style="font-size:40px;">&times;</span>
</button>
<div class="profile_desc_ d-flex flex-row"> <div class="profile_desc_ d-flex flex-row">
<img src="{{profileUrl}}" onError="this.src='./img/noImage.png'" /> <img src="{{profileUrl}}" onError="this.src='./img/noImage.png'" />
<div class="profile_name d-flex justify-content-center align-items-center"><span>{{name}}</span></div> <div class="profile_name d-flex justify-content-center align-items-center"><span>{{name}}</span></div>
</div> </div>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" style="font-size:40px;">&times;</span>
</button>
</div> </div>
<div class="modal-body" id="userNameCard-scroll"> <div class="modal-body" id="userNameCard-scroll">
{{#groupPathList}} {{#groupPathList}}
......
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