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,43 +11,46 @@ $(function() { ...@@ -8,43 +11,46 @@ $(function() {
return; return;
} }
// 検索 // 検索結果を表示
var archiveList = CHAT_DB.getArchiveByName(keyword); CHAT_DB.callGetArchiveByName(keyword);
var archiveTemplate; });
$.get({ url: "./template/template_archive_list.html", async: false } });
, function(text) {
archiveTemplate = text;
});
archiveList.forEach(function(archive) { ARCHIVE_UI.refreshSearchScreen = function(keyword) {
var typeImage = ""; var archiveList = CHAT_DB.getArchiveByName(keyword);
switch(archive.archiveType) { var archiveTemplate;
case 0: // 画像 $.get({ url: "./template/template_archive_list.html", async: false }
typeImage = "icon/icon_collabo_picture.png"; , function(text) {
break; archiveTemplate = text;
case 1: // 動画 });
typeImage = "icon/icon_collabo_videocam.png";
break;
case 2: // 音声
typeImage = "icon/icon_collabo_headset.png";
break;
case 3: // 文書
typeImage = "icon/icon_collabo_document.png";
break;
default: // その他
typeImage = "";
}
let html = Mustache.render(archiveTemplate, { archiveList.forEach(function(archive) {
archiveId: archive.archiveId, var typeImage = "";
fileName: archive.archiveName, switch(archive.archiveType) {
insertDate: archive.archiveDate, case 0: // 画像
typeImage: typeImage typeImage = "icon/icon_collabo_picture.png";
}); break;
case 1: // 動画
let obj = jQuery.parseHTML(html); typeImage = "icon/icon_collabo_videocam.png";
$('.overlay_src_msg').append(obj); break;
}); case 2: // 音声
typeImage = "icon/icon_collabo_headset.png";
break;
case 3: // 文書
typeImage = "icon/icon_collabo_document.png";
break;
default: // その他
typeImage = "";
}
let html = Mustache.render(archiveTemplate, {
archiveId: archive.archiveId,
fileName: archive.archiveName,
insertDate: archive.archiveDate,
typeImage: typeImage
});
let obj = jQuery.parseHTML(html);
$('.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