Commit 6ee54ba1 by Lee Munkyeong

連絡先画面UI

parent c9a4a037
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<a href="#" class="cancel none">キャンセル</a> <a href="#" class="cancel none">キャンセル</a>
</form> </form>
</div> </div>
<div class="chat_list"> <div class="content chat_list">
<ul class="p-0 chat_make_room_list"> <ul class="p-0 chat_make_room_list">
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
<a href="#" data-toggle="modal" data-target="#myNameCard" style="width: 100%;"> <a href="#" data-toggle="modal" data-target="#myNameCard" style="width: 100%;">
...@@ -88,11 +88,7 @@ ...@@ -88,11 +88,7 @@
</div> </div>
</div> </div>
<div class="tab_content" id="tab2_content"> <div class="tab_content" id="tab2_content">
<div class="breadcrumb"> <div class="breadcrumb" id="groupPathArea"></div>
<a href="#" class="breadcrumb_item"><span>Root</span></a>
<a href="#" class="breadcrumb_item"><span>GroupA</span></a>
<a href="#" class="breadcrumb_item"><span>GroupASubB</span></a>
</div>
<div class="chat_list"> <div class="chat_list">
<!-- 全グループ --> <!-- 全グループ -->
<ul class="p-0 chat_make_room_list"> <ul class="p-0 chat_make_room_list">
...@@ -113,11 +109,6 @@ ...@@ -113,11 +109,6 @@
</div> </div>
</div> </div>
</a> </a>
<!--<div class="chat_item_r">
<div class="d-flex flex-column">
<span class="star disable"></span>
</div>
</div>-->
</li> </li>
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
<a href="#" class="w-100" id="parentGroupBtn"> <a href="#" class="w-100" id="parentGroupBtn">
...@@ -130,17 +121,12 @@ ...@@ -130,17 +121,12 @@
<div class="chat_item_m px-0"> <div class="chat_item_m px-0">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="chat_item_t"> <div class="chat_item_t">
<span class="chat_item_ttl">トップグループに戻る</span> <span class="chat_item_ttl">上位グループに戻る</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</a> </a>
<!--<div class="chat_item_r">
<div class="d-flex flex-column">
<span class="star disable"></span>
</div>
</div>-->
</li> </li>
<div id="childGroupListArea"> <div id="childGroupListArea">
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
...@@ -167,75 +153,7 @@ ...@@ -167,75 +153,7 @@
</div> </div>
</li> </li>
</div> </div>
<li class="d-flex align-items-center"> <div id="userInGroupList"></div>
<a href="chat_room.html" class="w-100">
<div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l">
<div class="thubnail">
<div class="img_wrap"><img src="img/thumbnail.png" alt="サムネイル画像" /></div>
</div>
</div>
<div class="chat_item_m px-0">
<div class="d-flex flex-column">
<div class="chat_item_t">
<span class="chat_item_ttl">名前太郎名前太郎名前太郎名前太郎名前太郎名前太郎名前太郎名前太郎</span>
</div>
</div>
</div>
</div>
</a>
<div class="chat_item_r">
<div class="d-flex flex-column">
<span class="star disable"></span>
</div>
</div>
</li>
<li class="d-flex align-items-center">
<a href="chat_room.html" class="w-100">
<div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l">
<div class="thubnail">
<div class="img_wrap"><img src="img/thumbnail.png" alt="サムネイル画像" /></div>
</div>
</div>
<div class="chat_item_m px-0">
<div class="d-flex flex-column">
<div class="chat_item_t">
<span class="chat_item_ttl">名前太郎名前太郎名前太郎名前太郎名前太郎名前太郎名前太郎名前太郎</span>
</div>
</div>
</div>
</div>
</a>
<div class="chat_item_r">
<div class="d-flex flex-column">
<span class="star disable"></span>
</div>
</div>
</li>
<li class="d-flex align-items-center">
<a href="chat_room.html" class="w-100">
<div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l">
<div class="thubnail">
<div class="img_wrap"><img src="img/thumbnail.png" alt="サムネイル画像" /></div>
</div>
</div>
<div class="chat_item_m px-0">
<div class="d-flex flex-column">
<div class="chat_item_t">
<span class="chat_item_ttl">名前 太郎</span>
</div>
</div>
</div>
</div>
</a>
<div class="chat_item_r">
<div class="d-flex flex-column">
<span class="star disable"></span>
</div>
</div>
</li>
</ul> </ul>
</div> </div>
</div> </div>
......
...@@ -56,7 +56,6 @@ CHAT_DB.getMyGroupUsers = function() { ...@@ -56,7 +56,6 @@ CHAT_DB.getMyGroupUsers = function() {
//TODO IOS処理追加必要 //TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn //String形式をJsonに変更してReturn
console.log(JSON.parse(android.getMyGroupUsers()));
return JSON.parse(android.getMyGroupUsers()); return JSON.parse(android.getMyGroupUsers());
} }
}; };
...@@ -78,3 +77,30 @@ CHAT_DB.getNameCardData = function(shopMemberId) { ...@@ -78,3 +77,30 @@ CHAT_DB.getNameCardData = function(shopMemberId) {
return JSON.parse(android.getNameCardData(shopMemberId)); return JSON.parse(android.getNameCardData(shopMemberId));
} }
}; };
CHAT_DB.getMyGroupShopMemberByName = function(shopMemberName) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupShopMemberByName(shopMemberName));
}
};
CHAT_DB.getAllGroupShopMemberByName = function(shopMemberName) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getAllGroupShopMemberByName(shopMemberName));
}
};
CHAT_DB.getGroupByName = function(groupName) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupByName(groupName));
}
};
...@@ -73,7 +73,7 @@ $('#roomDeleteButton').on('click', function(e) { ...@@ -73,7 +73,7 @@ $('#roomDeleteButton').on('click', function(e) {
let roomListTitle = getLocalizedString("roomListTitle") let roomListTitle = getLocalizedString("roomListTitle")
$('.titleRoomName').text(roomListTitle) $('.titleRoomName').text(roomListTitle)
$('.chat_list.active_chat').on('click', function(e){ $('.chat_list.active_chat').on('click', function(e) {
$('#pills-chat-tab').tab('show'); $('#pills-chat-tab').tab('show');
}); });
} else { } else {
...@@ -87,7 +87,7 @@ $('#roomDeleteButton').on('click', function(e) { ...@@ -87,7 +87,7 @@ $('#roomDeleteButton').on('click', function(e) {
// チャットルームの削除アイコンにクリックイベントを与える // チャットルームの削除アイコンにクリックイベントを与える
$('.deleteBox').off('click'); $('.deleteBox').off('click');
$('.deleteBox').on('click', function(e){ $('.deleteBox').on('click', function(e) {
// #36174 // #36174
let roomId = $(this).data('roomId'); let roomId = $(this).data('roomId');
let activeRoom = $(this).data('activeRoom'); let activeRoom = $(this).data('activeRoom');
...@@ -133,7 +133,7 @@ $('#room-search').on('input', function(event) { ...@@ -133,7 +133,7 @@ $('#room-search').on('input', function(event) {
}); });
//上にスクロールすると新しいメッセージを呼ぶ処理。 //上にスクロールすると新しいメッセージを呼ぶ処理。
$('#messages').scroll(function(){ $('#messages').scroll(function() {
if ($(this).scrollTop() === 0) { if ($(this).scrollTop() === 0) {
if (!$('#chatLoader').is(':visible')) { if (!$('#chatLoader').is(':visible')) {
// 現在、メッセージの個数以前をメッセージを読み込む // 現在、メッセージの個数以前をメッセージを読み込む
...@@ -150,7 +150,7 @@ $('#messages').scroll(function(){ ...@@ -150,7 +150,7 @@ $('#messages').scroll(function(){
}); });
// UIの位置調整(キーボード出現時) // UIの位置調整(キーボード出現時)
$('#message-form').on('focus', function(){ $('#message-form').on('focus', function() {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
// メッセージ入力欄の位置指定 // メッセージ入力欄の位置指定
document.querySelector('.fixed-bottom').style.bottom = 10000 + 'px'; document.querySelector('.fixed-bottom').style.bottom = 10000 + 'px';
...@@ -181,7 +181,7 @@ CHAT_UI.resetNavigationPosition = function() { ...@@ -181,7 +181,7 @@ CHAT_UI.resetNavigationPosition = function() {
// 端末の向きを記録(キーボード出現時にLandscapeModeと判定する対策) // 端末の向きを記録(キーボード出現時にLandscapeModeと判定する対策)
var isLandscape; var isLandscape;
CHAT_UI.setOrientation = function(isLandscapeMode){ CHAT_UI.setOrientation = function(isLandscapeMode) {
if (isLandscapeMode == 'false') { if (isLandscapeMode == 'false') {
$(".mesgs").removeClass("landscape_mesgs"); $(".mesgs").removeClass("landscape_mesgs");
isLandscape = false; isLandscape = false;
...@@ -192,7 +192,7 @@ CHAT_UI.setOrientation = function(isLandscapeMode){ ...@@ -192,7 +192,7 @@ CHAT_UI.setOrientation = function(isLandscapeMode){
} }
//メッセージ送信 //メッセージ送信
$('#message-form').on('keypress', function(event){ $('#message-form').on('keypress', function(event) {
if (event.which == 13) { if (event.which == 13) {
// Enterキーの処理 // Enterキーの処理
$('#message-send-btn').click(); $('#message-send-btn').click();
...@@ -200,7 +200,7 @@ $('#message-form').on('keypress', function(event){ ...@@ -200,7 +200,7 @@ $('#message-form').on('keypress', function(event){
}); });
// 送信ボタンの処理 // 送信ボタンの処理
$('#message-send-btn').on('click', function (e){ $('#message-send-btn').on('click', function(e) {
e.preventDefault(); e.preventDefault();
const messageTextBox = $('#message-form'); const messageTextBox = $('#message-form');
const message = messageTextBox.val().length > 0 ? encodeURIComponent(messageTextBox.val() + " ") : ""; const message = messageTextBox.val().length > 0 ? encodeURIComponent(messageTextBox.val() + " ") : "";
...@@ -216,24 +216,24 @@ $('#message-send-btn').on('click', function (e){ ...@@ -216,24 +216,24 @@ $('#message-send-btn').on('click', function (e){
}); });
// 写真アップロード // 写真アップロード
$('#fileUploadButton').on('click', function(){ $('#fileUploadButton').on('click', function() {
$('#imageInputTag').click(); $('#imageInputTag').click();
}); });
// 動画アップロード // 動画アップロード
$('#fileUploadButton2').on('click', function(){ $('#fileUploadButton2').on('click', function() {
$('#imageInputTag2').click(); $('#imageInputTag2').click();
}); });
$('#imageInputTag').on('change', function(){ $('#imageInputTag').on('change', function() {
$('#image-form').submit(); $('#image-form').submit();
}); });
$('#imageInputTag2').on('change', function(){ $('#imageInputTag2').on('change', function() {
$('#image-form2').submit(); $('#image-form2').submit();
}); });
$('#image-form').on('submit', function(e){ $('#image-form').on('submit', function(e) {
e.preventDefault(); e.preventDefault();
const imageInputTag = $('#imageInputTag'); const imageInputTag = $('#imageInputTag');
const file = imageInputTag.prop('files')[0]; const file = imageInputTag.prop('files')[0];
...@@ -244,7 +244,7 @@ $('#image-form').on('submit', function(e){ ...@@ -244,7 +244,7 @@ $('#image-form').on('submit', function(e){
var fd = new FormData($(this)[0]); var fd = new FormData($(this)[0]);
//画像の大きさが500pixelより大きかったら、thumbnailを生成 //画像の大きさが500pixelより大きかったら、thumbnailを生成
CHAT.createThumbnailAndUpload(file, function(resizeFile, thumbnailCreated){ CHAT.createThumbnailAndUpload(file, function(resizeFile, thumbnailCreated) {
if (resizeFile && thumbnailCreated) { if (resizeFile && thumbnailCreated) {
//ただ、画像の大きさが500pixel以下の場合はthumbnailは生成されない //ただ、画像の大きさが500pixel以下の場合はthumbnailは生成されない
fd.append('thumb', resizeFile) fd.append('thumb', resizeFile)
...@@ -257,7 +257,7 @@ $('#image-form').on('submit', function(e){ ...@@ -257,7 +257,7 @@ $('#image-form').on('submit', function(e){
} }
}); });
$('#image-form2').on('submit', function(e){ $('#image-form2').on('submit', function(e) {
e.preventDefault(); e.preventDefault();
const imageInputTag2 = $('#imageInputTag2'); const imageInputTag2 = $('#imageInputTag2');
const file = imageInputTag2.prop('files')[0]; const file = imageInputTag2.prop('files')[0];
...@@ -268,7 +268,7 @@ $('#image-form2').on('submit', function(e){ ...@@ -268,7 +268,7 @@ $('#image-form2').on('submit', function(e){
var fd = new FormData($(this)[0]); var fd = new FormData($(this)[0]);
if(!file.type.includes("image")) { // video 保存 if(!file.type.includes("image")) { // video 保存
CHAT.createVideoThumbnailAndUpload(file, function(resizeFile, thumbnailCreated){ CHAT.createVideoThumbnailAndUpload(file, function(resizeFile, thumbnailCreated) {
if(resizeFile && thumbnailCreated) { if(resizeFile && thumbnailCreated) {
//ただ、画像の大きさが500pixel以下の場合はthumbnailは生成されない //ただ、画像の大きさが500pixel以下の場合はthumbnailは生成されない
fd.append('thumb', resizeFile) fd.append('thumb', resizeFile)
...@@ -310,7 +310,7 @@ $('#pre-search').on('click', function(event) { ...@@ -310,7 +310,7 @@ $('#pre-search').on('click', function(event) {
}); });
// Exit Room // Exit Room
$('#exitRoom').on('click', function(event){ $('#exitRoom').on('click', function(event) {
// 36174 // 36174
$("#exitRoomTitle").text(getLocalizedString("exitRoomTitle")); $("#exitRoomTitle").text(getLocalizedString("exitRoomTitle"));
$("#exitRoomOk").text(getLocalizedString("yesTitle")); $("#exitRoomOk").text(getLocalizedString("yesTitle"));
...@@ -331,7 +331,7 @@ $('#exitRoom').on('click', function(event){ ...@@ -331,7 +331,7 @@ $('#exitRoom').on('click', function(event){
}); });
// Side Bar // Side Bar
$('#sidebarCollapse').on('click', function (){ $('#sidebarCollapse').on('click', function() {
// open sidebar // open sidebar
$('#sidebar').addClass('active'); $('#sidebar').addClass('active');
// fade in the overlay // fade in the overlay
...@@ -340,7 +340,7 @@ $('#sidebarCollapse').on('click', function (){ ...@@ -340,7 +340,7 @@ $('#sidebarCollapse').on('click', function (){
$('a[aria-expanded=true]').attr('aria-expanded', 'false'); $('a[aria-expanded=true]').attr('aria-expanded', 'false');
}); });
$('#dismiss, .overlay').on('click', function (){ $('#dismiss, .overlay').on('click', function() {
// hide sidebar // hide sidebar
$('#sidebar').removeClass('active'); $('#sidebar').removeClass('active');
// hide overlay if dismissable // hide overlay if dismissable
...@@ -349,7 +349,7 @@ $('#dismiss, .overlay').on('click', function (){ ...@@ -349,7 +349,7 @@ $('#dismiss, .overlay').on('click', function (){
//Invite User //Invite User
//招待ボタンを押すとグループリストを持ってくる。(ボタンを動的に追加して微動作中) //招待ボタンを押すとグループリストを持ってくる。(ボタンを動的に追加して微動作中)
$('#addUser').on('click', function(event){ $('#addUser').on('click', function(event) {
//loadingIndicatorを表示 //loadingIndicatorを表示
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
let isInvite = true; let isInvite = true;
...@@ -394,7 +394,7 @@ $('#selectListKeyword').on('input', function(event) { ...@@ -394,7 +394,7 @@ $('#selectListKeyword').on('input', function(event) {
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
// Tab Open/Shown Event // Tab Open/Shown Event
$('a[data-toggle="pill"]').on('show.bs.tab', function (e) { $('a[data-toggle="pill"]').on('show.bs.tab', function(e) {
var target = $(e.target).attr("href"); // e.target : activated tab var target = $(e.target).attr("href"); // e.target : activated tab
switch(target) { switch(target) {
case '#pills-chat': case '#pills-chat':
...@@ -530,15 +530,15 @@ $('a[data-toggle="pill"]').on('hide.bs.tab', function(e) { ...@@ -530,15 +530,15 @@ $('a[data-toggle="pill"]').on('hide.bs.tab', function(e) {
} }
}); });
$('#pills-chat-tab').on('shown.bs.tab', function (e){ $('#pills-chat-tab').on('shown.bs.tab', function(e) {
CHAT_UI.scrollToBottom(); CHAT_UI.scrollToBottom();
}); });
$('#pills-user-tab').on('shown.bs.tab', function (e){ $('#pills-user-tab').on('shown.bs.tab', function(e) {
$('#userSelectionConfirmBtn').show(); $('#userSelectionConfirmBtn').show();
}); });
$('#pills-confirm-tab').on('shown.bs.tab', function (e){ $('#pills-confirm-tab').on('shown.bs.tab', function(e) {
$('#userSelectionConfirmBtn').show(); $('#userSelectionConfirmBtn').show();
$('#userSelectionLength').text(''); $('#userSelectionLength').text('');
$('#userSelectionDeleteBtn').hide(); $('#userSelectionDeleteBtn').hide();
...@@ -606,7 +606,7 @@ CHAT_UI.showConfirmView = function(isInvite) { ...@@ -606,7 +606,7 @@ CHAT_UI.showConfirmView = function(isInvite) {
const template = $('#user-template').html(); const template = $('#user-template').html();
$('#select_user_list').html(''); $('#select_user_list').html('');
CHAT.globalSelectedUserList.forEach(function(user){ CHAT.globalSelectedUserList.forEach(function(user) {
let html = Mustache.render(template, { let html = Mustache.render(template, {
id: user.shopMemberId, id: user.shopMemberId,
profileImage: user.profileImagePath, profileImage: user.profileImagePath,
...@@ -615,7 +615,7 @@ CHAT_UI.showConfirmView = function(isInvite) { ...@@ -615,7 +615,7 @@ CHAT_UI.showConfirmView = function(isInvite) {
// TODO 次のコミットに参考事項 // TODO 次のコミットに参考事項
// チャットルーム開設画面で参加ユーザー削除用チェックロジックが残っているので // チャットルーム開設画面で参加ユーザー削除用チェックロジックが残っているので
// 影響テスト後、削除予定。 kang-dh // 影響テスト後、削除予定。 kang-dh
let obj = $(jQuery.parseHTML(html)).on('click',function(){ let obj = $(jQuery.parseHTML(html)).on('click',function() {
$(this).find('.userCheckBox').toggleClass('active'); $(this).find('.userCheckBox').toggleClass('active');
}); });
...@@ -637,13 +637,13 @@ CHAT_UI.showConfirmView = function(isInvite) { ...@@ -637,13 +637,13 @@ CHAT_UI.showConfirmView = function(isInvite) {
socket.emit('getGroupList', isInvite) socket.emit('getGroupList', isInvite)
}); });
$("#userSelectionConfirmBtn").off().on('click', function(){ $("#userSelectionConfirmBtn").off().on('click', function() {
if (isInvite) { if (isInvite) {
let userIdList = jQuery.makeArray($('#select_user_list .user_list').find('.userCheckBox')).map(function (e) { let userIdList = jQuery.makeArray($('#select_user_list .user_list').find('.userCheckBox')).map(function(e) {
return e.dataset.id; return e.dataset.id;
}); });
// ユーザーの名前(login id)リスト。 // ユーザーの名前(login id)リスト。
let loginIdList = jQuery.makeArray($('#select_user_list .user_list').find('.userCheckBox')).map(function (e) { let loginIdList = jQuery.makeArray($('#select_user_list .user_list').find('.userCheckBox')).map(function(e) {
return e.dataset.name; return e.dataset.name;
}); });
...@@ -663,10 +663,10 @@ CHAT_UI.showConfirmView = function(isInvite) { ...@@ -663,10 +663,10 @@ CHAT_UI.showConfirmView = function(isInvite) {
// loadingIndicatorを表示 // loadingIndicatorを表示
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
let userIdList = jQuery.makeArray($('#select_user_list .user_list').find('.userCheckBox')).map(function (e) { let userIdList = jQuery.makeArray($('#select_user_list .user_list').find('.userCheckBox')).map(function(e) {
return e.dataset.id; return e.dataset.id;
}); });
let userNameList = jQuery.makeArray($('#select_user_list .user_list').find('.userCheckBox')).map(function (e) { let userNameList = jQuery.makeArray($('#select_user_list .user_list').find('.userCheckBox')).map(function(e) {
return e.dataset.name; return e.dataset.name;
}); });
...@@ -684,7 +684,7 @@ CHAT_UI.showConfirmView = function(isInvite) { ...@@ -684,7 +684,7 @@ CHAT_UI.showConfirmView = function(isInvite) {
/*socket.emit('createNewRoom', userIdList, encodedRoomName, function(newRoomId) { /*socket.emit('createNewRoom', userIdList, encodedRoomName, function(newRoomId) {
socket.emit('joinRoom', newRoomId, newRoomName, function () { socket.emit('joinRoom', newRoomId, newRoomName, function() {
CHAT.saveRoomInfo(newRoomId, newRoomName); CHAT.saveRoomInfo(newRoomId, newRoomName);
$('#messages').html(''); $('#messages').html('');
$('.titleRoomName').text(newRoomName).data('roomName', newRoomName); $('.titleRoomName').text(newRoomName).data('roomName', newRoomName);
...@@ -695,7 +695,7 @@ CHAT_UI.showConfirmView = function(isInvite) { ...@@ -695,7 +695,7 @@ CHAT_UI.showConfirmView = function(isInvite) {
/*socket.on('createNewRoom', (shopMemberIdList, newRoomName, callback) => { /*socket.on('createNewRoom', (shopMemberIdList, newRoomName, callback) => {
const user = onlineUsers.getUser(socket.id) const user = onlineUsers.getUser(socket.id)
if(user){ if(user) {
var loginIdListObj = new Object(); var loginIdListObj = new Object();
var newRoomNameObj = new Object(); var newRoomNameObj = new Object();
...@@ -764,7 +764,7 @@ CHAT_UI.showConfirmView = function(isInvite) { ...@@ -764,7 +764,7 @@ CHAT_UI.showConfirmView = function(isInvite) {
} else { } else {
//loadingIndicatorを表示 //loadingIndicatorを表示
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
let userIdList = jQuery.makeArray($('#select_user_list .user_list').find('.userCheckBox')).map(function (e) { let userIdList = jQuery.makeArray($('#select_user_list .user_list').find('.userCheckBox')).map(function(e) {
return e.dataset.id; return e.dataset.id;
}); });
...@@ -798,7 +798,7 @@ CHAT_UI.showConfirmView = function(isInvite) { ...@@ -798,7 +798,7 @@ CHAT_UI.showConfirmView = function(isInvite) {
CHAT_UI.deleteButtonAction = function(isInvite) { CHAT_UI.deleteButtonAction = function(isInvite) {
//配列の整理 //配列の整理
jQuery.makeArray($('#select_user_list .user_list').find(".userCheckBox.active")).map(function (e) { jQuery.makeArray($('#select_user_list .user_list').find(".userCheckBox.active")).map(function(e) {
CHAT.globalSelectedUserList = CHAT.globalSelectedUserList.filter(function(element) { CHAT.globalSelectedUserList = CHAT.globalSelectedUserList.filter(function(element) {
return e.dataset.name != element.loginId; return e.dataset.name != element.loginId;
}); });
...@@ -860,13 +860,13 @@ CHAT_UI.waitForLoadingImage = function(div, callback) { ...@@ -860,13 +860,13 @@ CHAT_UI.waitForLoadingImage = function(div, callback) {
if (count==0) if (count==0)
callback(); callback();
var loaded = 0; var loaded = 0;
imgs.one( "load" , function ( e ) { imgs.one( "load" , function( e ) {
// イメージが読み込まれた // イメージが読み込まれた
loaded++; loaded++;
if ( loaded === count ) { if ( loaded === count ) {
callback(); callback();
} }
}).each( function () { }).each( function() {
if ( this.complete || this.readyState === readyState.COMPLETED ) { if ( this.complete || this.readyState === readyState.COMPLETED ) {
$(this).trigger("load"); $(this).trigger("load");
} }
...@@ -874,11 +874,11 @@ CHAT_UI.waitForLoadingImage = function(div, callback) { ...@@ -874,11 +874,11 @@ CHAT_UI.waitForLoadingImage = function(div, callback) {
}); });
} }
$('#contactButton').on('click', function(event){ $('#contactButton').on('click', function(event) {
CHAT_UI.refreshContactScreen(); CHAT_UI.refreshContactScreen();
}); });
$('#chatButton').on('click', function(event){ $('#chatButton').on('click', function(event) {
CHAT_UI.refreshRoomList(chatRoomType.DM); CHAT_UI.refreshRoomList(chatRoomType.DM);
}); });
...@@ -893,7 +893,11 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -893,7 +893,11 @@ CHAT_UI.refreshContactScreen = function() {
$('#title').text(contactListTitle); $('#title').text(contactListTitle);
// グループの様式を読み込む // グループの様式を読み込む
const groupTemplate = $('#group-template').html(); var groupTemplate;
$.get({ url: "./template/template_group_list.html", async: false }
, function(text) {
groupTemplate = text;
});
// ユーザの様式を読み込む // ユーザの様式を読み込む
var userTemplate; var userTemplate;
...@@ -914,7 +918,6 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -914,7 +918,6 @@ CHAT_UI.refreshContactScreen = function() {
groupUserTemplate = text; groupUserTemplate = text;
}); });
//const userNamecardTemplate = $('#namecard-template').html();
if (IS_ONLINE == 'true') { if (IS_ONLINE == 'true') {
android.updateGroupInfo('0'); android.updateGroupInfo('0');
android.updateMyInfo(); android.updateMyInfo();
...@@ -934,43 +937,41 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -934,43 +937,41 @@ CHAT_UI.refreshContactScreen = function() {
name: myInfo.shopMemberName, name: myInfo.shopMemberName,
groupPathList: myInfo.groupPathList groupPathList: myInfo.groupPathList
}); });
let myNamecardObj = $(jQuery.parseHTML(myNamecardHtml)).on('click', function(){ let myNamecardObj = $(jQuery.parseHTML(myNamecardHtml)).on('click', function() {
}); });
$('#myProfileModal').html(myNamecardObj); $('#myProfileModal').html(myNamecardObj);
$('#myName').text(myInfo.shopMemberName); $('#myName').text(myInfo.shopMemberName);
$('#myImg').attr('src',myInfo.profileImagePath); $('#myImg').attr('src',myInfo.profileImagePath);
/*let html = Mustache.render(userTemplate, { //お気に入りグループ取得。
id: myInfo.shopMemberId, var favoriteGroupList = CHAT_DB.getFavoriteGroups();
profileImage: myInfo.profileImagePath, console.log(favoriteGroupList);
name: myInfo.shopMemberName
});
let obj = $(jQuery.parseHTML(html)).on('click', function(){
CHAT_UI.showNamecard('myNamecard');
});
$('#my_info').append(obj);*/
var favoriteCount = 0;
/*var favoriteGroupList = CHAT_DB.getFavoriteGroups();
favoriteGroupList.forEach(function(favoriteGroup) { favoriteGroupList.forEach(function(favoriteGroup) {
let html = Mustache.render(groupTemplate, { let html = Mustache.render(groupTemplate, {
name: favoriteGroup.groupName name: favoriteGroup.groupName,
id: favoriteGroup.groupId,
isFavorite: true
}); });
let obj = $(jQuery.parseHTML(html)).on('click', function(){ let obj = $(jQuery.parseHTML(html)).on('click', function() {
//TODO need onClick Action
}); });
favoriteCount++ $('#favoriteList').append(obj);
$('#favorite_list').append(obj); })
})*/ //お気に入りユーザ取得。
var favoriteUserList = CHAT_DB.getFavoriteUsers(); var favoriteUserList = CHAT_DB.getFavoriteUsers();
favoriteUserList.forEach(function(favoriteUser) { favoriteUserList.forEach(function(favoriteUser) {
favoriteUser.profileUrl = CHAT.getProfileImgUrl(favoriteUser.profileUrl);
favoriteUser.isFavorite = true;
});
let html = Mustache.render(userTemplate, {
userList: favoriteUserList
});
let obj = jQuery.parseHTML(html);
$('#favoriteList').append(obj);
/*favoriteUserList.forEach(function(favoriteUser) {
favoriteUser.profileImagePath = CHAT.getProfileImgUrl(favoriteUser.profileUrl) favoriteUser.profileImagePath = CHAT.getProfileImgUrl(favoriteUser.profileUrl)
let html = Mustache.render(userTemplate, { let html = Mustache.render(userTemplate, {
shopMemberId: favoriteUser.shopMemberId, shopMemberId: favoriteUser.shopMemberId,
...@@ -979,37 +980,28 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -979,37 +980,28 @@ CHAT_UI.refreshContactScreen = function() {
isFavorite: true isFavorite: true
}); });
let obj = $(jQuery.parseHTML(html)).on('click', function(){ let obj = $(jQuery.parseHTML(html)).on('click', function() {
//TODO need onClick Action
}); });
favoriteCount++
$('#favoriteList').append(obj); $('#favoriteList').append(obj);
}) })*/
var myGroupList = CHAT_DB.getMyGroupUsers(); var myGroupList = CHAT_DB.getMyGroupUsers();
myGroupList.forEach(function(myGroup) { myGroupList.forEach(function(myGroup) {
myGroup.groupUserList.forEach(function (groupUser){ myGroup.groupUserList.forEach(function(groupUser) {
groupUser.profileImagePath = CHAT.getProfileImgUrl(groupUser.profileUrl) groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl)
}) })
let html = Mustache.render(groupUserTemplate, { let html = Mustache.render(groupUserTemplate, {
groupName: myGroup.groupName, groupName: myGroup.groupName,
groupUserList: myGroup.groupUserList groupUserList: myGroup.groupUserList
}); });
let obj = $(jQuery.parseHTML(html)).on('click', function(){ let obj = $(jQuery.parseHTML(html)).on('click', function() {
}); });
$('#myGroupList').append(obj); $('#myGroupList').append(obj);
}) })
/*if (favoriteCount == 0) {
$('#favorite_list').hide();
$('#favorite-seperator').hide();
} else {
$('#favorite_list').show();
$('#favorite-seperator').show();
}*/
} }
CHAT_UI.refreshRoomList = function(roomType) { CHAT_UI.refreshRoomList = function(roomType) {
...@@ -1152,7 +1144,7 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) { ...@@ -1152,7 +1144,7 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) {
jQueryMessages.prepend(workVal); jQueryMessages.prepend(workVal);
if (beforeHeight !== 0) { if (beforeHeight !== 0) {
// 追加のメッセージ読み込み時は読み込み前のスクロール位置を維持 // 追加のメッセージ読み込み時は読み込み前のスクロール位置を維持
setTimeout(function () { setTimeout(function() {
jQueryMessages.scrollTop(jQueryMessages.prop('scrollHeight') - beforeHeight); jQueryMessages.scrollTop(jQueryMessages.prop('scrollHeight') - beforeHeight);
}, 400); }, 400);
} else { } else {
...@@ -1174,89 +1166,127 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) { ...@@ -1174,89 +1166,127 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) {
}; };
$('#dmBtn').on('click', function (e){ $('#dmBtn').on('click', function(e) {
CHAT_UI.refreshRoomList(chatRoomType.DM); CHAT_UI.refreshRoomList(chatRoomType.DM);
}); });
$('#groupBtn').on('click', function (e){ $('#groupBtn').on('click', function(e) {
CHAT_UI.refreshRoomList(chatRoomType.GROUP); CHAT_UI.refreshRoomList(chatRoomType.GROUP);
}); });
CHAT_UI.showNamecard = function(id) { $('#myGroupBtn').on('click', function(e) {
$('#'+id).appendTo("body").modal({ $('#myGroupArea').show();
backdrop: 'static', $('#allGroupArea').hide();
keyboard: false });
})
}
CHAT_UI.hideNamecard = function(id) { $('#tabAllGroup').on('click', function(e) {
$('#'+id).modal('hide'); CHAT_UI.refesshAllGroupSearch('0')
} });
CHAT_UI.showUserNamecard = function(shopMemberId) { CHAT_UI.favoriteUserChange = function(shopMemberId, star) {
if ($(star).hasClass('active')) {
CHAT_UI.removeFavoriteUser(shopMemberId);
} else if ($(star).hasClass('disable')) {
CHAT_UI.insertFavoriteUser(shopMemberId);
}
}
// $('#myNamecard').appendTo("body").modal({ CHAT_UI.favoriteGroupChange = function(groupId, star) {
// backdrop: 'static', if ($(star).hasClass('active')) {
// keyboard: false CHAT_UI.removeFavoriteGroup(groupId);
// }) } else if ($(star).hasClass('disable')) {
CHAT_UI.insertFavoriteGroup(groupId);
}
} }
$('#myGroupBtn').on('click', function (e){ CHAT_UI.removeFavoriteUser = function(shopMemberId) {
$('#userNameCard').modal('hide');
$('#myNameCard').modal('hide');
android.removeFavoriteUser(shopMemberId);
$('.shopmember_'+shopMemberId).removeClass('active');
$('.shopmember_'+shopMemberId).addClass('disable');
};
$('#myGroupArea').show(); CHAT_UI.insertFavoriteUser = function(shopMemberId) {
$('#allGroupArea').hide(); $('#userNameCard').modal('hide');
}); $('#myNameCard').modal('hide');
android.addFavoriteUser(shopMemberId);
$('.shopmember_'+shopMemberId).removeClass('disable');
$('.shopmember_'+shopMemberId).addClass('active');
};
$('#tabAllGroup').on('click', function (e){ CHAT_UI.removeFavoriteGroup = function(groupId) {
console.log('tabAllGroup') android.removeFavoriteGroup(groupId);
CHAT_UI.refesshAllGroupSearch('0') $('.group_'+groupId).removeClass('active');
}); $('.group_'+groupId).addClass('disable');
};
CHAT_UI.insertFavoriteGroup = function(groupId) {
android.addFavoriteGroup(groupId);
$('.group_'+groupId).removeClass('disable');
$('.group_'+groupId).addClass('active');
};
//全グループ検索画面表示。
CHAT_UI.refesshAllGroupSearch = function(groupId) { CHAT_UI.refesshAllGroupSearch = function(groupId) {
console.log('AllGroupSearchScreen');
//CHAT_UI.makeNameCard(id) $('.cancel').addClass('none');
$('.search_form input').removeClass('focus');
$('.search_form input').val('');
$('.search_form form').removeClass();
$('.content').removeClass('none');
$('.overlay_src_msg').empty();
$('#tabAllGroup').prop('checked', true);
//オンライン状態であればサーバから情報更新。
if (IS_ONLINE == 'true') { if (IS_ONLINE == 'true') {
android.updateGroupInfo(groupId); android.updateGroupInfo(groupId);
} }
//画面エリアを初期化。
$('#rootGroupBtn').off(); $('#rootGroupBtn').off();
$('#parentGroupBtn').off(); $('#parentGroupBtn').off();
var result = CHAT_DB.getGroupInfo(groupId);
$('#childGroupListArea').html(''); $('#childGroupListArea').html('');
$('#userInGroupList').html(''); $('#userInGroupList').html('');
$('#groupPathArea').html(''); $('#groupPathArea').html('');
//DBからグループ情報を取得。
var result = CHAT_DB.getGroupInfo(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== 'undefined') { if (typeof result.parentGroupId !== 'undefined') {
console.log(result.parentGroupId);
$('#parentGroupBtn').on('click', function() { $('#parentGroupBtn').on('click', function() {
CHAT_UI.refesshAllGroupSearch(result.parentGroupId); CHAT_UI.refesshAllGroupSearch(result.parentGroupId);
}); });
} }
if (typeof result.rootGroupId !== 'undefined') { if (typeof result.rootGroupId !== 'undefined') {
console.log(result.rootGroupId);
$('#rootGroupBtn').on('click', function() { $('#rootGroupBtn').on('click', function() {
CHAT_UI.refesshAllGroupSearch(result.rootGroupId); CHAT_UI.refesshAllGroupSearch(result.rootGroupId);
}); });
} }
//該当グループのパースを表示。
var groupPathTemplate;
$.get({ url: "./template/template_group_path.html", async: false }
, function(text) {
groupPathTemplate = text;
});
/*const groupNaviTemplate = $('#group-navigater-template').html(); var groupPathCount = 0;
var groupCount = 0;
result.groupPathList.forEach(function(groupPath) { result.groupPathList.forEach(function(groupPath) {
if (groupCount != 0) { if (!(groupPathCount < (result.groupPathList.length - 3))) {
$('#groupPathArea').append("<label class='group-navigater'> > </label>"); let html = Mustache.render(groupPathTemplate, {
}
let html = Mustache.render(groupNaviTemplate, {
name: groupPath.groupName, name: groupPath.groupName,
id: groupPath.groupId id: groupPath.groupId
}); });
let obj = $(jQuery.parseHTML(html)).on('click', function(){ let obj = jQuery.parseHTML(html);
CHAT_UI.refesshAllGroupSearch(groupPath.groupId);
});
groupCount++;
$('#groupPathArea').append(obj); $('#groupPathArea').append(obj);
})*/ }
groupPathCount++;
})
//該当グループの下位グループ表示。
var groupTemplate; var groupTemplate;
$.get({ url: "./template/template_group_list.html", async: false } $.get({ url: "./template/template_group_list.html", async: false }
, function(text) { , function(text) {
...@@ -1268,35 +1298,31 @@ CHAT_UI.refesshAllGroupSearch = function(groupId) { ...@@ -1268,35 +1298,31 @@ CHAT_UI.refesshAllGroupSearch = function(groupId) {
id: childGroup.groupId id: childGroup.groupId
}); });
let obj = $(jQuery.parseHTML(html)).on('click', function(){ let obj = $(jQuery.parseHTML(html)).on('click', function() {
CHAT_UI.refesshAllGroupSearch(childGroup.groupId);
}); });
$('#childGroupListArea').append(obj); $('#childGroupListArea').append(obj);
}) })
/*const userTemplate = $('#user-template').html(); //該当グループの所属ユーザを表示。
var userTemplate;
$.get({ url: "./template/template_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
result.groupUserList.forEach(function(groupUser) { result.groupUserList.forEach(function(groupUser) {
groupUser.profileImagePath = CHAT.getProfileImgUrl(groupUser.profileUrl) groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl)
})
let html = Mustache.render(userTemplate, { let html = Mustache.render(userTemplate, {
id: groupUser.shopMemberId, userList: result.groupUserList
profileImage: groupUser.profileImagePath,
name: groupUser.shopMemberName
}); });
let obj = jQuery.parseHTML(html);
let obj = $(jQuery.parseHTML(html)).on('click', function(){
CHAT_UI.makeNameCard(groupUser.shopMemberId);
});
$('#userInGroupList').append(obj); $('#userInGroupList').append(obj);
})
$('#myGroupArea').hide();
$('#allGroupArea').show();*/
} }
CHAT_UI.startChat = function (userShopMemberId,userName) { CHAT_UI.startChat = function(userShopMemberId,userName) {
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
var userIdList = []; var userIdList = [];
userIdList.push(userShopMemberId); userIdList.push(userShopMemberId);
...@@ -1307,43 +1333,14 @@ CHAT_UI.startChat = function (userShopMemberId,userName) { ...@@ -1307,43 +1333,14 @@ CHAT_UI.startChat = function (userShopMemberId,userName) {
CHAT_UI.hideNamecard(nameCardAreaId.USER); CHAT_UI.hideNamecard(nameCardAreaId.USER);
}; };
CHAT_UI.startVoice = function () { CHAT_UI.startVoice = function() {
//add Android Chat click
console.log("VoiceClick"); console.log("VoiceClick");
}; };
CHAT_UI.changeFavorite = function () {
//add Android Chat click
console.log("FavoriteClick");
};
CHAT_UI.removeFavoriteUser = function (shopMemberId) {
//add Android Chat click
$('#userNameCard').modal('hide');
$('#myNameCard').modal('hide');
console.log('hide');
android.removeFavoriteUser(shopMemberId);
console.log("removeFU");
};
CHAT_UI.insertFavoriteUser = function (shopMemberId) {
//add Android Chat click
$('#userNameCard').modal('hide');
$('#myNameCard').modal('hide');
console.log('insert');
android.addFavoriteUser(shopMemberId);
console.log("insertFU");
};
CHAT_UI.changeFavorite = function () { CHAT_UI.makeNameCard = function(shopMemberId) {
//add Android Chat click
console.log("FavoriteClick");
};
CHAT_UI.makeNameCard = function (shopMemberId) {
console.log('makeNameCard Click');
var nameCardInfo = CHAT_DB.getNameCardData(shopMemberId); var nameCardInfo = CHAT_DB.getNameCardData(shopMemberId);
console.log(nameCardInfo);
var namecardTemplate; var namecardTemplate;
$.get({ url: "./template/template_user_name_card.html", async: false } $.get({ url: "./template/template_user_name_card.html", async: false }
...@@ -1362,112 +1359,14 @@ CHAT_UI.makeNameCard = function (shopMemberId) { ...@@ -1362,112 +1359,14 @@ CHAT_UI.makeNameCard = function (shopMemberId) {
isFavorite: nameCardInfo.isFavorite isFavorite: nameCardInfo.isFavorite
}); });
let namecardObj = $(jQuery.parseHTML(namecardHtml)).on('click', function(){ let namecardObj = $(jQuery.parseHTML(namecardHtml)).on('click', function() {
}); });
$('#userProfileModal').html(namecardObj); $('#userProfileModal').html(namecardObj);
$('#userNameCard').modal('show'); $('#userNameCard').modal('show');
}; };
CHAT_UI.makeNameCardInChatRoom = function (chatRoomId) { CHAT_UI.toggleCategory = function(category) {
console.log('makeNameCard Click'); $(category).toggleClass("open");
var nameCardInfo = CHAT_DB.getNameCardData(chatRoomId); $(category).next().slideToggle();
console.log(nameCardInfo);
const userNamecardTemplate = $('#namecard-template').html();
let namecardHtml = Mustache.render(userNamecardTemplate, {
loginId: nameCardInfo.shopMemberId,
profileImage: nameCardInfo.profileImagePath,
name: nameCardInfo.shopMemberName,
groupPathList: nameCardInfo.groupPathList,
chat: getLocalizedString("chat"),
voice: getLocalizedString("voice"),
favorite: getLocalizedString("addFavorite")
});
console.log('done html render');
let namecardObj = $(jQuery.parseHTML(namecardHtml)).on('click', function(){
});
console.log(namecardHtml);
console.log(namecardObj);
$('#userProfileModal').html(namecardHtml);
CHAT_UI.showNamecard('userProfileModal');
}; };
CHAT_UI.refesshAllGroupSearchFaborite = function(groupId) {
const userNamecardTemplate = $('#namecard-template').html();
if (IS_ONLINE == 'true') {
android.updateGroupInfo(groupId);
}
$('#rootGroupBtn').off();
$('#parentGroupBtn').off();
var result = CHAT_DB.getGroupInfo(groupId);
$('#childGroupList').html('');
$('#userInGroupList').html('');
$('#groupPathArea').html('');
if (typeof result.parentGroupId !== 'undefined') {
console.log(result.parentGroupId);
$('#parentGroupBtn').on('click', function() {
CHAT_UI.refesshAllGroupSearch(result.parentGroupId);
});
}
if (typeof result.rootGroupId !== 'undefined') {
console.log(result.rootGroupId);
$('#rootGroupBtn').on('click', function() {
CHAT_UI.refesshAllGroupSearch(result.rootGroupId);
});
}
const groupNaviTemplate = $('#group-navigater-template').html();
var groupCount = 0;
result.groupPathList.forEach(function(groupPath) {
if (groupCount != 0) {
$('#groupPathArea').append("<label class='group-navigater'> > </label>");
}
let html = Mustache.render(groupNaviTemplate, {
name: groupPath.groupName,
id: groupPath.groupId
});
let obj = $(jQuery.parseHTML(html)).on('click', function(){
CHAT_UI.refesshAllGroupSearch(groupPath.groupId);
});
groupCount++;
$('#groupPathArea').append(obj);
})
const groupTemplate = $('#group-template').html();
result.childGroupList.forEach(function(childGroup) {
let html = Mustache.render(groupTemplate, {
name: childGroup.groupName,
id: childGroup.groupId
});
let obj = $(jQuery.parseHTML(html)).on('click', function(){
CHAT_UI.refesshAllGroupSearch(childGroup.groupId);
});
$('#childGroupList').append(obj);
})
const userTemplate = $('#user-template').html();
result.groupUserList.forEach(function(groupUser) {
groupUser.profileImagePath = CHAT.getProfileImgUrl(groupUser.profileUrl)
let html = Mustache.render(userTemplate, {
id: groupUser.shopMemberId,
profileImage: groupUser.profileImagePath,
name: groupUser.shopMemberName
});
let obj = $(jQuery.parseHTML(html)).on('click', function(){
CHAT_UI.makeNameCard(groupUser.shopMemberId);
});
$('#userInGroupList').append(obj);
})
$('#myGroupArea').hide();
$('#allGroupArea').show();
}
\ No newline at end of file
$(function() { // アコーディオン
var h = $(window).height(); //画面の高さを取得 $('.category').on('click',function () {
// アコーディオン
$('.category').click(function() {
$(this).toggleClass("open"); $(this).toggleClass("open");
$(this).next().slideToggle(); $(this).next().slideToggle();
}); });
$(function() {
var h = $(window).height(); //画面の高さを取得
// ローディング表示 // ローディング表示
$('footer a').click(function(event){ $('footer a').click(function(event){
......
$(function() { $(function() {
// メンバー検索 // メンバー検索
$('#contact .search_form input[type="search"]').keyup(function(){ $('#contact .search_form input[type="search"]').keyup(function(){
$.ajax({ var isAllGroup = $('#tabAllGroup').is(':checked');
url: 'search_message_user_list.html', console.log(isAllGroup);
type: 'POST', $('.overlay_src_msg').empty();
datatype: 'html'
}).done(function (data) { //全グループ検索画面
$('.overlay_src_msg').html(data); if (isAllGroup) {
var keyword = $('#contact .search_form input[type="search"]').val();
if (keyword == '') {
return;
}
//グループデータ検索
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, {
name: group.groupName,
id: group.groupId,
isFavorite: group.isFavorite
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
}) })
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberByName(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').append(obj);
  //連絡先画面
} else {
var keyword = $('#contact .search_form input[type="search"]').val();
if (keyword == '') {
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);
}
}); });
}); });
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
<a href="chat_room.html" class="w-100"> <a href="#" class="w-100" onclick="CHAT_UI.refesshAllGroupSearch({{id}});">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thubnail"> <div class="thubnail">
...@@ -17,7 +17,12 @@ ...@@ -17,7 +17,12 @@
</a> </a>
<div class="chat_item_r"> <div class="chat_item_r">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<span class="star disable"></span> {{#isFavorite}}
<span class="star active group_{{id}}" onclick="CHAT_UI.favoriteGroupChange({{id}},this)"></span>
{{/isFavorite}}
{{^isFavorite}}
<span class="star disable group_{{id}}" onclick="CHAT_UI.favoriteGroupChange({{id}},this)"></span>
{{/isFavorite}}
</div> </div>
</div> </div>
</li> </li>
\ No newline at end of file
<a href="#" class="breadcrumb_item" onclick="CHAT_UI.refesshAllGroupSearch({{id}});"><span>{{name}}</span></a>
\ No newline at end of file
<div class="category"><div class="category_name"><span>{{groupName}}</span></div></div> <div class="category" onclick="CHAT_UI.toggleCategory(this);"><div class="category_name"><span>{{groupName}}</span></div></div>
<ul class="p-0 chat_make_room_list"> <ul class="p-0 chat_make_room_list">
{{#groupUserList}} {{#groupUserList}}
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
<a href="#" onclick="CHAT_UI.makeNameCard({{shopMemberId}})" style="width: 100%;"> <a href="javascript:return false;" onclick="CHAT_UI.makeNameCard({{shopMemberId}})" style="width: 100%;">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thubnail"> <div class="thubnail">
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
<div class="chat_item_r"> <div class="chat_item_r">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
{{#isFavorite}} {{#isFavorite}}
<span class="star active"></span> <span class="star active shopmember_{{shopMemberId}}" onclick="CHAT_UI.favoriteUserChange({{shopMemberId}},this)"></span>
{{/isFavorite}} {{/isFavorite}}
{{^isFavorite}} {{^isFavorite}}
<span class="star disable"></span> <span class="star disable shopmember_{{shopMemberId}}" onclick="CHAT_UI.favoriteUserChange({{shopMemberId}},this)"></span>
{{/isFavorite}} {{/isFavorite}}
</div> </div>
</div> </div>
......
<ul class="p-0 chat_make_room_list"> <ul class="p-0 chat_make_room_list">
{{#userList}}
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
<a href="#" onclick="CHAT_UI.makeNameCard({{shopMemberId}})" style="width: 100%;"> <a href="javascript:return false;" onclick="CHAT_UI.makeNameCard({{shopMemberId}})" style="width: 100%;">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thubnail"> <div class="thubnail">
<div class="img_wrap"><img src="{{profileImage}}" onError="this.src='./img/noImage.png'" /></div> <div class="img_wrap"><img src="{{profileUrl}}" onError="this.src='./img/noImage.png'" /></div>
</div> </div>
</div> </div>
<div class="chat_item_m px-0"> <div class="chat_item_m px-0">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="chat_item_t"> <div class="chat_item_t">
<span class="chat_item_ttl">{{name}}</span> <span class="chat_item_ttl">{{shopMemberName}}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -19,12 +20,13 @@ ...@@ -19,12 +20,13 @@
<div class="chat_item_r"> <div class="chat_item_r">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
{{#isFavorite}} {{#isFavorite}}
<span class="star active"></span> <span class="star active shopmember_{{shopMemberId}}" onclick="CHAT_UI.favoriteUserChange({{shopMemberId}},this)"></span>
{{/isFavorite}} {{/isFavorite}}
{{^isFavorite}} {{^isFavorite}}
<span class="star disable"></span> <span class="star disable shopmember_{{shopMemberId}}" onclick="CHAT_UI.favoriteUserChange({{shopMemberId}},this)"></span>
{{/isFavorite}} {{/isFavorite}}
</div> </div>
</div> </div>
</li> </li>
{{/userList}}
</ul> </ul>
\ No newline at end of file
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