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
cb5d0bbf
Commit
cb5d0bbf
authored
Jun 16, 2021
by
Kim Peace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed for chat performance tunning
parent
2824234e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
11 deletions
+20
-11
public_new/js/chat-db.js
+10
-4
public_new/js/chat-room.js
+5
-4
public_new/js/chat-ui.js
+3
-3
public_new/js/constant.js
+2
-0
No files found.
public_new/js/chat-db.js
View file @
cb5d0bbf
...
...
@@ -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,7 +295,9 @@ CHAT_DB.getMyGroupUsersNotInRoom = function () {
};
CHAT_DB
.
getUserInfo
=
function
(
shopMemberId
)
{
if
(
shopMemberId
==
""
)
{
return
;
}
if
(
shopMemberId
==
""
)
{
return
;
}
if
(
CHAT_UTIL
.
isIOS
())
{
return
JSON
.
parse
(
callNativeApp
(
NATIVE_KEY_IOS
.
getUserInfo
,
{
shopMemberId
:
shopMemberId
})
...
...
public_new/js/chat-room.js
View file @
cb5d0bbf
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
);
...
...
public_new/js/chat-ui.js
View file @
cb5d0bbf
...
...
@@ -1407,7 +1407,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,
...
...
@@ -1418,7 +1418,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,
...
...
@@ -1431,7 +1431,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);
...
...
public_new/js/constant.js
View file @
cb5d0bbf
...
...
@@ -152,4 +152,6 @@ const NATIVE_KEY_IOS = {
getMyGroupUsersNotInRoom
:
"getMyGroupUsersNotInRoom"
,
getUserInfo
:
"getUserInfo"
,
getUserListByLoginId
:
"getUserListByLoginId"
,
getMessageListFromMessageId
:
"getMessageListFromMessageId"
,
updatePreMessage
:
"updatePreMessage"
,
};
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