Fixes #985 Give help messages a "message" class and isodate data attr.
This commit is contained in:
parent
fc17550d0c
commit
9b3c6d1a3a
|
@ -39,6 +39,15 @@
|
||||||
expect(info_messages.pop().textContent).toBe('/help: Show this menu');
|
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('/me: Write in the third person');
|
||||||
expect(info_messages.pop().textContent).toBe('/clear: Remove messages');
|
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();
|
done();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -580,6 +580,7 @@
|
||||||
this.content.insertAdjacentHTML(
|
this.content.insertAdjacentHTML(
|
||||||
'beforeend',
|
'beforeend',
|
||||||
tpl_help_message({
|
tpl_help_message({
|
||||||
|
'isodate': moment().format(),
|
||||||
'type': type||'info',
|
'type': type||'info',
|
||||||
'message': xss.filterXSS(msg, {'whiteList': {'strong': []}})
|
'message': xss.filterXSS(msg, {'whiteList': {'strong': []}})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
<div class="chat-{{{o.type}}}">{{o.message}}</div>
|
<div class="message chat-{{{o.type}}}" data-isodate="{{{o.isodate}}}">{{o.message}}</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user