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
13d41910
Commit
13d41910
authored
Aug 16, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
converse-emoji-views: Show categories in chosen skintone
parent
1cf9a936
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
sass/_emoji.scss
sass/_emoji.scss
+5
-2
spec/messages.js
spec/messages.js
+0
-1
src/converse-emoji-views.js
src/converse-emoji-views.js
+9
-1
src/templates/emojis.html
src/templates/emojis.html
+2
-2
No files found.
sass/_emoji.scss
View file @
13d41910
...
@@ -36,13 +36,16 @@
...
@@ -36,13 +36,16 @@
margin
:
0
;
margin
:
0
;
padding
:
0
0
.5em
;
padding
:
0
0
.5em
;
white-space
:
nowrap
;
white-space
:
nowrap
;
font-size
:
var
(
--
font-size
);
font-size
:
var
(
--
font-size
-small
);
color
:
var
(
--
heading-color
);
color
:
var
(
--
heading-color
);
}
}
li
{
padding
:
0
0
.25em
;
}
padding
:
0
.5em
0
;
padding
:
0
.5em
0
;
background-color
:
var
(
--
chat-head-color
);
background-color
:
var
(
--
chat-head-color
);
width
:
auto
;
width
:
auto
;
font-size
:
var
(
--
font-size
-large
);
font-size
:
var
(
--
font-size
);
}
}
}
}
.emoji-picker
{
.emoji-picker
{
...
...
spec/messages.js
View file @
13d41910
...
@@ -954,7 +954,6 @@
...
@@ -954,7 +954,6 @@
'
id
'
:
_converse
.
connection
.
getUniqueId
()
'
id
'
:
_converse
.
connection
.
getUniqueId
()
}).
c
(
'
body
'
).
t
(
'
😇 Hello world! 😇 😇
'
).
up
()
}).
c
(
'
body
'
).
t
(
'
😇 Hello world! 😇 😇
'
).
up
()
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
}).
tree
());
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
}).
tree
());
debugger
;
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
message
=
chat_content
.
querySelector
(
'
.message:last-child .chat-msg__text
'
);
message
=
chat_content
.
querySelector
(
'
.message:last-child .chat-msg__text
'
);
expect
(
u
.
hasClass
(
'
chat-msg__text--larger
'
,
message
)).
toBe
(
false
);
expect
(
u
.
hasClass
(
'
chat-msg__text--larger
'
,
message
)).
toBe
(
false
);
...
...
src/converse-emoji-views.js
View file @
13d41910
...
@@ -150,13 +150,21 @@ converse.plugins.add('converse-emoji-views', {
...
@@ -150,13 +150,21 @@ converse.plugins.add('converse-emoji-views', {
'
shouldBeHidden
'
:
emojiShouldBeHidden
,
'
shouldBeHidden
'
:
emojiShouldBeHidden
,
'
skintones
'
:
[
'
tone1
'
,
'
tone2
'
,
'
tone3
'
,
'
tone4
'
,
'
tone5
'
],
'
skintones
'
:
[
'
tone1
'
,
'
tone2
'
,
'
tone3
'
,
'
tone4
'
,
'
tone5
'
],
'
toned_emojis
'
:
_converse
.
emojis
.
toned
,
'
toned_emojis
'
:
_converse
.
emojis
.
toned
,
'
transform
'
:
u
.
getEmojiRenderer
()
'
transform
'
:
u
.
getEmojiRenderer
(),
'
transformCategory
'
:
shortname
=>
u
.
getEmojiRenderer
()(
this
.
getTonedShortname
(
shortname
))
}
}
)
)
);
);
return
html
;
return
html
;
},
},
getTonedShortname
(
shortname
)
{
if
(
_converse
.
emojis
.
toned
.
includes
(
shortname
)
&&
this
.
model
.
get
(
'
current_skintone
'
))
{
return
`
${
shortname
.
slice
(
0
,
shortname
.
length
-
1
)}
_
${
this
.
model
.
get
(
'
current_skintone
'
)}
:`
}
return
shortname
;
},
chooseSkinTone
(
ev
)
{
chooseSkinTone
(
ev
)
{
ev
.
preventDefault
();
ev
.
preventDefault
();
ev
.
stopPropagation
();
ev
.
stopPropagation
();
...
...
src/templates/emojis.html
View file @
13d41910
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<ul>
<ul>
{[ Object.keys(o.emoji_categories).forEach(function (category) { ]}
{[ Object.keys(o.emoji_categories).forEach(function (category) { ]}
<li
data-category=
"{{{category}}}"
class=
"emoji-category {[ if (o.current_category === category) { ]} picked {[ } ]}"
>
<li
data-category=
"{{{category}}}"
class=
"emoji-category {[ if (o.current_category === category) { ]} picked {[ } ]}"
>
<a
class=
"pick-category"
href=
"#emoji-picker-{{{category}}}"
data-category=
"{{{category}}}"
>
{{ o.transform(o.emoji_categories[category]) }}
</a>
<a
class=
"pick-category"
href=
"#emoji-picker-{{{category}}}"
data-category=
"{{{category}}}"
>
{{ o.transform
Category
(o.emoji_categories[category]) }}
</a>
</li>
</li>
{[ }); ]}
{[ }); ]}
</ul>
</ul>
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
{[ }); ]}
{[ }); ]}
</div>
</div>
<div
class=
"emoji-skintone-picker"
>
<div
class=
"emoji-skintone-picker"
>
<label>
Skin tone
:
</label>
<label>
Skin tone
</label>
<ul>
<ul>
{[ o.skintones.forEach(function (skintone) { ]}
{[ o.skintones.forEach(function (skintone) { ]}
<li
data-skintone=
"{{{skintone}}}"
class=
"emoji-skintone {[ if (o.current_skintone === skintone) { ]} picked {[ } ]}"
>
<li
data-skintone=
"{{{skintone}}}"
class=
"emoji-skintone {[ if (o.current_skintone === skintone) { ]} picked {[ } ]}"
>
...
...
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