Commit 6638f5dd by Lee Munkyeong

Merge branch 'release_sp3' of gitlab.agentec.jp:abookCommunication/chat_webview…

Merge branch 'release_sp3' of gitlab.agentec.jp:abookCommunication/chat_webview into features/release_sp3_collaboration_picture

# Conflicts:
#	public_new/js/constant.js
parents fbb06052 5b59f0d6
......@@ -30,7 +30,7 @@
<div class="col-4 pr-0">
<div class="nav-item">
<div class="nav_prev">
<a href="#"><span>ホーム</span></a>
<a href="#" class="home_btn"><span>ホーム</span></a>
</div>
</div>
</div>
......
......@@ -198,6 +198,8 @@
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
......
......@@ -53,10 +53,10 @@
<!-- タブ -->
<div class="content tabs">
<input id="tabMyGroupOnMakeRoom" type="radio" name="tab_item" checked>
<label class="tab_item" for="tabMyGroupOnMakeRoom">マイグループ</label>
<input id="tabAllGroupOnMakeRoom" type="radio" name="tab_item">
<label class="tab_item" for="tabAllGroupOnMakeRoom">全グループ</label>
<input id="tabMyGroupOnAddUser" type="radio" name="tab_item" checked>
<label class="tab_item" for="tabMyGroupOnAddUser">マイグループ</label>
<input id="tabAllGroupOnAddUser" type="radio" name="tab_item">
<label class="tab_item" for="tabAllGroupOnAddUser">全グループ</label>
<div class="tab_content" id="tab1_content">
<div class="chat_list">
<!-- お気に入りグループ -->
......@@ -154,8 +154,14 @@
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
android.getLoginParameter();
android.getGlobalParameter();
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
......
......@@ -85,8 +85,13 @@
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
android.getLoginParameter();
android.getGlobalParameter();
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
......
......@@ -86,8 +86,13 @@
let IS_ONLINE = false;
let roomId = 0;
$("#loadingArea").load("./loading.html");
android.getLoginParameter();
android.getGlobalParameter();
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
......
......@@ -91,8 +91,14 @@
let PLATFORM = '';
let IS_MOBILE = true;
let IS_ONLINE = false;
android.getLoginParameter();
android.getGlobalParameter();
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
......
......@@ -22,9 +22,9 @@
<nav>
<div class="chat_room_src_form none">
<div class="d-flex flex-row h-100 align-items-center">
<input type="search" name="search" placeholder="ユーザー検索">
<input type="search" name="search" id="searchMessage" placeholder="メッセージ検索">
<span class="src_icon"></span>
<a href="#" class="cancel">キャンセル</a>
<a href="#" class="cancel" id="messageSearchCancle">キャンセル</a>
</div>
</div>
<div class="row nav_item_wrap h-100 align-items-center">
......@@ -58,7 +58,7 @@
<!-- フィルター -->
<div id="filter" class="user_list filter d-flex flex-row none"></div>
<div class="chat_list">
<div class="chat_list none" id="searchList">
<ul class="overlay_src_msg">
</ul>
</div>
......
......@@ -56,31 +56,30 @@
<input id="tabAllGroup" type="radio" name="tab_item">
<label class="tab_item" for="tabAllGroup">全グループ</label>
<div class="content chat_list my_info_sell">
<ul class="p-0 chat_make_room_list">
<li class="d-flex align-items-center">
<a href="#" style="width: 100%;">
<div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l">
<div class="thumbnail">
<div class="img_wrap"><img id="myImg" src="img/noImage.png" onError="this.src='./img/noImage.png'" /></div>
<!-- タブ -->
<div class="tab_content" id="tab1_content">
<div class="content chat_list my_info_sell">
<ul class="p-0 chat_make_room_list">
<li class="d-flex align-items-center">
<a href="#" style="width: 100%;">
<div class="chat_item d-flex flex-row align-items-center" style="background: none !important;">
<div class="chat_item_l">
<div class="thumbnail">
<div class="img_wrap"><img id="myImg" src="img/noImage.png" onError="this.src='./img/noImage.png'" /></div>
</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" id="myName"></span>
<div class="chat_item_m px-0">
<div class="d-flex flex-column">
<div class="chat_item_t">
<span class="chat_item_ttl" id="myName"></span>
</div>
</div>
</div>
</div>
</div>
</a>
</li>
</ul>
</div>
<!-- タブ -->
<div class="tab_content" id="tab1_content">
</a>
</li>
</ul>
</div>
<div class="chat_list" id="myContactList">
<!-- お気に入りグループ -->
<div class="category"><div class="category_name"><span>お気に入り</span></div></div>
......@@ -204,6 +203,7 @@
let IS_MOBILE = true;
let IS_ONLINE = false;
$("#loadingArea").load("./loading.html");
if (typeof(android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
......
......@@ -41,6 +41,11 @@ input[name="tab_item"] {
display: block;
}
#tabMyGroupOnAddUser:checked ~ #tab1_content,
#tabAllGroupOnAddUser:checked ~ #tab2_content{
display: block;
}
#tabMyGroup:checked ~ #tab1_content,
#tabAllGroup:checked ~ #tab2_content{
display: block;
......@@ -94,6 +99,10 @@ input[name="tab_item"] {
right: 0px;
}
#searchList {
margin-bottom: 140px;
overflow: hidden;
}
/* リスト */
.chat_list .chat_item:hover {
background: aliceblue;
......@@ -205,7 +214,10 @@ input[name="tab_item"] {
.already_read {
background-color: #f1f2f2;
}
/* ダウンロードボタン*/
.fa-download {
width: 100%;
}
/**************************** make room *************************/
.chat_list .category {
text-align: left;
......@@ -220,8 +232,7 @@ input[name="tab_item"] {
}
.category_name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
overflow: scroll;
width: 90%;
}
.chat_list .category.open::after {
......
......@@ -16,4 +16,5 @@
}
.my_info_sell {
clear: both;
display: block;
}
......@@ -58,7 +58,7 @@ CHAT_DB.getMessages = function(roomId) {
CHAT_DB.getFavoriteUsersNotInRoom = function() {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
return JSON.parse(callNativeApp("getFavoriteUsersNotInRoom", {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getFavoriteUsersNotInRoom());
......@@ -101,9 +101,18 @@ CHAT_DB.getGroupInfo = function(groupId) {
}
};
CHAT_DB.getGroupInfoForAddUser = function(groupId) {
if (CHAT_UTIL.isIOS()) {
//TODO getGroupInfoの処理でユーザ情報にルーム参加者が入ってない処理。
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfoForAddUser(groupId));
}
};
CHAT_DB.loadSelectedUsers = function() {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
return JSON.parse(callNativeApp("getSelectedUserList", {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
console.log(JSON.parse(android.getSelectedUserList()));
......@@ -130,7 +139,7 @@ CHAT_DB.getMyGroupShopMemberByName = function(shopMemberName) {
CHAT_DB.getMyGroupShopMemberNotInRoomByName = function(shopMemberName) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
return JSON.parse(callNativeApp("getMyGroupShopMemberNotInRoomByName", {"shopMemberName": shopMemberName}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupShopMemberNotInRoomByName(shopMemberName));
......@@ -148,7 +157,7 @@ CHAT_DB.getAllGroupShopMemberByName = function(shopMemberName) {
CHAT_DB.getAllGroupShopMemberNotInRoomByName = function(shopMemberName) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
return JSON.parse(callNativeApp("getAllGroupShopMemberNotInRoomByName", {"shopMemberName": shopMemberName}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getAllGroupShopMemberNotInRoomByName(shopMemberName));
......@@ -210,7 +219,7 @@ CHAT_DB.getArchiveDetail = function(archiveId) {
CHAT_DB.updateArchiveDetail = function(archiveId) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.updateArchiveDetail.postMessage({archiveId});
webkit.messageHandlers.updateArchiveDetail.postMessage(archiveId);
} else if (CHAT_UTIL.isAndroid()) {
android.updateArchiveDetail(archiveId);
}
......@@ -218,7 +227,7 @@ CHAT_DB.updateArchiveDetail = function(archiveId) {
CHAT_DB.searchMessages = function(keyword, userList) {
if (CHAT_UTIL.isIOS()) {
// TODO
return JSON.parse(callNativeApp("searchMessages", {"keyWord": keyword, "userList": userList}));
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.searchMessages(keyword, userList));
}
......@@ -226,7 +235,7 @@ CHAT_DB.searchMessages = function(keyword, userList) {
CHAT_DB.getMyGroupUsersNotInRoom = function() {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
return JSON.parse(callNativeApp("getMyGroupUsersNotInRoom", {}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsersNotInRoom());
......@@ -235,9 +244,59 @@ CHAT_DB.getMyGroupUsersNotInRoom = function() {
CHAT_DB.getUserInfo = function(shopMemberId) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
return JSON.parse(callNativeApp("getUserInfo", {"shopMemberId": shopMemberId}));
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getUserInfo(shopMemberId));
}
}
\ No newline at end of file
};
CHAT_DB.getBeforeRoomType = function() {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp("getBeforeRoomType", {});
}
};
CHAT_DB.getRoomType = function() {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp("getRoomType", {});
}
};
CHAT_DB.removeFavoriteUser = function(shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp("removeFavoriteUser", {"shopMemberId": shopMemberId});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.addFavoriteUser = function(shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp("addFavoriteUser", {"shopMemberId": shopMemberId});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.addFavoriteGroup = function(groupId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp("addFavoriteGroup", {"groupId": groupId});
if (result == "true") {
return true;
} else {
return false;
}
}
};
\ No newline at end of file
jQuery('#homeButton').on('click', function() {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要。
webkit.messageHandlers.goHome.postMessage({});
} else if (CHAT_UTIL.isAndroid()) {
android.goHome();
}
......
......@@ -15,7 +15,7 @@ $('#roomNameChangeBtn').click(function() {
//TODO validation
var changeRoomName = $('#roomNameInput').val();
if (CHAT_UTIL.isIOS()) {
//TODO
webkit.messageHandlers.changeRoomName.postMessage(changeRoomName);
} else if (CHAT_UTIL.isAndroid()) {
android.changeRoomName(changeRoomName);
}
......
......@@ -206,7 +206,7 @@ CHAT_UI.sendMessage = function(e) {
, 0
);
}
$('.message_input_group').focus();
$('.message_input_form').focus();
}
//メッセージ送信
$('#messageInput').on('keypress', function(event) {
......@@ -691,9 +691,9 @@ CHAT_UI.showConfirmView = function(isInvite) {
//todo android create room api
if (typeof(android) != "undefined") {
android.createChatRoom("1",userIdList.join(','),newRoomName);
android.createChatRoom("1", userIdList.join(','), newRoomName, makeRoomFlg.MAKE_ROOM);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName});
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM});
}
......@@ -784,8 +784,11 @@ CHAT_UI.showConfirmView = function(isInvite) {
// ルーム名のtrimmingした後、URIencodingを行う
const encodedRoomName = encodeURIComponent(trimmedRoomName);
android.createChatRoom("1",userIdList.join(','),encodedRoomName);
if (typeof(android) != "undefined") {
android.createChatRoom("1", userIdList.join(','), encodedRoomName, makeRoomFlg.MAKE_ROOM);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM});
}
}
}
}
......@@ -1020,11 +1023,15 @@ CHAT_UI.refreshRoomList = function(roomType) {
var beforeRoomType;
if (typeof(android) != "undefined") {
beforeRoomType = android.getBeforeRoomType();
} else {
beforeRoomType = CHAT_DB.getBeforeRoomType();
}
if (beforeRoomType != null) {
roomType = beforeRoomType;
if (typeof(android) != "undefined") {
android.clearBeforeRoomType();
} else {
webkit.messageHandlers.clearBeforeRoomType.postMessage({});
}
}
CHAT_UI.showLoadingIndicator();
......@@ -1129,7 +1136,7 @@ CHAT_UI.joinRoom = function(roomId,roomName) {
if (typeof(android) != "undefined") {
android.joinRoom(roomId,roomName);
} else {
webkit.messageHandlers.roomInfosaveMessageHandlerId.postMessage({"roomId": roomId, "roomName": roomName});
webkit.messageHandlers.joinRoom.postMessage({"roomId": roomId, "roomName": roomName});
}
};
......@@ -1139,12 +1146,17 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
if (typeof(android) != "undefined") {
android.updateMessages(roomId);
} else {
webkit.messageHandlers.updateMessages.postMessage({roomId});
webkit.messageHandlers.updateMessages.postMessage(roomId);
}
} else {
CHAT_UI.refreshForOffline();
}
var roomType = android.getRoomType();
var roomType;
if (typeof(android) != "undefined") {
roomType = android.getRoomType();
} else {
roomType = CHAT_DB.getRoomType();
}
if (roomType == chatRoomType.DM) {
$('#roomMenu').removeClass('none');
}
......@@ -1319,18 +1331,39 @@ $('#tabAllGroupOnMakeRoom').on('click', function(e) {
CHAT_UI.refreshAllGroupForMakeRoom('0');
});
$('#tabMyGroupOnAddUser').on('click', function(e) {
CHAT_UI.refreshMyGroupForAddUser();
});
$('#tabAllGroupOnAddUser').on('click', function(e) {
CHAT_UI.refreshAllGroupForAddUser('0');
});
$('#makeRoomConfirmBtn').on('click', function(e) {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
if (typeof(android) != "undefined") {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
} else {
var userList = CHAT.globalSelectedUserList.join(",");
webkit.messageHandlers.saveSelectedUserList.postMessage(userList);
}
$('#makeRoomForm').submit();
});
$('#addUserConfirmBtn').on('click', function(e) {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
if (typeof(android) != "undefined") {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
} else {
var userList = CHAT.globalSelectedUserList.join(",");
webkit.messageHandlers.saveSelectedUserList.postMessage(userList);
}
$('#addUserForm').submit();
});
CHAT_UI.roomDisplayOff = function() {
android.roomDisplayOff();
if (typeof(android) != "undefined") {
android.roomDisplayOff();
} else {
webkit.messageHandlers.roomDisplayOff.postMessage({});
}
}
CHAT_UI.favoriteUserChange = function(shopMemberId, star) {
......@@ -1353,17 +1386,16 @@ CHAT_UI.removeFavoriteUser = function(shopMemberId) {
CHAT_UI.showLoadingIndicator();
$('#userNameCard').modal('hide');
$('#myNameCard').modal('hide');
var result;
if (typeof(android) != "undefined") {
var result = android.removeFavoriteUser(shopMemberId);
if (!result) {
$('.shopmember_'+shopMemberId).addClass('active');
$('.shopmember_'+shopMemberId).removeClass('disable');
} else {
$('.shopmember_'+shopMemberId).removeClass('active');
$('.shopmember_'+shopMemberId).addClass('disable');
}
result = android.removeFavoriteUser(shopMemberId);
} else {
result = CHAT_DB.removeFavoriteUser(shopMemberId);
}
if (!result) {
$('.shopmember_'+shopMemberId).addClass('active');
$('.shopmember_'+shopMemberId).removeClass('disable');
} else {
webkit.messageHandlers.removeFavoriteUser.postMessage({shopMemberId});
$('.shopmember_'+shopMemberId).removeClass('active');
$('.shopmember_'+shopMemberId).addClass('disable');
}
......@@ -1373,7 +1405,12 @@ CHAT_UI.removeFavoriteUser = function(shopMemberId) {
CHAT_UI.insertFavoriteUser = function(shopMemberId) {
$('#userNameCard').modal('hide');
$('#myNameCard').modal('hide');
var result = android.addFavoriteUser(shopMemberId);
var result;
if (typeof(android) != "undefined") {
result = android.addFavoriteUser(shopMemberId);
} else {
result = CHAT_DB.addFavoriteUser(shopMemberId);
}
if (!result) {
$('.shopmember_'+shopMemberId).addClass('disable');
$('.shopmember_'+shopMemberId).removeClass('active');
......@@ -1390,7 +1427,7 @@ CHAT_UI.removeFavoriteGroup = function(groupId) {
if (typeof(android) != "undefined") {
android.removeFavoriteGroup(groupId);
} else {
webkit.messageHandlers.removeFavoriteGroup.postMessage({groupId});
webkit.messageHandlers.removeFavoriteGroup.postMessage(groupId);
}
$('.group_'+groupId).removeClass('active');
$('.group_'+groupId).addClass('disable');
......@@ -1399,7 +1436,12 @@ CHAT_UI.removeFavoriteGroup = function(groupId) {
CHAT_UI.insertFavoriteGroup = function(groupId) {
CHAT_UI.showLoadingIndicator();
var result = android.addFavoriteGroup(groupId);
var result;
if (typeof(android) != "undefined") {
result = android.addFavoriteGroup(groupId);
} else {
result = CHAT_DB.addFavoriteGroup(groupId);
}
if (!result) {
$('.group_'+groupId).addClass('disable');
$('.group_'+groupId).removeClass('active');
......@@ -1425,7 +1467,7 @@ CHAT_UI.refreshAllGroupSearch = function(paramGroupId) {
$('.overlay_src_msg').empty();
$('#contactSearch').attr('placeholder', getLocalizedString('searchUserAndGroup'));
$('#tabAllGroup').prop('checked', true);
//オンライン状態であればサーバから情報更新。
if (IS_ONLINE == 'true') {
if (typeof(android) != "undefined") {
......@@ -1526,9 +1568,9 @@ CHAT_UI.startChat = function(userShopMemberId,userName) {
// 参加ユーザ名でルーム名を生成
let newRoomName = CHAT.globalLoginParameter.loginId + ',' +userName;
if (typeof(android) != "undefined") {
android.createChatRoom(chatRoomType.DM, userIdList.join(','),newRoomName);
android.createChatRoom(chatRoomType.DM, userIdList.join(','),newRoomName, makeRoomFlg.NAME_CARD);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": chatRoomType.DM, "userIdList": userIdList.join(','), "roomName": newRoomName});
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.NAME_CARD});
}
CHAT_UI.hideNamecard(nameCardAreaId.USER);
};
......@@ -1539,6 +1581,9 @@ CHAT_UI.startVoice = function() {
CHAT_UI.makeNameCard = function(shopMemberId) {
if (CHAT.globalLoginParameter.shopMemberId == shopMemberId) {
return;
}
var nameCardInfo = CHAT_DB.getNameCardData(shopMemberId);
var namecardTemplate;
$.get({ url: "./template/template_user_name_card.html", async: false }
......@@ -1678,7 +1723,7 @@ CHAT_UI.refreshArchiveDetailScreen = function(archiveId) {
case "2": // 音声
case 2:
$('#archive_player').prepend('<audio class="archive_audio_player" src=' + archiveFilePath + ' controls></audio>');
$('#archive_player').prepend('<img class="archive_player" src=' + "https://via.placeholder.com/1280x720" + ' />');
$('#archive_player').prepend('<img class="archive_player" src=' + "./img/capture.png" + ' />');
break;
case "3": // 文書
case 3:
......@@ -1693,7 +1738,8 @@ CHAT_UI.refreshArchiveDetailScreen = function(archiveId) {
// 参加ユーザ情報を表示
let attendUserList = archive.attendUserIds;
if (CHAT_UTIL.isAndroid()) {
if (typeof(android) != "undefined") {
// ios実装不要
attendUserList = JSON.parse(archive.attendUserIds);
}
......@@ -1755,10 +1801,17 @@ CHAT_UI.refreshMyGroupForMakeRoom = function() {
});
if (IS_ONLINE == 'true') {
android.updateGroupInfo('0');
android.updateMyInfo();
android.updateGroupUser();
android.updateFavorite();
if (typeof(android) != "undefined") {
android.updateGroupInfo('0');
android.updateMyInfo();
android.updateGroupUser();
android.updateFavorite();
} else {
webkit.messageHandlers.updateGroupInfo.postMessage("0");
webkit.messageHandlers.updateMyInfo.postMessage({});
webkit.messageHandlers.updateGroupUser.postMessage({});
webkit.messageHandlers.updateFavorite.postMessage({});
}
}
//お気に入りグループ取得。
......@@ -2000,8 +2053,11 @@ CHAT_UI.showMakeRoomConfirmView = function() {
// 参加ユーザ名でルーム名を生成
let newRoomName = CHAT.globalLoginParameter.loginId + ',' + userNameList.join(',');
android.createChatRoom("1",userIdList.join(','),newRoomName);
if (typeof(android) != "undefined") {
android.createChatRoom("1", userIdList.join(','), newRoomName, makeRoomFlg.MAKE_ROOM);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM});
}
} else if(trimmedRoomName.includes(';') || trimmedRoomName.includes('/') || trimmedRoomName.includes('?') || trimmedRoomName.includes(':') || trimmedRoomName.includes("@")
|| trimmedRoomName.includes('&') || trimmedRoomName.includes('=') || trimmedRoomName.includes("+") || trimmedRoomName.includes('$') || trimmedRoomName.includes(",") || trimmedRoomName.includes('-')
|| trimmedRoomName.includes('_') || trimmedRoomName.includes('.') || trimmedRoomName.includes('!') || trimmedRoomName.includes('~') || trimmedRoomName.includes('*') || trimmedRoomName.includes("\'")
......@@ -2044,8 +2100,11 @@ CHAT_UI.showMakeRoomConfirmView = function() {
// ルーム名のtrimmingした後、URIencodingを行う
const encodedRoomName = encodeURIComponent(trimmedRoomName);
android.createChatRoom("1",userIdList.join(','),encodedRoomName);
if (typeof(android) != "undefined") {
android.createChatRoom("1", userIdList.join(','), trimmedRoomName, makeRoomFlg.MAKE_ROOM);
} else {
webkit.messageHandlers.createChatRoom.postMessage({"roomType": "1", "userIdList": userIdList.join(','), "roomName": newRoomName, "screenFlg": makeRoomFlg.MAKE_ROOM});
}
}
});
}
......@@ -2079,7 +2138,11 @@ CHAT_UI.showAddUserConfirmView = function() {
selectedUserList.forEach(function(user){
userIdList.push(user.shopMemberId);
})
android.inviteUsers(userIdList.join(','));
if (typeof(android) != "undefined") {
android.inviteUsers(userIdList.join(','));
} else {
webkit.messageHandlers.inviteUsers.postMessage({"userIdList": userIdList.join(',')});
}
});
}
......@@ -2112,10 +2175,17 @@ CHAT_UI.refreshMyGroupForAddUser = function() {
});
if (IS_ONLINE == 'true') {
android.updateGroupInfo('0');
android.updateMyInfo();
android.updateGroupUser();
android.updateFavorite();
if (typeof(android) != "undefined") {
android.updateGroupInfo('0');
android.updateMyInfo();
android.updateGroupUser();
android.updateFavorite();
} else {
webkit.messageHandlers.updateGroupInfo.postMessage("0");
webkit.messageHandlers.updateMyInfo.postMessage({});
webkit.messageHandlers.updateGroupUser.postMessage({});
webkit.messageHandlers.updateFavorite.postMessage({});
}
}
//お気に入りグループ取得。
......@@ -2170,6 +2240,116 @@ CHAT_UI.refreshMyGroupForAddUser = function() {
})
}
CHAT_UI.refreshAllGroupForAddUser = function(paramGroupId) {
var groupId = paramGroupId;
$('.cancel').addClass('none');
$('.search_form input').removeClass('focus');
$('.search_form input').val('');
$('.search_form form').removeClass();
$('.content').removeClass('none');
$('.overlay_src_msg').empty();
$('#tabAllGroupOnAllUser').prop('checked', true);
//オンライン状態であればサーバから情報更新。
if (IS_ONLINE == 'true') {
if (typeof(android) != "undefined") {
android.updateGroupInfo(groupId);
} else {
webkit.messageHandlers.updateGroupInfo.postMessage(groupId);
}
}
//画面エリアを初期化。
$('#parentGroupBtnForMakeRoom').off();
$('#rootGroupBtnForMakeRoom').off();
$('#childGroupListAreaForMakeRoom').html('');
$('#userInGroupListForMakeRoom').html('');
$('#groupPathAreaForMakeRoom').html('');
//DBからグループ情報を取得。
var result = CHAT_DB.getGroupInfoForAddUser(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== 'undefined') {
$('#parentGroupBtnForMakeRoom').on('click', function() {
CHAT_UI.refreshAllGroupForAddUser(result.parentGroupId);
});
}
if (typeof result.rootGroupId !== 'undefined') {
if (paramGroupId == 0) { groupId = result.rootGroupId }
$('#rootGroupBtnForMakeRoom').on('click', function() {
CHAT_UI.refreshAllGroupForAddUser(result.rootGroupId);
});
}
if (groupId == result.rootGroupId || paramGroupId == '0') {
$('#rootGroupArea').addClass('none');
$('#parentGroupArea').addClass('none');
} else {
$('#rootGroupArea').removeClass('none');
$('#parentGroupArea').removeClass('none');
}
//該当グループのパースを表示。
var groupPathTemplate;
$.get({ url: "./template/template_make_room_group_path.html", async: false }
, function(text) {
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);
$('#groupPathAreaForMakeRoom').append(obj);
}
groupPathCount++;
})
//該当グループの下位グループ表示。
var groupTemplate;
$.get({ url: "./template/template_make_room_group_list.html", async: false }
, function(text) {
groupTemplate = text;
});
result.childGroupList.forEach(function(childGroup) {
let html = Mustache.render(groupTemplate, {
name: childGroup.groupName,
id: childGroup.groupId,
});
let obj = $(jQuery.parseHTML(html)).on('click', function() {
});
$('#childGroupListAreaForMakeRoom').append(obj);
})
//該当グループの所属ユーザを表示。
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
result.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(userTemplate, {
userList: result.groupUserList
});
let obj = jQuery.parseHTML(html);
$('#userInGroupListForMakeRoom').append(obj);
};
CHAT_UI.refreshForOnline = function() {
IS_ONLINE = 'true';
$('.craeteRoomButton').show();
......@@ -2179,6 +2359,7 @@ CHAT_UI.refreshForOnline = function() {
$('#roomMenu').show();
$('.attach_file').show();
$('.fa-download').show();
$('.chat_room_footer').show();
if (typeof $('#roomTitle').val() != 'undefined') {
CHAT_SOCKET.connectSocket();
socket.emit('join', CHAT.globalLoginParameter, function() {
......@@ -2195,4 +2376,12 @@ CHAT_UI.refreshForOffline = function() {
$('#roomMenu').hide();
$('.attach_file').hide();
$('.fa-download').hide();
$('.chat_room_footer').hide();
}
CHAT_UI.displayExistRoom = function(roomId) {
if (confirm('error_already_exist_same_user')) {
android.joinRoom(roomId, '');
}
return;
}
\ No newline at end of file
......@@ -293,6 +293,10 @@ $(function() {
// フィルタ表示
$('#filter').removeClass('none');
$('#user_list').addClass('none');
$('.chat_room_src_form input[type="search"]').focus();
$('#searchMessage').addClass('onfocus');
$('.chat_list').removeClass('none');
});
$('.chat_room_src_form .cancel').click(function(){
$('.nav_item_wrap').removeClass('none');
......@@ -303,10 +307,28 @@ $(function() {
// ユーザーリスト表示
$('#filter').addClass('none');
$('#user_list').removeClass('none');
$('.chat_room_src_form input[type="search"]').blur();
$('#searchMessage').removeClass('onfocus');
$('.chat_list').addClass('none');
});
$('.chat_room_src_form input[type="search"]').click(function() {
if($('#searchMessage').hasClass('onfocus')) {
$('#searchMessage').removeClass('onfocus');
$('#searchMessage').blur();
} else {
$('#searchMessage').addClass('onfocus');
$('#searchMessage').focus();
}
})
$('#searchMessage').blur(function() {
$('#searchMessage').removeClass('onfocus');
})
// フィルタ選択イベント
$('#filter .img_wrap').click(function(){
$(document).on('click', '#filter .img_wrap', function(event) {
// チェックアイコン追加
$(this).toggleClass("filter");
});
......@@ -494,12 +516,13 @@ $(function() {
jQueryMessages.append(noResultMsg);
}
if (e.key == "Enter" || e.KeyCode == 13) {
$('#contact .search_form input[type="search"]').blur();
$('#searchMessage').removeClass('onfocus');
$('.chat_room_src_form input[type="search"]').blur();
return;
}
});
$('.filter_img').on('click', function() {
$(document).on('click', '.filter_img', function(event) {
let workVal = "";
var keyword = $('.chat_room_src_form input[type="search"]').val();
$('.overlay_src_msg').empty();
......
......@@ -5,7 +5,11 @@ $('.category').on('click', function() {
});
$('.home_btn').on('click', function() {
android.goHome();
if (CHAT_UTIL.isAndroid()) {
android.goHome();
} else if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.goHome.postMessage({});
}
});
$(function() {
var h = $(window).height(); //画面の高さを取得
......@@ -42,7 +46,7 @@ $(function() {
$('.craeteRoomButton').removeClass('none');
});
$('.message_input_form').click(function(){
$('.message_input_form').on('focus',function(e){
$('.message_input_send').removeClass('none');
$('.attach_file').addClass('none');
$('.footer_content_b').addClass('none');
......@@ -51,9 +55,10 @@ $(function() {
$('.message_input_form').on('focusout',function(e){
if($(e.relatedTarget).hasClass('message_input_send')){
CHAT_UI.sendMessage();
} else {
$('.message_input_send').addClass('none');
$('.attach_file').removeClass('none');
$('.footer_content_b').removeClass('none');
}
$('.message_input_send').addClass('none');
$('.attach_file').removeClass('none');
$('.footer_content_b').removeClass('none');
});
});
......@@ -43,5 +43,10 @@ const collaborationTypeKey = {
VIDEO : "video"
}
const makeRoomFlg = {
NAME_CARD : 0,
MAKE_ROOM : 1
}
const messageSeperator = "<::split>";
const dataMessageScheme = "::NOT_MESSAGE";
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