Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chat_webview
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abookCommunication
chat_webview
Commits
840c43c7
Commit
840c43c7
authored
Jun 13, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/performance_improvement' into 'develop'
Feature/performance improvement See merge request
!175
parents
32e4f774
fb3545c9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
75 additions
and
24 deletions
+75
-24
public_new/js/chat-db.js
+8
-0
public_new/js/chat-room.js
+24
-0
public_new/js/chat-ui.js
+32
-19
public_new/js/chat-websocket-message.js
+2
-0
public_new/js/constant.js
+4
-0
public_new/template/template_close_collaboration_message.html
+1
-1
public_new/template/template_my_message.html
+1
-1
public_new/template/template_open_collaboration_message.html
+1
-1
public_new/template/template_user_message.html
+2
-2
No files found.
public_new/js/chat-db.js
View file @
840c43c7
...
...
@@ -49,6 +49,14 @@ CHAT_DB.getMessages = function (roomId) {
}
};
CHAT_DB
.
getMessagesWithMessageId
=
function
(
messageId
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO メッセージ追加呼出。
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
return
JSON
.
parse
(
android
.
getMessageListFromMessageId
(
messageId
));
}
};
CHAT_DB
.
getFavoriteUsersNotInRoom
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
return
JSON
.
parse
(
...
...
public_new/js/chat-room.js
View file @
840c43c7
var
lastscrollvalue
;
window
.
onscroll
=
function
()
{
beforeScroll
=
window
.
scrollY
;
var
beforeHeight
=
$
(
".room_container"
).
height
();
messageCount
=
$
(
".chat_message"
).
length
;
if
(
$
(
this
).
scrollTop
()
===
0
&&
messageCount
>=
PagingSize
.
MESAGE
)
{
if
(
!
$
(
"#chatLoader"
).
is
(
":visible"
))
{
let
loader
=
$
(
'<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
;
if
(
typeof
android
!=
"undefined"
)
{
if
(
IS_ONLINE
==
"true"
)
{
android
.
updatePreMessage
(
messageId
);
}
}
else
{
//TODO 追加メッセージUpdate、get
}
messages
=
CHAT_DB
.
getMessagesWithMessageId
(
messageId
);
CHAT_UI
.
prependMessage
(
messages
);
loader
.
remove
();
var
afterHeight
=
$
(
".room_container"
).
height
();
window
.
scroll
(
0
,
afterHeight
-
beforeHeight
);
}
}
};
$
(
"#roomNameChangeBtn"
).
click
(
function
()
{
...
...
public_new/js/chat-ui.js
View file @
840c43c7
...
...
@@ -1059,19 +1059,8 @@ CHAT_UI.loadMessages = function (roomId, roomName) {
let jQueryMessages = $("#messages");
// スクロールの変化を防ぐため以前画面の高さを保存する
let beforeHeight = jQueryMessages.prop("scrollHeight");
// メッセージ文字列の生成
let workVal = "";
var userTemplate = getTemplate(TemplateURL.USER_LIST);
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
var systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
var openCollaborationMessageTemplate = getTemplate(
TemplateURL.OPEN_COLLABORATION_MESSAGE
);
var userTemplate = getTemplate(TemplateURL.USER_LIST);
var topUserListTemplate = getTemplate(TemplateURL.CHATROOM_USER_LIST);
...
...
@@ -1094,6 +1083,33 @@ CHAT_UI.loadMessages = function (roomId, roomName) {
let filterObj = jQuery.parseHTML(filterHtml);
$("#filter").append(filterObj);
CHAT_UI.prependMessage(messages);
CHAT_UI.waitForLoadingImage(jQueryMessages, CHAT_UI.scrollToBottom);
CHAT_UI.waitForLoadingVideo(jQueryMessages, CHAT_UI.scrollToBottom);
// ユーザ削除ボタン表示しない
$("#userSelectionDeleteBtn").hide();
};
CHAT_UI.prependMessage = function(messages) {
var now = new Date();
let jQueryMessages = $("#messages");
// スクロールの変化を防ぐため以前画面の高さを保存する
let beforeHeight = jQueryMessages.prop("scrollHeight");
// メッセージ文字列の生成
let workVal = "";
var userTemplate = getTemplate(TemplateURL.USER_LIST);
var userMessageTemplate = getTemplate(TemplateURL.USER_MESSAGE);
var myMessageTemplate = getTemplate(TemplateURL.MY_MESSAGE);
var systemMessageTemplate = getTemplate(TemplateURL.SYSTEM_MESSAGE);
var openCollaborationMessageTemplate = getTemplate(
TemplateURL.OPEN_COLLABORATION_MESSAGE
);
var checkBeforeDate = "";
var beforeDate = "";
messages.forEach(function (message) {
...
...
@@ -1175,6 +1191,7 @@ CHAT_UI.loadMessages = function (roomId, roomName) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
});
let html = Mustache.render(template, {
messageId: message.messageId,
roomName: roomName,
userCount: userInCollaboration.length,
userList:
...
...
@@ -1203,6 +1220,7 @@ CHAT_UI.loadMessages = function (roomId, roomName) {
let html = Mustache.render(template, {
text: message.message,
from: message.loginId,
messageId: message.messageId,
shopMemberId: message.shopMemberId,
profileImage: message.profileUrl,
createdAtDay: messageTime.createdAtDay,
...
...
@@ -1223,11 +1241,7 @@ CHAT_UI.loadMessages = function (roomId, roomName) {
});
// メッセージの画面描画
jQueryMessages.prepend(workVal);
CHAT_UI.waitForLoadingImage(jQueryMessages, CHAT_UI.scrollToBottom);
CHAT_UI.waitForLoadingVideo(jQueryMessages, CHAT_UI.scrollToBottom);
// ユーザ削除ボタン表示しない
$("#userSelectionDeleteBtn").hide();
};
}
CHAT_UI.roomDisplayOff = function () {
if (typeof android != "undefined") {
...
...
@@ -2434,7 +2448,6 @@ var createChatRoom = function (
var updateContactInfo = function () {
if (IS_ONLINE == "true") {
if (typeof android != "undefined") {
android.updateGroupInfo("0");
android.updateMyInfo();
android.updateGroupUser();
android.updateFavorite();
...
...
@@ -2450,7 +2463,7 @@ var updateContactInfo = function () {
var updateGroupInfo = function (groupID) {
if (IS_ONLINE == "true") {
if (typeof android != "undefined") {
android.updateGroup
Info(groupID
);
android.updateGroup
User(
);
} else {
webkit.messageHandlers.updateGroupInfo.postMessage(groupID);
}
...
...
public_new/js/chat-websocket-message.js
View file @
840c43c7
...
...
@@ -105,6 +105,7 @@ var renderCollaborationMessage = function (
let
messageTime
=
CHAT_UTIL
.
formatDate
(
createdAt
);
return
Mustache
.
render
(
template
,
{
roomName
:
roomName
,
messageId
:
0
,
userCount
:
1
,
userList
:
userList
,
insertDate
:
insertDate
,
...
...
@@ -146,6 +147,7 @@ var renderTextMessage = function (
let
dataInsertedTemplate
=
Mustache
.
render
(
template
,
{
text
:
text
,
from
:
from
,
messageId
:
0
,
profileImage
:
profileImagePath
,
shopMemberId
:
userID
,
createdAtDay
:
messageTime
.
createdAtDay
,
...
...
public_new/js/constant.js
View file @
840c43c7
...
...
@@ -54,6 +54,10 @@ const HostRequestFlag = {
DOING
:
1
,
};
const
PagingSize
=
{
MESAGE
:
20
};
const
messageSeperator
=
"<::split>"
;
const
DATA_MESSAGE_SCHEME
=
"::NOT_MESSAGE"
;
const
FINISH_ALL_COLLABORATION_SIGNAL
=
"::ALL_COLLABORATION_END"
;
...
...
public_new/template/template_close_collaboration_message.html
View file @
840c43c7
<!-- 通話 -->
<div
class=
"collabo_area_container"
>
<div
class=
"collabo_area_container
chat_message"
data-messageid=
"{{messageId}}
"
>
<!-- 時刻 -->
<div
class=
"collabo_date text-right"
>
<span>
12:23 PM
</span>
...
...
public_new/template/template_my_message.html
View file @
840c43c7
<div
class=
"my_messages"
>
<div
class=
"my_messages
chat_message"
data-messageid=
"{{messageId}}
"
>
<div
class=
"room_right"
>
<div
class=
"text"
>
{{text}}
</div>
{{#isToday}}
...
...
public_new/template/template_open_collaboration_message.html
View file @
840c43c7
<!-- 通話 -->
<div
class=
"collabo_area_container"
>
<div
class=
"collabo_area_container
chat_message"
data-messageid=
"{{messageId}}
"
>
<!-- 時刻 -->
<div
class=
"collabo_date text-right"
>
{{#isToday}}
...
...
public_new/template/template_user_message.html
View file @
840c43c7
<div
class=
"room_left"
>
<div
class=
"room_left
chat_message"
data-messageid=
"{{messageId}}
"
>
<figure>
<a
href=
"#"
data-toggle=
"modal"
data-target=
"#profileModal1"
>
<a
href=
"#"
data-toggle=
"modal"
data-target=
"#profileModal1"
>
c
<img
src=
"{{profileImage}}"
onError=
"this.src='./img/noImage.png'"
onclick=
"CHAT_UI.makeNameCard({{shopMemberId}})"
>
</a>
</figure>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment