How to use the emojilib.ordered function in emojilib

To help you get started, we’ve selected a few emojilib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github castorini / honkling / honkling-assistant / app / search.js View on Github external
/* global localStorage, fetch */
var emojilib = JSON.parse(localStorage.getItem('emojilib')) || require('emojilib').lib
var emojikeys = JSON.parse(localStorage.getItem('emojikeys')) || require('emojilib').ordered
var modifiers = require('emojilib').fitzpatrick_scale_modifiers
var clipboard = require('electron').clipboard
var ipc = require('electron').ipcRenderer

var CommandProcessor = require('./CommandProcessor')
var MicAudioProcessor = require('./micAudioProcessor')
var KeywordSpotter = require('honkling-node')
var displayManager = require('./displayManager')

var index = buildIndex()
var indexKeys = Object.keys(index)
var emojikeyIndexTable = buildEmojikeyIndexTable()
var searching = false
var searchInput = document.querySelector('.js-search')
var preference = JSON.parse(localStorage.getItem('preference'))
var directions = {
github night / BetterTTV / src / modules / emotes / emojis.js View on Github external
sendState.message = sendState.message.split(' ').map(piece => {
            if (piece.charAt(0) !== ':' || piece.charAt(piece.length - 1) !== ':') return piece;
            const emoji = emojilib.ordered[emojilib.ordered.indexOf(piece.replace(/:/g, ''))];
            if (!emoji || !emojilib.lib[emoji]) return piece;
            return emojilib.lib[emoji].char;
        }).join(' ');
    }
github night / BetterTTV / src / js / chat / helpers.js View on Github external
return message.split(' ').map(function(piece) {
        if (piece.charAt(0) !== ':' || piece.charAt(piece.length - 1) !== ':') return piece;
        var emoji = emojilib.ordered[emojilib.ordered.indexOf(piece.replace(/:/g, ''))];
        if (!emoji || !emojilib.lib[emoji]) return piece;
        if (!store.bttvEmotes[piece] || store.bttvEmotes[piece].type !== 'emoji') return piece;
        return emojilib.lib[emoji].char;
    }).join(' ');
};
github night / BetterTTV / src / js / chat / helpers.js View on Github external
return message.split(' ').map(function(piece) {
        if (piece.charAt(0) !== ':' || piece.charAt(piece.length - 1) !== ':') return piece;
        var emoji = emojilib.ordered[emojilib.ordered.indexOf(piece.replace(/:/g, ''))];
        if (!emoji || !emojilib.lib[emoji]) return piece;
        if (!store.bttvEmotes[piece] || store.bttvEmotes[piece].type !== 'emoji') return piece;
        return emojilib.lib[emoji].char;
    }).join(' ');
};
github jsumners / alfred-emoji / src / search.js View on Github external
'use strict'

const emojilib = require('emojilib')
const emojiNames = emojilib.ordered

let verb = 'Copy'
let preposition = 'to clipboard'

const resetWordsForPasteByDefault = () => {
  verb = 'Paste'
  preposition = 'as snippet'
}

const alfredItem = (emoji, name) => {
  return {
    uid: name,
    title: name,
    subtitle: `${verb} "${emoji}" (${name}) ${preposition}`,
    arg: emoji,
    autocomplete: name,
github shea256 / emojicoding / src / utils.js View on Github external
function isEmojiName(input) {
	if (emojilib.ordered.indexOf(input) < 0) {
		return false
	} else {
		return true
	}
}
github shea256 / emojicoding / src / encode.js View on Github external
tenBitChunks.map(emojiIndex => {
		const emojiName = emojilib.ordered[emojiIndex]
		emojiNames.push(emojiName)
	})
github shea256 / emojicoding / src / decode.js View on Github external
emojiNames.forEach(emojiName => {
		if (!isEmojiName(emojiName)) {
			throw new TypeError('Input contains invalid emoji name')
		}

		const emojiIndex = emojilib.ordered.indexOf(emojiName)

		if (emojiIndex > 1023) {
			throw new TypeError('Input contains characters outside the first 1024 emojis')
		} else {
			emojiIndices.push(emojiIndex)
		}
	})