mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	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:
		@@ -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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user