Revision as of 01:57, December 19, 2019 by Bfriend (talk | contribs)
Jump to: navigation, search

Documentation/GWC/9.0Draft/WidgetsAPI/CustomEmoji

Customizable Emoji Menu

Introduction

WebChat offers a new v2 emoji menu that lets you choose emoji you want to offer.

V1 v2 Emoji Menu 2.jpg

Differences between v1 and v2

  • v1 shows as a tooltip-style overlay. v2 shows as a new block between the transcript and the message input
  • v1 closes when you select an emoji or click outside the menu. v2 lets you choose multiple emoji and only closes if you click the emoji menu button again.
  • v1 has 3 fixed emoji to choose from. v2 can show hundreds of customizable emoji in a grid layout
  • v1 menu appears in mobile mode. v2 menu is not available in mobile mode (when v2 is configured, no emoji menu button is present in mobile mode).
  • v1 menu has default emoji. v2 menu does not have default emoji. It must be explicitly configured with a list of emoji.

Usage

Clicking the Emoji menu icon at the bottom-left corner of the WebChat UI will open the v2 Emoji Menu. The transcript will be resized to fit the emoji menu, which can vary in height dependent on the number of emoji configured.

  • When 1-8 emoji are configured, the menu is one row tall, no scrollbar appears.
  • When 9-16 emoji are configured, the menu is two rows tall, no scrollbar appears.
  • When 17-24 emoji are configured, the menu is three rows tall, no scrollbar appears.
  • When 25 or more emoji are configured, the menu is three rows tall and a scrollbar appears.

V2 Emoji Menu Resizing.jpg

Configuring

The v2 emoji menu can be configured by passing a string containing emoji into the WebChat configuration or through localization.

Important
Note: If you define an emoji list in the WebChat configuration, it will override any emoji lists defined in localization files.

You configure the emoji list by specifying a string of emoji characters like "๐Ÿคฉ๐Ÿคช๐Ÿคญ๐Ÿคซ". WebChat will parse this string and arrange them into the emoji menu.

// Configure a flat list of emoji characters
_genesys.widgets.webchat.emojiList = "๐Ÿคฉ๐Ÿคช๐Ÿคญ๐Ÿคซ๐Ÿคจโ‚ฟ๐Ÿคฎ๐Ÿคฏ๐Ÿง๐Ÿคฌ๐Ÿงก๐ŸคŸ๐Ÿคฒ๐Ÿง ๐Ÿง’๐Ÿง‘๐Ÿง”๐Ÿง“๐Ÿง•๐Ÿคฑโ‚ฟ๐Ÿง™๐Ÿงš๐Ÿง›๐Ÿงœ๐Ÿง๐Ÿงž๐ŸงŸ๐Ÿง–๐Ÿง—๐Ÿง˜๐Ÿฆ“๐Ÿฆ’๐Ÿฆ”๐Ÿฆ•๐Ÿฆ–๐Ÿฆ—๐Ÿฅฅ๐Ÿฅฆ๐Ÿฅจ๐Ÿฅฉ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ‡ซ๐Ÿ‡ท๐ŸŽ‚๐Ÿ›๐Ÿ‡จ๐Ÿ‡ฆ๐Ÿ‡ง๐Ÿ‡ท๐Ÿ‰๐ŸŽ…๐Ÿ‡ฒ๐Ÿ‡ฝ๐Ÿ•ฏ๐Ÿ‡จ๐Ÿ‡ณ๐Ÿฐ๐ŸŽฅ๐Ÿ‚๐Ÿ‘จ๐Ÿ’ช๐ŸŽ“๐Ÿ”ฅ๐ŸŽƒ๐Ÿ•Ž๐Ÿ’•๐Ÿ•‰๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ‘ฉ๐ŸŽŠ๐ŸŠ๐Ÿณ๏ธโ€๐ŸŒˆ๐Ÿ‘‘โ˜ช๐ŸŒฑโ˜˜โ˜€๐Ÿˆ๐Ÿฆƒ๐Ÿ’˜๐Ÿ‘ฐโ›„๐ŸŽฟโšฝ๐ŸŒŽ";

Emoji Display Names

You can also add names to emoji so their name will appear when you hover over them. To add names to emojis, you simple add a colon and a name, and separate each instance with semicolons.

The format isย ;๐Ÿคฉ:name;

You can only add one name to an emoji. Each emoji:name pair must be separated by a semicolon at each end to separate it from the others. A colon must be used to link the title to the emoji.

