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
19b9aead
Commit
19b9aead
authored
Jul 06, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show an indicator that the message has been edited
parent
9f42f09d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
4 deletions
+25
-4
dist/converse.js
dist/converse.js
+13
-2
spec/messages.js
spec/messages.js
+5
-1
src/converse-chatboxes.js
src/converse-chatboxes.js
+5
-1
src/converse-message-view.js
src/converse-message-view.js
+1
-0
src/templates/message.html
src/templates/message.html
+1
-0
No files found.
dist/converse.js
View file @
19b9aead
...
...
@@ -68988,7 +68988,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
});
if (replace) {
message.save('message', getMessageBody(stanza));
message.save({
'message': getMessageBody(stanza),
'older_versions': (message.get('older_versions') || []).push(message.get('message')),
'edited': true
});
} else if (!message) {
// Only create the message when we're sure it's not a duplicate
chatbox.incrementUnreadMsgCounter(original_stanza);
...
...
@@ -74562,6 +74566,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
role = this.model.vcard.get('role'),
roles = role ? role.split(',') : [];
const msg = u.stringToElement(template(_.extend(this.model.toJSON(), {
'__': __,
'roles': roles,
'pretty_time': moment_time.format(_converse.time_format),
'time': moment_time.format(),
...
...
@@ -85554,7 +85559,13 @@ __p += '\n </span>\n <time timestamp="' +
__e(o.isodate) +
'" class="chat-msg-time">' +
__e(o.pretty_time) +
'</time>\n </span>\n <span class="chat-msg-text"></span>\n <div class="chat-msg-media"></div>\n </div>\n</div>\n';
'</time>\n </span>\n <span class="chat-msg-text"></span>\n <div class="chat-msg-media"></div>\n ';
if (o.edited) { ;
__p += ' <i title="' +
__e(o.__('This message has been edited')) +
'" class="fa fa-edit"></i> ';
} ;
__p += '\n </div>\n</div>\n';
return __p
};
spec/messages.js
View file @
19b9aead
...
...
@@ -105,7 +105,11 @@
expect
(
chatboxview
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
1
);
test_utils
.
waitUntil
(()
=>
chatboxview
.
el
.
querySelector
(
'
.chat-msg-text
'
).
textContent
===
'
But soft, what light through yonder window breaks?
'
).
then
(
done
);
'
But soft, what light through yonder window breaks?
'
).
then
(()
=>
{
expect
(
chatboxview
.
el
.
querySelectorAll
(
'
.chat-msg-content .fa-edit
'
).
length
).
toBe
(
1
);
done
();
});
}));
describe
(
"
when a chatbox is opened for someone who is not in the roster
"
,
function
()
{
...
...
src/converse-chatboxes.js
View file @
19b9aead
...
...
@@ -662,7 +662,11 @@
message
=
msgid
&&
chatbox
.
messages
.
findWhere
({
msgid
});
if
(
replace
)
{
message
.
save
(
'
message
'
,
getMessageBody
(
stanza
));
message
.
save
({
'
message
'
:
getMessageBody
(
stanza
),
'
older_versions
'
:
(
message
.
get
(
'
older_versions
'
)
||
[]).
push
(
message
.
get
(
'
message
'
)),
'
edited
'
:
true
});
}
else
if
(
!
message
)
{
// Only create the message when we're sure it's not a duplicate
chatbox
.
incrementUnreadMsgCounter
(
original_stanza
);
...
...
src/converse-message-view.js
View file @
19b9aead
...
...
@@ -121,6 +121,7 @@
const
msg
=
u
.
stringToElement
(
template
(
_
.
extend
(
this
.
model
.
toJSON
(),
{
'
__
'
:
__
,
'
roles
'
:
roles
,
'
pretty_time
'
:
moment_time
.
format
(
_converse
.
time_format
),
'
time
'
:
moment_time
.
format
(),
...
...
src/templates/message.html
View file @
19b9aead
...
...
@@ -11,5 +11,6 @@
</span>
<span
class=
"chat-msg-text"
></span>
<div
class=
"chat-msg-media"
></div>
{[ if (o.edited) { ]}
<i
title=
"{{{o.__('This message has been edited')}}}"
class=
"fa fa-edit"
></i>
{[ } ]}
</div>
</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