Fixes #985 Give help messages a "message" class and isodate data attr.

This commit is contained in:
JC Brand 2018-01-15 20:32:24 +01:00
parent fc17550d0c
commit 9b3c6d1a3a
3 changed files with 11 additions and 1 deletions

View File

@ -39,6 +39,15 @@
expect(info_messages.pop().textContent).toBe('/help: Show this menu');
expect(info_messages.pop().textContent).toBe('/me: Write in the third person');
expect(info_messages.pop().textContent).toBe('/clear: Remove messages');
var msg = $msg({
from: contact_jid,
to: _converse.connection.jid,
type: 'chat',
id: (new Date()).getTime()
}).c('body').t('hello world').tree();
_converse.chatboxes.onMessage(msg);
expect(view.content.lastElementChild.textContent.trim().indexOf('hello world')).not.toBe(-1);
done();
}));

View File

@ -580,6 +580,7 @@
this.content.insertAdjacentHTML(
'beforeend',
tpl_help_message({
'isodate': moment().format(),
'type': type||'info',
'message': xss.filterXSS(msg, {'whiteList': {'strong': []}})
})

View File

@ -1 +1 @@
<div class="chat-{{{o.type}}}">{{o.message}}</div>
<div class="message chat-{{{o.type}}}" data-isodate="{{{o.isodate}}}">{{o.message}}</div>