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
4d124b44
Commit
4d124b44
authored
May 11, 2021
by
Kang Donghun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
協業開始メッセージ表示修正
parent
ca6ea671
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
17 deletions
+53
-17
public_new/js/chat-websocket.js
+53
-17
No files found.
public_new/js/chat-websocket.js
View file @
4d124b44
...
...
@@ -175,6 +175,11 @@ function setSocketAction () {
,
function
(
text
)
{
systemMessageTemplate
=
text
;
});
var
openCollaborationMessageTemplate
;
$
.
get
({
url
:
"./template/template_open_collaboration_message.html"
,
async
:
false
}
,
function
(
text
)
{
openCollaborationMessageTemplate
=
text
;
});
let
template
=
userMessageTemplate
;
if
(
message
.
id
===
socket
.
id
)
{
...
...
@@ -188,25 +193,56 @@ function setSocketAction () {
}
catch
(
e
)
{
message
.
text
=
message
.
text
}
let
type
;
let
collaborationType
;
if
(
message
.
text
.
includes
(
messageSeperator
)
)
{
message
.
text
=
message
.
text
.
split
(
messageSeperator
)[
0
];
let
text
=
message
.
text
.
split
(
messageSeperator
);
message
.
text
=
text
[
0
];
type
=
text
[
1
];
if
(
type
==
messageType
.
COMMUNICATIONSTART
||
type
==
messageType
.
COMMUNICATIONEND
)
{
collaborationType
=
text
[
2
];
var
userInCollaboration
;
if
(
CHAT_UTIL
.
isIOS
())
{
userInCollaboration
=
JSON
.
parse
(
CHAT_DB
.
getUserInfoList
(
message
.
userId
));
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
userInCollaboration
=
JSON
.
parse
(
android
.
getUserInfoList
(
message
.
userId
));
}
userInCollaboration
.
forEach
(
function
(
user
)
{
user
.
profileUrl
=
CHAT
.
getProfileImgUrl
(
user
.
profileUrl
);
})
template
=
openCollaborationMessageTemplate
;
let
html
=
Mustache
.
render
(
template
,
{
roomName
:
roomName
,
userCount
:
1
,
userList
:
userInCollaboration
,
insertDate
:
message
.
insertDate
,
collaborationType
:
collaborationType
,
isToday
:
true
,
createdAtDay
:
messageTime
.
createdAtDay
,
createdAtTime
:
messageTime
.
createdAtTime
,
isOtherYear
:
false
});
$
(
'#messages'
).
append
(
html
);
}
else
{
var
replacePath
=
message
.
text
;
replacePath
=
replacePath
.
replaceAll
(
'?fileName='
,
'?sid='
+
CHAT
.
globalLoginParameter
.
sid
+
'&fileName='
);
message
.
text
=
replacePath
;
//TODO newMessageの際にDB格納が必要。
let
html
=
Mustache
.
render
(
template
,
{
text
:
message
.
text
,
from
:
message
.
from
,
profileImage
:
message
.
profileImagePath
,
shopMemberId
:
message
.
userId
,
createdAtDay
:
messageTime
.
createdAtDay
,
createdAtTime
:
messageTime
.
createdAtTime
,
isToday
:
true
});
// イメージの場合、img tagを追加する
html
=
message
.
text
.
includes
(
'attachedImages'
)
||
message
.
text
.
includes
(
'attachedVideos'
)
?
CHAT_UTIL
.
htmlDecode
(
html
)
:
html
;
$
(
'#messages'
).
append
(
html
);
}
}
var
replacePath
=
message
.
text
;
replacePath
=
replacePath
.
replaceAll
(
'?fileName='
,
'?sid='
+
CHAT
.
globalLoginParameter
.
sid
+
'&fileName='
);
message
.
text
=
replacePath
;
//TODO newMessageの際にDB格納が必要。
let
html
=
Mustache
.
render
(
template
,
{
text
:
message
.
text
,
from
:
message
.
from
,
profileImage
:
message
.
profileImagePath
,
shopMemberId
:
message
.
userId
,
createdAtDay
:
messageTime
.
createdAtDay
,
createdAtTime
:
messageTime
.
createdAtTime
,
isToday
:
true
});
// イメージの場合、img tagを追加する
html
=
message
.
text
.
includes
(
'attachedImages'
)
||
message
.
text
.
includes
(
'attachedVideos'
)
?
CHAT_UTIL
.
htmlDecode
(
html
)
:
html
;
$
(
'#messages'
).
append
(
html
);
// 画像、動画の描画を待ってからスクロール
setTimeout
(
function
()
{
...
...
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