Commit d05043cb by Kim Peace

Added console logs

parent 22eccd64
......@@ -161,6 +161,7 @@
<script src="./js/views/contact/namecard.js"></script>
<script>
console.log("peacekim:: start collaobrtion html script");
$("#footer_collabo").load("./footer_collabo.html");
$("#modal_collabo_host_request").load("./modal_collabo_host_request.html");
$("#modal_collabo_change_host").load("./modal_collabo_change_host.html");
......
......@@ -39,6 +39,8 @@ $(".home_btn").on("click", function () {
});
document.addEventListener("DOMContentLoaded", function () {
console.log("peacekim:: DOMContentLoaded on common.js");
// ローディング表示
$("footer a").click(function (event) {
const a = $(this);
......@@ -73,7 +75,7 @@ document.addEventListener("DOMContentLoaded", function () {
});
document.addEventListener("readystatechange", () => {
console.log("peacekim:: document.readyState: " + document.readyState);
switch (document.readyState) {
case "interactive":
break;
......@@ -90,16 +92,19 @@ var Common = {};
//loadingIndicatorを表示
Common.showLoadingIndicator = function () {
console.log("peacekim:: Common.showLoadingIndicator");
NativeBridgeDelegate.showLoadingIndicator();
};
//loadingIndicatorを表示しない
Common.dismissLoadingIndicator = function () {
console.log("peacekim:: Common.dismissLoadingIndicator");
NativeBridgeDelegate.hideLoadingIndicator();
};
Common.refreshForOnline = function () {
Common.showLoadingIndicator();
console.log("peacekim:: Common.refreshForOnline");
serverInfo.isOnline = true;
$(".footer_item a").removeClass("ui-state-disabled");
if (typeof ChatList != "undefined") {
......@@ -114,6 +119,7 @@ Common.refreshForOnline = function () {
};
Common.refreshForOffline = function () {
console.log("peacekim:: Common.refreshForOffline");
serverInfo.isOnline = false;
$(".footer_item a").addClass("ui-state-disabled");
if (typeof ChatList != "undefined") {
......@@ -133,6 +139,7 @@ Common.refreshForOffline = function () {
// #36170 画像パスが存在しない場合はデフォルトの画像を返す
// 存在する場合はプロフィール画像取得用APIのURLを生成して返す
Common.getProfileImgUrl = function (path) {
console.log("peacekim:: Common.getProfileImgUrl");
if (path == undefined || path == "") {
return "./img/noImage.png";
} else if (path.includes("/mnt")) {
......@@ -153,6 +160,9 @@ Common.getProfileImgUrl = function (path) {
};
Common.startCollaboration = function (collaborationType) {
console.log(
"peacekim:: Common.startCollaboration type: " + collaborationType
);
if (deviceInfo.isAndroid()) {
if (
collaborationType == COLLABORATION_TYPE.DOCUMENT &&
......
var NativeBridgeDelegate = {};
NativeBridgeDelegate.updateRoomList = function () {
console.debug("call Native Delegate - updateRoomList");
if (typeof android != "undefined") {
android.updateRoomList();
} else {
......@@ -9,6 +10,7 @@ NativeBridgeDelegate.updateRoomList = function () {
};
NativeBridgeDelegate.roomDisplayOff = function () {
console.debug("call Native Delegate - roomDisplayOff");
if (typeof android != "undefined") {
android.roomDisplayOff();
} else {
......@@ -17,6 +19,7 @@ NativeBridgeDelegate.roomDisplayOff = function () {
};
NativeBridgeDelegate.openCommunicationHome = function () {
console.debug("call Native Delegate - openCommunicationHome");
if (typeof android != "undefined") {
android.openCommunicationHome();
} else {
......@@ -25,6 +28,8 @@ NativeBridgeDelegate.openCommunicationHome = function () {
};
NativeBridgeDelegate.joinRoom = function (roomID, roomName = "") {
console.debug("call Native Delegate - joinRoom");
if (typeof android != "undefined") {
try {
android.joinRoom(roomID, roomName);
......@@ -46,6 +51,7 @@ NativeBridgeDelegate.createChatRoom = function (
screenFlag,
isVoice
) {
console.debug("call Native Delegate - createChatRoom");
if (typeof android != "undefined") {
android.createChatRoom(
chatRoomType,
......@@ -66,6 +72,7 @@ NativeBridgeDelegate.createChatRoom = function (
};
NativeBridgeDelegate.updateContactInfo = function () {
console.debug("call Native Delegate - updateContactInfo");
if (serverInfo.isOnline == false) {
return;
}
......@@ -82,6 +89,7 @@ NativeBridgeDelegate.updateContactInfo = function () {
};
NativeBridgeDelegate.updateGroupInfo = function (groupID) {
console.debug("call Native Delegate - updateGroupInfo");
if (serverInfo.isOnline == true) {
if (typeof android != "undefined") {
// TODO: peacekim:: check this method is right or not
......@@ -96,6 +104,8 @@ NativeBridgeDelegate.joinCollaboration = function (
collaborationType,
meetingID = 0
) {
console.debug("call Native Delegate - joinCollaboration");
Common.showLoadingIndicator();
const collaborationTypeNumber =
CHAT_UTIL.getCollaborationTypeNumber(collaborationType);
if (deviceInfo.isiOS()) {
......@@ -113,9 +123,11 @@ NativeBridgeDelegate.joinCollaboration = function (
}
android.joinCollaboration(collaborationTypeNumber, meetingID);
}
Common.dismissLoadingIndicator();
};
NativeBridgeDelegate.inviteUsers = function (userIDList) {
console.debug("call Native Delegate - inviteUsers");
if (typeof android != "undefined") {
android.inviteUsers(userIDList, false);
} else {
......@@ -126,6 +138,7 @@ NativeBridgeDelegate.inviteUsers = function (userIDList) {
};
NativeBridgeDelegate.saveSelectedUserList = function (selectedUserList) {
console.debug("call Native Delegate - saveSelectedUserList");
if (typeof android != "undefined") {
android.saveSelectedUserList(selectedUserList);
} else {
......@@ -134,6 +147,7 @@ NativeBridgeDelegate.saveSelectedUserList = function (selectedUserList) {
};
NativeBridgeDelegate.startPIPMode = function () {
console.debug("call Native Delegate - startPIPMode");
if (typeof android != "undefined") {
android.startPipMode();
} else if (deviceInfo.isiOS()) {
......@@ -142,6 +156,7 @@ NativeBridgeDelegate.startPIPMode = function () {
};
NativeBridgeDelegate.finishPIPMode = function (needsAndroid = false) {
console.debug("call Native Delegate - finishPIPMode");
// not for android
if (deviceInfo.isiOS()) {
webkit.messageHandlers.finishPipMode.postMessage({});
......@@ -151,6 +166,7 @@ NativeBridgeDelegate.finishPIPMode = function (needsAndroid = false) {
};
NativeBridgeDelegate.setHostRequestFlg = function (hostRequestFlag) {
console.debug("call Native Delegate - setHostRequestFlg");
if (deviceInfo.isAndroid()) {
android.setHostRequestFlg(hostRequestFlag);
} else {
......@@ -159,6 +175,7 @@ NativeBridgeDelegate.setHostRequestFlg = function (hostRequestFlag) {
};
NativeBridgeDelegate.setToMoveGroupId = function (groupID) {
console.debug("call Native Delegate - setToMoveGroupId");
if (typeof android != "undefined") {
android.setToMoveGroupId(groupID);
} else {
......@@ -175,6 +192,10 @@ NativeBridgeDelegate.updateArchiveList = function () {
};
NativeBridgeDelegate.updateArchiveDetail = function (archiveId) {
console.debug(
"Native Delegate -BridgeDelegate.updateArchiveDetail called, archiveId: " +
archiveId
);
if (deviceInfo.isiOS()) {
webkit.messageHandlers.updateArchiveDetail.postMessage(archiveId);
} else if (deviceInfo.isAndroid()) {
......@@ -183,6 +204,7 @@ NativeBridgeDelegate.updateArchiveDetail = function (archiveId) {
};
NativeBridgeDelegate.goHome = function () {
console.debug("call Native Delegate - goHome");
if (deviceInfo.isAndroid()) {
android.goHome();
} else if (deviceInfo.isiOS()) {
......@@ -191,6 +213,7 @@ NativeBridgeDelegate.goHome = function () {
};
NativeBridgeDelegate.updatePreMessage = function (messageID) {
console.debug("call Native Delegate - updatePreMessage");
if (typeof android != "undefined") {
if (serverInfo.isOnline == true) {
android.updatePreMessage(messageID);
......@@ -204,6 +227,7 @@ NativeBridgeDelegate.updatePreMessage = function (messageID) {
};
NativeBridgeDelegate.changeRoomName = function (newRoomName) {
console.debug("call Native Delegate - changeRoomName");
if (deviceInfo.isiOS()) {
webkit.messageHandlers.changeRoomName.postMessage(newRoomName);
} else if (deviceInfo.isAndroid()) {
......@@ -212,6 +236,7 @@ NativeBridgeDelegate.changeRoomName = function (newRoomName) {
};
NativeBridgeDelegate.startCollaboration = function (type) {
console.debug("call Native Delegate - startCollaboration");
const collaborationNumber = CHAT_UTIL.getCollaborationTypeNumber(type);
if (deviceInfo.isiOS()) {
webkit.messageHandlers.startCollaboration.postMessage(collaborationNumber);
......@@ -221,6 +246,10 @@ NativeBridgeDelegate.startCollaboration = function (type) {
};
NativeBridgeDelegate.finishCollaboration = function (needsAndroid = false) {
console.debug(
"Native Delegate -BridgeDelegate.finishCollaboration called, needsAndroid: " +
needsAndroid
);
if (deviceInfo.isiOS()) {
webkit.messageHandlers.finishCollaboration.postMessage({});
} else if (needsAndroid) {
......@@ -229,6 +258,7 @@ NativeBridgeDelegate.finishCollaboration = function (needsAndroid = false) {
};
NativeBridgeDelegate.finishAllCollaboration = function () {
console.debug("call Native Delegate - finishAllCollaboration");
if (deviceInfo.isiOS()) {
webkit.messageHandlers.finishAllCollaboration.postMessage({});
} else if (deviceInfo.isAndroid()) {
......@@ -240,6 +270,7 @@ NativeBridgeDelegate.inviteCollaboration = function (
userIDList,
collaborationType
) {
console.debug("call Native Delegate - inviteCollaboration");
const collaborationNumber =
CHAT_UTIL.getCollaborationTypeNumber(collaborationType);
if (typeof android != "undefined") {
......@@ -253,6 +284,7 @@ NativeBridgeDelegate.inviteCollaboration = function (
};
NativeBridgeDelegate.clearBeforeRoomType = function () {
console.debug("call Native Delegate - clearBeforeRoomType");
if (typeof android != "undefined") {
android.clearBeforeRoomType();
} else {
......@@ -261,6 +293,7 @@ NativeBridgeDelegate.clearBeforeRoomType = function () {
};
NativeBridgeDelegate.updateMessages = function (roomID) {
console.debug("call Native Delegate - updateMessages");
if (typeof android != "undefined") {
android.updateMessages(roomID);
} else {
......@@ -269,6 +302,7 @@ NativeBridgeDelegate.updateMessages = function (roomID) {
};
NativeBridgeDelegate.saveVisitRoomInfo = function (roomID = "", roomName = "") {
console.debug("call Native Delegate - saveVisitRoomInfo");
if (deviceInfo.isiOS()) {
webkit.messageHandlers.roomInfoSaveMessageHandlerId.postMessage({
roomId: roomID,
......@@ -284,6 +318,7 @@ NativeBridgeDelegate.saveVisitRoomInfo = function (roomID = "", roomName = "") {
};
NativeBridgeDelegate.exitMeetingRoom = function () {
console.debug("call Native Delegate - exitMeetingRoom");
if (deviceInfo.isiOS()) {
webkit.messageHandlers.exitMeetingRoom.postMessage({});
} else if (deviceInfo.isAndroid()) {
......@@ -295,6 +330,7 @@ NativeBridgeDelegate.joinChangedCollaboration = function (
collaborationType,
meetingID
) {
console.debug("call Native Delegate - joinChangedCollaboration");
const collaborationNumber =
CHAT_UTIL.getCollaborationTypeNumber(collaborationType);
if (deviceInfo.isiOS()) {
......@@ -308,6 +344,7 @@ NativeBridgeDelegate.joinChangedCollaboration = function (
};
NativeBridgeDelegate.joinMeetingRoom = function (meetingID) {
console.debug("call Native Delegate - joinMeetingRoom");
if (deviceInfo.isiOS()) {
webkit.messageHandlers.joinMeetingRoom.postMessage(meetingID);
} else if (deviceInfo.isAndroid()) {
......@@ -316,6 +353,7 @@ NativeBridgeDelegate.joinMeetingRoom = function (meetingID) {
};
NativeBridgeDelegate.setJoinCollaborationType = function (type) {
console.debug("call Native Delegate - setJoinCollaborationType");
const collaborationNumber = CHAT_UTIL.getCollaborationTypeNumber(type);
if (deviceInfo.isiOS()) {
webkit.messageHandlers.setJoinCollaborationType.postMessage(
......@@ -334,6 +372,7 @@ NativeBridgeDelegate.setJoinCollaborationType = function (type) {
};
NativeBridgeDelegate.showExitHostAlert = function () {
console.debug("call Native Delegate - showExitHostAlert");
if (deviceInfo.isiOS()) {
webkit.messageHandlers.showExitHostAlert.postMessage({});
}
......@@ -341,6 +380,7 @@ NativeBridgeDelegate.showExitHostAlert = function () {
};
NativeBridgeDelegate.startContentView = function () {
console.debug("call Native Delegate - startContentView");
if (deviceInfo.isiOS()) {
webkit.messageHandlers.startContentView.postMessage({});
} else if (deviceInfo.isAndroid()) {
......@@ -352,6 +392,7 @@ NativeBridgeDelegate.changeCollaboration = function (
collaborationType,
meetingID
) {
console.debug("call Native Delegate - changeCollaboration");
const collaborationNumber =
CHAT_UTIL.getCollaborationTypeNumber(collaborationType);
if (deviceInfo.isiOS()) {
......@@ -365,6 +406,7 @@ NativeBridgeDelegate.changeCollaboration = function (
};
NativeBridgeDelegate.showLoadingIndicator = function () {
console.debug("call Native Delegate - showLoadingIndicator");
if (deviceInfo.isiOS()) {
webkit.messageHandlers.showLoadingIndicator.postMessage({});
} else if (deviceInfo.isAndroid()) {
......@@ -373,6 +415,7 @@ NativeBridgeDelegate.showLoadingIndicator = function () {
};
NativeBridgeDelegate.hideLoadingIndicator = function () {
console.debug("call Native Delegate - hideLoadingIndicator");
if (deviceInfo.isiOS()) {
webkit.messageHandlers.hideLoadingIndicator.postMessage({});
} else if (deviceInfo.isAndroid()) {
......@@ -384,6 +427,7 @@ var ReverseDelegate = {};
/* reverse delegates */
// for android native call
ReverseDelegate.leaveRoom = function () {
console.debug("call Native Delegate - leaveRoom");
CHAT_SOCKET.emitLeaveRoom();
};
......
......@@ -288,10 +288,10 @@
}
function warn(msg) {
if (hooks.suppressDeprecationWarnings === false &&
(typeof console !== 'undefined') && console.warn) {
console.warn('Deprecation warning: ' + msg);
}
// if (hooks.suppressDeprecationWarnings === false &&
// (typeof console !== 'undefined') && console.warn) {
// console.warn('Deprecation warning: ' + msg);
// }
}
function deprecate(msg, fn) {
......
......@@ -2,6 +2,14 @@ CHAT_SOCKET.bindOnNewMessage = function () {
// New Message
// #36170
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 unwrappedMessageInfo = CHAT_SOCKET.decodeMessage(message.text);
......@@ -60,6 +68,18 @@ CHAT_SOCKET.addCollaborationMessage = function (
insertDate,
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 meetingID = CHAT_SOCKET.getMeetingID(collaborationType, messageInfo);
const userInCollaboration = JSON.parse(
......@@ -88,6 +108,12 @@ CHAT_SOCKET.addCollaborationMessage = function (
};
CHAT_SOCKET.getMeetingID = function (collaborationType, messageInfo) {
console.log(
"peacekim:: CHAT_SOCKET.getMeetingID collaborationType: " +
collaborationType +
", messageInfo: " +
messageInfo
);
if (collaborationType == COLLABORATION_TYPE.DOCUMENT) {
return messageInfo[3];
} else {
......@@ -104,6 +130,20 @@ CHAT_SOCKET.renderCollaborationMessage = function (
meetingID,
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);
return Mustache.render(template, {
roomName: roomName,
......@@ -121,6 +161,14 @@ CHAT_SOCKET.renderCollaborationMessage = function (
};
CHAT_SOCKET.addTextMessage = function (messageText, message, socketID) {
console.log(
"peacekim:: CHAT_SOCKET.addTextMessage messageText: " +
messageText +
", message: " +
message +
", socketID: " +
socketID
);
const messageTextWithSID = CHAT_SOCKET.insertSID(messageText);
const messageSender = JSON.parse(
NativeBridgeDataSource.getUserInfoList(message.userId)
......@@ -174,6 +222,7 @@ CHAT_SOCKET.getUserInfoList = function (userID) {
};
CHAT_SOCKET.cleanUpCollaborationMessage = function () {
console.log("peacekim:: CHAT_SOCKET.cleanUpCollaborationMessage");
$(".collabo_area.start").each(function (index, collaborationMessage) {
$(collaborationMessage).removeClass("start");
$(collaborationMessage).addClass("end");
......@@ -188,6 +237,7 @@ CHAT_SOCKET.cleanUpCollaborationMessage = function () {
};
CHAT_SOCKET.insertSID = function (text) {
console.log("peacekim:: CHAT_SOCKET.insertSID text: " + text);
let replacePath = text;
replacePath = replacePath.replaceAll(
"?fileName=",
......
......@@ -10,6 +10,7 @@ CHAT_SOCKET.socketCheck = function () {
};
CHAT_SOCKET.connectSocket = function () {
console.log("peacekim:: CHAT_SOCKET.connectSocket");
if (serverInfo.isOnline == true) {
socket = io(serverInfo.chatURL);
setSocketAction();
......@@ -47,6 +48,7 @@ function setSocketAction() {
var bindOnConnect = function () {
socket.on(SOCKET_KEY.CONNECT, function () {
console.log("peacekim:: on SOCKET_KEY.CONNECT");
// socketが接続されたらチャット画面で画面を更新する
$(".overlay").removeClass("active undismissable");
});
......@@ -54,6 +56,7 @@ var bindOnConnect = function () {
var bindOnDisconnect = function () {
socket.on(SOCKET_KEY.DISCONNECT, function () {
console.log("peacekim:: on SOCKET_KEY.DISCONNECT");
//socketが切断されたら黒画面で画面を更新する
$(".overlay").addClass("active undismissable");
Common.dismissLoadingIndicator();
......@@ -62,6 +65,7 @@ var bindOnDisconnect = function () {
var bindOnConnectError = function () {
socket.on(SOCKET_KEY.CONNECT_ERROR, function () {
console.log("peacekim:: on SOCKET_KEY.CONNECT_ERROR");
Common.dismissLoadingIndicator();
});
};
......@@ -69,6 +73,7 @@ var bindOnConnectError = function () {
var bindOnNewNotification = function () {
// Notification
socket.on(SOCKET_KEY.NEW_NOTIFICATION, function (keyword, event) {
console.log("peacekim:: on SOCKET_KEY.NEW_NOTIFICATION");
const notificationString = getLocalizedString(event, keyword);
$("#messageNotification")
.finish()
......@@ -83,6 +88,12 @@ var bindOnNewNotification = function () {
var bindOnRefreshGroupList = function () {
// Update Group List(Invite)
socket.on(SOCKET_KEY.REFRESH_GROUPLIST, function (groups, isInvite) {
console.log(
"peacekim:: on SOCKET_KEY.REFRESH_GROUPLIST isInvite: " +
isInvite +
", groups: " +
groups
);
const groupListElement = $("#group_list");
groupListElement.html("");
......@@ -100,6 +111,7 @@ var bindOnRefreshGroupList = function () {
var bindOnShowServerError = function () {
socket.on(SOCKET_KEY.SHOW_SERVER_ERROR, function (message) {
console.log("peacekim:: on SOCKET_KEY.SHOW_SERVER_ERROR, message: " + message);
// #36215
if (message.includes("SC_FORBIDDEN")) {
alert("SC_FORBIDDEN");
......@@ -131,6 +143,7 @@ var bindOnShowServerError = function () {
var bindOnRetryJoinProcess = function () {
socket.on(SOCKET_KEY.RETRY_JOIN_PROCESS, function () {
console.log("peacekim:: on SOCKET_KEY.RETRY_JOIN_PROCESS");
currentUserInfo.configureLanguage();
// webでのsocket connect
CHAT_SOCKET.emitJoin(params, true, true);
......@@ -143,6 +156,7 @@ CHAT_SOCKET.emitJoin = function (
needsHandlingError
) {
socket.emit(SOCKET_KEY.JOIN, joinInfo, function (err) {
console.log("peacekim:: emit SOCKET_KEY.JOIN");
if (err) {
if (needsHandlingError) {
errorHandlingForEmitJoin();
......@@ -180,6 +194,7 @@ var bindOnRefreshUserListInGroup = function () {
socket.on(
SOCKET_KEY.REFRESH_USERLIST_INGROUP,
function (users, groupId, isInvite) {
console.log("peacekim:: on SOCKET_KEY.REFRESH_USERLIST_INGROUP");
console.debug(
SOCKET_KEY.REFRESH_USERLIST_INGROUP +
"message received but it does nothing."
......@@ -214,6 +229,7 @@ CHAT_SOCKET.saveRoomInfo = function (roomID, roomName) {
};
CHAT_SOCKET.initialJoin = function () {
console.log("peacekim:: CHAT_SOCKET.initialJoin");
CHAT_SOCKET.connectSocket();
const joinInfo = new JoinInfo(
currentUserInfo.sid,
......
......@@ -8,6 +8,7 @@ const collaborationMessageTemplate = getTemplate(
* Search Messages
***********************/
ChatRoom.appendSearchMessages = function (messages, unwrappedWorkVal = "") {
console.log("peacekim:: ChatRoom.appendSearchMessages mesage: " + messages);
let workVal = unwrappedWorkVal;
messages.forEach(function (message) {
let html = ChatRoom.renderMessageForSearchMessage(message);
......@@ -17,6 +18,9 @@ ChatRoom.appendSearchMessages = function (messages, unwrappedWorkVal = "") {
};
ChatRoom.renderMessageForSearchMessage = function (message) {
console.log(
"peacekim:: ChatRoom.renderMessageForSearchMessage mesage: " + messages
);
let template = ChatRoom.getChatMessageTemplate(
message.messageType,
message.shopMemberId
......@@ -50,6 +54,7 @@ ChatRoom.renderMessageForSearchMessage = function (message) {
***********************/
// Input recognize
$("#messageInput").on("keypress", function (event) {
console.log("peacekim:: ChatRoom - messageInput keypressed");
if (event.which == 13) {
// Enterキーの処理
$("#messageSend").click();
......@@ -57,6 +62,7 @@ $("#messageInput").on("keypress", function (event) {
});
ChatRoom.sendMessage = function (e) {
console.log("peacekim:: ChatRoom - sendMessage");
const messageTextBox = $("#messageInput");
const message =
messageTextBox.val().length > 0
......@@ -75,6 +81,12 @@ ChatRoom.sendMessage = function (e) {
* Load Messages
***********************/
ChatRoom.loadMessages = function (joinRoomID, joinRoomName) {
console.log(
"peacekim:: ChatRoom.loadMessages joinRoomID: " +
joinRoomID +
", joinRoomName: " +
joinRoomName
);
let roomID = joinRoomID.toString().replace(/['"]+/g, "");
roomName = joinRoomName;
// 画面更新
......@@ -98,7 +110,6 @@ ChatRoom.loadMessages = function (joinRoomID, joinRoomName) {
let messages = NativeBridgeDataSource.getMessagesByRoomID(roomID);
ChatRoom.prependMessage(messages);
window.addEventListener(
"load",
function (event) {
......@@ -109,6 +120,7 @@ ChatRoom.loadMessages = function (joinRoomID, joinRoomName) {
};
ChatRoom.configureRoomMenu = function () {
console.log("peacekim:: ChatRoom.configureRoomMenu");
if (roomInfo.roomType == ChatRoomType.DM) {
$("#roomMenu").removeClass("none");
} else {
......@@ -117,6 +129,7 @@ ChatRoom.configureRoomMenu = function () {
};
ChatRoom.appendAttendedUsers = function (roomID) {
console.log("peacekim:: ChatRoom.appendAttendedUsers roomID: " + roomID);
const topUserListTemplate = getTemplate(TemplateURL.CHATROOM_USER_LIST);
const filterUserListTemplate = getTemplate(
TemplateURL.CHATROOM_USER_FILTER_LIST
......@@ -143,6 +156,9 @@ ChatRoom.appendAttendedUsers = function (roomID) {
};
ChatRoom.prependMessage = function (messages) {
console.log(
"peacekim:: ChatRoom.appendAttendedUsers prependMessage: " + messages
);
const now = new Date();
const messageElement = $("#messages");
......@@ -167,9 +183,9 @@ ChatRoom.prependMessage = function (messages) {
// 日付ラーベル表示
if (
messageCreatedTime != checkBeforeDate
&& checkBeforeDate != ""
&& !isToday
messageCreatedTime != checkBeforeDate &&
checkBeforeDate != "" &&
!isToday
) {
const html = ChatRoom.renderDateLabelMessage(beforeDate);
messageElement.append(html);
......@@ -187,6 +203,10 @@ ChatRoom.prependMessage = function (messages) {
};
ChatRoom.appendInitialDateMessage = function (messages) {
console.log(
"peacekim:: ChatRoom.appendAttendedUsers appendInitialDateMessage: " +
messages
);
if ($(".chat_message").length != 0 && messages.length != 0) {
$("#initial-date-message").detach();
const html = ChatRoom.renderDateLabelMessage(
......@@ -241,6 +261,14 @@ ChatRoom.renderMessage = function (message, isToday, isOtherYear) {
};
ChatRoom.renderCollaborationMessage = function (message, isToday, isOtherYear) {
console.log(
"peacekim:: ChatRoom.renderCollaborationMessage message: " +
message +
" isToday: " +
isToday +
" isOtherYear: " +
isOtherYear
);
const collaborationInfo = JSON.parse(message.message);
const userInCollaboration = JSON.parse(
NativeBridgeDataSource.getUserInfoList(collaborationInfo.userList)
......@@ -282,6 +310,7 @@ ChatRoom.getMeetingID = function (meetingID) {
};
ChatRoom.getDisplayUserList = function (userList) {
console.log("peacekim:: ChatRoom.getDisplayUserList userList: " + userList);
userList.forEach(function (user) {
user.profileUrl = Common.getProfileImgUrl(user.profileUrl);
});
......@@ -289,6 +318,14 @@ ChatRoom.getDisplayUserList = function (userList) {
};
ChatRoom.renderChatMessage = function (message, isToday, isOtherYear) {
console.log(
"peacekim:: ChatRoom.renderChatMessage message: " +
message +
" isToday: " +
isToday +
" isOtherYear: " +
isOtherYear
);
const template = ChatRoom.getChatMessageTemplate(
message.messageType,
message.shopMemberId
......
ChatRoom.bindSearchUI = function () {
console.log("peacekim:: ChatRoom.bindSearchUI");
const chatSearchForm = $(".chat_room_src_form");
const chatSearchInput = $('.chat_room_src_form input[type="search"]');
const searchMessage = $("#searchMessage");
// 検索アイコン押下イベント
$(".nav_item_wrap .search_menu").click(function () {
console.log(
"peacekim:: ChatRoom.bindSearchUI .nav_item_wrap .search_menu clicked"
);
$(".nav_item_wrap").addClass("none");
$(".footer-wrap").addClass("none");
chatSearchForm.removeClass("none");
......@@ -20,6 +24,9 @@ ChatRoom.bindSearchUI = function () {
});
$(".chat_room_src_form .cancel").click(function () {
console.log(
"peacekim:: ChatRoom.bindSearchUI .chat_room_src_form .cancel clicked"
);
$(".nav_item_wrap").removeClass("none");
$(".footer-wrap").removeClass("none");
chatSearchForm.addClass("none");
......@@ -37,6 +44,9 @@ ChatRoom.bindSearchUI = function () {
});
chatSearchInput.click(function () {
console.log(
"peacekim:: ChatRoom.bindSearchUI .chat_room_src_form input[type=search] clicked"
);
if (searchMessage.hasClass("onfocus")) {
searchMessage.removeClass("onfocus");
searchMessage.blur();
......@@ -47,12 +57,18 @@ ChatRoom.bindSearchUI = function () {
});
searchMessage.blur(function () {
console.log(
"peacekim:: ChatRoom.bindSearchUI .chat_room_src_form input[type=search] blured"
);
searchMessage.removeClass("onfocus");
});
// チャットルーム
// メッセージ検索イベント
chatSearchInput.keyup(function (e) {
console.log(
"peacekim:: ChatRoom.bindSearchUI .chat_room_src_form input[type=search] key up"
);
let workVal = "";
const keyword = chatSearchInput.val();
const enterKeyPressed = e.key == "Enter" || e.KeyCode == 13;
......@@ -76,6 +92,9 @@ ChatRoom.bindSearchUI = function () {
// iOSキーボード変換検知用
chatSearchInput.on("compositionend", function () {
console.log(
"peacekim:: ChatRoom.bindSearchUI .chat_room_src_form input[type=search] compositionend"
);
if (deviceInfo.isiOS()) {
let workVal = "";
var keyword = chatSearchInput.val();
......@@ -87,13 +106,18 @@ ChatRoom.bindSearchUI = function () {
// フィルタ選択イベント
$(document).on("click", "#filter .img_wrap", function (event) {
console.log("peacekim:: ChatRoom.bindSearchUI .filter .img_wrap clicked");
// チェックアイコン追加
$(this).toggleClass("filter");
});
};
ChatRoom.bindUserFilteredMessage = function () {
console.log("peacekim:: ChatRoom.bindUserFilteredMessage");
$(document).on("click", ".filter_img", function (event) {
console.log(
"peacekim:: ChatRoom.bindUserFilteredMessage on document click"
);
const keyword = $('.chat_room_src_form input[type="search"]').val();
$(".overlay_src_msg").empty();
let checkedUserList = ChatRoom.getCheckedUserList();
......@@ -110,6 +134,7 @@ ChatRoom.bindUserFilteredMessage = function () {
// メッセージ検索
ChatRoom.searchMessage = function (keyword, workVal) {
console.log("peacekim:: ChatRoom.searchMessage");
$(".overlay_src_msg").empty();
let checkedUserList = ChatRoom.getCheckedUserList();
const messages = NativeBridgeDataSource.searchMessages(
......@@ -126,6 +151,7 @@ ChatRoom.searchMessage = function (keyword, workVal) {
};
ChatRoom.getCheckedUserList = function () {
console.log("peacekim:: ChatRoom.getCheckedUserList");
let checkedUserList = [];
$(".img_wrap.filter").each(function (user) {
const selectedUser = $(".img_wrap.filter")[user];
......
......@@ -37,6 +37,7 @@ window.onscroll = function () {
};
document.addEventListener("DOMContentLoaded", function () {
console.log("peacekim:: chat-room DOMContentLoaded");
// 検索イベントバインディング
ChatRoom.bindSearchUI();
......@@ -86,6 +87,7 @@ ChatRoom.bindResize = function () {
};
ChatRoom.bindMessageInput = function () {
console.log("peacekim:: ChatRoom.bindMessageInput");
$("#messageInput").focusin(function (e) {
beforeHeight = window.innerHeight;
beforeWidth = window.innerWidth;
......@@ -133,6 +135,7 @@ ChatRoom.bindUserListDisplayToggle = function () {
// 画像の読み込みが全て終わったタイミングでコールバック実行
// FIXME 追加読み込みの場合は差分の画像のみ監視すべきだが、現状新規入室時にしか対応出来ていない。
ChatRoom.waitForLoadingVideo = function (div, callback) {
console.log("peacekim:: ChatRoom.waitForLoadingVideo");
Common.showLoadingIndicator();
// var imgs = document.getElementsByTagName("video");
let video = div.find("video");
......@@ -151,6 +154,7 @@ ChatRoom.waitForLoadingVideo = function (div, callback) {
};
ChatRoom.waitForLoadingImage = function (div, callback) {
console.log("peacekim:: ChatRoom.waitForLoadingImage");
let imgs = div.find("img");
let count = imgs.length;
if (count == 0) callback();
......@@ -171,9 +175,9 @@ ChatRoom.waitForLoadingImage = function (div, callback) {
};
ChatRoom.scrollToBottom = function (animated = true) {
console.log("peacekim:: ChatRoom.scrollToBottom");
const messages = $(".room_contents");
const scrollHeight = messages.prop("scrollHeight");
$("html, body").animate(
{
scrollTop: scrollHeight,
......@@ -182,11 +186,13 @@ ChatRoom.scrollToBottom = function (animated = true) {
function () {
initialLoading = false;
Common.dismissLoadingIndicator();
console.log("peacekim:: ChatRoom.scrollToBottom animate completed");
}
);
};
ChatRoom.refreshForOnline = function () {
console.log("peacekim:: ChatRoom.refreshForOnline");
$("#videoUploadButton").removeClass("ui-state-disabled");
$("#imageInputButton").removeClass("ui-state-disabled");
$("#messageSend").prop("disabled", false);
......@@ -202,6 +208,7 @@ ChatRoom.refreshForOnline = function () {
};
ChatRoom.refreshForOffline = function () {
console.log("peacekim:: ChatRoom.refreshForOffline");
$("#videoUploadButton").addClass("ui-state-disabled");
$("#imageInputButton").addClass("ui-state-disabled");
$("#messageSend").prop("disabled", true);
......
......@@ -4,6 +4,7 @@ var ChatManagementCommon = {};
ChatManagementCommon.selectedUserList = new Array();
ChatManagementCommon.showMakeRoomConfirmView = function () {
console.log("peacekim:: ChatManagementCommon.showMakeRoomConfirmView");
$("#selectedUserList").html("");
const userTemplate = getTemplate(TemplateURL.MAKE_ROOM_CONFIRM_USER_LIST);
......@@ -23,6 +24,7 @@ ChatManagementCommon.showMakeRoomConfirmView = function () {
$("#makeRoomBtn")
.off()
.on("click", function () {
console.log("peacekim:: ChatManagementCommon - makeRoomBtn clicked");
// #36130に対応
const trimmedRoomName = $("#newRoomName").val().trim();
if (trimmedRoomName.length == 0) {
......@@ -128,6 +130,7 @@ ChatManagementCommon.showMakeRoomConfirmView = function () {
};
ChatManagementCommon.showAddUserConfirmView = function () {
console.log("peacekim:: ChatManagementCommon.showAddUserConfirmView");
$("#selectedUserList").html("");
const userTemplate = getTemplate(TemplateURL.ADD_USER_CONFIRM_USER_LIST);
......@@ -146,6 +149,9 @@ ChatManagementCommon.showAddUserConfirmView = function () {
$("#addUserBtn")
.off()
.on("click", function () {
console.log(
"peacekim:: ChatManagementCommon.showAddUserConfirmView addUserBtn clicked"
);
Common.showLoadingIndicator();
let userIdList = new Array();
selectedUserList.forEach(function (user) {
......@@ -156,6 +162,10 @@ ChatManagementCommon.showAddUserConfirmView = function () {
};
ChatManagementCommon.checkForMakeChat = function (checkMemberID) {
console.log(
"peacekim:: ChatManagementCommon.checkForMakeChat check memberID: " +
checkMemberID
);
let findObj = ChatManagementCommon.selectedUserList.find(function (
shopMemberID
) {
......@@ -184,6 +194,12 @@ ChatManagementCommon.checkForMakeChat = function (checkMemberID) {
};
ChatManagementCommon.updateCheckBox = function (checkMemberID, checked) {
console.log(
"peacekim:: ChatManagementCommon.updateCheckBox check memberID: " +
checkMemberID +
", checked: " +
checked
);
$(".checkbox" + checkMemberID)
.prop("checked", checked)
.trigger("change");
......
CollaborationUI.initialBindAddUserButton = function () {
console.log("peacekim:: CollaborationUI.initialBindAddUserButton");
// ユーザー招待メンバー検索
$(".add_user_btn").click(function () {
console.log("peacekim:: CollaborationUI.initialBindAddUserButton add_user_btn clicked");
CollaborationUI.bindEnableScroll();
Common.showLoadingIndicator();
ChatManagementCommon.selectedUserList = [];
......@@ -8,6 +10,7 @@ CollaborationUI.initialBindAddUserButton = function () {
$("#addUserConfirmBtnInCollaboration")
.off()
.on("click", function () {
console.log("peacekim:: CollaborationUI.initialBindAddUserButton addUserConfirmBtnInCollaboration clicked");
$("#addUserInCollaboration").modal("hide");
const selectedUserList =
ChatManagementCommon.selectedUserList.join(",");
......@@ -18,14 +21,17 @@ CollaborationUI.initialBindAddUserButton = function () {
};
$("#tabMyGroupOnAddUserInCollaboration").on("click", function (e) {
console.log("peacekim:: CollaborationUI.initialBindAddUserButton tabMyGroupOnAddUserInCollaboration clicked");
CollaborationUI.refreshMyGroupForAddUserInCollaboration();
});
$("#tabAllGroupOnAddUserInCollaboration").on("click", function (e) {
console.log("peacekim:: CollaborationUI.initialBindAddUserButton tabAllGroupOnAddUserInCollaboration clicked");
CollaborationUI.refreshAllGroupForAddUserInCollaboration("0");
});
CollaborationUI.refreshMyGroupForAddUserInCollaboration = function () {
console.log("peacekim:: CollaborationUI.initialBindAddUserButton refreshMyGroupForAddUserInCollaboration");
if (ChatManagementCommon.selectedUserList.length > 0) {
$(".select_member_num").text(ChatManagementCommon.selectedUserList.length);
} else {
......@@ -49,6 +55,7 @@ CollaborationUI.refreshMyGroupForAddUserInCollaboration = function () {
};
CollaborationUI.appendFavoriteGroupList = function () {
console.log("peacekim:: CollaborationUI.appendFavoriteGroupList");
// グループの様式を読み込む
const groupTemplate = getTemplate(
TemplateURL.ADD_USER_GROUP_LIST_IN_COLLABORATION
......@@ -67,6 +74,7 @@ CollaborationUI.appendFavoriteGroupList = function () {
};
CollaborationUI.appendFavoriteUserList = function () {
console.log("peacekim:: CollaborationUI.appendFavoriteUserList");
// ユーザの様式を読み込む
const userTemplate = getTemplate(
TemplateURL.ADD_USER_USER_LIST_IN_COLLABORATION
......@@ -92,6 +100,7 @@ CollaborationUI.appendFavoriteUserList = function () {
};
CollaborationUI.appendMyGroupList = function () {
console.log("peacekim:: CollaborationUI.appendMyGroupList");
const groupUserTemplate = getTemplate(
TemplateURL.ADD_USER_GROUP_USER_LIST_IN_COLLABORATION
);
......@@ -119,6 +128,7 @@ CollaborationUI.appendMyGroupList = function () {
};
CollaborationUI.refreshAllGroupForAddUserInCollaboration = function (groupID) {
console.log("peacekim:: CollaborationUI.refreshAllGroupForAddUserInCollaboration");
$(".content").removeClass("none");
$("#tabAllGroupOnAddUserInCollaboration").prop("checked", true);
......@@ -153,13 +163,17 @@ CollaborationUI.refreshAllGroupForAddUserInCollaboration = function (groupID) {
};
CollaborationUI.bindOnClickParentGroup = function (parentGroupID) {
console.log("peacekim:: CollaborationUI.bindOnClickParentGroup");
$("#parentGroupBtnForAddUserInCollaboration").on("click", function () {
console.log("peacekim:: CollaborationUI.bindOnClickParentGroup parentGroupBtnForAddUserInCollaboration clicked");
CollaborationUI.refreshAllGroupForAddUserInCollaboration(parentGroupID);
});
};
CollaborationUI.bindOnClickRootGroup = function (rootGroupID) {
console.log("peacekim:: CollaborationUI.bindOnClickRootGroup");
$("#rootGroupBtnForAddUserInCollaboration").on("click", function () {
console.log("peacekim:: CollaborationUI.bindOnClickRootGroup rootGroupBtnForAddUserInCollaboration clicked");
CollaborationUI.refreshAllGroupForAddUserInCollaboration(rootGroupID);
});
};
......@@ -168,6 +182,7 @@ CollaborationUI.displayRootGroupAndParentGroupIfNeeded = function (
rootGroupID,
groupID
) {
console.log("peacekim:: CollaborationUI.displayRootGroupAndParentGroupIfNeeded");
if (typeof rootGroupID !== "undefined" && paramGroupID == 0) {
groupID = rootGroupID;
}
......@@ -182,6 +197,7 @@ CollaborationUI.displayRootGroupAndParentGroupIfNeeded = function (
};
CollaborationUI.appendGroupPath = function (groupPathList) {
console.log("peacekim:: CollaborationUI.appendGroupPath groupPathList: "+ groupPathList);
const groupPathTemplate = getTemplate(
TemplateURL.ADD_USER_GROUP_PATH_IN_COLLABORATION
);
......@@ -201,6 +217,7 @@ CollaborationUI.appendGroupPath = function (groupPathList) {
};
CollaborationUI.appendChildGroups = function (chidGroups) {
console.log("peacekim:: CollaborationUI.appendChildGroups chidGroups: "+ chidGroups);
const groupTemplate = getTemplate(
TemplateURL.ADD_USER_GROUP_LIST_IN_COLLABORATION
);
......@@ -217,6 +234,7 @@ CollaborationUI.appendChildGroups = function (chidGroups) {
};
CollaborationUI.appendUsers = function (userList) {
console.log("peacekim:: CollaborationUI.appendUsers userList: "+ userList);
const userTemplate = getTemplate(
TemplateURL.ADD_USER_USER_LIST_IN_COLLABORATION
);
......@@ -244,6 +262,7 @@ CollaborationUI.appendRootGroupAndParentGroupIfNeeded = function (
parentGroupID,
groupID
) {
console.log("peacekim:: CollaborationUI.appendRootGroupAndParentGroupIfNeeded");
if (typeof parentGroupID !== "undefined") {
CollaborationUI.bindOnClickParentGroup(parentGroupID);
}
......@@ -256,6 +275,7 @@ CollaborationUI.appendRootGroupAndParentGroupIfNeeded = function (
};
CollaborationUI.confirmInviteUserListInCollaboration = function () {
console.log("peacekim:: CollaborationUI.confirmInviteUserListInCollaboration");
const selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") {
$("#selectedUserListinCollaboration").html("");
......@@ -280,18 +300,22 @@ CollaborationUI.confirmInviteUserListInCollaboration = function () {
};
CollaborationUI.bindCancelAddUserButton = function () {
console.log("peacekim:: CollaborationUI.bindCancelAddUserButton");
$("#cancelAddUserBtn")
.off()
.on("click", function () {
console.log("peacekim:: CollaborationUI.bindCancelAddUserButton cancelAddUserBtn clicked");
$("#modalAddUserConfirm").modal("hide");
$("#addUserInCollaboration").modal("show");
});
};
CollaborationUI.bindAddUserButton = function (selectedUsers) {
console.log("peacekim:: CollaborationUI.bindAddUserButton");
$("#addUserBtn")
.off()
.on("click", function () {
console.log("peacekim:: CollaborationUI.bindAddUserButton addUserBtn clicked");
Common.showLoadingIndicator();
let userIDList = selectedUsers.map((user) => user.shopMemberId);
const commaJoinedUserIDList = userIDList.join(",");
......@@ -308,6 +332,7 @@ CollaborationUI.bindAddUserButton = function (selectedUsers) {
};
CollaborationUI.toggleCategory = function (category) {
console.log("peacekim:: CollaborationUI.toggleCategory");
$(category).toggleClass("open");
$(category).next().slideToggle();
};
var CollaborationUI = {};
document.addEventListener("DOMContentLoaded", function () {
console.log("peacekim:: DOMContentLoaded on collaboration js");
CollaborationUI.bindDisableScroll();
// メニューオーバーレイ表示
......@@ -78,6 +79,7 @@ CollaborationUI.bindInviteButton = function () {
* Scroll Controls
********************************/
CollaborationUI.bindDisableScroll = function () {
console.log("peacekim:: CollaborationUI.bindDisableScroll");
document.addEventListener("mousewheel", CollaborationUI.scrollControl, {
passive: false,
});
......@@ -88,6 +90,7 @@ CollaborationUI.bindDisableScroll = function () {
// スクロール禁止解除
CollaborationUI.bindEnableScroll = function () {
console.log("peacekim:: CollaborationUI.bindEnableScroll");
document.removeEventListener("mousewheel", CollaborationUI.scrollControl, {
passive: false,
});
......@@ -97,6 +100,7 @@ CollaborationUI.bindEnableScroll = function () {
};
CollaborationUI.scrollControl = function (event) {
console.log("peacekim:: CollaborationUI.scrollControl");
if (event.cancelable) {
event.preventDefault();
}
......@@ -106,6 +110,10 @@ CollaborationUI.scrollControl = function (event) {
* NameCard in Collaboration
********************************/
CollaborationUI.makeNameCard = function (shopMemberID) {
console.log(
"peacekim:: CollaborationUI.makeNameCard shopMemberID: " + shopMemberID
);
if (currentUserInfo.shopMemberID == shopMemberID) {
return;
}
......@@ -143,6 +151,10 @@ CollaborationUI.makeNameCard = function (shopMemberID) {
};
CollaborationUI.removeFavoriteUserInCollaboration = function (shopMemberID) {
console.log(
"peacekim:: CollaborationUI.removeFavoriteUserInCollaboration shopMemberID: " +
shopMemberID
);
Common.showLoadingIndicator();
$("#userNameCardInCollaboration").modal("hide");
NativeBridgeDataSource.removeFavoriteUser(shopMemberID);
......@@ -150,12 +162,17 @@ CollaborationUI.removeFavoriteUserInCollaboration = function (shopMemberID) {
};
CollaborationUI.insertFavoriteUserInCollaboration = function (shopMemberID) {
console.log(
"peacekim:: CollaborationUI.insertFavoriteUserInCollaboration shopMemberID: " +
shopMemberID
);
$("#userNameCardInCollaboration").modal("hide");
NativeBridgeDataSource.addFavoriteUser(shopMemberID);
Common.dismissLoadingIndicator();
};
CollaborationUI.refreshForOffline = function () {
console.log("peacekim:: CollaborationUI.refreshForOffline");
serverInfo.isOnline = false;
if (typeof coview_api == "undefined") {
return;
......@@ -173,14 +190,22 @@ CollaborationUI.refreshForOffline = function () {
};
CollaborationUI.showLoadingIndicator = function () {
console.log("peacekim:: CollaborationUI.showLoadingIndicator");
$("#loadingIndicator").addClass("full_active");
};
CollaborationUI.hideLoadingIndicator = function () {
console.log("peacekim:: CollaborationUI.hideLoadingIndicator");
$("#loadingIndicator").removeClass("full_active");
};
CollaborationUI.displayAddUserButtonIfNeeded = function () {
console.log(
"peacekim:: CollaborationUI.displayAddUserButtonIfNeeded" +
", roomInfo.roomType == ChatRoomType.DM: " +
roomInfo.roomType ==
ChatRoomType.DM
);
if (roomInfo.roomType == ChatRoomType.DM) {
$(".add_user_btn").removeClass("none");
}
......
......@@ -2,20 +2,26 @@ var FermiWebSocketBridge = {};
// call from modal_collabo_profile.html
FermiWebSocketBridge.requestHostChange = function (loginID) {
console.log(
"peacekim:: FermiWebSocketBridge.requestHostChange loginID: " + loginID
);
fw.sendToMsg("others", "HOST_CHANGE_REQUEST", {
loginId: loginID,
});
};
FermiWebSocketBridge.shareFileHost = function (collaborationType) {
console.log(
"peacekim:: FermiWebSocketBridge.shareFileHost collaborationType: " +
collaborationType
);
fw.sendToMsg("others", "SHARE_FILE_HOST", {
// TODO: Peacekim check collaboration type as coviewType
collaborationType: collaborationType,
});
};
FermiWebSocketBridge.hostChangeResponse = function () {
// TODO: peacekim:: check loginID is for fw or not
console.log("peacekim:: FermiWebSocketBridge.hostChangeResponse");
fw.sendToMsg("others", "HOST_CHANGE_RESPONSE", {
isAndroid: deviceInfo.isAndroid(),
isAble: deviceInfo.androidVersion >= ANDROID_SDK_VERSION.O,
......@@ -25,6 +31,9 @@ FermiWebSocketBridge.hostChangeResponse = function () {
// PIP_END_REQUEST
FermiWebSocketBridge.pipEndRequest = function (loginID) {
console.log(
"peacekim:: FermiWebSocketBridge.pipEndRequest loginID: " + loginID
);
fw.sendToMsg("others", "PIP_END_REQUEST", {
loginId: loginID,
});
......@@ -32,6 +41,9 @@ FermiWebSocketBridge.pipEndRequest = function (loginID) {
// HOST_REQUEST_REJECT
FermiWebSocketBridge.hostRequestReject = function (hostID) {
console.log(
"peacekim:: FermiWebSocketBridge.hostRequestReject hostID: " + hostID
);
fw.sendToMsg("others", "HOST_REQUEST_REJECT", {
hostId: hostID,
});
......@@ -39,6 +51,9 @@ FermiWebSocketBridge.hostRequestReject = function (hostID) {
// HOST_REQUEST_DONE
FermiWebSocketBridge.hostRequestDone = function (hostID) {
console.log(
"peacekim:: FermiWebSocketBridge.hostRequestDone hostID: " + hostID
);
fw.sendToMsg("others", "HOST_REQUEST_DONE", {
hostId: hostID,
});
......@@ -46,6 +61,12 @@ FermiWebSocketBridge.hostRequestDone = function (hostID) {
// GET_COLLABORATION_TYPE_RESPONSE
FermiWebSocketBridge.getCollaborationTypeResponse = function (loginID) {
console.log(
"peacekim:: FermiWebSocketBridge.getCollaborationTypeResponse hostID: " +
loginID +
", meetingID: " +
meetingID
);
fw.sendToMsg("others", "GET_COLLABORATION_TYPE_RESPONSE", {
loginId: loginID,
collaborationType: globalUserInfo.collaborationType,
......@@ -55,6 +76,10 @@ FermiWebSocketBridge.getCollaborationTypeResponse = function (loginID) {
// GET_COLLABORATION_TYPE
FermiWebSocketBridge.getCollaborationType = function () {
console.log(
"peacekim:: FermiWebSocketBridge.getCollaborationType globalUserInfo.loginId: " +
globalUserInfo.loginId
);
fw.sendToMsg("others", "GET_COLLABORATION_TYPE", {
loginId: globalUserInfo.loginId,
});
......@@ -62,8 +87,11 @@ FermiWebSocketBridge.getCollaborationType = function () {
// CAPTURE_REQUEST
FermiWebSocketBridge.captureRequest = function () {
// todo: peacekim:: check if it's okay for loginID
// instead of globalUserInfo.loginId
console.log(
"peacekim:: FermiWebSocketBridge.captureRequest globalUserInfo.loginId: " +
globalUserInfo.loginId
);
fw.sendToMsg("others", "CAPTURE_REQUEST", {
name: globalUserInfo.loginId,
});
......@@ -74,6 +102,12 @@ FermiWebSocketBridge.changeCollaboration = function (
collaborationType,
newMeetingID
) {
console.log(
"peacekim:: FermiWebSocketBridge.changeCollaboration collaborationType: " +
collaborationType +
", newMeetingID: " +
newMeetingID
);
fw.sendToMsg("others", "CHANGE_COLLABORATION", {
collaborationType: collaborationType,
newMeetingId: newMeetingID,
......@@ -82,6 +116,10 @@ FermiWebSocketBridge.changeCollaboration = function (
// CHANGE_HOST_APPLY
FermiWebSocketBridge.changeHostApply = function () {
console.log(
"peacekim:: FermiWebSocketBridge.changeHostApply globalUserInfo.loginId: " +
globalUserInfo.loginId
);
fw.sendToMsg("others", "CHANGE_HOST_APPLY", {
hostId: globalUserInfo.loginId,
});
......
var FermiWebSocketMessageHandler = {};
FermiWebSocketMessageHandler.bindWebSocketMessage = function () {
console.log("peacekim:: FermiWebSocketMessageHandler.bindWebSocketMessage");
fw.socket.on("message", async function (data) {
console.log(
"peacekim:: fw socket message received, isMainman: " +
g_isMainMan +
", data.payload.loginId == globalUserInfo.loginId: " +
(data.payload.loginId == globalUserInfo.loginId)
);
if (g_isMainMan) {
FermiWebSocketMessageHandler.handleMessagesToHost(data);
} else if (data.payload.loginId == globalUserInfo.loginId) {
......@@ -14,6 +22,10 @@ FermiWebSocketMessageHandler.bindWebSocketMessage = function () {
};
FermiWebSocketMessageHandler.handleMessagesToHost = function (data) {
console.log(
"peacekim:: FermiWebSocketMessageHandler.handleMessagesToHost message: " +
data.type
);
// HOSTの場合
switch (data.type) {
case "CAPTURE_REQUEST":
......@@ -39,6 +51,10 @@ FermiWebSocketMessageHandler.handleMessagesToHost = function (data) {
};
FermiWebSocketMessageHandler.handleMessagesToSelf = function (data) {
console.log(
"peacekim:: FermiWebSocketMessageHandler.handleMessagesToSelf message: " +
data.type
);
// 自分自身の場合
switch (data.type) {
case "HOST_CHANGE_REQUEST":
......@@ -58,6 +74,10 @@ FermiWebSocketMessageHandler.handleMessagesToSelf = function (data) {
};
FermiWebSocketMessageHandler.handleMessagesToAll = function (data) {
console.log(
"peacekim:: FermiWebSocketMessageHandler.handleMessagesToAll message: " +
data.type
);
switch (data.type) {
case "CHANGE_COLLABORATION":
FermiWebSocketMessageHandler.changeCollaboration(data);
......@@ -100,6 +120,12 @@ FermiWebSocketMessageHandler.handleMessagesToAll = function (data) {
// CHANGE_COLLABORATION
FermiWebSocketMessageHandler.changeCollaboration = function (data) {
const newMeetingID = data.payload.newMeetingId;
console.log(
"peacekim:: FermiWebSocketMessageHandler.changeCollaboration newMeetingID: " +
newMeetingID +
", collaborationType: " +
data.payload.collaborationType
);
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.exitMeetingRoom();
NativeBridgeDelegate.finishPIPMode(true);
......@@ -132,6 +158,7 @@ FermiWebSocketMessageHandler.changeCollaboration = function (data) {
// SHARE_FILE
FermiWebSocketMessageHandler.shareFile = function () {
console.log("peacekim:: FermiWebSocketMessageHandler.shareFile");
CollaborationUI.updateScreen(COLLABORATION_TYPE.CAMERA);
globalUserInfo.collaborationType = COLLABORATION_TYPE.CAMERA;
FermiWebSocketBridge.shareFileHost(COLLABORATION_TYPE.CAMERA);
......@@ -139,12 +166,17 @@ FermiWebSocketMessageHandler.shareFile = function () {
// SHARE_FILE_HOST
FermiWebSocketMessageHandler.shareFileHost = function () {
console.log("peacekim:: FermiWebSocketMessageHandler.shareFileHost");
CollaborationUI.updateScreen(COLLABORATION_TYPE.CAMERA);
globalUserInfo.collaborationType = COLLABORATION_TYPE.CAMERA;
};
// CAPTURE_REQUEST
FermiWebSocketMessageHandler.captureRequest = function (data) {
console.log(
"peacekim:: FermiWebSocketMessageHandler.captureRequest name: " +
data.payload.name
);
const name = data.payload.name;
if (confirm(name + getLocalizedString("request_capture")) == false) {
return;
......@@ -169,11 +201,16 @@ FermiWebSocketMessageHandler.captureRequest = function (data) {
// HOST_CHANGE_REQUEST
FermiWebSocketMessageHandler.hostChangeRequest = function () {
console.log("peacekim:: FermiWebSocketMessageHandler.hostChangeRequest");
FermiWebSocketBridge.requestHostChange();
};
// HOST_CHANGE_RESPONSE
FermiWebSocketMessageHandler.hostChangeResponse = function (data) {
console.log(
"peacekim:: FermiWebSocketMessageHandler.hostChangeResponse loginID: " +
data.payload.loginId
);
const isAndroid = data.payload.isAndroid;
const isAble = data.payload.isAble;
if (
......@@ -193,6 +230,7 @@ FermiWebSocketMessageHandler.hostChangeResponse = function (data) {
// PIP_END_REQUEST
FermiWebSocketMessageHandler.pipEndRequest = function () {
console.log("peacekim:: FermiWebSocketMessageHandler.pipEndRequest");
NativeBridgeDelegate.finishPIPMode(true);
if (deviceInfo.isAndroid()) {
$(".pip_indicator").addClass("none");
......@@ -201,6 +239,10 @@ FermiWebSocketMessageHandler.pipEndRequest = function () {
// API_SEND_OWNER_CHANGE_COMPLETE
FermiWebSocketMessageHandler.apiSendOwnerChangeComplete = function (data) {
console.log(
"peacekim:: FermiWebSocketMessageHandler.apiSendOwnerChangeComplete, host: " +
data.payload.host
);
penOff();
if ($("#recordBtn .record").hasClass("disable")) {
recordStop(function () {});
......@@ -214,18 +256,29 @@ FermiWebSocketMessageHandler.apiSendOwnerChangeComplete = function (data) {
// API_SEND_OWNER_CHANGE_CONFIRM
FermiWebSocketMessageHandler.apiSendOwnerChangeConfirm = function () {
console.log(
"peacekim:: FermiWebSocketMessageHandler.apiSendOwnerChangeConfirm"
);
waitMillisecond(500);
removeOldLocalVideo(g_localStream);
};
// CHANGE_HOST_APPLY
FermiWebSocketMessageHandler.changeHostApplyForNotHost = function (data) {
console.log(
"peacekim:: FermiWebSocketMessageHandler.changeHostApplyForNotHost"
);
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DOING);
waitMillisecond(500);
};
// CHANGE_HOST_APPLY
FermiWebSocketMessageHandler.changeHostApplyForHost = function (data) {
console.log(
"peacekim:: FermiWebSocketMessageHandler.changeHostApplyForNotHost hostID: " +
data.payload.hostId
);
const hostID = data.payload.hostId;
coview_api.HeartBeatUser(globalUserInfo.loginId);
NativeBridgeDelegate.finishPIPMode(true);
......@@ -248,11 +301,19 @@ FermiWebSocketMessageHandler.changeHostApplyForHost = function (data) {
// HOST_REQUEST_DONE
FermiWebSocketMessageHandler.hostRequestDone = function () {
console.log("peacekim:: FermiWebSocketMessageHandler.hostRequestDone");
NativeBridgeDelegate.setHostRequestFlg(HostRequestFlag.DONE);
};
// HOST_REQUEST_REJECT
FermiWebSocketMessageHandler.hostRequestReject = function (data) {
console.log(
"peacekim:: FermiWebSocketMessageHandler.hostRequestReject hostID: " +
data.payload.hostId +
", loginID: " +
globalUserInfo.loginId
);
if (data.payload.hostId == globalUserInfo.loginId) {
alert("REJECT for owner user");
}
......@@ -261,6 +322,10 @@ FermiWebSocketMessageHandler.hostRequestReject = function (data) {
// GET_COLLABORATION_TYPE
FermiWebSocketMessageHandler.getCollaborationType = function (data) {
console.log(
"peacekim:: FermiWebSocketMessageHandler.getCollaborationType loginID: " +
data.payload.loginId
);
FermiWebSocketBridge.getCollaborationTypeResponse(data.payload.loginId);
};
......@@ -268,6 +333,14 @@ FermiWebSocketMessageHandler.getCollaborationType = function (data) {
FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) {
const collaborationType = data.payload.collaborationType;
const meetingID = data.payload.newMeetingId;
console.log(
"peacekim:: FermiWebSocketMessageHandler.getCollaborationTypeResponse globalUserInfo.collaborationType: " +
globalUserInfo.collaborationType +
", data.payload.collaborationType: " +
data.payload.collaborationType +
", meetingID: " +
meetingID
);
FermiWebSocketMessageHandler.updateJoinChangeCollaboration(collaborationType);
globalUserInfo.meetingID = meetingID;
CollaborationUI.updateScreen(globalUserInfo.collaborationType);
......@@ -284,6 +357,7 @@ FermiWebSocketMessageHandler.getCollaborationTypeResponse = function (data) {
// API_WELCOME
FermiWebSocketMessageHandler.apiWelcome = function () {
console.log("peacekim:: FermiWebSocketMessageHandler.apiWelcome");
FermiWebSocketBridge.getCollaborationType();
globalUserInfo.joinType = COLLABORATION_JOIN_TYPE.ATTENDEE;
};
......@@ -291,6 +365,10 @@ FermiWebSocketMessageHandler.apiWelcome = function () {
FermiWebSocketMessageHandler.updateJoinChangeCollaboration = function (
collaborationType
) {
console.log(
"peacekim:: FermiWebSocketMessageHandler.updateJoinChangeCollaboration collaborationType: " +
collaborationType
);
if (
deviceInfo.isAndroid() &&
collaborationType == COLLABORATION_TYPE.DOCUMENT &&
......
......@@ -2,6 +2,7 @@
* Toggle Feature Buttons
**************************/
function togglePen() {
console.log("peacekim:: share-bind-button-action - togglepend()");
$("#coviewPenCtrBtn").click();
if ($("#penBtn .pen").hasClass("disable")) {
$("#penBtn .pen").removeClass("disable");
......@@ -11,6 +12,7 @@ function togglePen() {
}
function penOff() {
console.log("peacekim:: share-bind-button-action - penOff()");
if (!$("#penBtn .pen").hasClass("disable")) {
$("#coviewPenCtrBtn").click();
$("#penBtn .pen").addClass("disable");
......@@ -18,14 +20,19 @@ function penOff() {
}
function togglePhotoOpenPlaceHolder() {
console.log(
"peacekim:: share-bind-button-action - togglePhotoOpenPlaceHolder()"
);
$("#open_file_upload").trigger("click");
}
function toggleEraser() {
console.log("peacekim:: share-bind-button-action - toggleEraser()");
$("#coviewEraserCtrBtn").click();
}
function toggleCapture() {
console.log("peacekim:: share-bind-button-action - toggleCapture()");
if ($("#recordBtn").hasClass("bg_red")) {
screenLock();
recordStop(function () {
......@@ -38,20 +45,24 @@ function toggleCapture() {
}
function toggleCaptureRequest() {
console.log("peacekim:: share-bind-button-action - toggleCaptureRequest()");
FermiWebSocketBridge.captureRequest();
}
function micOn() {
console.log("peacekim:: share-bind-button-action - micOn()");
coview_api.MicMuteControl("off");
$("#micBtn .voice").removeClass("disable");
}
function micOff() {
console.log("peacekim:: share-bind-button-action - micOff()");
coview_api.MicMuteControl("on");
$("#micBtn .voice").addClass("disable");
}
function toggleMic() {
console.log("peacekim:: share-bind-button-action - toggleMic()");
if ($("#micBtn .voice").hasClass("disable")) {
micOn();
} else {
......@@ -63,12 +74,14 @@ function toggleMic() {
* レコード関連
*************/
function recordStart() {
console.log("peacekim:: share-bind-button-action - recordStart()");
MainManRecord("on");
$("#recordBtn .record").addClass("disable");
$(".flash-txt").addClass("on");
}
function recordFinished() {
console.log("peacekim:: share-bind-button-action - recordFinished()");
$("#recordBtn .record").removeClass("disable");
$(".flash-txt").removeClass("on");
// ロック画面の削除
......@@ -76,6 +89,7 @@ function recordFinished() {
}
function toggleRecord() {
console.log("peacekim:: share-bind-button-action - toggleRecord()");
if (!$("#recordBtn .record").hasClass("disable")) {
recordStart();
} else {
......@@ -86,6 +100,7 @@ function toggleRecord() {
}
function recordStop(callback) {
console.log("peacekim:: share-bind-button-action - recordStop()");
if (!$("#recordBtn .record").hasClass("disable")) {
callback();
return;
......@@ -103,6 +118,9 @@ function recordStop(callback) {
}
function mainManRecordWithCollaboration(action, url, callback) {
console.log(
"peacekim:: share-bind-button-action - mainManRecordWithCollaboration()"
);
try {
mediaRecorder.stop();
} catch (exeption) {
......
......@@ -2,7 +2,11 @@ var CoviewBridge = {};
var CollaborationFeature = {};
CoviewBridge.bindReadyEvent = function () {
console.log("peacekim:: CoviewBridge.bindReadyEvent");
coview_api.addEventListener("ready", function () {
console.log(
"peacekim:: CoviewBridge.bindReadyEvent coview_api.addEventListener ready"
);
CoviewBridge.bindFermiWebSocketOpenned();
// add login ID if not exist
......@@ -14,13 +18,21 @@ CoviewBridge.bindReadyEvent = function () {
};
CoviewBridge.bindFermiWebSocketOpenned = function () {
console.log("peacekim:: CoviewBridge.bindFermiWebSocketOpenned");
wc_api.addEventListener("open", async function (event) {
console.log(
"peacekim:: CoviewBridge.bindFermiWebSocketOpenned wc_api.addEventListener open"
);
FermiWebSocketMessageHandler.bindWebSocketMessage();
});
};
CoviewBridge.bindStartEvent = function () {
console.log("peacekim:: CoviewBridge.bindStartEvent");
coview_api.addEventListener("start", function () {
console.log(
"peacekim:: CoviewBridge.bindStartEvent coview_api.addEventListener(start)"
);
CollaborationFeature.enableScrollLock();
CollaborationUI.hideLoadingIndicator();
});
......@@ -30,6 +42,7 @@ CoviewBridge.bindStartEvent = function () {
* Scroll Lock
**************/
CollaborationFeature.scrollLock = function (e) {
console.log("peacekim:: CollaborationFeature.scrollLock");
if (deviceInfo.isiOS()) {
if (
$(e.target).closest(".add_user_modal").length > 0 ||
......@@ -44,6 +57,7 @@ CollaborationFeature.scrollLock = function (e) {
};
CollaborationFeature.enableScrollLock = function () {
console.log("peacekim:: CollaborationFeature.enableScrollLock");
document
.getElementById("collabo_main")
.addEventListener("touchmove", CollaborationFeature.scrollLock, {
......@@ -52,6 +66,7 @@ CollaborationFeature.enableScrollLock = function () {
};
CollaborationFeature.disableScrollLock = function () {
console.log("peacekim:: CollaborationFeature.disableScrollLock");
document
.getElementById("collabo_main")
.removeEventListener("touchmove", CollaborationFeature.scrollLock, {
......@@ -60,7 +75,11 @@ CollaborationFeature.disableScrollLock = function () {
};
CoviewBridge.bindAllByeEvent = function () {
console.log("peacekim:: CollaborationFeature.bindAllByeEvent");
coview_api.addEventListener("allbye", function () {
console.log(
"peacekim:: CollaborationFeature.bindAllByeEvent coview_api.addEventListener(allbye)"
);
CHAT_SOCKET.emitCollaborationFinishMessage();
if (deviceInfo.isAndroid()) {
android.setExitHostAlert();
......@@ -83,13 +102,21 @@ CoviewBridge.bindAllByeEvent = function () {
};
CoviewBridge.bindGuestByeEvent = function () {
console.log("peacekim:: CollaborationFeature.bindGuestByeEvent");
coview_api.addEventListener("guestbye", function () {
console.log(
"peacekim:: CollaborationFeature.bindGuestByeEvent coview_api.addEventListener(guestbye)"
);
CollaborationUI.hideLoadingIndicator();
});
};
CoviewBridge.bindDestroyEvent = function () {
console.log("peacekim:: CollaborationFeature.bindDestroyEvent");
coview_api.addEventListener("destroy", function () {
console.log(
"peacekim:: CollaborationFeature.bindDestroyEvent coview_api.addEventListener(destroy)"
);
CHAT_SOCKET.emitCollaborationFinishMessage();
alert(getLocalizedString("inform_exit_host_collaboration"));
CoviewBridge.exitCollaboration();
......@@ -98,7 +125,12 @@ CoviewBridge.bindDestroyEvent = function () {
};
CoviewBridge.bindMessageEvent = function () {
console.log("peacekim:: CollaborationFeature.bindMessageEvent");
coview_api.addEventListener("message", async function (event, json) {
console.log(
"peacekim:: CollaborationFeature.bindMessageEvent coview_api.addEventListener(message), api: " +
json.api
);
if (globalUserInfo.isLeaved) {
return;
}
......@@ -120,6 +152,7 @@ CoviewBridge.bindMessageEvent = function () {
if (json.resultCode != 200) {
break;
}
console.log("peacekim:: will call CollaborationFeature.updateHost 1");
CollaborationFeature.updateHost();
// fall through
case "RoomMemberJoinedEvent":
......@@ -168,6 +201,15 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () {
globalUserInfo.joinType == COLLABORATION_JOIN_TYPE.ATTENDEE;
const isHost = globalUserInfo.joinType == COLLABORATION_JOIN_TYPE.HOST;
console.log(
"peacekim:: CollaborationFeature.didReceiveLoginResponseMessage isDocument : " +
isDocument +
", isAttendee: " +
isAttendee +
", isHost: " +
isHost
);
if (isDocument) {
if (isAttendee) {
NativeBridgeDelegate.startContentView();
......@@ -201,11 +243,15 @@ CollaborationFeature.didReceiveLoginResponseMessage = async function () {
default:
break;
}
console.log("peacekim:: will call CollaborationFeature.updateHost 3");
CollaborationFeature.updateHost();
CollaborationUI.moveToVideoShareArea();
};
CollaborationFeature.didReceiveCreateRoomResponseMessage = function () {
console.log(
"peacekim:: CollaborationFeature.didReceiveCreateRoomResponseMessage"
);
let coviewInviteMessage =
"" +
messageSeperator +
......@@ -221,6 +267,9 @@ CollaborationFeature.didReceiveCreateRoomResponseMessage = function () {
};
CollaborationFeature.didReceivedJoinRoomInfoResponseMessage = function () {
console.log(
"peacekim:: CollaborationFeature.didReceivedJoinRoomInfoResponseMessage"
);
alert(getLocalizedString("not_exist_sharing_call"));
coview_api.LeaveRoom();
$(".coview_share_area").hide();
......@@ -229,11 +278,13 @@ CollaborationFeature.didReceivedJoinRoomInfoResponseMessage = function () {
};
CoviewBridge.changeHost = function (userID) {
console.log("peacekim:: CoviewBridge.changeHost userID: " + userID);
// call in agent_app.js
coview_api.HostChange(userID);
};
CoviewBridge.addLoginID = function (loginID) {
console.log("peacekim:: CoviewBridge.addLoginID loginID: " + loginID);
const url = BIZ_TASK_YELL_URL + "/auth/getuser";
$.ajax({
url: url,
......@@ -253,6 +304,15 @@ CoviewBridge.addLoginID = function (loginID) {
};
CollaborationFeature.updateHost = function () {
console.log(
"peacekim:: CollaborationFeature.updateHost g_isMainMan: " +
g_isMainMan +
", g_isMainManUsername: " +
g_isMainManUsername +
", g_username: " +
g_username
);
if (g_isMainMan) {
CollaborationUI.showHostButtons();
} else {
......@@ -265,7 +325,7 @@ CollaborationFeature.updateHost = function () {
};
CollaborationUI.showHostButtons = function () {
console.log("peacekim:: CollaborationUI.showHostButtons");
$(".host_contents").removeClass("none");
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) {
$(".photo_select_button").removeClass("none");
......@@ -277,7 +337,7 @@ CollaborationUI.showHostButtons = function () {
};
CollaborationUI.hideHostButtons = function () {
console.log("peacekim:: CollaborationUI.hideHostButtons");
$(".host_contents").addClass("none");
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.CAMERA) {
$(".photo_select_button").addClass("none");
......@@ -289,6 +349,8 @@ CollaborationUI.hideHostButtons = function () {
};
CollaborationUI.showHostMark = function (hostName) {
console.log("peacekim:: CollaborationUI.showHostMark hostName: " + hostName);
// remove all host mark
attendingUsers.forEach(function (userName) {
const user = "#collaboration_user_" + getReplacedLoginId(userName);
......@@ -310,6 +372,7 @@ CollaborationUI.showHostMark = function (hostName) {
};
function captureAndShareImage(urls, changeHostName) {
console.log("peacekim:: share-event-listener.js captureAndShareImage");
addCaptureEffect();
$(this).removeClass("on");
var w, h;
......@@ -379,6 +442,7 @@ function captureAndShareImage(urls, changeHostName) {
}
CollaborationUI.configureCanvasSize = function (canvas) {
console.log("peacekim:: CollaborationUI.configureCanvasSize");
const canvasWrap = $(".canvas_wrap");
const canvasWidth = $(canvas).attr("width");
const canvasHeight = $(canvas).attr("height");
......@@ -402,10 +466,16 @@ CollaborationUI.configureCanvasSize = function (canvas) {
};
function getReplacedLoginId(loginId) {
console.log(
"peacekim:: share-event-listener.js getReplacedLoginId loginID: " + loginId
);
return loginId.replaceAll(globalUserInfo.shopName + "_", "");
}
CoviewBridge.exitCollaboration = function () {
console.log(
"peacekim:: CoviewBridge.exitCollaboration g_isMainMan: " + g_isMainMan
);
CollaborationFeature.disableScrollLock();
Common.showLoadingIndicator();
......@@ -424,6 +494,7 @@ CoviewBridge.exitCollaboration = function () {
};
CoviewBridge.finishCollaboration = function () {
console.log("peacekim:: CoviewBridge.finishCollaboration");
Common.showLoadingIndicator();
coview_api.LeaveRoom();
if (coview_api.getRoomUsers()) {
......@@ -441,6 +512,10 @@ CoviewBridge.finishCollaboration = function () {
// Display User List
CollaborationUI.refreshJoinedCollaboration = function (loginIDList) {
console.log(
"peacekim:: CollaborationUI.refreshJoinedCollaboration loginIDList: " +
loginIDList
);
for (var count = 0; count < loginIDList.length; count++) {
loginIDList[count] = loginIDList[count].replaceAll(
globalUserInfo.shopName + "_",
......@@ -481,6 +556,7 @@ CollaborationUI.refreshJoinedCollaboration = function (loginIDList) {
};
CollaborationUI.moveToVideoShareArea = function () {
console.log("peacekim:: CollaborationUI.moveToVideoShareArea");
CollaborationUI.showLoadingIndicator();
$(".coview_share_area").show();
$("#collabo_main").removeClass("none");
......
......@@ -7,6 +7,7 @@ var isBoard = false;
var backgroundFileName;
document.addEventListener("DOMContentLoaded", function () {
console.log("peacekim:: share.js DOMContentLoaded");
coview_api.Init({
coview_api_srv_addr: BIZ_TASK_YELL_URL,
coview_wrap_id: "coviewShare",
......@@ -28,7 +29,9 @@ document.addEventListener("DOMContentLoaded", function () {
// call from collaboration_overlay_menu.html and collaboration.html
function changeCollaboration(collaborationType) {
console.log("peacekim:: share.js changeCollaboration collaborationType: "+collaborationType);
recordStop(function () {
console.log("peacekim:: share.js changeCollaboration did recordStop");
var newMeetingID = 0;
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.exitMeetingRoom();
......@@ -76,6 +79,7 @@ function changeCollaboration(collaborationType) {
}
CollaborationUI.updateScreen = async function (collaborationType) {
console.log("peacekim:: CollaborationUI.updateScreen");
$("#coviewEraserCtrBtn").click();
if ($(".user_btn").hasClass("hide")) {
$(".user_btn").click();
......@@ -116,6 +120,7 @@ CollaborationUI.updateScreen = async function (collaborationType) {
// call from modal_collabo_host_request.html
function applyForHostChange() {
console.log("peacekim:: share.js applyForHostChange");
if (
globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT &&
deviceInfo.androidVersion < ANDROID_SDK_VERSION.O &&
......@@ -139,6 +144,7 @@ function getFermiLoginId(loginId) {
}
function screenLock() {
console.log("peacekim:: share.js screenLock");
// ロック用のdivを生成
const element = document.createElement("div");
element.id = "screenLock";
......
var Namecard = {};
Namecard.makeNameCard = function (shopMemberID) {
console.log("peacekim:: Namecard.makeNameCard shopMemberID: "+ shopMemberID);
if (currentUserInfo.shopMemberID == shopMemberID) {
return;
}
......@@ -30,6 +31,7 @@ Namecard.makeNameCard = function (shopMemberID) {
// template_user_name_card.html
Namecard.startChat = function (userShopMemberID, userName) {
console.log("peacekim:: Namecard.startChat userShopMemberID: "+ userShopMemberID + ", userName: " + userName);
Common.showLoadingIndicator();
let userIDList = [];
userIDList.push(userShopMemberID);
......@@ -47,6 +49,7 @@ Namecard.startChat = function (userShopMemberID, userName) {
// template_user_name_card.html
Namecard.startVoice = function (userShopMemberID, userName) {
console.log("peacekim:: Namecard.startVoice userShopMemberID: "+ userShopMemberID + ", userName: "+userName);
Common.showLoadingIndicator();
let userIDList = [];
userIDList.push(userShopMemberID);
......@@ -63,6 +66,12 @@ Namecard.startVoice = function (userShopMemberID, userName) {
};
Namecard.favoriteUserChange = function (shopMemberID, star) {
console.log(
"peacekim:: Namecard.startVoice shopMemberID: " +
shopMemberID +
", star: " +
star
);
if ($(star).hasClass("active")) {
Namecard.removeFavoriteUser(shopMemberID);
} else if ($(star).hasClass("disable")) {
......@@ -86,6 +95,7 @@ Namecard.removeFavoriteUser = function (shopMemberID) {
};
Namecard.insertFavoriteUser = function (shopMemberID) {
console.log("peacekim:: Namecard.insertFavoriteUser shopMemberID: "+ shopMemberID);
$("#userNameCard").modal("hide");
$("#myNameCard").modal("hide");
const result = NativeBridgeDataSource.addFavoriteUser(shopMemberID);
......@@ -100,10 +110,12 @@ Namecard.insertFavoriteUser = function (shopMemberID) {
};
Namecard.refreshForOnline = function () {
console.log("peacekim:: Namecard.refreshForOnline");
$("#favoriteButton").prop("disabled", false);
};
Namecard.refreshForOffline = function () {
console.log("peacekim:: Namecard.refreshForOffline");
$("#favoriteButton").prop("disabled", true);
};
......
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