Commit 1984f4df by Takatoshi Miura

db連携中

parent f92daabd
......@@ -5,19 +5,35 @@ var CHAT_DB = {};
//ロカールDBからルーム一覧情報を取得
CHAT_DB.getRoomList = function(roomType) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
return JSON.parse(iosRoomList);
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getRoomList(roomType));
}
};
var iosRoomList;
CHAT_DB.getIosRoomList = function(roomList) {
iosRoomList = roomList;
CHAT_DB.getRoomList(0);
};
CHAT_DB.callGetRoomList = function(roomType) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.getRoomList.postMessage({roomType});
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getRoomList(roomType));
}
}
//ロカールDBからログインしたユーザのデータを取得する。
CHAT_DB.getMyInfo = function(input) {
var result = JSON.parse(android.getMyInfo());
CHAT.globalLoginParameter.shopMemberId = result.shopMemberId;
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return result;
......@@ -107,10 +123,6 @@ CHAT_DB.getGroupByName = function(groupName) {
// アーカイブ一覧
var iosArchiveList;
getIosArchiveList = function(archiveList) {
iosArchiveList = archiveList;
CHAT_UI.refreshArchiveScreen();
};
CHAT_DB.callGetArchiveList = function() {
if (CHAT_UTIL.isIOS()) {
......@@ -121,6 +133,11 @@ CHAT_DB.callGetArchiveList = function() {
}
};
CHAT_DB.getIosArchiveList = function(archiveList) {
iosArchiveList = archiveList;
CHAT_UI.refreshArchiveScreen();
};
CHAT_DB.getArchiveList = function() {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(iosArchiveList);
......@@ -140,10 +157,6 @@ CHAT_DB.updateArchiveList = function() {
// アーカイブ一覧検索
var iosSearchArchiveList;
var searchWord;
getIosSearchArchiveList = function(archiveList) {
iosSearchArchiveList = archiveList;
ARCHIVE_UI.refreshSearchScreen(searchWord);
};
CHAT_DB.callGetArchiveByName = function(keyword) {
if (CHAT_UTIL.isIOS()) {
......@@ -155,10 +168,14 @@ CHAT_DB.callGetArchiveByName = function(keyword) {
}
};
CHAT_DB.getIosSearchArchiveList = function(archiveList) {
iosSearchArchiveList = archiveList;
ARCHIVE_UI.refreshSearchScreen(searchWord);
};
CHAT_DB.getArchiveByName = function(archiveName) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse();
return JSON.parse(iosSearchArchiveList);
} else if (CHAT_UTIL.isAndroid()) {
// TODO
}
......
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