Commit 6e2d9b07 by Lee Munkyeong

Merge branch 'bugFix/#42198_#42198_And_search_All_Search' into 'release_sp3'

Bug fix/#42198 #42198 and search all search

See merge request !26
parents 45c0c6ba 520992c9
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
<!-- ナビメニュー --> <!-- ナビメニュー -->
<nav> <nav>
<div class="chat_room_src_form none"> <div class="chat_room_src_form none">
<form class="d-flex flex-row h-100 align-items-center"> <div class="d-flex flex-row h-100 align-items-center">
<input type="search" name="search" placeholder="ユーザー検索"> <input type="search" name="search" placeholder="ユーザー検索">
<span class="src_icon"></span> <span class="src_icon"></span>
<a href="#" class="cancel">キャンセル</a> <a href="#" class="cancel">キャンセル</a>
</form> </div>
</div> </div>
<div class="row nav_item_wrap h-100 align-items-center"> <div class="row nav_item_wrap h-100 align-items-center">
<div class="col-4 pr-0"> <div class="col-4 pr-0">
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<main id="contact"> <main id="contact">
<!-- ユーザー検索 --> <!-- ユーザー検索 -->
<div class="search_form"> <div class="search_form">
<input type="search" name="search" placeholder="ユーザー検索"> <input type="search" name="search" id="contactSearch" placeholder="ユーザー検索">
<span class="src_icon"></span> <span class="src_icon"></span>
<a href="#" class="cancel none">キャンセル</a> <a href="#" class="cancel none">キャンセル</a>
</div> </div>
......
...@@ -914,6 +914,7 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -914,6 +914,7 @@ CHAT_UI.refreshContactScreen = function() {
let contactListTitle = getLocalizedString("contactListTitle"); let contactListTitle = getLocalizedString("contactListTitle");
$('#title').text(contactListTitle); $('#title').text(contactListTitle);
// グループの様式を読み込む // グループの様式を読み込む
var groupTemplate; var groupTemplate;
$.get({ url: "./template/template_group_list.html", async: false } $.get({ url: "./template/template_group_list.html", async: false }
...@@ -1271,6 +1272,7 @@ $('#tabAllGroup').on('click', function(e) { ...@@ -1271,6 +1272,7 @@ $('#tabAllGroup').on('click', function(e) {
}); });
$('#tabMyGroup').on('click', function(e) { $('#tabMyGroup').on('click', function(e) {
$('#contactSearch').attr('placeholder', getLocalizedString('userSearch'));
CHAT_UI.refreshContactScreen(); CHAT_UI.refreshContactScreen();
}); });
...@@ -1328,13 +1330,13 @@ CHAT_UI.insertFavoriteUser = function(shopMemberId) { ...@@ -1328,13 +1330,13 @@ CHAT_UI.insertFavoriteUser = function(shopMemberId) {
$('#myNameCard').modal('hide'); $('#myNameCard').modal('hide');
var result = android.addFavoriteUser(shopMemberId); var result = android.addFavoriteUser(shopMemberId);
if (!result) { if (!result) {
$('.shopmember_'+groupId).addClass('disable'); $('.shopmember_'+shopMemberId).addClass('disable');
$('.shopmember_'+groupId).removeClass('active'); $('.shopmember_'+shopMemberId).removeClass('active');
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
return; return;
} else { } else {
$('.shopmember_'+groupId).removeClass('disable'); $('.shopmember_'+shopMemberId).removeClass('disable');
$('.shopmember_'+groupId).addClass('active'); $('.shopmember_'+shopMemberId).addClass('active');
} }
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}; };
...@@ -1373,7 +1375,7 @@ CHAT_UI.refreshAllGroupSearch = function(paramGroupId) { ...@@ -1373,7 +1375,7 @@ CHAT_UI.refreshAllGroupSearch = function(paramGroupId) {
$('.search_form form').removeClass(); $('.search_form form').removeClass();
$('.content').removeClass('none'); $('.content').removeClass('none');
$('.overlay_src_msg').empty(); $('.overlay_src_msg').empty();
$('#contactSearch').attr('placeholder', getLocalizedString('searchUserAndGroup'));
$('#tabAllGroup').prop('checked', true); $('#tabAllGroup').prop('checked', true);
//オンライン状態であればサーバから情報更新。 //オンライン状態であればサーバから情報更新。
......
...@@ -343,16 +343,19 @@ $(function() { ...@@ -343,16 +343,19 @@ $(function() {
// チャットメンバー検索 // チャットメンバー検索
$('#chat .search_form input[type="search"]').keyup(function(e){ $('#chat .search_form input[type="search"]').keyup(function(e){
var rooms;
if (e.key == "Enter" || e.KeyCode == 13) { var keyword = $('#chat .search_form input[type="search"]').val();
$('#chat .search_form input[type="search"]').blur(); if (e.KeyCode == 13 || e.key == "Enter") {
return ; if (keyword.length != 0 && keyword != '') {
$('#chat .search_form input[type="search"]').blur();
return;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return;
} }
$('.overlay_src_msg').empty(); $('.overlay_src_msg').empty();
var keyword = $('#chat .search_form input[type="search"]').val(); rooms = CHAT_DB.getRoomList(chatRoomType.ALL, keyword);
if (keyword == '' || keyword.length < 2) { return; }
var rooms = CHAT_DB.getRoomList(chatRoomType.ALL, keyword);
let roomListTitle = getLocalizedString("room_search_placeholder"); let roomListTitle = getLocalizedString("room_search_placeholder");
$('#chatTitle').text(roomListTitle); $('#chatTitle').text(roomListTitle);
var template; var template;
...@@ -360,7 +363,6 @@ $(function() { ...@@ -360,7 +363,6 @@ $(function() {
, function(text) { , function(text) {
template = text; template = text;
}); });
rooms.forEach(function(room) { rooms.forEach(function(room) {
room.profileImagePath = ASSET_PATH + 'images/user-profile.png' room.profileImagePath = ASSET_PATH + 'images/user-profile.png'
if (room.message) { if (room.message) {
...@@ -405,26 +407,34 @@ $(function() { ...@@ -405,26 +407,34 @@ $(function() {
if (CHAT_UI.isLandscapeMode()) { if (CHAT_UI.isLandscapeMode()) {
$(".chat_list").removeClass("col-12").addClass("col-6"); $(".chat_list").removeClass("col-12").addClass("col-6");
} }
if (e.KeyCode == 13 || e.key == "Enter") {
$('#chat .search_form input[type="search"]').blur();
return ;
}
}); });
// チャットルーム // チャットルーム
// メッセージ検索イベント // メッセージ検索イベント
$('.chat_room_src_form input[type="search"]').keyup(function(e){ $('.chat_room_src_form input[type="search"]').keyup(function(e){
var keyword = $('.chat_room_src_form input[type="search"]').val();
if (e.key == "Enter" || e.KeyCode == 13) { if (e.key == "Enter" || e.KeyCode == 13) {
$('.chat_room_src_form input[type="search"]').blur(); if (keyword != '' && keyword.length != 0) {
return ; $('.chat_room_src_form input[type="search"]').blur();
return;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return;
} }
let workVal = ""; let workVal = "";
var keyword = $('.chat_room_src_form input[type="search"]').val();
$('.overlay_src_msg').empty(); $('.overlay_src_msg').empty();
var checkedUserList = []; var checkedUserList = [];
$('.img_wrap.filter').each(function(user) { $('.img_wrap.filter').each(function(user) {
var selectedUser = $('.img_wrap.filter')[user]; var selectedUser = $('.img_wrap.filter')[user];
checkedUserList.push($(selectedUser).data('user-id')); checkedUserList.push($(selectedUser).data('user-id'));
}) })
if (keyword.length < 2) { return; }
var messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(',')); var messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(','));
var userMessageTemplate; var userMessageTemplate;
$.get({ url: "./template/template_user_message.html", async: false } $.get({ url: "./template/template_user_message.html", async: false }
...@@ -473,6 +483,10 @@ $(function() { ...@@ -473,6 +483,10 @@ $(function() {
noResultMsg.append(getLocalizedString("noResult")) noResultMsg.append(getLocalizedString("noResult"))
jQueryMessages.append(noResultMsg); jQueryMessages.append(noResultMsg);
} }
if (e.key == "Enter" || e.KeyCode == 13) {
$('#contact .search_form input[type="search"]').blur();
return;
}
}); });
$('.filter_img').on('click', function() { $('.filter_img').on('click', function() {
...@@ -484,7 +498,7 @@ $(function() { ...@@ -484,7 +498,7 @@ $(function() {
var selectedUser = $('.img_wrap.filter')[user]; var selectedUser = $('.img_wrap.filter')[user];
checkedUserList.push($(selectedUser).data('user-id')); checkedUserList.push($(selectedUser).data('user-id'));
}) })
if (keyword.length < 2) { return; } if (keyword.length == 1) { return; }
var messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(',')); var messages = CHAT_DB.searchMessages(keyword, checkedUserList.join(','));
var userMessageTemplate; var userMessageTemplate;
$.get({ url: "./template/template_user_message.html", async: false } $.get({ url: "./template/template_user_message.html", async: false }
......
...@@ -2,8 +2,14 @@ $(function() { ...@@ -2,8 +2,14 @@ $(function() {
// メンバー検索 // メンバー検索
$('#chatMakeRoom .search_form input[type="search"]').keyup(function(e) { $('#chatMakeRoom .search_form input[type="search"]').keyup(function(e) {
if (e.key == "Enter" || e.KeyCode == 13) { var keyword = $('#chatMakeRoom .search_form input[type="search"]').val();
$('#chatMakeRoom .search_form input[type="search"]').blur(); if (e.KeyCode == 13 || e.key == "Enter") {
if (keyword != '' && keyword.length != 0) {
$('#chatMakeRoom .search_form input[type="search"]').blur();
return false;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return false; return false;
} }
...@@ -12,11 +18,6 @@ $(function() { ...@@ -12,11 +18,6 @@ $(function() {
//全グループ検索画面 //全グループ検索画面
if (isAllGroup) { if (isAllGroup) {
var keyword = $('#chatMakeRoom .search_form input[type="search"]').val();
if (keyword == '') {
return;
}
//グループデータ検索 //グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword); var groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate; var groupTemplate;
...@@ -63,10 +64,6 @@ $(function() { ...@@ -63,10 +64,6 @@ $(function() {
} }
  //連絡先画面   //連絡先画面
} else { } else {
var keyword = $('#chatMakeRoom .search_form input[type="search"]').val();
if (keyword == '') {
return;
}
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword); var userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
var userTemplate; var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false } $.get({ url: "./template/template_make_room_user_list.html", async: false }
...@@ -92,6 +89,11 @@ $(function() { ...@@ -92,6 +89,11 @@ $(function() {
noResultMsg.append(getLocalizedString("noResult")) noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg); $('.overlay_src_msg').append(noResultMsg);
} }
}
if (e.key == "Enter" || e.KeyCode == 13) {
$('#chatMakeRoom .search_form input[type="search"]').blur();
return;
} }
}); });
}); });
$(function () { $(function () {
// メンバー検索 // メンバー検索
$('#contact .search_form input[type="search"]').keyup(function(e){ $('#contact .search_form input[type="search"]').keyup(function(e) {
var groupList;
if (e.key == "Enter" || e.KeyCode == 13) { var keyword = $('#contact .search_form input[type="search"]').val();
$('#contact .search_form input[type="search"]').blur(); if (e.key == "Enter" || e.KeyCode == 13) {
return ; if (keyword != '' && keyword.length != 0) {
} $('#contact .search_form input[type="search"]').blur();
return;
}
} else if (keyword == '' || keyword.length < 2) {
$('.overlay_src_msg').empty();
return;
}
$('.overlay_src_msg').empty();
var isAllGroup = $('#tabAllGroup').is(':checked');
//全グループ検索画面
if (isAllGroup) {
//グループデータ検索
groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate;
$.get({ url: "./template/template_group_list.html", async: false }
, function(text) {
groupTemplate = text;
});
var isAllGroup = $('#tabAllGroup').is(':checked'); groupList.forEach(function(group) {
$('.overlay_src_msg').empty(); let html = Mustache.render(groupTemplate, {
var keyword = $('#contact .search_form input[type="search"]').val(); name: group.groupName,
if (keyword == '' || keyword.length < 2) { id: group.groupId,
return; isFavorite: group.isFavorite
} });
//全グループ検索画面 let obj = jQuery.parseHTML(html);
if (isAllGroup) { $('.overlay_src_msg').append(obj);
//グループデータ検索 })
var groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate;
$.get({ url: "./template/template_group_list.html", async: false }
, function(text) {
groupTemplate = text;
});
groupList.forEach(function(group) { //ユーザデータ検索
let html = Mustache.render(groupTemplate, { var userList = CHAT_DB.getAllGroupShopMemberByName(keyword);
name: group.groupName, var userTemplate;
id: group.groupId, $.get({ url: "./template/template_user_list.html", async: false }
isFavorite: group.isFavorite , function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
let html = Mustache.render(userTemplate, {
userList: userList
}); });
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj); $('.overlay_src_msg').append(obj);
}) if (userList.length == 0 && groupList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
//ユーザデータ検索 noResultMsg.append(getLocalizedString("noResult"))
var userList = CHAT_DB.getAllGroupShopMemberByName(keyword); $('.overlay_src_msg').append(noResultMsg);
var userTemplate; }
$.get({ url: "./template/template_user_list.html", async: false } //連絡先画面
, function(text) { } else {
userTemplate = text; var userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
}); var userTemplate;
userList.forEach(function(user) { $.get({ url: "./template/template_user_list.html", async: false }
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl); , function(text) {
}); userTemplate = text;
let html = Mustache.render(userTemplate, { });
userList: userList userList.forEach(function(user) {
}); user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let obj = jQuery.parseHTML(html); });
let html = Mustache.render(userTemplate, {
$('.overlay_src_msg').append(obj); userList: userList
if (userList.length == 0 && groupList.length == 0) { });
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'}); let obj = jQuery.parseHTML(html);
noResultMsg.append(getLocalizedString("noResult")) $('.overlay_src_msg').html(obj);
$('.overlay_src_msg').append(noResultMsg); if (userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
} }
  //連絡先画面 if (e.key == "Enter" || e.KeyCode == 13) {
} else { $('#contact .search_form input[type="search"]').blur();
var keyword = $('#contact .search_form input[type="search"]').val();
if (keyword == '') {
return; return;
} }
var userList = CHAT_DB.getMyGroupShopMemberByName(keyword); });
var userTemplate;
$.get({ url: "./template/template_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
let html = Mustache.render(userTemplate, {
userList: userList
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').html(obj);
if (userList.length == 0) {
const noResultMsg = $('<div/>',{width:'auto', style:'text-align: center'});
noResultMsg.append(getLocalizedString("noResult"))
$('.overlay_src_msg').append(noResultMsg);
}
}
});
}); });
...@@ -77,5 +77,6 @@ $.lang.en = { ...@@ -77,5 +77,6 @@ $.lang.en = {
"archiveRoomName":"ChatRoom Name", "archiveRoomName":"ChatRoom Name",
"archiveSaveUser":"Save User", "archiveSaveUser":"Save User",
"archiveAttendUser":"Attend User", "archiveAttendUser":"Attend User",
"noResult":"there is no search result." "noResult":"there is no search result.",
"searchUserAndGroup":"search user and group."
} }
...@@ -77,5 +77,6 @@ $.lang.ja = { ...@@ -77,5 +77,6 @@ $.lang.ja = {
"archiveRoomName":"チャットルーム名", "archiveRoomName":"チャットルーム名",
"archiveSaveUser":"保存ユーザー", "archiveSaveUser":"保存ユーザー",
"archiveAttendUser":"参加ユーザー", "archiveAttendUser":"参加ユーザー",
"noResult":"検索結果がありませんでした。" "noResult":"検索結果がありませんでした。",
"searchUserAndGroup":"ユーザーとグループ検索"
} }
...@@ -77,5 +77,6 @@ $.lang.ko = { ...@@ -77,5 +77,6 @@ $.lang.ko = {
"archiveRoomName":"대화방 이름", "archiveRoomName":"대화방 이름",
"archiveSaveUser":"저장 사용자", "archiveSaveUser":"저장 사용자",
"archiveAttendUser":"참여자", "archiveAttendUser":"참여자",
"noResult":"검색결과가 존재하지않습니다" "noResult":"검색결과가 존재하지않습니다",
"searchUserAndGroup":"유저,그룹 검색"
} }
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