Commit b952b542 by Kim Peace

Divded all delegates and datasource from native value

parent 91c488ee
......@@ -108,11 +108,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<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-ui.js"></script>
......
......@@ -17,21 +17,6 @@
<link rel="stylesheet" href="./css/font-awesome.css">
</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>
<!-- ナビメニュー -->
......@@ -81,12 +66,12 @@
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<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-ui.js"></script>
<script src="./js/archive.js"></script>
<!-- Template archive-detail -->
......@@ -215,6 +200,22 @@
CHAT_UI.refreshArchiveDetailScreen(archiveId);
};
</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>
</html>
\ No newline at end of file
......@@ -114,11 +114,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<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-ui.js"></script>
......
......@@ -142,11 +142,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<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-ui.js"></script>
......@@ -174,8 +173,9 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_DB.loadSelectedUsers() != "") {
let selectedUsers = CHAT_DB.loadSelectedUsers();
const selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") {
selectedUsers.forEach(function (user) {
CHAT.globalSelectedUserList.push(user.shopMemberId);
})
......
......@@ -72,12 +72,11 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/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/common/loading.js"></script>
......
......@@ -71,11 +71,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<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-ui.js"></script>
......
......@@ -143,11 +143,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<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-ui.js"></script>
......@@ -176,8 +175,8 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_DB.loadSelectedUsers() != "") {
let selectedUsers = CHAT_DB.loadSelectedUsers();
if (NativeBridgeDataSource.loadSelectedUsers() != "") {
let selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
selectedUsers.forEach(function (user) {
CHAT.globalSelectedUserList.push(user.shopMemberId);
})
......
......@@ -79,11 +79,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<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-ui.js"></script>
......
......@@ -160,11 +160,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......
......@@ -141,11 +141,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -203,12 +202,11 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
joinCollaborationType = CHAT_DB.getJoinCollaborationType();
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
joinCollaborationType = android.getJoinCollaborationType();
collaborationJoinFlg = android.getCollaborationJoinFlg();
joinCollaborationType = NativeBridgeDataSource.getJoinCollaborationType();
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
if (CHAT_UTIL.isAndroid()) {
androidVersion = android.getAndroidVersion();
if (joinCollaborationType == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) {
alert(getLocalizedString('not_support_version'));
......@@ -222,8 +220,7 @@
globalUserInfo.coWorkType = CHAT_UTIL.getCoviewTypeFromCollaborationType(joinCollaborationType);
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
}
};
</script>
......
......@@ -84,11 +84,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -131,16 +130,11 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
}
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.DOCUMENT;
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
};
</script>
</body>
......
......@@ -145,11 +145,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -194,17 +193,12 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.CAMERA;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
}
};
</script>
......
......@@ -135,11 +135,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -185,17 +184,12 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.VIDEO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
}
};
</script>
......
......@@ -80,11 +80,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -129,17 +128,12 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
}
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.AUDIO;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
}
};
</script>
......
......@@ -137,11 +137,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<script src="./js/chat-db.js"></script>
<script src="./js/chat-db-foriOS.js"></script>
<!-- Socket -->
<script src="./js/sockets/chat-websocket.js"></script>
<script src="./js/sockets/chat-websocket-message.js"></script>
......@@ -187,16 +186,12 @@
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
}
collaborationJoinFlg = NativeBridgeDataSource.getCollaborationJoinFlg();
globalUserInfo.coWorkType = CollaborationTypeKey.BOARD;
if (collaborationJoinFlg != '2') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function () {
});
socket.emit('join', CHAT.globalLoginParameter, function () { });
}
};
</script>
......
......@@ -191,11 +191,10 @@
<script src="./js/languages/language_en.js" charset="UTF-8"></script>
<!-- Common -->
<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/chat-util.js"></script>
<!-- Model -->
<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-ui.js"></script>
......@@ -225,14 +224,10 @@
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
let groupId;
if (typeof (android) != "undefined") {
groupId = android.getToMoveGroupId();
} else {
groupId = CHAT_DB.getToMoveGroupId();
}
if (groupId != "" && groupId != undefined) {
CHAT_UI.refreshAllGroupSearch(groupId);
const groupID = NativeBridgeDataSource.getToMoveGroupId();
if (groupID != "" && groupID != undefined) {
CHAT_UI.refreshAllGroupSearch(groupID);
NativeBridgeDelegate.setToMoveGroupId("");
} else {
CHAT_UI.refreshContactScreen();
......
......@@ -9,7 +9,7 @@ document.addEventListener("DOMContentLoaded", function () {
});
ARCHIVE_UI.refreshSearchScreen = function (keyword) {
const archiveList = CHAT_DB.getArchiveByName(keyword);
const archiveList = NativeBridgeDataSource.getArchiveByName(keyword);
const typeImage = getArchiveTypeIconURL(archive.archiveType);
getArchiveTemplate().then(function (archiveTemplate) {
......
......@@ -18,17 +18,17 @@ CHAT_ADD_USER.searchUser = function (keyword) {
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
const groupList = CHAT_DB.getGroupByName(keyword);
const groupList = NativeBridgeDataSource.getGroupByName(keyword);
searchGroupData(groupList, overlayMessage);
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword);
var userList = NativeBridgeDataSource.getAllGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList, overlayMessage);
hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面
} else {
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
var userList = NativeBridgeDataSource.getMyGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList, overlayMessage);
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 () {
$("#messages").prepend(loader);
const messageId = $($(".chat_message").get(0)).data("messageid");
NativeBridgeDelegate.updatePreMessage(messageId);
let messages = CHAT_DB.getMessagesWithMessageId(messageId);
let messages = NativeBridgeDataSource.getMessagesWithMessageId(messageId);
CHAT_UI.prependMessage(messages);
loader.remove();
var afterHeight = $(".room_container").height();
......
......@@ -45,7 +45,7 @@ CHAT_UI.refreshJoinedCollaboration = function (loginIdList) {
}
);
var joinedUserList = CHAT_DB.getUserListByLoginId(loginIdList);
var joinedUserList = NativeBridgeDataSource.getUserListByLoginId(loginIdList);
var sortedUserList = new Array();
loginIdList.forEach(function (userId) {
......@@ -98,7 +98,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
NativeBridgeDelegate.updateContactInfo();
//お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups();
var favoriteGroupList = NativeBridgeDataSource.getFavoriteGroups();
favoriteGroupList.forEach(function (favoriteGroup) {
let html = Mustache.render(groupTemplate, {
name: favoriteGroup.groupName,
......@@ -109,7 +109,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
$("#favoriteListForAddUserInCollaboration").append(obj);
});
//お気に入りユーザ取得。
var favoriteUserList = CHAT_DB.getFavoriteUsersNotInRoom();
var favoriteUserList = NativeBridgeDataSource.getFavoriteUsersNotInRoom();
favoriteUserList.forEach(function (favoriteUser) {
favoriteUser.profileUrl = CHAT.getProfileImgUrl(favoriteUser.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function (shopMemberId) {
......@@ -125,7 +125,7 @@ CHAT_UI.refreshMyGroupForAddUserInCollaboration = function () {
let obj = jQuery.parseHTML(html);
$("#favoriteListForAddUserInCollaboration").append(obj);
var myGroupList = CHAT_DB.getMyGroupUsersNotInRoom();
var myGroupList = NativeBridgeDataSource.getMyGroupUsersNotInRoom();
myGroupList.forEach(function (myGroup) {
myGroup.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl);
......@@ -164,7 +164,7 @@ CHAT_UI.refreshAllGroupForAddUserInCollaboration = function (paramGroupId) {
$("#groupPathAreaForAddUserInCollaboration").html("");
//DBからグループ情報を取得。
var result = CHAT_DB.getGroupInfoForAddUser(groupId);
var result = NativeBridgeDataSource.getGroupInfoForAddUser(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== "undefined") {
$("#parentGroupBtnForAddUserInCollaboration").on("click", function () {
......@@ -244,7 +244,7 @@ CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) {
if (CHAT.globalLoginParameter.shopMemberId == shopMemberId) {
return;
}
var nameCardInfo = CHAT_DB.getNameCardData(shopMemberId);
var nameCardInfo = NativeBridgeDataSource.getNameCardData(shopMemberId);
var namecardTemplate;
var changeHostTemplate;
......@@ -280,32 +280,22 @@ CHAT_UI.makeNameCardInCollaboration = function (shopMemberId) {
CHAT_UI.removeFavoriteUserInCollaboration = function (shopMemberId) {
CHAT_UI.showLoadingIndicator();
$("#userNameCardInCollaboration").modal("hide");
var result;
if (typeof android != "undefined") {
result = android.removeFavoriteUser(shopMemberId);
} else {
result = CHAT_DB.removeFavoriteUser(shopMemberId);
}
NativeBridgeDataSource.removeFavoriteUser(shopMemberId);
CHAT_UI.dismissLoadingIndicator();
};
CHAT_UI.insertFavoriteUserInCollaboration = function (shopMemberId) {
$("#userNameCardInCollaboration").modal("hide");
var result;
if (typeof android != "undefined") {
result = android.addFavoriteUser(shopMemberId);
} else {
result = CHAT_DB.addFavoriteUser(shopMemberId);
}
NativeBridgeDataSource.addFavoriteUser(shopMemberId);
CHAT_UI.dismissLoadingIndicator();
};
CHAT_UI.confirmInviteUserListInCollaboration = function () {
var selectedUsers = CHAT_DB.loadSelectedUsers();
var selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
if (selectedUsers != "") {
$("#selectedUserListinCollaboration").html("");
var selectedUserList = CHAT_DB.loadSelectedUsers();
var selectedUserList = NativeBridgeDataSource.loadSelectedUsers();
selectedUserList.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
......
......@@ -140,10 +140,8 @@ CHAT_UTIL.getCoviewTypeFromCollaborationType = function (
) {
switch (joinCollaborationType) {
case COLLABORATION_TYPE.AUDIO:
console.log(CollaborationTypeKey.AUDIO);
return CollaborationTypeKey.AUDIO;
case COLLABORATION_TYPE.CAMERA:
console.log(CollaborationTypeKey.CAMERA);
return CollaborationTypeKey.CAMERA;
case COLLABORATION_TYPE.VIDEO:
return CollaborationTypeKey.VIDEO;
......
......@@ -570,7 +570,7 @@ document.addEventListener("DOMContentLoaded", function () {
if (keyword.length == 1) {
return;
}
const messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(","));
const messages = NativeBridgeDataSource.searchMessages(keyword, checkedUserList.join(","));
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
......@@ -631,7 +631,7 @@ var getCheckedUserList = function () {
CHAT.searchRoom = function (keyword, rooms) {
const overlayMessage = $(".overlay_src_msg");
overlayMessage.empty();
rooms = CHAT_DB.getRoomList(ChatRoomType.ALL, keyword);
rooms = NativeBridgeDataSource.getRoomList(ChatRoomType.ALL, keyword);
let roomListTitle = getLocalizedString("room_search_placeholder");
$("#chatTitle").text(roomListTitle);
......@@ -716,7 +716,7 @@ CHAT.searchMessage = function (keyword, workVal) {
const selectedUser = $(".img_wrap.filter")[user];
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 myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
......
......@@ -19,7 +19,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword);
var groupList = NativeBridgeDataSource.getGroupByName(keyword);
var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
groupList.forEach(function (group) {
......@@ -29,7 +29,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
});
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
var userList = NativeBridgeDataSource.getAllGroupShopMemberByName(keyword);
searchUserData(userList);
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList);
......@@ -38,7 +38,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
hasNoData = groupList.length == 0 && userList.length == 0;
//連絡先画面
} else {
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
const userList = NativeBridgeDataSource.getMyGroupShopMemberByName(keyword);
searchUserData(userList);
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList);
......
......@@ -19,17 +19,17 @@ CONTACT.searchUser = function (keyword) {
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
const groupList = CHAT_DB.getGroupByName(keyword);
const groupList = NativeBridgeDataSource.getGroupByName(keyword);
groupDataSearch(groupList);
//ユーザデータ検索
const userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
const userList = NativeBridgeDataSource.getAllGroupShopMemberByName(keyword);
userDataSearch(userList);
hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面
} else {
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
const userList = NativeBridgeDataSource.getMyGroupShopMemberByName(keyword);
userDataSearch(userList);
hasNoData = userList.length == 0;
......
......@@ -414,11 +414,7 @@ document.addEventListener("DOMContentLoaded", function () {
globalUserInfo.coWorkType
);
if (isDocument) {
if (CHAT_UTIL.isIOS()) {
meetingId = CHAT_DB.createContentView();
} else if (CHAT_UTIL.isAndroid()) {
meetingId = android.createContentView();
}
meetingId = NativeBridgeDataSource.createContentView();
joinMeetingId = meetingId;
}
} else if (collaborationJoinFlg == "2") {
......@@ -571,12 +567,7 @@ function changeCollaboration(changeCollaborationType) {
break;
case COLLABORATION_TYPE.DOCUMENT:
coview_api.ChangeCollaboration("audio");
if (CHAT_UTIL.isIOS()) {
newMeetingId = CHAT_DB.createContentView();
} else if (CHAT_UTIL.isAndroid()) {
newMeetingId = android.createContentView();
console.log("newMeetingId = " + newMeetingId);
}
newMeetingId = NativeBridgeDataSource.createContentView();
break;
case COLLABORATION_TYPE.BOARD:
coview_api.ChangeCollaboration("audio");
......@@ -742,12 +733,7 @@ function applyForHostChange() {
alert(getLocalizedString("not_support_version"));
return;
}
var hostRequestFlg = 0;
if (CHAT_UTIL.isAndroid()) {
hostRequestFlg = android.getHostRequestFlg();
} else {
hostRequestFlg = CHAT_DB.getHostRequestFlg();
}
const hostRequestFlg = NativeBridgeDataSource.getHostRequestFlg();
if (hostRequestFlg == HostRequestFlag.DOING) {
alert(getLocalizedString("already_processing_host_request"));
return;
......
......@@ -59,7 +59,7 @@ var addCollaborationMessage = function (
) {
const collaborationType = messageInfo[2];
const meetingID = getMeetingID(collaborationType, messageInfo);
const userInCollaboration = getUserInfoList(userID);
const userInCollaboration = JSON.parse(NativeBridgeDataSource.getUserInfoList(userID));
userInCollaboration.forEach(function (user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
......@@ -120,7 +120,9 @@ var renderCollaborationMessage = function (
var addTextMessage = function (messageText, message, socketID) {
const messageTextWithSID = insertSID(messageText);
const messageSender = getUserInfoList(message.userId);
const messageSender = JSON.parse(
NativeBridgeDataSource.getUserInfoList(message.userId)
);
const shopMemberName = messageSender[0].shopMemberName;
const textMessageTemplate = getTextMessageTemplate(message.id === socketID);
const profileImagePath = CHAT.getProfileImgUrl(message.profileImagePath);
......@@ -164,11 +166,7 @@ var renderTextMessage = function (
};
var getUserInfoList = function (userID) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(CHAT_DB.getUserInfoList(userID));
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getUserInfoList(userID));
}
return JSON.parse(NativeBridgeDataSource.getUserInfoList(userID));
};
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