Commit 42fe068a by Kim Peace

WIP: assamble as native bridge

parent a9049c58
...@@ -154,13 +154,9 @@ ...@@ -154,13 +154,9 @@
let IS_ONLINE = false; let IS_ONLINE = false;
$("#chatMenuModal").load("./modal_chat_menu.html"); $("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
if (typeof (android) != "undefined") {
android.getLoginParameter(); NativeBridge.getLoginParameter();
android.getGlobalParameter(); NativeBridge.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -203,13 +203,8 @@ ...@@ -203,13 +203,8 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
if (typeof (android) != "undefined") { NativeBridge.getLoginParameter();
android.getLoginParameter(); NativeBridge.getGlobalParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -134,13 +134,13 @@ ...@@ -134,13 +134,13 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
NativeBridge.getLoginParameter();
NativeBridge.getGlobalParameter();
if (typeof (android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
android.saveSelectedUserList(""); android.saveSelectedUserList("");
} else { } else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
webkit.messageHandlers.saveSelectedUserList.postMessage(""); webkit.messageHandlers.saveSelectedUserList.postMessage("");
} }
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
......
...@@ -165,13 +165,8 @@ ...@@ -165,13 +165,8 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
if (typeof (android) != "undefined") { NativeBridge.getLoginParameter();
android.getLoginParameter(); NativeBridge.getGlobalParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -92,13 +92,9 @@ ...@@ -92,13 +92,9 @@
let PLATFORM = ''; let PLATFORM = '';
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
if (typeof (android) != "undefined") {
android.getLoginParameter(); NativeBridge.getLoginParameter();
android.getGlobalParameter(); NativeBridge.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -92,13 +92,9 @@ ...@@ -92,13 +92,9 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
let roomId = 0; let roomId = 0;
if (typeof (android) != "undefined") {
android.getLoginParameter(); NativeBridge.getLoginParameter();
android.getGlobalParameter(); NativeBridge.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -165,13 +165,10 @@ ...@@ -165,13 +165,10 @@
let PLATFORM = ''; let PLATFORM = '';
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
if (typeof (android) != "undefined") {
android.getLoginParameter(); NativeBridge.getLoginParameter();
android.getGlobalParameter(); NativeBridge.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -101,13 +101,8 @@ ...@@ -101,13 +101,8 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
if (typeof (android) != "undefined") { NativeBridge.getLoginParameter();
android.getLoginParameter(); NativeBridge.getGlobalParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -198,14 +198,14 @@ ...@@ -198,14 +198,14 @@
$("#chatMenuModal").load("./modal_chat_menu.html"); $("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
NativeBridge.getLoginParameter();
NativeBridge.getGlobalParameter();
if (typeof (android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
android.saveSelectedUserList(""); android.saveSelectedUserList("");
androidVersion = android.getAndroidVersion(); androidVersion = android.getAndroidVersion();
} else { } else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
webkit.messageHandlers.saveSelectedUserList.postMessage(""); webkit.messageHandlers.saveSelectedUserList.postMessage("");
} }
......
...@@ -156,7 +156,8 @@ ...@@ -156,7 +156,8 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/collaboration.js"></script> <script src="./js/collaboration.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/share.js"></script>
<script> <script>
$("#footer_collabo").load("./footer_collabo.html"); $("#footer_collabo").load("./footer_collabo.html");
$("#modal_collabo_host_request").load("./modal_collabo_host_request.html"); $("#modal_collabo_host_request").load("./modal_collabo_host_request.html");
...@@ -180,13 +181,12 @@ ...@@ -180,13 +181,12 @@
let joinMeetingId = 0; let joinMeetingId = 0;
let androidVersion = 0; let androidVersion = 0;
NativeBridge.getLoginParameter();
NativeBridge.getGlobalParameter();
if (typeof (android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType(); roomType = android.getRoomType();
} else { } else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType(); roomType = CHAT_DB.getRoomType();
} }
...@@ -227,7 +227,9 @@ ...@@ -227,7 +227,9 @@
androidVersion = android.getAndroidVersion(); androidVersion = android.getAndroidVersion();
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) { if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) {
alert(getLocalizedString('not_support_version')); alert(getLocalizedString('not_support_version'));
android.openCommunicationHome(); if (typeof android != "undefined") {
NativeBridge.openCommunicationHome();
}
} }
} }
......
...@@ -119,13 +119,8 @@ ...@@ -119,13 +119,8 @@
let IS_ONLINE = false; let IS_ONLINE = false;
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
if (typeof (android) != "undefined") { NativeBridge.getLoginParameter();
android.getLoginParameter(); NativeBridge.getGlobalParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function startPipMode() { function startPipMode() {
if (typeof (android) != "undefined") { if (typeof (android) != "undefined") {
......
...@@ -160,6 +160,7 @@ ...@@ -160,6 +160,7 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/collaboration.js"></script> <script src="./js/collaboration.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/share.js"></script>
<script> <script>
$("#footer_collabo").load("./footer_collabo.html"); $("#footer_collabo").load("./footer_collabo.html");
...@@ -180,13 +181,12 @@ ...@@ -180,13 +181,12 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType; let roomType;
NativeBridge.getLoginParameter();
NativeBridge.getGlobalParameter();
if (typeof (android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType(); roomType = android.getRoomType();
} else { } else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType(); roomType = CHAT_DB.getRoomType();
} }
......
...@@ -150,7 +150,8 @@ ...@@ -150,7 +150,8 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/collaboration.js"></script> <script src="./js/collaboration.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/share.js"></script>
</body> </body>
<script> <script>
$("#footer_collabo").load("./footer_collabo.html"); $("#footer_collabo").load("./footer_collabo.html");
...@@ -171,13 +172,12 @@ ...@@ -171,13 +172,12 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType; let roomType;
NativeBridge.getLoginParameter();
NativeBridge.getGlobalParameter();
if (typeof (android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType(); roomType = android.getRoomType();
} else { } else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType(); roomType = CHAT_DB.getRoomType();
} }
......
...@@ -95,7 +95,8 @@ ...@@ -95,7 +95,8 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/collaboration.js"></script> <script src="./js/collaboration.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/share.js"></script>
<script> <script>
$("#footer_collabo").load("./footer_collabo.html"); $("#footer_collabo").load("./footer_collabo.html");
$("#modal_collabo_host_request").load("./modal_collabo_host_request.html"); $("#modal_collabo_host_request").load("./modal_collabo_host_request.html");
...@@ -114,13 +115,12 @@ ...@@ -114,13 +115,12 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType; let roomType;
NativeBridge.getLoginParameter();
NativeBridge.getGlobalParameter();
if (typeof (android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType(); roomType = android.getRoomType();
} else { } else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType(); roomType = CHAT_DB.getRoomType();
} }
......
...@@ -152,7 +152,8 @@ ...@@ -152,7 +152,8 @@
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/collaboration.js"></script> <script src="./js/collaboration.js"></script>
<script src="https://biztaskyell.abookcloud.com/coview_api.js"></script> <script src="https://biztaskyell.abookcloud.com/coview_api.js"></script>
<script src="./js/share.js"></script>
<script> <script>
$("#footer_collabo").load("./footer_collabo.html"); $("#footer_collabo").load("./footer_collabo.html");
$("#modal_collabo_host_request").load("./modal_collabo_host_request.html"); $("#modal_collabo_host_request").load("./modal_collabo_host_request.html");
...@@ -172,13 +173,12 @@ ...@@ -172,13 +173,12 @@
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType; let roomType;
NativeBridge.getLoginParameter();
NativeBridge.getGlobalParameter();
if (typeof (android) != "undefined") { if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
roomType = android.getRoomType(); roomType = android.getRoomType();
} else { } else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
roomType = CHAT_DB.getRoomType(); roomType = CHAT_DB.getRoomType();
} }
......
...@@ -215,13 +215,9 @@ ...@@ -215,13 +215,9 @@
let IS_ONLINE = false; let IS_ONLINE = false;
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
if (typeof (android) != "undefined") { NativeBridge.getLoginParameter();
android.getLoginParameter(); NativeBridge.getGlobalParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl; CMS_SERVER_URL = cmsServerUrl;
......
...@@ -58,34 +58,6 @@ CHAT_DB.addFavoriteUser = function (shopMemberId) { ...@@ -58,34 +58,6 @@ CHAT_DB.addFavoriteUser = function (shopMemberId) {
} }
}; };
CHAT_DB.removeFavoriteGroup = function (groupId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteGroup, {
groupId: groupId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.addFavoriteGroup = function (groupId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteGroup, {
groupId: groupId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.getCollaborationJoinFlg = function () { CHAT_DB.getCollaborationJoinFlg = function () {
// Androidは実装不要 // Androidは実装不要
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
......
...@@ -95,11 +95,7 @@ $("#room-search").on("input", function (event) { ...@@ -95,11 +95,7 @@ $("#room-search").on("input", function (event) {
socket.emit("roomSearch", encodeURIComponent($("#room-search").val())); socket.emit("roomSearch", encodeURIComponent($("#room-search").val()));
} else { } else {
if (IS_ONLINE == "true") { if (IS_ONLINE == "true") {
if (typeof android != "undefined") { NativeBridge.updateRoomList();
android.updateRoomList();
} else {
webkit.messageHandlers.updateRoomList.postMessage({});
}
CHAT_UI.refreshRoomList(ChatRoomType.DM); CHAT_UI.refreshRoomList(ChatRoomType.DM);
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
} }
......
CHAT_UI.joinCollaboration = function (collaborationType, meetingId = 0) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.joinCollaboration.postMessage({
collaborationType: collaborationType,
meetingId: meetingId,
});
} else if (CHAT_UTIL.isAndroid()) {
if (
collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O
) {
alert(getLocalizedString("not_support_version"));
return;
}
android.joinCollaboration(collaborationType, meetingId);
}
};
CHAT_UI.startCollaboration = function (collaborationType) { CHAT_UI.startCollaboration = function (collaborationType) {
if (CHAT_UTIL.isAndroid()) { if (CHAT_UTIL.isAndroid()) {
if ( if (
...@@ -122,18 +104,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () { ...@@ -122,18 +104,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
TemplateURL.ADD_USER_GROUP_USER_LIST_IN_COLLABORATION TemplateURL.ADD_USER_GROUP_USER_LIST_IN_COLLABORATION
); );
if (IS_ONLINE == "true") { NativeBridge.updateContactInfo();
if (typeof android != "undefined") {
android.updateMyInfo();
android.updateGroupUser();
android.updateFavorite();
} else {
webkit.messageHandlers.updateGroupInfo.postMessage("0");
webkit.messageHandlers.updateMyInfo.postMessage({});
webkit.messageHandlers.updateGroupUser.postMessage({});
webkit.messageHandlers.updateFavorite.postMessage({});
}
}
//お気に入りグループ取得。 //お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups(); var favoriteGroupList = CHAT_DB.getFavoriteGroups();
...@@ -192,14 +163,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) { ...@@ -192,14 +163,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) {
$("#tabAllGroupOnAddUserInCollaboration").prop("checked", true); $("#tabAllGroupOnAddUserInCollaboration").prop("checked", true);
//オンライン状態であればサーバから情報更新。 NativeBridge.updateGroupInfo(groupId);
if (IS_ONLINE == "true") {
if (typeof android != "undefined") {
android.updateGroupUser();
} else {
webkit.messageHandlers.updateGroupInfo.postMessage(groupId);
}
}
//画面エリアを初期化。 //画面エリアを初期化。
$("#parentGroupBtnForAddUserInCollaboration").off(); $("#parentGroupBtnForAddUserInCollaboration").off();
......
...@@ -139,13 +139,7 @@ $('a[data-toggle="pill"]').on("show.bs.tab", function (e) { ...@@ -139,13 +139,7 @@ $('a[data-toggle="pill"]').on("show.bs.tab", function (e) {
CHAT.saveRoomInfo(); CHAT.saveRoomInfo();
if (IS_ONLINE == "true") { if (IS_ONLINE == "true") {
socket.emit("leaveRoom", function () { socket.emit("leaveRoom", function () {
if (typeof android != "undefined") { NativeBridge.updateRoomList();
android.updateRoomList();
} else {
webkit.messageHandlers.updateRoomList.postMessage({
groupId: "0",
});
}
}); });
} }
CHAT_UI.refreshRoomList(ChatRoomType.DM); CHAT_UI.refreshRoomList(ChatRoomType.DM);
...@@ -444,10 +438,9 @@ CHAT_UI.showConfirmView = function (isInvite) { ...@@ -444,10 +438,9 @@ CHAT_UI.showConfirmView = function (isInvite) {
// ルーム名のURIencodingを行う // ルーム名のURIencodingを行う
//const encodedRoomName = encodeURIComponent(newRoomName); //const encodedRoomName = encodeURIComponent(newRoomName);
//todo android create room api NativeBridge.createChatRoom(
createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList, userIdList.join(","),
newRoomName, newRoomName,
MakeRoomFlag.MAKE_ROOM, MakeRoomFlag.MAKE_ROOM,
false false
...@@ -521,9 +514,9 @@ CHAT_UI.showConfirmView = function (isInvite) { ...@@ -521,9 +514,9 @@ CHAT_UI.showConfirmView = function (isInvite) {
// ルーム名のtrimmingした後、URIencodingを行う // ルーム名のtrimmingした後、URIencodingを行う
const encodedRoomName = encodeURIComponent(trimmedRoomName); const encodedRoomName = encodeURIComponent(trimmedRoomName);
createChatRoom( NativeBridge.createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList, userIdList.join(","),
encodedRoomName, encodedRoomName,
MakeRoomFlag.MAKE_ROOM, MakeRoomFlag.MAKE_ROOM,
false false
...@@ -815,7 +808,7 @@ CHAT_UI.refreshContactScreen = function () { ...@@ -815,7 +808,7 @@ CHAT_UI.refreshContactScreen = function () {
var myNamecardTemplate = getTemplate(TemplateURL.MY_NAME_CARD); var myNamecardTemplate = getTemplate(TemplateURL.MY_NAME_CARD);
var groupUserTemplate = getTemplate(TemplateURL.GROUP_USER_LIST); var groupUserTemplate = getTemplate(TemplateURL.GROUP_USER_LIST);
updateContactInfo(); NativeBridge.updateContactInfo();
var myInfo = CHAT_DB.getMyInfo(); var myInfo = CHAT_DB.getMyInfo();
myInfo.profileImagePath = CHAT.getProfileImgUrl(myInfo.profileUrl); myInfo.profileImagePath = CHAT.getProfileImgUrl(myInfo.profileUrl);
...@@ -903,11 +896,7 @@ CHAT_UI.refreshRoomList = function (roomType) { ...@@ -903,11 +896,7 @@ CHAT_UI.refreshRoomList = function (roomType) {
} }
if (IS_ONLINE == "true") { if (IS_ONLINE == "true") {
if (typeof android != "undefined") { NativeBridge.updateRoomList();
android.updateRoomList();
} else {
webkit.messageHandlers.updateRoomList.postMessage({});
}
} }
var rooms = CHAT_DB.getRoomList(roomType, null); var rooms = CHAT_DB.getRoomList(roomType, null);
CHAT.globalIsInvite = false; CHAT.globalIsInvite = false;
...@@ -994,9 +983,6 @@ CHAT_UI.refreshRoomList = function (roomType) { ...@@ -994,9 +983,6 @@ CHAT_UI.refreshRoomList = function (roomType) {
}); });
// Click event // Click event
let obj = $(jQuery.parseHTML(html)).on("click", function () { let obj = $(jQuery.parseHTML(html)).on("click", function () {
/* let roomId = $(this).data('roomId');
let roomName = $(this).data('roomname');
CHAT_UI.joinRoom(roomId,roomName);*/
//TODO ルームに入る処理追加必要 //TODO ルームに入る処理追加必要
}); });
// ルームグループごとに追加。 // ルームグループごとに追加。
...@@ -1015,22 +1001,6 @@ CHAT_UI.refreshRoomList = function (roomType) { ...@@ -1015,22 +1001,6 @@ CHAT_UI.refreshRoomList = function (roomType) {
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}; };
CHAT_UI.joinRoom = function (roomId, roomName) {
//native側に入場対象のroomId,roomNameを保存。(ルーム詳細画面初期化の時に使用。)
if (typeof android != "undefined") {
try {
android.joinRoom(roomId, roomName);
} catch {
alert(getLocalizedString("err_not_exist_room"));
}
} else {
webkit.messageHandlers.joinRoom.postMessage({
roomId: roomId,
roomName: roomName,
});
}
};
CHAT_UI.loadMessages = function (roomId, joinRoomName) { CHAT_UI.loadMessages = function (roomId, joinRoomName) {
roomName = joinRoomName; roomName = joinRoomName;
var now = new Date(); var now = new Date();
...@@ -1092,14 +1062,13 @@ CHAT_UI.loadMessages = function (roomId, joinRoomName) { ...@@ -1092,14 +1062,13 @@ CHAT_UI.loadMessages = function (roomId, joinRoomName) {
$("#userSelectionDeleteBtn").hide(); $("#userSelectionDeleteBtn").hide();
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
$(window).on('load', function() { $(window).on("load", function () {
CHAT_UI.scrollToBottom(); CHAT_UI.scrollToBottom();
}); });
} }
}; };
CHAT_UI.prependMessage = function (messages) {
CHAT_UI.prependMessage = function(messages) {
var now = new Date(); var now = new Date();
let jQueryMessages = $("#messages"); let jQueryMessages = $("#messages");
// スクロールの変化を防ぐため以前画面の高さを保存する // スクロールの変化を防ぐため以前画面の高さを保存する
...@@ -1248,14 +1217,6 @@ CHAT_UI.prependMessage = function(messages) { ...@@ -1248,14 +1217,6 @@ CHAT_UI.prependMessage = function(messages) {
}); });
// メッセージの画面描画 // メッセージの画面描画
jQueryMessages.prepend(workVal); jQueryMessages.prepend(workVal);
}
CHAT_UI.roomDisplayOff = function () {
if (typeof android != "undefined") {
android.roomDisplayOff();
} else {
webkit.messageHandlers.roomDisplayOff.postMessage({});
}
}; };
CHAT_UI.favoriteUserChange = function (shopMemberId, star) { CHAT_UI.favoriteUserChange = function (shopMemberId, star) {
...@@ -1317,36 +1278,26 @@ CHAT_UI.insertFavoriteUser = function (shopMemberId) { ...@@ -1317,36 +1278,26 @@ CHAT_UI.insertFavoriteUser = function (shopMemberId) {
CHAT_UI.removeFavoriteGroup = function (groupId) { CHAT_UI.removeFavoriteGroup = function (groupId) {
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
var result; var result = NativeBridge.removeFavoriteGroup(groupId);
if (typeof android != "undefined") { if (result) {
result = android.removeFavoriteGroup(groupId); $(".group_" + groupId).removeClass("active");
$(".group_" + groupId).addClass("disable");
} else { } else {
result = CHAT_DB.removeFavoriteGroup(groupId);
}
if (!result) {
$(".group_" + groupId).addClass("active"); $(".group_" + groupId).addClass("active");
$(".group_" + groupId).removeClass("disable"); $(".group_" + groupId).removeClass("disable");
} else {
$(".group_" + groupId).removeClass("active");
$(".group_" + groupId).addClass("disable");
} }
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}; };
CHAT_UI.insertFavoriteGroup = function (groupId) { CHAT_UI.insertFavoriteGroup = function (groupId) {
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
var result; const result = NativeBridge.addFavoriteGroup(groupID);
if (typeof android != "undefined") { if (result) {
result = android.addFavoriteGroup(groupId); $(".group_" + groupId).removeClass("disable");
$(".group_" + groupId).addClass("active");
} else { } else {
result = CHAT_DB.addFavoriteGroup(groupId);
}
if (!result) {
$(".group_" + groupId).addClass("disable"); $(".group_" + groupId).addClass("disable");
$(".group_" + groupId).removeClass("active"); $(".group_" + groupId).removeClass("active");
} else {
$(".group_" + groupId).removeClass("disable");
$(".group_" + groupId).addClass("active");
} }
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}; };
...@@ -1379,7 +1330,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) { ...@@ -1379,7 +1330,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
$("#tabAllGroup").prop("checked", true); $("#tabAllGroup").prop("checked", true);
//オンライン状態であればサーバから情報更新。 //オンライン状態であればサーバから情報更新。
updateGroupInfo(groupId); NativeBridge.updateGroupInfo(groupId);
//画面エリアを初期化。 //画面エリアを初期化。
$("#rootGroupBtn").off(); $("#rootGroupBtn").off();
...@@ -1457,9 +1408,9 @@ CHAT_UI.startChat = function (userShopMemberId, userName) { ...@@ -1457,9 +1408,9 @@ CHAT_UI.startChat = function (userShopMemberId, userName) {
// 参加ユーザ名でルーム名を生成 // 参加ユーザ名でルーム名を生成
let newRoomName = CHAT.globalLoginParameter.loginId + "," + userName; let newRoomName = CHAT.globalLoginParameter.loginId + "," + userName;
createChatRoom( NativeBridge.createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList, userIdList.join(","),
newRoomName, newRoomName,
MakeRoomFlag.NAME_CARD, MakeRoomFlag.NAME_CARD,
false false
...@@ -1473,9 +1424,9 @@ CHAT_UI.startVoice = function (userShopMemberId, userName) { ...@@ -1473,9 +1424,9 @@ CHAT_UI.startVoice = function (userShopMemberId, userName) {
// 参加ユーザ名でルーム名を生成 // 参加ユーザ名でルーム名を生成
let newRoomName = CHAT.globalLoginParameter.loginId + "," + userName; let newRoomName = CHAT.globalLoginParameter.loginId + "," + userName;
createChatRoom( NativeBridge.createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList, userIdList.join(","),
newRoomName, newRoomName,
MakeRoomFlag.NAME_CARD, MakeRoomFlag.NAME_CARD,
true true
...@@ -1546,12 +1497,14 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) { ...@@ -1546,12 +1497,14 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
userId: userInfo.shopMemberId, userId: userInfo.shopMemberId,
}); });
var obj = $(jQuery.parseHTML(html)).on("click", function () {}); var obj = $(jQuery.parseHTML(html)).on("click", function () {});
$("#archiveDetail").append(obj); $("#archiveDetail").append(obj);
// プレイヤーの切り替え // プレイヤーの切り替え
const archiveFilePath = CHAT.createGetDataUrl(archive.filePath, archive.roomId); const archiveFilePath = CHAT.createGetDataUrl(
archive.filePath,
archive.roomId
);
switch (archive.archiveType) { switch (archive.archiveType) {
case "0": // 画像 case "0": // 画像
...@@ -1620,7 +1573,9 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) { ...@@ -1620,7 +1573,9 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
} }
attendUserList.forEach(function (user) { attendUserList.forEach(function (user) {
if (user == "") { return; } if (user == "") {
return;
}
var userInfo = CHAT_DB.getUserInfo(user); var userInfo = CHAT_DB.getUserInfo(user);
userInfo.profileUrl = CHAT.getProfileImgUrl(userInfo.profileUrl); userInfo.profileUrl = CHAT.getProfileImgUrl(userInfo.profileUrl);
const html = Mustache.render(archiveUserTemplate, { const html = Mustache.render(archiveUserTemplate, {
...@@ -1640,7 +1595,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) { ...@@ -1640,7 +1595,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
// チャットルームへのリンク付け // チャットルームへのリンク付け
document.getElementById("joinChatRoom").onclick = function () { document.getElementById("joinChatRoom").onclick = function () {
CHAT_UI.joinRoom(archive.roomId, archive.roomName); NativeBridge.joinRoom(archive.roomId, archive.roomName);
}; };
// loadingIndicatorを非表示 // loadingIndicatorを非表示
...@@ -1663,7 +1618,7 @@ CHAT_UI.refreshMyGroupForMakeRoom = function () { ...@@ -1663,7 +1618,7 @@ CHAT_UI.refreshMyGroupForMakeRoom = function () {
var groupUserTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_USER_LIST); var groupUserTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_USER_LIST);
updateContactInfo(); NativeBridge.updateContactInfo();
//お気に入りグループ取得。 //お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups(); var favoriteGroupList = CHAT_DB.getFavoriteGroups();
...@@ -1726,7 +1681,7 @@ CHAT_UI.refreshAllGroupForMakeRoom = function (paramGroupId) { ...@@ -1726,7 +1681,7 @@ CHAT_UI.refreshAllGroupForMakeRoom = function (paramGroupId) {
$("#tabAllGroupOnMakeRoom").prop("checked", true); $("#tabAllGroupOnMakeRoom").prop("checked", true);
//オンライン状態であればサーバから情報更新。 //オンライン状態であればサーバから情報更新。
updateGroupInfo(groupId); NativeBridge.updateGroupInfo(groupId);
//画面エリアを初期化。 //画面エリアを初期化。
$("#parentGroupBtnForMakeRoom").off(); $("#parentGroupBtnForMakeRoom").off();
...@@ -1928,9 +1883,9 @@ CHAT_UI.showMakeRoomConfirmView = function () { ...@@ -1928,9 +1883,9 @@ CHAT_UI.showMakeRoomConfirmView = function () {
// 参加ユーザ名でルーム名を生成 // 参加ユーザ名でルーム名を生成
let newRoomName = let newRoomName =
CHAT.globalLoginParameter.loginId + "," + userNameList.join(","); CHAT.globalLoginParameter.loginId + "," + userNameList.join(",");
createChatRoom( NativeBridge.createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList, userIdList.join(","),
newRoomName, newRoomName,
MakeRoomFlag.MAKE_ROOM, MakeRoomFlag.MAKE_ROOM,
false false
...@@ -2003,9 +1958,9 @@ CHAT_UI.showMakeRoomConfirmView = function () { ...@@ -2003,9 +1958,9 @@ CHAT_UI.showMakeRoomConfirmView = function () {
// TODO: check why here using trimmedroomname instead of encodedRoomName // TODO: check why here using trimmedroomname instead of encodedRoomName
// ルーム名のtrimmingした後、URIencodingを行う // ルーム名のtrimmingした後、URIencodingを行う
const encodedRoomName = encodeURIComponent(trimmedRoomName); const encodedRoomName = encodeURIComponent(trimmedRoomName);
createChatRoom( NativeBridge.createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList, userIdList.join(","),
trimmedRoomName, trimmedRoomName,
MakeRoomFlag.MAKE_ROOM, MakeRoomFlag.MAKE_ROOM,
false false
...@@ -2038,13 +1993,7 @@ CHAT_UI.showAddUserConfirmView = function () { ...@@ -2038,13 +1993,7 @@ CHAT_UI.showAddUserConfirmView = function () {
selectedUserList.forEach(function (user) { selectedUserList.forEach(function (user) {
userIdList.push(user.shopMemberId); userIdList.push(user.shopMemberId);
}); });
if (typeof android != "undefined") { NativeBridge.inviteUsers(userIdList.join(","));
android.inviteUsers(userIdList.join(","), false);
} else {
webkit.messageHandlers.inviteUsers.postMessage({
userIdList: userIdList.join(","),
});
}
}); });
}; };
...@@ -2063,7 +2012,7 @@ CHAT_UI.refreshMyGroupForAddUser = function () { ...@@ -2063,7 +2012,7 @@ CHAT_UI.refreshMyGroupForAddUser = function () {
var userTemplate = getTemplate(TemplateURL.ADD_USER_USER_LIST); var userTemplate = getTemplate(TemplateURL.ADD_USER_USER_LIST);
var groupUserTemplate = getTemplate(TemplateURL.ADD_USER_GROUP_USER_LIST); var groupUserTemplate = getTemplate(TemplateURL.ADD_USER_GROUP_USER_LIST);
updateContactInfo(); NativeBridge.updateContactInfo();
//お気に入りグループ取得。 //お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups(); var favoriteGroupList = CHAT_DB.getFavoriteGroups();
...@@ -2126,7 +2075,7 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) { ...@@ -2126,7 +2075,7 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) {
$("#tabAllGroupOnAddUser").prop("checked", true); $("#tabAllGroupOnAddUser").prop("checked", true);
//オンライン状態であればサーバから情報更新。 //オンライン状態であればサーバから情報更新。
updateGroupInfo(groupId); NativeBridge.updateGroupInfo(groupId);
//画面エリアを初期化。 //画面エリアを初期化。
$("#parentGroupBtnForAddUser").off(); $("#parentGroupBtnForAddUser").off();
...@@ -2253,16 +2202,12 @@ CHAT_UI.refreshForOffline = function () { ...@@ -2253,16 +2202,12 @@ CHAT_UI.refreshForOffline = function () {
webkit.messageHandlers.finishCollaboration.postMessage({}); webkit.messageHandlers.finishCollaboration.postMessage({});
} }
if (collaborationJoinFlg != "2") { if (collaborationJoinFlg != "2") {
CHAT_UI.joinRoom( NativeBridge.joinRoom(
CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name CHAT.globalLoginParameter.name
); );
} else { } else {
if (typeof android != "undefined") { NativeBridge.openCommunicationHome();
android.openCommunicationHome();
} else {
webkit.messageHandlers.openCommunicationHome.postMessage({});
}
} }
}; };
...@@ -2272,63 +2217,7 @@ CHAT_UI.offlineHandler = function (e) { ...@@ -2272,63 +2217,7 @@ CHAT_UI.offlineHandler = function (e) {
CHAT_UI.displayExistRoom = function (roomId) { CHAT_UI.displayExistRoom = function (roomId) {
if (confirm("error_already_exist_same_user")) { if (confirm("error_already_exist_same_user")) {
if (CHAT_UTIL.isIOS()) { NativeBridge.joinRoom(roomId);
webkit.messageHandlers.joinRoom.postMessage({ roomId: roomId });
} else if (CHAT_UTIL.isAndroid()) {
android.joinRoom(roomId, "");
}
} }
return; return;
}; };
\ No newline at end of file
var createChatRoom = function (
chatRoomType,
userIDList,
newRoomName,
screenFlag,
isVoice
) {
//todo android create room api
if (typeof android != "undefined") {
android.createChatRoom(
chatRoomType,
userIDList.join(","),
newRoomName,
screenFlag,
isVoice
);
} else {
webkit.messageHandlers.createChatRoom.postMessage({
roomType: chatRoomType,
userIdList: userIDList.join(","),
roomName: newRoomName,
screenFlag: screenFlag,
isVoice: isVoice,
});
}
};
var updateContactInfo = function () {
if (IS_ONLINE == "true") {
if (typeof android != "undefined") {
android.updateMyInfo();
android.updateGroupUser();
android.updateFavorite();
} else {
webkit.messageHandlers.updateGroupInfo.postMessage("0");
webkit.messageHandlers.updateMyInfo.postMessage({});
webkit.messageHandlers.updateGroupUser.postMessage({});
webkit.messageHandlers.updateFavorite.postMessage({});
}
}
};
var updateGroupInfo = function (groupID) {
if (IS_ONLINE == "true") {
if (typeof android != "undefined") {
android.updateGroupUser();
} else {
webkit.messageHandlers.updateGroupInfo.postMessage(groupID);
}
}
};
includeJs("./js/share.js");
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
no_scroll(); no_scroll();
......
...@@ -24,7 +24,7 @@ NativeBridge.openCommunicationHome = function () { ...@@ -24,7 +24,7 @@ NativeBridge.openCommunicationHome = function () {
} }
}; };
NativeBridge.joinRoom = function (roomID, roomName) { NativeBridge.joinRoom = function (roomID, roomName = "") {
if (typeof android != "undefined") { if (typeof android != "undefined") {
try { try {
android.joinRoom(roomID, roomName); android.joinRoom(roomID, roomName);
...@@ -50,7 +50,7 @@ NativeBridge.createChatRoom = function ( ...@@ -50,7 +50,7 @@ NativeBridge.createChatRoom = function (
if (typeof android != "undefined") { if (typeof android != "undefined") {
android.createChatRoom( android.createChatRoom(
chatRoomType, chatRoomType,
userIDList.join(","), userIDList,
newRoomName, newRoomName,
screenFlag, screenFlag,
isVoice isVoice
...@@ -58,7 +58,7 @@ NativeBridge.createChatRoom = function ( ...@@ -58,7 +58,7 @@ NativeBridge.createChatRoom = function (
} else { } else {
webkit.messageHandlers.createChatRoom.postMessage({ webkit.messageHandlers.createChatRoom.postMessage({
roomType: chatRoomType, roomType: chatRoomType,
userIdList: userIDList.join(","), userIdList: userIDList,
roomName: newRoomName, roomName: newRoomName,
screenFlag: screenFlag, screenFlag: screenFlag,
isVoice: isVoice, isVoice: isVoice,
...@@ -105,6 +105,21 @@ NativeBridge.removeFavoriteGroup = function (groupID) { ...@@ -105,6 +105,21 @@ NativeBridge.removeFavoriteGroup = function (groupID) {
} }
}; };
NativeBridge.addFavoriteGroup = function (groupID) {
if (typeof android != "undefined") {
return android.addFavoriteGroup(groupID);
} else {
const result = callNativeApp(NATIVE_KEY_IOS.addFavoriteGroup, {
groupId: groupId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
NativeBridge.joinCollaboration = function (collaborationType, meetingId = 0) { NativeBridge.joinCollaboration = function (collaborationType, meetingId = 0) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.joinCollaboration.postMessage({ webkit.messageHandlers.joinCollaboration.postMessage({
...@@ -123,14 +138,6 @@ NativeBridge.joinCollaboration = function (collaborationType, meetingId = 0) { ...@@ -123,14 +138,6 @@ NativeBridge.joinCollaboration = function (collaborationType, meetingId = 0) {
} }
}; };
NativeBridge.joinRoom = function () {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.joinRoom.postMessage({ roomId: roomId });
} else if (CHAT_UTIL.isAndroid()) {
android.joinRoom(roomId, "");
}
};
NativeBridge.inviteUsers = function (userIDList) { NativeBridge.inviteUsers = function (userIDList) {
if (typeof android != "undefined") { if (typeof android != "undefined") {
android.inviteUsers(userIDList, false); android.inviteUsers(userIDList, false);
......
...@@ -139,7 +139,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -139,7 +139,7 @@ document.addEventListener("DOMContentLoaded", function () {
android.finishPip(); android.finishPip();
$(".pip_indicator").addClass("none"); $(".pip_indicator").addClass("none");
} }
await new Promise(done => setTimeout(() => done(), 500)); await new Promise((done) => setTimeout(() => done(), 500));
updateCanvasSize(); updateCanvasSize();
} }
...@@ -232,11 +232,14 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -232,11 +232,14 @@ document.addEventListener("DOMContentLoaded", function () {
fw.sendToMsg("others", "PIP_END_REQUEST", { fw.sendToMsg("others", "PIP_END_REQUEST", {
loginId: getFermiLoginId(data.payload.loginId), loginId: getFermiLoginId(data.payload.loginId),
}); });
await new Promise(done => setTimeout(() => done(), 500)); await new Promise((done) => setTimeout(() => done(), 500));
Coview_changeHost(getFermiLoginId(data.payload.loginId)); Coview_changeHost(getFermiLoginId(data.payload.loginId));
} }
} else if (data.type === "PIP_END_REQUEST") { } else if (data.type === "PIP_END_REQUEST") {
if (data.payload.loginId == globalUserInfo.loginId && joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) { if (
data.payload.loginId == globalUserInfo.loginId &&
joinCollaborationType == COLLABORATION_TYPE.DOCUMENT
) {
if (CHAT_UTIL.isAndroid()) { if (CHAT_UTIL.isAndroid()) {
android.finishPip(); android.finishPip();
$(".pip_indicator").addClass("none"); $(".pip_indicator").addClass("none");
...@@ -258,7 +261,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -258,7 +261,7 @@ document.addEventListener("DOMContentLoaded", function () {
} }
} else if (data.type === "API_SEND_OWNER_CHANGE_CONFIRM") { } else if (data.type === "API_SEND_OWNER_CHANGE_CONFIRM") {
if (joinCollaborationType == COLLABORATION_TYPE.CAMERA) { if (joinCollaborationType == COLLABORATION_TYPE.CAMERA) {
await new Promise(done => setTimeout(() => done(), 500)); await new Promise((done) => setTimeout(() => done(), 500));
removeOldLocalVideo(g_localStream); removeOldLocalVideo(g_localStream);
} }
} else if (data.type === "CHANGE_HOST_APPLY") { } else if (data.type === "CHANGE_HOST_APPLY") {
...@@ -278,7 +281,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -278,7 +281,7 @@ document.addEventListener("DOMContentLoaded", function () {
HostRequestFlag.DOING HostRequestFlag.DOING
); );
} }
await new Promise(done => setTimeout(() => done(), 500)); await new Promise((done) => setTimeout(() => done(), 500));
if (g_isMainMan) { if (g_isMainMan) {
if ( if (
confirm( confirm(
...@@ -401,21 +404,17 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -401,21 +404,17 @@ document.addEventListener("DOMContentLoaded", function () {
} }
} }
if (isInvited == InvitedFlag.NONE) { if (isInvited == InvitedFlag.NONE) {
CHAT_UI.joinRoom( NativeBridge.joinRoom(
CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name CHAT.globalLoginParameter.name
); );
} else { } else {
if (typeof android != "undefined") { NativeBridge.openCommunicationHome();
android.openCommunicationHome();
} else {
webkit.messageHandlers.openCommunicationHome.postMessage({});
}
} }
console.log("=============> HOST BYE : share hostbye"); console.log("=============> HOST BYE : share hostbye");
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.showExitHostAlert.postMessage({}); webkit.messageHandlers.showExitHostAlert.postMessage({});
return; return;
} }
$("#loadingIndicator").removeClass("full_active"); $("#loadingIndicator").removeClass("full_active");
}); });
...@@ -465,9 +464,11 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -465,9 +464,11 @@ document.addEventListener("DOMContentLoaded", function () {
} }
} }
} else if (collaborationJoinFlg == "0") { } else if (collaborationJoinFlg == "0") {
let deleteRoomResult = JSON.parse(await deleteRoomApi(globalUserInfo.roomId)); let deleteRoomResult = JSON.parse(
await deleteRoomApi(globalUserInfo.roomId)
);
if (deleteRoomResult.resultCode == 200) { if (deleteRoomResult.resultCode == 200) {
await new Promise(done => setTimeout(() => done(), 3000)); await new Promise((done) => setTimeout(() => done(), 3000));
} }
coview_api.CreateRoom( coview_api.CreateRoom(
globalUserInfo.roomId, globalUserInfo.roomId,
...@@ -532,7 +533,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -532,7 +533,7 @@ document.addEventListener("DOMContentLoaded", function () {
coview_api.LeaveRoom(); coview_api.LeaveRoom();
$(".coview_share_area").hide(); $(".coview_share_area").hide();
$("#loadingIndicator").removeClass("full_active"); $("#loadingIndicator").removeClass("full_active");
CHAT_UI.joinRoom( NativeBridge.joinRoom(
CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name CHAT.globalLoginParameter.name
); );
...@@ -608,72 +609,72 @@ function Coview_moveToAudioShareArea() { ...@@ -608,72 +609,72 @@ function Coview_moveToAudioShareArea() {
function changeCollaboration(changeCollaborationType) { function changeCollaboration(changeCollaborationType) {
recordStop(function () { recordStop(function () {
var newMeetingId = 0; var newMeetingId = 0;
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) { if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.exitMeetingRoom.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.exitMeetingRoom();
}
}
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.setJoinCollaborationType.postMessage( webkit.messageHandlers.exitMeetingRoom.postMessage({});
changeCollaborationType
);
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
if ( android.exitMeetingRoom();
changeCollaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O
) {
alert(getLocalizedString("not_support_version"));
return;
}
android.setJoinCollaborationType(changeCollaborationType);
}
joinCollaborationType = changeCollaborationType;
initCollaborationUI(changeCollaborationType);
switch (changeCollaborationType) {
case COLLABORATION_TYPE.AUDIO:
coview_api.ChangeCollaboration("audio");
break;
case COLLABORATION_TYPE.CAMERA:
removeOldLocalVideo(g_localStream);
coview_api.ChangeCollaboration("image");
break;
case COLLABORATION_TYPE.VIDEO:
coview_api.ChangeCollaboration("video");
break;
case COLLABORATION_TYPE.DOCUMENT:
coview_api.ChangeCollaboration("audio");
if (CHAT_UTIL.isIOS()) {
newMeetingId = CHAT_DB.createContentView();
} else if (CHAT_UTIL.isAndroid()) {
newMeetingId = android.createContentView();
console.log("newMeetingId = " + newMeetingId);
}
break;
case COLLABORATION_TYPE.BOARD:
coview_api.ChangeCollaboration("audio");
break;
}
if ($("#micBtn .voice").hasClass("disable")) {
micOff();
} else {
micOn();
} }
penOff(); }
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.changeCollaboration.postMessage({ webkit.messageHandlers.setJoinCollaborationType.postMessage(
changeCollaborationType: changeCollaborationType, changeCollaborationType
meetingId: newMeetingId, );
}); } else if (CHAT_UTIL.isAndroid()) {
} else if (CHAT_UTIL.isAndroid()) { if (
android.changeCollaboration(changeCollaborationType, newMeetingId); changeCollaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O
) {
alert(getLocalizedString("not_support_version"));
return;
} }
joinMeetingId = newMeetingId; android.setJoinCollaborationType(changeCollaborationType);
fw.sendToMsg("others", "CHANGE_COLLABORATION", { }
collaborationType: changeCollaborationType, joinCollaborationType = changeCollaborationType;
newMeetingId: newMeetingId, initCollaborationUI(changeCollaborationType);
switch (changeCollaborationType) {
case COLLABORATION_TYPE.AUDIO:
coview_api.ChangeCollaboration("audio");
break;
case COLLABORATION_TYPE.CAMERA:
removeOldLocalVideo(g_localStream);
coview_api.ChangeCollaboration("image");
break;
case COLLABORATION_TYPE.VIDEO:
coview_api.ChangeCollaboration("video");
break;
case COLLABORATION_TYPE.DOCUMENT:
coview_api.ChangeCollaboration("audio");
if (CHAT_UTIL.isIOS()) {
newMeetingId = CHAT_DB.createContentView();
} else if (CHAT_UTIL.isAndroid()) {
newMeetingId = android.createContentView();
console.log("newMeetingId = " + newMeetingId);
}
break;
case COLLABORATION_TYPE.BOARD:
coview_api.ChangeCollaboration("audio");
break;
}
if ($("#micBtn .voice").hasClass("disable")) {
micOff();
} else {
micOn();
}
penOff();
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.changeCollaboration.postMessage({
changeCollaborationType: changeCollaborationType,
meetingId: newMeetingId,
}); });
} else if (CHAT_UTIL.isAndroid()) {
android.changeCollaboration(changeCollaborationType, newMeetingId);
}
joinMeetingId = newMeetingId;
fw.sendToMsg("others", "CHANGE_COLLABORATION", {
collaborationType: changeCollaborationType,
newMeetingId: newMeetingId,
});
}); });
} }
...@@ -783,16 +784,12 @@ function Coview_finishCollaboration() { ...@@ -783,16 +784,12 @@ function Coview_finishCollaboration() {
} }
isLeaved = true; isLeaved = true;
if (isInvited == InvitedFlag.NONE) { if (isInvited == InvitedFlag.NONE) {
CHAT_UI.joinRoom( NativeBridge.joinRoom(
CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name CHAT.globalLoginParameter.name
); );
} else { } else {
if (typeof android != "undefined") { NativeBridge.openCommunicationHome();
android.openCommunicationHome();
} else {
webkit.messageHandlers.openCommunicationHome.postMessage({});
}
} }
} }
...@@ -1041,11 +1038,11 @@ function captureAndShareImage(urls, changeHostName) { ...@@ -1041,11 +1038,11 @@ function captureAndShareImage(urls, changeHostName) {
}); });
} }
function toolToggle(){ function toolToggle() {
if($("#collabo_footer_menu").hasClass('hide')){ if ($("#collabo_footer_menu").hasClass("hide")) {
$("#collabo_footer_menu").removeClass('hide'); $("#collabo_footer_menu").removeClass("hide");
}else{ } else {
$("#collabo_footer_menu").addClass('hide'); $("#collabo_footer_menu").addClass("hide");
} }
} }
...@@ -1071,12 +1068,12 @@ function recordStart() { ...@@ -1071,12 +1068,12 @@ function recordStart() {
console.log("レコードを開始しました"); console.log("レコードを開始しました");
MainManRecord("on"); MainManRecord("on");
$("#recordBtn .record").addClass("disable"); $("#recordBtn .record").addClass("disable");
$('.flash-txt').addClass('on'); $(".flash-txt").addClass("on");
} }
function recordFinished() { function recordFinished() {
$("#recordBtn .record").removeClass("disable"); $("#recordBtn .record").removeClass("disable");
$('.flash-txt').removeClass('on'); $(".flash-txt").removeClass("on");
// ロック画面の削除 // ロック画面の削除
delete_dom_obj("screenLock"); delete_dom_obj("screenLock");
} }
...@@ -1111,7 +1108,7 @@ function recordStop(callback) { ...@@ -1111,7 +1108,7 @@ function recordStop(callback) {
function MainManRecordWithCollaboration(action, url, callback) { function MainManRecordWithCollaboration(action, url, callback) {
try { try {
mediaRecorder.stop(); mediaRecorder.stop();
} catch(exeption) { } catch (exeption) {
console.log("Record fail"); console.log("Record fail");
callback(); callback();
} }
...@@ -1193,7 +1190,7 @@ function requestCollaborationFinish() { ...@@ -1193,7 +1190,7 @@ function requestCollaborationFinish() {
} }
async function waitMillisecond(millesecond) { async function waitMillisecond(millesecond) {
await new Promise(done => setTimeout(() => done(), millesecond)); await new Promise((done) => setTimeout(() => done(), millesecond));
} }
function penToggle() { function penToggle() {
...@@ -1225,4 +1222,4 @@ function captureRequestToggle() { ...@@ -1225,4 +1222,4 @@ function captureRequestToggle() {
fw.sendToMsg("others", "CAPTURE_REQUEST", { fw.sendToMsg("others", "CAPTURE_REQUEST", {
name: CHAT.globalLoginParameter.loginId, name: CHAT.globalLoginParameter.loginId,
}); });
} }
\ No newline at end of file
...@@ -63,7 +63,8 @@ var setupBackButton = function () { ...@@ -63,7 +63,8 @@ var setupBackButton = function () {
$("#pills-chat-tab").tab("show"); $("#pills-chat-tab").tab("show");
} else { } else {
if (IS_ONLINE == "true") { if (IS_ONLINE == "true") {
android.updateRoomList(); // todo: peacekim:: needs to check it only needs for android or not.
NativeBridge.updateRoomList();
CHAT_UI.refreshRoomList(ChatRoomType.DM); CHAT_UI.refreshRoomList(ChatRoomType.DM);
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
} }
......
...@@ -58,11 +58,7 @@ var bindOnConnect = function () { ...@@ -58,11 +58,7 @@ var bindOnConnect = function () {
var requestLoginInfo = function () { var requestLoginInfo = function () {
// チャットルームに入場する際、sid, loginId, shopName, roomId, roomNameの情報を取得しNodeJsに渡す // チャットルームに入場する際、sid, loginId, shopName, roomId, roomNameの情報を取得しNodeJsに渡す
if (CHAT_UTIL.isIOS()) { NativeBridge.getLoginParameter();
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.getLoginParameter();
}
}; };
var bindOnDisconnect = function () { var bindOnDisconnect = function () {
...@@ -127,10 +123,8 @@ var bindOnShowServerError = function () { ...@@ -127,10 +123,8 @@ var bindOnShowServerError = function () {
var bindOnRetryJoinProcess = function () { var bindOnRetryJoinProcess = function () {
socket.on(SOCKET_KEY.RETRY_JOIN_PROCESS, function () { socket.on(SOCKET_KEY.RETRY_JOIN_PROCESS, function () {
var ua = window.navigator.userAgent.toLowerCase(); var ua = window.navigator.userAgent.toLowerCase();
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS() || CHAT_UTIL.isAndroid()) {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({}); webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.getLoginParameter();
} else { } else {
CHAT_UI.htmlElementTextInitialize("ko"); CHAT_UI.htmlElementTextInitialize("ko");
// webでのsocket connect // webでのsocket connect
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<li><a id="room_name_change_button" href="chat_change_room_name.html"><img src="icon/icon_change_room_name.png" alt="ルーム名変更">ルーム名変更</a> <li><a id="room_name_change_button" href="chat_change_room_name.html"><img src="icon/icon_change_room_name.png" alt="ルーム名変更">ルーム名変更</a>
</li> </li>
<li><a id="add_user_button" href="chat_add_user.html"><img src="icon/icon_add_user.png" alt="ユーザー招待">ユーザー招待</a></li> <li><a id="add_user_button" href="chat_add_user.html"><img src="icon/icon_add_user.png" alt="ユーザー招待">ユーザー招待</a></li>
<li ><a id="display_off_button" href="javascript:return false;" onclick="CHAT_UI.roomDisplayOff();"><img src="icon/icon_display_off_chatroom.png" alt="ユーザー招待">部屋非表示</a></li> <li ><a id="display_off_button" href="javascript:return false;" onclick="NativeBridge.roomDisplayOff();"><img src="icon/icon_display_off_chatroom.png" alt="ユーザー招待">部屋非表示</a></li>
</ul> </ul>
</div> </div>
</div> </div>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</div> </div>
</div> </div>
<div class="collabo_btn"> <div class="collabo_btn">
<button class="collaboation_join_button" type="button" name="button" onclick="CHAT_UI.joinCollaboration({{collaborationType}}, {{meetingId}})" {{#isEnded}} disabled {{/isEnded}}> <button class="collaboation_join_button" type="button" name="button" onclick="NativeBridge.joinCollaboration({{collaborationType}}, {{meetingId}})" {{#isEnded}} disabled {{/isEnded}}>
<img src="icon/icon_profile_phone.png" alt="通話"> <img src="icon/icon_profile_phone.png" alt="通話">
{{#isEnded}} {{#isEnded}}
<span class="collaboration_join_message">終了しました</span> <span class="collaboration_join_message">終了しました</span>
......
<ul class="m-0"> <ul class="m-0">
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
<a href="#" class="w-100" onclick="CHAT_UI.joinRoom({{roomId}},'{{roomName}}');"> <a href="#" class="w-100" onclick="NativeBridge.joinRoom({{roomId}},'{{roomName}}');">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thumbnail{{thumbnailCount}} thumbnail"> <div class="thumbnail{{thumbnailCount}} thumbnail">
......
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