Commit 91c488ee by Kim Peace

Moved native bridge delegate for calling native method

parent 42fe068a
...@@ -155,8 +155,8 @@ ...@@ -155,8 +155,8 @@
$("#chatMenuModal").load("./modal_chat_menu.html"); $("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script> <script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common --> <!-- Common -->
<script src="./js/common/constant.js"></script> <script src="./js/common/constant.js"></script>
<script src="./js/common/NativeBridge.js"></script> <script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/common.js"></script> <script src="./js/common/common.js"></script>
<script src="./js/chat-util.js"></script> <script src="./js/chat-util.js"></script>
<!-- Model --> <!-- Model -->
...@@ -203,8 +203,8 @@ ...@@ -203,8 +203,8 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -135,14 +135,10 @@ ...@@ -135,14 +135,10 @@
let IS_ONLINE = false; let IS_ONLINE = false;
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
NativeBridgeDelegate.saveSelectedUserList("");
if (typeof (android) != "undefined") {
android.saveSelectedUserList("");
} else {
webkit.messageHandlers.saveSelectedUserList.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;
......
...@@ -165,8 +165,8 @@ ...@@ -165,8 +165,8 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -93,8 +93,8 @@ ...@@ -93,8 +93,8 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -93,8 +93,8 @@ ...@@ -93,8 +93,8 @@
let IS_ONLINE = false; let IS_ONLINE = false;
let roomId = 0; let roomId = 0;
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -166,8 +166,8 @@ ...@@ -166,8 +166,8 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
......
...@@ -101,8 +101,8 @@ ...@@ -101,8 +101,8 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
......
...@@ -198,15 +198,12 @@ ...@@ -198,15 +198,12 @@
$("#chatMenuModal").load("./modal_chat_menu.html"); $("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
NativeBridgeDelegate.getLoginParameter();
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getGlobalParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.saveSelectedUserList("");
if (typeof (android) != "undefined") { if (typeof (android) != "undefined") {
android.saveSelectedUserList("");
androidVersion = android.getAndroidVersion(); androidVersion = android.getAndroidVersion();
} else {
webkit.messageHandlers.saveSelectedUserList.postMessage("");
} }
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<div <div
class="start_pip_area d-flex flex-column justify-content-center align-items-center h-100 collaboration_contents document_contents none"> class="start_pip_area d-flex flex-column justify-content-center align-items-center h-100 collaboration_contents document_contents none">
<div class="start_pip_img_wrap"> <div class="start_pip_img_wrap">
<a href="javascript:startPipMode();"> <a href="javascript:NativeBridgeDelegate.startPIPMode();">
<img src="icon/icon_start_pip.png" alt="文書共有"> <img src="icon/icon_start_pip.png" alt="文書共有">
</a> </a>
</div> </div>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<!-- フッター --> <!-- フッター -->
<div id="footer_collabo"></div> <div id="footer_collabo"></div>
<div id="loadingArea"></div> <div id="loadingArea"></div>
<div class="pip_indicator none" onclick="finishPipMode();"> <div class="pip_indicator none" onclick="NativeBridgeDelegate.finishPIPMode();">
<div style="vertical-align: middle;display: table-cell;"> <div style="vertical-align: middle;display: table-cell;">
<img src="icon/icon_end_pip.png" alt="文書共有" style="width: 30px;height: 30px;"> <img src="icon/icon_end_pip.png" alt="文書共有" style="width: 30px;height: 30px;">
<span style="font-size: 20px;vertical-align: middle;">戻る</span> <span style="font-size: 20px;vertical-align: middle;">戻る</span>
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
<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 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");
...@@ -176,36 +176,21 @@ ...@@ -176,36 +176,21 @@
let IS_ONLINE = false; let IS_ONLINE = false;
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let isInvited = 0; let isInvited = 0;
let roomType;
let joinCollaborationType = 0; let joinCollaborationType = 0;
let joinMeetingId = 0; let joinMeetingId = 0;
let androidVersion = 0; let androidVersion = 0;
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
if (typeof (android) != "undefined") {
roomType = android.getRoomType();
} else {
roomType = CHAT_DB.getRoomType();
}
const roomType = NativeBridgeDataSource.getRoomType();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
function startPipMode() { function startPipMode() {
if (typeof (android) != "undefined") { NativeBridgeDelegate.startPIPMode();
android.startPipMode();
} else {
webkit.messageHandlers.startPipMode.postMessage({});
}
}
function finishPipMode() {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.finishPipMode.postMessage({});
}
} }
String.prototype.replaceAll = function (org, dest) { String.prototype.replaceAll = function (org, dest) {
...@@ -228,7 +213,7 @@ ...@@ -228,7 +213,7 @@
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'));
if (typeof android != "undefined") { if (typeof android != "undefined") {
NativeBridge.openCommunicationHome(); NativeBridgeDelegate.openCommunicationHome();
} }
} }
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<div class="text-right d-flex align-items-center"> <div class="text-right d-flex align-items-center">
<button type="button" name="button" class="btn add_user_btn"></button> <button type="button" name="button" class="btn add_user_btn"></button>
<button type="button" name="button" class="btn menu_btn"></button> <button type="button" name="button" class="btn menu_btn"></button>
<button type="button" name="button" class="btn start_pip_btn" onclick="startPipMode();"></button> <button type="button" name="button" class="btn start_pip_btn" onclick="NativeBridgeDelegate.startPIPMode();"></button>
</div> </div>
</div> </div>
</div> </div>
...@@ -64,9 +64,8 @@ ...@@ -64,9 +64,8 @@
<!-- フッター --> <!-- フッター -->
<div id="footer_collabo"></div> <div id="footer_collabo"></div>
<div id="loadingArea"></div> <div id="loadingArea"></div>
<div class="pip_indicator none" onclick="finishPipMode();"> <div class="pip_indicator none" onclick="NativeBridgeDelegate.finishPIPMode();">
<div style="vertical-align: middle;display: table-cell;">協業中 <div style="vertical-align: middle;display: table-cell;">協業中</div>
</div>
</div> </div>
<!-- Library --> <!-- Library -->
...@@ -119,21 +118,11 @@ ...@@ -119,21 +118,11 @@
let IS_ONLINE = false; let IS_ONLINE = false;
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
function startPipMode() {
if (typeof (android) != "undefined") {
android.startPipMode();
} else if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.startPipMode.postMessage({});
}
}
function finishPipMode() { function finishPipMode() {
if (CHAT_UTIL.isIOS()) { NativeBridgeDelegate.finishPIPMode();
webkit.messageHandlers.finishPipMode.postMessage({});
}
} }
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
......
...@@ -179,17 +179,11 @@ ...@@ -179,17 +179,11 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType;
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
if (typeof (android) != "undefined") {
roomType = android.getRoomType();
} else {
roomType = CHAT_DB.getRoomType();
}
const roomType = NativeBridgeDataSource.getRoomType();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
......
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
<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 src="./js/share.js"></script>
</body> </body>
<script> <script>
$("#footer_collabo").load("./footer_collabo.html"); $("#footer_collabo").load("./footer_collabo.html");
...@@ -170,17 +170,11 @@ ...@@ -170,17 +170,11 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType;
NativeBridge.getLoginParameter();
NativeBridge.getGlobalParameter();
if (typeof (android) != "undefined") { NativeBridgeDelegate.getLoginParameter();
roomType = android.getRoomType(); NativeBridgeDelegate.getGlobalParameter();
} else {
roomType = CHAT_DB.getRoomType();
}
const roomType = NativeBridgeDataSource.getRoomType();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<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 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");
...@@ -113,17 +113,12 @@ ...@@ -113,17 +113,12 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType;
NativeBridge.getLoginParameter();
NativeBridge.getGlobalParameter();
if (typeof (android) != "undefined") { NativeBridgeDelegate.getLoginParameter();
roomType = android.getRoomType(); NativeBridgeDelegate.getGlobalParameter();
} else {
roomType = CHAT_DB.getRoomType();
}
const roomType = NativeBridgeDataSource.getRoomType();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
......
...@@ -171,17 +171,12 @@ ...@@ -171,17 +171,12 @@
let IS_MOBILE = true; let IS_MOBILE = true;
let IS_ONLINE = false; let IS_ONLINE = false;
let collaborationJoinFlg = 0; let collaborationJoinFlg = 0;
let roomType;
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
if (typeof (android) != "undefined") {
roomType = android.getRoomType();
} else {
roomType = CHAT_DB.getRoomType();
}
const roomType = NativeBridgeDataSource.getRoomType();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$('.add_user_btn').removeClass('none'); $('.add_user_btn').removeClass('none');
} }
......
...@@ -215,8 +215,8 @@ ...@@ -215,8 +215,8 @@
let IS_ONLINE = false; let IS_ONLINE = false;
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
NativeBridge.getLoginParameter(); NativeBridgeDelegate.getLoginParameter();
NativeBridge.getGlobalParameter(); NativeBridgeDelegate.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
...@@ -233,11 +233,7 @@ ...@@ -233,11 +233,7 @@
} }
if (groupId != "" && groupId != undefined) { if (groupId != "" && groupId != undefined) {
CHAT_UI.refreshAllGroupSearch(groupId); CHAT_UI.refreshAllGroupSearch(groupId);
if (typeof (android) != "undefined") { NativeBridgeDelegate.setToMoveGroupId("");
android.setToMoveGroupId("");
} else {
webkit.messageHandlers.setToMoveGroupId.postMessage("");
}
} else { } else {
CHAT_UI.refreshContactScreen(); CHAT_UI.refreshContactScreen();
} }
......
...@@ -228,14 +228,6 @@ CHAT_DB.getArchiveList = function () { ...@@ -228,14 +228,6 @@ CHAT_DB.getArchiveList = function () {
} }
}; };
CHAT_DB.updateArchiveList = function () {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.updateArchiveList.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.updateArchiveList();
}
};
// アーカイブ一覧検索 // アーカイブ一覧検索
CHAT_DB.getArchiveByName = function (archiveName) { CHAT_DB.getArchiveByName = function (archiveName) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
...@@ -260,13 +252,7 @@ CHAT_DB.getArchiveDetail = function (archiveId) { ...@@ -260,13 +252,7 @@ CHAT_DB.getArchiveDetail = function (archiveId) {
} }
}; };
CHAT_DB.updateArchiveDetail = function (archiveId) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.updateArchiveDetail.postMessage(archiveId);
} else if (CHAT_UTIL.isAndroid()) {
android.updateArchiveDetail(archiveId);
}
};
CHAT_DB.searchMessages = function (keyword, userList) { CHAT_DB.searchMessages = function (keyword, userList) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
......
jQuery("#homeButton").on("click", function () { jQuery("#homeButton").on("click", function () {
if (CHAT_UTIL.isIOS()) { NativeBridgeDelegate.goHome();
webkit.messageHandlers.goHome.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.goHome();
}
}); });
jQuery("#reloadButton").on("click", function () { jQuery("#reloadButton").on("click", function () {
......
...@@ -13,16 +13,8 @@ window.onscroll = function () { ...@@ -13,16 +13,8 @@ window.onscroll = function () {
); );
$("#messages").prepend(loader); $("#messages").prepend(loader);
const messageId = $($(".chat_message").get(0)).data("messageid"); const messageId = $($(".chat_message").get(0)).data("messageid");
let messages; NativeBridgeDelegate.updatePreMessage(messageId);
if (typeof android != "undefined") { let messages = CHAT_DB.getMessagesWithMessageId(messageId);
if (IS_ONLINE == "true") {
android.updatePreMessage(messageId);
}
} else {
// 追加メッセージUpdate、get
webkit.messageHandlers.updatePreMessage.postMessage({ messageId: messageId });
}
messages = CHAT_DB.getMessagesWithMessageId(messageId);
CHAT_UI.prependMessage(messages); CHAT_UI.prependMessage(messages);
loader.remove(); loader.remove();
var afterHeight = $(".room_container").height(); var afterHeight = $(".room_container").height();
...@@ -38,27 +30,5 @@ $("#roomNameChangeBtn").click(function () { ...@@ -38,27 +30,5 @@ $("#roomNameChangeBtn").click(function () {
alert(getLocalizedString("error_empty_room_name")); alert(getLocalizedString("error_empty_room_name"));
return; return;
} }
if (CHAT_UTIL.isIOS()) { NativeBridgeDelegate.changeRoomName(changeRoomName);
webkit.messageHandlers.changeRoomName.postMessage(changeRoomName);
} else if (CHAT_UTIL.isAndroid()) {
android.changeRoomName(changeRoomName);
}
}); });
/*
$('#messages').scroll(function() {
console.log('messagescroll');
if ($(this).scrollTop() === 0) {
if (!$('#chatLoader').is(':visible')) {
// 現在、メッセージの個数以前をメッセージを読み込む
// ローディングアイコンを追加する
let loader = $('<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>')
$('#messages').prepend(loader)
loader.remove();
// socket.emit('getMessages', $(this).children().length, function() {
// // ローディングアイコンを削除する
// loader.remove();
// });
}
}
});*/
...@@ -95,7 +95,7 @@ $("#room-search").on("input", function (event) { ...@@ -95,7 +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") {
NativeBridge.updateRoomList(); NativeBridgeDelegate.updateRoomList();
CHAT_UI.refreshRoomList(ChatRoomType.DM); CHAT_UI.refreshRoomList(ChatRoomType.DM);
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
} }
...@@ -338,23 +338,13 @@ $("#tabAllGroupOnAddUserInCollaboration").on("click", function (e) { ...@@ -338,23 +338,13 @@ $("#tabAllGroupOnAddUserInCollaboration").on("click", function (e) {
}); });
$("#makeRoomConfirmBtn").on("click", function (e) { $("#makeRoomConfirmBtn").on("click", function (e) {
if (typeof android != "undefined") { const selectedUserList = CHAT.globalSelectedUserList.join(",");
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(",")); NativeBridgeDelegate.saveSelectedUserList(selectedUserList);
} else {
webkit.messageHandlers.saveSelectedUserList.postMessage(
CHAT.globalSelectedUserList.join(",")
);
}
$("#makeRoomForm").submit(); $("#makeRoomForm").submit();
}); });
$("#addUserConfirmBtn").on("click", function (e) { $("#addUserConfirmBtn").on("click", function (e) {
if (typeof android != "undefined") { const selectedUserList = CHAT.globalSelectedUserList.join(",");
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(",")); NativeBridgeDelegate.saveSelectedUserList(selectedUserList);
} else {
webkit.messageHandlers.saveSelectedUserList.postMessage(
CHAT.globalSelectedUserList.join(",")
);
}
$("#addUserForm").submit(); $("#addUserForm").submit();
}); });
...@@ -21,18 +21,9 @@ CHAT_UI.startCollaboration = function (collaborationType) { ...@@ -21,18 +21,9 @@ CHAT_UI.startCollaboration = function (collaborationType) {
}, },
0 0
); );
if (CHAT_UTIL.isIOS()) { NativeBridgeDelegate.finishAllCollaboration();
webkit.messageHandlers.finishAllCollaboration.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.finishAllCollaboration();
}
}
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.startCollaboration.postMessage(collaborationType);
} else if (CHAT_UTIL.isAndroid()) {
android.startCollaboration(collaborationType);
} }
NativeBridgeDelegate.startCollaboration(collaborationType);
}; };
CHAT_UI.refreshJoinedCollaboration = function (loginIdList) { CHAT_UI.refreshJoinedCollaboration = function (loginIdList) {
...@@ -104,7 +95,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () { ...@@ -104,7 +95,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
TemplateURL.ADD_USER_GROUP_USER_LIST_IN_COLLABORATION TemplateURL.ADD_USER_GROUP_USER_LIST_IN_COLLABORATION
); );
NativeBridge.updateContactInfo(); NativeBridgeDelegate.updateContactInfo();
//お気に入りグループ取得。 //お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups(); var favoriteGroupList = CHAT_DB.getFavoriteGroups();
...@@ -163,7 +154,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) { ...@@ -163,7 +154,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) {
$("#tabAllGroupOnAddUserInCollaboration").prop("checked", true); $("#tabAllGroupOnAddUserInCollaboration").prop("checked", true);
NativeBridge.updateGroupInfo(groupId); NativeBridgeDelegate.updateGroupInfo(groupId);
//画面エリアを初期化。 //画面エリアを初期化。
$("#parentGroupBtnForAddUserInCollaboration").off(); $("#parentGroupBtnForAddUserInCollaboration").off();
...@@ -350,19 +341,16 @@ CHAT_UI.confirmInviteUserListInCollaboration = function () { ...@@ -350,19 +341,16 @@ CHAT_UI.confirmInviteUserListInCollaboration = function () {
selectedUserList.forEach(function (user) { selectedUserList.forEach(function (user) {
userIdList.push(user.shopMemberId); userIdList.push(user.shopMemberId);
}); });
if (typeof android != "undefined") { const commaJoinedUserIDList = userIdList.join(",");
android.inviteCollaboration( const collaborationType = CHAT_UTIL.getCollaborationType(
userIdList.join(","), globalUserInfo.coWorkType
CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType) );
);
} else { NativeBridgeDelegate.inviteCollaboration(
webkit.messageHandlers.inviteCollaboration.postMessage({ commaJoinedUserIDList,
userIdList: userIdList.join(","), collaborationType
collaborationType: CHAT_UTIL.getCollaborationType( );
globalUserInfo.coWorkType
),
});
}
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
$("#modalAddUserConfirm").modal("hide"); $("#modalAddUserConfirm").modal("hide");
}); });
......
...@@ -139,7 +139,7 @@ $('a[data-toggle="pill"]').on("show.bs.tab", function (e) { ...@@ -139,7 +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 () {
NativeBridge.updateRoomList(); NativeBridgeDelegate.updateRoomList();
}); });
} }
CHAT_UI.refreshRoomList(ChatRoomType.DM); CHAT_UI.refreshRoomList(ChatRoomType.DM);
...@@ -438,7 +438,7 @@ CHAT_UI.showConfirmView = function (isInvite) { ...@@ -438,7 +438,7 @@ CHAT_UI.showConfirmView = function (isInvite) {
// ルーム名のURIencodingを行う // ルーム名のURIencodingを行う
//const encodedRoomName = encodeURIComponent(newRoomName); //const encodedRoomName = encodeURIComponent(newRoomName);
NativeBridge.createChatRoom( NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList.join(","), userIdList.join(","),
newRoomName, newRoomName,
...@@ -514,7 +514,7 @@ CHAT_UI.showConfirmView = function (isInvite) { ...@@ -514,7 +514,7 @@ CHAT_UI.showConfirmView = function (isInvite) {
// ルーム名のtrimmingした後、URIencodingを行う // ルーム名のtrimmingした後、URIencodingを行う
const encodedRoomName = encodeURIComponent(trimmedRoomName); const encodedRoomName = encodeURIComponent(trimmedRoomName);
NativeBridge.createChatRoom( NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList.join(","), userIdList.join(","),
encodedRoomName, encodedRoomName,
...@@ -808,7 +808,7 @@ CHAT_UI.refreshContactScreen = function () { ...@@ -808,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);
NativeBridge.updateContactInfo(); NativeBridgeDelegate.updateContactInfo();
var myInfo = CHAT_DB.getMyInfo(); var myInfo = CHAT_DB.getMyInfo();
myInfo.profileImagePath = CHAT.getProfileImgUrl(myInfo.profileUrl); myInfo.profileImagePath = CHAT.getProfileImgUrl(myInfo.profileUrl);
...@@ -882,11 +882,7 @@ CHAT_UI.refreshRoomList = function (roomType) { ...@@ -882,11 +882,7 @@ CHAT_UI.refreshRoomList = function (roomType) {
} }
if (beforeRoomType != null) { if (beforeRoomType != null) {
roomType = beforeRoomType; roomType = beforeRoomType;
if (typeof android != "undefined") { NativeBridgeDelegate.clearBeforeRoomType();
android.clearBeforeRoomType();
} else {
webkit.messageHandlers.clearBeforeRoomType.postMessage({});
}
} }
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
...@@ -896,7 +892,7 @@ CHAT_UI.refreshRoomList = function (roomType) { ...@@ -896,7 +892,7 @@ CHAT_UI.refreshRoomList = function (roomType) {
} }
if (IS_ONLINE == "true") { if (IS_ONLINE == "true") {
NativeBridge.updateRoomList(); NativeBridgeDelegate.updateRoomList();
} }
var rooms = CHAT_DB.getRoomList(roomType, null); var rooms = CHAT_DB.getRoomList(roomType, null);
CHAT.globalIsInvite = false; CHAT.globalIsInvite = false;
...@@ -1003,23 +999,13 @@ CHAT_UI.refreshRoomList = function (roomType) { ...@@ -1003,23 +999,13 @@ CHAT_UI.refreshRoomList = function (roomType) {
CHAT_UI.loadMessages = function (roomId, joinRoomName) { CHAT_UI.loadMessages = function (roomId, joinRoomName) {
roomName = joinRoomName; roomName = joinRoomName;
var now = new Date();
if (IS_ONLINE == "true") { if (IS_ONLINE == "true") {
CHAT_UI.refreshForOnline(); CHAT_UI.refreshForOnline();
if (typeof android != "undefined") { NativeBridgeDelegate.updateMessages(roomId);
android.updateMessages(roomId);
} else {
webkit.messageHandlers.updateMessages.postMessage(roomId);
}
} else { } else {
CHAT_UI.refreshForOffline(); CHAT_UI.refreshForOffline();
} }
var roomType; const roomType = NativeBridgeDataSource.getRoomType();
if (typeof android != "undefined") {
roomType = android.getRoomType();
} else {
roomType = CHAT_DB.getRoomType();
}
if (roomType == ChatRoomType.DM) { if (roomType == ChatRoomType.DM) {
$("#roomMenu").removeClass("none"); $("#roomMenu").removeClass("none");
} }
...@@ -1278,7 +1264,7 @@ CHAT_UI.insertFavoriteUser = function (shopMemberId) { ...@@ -1278,7 +1264,7 @@ CHAT_UI.insertFavoriteUser = function (shopMemberId) {
CHAT_UI.removeFavoriteGroup = function (groupId) { CHAT_UI.removeFavoriteGroup = function (groupId) {
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
var result = NativeBridge.removeFavoriteGroup(groupId); var result = NativeBridgeDataSource.removeFavoriteGroup(groupId);
if (result) { if (result) {
$(".group_" + groupId).removeClass("active"); $(".group_" + groupId).removeClass("active");
$(".group_" + groupId).addClass("disable"); $(".group_" + groupId).addClass("disable");
...@@ -1291,7 +1277,7 @@ CHAT_UI.removeFavoriteGroup = function (groupId) { ...@@ -1291,7 +1277,7 @@ CHAT_UI.removeFavoriteGroup = function (groupId) {
CHAT_UI.insertFavoriteGroup = function (groupId) { CHAT_UI.insertFavoriteGroup = function (groupId) {
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
const result = NativeBridge.addFavoriteGroup(groupID); const result = NativeBridgeDataSource.addFavoriteGroup(groupID);
if (result) { if (result) {
$(".group_" + groupId).removeClass("disable"); $(".group_" + groupId).removeClass("disable");
$(".group_" + groupId).addClass("active"); $(".group_" + groupId).addClass("active");
...@@ -1307,11 +1293,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) { ...@@ -1307,11 +1293,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
var groupId = paramGroupId; var groupId = paramGroupId;
if (window.location.pathname.includes("chat_room")) { if (window.location.pathname.includes("chat_room")) {
if (groupId == "") return; if (groupId == "") return;
if (typeof android != "undefined") { NativeBridgeDelegate.setToMoveGroupId(groupId);
android.setToMoveGroupId(groupId);
} else {
webkit.messageHandlers.setToMoveGroupId.postMessage(groupId);
}
window.location.href = "contact.html"; window.location.href = "contact.html";
} }
...@@ -1330,7 +1312,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) { ...@@ -1330,7 +1312,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
$("#tabAllGroup").prop("checked", true); $("#tabAllGroup").prop("checked", true);
//オンライン状態であればサーバから情報更新。 //オンライン状態であればサーバから情報更新。
NativeBridge.updateGroupInfo(groupId); NativeBridgeDelegate.updateGroupInfo(groupId);
//画面エリアを初期化。 //画面エリアを初期化。
$("#rootGroupBtn").off(); $("#rootGroupBtn").off();
...@@ -1408,7 +1390,7 @@ CHAT_UI.startChat = function (userShopMemberId, userName) { ...@@ -1408,7 +1390,7 @@ CHAT_UI.startChat = function (userShopMemberId, userName) {
// 参加ユーザ名でルーム名を生成 // 参加ユーザ名でルーム名を生成
let newRoomName = CHAT.globalLoginParameter.loginId + "," + userName; let newRoomName = CHAT.globalLoginParameter.loginId + "," + userName;
NativeBridge.createChatRoom( NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList.join(","), userIdList.join(","),
newRoomName, newRoomName,
...@@ -1424,7 +1406,7 @@ CHAT_UI.startVoice = function (userShopMemberId, userName) { ...@@ -1424,7 +1406,7 @@ CHAT_UI.startVoice = function (userShopMemberId, userName) {
// 参加ユーザ名でルーム名を生成 // 参加ユーザ名でルーム名を生成
let newRoomName = CHAT.globalLoginParameter.loginId + "," + userName; let newRoomName = CHAT.globalLoginParameter.loginId + "," + userName;
NativeBridge.createChatRoom( NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList.join(","), userIdList.join(","),
newRoomName, newRoomName,
...@@ -1477,7 +1459,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) { ...@@ -1477,7 +1459,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
// アーカイブ詳細の様式を読み込む // アーカイブ詳細の様式を読み込む
const archiveDetailTemplate = $("#archive-detail-template").html(); const archiveDetailTemplate = $("#archive-detail-template").html();
if (IS_ONLINE == "true") { if (IS_ONLINE == "true") {
CHAT_DB.updateArchiveDetail(archiveId); NativeBridgeDelegate.updateArchiveDetail(archiveId);
} }
// アーカイブ詳細取得 // アーカイブ詳細取得
const archive = CHAT_DB.getArchiveDetail(archiveId); const archive = CHAT_DB.getArchiveDetail(archiveId);
...@@ -1595,7 +1577,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) { ...@@ -1595,7 +1577,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
// チャットルームへのリンク付け // チャットルームへのリンク付け
document.getElementById("joinChatRoom").onclick = function () { document.getElementById("joinChatRoom").onclick = function () {
NativeBridge.joinRoom(archive.roomId, archive.roomName); NativeBridgeDelegate.joinRoom(archive.roomId, archive.roomName);
}; };
// loadingIndicatorを非表示 // loadingIndicatorを非表示
...@@ -1618,7 +1600,7 @@ CHAT_UI.refreshMyGroupForMakeRoom = function () { ...@@ -1618,7 +1600,7 @@ CHAT_UI.refreshMyGroupForMakeRoom = function () {
var groupUserTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_USER_LIST); var groupUserTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_USER_LIST);
NativeBridge.updateContactInfo(); NativeBridgeDelegate.updateContactInfo();
//お気に入りグループ取得。 //お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups(); var favoriteGroupList = CHAT_DB.getFavoriteGroups();
...@@ -1681,7 +1663,7 @@ CHAT_UI.refreshAllGroupForMakeRoom = function (paramGroupId) { ...@@ -1681,7 +1663,7 @@ CHAT_UI.refreshAllGroupForMakeRoom = function (paramGroupId) {
$("#tabAllGroupOnMakeRoom").prop("checked", true); $("#tabAllGroupOnMakeRoom").prop("checked", true);
//オンライン状態であればサーバから情報更新。 //オンライン状態であればサーバから情報更新。
NativeBridge.updateGroupInfo(groupId); NativeBridgeDelegate.updateGroupInfo(groupId);
//画面エリアを初期化。 //画面エリアを初期化。
$("#parentGroupBtnForMakeRoom").off(); $("#parentGroupBtnForMakeRoom").off();
...@@ -1805,7 +1787,7 @@ CHAT_UI.refreshArchiveScreen = function () { ...@@ -1805,7 +1787,7 @@ CHAT_UI.refreshArchiveScreen = function () {
// アーカイブ一覧取得 // アーカイブ一覧取得
if (IS_ONLINE == "true") { if (IS_ONLINE == "true") {
CHAT_DB.updateArchiveList(); NativeBridgeDelegate.updateArchiveList();
} }
// ローカルDBのデータを表示 // ローカルDBのデータを表示
...@@ -1883,7 +1865,7 @@ CHAT_UI.showMakeRoomConfirmView = function () { ...@@ -1883,7 +1865,7 @@ CHAT_UI.showMakeRoomConfirmView = function () {
// 参加ユーザ名でルーム名を生成 // 参加ユーザ名でルーム名を生成
let newRoomName = let newRoomName =
CHAT.globalLoginParameter.loginId + "," + userNameList.join(","); CHAT.globalLoginParameter.loginId + "," + userNameList.join(",");
NativeBridge.createChatRoom( NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList.join(","), userIdList.join(","),
newRoomName, newRoomName,
...@@ -1958,7 +1940,7 @@ CHAT_UI.showMakeRoomConfirmView = function () { ...@@ -1958,7 +1940,7 @@ 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);
NativeBridge.createChatRoom( NativeBridgeDelegate.createChatRoom(
ChatRoomType.DM, ChatRoomType.DM,
userIdList.join(","), userIdList.join(","),
trimmedRoomName, trimmedRoomName,
...@@ -1993,7 +1975,7 @@ CHAT_UI.showAddUserConfirmView = function () { ...@@ -1993,7 +1975,7 @@ CHAT_UI.showAddUserConfirmView = function () {
selectedUserList.forEach(function (user) { selectedUserList.forEach(function (user) {
userIdList.push(user.shopMemberId); userIdList.push(user.shopMemberId);
}); });
NativeBridge.inviteUsers(userIdList.join(",")); NativeBridgeDelegate.inviteUsers(userIdList.join(","));
}); });
}; };
...@@ -2012,7 +1994,7 @@ CHAT_UI.refreshMyGroupForAddUser = function () { ...@@ -2012,7 +1994,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);
NativeBridge.updateContactInfo(); NativeBridgeDelegate.updateContactInfo();
//お気に入りグループ取得。 //お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups(); var favoriteGroupList = CHAT_DB.getFavoriteGroups();
...@@ -2075,7 +2057,7 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) { ...@@ -2075,7 +2057,7 @@ CHAT_UI.refreshAllGroupForAddUser = function (paramGroupId) {
$("#tabAllGroupOnAddUser").prop("checked", true); $("#tabAllGroupOnAddUser").prop("checked", true);
//オンライン状態であればサーバから情報更新。 //オンライン状態であればサーバから情報更新。
NativeBridge.updateGroupInfo(groupId); NativeBridgeDelegate.updateGroupInfo(groupId);
//画面エリアを初期化。 //画面エリアを初期化。
$("#parentGroupBtnForAddUser").off(); $("#parentGroupBtnForAddUser").off();
...@@ -2198,16 +2180,16 @@ CHAT_UI.refreshForOffline = function () { ...@@ -2198,16 +2180,16 @@ CHAT_UI.refreshForOffline = function () {
alertString = getLocalizedString("err_weak_network_exit_collaboration"); alertString = getLocalizedString("err_weak_network_exit_collaboration");
} }
alert(alertString); alert(alertString);
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.finishCollaboration.postMessage({}); NativeBridgeDelegate.finishCollaboration();
}
if (collaborationJoinFlg != "2") { if (collaborationJoinFlg != "2") {
NativeBridge.joinRoom( NativeBridgeDelegate.joinRoom(
CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.roomId,
CHAT.globalLoginParameter.name CHAT.globalLoginParameter.name
); );
} else { } else {
NativeBridge.openCommunicationHome(); NativeBridgeDelegate.openCommunicationHome();
} }
}; };
...@@ -2217,7 +2199,7 @@ CHAT_UI.offlineHandler = function (e) { ...@@ -2217,7 +2199,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")) {
NativeBridge.joinRoom(roomId); NativeBridgeDelegate.joinRoom(roomId);
} }
return; return;
}; };
\ No newline at end of file
...@@ -15,21 +15,10 @@ var beforeHeight = window.innerHeight; ...@@ -15,21 +15,10 @@ var beforeHeight = window.innerHeight;
var beforeWidth = window.innerWidth; var beforeWidth = window.innerWidth;
var beforeScroll; var beforeScroll;
CHAT.saveRoomInfo = function (roomId, roomName) { CHAT.saveRoomInfo = function (roomID, roomName) {
CHAT.globalLoginParameter.roomId = roomId; CHAT.globalLoginParameter.roomId = roomID;
CHAT.globalLoginParameter.roomName = roomName; CHAT.globalLoginParameter.roomName = roomName;
if (CHAT_UTIL.isIOS()) { NativeBridgeDelegate.saveVisitRoomInfo(roomID, roomName)
webkit.messageHandlers.roomInfosaveMessageHandlerId.postMessage({
roomId: roomId,
roomName: roomName,
});
} else if (CHAT_UTIL.isAndroid()) {
if (roomId == undefined && roomName == undefined) {
android.saveVisitRoomInfo("", "");
} else {
android.saveVisitRoomInfo(roomId, roomName);
}
}
}; };
// #36170 画像パスが存在しない場合はデフォルトの画像を返す // #36170 画像パスが存在しない場合はデフォルトの画像を返す
......
...@@ -60,13 +60,8 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -60,13 +60,8 @@ document.addEventListener("DOMContentLoaded", function () {
.off() .off()
.on("click", function () { .on("click", function () {
$("#addUserInCollaboration").modal("hide"); $("#addUserInCollaboration").modal("hide");
if (typeof android != "undefined") { const selectedUserList = CHAT.globalSelectedUserList.join(",");
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(",")); NativeBridgeDelegate.saveSelectedUserList(selectedUserList);
} else {
webkit.messageHandlers.saveSelectedUserList.postMessage(
CHAT.globalSelectedUserList.join(",")
);
}
CHAT_UI.confirmInviteUserListInCollaboration(); CHAT_UI.confirmInviteUserListInCollaboration();
}); });
}); });
......
...@@ -31,11 +31,7 @@ $(".category").on("click", function () { ...@@ -31,11 +31,7 @@ $(".category").on("click", function () {
}); });
$(".home_btn").on("click", function () { $(".home_btn").on("click", function () {
if (CHAT_UTIL.isAndroid()) { NativeBridgeDelegate.goHome();
android.goHome();
} else if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.goHome.postMessage({});
}
}); });
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
......
var NativeBridgeDataSource = {};
// todo: peacekim:: it should be datasource
NativeBridgeDataSource.removeFavoriteGroup = function (groupID) {
if (CHAT_UTIL.isIOS()) {
const result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteGroup, {
groupId: groupID,
});
return result == "true" ? true : false;
} else {
return android.removeFavoriteGroup(groupID);
}
};
NativeBridgeDataSource.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;
}
}
};
NativeBridgeDataSource.getRoomType = function () {
if (typeof android != "undefined") {
return android.getRoomType();
} else {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getRoomType, {}), 10);
}
};
...@@ -64,7 +64,7 @@ var setupBackButton = function () { ...@@ -64,7 +64,7 @@ var setupBackButton = function () {
} else { } else {
if (IS_ONLINE == "true") { if (IS_ONLINE == "true") {
// todo: peacekim:: needs to check it only needs for android or not. // todo: peacekim:: needs to check it only needs for android or not.
NativeBridge.updateRoomList(); NativeBridgeDelegate.updateRoomList();
CHAT_UI.refreshRoomList(ChatRoomType.DM); CHAT_UI.refreshRoomList(ChatRoomType.DM);
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
} }
......
...@@ -51,16 +51,11 @@ var bindOnConnect = function () { ...@@ -51,16 +51,11 @@ var bindOnConnect = function () {
$(".overlay").removeClass("active undismissable"); $(".overlay").removeClass("active undismissable");
// loadingIndicatorを表示 // loadingIndicatorを表示
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
requestLoginInfo(); NativeBridgeDelegate.getLoginParameter();
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}); });
}; };
var requestLoginInfo = function () {
// チャットルームに入場する際、sid, loginId, shopName, roomId, roomNameの情報を取得しNodeJsに渡す
NativeBridge.getLoginParameter();
};
var bindOnDisconnect = function () { var bindOnDisconnect = function () {
socket.on(SOCKET_KEY.DISCONNECT, function () { socket.on(SOCKET_KEY.DISCONNECT, function () {
//socketが切断されたら黒画面で画面を更新する //socketが切断されたら黒画面で画面を更新する
...@@ -122,9 +117,8 @@ var bindOnShowServerError = function () { ...@@ -122,9 +117,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();
if (CHAT_UTIL.isIOS() || CHAT_UTIL.isAndroid()) { if (CHAT_UTIL.isIOS() || CHAT_UTIL.isAndroid()) {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({}); NativeBridgeDelegate.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="NativeBridge.roomDisplayOff();"><img src="icon/icon_display_off_chatroom.png" alt="ユーザー招待">部屋非表示</a></li> <li ><a id="display_off_button" href="javascript:return false;" onclick="NativeBridgeDelegate.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="NativeBridge.joinCollaboration({{collaborationType}}, {{meetingId}})" {{#isEnded}} disabled {{/isEnded}}> <button class="collaboation_join_button" type="button" name="button" onclick="NativeBridgeDelegate.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="NativeBridge.joinRoom({{roomId}},'{{roomName}}');"> <a href="#" class="w-100" onclick="NativeBridgeDelegate.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