contentbox.modules.contentbox-deps.modules.cbmarkdown.modules.cbemoji.models

Class EmojiService

lucee.Component
    extended by contentbox.modules.contentbox-deps.modules.cbmarkdown.modules.cbemoji.models.EmojiService

Emoji Service

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any emojimap
          The emoji map holder.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    any emojify(any target, [any onMissing])
         Takes in a string and replaces :emojikey: inside of it with the right emojis.
    private any ensureColons(any target)
         Ensure :string: colon patterns are returned.
    any get(any emoji)
         Returns an emoji code and displays on terminals that support it.
    any getByKey(any emoji)
         Get an emoji by clean key, if not found, it just returns the key back.
    string getEmojimap()
    any hasEmoji(any nameOrCode)
         Check if an emoji exists in this library either by key name or :name: pattern.
    any hasEmojiByCode(any code)
         Check if you have an emoji by code.
    any hasEmojiByName(any name)
         Check if you have an emoji by key or :key:.
    struct random()
         Get a random emoji.
    struct search(any target)
         Return a struct of potential emoji matches.
    any setEmojimap(any emojimap)
    private any stripColons(any target)
         Strip :emoji: colons from the text.
    private any stripNSB(any code)
         Remove the non-spacing-mark from the code, never send a stripped version to the client, as it kills graphical emoticons.
    any unemojify(any target)
         Unemojify a string.
    any which(any code, [boolean includeColons='false'])
         Pass in the emoji unicode and get the name, else empty string if not found.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    emojimap

    property any emojimap

    The emoji map holder

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    emojify

    public any emojify(any target, [any onMissing])

    Takes in a string and replaces :emojikey: inside of it with the right emojis

    Parameters:
    target - The string to emojify
    onMissing - Closure called if the emoji requested does not exist, return what you want to display.

    ensureColons

    private any ensureColons(any target)

    Ensure :string: colon patterns are returned

    Parameters:
    target - the incoming target to wrap in ::

    get

    public any get(any emoji)

    Returns an emoji code and displays on terminals that support it The emoji can be a direct key or a github flavored markup emoji: http://www.emoji-cheat-sheet.com/)

    Parameters:
    emoji - The emoji key

    getByKey

    public any getByKey(any emoji)

    Get an emoji by clean key, if not found, it just returns the key back This does not use the github flavored markup emoji key.

    Parameters:
    emoji - The emoji key

    getEmojimap

    public string getEmojimap()


    hasEmoji

    public any hasEmoji(any nameOrCode)

    Check if an emoji exists in this library either by key name or :name: pattern

    Parameters:
    nameOrCode - The key name or the :code: name

    hasEmojiByCode

    public any hasEmojiByCode(any code)

    Check if you have an emoji by code

    Parameters:
    code - The code

    hasEmojiByName

    public any hasEmojiByName(any name)

    Check if you have an emoji by key or :key:

    Parameters:
    name - The name

    random

    public struct random()

    Get a random emoji

    Returns:
    A struct with { key, emoji }

    search

    public struct search(any target)

    Return a struct of potential emoji matches

    Parameters:
    target - The search string to search

    setEmojimap

    public any setEmojimap(any emojimap)

    Parameters:
    emojimap

    stripColons

    private any stripColons(any target)

    Strip :emoji: colons from the text

    Parameters:
    target - The target string

    stripNSB

    private any stripNSB(any code)

    Remove the non-spacing-mark from the code, never send a stripped version to the client, as it kills graphical emoticons.

    Parameters:
    code - The code to inspect

    unemojify

    public any unemojify(any target)

    Unemojify a string

    Parameters:
    target - The string to unemojify

    which

    public any which(any code, [boolean includeColons='false'])

    Pass in the emoji unicode and get the name, else empty string if not found.

    Parameters:
    code - The emoji unicode
    includeColons - Wrap the word in colons or just by key