Skip to content

Commit

Permalink
Emoji: Eliminate unused images, make sure panel clicks add emoji (#1849)
Browse files Browse the repository at this point in the history
* Emoji: Ensure that all clicks work by using emoji data directly

* Eliminate a number of unused emoji images from final build

* Re-add the generic sheets directory, which we partially filter
  • Loading branch information
scottnonnenberg committed Dec 4, 2017
1 parent 9c7ba87 commit 2430ee0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/views/conversation_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@
this.updateMessageFieldSize({});
},
insertEmoji: function(e) {
var colons = ':' + emoji.data[e.unified.toLowerCase()][3][0] + ':';
var colons = ':' + emojiData[e.index].short_name + ':';

var textarea = this.$messageField[0];
if (textarea.selectionStart || textarea.selectionStart == '0') {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@
"fonts/*",
"build/assets",
"node_modules/**",
"!node_modules/emoji-datasource/*.png",
"!node_modules/emoji-datasource-apple/img/apple/{sheets-128,sheets-256}/*.png",
"!node_modules/emoji-datasource-apple/img/apple/sheets/{16,20,32}.png",
"!node_modules/spellchecker/vendor/hunspell/**/*",
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme,test,__tests__,tests,powered-test,example,examples,*.d.ts}",
"!**/node_modules/.bin",
Expand Down
1 change: 1 addition & 0 deletions preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
}, 1000);

window.EmojiConvertor = require('emoji-js');
window.emojiData = require('emoji-datasource');
window.nodeFetch = require('node-fetch');
window.httpsAgent = require('https').Agent;
window.nodeBuffer = Buffer;
Expand Down
2 changes: 1 addition & 1 deletion stylesheets/_emoji.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ button.emoji {
.emoji-panel-container {
height: 0px;
.ep-e {
background-image: url('../node_modules/emoji-datasource/sheet_apple_64.png');
background-image: url('../node_modules/emoji-datasource-apple/img/apple/sheets/64.png');
background-size: 1734px;
}
.ep-slide {
Expand Down
2 changes: 1 addition & 1 deletion stylesheets/manifest.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2430ee0

Please sign in to comment.