emoji: Change emoji image titles to use spaces instead of underscores.

Previously, the emoji images title display `🍼`.
This commit changes the title to display `baby bottle`.
This commit is contained in:
digi0ps
2017-06-09 14:00:24 +05:30
committed by Tim Abbott
parent 0f3c1c04d5
commit 2d92f9dc0b
8 changed files with 49 additions and 38 deletions

View File

@@ -118,27 +118,30 @@ function handleUnicodeEmoji(unicode_emoji) {
var hex_value = unicode_emoji.codePointAt(0).toString(16);
if (emoji.emojis_by_unicode.hasOwnProperty(hex_value)) {
var emoji_url = emoji.emojis_by_unicode[hex_value];
var display_string = ':' + emoji_codes.codepoint_to_name[hex_value] + ':';
return '<img alt="' + display_string + '"' +
var emoji_name = emoji_codes.codepoint_to_name[hex_value];
var alt_text = ':' + emoji_name + ':';
var title = emoji_name.split("_").join(" ");
return '<img alt="' + alt_text + '"' +
' class="emoji" src="' + emoji_url + '"' +
' title="' + display_string + '">';
' title="' + title + '">';
}
return unicode_emoji;
}
function handleEmoji(emoji_name) {
var input_emoji = ':' + emoji_name + ":";
var input_emoji = ':' + emoji_name + ':';
var title = emoji_name.split("_").join(" ");
var emoji_url;
if (emoji.active_realm_emojis.hasOwnProperty(emoji_name)) {
emoji_url = emoji.active_realm_emojis[emoji_name].emoji_url;
return '<img alt="' + input_emoji + '"' +
' class="emoji" src="' + emoji_url + '"' +
' title="' + input_emoji + '">';
' title="' + title + '">';
} else if (emoji.emojis_by_name.hasOwnProperty(emoji_name)) {
emoji_url = emoji.emojis_by_name[emoji_name];
return '<img alt="' + input_emoji + '"' +
' class="emoji" src="' + emoji_url + '"' +
' title="' + input_emoji + '">';
' title="' + title + '">';
}
return input_emoji;
}