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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
12 deletions
+21
-12
public_new/js/chat-db.js
+10
-4
public_new/js/chat-room.js
+5
-4
public_new/js/chat-ui.js
+4
-4
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) {
...
@@ -51,7 +51,11 @@ CHAT_DB.getMessages = function (roomId) {
CHAT_DB
.
getMessagesWithMessageId
=
function
(
messageId
)
{
CHAT_DB
.
getMessagesWithMessageId
=
function
(
messageId
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO メッセージ追加呼出。
return
JSON
.
parse
(
callNativeApp
(
NATIVE_KEY_IOS
.
getMessageListFromMessageId
,
{
messageId
:
messageId
})
);
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
return
JSON
.
parse
(
android
.
getMessageListFromMessageId
(
messageId
));
return
JSON
.
parse
(
android
.
getMessageListFromMessageId
(
messageId
));
}
}
...
@@ -270,8 +274,8 @@ CHAT_DB.searchMessages = function (keyword, userList) {
...
@@ -270,8 +274,8 @@ CHAT_DB.searchMessages = function (keyword, userList) {
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
return
JSON
.
parse
(
return
JSON
.
parse
(
callNativeApp
(
NATIVE_KEY_IOS
.
searchMessages
,
{
callNativeApp
(
NATIVE_KEY_IOS
.
searchMessages
,
{
"keyWord"
:
keyword
,
keyWord
:
keyword
,
"userList"
:
userList
,
userList
:
userList
,
})
})
);
);
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
...
@@ -291,7 +295,9 @@ CHAT_DB.getMyGroupUsersNotInRoom = function () {
...
@@ -291,7 +295,9 @@ CHAT_DB.getMyGroupUsersNotInRoom = function () {
};
};
CHAT_DB
.
getUserInfo
=
function
(
shopMemberId
)
{
CHAT_DB
.
getUserInfo
=
function
(
shopMemberId
)
{
if
(
shopMemberId
==
""
)
{
return
;
}
if
(
shopMemberId
==
""
)
{
return
;
}
if
(
CHAT_UTIL
.
isIOS
())
{
if
(
CHAT_UTIL
.
isIOS
())
{
return
JSON
.
parse
(
return
JSON
.
parse
(
callNativeApp
(
NATIVE_KEY_IOS
.
getUserInfo
,
{
shopMemberId
:
shopMemberId
})
callNativeApp
(
NATIVE_KEY_IOS
.
getUserInfo
,
{
shopMemberId
:
shopMemberId
})
...
...
public_new/js/chat-room.js
View file @
cb5d0bbf
var
lastscrollvalue
;
var
lastscrollvalue
;
window
.
onscroll
=
function
()
{
window
.
onscroll
=
function
()
{
beforeScroll
=
window
.
scrollY
;
beforeScroll
=
window
.
scrollY
;
var
beforeHeight
=
$
(
".room_container"
).
height
();
const
beforeHeight
=
$
(
".room_container"
).
height
();
messageCount
=
$
(
".chat_message"
).
length
;
messageCount
=
$
(
".chat_message"
).
length
;
if
(
$
(
this
).
scrollTop
()
===
0
&&
messageCount
>=
PagingSize
.
MESSAGE
)
{
if
(
$
(
this
).
scrollTop
()
===
0
&&
messageCount
>=
PagingSize
.
MESSAGE
)
{
if
(
!
$
(
"#chatLoader"
).
is
(
":visible"
))
{
if
(
!
$
(
"#chatLoader"
).
is
(
":visible"
))
{
...
@@ -9,14 +9,15 @@ window.onscroll = function () {
...
@@ -9,14 +9,15 @@ window.onscroll = function () {
'<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>'
'<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>'
);
);
$
(
"#messages"
).
prepend
(
loader
);
$
(
"#messages"
).
prepend
(
loader
);
var
messageId
=
$
(
$
(
".chat_message"
).
get
(
0
)).
data
(
"messageid"
);
const
messageId
=
$
(
$
(
".chat_message"
).
get
(
0
)).
data
(
"messageid"
);
var
messages
;
let
messages
;
if
(
typeof
android
!=
"undefined"
)
{
if
(
typeof
android
!=
"undefined"
)
{
if
(
IS_ONLINE
==
"true"
)
{
if
(
IS_ONLINE
==
"true"
)
{
android
.
updatePreMessage
(
messageId
);
android
.
updatePreMessage
(
messageId
);
}
}
}
else
{
}
else
{
//TODO 追加メッセージUpdate、get
// 追加メッセージUpdate、get
webkit
.
messageHandlers
.
updatePreMessage
.
postMessage
({
messageId
:
messageId
});
}
}
messages
=
CHAT_DB
.
getMessagesWithMessageId
(
messageId
);
messages
=
CHAT_DB
.
getMessagesWithMessageId
(
messageId
);
CHAT_UI
.
prependMessage
(
messages
);
CHAT_UI
.
prependMessage
(
messages
);
...
...
public_new/js/chat-ui.js
View file @
cb5d0bbf
...
@@ -1407,7 +1407,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
...
@@ -1407,7 +1407,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
$("#parentGroupArea").removeClass("none");
$("#parentGroupArea").removeClass("none");
}
}
//該当グループのパースを表示。
//該当グループのパースを表示。
var
groupPathTemplate = getTemplate(TemplateURL.GROUP_PATH);
const
groupPathTemplate = getTemplate(TemplateURL.GROUP_PATH);
result.groupPathList.forEach(function (groupPath) {
result.groupPathList.forEach(function (groupPath) {
let html = Mustache.render(groupPathTemplate, {
let html = Mustache.render(groupPathTemplate, {
name: groupPath.groupName,
name: groupPath.groupName,
...
@@ -1418,7 +1418,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
...
@@ -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) {
result.childGroupList.forEach(function (childGroup) {
let html = Mustache.render(groupTemplate, {
let html = Mustache.render(groupTemplate, {
name: childGroup.groupName,
name: childGroup.groupName,
...
@@ -1431,7 +1431,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
...
@@ -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) {
result.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl);
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl);
...
@@ -1639,7 +1639,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
...
@@ -1639,7 +1639,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
CHAT_UI
.
refreshArchiveDetailScreen
=
function
(
archiveId
)
{
CHAT_UI
.
refreshArchiveDetailScreen
=
function
(
archiveId
)
{
// loadingIndicatorを表示
// loadingIndicatorを表示
CHAT_UI
.
showLoadingIndicator
();
CHAT_UI
.
showLoadingIndicator
();
// 初期化
// 初期化
$
(
"#archiveDetail"
).
html
(
""
);
$
(
"#archiveDetail"
).
html
(
""
);
...
...
public_new/js/constant.js
View file @
cb5d0bbf
...
@@ -152,4 +152,6 @@ const NATIVE_KEY_IOS = {
...
@@ -152,4 +152,6 @@ const NATIVE_KEY_IOS = {
getMyGroupUsersNotInRoom
:
"getMyGroupUsersNotInRoom"
,
getMyGroupUsersNotInRoom
:
"getMyGroupUsersNotInRoom"
,
getUserInfo
:
"getUserInfo"
,
getUserInfo
:
"getUserInfo"
,
getUserListByLoginId
:
"getUserListByLoginId"
,
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