Commit d099744d authored by Mike Greiling's avatar Mike Greiling

centralize emoji helper methods

parent 5a044dc2
...@@ -2,11 +2,8 @@ ...@@ -2,11 +2,8 @@
/* global Flash */ /* global Flash */
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import emojiMap from 'emojis/digests.json';
import emojiAliases from 'emojis/aliases.json';
import { glEmojiTag } from './behaviors/gl_emoji'; 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 animationEndEventString = 'animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd';
const transitionEndEventString = 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'; const transitionEndEventString = 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd';
......
import installCustomElements from 'document-register-element'; import installCustomElements from 'document-register-element';
import emojiMap from 'emojis/digests.json'; import { emojiMap, emojiAliases, isEmojiUnicodeSupported, getUnicodeSupportMap } from '../emoji';
import emojiAliases from 'emojis/aliases.json';
import { getUnicodeSupportMap } from './gl_emoji/unicode_support_map';
import { isEmojiUnicodeSupported } from './gl_emoji/is_emoji_unicode_supported';
installCustomElements(window); installCustomElements(window);
......
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 ...@@ -111,7 +111,7 @@ function isEmojiUnicodeSupported(unicodeSupportMap = {}, emojiUnicode, unicodeVe
} }
export { export {
isEmojiUnicodeSupported, isEmojiUnicodeSupported as default,
isFlagEmoji, isFlagEmoji,
isKeycapEmoji, isKeycapEmoji,
isSkinToneComboEmoji, isSkinToneComboEmoji,
......
import AccessorUtilities from '../../lib/utils/accessor'; import AccessorUtilities from '../lib/utils/accessor';
const unicodeSupportTestMap = { const unicodeSupportTestMap = {
// man, student (emojione does not have any of these yet), http://emojipedia.org/emoji-zwj-sequences/ // man, student (emojione does not have any of these yet), http://emojipedia.org/emoji-zwj-sequences/
...@@ -140,7 +140,7 @@ function generateUnicodeSupportMap(testMap) { ...@@ -140,7 +140,7 @@ function generateUnicodeSupportMap(testMap) {
return resultMap; return resultMap;
} }
function getUnicodeSupportMap() { export default function getUnicodeSupportMap() {
let unicodeSupportMap; let unicodeSupportMap;
let userAgentFromCache; let userAgentFromCache;
...@@ -165,8 +165,3 @@ function getUnicodeSupportMap() { ...@@ -165,8 +165,3 @@ function getUnicodeSupportMap() {
return unicodeSupportMap; return unicodeSupportMap;
} }
export {
getUnicodeSupportMap,
generateUnicodeSupportMap,
};
import emojiMap from 'emojis/digests.json'; import { glEmojiTag } from './behaviors/gl_emoji';
import emojiAliases from 'emojis/aliases.json'; import { emojiMap, emojiAliases } from './emoji';
import { glEmojiTag } from '~/behaviors/gl_emoji'; import glRegexp from './lib/utils/regexp';
import glRegexp from '~/lib/utils/regexp'; import AjaxCache from './lib/utils/ajax_cache';
import AjaxCache from '~/lib/utils/ajax_cache';
function sanitize(str) { function sanitize(str) {
return str.replace(/<(?:.|\n)*?>/gm, ''); return str.replace(/<(?:.|\n)*?>/gm, '');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment