Commit a4ea3c56 by Kim Peace

Merge commit 'ce69af2e' into…

Merge commit 'ce69af2e' into bugFix/#433group_screen_corporate_topButton
parents cade5986 ce69af2e
...@@ -16,7 +16,6 @@ CHAT_DB.getRoomList = function(roomType) { ...@@ -16,7 +16,6 @@ CHAT_DB.getRoomList = function(roomType) {
CHAT_DB.getMyInfo = function(input) { CHAT_DB.getMyInfo = function(input) {
var result = JSON.parse(android.getMyInfo()); var result = JSON.parse(android.getMyInfo());
CHAT.globalLoginParameter.shopMemberId = result.shopMemberId; CHAT.globalLoginParameter.shopMemberId = result.shopMemberId;
console.log(CHAT.globalLoginParameter.shopMemberId);
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要 //TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
......
...@@ -958,13 +958,11 @@ CHAT_UI.refreshGroupSearch = function(groupId, isInvite) { ...@@ -958,13 +958,11 @@ CHAT_UI.refreshGroupSearch = function(groupId, isInvite) {
$('#groupPathArea').html(''); $('#groupPathArea').html('');
if (typeof result.parentGroupId !== 'undefined') { if (typeof result.parentGroupId !== 'undefined') {
console.log(result.parentGroupId);
$('#parentGroupBtn').on('click', function() { $('#parentGroupBtn').on('click', function() {
CHAT_UI.refreshGroupSearch(result.parentGroupId, isInvite); CHAT_UI.refreshGroupSearch(result.parentGroupId, isInvite);
}); });
} }
if (typeof result.rootGroupId !== 'undefined') { if (typeof result.rootGroupId !== 'undefined') {
console.log(result.rootGroupId);
$('#rootGroupBtn').on('click', function() { $('#rootGroupBtn').on('click', function() {
CHAT_UI.refreshGroupSearch(result.rootGroupId, isInvite); CHAT_UI.refreshGroupSearch(result.rootGroupId, isInvite);
}); });
...@@ -1150,7 +1148,6 @@ CHAT_UI.refreshContactScreen = function(isCreate, isInvite) { ...@@ -1150,7 +1148,6 @@ CHAT_UI.refreshContactScreen = function(isCreate, isInvite) {
}); });
let obj = $(jQuery.parseHTML(html)).on('click', function(){ let obj = $(jQuery.parseHTML(html)).on('click', function(){
console.log('click');
if (isCreate != true) { if (isCreate != true) {
CHAT_UI.makeNameCard(groupUser.shopMemberId); CHAT_UI.makeNameCard(groupUser.shopMemberId);
} else { } else {
...@@ -1477,13 +1474,11 @@ CHAT_UI.refesshAllGroupSearch = function(groupId) { ...@@ -1477,13 +1474,11 @@ CHAT_UI.refesshAllGroupSearch = function(groupId) {
$('#groupPathArea').html(''); $('#groupPathArea').html('');
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);
}); });
...@@ -1583,10 +1578,7 @@ CHAT_UI.changeFavorite = function () { ...@@ -1583,10 +1578,7 @@ CHAT_UI.changeFavorite = function () {
}; };
CHAT_UI.makeNameCard = function (shopMemberId) { CHAT_UI.makeNameCard = function (shopMemberId) {
console.log('makeNameCard Click');
var nameCardInfo = CHAT_DB.getNameCardData(shopMemberId); var nameCardInfo = CHAT_DB.getNameCardData(shopMemberId);
console.log(nameCardInfo);
const userNamecardTemplate = $('#namecard-template').html(); const userNamecardTemplate = $('#namecard-template').html();
let namecardHtml = Mustache.render(userNamecardTemplate, { let namecardHtml = Mustache.render(userNamecardTemplate, {
loginId: nameCardInfo.shopMemberId, loginId: nameCardInfo.shopMemberId,
...@@ -1606,10 +1598,7 @@ CHAT_UI.makeNameCard = function (shopMemberId) { ...@@ -1606,10 +1598,7 @@ CHAT_UI.makeNameCard = function (shopMemberId) {
}; };
CHAT_UI.makeNameCardInChatRoom = function (chatRoomId) { CHAT_UI.makeNameCardInChatRoom = function (chatRoomId) {
console.log('makeNameCard Click');
var nameCardInfo = CHAT_DB.getNameCardData(chatRoomId); var nameCardInfo = CHAT_DB.getNameCardData(chatRoomId);
console.log(nameCardInfo);
const userNamecardTemplate = $('#namecard-template').html(); const userNamecardTemplate = $('#namecard-template').html();
let namecardHtml = Mustache.render(userNamecardTemplate, { let namecardHtml = Mustache.render(userNamecardTemplate, {
loginId: nameCardInfo.shopMemberId, loginId: nameCardInfo.shopMemberId,
...@@ -1643,13 +1632,11 @@ CHAT_UI.refesshAllGroupSearchFaborite = function(groupId) { ...@@ -1643,13 +1632,11 @@ CHAT_UI.refesshAllGroupSearchFaborite = function(groupId) {
$('#groupPathArea').html(''); $('#groupPathArea').html('');
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);
}); });
......
...@@ -121,7 +121,6 @@ ...@@ -121,7 +121,6 @@
String.prototype.replaceAll = function(org, dest) { String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest); return this.split(org).join(dest);
} }
let CHAT_SERVER_URL = ''; let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = ''; let CMS_SERVER_URL = '';
let ASSET_PATH = './'; let ASSET_PATH = './';
...@@ -131,6 +130,7 @@ ...@@ -131,6 +130,7 @@
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
android.getLoginParameter(); android.getLoginParameter();
android.getGlobalParameter(); android.getGlobalParameter();
android.saveSelectedUserList("");
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
...@@ -140,6 +140,7 @@ ...@@ -140,6 +140,7 @@
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
console.log("onChat"); console.log("onChat");
CHAT_UI.refreshRoomList(chatRoomType.GROUP); CHAT_UI.refreshRoomList(chatRoomType.GROUP);
CHAT_UI.dismissLoadingIndicator();
}; };
</script> </script>
</body> </body>
......
...@@ -43,158 +43,58 @@ ...@@ -43,158 +43,58 @@
<div class="chat_list"> <div class="chat_list">
<h2>参加者</h2> <h2>参加者</h2>
<ul class="p-0 chat_make_room_list"> <ul class="p-0 chat_make_room_list">
<li class="d-flex align-items-center"> <div id="selectedUserList"></div>
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l">
<div class="thumbnail">
<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>
</li>
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l">
<div class="thumbnail">
<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>
</li>
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l">
<div class="thumbnail"><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>
</li>
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l">
<div class="thumbnail"><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>
</li>
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l">
<div class="thumbnail"><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>
</li>
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l">
<div class="thumbnail"><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>
</li>
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l">
<div class="thumbnail"><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>
</li>
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l">
<div class="thumbnail"><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>
</li>
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l">
<div class="thumbnail"><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>
</li>
</ul> </ul>
</div> </div>
<!-- ユーザー招待ボタン --> <!-- ユーザー招待ボタン -->
<div class="add_user_btn"> <div class="add_user_btn">
<button type="button" name="button">招待</button> <button type="button" name="button" id="addUserBtn">招待</button>
</div> </div>
</form> </form>
</main> </main>
<script src="./js/libs/jquery-3.3.1.min.js"></script>
<script src="./js/language.js"></script>
<script src="./js/language_ko.js" charset="UTF-8"></script>
<script src="./js/language_ja.js" charset="UTF-8"></script>
<script src="./js/language_en.js" charset="UTF-8"></script>
<script src="./js/libs/moment.js"></script>
<script src="./js/libs/locale/ko.js" charset="UTF-8"></script>
<script src="./js/libs/locale/ja.js" charset="UTF-8"></script>
<script src="./js/libs/mustache.min.js"></script>
<script src="./js/libs/bootstrap.min.js"></script>
<script src="./js/libs/jquery.mark.min.js"></script>
<script src="./js/common.js"></script>
<script src="./js/loading.js"></script>
<script src="./js/constant.js"></script>
<script src="./js/chat.js"></script>
<script src="./js/chat-ui.js"></script>
<script src="./js/chat-util.js"></script>
<script src="./js/chat-db.js"></script>
<script>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
}
<script src="./js/libs/jquery-3.3.1.min.js"></script> let CHAT_SERVER_URL = '';
<script src="./js/libs/moment.js"></script> let CMS_SERVER_URL = '';
<script src="./js/libs/bootstrap.min.js"></script> let ASSET_PATH = './';
<script src="./js/libs/jquery.mark.min.js"></script> let PLATFORM = '';
<script src="./js/chat.js"></script> let IS_MOBILE = true;
let IS_ONLINE = false;
android.getLoginParameter();
android.getGlobalParameter();
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
PLATFORM = platform;
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
//CHAT_UI.showMakeRoomConfirmView();
CHAT_UI.showAddUserConfirmView();
};
</script>
</body> </body>
</html> </html>
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
</div> </div>
</div> </div>
<div class="chat_make_room"> <div class="chat_make_room">
<ul class="overlay_src_msg"> <ul class="overlay_src_msg" style="padding-inline-start: 20px;">
</ul> </ul>
</div> </div>
......
...@@ -182,6 +182,7 @@ ...@@ -182,6 +182,7 @@
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
CHAT_UI.loadMessages(CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.roomName); CHAT_UI.loadMessages(CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.roomName);
}; };
</script> </script>
......
$(function() {
// メンバー検索
$('#chat_add_user .search_form input[type="search"]').keyup(function(){
var isAllGroup = $('#tabAllGroupOnMakeRoom').is(':checked');
$('.overlay_src_msg').empty();
//全グループ検索画面
if (isAllGroup) {
var keyword = $('#chat_add_user .search_form input[type="search"]').val();
if (keyword == '') {
return;
}
//グループデータ検索
var groupList = CHAT_DB.getGroupByName(keyword);
var groupTemplate;
$.get({ url: "./template/template_make_room_group_list.html", async: false }
, function(text) {
groupTemplate = text;
});
groupList.forEach(function(group) {
let html = Mustache.render(groupTemplate, {
name: group.groupName,
id: group.groupId,
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
})
//ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword);
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
return shopMemberId == user.shopMemberId;
})
if (findObj) {
user.checked = 'checked';
}
});
let html = Mustache.render(userTemplate, {
userList: userList
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').append(obj);
  //連絡先画面
} else {
var keyword = $('#chat_add_user .search_form input[type="search"]').val();
if (keyword == '') {
return;
}
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
userList.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
return shopMemberId == user.shopMemberId;
})
if (findObj) {
user.checked = 'checked';
}
});
let html = Mustache.render(userTemplate, {
userList: userList
});
let obj = jQuery.parseHTML(html);
$('.overlay_src_msg').html(obj);
}
});
});
...@@ -46,6 +46,15 @@ CHAT_DB.getMessages = function(roomId) { ...@@ -46,6 +46,15 @@ CHAT_DB.getMessages = function(roomId) {
} }
}; };
CHAT_DB.getFavoriteUsersNotInRoom = function() {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsersNotInRoom());
}
};
CHAT_DB.getFavoriteUsers = function() { CHAT_DB.getFavoriteUsers = function() {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要 //TODO IOS処理追加必要
...@@ -109,6 +118,15 @@ CHAT_DB.getMyGroupShopMemberByName = function(shopMemberName) { ...@@ -109,6 +118,15 @@ CHAT_DB.getMyGroupShopMemberByName = function(shopMemberName) {
} }
}; };
CHAT_DB.getMyGroupShopMemberNotInRoomByName = function(shopMemberName) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupShopMemberNotInRoomByName(shopMemberName));
}
};
CHAT_DB.getAllGroupShopMemberByName = function(shopMemberName) { CHAT_DB.getAllGroupShopMemberByName = function(shopMemberName) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要 //TODO IOS処理追加必要
...@@ -118,6 +136,15 @@ CHAT_DB.getAllGroupShopMemberByName = function(shopMemberName) { ...@@ -118,6 +136,15 @@ CHAT_DB.getAllGroupShopMemberByName = function(shopMemberName) {
} }
}; };
CHAT_DB.getAllGroupShopMemberNotInRoomByName = function(shopMemberName) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getAllGroupShopMemberNotInRoomByName(shopMemberName));
}
};
CHAT_DB.getGroupByName = function(groupName) { CHAT_DB.getGroupByName = function(groupName) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要 //TODO IOS処理追加必要
...@@ -235,3 +262,12 @@ CHAT_DB.searchMessages = function(keyword, userList) { ...@@ -235,3 +262,12 @@ CHAT_DB.searchMessages = function(keyword, userList) {
return JSON.parse(android.searchMessages(keyword, userList)); return JSON.parse(android.searchMessages(keyword, userList));
} }
}; };
CHAT_DB.getMyGroupUsersNotInRoom = function() {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsersNotInRoom());
}
};
\ No newline at end of file
...@@ -565,12 +565,14 @@ CHAT_UI.scrollToLastMarkedUnseen = function(value) { ...@@ -565,12 +565,14 @@ CHAT_UI.scrollToLastMarkedUnseen = function(value) {
//loadingIndicatorを表示 //loadingIndicatorを表示
CHAT_UI.showLoadingIndicator = function() { CHAT_UI.showLoadingIndicator = function() {
$('.loading-indicator').css('display', 'block'); var h = $(window).height();
$('#loader-bg ,#loader').height(h).css('display','block');
} }
//loadingIndicatorを表示しない //loadingIndicatorを表示しない
CHAT_UI.dismissLoadingIndicator = function() { CHAT_UI.dismissLoadingIndicator = function() {
$('.loading-indicator').css('display', 'none'); var h = $(window).height();
$('#loader-bg ,#loader').height(h).css('display','none');
} }
//画面の方向をcheck //画面の方向をcheck
...@@ -892,9 +894,7 @@ $('#chatButton').on('click', function(event) { ...@@ -892,9 +894,7 @@ $('#chatButton').on('click', function(event) {
CHAT_UI.refreshContactScreen = function() { CHAT_UI.refreshContactScreen = function() {
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
$(".modal-backdrop").remove(); $('#userNameCard').modal('hide');
$('#myProfileModal').html('');
$('#userProfileModal').html('');
$('#favoriteList').html(''); $('#favoriteList').html('');
$('#myGroupList').html(''); $('#myGroupList').html('');
//画面タイトル設定 //画面タイトル設定
...@@ -997,6 +997,8 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -997,6 +997,8 @@ CHAT_UI.refreshContactScreen = function() {
} }
CHAT_UI.refreshRoomList = function(roomType) { CHAT_UI.refreshRoomList = function(roomType) {
CHAT_UI.showLoadingIndicator();
console.log('START');
if (roomType == chatRoomType.DM) { if (roomType == chatRoomType.DM) {
$('#tabDM').prop('checked', true); $('#tabDM').prop('checked', true);
} else { } else {
...@@ -1085,7 +1087,8 @@ CHAT_UI.refreshRoomList = function(roomType) { ...@@ -1085,7 +1087,8 @@ CHAT_UI.refreshRoomList = function(roomType) {
if (CHAT_UI.isLandscapeMode()) { if (CHAT_UI.isLandscapeMode()) {
$(".chat_list").removeClass("col-12").addClass("col-6"); $(".chat_list").removeClass("col-12").addClass("col-6");
} }
console.log('DONE');
CHAT_UI.dismissLoadingIndicator();
}; };
CHAT_UI.joinRoom = function(roomId,roomName) { CHAT_UI.joinRoom = function(roomId,roomName) {
...@@ -1256,6 +1259,11 @@ $('#makeRoomConfirmBtn').on('click', function(e) { ...@@ -1256,6 +1259,11 @@ $('#makeRoomConfirmBtn').on('click', function(e) {
$('#makeRoomForm').submit(); $('#makeRoomForm').submit();
}); });
$('#addUserConfirmBtn').on('click', function(e) {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
$('#addUserForm').submit();
});
CHAT_UI.favoriteUserChange = function(shopMemberId, star) { CHAT_UI.favoriteUserChange = function(shopMemberId, star) {
if ($(star).hasClass('active')) { if ($(star).hasClass('active')) {
CHAT_UI.removeFavoriteUser(shopMemberId); CHAT_UI.removeFavoriteUser(shopMemberId);
...@@ -1363,17 +1371,13 @@ CHAT_UI.refreshAllGroupSearch = function(paramGroupId) { ...@@ -1363,17 +1371,13 @@ CHAT_UI.refreshAllGroupSearch = function(paramGroupId) {
groupPathTemplate = text; groupPathTemplate = text;
}); });
var groupPathCount = 0;
result.groupPathList.forEach(function(groupPath) { result.groupPathList.forEach(function(groupPath) {
if (!(groupPathCount < (result.groupPathList.length - 3))) { let html = Mustache.render(groupPathTemplate, {
let html = Mustache.render(groupPathTemplate, { name: groupPath.groupName,
name: groupPath.groupName, id: groupPath.groupId
id: groupPath.groupId });
}); let obj = jQuery.parseHTML(html);
let obj = jQuery.parseHTML(html); $('#groupPathArea').append(obj);
$('#groupPathArea').append(obj);
}
groupPathCount++;
}) })
//該当グループの下位グループ表示。 //該当グループの下位グループ表示。
...@@ -1834,7 +1838,6 @@ CHAT_UI.refreshAllGroupForMakeRoom = function(groupId) { ...@@ -1834,7 +1838,6 @@ CHAT_UI.refreshAllGroupForMakeRoom = function(groupId) {
}; };
CHAT_UI.checkForMakeChat = function(checkMemberId) { CHAT_UI.checkForMakeChat = function(checkMemberId) {
var nameInfo = CHAT_DB.getNameCardData(checkMemberId);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) { let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
return shopMemberId == checkMemberId; return shopMemberId == checkMemberId;
}) })
...@@ -1845,13 +1848,12 @@ CHAT_UI.checkForMakeChat = function(checkMemberId) { ...@@ -1845,13 +1848,12 @@ CHAT_UI.checkForMakeChat = function(checkMemberId) {
}); });
} else { } else {
// add // add
CHAT.globalSelectedUserList.push(nameInfo.shopMemberId); CHAT.globalSelectedUserList.push(checkMemberId);
} }
if($('.checkbox' + checkMemberId).prop('checked')){ if($('.checkbox' + checkMemberId).prop('checked')){
$('.checkbox' + checkMemberId).attr('checked', true); $('.checkbox' + checkMemberId).removeAttr('checked');
}else{ }else{
$('.checkbox' + checkMemberId).removeAttr('checked'); $('.checkbox' + checkMemberId).attr('checked', true);
} }
let cnt = CHAT.globalSelectedUserList.length; let cnt = CHAT.globalSelectedUserList.length;
if (CHAT.globalSelectedUserList.length > 0) { if (CHAT.globalSelectedUserList.length > 0) {
...@@ -1872,7 +1874,6 @@ CHAT_UI.showMakeRoomConfirmView = function() { ...@@ -1872,7 +1874,6 @@ CHAT_UI.showMakeRoomConfirmView = function() {
var selectedUserList = CHAT_DB.loadSelectedUsers(); var selectedUserList = CHAT_DB.loadSelectedUsers();
console.log("check = " + selectedUserList);
selectedUserList.forEach(function(user){ selectedUserList.forEach(function(user){
let html = Mustache.render(userTemplate, { let html = Mustache.render(userTemplate, {
id: user.shopMemberId, id: user.shopMemberId,
...@@ -1950,4 +1951,139 @@ CHAT_UI.showMakeRoomConfirmView = function() { ...@@ -1950,4 +1951,139 @@ CHAT_UI.showMakeRoomConfirmView = function() {
} }
}); });
}
CHAT_UI.showAddUserConfirmView = function() {
$('#selectedUserList').html('');
var userTemplate;
$.get({ url: "./template/template_add_user_confirm_user_list.html", async: false }
, function(text) {
userTemplate = text;
}
);
var selectedUserList = CHAT_DB.loadSelectedUsers();
console.log("check = " + selectedUserList);
selectedUserList.forEach(function(user){
let html = Mustache.render(userTemplate, {
id: user.shopMemberId,
profileImage: CHAT.getProfileImgUrl(user.profileUrl),
name: user.shopMemberName
});
let obj = jQuery.parseHTML(html);
$('#selectedUserList').append(obj);
})
$("#addUserBtn").off().on('click', function() {
CHAT_UI.showLoadingIndicator();
let userIdList = new Array();
selectedUserList.forEach(function(user){
userIdList.push(user.shopMemberId);
})
android.inviteUsers(userIdList.join(','));
});
}
CHAT_UI.refreshMyGroupForAddUser = function() {
$(".modal-backdrop").remove();
$('#favoriteListForMakeRoom').html('');
$('#myGroupListForMakeRoom').html('');
//画面タイトル設定
let contactListTitle = getLocalizedString("userSearch");
$('#title').text(contactListTitle);
// グループの様式を読み込む
var groupTemplate;
$.get({ url: "./template/template_make_room_group_list.html", async: false }
, function(text) {
groupTemplate = text;
});
// ユーザの様式を読み込む
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
var groupUserTemplate;
$.get({ url: "./template/template_make_room_group_user_list.html", async: false }
, function(text) {
groupUserTemplate = text;
});
if (IS_ONLINE == 'true') {
android.updateGroupInfo('0');
android.updateMyInfo();
android.updateGroupUser();
android.updateFavorite();
}
//お気に入りグループ取得。
var favoriteGroupList = CHAT_DB.getFavoriteGroups();
favoriteGroupList.forEach(function(favoriteGroup) {
let html = Mustache.render(groupTemplate, {
name: favoriteGroup.groupName,
id: favoriteGroup.groupId,
});
let obj = $(jQuery.parseHTML(html)).on('click', function() {
});
$('#favoriteListForMakeRoom').append(obj);
})
//お気に入りユーザ取得。
var favoriteUserList = CHAT_DB.getFavoriteUsersNotInRoom();
favoriteUserList.forEach(function(favoriteUser) {
favoriteUser.profileUrl = CHAT.getProfileImgUrl(favoriteUser.profileUrl);
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
return shopMemberId == favoriteUser.shopMemberId;
})
if (findObj) {
favoriteUser.checked = 'checked';
}
});
let html = Mustache.render(userTemplate, {
userList: favoriteUserList
});
let obj = jQuery.parseHTML(html);
$('#favoriteListForMakeRoom').append(obj);
/*favoriteUserList.forEach(function(favoriteUser) {
favoriteUser.profileImagePath = CHAT.getProfileImgUrl(favoriteUser.profileUrl)
let html = Mustache.render(userTemplate, {
shopMemberId: favoriteUser.shopMemberId,
profileImage: favoriteUser.profileImagePath,
name: favoriteUser.shopMemberName,
isFavorite: true
});
let obj = $(jQuery.parseHTML(html)).on('click', function() {
});
$('#favoriteList').append(obj);
})*/
var myGroupList = CHAT_DB.getMyGroupUsersNotInRoom();
myGroupList.forEach(function(myGroup) {
myGroup.groupUserList.forEach(function(groupUser) {
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl)
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
return shopMemberId == groupUser.shopMemberId;
})
if (findObj) {
groupUser.checked = 'checked';
}
})
let html = Mustache.render(groupUserTemplate, {
groupName: myGroup.groupName,
groupUserList: myGroup.groupUserList
});
let obj = $(jQuery.parseHTML(html)).on('click', function() {
});
$('#myGroupListForMakeRoom').append(obj);
})
} }
\ No newline at end of file
...@@ -326,7 +326,8 @@ $(function() { ...@@ -326,7 +326,8 @@ $(function() {
let roomListTitle = getLocalizedString("roomListTitle"); let roomListTitle = getLocalizedString("roomListTitle");
$('#chatTitle').text(roomListTitle); $('#chatTitle').text(roomListTitle);
}); });
$('#chatMakeRoom .search_form .cancel').click(function(){
$('#chat_add_user .search_form .cancel').click(function(){
CHAT.globalSelectedUserList.forEach(function(userId) { CHAT.globalSelectedUserList.forEach(function(userId) {
if ($('.checkbox' + userId).prop('checked')) { if ($('.checkbox' + userId).prop('checked')) {
$('.checkbox' + checkMemberId).attr('checked', true); $('.checkbox' + checkMemberId).attr('checked', true);
...@@ -399,16 +400,6 @@ $(function() { ...@@ -399,16 +400,6 @@ $(function() {
$('.overlay_src_msg').html(data); $('.overlay_src_msg').html(data);
}) })
}); });
// ユーザー招待メンバー検索
$('#chat_add_user .search_form input[type="search"]').keyup(function(){
$.ajax({
url: 'search_message_user_list.html',
type: 'POST',
datatype: 'html'
}).done(function (data) {
$('.overlay_src_msg').html(data);
})
});
// チャットルーム // チャットルーム
// メッセージ検索イベント // メッセージ検索イベント
......
<ul class="p-0 chat_make_room_list">
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l">
<div class="thumbnail">
<div class="img_wrap"><img src="{{profileImage}}" onError="this.src='./img/noImage.png'"/></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">{{name}}</span>
</div>
</div>
</div>
</div>
</li>
</ul>
\ No newline at end of file
<ul class="p-0 chat_make_room_list">
{{#userList}}
<li class="d-flex align-items-center">
<div class="chat_item d-flex flex-row align-items-center w-100">
<div class="chat_item_l_chk">
<div class="checkbox">
<label>
<input type="checkbox" id="checkbox{{shopMemberId}}" name="checkbox[]" class="checkbox-input checkbox{{shopMemberId}}" onchange="CHAT_UI.checkForMakeChat({{shopMemberId}});" {{checked}}>
<span class="checkbox-parts"></span>
</label>
</div>
</div>
<div class="chat_item_l">
<div class="thumbnail">
<div class="img_wrap"><img src="{{profileUrl}}" onError="this.src='./img/noImage.png'" /></div>
</div>
</div>
<div class="chat_item_m">
<div class="d-flex flex-column">
<div class="chat_item_t">
<span class="chat_item_ttl">{{shopMemberName}}</span>
</div>
</div>
</div>
</div>
</li>
{{/userList}}
</ul>
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="chat_item_l_chk"> <div class="chat_item_l_chk">
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="checkbox" id="checkbox{{shopMemberId}}" name="checkbox[]" class="checkbox-input" onchange="CHAT_UI.checkForMakeChat({{shopMemberId}});" {{checked}}> <input type="checkbox" id="checkbox{{shopMemberId}}" name="checkbox[]" class="checkbox-input checkbox{{shopMemberId}}" onchange="CHAT_UI.checkForMakeChat({{shopMemberId}});" {{checked}}>
<span class="checkbox-parts"></span> <span class="checkbox-parts"></span>
</label> </label>
</div> </div>
......
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