core/emoji/auto_complete

Description:
  • Emoji auto complete.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Emoji auto complete.

Methods

(inner) addRecentEmoji(unified, shortName)

Description:
  • Add an emoji data to the set of recent emojis. The new set of recent emojis are saved in local storage.

Source:
Parameters:
Name Type Description
unified String

The char chodes for the emoji

shortName String

The emoji short name

(inner) getActiveEmojiSuggestion(root) → {Element|null}

Description:
  • Get the currently active emoji button element in the list of suggestions.

Source:
Parameters:
Name Type Description
root Element

The emoji auto complete container element

Returns:
Type
Element | null

(inner) getEmojiTextFromShortName(shortName) → {String|null}

Description:
  • Get the actual emoji string from the short name.

Source:
Parameters:
Name Type Description
shortName String

Emoji short name

Returns:
Type
String | null

(inner) getRecentEmojis() → {Array}

Description:
  • Get the list of recent emojis data from local storage.

Source:
Returns:
Type
Array

(inner) getShortNameFromText(text) → {String}

Description:
  • Remove the colon characters from the given text.

Source:
Parameters:
Name Type Description
text String

The text to process

Returns:
Type
String

(inner) getWordFromPosition(text, position) → {String}

Description:
  • Get the current word at the given position (index) within the text.

Source:
Parameters:
Name Type Description
text String

The text to process

position Number

The position (index) within the text to match the word

Returns:
Type
String

(inner) isCompleteShortName(text) → {Bool}

Description:
  • Check if the given text is a full short name, i.e. has leading and trialing colon characters.

Source:
Parameters:
Name Type Description
text String

The text to process

Returns:
Type
Bool

(inner) isPartialShortName(text) → {Bool}

Description:
  • Check if the given text is a partial short name, i.e. has a leading colon but no trailing colon.

Source:
Parameters:
Name Type Description
text String

The text to process

Returns:
Type
Bool

(async, inner) render(root, shortNames)

Description:
  • Render the auto complete list for the given short names.

Source:
Parameters:
Name Type Description
root Element

The root container for the emoji auto complete

shortNames Array

The list of short names for emoji suggestions to show

(inner) searchEmojis(searchTerm, limit) → {Array}

Description:
  • Get the list of emoji short names that include the given search term. If the search term is an empty string then the list of recently used emojis will be returned.

Source:
Parameters:
Name Type Description
searchTerm String

Text to match on

limit Number

Maximum number of results to return

Returns:
Type
Array

(inner) selectEmojiElement(element, selectCallback)

Description:
  • Trigger the select callback for the given emoji button element.

Source:
Parameters:
Name Type Description
element Element

The emoji button element

selectCallback function

The callback for when the user selects an emoji

(inner) selectNextEmojiSuggestion(root)

Description:
  • Make the next sibling to the current active emoji active.

Source:
Parameters:
Name Type Description
root Element

The emoji auto complete container element

(inner) selectPreviousEmojiSuggestion(root)

Description:
  • Make the previous sibling of the current active emoji active.

Source:
Parameters:
Name Type Description
root Element

The emoji auto complete container element