Commit a30a3d69 by Kim Peace

Fixed loading indicator

parent eb1edc39
...@@ -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,8 +125,6 @@ ...@@ -126,8 +125,6 @@
<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) {
......
...@@ -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">
...@@ -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();
......
...@@ -107,7 +107,6 @@ ...@@ -107,7 +107,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 +170,6 @@ ...@@ -171,7 +170,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");
......
...@@ -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) {
......
...@@ -484,6 +484,7 @@ input[name="tab_item"] { ...@@ -484,6 +484,7 @@ input[name="tab_item"] {
overflow: hidden; overflow: hidden;
margin: 20px auto; margin: 20px auto;
margin-bottom: 140px; margin-bottom: 140px;
flex-direction: column-reverse;
} }
/* 会話部分 */ /* 会話部分 */
.room_contents { .room_contents {
......
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");
...@@ -45,7 +45,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -45,7 +45,7 @@ document.addEventListener("DOMContentLoaded", function () {
$("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 +74,31 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -74,21 +74,31 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
}); });
document.addEventListener("readystatechange", () => {
switch (document.readyState) {
case "interactive":
break;
case "complete":
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
......
var bindOnNewMessage = function () { CHAT_SOCKET.bindOnNewMessage = function () {
// New Message // New Message
// #36170 // #36170
socket.on(SOCKET_KEY.NEW_MESSAGE, function (message, roomID, roomName) { socket.on(SOCKET_KEY.NEW_MESSAGE, function (message, roomID, roomName) {
console.log(
"peacekim:: on SOCKET_KEY.NEW_MESSAGE message: " +
message +
", roomID: " +
roomID +
", roomName: " +
roomName
);
const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE); const systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
const unwrappedMessageInfo = decodeMessage(message.text); const unwrappedMessageInfo = CHAT_SOCKET.decodeMessage(message.text);
if ( if (
unwrappedMessageInfo == unwrappedMessageInfo ==
DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL
) { ) {
cleanUpCollaborationMessage(); CHAT_SOCKET.cleanUpCollaborationMessage();
return; return;
} }
...@@ -22,7 +30,7 @@ var bindOnNewMessage = function () { ...@@ -22,7 +30,7 @@ var bindOnNewMessage = function () {
messageType == MessageType.COMMUNICATIONSTART || messageType == MessageType.COMMUNICATIONSTART ||
messageType == MessageType.COMMUNICATIONEND messageType == MessageType.COMMUNICATIONEND
) { ) {
addCollaborationMessage( CHAT_SOCKET.addCollaborationMessage(
messageInfo, messageInfo,
message.userId, message.userId,
roomName, roomName,
...@@ -30,7 +38,7 @@ var bindOnNewMessage = function () { ...@@ -30,7 +38,7 @@ var bindOnNewMessage = function () {
message.createdAt message.createdAt
); );
} else { } else {
addTextMessage(messageText, message, socket.id); CHAT_SOCKET.addTextMessage(messageText, message, socket.id);
} }
} }
...@@ -43,7 +51,7 @@ var bindOnNewMessage = function () { ...@@ -43,7 +51,7 @@ var bindOnNewMessage = function () {
}); });
}; };
var decodeMessage = function (text) { CHAT_SOCKET.decodeMessage = function (text) {
try { try {
return decodeURIComponent(text); return decodeURIComponent(text);
} catch (e) { } catch (e) {
...@@ -51,15 +59,27 @@ var decodeMessage = function (text) { ...@@ -51,15 +59,27 @@ var decodeMessage = function (text) {
} }
}; };
var addCollaborationMessage = function ( CHAT_SOCKET.addCollaborationMessage = function (
messageInfo, messageInfo,
userID, userID,
roomName, roomName,
insertDate, insertDate,
createdAt createdAt
) { ) {
console.log(
"peacekim:: CHAT_SOCKET.addCollaborationMessage messageInfo: " +
messageInfo +
", userId: " +
userID +
", roomName: " +
roomName +
", insertDate: " +
insertDate +
", createdAt: " +
createdAt
);
const collaborationType = CHAT_UTIL.getCollaborationType(messageInfo[2]); const collaborationType = CHAT_UTIL.getCollaborationType(messageInfo[2]);
const meetingID = getMeetingID(collaborationType, messageInfo); const meetingID = CHAT_SOCKET.getMeetingID(collaborationType, messageInfo);
const userInCollaboration = JSON.parse( const userInCollaboration = JSON.parse(
NativeBridgeDataSource.getUserInfoList(userID) NativeBridgeDataSource.getUserInfoList(userID)
); );
...@@ -72,7 +92,7 @@ var addCollaborationMessage = function ( ...@@ -72,7 +92,7 @@ var addCollaborationMessage = function (
TemplateURL.OPEN_COLLABORATION_MESSAGE TemplateURL.OPEN_COLLABORATION_MESSAGE
); );
const html = renderCollaborationMessage( const html = CHAT_SOCKET.renderCollaborationMessage(
openCollaborationMessageTemplate, openCollaborationMessageTemplate,
roomName, roomName,
userInCollaboration, userInCollaboration,
...@@ -85,7 +105,13 @@ var addCollaborationMessage = function ( ...@@ -85,7 +105,13 @@ var addCollaborationMessage = function (
$("#messages").append(html); $("#messages").append(html);
}; };
var getMeetingID = function (collaborationType, messageInfo) { CHAT_SOCKET.getMeetingID = function (collaborationType, messageInfo) {
console.log(
"peacekim:: CHAT_SOCKET.getMeetingID collaborationType: " +
collaborationType +
", messageInfo: " +
messageInfo
);
if (collaborationType == COLLABORATION_TYPE.DOCUMENT) { if (collaborationType == COLLABORATION_TYPE.DOCUMENT) {
return messageInfo[3]; return messageInfo[3];
} else { } else {
...@@ -93,7 +119,7 @@ var getMeetingID = function (collaborationType, messageInfo) { ...@@ -93,7 +119,7 @@ var getMeetingID = function (collaborationType, messageInfo) {
} }
}; };
var renderCollaborationMessage = function ( CHAT_SOCKET.renderCollaborationMessage = function (
template, template,
roomName, roomName,
userList, userList,
...@@ -102,6 +128,20 @@ var renderCollaborationMessage = function ( ...@@ -102,6 +128,20 @@ var renderCollaborationMessage = function (
meetingID, meetingID,
createdAt createdAt
) { ) {
console.log(
"peacekim:: CHAT_SOCKET.renderCollaborationMessage roomName: " +
roomName +
", userList: " +
userList +
", insertDate: " +
insertDate +
", collaborationType: " +
collaborationType +
", meetingID: " +
meetingID +
", createdAt: " +
createdAt
);
let messageTime = CHAT_UTIL.formatDate(createdAt); let messageTime = CHAT_UTIL.formatDate(createdAt);
return Mustache.render(template, { return Mustache.render(template, {
roomName: roomName, roomName: roomName,
...@@ -118,15 +158,18 @@ var renderCollaborationMessage = function ( ...@@ -118,15 +158,18 @@ var renderCollaborationMessage = function (
}); });
}; };
var addTextMessage = function (messageText, message, socketID) { CHAT_SOCKET.addTextMessage = function (messageText, message, socketID) {
const messageTextWithSID = insertSID(messageText); console.log("peacekim:: CHAT_SOCKET.addTextMessage messageText: " + messageText + ", message: " + message + ", socketID: " + socketID);
const messageTextWithSID = CHAT_SOCKET.insertSID(messageText);
const messageSender = JSON.parse( const messageSender = JSON.parse(
NativeBridgeDataSource.getUserInfoList(message.userId) NativeBridgeDataSource.getUserInfoList(message.userId)
); );
const shopMemberName = messageSender[0].shopMemberName; const shopMemberName = messageSender[0].shopMemberName;
const textMessageTemplate = getTextMessageTemplate(message.id === socketID); const textMessageTemplate = CHAT_SOCKET.getTextMessageTemplate(
message.id === socketID
);
const profileImagePath = Common.getProfileImgUrl(message.profileImagePath); const profileImagePath = Common.getProfileImgUrl(message.profileImagePath);
const html = renderTextMessage( const html = CHAT_SOCKET.renderTextMessage(
textMessageTemplate, textMessageTemplate,
messageTextWithSID, messageTextWithSID,
shopMemberName, shopMemberName,
...@@ -137,7 +180,7 @@ var addTextMessage = function (messageText, message, socketID) { ...@@ -137,7 +180,7 @@ var addTextMessage = function (messageText, message, socketID) {
$("#messages").append(html); $("#messages").append(html);
}; };
var renderTextMessage = function ( CHAT_SOCKET.renderTextMessage = function (
template, template,
text, text,
from, from,
...@@ -165,11 +208,12 @@ var renderTextMessage = function ( ...@@ -165,11 +208,12 @@ var renderTextMessage = function (
} }
}; };
var getUserInfoList = function (userID) { CHAT_SOCKET.getUserInfoList = function (userID) {
return JSON.parse(NativeBridgeDataSource.getUserInfoList(userID)); return JSON.parse(NativeBridgeDataSource.getUserInfoList(userID));
}; };
var cleanUpCollaborationMessage = function () { CHAT_SOCKET.cleanUpCollaborationMessage = function () {
console.log("peacekim:: CHAT_SOCKET.cleanUpCollaborationMessage");
$(".collabo_area.start").each(function (index, collaborationMessage) { $(".collabo_area.start").each(function (index, collaborationMessage) {
$(collaborationMessage).removeClass("start"); $(collaborationMessage).removeClass("start");
$(collaborationMessage).addClass("end"); $(collaborationMessage).addClass("end");
...@@ -179,11 +223,12 @@ var cleanUpCollaborationMessage = function () { ...@@ -179,11 +223,12 @@ var cleanUpCollaborationMessage = function () {
.attr("disabled", "disabled"); .attr("disabled", "disabled");
$(collaborationMessage) $(collaborationMessage)
.find(".collaboration_join_message") .find(".collaboration_join_message")
.text(getLocalizedString("message_ended")); .text(getLocalizedString("flex-directionmessage_ended"));
}); });
}; };
var insertSID = function (text) { CHAT_SOCKET.insertSID = function (text) {
console.log("peacekim:: CHAT_SOCKET.insertSID text: " + text);
let replacePath = text; let replacePath = text;
replacePath = replacePath.replaceAll( replacePath = replacePath.replaceAll(
"?fileName=", "?fileName=",
...@@ -192,7 +237,7 @@ var insertSID = function (text) { ...@@ -192,7 +237,7 @@ var insertSID = function (text) {
return replacePath; return replacePath;
}; };
var getTextMessageTemplate = function (isSenderMySelf) { CHAT_SOCKET.getTextMessageTemplate = function (isSenderMySelf) {
return getTemplate( return getTemplate(
isSenderMySelf isSenderMySelf
? TemplateURL.MY_MESSAGE // ユーザーが送信したメッセージの場合、自分のメッセージ様式を適用して表示する ? TemplateURL.MY_MESSAGE // ユーザーが送信したメッセージの場合、自分のメッセージ様式を適用して表示する
......
...@@ -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();
...@@ -197,7 +197,7 @@ CHAT_SOCKET.emitCollaborationFinishMessage = function () { ...@@ -197,7 +197,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(sendData, 0); 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);
......
...@@ -98,20 +98,20 @@ ChatRoom.loadMessages = function (joinRoomID, joinRoomName) { ...@@ -98,20 +98,20 @@ 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調整 // iOS用スクロールoffset調整
if (deviceInfo.isiOS()) { if (deviceInfo.isiOS()) {
$(window).on("load", function () { window.addEventListener(
ChatRoom.scrollToBottom(); "load",
}); function (event) {
ChatRoom.scrollToBottom(false);
},
false
);
} }
}; };
ChatRoom.configureRoomMenu = function () { ChatRoom.configureRoomMenu = function () {
console.log("peacekim:: ChatRoom.configureRoomMenu");
if (roomInfo.roomType == ChatRoomType.DM) { if (roomInfo.roomType == ChatRoomType.DM) {
$("#roomMenu").removeClass("none"); $("#roomMenu").removeClass("none");
} else { } else {
...@@ -254,7 +254,9 @@ ChatRoom.renderCollaborationMessage = function (message, isToday, isOtherYear) { ...@@ -254,7 +254,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 +281,7 @@ ChatRoom.renderCollaborationMessage = function (message, isToday, isOtherYear) { ...@@ -279,11 +281,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) {
......
...@@ -40,6 +40,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -40,6 +40,7 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
ChatRoom.bindResize = function () { ChatRoom.bindResize = function () {
console.log("peacekim:: ChatRoom.bindResize");
const footerHeight = $(".footer-wrap").height(); const footerHeight = $(".footer-wrap").height();
window.addEventListener("resize", function () { window.addEventListener("resize", function () {
var afterHeight = window.innerHeight; var afterHeight = window.innerHeight;
...@@ -103,19 +104,21 @@ ChatRoom.bindMessageInput = function () { ...@@ -103,19 +104,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 { startPos = winScrollTop;
$("#chat_room .user_list").removeClass("hide"); });
} };
startPos = winScrollTop;
});
//上にスクロールすると新しいメッセージを呼ぶ処理。 //上にスクロールすると新しいメッセージを呼ぶ処理。
$("#messages").scroll(function () { $("#messages").scroll(function () {
...@@ -172,15 +175,15 @@ ChatRoom.waitForLoadingImage = function (div, callback) { ...@@ -172,15 +175,15 @@ 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
); );
}; };
......
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,
}); });
......
...@@ -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
); );
} }
}; };
...@@ -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);
} }
<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
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