// Configure an emoji list with emoji names
_genesys.widgets.webchat.emojiList = "๐Ÿคฉ:Star-Struck;๐Ÿคช:Zany Face;๐Ÿคญ:Face With Hand Over Mouth;๐Ÿคซ:Shushing Face;๐Ÿคจ:Face With Raised Eyebrow;โ‚ฟ:Bitcoin;๐Ÿคฎ:Face Vomiting;๐Ÿคฏ:Exploding Head;๐Ÿง:Face With Monocle;๐Ÿคฌ:Face With Symbols on Mouth;๐Ÿงก:Orange Heart;๐ŸคŸ:Love-You Gesture;๐Ÿคฒ:Palms Up Together;๐Ÿง :Brain;๐Ÿง’:Child;๐Ÿง‘:Person;๐Ÿง”:Man: Beard;๐Ÿง“:Older Person;๐Ÿง•:Woman With Headscarf;๐Ÿคฑ:Breast-Feeding;โ‚ฟ:Bitcoin;๐Ÿง™:Mage;๐Ÿงš:Fairy;๐Ÿง›:Vampire;๐Ÿงœ:Merperson;๐Ÿง:Elf;๐Ÿงž:Genie;๐ŸงŸ:Zombie;๐Ÿง–:Person in Steamy Room;๐Ÿง—:Person Climbing;๐Ÿง˜:Person in Lotus Position;๐Ÿฆ“:Zebra;๐Ÿฆ’:Giraffe;๐Ÿฆ”:Hedgehog;๐Ÿฆ•:Sauropod;๐Ÿฆ–:T-Rex;๐Ÿฆ—:Cricket;๐Ÿฅฅ:Coconut;๐Ÿฅฆ:Broccoli;๐Ÿฅจ:Pretzel;๐Ÿฅฉ:Cut of Meat;๐Ÿ‡ฆ๐Ÿ‡บ:Australia Day;๐Ÿ‡ซ๐Ÿ‡ท:Bastille Day;๐ŸŽ‚:Birthday;๐Ÿ›:Black Friday;๐Ÿ‡จ๐Ÿ‡ฆ:Canada Day;๐Ÿ‡ง๐Ÿ‡ท:Carnaval;๐Ÿ‰:Chinese New Year;๐ŸŽ…:Christmas;๐Ÿ‡ฒ๐Ÿ‡ฝ:Cinco de Mayo;๐Ÿ•ฏ:Diwali;๐Ÿ‡จ๐Ÿ‡ณ:Dragon Boat Festival;๐Ÿฐ:Easter;๐ŸŽฅ:Emoji Movie;๐Ÿ‚:Fall / Autumn;๐Ÿ‘จ:Fatherโ€™s Day;๐Ÿ’ช:Festivus;๐ŸŽ“:Graduation;๐Ÿ”ฅ:Guy Fawkes;๐ŸŽƒ:Halloween;๐Ÿ•Ž:Hanukkah;๐Ÿ’•:Hearts;๐Ÿ•‰:Holi;๐Ÿ‡บ๐Ÿ‡ธ:Independence Day;๐Ÿ‘ฉ:Motherโ€™s Day;๐ŸŽŠ:New Yearโ€™s Eve;๐ŸŠ:Olympics;๐Ÿณ๏ธโ€๐ŸŒˆ:Pride;๐Ÿ‘‘:Queenโ€™s Birthday;โ˜ช:Ramadan;๐ŸŒฑ:Spring;โ˜˜:St Patrickโ€™s Day;โ˜€:Summer;๐Ÿˆ:Super Bowl;๐Ÿฆƒ:Thanksgiving;๐Ÿ’˜:Valentineโ€™s Day;๐Ÿ‘ฐ:Wedding / Marriage;โ›„:Winter;๐ŸŽฟ:Winter Olympics;โšฝ:World Cup;๐ŸŒŽ:World Emoji Day;";

Partially Named Lists

You don't have to add names for every emoji. You can add titles to only a select few.

// Configure an emoji list with only a few emoji names
_genesys.widgets.webchat.emojiList = "๐Ÿคฉ๐Ÿคช๐Ÿคญ๐Ÿคซ๐Ÿคจโ‚ฟ๐Ÿคฎ๐Ÿคฏ๐Ÿง๐Ÿคฌ๐Ÿงก๐ŸคŸ;๐Ÿคฒ:Palms Up Together;๐Ÿง ๐Ÿง’๐Ÿง‘๐Ÿง”๐Ÿง“๐Ÿง•๐Ÿคฑโ‚ฟ๐Ÿง™๐Ÿงš๐Ÿง›๐Ÿงœ๐Ÿง๐Ÿงž๐ŸงŸ๐Ÿง–๐Ÿง—๐Ÿง˜๐Ÿฆ“๐Ÿฆ’๐Ÿฆ”๐Ÿฆ•๐Ÿฆ–๐Ÿฆ—๐Ÿฅฅ๐Ÿฅฆ๐Ÿฅจ๐Ÿฅฉ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ‡ซ๐Ÿ‡ท๐ŸŽ‚;๐Ÿ›:Black Friday;๐Ÿ‡จ๐Ÿ‡ฆ๐Ÿ‡ง๐Ÿ‡ท๐Ÿ‰๐ŸŽ…๐Ÿ‡ฒ๐Ÿ‡ฝ๐Ÿ•ฏ๐Ÿ‡จ๐Ÿ‡ณ๐Ÿฐ๐ŸŽฅ๐Ÿ‚๐Ÿ‘จ๐Ÿ’ช๐ŸŽ“๐Ÿ”ฅ๐ŸŽƒ๐Ÿ•Ž๐Ÿ’•๐Ÿ•‰๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ‘ฉ๐ŸŽŠ๐ŸŠ๐Ÿณ๏ธโ€๐ŸŒˆ๐Ÿ‘‘โ˜ช๐ŸŒฑโ˜˜โ˜€๐Ÿˆ๐Ÿฆƒ๐Ÿ’˜๐Ÿ‘ฐ;โ›„:Snowman;๐ŸŽฟโšฝ๐ŸŒŽ";




Localization

Emoji can be localized so that each language has a preferred set of emoji and emoji titles.

Important
Note: If you define an emoji list in the WebChat configuration, it will override any emoji lists defined in localization files.

The key name for defining an emoji list is "EmojiList".

Example:

{
    "en": {
        "webchat": {
            "EmojiList": "๐Ÿคฉ:Star-Struck;๐Ÿคช:Zany Face;๐Ÿคญ:Face With Hand Over Mouth;๐Ÿคซ:Shushing Face;"
        }
    }
}

Emoji lists are defined in a localization file using the same syntax as the WebChat configuration.

Comments or questions about this documentation? Contact us for support!