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
d97deaea
Commit
d97deaea
authored
Jan 28, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1369
* Add test and changelog entry * Also show message subject if available
parent
3c0e3d3f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
4 deletions
+37
-4
CHANGES.md
CHANGES.md
+1
-0
css/converse.css
css/converse.css
+3
-0
dist/converse.js
dist/converse.js
+6
-0
sass/_messages.scss
sass/_messages.scss
+5
-0
spec/muc.js
spec/muc.js
+19
-4
src/templates/message.html
src/templates/message.html
+3
-0
No files found.
CHANGES.md
View file @
d97deaea
...
...
@@ -3,6 +3,7 @@
## 4.1.1 (unreleased)
-
Accessibility: Tag the chat-content as an ARIA live region, for screen readers
-
#1369 Don't wrongly interpret message with
`subject`
as a topic change.
-
#1408 new config option
`roomconfig_whitelist`
-
#1421 fix direct invite for membersonly room
...
...
css/converse.css
View file @
d97deaea
...
...
@@ -11912,6 +11912,9 @@ body.converse-fullscreen {
padding-right
:
0.5em
;
}
#conversejs
.message.chat-msg.headline
.chat-msg__body
{
margin-left
:
0
;
}
#conversejs
.message.chat-msg
.chat-msg__subject
{
font-weight
:
bold
;
clear
:
right
;
}
#conversejs
.message.chat-msg
.chat-msg__text
{
padding
:
0
;
color
:
var
(
--message-text-color
);
...
...
dist/converse.js
View file @
d97deaea
...
...
@@ -93518,6 +93518,12 @@ __e(o.spoiler_hint) +
__e(o.label_show) +
'</a>\n </div>\n ';
} ;
__p += '\n ';
if (o.subject) { ;
__p += '\n <div class="chat-msg__subject">' +
__e( o.subject ) +
'</div>\n ';
} ;
__p += '\n <div class="chat-msg__text';
if (o.is_spoiler) { ;
__p += ' spoiler collapsed';
sass/_messages.scss
View file @
d97deaea
...
...
@@ -149,6 +149,11 @@
}
}
.chat-msg__subject
{
font-weight
:
bold
;
clear
:
right
;
}
.chat-msg__text
{
padding
:
0
;
color
:
var
(
--
message-text-color
);
...
...
spec/muc.js
View file @
d97deaea
...
...
@@ -12,7 +12,7 @@
Backbone
=
converse
.
env
.
Backbone
,
u
=
converse
.
env
.
utils
;
describe
(
"
Chatroom
s
"
,
function
()
{
describe
(
"
Groupchat
s
"
,
function
()
{
describe
(
"
The
\"
rooms
\"
API
"
,
function
()
{
...
...
@@ -1937,7 +1937,7 @@
await
test_utils
.
openAndEnterChatRoom
(
_converse
,
'
jdev
'
,
'
conference.jabber.org
'
,
'
jc
'
);
const
text
=
'
Jabber/XMPP Development | RFCs and Extensions: http://xmpp.org/ | Protocol and XSF discussions: xsf@muc.xmpp.org
'
;
cons
t
stanza
=
Strophe
.
xmlHtmlNode
(
le
t
stanza
=
Strophe
.
xmlHtmlNode
(
'
<message xmlns="jabber:client" to="jc@opkode.com/_converse.js-60429116" type="groupchat" from="jdev@conference.jabber.org/ralphm">
'
+
'
<subject>
'
+
text
+
'
</subject>
'
+
'
<delay xmlns="urn:xmpp:delay" stamp="2014-02-04T09:35:39Z" from="jdev@conference.jabber.org"/>
'
+
...
...
@@ -1945,11 +1945,26 @@
'
</message>
'
).
firstChild
;
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
const
view
=
_converse
.
chatboxviews
.
get
(
'
jdev@conference.jabber.org
'
);
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
cons
t
chat_content
=
view
.
el
.
querySelector
(
'
.chat-content
'
);
await
new
Promise
((
resolve
,
reject
)
=>
view
.
model
.
once
(
'
change:subject
'
,
resolve
));
le
t
chat_content
=
view
.
el
.
querySelector
(
'
.chat-content
'
);
expect
(
sizzle
(
'
.chat-event:last
'
).
pop
().
textContent
).
toBe
(
'
Topic set by ralphm
'
);
expect
(
sizzle
(
'
.chat-topic:last
'
).
pop
().
textContent
).
toBe
(
text
);
expect
(
view
.
el
.
querySelector
(
'
.chatroom-description
'
).
textContent
).
toBe
(
text
);
stanza
=
Strophe
.
xmlHtmlNode
(
`<message xmlns="jabber:client" to="jc@opkode.com/_converse.js-60429116" type="groupchat" from="jdev@conference.jabber.org/ralphm">
<subject>This is a message subject</subject>
<body>This is a message</body>
</message>`
).
firstChild
;
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
chat_content
=
view
.
el
.
querySelector
(
'
.chat-content
'
);
expect
(
sizzle
(
'
.chat-topic
'
).
length
).
toBe
(
1
);
expect
(
sizzle
(
'
.chat-msg__subject
'
).
length
).
toBe
(
1
);
expect
(
sizzle
(
'
.chat-msg__subject
'
).
pop
().
textContent
).
toBe
(
'
This is a message subject
'
);
expect
(
sizzle
(
'
.chat-msg__text
'
).
length
).
toBe
(
1
);
expect
(
sizzle
(
'
.chat-msg__text
'
).
pop
().
textContent
).
toBe
(
'
This is a message
'
);
expect
(
view
.
el
.
querySelector
(
'
.chatroom-description
'
).
textContent
).
toBe
(
text
);
done
();
}));
...
...
src/templates/message.html
View file @
d97deaea
...
...
@@ -23,6 +23,9 @@
<a
class=
"badge badge-info spoiler-toggle"
data-toggle-state=
"closed"
href=
"#"
><i
class=
"fa fa-eye"
></i>
{{{o.label_show}}}
</a>
</div>
{[ } ]}
{[ if (o.subject) { ]}
<div
class=
"chat-msg__subject"
>
{{{ o.subject }}}
</div>
{[ } ]}
<div
class=
"chat-msg__text{[ if (o.is_spoiler) { ]} spoiler collapsed{[ } ]}"
>
<!-- message gets added here via renderMessage -->
</div>
<div
class=
"chat-msg__media"
></div>
{[ if (!o.is_me_message) { ]}
</div>
{[ } ]}
...
...
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