centralize emoji helper methods
This commit is contained in:
parent
5a044dc25b
commit
d099744dd4
7 changed files with 22 additions and 21 deletions
|
@ -2,11 +2,8 @@
|
|||
/* global Flash */
|
||||
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
import emojiMap from 'emojis/digests.json';
|
||||
import emojiAliases from 'emojis/aliases.json';
|
||||
import { glEmojiTag } from './behaviors/gl_emoji';
|
||||
import isEmojiNameValid from './behaviors/gl_emoji/is_emoji_name_valid';
|
||||
import { emojiMap, emojiAliases, isEmojiNameValid } from './emoji';
|
||||
|
||||
const animationEndEventString = 'animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd';
|
||||
const transitionEndEventString = 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd';
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import installCustomElements from 'document-register-element';
|
||||
import emojiMap from 'emojis/digests.json';
|
||||
import emojiAliases from 'emojis/aliases.json';
|
||||
import { getUnicodeSupportMap } from './gl_emoji/unicode_support_map';
|
||||
import { isEmojiUnicodeSupported } from './gl_emoji/is_emoji_unicode_supported';
|
||||
import { emojiMap, emojiAliases, isEmojiUnicodeSupported, getUnicodeSupportMap } from '../emoji';
|
||||
|
||||
installCustomElements(window);
|
||||
|
||||
|
|
13
app/assets/javascripts/emoji/index.js
Normal file
13
app/assets/javascripts/emoji/index.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import emojiMap from 'emojis/digests.json';
|
||||
import emojiAliases from 'emojis/aliases.json';
|
||||
import getUnicodeSupportMap from './unicode_support_map';
|
||||
import isEmojiNameValid from './is_emoji_name_valid';
|
||||
import isEmojiUnicodeSupported from './is_emoji_unicode_supported';
|
||||
|
||||
export {
|
||||
emojiMap,
|
||||
emojiAliases,
|
||||
getUnicodeSupportMap,
|
||||
isEmojiNameValid,
|
||||
isEmojiUnicodeSupported,
|
||||
};
|
|
@ -111,7 +111,7 @@ function isEmojiUnicodeSupported(unicodeSupportMap = {}, emojiUnicode, unicodeVe
|
|||
}
|
||||
|
||||
export {
|
||||
isEmojiUnicodeSupported,
|
||||
isEmojiUnicodeSupported as default,
|
||||
isFlagEmoji,
|
||||
isKeycapEmoji,
|
||||
isSkinToneComboEmoji,
|
|
@ -1,4 +1,4 @@
|
|||
import AccessorUtilities from '../../lib/utils/accessor';
|
||||
import AccessorUtilities from '../lib/utils/accessor';
|
||||
|
||||
const unicodeSupportTestMap = {
|
||||
// man, student (emojione does not have any of these yet), http://emojipedia.org/emoji-zwj-sequences/
|
||||
|
@ -140,7 +140,7 @@ function generateUnicodeSupportMap(testMap) {
|
|||
return resultMap;
|
||||
}
|
||||
|
||||
function getUnicodeSupportMap() {
|
||||
export default function getUnicodeSupportMap() {
|
||||
let unicodeSupportMap;
|
||||
let userAgentFromCache;
|
||||
|
||||
|
@ -165,8 +165,3 @@ function getUnicodeSupportMap() {
|
|||
|
||||
return unicodeSupportMap;
|
||||
}
|
||||
|
||||
export {
|
||||
getUnicodeSupportMap,
|
||||
generateUnicodeSupportMap,
|
||||
};
|
|
@ -1,8 +1,7 @@
|
|||
import emojiMap from 'emojis/digests.json';
|
||||
import emojiAliases from 'emojis/aliases.json';
|
||||
import { glEmojiTag } from '~/behaviors/gl_emoji';
|
||||
import glRegexp from '~/lib/utils/regexp';
|
||||
import AjaxCache from '~/lib/utils/ajax_cache';
|
||||
import { glEmojiTag } from './behaviors/gl_emoji';
|
||||
import { emojiMap, emojiAliases } from './emoji';
|
||||
import glRegexp from './lib/utils/regexp';
|
||||
import AjaxCache from './lib/utils/ajax_cache';
|
||||
|
||||
function sanitize(str) {
|
||||
return str.replace(/<(?:.|\n)*?>/gm, '');
|
||||
|
|
Loading…
Reference in a new issue