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
972c31be
Commit
972c31be
authored
Jul 15, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
emoji: Allow the option of using emojione (now that we sanitize)
parent
284e8847
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
+14
-9
docs/source/configuration.rst
docs/source/configuration.rst
+5
-5
spec/chatbox.js
spec/chatbox.js
+2
-0
src/converse-chatview.js
src/converse-chatview.js
+2
-3
src/utils.js
src/utils.js
+5
-1
No files found.
docs/source/configuration.rst
View file @
972c31be
...
...
@@ -993,13 +993,13 @@ Notification will be shown in the following cases:
Requires the `src/converse-notification.js` plugin.
show
_emojione
------------
-
* Default: ``
fals
e``
use
_emojione
------------
* Default: ``
tru
e``
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
----------------------
...
...
spec/chatbox.js
View file @
972c31be
...
...
@@ -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
'
);
...
...
src/converse-chatview.js
View file @
972c31be
...
...
@@ -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
);
...
...
src/utils.js
View file @
972c31be
...
...
@@ -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
...
...
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