Commit f92daabd by Takatoshi Miura

db連携

parent 180fc1ea
// 名前空間
var ARCHIVE_UI = {};
$(function() { $(function() {
// アーカイブ検索 // アーカイブ検索
$('#archive .search_form input[type="search"]').keyup(function(){ $('#archive .search_form input[type="search"]').keyup(function(){
...@@ -8,7 +11,12 @@ $(function() { ...@@ -8,7 +11,12 @@ $(function() {
return; return;
} }
// 検索 // 検索結果を表示
CHAT_DB.callGetArchiveByName(keyword);
});
});
ARCHIVE_UI.refreshSearchScreen = function(keyword) {
var archiveList = CHAT_DB.getArchiveByName(keyword); var archiveList = CHAT_DB.getArchiveByName(keyword);
var archiveTemplate; var archiveTemplate;
$.get({ url: "./template/template_archive_list.html", async: false } $.get({ url: "./template/template_archive_list.html", async: false }
...@@ -45,6 +53,4 @@ $(function() { ...@@ -45,6 +53,4 @@ $(function() {
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj); $('.overlay_src_msg').append(obj);
}); });
};
});
});
...@@ -137,9 +137,27 @@ CHAT_DB.updateArchiveList = function() { ...@@ -137,9 +137,27 @@ 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()) {
iosSearchArchiveList = "";
searchWord = keyword;
webkit.messageHandlers.getArchiveByName.postMessage({keyword});
} else if (CHAT_UTIL.isAndroid()) {
ARCHIVE_UI.refreshSearchScreen(keyword);
}
};
CHAT_DB.getArchiveByName = function(archiveName) { CHAT_DB.getArchiveByName = function(archiveName) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.getArchiveByName.postMessage({archiveName});
return JSON.parse(); return JSON.parse();
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
// TODO // 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