emoji: Allow the option of using emojione (now that we sanitize)
This commit is contained in:
parent
284e884766
commit
972c31be1d
@ -993,13 +993,13 @@ Notification will be shown in the following cases:
|
||||
|
||||
Requires the `src/converse-notification.js` plugin.
|
||||
|
||||
show_emojione
|
||||
-------------
|
||||
* Default: ``false``
|
||||
use_emojione
|
||||
------------
|
||||
* Default: ``true``
|
||||
|
||||
Determines whether `Emojione <https://www.emojione.com/>`_ should be used to
|
||||
render emojis. The default is not to do this, but to simply let the operating
|
||||
system or browser render emoji (if it has support for them).
|
||||
render emojis. If set to ``false``, then rendering support will fall back to
|
||||
the operating system or browser (which might not support emoji).
|
||||
|
||||
show_only_online_users
|
||||
----------------------
|
||||
|
@ -412,6 +412,8 @@
|
||||
}, 300).then(function () {
|
||||
$toolbar.children('li.toggle-smiley').click();
|
||||
expect(view.toggleEmojiMenu).toHaveBeenCalled();
|
||||
view.$el.find('textarea.chat-textarea').trigger($.Event('keypress', {keyCode: 13}));
|
||||
|
||||
test_utils.waitUntil(function () {
|
||||
var $picker = view.$el.find('.toggle-smiley .emoji-picker-container');
|
||||
return $picker.is(':visible');
|
||||
|
@ -92,6 +92,7 @@
|
||||
{ __ } = _converse;
|
||||
|
||||
_converse.api.settings.update({
|
||||
use_emojione: true,
|
||||
chatview_avatar_height: 32,
|
||||
chatview_avatar_width: 32,
|
||||
show_toolbar: true,
|
||||
@ -426,9 +427,7 @@
|
||||
'extra_classes': this.getExtraMessageClasses(attrs)
|
||||
})
|
||||
));
|
||||
if (_converse.visible_toolbar_buttons.emoji) {
|
||||
text = utils.addEmoji(_converse, emojione, text);
|
||||
}
|
||||
const msg_content = $msg[0].querySelector('.chat-msg-content');
|
||||
msg_content.innerHTML = xss.filterXSS(text, {'whiteList': {}});
|
||||
utils.addHyperlinks(msg_content);
|
||||
|
@ -599,8 +599,12 @@
|
||||
};
|
||||
|
||||
utils.addEmoji = function (_converse, emojione, text) {
|
||||
if (_converse.use_emojione) {
|
||||
return emojione.toImage(text);
|
||||
} else {
|
||||
return emojione.shortnameToUnicode(text);
|
||||
}
|
||||
}
|
||||
|
||||
utils.marshallEmojis = function (emojione) {
|
||||
/* Return a dict of emojis with the categories as keys and
|
||||
|
Loading…
Reference in New Issue
Block a user