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
23b65f5f
Commit
23b65f5f
authored
Sep 03, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lazily load emoji images
parent
e35fceff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
dist/converse.js
dist/converse.js
+4
-4
src/converse-chatview.js
src/converse-chatview.js
+4
-3
src/utils/emoji.js
src/utils/emoji.js
+1
-1
No files found.
dist/converse.js
View file @
23b65f5f
...
...
@@ -60961,7 +60961,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
initialize() {
this.initDebounced();
this.createEmojiPicker();
this.model.messages.on('add', this.onMessageAdded, this);
this.model.messages.on('rendered', this.scrollDown, this);
this.model.on('show', this.show, this);
...
...
@@ -61006,7 +61005,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.el.querySelector('.chat-toolbar').innerHTML = toolbar(options);
this.addSpoilerButton(options);
this.addFileUploadButton();
this.insertEmojiPicker();
_converse.emit('renderToolbar', this);
...
...
@@ -61745,6 +61743,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
toggleEmojiMenu(ev) {
if (_.isUndefined(this.emoji_dropdown)) {
ev.stopPropagation();
this.createEmojiPicker();
this.insertEmojiPicker();
this.renderEmojiPicker();
const dropdown_el = this.el.querySelector('.toggle-smiley.dropup');
this.emoji_dropdown = new bootstrap.Dropdown(dropdown_el, true);
this.emoji_dropdown.toggle();
...
...
@@ -61878,7 +61879,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
afterShown() {
this.model.clearUnreadMsgCounter();
this.setChatState(_converse.ACTIVE);
this.renderEmojiPicker();
this.scrollDown();
this.focus();
},
...
...
@@ -102993,7 +102993,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
/* will output unicode from shortname
* useful for sending emojis back to mobile devices
*/
//
r
eplace regular shortnames first
//
R
eplace regular shortnames first
str = str.replace(SHORTNAMES_REGEX, shortname => {
if (typeof shortname === 'undefined' || shortname === '' || !(shortname in emoji_list)) {
// if the shortname doesnt exist just return the entire matchhju
src/converse-chatview.js
View file @
23b65f5f
...
...
@@ -310,7 +310,6 @@
initialize
()
{
this
.
initDebounced
();
this
.
createEmojiPicker
();
this
.
model
.
messages
.
on
(
'
add
'
,
this
.
onMessageAdded
,
this
);
this
.
model
.
messages
.
on
(
'
rendered
'
,
this
.
scrollDown
,
this
);
...
...
@@ -358,7 +357,6 @@
this
.
el
.
querySelector
(
'
.chat-toolbar
'
).
innerHTML
=
toolbar
(
options
);
this
.
addSpoilerButton
(
options
);
this
.
addFileUploadButton
();
this
.
insertEmojiPicker
();
_converse
.
emit
(
'
renderToolbar
'
,
this
);
return
this
;
},
...
...
@@ -1057,6 +1055,10 @@
toggleEmojiMenu
(
ev
)
{
if
(
_
.
isUndefined
(
this
.
emoji_dropdown
))
{
ev
.
stopPropagation
();
this
.
createEmojiPicker
();
this
.
insertEmojiPicker
();
this
.
renderEmojiPicker
();
const
dropdown_el
=
this
.
el
.
querySelector
(
'
.toggle-smiley.dropup
'
);
this
.
emoji_dropdown
=
new
bootstrap
.
Dropdown
(
dropdown_el
,
true
);
this
.
emoji_dropdown
.
toggle
();
...
...
@@ -1179,7 +1181,6 @@
afterShown
()
{
this
.
model
.
clearUnreadMsgCounter
();
this
.
setChatState
(
_converse
.
ACTIVE
);
this
.
renderEmojiPicker
();
this
.
scrollDown
();
this
.
focus
();
},
...
...
src/utils/emoji.js
View file @
23b65f5f
...
...
@@ -173,7 +173,7 @@
/* will output unicode from shortname
* useful for sending emojis back to mobile devices
*/
//
r
eplace regular shortnames first
//
R
eplace regular shortnames first
str
=
str
.
replace
(
SHORTNAMES_REGEX
,
(
shortname
)
=>
{
if
(
(
typeof
shortname
===
'
undefined
'
)
||
(
shortname
===
''
)
||
(
!
(
shortname
in
emoji_list
))
)
{
// if the shortname doesnt exist just return the entire matchhju
...
...
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