Commit b952b542 by Kim Peace

Divded all delegates and datasource from native value

parent 91c488ee
...@@ -108,11 +108,10 @@ ...@@ -108,11 +108,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- view --> <!-- view -->
<script src="./js/chat.js"></script> <script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
......
...@@ -17,21 +17,6 @@ ...@@ -17,21 +17,6 @@
<link rel="stylesheet" href="./css/font-awesome.css"> <link rel="stylesheet" href="./css/font-awesome.css">
</head> </head>
<script>
var archiveId;
window.addEventListener('DOMContentLoaded', function () {
var urlPrm = new Object;
var urlSearch = location.search.substring(1).split('&');
var kv = urlSearch[0].split('=');
urlPrm[kv[0]] = kv[1];
archiveId = urlPrm.archiveId
if (typeof (android) != "undefined") {
} else {
CHAT_UI.refreshArchiveDetailScreen(urlPrm.archiveId);
}
});
</script>
<body> <body>
<!-- ナビメニュー --> <!-- ナビメニュー -->
...@@ -81,12 +66,12 @@ ...@@ -81,12 +66,12 @@
<!-- Common --> <!-- Common -->
<script src="./js/common/constant.js"></script> <script src="./js/common/constant.js"></script>
<script src="./js/common/native-bridge-delegate.js"></script> <script src="./js/common/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- view --> <!-- view -->
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
<script src="./js/archive.js"></script> <script src="./js/archive.js"></script>
<!-- Template archive-detail --> <!-- Template archive-detail -->
...@@ -215,6 +200,22 @@ ...@@ -215,6 +200,22 @@
CHAT_UI.refreshArchiveDetailScreen(archiveId); CHAT_UI.refreshArchiveDetailScreen(archiveId);
}; };
</script> </script>
<script>
var archiveId;
window.addEventListener('DOMContentLoaded', function () {
var urlPrm = new Object;
var urlSearch = location.search.substring(1).split('&');
var kv = urlSearch[0].split('=');
urlPrm[kv[0]] = kv[1];
archiveId = urlPrm.archiveId
if (typeof (android) != "undefined") {
} else {
CHAT_UI.refreshArchiveDetailScreen(urlPrm.archiveId);
}
});
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -114,11 +114,10 @@ ...@@ -114,11 +114,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View --> <!-- View -->
<script src="./js/chat.js"></script> <script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
......
...@@ -142,11 +142,10 @@ ...@@ -142,11 +142,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View --> <!-- View -->
<script src="./js/chat.js"></script> <script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
...@@ -174,8 +173,9 @@ ...@@ -174,8 +173,9 @@
PLATFORM = platform; PLATFORM = platform;
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
if (CHAT_DB.loadSelectedUsers() != "") {
let selectedUsers = CHAT_DB.loadSelectedUsers(); const selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") {
selectedUsers.forEach(function (user) { selectedUsers.forEach(function (user) {
CHAT.globalSelectedUserList.push(user.shopMemberId); CHAT.globalSelectedUserList.push(user.shopMemberId);
}) })
......
...@@ -72,12 +72,11 @@ ...@@ -72,12 +72,11 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 --> <!-- View -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View -->
<script src="./js/chat.js"></script> <script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
<script src="./js/common/loading.js"></script> <script src="./js/common/loading.js"></script>
......
...@@ -71,11 +71,10 @@ ...@@ -71,11 +71,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View --> <!-- View -->
<script src="./js/chat.js"></script> <script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
......
...@@ -143,11 +143,10 @@ ...@@ -143,11 +143,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View --> <!-- View -->
<script src="./js/chat.js"></script> <script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
...@@ -176,8 +175,8 @@ ...@@ -176,8 +175,8 @@
PLATFORM = platform; PLATFORM = platform;
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
if (CHAT_DB.loadSelectedUsers() != "") { if (NativeBridgeDataSource.loadSelectedUsers() != "") {
let selectedUsers = CHAT_DB.loadSelectedUsers(); let selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
selectedUsers.forEach(function (user) { selectedUsers.forEach(function (user) {
CHAT.globalSelectedUserList.push(user.shopMemberId); CHAT.globalSelectedUserList.push(user.shopMemberId);
}) })
......
...@@ -79,11 +79,10 @@ ...@@ -79,11 +79,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View --> <!-- View -->
<script src="./js/chat.js"></script> <script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
......
...@@ -160,11 +160,10 @@ ...@@ -160,11 +160,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket --> <!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script> <script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script> <script src="./js/sockets/chat-websocket-message.js"></script>
......
...@@ -141,11 +141,10 @@ ...@@ -141,11 +141,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket --> <!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script> <script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script> <script src="./js/sockets/chat-websocket-message.js"></script>
...@@ -203,12 +202,11 @@ ...@@ -203,12 +202,11 @@
PLATFORM = platform; PLATFORM = platform;
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
joinCollaborationType = CHAT_DB.getJoinCollaborationType(); joinCollaborationType = NativeBridgeDataSource.getJoinCollaborationType();
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg(); collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
joinCollaborationType = android.getJoinCollaborationType(); if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
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'));
...@@ -222,8 +220,7 @@ ...@@ -222,8 +220,7 @@
globalUserInfo.coWorkType = CHAT_UTIL.getCoviewTypeFromCollaborationType(joinCollaborationType); globalUserInfo.coWorkType = CHAT_UTIL.getCoviewTypeFromCollaborationType(joinCollaborationType);
if (collaborationJoinFlg != '2') { if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket(); CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { socket.emit('join', CHAT.globalLoginParameter, function () { });
});
} }
}; };
</script> </script>
......
...@@ -84,11 +84,10 @@ ...@@ -84,11 +84,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket --> <!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script> <script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script> <script src="./js/sockets/chat-websocket-message.js"></script>
...@@ -131,16 +130,11 @@ ...@@ -131,16 +130,11 @@
PLATFORM = platform; PLATFORM = platform;
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) { collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
}
globalUserInfo.coWorkType = CollaborationTypeKey.DOCUMENT; globalUserInfo.coWorkType = CollaborationTypeKey.DOCUMENT;
CHAT_SOCKET.connectSocket(); CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { socket.emit('join', CHAT.globalLoginParameter, function () { });
});
}; };
</script> </script>
</body> </body>
......
...@@ -145,11 +145,10 @@ ...@@ -145,11 +145,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket --> <!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script> <script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script> <script src="./js/sockets/chat-websocket-message.js"></script>
...@@ -194,17 +193,12 @@ ...@@ -194,17 +193,12 @@
PLATFORM = platform; PLATFORM = platform;
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) { collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
globalUserInfo.coWorkType = CollaborationTypeKey.CAMERA; globalUserInfo.coWorkType = CollaborationTypeKey.CAMERA;
if (collaborationJoinFlg != '2') { if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket(); CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { socket.emit('join', CHAT.globalLoginParameter, function () { });
});
} }
}; };
</script> </script>
......
...@@ -135,11 +135,10 @@ ...@@ -135,11 +135,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket --> <!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script> <script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script> <script src="./js/sockets/chat-websocket-message.js"></script>
...@@ -185,17 +184,12 @@ ...@@ -185,17 +184,12 @@
PLATFORM = platform; PLATFORM = platform;
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) { collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
globalUserInfo.coWorkType = CollaborationTypeKey.VIDEO; globalUserInfo.coWorkType = CollaborationTypeKey.VIDEO;
if (collaborationJoinFlg != '2') { if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket(); CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { socket.emit('join', CHAT.globalLoginParameter, function () { });
});
} }
}; };
</script> </script>
......
...@@ -80,11 +80,10 @@ ...@@ -80,11 +80,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket --> <!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script> <script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script> <script src="./js/sockets/chat-websocket-message.js"></script>
...@@ -129,17 +128,12 @@ ...@@ -129,17 +128,12 @@
PLATFORM = platform; PLATFORM = platform;
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) { collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO; globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO;
if (collaborationJoinFlg != '2') { if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket(); CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { socket.emit('join', CHAT.globalLoginParameter, function () { });
});
} }
}; };
</script> </script>
......
...@@ -137,11 +137,10 @@ ...@@ -137,11 +137,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket --> <!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script> <script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script> <script src="./js/sockets/chat-websocket-message.js"></script>
...@@ -187,16 +186,12 @@ ...@@ -187,16 +186,12 @@
PLATFORM = platform; PLATFORM = platform;
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) { collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
}
globalUserInfo.coWorkType = CollaborationTypeKey.BOARD; globalUserInfo.coWorkType = CollaborationTypeKey.BOARD;
if (collaborationJoinFlg != '2') { if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket(); CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () { socket.emit('join', CHAT.globalLoginParameter, function () { });
});
} }
}; };
</script> </script>
......
...@@ -191,11 +191,10 @@ ...@@ -191,11 +191,10 @@
<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/native-bridge-delegate.js"></script>
<script src="./js/common/native-bridge-datasource.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 -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- View --> <!-- View -->
<script src="./js/chat.js"></script> <script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script> <script src="./js/chat-ui.js"></script>
...@@ -225,14 +224,10 @@ ...@@ -225,14 +224,10 @@
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
let groupId; const groupID = NativeBridgeDataSource.getToMoveGroupId();
if (typeof (android) != "undefined") {
groupId = android.getToMoveGroupId(); if (groupID != "" && groupID != undefined) {
} else { CHAT_UI.refreshAllGroupSearch(groupID);
groupId = CHAT_DB.getToMoveGroupId();
}
if (groupId != "" && groupId != undefined) {
CHAT_UI.refreshAllGroupSearch(groupId);
NativeBridgeDelegate.setToMoveGroupId(""); NativeBridgeDelegate.setToMoveGroupId("");
} else { } else {
CHAT_UI.refreshContactScreen(); CHAT_UI.refreshContactScreen();
......
...@@ -9,7 +9,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -9,7 +9,7 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
ARCHIVE_UI.refreshSearchScreen = function (keyword) { ARCHIVE_UI.refreshSearchScreen = function (keyword) {
const archiveList = CHAT_DB.getArchiveByName(keyword); const archiveList = NativeBridgeDataSource.getArchiveByName(keyword);
const typeImage = getArchiveTypeIconURL(archive.archiveType); const typeImage = getArchiveTypeIconURL(archive.archiveType);
getArchiveTemplate().then(function (archiveTemplate) { getArchiveTemplate().then(function (archiveTemplate) {
......
...@@ -18,17 +18,17 @@ CHAT_ADD_USER.searchUser = function (keyword) { ...@@ -18,17 +18,17 @@ CHAT_ADD_USER.searchUser = function (keyword) {
//全グループ検索画面 //全グループ検索画面
if (isAllGroup) { if (isAllGroup) {
//グループデータ検索 //グループデータ検索
const groupList = CHAT_DB.getGroupByName(keyword); const groupList = NativeBridgeDataSource.getGroupByName(keyword);
searchGroupData(groupList, overlayMessage); searchGroupData(groupList, overlayMessage);
//ユーザデータ検索 //ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword); var userList = NativeBridgeDataSource.getAllGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList, overlayMessage); searchUserData(userList, overlayMessage);
hasNoData = userList.length == 0 && groupList.length == 0; hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面 //連絡先画面
} else { } else {
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword); var userList = NativeBridgeDataSource.getMyGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList, overlayMessage); searchUserData(userList, overlayMessage);
hasNoData = userList.length == 0; hasNoData = userList.length == 0;
} }
......
// ios用
function callNativeApp(iosKey, jsonData) {
console.log("callNativeApp called");
var result;
try {
var key = iosKey;
var data = jsonData;
var payload = { key: key, data: data };
// payloadの形 {"type":"SJbridge","data":{"name":"abc","role":"dev"}}
// resにObjective-cからのレスポンスが返る
result = prompt(JSON.stringify(payload));
console.log(result);
} catch (err) {
console.log("The native context does not exist yet");
}
return result;
}
CHAT_DB.getBeforeRoomType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getBeforeRoomType, {});
}
};
CHAT_DB.getRoomType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getRoomType, {}), 10);
}
};
CHAT_DB.removeFavoriteUser = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.addFavoriteUser = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.getCollaborationJoinFlg = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getCollaborationJoinFlg, {});
}
};
CHAT_DB.getUserInfoList = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getUserInfoList, {
shopMemberId: shopMemberId,
});
}
};
CHAT_DB.createContentView = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.createContentView, {}));
}
};
CHAT_DB.getToMoveGroupId = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getToMoveGroupId, {});
}
};
CHAT_DB.getJoinCollaborationType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(
callNativeApp(NATIVE_KEY_IOS.getJoinCollaborationType, {}),
10
);
}
};
CHAT_DB.getHostRequestFlg = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getHostRequestFlg, {}), 10);
}
};
// 名前空間
var CHAT_DB = {};
//ロカールDBからルーム一覧情報を取得
CHAT_DB.getRoomList = function (roomType, keyWord) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getRoomList, {
roomType: roomType,
keyWord: keyWord,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getRoomList(roomType, keyWord));
}
};
CHAT_DB.callGetRoomList = function (roomType) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getRoomList, { roomType: roomType })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getRoomList(roomType));
}
};
//ロカールDBからログインしたユーザのデータを取得する。
CHAT_DB.getMyInfo = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getMyInfo, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyInfo());
}
};
CHAT_DB.getMessages = function (roomId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessages, { roomId: roomId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMessageList(roomId));
}
};
CHAT_DB.getMessagesWithMessageId = function (messageId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessageListFromMessageId, {
messageId: messageId
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getMessageListFromMessageId(messageId));
}
};
CHAT_DB.getFavoriteUsersNotInRoom = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getFavoriteUsersNotInRoom, {})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsersNotInRoom());
}
};
CHAT_DB.getFavoriteUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getFavoriteUsers, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsers());
}
};
CHAT_DB.getFavoriteGroups = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getFavoriteGroups, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteGroups());
}
};
CHAT_DB.getMyGroupUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getMyGroupUsers, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsers());
}
};
CHAT_DB.getGroupInfo = function (groupId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupInfo, { groupId: groupId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfo(groupId));
}
};
CHAT_DB.getGroupInfoForAddUser = function (groupId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupInfoForAddUser, { groupId: groupId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfoForAddUser(groupId));
}
};
CHAT_DB.loadSelectedUsers = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getSelectedUserList, {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
console.log(JSON.parse(android.getSelectedUserList()));
return JSON.parse(android.getSelectedUserList());
}
};
CHAT_DB.getNameCardData = function (shopMemberId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getNameCardData, {
shopMemberId: shopMemberId,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getNameCardData(shopMemberId));
}
};
CHAT_DB.getMyGroupShopMemberByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupShopMemberByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupShopMemberByName(shopMemberName));
}
};
CHAT_DB.getMyGroupShopMemberNotInRoomByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupShopMemberNotInRoomByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(
android.getMyGroupShopMemberNotInRoomByName(shopMemberName)
);
}
};
CHAT_DB.getAllGroupShopMemberByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getAllGroupShopMemberByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getAllGroupShopMemberByName(shopMemberName));
}
};
CHAT_DB.getAllGroupShopMemberNotInRoomByName = function (shopMemberName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getAllGroupShopMemberNotInRoomByName, {
shopMemberName: shopMemberName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(
android.getAllGroupShopMemberNotInRoomByName(shopMemberName)
);
}
};
CHAT_DB.getGroupByName = function (groupName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getGroupByName, { groupName: groupName })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupByName(groupName));
}
};
CHAT_DB.getUsersInRoom = function (roomId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUsersInRoom, { roomId: roomId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getUsersInRoom(roomId));
}
};
// アーカイブ一覧
CHAT_DB.getArchiveList = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp(NATIVE_KEY_IOS.getArchiveList, {}));
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveList());
}
};
// アーカイブ一覧検索
CHAT_DB.getArchiveByName = function (archiveName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getArchiveByName, {
archiveName: archiveName,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveListByName(archiveName));
}
};
// アーカイブ詳細
CHAT_DB.getArchiveDetail = function (archiveId) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getArchiveDetail, { archiveId: archiveId })
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getArchiveDetail(archiveId));
}
};
CHAT_DB.searchMessages = function (keyword, userList) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.searchMessages, {
keyWord: keyword,
userList: userList,
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.searchMessages(keyword, userList));
}
};
CHAT_DB.getMyGroupUsersNotInRoom = function () {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMyGroupUsersNotInRoom, {})
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsersNotInRoom());
}
};
CHAT_DB.getUserInfo = function (shopMemberId) {
if (shopMemberId == "") {
return;
}
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserInfo, { shopMemberId: shopMemberId })
);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getUserInfo(shopMemberId));
}
};
CHAT_DB.getUserListByLoginId = function (loginIdList) {
console.log(loginIdList);
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserListByLoginId, {
loginIdList: loginIdList.join(","),
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getUserListByLoginId(loginIdList.join(",")));
}
};
...@@ -14,7 +14,7 @@ window.onscroll = function () { ...@@ -14,7 +14,7 @@ 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");
NativeBridgeDelegate.updatePreMessage(messageId); NativeBridgeDelegate.updatePreMessage(messageId);
let messages = CHAT_DB.getMessagesWithMessageId(messageId); let messages = NativeBridgeDataSource.getMessagesWithMessageId(messageId);
CHAT_UI.prependMessage(messages); CHAT_UI.prependMessage(messages);
loader.remove(); loader.remove();
var afterHeight = $(".room_container").height(); var afterHeight = $(".room_container").height();
......
...@@ -45,7 +45,7 @@ CHAT_UI.refreshJoinedCollaboration = function (loginIdList) { ...@@ -45,7 +45,7 @@ CHAT_UI.refreshJoinedCollaboration = function (loginIdList) {
} }
); );
var joinedUserList = CHAT_DB.getUserListByLoginId(loginIdList); var joinedUserList = NativeBridgeDataSource.getUserListByLoginId(loginIdList);
var sortedUserList = new Array(); var sortedUserList = new Array();
loginIdList.forEach(function (userId) { loginIdList.forEach(function (userId) {
...@@ -98,7 +98,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () { ...@@ -98,7 +98,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
NativeBridgeDelegate.updateContactInfo(); NativeBridgeDelegate.updateContactInfo();
//お気に入りグループ取得。 //お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups(); var favoriteGroupList = NativeBridgeDataSource.getFavoriteGroups();
favoriteGroupList.forEach(function (favoriteGroup) { favoriteGroupList.forEach(function (favoriteGroup) {
let html = Mustache.render(groupTemplate, { let html = Mustache.render(groupTemplate, {
name: favoriteGroup.groupName, name: favoriteGroup.groupName,
...@@ -109,7 +109,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () { ...@@ -109,7 +109,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
$("#favoriteListForAddUserInCollaboration").append(obj); $("#favoriteListForAddUserInCollaboration").append(obj);
}); });
//お気に入りユーザ取得。 //お気に入りユーザ取得。
var favoriteUserList = CHAT_DB.getFavoriteUsersNotInRoom(); var favoriteUserList = NativeBridgeDataSource.getFavoriteUsersNotInRoom();
favoriteUserList.forEach(function (favoriteUser) { favoriteUserList.forEach(function (favoriteUser) {
favoriteUser.profileUrl = CHAT.getProfileImgUrl(favoriteUser.profileUrl); favoriteUser.profileUrl = CHAT.getProfileImgUrl(favoriteUser.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) { let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
...@@ -125,7 +125,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () { ...@@ -125,7 +125,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$("#favoriteListForAddUserInCollaboration").append(obj); $("#favoriteListForAddUserInCollaboration").append(obj);
var myGroupList = CHAT_DB.getMyGroupUsersNotInRoom(); var myGroupList = NativeBridgeDataSource.getMyGroupUsersNotInRoom();
myGroupList.forEach(function (myGroup) { myGroupList.forEach(function (myGroup) {
myGroup.groupUserList.forEach(function (groupUser) { myGroup.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl); groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl);
...@@ -164,7 +164,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) { ...@@ -164,7 +164,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) {
$("#groupPathAreaForAddUserInCollaboration").html(""); $("#groupPathAreaForAddUserInCollaboration").html("");
//DBからグループ情報を取得。 //DBからグループ情報を取得。
var result = CHAT_DB.getGroupInfoForAddUser(groupId); var result = NativeBridgeDataSource.getGroupInfoForAddUser(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。 //上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") { if (typeof result.parentGroupId !== "undefined") {
$("#parentGroupBtnForAddUserInCollaboration").on("click", function () { $("#parentGroupBtnForAddUserInCollaboration").on("click", function () {
...@@ -244,7 +244,7 @@ CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) { ...@@ -244,7 +244,7 @@ CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) {
if (CHAT.globalLoginParameter.shopMemberId == shopMemberId) { if (CHAT.globalLoginParameter.shopMemberId == shopMemberId) {
return; return;
} }
var nameCardInfo = CHAT_DB.getNameCardData(shopMemberId); var nameCardInfo = NativeBridgeDataSource.getNameCardData(shopMemberId);
var namecardTemplate; var namecardTemplate;
var changeHostTemplate; var changeHostTemplate;
...@@ -280,32 +280,22 @@ CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) { ...@@ -280,32 +280,22 @@ CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) {
CHAT_UI.removeFavoriteUserInCollaboration = function (shopMemberId) { CHAT_UI.removeFavoriteUserInCollaboration = function (shopMemberId) {
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
$("#userNameCardInCollaboration").modal("hide"); $("#userNameCardInCollaboration").modal("hide");
var result; NativeBridgeDataSource.removeFavoriteUser(shopMemberId);
if (typeof android != "undefined") {
result = android.removeFavoriteUser(shopMemberId);
} else {
result = CHAT_DB.removeFavoriteUser(shopMemberId);
}
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}; };
CHAT_UI.insertFavoriteUserInCollaboration = function (shopMemberId) { CHAT_UI.insertFavoriteUserInCollaboration = function (shopMemberId) {
$("#userNameCardInCollaboration").modal("hide"); $("#userNameCardInCollaboration").modal("hide");
var result; NativeBridgeDataSource.addFavoriteUser(shopMemberId);
if (typeof android != "undefined") {
result = android.addFavoriteUser(shopMemberId);
} else {
result = CHAT_DB.addFavoriteUser(shopMemberId);
}
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}; };
CHAT_UI.confirmInviteUserListInCollaboration = function () { CHAT_UI.confirmInviteUserListInCollaboration = function () {
var selectedUsers = CHAT_DB.loadSelectedUsers(); var selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") { if (selectedUsers != "") {
$("#selectedUserListinCollaboration").html(""); $("#selectedUserListinCollaboration").html("");
var selectedUserList = CHAT_DB.loadSelectedUsers(); var selectedUserList = NativeBridgeDataSource.loadSelectedUsers();
selectedUserList.forEach(function (user) { selectedUserList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
}); });
......
...@@ -140,10 +140,8 @@ CHAT_UTIL.getCoviewTypeFromCollaborationType = function ( ...@@ -140,10 +140,8 @@ CHAT_UTIL.getCoviewTypeFromCollaborationType = function (
) { ) {
switch (joinCollaborationType) { switch (joinCollaborationType) {
case COLLABORATION_TYPE.AUDIO: case COLLABORATION_TYPE.AUDIO:
console.log(CollaborationTypeKey.AUDIO);
return CollaborationTypeKey.AUDIO; return CollaborationTypeKey.AUDIO;
case COLLABORATION_TYPE.CAMERA: case COLLABORATION_TYPE.CAMERA:
console.log(CollaborationTypeKey.CAMERA);
return CollaborationTypeKey.CAMERA; return CollaborationTypeKey.CAMERA;
case COLLABORATION_TYPE.VIDEO: case COLLABORATION_TYPE.VIDEO:
return CollaborationTypeKey.VIDEO; return CollaborationTypeKey.VIDEO;
......
...@@ -570,7 +570,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -570,7 +570,7 @@ document.addEventListener("DOMContentLoaded", function () {
if (keyword.length == 1) { if (keyword.length == 1) {
return; return;
} }
const messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(",")); const messages = NativeBridgeDataSource.searchMessages(keyword, checkedUserList.join(","));
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE); var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE); var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
...@@ -631,7 +631,7 @@ var getCheckedUserList = function () { ...@@ -631,7 +631,7 @@ var getCheckedUserList = function () {
CHAT.searchRoom = function (keyword, rooms) { CHAT.searchRoom = function (keyword, rooms) {
const overlayMessage = $(".overlay_src_msg"); const overlayMessage = $(".overlay_src_msg");
overlayMessage.empty(); overlayMessage.empty();
rooms = CHAT_DB.getRoomList(ChatRoomType.ALL, keyword); rooms = NativeBridgeDataSource.getRoomList(ChatRoomType.ALL, keyword);
let roomListTitle = getLocalizedString("room_search_placeholder"); let roomListTitle = getLocalizedString("room_search_placeholder");
$("#chatTitle").text(roomListTitle); $("#chatTitle").text(roomListTitle);
...@@ -716,7 +716,7 @@ CHAT.searchMessage = function (keyword, workVal) { ...@@ -716,7 +716,7 @@ CHAT.searchMessage = function (keyword, workVal) {
const selectedUser = $(".img_wrap.filter")[user]; const selectedUser = $(".img_wrap.filter")[user];
checkedUserList.push($(selectedUser).data("user-id")); checkedUserList.push($(selectedUser).data("user-id"));
}); });
var messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(",")); var messages = NativeBridgeDataSource.searchMessages(keyword, checkedUserList.join(","));
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE); var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE); var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
......
...@@ -19,7 +19,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) { ...@@ -19,7 +19,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
//全グループ検索画面 //全グループ検索画面
if (isAllGroup) { if (isAllGroup) {
//グループデータ検索 //グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword); var groupList = NativeBridgeDataSource.getGroupByName(keyword);
var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST); var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
groupList.forEach(function (group) { groupList.forEach(function (group) {
...@@ -29,7 +29,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) { ...@@ -29,7 +29,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
}); });
//ユーザデータ検索 //ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword); var userList = NativeBridgeDataSource.getAllGroupShopMemberByName(keyword);
searchUserData(userList); searchUserData(userList);
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST); var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList); let html = renderUser(userTemplate, userList);
...@@ -38,7 +38,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) { ...@@ -38,7 +38,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
hasNoData = groupList.length == 0 && userList.length == 0; hasNoData = groupList.length == 0 && userList.length == 0;
//連絡先画面 //連絡先画面
} else { } else {
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword); const userList = NativeBridgeDataSource.getMyGroupShopMemberByName(keyword);
searchUserData(userList); searchUserData(userList);
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST); var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList); let html = renderUser(userTemplate, userList);
......
...@@ -19,17 +19,17 @@ CONTACT.searchUser = function (keyword) { ...@@ -19,17 +19,17 @@ CONTACT.searchUser = function (keyword) {
//全グループ検索画面 //全グループ検索画面
if (isAllGroup) { if (isAllGroup) {
//グループデータ検索 //グループデータ検索
const groupList = CHAT_DB.getGroupByName(keyword); const groupList = NativeBridgeDataSource.getGroupByName(keyword);
groupDataSearch(groupList); groupDataSearch(groupList);
//ユーザデータ検索 //ユーザデータ検索
const userList = CHAT_DB.getAllGroupShopMemberByName(keyword); const userList = NativeBridgeDataSource.getAllGroupShopMemberByName(keyword);
userDataSearch(userList); userDataSearch(userList);
hasNoData = userList.length == 0 && groupList.length == 0; hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面 //連絡先画面
} else { } else {
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword); const userList = NativeBridgeDataSource.getMyGroupShopMemberByName(keyword);
userDataSearch(userList); userDataSearch(userList);
hasNoData = userList.length == 0; hasNoData = userList.length == 0;
......
...@@ -414,11 +414,7 @@ document.addEventListener("DOMContentLoaded", function () { ...@@ -414,11 +414,7 @@ document.addEventListener("DOMContentLoaded", function () {
globalUserInfo.coWorkType globalUserInfo.coWorkType
); );
if (isDocument) { if (isDocument) {
if (CHAT_UTIL.isIOS()) { meetingId = NativeBridgeDataSource.createContentView();
meetingId = CHAT_DB.createContentView();
} else if (CHAT_UTIL.isAndroid()) {
meetingId = android.createContentView();
}
joinMeetingId = meetingId; joinMeetingId = meetingId;
} }
} else if (collaborationJoinFlg == "2") { } else if (collaborationJoinFlg == "2") {
...@@ -571,12 +567,7 @@ function changeCollaboration(changeCollaborationType) { ...@@ -571,12 +567,7 @@ function changeCollaboration(changeCollaborationType) {
break; break;
case COLLABORATION_TYPE.DOCUMENT: case COLLABORATION_TYPE.DOCUMENT:
coview_api.ChangeCollaboration("audio"); coview_api.ChangeCollaboration("audio");
if (CHAT_UTIL.isIOS()) { newMeetingId = NativeBridgeDataSource.createContentView();
newMeetingId = CHAT_DB.createContentView();
} else if (CHAT_UTIL.isAndroid()) {
newMeetingId = android.createContentView();
console.log("newMeetingId = " + newMeetingId);
}
break; break;
case COLLABORATION_TYPE.BOARD: case COLLABORATION_TYPE.BOARD:
coview_api.ChangeCollaboration("audio"); coview_api.ChangeCollaboration("audio");
...@@ -742,12 +733,7 @@ function applyForHostChange() { ...@@ -742,12 +733,7 @@ function applyForHostChange() {
alert(getLocalizedString("not_support_version")); alert(getLocalizedString("not_support_version"));
return; return;
} }
var hostRequestFlg = 0; const hostRequestFlg = NativeBridgeDataSource.getHostRequestFlg();
if (CHAT_UTIL.isAndroid()) {
hostRequestFlg = android.getHostRequestFlg();
} else {
hostRequestFlg = CHAT_DB.getHostRequestFlg();
}
if (hostRequestFlg == HostRequestFlag.DOING) { if (hostRequestFlg == HostRequestFlag.DOING) {
alert(getLocalizedString("already_processing_host_request")); alert(getLocalizedString("already_processing_host_request"));
return; return;
......
...@@ -59,7 +59,7 @@ var addCollaborationMessage = function ( ...@@ -59,7 +59,7 @@ var addCollaborationMessage = function (
) { ) {
const collaborationType = messageInfo[2]; const collaborationType = messageInfo[2];
const meetingID = getMeetingID(collaborationType, messageInfo); const meetingID = getMeetingID(collaborationType, messageInfo);
const userInCollaboration = getUserInfoList(userID); const userInCollaboration = JSON.parse(NativeBridgeDataSource.getUserInfoList(userID));
userInCollaboration.forEach(function (user) { userInCollaboration.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
...@@ -120,7 +120,9 @@ var renderCollaborationMessage = function ( ...@@ -120,7 +120,9 @@ var renderCollaborationMessage = function (
var addTextMessage = function (messageText, message, socketID) { var addTextMessage = function (messageText, message, socketID) {
const messageTextWithSID = insertSID(messageText); const messageTextWithSID = insertSID(messageText);
const messageSender = getUserInfoList(message.userId); const messageSender = JSON.parse(
NativeBridgeDataSource.getUserInfoList(message.userId)
);
const shopMemberName = messageSender[0].shopMemberName; const shopMemberName = messageSender[0].shopMemberName;
const textMessageTemplate = getTextMessageTemplate(message.id === socketID); const textMessageTemplate = getTextMessageTemplate(message.id === socketID);
const profileImagePath = CHAT.getProfileImgUrl(message.profileImagePath); const profileImagePath = CHAT.getProfileImgUrl(message.profileImagePath);
...@@ -164,11 +166,7 @@ var renderTextMessage = function ( ...@@ -164,11 +166,7 @@ var renderTextMessage = function (
}; };
var getUserInfoList = function (userID) { var getUserInfoList = function (userID) {
if (CHAT_UTIL.isIOS()) { return JSON.parse(NativeBridgeDataSource.getUserInfoList(userID));
return JSON.parse(CHAT_DB.getUserInfoList(userID));
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getUserInfoList(userID));
}
}; };
var cleanUpCollaborationMessage = function () { var cleanUpCollaborationMessage = function () {
......
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