refactor: Move list of frequent emojis to emoji.js.

All of our data related to emojis is in emoji.js.
Now typeahead_helper no longer depends on emoji_picker.

Generally we want typeahead_helper to only depend
on data modules to avoid complicated circular
dependencies (or at least mitigate them).
This commit is contained in:
Steve Howell
2018-08-04 12:49:43 +00:00
committed by Tim Abbott
parent f4a8ff415c
commit ab22b4411f
5 changed files with 27 additions and 29 deletions

View File

@@ -12,18 +12,6 @@ var APPROX_WIDTH = 255;
// implemented as the emoji_popover.
exports.complete_emoji_catalog = [];
// Unfortunately, this list does not currently match on
// alias names like party_popper, simple_smile, and
// hammer_and_wrench. But thumbs_up sorts to the top
// for some other reason.
exports.frequently_used_emojis_list = [
'1f44d', // +1
'1f389', // tada
'1f642', // slight_smile
'2764', // heart
'1f6e0', // working_on_it
'1f419', // octopus
];
var current_message_emoji_popover_elem;
var emoji_catalog_last_coordinates = {
section: 0,
@@ -129,7 +117,7 @@ exports.generate_emoji_picker_data = function (realm_emojis) {
});
exports.complete_emoji_catalog.Popular = [];
_.each(exports.frequently_used_emojis_list, function (codepoint) {
_.each(emoji.frequently_used_emojis_list, function (codepoint) {
if (emoji_codes.codepoint_to_name.hasOwnProperty(codepoint)) {
var emoji_name = emoji_codes.codepoint_to_name[codepoint];
if (emoji.emojis_by_name.hasOwnProperty(emoji_name)) {