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
1294d682
Commit
1294d682
authored
Aug 30, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically remove leave/enter and enter/leave messages
after 10 seconds.
parent
4b5b5173
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
sass/_core.scss
sass/_core.scss
+17
-0
src/converse-muc-views.js
src/converse-muc-views.js
+12
-5
No files found.
sass/_core.scss
View file @
1294d682
...
...
@@ -320,6 +320,15 @@ body.reset {
100
%
{
opacity
:
1
}
}
@-webkit-keyframes
fadeOut
{
0
%
{
opacity
:
1
;
visibility
:
visible
;
}
100
%
{
opacity
:
0
;
visibility
:
hidden
;
}
}
@keyframes
fadeOut
{
0
%
{
opacity
:
1
;
visibility
:
visible
;
}
100
%
{
opacity
:
0
;
visibility
:
hidden
;
}
}
.fade-in
{
@include
fade-in
;
}
...
...
@@ -336,6 +345,14 @@ body.reset {
opacity
:
0
!
important
;
display
:
none
!
important
;
}
.fade-out
{
animation-duration
:
1s
;
animation-fill-mode
:
forwards
;
animation-name
:
fadeOut
;
animation-timing-function
:
ease-in-out
;
}
.collapsed
{
height
:
0
!
important
;
overflow
:
hidden
!
important
;
...
...
src/converse-muc-views.js
View file @
1294d682
...
...
@@ -1441,12 +1441,13 @@
if
(
this
.
model
.
get
(
'
connection_status
'
)
!==
converse
.
ROOMSTATUS
.
ENTERED
)
{
return
;
}
const
nick
=
occupant
.
get
(
'
nick
'
)
;
const
stat
=
occupant
.
get
(
'
status
'
);
cons
t
last_el
=
this
.
content
.
lastElementChild
;
const
nick
=
occupant
.
get
(
'
nick
'
)
,
stat
=
occupant
.
get
(
'
status
'
);
le
t
last_el
=
this
.
content
.
lastElementChild
;
if
(
_
.
includes
(
_
.
get
(
last_el
,
'
classList
'
,
[]),
'
chat-info
'
)
&&
_
.
get
(
last_el
,
'
dataset
'
,
{}).
leave
===
`"
${
nick
}
"`
)
{
last_el
.
outerHTML
=
tpl_info
({
'
data
'
:
`data-leavejoin="
${
nick
}
"`
,
...
...
@@ -1454,6 +1455,9 @@
'
extra_classes
'
:
'
chat-event
'
,
'
message
'
:
__
(
'
%1$s has left and re-entered the groupchat
'
,
nick
)
});
last_el
=
this
.
content
.
lastElementChild
;
setTimeout
(()
=>
u
.
addClass
(
'
fade-out
'
,
last_el
),
10000
);
setTimeout
(()
=>
last_el
.
parentElement
.
removeChild
(
last_el
),
11500
);
}
else
{
let
message
;
if
(
_
.
isNil
(
stat
))
{
...
...
@@ -1482,8 +1486,8 @@
showLeaveNotification
(
occupant
)
{
const
nick
=
occupant
.
get
(
'
nick
'
),
stat
=
occupant
.
get
(
'
status
'
)
,
last_el
=
this
.
content
.
lastElementChild
;
stat
=
occupant
.
get
(
'
status
'
)
;
let
last_el
=
this
.
content
.
lastElementChild
;
if
(
last_el
&&
_
.
includes
(
_
.
get
(
last_el
,
'
classList
'
,
[]),
'
chat-info
'
)
&&
...
...
@@ -1503,6 +1507,9 @@
'
extra_classes
'
:
'
chat-event
'
,
'
message
'
:
message
});
last_el
=
this
.
content
.
lastElementChild
;
setTimeout
(()
=>
u
.
addClass
(
'
fade-out
'
,
last_el
),
10000
);
setTimeout
(()
=>
last_el
.
parentElement
.
removeChild
(
last_el
),
11500
);
}
else
{
let
message
;
if
(
_
.
isNil
(
stat
))
{
...
...
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