Commit 5e05ce42 by Lee Munkyeong

Merge branch 'develop' of gitlab.agentec.jp:abookCommunication/chat_webview into develop

# Conflicts:
#	public_new/js/chat-ui.js
parents 05b206b3 750f11f0
......@@ -19,18 +19,19 @@
</head>
<script>
var archiveId;
window.addEventListener('DOMContentLoaded', function(){
window.addEventListener('DOMContentLoaded', function () {
var urlPrm = new Object;
var urlSearch = location.search.substring(1).split('&');
var kv = urlSearch[0].split('=');
urlPrm[kv[0]]=kv[1];
urlPrm[kv[0]] = kv[1];
archiveId = urlPrm.archiveId
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
} else {
CHAT_UI.refreshArchiveDetailScreen(urlPrm.archiveId);
}
});
</script>
</script>
<body>
<!-- ナビメニュー -->
......@@ -195,7 +196,7 @@
let IS_MOBILE = true;
let IS_ONLINE = false;
if (typeof(android) != "undefined") {
if (typeof (android) != "undefined") {
android.getLoginParameter();
android.getGlobalParameter();
} else {
......
......@@ -51,7 +51,11 @@ CHAT_DB.getMessages = function (roomId) {
CHAT_DB.getMessagesWithMessageId = function (messageId) {
if (CHAT_UTIL.isIOS()) {
//TODO メッセージ追加呼出。
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessageListFromMessageId, {
messageId: messageId
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getMessageListFromMessageId(messageId));
}
......@@ -270,8 +274,8 @@ CHAT_DB.searchMessages = function (keyword, userList) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.searchMessages, {
"keyWord": keyword,
"userList": userList,
keyWord: keyword,
userList: userList,
})
);
} else if (CHAT_UTIL.isAndroid()) {
......@@ -291,6 +295,9 @@ CHAT_DB.getMyGroupUsersNotInRoom = function () {
};
CHAT_DB.getUserInfo = function (shopMemberId) {
if (shopMemberId == "") {
return;
}
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserInfo, { shopMemberId: shopMemberId })
......
var lastscrollvalue;
window.onscroll = function () {
beforeScroll = window.scrollY;
var beforeHeight = $(".room_container").height();
const beforeHeight = $(".room_container").height();
messageCount = $(".chat_message").length;
if ($(this).scrollTop() === 0 && messageCount >= PagingSize.MESSAGE) {
if (!$("#chatLoader").is(":visible")) {
......@@ -9,14 +9,15 @@ window.onscroll = function () {
'<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>'
);
$("#messages").prepend(loader);
var messageId = $($(".chat_message").get(0)).data("messageid");
var messages;
const messageId = $($(".chat_message").get(0)).data("messageid");
let messages;
if (typeof android != "undefined") {
if (IS_ONLINE == "true") {
android.updatePreMessage(messageId);
}
} else {
//TODO 追加メッセージUpdate、get
// 追加メッセージUpdate、get
webkit.messageHandlers.updatePreMessage.postMessage({ messageId: messageId });
}
messages = CHAT_DB.getMessagesWithMessageId(messageId);
CHAT_UI.prependMessage(messages);
......
......@@ -1413,7 +1413,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
$("#parentGroupArea").removeClass("none");
}
//該当グループのパースを表示。
var groupPathTemplate = getTemplate(TemplateURL.GROUP_PATH);
const groupPathTemplate = getTemplate(TemplateURL.GROUP_PATH);
result.groupPathList.forEach(function (groupPath) {
let html = Mustache.render(groupPathTemplate, {
name: groupPath.groupName,
......@@ -1424,7 +1424,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
});
//該当グループの下位グループ表示。
var groupTemplate = getTemplate(TemplateURL.GROUP_LIST);
const groupTemplate = getTemplate(TemplateURL.GROUP_LIST);
result.childGroupList.forEach(function (childGroup) {
let html = Mustache.render(groupTemplate, {
name: childGroup.groupName,
......@@ -1437,7 +1437,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
});
//該当グループの所属ユーザを表示。
var userTemplate = getTemplate(TemplateURL.USER_LIST);
const userTemplate = getTemplate(TemplateURL.USER_LIST);
result.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl);
......@@ -1522,24 +1522,21 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
// 初期化
$("#archiveDetail").html("");
// アーカイブ詳細の様式を読み込む
const archiveDetailTemplate = $("#archive-detail-template").html();
if (IS_ONLINE == "true") {
CHAT_DB.updateArchiveDetail(archiveId);
}
// アーカイブ詳細取得
var archive = CHAT_DB.getArchiveDetail(archiveId);
// チャットルーム情報を取得
var roomId = archive.roomId;
const archive = CHAT_DB.getArchiveDetail(archiveId);
//保存ユーザ情報を取得
var userInfo = CHAT_DB.getUserInfo(archive.saveUserId);
// 保存ユーザ情報を取得
const userInfo = CHAT_DB.getUserInfo(archive.saveUserId);
userInfo.profileUrl = CHAT.getProfileImgUrl(userInfo.profileUrl);
// アーカイブ情報を表示
var html = Mustache.render(archiveDetailTemplate, {
const html = Mustache.render(archiveDetailTemplate, {
fileName: archive.archiveName,
insertDate: archive.archiveDate,
chatRoomName: archive.roomName,
......@@ -1549,11 +1546,12 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
userId: userInfo.shopMemberId,
});
var obj = $(jQuery.parseHTML(html)).on("click", function () {});
$("#archiveDetail").append(obj);
// プレイヤーの切り替え
var archiveFilePath = CHAT.createGetDataUrl(archive.filePath, archive.roomId);
const archiveFilePath = CHAT.createGetDataUrl(archive.filePath, archive.roomId);
switch (archive.archiveType) {
case "0": // 画像
......@@ -1624,14 +1622,15 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
}
attendUserList.forEach(function (user) {
if (user == "") { return; }
var userInfo = CHAT_DB.getUserInfo(user);
userInfo.profileUrl = CHAT.getProfileImgUrl(userInfo.profileUrl);
var html = Mustache.render(archiveUserTemplate, {
const html = Mustache.render(archiveUserTemplate, {
profileImage: userInfo.profileUrl,
userName: userInfo.shopMemberName,
});
var obj = $(jQuery.parseHTML(html)).on("click", function () {
const obj = $(jQuery.parseHTML(html)).on("click", function () {
// ネームカード表示
CHAT_UI.makeNameCard(user);
});
......
......@@ -157,4 +157,6 @@ const NATIVE_KEY_IOS = {
getMyGroupUsersNotInRoom: "getMyGroupUsersNotInRoom",
getUserInfo: "getUserInfo",
getUserListByLoginId: "getUserListByLoginId",
getMessageListFromMessageId: "getMessageListFromMessageId",
updatePreMessage: "updatePreMessage",
};
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