Commit b977262b by Lee Munkyeong

add-user

parent 7194ca24
......@@ -121,7 +121,6 @@
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
}
let CHAT_SERVER_URL = '';
let CMS_SERVER_URL = '';
let ASSET_PATH = './';
......@@ -140,6 +139,7 @@
IS_ONLINE = isOnline;
console.log("onChat");
CHAT_UI.refreshRoomList(chatRoomType.GROUP);
CHAT_UI.dismissLoadingIndicator();
};
</script>
</body>
......
......@@ -137,11 +137,11 @@
<script src="./js/language_ja.js" charset="UTF-8"></script>
<script src="./js/language_en.js" charset="UTF-8"></script>
<script src="./js/constant.js"></script>
<script src="./js/chatMakeRoom.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 src="./js/chat-add-user.js"></script>
<script>
String.prototype.replaceAll = function(org, dest) {
return this.split(org).join(dest);
......
......@@ -182,6 +182,7 @@
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
CHAT_UI.loadMessages(CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.roomName);
};
</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);
}
});
});
......@@ -118,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) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
......@@ -127,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) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
......
......@@ -565,12 +565,14 @@ CHAT_UI.scrollToLastMarkedUnseen = function(value) {
//loadingIndicatorを表示
CHAT_UI.showLoadingIndicator = function() {
$('.loading-indicator').css('display', 'block');
var h = $(window).height();
$('#loader-bg ,#loader').height(h).css('display','block');
}
//loadingIndicatorを表示しない
CHAT_UI.dismissLoadingIndicator = function() {
$('.loading-indicator').css('display', 'none');
var h = $(window).height();
$('#loader-bg ,#loader').height(h).css('display','none');
}
//画面の方向をcheck
......@@ -892,9 +894,7 @@ $('#chatButton').on('click', function(event) {
CHAT_UI.refreshContactScreen = function() {
CHAT_UI.showLoadingIndicator();
$(".modal-backdrop").remove();
$('#myProfileModal').html('');
$('#userProfileModal').html('');
$('#userNameCard').modal('hide');
$('#favoriteList').html('');
$('#myGroupList').html('');
//画面タイトル設定
......@@ -997,6 +997,8 @@ CHAT_UI.refreshContactScreen = function() {
}
CHAT_UI.refreshRoomList = function(roomType) {
CHAT_UI.showLoadingIndicator();
console.log('START');
if (roomType == chatRoomType.DM) {
$('#tabDM').prop('checked', true);
} else {
......@@ -1085,7 +1087,8 @@ CHAT_UI.refreshRoomList = function(roomType) {
if (CHAT_UI.isLandscapeMode()) {
$(".chat_list").removeClass("col-12").addClass("col-6");
}
console.log('DONE');
CHAT_UI.dismissLoadingIndicator();
};
CHAT_UI.joinRoom = function(roomId,roomName) {
......@@ -1360,17 +1363,13 @@ CHAT_UI.refreshAllGroupSearch = function(groupId) {
groupPathTemplate = text;
});
var groupPathCount = 0;
result.groupPathList.forEach(function(groupPath) {
if (!(groupPathCount < (result.groupPathList.length - 3))) {
let html = Mustache.render(groupPathTemplate, {
name: groupPath.groupName,
id: groupPath.groupId
});
let obj = jQuery.parseHTML(html);
$('#groupPathArea').append(obj);
}
groupPathCount++;
let html = Mustache.render(groupPathTemplate, {
name: groupPath.groupName,
id: groupPath.groupId
});
let obj = jQuery.parseHTML(html);
$('#groupPathArea').append(obj);
})
//該当グループの下位グループ表示。
......
......@@ -336,6 +336,16 @@ $(function() {
});
});
$('#chat_add_user .search_form .cancel').click(function(){
CHAT.globalSelectedUserList.forEach(function(userId) {
if ($('.checkbox' + userId).prop('checked')) {
$('.checkbox' + checkMemberId).attr('checked', true);
} else {
$('.checkbox' + checkMemberId).removeAttr('checked');
}
});
});
// チャットメンバー検索
$('#chat .search_form input[type="search"]').keyup(function(){
$('.overlay_src_msg').empty();
......@@ -399,16 +409,6 @@ $(function() {
$('.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);
})
});
// チャットルーム
// メッセージ検索イベント
......
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