Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
59a5acf2
Commit
59a5acf2
authored
Jun 11, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #2064 (for real this time)
parent
80c955f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
16 deletions
+24
-16
sass/_messages.scss
sass/_messages.scss
+10
-5
src/components/message.js
src/components/message.js
+13
-7
src/templates/chat_message.js
src/templates/chat_message.js
+1
-4
No files found.
sass/_messages.scss
View file @
59a5acf2
...
...
@@ -133,6 +133,11 @@
align-items
:
stretch
;
margin-left
:
0
.5rem
;
width
:
calc
(
100%
-
var
(
--
message-avatar-width
));
&
:hover
{
.btn--standalone
{
opacity
:
1
;
}
}
}
.chat-msg__content--me
{
...
...
@@ -156,11 +161,10 @@
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
&
:hover
{
.btn--standalone
{
opacity
:
1
;
}
}
}
converse-chat-message-body
{
display
:
inline-block
;
}
.chat-msg__message
{
...
...
@@ -341,6 +345,7 @@
}
.chat-msg__receipt
{
margin-left
:
0
.5em
;
margin-right
:
0
.5em
;
color
:
var
(
--
message-receipt-color
);
}
...
...
src/components/message.js
View file @
59a5acf2
...
...
@@ -15,6 +15,7 @@ import { renderAvatar } from './../templates/directives/avatar';
const
{
Strophe
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
const
i18n_edited
=
__
(
'
This message has been edited
'
);
const
i18n_show
=
__
(
'
Show more
'
);
const
i18n_show_less
=
__
(
'
Show less
'
);
const
i18n_uploading
=
__
(
'
Uploading file:
'
);
...
...
@@ -212,6 +213,7 @@ class Message extends CustomElement {
}
renderMessageText
()
{
const
is_groupchat_message
=
(
this
.
message_type
===
'
groupchat
'
);
const
tpl_spoiler_hint
=
html
`
<div class="chat-msg__spoiler-hint">
<span class="spoiler-hint">
${
this
.
spoiler_hint
}
</span>
...
...
@@ -224,13 +226,17 @@ class Message extends CustomElement {
return
html
`
${
this
.
is_spoiler
?
tpl_spoiler_hint
:
''
}
${
this
.
subject
?
html
`<div class="chat-msg__subject">
${
this
.
subject
}
</div>`
:
''
}
<converse-chat-message-body
.model="
${
this
.
model
}
"
?is_me_message="
${
this
.
is_me_message
}
"
?is_only_emojis="
${
this
.
is_only_emojis
}
"
?is_spoiler="
${
this
.
is_spoiler
}
"
?is_spoiler_visible="
${
this
.
is_spoiler_visible
}
"
text="
${
this
.
model
.
getMessageText
()}
"></converse-chat-message-body>
<span>
<converse-chat-message-body
.model="
${
this
.
model
}
"
?is_me_message="
${
this
.
is_me_message
}
"
?is_only_emojis="
${
this
.
is_only_emojis
}
"
?is_spoiler="
${
this
.
is_spoiler
}
"
?is_spoiler_visible="
${
this
.
is_spoiler_visible
}
"
text="
${
this
.
model
.
getMessageText
()}
"></converse-chat-message-body>
${
(
this
.
received
&&
!
this
.
is_me_message
&&
!
is_groupchat_message
)
?
html
`<span class="fa fa-check chat-msg__receipt"></span>`
:
''
}
${
(
this
.
edited
)
?
html
`<i title="
${
i18n_edited
}
" class="fa fa-edit chat-msg__edit-modal" @click=
${
this
.
showMessageVersionsModal
}
></i>`
:
''
}
</span>
${
this
.
oob_url
?
html
`<div class="chat-msg__media">
${
u
.
getOOBURLMarkup
(
_converse
,
this
.
oob_url
)}
</div>`
:
''
}
<div class="chat-msg__error">
${
this
.
error_text
||
this
.
error
}
</div>
`
;
...
...
src/templates/chat_message.js
View file @
59a5acf2
...
...
@@ -2,12 +2,11 @@ import { html } from "lit-html";
import
{
__
}
from
'
@converse/headless/i18n
'
;
import
{
renderAvatar
}
from
'
./../templates/directives/avatar
'
;
const
i18n_edited
=
__
(
'
This message has been edited
'
);
const
i18n_new_messages
=
__
(
'
New messages
'
);
export
default
(
o
)
=>
{
const
is_groupchat_message
=
(
o
.
message_type
===
'
groupchat
'
);
return
html
`
${
o
.
is_first_unread
?
html
`<div class="message date-separator"><hr class="separator"><span class="separator-text">
${
i18n_new_messages
}
</span></div>`
:
''
}
<div class="message chat-msg
${
o
.
getExtraMessageClasses
()
}
"
...
...
@@ -30,8 +29,6 @@ export default (o) => {
<div class="chat-msg__body chat-msg__body--
${
o
.
message_type
}
${
o
.
received
?
'
chat-msg__body--received
'
:
''
}
${
o
.
is_delayed
?
'
chat-msg__body--delayed
'
:
''
}
">
<div class="chat-msg__message">
${
o
.
is_retracted
?
o
.
renderRetraction
()
:
o
.
renderMessageText
()
}
${
(
o
.
received
&&
!
o
.
is_me_message
&&
!
is_groupchat_message
)
?
html
`<span class="fa fa-check chat-msg__receipt"></span>`
:
''
}
${
(
o
.
edited
)
?
html
`<i title="
${
i18n_edited
}
" class="fa fa-edit chat-msg__edit-modal" @click=
${
o
.
showMessageVersionsModal
}
></i>`
:
''
}
</div>
<converse-message-actions
.chatview=
${
o
.
chatview
}
...
...
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