From 4d5146b829f1060c29b6e2934a23743fed354fbc Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 23 Jul 2015 20:36:02 +0930 Subject: [PATCH 001/154] Initial commit --- extensions/emoji/.editorconfig | 32 ++++ extensions/emoji/.eslintignore | 5 + extensions/emoji/.eslintrc | 171 ++++++++++++++++++ extensions/emoji/.gitignore | 4 + extensions/emoji/bootstrap.php | 10 + extensions/emoji/composer.json | 7 + extensions/emoji/flarum.json | 16 ++ extensions/emoji/js/.gitignore | 3 + extensions/emoji/js/forum/Gulpfile.js | 8 + extensions/emoji/js/forum/bower.json | 6 + extensions/emoji/js/forum/package.json | 7 + extensions/emoji/js/forum/src/main.js | 16 ++ extensions/emoji/less/forum/extension.less | 5 + extensions/emoji/locale/en.yml | 2 + extensions/emoji/src/Extension.php | 13 ++ .../emoji/src/Listeners/AddClientAssets.php | 29 +++ .../emoji/src/Listeners/AddEmoticons.php | 29 +++ 17 files changed, 363 insertions(+) create mode 100644 extensions/emoji/.editorconfig create mode 100644 extensions/emoji/.eslintignore create mode 100644 extensions/emoji/.eslintrc create mode 100644 extensions/emoji/.gitignore create mode 100644 extensions/emoji/bootstrap.php create mode 100644 extensions/emoji/composer.json create mode 100644 extensions/emoji/flarum.json create mode 100644 extensions/emoji/js/.gitignore create mode 100644 extensions/emoji/js/forum/Gulpfile.js create mode 100644 extensions/emoji/js/forum/bower.json create mode 100644 extensions/emoji/js/forum/package.json create mode 100644 extensions/emoji/js/forum/src/main.js create mode 100644 extensions/emoji/less/forum/extension.less create mode 100644 extensions/emoji/locale/en.yml create mode 100644 extensions/emoji/src/Extension.php create mode 100644 extensions/emoji/src/Listeners/AddClientAssets.php create mode 100644 extensions/emoji/src/Listeners/AddEmoticons.php diff --git a/extensions/emoji/.editorconfig b/extensions/emoji/.editorconfig new file mode 100644 index 000000000..5612a5e74 --- /dev/null +++ b/extensions/emoji/.editorconfig @@ -0,0 +1,32 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.js] +indent_style = space +indent_size = 2 + +[*.{css,less}] +indent_style = space +indent_size = 2 + +[*.html] +indent_style = space +indent_size = 2 + +[*.{diff,md}] +trim_trailing_whitespace = false + +[*.php] +indent_style = space +indent_size = 4 diff --git a/extensions/emoji/.eslintignore b/extensions/emoji/.eslintignore new file mode 100644 index 000000000..86b7c8854 --- /dev/null +++ b/extensions/emoji/.eslintignore @@ -0,0 +1,5 @@ +**/bower_components/**/* +**/node_modules/**/* +vendor/**/* +**/Gulpfile.js +**/dist/**/* diff --git a/extensions/emoji/.eslintrc b/extensions/emoji/.eslintrc new file mode 100644 index 000000000..9cebc759d --- /dev/null +++ b/extensions/emoji/.eslintrc @@ -0,0 +1,171 @@ +{ + "parser": "babel-eslint", // https://github.com/babel/babel-eslint + "env": { // http://eslint.org/docs/user-guide/configuring.html#specifying-environments + "browser": true // browser global variables + }, + "ecmaFeatures": { + "arrowFunctions": true, + "blockBindings": true, + "classes": true, + "defaultParams": true, + "destructuring": true, + "forOf": true, + "generators": false, + "modules": true, + "objectLiteralComputedProperties": true, + "objectLiteralDuplicateProperties": false, + "objectLiteralShorthandMethods": true, + "objectLiteralShorthandProperties": true, + "spread": true, + "superInFunctions": true, + "templateStrings": true, + "jsx": true + }, + "globals": { + "m": true, + "app": true, + "$": true, + "moment": true + }, + "rules": { +/** + * Strict mode + */ + // babel inserts "use strict"; for us + "strict": [2, "never"], // http://eslint.org/docs/rules/strict + +/** + * ES6 + */ + "no-var": 2, // http://eslint.org/docs/rules/no-var + "prefer-const": 2, // http://eslint.org/docs/rules/prefer-const + +/** + * Variables + */ + "no-shadow": 2, // http://eslint.org/docs/rules/no-shadow + "no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names + "no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars + "vars": "local", + "args": "after-used" + }], + "no-use-before-define": 2, // http://eslint.org/docs/rules/no-use-before-define + +/** + * Possible errors + */ + "comma-dangle": [2, "never"], // http://eslint.org/docs/rules/comma-dangle + "no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign + "no-console": 1, // http://eslint.org/docs/rules/no-console + "no-debugger": 1, // http://eslint.org/docs/rules/no-debugger + "no-alert": 1, // http://eslint.org/docs/rules/no-alert + "no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition + "no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys + "no-duplicate-case": 2, // http://eslint.org/docs/rules/no-duplicate-case + "no-empty": 2, // http://eslint.org/docs/rules/no-empty + "no-ex-assign": 2, // http://eslint.org/docs/rules/no-ex-assign + "no-extra-boolean-cast": 0, // http://eslint.org/docs/rules/no-extra-boolean-cast + "no-extra-semi": 2, // http://eslint.org/docs/rules/no-extra-semi + "no-func-assign": 2, // http://eslint.org/docs/rules/no-func-assign + "no-inner-declarations": 2, // http://eslint.org/docs/rules/no-inner-declarations + "no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp + "no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace + "no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls + "no-reserved-keys": 2, // http://eslint.org/docs/rules/no-reserved-keys + "no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays + "no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable + "use-isnan": 2, // http://eslint.org/docs/rules/use-isnan + "block-scoped-var": 2, // http://eslint.org/docs/rules/block-scoped-var + +/** + * Best practices + */ + "consistent-return": 2, // http://eslint.org/docs/rules/consistent-return + "curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly + "default-case": 2, // http://eslint.org/docs/rules/default-case + "dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation + "allowKeywords": true + }], + "eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq + "no-caller": 2, // http://eslint.org/docs/rules/no-caller + "no-else-return": 2, // http://eslint.org/docs/rules/no-else-return + "no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null + "no-eval": 2, // http://eslint.org/docs/rules/no-eval + "no-extend-native": 2, // http://eslint.org/docs/rules/no-extend-native + "no-extra-bind": 2, // http://eslint.org/docs/rules/no-extra-bind + "no-fallthrough": 2, // http://eslint.org/docs/rules/no-fallthrough + "no-floating-decimal": 2, // http://eslint.org/docs/rules/no-floating-decimal + "no-implied-eval": 2, // http://eslint.org/docs/rules/no-implied-eval + "no-lone-blocks": 2, // http://eslint.org/docs/rules/no-lone-blocks + "no-loop-func": 2, // http://eslint.org/docs/rules/no-loop-func + "no-multi-str": 2, // http://eslint.org/docs/rules/no-multi-str + "no-native-reassign": 2, // http://eslint.org/docs/rules/no-native-reassign + "no-new": 2, // http://eslint.org/docs/rules/no-new + "no-new-func": 2, // http://eslint.org/docs/rules/no-new-func + "no-new-wrappers": 2, // http://eslint.org/docs/rules/no-new-wrappers + "no-octal": 2, // http://eslint.org/docs/rules/no-octal + "no-octal-escape": 2, // http://eslint.org/docs/rules/no-octal-escape + "no-param-reassign": 2, // http://eslint.org/docs/rules/no-param-reassign + "no-proto": 2, // http://eslint.org/docs/rules/no-proto + "no-redeclare": 2, // http://eslint.org/docs/rules/no-redeclare + "no-return-assign": 2, // http://eslint.org/docs/rules/no-return-assign + "no-self-compare": 2, // http://eslint.org/docs/rules/no-self-compare + "no-sequences": 2, // http://eslint.org/docs/rules/no-sequences + "no-throw-literal": 2, // http://eslint.org/docs/rules/no-throw-literal + "no-with": 2, // http://eslint.org/docs/rules/no-with + "radix": 2, // http://eslint.org/docs/rules/radix + "vars-on-top": 2, // http://eslint.org/docs/rules/vars-on-top + "wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife + "yoda": 2, // http://eslint.org/docs/rules/yoda + +/** + * Style + */ + "indent": [2, 2], // http://eslint.org/docs/rules/indent + "brace-style": [2, // http://eslint.org/docs/rules/brace-style + "1tbs", { + "allowSingleLine": true + }], + "quotes": [ + 2, "single", "avoid-escape" // http://eslint.org/docs/rules/quotes + ], + "camelcase": [2, { // http://eslint.org/docs/rules/camelcase + "properties": "never" + }], + "comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing + "before": false, + "after": true + }], + "comma-style": [2, "last"], // http://eslint.org/docs/rules/comma-style + "eol-last": 2, // http://eslint.org/docs/rules/eol-last + "func-names": 1, // http://eslint.org/docs/rules/func-names + "key-spacing": [2, { // http://eslint.org/docs/rules/key-spacing + "beforeColon": false, + "afterColon": true + }], + "new-cap": [2, { // http://eslint.org/docs/rules/new-cap + "newIsCap": true + }], + "no-multiple-empty-lines": [2, { // http://eslint.org/docs/rules/no-multiple-empty-lines + "max": 2 + }], + "no-new-object": 2, // http://eslint.org/docs/rules/no-new-object + "no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func + "no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces + "no-wrap-func": 2, // http://eslint.org/docs/rules/no-wrap-func + "no-underscore-dangle": 0, // http://eslint.org/docs/rules/no-underscore-dangle + "one-var": [2, "never"], // http://eslint.org/docs/rules/one-var + "padded-blocks": [2, "never"], // http://eslint.org/docs/rules/padded-blocks + "semi": [2, "always"], // http://eslint.org/docs/rules/semi + "semi-spacing": [2, { // http://eslint.org/docs/rules/semi-spacing + "before": false, + "after": true + }], + "space-after-keywords": 2, // http://eslint.org/docs/rules/space-after-keywords + "space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks + "space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren + "space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops + "space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case + "spaced-line-comment": 2, // http://eslint.org/docs/rules/spaced-line-comment + } +} diff --git a/extensions/emoji/.gitignore b/extensions/emoji/.gitignore new file mode 100644 index 000000000..a4f3b125e --- /dev/null +++ b/extensions/emoji/.gitignore @@ -0,0 +1,4 @@ +/vendor +composer.phar +.DS_Store +Thumbs.db diff --git a/extensions/emoji/bootstrap.php b/extensions/emoji/bootstrap.php new file mode 100644 index 000000000..2ec1c9832 --- /dev/null +++ b/extensions/emoji/bootstrap.php @@ -0,0 +1,10 @@ +=5.4.0", + "flarum": ">0.1.0" + } +} \ No newline at end of file diff --git a/extensions/emoji/js/.gitignore b/extensions/emoji/js/.gitignore new file mode 100644 index 000000000..372e20a51 --- /dev/null +++ b/extensions/emoji/js/.gitignore @@ -0,0 +1,3 @@ +bower_components +node_modules +dist diff --git a/extensions/emoji/js/forum/Gulpfile.js b/extensions/emoji/js/forum/Gulpfile.js new file mode 100644 index 000000000..1c3a1a990 --- /dev/null +++ b/extensions/emoji/js/forum/Gulpfile.js @@ -0,0 +1,8 @@ +var gulp = require('flarum-gulp'); + +gulp({ + modulePrefix: 'emoji', + files: [ + 'bower_components/twemoji/index.js' + ] +}); diff --git a/extensions/emoji/js/forum/bower.json b/extensions/emoji/js/forum/bower.json new file mode 100644 index 000000000..12710063f --- /dev/null +++ b/extensions/emoji/js/forum/bower.json @@ -0,0 +1,6 @@ +{ + "name": "flarum-emoji", + "devDependencies": { + "twemoji": "https://raw.githubusercontent.com/twitter/twemoji/gh-pages/twemoji.min.js" + } +} diff --git a/extensions/emoji/js/forum/package.json b/extensions/emoji/js/forum/package.json new file mode 100644 index 000000000..3e0ef919d --- /dev/null +++ b/extensions/emoji/js/forum/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "devDependencies": { + "gulp": "^3.8.11", + "flarum-gulp": "git+https://github.com/flarum/gulp.git" + } +} diff --git a/extensions/emoji/js/forum/src/main.js b/extensions/emoji/js/forum/src/main.js new file mode 100644 index 000000000..dc9157513 --- /dev/null +++ b/extensions/emoji/js/forum/src/main.js @@ -0,0 +1,16 @@ +/*global twemoji, s9e*/ + +import { override } from 'flarum/extend'; +import app from 'flarum/app'; +import Post from 'flarum/models/Post'; + +app.initializers.add('emoji', () => { + override(Post.prototype, 'contentHtml', original => { + return twemoji.parse(original()); + }); + + override(s9e.TextFormatter, 'preview', (original, content, elm) => { + original(content, elm); + twemoji.parse(elm); + }); +}); diff --git a/extensions/emoji/less/forum/extension.less b/extensions/emoji/less/forum/extension.less new file mode 100644 index 000000000..236dc4157 --- /dev/null +++ b/extensions/emoji/less/forum/extension.less @@ -0,0 +1,5 @@ +img.emoji { + height: 1.5em; + margin: 0 .05em 0 .1em; + vertical-align: -0.3em; +} diff --git a/extensions/emoji/locale/en.yml b/extensions/emoji/locale/en.yml new file mode 100644 index 000000000..55f519f92 --- /dev/null +++ b/extensions/emoji/locale/en.yml @@ -0,0 +1,2 @@ +emoji: + diff --git a/extensions/emoji/src/Extension.php b/extensions/emoji/src/Extension.php new file mode 100644 index 000000000..9197ca630 --- /dev/null +++ b/extensions/emoji/src/Extension.php @@ -0,0 +1,13 @@ +subscribe('Flarum\Emoji\Listeners\AddClientAssets'); + $events->subscribe('Flarum\Emoji\Listeners\AddEmoticons'); + } +} diff --git a/extensions/emoji/src/Listeners/AddClientAssets.php b/extensions/emoji/src/Listeners/AddClientAssets.php new file mode 100644 index 000000000..ab74fcc5b --- /dev/null +++ b/extensions/emoji/src/Listeners/AddClientAssets.php @@ -0,0 +1,29 @@ +listen(RegisterLocales::class, __CLASS__.'@addLocale'); + $events->listen(BuildClientView::class, __CLASS__.'@addAssets'); + } + + public function addLocale(RegisterLocales $event) + { + $event->addTranslations('en', __DIR__.'/../../locale/en.yml'); + } + + public function addAssets(BuildClientView $event) + { + $event->forumAssets([ + __DIR__.'/../../js/forum/dist/extension.js', + __DIR__.'/../../less/forum/extension.less' + ]); + + $event->forumBootstrapper('emoji/main'); + } +} diff --git a/extensions/emoji/src/Listeners/AddEmoticons.php b/extensions/emoji/src/Listeners/AddEmoticons.php new file mode 100644 index 000000000..5531e779e --- /dev/null +++ b/extensions/emoji/src/Listeners/AddEmoticons.php @@ -0,0 +1,29 @@ +listen(FormatterConfigurator::class, __CLASS__.'@addEmoticons'); + } + + public function addEmoticons(FormatterConfigurator $event) + { + $event->configurator->Emoticons->add(':)', '😄'); + $event->configurator->Emoticons->add(':D', '😃'); + $event->configurator->Emoticons->add(':P', '😜'); + $event->configurator->Emoticons->add(':(', '😟'); + $event->configurator->Emoticons->add(':|', '😐'); + $event->configurator->Emoticons->add(';)', '😉'); + $event->configurator->Emoticons->add(':*', '😘'); + $event->configurator->Emoticons->add(':\'(', '😢'); + $event->configurator->Emoticons->add(':\')', '😂'); + $event->configurator->Emoticons->add(':O', '😮'); + $event->configurator->Emoticons->add('B)', '😎'); + $event->configurator->Emoticons->add('>:(', '😡'); + $event->configurator->Emoticons->add(':/', '😕'); + } +} From e536ea5d0d3e078497a88ce0961fdf7ec016395f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 24 Jul 2015 13:30:06 +0930 Subject: [PATCH 002/154] Temporarily remove :/ emoticon See https://github.com/s9e/TextFormatter/issues/12 --- extensions/emoji/src/Listeners/AddEmoticons.php | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/emoji/src/Listeners/AddEmoticons.php b/extensions/emoji/src/Listeners/AddEmoticons.php index 5531e779e..756c2a6b2 100644 --- a/extensions/emoji/src/Listeners/AddEmoticons.php +++ b/extensions/emoji/src/Listeners/AddEmoticons.php @@ -24,6 +24,5 @@ class AddEmoticons $event->configurator->Emoticons->add(':O', '😮'); $event->configurator->Emoticons->add('B)', '😎'); $event->configurator->Emoticons->add('>:(', '😡'); - $event->configurator->Emoticons->add(':/', '😕'); } } From c5bb8bcf6c9d6e2c46758133076f413c550380b9 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 27 Jul 2015 11:54:03 +0930 Subject: [PATCH 003/154] PERF: avoid reinstantiation of event subscribers --- extensions/emoji/src/Listeners/AddClientAssets.php | 4 ++-- extensions/emoji/src/Listeners/AddEmoticons.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/emoji/src/Listeners/AddClientAssets.php b/extensions/emoji/src/Listeners/AddClientAssets.php index ab74fcc5b..da8cb54b7 100644 --- a/extensions/emoji/src/Listeners/AddClientAssets.php +++ b/extensions/emoji/src/Listeners/AddClientAssets.php @@ -8,8 +8,8 @@ class AddClientAssets { public function subscribe(Dispatcher $events) { - $events->listen(RegisterLocales::class, __CLASS__.'@addLocale'); - $events->listen(BuildClientView::class, __CLASS__.'@addAssets'); + $events->listen(RegisterLocales::class, [$this, 'addLocale']); + $events->listen(BuildClientView::class, [$this, 'addAssets']); } public function addLocale(RegisterLocales $event) diff --git a/extensions/emoji/src/Listeners/AddEmoticons.php b/extensions/emoji/src/Listeners/AddEmoticons.php index 756c2a6b2..e8303cadb 100644 --- a/extensions/emoji/src/Listeners/AddEmoticons.php +++ b/extensions/emoji/src/Listeners/AddEmoticons.php @@ -7,7 +7,7 @@ class AddEmoticons { public function subscribe(Dispatcher $events) { - $events->listen(FormatterConfigurator::class, __CLASS__.'@addEmoticons'); + $events->listen(FormatterConfigurator::class, [$this, 'addEmoticons']); } public function addEmoticons(FormatterConfigurator $event) From 68b402015a885c60ea418b7fd2fa010cd579d3b7 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 27 Jul 2015 14:19:08 +0930 Subject: [PATCH 004/154] Better way to override formatting util --- extensions/emoji/js/forum/src/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/emoji/js/forum/src/main.js b/extensions/emoji/js/forum/src/main.js index dc9157513..0b73b931c 100644 --- a/extensions/emoji/js/forum/src/main.js +++ b/extensions/emoji/js/forum/src/main.js @@ -3,14 +3,14 @@ import { override } from 'flarum/extend'; import app from 'flarum/app'; import Post from 'flarum/models/Post'; +import Formatter from 'flarum/utils/Formatter'; app.initializers.add('emoji', () => { override(Post.prototype, 'contentHtml', original => { return twemoji.parse(original()); }); - override(s9e.TextFormatter, 'preview', (original, content, elm) => { - original(content, elm); - twemoji.parse(elm); + override(Formatter, 'format', (original, text) => { + return twemoji.parse(original(text)); }); }); From 652786892408ff852a97fd2a93f7d9830f7be36e Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 27 Jul 2015 14:19:11 +0930 Subject: [PATCH 005/154] Update gulp module configuration --- extensions/emoji/js/forum/Gulpfile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/emoji/js/forum/Gulpfile.js b/extensions/emoji/js/forum/Gulpfile.js index 1c3a1a990..dc2bde879 100644 --- a/extensions/emoji/js/forum/Gulpfile.js +++ b/extensions/emoji/js/forum/Gulpfile.js @@ -1,7 +1,9 @@ var gulp = require('flarum-gulp'); gulp({ - modulePrefix: 'emoji', + modules: { + 'emoji': 'src/**/*.js' + }, files: [ 'bower_components/twemoji/index.js' ] From cb358a90846f354d16394741a0cb6d8e3c3a2b56 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 28 Jul 2015 16:06:37 +0930 Subject: [PATCH 006/154] Update for live preview refactor --- extensions/emoji/js/forum/src/main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extensions/emoji/js/forum/src/main.js b/extensions/emoji/js/forum/src/main.js index 0b73b931c..af43e47af 100644 --- a/extensions/emoji/js/forum/src/main.js +++ b/extensions/emoji/js/forum/src/main.js @@ -3,14 +3,15 @@ import { override } from 'flarum/extend'; import app from 'flarum/app'; import Post from 'flarum/models/Post'; -import Formatter from 'flarum/utils/Formatter'; app.initializers.add('emoji', () => { override(Post.prototype, 'contentHtml', original => { return twemoji.parse(original()); }); - override(Formatter, 'format', (original, text) => { - return twemoji.parse(original(text)); + override(s9e.TextFormatter, 'preview', (original, text, element) => { + original(text, element); + + twemoji.parse(element); }); }); From 637e3abfc9cd93ba518ba070f01bae7ceaa73627 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 31 Jul 2015 20:32:49 +0930 Subject: [PATCH 007/154] PERF: Cache emojified post content --- extensions/emoji/js/forum/src/main.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/extensions/emoji/js/forum/src/main.js b/extensions/emoji/js/forum/src/main.js index af43e47af..26ce757fc 100644 --- a/extensions/emoji/js/forum/src/main.js +++ b/extensions/emoji/js/forum/src/main.js @@ -5,8 +5,15 @@ import app from 'flarum/app'; import Post from 'flarum/models/Post'; app.initializers.add('emoji', () => { - override(Post.prototype, 'contentHtml', original => { - return twemoji.parse(original()); + override(Post.prototype, 'contentHtml', function(original) { + const contentHtml = original(); + + if (this.oldContentHtml !== contentHtml) { + this.emojifiedContentHtml = twemoji.parse(contentHtml); + this.oldContentHtml = contentHtml; + } + + return this.emojifiedContentHtml; }); override(s9e.TextFormatter, 'preview', (original, text, element) => { From ca85d1ebe2a703f7443c0d41709dd69fb6d49be8 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 13 Aug 2015 12:49:04 +0930 Subject: [PATCH 008/154] Add icon --- extensions/emoji/flarum.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/extensions/emoji/flarum.json b/extensions/emoji/flarum.json index 793a6e893..775b867a5 100644 --- a/extensions/emoji/flarum.json +++ b/extensions/emoji/flarum.json @@ -2,7 +2,7 @@ "name": "emoji", "title": "Emoji", "description": "Convert text and unicode emoji into Twemoji.", - "keywords": [], + "keywords": ["discussions"], "version": "0.1.0", "author": { "name": "Toby Zerner", @@ -12,5 +12,10 @@ "require": { "php": ">=5.4.0", "flarum": ">0.1.0" + }, + "icon": { + "name": "smile-o", + "backgroundColor": "#FFC700", + "color": "#000" } -} \ No newline at end of file +} From 1eb5d79944a0d4c2cb3b8fdff8e75249f42c5095 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 13 Aug 2015 12:49:07 +0930 Subject: [PATCH 009/154] Use new listen API --- extensions/emoji/src/Extension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/emoji/src/Extension.php b/extensions/emoji/src/Extension.php index 9197ca630..3748d996d 100644 --- a/extensions/emoji/src/Extension.php +++ b/extensions/emoji/src/Extension.php @@ -5,7 +5,7 @@ use Illuminate\Events\Dispatcher; class Extension extends BaseExtension { - public function boot(Dispatcher $events) + public function listen(Dispatcher $events) { $events->subscribe('Flarum\Emoji\Listeners\AddClientAssets'); $events->subscribe('Flarum\Emoji\Listeners\AddEmoticons'); From ae6dfee0078b4db8f7b44283207f8b21b9bd7968 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 4 Sep 2015 11:37:09 +0930 Subject: [PATCH 010/154] Add phpcs, Travis, clean up editorconfig and eslint --- extensions/emoji/.editorconfig | 13 ------------- extensions/emoji/.eslintrc | 5 +++++ extensions/emoji/.php_cs | 27 +++++++++++++++++++++++++++ extensions/emoji/.travis.yml | 23 +++++++++++++++++++++++ extensions/emoji/composer.json | 3 +++ 5 files changed, 58 insertions(+), 13 deletions(-) create mode 100755 extensions/emoji/.php_cs create mode 100644 extensions/emoji/.travis.yml diff --git a/extensions/emoji/.editorconfig b/extensions/emoji/.editorconfig index 5612a5e74..87694ddab 100644 --- a/extensions/emoji/.editorconfig +++ b/extensions/emoji/.editorconfig @@ -12,21 +12,8 @@ insert_final_newline = true indent_style = space indent_size = 2 -[*.js] -indent_style = space -indent_size = 2 - -[*.{css,less}] -indent_style = space -indent_size = 2 - -[*.html] -indent_style = space -indent_size = 2 - [*.{diff,md}] trim_trailing_whitespace = false [*.php] -indent_style = space indent_size = 4 diff --git a/extensions/emoji/.eslintrc b/extensions/emoji/.eslintrc index 9cebc759d..534b50e27 100644 --- a/extensions/emoji/.eslintrc +++ b/extensions/emoji/.eslintrc @@ -27,7 +27,12 @@ "$": true, "moment": true }, + "plugins": [ + "react" + ], "rules": { + "react/jsx-uses-vars": 1, + /** * Strict mode */ diff --git a/extensions/emoji/.php_cs b/extensions/emoji/.php_cs new file mode 100755 index 000000000..c55085293 --- /dev/null +++ b/extensions/emoji/.php_cs @@ -0,0 +1,27 @@ + + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. +EOF; + +Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header); + +$finder = Symfony\CS\Finder\DefaultFinder::create() + ->exclude('js') + ->exclude('less') + ->in(__DIR__); + +return Symfony\CS\Config\Config::create() + ->setUsingCache(true) + ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) + ->fixers([ + 'short_array_syntax', + 'header_comment', + '-psr0' + ]) + ->finder($finder); diff --git a/extensions/emoji/.travis.yml b/extensions/emoji/.travis.yml new file mode 100644 index 000000000..692e09f86 --- /dev/null +++ b/extensions/emoji/.travis.yml @@ -0,0 +1,23 @@ +language: php + +php: + - 5.5 + - 5.6 + +matrix: + allow_failures: + - php: hhvm + fast_finish: true + +before_script: + - curl -s http://getcomposer.org/installer | php + - php composer.phar install + +script: + - php composer.phar style + +notifications: + email: + on_failure: change + +sudo: false diff --git a/extensions/emoji/composer.json b/extensions/emoji/composer.json index decd9705f..83896c549 100644 --- a/extensions/emoji/composer.json +++ b/extensions/emoji/composer.json @@ -3,5 +3,8 @@ "psr-4": { "Flarum\\Emoji\\": "src/" } + }, + "scripts": { + "style": "phpcs --standard=PSR2 -np src" } } From 009f52c5e1ee444cbf76dc15014a6c8ec3decd21 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 4 Sep 2015 12:07:46 +0930 Subject: [PATCH 011/154] Update flarum.json --- extensions/emoji/flarum.json | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/extensions/emoji/flarum.json b/extensions/emoji/flarum.json index 775b867a5..5caede69b 100644 --- a/extensions/emoji/flarum.json +++ b/extensions/emoji/flarum.json @@ -3,19 +3,23 @@ "title": "Emoji", "description": "Convert text and unicode emoji into Twemoji.", "keywords": ["discussions"], - "version": "0.1.0", + "version": "0.1.0-beta.2", "author": { "name": "Toby Zerner", - "email": "toby.zerner@gmail.com" + "email": "toby@flarum.org", + "homepage": "http://tobyzerner.com" }, "license": "MIT", "require": { - "php": ">=5.4.0", - "flarum": ">0.1.0" + "flarum": ">=0.1.0-beta.2" + }, + "support": { + "source": "https://github.com/flarum/emoji", + "issues": "https://github.com/flarum/core/issues" }, "icon": { - "name": "smile-o", - "backgroundColor": "#FFC700", - "color": "#000" + "name": "smile-o", + "backgroundColor": "#FFC700", + "color": "#000" } } From 1f1a8d8f45c183120ddb5be77f096531bbf47085 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 4 Sep 2015 12:07:50 +0930 Subject: [PATCH 012/154] Update npm dependency --- extensions/emoji/js/forum/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/emoji/js/forum/package.json b/extensions/emoji/js/forum/package.json index 3e0ef919d..62ea6c691 100644 --- a/extensions/emoji/js/forum/package.json +++ b/extensions/emoji/js/forum/package.json @@ -2,6 +2,6 @@ "private": true, "devDependencies": { "gulp": "^3.8.11", - "flarum-gulp": "git+https://github.com/flarum/gulp.git" + "flarum-gulp": "^0.1.0" } } From 9a342be49558caffb315779dc9bcc5eb594020b2 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 4 Sep 2015 12:32:52 +0930 Subject: [PATCH 013/154] Add LICENSE information --- extensions/emoji/.php_cs | 1 - extensions/emoji/LICENSE | 21 +++++++++++++++++++ extensions/emoji/bootstrap.php | 14 ++++++++----- extensions/emoji/src/Extension.php | 12 ++++++++++- .../emoji/src/Listeners/AddClientAssets.php | 12 ++++++++++- .../emoji/src/Listeners/AddEmoticons.php | 12 ++++++++++- 6 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 extensions/emoji/LICENSE diff --git a/extensions/emoji/.php_cs b/extensions/emoji/.php_cs index c55085293..20d29c766 100755 --- a/extensions/emoji/.php_cs +++ b/extensions/emoji/.php_cs @@ -17,7 +17,6 @@ $finder = Symfony\CS\Finder\DefaultFinder::create() ->in(__DIR__); return Symfony\CS\Config\Config::create() - ->setUsingCache(true) ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) ->fixers([ 'short_array_syntax', diff --git a/extensions/emoji/LICENSE b/extensions/emoji/LICENSE new file mode 100644 index 000000000..aa1e5fb86 --- /dev/null +++ b/extensions/emoji/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015 Toby Zerner + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/extensions/emoji/bootstrap.php b/extensions/emoji/bootstrap.php index 2ec1c9832..022dcd3d6 100644 --- a/extensions/emoji/bootstrap.php +++ b/extensions/emoji/bootstrap.php @@ -1,10 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + require __DIR__.'/vendor/autoload.php'; -// Return the name of our Extension class. Flarum will register it as a service -// provider, allowing it to register bindings and execute code when the -// application boots. return 'Flarum\Emoji\Extension'; diff --git a/extensions/emoji/src/Extension.php b/extensions/emoji/src/Extension.php index 3748d996d..ad56f2f4a 100644 --- a/extensions/emoji/src/Extension.php +++ b/extensions/emoji/src/Extension.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Emoji; use Flarum\Support\Extension as BaseExtension; use Illuminate\Events\Dispatcher; diff --git a/extensions/emoji/src/Listeners/AddClientAssets.php b/extensions/emoji/src/Listeners/AddClientAssets.php index da8cb54b7..9f733af91 100644 --- a/extensions/emoji/src/Listeners/AddClientAssets.php +++ b/extensions/emoji/src/Listeners/AddClientAssets.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Emoji\Listeners; use Flarum\Events\RegisterLocales; use Flarum\Events\BuildClientView; diff --git a/extensions/emoji/src/Listeners/AddEmoticons.php b/extensions/emoji/src/Listeners/AddEmoticons.php index e8303cadb..bc17178d1 100644 --- a/extensions/emoji/src/Listeners/AddEmoticons.php +++ b/extensions/emoji/src/Listeners/AddEmoticons.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Emoji\Listeners; use Flarum\Events\FormatterConfigurator; use Illuminate\Contracts\Events\Dispatcher; From 751dddd940b7b32d1689d1f11dc4bd9a6611e440 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 17 Sep 2015 09:10:28 +0930 Subject: [PATCH 014/154] Add gitattributes --- extensions/emoji/.gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 extensions/emoji/.gitattributes diff --git a/extensions/emoji/.gitattributes b/extensions/emoji/.gitattributes new file mode 100644 index 000000000..4afe79241 --- /dev/null +++ b/extensions/emoji/.gitattributes @@ -0,0 +1,3 @@ +.gitattributes export-ignore +.gitignore export-ignore +.travis.yml export-ignore From 57ed9dad5fc2c3a2785e945b1b8865698e068320 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 11 Oct 2015 17:02:19 +1030 Subject: [PATCH 015/154] Update for composer branch --- extensions/emoji/.gitignore | 2 + extensions/emoji/bootstrap.php | 8 +- extensions/emoji/composer.json | 27 +- extensions/emoji/flarum.json | 25 - extensions/emoji/icon.svg | 1 + extensions/emoji/js/.gitignore | 3 - extensions/emoji/js/forum/Gulpfile.js | 2 +- extensions/emoji/js/forum/bower.json | 2 +- extensions/emoji/js/forum/dist/extension.js | 625 ++++++++++++++++++ extensions/emoji/js/forum/src/main.js | 2 +- extensions/emoji/locale/en.yml | 2 - extensions/emoji/scripts/compile.sh | 27 + .../emoji/src/Listener/AddClientAssets.php | 39 ++ .../FormatEmoticons.php} | 16 +- .../emoji/src/Listeners/AddClientAssets.php | 39 -- 15 files changed, 739 insertions(+), 81 deletions(-) delete mode 100644 extensions/emoji/flarum.json create mode 100644 extensions/emoji/icon.svg delete mode 100644 extensions/emoji/js/.gitignore create mode 100644 extensions/emoji/js/forum/dist/extension.js delete mode 100644 extensions/emoji/locale/en.yml create mode 100755 extensions/emoji/scripts/compile.sh create mode 100644 extensions/emoji/src/Listener/AddClientAssets.php rename extensions/emoji/src/{Listeners/AddEmoticons.php => Listener/FormatEmoticons.php} (77%) delete mode 100644 extensions/emoji/src/Listeners/AddClientAssets.php diff --git a/extensions/emoji/.gitignore b/extensions/emoji/.gitignore index a4f3b125e..43eeee7fe 100644 --- a/extensions/emoji/.gitignore +++ b/extensions/emoji/.gitignore @@ -2,3 +2,5 @@ composer.phar .DS_Store Thumbs.db +bower_components +node_modules \ No newline at end of file diff --git a/extensions/emoji/bootstrap.php b/extensions/emoji/bootstrap.php index 022dcd3d6..f632a04d5 100644 --- a/extensions/emoji/bootstrap.php +++ b/extensions/emoji/bootstrap.php @@ -9,6 +9,10 @@ * file that was distributed with this source code. */ -require __DIR__.'/vendor/autoload.php'; +use Flarum\Emoji\Listener; +use Illuminate\Contracts\Events\Dispatcher; -return 'Flarum\Emoji\Extension'; +return function (Dispatcher $events) { + $events->subscribe(Listener\AddClientAssets::class); + $events->subscribe(Listener\FormatEmoticons::class); +}; \ No newline at end of file diff --git a/extensions/emoji/composer.json b/extensions/emoji/composer.json index 83896c549..58160ee38 100644 --- a/extensions/emoji/composer.json +++ b/extensions/emoji/composer.json @@ -1,10 +1,33 @@ { + "name": "flarum/emoji", + "description": "Convert text and unicode emoji into Twemoji.", + "type": "flarum-extension", + "license": "MIT", + "authors": [ + { + "name": "Toby Zerner", + "email": "toby.zerner@gmail.com" + } + ], + "support": { + "issues": "https://github.com/flarum/core/issues", + "source": "https://github.com/flarum/emoji" + }, + "require": { + "flarum/core": "^0.1.0-beta.3" + }, "autoload": { "psr-4": { "Flarum\\Emoji\\": "src/" } }, - "scripts": { - "style": "phpcs --standard=PSR2 -np src" + "extra": { + "flarum-extension": { + "title": "Emoji", + "icon": { + "image": "icon.svg", + "backgroundColor": "#FECC4D" + } + } } } diff --git a/extensions/emoji/flarum.json b/extensions/emoji/flarum.json deleted file mode 100644 index 5caede69b..000000000 --- a/extensions/emoji/flarum.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "emoji", - "title": "Emoji", - "description": "Convert text and unicode emoji into Twemoji.", - "keywords": ["discussions"], - "version": "0.1.0-beta.2", - "author": { - "name": "Toby Zerner", - "email": "toby@flarum.org", - "homepage": "http://tobyzerner.com" - }, - "license": "MIT", - "require": { - "flarum": ">=0.1.0-beta.2" - }, - "support": { - "source": "https://github.com/flarum/emoji", - "issues": "https://github.com/flarum/core/issues" - }, - "icon": { - "name": "smile-o", - "backgroundColor": "#FFC700", - "color": "#000" - } -} diff --git a/extensions/emoji/icon.svg b/extensions/emoji/icon.svg new file mode 100644 index 000000000..9c38390ed --- /dev/null +++ b/extensions/emoji/icon.svg @@ -0,0 +1 @@ +image/svg+xml diff --git a/extensions/emoji/js/.gitignore b/extensions/emoji/js/.gitignore deleted file mode 100644 index 372e20a51..000000000 --- a/extensions/emoji/js/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -bower_components -node_modules -dist diff --git a/extensions/emoji/js/forum/Gulpfile.js b/extensions/emoji/js/forum/Gulpfile.js index dc2bde879..50ad53f3e 100644 --- a/extensions/emoji/js/forum/Gulpfile.js +++ b/extensions/emoji/js/forum/Gulpfile.js @@ -2,7 +2,7 @@ var gulp = require('flarum-gulp'); gulp({ modules: { - 'emoji': 'src/**/*.js' + 'flarum/emoji': 'src/**/*.js' }, files: [ 'bower_components/twemoji/index.js' diff --git a/extensions/emoji/js/forum/bower.json b/extensions/emoji/js/forum/bower.json index 12710063f..36cb5a6c6 100644 --- a/extensions/emoji/js/forum/bower.json +++ b/extensions/emoji/js/forum/bower.json @@ -1,6 +1,6 @@ { "name": "flarum-emoji", "devDependencies": { - "twemoji": "https://raw.githubusercontent.com/twitter/twemoji/gh-pages/twemoji.min.js" + "twemoji": "https://raw.githubusercontent.com/twitter/twemoji/gh-pages/twemoji.js" } } diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js new file mode 100644 index 000000000..10dafb5d4 --- /dev/null +++ b/extensions/emoji/js/forum/dist/extension.js @@ -0,0 +1,625 @@ +/*jslint indent: 2, browser: true, bitwise: true, plusplus: true */ +var twemoji = (function ( + /*! Copyright Twitter Inc. and other contributors. Licensed under MIT *//* + https://github.com/twitter/twemoji/blob/gh-pages/LICENSE + */ + + // WARNING: this file is generated automatically via + // `node twemoji-generator.js` + // please update its `createTwemoji` function + // at the bottom of the same file instead. + +) { + 'use strict'; + + /*jshint maxparams:4 */ + + var + // the exported module object + twemoji = { + + + ///////////////////////// + // properties // + ///////////////////////// + + // default assets url, by default will be Twitter Inc. CDN + base: (location.protocol === 'https:' ? 'https:' : 'http:') + + '//twemoji.maxcdn.com/', + + // default assets file extensions, by default '.png' + ext: '.png', + + // default assets/folder size, by default "36x36" + // available via Twitter CDN: 16, 36, 72 + size: '36x36', + + // default class name, by default 'emoji' + className: 'emoji', + + // basic utilities / helpers to convert code points + // to JavaScript surrogates and vice versa + convert: { + + /** + * Given an HEX codepoint, returns UTF16 surrogate pairs. + * + * @param string generic codepoint, i.e. '1F4A9' + * @return string codepoint transformed into utf16 surrogates pair, + * i.e. \uD83D\uDCA9 + * + * @example + * twemoji.convert.fromCodePoint('1f1e8'); + * // "\ud83c\udde8" + * + * '1f1e8-1f1f3'.split('-').map(twemoji.convert.fromCodePoint).join('') + * // "\ud83c\udde8\ud83c\uddf3" + */ + fromCodePoint: fromCodePoint, + + /** + * Given UTF16 surrogate pairs, returns the equivalent HEX codepoint. + * + * @param string generic utf16 surrogates pair, i.e. \uD83D\uDCA9 + * @param string optional separator for double code points, default='-' + * @return string utf16 transformed into codepoint, i.e. '1F4A9' + * + * @example + * twemoji.convert.toCodePoint('\ud83c\udde8\ud83c\uddf3'); + * // "1f1e8-1f1f3" + * + * twemoji.convert.toCodePoint('\ud83c\udde8\ud83c\uddf3', '~'); + * // "1f1e8~1f1f3" + */ + toCodePoint: toCodePoint + }, + + + ///////////////////////// + // methods // + ///////////////////////// + + /** + * User first: used to remove missing images + * preserving the original text intent when + * a fallback for network problems is desired. + * Automatically added to Image nodes via DOM + * It could be recycled for string operations via: + * $('img.emoji').on('error', twemoji.onerror) + */ + onerror: function onerror() { + if (this.parentNode) { + this.parentNode.replaceChild(createText(this.alt), this); + } + }, + + /** + * Main method/logic to generate either tags or HTMLImage nodes. + * "emojify" a generic text or DOM Element. + * + * @overloads + * + * String replacement for `innerHTML` or server side operations + * twemoji.parse(string); + * twemoji.parse(string, Function); + * twemoji.parse(string, Object); + * + * HTMLElement tree parsing for safer operations over existing DOM + * twemoji.parse(HTMLElement); + * twemoji.parse(HTMLElement, Function); + * twemoji.parse(HTMLElement, Object); + * + * @param string|HTMLElement the source to parse and enrich with emoji. + * + * string replace emoji matches with tags. + * Mainly used to inject emoji via `innerHTML` + * It does **not** parse the string or validate it, + * it simply replaces found emoji with a tag. + * NOTE: be sure this won't affect security. + * + * HTMLElement walk through the DOM tree and find emoji + * that are inside **text node only** (nodeType === 3) + * Mainly used to put emoji in already generated DOM + * without compromising surrounding nodes and + * **avoiding** the usage of `innerHTML`. + * NOTE: Using DOM elements instead of strings should + * improve security without compromising too much + * performance compared with a less safe `innerHTML`. + * + * @param Function|Object [optional] + * either the callback that will be invoked or an object + * with all properties to use per each found emoji. + * + * Function if specified, this will be invoked per each emoji + * that has been found through the RegExp except + * those follwed by the invariant \uFE0E ("as text"). + * Once invoked, parameters will be: + * + * codePoint:string the lower case HEX code point + * i.e. "1f4a9" + * + * options:Object all info for this parsing operation + * + * variant:char the optional \uFE0F ("as image") + * variant, in case this info + * is anyhow meaningful. + * By default this is ignored. + * + * If such callback will return a falsy value instead + * of a valid `src` to use for the image, nothing will + * actually change for that specific emoji. + * + * + * Object if specified, an object containing the following properties + * + * callback Function the callback to invoke per each found emoji. + * base string the base url, by default twemoji.base + * ext string the image extension, by default twemoji.ext + * size string the assets size, by default twemoji.size + * + * @example + * + * twemoji.parse("I \u2764\uFE0F emoji!"); + * // I ❤️ emoji! + * + * + * twemoji.parse("I \u2764\uFE0F emoji!", function(icon, options, variant) { + * return '/assets/' + icon + '.gif'; + * }); + * // I ❤️ emoji! + * + * + * twemoji.parse("I \u2764\uFE0F emoji!", { + * size: 72, + * callback: function(icon, options, variant) { + * return '/assets/' + options.size + '/' + icon + options.ext; + * } + * }); + * // I ❤️ emoji! + * + */ + parse: parse, + + /** + * Given a string, invokes the callback argument + * per each emoji found in such string. + * This is the most raw version used by + * the .parse(string) method itself. + * + * @param string generic string to parse + * @param Function a generic callback that will be + * invoked to replace the content. + * This calback wil receive standard + * String.prototype.replace(str, callback) + * arguments such: + * callback( + * match, // the emoji match + * icon, // the emoji text (same as text) + * variant // either '\uFE0E' or '\uFE0F', if present + * ); + * + * and others commonly received via replace. + * + * NOTE: When the variant \uFE0E is found, remember this is an explicit intent + * from the user: the emoji should **not** be replaced with an image. + * In \uFE0F case one, it's the opposite, it should be graphic. + * This utility convetion is that only \uFE0E are not translated into images. + */ + replace: replace, + + /** + * Simplify string tests against emoji. + * + * @param string some text that might contain emoji + * @return boolean true if any emoji was found, false otherwise. + * + * @example + * + * if (twemoji.test(someContent)) { + * console.log("emoji All The Things!"); + * } + */ + test: test + }, + + // used to escape HTML special chars in attributes + escaper = { + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' + }, + + // RegExp based on emoji's official Unicode standards + // http://www.unicode.org/Public/UNIDATA/EmojiSources.txt + re = /((?:\ud83c\udde8\ud83c\uddf3|\ud83c\uddfa\ud83c\uddf8|\ud83c\uddf7\ud83c\uddfa|\ud83c\uddf0\ud83c\uddf7|\ud83c\uddef\ud83c\uddf5|\ud83c\uddee\ud83c\uddf9|\ud83c\uddec\ud83c\udde7|\ud83c\uddeb\ud83c\uddf7|\ud83c\uddea\ud83c\uddf8|\ud83c\udde9\ud83c\uddea|\u0039\ufe0f?\u20e3|\u0038\ufe0f?\u20e3|\u0037\ufe0f?\u20e3|\u0036\ufe0f?\u20e3|\u0035\ufe0f?\u20e3|\u0034\ufe0f?\u20e3|\u0033\ufe0f?\u20e3|\u0032\ufe0f?\u20e3|\u0031\ufe0f?\u20e3|\u0030\ufe0f?\u20e3|\u0023\ufe0f?\u20e3|\ud83d\udeb3|\ud83d\udeb1|\ud83d\udeb0|\ud83d\udeaf|\ud83d\udeae|\ud83d\udea6|\ud83d\udea3|\ud83d\udea1|\ud83d\udea0|\ud83d\ude9f|\ud83d\ude9e|\ud83d\ude9d|\ud83d\ude9c|\ud83d\ude9b|\ud83d\ude98|\ud83d\ude96|\ud83d\ude94|\ud83d\ude90|\ud83d\ude8e|\ud83d\ude8d|\ud83d\ude8b|\ud83d\ude8a|\ud83d\ude88|\ud83d\ude86|\ud83d\ude82|\ud83d\ude81|\ud83d\ude36|\ud83d\ude34|\ud83d\ude2f|\ud83d\ude2e|\ud83d\ude2c|\ud83d\ude27|\ud83d\ude26|\ud83d\ude1f|\ud83d\ude1b|\ud83d\ude19|\ud83d\ude17|\ud83d\ude15|\ud83d\ude11|\ud83d\ude10|\ud83d\ude0e|\ud83d\ude08|\ud83d\ude07|\ud83d\ude00|\ud83d\udd67|\ud83d\udd66|\ud83d\udd65|\ud83d\udd64|\ud83d\udd63|\ud83d\udd62|\ud83d\udd61|\ud83d\udd60|\ud83d\udd5f|\ud83d\udd5e|\ud83d\udd5d|\ud83d\udd5c|\ud83d\udd2d|\ud83d\udd2c|\ud83d\udd15|\ud83d\udd09|\ud83d\udd08|\ud83d\udd07|\ud83d\udd06|\ud83d\udd05|\ud83d\udd04|\ud83d\udd02|\ud83d\udd01|\ud83d\udd00|\ud83d\udcf5|\ud83d\udcef|\ud83d\udced|\ud83d\udcec|\ud83d\udcb7|\ud83d\udcb6|\ud83d\udcad|\ud83d\udc6d|\ud83d\udc6c|\ud83d\udc65|\ud83d\udc2a|\ud83d\udc16|\ud83d\udc15|\ud83d\udc13|\ud83d\udc10|\ud83d\udc0f|\ud83d\udc0b|\ud83d\udc0a|\ud83d\udc09|\ud83d\udc08|\ud83d\udc07|\ud83d\udc06|\ud83d\udc05|\ud83d\udc04|\ud83d\udc03|\ud83d\udc02|\ud83d\udc01|\ud83d\udc00|\ud83c\udfe4|\ud83c\udfc9|\ud83c\udfc7|\ud83c\udf7c|\ud83c\udf50|\ud83c\udf4b|\ud83c\udf33|\ud83c\udf32|\ud83c\udf1e|\ud83c\udf1d|\ud83c\udf1c|\ud83c\udf1a|\ud83c\udf18|\ud83c\udccf|\ud83c\udd70|\ud83c\udd71|\ud83c\udd7e|\ud83c\udd8e|\ud83c\udd91|\ud83c\udd92|\ud83c\udd93|\ud83c\udd94|\ud83c\udd95|\ud83c\udd96|\ud83c\udd97|\ud83c\udd98|\ud83c\udd99|\ud83c\udd9a|\ud83d\udc77|\ud83d\udec5|\ud83d\udec4|\ud83d\udec3|\ud83d\udec2|\ud83d\udec1|\ud83d\udebf|\ud83d\udeb8|\ud83d\udeb7|\ud83d\udeb5|\ud83c\ude01|\ud83c\ude02|\ud83c\ude32|\ud83c\ude33|\ud83c\ude34|\ud83c\ude35|\ud83c\ude36|\ud83c\ude37|\ud83c\ude38|\ud83c\ude39|\ud83c\ude3a|\ud83c\ude50|\ud83c\ude51|\ud83c\udf00|\ud83c\udf01|\ud83c\udf02|\ud83c\udf03|\ud83c\udf04|\ud83c\udf05|\ud83c\udf06|\ud83c\udf07|\ud83c\udf08|\ud83c\udf09|\ud83c\udf0a|\ud83c\udf0b|\ud83c\udf0c|\ud83c\udf0f|\ud83c\udf11|\ud83c\udf13|\ud83c\udf14|\ud83c\udf15|\ud83c\udf19|\ud83c\udf1b|\ud83c\udf1f|\ud83c\udf20|\ud83c\udf30|\ud83c\udf31|\ud83c\udf34|\ud83c\udf35|\ud83c\udf37|\ud83c\udf38|\ud83c\udf39|\ud83c\udf3a|\ud83c\udf3b|\ud83c\udf3c|\ud83c\udf3d|\ud83c\udf3e|\ud83c\udf3f|\ud83c\udf40|\ud83c\udf41|\ud83c\udf42|\ud83c\udf43|\ud83c\udf44|\ud83c\udf45|\ud83c\udf46|\ud83c\udf47|\ud83c\udf48|\ud83c\udf49|\ud83c\udf4a|\ud83c\udf4c|\ud83c\udf4d|\ud83c\udf4e|\ud83c\udf4f|\ud83c\udf51|\ud83c\udf52|\ud83c\udf53|\ud83c\udf54|\ud83c\udf55|\ud83c\udf56|\ud83c\udf57|\ud83c\udf58|\ud83c\udf59|\ud83c\udf5a|\ud83c\udf5b|\ud83c\udf5c|\ud83c\udf5d|\ud83c\udf5e|\ud83c\udf5f|\ud83c\udf60|\ud83c\udf61|\ud83c\udf62|\ud83c\udf63|\ud83c\udf64|\ud83c\udf65|\ud83c\udf66|\ud83c\udf67|\ud83c\udf68|\ud83c\udf69|\ud83c\udf6a|\ud83c\udf6b|\ud83c\udf6c|\ud83c\udf6d|\ud83c\udf6e|\ud83c\udf6f|\ud83c\udf70|\ud83c\udf71|\ud83c\udf72|\ud83c\udf73|\ud83c\udf74|\ud83c\udf75|\ud83c\udf76|\ud83c\udf77|\ud83c\udf78|\ud83c\udf79|\ud83c\udf7a|\ud83c\udf7b|\ud83c\udf80|\ud83c\udf81|\ud83c\udf82|\ud83c\udf83|\ud83c\udf84|\ud83c\udf85|\ud83c\udf86|\ud83c\udf87|\ud83c\udf88|\ud83c\udf89|\ud83c\udf8a|\ud83c\udf8b|\ud83c\udf8c|\ud83c\udf8d|\ud83c\udf8e|\ud83c\udf8f|\ud83c\udf90|\ud83c\udf91|\ud83c\udf92|\ud83c\udf93|\ud83c\udfa0|\ud83c\udfa1|\ud83c\udfa2|\ud83c\udfa3|\ud83c\udfa4|\ud83c\udfa5|\ud83c\udfa6|\ud83c\udfa7|\ud83c\udfa8|\ud83c\udfa9|\ud83c\udfaa|\ud83c\udfab|\ud83c\udfac|\ud83c\udfad|\ud83c\udfae|\ud83c\udfaf|\ud83c\udfb0|\ud83c\udfb1|\ud83c\udfb2|\ud83c\udfb3|\ud83c\udfb4|\ud83c\udfb5|\ud83c\udfb6|\ud83c\udfb7|\ud83c\udfb8|\ud83c\udfb9|\ud83c\udfba|\ud83c\udfbb|\ud83c\udfbc|\ud83c\udfbd|\ud83c\udfbe|\ud83c\udfbf|\ud83c\udfc0|\ud83c\udfc1|\ud83c\udfc2|\ud83c\udfc3|\ud83c\udfc4|\ud83c\udfc6|\ud83c\udfc8|\ud83c\udfca|\ud83c\udfe0|\ud83c\udfe1|\ud83c\udfe2|\ud83c\udfe3|\ud83c\udfe5|\ud83c\udfe6|\ud83c\udfe7|\ud83c\udfe8|\ud83c\udfe9|\ud83c\udfea|\ud83c\udfeb|\ud83c\udfec|\ud83c\udfed|\ud83c\udfee|\ud83c\udfef|\ud83c\udff0|\ud83d\udc0c|\ud83d\udc0d|\ud83d\udc0e|\ud83d\udc11|\ud83d\udc12|\ud83d\udc14|\ud83d\udc17|\ud83d\udc18|\ud83d\udc19|\ud83d\udc1a|\ud83d\udc1b|\ud83d\udc1c|\ud83d\udc1d|\ud83d\udc1e|\ud83d\udc1f|\ud83d\udc20|\ud83d\udc21|\ud83d\udc22|\ud83d\udc23|\ud83d\udc24|\ud83d\udc25|\ud83d\udc26|\ud83d\udc27|\ud83d\udc28|\ud83d\udc29|\ud83d\udc2b|\ud83d\udc2c|\ud83d\udc2d|\ud83d\udc2e|\ud83d\udc2f|\ud83d\udc30|\ud83d\udc31|\ud83d\udc32|\ud83d\udc33|\ud83d\udc34|\ud83d\udc35|\ud83d\udc36|\ud83d\udc37|\ud83d\udc38|\ud83d\udc39|\ud83d\udc3a|\ud83d\udc3b|\ud83d\udc3c|\ud83d\udc3d|\ud83d\udc3e|\ud83d\udc40|\ud83d\udc42|\ud83d\udc43|\ud83d\udc44|\ud83d\udc45|\ud83d\udc46|\ud83d\udc47|\ud83d\udc48|\ud83d\udc49|\ud83d\udc4a|\ud83d\udc4b|\ud83d\udc4c|\ud83d\udc4d|\ud83d\udc4e|\ud83d\udc4f|\ud83d\udc50|\ud83d\udc51|\ud83d\udc52|\ud83d\udc53|\ud83d\udc54|\ud83d\udc55|\ud83d\udc56|\ud83d\udc57|\ud83d\udc58|\ud83d\udc59|\ud83d\udc5a|\ud83d\udc5b|\ud83d\udc5c|\ud83d\udc5d|\ud83d\udc5e|\ud83d\udc5f|\ud83d\udc60|\ud83d\udc61|\ud83d\udc62|\ud83d\udc63|\ud83d\udc64|\ud83d\udc66|\ud83d\udc67|\ud83d\udc68|\ud83d\udc69|\ud83d\udc6a|\ud83d\udc6b|\ud83d\udc6e|\ud83d\udc6f|\ud83d\udc70|\ud83d\udc71|\ud83d\udc72|\ud83d\udc73|\ud83d\udc74|\ud83d\udc75|\ud83d\udc76|\ud83d\udeb4|\ud83d\udc78|\ud83d\udc79|\ud83d\udc7a|\ud83d\udc7b|\ud83d\udc7c|\ud83d\udc7d|\ud83d\udc7e|\ud83d\udc7f|\ud83d\udc80|\ud83d\udc81|\ud83d\udc82|\ud83d\udc83|\ud83d\udc84|\ud83d\udc85|\ud83d\udc86|\ud83d\udc87|\ud83d\udc88|\ud83d\udc89|\ud83d\udc8a|\ud83d\udc8b|\ud83d\udc8c|\ud83d\udc8d|\ud83d\udc8e|\ud83d\udc8f|\ud83d\udc90|\ud83d\udc91|\ud83d\udc92|\ud83d\udc93|\ud83d\udc94|\ud83d\udc95|\ud83d\udc96|\ud83d\udc97|\ud83d\udc98|\ud83d\udc99|\ud83d\udc9a|\ud83d\udc9b|\ud83d\udc9c|\ud83d\udc9d|\ud83d\udc9e|\ud83d\udc9f|\ud83d\udca0|\ud83d\udca1|\ud83d\udca2|\ud83d\udca3|\ud83d\udca4|\ud83d\udca5|\ud83d\udca6|\ud83d\udca7|\ud83d\udca8|\ud83d\udca9|\ud83d\udcaa|\ud83d\udcab|\ud83d\udcac|\ud83d\udcae|\ud83d\udcaf|\ud83d\udcb0|\ud83d\udcb1|\ud83d\udcb2|\ud83d\udcb3|\ud83d\udcb4|\ud83d\udcb5|\ud83d\udcb8|\ud83d\udcb9|\ud83d\udcba|\ud83d\udcbb|\ud83d\udcbc|\ud83d\udcbd|\ud83d\udcbe|\ud83d\udcbf|\ud83d\udcc0|\ud83d\udcc1|\ud83d\udcc2|\ud83d\udcc3|\ud83d\udcc4|\ud83d\udcc5|\ud83d\udcc6|\ud83d\udcc7|\ud83d\udcc8|\ud83d\udcc9|\ud83d\udcca|\ud83d\udccb|\ud83d\udccc|\ud83d\udccd|\ud83d\udcce|\ud83d\udccf|\ud83d\udcd0|\ud83d\udcd1|\ud83d\udcd2|\ud83d\udcd3|\ud83d\udcd4|\ud83d\udcd5|\ud83d\udcd6|\ud83d\udcd7|\ud83d\udcd8|\ud83d\udcd9|\ud83d\udcda|\ud83d\udcdb|\ud83d\udcdc|\ud83d\udcdd|\ud83d\udcde|\ud83d\udcdf|\ud83d\udce0|\ud83d\udce1|\ud83d\udce2|\ud83d\udce3|\ud83d\udce4|\ud83d\udce5|\ud83d\udce6|\ud83d\udce7|\ud83d\udce8|\ud83d\udce9|\ud83d\udcea|\ud83d\udceb|\ud83d\udcee|\ud83d\udcf0|\ud83d\udcf1|\ud83d\udcf2|\ud83d\udcf3|\ud83d\udcf4|\ud83d\udcf6|\ud83d\udcf7|\ud83d\udcf9|\ud83d\udcfa|\ud83d\udcfb|\ud83d\udcfc|\ud83d\udd03|\ud83d\udd0a|\ud83d\udd0b|\ud83d\udd0c|\ud83d\udd0d|\ud83d\udd0e|\ud83d\udd0f|\ud83d\udd10|\ud83d\udd11|\ud83d\udd12|\ud83d\udd13|\ud83d\udd14|\ud83d\udd16|\ud83d\udd17|\ud83d\udd18|\ud83d\udd19|\ud83d\udd1a|\ud83d\udd1b|\ud83d\udd1c|\ud83d\udd1d|\ud83d\udd1e|\ud83d\udd1f|\ud83d\udd20|\ud83d\udd21|\ud83d\udd22|\ud83d\udd23|\ud83d\udd24|\ud83d\udd25|\ud83d\udd26|\ud83d\udd27|\ud83d\udd28|\ud83d\udd29|\ud83d\udd2a|\ud83d\udd2b|\ud83d\udd2e|\ud83d\udd2f|\ud83d\udd30|\ud83d\udd31|\ud83d\udd32|\ud83d\udd33|\ud83d\udd34|\ud83d\udd35|\ud83d\udd36|\ud83d\udd37|\ud83d\udd38|\ud83d\udd39|\ud83d\udd3a|\ud83d\udd3b|\ud83d\udd3c|\ud83d\udd3d|\ud83d\udd50|\ud83d\udd51|\ud83d\udd52|\ud83d\udd53|\ud83d\udd54|\ud83d\udd55|\ud83d\udd56|\ud83d\udd57|\ud83d\udd58|\ud83d\udd59|\ud83d\udd5a|\ud83d\udd5b|\ud83d\uddfb|\ud83d\uddfc|\ud83d\uddfd|\ud83d\uddfe|\ud83d\uddff|\ud83d\ude01|\ud83d\ude02|\ud83d\ude03|\ud83d\ude04|\ud83d\ude05|\ud83d\ude06|\ud83d\ude09|\ud83d\ude0a|\ud83d\ude0b|\ud83d\ude0c|\ud83d\ude0d|\ud83d\ude0f|\ud83d\ude12|\ud83d\ude13|\ud83d\ude14|\ud83d\ude16|\ud83d\ude18|\ud83d\ude1a|\ud83d\ude1c|\ud83d\ude1d|\ud83d\ude1e|\ud83d\ude20|\ud83d\ude21|\ud83d\ude22|\ud83d\ude23|\ud83d\ude24|\ud83d\ude25|\ud83d\ude28|\ud83d\ude29|\ud83d\ude2a|\ud83d\ude2b|\ud83d\ude2d|\ud83d\ude30|\ud83d\ude31|\ud83d\ude32|\ud83d\ude33|\ud83d\ude35|\ud83d\ude37|\ud83d\ude38|\ud83d\ude39|\ud83d\ude3a|\ud83d\ude3b|\ud83d\ude3c|\ud83d\ude3d|\ud83d\ude3e|\ud83d\ude3f|\ud83d\ude40|\ud83d\ude45|\ud83d\ude46|\ud83d\ude47|\ud83d\ude48|\ud83d\ude49|\ud83d\ude4a|\ud83d\ude4b|\ud83d\ude4c|\ud83d\ude4d|\ud83d\ude4e|\ud83d\ude4f|\ud83d\ude80|\ud83d\ude83|\ud83d\ude84|\ud83d\ude85|\ud83d\ude87|\ud83d\ude89|\ud83d\ude8c|\ud83d\ude8f|\ud83d\ude91|\ud83d\ude92|\ud83d\ude93|\ud83d\ude95|\ud83d\ude97|\ud83d\ude99|\ud83d\ude9a|\ud83d\udea2|\ud83d\udea4|\ud83d\udea5|\ud83d\udea7|\ud83d\udea8|\ud83d\udea9|\ud83d\udeaa|\ud83d\udeab|\ud83d\udeac|\ud83d\udead|\ud83d\udeb2|\ud83d\udeb6|\ud83d\udeb9|\ud83d\udeba|\ud83d\udebb|\ud83d\udebc|\ud83d\udebd|\ud83d\udebe|\ud83d\udec0|\ud83c\udde6|\ud83c\udde7|\ud83c\udde8|\ud83c\udde9|\ud83c\uddea|\ud83c\uddeb|\ud83c\uddec|\ud83c\udded|\ud83c\uddee|\ud83c\uddef|\ud83c\uddf0|\ud83c\uddf1|\ud83c\uddf2|\ud83c\uddf3|\ud83c\uddf4|\ud83c\uddf5|\ud83c\uddf6|\ud83c\uddf7|\ud83c\uddf8|\ud83c\uddf9|\ud83c\uddfa|\ud83c\uddfb|\ud83c\uddfc|\ud83c\uddfd|\ud83c\uddfe|\ud83c\uddff|\ud83c\udf0d|\ud83c\udf0e|\ud83c\udf10|\ud83c\udf12|\ud83c\udf16|\ud83c\udf17|\ue50a|\u3030|\u27b0|\u2797|\u2796|\u2795|\u2755|\u2754|\u2753|\u274e|\u274c|\u2728|\u270b|\u270a|\u2705|\u26ce|\u23f3|\u23f0|\u23ec|\u23eb|\u23ea|\u23e9|\u2122|\u27bf|\u00a9|\u00ae)|(?:(?:\ud83c\udc04|\ud83c\udd7f|\ud83c\ude1a|\ud83c\ude2f|\u3299|\u303d|\u2b55|\u2b50|\u2b1c|\u2b1b|\u2b07|\u2b06|\u2b05|\u2935|\u2934|\u27a1|\u2764|\u2757|\u2747|\u2744|\u2734|\u2733|\u2716|\u2714|\u2712|\u270f|\u270c|\u2709|\u2708|\u2702|\u26fd|\u26fa|\u26f5|\u26f3|\u26f2|\u26ea|\u26d4|\u26c5|\u26c4|\u26be|\u26bd|\u26ab|\u26aa|\u26a1|\u26a0|\u2693|\u267f|\u267b|\u3297|\u2666|\u2665|\u2663|\u2660|\u2653|\u2652|\u2651|\u2650|\u264f|\u264e|\u264d|\u264c|\u264b|\u264a|\u2649|\u2648|\u263a|\u261d|\u2615|\u2614|\u2611|\u260e|\u2601|\u2600|\u25fe|\u25fd|\u25fc|\u25fb|\u25c0|\u25b6|\u25ab|\u25aa|\u24c2|\u231b|\u231a|\u21aa|\u21a9|\u2199|\u2198|\u2197|\u2196|\u2195|\u2194|\u2139|\u2049|\u203c|\u2668)([\uFE0E\uFE0F]?)))/g, + + // used to find HTML special chars in attributes + rescaper = /[&<>'"]/g, + + // nodes with type 1 which should **not** be parsed (including lower case svg) + shouldntBeParsed = /IFRAME|NOFRAMES|NOSCRIPT|SCRIPT|SELECT|STYLE|TEXTAREA|[a-z]/, + + // just a private shortcut + fromCharCode = String.fromCharCode; + + return twemoji; + + + ///////////////////////// + // private functions // + // declaration // + ///////////////////////// + + /** + * Shortcut to create text nodes + * @param string text used to create DOM text node + * @return Node a DOM node with that text + */ + function createText(text) { + return document.createTextNode(text); + } + + /** + * Utility function to escape html attribute text + * @param string text use in HTML attribute + * @return string text encoded to use in HTML attribute + */ + function escapeHTML(s) { + return s.replace(rescaper, replacer); + } + + /** + * Default callback used to generate emoji src + * based on Twitter CDN + * @param string the emoji codepoint string + * @param string the default size to use, i.e. "36x36" + * @param string optional "\uFE0F" variant char, ignored by default + * @return string the image source to use + */ + function defaultImageSrcGenerator(icon, options) { + return ''.concat(options.base, options.size, '/', icon, options.ext); + } + + /** + * Given a generic DOM nodeType 1, walk through all children + * and store every nodeType 3 (#text) found in the tree. + * @param Element a DOM Element with probably some text in it + * @param Array the list of previously discovered text nodes + * @return Array same list with new discovered nodes, if any + */ + function grabAllTextNodes(node, allText) { + var + childNodes = node.childNodes, + length = childNodes.length, + subnode, + nodeType; + while (length--) { + subnode = childNodes[length]; + nodeType = subnode.nodeType; + // parse emoji only in text nodes + if (nodeType === 3) { + // collect them to process emoji later + allText.push(subnode); + } + // ignore all nodes that are not type 1 or that + // should not be parsed as script, style, and others + else if (nodeType === 1 && !shouldntBeParsed.test(subnode.nodeName)) { + grabAllTextNodes(subnode, allText); + } + } + return allText; + } + + /** + * Used to both remove the possible variant + * and to convert utf16 into code points + * @param string the emoji surrogate pair + * @param string the optional variant char, if any + */ + function grabTheRightIcon(icon, variant) { + // if variant is present as \uFE0F + return toCodePoint( + variant === '\uFE0F' ? + // the icon should not contain it + icon.slice(0, -1) : + // fix non standard OSX behavior + (icon.length === 3 && icon.charAt(1) === '\uFE0F' ? + icon.charAt(0) + icon.charAt(2) : icon) + ); + } + + /** + * DOM version of the same logic / parser: + * emojify all found sub-text nodes placing images node instead. + * @param Element generic DOM node with some text in some child node + * @param Object options containing info about how to parse + * + * .callback Function the callback to invoke per each found emoji. + * .base string the base url, by default twemoji.base + * .ext string the image extension, by default twemoji.ext + * .size string the assets size, by default twemoji.size + * + * @return Element same generic node with emoji in place, if any. + */ + function parseNode(node, options) { + var + allText = grabAllTextNodes(node, []), + length = allText.length, + attrib, + attrname, + modified, + fragment, + subnode, + text, + match, + i, + index, + img, + alt, + icon, + variant, + src; + while (length--) { + modified = false; + fragment = document.createDocumentFragment(); + subnode = allText[length]; + text = subnode.nodeValue; + i = 0; + while ((match = re.exec(text))) { + index = match.index; + if (index !== i) { + fragment.appendChild( + createText(text.slice(i, index)) + ); + } + alt = match[0]; + icon = match[1]; + variant = match[2]; + i = index + alt.length; + if (variant !== '\uFE0E') { + src = options.callback( + grabTheRightIcon(icon, variant), + options, + variant + ); + if (src) { + img = new Image(); + img.onerror = twemoji.onerror; + img.setAttribute('draggable', 'false'); + attrib = options.attributes(icon, variant); + for (attrname in attrib) { + if ( + attrib.hasOwnProperty(attrname) && + // don't allow any handlers to be set + don't allow overrides + attrname.indexOf('on') !== 0 && + !img.hasAttribute(attrname) + ) { + img.setAttribute(attrname, attrib[attrname]); + } + } + img.className = options.className; + img.alt = alt; + img.src = src; + modified = true; + fragment.appendChild(img); + } + } + if (!img) fragment.appendChild(createText(alt)); + img = null; + } + // is there actually anything to replace in here ? + if (modified) { + // any text left to be added ? + if (i < text.length) { + fragment.appendChild( + createText(text.slice(i)) + ); + } + // replace the text node only, leave intact + // anything else surrounding such text + subnode.parentNode.replaceChild(fragment, subnode); + } + } + return node; + } + + /** + * String/HTML version of the same logic / parser: + * emojify a generic text placing images tags instead of surrogates pair. + * @param string generic string with possibly some emoji in it + * @param Object options containing info about how to parse + * + * .callback Function the callback to invoke per each found emoji. + * .base string the base url, by default twemoji.base + * .ext string the image extension, by default twemoji.ext + * .size string the assets size, by default twemoji.size + * + * @return the string with replacing all found and parsed emoji + */ + function parseString(str, options) { + return replace(str, function (match, icon, variant) { + var + ret = match, + attrib, + attrname, + src; + // verify the variant is not the FE0E one + // this variant means "emoji as text" and should not + // require any action/replacement + // http://unicode.org/Public/UNIDATA/StandardizedVariants.html + if (variant !== '\uFE0E') { + src = options.callback( + grabTheRightIcon(icon, variant), + options, + variant + ); + if (src) { + // recycle the match string replacing the emoji + // with its image counter part + ret = ''); + } + } + return ret; + }); + } + + /** + * Function used to actually replace HTML special chars + * @param string HTML special char + * @return string encoded HTML special char + */ + function replacer(m) { + return escaper[m]; + } + + /** + * Default options.attribute callback + * @return null + */ + function returnNull() { + return null; + } + + /** + * Given a generic value, creates its squared counterpart if it's a number. + * As example, number 36 will return '36x36'. + * @param any a generic value. + * @return any a string representing asset size, i.e. "36x36" + * only in case the value was a number. + * Returns initial value otherwise. + */ + function toSizeSquaredAsset(value) { + return typeof value === 'number' ? + value + 'x' + value : + value; + } + + + ///////////////////////// + // exported functions // + // declaration // + ///////////////////////// + + function fromCodePoint(codepoint) { + var code = typeof codepoint === 'string' ? + parseInt(codepoint, 16) : codepoint; + if (code < 0x10000) { + return fromCharCode(code); + } + code -= 0x10000; + return fromCharCode( + 0xD800 + (code >> 10), + 0xDC00 + (code & 0x3FF) + ); + } + + function parse(what, how) { + if (!how || typeof how === 'function') { + how = {callback: how}; + } + // if first argument is string, inject html tags + // otherwise use the DOM tree and parse text nodes only + return (typeof what === 'string' ? parseString : parseNode)(what, { + callback: how.callback || defaultImageSrcGenerator, + attributes: typeof how.attributes === 'function' ? how.attributes : returnNull, + base: typeof how.base === 'string' ? how.base : twemoji.base, + ext: how.ext || twemoji.ext, + size: how.folder || toSizeSquaredAsset(how.size || twemoji.size), + className: how.className || twemoji.className + }); + } + + function replace(text, callback) { + return String(text).replace(re, callback); + } + + function test(text) { + // IE6 needs a reset before too + re.lastIndex = 0; + var result = re.test(text); + re.lastIndex = 0; + return result; + } + + function toCodePoint(unicodeSurrogates, sep) { + var + r = [], + c = 0, + p = 0, + i = 0; + while (i < unicodeSurrogates.length) { + c = unicodeSurrogates.charCodeAt(i++); + if (p) { + r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16)); + p = 0; + } else if (0xD800 <= c && c <= 0xDBFF) { + p = c; + } else { + r.push(c.toString(16)); + } + } + return r.join(sep || '-'); + } + +}());;System.register('flarum/emoji/main', ['flarum/extend', 'flarum/app', 'flarum/models/Post'], function (_export) { + /*global twemoji, s9e*/ + + 'use strict'; + + var override, app, Post; + return { + setters: [function (_flarumExtend) { + override = _flarumExtend.override; + }, function (_flarumApp) { + app = _flarumApp['default']; + }, function (_flarumModelsPost) { + Post = _flarumModelsPost['default']; + }], + execute: function () { + + app.initializers.add('flarum-emoji', function () { + override(Post.prototype, 'contentHtml', function (original) { + var contentHtml = original(); + + if (this.oldContentHtml !== contentHtml) { + this.emojifiedContentHtml = twemoji.parse(contentHtml); + this.oldContentHtml = contentHtml; + } + + return this.emojifiedContentHtml; + }); + + override(s9e.TextFormatter, 'preview', function (original, text, element) { + original(text, element); + + twemoji.parse(element); + }); + }); + } + }; +}); \ No newline at end of file diff --git a/extensions/emoji/js/forum/src/main.js b/extensions/emoji/js/forum/src/main.js index 26ce757fc..354587d49 100644 --- a/extensions/emoji/js/forum/src/main.js +++ b/extensions/emoji/js/forum/src/main.js @@ -4,7 +4,7 @@ import { override } from 'flarum/extend'; import app from 'flarum/app'; import Post from 'flarum/models/Post'; -app.initializers.add('emoji', () => { +app.initializers.add('flarum-emoji', () => { override(Post.prototype, 'contentHtml', function(original) { const contentHtml = original(); diff --git a/extensions/emoji/locale/en.yml b/extensions/emoji/locale/en.yml deleted file mode 100644 index 55f519f92..000000000 --- a/extensions/emoji/locale/en.yml +++ /dev/null @@ -1,2 +0,0 @@ -emoji: - diff --git a/extensions/emoji/scripts/compile.sh b/extensions/emoji/scripts/compile.sh new file mode 100755 index 000000000..b0d8e8bd3 --- /dev/null +++ b/extensions/emoji/scripts/compile.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# This script compiles the extension so that it can be used in a Flarum +# installation. It should be run from the root directory of the extension. + +base=$PWD + +cd "${base}/js" + +if [ -f bower.json ]; then + bower install +fi + +for app in forum admin; do + cd "${base}/js" + + if [ -d $app ]; then + cd $app + + if [ -f bower.json ]; then + bower install + fi + + npm install + gulp --production + fi +done diff --git a/extensions/emoji/src/Listener/AddClientAssets.php b/extensions/emoji/src/Listener/AddClientAssets.php new file mode 100644 index 000000000..5b01282ac --- /dev/null +++ b/extensions/emoji/src/Listener/AddClientAssets.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Emoji\Listener; + +use Flarum\Event\ConfigureClientView; +use Illuminate\Contracts\Events\Dispatcher; + +class AddClientAssets +{ + /** + * @param Dispatcher $events + */ + public function subscribe(Dispatcher $events) + { + $events->listen(ConfigureClientView::class, [$this, 'addAssets']); + } + + /** + * @param ConfigureClientView $event + */ + public function addAssets(ConfigureClientView $event) + { + if ($event->isForum()) { + $event->addAssets([ + __DIR__ . '/../../js/forum/dist/extension.js', + __DIR__ . '/../../less/forum/extension.less' + ]); + $event->addBootstrapper('flarum/emoji/main'); + } + } +} diff --git a/extensions/emoji/src/Listeners/AddEmoticons.php b/extensions/emoji/src/Listener/FormatEmoticons.php similarity index 77% rename from extensions/emoji/src/Listeners/AddEmoticons.php rename to extensions/emoji/src/Listener/FormatEmoticons.php index bc17178d1..d4e0d0cc1 100644 --- a/extensions/emoji/src/Listeners/AddEmoticons.php +++ b/extensions/emoji/src/Listener/FormatEmoticons.php @@ -8,19 +8,25 @@ * file that was distributed with this source code. */ -namespace Flarum\Emoji\Listeners; +namespace Flarum\Emoji\Listener; -use Flarum\Events\FormatterConfigurator; +use Flarum\Event\ConfigureFormatter; use Illuminate\Contracts\Events\Dispatcher; -class AddEmoticons +class FormatEmoticons { + /** + * @param Dispatcher $events + */ public function subscribe(Dispatcher $events) { - $events->listen(FormatterConfigurator::class, [$this, 'addEmoticons']); + $events->listen(ConfigureFormatter::class, [$this, 'addEmoticons']); } - public function addEmoticons(FormatterConfigurator $event) + /** + * @param ConfigureFormatter $event + */ + public function addEmoticons(ConfigureFormatter $event) { $event->configurator->Emoticons->add(':)', '😄'); $event->configurator->Emoticons->add(':D', '😃'); diff --git a/extensions/emoji/src/Listeners/AddClientAssets.php b/extensions/emoji/src/Listeners/AddClientAssets.php deleted file mode 100644 index 9f733af91..000000000 --- a/extensions/emoji/src/Listeners/AddClientAssets.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Flarum\Emoji\Listeners; - -use Flarum\Events\RegisterLocales; -use Flarum\Events\BuildClientView; -use Illuminate\Contracts\Events\Dispatcher; - -class AddClientAssets -{ - public function subscribe(Dispatcher $events) - { - $events->listen(RegisterLocales::class, [$this, 'addLocale']); - $events->listen(BuildClientView::class, [$this, 'addAssets']); - } - - public function addLocale(RegisterLocales $event) - { - $event->addTranslations('en', __DIR__.'/../../locale/en.yml'); - } - - public function addAssets(BuildClientView $event) - { - $event->forumAssets([ - __DIR__.'/../../js/forum/dist/extension.js', - __DIR__.'/../../less/forum/extension.less' - ]); - - $event->forumBootstrapper('emoji/main'); - } -} From 866edd9f9a62d49947b67e07ff6006ef40a67b09 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 12 Oct 2015 15:00:15 +1030 Subject: [PATCH 016/154] Update metadata --- extensions/emoji/composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/emoji/composer.json b/extensions/emoji/composer.json index 58160ee38..41f686abe 100644 --- a/extensions/emoji/composer.json +++ b/extensions/emoji/composer.json @@ -2,6 +2,7 @@ "name": "flarum/emoji", "description": "Convert text and unicode emoji into Twemoji.", "type": "flarum-extension", + "keywords": ["formatting"], "license": "MIT", "authors": [ { From 5515ad91a583668a34d61323ac523e64d588508e Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 3 Nov 2015 10:02:52 +1030 Subject: [PATCH 017/154] Release 0.1.0-beta.3 --- extensions/emoji/js/forum/dist/extension.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index 10dafb5d4..f1449e0fe 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -586,7 +586,8 @@ var twemoji = (function ( return r.join(sep || '-'); } -}());;System.register('flarum/emoji/main', ['flarum/extend', 'flarum/app', 'flarum/models/Post'], function (_export) { +}());; +System.register('flarum/emoji/main', ['flarum/extend', 'flarum/app', 'flarum/models/Post'], function (_export) { /*global twemoji, s9e*/ 'use strict'; From 38de892d36ae782e11140d185dc091861f91b8bb Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 29 Dec 2015 12:55:05 +1030 Subject: [PATCH 018/154] Rename package --- extensions/emoji/composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/emoji/composer.json b/extensions/emoji/composer.json index 41f686abe..aa1b64828 100644 --- a/extensions/emoji/composer.json +++ b/extensions/emoji/composer.json @@ -1,5 +1,5 @@ { - "name": "flarum/emoji", + "name": "flarum/flarum-ext-emoji", "description": "Convert text and unicode emoji into Twemoji.", "type": "flarum-extension", "keywords": ["formatting"], @@ -12,7 +12,7 @@ ], "support": { "issues": "https://github.com/flarum/core/issues", - "source": "https://github.com/flarum/emoji" + "source": "https://github.com/flarum/flarum-ext-emoji" }, "require": { "flarum/core": "^0.1.0-beta.3" From d38c49809c94dedf3b9b4ae4cc05416702e75445 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 19 Jan 2016 17:19:17 +1030 Subject: [PATCH 019/154] Add Composer branch-alias This allows installations to require version 0.1.0 with minimum-stability=dev, and they will get the latest from master. See flarum/core#727 --- extensions/emoji/composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/emoji/composer.json b/extensions/emoji/composer.json index aa1b64828..376c41ee8 100644 --- a/extensions/emoji/composer.json +++ b/extensions/emoji/composer.json @@ -23,6 +23,9 @@ } }, "extra": { + "branch-alias": { + "dev-master": "0.1.x-dev" + }, "flarum-extension": { "title": "Emoji", "icon": { From 63d57474077669582196e810ca3220c648da89e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Soucaze?= Date: Mon, 25 Jan 2016 16:51:33 +0100 Subject: [PATCH 020/154] Update license year range to 2016 --- extensions/emoji/LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/emoji/LICENSE b/extensions/emoji/LICENSE index aa1e5fb86..a502a8545 100644 --- a/extensions/emoji/LICENSE +++ b/extensions/emoji/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2015 Toby Zerner +Copyright (c) 2014-2016 Toby Zerner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From e9ea22d59120b02ae678abf940435e5268921525 Mon Sep 17 00:00:00 2001 From: Sajjad Hasehmian Date: Mon, 1 Feb 2016 00:31:54 +0330 Subject: [PATCH 021/154] Use TextFormatter Emoji plugin --- extensions/emoji/js/forum/Gulpfile.js | 5 +- extensions/emoji/js/forum/bower.json | 6 - extensions/emoji/js/forum/dist/extension.js | 608 +----------------- extensions/emoji/js/forum/src/main.js | 19 +- .../emoji/src/Listener/FormatEmoticons.php | 30 +- 5 files changed, 20 insertions(+), 648 deletions(-) delete mode 100644 extensions/emoji/js/forum/bower.json diff --git a/extensions/emoji/js/forum/Gulpfile.js b/extensions/emoji/js/forum/Gulpfile.js index 50ad53f3e..6b80e3f33 100644 --- a/extensions/emoji/js/forum/Gulpfile.js +++ b/extensions/emoji/js/forum/Gulpfile.js @@ -3,8 +3,5 @@ var gulp = require('flarum-gulp'); gulp({ modules: { 'flarum/emoji': 'src/**/*.js' - }, - files: [ - 'bower_components/twemoji/index.js' - ] + } }); diff --git a/extensions/emoji/js/forum/bower.json b/extensions/emoji/js/forum/bower.json deleted file mode 100644 index 36cb5a6c6..000000000 --- a/extensions/emoji/js/forum/bower.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "flarum-emoji", - "devDependencies": { - "twemoji": "https://raw.githubusercontent.com/twitter/twemoji/gh-pages/twemoji.js" - } -} diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index f1449e0fe..dc3e6453d 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -1,592 +1,3 @@ -/*jslint indent: 2, browser: true, bitwise: true, plusplus: true */ -var twemoji = (function ( - /*! Copyright Twitter Inc. and other contributors. Licensed under MIT *//* - https://github.com/twitter/twemoji/blob/gh-pages/LICENSE - */ - - // WARNING: this file is generated automatically via - // `node twemoji-generator.js` - // please update its `createTwemoji` function - // at the bottom of the same file instead. - -) { - 'use strict'; - - /*jshint maxparams:4 */ - - var - // the exported module object - twemoji = { - - - ///////////////////////// - // properties // - ///////////////////////// - - // default assets url, by default will be Twitter Inc. CDN - base: (location.protocol === 'https:' ? 'https:' : 'http:') + - '//twemoji.maxcdn.com/', - - // default assets file extensions, by default '.png' - ext: '.png', - - // default assets/folder size, by default "36x36" - // available via Twitter CDN: 16, 36, 72 - size: '36x36', - - // default class name, by default 'emoji' - className: 'emoji', - - // basic utilities / helpers to convert code points - // to JavaScript surrogates and vice versa - convert: { - - /** - * Given an HEX codepoint, returns UTF16 surrogate pairs. - * - * @param string generic codepoint, i.e. '1F4A9' - * @return string codepoint transformed into utf16 surrogates pair, - * i.e. \uD83D\uDCA9 - * - * @example - * twemoji.convert.fromCodePoint('1f1e8'); - * // "\ud83c\udde8" - * - * '1f1e8-1f1f3'.split('-').map(twemoji.convert.fromCodePoint).join('') - * // "\ud83c\udde8\ud83c\uddf3" - */ - fromCodePoint: fromCodePoint, - - /** - * Given UTF16 surrogate pairs, returns the equivalent HEX codepoint. - * - * @param string generic utf16 surrogates pair, i.e. \uD83D\uDCA9 - * @param string optional separator for double code points, default='-' - * @return string utf16 transformed into codepoint, i.e. '1F4A9' - * - * @example - * twemoji.convert.toCodePoint('\ud83c\udde8\ud83c\uddf3'); - * // "1f1e8-1f1f3" - * - * twemoji.convert.toCodePoint('\ud83c\udde8\ud83c\uddf3', '~'); - * // "1f1e8~1f1f3" - */ - toCodePoint: toCodePoint - }, - - - ///////////////////////// - // methods // - ///////////////////////// - - /** - * User first: used to remove missing images - * preserving the original text intent when - * a fallback for network problems is desired. - * Automatically added to Image nodes via DOM - * It could be recycled for string operations via: - * $('img.emoji').on('error', twemoji.onerror) - */ - onerror: function onerror() { - if (this.parentNode) { - this.parentNode.replaceChild(createText(this.alt), this); - } - }, - - /** - * Main method/logic to generate either tags or HTMLImage nodes. - * "emojify" a generic text or DOM Element. - * - * @overloads - * - * String replacement for `innerHTML` or server side operations - * twemoji.parse(string); - * twemoji.parse(string, Function); - * twemoji.parse(string, Object); - * - * HTMLElement tree parsing for safer operations over existing DOM - * twemoji.parse(HTMLElement); - * twemoji.parse(HTMLElement, Function); - * twemoji.parse(HTMLElement, Object); - * - * @param string|HTMLElement the source to parse and enrich with emoji. - * - * string replace emoji matches with tags. - * Mainly used to inject emoji via `innerHTML` - * It does **not** parse the string or validate it, - * it simply replaces found emoji with a tag. - * NOTE: be sure this won't affect security. - * - * HTMLElement walk through the DOM tree and find emoji - * that are inside **text node only** (nodeType === 3) - * Mainly used to put emoji in already generated DOM - * without compromising surrounding nodes and - * **avoiding** the usage of `innerHTML`. - * NOTE: Using DOM elements instead of strings should - * improve security without compromising too much - * performance compared with a less safe `innerHTML`. - * - * @param Function|Object [optional] - * either the callback that will be invoked or an object - * with all properties to use per each found emoji. - * - * Function if specified, this will be invoked per each emoji - * that has been found through the RegExp except - * those follwed by the invariant \uFE0E ("as text"). - * Once invoked, parameters will be: - * - * codePoint:string the lower case HEX code point - * i.e. "1f4a9" - * - * options:Object all info for this parsing operation - * - * variant:char the optional \uFE0F ("as image") - * variant, in case this info - * is anyhow meaningful. - * By default this is ignored. - * - * If such callback will return a falsy value instead - * of a valid `src` to use for the image, nothing will - * actually change for that specific emoji. - * - * - * Object if specified, an object containing the following properties - * - * callback Function the callback to invoke per each found emoji. - * base string the base url, by default twemoji.base - * ext string the image extension, by default twemoji.ext - * size string the assets size, by default twemoji.size - * - * @example - * - * twemoji.parse("I \u2764\uFE0F emoji!"); - * // I ❤️ emoji! - * - * - * twemoji.parse("I \u2764\uFE0F emoji!", function(icon, options, variant) { - * return '/assets/' + icon + '.gif'; - * }); - * // I ❤️ emoji! - * - * - * twemoji.parse("I \u2764\uFE0F emoji!", { - * size: 72, - * callback: function(icon, options, variant) { - * return '/assets/' + options.size + '/' + icon + options.ext; - * } - * }); - * // I ❤️ emoji! - * - */ - parse: parse, - - /** - * Given a string, invokes the callback argument - * per each emoji found in such string. - * This is the most raw version used by - * the .parse(string) method itself. - * - * @param string generic string to parse - * @param Function a generic callback that will be - * invoked to replace the content. - * This calback wil receive standard - * String.prototype.replace(str, callback) - * arguments such: - * callback( - * match, // the emoji match - * icon, // the emoji text (same as text) - * variant // either '\uFE0E' or '\uFE0F', if present - * ); - * - * and others commonly received via replace. - * - * NOTE: When the variant \uFE0E is found, remember this is an explicit intent - * from the user: the emoji should **not** be replaced with an image. - * In \uFE0F case one, it's the opposite, it should be graphic. - * This utility convetion is that only \uFE0E are not translated into images. - */ - replace: replace, - - /** - * Simplify string tests against emoji. - * - * @param string some text that might contain emoji - * @return boolean true if any emoji was found, false otherwise. - * - * @example - * - * if (twemoji.test(someContent)) { - * console.log("emoji All The Things!"); - * } - */ - test: test - }, - - // used to escape HTML special chars in attributes - escaper = { - '&': '&', - '<': '<', - '>': '>', - "'": ''', - '"': '"' - }, - - // RegExp based on emoji's official Unicode standards - // http://www.unicode.org/Public/UNIDATA/EmojiSources.txt - re = /((?:\ud83c\udde8\ud83c\uddf3|\ud83c\uddfa\ud83c\uddf8|\ud83c\uddf7\ud83c\uddfa|\ud83c\uddf0\ud83c\uddf7|\ud83c\uddef\ud83c\uddf5|\ud83c\uddee\ud83c\uddf9|\ud83c\uddec\ud83c\udde7|\ud83c\uddeb\ud83c\uddf7|\ud83c\uddea\ud83c\uddf8|\ud83c\udde9\ud83c\uddea|\u0039\ufe0f?\u20e3|\u0038\ufe0f?\u20e3|\u0037\ufe0f?\u20e3|\u0036\ufe0f?\u20e3|\u0035\ufe0f?\u20e3|\u0034\ufe0f?\u20e3|\u0033\ufe0f?\u20e3|\u0032\ufe0f?\u20e3|\u0031\ufe0f?\u20e3|\u0030\ufe0f?\u20e3|\u0023\ufe0f?\u20e3|\ud83d\udeb3|\ud83d\udeb1|\ud83d\udeb0|\ud83d\udeaf|\ud83d\udeae|\ud83d\udea6|\ud83d\udea3|\ud83d\udea1|\ud83d\udea0|\ud83d\ude9f|\ud83d\ude9e|\ud83d\ude9d|\ud83d\ude9c|\ud83d\ude9b|\ud83d\ude98|\ud83d\ude96|\ud83d\ude94|\ud83d\ude90|\ud83d\ude8e|\ud83d\ude8d|\ud83d\ude8b|\ud83d\ude8a|\ud83d\ude88|\ud83d\ude86|\ud83d\ude82|\ud83d\ude81|\ud83d\ude36|\ud83d\ude34|\ud83d\ude2f|\ud83d\ude2e|\ud83d\ude2c|\ud83d\ude27|\ud83d\ude26|\ud83d\ude1f|\ud83d\ude1b|\ud83d\ude19|\ud83d\ude17|\ud83d\ude15|\ud83d\ude11|\ud83d\ude10|\ud83d\ude0e|\ud83d\ude08|\ud83d\ude07|\ud83d\ude00|\ud83d\udd67|\ud83d\udd66|\ud83d\udd65|\ud83d\udd64|\ud83d\udd63|\ud83d\udd62|\ud83d\udd61|\ud83d\udd60|\ud83d\udd5f|\ud83d\udd5e|\ud83d\udd5d|\ud83d\udd5c|\ud83d\udd2d|\ud83d\udd2c|\ud83d\udd15|\ud83d\udd09|\ud83d\udd08|\ud83d\udd07|\ud83d\udd06|\ud83d\udd05|\ud83d\udd04|\ud83d\udd02|\ud83d\udd01|\ud83d\udd00|\ud83d\udcf5|\ud83d\udcef|\ud83d\udced|\ud83d\udcec|\ud83d\udcb7|\ud83d\udcb6|\ud83d\udcad|\ud83d\udc6d|\ud83d\udc6c|\ud83d\udc65|\ud83d\udc2a|\ud83d\udc16|\ud83d\udc15|\ud83d\udc13|\ud83d\udc10|\ud83d\udc0f|\ud83d\udc0b|\ud83d\udc0a|\ud83d\udc09|\ud83d\udc08|\ud83d\udc07|\ud83d\udc06|\ud83d\udc05|\ud83d\udc04|\ud83d\udc03|\ud83d\udc02|\ud83d\udc01|\ud83d\udc00|\ud83c\udfe4|\ud83c\udfc9|\ud83c\udfc7|\ud83c\udf7c|\ud83c\udf50|\ud83c\udf4b|\ud83c\udf33|\ud83c\udf32|\ud83c\udf1e|\ud83c\udf1d|\ud83c\udf1c|\ud83c\udf1a|\ud83c\udf18|\ud83c\udccf|\ud83c\udd70|\ud83c\udd71|\ud83c\udd7e|\ud83c\udd8e|\ud83c\udd91|\ud83c\udd92|\ud83c\udd93|\ud83c\udd94|\ud83c\udd95|\ud83c\udd96|\ud83c\udd97|\ud83c\udd98|\ud83c\udd99|\ud83c\udd9a|\ud83d\udc77|\ud83d\udec5|\ud83d\udec4|\ud83d\udec3|\ud83d\udec2|\ud83d\udec1|\ud83d\udebf|\ud83d\udeb8|\ud83d\udeb7|\ud83d\udeb5|\ud83c\ude01|\ud83c\ude02|\ud83c\ude32|\ud83c\ude33|\ud83c\ude34|\ud83c\ude35|\ud83c\ude36|\ud83c\ude37|\ud83c\ude38|\ud83c\ude39|\ud83c\ude3a|\ud83c\ude50|\ud83c\ude51|\ud83c\udf00|\ud83c\udf01|\ud83c\udf02|\ud83c\udf03|\ud83c\udf04|\ud83c\udf05|\ud83c\udf06|\ud83c\udf07|\ud83c\udf08|\ud83c\udf09|\ud83c\udf0a|\ud83c\udf0b|\ud83c\udf0c|\ud83c\udf0f|\ud83c\udf11|\ud83c\udf13|\ud83c\udf14|\ud83c\udf15|\ud83c\udf19|\ud83c\udf1b|\ud83c\udf1f|\ud83c\udf20|\ud83c\udf30|\ud83c\udf31|\ud83c\udf34|\ud83c\udf35|\ud83c\udf37|\ud83c\udf38|\ud83c\udf39|\ud83c\udf3a|\ud83c\udf3b|\ud83c\udf3c|\ud83c\udf3d|\ud83c\udf3e|\ud83c\udf3f|\ud83c\udf40|\ud83c\udf41|\ud83c\udf42|\ud83c\udf43|\ud83c\udf44|\ud83c\udf45|\ud83c\udf46|\ud83c\udf47|\ud83c\udf48|\ud83c\udf49|\ud83c\udf4a|\ud83c\udf4c|\ud83c\udf4d|\ud83c\udf4e|\ud83c\udf4f|\ud83c\udf51|\ud83c\udf52|\ud83c\udf53|\ud83c\udf54|\ud83c\udf55|\ud83c\udf56|\ud83c\udf57|\ud83c\udf58|\ud83c\udf59|\ud83c\udf5a|\ud83c\udf5b|\ud83c\udf5c|\ud83c\udf5d|\ud83c\udf5e|\ud83c\udf5f|\ud83c\udf60|\ud83c\udf61|\ud83c\udf62|\ud83c\udf63|\ud83c\udf64|\ud83c\udf65|\ud83c\udf66|\ud83c\udf67|\ud83c\udf68|\ud83c\udf69|\ud83c\udf6a|\ud83c\udf6b|\ud83c\udf6c|\ud83c\udf6d|\ud83c\udf6e|\ud83c\udf6f|\ud83c\udf70|\ud83c\udf71|\ud83c\udf72|\ud83c\udf73|\ud83c\udf74|\ud83c\udf75|\ud83c\udf76|\ud83c\udf77|\ud83c\udf78|\ud83c\udf79|\ud83c\udf7a|\ud83c\udf7b|\ud83c\udf80|\ud83c\udf81|\ud83c\udf82|\ud83c\udf83|\ud83c\udf84|\ud83c\udf85|\ud83c\udf86|\ud83c\udf87|\ud83c\udf88|\ud83c\udf89|\ud83c\udf8a|\ud83c\udf8b|\ud83c\udf8c|\ud83c\udf8d|\ud83c\udf8e|\ud83c\udf8f|\ud83c\udf90|\ud83c\udf91|\ud83c\udf92|\ud83c\udf93|\ud83c\udfa0|\ud83c\udfa1|\ud83c\udfa2|\ud83c\udfa3|\ud83c\udfa4|\ud83c\udfa5|\ud83c\udfa6|\ud83c\udfa7|\ud83c\udfa8|\ud83c\udfa9|\ud83c\udfaa|\ud83c\udfab|\ud83c\udfac|\ud83c\udfad|\ud83c\udfae|\ud83c\udfaf|\ud83c\udfb0|\ud83c\udfb1|\ud83c\udfb2|\ud83c\udfb3|\ud83c\udfb4|\ud83c\udfb5|\ud83c\udfb6|\ud83c\udfb7|\ud83c\udfb8|\ud83c\udfb9|\ud83c\udfba|\ud83c\udfbb|\ud83c\udfbc|\ud83c\udfbd|\ud83c\udfbe|\ud83c\udfbf|\ud83c\udfc0|\ud83c\udfc1|\ud83c\udfc2|\ud83c\udfc3|\ud83c\udfc4|\ud83c\udfc6|\ud83c\udfc8|\ud83c\udfca|\ud83c\udfe0|\ud83c\udfe1|\ud83c\udfe2|\ud83c\udfe3|\ud83c\udfe5|\ud83c\udfe6|\ud83c\udfe7|\ud83c\udfe8|\ud83c\udfe9|\ud83c\udfea|\ud83c\udfeb|\ud83c\udfec|\ud83c\udfed|\ud83c\udfee|\ud83c\udfef|\ud83c\udff0|\ud83d\udc0c|\ud83d\udc0d|\ud83d\udc0e|\ud83d\udc11|\ud83d\udc12|\ud83d\udc14|\ud83d\udc17|\ud83d\udc18|\ud83d\udc19|\ud83d\udc1a|\ud83d\udc1b|\ud83d\udc1c|\ud83d\udc1d|\ud83d\udc1e|\ud83d\udc1f|\ud83d\udc20|\ud83d\udc21|\ud83d\udc22|\ud83d\udc23|\ud83d\udc24|\ud83d\udc25|\ud83d\udc26|\ud83d\udc27|\ud83d\udc28|\ud83d\udc29|\ud83d\udc2b|\ud83d\udc2c|\ud83d\udc2d|\ud83d\udc2e|\ud83d\udc2f|\ud83d\udc30|\ud83d\udc31|\ud83d\udc32|\ud83d\udc33|\ud83d\udc34|\ud83d\udc35|\ud83d\udc36|\ud83d\udc37|\ud83d\udc38|\ud83d\udc39|\ud83d\udc3a|\ud83d\udc3b|\ud83d\udc3c|\ud83d\udc3d|\ud83d\udc3e|\ud83d\udc40|\ud83d\udc42|\ud83d\udc43|\ud83d\udc44|\ud83d\udc45|\ud83d\udc46|\ud83d\udc47|\ud83d\udc48|\ud83d\udc49|\ud83d\udc4a|\ud83d\udc4b|\ud83d\udc4c|\ud83d\udc4d|\ud83d\udc4e|\ud83d\udc4f|\ud83d\udc50|\ud83d\udc51|\ud83d\udc52|\ud83d\udc53|\ud83d\udc54|\ud83d\udc55|\ud83d\udc56|\ud83d\udc57|\ud83d\udc58|\ud83d\udc59|\ud83d\udc5a|\ud83d\udc5b|\ud83d\udc5c|\ud83d\udc5d|\ud83d\udc5e|\ud83d\udc5f|\ud83d\udc60|\ud83d\udc61|\ud83d\udc62|\ud83d\udc63|\ud83d\udc64|\ud83d\udc66|\ud83d\udc67|\ud83d\udc68|\ud83d\udc69|\ud83d\udc6a|\ud83d\udc6b|\ud83d\udc6e|\ud83d\udc6f|\ud83d\udc70|\ud83d\udc71|\ud83d\udc72|\ud83d\udc73|\ud83d\udc74|\ud83d\udc75|\ud83d\udc76|\ud83d\udeb4|\ud83d\udc78|\ud83d\udc79|\ud83d\udc7a|\ud83d\udc7b|\ud83d\udc7c|\ud83d\udc7d|\ud83d\udc7e|\ud83d\udc7f|\ud83d\udc80|\ud83d\udc81|\ud83d\udc82|\ud83d\udc83|\ud83d\udc84|\ud83d\udc85|\ud83d\udc86|\ud83d\udc87|\ud83d\udc88|\ud83d\udc89|\ud83d\udc8a|\ud83d\udc8b|\ud83d\udc8c|\ud83d\udc8d|\ud83d\udc8e|\ud83d\udc8f|\ud83d\udc90|\ud83d\udc91|\ud83d\udc92|\ud83d\udc93|\ud83d\udc94|\ud83d\udc95|\ud83d\udc96|\ud83d\udc97|\ud83d\udc98|\ud83d\udc99|\ud83d\udc9a|\ud83d\udc9b|\ud83d\udc9c|\ud83d\udc9d|\ud83d\udc9e|\ud83d\udc9f|\ud83d\udca0|\ud83d\udca1|\ud83d\udca2|\ud83d\udca3|\ud83d\udca4|\ud83d\udca5|\ud83d\udca6|\ud83d\udca7|\ud83d\udca8|\ud83d\udca9|\ud83d\udcaa|\ud83d\udcab|\ud83d\udcac|\ud83d\udcae|\ud83d\udcaf|\ud83d\udcb0|\ud83d\udcb1|\ud83d\udcb2|\ud83d\udcb3|\ud83d\udcb4|\ud83d\udcb5|\ud83d\udcb8|\ud83d\udcb9|\ud83d\udcba|\ud83d\udcbb|\ud83d\udcbc|\ud83d\udcbd|\ud83d\udcbe|\ud83d\udcbf|\ud83d\udcc0|\ud83d\udcc1|\ud83d\udcc2|\ud83d\udcc3|\ud83d\udcc4|\ud83d\udcc5|\ud83d\udcc6|\ud83d\udcc7|\ud83d\udcc8|\ud83d\udcc9|\ud83d\udcca|\ud83d\udccb|\ud83d\udccc|\ud83d\udccd|\ud83d\udcce|\ud83d\udccf|\ud83d\udcd0|\ud83d\udcd1|\ud83d\udcd2|\ud83d\udcd3|\ud83d\udcd4|\ud83d\udcd5|\ud83d\udcd6|\ud83d\udcd7|\ud83d\udcd8|\ud83d\udcd9|\ud83d\udcda|\ud83d\udcdb|\ud83d\udcdc|\ud83d\udcdd|\ud83d\udcde|\ud83d\udcdf|\ud83d\udce0|\ud83d\udce1|\ud83d\udce2|\ud83d\udce3|\ud83d\udce4|\ud83d\udce5|\ud83d\udce6|\ud83d\udce7|\ud83d\udce8|\ud83d\udce9|\ud83d\udcea|\ud83d\udceb|\ud83d\udcee|\ud83d\udcf0|\ud83d\udcf1|\ud83d\udcf2|\ud83d\udcf3|\ud83d\udcf4|\ud83d\udcf6|\ud83d\udcf7|\ud83d\udcf9|\ud83d\udcfa|\ud83d\udcfb|\ud83d\udcfc|\ud83d\udd03|\ud83d\udd0a|\ud83d\udd0b|\ud83d\udd0c|\ud83d\udd0d|\ud83d\udd0e|\ud83d\udd0f|\ud83d\udd10|\ud83d\udd11|\ud83d\udd12|\ud83d\udd13|\ud83d\udd14|\ud83d\udd16|\ud83d\udd17|\ud83d\udd18|\ud83d\udd19|\ud83d\udd1a|\ud83d\udd1b|\ud83d\udd1c|\ud83d\udd1d|\ud83d\udd1e|\ud83d\udd1f|\ud83d\udd20|\ud83d\udd21|\ud83d\udd22|\ud83d\udd23|\ud83d\udd24|\ud83d\udd25|\ud83d\udd26|\ud83d\udd27|\ud83d\udd28|\ud83d\udd29|\ud83d\udd2a|\ud83d\udd2b|\ud83d\udd2e|\ud83d\udd2f|\ud83d\udd30|\ud83d\udd31|\ud83d\udd32|\ud83d\udd33|\ud83d\udd34|\ud83d\udd35|\ud83d\udd36|\ud83d\udd37|\ud83d\udd38|\ud83d\udd39|\ud83d\udd3a|\ud83d\udd3b|\ud83d\udd3c|\ud83d\udd3d|\ud83d\udd50|\ud83d\udd51|\ud83d\udd52|\ud83d\udd53|\ud83d\udd54|\ud83d\udd55|\ud83d\udd56|\ud83d\udd57|\ud83d\udd58|\ud83d\udd59|\ud83d\udd5a|\ud83d\udd5b|\ud83d\uddfb|\ud83d\uddfc|\ud83d\uddfd|\ud83d\uddfe|\ud83d\uddff|\ud83d\ude01|\ud83d\ude02|\ud83d\ude03|\ud83d\ude04|\ud83d\ude05|\ud83d\ude06|\ud83d\ude09|\ud83d\ude0a|\ud83d\ude0b|\ud83d\ude0c|\ud83d\ude0d|\ud83d\ude0f|\ud83d\ude12|\ud83d\ude13|\ud83d\ude14|\ud83d\ude16|\ud83d\ude18|\ud83d\ude1a|\ud83d\ude1c|\ud83d\ude1d|\ud83d\ude1e|\ud83d\ude20|\ud83d\ude21|\ud83d\ude22|\ud83d\ude23|\ud83d\ude24|\ud83d\ude25|\ud83d\ude28|\ud83d\ude29|\ud83d\ude2a|\ud83d\ude2b|\ud83d\ude2d|\ud83d\ude30|\ud83d\ude31|\ud83d\ude32|\ud83d\ude33|\ud83d\ude35|\ud83d\ude37|\ud83d\ude38|\ud83d\ude39|\ud83d\ude3a|\ud83d\ude3b|\ud83d\ude3c|\ud83d\ude3d|\ud83d\ude3e|\ud83d\ude3f|\ud83d\ude40|\ud83d\ude45|\ud83d\ude46|\ud83d\ude47|\ud83d\ude48|\ud83d\ude49|\ud83d\ude4a|\ud83d\ude4b|\ud83d\ude4c|\ud83d\ude4d|\ud83d\ude4e|\ud83d\ude4f|\ud83d\ude80|\ud83d\ude83|\ud83d\ude84|\ud83d\ude85|\ud83d\ude87|\ud83d\ude89|\ud83d\ude8c|\ud83d\ude8f|\ud83d\ude91|\ud83d\ude92|\ud83d\ude93|\ud83d\ude95|\ud83d\ude97|\ud83d\ude99|\ud83d\ude9a|\ud83d\udea2|\ud83d\udea4|\ud83d\udea5|\ud83d\udea7|\ud83d\udea8|\ud83d\udea9|\ud83d\udeaa|\ud83d\udeab|\ud83d\udeac|\ud83d\udead|\ud83d\udeb2|\ud83d\udeb6|\ud83d\udeb9|\ud83d\udeba|\ud83d\udebb|\ud83d\udebc|\ud83d\udebd|\ud83d\udebe|\ud83d\udec0|\ud83c\udde6|\ud83c\udde7|\ud83c\udde8|\ud83c\udde9|\ud83c\uddea|\ud83c\uddeb|\ud83c\uddec|\ud83c\udded|\ud83c\uddee|\ud83c\uddef|\ud83c\uddf0|\ud83c\uddf1|\ud83c\uddf2|\ud83c\uddf3|\ud83c\uddf4|\ud83c\uddf5|\ud83c\uddf6|\ud83c\uddf7|\ud83c\uddf8|\ud83c\uddf9|\ud83c\uddfa|\ud83c\uddfb|\ud83c\uddfc|\ud83c\uddfd|\ud83c\uddfe|\ud83c\uddff|\ud83c\udf0d|\ud83c\udf0e|\ud83c\udf10|\ud83c\udf12|\ud83c\udf16|\ud83c\udf17|\ue50a|\u3030|\u27b0|\u2797|\u2796|\u2795|\u2755|\u2754|\u2753|\u274e|\u274c|\u2728|\u270b|\u270a|\u2705|\u26ce|\u23f3|\u23f0|\u23ec|\u23eb|\u23ea|\u23e9|\u2122|\u27bf|\u00a9|\u00ae)|(?:(?:\ud83c\udc04|\ud83c\udd7f|\ud83c\ude1a|\ud83c\ude2f|\u3299|\u303d|\u2b55|\u2b50|\u2b1c|\u2b1b|\u2b07|\u2b06|\u2b05|\u2935|\u2934|\u27a1|\u2764|\u2757|\u2747|\u2744|\u2734|\u2733|\u2716|\u2714|\u2712|\u270f|\u270c|\u2709|\u2708|\u2702|\u26fd|\u26fa|\u26f5|\u26f3|\u26f2|\u26ea|\u26d4|\u26c5|\u26c4|\u26be|\u26bd|\u26ab|\u26aa|\u26a1|\u26a0|\u2693|\u267f|\u267b|\u3297|\u2666|\u2665|\u2663|\u2660|\u2653|\u2652|\u2651|\u2650|\u264f|\u264e|\u264d|\u264c|\u264b|\u264a|\u2649|\u2648|\u263a|\u261d|\u2615|\u2614|\u2611|\u260e|\u2601|\u2600|\u25fe|\u25fd|\u25fc|\u25fb|\u25c0|\u25b6|\u25ab|\u25aa|\u24c2|\u231b|\u231a|\u21aa|\u21a9|\u2199|\u2198|\u2197|\u2196|\u2195|\u2194|\u2139|\u2049|\u203c|\u2668)([\uFE0E\uFE0F]?)))/g, - - // used to find HTML special chars in attributes - rescaper = /[&<>'"]/g, - - // nodes with type 1 which should **not** be parsed (including lower case svg) - shouldntBeParsed = /IFRAME|NOFRAMES|NOSCRIPT|SCRIPT|SELECT|STYLE|TEXTAREA|[a-z]/, - - // just a private shortcut - fromCharCode = String.fromCharCode; - - return twemoji; - - - ///////////////////////// - // private functions // - // declaration // - ///////////////////////// - - /** - * Shortcut to create text nodes - * @param string text used to create DOM text node - * @return Node a DOM node with that text - */ - function createText(text) { - return document.createTextNode(text); - } - - /** - * Utility function to escape html attribute text - * @param string text use in HTML attribute - * @return string text encoded to use in HTML attribute - */ - function escapeHTML(s) { - return s.replace(rescaper, replacer); - } - - /** - * Default callback used to generate emoji src - * based on Twitter CDN - * @param string the emoji codepoint string - * @param string the default size to use, i.e. "36x36" - * @param string optional "\uFE0F" variant char, ignored by default - * @return string the image source to use - */ - function defaultImageSrcGenerator(icon, options) { - return ''.concat(options.base, options.size, '/', icon, options.ext); - } - - /** - * Given a generic DOM nodeType 1, walk through all children - * and store every nodeType 3 (#text) found in the tree. - * @param Element a DOM Element with probably some text in it - * @param Array the list of previously discovered text nodes - * @return Array same list with new discovered nodes, if any - */ - function grabAllTextNodes(node, allText) { - var - childNodes = node.childNodes, - length = childNodes.length, - subnode, - nodeType; - while (length--) { - subnode = childNodes[length]; - nodeType = subnode.nodeType; - // parse emoji only in text nodes - if (nodeType === 3) { - // collect them to process emoji later - allText.push(subnode); - } - // ignore all nodes that are not type 1 or that - // should not be parsed as script, style, and others - else if (nodeType === 1 && !shouldntBeParsed.test(subnode.nodeName)) { - grabAllTextNodes(subnode, allText); - } - } - return allText; - } - - /** - * Used to both remove the possible variant - * and to convert utf16 into code points - * @param string the emoji surrogate pair - * @param string the optional variant char, if any - */ - function grabTheRightIcon(icon, variant) { - // if variant is present as \uFE0F - return toCodePoint( - variant === '\uFE0F' ? - // the icon should not contain it - icon.slice(0, -1) : - // fix non standard OSX behavior - (icon.length === 3 && icon.charAt(1) === '\uFE0F' ? - icon.charAt(0) + icon.charAt(2) : icon) - ); - } - - /** - * DOM version of the same logic / parser: - * emojify all found sub-text nodes placing images node instead. - * @param Element generic DOM node with some text in some child node - * @param Object options containing info about how to parse - * - * .callback Function the callback to invoke per each found emoji. - * .base string the base url, by default twemoji.base - * .ext string the image extension, by default twemoji.ext - * .size string the assets size, by default twemoji.size - * - * @return Element same generic node with emoji in place, if any. - */ - function parseNode(node, options) { - var - allText = grabAllTextNodes(node, []), - length = allText.length, - attrib, - attrname, - modified, - fragment, - subnode, - text, - match, - i, - index, - img, - alt, - icon, - variant, - src; - while (length--) { - modified = false; - fragment = document.createDocumentFragment(); - subnode = allText[length]; - text = subnode.nodeValue; - i = 0; - while ((match = re.exec(text))) { - index = match.index; - if (index !== i) { - fragment.appendChild( - createText(text.slice(i, index)) - ); - } - alt = match[0]; - icon = match[1]; - variant = match[2]; - i = index + alt.length; - if (variant !== '\uFE0E') { - src = options.callback( - grabTheRightIcon(icon, variant), - options, - variant - ); - if (src) { - img = new Image(); - img.onerror = twemoji.onerror; - img.setAttribute('draggable', 'false'); - attrib = options.attributes(icon, variant); - for (attrname in attrib) { - if ( - attrib.hasOwnProperty(attrname) && - // don't allow any handlers to be set + don't allow overrides - attrname.indexOf('on') !== 0 && - !img.hasAttribute(attrname) - ) { - img.setAttribute(attrname, attrib[attrname]); - } - } - img.className = options.className; - img.alt = alt; - img.src = src; - modified = true; - fragment.appendChild(img); - } - } - if (!img) fragment.appendChild(createText(alt)); - img = null; - } - // is there actually anything to replace in here ? - if (modified) { - // any text left to be added ? - if (i < text.length) { - fragment.appendChild( - createText(text.slice(i)) - ); - } - // replace the text node only, leave intact - // anything else surrounding such text - subnode.parentNode.replaceChild(fragment, subnode); - } - } - return node; - } - - /** - * String/HTML version of the same logic / parser: - * emojify a generic text placing images tags instead of surrogates pair. - * @param string generic string with possibly some emoji in it - * @param Object options containing info about how to parse - * - * .callback Function the callback to invoke per each found emoji. - * .base string the base url, by default twemoji.base - * .ext string the image extension, by default twemoji.ext - * .size string the assets size, by default twemoji.size - * - * @return the string with replacing all found and parsed emoji - */ - function parseString(str, options) { - return replace(str, function (match, icon, variant) { - var - ret = match, - attrib, - attrname, - src; - // verify the variant is not the FE0E one - // this variant means "emoji as text" and should not - // require any action/replacement - // http://unicode.org/Public/UNIDATA/StandardizedVariants.html - if (variant !== '\uFE0E') { - src = options.callback( - grabTheRightIcon(icon, variant), - options, - variant - ); - if (src) { - // recycle the match string replacing the emoji - // with its image counter part - ret = ''); - } - } - return ret; - }); - } - - /** - * Function used to actually replace HTML special chars - * @param string HTML special char - * @return string encoded HTML special char - */ - function replacer(m) { - return escaper[m]; - } - - /** - * Default options.attribute callback - * @return null - */ - function returnNull() { - return null; - } - - /** - * Given a generic value, creates its squared counterpart if it's a number. - * As example, number 36 will return '36x36'. - * @param any a generic value. - * @return any a string representing asset size, i.e. "36x36" - * only in case the value was a number. - * Returns initial value otherwise. - */ - function toSizeSquaredAsset(value) { - return typeof value === 'number' ? - value + 'x' + value : - value; - } - - - ///////////////////////// - // exported functions // - // declaration // - ///////////////////////// - - function fromCodePoint(codepoint) { - var code = typeof codepoint === 'string' ? - parseInt(codepoint, 16) : codepoint; - if (code < 0x10000) { - return fromCharCode(code); - } - code -= 0x10000; - return fromCharCode( - 0xD800 + (code >> 10), - 0xDC00 + (code & 0x3FF) - ); - } - - function parse(what, how) { - if (!how || typeof how === 'function') { - how = {callback: how}; - } - // if first argument is string, inject html tags - // otherwise use the DOM tree and parse text nodes only - return (typeof what === 'string' ? parseString : parseNode)(what, { - callback: how.callback || defaultImageSrcGenerator, - attributes: typeof how.attributes === 'function' ? how.attributes : returnNull, - base: typeof how.base === 'string' ? how.base : twemoji.base, - ext: how.ext || twemoji.ext, - size: how.folder || toSizeSquaredAsset(how.size || twemoji.size), - className: how.className || twemoji.className - }); - } - - function replace(text, callback) { - return String(text).replace(re, callback); - } - - function test(text) { - // IE6 needs a reset before too - re.lastIndex = 0; - var result = re.test(text); - re.lastIndex = 0; - return result; - } - - function toCodePoint(unicodeSurrogates, sep) { - var - r = [], - c = 0, - p = 0, - i = 0; - while (i < unicodeSurrogates.length) { - c = unicodeSurrogates.charCodeAt(i++); - if (p) { - r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16)); - p = 0; - } else if (0xD800 <= c && c <= 0xDBFF) { - p = c; - } else { - r.push(c.toString(16)); - } - } - return r.join(sep || '-'); - } - -}());; System.register('flarum/emoji/main', ['flarum/extend', 'flarum/app', 'flarum/models/Post'], function (_export) { /*global twemoji, s9e*/ @@ -603,24 +14,7 @@ System.register('flarum/emoji/main', ['flarum/extend', 'flarum/app', 'flarum/mod }], execute: function () { - app.initializers.add('flarum-emoji', function () { - override(Post.prototype, 'contentHtml', function (original) { - var contentHtml = original(); - - if (this.oldContentHtml !== contentHtml) { - this.emojifiedContentHtml = twemoji.parse(contentHtml); - this.oldContentHtml = contentHtml; - } - - return this.emojifiedContentHtml; - }); - - override(s9e.TextFormatter, 'preview', function (original, text, element) { - original(text, element); - - twemoji.parse(element); - }); - }); + app.initializers.add('flarum-emoji', function () {}); } }; }); \ No newline at end of file diff --git a/extensions/emoji/js/forum/src/main.js b/extensions/emoji/js/forum/src/main.js index 354587d49..9e6d9fc6f 100644 --- a/extensions/emoji/js/forum/src/main.js +++ b/extensions/emoji/js/forum/src/main.js @@ -4,21 +4,4 @@ import { override } from 'flarum/extend'; import app from 'flarum/app'; import Post from 'flarum/models/Post'; -app.initializers.add('flarum-emoji', () => { - override(Post.prototype, 'contentHtml', function(original) { - const contentHtml = original(); - - if (this.oldContentHtml !== contentHtml) { - this.emojifiedContentHtml = twemoji.parse(contentHtml); - this.oldContentHtml = contentHtml; - } - - return this.emojifiedContentHtml; - }); - - override(s9e.TextFormatter, 'preview', (original, text, element) => { - original(text, element); - - twemoji.parse(element); - }); -}); +app.initializers.add('flarum-emoji', () => {}); diff --git a/extensions/emoji/src/Listener/FormatEmoticons.php b/extensions/emoji/src/Listener/FormatEmoticons.php index d4e0d0cc1..375b4da1e 100644 --- a/extensions/emoji/src/Listener/FormatEmoticons.php +++ b/extensions/emoji/src/Listener/FormatEmoticons.php @@ -1,4 +1,4 @@ -configurator->Emoticons->add(':)', '😄'); - $event->configurator->Emoticons->add(':D', '😃'); - $event->configurator->Emoticons->add(':P', '😜'); - $event->configurator->Emoticons->add(':(', '😟'); - $event->configurator->Emoticons->add(':|', '😐'); - $event->configurator->Emoticons->add(';)', '😉'); - $event->configurator->Emoticons->add(':*', '😘'); - $event->configurator->Emoticons->add(':\'(', '😢'); - $event->configurator->Emoticons->add(':\')', '😂'); - $event->configurator->Emoticons->add(':O', '😮'); - $event->configurator->Emoticons->add('B)', '😎'); - $event->configurator->Emoticons->add('>:(', '😡'); + $event->configurator->Emoji->useTwemoji(); + $event->configurator->Emoji->setImageSize(32); + $event->configurator->Emoji->omitImageSize(); + + $event->configurator->Emoji->addAlias(':)', '😄'); + $event->configurator->Emoji->addAlias(':D', '😃'); + $event->configurator->Emoji->addAlias(':P', '😜'); + $event->configurator->Emoji->addAlias(':(', '😟'); + $event->configurator->Emoji->addAlias(':|', '😐'); + $event->configurator->Emoji->addAlias(';)', '😉'); + $event->configurator->Emoji->addAlias(':*', '😘'); + $event->configurator->Emoji->addAlias(':\'(', '😢'); + $event->configurator->Emoji->addAlias(':\')', '😂'); + $event->configurator->Emoji->addAlias(':O', '😮'); + $event->configurator->Emoji->addAlias('B)', '😎'); + $event->configurator->Emoji->addAlias('>:(', '😡'); } } From bd7a72911bb4445569360d496e612e8dd9f548ba Mon Sep 17 00:00:00 2001 From: Sajjad Hasehmian Date: Mon, 1 Feb 2016 23:17:56 +0330 Subject: [PATCH 022/154] Add Emoji auto suggestion menu fixes flarum/core#397 Clean Up --- extensions/emoji/js/forum/Gulpfile.js | 5 +- extensions/emoji/js/forum/bower.json | 6 + extensions/emoji/js/forum/dist/extension.js | 456 +++++++++++++++++- .../js/forum/src/addComposerAutocomplete.js | 137 ++++++ .../src/components/AutocompleteDropdown.js | 95 ++++ extensions/emoji/js/forum/src/main.js | 10 +- extensions/emoji/less/forum/extension.less | 35 ++ 7 files changed, 736 insertions(+), 8 deletions(-) create mode 100644 extensions/emoji/js/forum/bower.json create mode 100644 extensions/emoji/js/forum/src/addComposerAutocomplete.js create mode 100644 extensions/emoji/js/forum/src/components/AutocompleteDropdown.js diff --git a/extensions/emoji/js/forum/Gulpfile.js b/extensions/emoji/js/forum/Gulpfile.js index 6b80e3f33..6259a8e2d 100644 --- a/extensions/emoji/js/forum/Gulpfile.js +++ b/extensions/emoji/js/forum/Gulpfile.js @@ -3,5 +3,8 @@ var gulp = require('flarum-gulp'); gulp({ modules: { 'flarum/emoji': 'src/**/*.js' - } + }, + files: [ + 'bower_components/textarea-caret-position/index.js' + ] }); diff --git a/extensions/emoji/js/forum/bower.json b/extensions/emoji/js/forum/bower.json new file mode 100644 index 000000000..6d52edb04 --- /dev/null +++ b/extensions/emoji/js/forum/bower.json @@ -0,0 +1,6 @@ +{ + "name": "flarum-emoji", + "devDependencies": { + "textarea-caret-position": "~3.0.0" + } +} diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index dc3e6453d..e5387b3a2 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -1,9 +1,451 @@ -System.register('flarum/emoji/main', ['flarum/extend', 'flarum/app', 'flarum/models/Post'], function (_export) { - /*global twemoji, s9e*/ +/* jshint browser: true */ + +(function () { + +// The properties that we copy into a mirrored div. +// Note that some browsers, such as Firefox, +// do not concatenate properties, i.e. padding-top, bottom etc. -> padding, +// so we have to do every single property specifically. +var properties = [ + 'direction', // RTL support + 'boxSizing', + 'width', // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does + 'height', + 'overflowX', + 'overflowY', // copy the scrollbar for IE + + 'borderTopWidth', + 'borderRightWidth', + 'borderBottomWidth', + 'borderLeftWidth', + 'borderStyle', + + 'paddingTop', + 'paddingRight', + 'paddingBottom', + 'paddingLeft', + + // https://developer.mozilla.org/en-US/docs/Web/CSS/font + 'fontStyle', + 'fontVariant', + 'fontWeight', + 'fontStretch', + 'fontSize', + 'fontSizeAdjust', + 'lineHeight', + 'fontFamily', + + 'textAlign', + 'textTransform', + 'textIndent', + 'textDecoration', // might not make a difference, but better be safe + + 'letterSpacing', + 'wordSpacing', + + 'tabSize', + 'MozTabSize' + +]; + +var isBrowser = (typeof window !== 'undefined'); +var isFirefox = (isBrowser && window.mozInnerScreenX != null); + +function getCaretCoordinates(element, position, options) { + if(!isBrowser) { + throw new Error('textarea-caret-position#getCaretCoordinates should only be called in a browser'); + } + + var debug = options && options.debug || false; + if (debug) { + var el = document.querySelector('#input-textarea-caret-position-mirror-div'); + if ( el ) { el.parentNode.removeChild(el); } + } + + // mirrored div + var div = document.createElement('div'); + div.id = 'input-textarea-caret-position-mirror-div'; + document.body.appendChild(div); + + var style = div.style; + var computed = window.getComputedStyle? getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9 + + // default textarea styles + style.whiteSpace = 'pre-wrap'; + if (element.nodeName !== 'INPUT') + style.wordWrap = 'break-word'; // only for textarea-s + + // position off-screen + style.position = 'absolute'; // required to return coordinates properly + if (!debug) + style.visibility = 'hidden'; // not 'display: none' because we want rendering + + // transfer the element's properties to the div + properties.forEach(function (prop) { + style[prop] = computed[prop]; + }); + + if (isFirefox) { + // Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275 + if (element.scrollHeight > parseInt(computed.height)) + style.overflowY = 'scroll'; + } else { + style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll' + } + + div.textContent = element.value.substring(0, position); + // the second special handling for input type="text" vs textarea: spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037 + if (element.nodeName === 'INPUT') + div.textContent = div.textContent.replace(/\s/g, '\u00a0'); + + var span = document.createElement('span'); + // Wrapping must be replicated *exactly*, including when a long word gets + // onto the next line, with whitespace at the end of the line before (#7). + // The *only* reliable way to do that is to copy the *entire* rest of the + // textarea's content into the created at the caret position. + // for inputs, just '.' would be enough, but why bother? + span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all + div.appendChild(span); + + var coordinates = { + top: span.offsetTop + parseInt(computed['borderTopWidth']), + left: span.offsetLeft + parseInt(computed['borderLeftWidth']) + }; + + if (debug) { + span.style.backgroundColor = '#aaa'; + } else { + document.body.removeChild(div); + } + + return coordinates; +} + +if (typeof module != 'undefined' && typeof module.exports != 'undefined') { + module.exports = getCaretCoordinates; +} else if(isBrowser){ + window.getCaretCoordinates = getCaretCoordinates; +} + +}()); +; +System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flarum/components/ComposerBody', 'flarum/emoji/components/AutocompleteDropdown'], function (_export) { + /*global getCaretCoordinates*/ 'use strict'; - var override, app, Post; + var extend, ComposerBody, AutocompleteDropdown; + + _export('default', addComposerAutocomplete); + + function addComposerAutocomplete() { + + var emoji_map = { "-1": "1f44e", "+1": "1f44d", "8ball": "1f3b1", "a": "1f170", "ab": "1f18e", "abc": "1f524", "abcd": "1f521", "accept": "1f251", "aerial_tramway": "1f6a1", "airplane": "2708", "alarm_clock": "23f0", "alien": "1f47d", "ambulance": "1f691", "anchor": "2693", "angel": "1f47c", "anger": "1f4a2", "angry": "1f620", "anguished": "1f627", "ant": "1f41c", "apple": "1f34e", "aquarius": "2652", "aries": "2648", "arrow_backward": "25c0", "arrow_double_down": "23ec", "arrow_double_up": "23eb", "arrow_down": "2b07", "arrow_down_small": "1f53d", "arrow_forward": "25b6", "arrow_heading_down": "2935", "arrow_heading_up": "2934", "arrow_left": "2b05", "arrow_lower_left": "2199", "arrow_lower_right": "2198", "arrow_right": "27a1", "arrow_right_hook": "21aa", "arrow_up": "2b06", "arrow_up_down": "2195", "arrow_up_small": "1f53c", "arrow_upper_left": "2196", "arrow_upper_right": "2197", "arrows_clockwise": "1f503", "arrows_counterclockwise": "1f504", "art": "1f3a8", "articulated_lorry": "1f69b", "astonished": "1f632", "athletic_shoe": "1f45f", "atm": "1f3e7", "b": "1f171", "baby": "1f476", "baby_bottle": "1f37c", "baby_chick": "1f424", "baby_symbol": "1f6bc", "back": "1f519", "baggage_claim": "1f6c4", "balloon": "1f388", "ballot_box_with_check": "2611", "bamboo": "1f38d", "banana": "1f34c", "bangbang": "203c", "bank": "1f3e6", "bar_chart": "1f4ca", "barber": "1f488", "baseball": "26be", "basketball": "1f3c0", "bath": "1f6c0", "bathtub": "1f6c1", "battery": "1f50b", "bear": "1f43b", "bee": "1f41d", "beer": "1f37a", "beers": "1f37b", "beetle": "1f41e", "beginner": "1f530", "bell": "1f514", "bento": "1f371", "bicyclist": "1f6b4", "bike": "1f6b2", "bikini": "1f459", "bird": "1f426", "birthday": "1f382", "black_circle": "26ab", "black_joker": "1f0cf", "black_large_square": "2b1b", "black_medium_small_square": "25fe", "black_medium_square": "25fc", "black_nib": "2712", "black_small_square": "25aa", "black_square_button": "1f532", "blossom": "1f33c", "blowfish": "1f421", "blue_book": "1f4d8", "blue_car": "1f699", "blue_heart": "1f499", "blush": "1f60a", "boar": "1f417", "boat": "26f5", "bomb": "1f4a3", "book": "1f4d6", "bookmark": "1f516", "bookmark_tabs": "1f4d1", "books": "1f4da", "boom": "1f4a5", "boot": "1f462", "bouquet": "1f490", "bow": "1f647", "bowling": "1f3b3", "boy": "1f466", "bread": "1f35e", "bride_with_veil": "1f470", "bridge_at_night": "1f309", "briefcase": "1f4bc", "broken_heart": "1f494", "bug": "1f41b", "bulb": "1f4a1", "bullettrain_front": "1f685", "bullettrain_side": "1f684", "bus": "1f68c", "busstop": "1f68f", "bust_in_silhouette": "1f464", "busts_in_silhouette": "1f465", "cactus": "1f335", "cake": "1f370", "calendar": "1f4c6", "calling": "1f4f2", "camel": "1f42b", "camera": "1f4f7", "cancer": "264b", "candy": "1f36c", "capital_abcd": "1f520", "capricorn": "2651", "car": "1f697", "card_index": "1f4c7", "carousel_horse": "1f3a0", "cat": "1f431", "cat2": "1f408", "cd": "1f4bf", "chart": "1f4b9", "chart_with_downwards_trend": "1f4c9", "chart_with_upwards_trend": "1f4c8", "checkered_flag": "1f3c1", "cherries": "1f352", "cherry_blossom": "1f338", "chestnut": "1f330", "chicken": "1f414", "children_crossing": "1f6b8", "chocolate_bar": "1f36b", "christmas_tree": "1f384", "church": "26ea", "cinema": "1f3a6", "circus_tent": "1f3aa", "city_sunrise": "1f307", "city_sunset": "1f306", "cl": "1f191", "clap": "1f44f", "clapper": "1f3ac", "clipboard": "1f4cb", "clock1": "1f550", "clock10": "1f559", "clock1030": "1f565", "clock11": "1f55a", "clock1130": "1f566", "clock12": "1f55b", "clock1230": "1f567", "clock130": "1f55c", "clock2": "1f551", "clock230": "1f55d", "clock3": "1f552", "clock330": "1f55e", "clock4": "1f553", "clock430": "1f55f", "clock5": "1f554", "clock530": "1f560", "clock6": "1f555", "clock630": "1f561", "clock7": "1f556", "clock730": "1f562", "clock8": "1f557", "clock830": "1f563", "clock9": "1f558", "clock930": "1f564", "closed_book": "1f4d5", "closed_lock_with_key": "1f510", "closed_umbrella": "1f302", "cloud": "2601", "clubs": "2663", "cn": "1f1e8-1f1f3", "cocktail": "1f378", "coffee": "2615", "cold_sweat": "1f630", "collision": "1f4a5", "computer": "1f4bb", "confetti_ball": "1f38a", "confounded": "1f616", "confused": "1f615", "congratulations": "3297", "construction": "1f6a7", "construction_worker": "1f477", "convenience_store": "1f3ea", "cookie": "1f36a", "cool": "1f192", "cop": "1f46e", "copyright": "a9", "corn": "1f33d", "couple": "1f46b", "couple_with_heart": "1f491", "couplekiss": "1f48f", "cow": "1f42e", "cow2": "1f404", "credit_card": "1f4b3", "crescent_moon": "1f319", "crocodile": "1f40a", "crossed_flags": "1f38c", "crown": "1f451", "cry": "1f622", "crying_cat_face": "1f63f", "crystal_ball": "1f52e", "cupid": "1f498", "curly_loop": "27b0", "currency_exchange": "1f4b1", "curry": "1f35b", "custard": "1f36e", "customs": "1f6c3", "cyclone": "1f300", "dancer": "1f483", "dancers": "1f46f", "dango": "1f361", "dart": "1f3af", "dash": "1f4a8", "date": "1f4c5", "de": "1f1e9-1f1ea", "deciduous_tree": "1f333", "department_store": "1f3ec", "diamond_shape_with_a_dot_inside": "1f4a0", "diamonds": "2666", "disappointed": "1f61e", "disappointed_relieved": "1f625", "dizzy": "1f4ab", "dizzy_face": "1f635", "do_not_litter": "1f6af", "dog": "1f436", "dog2": "1f415", "dollar": "1f4b5", "dolls": "1f38e", "dolphin": "1f42c", "door": "1f6aa", "doughnut": "1f369", "dragon": "1f409", "dragon_face": "1f432", "dress": "1f457", "dromedary_camel": "1f42a", "droplet": "1f4a7", "dvd": "1f4c0", "e-mail": "1f4e7", "ear": "1f442", "ear_of_rice": "1f33e", "earth_africa": "1f30d", "earth_americas": "1f30e", "earth_asia": "1f30f", "egg": "1f373", "eggplant": "1f346", "eight": "38-20e3", "eight_pointed_black_star": "2734", "eight_spoked_asterisk": "2733", "electric_plug": "1f50c", "elephant": "1f418", "email": "2709", "end": "1f51a", "envelope": "2709", "envelope_with_arrow": "1f4e9", "es": "1f1ea-1f1f8", "euro": "1f4b6", "european_castle": "1f3f0", "european_post_office": "1f3e4", "evergreen_tree": "1f332", "exclamation": "2757", "expressionless": "1f611", "eyeglasses": "1f453", "eyes": "1f440", "facepunch": "1f44a", "factory": "1f3ed", "fallen_leaf": "1f342", "family": "1f46a", "fast_forward": "23e9", "fax": "1f4e0", "fearful": "1f628", "feet": "1f43e", "ferris_wheel": "1f3a1", "file_folder": "1f4c1", "fire": "1f525", "fire_engine": "1f692", "fireworks": "1f386", "first_quarter_moon": "1f313", "first_quarter_moon_with_face": "1f31b", "fish": "1f41f", "fish_cake": "1f365", "fishing_pole_and_fish": "1f3a3", "fist": "270a", "five": "35-20e3", "flags": "1f38f", "flashlight": "1f526", "flipper": "1f42c", "floppy_disk": "1f4be", "flower_playing_cards": "1f3b4", "flushed": "1f633", "foggy": "1f301", "football": "1f3c8", "footprints": "1f463", "fork_and_knife": "1f374", "fountain": "26f2", "four": "34-20e3", "four_leaf_clover": "1f340", "fr": "1f1eb-1f1f7", "free": "1f193", "fried_shrimp": "1f364", "fries": "1f35f", "frog": "1f438", "frowning": "1f626", "fuelpump": "26fd", "full_moon": "1f315", "full_moon_with_face": "1f31d", "game_die": "1f3b2", "gb": "1f1ec-1f1e7", "gem": "1f48e", "gemini": "264a", "ghost": "1f47b", "gift": "1f381", "gift_heart": "1f49d", "girl": "1f467", "globe_with_meridians": "1f310", "goat": "1f410", "golf": "26f3", "grapes": "1f347", "green_apple": "1f34f", "green_book": "1f4d7", "green_heart": "1f49a", "grey_exclamation": "2755", "grey_question": "2754", "grimacing": "1f62c", "grin": "1f601", "grinning": "1f600", "guardsman": "1f482", "guitar": "1f3b8", "gun": "1f52b", "haircut": "1f487", "hamburger": "1f354", "hammer": "1f528", "hamster": "1f439", "hand": "270b", "handbag": "1f45c", "hankey": "1f4a9", "hash": "23-20e3", "hatched_chick": "1f425", "hatching_chick": "1f423", "headphones": "1f3a7", "hear_no_evil": "1f649", "heart": "2764", "heart_decoration": "1f49f", "heart_eyes": "1f60d", "heart_eyes_cat": "1f63b", "heartbeat": "1f493", "heartpulse": "1f497", "hearts": "2665", "heavy_check_mark": "2714", "heavy_division_sign": "2797", "heavy_dollar_sign": "1f4b2", "heavy_exclamation_mark": "2757", "heavy_minus_sign": "2796", "heavy_multiplication_x": "2716", "heavy_plus_sign": "2795", "helicopter": "1f681", "herb": "1f33f", "hibiscus": "1f33a", "high_brightness": "1f506", "high_heel": "1f460", "hocho": "1f52a", "honey_pot": "1f36f", "honeybee": "1f41d", "horse": "1f434", "horse_racing": "1f3c7", "hospital": "1f3e5", "hotel": "1f3e8", "hotsprings": "2668", "hourglass": "231b", "hourglass_flowing_sand": "23f3", "house": "1f3e0", "house_with_garden": "1f3e1", "hushed": "1f62f", "ice_cream": "1f368", "icecream": "1f366", "id": "1f194", "ideograph_advantage": "1f250", "imp": "1f47f", "inbox_tray": "1f4e5", "incoming_envelope": "1f4e8", "information_desk_person": "1f481", "information_source": "2139", "innocent": "1f607", "interrobang": "2049", "iphone": "1f4f1", "it": "1f1ee-1f1f9", "izakaya_lantern": "1f3ee", "jack_o_lantern": "1f383", "japan": "1f5fe", "japanese_castle": "1f3ef", "japanese_goblin": "1f47a", "japanese_ogre": "1f479", "jeans": "1f456", "joy": "1f602", "joy_cat": "1f639", "jp": "1f1ef-1f1f5", "key": "1f511", "keycap_ten": "1f51f", "kimono": "1f458", "kiss": "1f48b", "kissing": "1f617", "kissing_cat": "1f63d", "kissing_closed_eyes": "1f61a", "kissing_heart": "1f618", "kissing_smiling_eyes": "1f619", "knife": "1f52a", "koala": "1f428", "koko": "1f201", "kr": "1f1f0-1f1f7", "lantern": "1f3ee", "large_blue_circle": "1f535", "large_blue_diamond": "1f537", "large_orange_diamond": "1f536", "last_quarter_moon": "1f317", "last_quarter_moon_with_face": "1f31c", "laughing": "1f606", "leaves": "1f343", "ledger": "1f4d2", "left_luggage": "1f6c5", "left_right_arrow": "2194", "leftwards_arrow_with_hook": "21a9", "lemon": "1f34b", "leo": "264c", "leopard": "1f406", "libra": "264e", "light_rail": "1f688", "link": "1f517", "lips": "1f444", "lipstick": "1f484", "lock": "1f512", "lock_with_ink_pen": "1f50f", "lollipop": "1f36d", "loop": "27bf", "loud_sound": "1f50a", "loudspeaker": "1f4e2", "love_hotel": "1f3e9", "love_letter": "1f48c", "low_brightness": "1f505", "m": "24c2", "mag": "1f50d", "mag_right": "1f50e", "mahjong": "1f004", "mailbox": "1f4eb", "mailbox_closed": "1f4ea", "mailbox_with_mail": "1f4ec", "mailbox_with_no_mail": "1f4ed", "man": "1f468", "man_with_gua_pi_mao": "1f472", "man_with_turban": "1f473", "mans_shoe": "1f45e", "maple_leaf": "1f341", "mask": "1f637", "massage": "1f486", "meat_on_bone": "1f356", "mega": "1f4e3", "melon": "1f348", "memo": "1f4dd", "mens": "1f6b9", "metro": "1f687", "microphone": "1f3a4", "microscope": "1f52c", "milky_way": "1f30c", "minibus": "1f690", "minidisc": "1f4bd", "mobile_phone_off": "1f4f4", "money_with_wings": "1f4b8", "moneybag": "1f4b0", "monkey": "1f412", "monkey_face": "1f435", "monorail": "1f69d", "moon": "1f314", "mortar_board": "1f393", "mount_fuji": "1f5fb", "mountain_bicyclist": "1f6b5", "mountain_cableway": "1f6a0", "mountain_railway": "1f69e", "mouse": "1f42d", "mouse2": "1f401", "movie_camera": "1f3a5", "moyai": "1f5ff", "muscle": "1f4aa", "mushroom": "1f344", "musical_keyboard": "1f3b9", "musical_note": "1f3b5", "musical_score": "1f3bc", "mute": "1f507", "nail_care": "1f485", "name_badge": "1f4db", "necktie": "1f454", "negative_squared_cross_mark": "274e", "neutral_face": "1f610", "new": "1f195", "new_moon": "1f311", "new_moon_with_face": "1f31a", "newspaper": "1f4f0", "ng": "1f196", "ng_woman": "1f645", "night_with_stars": "1f303", "nine": "39-20e3", "no_bell": "1f515", "no_bicycles": "1f6b3", "no_entry": "26d4", "no_entry_sign": "1f6ab", "no_good": "1f645", "no_mobile_phones": "1f4f5", "no_mouth": "1f636", "no_pedestrians": "1f6b7", "no_smoking": "1f6ad", "non-potable_water": "1f6b1", "nose": "1f443", "notebook": "1f4d3", "notebook_with_decorative_cover": "1f4d4", "notes": "1f3b6", "nut_and_bolt": "1f529", "o": "2b55", "o2": "1f17e", "ocean": "1f30a", "octopus": "1f419", "oden": "1f362", "office": "1f3e2", "ok": "1f197", "ok_hand": "1f44c", "ok_woman": "1f646", "older_man": "1f474", "older_woman": "1f475", "on": "1f51b", "oncoming_automobile": "1f698", "oncoming_bus": "1f68d", "oncoming_police_car": "1f694", "oncoming_taxi": "1f696", "one": "31-20e3", "open_book": "1f4d6", "open_file_folder": "1f4c2", "open_hands": "1f450", "open_mouth": "1f62e", "ophiuchus": "26ce", "orange_book": "1f4d9", "outbox_tray": "1f4e4", "ox": "1f402", "package": "1f4e6", "page_facing_up": "1f4c4", "page_with_curl": "1f4c3", "pager": "1f4df", "palm_tree": "1f334", "panda_face": "1f43c", "paperclip": "1f4ce", "parking": "1f17f", "part_alternation_mark": "303d", "partly_sunny": "26c5", "passport_control": "1f6c2", "paw_prints": "1f43e", "peach": "1f351", "pear": "1f350", "pencil": "1f4dd", "pencil2": "270f", "penguin": "1f427", "pensive": "1f614", "performing_arts": "1f3ad", "persevere": "1f623", "person_frowning": "1f64d", "person_with_blond_hair": "1f471", "person_with_pouting_face": "1f64e", "phone": "260e", "pig": "1f437", "pig2": "1f416", "pig_nose": "1f43d", "pill": "1f48a", "pineapple": "1f34d", "pisces": "2653", "pizza": "1f355", "point_down": "1f447", "point_left": "1f448", "point_right": "1f449", "point_up": "261d", "point_up_2": "1f446", "police_car": "1f693", "poodle": "1f429", "poop": "1f4a9", "post_office": "1f3e3", "postal_horn": "1f4ef", "postbox": "1f4ee", "potable_water": "1f6b0", "pouch": "1f45d", "poultry_leg": "1f357", "pound": "1f4b7", "pout": "1f621", "pouting_cat": "1f63e", "pray": "1f64f", "princess": "1f478", "punch": "1f44a", "purple_heart": "1f49c", "purse": "1f45b", "pushpin": "1f4cc", "put_litter_in_its_place": "1f6ae", "question": "2753", "rabbit": "1f430", "rabbit2": "1f407", "racehorse": "1f40e", "radio": "1f4fb", "radio_button": "1f518", "rage": "1f621", "railway_car": "1f683", "rainbow": "1f308", "raised_hand": "270b", "raised_hands": "1f64c", "raising_hand": "1f64b", "ram": "1f40f", "ramen": "1f35c", "rat": "1f400", "recycle": "267b", "red_car": "1f697", "red_circle": "1f534", "registered": "ae", "relaxed": "263a", "relieved": "1f60c", "repeat": "1f501", "repeat_one": "1f502", "restroom": "1f6bb", "revolving_hearts": "1f49e", "rewind": "23ea", "ribbon": "1f380", "rice": "1f35a", "rice_ball": "1f359", "rice_cracker": "1f358", "rice_scene": "1f391", "ring": "1f48d", "rocket": "1f680", "roller_coaster": "1f3a2", "rooster": "1f413", "rose": "1f339", "rotating_light": "1f6a8", "round_pushpin": "1f4cd", "rowboat": "1f6a3", "ru": "1f1f7-1f1fa", "rugby_football": "1f3c9", "runner": "1f3c3", "running": "1f3c3", "running_shirt_with_sash": "1f3bd", "sa": "1f202", "sagittarius": "2650", "sailboat": "26f5", "sake": "1f376", "sandal": "1f461", "santa": "1f385", "satellite": "1f4e1", "satisfied": "1f606", "saxophone": "1f3b7", "school": "1f3eb", "school_satchel": "1f392", "scissors": "2702", "scorpius": "264f", "scream": "1f631", "scream_cat": "1f640", "scroll": "1f4dc", "seat": "1f4ba", "secret": "3299", "see_no_evil": "1f648", "seedling": "1f331", "seven": "37-20e3", "shaved_ice": "1f367", "sheep": "1f411", "shell": "1f41a", "ship": "1f6a2", "shirt": "1f455", "shit": "1f4a9", "shoe": "1f45e", "shower": "1f6bf", "signal_strength": "1f4f6", "six": "36-20e3", "six_pointed_star": "1f52f", "ski": "1f3bf", "skull": "1f480", "sleeping": "1f634", "sleepy": "1f62a", "slot_machine": "1f3b0", "small_blue_diamond": "1f539", "small_orange_diamond": "1f538", "small_red_triangle": "1f53a", "small_red_triangle_down": "1f53b", "smile": "1f604", "smile_cat": "1f638", "smiley": "1f603", "smiley_cat": "1f63a", "smiling_imp": "1f608", "smirk": "1f60f", "smirk_cat": "1f63c", "smoking": "1f6ac", "snail": "1f40c", "snake": "1f40d", "snowboarder": "1f3c2", "snowflake": "2744", "snowman": "26c4", "sob": "1f62d", "soccer": "26bd", "soon": "1f51c", "sos": "1f198", "sound": "1f509", "space_invader": "1f47e", "spades": "2660", "spaghetti": "1f35d", "sparkle": "2747", "sparkler": "1f387", "sparkles": "2728", "sparkling_heart": "1f496", "speak_no_evil": "1f64a", "speaker": "1f508", "speech_balloon": "1f4ac", "speedboat": "1f6a4", "star": "2b50", "star2": "1f31f", "stars": "1f320", "station": "1f689", "statue_of_liberty": "1f5fd", "steam_locomotive": "1f682", "stew": "1f372", "straight_ruler": "1f4cf", "strawberry": "1f353", "stuck_out_tongue": "1f61b", "stuck_out_tongue_closed_eyes": "1f61d", "stuck_out_tongue_winking_eye": "1f61c", "sun_with_face": "1f31e", "sunflower": "1f33b", "sunglasses": "1f60e", "sunny": "2600", "sunrise": "1f305", "sunrise_over_mountains": "1f304", "surfer": "1f3c4", "sushi": "1f363", "suspension_railway": "1f69f", "sweat": "1f613", "sweat_drops": "1f4a6", "sweat_smile": "1f605", "sweet_potato": "1f360", "swimmer": "1f3ca", "symbols": "1f523", "syringe": "1f489", "tada": "1f389", "tanabata_tree": "1f38b", "tangerine": "1f34a", "taurus": "2649", "taxi": "1f695", "tea": "1f375", "telephone": "260e", "telephone_receiver": "1f4de", "telescope": "1f52d", "tennis": "1f3be", "tent": "26fa", "thought_balloon": "1f4ad", "three": "33-20e3", "thumbsdown": "1f44e", "thumbsup": "1f44d", "ticket": "1f3ab", "tiger": "1f42f", "tiger2": "1f405", "tired_face": "1f62b", "tm": "2122", "toilet": "1f6bd", "tokyo_tower": "1f5fc", "tomato": "1f345", "tongue": "1f445", "top": "1f51d", "tophat": "1f3a9", "tractor": "1f69c", "traffic_light": "1f6a5", "train": "1f68b", "train2": "1f686", "tram": "1f68a", "triangular_flag_on_post": "1f6a9", "triangular_ruler": "1f4d0", "trident": "1f531", "triumph": "1f624", "trolleybus": "1f68e", "trophy": "1f3c6", "tropical_drink": "1f379", "tropical_fish": "1f420", "truck": "1f69a", "trumpet": "1f3ba", "tshirt": "1f455", "tulip": "1f337", "turtle": "1f422", "tv": "1f4fa", "twisted_rightwards_arrows": "1f500", "two": "32-20e3", "two_hearts": "1f495", "two_men_holding_hands": "1f46c", "two_women_holding_hands": "1f46d", "u5272": "1f239", "u5408": "1f234", "u55b6": "1f23a", "u6307": "1f22f", "u6708": "1f237", "u6709": "1f236", "u6e80": "1f235", "u7121": "1f21a", "u7533": "1f238", "u7981": "1f232", "u7a7a": "1f233", "uk": "1f1ec-1f1e7", "umbrella": "2614", "unamused": "1f612", "underage": "1f51e", "unlock": "1f513", "up": "1f199", "us": "1f1fa-1f1f8", "v": "270c", "vertical_traffic_light": "1f6a6", "vhs": "1f4fc", "vibration_mode": "1f4f3", "video_camera": "1f4f9", "video_game": "1f3ae", "violin": "1f3bb", "virgo": "264d", "volcano": "1f30b", "vs": "1f19a", "walking": "1f6b6", "waning_crescent_moon": "1f318", "waning_gibbous_moon": "1f316", "warning": "26a0", "watch": "231a", "water_buffalo": "1f403", "watermelon": "1f349", "wave": "1f44b", "wavy_dash": "3030", "waxing_crescent_moon": "1f312", "waxing_gibbous_moon": "1f314", "wc": "1f6be", "weary": "1f629", "wedding": "1f492", "whale": "1f433", "whale2": "1f40b", "wheelchair": "267f", "white_check_mark": "2705", "white_circle": "26aa", "white_flower": "1f4ae", "white_large_square": "2b1c", "white_medium_small_square": "25fd", "white_medium_square": "25fb", "white_small_square": "25ab", "white_square_button": "1f533", "wind_chime": "1f390", "wine_glass": "1f377", "wink": "1f609", "wolf": "1f43a", "woman": "1f469", "womans_clothes": "1f45a", "womans_hat": "1f452", "womens": "1f6ba", "worried": "1f61f", "wrench": "1f527", "x": "274c", "yellow_heart": "1f49b", "yen": "1f4b4", "yum": "1f60b", "zap": "26a1", "zero": "30-20e3", "zzz": "1f4a4", "100": "1f4af", "1234": "1f522" }; + + var emoji_keys = Object.keys(emoji_map); + + extend(ComposerBody.prototype, 'config', function (original, isInitialized) { + if (isInitialized) return; + + var composer = this; + var $container = $('
'); + var dropdown = new AutocompleteDropdown({ items: [] }); + var $textarea = this.$('textarea').wrap('
'); + var emojiStart = undefined; + var typed = undefined; + + var applySuggestion = function applySuggestion(replacement) { + var insert = replacement + ' '; + + var content = composer.content(); + composer.editor.setValue(content.substring(0, emojiStart - 1) + insert + content.substr($textarea[0].selectionStart)); + + var index = emojiStart - 1 + insert.length; + composer.editor.setSelectionRange(index, index); + + dropdown.hide(); + }; + + $textarea.after($container).on('keydown', dropdown.navigate.bind(dropdown)).on('click keyup', function (e) { + var _this = this; + + // Up, down, enter, tab, escape, left, right. + if ([9, 13, 27, 40, 38, 37, 39].indexOf(e.which) !== -1) return; + + var cursor = this.selectionStart; + + if (this.selectionEnd - cursor > 0) return; + + // Search backwards from the cursor for an ':' symbol, without any + // intervening whitespace. If we find one, we will want to show the + // autocomplete dropdown! + var value = this.value; + emojiStart = 0; + for (var i = cursor - 1; i >= 0; i--) { + var character = value.substr(i, 1); + if (/\s/.test(character)) break; + if (character === ':') { + emojiStart = i + 1; + break; + } + } + + dropdown.hide(); + dropdown.active = false; + + if (emojiStart) { + (function () { + typed = value.substring(emojiStart, cursor).toLowerCase(); + + var makeSuggestion = function makeSuggestion(key) { + var code = ':' + key + ':'; + return m( + 'button', + { className: 'PostPreview', + onclick: function () { + return applySuggestion(code); + }, + onmouseenter: function () { + dropdown.setIndex($(this).parent().index()); + } }, + m( + 'span', + { className: 'PostPreview-content' }, + m('img', { alt: code, 'class': 'emoji', draggable: 'false', src: '//twemoji.maxcdn.com/36x36/' + emoji_map[key] + '.png' }), + key + ) + ); + }; + + var buildSuggestions = function buildSuggestions() { + var suggestions = []; + var similarEmoji = []; + + var fuzzyRegexp = function fuzzyRegexp(str) { + var reEscape = new RegExp("\\(([" + "+.*?[]{}()^$|\\".replace(/(.)/g, "\\$1") + "])\\)", "g"); + return new RegExp("(.*)" + str.toLowerCase().replace(/(.)/g, "($1)(.*?)").replace(reEscape, "(\\$1)") + "$", "i"); + }; + + var regTyped = fuzzyRegexp(typed); + for (var i = 0, maxSuggestions = 7; i < emoji_keys.length && maxSuggestions > 0; i++) { + if (regTyped.test(emoji_keys[i])) { + --maxSuggestions; + similarEmoji.push(emoji_keys[i]); + } + } + + similarEmoji = similarEmoji.sort(function (a, b) { + return a.length - b.length; + }); + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = similarEmoji[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var key = _step.value; + + suggestions.push(makeSuggestion(key)); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator['return']) { + _iterator['return'](); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + if (suggestions.length) { + dropdown.props.items = suggestions; + m.render($container[0], dropdown.render()); + + dropdown.show(); + var coordinates = getCaretCoordinates(_this, emojiStart); + var width = dropdown.$().outerWidth(); + var height = dropdown.$().outerHeight(); + var _parent = dropdown.$().offsetParent(); + var left = coordinates.left; + var _top = coordinates.top + 15; + if (_top + height > _parent.height()) { + _top = coordinates.top - height - 15; + } + if (left + width > _parent.width()) { + left = _parent.width() - width; + } + dropdown.show(left, _top); + } + }; + + buildSuggestions(); + + dropdown.setIndex(0); + dropdown.$().scrollTop(0); + dropdown.active = true; + })(); + } + }); + }); + } + + return { + setters: [function (_flarumExtend) { + extend = _flarumExtend.extend; + }, function (_flarumComponentsComposerBody) { + ComposerBody = _flarumComponentsComposerBody['default']; + }, function (_flarumEmojiComponentsAutocompleteDropdown) { + AutocompleteDropdown = _flarumEmojiComponentsAutocompleteDropdown['default']; + }], + execute: function () {} + }; +});; +System.register('flarum/emoji/components/AutocompleteDropdown', ['flarum/Component'], function (_export) { + 'use strict'; + + var Component, AutocompleteDropdown; + return { + setters: [function (_flarumComponent) { + Component = _flarumComponent['default']; + }], + execute: function () { + AutocompleteDropdown = (function (_Component) { + babelHelpers.inherits(AutocompleteDropdown, _Component); + + function AutocompleteDropdown() { + babelHelpers.classCallCheck(this, AutocompleteDropdown); + babelHelpers.get(Object.getPrototypeOf(AutocompleteDropdown.prototype), 'constructor', this).apply(this, arguments); + } + + babelHelpers.createClass(AutocompleteDropdown, [{ + key: 'init', + value: function init() { + this.active = false; + this.index = 0; + this.keyWasJustPressed = false; + } + }, { + key: 'view', + value: function view() { + return m( + 'ul', + { className: 'Dropdown-menu EmojiDropdown' }, + this.props.items.map(function (item) { + return m( + 'li', + null, + item + ); + }) + ); + } + }, { + key: 'show', + value: function show(left, top) { + this.$().show().css({ + left: left + 'px', + top: top + 'px' + }); + this.active = true; + } + }, { + key: 'hide', + value: function hide() { + this.$().hide(); + this.active = false; + } + }, { + key: 'navigate', + value: function navigate(e) { + var _this = this; + + if (!this.active) return; + + switch (e.which) { + case 40:case 38: + // Down/Up + this.keyWasJustPressed = true; + this.setIndex(this.index + (e.which === 40 ? 1 : -1), true); + clearTimeout(this.keyWasJustPressedTimeout); + this.keyWasJustPressedTimeout = setTimeout(function () { + return _this.keyWasJustPressed = false; + }, 500); + e.preventDefault(); + break; + + case 13:case 9: + // Enter/Tab + this.$('li').eq(this.index).find('button').click(); + e.preventDefault(); + break; + + case 27: + // Escape + this.hide(); + e.stopPropagation(); + e.preventDefault(); + break; + + default: + // no default + } + } + }, { + key: 'setIndex', + value: function setIndex(index, scrollToItem) { + if (this.keyWasJustPressed && !scrollToItem) return; + + var $dropdown = this.$(); + var $items = $dropdown.find('li'); + var rangedIndex = index; + + if (rangedIndex < 0) { + rangedIndex = $items.length - 1; + } else if (rangedIndex >= $items.length) { + rangedIndex = 0; + } + + this.index = rangedIndex; + + var $item = $items.removeClass('active').eq(rangedIndex).addClass('active'); + + if (scrollToItem) { + var dropdownScroll = $dropdown.scrollTop(); + var dropdownTop = $dropdown.offset().top; + var dropdownBottom = dropdownTop + $dropdown.outerHeight(); + var itemTop = $item.offset().top; + var itemBottom = itemTop + $item.outerHeight(); + + var scrollTop = undefined; + if (itemTop < dropdownTop) { + scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10); + } else if (itemBottom > dropdownBottom) { + scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10); + } + + if (typeof scrollTop !== 'undefined') { + $dropdown.stop(true).animate({ scrollTop: scrollTop }, 100); + } + } + } + }]); + return AutocompleteDropdown; + })(Component); + + _export('default', AutocompleteDropdown); + } + }; +});; +System.register('flarum/emoji/main', ['flarum/extend', 'flarum/app', 'flarum/models/Post', 'flarum/emoji/addComposerAutocomplete'], function (_export) { + 'use strict'; + + var override, app, Post, addComposerAutocomplete; return { setters: [function (_flarumExtend) { override = _flarumExtend.override; @@ -11,10 +453,16 @@ System.register('flarum/emoji/main', ['flarum/extend', 'flarum/app', 'flarum/mod app = _flarumApp['default']; }, function (_flarumModelsPost) { Post = _flarumModelsPost['default']; + }, function (_flarumEmojiAddComposerAutocomplete) { + addComposerAutocomplete = _flarumEmojiAddComposerAutocomplete['default']; }], execute: function () { - app.initializers.add('flarum-emoji', function () {}); + app.initializers.add('flarum-emoji', function () { + // After typing ':' in the composer, show a dropdown suggesting a bunch of + // emoji that the user could use. + addComposerAutocomplete(); + }); } }; }); \ No newline at end of file diff --git a/extensions/emoji/js/forum/src/addComposerAutocomplete.js b/extensions/emoji/js/forum/src/addComposerAutocomplete.js new file mode 100644 index 000000000..4548af239 --- /dev/null +++ b/extensions/emoji/js/forum/src/addComposerAutocomplete.js @@ -0,0 +1,137 @@ +/*global getCaretCoordinates*/ + +import { extend } from 'flarum/extend'; +import ComposerBody from 'flarum/components/ComposerBody'; + +import AutocompleteDropdown from 'flarum/emoji/components/AutocompleteDropdown'; + +export default function addComposerAutocomplete() { + + const emoji_map = {"-1":"1f44e","+1":"1f44d","8ball":"1f3b1","a":"1f170","ab":"1f18e","abc":"1f524","abcd":"1f521","accept":"1f251","aerial_tramway":"1f6a1","airplane":"2708","alarm_clock":"23f0","alien":"1f47d","ambulance":"1f691","anchor":"2693","angel":"1f47c","anger":"1f4a2","angry":"1f620","anguished":"1f627","ant":"1f41c","apple":"1f34e","aquarius":"2652","aries":"2648","arrow_backward":"25c0","arrow_double_down":"23ec","arrow_double_up":"23eb","arrow_down":"2b07","arrow_down_small":"1f53d","arrow_forward":"25b6","arrow_heading_down":"2935","arrow_heading_up":"2934","arrow_left":"2b05","arrow_lower_left":"2199","arrow_lower_right":"2198","arrow_right":"27a1","arrow_right_hook":"21aa","arrow_up":"2b06","arrow_up_down":"2195","arrow_up_small":"1f53c","arrow_upper_left":"2196","arrow_upper_right":"2197","arrows_clockwise":"1f503","arrows_counterclockwise":"1f504","art":"1f3a8","articulated_lorry":"1f69b","astonished":"1f632","athletic_shoe":"1f45f","atm":"1f3e7","b":"1f171","baby":"1f476","baby_bottle":"1f37c","baby_chick":"1f424","baby_symbol":"1f6bc","back":"1f519","baggage_claim":"1f6c4","balloon":"1f388","ballot_box_with_check":"2611","bamboo":"1f38d","banana":"1f34c","bangbang":"203c","bank":"1f3e6","bar_chart":"1f4ca","barber":"1f488","baseball":"26be","basketball":"1f3c0","bath":"1f6c0","bathtub":"1f6c1","battery":"1f50b","bear":"1f43b","bee":"1f41d","beer":"1f37a","beers":"1f37b","beetle":"1f41e","beginner":"1f530","bell":"1f514","bento":"1f371","bicyclist":"1f6b4","bike":"1f6b2","bikini":"1f459","bird":"1f426","birthday":"1f382","black_circle":"26ab","black_joker":"1f0cf","black_large_square":"2b1b","black_medium_small_square":"25fe","black_medium_square":"25fc","black_nib":"2712","black_small_square":"25aa","black_square_button":"1f532","blossom":"1f33c","blowfish":"1f421","blue_book":"1f4d8","blue_car":"1f699","blue_heart":"1f499","blush":"1f60a","boar":"1f417","boat":"26f5","bomb":"1f4a3","book":"1f4d6","bookmark":"1f516","bookmark_tabs":"1f4d1","books":"1f4da","boom":"1f4a5","boot":"1f462","bouquet":"1f490","bow":"1f647","bowling":"1f3b3","boy":"1f466","bread":"1f35e","bride_with_veil":"1f470","bridge_at_night":"1f309","briefcase":"1f4bc","broken_heart":"1f494","bug":"1f41b","bulb":"1f4a1","bullettrain_front":"1f685","bullettrain_side":"1f684","bus":"1f68c","busstop":"1f68f","bust_in_silhouette":"1f464","busts_in_silhouette":"1f465","cactus":"1f335","cake":"1f370","calendar":"1f4c6","calling":"1f4f2","camel":"1f42b","camera":"1f4f7","cancer":"264b","candy":"1f36c","capital_abcd":"1f520","capricorn":"2651","car":"1f697","card_index":"1f4c7","carousel_horse":"1f3a0","cat":"1f431","cat2":"1f408","cd":"1f4bf","chart":"1f4b9","chart_with_downwards_trend":"1f4c9","chart_with_upwards_trend":"1f4c8","checkered_flag":"1f3c1","cherries":"1f352","cherry_blossom":"1f338","chestnut":"1f330","chicken":"1f414","children_crossing":"1f6b8","chocolate_bar":"1f36b","christmas_tree":"1f384","church":"26ea","cinema":"1f3a6","circus_tent":"1f3aa","city_sunrise":"1f307","city_sunset":"1f306","cl":"1f191","clap":"1f44f","clapper":"1f3ac","clipboard":"1f4cb","clock1":"1f550","clock10":"1f559","clock1030":"1f565","clock11":"1f55a","clock1130":"1f566","clock12":"1f55b","clock1230":"1f567","clock130":"1f55c","clock2":"1f551","clock230":"1f55d","clock3":"1f552","clock330":"1f55e","clock4":"1f553","clock430":"1f55f","clock5":"1f554","clock530":"1f560","clock6":"1f555","clock630":"1f561","clock7":"1f556","clock730":"1f562","clock8":"1f557","clock830":"1f563","clock9":"1f558","clock930":"1f564","closed_book":"1f4d5","closed_lock_with_key":"1f510","closed_umbrella":"1f302","cloud":"2601","clubs":"2663","cn":"1f1e8-1f1f3","cocktail":"1f378","coffee":"2615","cold_sweat":"1f630","collision":"1f4a5","computer":"1f4bb","confetti_ball":"1f38a","confounded":"1f616","confused":"1f615","congratulations":"3297","construction":"1f6a7","construction_worker":"1f477","convenience_store":"1f3ea","cookie":"1f36a","cool":"1f192","cop":"1f46e","copyright":"a9","corn":"1f33d","couple":"1f46b","couple_with_heart":"1f491","couplekiss":"1f48f","cow":"1f42e","cow2":"1f404","credit_card":"1f4b3","crescent_moon":"1f319","crocodile":"1f40a","crossed_flags":"1f38c","crown":"1f451","cry":"1f622","crying_cat_face":"1f63f","crystal_ball":"1f52e","cupid":"1f498","curly_loop":"27b0","currency_exchange":"1f4b1","curry":"1f35b","custard":"1f36e","customs":"1f6c3","cyclone":"1f300","dancer":"1f483","dancers":"1f46f","dango":"1f361","dart":"1f3af","dash":"1f4a8","date":"1f4c5","de":"1f1e9-1f1ea","deciduous_tree":"1f333","department_store":"1f3ec","diamond_shape_with_a_dot_inside":"1f4a0","diamonds":"2666","disappointed":"1f61e","disappointed_relieved":"1f625","dizzy":"1f4ab","dizzy_face":"1f635","do_not_litter":"1f6af","dog":"1f436","dog2":"1f415","dollar":"1f4b5","dolls":"1f38e","dolphin":"1f42c","door":"1f6aa","doughnut":"1f369","dragon":"1f409","dragon_face":"1f432","dress":"1f457","dromedary_camel":"1f42a","droplet":"1f4a7","dvd":"1f4c0","e-mail":"1f4e7","ear":"1f442","ear_of_rice":"1f33e","earth_africa":"1f30d","earth_americas":"1f30e","earth_asia":"1f30f","egg":"1f373","eggplant":"1f346","eight":"38-20e3","eight_pointed_black_star":"2734","eight_spoked_asterisk":"2733","electric_plug":"1f50c","elephant":"1f418","email":"2709","end":"1f51a","envelope":"2709","envelope_with_arrow":"1f4e9","es":"1f1ea-1f1f8","euro":"1f4b6","european_castle":"1f3f0","european_post_office":"1f3e4","evergreen_tree":"1f332","exclamation":"2757","expressionless":"1f611","eyeglasses":"1f453","eyes":"1f440","facepunch":"1f44a","factory":"1f3ed","fallen_leaf":"1f342","family":"1f46a","fast_forward":"23e9","fax":"1f4e0","fearful":"1f628","feet":"1f43e","ferris_wheel":"1f3a1","file_folder":"1f4c1","fire":"1f525","fire_engine":"1f692","fireworks":"1f386","first_quarter_moon":"1f313","first_quarter_moon_with_face":"1f31b","fish":"1f41f","fish_cake":"1f365","fishing_pole_and_fish":"1f3a3","fist":"270a","five":"35-20e3","flags":"1f38f","flashlight":"1f526","flipper":"1f42c","floppy_disk":"1f4be","flower_playing_cards":"1f3b4","flushed":"1f633","foggy":"1f301","football":"1f3c8","footprints":"1f463","fork_and_knife":"1f374","fountain":"26f2","four":"34-20e3","four_leaf_clover":"1f340","fr":"1f1eb-1f1f7","free":"1f193","fried_shrimp":"1f364","fries":"1f35f","frog":"1f438","frowning":"1f626","fuelpump":"26fd","full_moon":"1f315","full_moon_with_face":"1f31d","game_die":"1f3b2","gb":"1f1ec-1f1e7","gem":"1f48e","gemini":"264a","ghost":"1f47b","gift":"1f381","gift_heart":"1f49d","girl":"1f467","globe_with_meridians":"1f310","goat":"1f410","golf":"26f3","grapes":"1f347","green_apple":"1f34f","green_book":"1f4d7","green_heart":"1f49a","grey_exclamation":"2755","grey_question":"2754","grimacing":"1f62c","grin":"1f601","grinning":"1f600","guardsman":"1f482","guitar":"1f3b8","gun":"1f52b","haircut":"1f487","hamburger":"1f354","hammer":"1f528","hamster":"1f439","hand":"270b","handbag":"1f45c","hankey":"1f4a9","hash":"23-20e3","hatched_chick":"1f425","hatching_chick":"1f423","headphones":"1f3a7","hear_no_evil":"1f649","heart":"2764","heart_decoration":"1f49f","heart_eyes":"1f60d","heart_eyes_cat":"1f63b","heartbeat":"1f493","heartpulse":"1f497","hearts":"2665","heavy_check_mark":"2714","heavy_division_sign":"2797","heavy_dollar_sign":"1f4b2","heavy_exclamation_mark":"2757","heavy_minus_sign":"2796","heavy_multiplication_x":"2716","heavy_plus_sign":"2795","helicopter":"1f681","herb":"1f33f","hibiscus":"1f33a","high_brightness":"1f506","high_heel":"1f460","hocho":"1f52a","honey_pot":"1f36f","honeybee":"1f41d","horse":"1f434","horse_racing":"1f3c7","hospital":"1f3e5","hotel":"1f3e8","hotsprings":"2668","hourglass":"231b","hourglass_flowing_sand":"23f3","house":"1f3e0","house_with_garden":"1f3e1","hushed":"1f62f","ice_cream":"1f368","icecream":"1f366","id":"1f194","ideograph_advantage":"1f250","imp":"1f47f","inbox_tray":"1f4e5","incoming_envelope":"1f4e8","information_desk_person":"1f481","information_source":"2139","innocent":"1f607","interrobang":"2049","iphone":"1f4f1","it":"1f1ee-1f1f9","izakaya_lantern":"1f3ee","jack_o_lantern":"1f383","japan":"1f5fe","japanese_castle":"1f3ef","japanese_goblin":"1f47a","japanese_ogre":"1f479","jeans":"1f456","joy":"1f602","joy_cat":"1f639","jp":"1f1ef-1f1f5","key":"1f511","keycap_ten":"1f51f","kimono":"1f458","kiss":"1f48b","kissing":"1f617","kissing_cat":"1f63d","kissing_closed_eyes":"1f61a","kissing_heart":"1f618","kissing_smiling_eyes":"1f619","knife":"1f52a","koala":"1f428","koko":"1f201","kr":"1f1f0-1f1f7","lantern":"1f3ee","large_blue_circle":"1f535","large_blue_diamond":"1f537","large_orange_diamond":"1f536","last_quarter_moon":"1f317","last_quarter_moon_with_face":"1f31c","laughing":"1f606","leaves":"1f343","ledger":"1f4d2","left_luggage":"1f6c5","left_right_arrow":"2194","leftwards_arrow_with_hook":"21a9","lemon":"1f34b","leo":"264c","leopard":"1f406","libra":"264e","light_rail":"1f688","link":"1f517","lips":"1f444","lipstick":"1f484","lock":"1f512","lock_with_ink_pen":"1f50f","lollipop":"1f36d","loop":"27bf","loud_sound":"1f50a","loudspeaker":"1f4e2","love_hotel":"1f3e9","love_letter":"1f48c","low_brightness":"1f505","m":"24c2","mag":"1f50d","mag_right":"1f50e","mahjong":"1f004","mailbox":"1f4eb","mailbox_closed":"1f4ea","mailbox_with_mail":"1f4ec","mailbox_with_no_mail":"1f4ed","man":"1f468","man_with_gua_pi_mao":"1f472","man_with_turban":"1f473","mans_shoe":"1f45e","maple_leaf":"1f341","mask":"1f637","massage":"1f486","meat_on_bone":"1f356","mega":"1f4e3","melon":"1f348","memo":"1f4dd","mens":"1f6b9","metro":"1f687","microphone":"1f3a4","microscope":"1f52c","milky_way":"1f30c","minibus":"1f690","minidisc":"1f4bd","mobile_phone_off":"1f4f4","money_with_wings":"1f4b8","moneybag":"1f4b0","monkey":"1f412","monkey_face":"1f435","monorail":"1f69d","moon":"1f314","mortar_board":"1f393","mount_fuji":"1f5fb","mountain_bicyclist":"1f6b5","mountain_cableway":"1f6a0","mountain_railway":"1f69e","mouse":"1f42d","mouse2":"1f401","movie_camera":"1f3a5","moyai":"1f5ff","muscle":"1f4aa","mushroom":"1f344","musical_keyboard":"1f3b9","musical_note":"1f3b5","musical_score":"1f3bc","mute":"1f507","nail_care":"1f485","name_badge":"1f4db","necktie":"1f454","negative_squared_cross_mark":"274e","neutral_face":"1f610","new":"1f195","new_moon":"1f311","new_moon_with_face":"1f31a","newspaper":"1f4f0","ng":"1f196","ng_woman":"1f645","night_with_stars":"1f303","nine":"39-20e3","no_bell":"1f515","no_bicycles":"1f6b3","no_entry":"26d4","no_entry_sign":"1f6ab","no_good":"1f645","no_mobile_phones":"1f4f5","no_mouth":"1f636","no_pedestrians":"1f6b7","no_smoking":"1f6ad","non-potable_water":"1f6b1","nose":"1f443","notebook":"1f4d3","notebook_with_decorative_cover":"1f4d4","notes":"1f3b6","nut_and_bolt":"1f529","o":"2b55","o2":"1f17e","ocean":"1f30a","octopus":"1f419","oden":"1f362","office":"1f3e2","ok":"1f197","ok_hand":"1f44c","ok_woman":"1f646","older_man":"1f474","older_woman":"1f475","on":"1f51b","oncoming_automobile":"1f698","oncoming_bus":"1f68d","oncoming_police_car":"1f694","oncoming_taxi":"1f696","one":"31-20e3","open_book":"1f4d6","open_file_folder":"1f4c2","open_hands":"1f450","open_mouth":"1f62e","ophiuchus":"26ce","orange_book":"1f4d9","outbox_tray":"1f4e4","ox":"1f402","package":"1f4e6","page_facing_up":"1f4c4","page_with_curl":"1f4c3","pager":"1f4df","palm_tree":"1f334","panda_face":"1f43c","paperclip":"1f4ce","parking":"1f17f","part_alternation_mark":"303d","partly_sunny":"26c5","passport_control":"1f6c2","paw_prints":"1f43e","peach":"1f351","pear":"1f350","pencil":"1f4dd","pencil2":"270f","penguin":"1f427","pensive":"1f614","performing_arts":"1f3ad","persevere":"1f623","person_frowning":"1f64d","person_with_blond_hair":"1f471","person_with_pouting_face":"1f64e","phone":"260e","pig":"1f437","pig2":"1f416","pig_nose":"1f43d","pill":"1f48a","pineapple":"1f34d","pisces":"2653","pizza":"1f355","point_down":"1f447","point_left":"1f448","point_right":"1f449","point_up":"261d","point_up_2":"1f446","police_car":"1f693","poodle":"1f429","poop":"1f4a9","post_office":"1f3e3","postal_horn":"1f4ef","postbox":"1f4ee","potable_water":"1f6b0","pouch":"1f45d","poultry_leg":"1f357","pound":"1f4b7","pout":"1f621","pouting_cat":"1f63e","pray":"1f64f","princess":"1f478","punch":"1f44a","purple_heart":"1f49c","purse":"1f45b","pushpin":"1f4cc","put_litter_in_its_place":"1f6ae","question":"2753","rabbit":"1f430","rabbit2":"1f407","racehorse":"1f40e","radio":"1f4fb","radio_button":"1f518","rage":"1f621","railway_car":"1f683","rainbow":"1f308","raised_hand":"270b","raised_hands":"1f64c","raising_hand":"1f64b","ram":"1f40f","ramen":"1f35c","rat":"1f400","recycle":"267b","red_car":"1f697","red_circle":"1f534","registered":"ae","relaxed":"263a","relieved":"1f60c","repeat":"1f501","repeat_one":"1f502","restroom":"1f6bb","revolving_hearts":"1f49e","rewind":"23ea","ribbon":"1f380","rice":"1f35a","rice_ball":"1f359","rice_cracker":"1f358","rice_scene":"1f391","ring":"1f48d","rocket":"1f680","roller_coaster":"1f3a2","rooster":"1f413","rose":"1f339","rotating_light":"1f6a8","round_pushpin":"1f4cd","rowboat":"1f6a3","ru":"1f1f7-1f1fa","rugby_football":"1f3c9","runner":"1f3c3","running":"1f3c3","running_shirt_with_sash":"1f3bd","sa":"1f202","sagittarius":"2650","sailboat":"26f5","sake":"1f376","sandal":"1f461","santa":"1f385","satellite":"1f4e1","satisfied":"1f606","saxophone":"1f3b7","school":"1f3eb","school_satchel":"1f392","scissors":"2702","scorpius":"264f","scream":"1f631","scream_cat":"1f640","scroll":"1f4dc","seat":"1f4ba","secret":"3299","see_no_evil":"1f648","seedling":"1f331","seven":"37-20e3","shaved_ice":"1f367","sheep":"1f411","shell":"1f41a","ship":"1f6a2","shirt":"1f455","shit":"1f4a9","shoe":"1f45e","shower":"1f6bf","signal_strength":"1f4f6","six":"36-20e3","six_pointed_star":"1f52f","ski":"1f3bf","skull":"1f480","sleeping":"1f634","sleepy":"1f62a","slot_machine":"1f3b0","small_blue_diamond":"1f539","small_orange_diamond":"1f538","small_red_triangle":"1f53a","small_red_triangle_down":"1f53b","smile":"1f604","smile_cat":"1f638","smiley":"1f603","smiley_cat":"1f63a","smiling_imp":"1f608","smirk":"1f60f","smirk_cat":"1f63c","smoking":"1f6ac","snail":"1f40c","snake":"1f40d","snowboarder":"1f3c2","snowflake":"2744","snowman":"26c4","sob":"1f62d","soccer":"26bd","soon":"1f51c","sos":"1f198","sound":"1f509","space_invader":"1f47e","spades":"2660","spaghetti":"1f35d","sparkle":"2747","sparkler":"1f387","sparkles":"2728","sparkling_heart":"1f496","speak_no_evil":"1f64a","speaker":"1f508","speech_balloon":"1f4ac","speedboat":"1f6a4","star":"2b50","star2":"1f31f","stars":"1f320","station":"1f689","statue_of_liberty":"1f5fd","steam_locomotive":"1f682","stew":"1f372","straight_ruler":"1f4cf","strawberry":"1f353","stuck_out_tongue":"1f61b","stuck_out_tongue_closed_eyes":"1f61d","stuck_out_tongue_winking_eye":"1f61c","sun_with_face":"1f31e","sunflower":"1f33b","sunglasses":"1f60e","sunny":"2600","sunrise":"1f305","sunrise_over_mountains":"1f304","surfer":"1f3c4","sushi":"1f363","suspension_railway":"1f69f","sweat":"1f613","sweat_drops":"1f4a6","sweat_smile":"1f605","sweet_potato":"1f360","swimmer":"1f3ca","symbols":"1f523","syringe":"1f489","tada":"1f389","tanabata_tree":"1f38b","tangerine":"1f34a","taurus":"2649","taxi":"1f695","tea":"1f375","telephone":"260e","telephone_receiver":"1f4de","telescope":"1f52d","tennis":"1f3be","tent":"26fa","thought_balloon":"1f4ad","three":"33-20e3","thumbsdown":"1f44e","thumbsup":"1f44d","ticket":"1f3ab","tiger":"1f42f","tiger2":"1f405","tired_face":"1f62b","tm":"2122","toilet":"1f6bd","tokyo_tower":"1f5fc","tomato":"1f345","tongue":"1f445","top":"1f51d","tophat":"1f3a9","tractor":"1f69c","traffic_light":"1f6a5","train":"1f68b","train2":"1f686","tram":"1f68a","triangular_flag_on_post":"1f6a9","triangular_ruler":"1f4d0","trident":"1f531","triumph":"1f624","trolleybus":"1f68e","trophy":"1f3c6","tropical_drink":"1f379","tropical_fish":"1f420","truck":"1f69a","trumpet":"1f3ba","tshirt":"1f455","tulip":"1f337","turtle":"1f422","tv":"1f4fa","twisted_rightwards_arrows":"1f500","two":"32-20e3","two_hearts":"1f495","two_men_holding_hands":"1f46c","two_women_holding_hands":"1f46d","u5272":"1f239","u5408":"1f234","u55b6":"1f23a","u6307":"1f22f","u6708":"1f237","u6709":"1f236","u6e80":"1f235","u7121":"1f21a","u7533":"1f238","u7981":"1f232","u7a7a":"1f233","uk":"1f1ec-1f1e7","umbrella":"2614","unamused":"1f612","underage":"1f51e","unlock":"1f513","up":"1f199","us":"1f1fa-1f1f8","v":"270c","vertical_traffic_light":"1f6a6","vhs":"1f4fc","vibration_mode":"1f4f3","video_camera":"1f4f9","video_game":"1f3ae","violin":"1f3bb","virgo":"264d","volcano":"1f30b","vs":"1f19a","walking":"1f6b6","waning_crescent_moon":"1f318","waning_gibbous_moon":"1f316","warning":"26a0","watch":"231a","water_buffalo":"1f403","watermelon":"1f349","wave":"1f44b","wavy_dash":"3030","waxing_crescent_moon":"1f312","waxing_gibbous_moon":"1f314","wc":"1f6be","weary":"1f629","wedding":"1f492","whale":"1f433","whale2":"1f40b","wheelchair":"267f","white_check_mark":"2705","white_circle":"26aa","white_flower":"1f4ae","white_large_square":"2b1c","white_medium_small_square":"25fd","white_medium_square":"25fb","white_small_square":"25ab","white_square_button":"1f533","wind_chime":"1f390","wine_glass":"1f377","wink":"1f609","wolf":"1f43a","woman":"1f469","womans_clothes":"1f45a","womans_hat":"1f452","womens":"1f6ba","worried":"1f61f","wrench":"1f527","x":"274c","yellow_heart":"1f49b","yen":"1f4b4","yum":"1f60b","zap":"26a1","zero":"30-20e3","zzz":"1f4a4","100":"1f4af","1234":"1f522"}; + + const emoji_keys = Object.keys(emoji_map); + + extend(ComposerBody.prototype, 'config', function(original, isInitialized) { + if (isInitialized) return; + + const composer = this; + const $container = $('
'); + const dropdown = new AutocompleteDropdown({items: []}); + const $textarea = this.$('textarea').wrap('
'); + let emojiStart; + let typed; + + const applySuggestion = function(replacement) { + const insert = replacement + ' '; + + const content = composer.content(); + composer.editor.setValue(content.substring(0, emojiStart - 1) + insert + content.substr($textarea[0].selectionStart)); + + const index = emojiStart - 1 + insert.length; + composer.editor.setSelectionRange(index, index); + + dropdown.hide(); + }; + + $textarea + .after($container) + .on('keydown', dropdown.navigate.bind(dropdown)) + .on('click keyup', function(e) { + // Up, down, enter, tab, escape, left, right. + if ([9, 13, 27, 40, 38, 37, 39].indexOf(e.which) !== -1) return; + + const cursor = this.selectionStart; + + if (this.selectionEnd - cursor > 0) return; + + // Search backwards from the cursor for an ':' symbol, without any + // intervening whitespace. If we find one, we will want to show the + // autocomplete dropdown! + const value = this.value; + emojiStart = 0; + for (let i = cursor - 1; i >= 0; i--) { + const character = value.substr(i, 1); + if (/\s/.test(character)) break; + if (character === ':') { + emojiStart = i + 1; + break; + } + } + + dropdown.hide(); + dropdown.active = false; + + if (emojiStart) { + typed = value.substring(emojiStart, cursor).toLowerCase(); + + const makeSuggestion = function(key) { + const code = ':' + key + ':'; + return ( + + ); + }; + + const buildSuggestions = () => { + const suggestions = []; + let similarEmoji = []; + + const fuzzyRegexp = function(str) { + const reEscape = new RegExp("\\(([" + ("+.*?[]{}()^$|\\".replace(/(.)/g, "\\$1")) + "])\\)", "g"); + return new RegExp("(.*)" + (str.toLowerCase().replace(/(.)/g, "($1)(.*?)")).replace(reEscape, "(\\$1)") + "$", "i"); + } + + const regTyped = fuzzyRegexp(typed); + for (var i=0, maxSuggestions = 7; i < emoji_keys.length && maxSuggestions > 0; i++) { + if(regTyped.test(emoji_keys[i])) { + --maxSuggestions; + similarEmoji.push(emoji_keys[i]); + } + } + + similarEmoji = similarEmoji.sort((a,b) => { + return a.length - b.length + }); + + for(let key of similarEmoji) { + suggestions.push(makeSuggestion(key)); + } + + if (suggestions.length) { + dropdown.props.items = suggestions; + m.render($container[0], dropdown.render()); + + dropdown.show(); + const coordinates = getCaretCoordinates(this, emojiStart); + const width = dropdown.$().outerWidth(); + const height = dropdown.$().outerHeight(); + const parent = dropdown.$().offsetParent(); + let left = coordinates.left; + let top = coordinates.top + 15; + if (top + height > parent.height()) { + top = coordinates.top - height - 15; + } + if (left + width > parent.width()) { + left = parent.width() - width; + } + dropdown.show(left, top); + } + }; + + buildSuggestions(); + + dropdown.setIndex(0); + dropdown.$().scrollTop(0); + dropdown.active = true; + } + }); + }); +} diff --git a/extensions/emoji/js/forum/src/components/AutocompleteDropdown.js b/extensions/emoji/js/forum/src/components/AutocompleteDropdown.js new file mode 100644 index 000000000..9682e51b1 --- /dev/null +++ b/extensions/emoji/js/forum/src/components/AutocompleteDropdown.js @@ -0,0 +1,95 @@ +import Component from 'flarum/Component'; + +export default class AutocompleteDropdown extends Component { + init() { + this.active = false; + this.index = 0; + this.keyWasJustPressed = false; + } + + view() { + return ( +
    + {this.props.items.map(item =>
  • {item}
  • )} +
+ ); + } + + show(left, top) { + this.$().show().css({ + left: left + 'px', + top: top + 'px' + }); + this.active = true; + } + + hide() { + this.$().hide(); + this.active = false; + } + + navigate(e) { + if (!this.active) return; + + switch (e.which) { + case 40: case 38: // Down/Up + this.keyWasJustPressed = true; + this.setIndex(this.index + (e.which === 40 ? 1 : -1), true); + clearTimeout(this.keyWasJustPressedTimeout); + this.keyWasJustPressedTimeout = setTimeout(() => this.keyWasJustPressed = false, 500); + e.preventDefault(); + break; + + case 13: case 9: // Enter/Tab + this.$('li').eq(this.index).find('button').click(); + e.preventDefault(); + break; + + case 27: // Escape + this.hide(); + e.stopPropagation(); + e.preventDefault(); + break; + + default: + // no default + } + } + + setIndex(index, scrollToItem) { + if (this.keyWasJustPressed && !scrollToItem) return; + + const $dropdown = this.$(); + const $items = $dropdown.find('li'); + let rangedIndex = index; + + if (rangedIndex < 0) { + rangedIndex = $items.length - 1; + } else if (rangedIndex >= $items.length) { + rangedIndex = 0; + } + + this.index = rangedIndex; + + const $item = $items.removeClass('active').eq(rangedIndex).addClass('active'); + + if (scrollToItem) { + const dropdownScroll = $dropdown.scrollTop(); + const dropdownTop = $dropdown.offset().top; + const dropdownBottom = dropdownTop + $dropdown.outerHeight(); + const itemTop = $item.offset().top; + const itemBottom = itemTop + $item.outerHeight(); + + let scrollTop; + if (itemTop < dropdownTop) { + scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10); + } else if (itemBottom > dropdownBottom) { + scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10); + } + + if (typeof scrollTop !== 'undefined') { + $dropdown.stop(true).animate({scrollTop}, 100); + } + } + } +} diff --git a/extensions/emoji/js/forum/src/main.js b/extensions/emoji/js/forum/src/main.js index 9e6d9fc6f..0355e24cc 100644 --- a/extensions/emoji/js/forum/src/main.js +++ b/extensions/emoji/js/forum/src/main.js @@ -1,7 +1,11 @@ -/*global twemoji, s9e*/ - import { override } from 'flarum/extend'; import app from 'flarum/app'; import Post from 'flarum/models/Post'; -app.initializers.add('flarum-emoji', () => {}); +import addComposerAutocomplete from 'flarum/emoji/addComposerAutocomplete'; + +app.initializers.add('flarum-emoji', () => { + // After typing ':' in the composer, show a dropdown suggesting a bunch of + // emoji that the user could use. + addComposerAutocomplete(); +}); diff --git a/extensions/emoji/less/forum/extension.less b/extensions/emoji/less/forum/extension.less index 236dc4157..689c80098 100644 --- a/extensions/emoji/less/forum/extension.less +++ b/extensions/emoji/less/forum/extension.less @@ -3,3 +3,38 @@ img.emoji { margin: 0 .05em 0 .1em; vertical-align: -0.3em; } + +.EmojiDropdown { + max-width: 500px; + max-height: 200px; + overflow: auto; + position: absolute; + margin: 5px 0 !important; + + > li > a { + white-space: normal; + border-bottom: 0; + } + + > li > a:hover { + background: none; + } + + .PostPreview { + color: @text-color; + font-weight: bold; + + .emoji { + margin-right: 5px; + } + } + .PostPreview-content { + overflow: hidden; + line-height: 1.7em; + display: block; + } +} + +.ComposerBody-emojiWrapper { + position: relative; +} From 31772b9a7620fa51d8e5b6b9118f6edc3a696a28 Mon Sep 17 00:00:00 2001 From: Sajjad Hasehmian Date: Tue, 2 Feb 2016 12:37:23 +0330 Subject: [PATCH 023/154] Use EmojiOne fixes flarum/core#744 --- extensions/emoji/js/forum/dist/extension.js | 17 +++++++++-------- .../js/forum/src/addComposerAutocomplete.js | 17 +++++++++-------- .../emoji/src/Listener/FormatEmoticons.php | 3 +-- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index e5387b3a2..c66696af3 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -140,9 +140,9 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru function addComposerAutocomplete() { - var emoji_map = { "-1": "1f44e", "+1": "1f44d", "8ball": "1f3b1", "a": "1f170", "ab": "1f18e", "abc": "1f524", "abcd": "1f521", "accept": "1f251", "aerial_tramway": "1f6a1", "airplane": "2708", "alarm_clock": "23f0", "alien": "1f47d", "ambulance": "1f691", "anchor": "2693", "angel": "1f47c", "anger": "1f4a2", "angry": "1f620", "anguished": "1f627", "ant": "1f41c", "apple": "1f34e", "aquarius": "2652", "aries": "2648", "arrow_backward": "25c0", "arrow_double_down": "23ec", "arrow_double_up": "23eb", "arrow_down": "2b07", "arrow_down_small": "1f53d", "arrow_forward": "25b6", "arrow_heading_down": "2935", "arrow_heading_up": "2934", "arrow_left": "2b05", "arrow_lower_left": "2199", "arrow_lower_right": "2198", "arrow_right": "27a1", "arrow_right_hook": "21aa", "arrow_up": "2b06", "arrow_up_down": "2195", "arrow_up_small": "1f53c", "arrow_upper_left": "2196", "arrow_upper_right": "2197", "arrows_clockwise": "1f503", "arrows_counterclockwise": "1f504", "art": "1f3a8", "articulated_lorry": "1f69b", "astonished": "1f632", "athletic_shoe": "1f45f", "atm": "1f3e7", "b": "1f171", "baby": "1f476", "baby_bottle": "1f37c", "baby_chick": "1f424", "baby_symbol": "1f6bc", "back": "1f519", "baggage_claim": "1f6c4", "balloon": "1f388", "ballot_box_with_check": "2611", "bamboo": "1f38d", "banana": "1f34c", "bangbang": "203c", "bank": "1f3e6", "bar_chart": "1f4ca", "barber": "1f488", "baseball": "26be", "basketball": "1f3c0", "bath": "1f6c0", "bathtub": "1f6c1", "battery": "1f50b", "bear": "1f43b", "bee": "1f41d", "beer": "1f37a", "beers": "1f37b", "beetle": "1f41e", "beginner": "1f530", "bell": "1f514", "bento": "1f371", "bicyclist": "1f6b4", "bike": "1f6b2", "bikini": "1f459", "bird": "1f426", "birthday": "1f382", "black_circle": "26ab", "black_joker": "1f0cf", "black_large_square": "2b1b", "black_medium_small_square": "25fe", "black_medium_square": "25fc", "black_nib": "2712", "black_small_square": "25aa", "black_square_button": "1f532", "blossom": "1f33c", "blowfish": "1f421", "blue_book": "1f4d8", "blue_car": "1f699", "blue_heart": "1f499", "blush": "1f60a", "boar": "1f417", "boat": "26f5", "bomb": "1f4a3", "book": "1f4d6", "bookmark": "1f516", "bookmark_tabs": "1f4d1", "books": "1f4da", "boom": "1f4a5", "boot": "1f462", "bouquet": "1f490", "bow": "1f647", "bowling": "1f3b3", "boy": "1f466", "bread": "1f35e", "bride_with_veil": "1f470", "bridge_at_night": "1f309", "briefcase": "1f4bc", "broken_heart": "1f494", "bug": "1f41b", "bulb": "1f4a1", "bullettrain_front": "1f685", "bullettrain_side": "1f684", "bus": "1f68c", "busstop": "1f68f", "bust_in_silhouette": "1f464", "busts_in_silhouette": "1f465", "cactus": "1f335", "cake": "1f370", "calendar": "1f4c6", "calling": "1f4f2", "camel": "1f42b", "camera": "1f4f7", "cancer": "264b", "candy": "1f36c", "capital_abcd": "1f520", "capricorn": "2651", "car": "1f697", "card_index": "1f4c7", "carousel_horse": "1f3a0", "cat": "1f431", "cat2": "1f408", "cd": "1f4bf", "chart": "1f4b9", "chart_with_downwards_trend": "1f4c9", "chart_with_upwards_trend": "1f4c8", "checkered_flag": "1f3c1", "cherries": "1f352", "cherry_blossom": "1f338", "chestnut": "1f330", "chicken": "1f414", "children_crossing": "1f6b8", "chocolate_bar": "1f36b", "christmas_tree": "1f384", "church": "26ea", "cinema": "1f3a6", "circus_tent": "1f3aa", "city_sunrise": "1f307", "city_sunset": "1f306", "cl": "1f191", "clap": "1f44f", "clapper": "1f3ac", "clipboard": "1f4cb", "clock1": "1f550", "clock10": "1f559", "clock1030": "1f565", "clock11": "1f55a", "clock1130": "1f566", "clock12": "1f55b", "clock1230": "1f567", "clock130": "1f55c", "clock2": "1f551", "clock230": "1f55d", "clock3": "1f552", "clock330": "1f55e", "clock4": "1f553", "clock430": "1f55f", "clock5": "1f554", "clock530": "1f560", "clock6": "1f555", "clock630": "1f561", "clock7": "1f556", "clock730": "1f562", "clock8": "1f557", "clock830": "1f563", "clock9": "1f558", "clock930": "1f564", "closed_book": "1f4d5", "closed_lock_with_key": "1f510", "closed_umbrella": "1f302", "cloud": "2601", "clubs": "2663", "cn": "1f1e8-1f1f3", "cocktail": "1f378", "coffee": "2615", "cold_sweat": "1f630", "collision": "1f4a5", "computer": "1f4bb", "confetti_ball": "1f38a", "confounded": "1f616", "confused": "1f615", "congratulations": "3297", "construction": "1f6a7", "construction_worker": "1f477", "convenience_store": "1f3ea", "cookie": "1f36a", "cool": "1f192", "cop": "1f46e", "copyright": "a9", "corn": "1f33d", "couple": "1f46b", "couple_with_heart": "1f491", "couplekiss": "1f48f", "cow": "1f42e", "cow2": "1f404", "credit_card": "1f4b3", "crescent_moon": "1f319", "crocodile": "1f40a", "crossed_flags": "1f38c", "crown": "1f451", "cry": "1f622", "crying_cat_face": "1f63f", "crystal_ball": "1f52e", "cupid": "1f498", "curly_loop": "27b0", "currency_exchange": "1f4b1", "curry": "1f35b", "custard": "1f36e", "customs": "1f6c3", "cyclone": "1f300", "dancer": "1f483", "dancers": "1f46f", "dango": "1f361", "dart": "1f3af", "dash": "1f4a8", "date": "1f4c5", "de": "1f1e9-1f1ea", "deciduous_tree": "1f333", "department_store": "1f3ec", "diamond_shape_with_a_dot_inside": "1f4a0", "diamonds": "2666", "disappointed": "1f61e", "disappointed_relieved": "1f625", "dizzy": "1f4ab", "dizzy_face": "1f635", "do_not_litter": "1f6af", "dog": "1f436", "dog2": "1f415", "dollar": "1f4b5", "dolls": "1f38e", "dolphin": "1f42c", "door": "1f6aa", "doughnut": "1f369", "dragon": "1f409", "dragon_face": "1f432", "dress": "1f457", "dromedary_camel": "1f42a", "droplet": "1f4a7", "dvd": "1f4c0", "e-mail": "1f4e7", "ear": "1f442", "ear_of_rice": "1f33e", "earth_africa": "1f30d", "earth_americas": "1f30e", "earth_asia": "1f30f", "egg": "1f373", "eggplant": "1f346", "eight": "38-20e3", "eight_pointed_black_star": "2734", "eight_spoked_asterisk": "2733", "electric_plug": "1f50c", "elephant": "1f418", "email": "2709", "end": "1f51a", "envelope": "2709", "envelope_with_arrow": "1f4e9", "es": "1f1ea-1f1f8", "euro": "1f4b6", "european_castle": "1f3f0", "european_post_office": "1f3e4", "evergreen_tree": "1f332", "exclamation": "2757", "expressionless": "1f611", "eyeglasses": "1f453", "eyes": "1f440", "facepunch": "1f44a", "factory": "1f3ed", "fallen_leaf": "1f342", "family": "1f46a", "fast_forward": "23e9", "fax": "1f4e0", "fearful": "1f628", "feet": "1f43e", "ferris_wheel": "1f3a1", "file_folder": "1f4c1", "fire": "1f525", "fire_engine": "1f692", "fireworks": "1f386", "first_quarter_moon": "1f313", "first_quarter_moon_with_face": "1f31b", "fish": "1f41f", "fish_cake": "1f365", "fishing_pole_and_fish": "1f3a3", "fist": "270a", "five": "35-20e3", "flags": "1f38f", "flashlight": "1f526", "flipper": "1f42c", "floppy_disk": "1f4be", "flower_playing_cards": "1f3b4", "flushed": "1f633", "foggy": "1f301", "football": "1f3c8", "footprints": "1f463", "fork_and_knife": "1f374", "fountain": "26f2", "four": "34-20e3", "four_leaf_clover": "1f340", "fr": "1f1eb-1f1f7", "free": "1f193", "fried_shrimp": "1f364", "fries": "1f35f", "frog": "1f438", "frowning": "1f626", "fuelpump": "26fd", "full_moon": "1f315", "full_moon_with_face": "1f31d", "game_die": "1f3b2", "gb": "1f1ec-1f1e7", "gem": "1f48e", "gemini": "264a", "ghost": "1f47b", "gift": "1f381", "gift_heart": "1f49d", "girl": "1f467", "globe_with_meridians": "1f310", "goat": "1f410", "golf": "26f3", "grapes": "1f347", "green_apple": "1f34f", "green_book": "1f4d7", "green_heart": "1f49a", "grey_exclamation": "2755", "grey_question": "2754", "grimacing": "1f62c", "grin": "1f601", "grinning": "1f600", "guardsman": "1f482", "guitar": "1f3b8", "gun": "1f52b", "haircut": "1f487", "hamburger": "1f354", "hammer": "1f528", "hamster": "1f439", "hand": "270b", "handbag": "1f45c", "hankey": "1f4a9", "hash": "23-20e3", "hatched_chick": "1f425", "hatching_chick": "1f423", "headphones": "1f3a7", "hear_no_evil": "1f649", "heart": "2764", "heart_decoration": "1f49f", "heart_eyes": "1f60d", "heart_eyes_cat": "1f63b", "heartbeat": "1f493", "heartpulse": "1f497", "hearts": "2665", "heavy_check_mark": "2714", "heavy_division_sign": "2797", "heavy_dollar_sign": "1f4b2", "heavy_exclamation_mark": "2757", "heavy_minus_sign": "2796", "heavy_multiplication_x": "2716", "heavy_plus_sign": "2795", "helicopter": "1f681", "herb": "1f33f", "hibiscus": "1f33a", "high_brightness": "1f506", "high_heel": "1f460", "hocho": "1f52a", "honey_pot": "1f36f", "honeybee": "1f41d", "horse": "1f434", "horse_racing": "1f3c7", "hospital": "1f3e5", "hotel": "1f3e8", "hotsprings": "2668", "hourglass": "231b", "hourglass_flowing_sand": "23f3", "house": "1f3e0", "house_with_garden": "1f3e1", "hushed": "1f62f", "ice_cream": "1f368", "icecream": "1f366", "id": "1f194", "ideograph_advantage": "1f250", "imp": "1f47f", "inbox_tray": "1f4e5", "incoming_envelope": "1f4e8", "information_desk_person": "1f481", "information_source": "2139", "innocent": "1f607", "interrobang": "2049", "iphone": "1f4f1", "it": "1f1ee-1f1f9", "izakaya_lantern": "1f3ee", "jack_o_lantern": "1f383", "japan": "1f5fe", "japanese_castle": "1f3ef", "japanese_goblin": "1f47a", "japanese_ogre": "1f479", "jeans": "1f456", "joy": "1f602", "joy_cat": "1f639", "jp": "1f1ef-1f1f5", "key": "1f511", "keycap_ten": "1f51f", "kimono": "1f458", "kiss": "1f48b", "kissing": "1f617", "kissing_cat": "1f63d", "kissing_closed_eyes": "1f61a", "kissing_heart": "1f618", "kissing_smiling_eyes": "1f619", "knife": "1f52a", "koala": "1f428", "koko": "1f201", "kr": "1f1f0-1f1f7", "lantern": "1f3ee", "large_blue_circle": "1f535", "large_blue_diamond": "1f537", "large_orange_diamond": "1f536", "last_quarter_moon": "1f317", "last_quarter_moon_with_face": "1f31c", "laughing": "1f606", "leaves": "1f343", "ledger": "1f4d2", "left_luggage": "1f6c5", "left_right_arrow": "2194", "leftwards_arrow_with_hook": "21a9", "lemon": "1f34b", "leo": "264c", "leopard": "1f406", "libra": "264e", "light_rail": "1f688", "link": "1f517", "lips": "1f444", "lipstick": "1f484", "lock": "1f512", "lock_with_ink_pen": "1f50f", "lollipop": "1f36d", "loop": "27bf", "loud_sound": "1f50a", "loudspeaker": "1f4e2", "love_hotel": "1f3e9", "love_letter": "1f48c", "low_brightness": "1f505", "m": "24c2", "mag": "1f50d", "mag_right": "1f50e", "mahjong": "1f004", "mailbox": "1f4eb", "mailbox_closed": "1f4ea", "mailbox_with_mail": "1f4ec", "mailbox_with_no_mail": "1f4ed", "man": "1f468", "man_with_gua_pi_mao": "1f472", "man_with_turban": "1f473", "mans_shoe": "1f45e", "maple_leaf": "1f341", "mask": "1f637", "massage": "1f486", "meat_on_bone": "1f356", "mega": "1f4e3", "melon": "1f348", "memo": "1f4dd", "mens": "1f6b9", "metro": "1f687", "microphone": "1f3a4", "microscope": "1f52c", "milky_way": "1f30c", "minibus": "1f690", "minidisc": "1f4bd", "mobile_phone_off": "1f4f4", "money_with_wings": "1f4b8", "moneybag": "1f4b0", "monkey": "1f412", "monkey_face": "1f435", "monorail": "1f69d", "moon": "1f314", "mortar_board": "1f393", "mount_fuji": "1f5fb", "mountain_bicyclist": "1f6b5", "mountain_cableway": "1f6a0", "mountain_railway": "1f69e", "mouse": "1f42d", "mouse2": "1f401", "movie_camera": "1f3a5", "moyai": "1f5ff", "muscle": "1f4aa", "mushroom": "1f344", "musical_keyboard": "1f3b9", "musical_note": "1f3b5", "musical_score": "1f3bc", "mute": "1f507", "nail_care": "1f485", "name_badge": "1f4db", "necktie": "1f454", "negative_squared_cross_mark": "274e", "neutral_face": "1f610", "new": "1f195", "new_moon": "1f311", "new_moon_with_face": "1f31a", "newspaper": "1f4f0", "ng": "1f196", "ng_woman": "1f645", "night_with_stars": "1f303", "nine": "39-20e3", "no_bell": "1f515", "no_bicycles": "1f6b3", "no_entry": "26d4", "no_entry_sign": "1f6ab", "no_good": "1f645", "no_mobile_phones": "1f4f5", "no_mouth": "1f636", "no_pedestrians": "1f6b7", "no_smoking": "1f6ad", "non-potable_water": "1f6b1", "nose": "1f443", "notebook": "1f4d3", "notebook_with_decorative_cover": "1f4d4", "notes": "1f3b6", "nut_and_bolt": "1f529", "o": "2b55", "o2": "1f17e", "ocean": "1f30a", "octopus": "1f419", "oden": "1f362", "office": "1f3e2", "ok": "1f197", "ok_hand": "1f44c", "ok_woman": "1f646", "older_man": "1f474", "older_woman": "1f475", "on": "1f51b", "oncoming_automobile": "1f698", "oncoming_bus": "1f68d", "oncoming_police_car": "1f694", "oncoming_taxi": "1f696", "one": "31-20e3", "open_book": "1f4d6", "open_file_folder": "1f4c2", "open_hands": "1f450", "open_mouth": "1f62e", "ophiuchus": "26ce", "orange_book": "1f4d9", "outbox_tray": "1f4e4", "ox": "1f402", "package": "1f4e6", "page_facing_up": "1f4c4", "page_with_curl": "1f4c3", "pager": "1f4df", "palm_tree": "1f334", "panda_face": "1f43c", "paperclip": "1f4ce", "parking": "1f17f", "part_alternation_mark": "303d", "partly_sunny": "26c5", "passport_control": "1f6c2", "paw_prints": "1f43e", "peach": "1f351", "pear": "1f350", "pencil": "1f4dd", "pencil2": "270f", "penguin": "1f427", "pensive": "1f614", "performing_arts": "1f3ad", "persevere": "1f623", "person_frowning": "1f64d", "person_with_blond_hair": "1f471", "person_with_pouting_face": "1f64e", "phone": "260e", "pig": "1f437", "pig2": "1f416", "pig_nose": "1f43d", "pill": "1f48a", "pineapple": "1f34d", "pisces": "2653", "pizza": "1f355", "point_down": "1f447", "point_left": "1f448", "point_right": "1f449", "point_up": "261d", "point_up_2": "1f446", "police_car": "1f693", "poodle": "1f429", "poop": "1f4a9", "post_office": "1f3e3", "postal_horn": "1f4ef", "postbox": "1f4ee", "potable_water": "1f6b0", "pouch": "1f45d", "poultry_leg": "1f357", "pound": "1f4b7", "pout": "1f621", "pouting_cat": "1f63e", "pray": "1f64f", "princess": "1f478", "punch": "1f44a", "purple_heart": "1f49c", "purse": "1f45b", "pushpin": "1f4cc", "put_litter_in_its_place": "1f6ae", "question": "2753", "rabbit": "1f430", "rabbit2": "1f407", "racehorse": "1f40e", "radio": "1f4fb", "radio_button": "1f518", "rage": "1f621", "railway_car": "1f683", "rainbow": "1f308", "raised_hand": "270b", "raised_hands": "1f64c", "raising_hand": "1f64b", "ram": "1f40f", "ramen": "1f35c", "rat": "1f400", "recycle": "267b", "red_car": "1f697", "red_circle": "1f534", "registered": "ae", "relaxed": "263a", "relieved": "1f60c", "repeat": "1f501", "repeat_one": "1f502", "restroom": "1f6bb", "revolving_hearts": "1f49e", "rewind": "23ea", "ribbon": "1f380", "rice": "1f35a", "rice_ball": "1f359", "rice_cracker": "1f358", "rice_scene": "1f391", "ring": "1f48d", "rocket": "1f680", "roller_coaster": "1f3a2", "rooster": "1f413", "rose": "1f339", "rotating_light": "1f6a8", "round_pushpin": "1f4cd", "rowboat": "1f6a3", "ru": "1f1f7-1f1fa", "rugby_football": "1f3c9", "runner": "1f3c3", "running": "1f3c3", "running_shirt_with_sash": "1f3bd", "sa": "1f202", "sagittarius": "2650", "sailboat": "26f5", "sake": "1f376", "sandal": "1f461", "santa": "1f385", "satellite": "1f4e1", "satisfied": "1f606", "saxophone": "1f3b7", "school": "1f3eb", "school_satchel": "1f392", "scissors": "2702", "scorpius": "264f", "scream": "1f631", "scream_cat": "1f640", "scroll": "1f4dc", "seat": "1f4ba", "secret": "3299", "see_no_evil": "1f648", "seedling": "1f331", "seven": "37-20e3", "shaved_ice": "1f367", "sheep": "1f411", "shell": "1f41a", "ship": "1f6a2", "shirt": "1f455", "shit": "1f4a9", "shoe": "1f45e", "shower": "1f6bf", "signal_strength": "1f4f6", "six": "36-20e3", "six_pointed_star": "1f52f", "ski": "1f3bf", "skull": "1f480", "sleeping": "1f634", "sleepy": "1f62a", "slot_machine": "1f3b0", "small_blue_diamond": "1f539", "small_orange_diamond": "1f538", "small_red_triangle": "1f53a", "small_red_triangle_down": "1f53b", "smile": "1f604", "smile_cat": "1f638", "smiley": "1f603", "smiley_cat": "1f63a", "smiling_imp": "1f608", "smirk": "1f60f", "smirk_cat": "1f63c", "smoking": "1f6ac", "snail": "1f40c", "snake": "1f40d", "snowboarder": "1f3c2", "snowflake": "2744", "snowman": "26c4", "sob": "1f62d", "soccer": "26bd", "soon": "1f51c", "sos": "1f198", "sound": "1f509", "space_invader": "1f47e", "spades": "2660", "spaghetti": "1f35d", "sparkle": "2747", "sparkler": "1f387", "sparkles": "2728", "sparkling_heart": "1f496", "speak_no_evil": "1f64a", "speaker": "1f508", "speech_balloon": "1f4ac", "speedboat": "1f6a4", "star": "2b50", "star2": "1f31f", "stars": "1f320", "station": "1f689", "statue_of_liberty": "1f5fd", "steam_locomotive": "1f682", "stew": "1f372", "straight_ruler": "1f4cf", "strawberry": "1f353", "stuck_out_tongue": "1f61b", "stuck_out_tongue_closed_eyes": "1f61d", "stuck_out_tongue_winking_eye": "1f61c", "sun_with_face": "1f31e", "sunflower": "1f33b", "sunglasses": "1f60e", "sunny": "2600", "sunrise": "1f305", "sunrise_over_mountains": "1f304", "surfer": "1f3c4", "sushi": "1f363", "suspension_railway": "1f69f", "sweat": "1f613", "sweat_drops": "1f4a6", "sweat_smile": "1f605", "sweet_potato": "1f360", "swimmer": "1f3ca", "symbols": "1f523", "syringe": "1f489", "tada": "1f389", "tanabata_tree": "1f38b", "tangerine": "1f34a", "taurus": "2649", "taxi": "1f695", "tea": "1f375", "telephone": "260e", "telephone_receiver": "1f4de", "telescope": "1f52d", "tennis": "1f3be", "tent": "26fa", "thought_balloon": "1f4ad", "three": "33-20e3", "thumbsdown": "1f44e", "thumbsup": "1f44d", "ticket": "1f3ab", "tiger": "1f42f", "tiger2": "1f405", "tired_face": "1f62b", "tm": "2122", "toilet": "1f6bd", "tokyo_tower": "1f5fc", "tomato": "1f345", "tongue": "1f445", "top": "1f51d", "tophat": "1f3a9", "tractor": "1f69c", "traffic_light": "1f6a5", "train": "1f68b", "train2": "1f686", "tram": "1f68a", "triangular_flag_on_post": "1f6a9", "triangular_ruler": "1f4d0", "trident": "1f531", "triumph": "1f624", "trolleybus": "1f68e", "trophy": "1f3c6", "tropical_drink": "1f379", "tropical_fish": "1f420", "truck": "1f69a", "trumpet": "1f3ba", "tshirt": "1f455", "tulip": "1f337", "turtle": "1f422", "tv": "1f4fa", "twisted_rightwards_arrows": "1f500", "two": "32-20e3", "two_hearts": "1f495", "two_men_holding_hands": "1f46c", "two_women_holding_hands": "1f46d", "u5272": "1f239", "u5408": "1f234", "u55b6": "1f23a", "u6307": "1f22f", "u6708": "1f237", "u6709": "1f236", "u6e80": "1f235", "u7121": "1f21a", "u7533": "1f238", "u7981": "1f232", "u7a7a": "1f233", "uk": "1f1ec-1f1e7", "umbrella": "2614", "unamused": "1f612", "underage": "1f51e", "unlock": "1f513", "up": "1f199", "us": "1f1fa-1f1f8", "v": "270c", "vertical_traffic_light": "1f6a6", "vhs": "1f4fc", "vibration_mode": "1f4f3", "video_camera": "1f4f9", "video_game": "1f3ae", "violin": "1f3bb", "virgo": "264d", "volcano": "1f30b", "vs": "1f19a", "walking": "1f6b6", "waning_crescent_moon": "1f318", "waning_gibbous_moon": "1f316", "warning": "26a0", "watch": "231a", "water_buffalo": "1f403", "watermelon": "1f349", "wave": "1f44b", "wavy_dash": "3030", "waxing_crescent_moon": "1f312", "waxing_gibbous_moon": "1f314", "wc": "1f6be", "weary": "1f629", "wedding": "1f492", "whale": "1f433", "whale2": "1f40b", "wheelchair": "267f", "white_check_mark": "2705", "white_circle": "26aa", "white_flower": "1f4ae", "white_large_square": "2b1c", "white_medium_small_square": "25fd", "white_medium_square": "25fb", "white_small_square": "25ab", "white_square_button": "1f533", "wind_chime": "1f390", "wine_glass": "1f377", "wink": "1f609", "wolf": "1f43a", "woman": "1f469", "womans_clothes": "1f45a", "womans_hat": "1f452", "womens": "1f6ba", "worried": "1f61f", "wrench": "1f527", "x": "274c", "yellow_heart": "1f49b", "yen": "1f4b4", "yum": "1f60b", "zap": "26a1", "zero": "30-20e3", "zzz": "1f4a4", "100": "1f4af", "1234": "1f522" }; + var emojiMap = { "-1": "1f44e", "+1": "1f44d", "8ball": "1f3b1", "a": "1f170", "ab": "1f18e", "abc": "1f524", "abcd": "1f521", "accept": "1f251", "aerial_tramway": "1f6a1", "airplane": "2708", "alarm_clock": "23f0", "alien": "1f47d", "ambulance": "1f691", "anchor": "2693", "angel": "1f47c", "anger": "1f4a2", "angry": "1f620", "anguished": "1f627", "ant": "1f41c", "apple": "1f34e", "aquarius": "2652", "aries": "2648", "arrow_backward": "25c0", "arrow_double_down": "23ec", "arrow_double_up": "23eb", "arrow_down": "2b07", "arrow_down_small": "1f53d", "arrow_forward": "25b6", "arrow_heading_down": "2935", "arrow_heading_up": "2934", "arrow_left": "2b05", "arrow_lower_left": "2199", "arrow_lower_right": "2198", "arrow_right": "27a1", "arrow_right_hook": "21aa", "arrow_up": "2b06", "arrow_up_down": "2195", "arrow_up_small": "1f53c", "arrow_upper_left": "2196", "arrow_upper_right": "2197", "arrows_clockwise": "1f503", "arrows_counterclockwise": "1f504", "art": "1f3a8", "articulated_lorry": "1f69b", "astonished": "1f632", "athletic_shoe": "1f45f", "atm": "1f3e7", "b": "1f171", "baby": "1f476", "baby_bottle": "1f37c", "baby_chick": "1f424", "baby_symbol": "1f6bc", "back": "1f519", "baggage_claim": "1f6c4", "balloon": "1f388", "ballot_box_with_check": "2611", "bamboo": "1f38d", "banana": "1f34c", "bangbang": "203c", "bank": "1f3e6", "bar_chart": "1f4ca", "barber": "1f488", "baseball": "26be", "basketball": "1f3c0", "bath": "1f6c0", "bathtub": "1f6c1", "battery": "1f50b", "bear": "1f43b", "bee": "1f41d", "beer": "1f37a", "beers": "1f37b", "beetle": "1f41e", "beginner": "1f530", "bell": "1f514", "bento": "1f371", "bicyclist": "1f6b4", "bike": "1f6b2", "bikini": "1f459", "bird": "1f426", "birthday": "1f382", "black_circle": "26ab", "black_joker": "1f0cf", "black_large_square": "2b1b", "black_medium_small_square": "25fe", "black_medium_square": "25fc", "black_nib": "2712", "black_small_square": "25aa", "black_square_button": "1f532", "blossom": "1f33c", "blowfish": "1f421", "blue_book": "1f4d8", "blue_car": "1f699", "blue_heart": "1f499", "blush": "1f60a", "boar": "1f417", "boat": "26f5", "bomb": "1f4a3", "book": "1f4d6", "bookmark": "1f516", "bookmark_tabs": "1f4d1", "books": "1f4da", "boom": "1f4a5", "boot": "1f462", "bouquet": "1f490", "bow": "1f647", "bowling": "1f3b3", "boy": "1f466", "bread": "1f35e", "bride_with_veil": "1f470", "bridge_at_night": "1f309", "briefcase": "1f4bc", "broken_heart": "1f494", "bug": "1f41b", "bulb": "1f4a1", "bullettrain_front": "1f685", "bullettrain_side": "1f684", "bus": "1f68c", "busstop": "1f68f", "bust_in_silhouette": "1f464", "busts_in_silhouette": "1f465", "cactus": "1f335", "cake": "1f370", "calendar": "1f4c6", "calling": "1f4f2", "camel": "1f42b", "camera": "1f4f7", "cancer": "264b", "candy": "1f36c", "capital_abcd": "1f520", "capricorn": "2651", "car": "1f697", "card_index": "1f4c7", "carousel_horse": "1f3a0", "cat": "1f431", "cat2": "1f408", "cd": "1f4bf", "chart": "1f4b9", "chart_with_downwards_trend": "1f4c9", "chart_with_upwards_trend": "1f4c8", "checkered_flag": "1f3c1", "cherries": "1f352", "cherry_blossom": "1f338", "chestnut": "1f330", "chicken": "1f414", "children_crossing": "1f6b8", "chocolate_bar": "1f36b", "christmas_tree": "1f384", "church": "26ea", "cinema": "1f3a6", "circus_tent": "1f3aa", "city_sunrise": "1f307", "city_sunset": "1f306", "cl": "1f191", "clap": "1f44f", "clapper": "1f3ac", "clipboard": "1f4cb", "clock1": "1f550", "clock10": "1f559", "clock1030": "1f565", "clock11": "1f55a", "clock1130": "1f566", "clock12": "1f55b", "clock1230": "1f567", "clock130": "1f55c", "clock2": "1f551", "clock230": "1f55d", "clock3": "1f552", "clock330": "1f55e", "clock4": "1f553", "clock430": "1f55f", "clock5": "1f554", "clock530": "1f560", "clock6": "1f555", "clock630": "1f561", "clock7": "1f556", "clock730": "1f562", "clock8": "1f557", "clock830": "1f563", "clock9": "1f558", "clock930": "1f564", "closed_book": "1f4d5", "closed_lock_with_key": "1f510", "closed_umbrella": "1f302", "cloud": "2601", "clubs": "2663", "cn": "1f1e8-1f1f3", "cocktail": "1f378", "coffee": "2615", "cold_sweat": "1f630", "collision": "1f4a5", "computer": "1f4bb", "confetti_ball": "1f38a", "confounded": "1f616", "confused": "1f615", "congratulations": "3297", "construction": "1f6a7", "construction_worker": "1f477", "convenience_store": "1f3ea", "cookie": "1f36a", "cool": "1f192", "cop": "1f46e", "copyright": "a9", "corn": "1f33d", "couple": "1f46b", "couple_with_heart": "1f491", "couplekiss": "1f48f", "cow": "1f42e", "cow2": "1f404", "credit_card": "1f4b3", "crescent_moon": "1f319", "crocodile": "1f40a", "crossed_flags": "1f38c", "crown": "1f451", "cry": "1f622", "crying_cat_face": "1f63f", "crystal_ball": "1f52e", "cupid": "1f498", "curly_loop": "27b0", "currency_exchange": "1f4b1", "curry": "1f35b", "custard": "1f36e", "customs": "1f6c3", "cyclone": "1f300", "dancer": "1f483", "dancers": "1f46f", "dango": "1f361", "dart": "1f3af", "dash": "1f4a8", "date": "1f4c5", "de": "1f1e9-1f1ea", "deciduous_tree": "1f333", "department_store": "1f3ec", "diamond_shape_with_a_dot_inside": "1f4a0", "diamonds": "2666", "disappointed": "1f61e", "disappointed_relieved": "1f625", "dizzy": "1f4ab", "dizzy_face": "1f635", "do_not_litter": "1f6af", "dog": "1f436", "dog2": "1f415", "dollar": "1f4b5", "dolls": "1f38e", "dolphin": "1f42c", "door": "1f6aa", "doughnut": "1f369", "dragon": "1f409", "dragon_face": "1f432", "dress": "1f457", "dromedary_camel": "1f42a", "droplet": "1f4a7", "dvd": "1f4c0", "e-mail": "1f4e7", "ear": "1f442", "ear_of_rice": "1f33e", "earth_africa": "1f30d", "earth_americas": "1f30e", "earth_asia": "1f30f", "egg": "1f373", "eggplant": "1f346", "eight": "38-20e3", "eight_pointed_black_star": "2734", "eight_spoked_asterisk": "2733", "electric_plug": "1f50c", "elephant": "1f418", "email": "2709", "end": "1f51a", "envelope": "2709", "envelope_with_arrow": "1f4e9", "es": "1f1ea-1f1f8", "euro": "1f4b6", "european_castle": "1f3f0", "european_post_office": "1f3e4", "evergreen_tree": "1f332", "exclamation": "2757", "expressionless": "1f611", "eyeglasses": "1f453", "eyes": "1f440", "facepunch": "1f44a", "factory": "1f3ed", "fallen_leaf": "1f342", "family": "1f46a", "fast_forward": "23e9", "fax": "1f4e0", "fearful": "1f628", "feet": "1f43e", "ferris_wheel": "1f3a1", "file_folder": "1f4c1", "fire": "1f525", "fire_engine": "1f692", "fireworks": "1f386", "first_quarter_moon": "1f313", "first_quarter_moon_with_face": "1f31b", "fish": "1f41f", "fish_cake": "1f365", "fishing_pole_and_fish": "1f3a3", "fist": "270a", "five": "35-20e3", "flags": "1f38f", "flashlight": "1f526", "flipper": "1f42c", "floppy_disk": "1f4be", "flower_playing_cards": "1f3b4", "flushed": "1f633", "foggy": "1f301", "football": "1f3c8", "footprints": "1f463", "fork_and_knife": "1f374", "fountain": "26f2", "four": "34-20e3", "four_leaf_clover": "1f340", "fr": "1f1eb-1f1f7", "free": "1f193", "fried_shrimp": "1f364", "fries": "1f35f", "frog": "1f438", "frowning": "1f626", "fuelpump": "26fd", "full_moon": "1f315", "full_moon_with_face": "1f31d", "game_die": "1f3b2", "gb": "1f1ec-1f1e7", "gem": "1f48e", "gemini": "264a", "ghost": "1f47b", "gift": "1f381", "gift_heart": "1f49d", "girl": "1f467", "globe_with_meridians": "1f310", "goat": "1f410", "golf": "26f3", "grapes": "1f347", "green_apple": "1f34f", "green_book": "1f4d7", "green_heart": "1f49a", "grey_exclamation": "2755", "grey_question": "2754", "grimacing": "1f62c", "grin": "1f601", "grinning": "1f600", "guardsman": "1f482", "guitar": "1f3b8", "gun": "1f52b", "haircut": "1f487", "hamburger": "1f354", "hammer": "1f528", "hamster": "1f439", "hand": "270b", "handbag": "1f45c", "hankey": "1f4a9", "hash": "23-20e3", "hatched_chick": "1f425", "hatching_chick": "1f423", "headphones": "1f3a7", "hear_no_evil": "1f649", "heart": "2764", "heart_decoration": "1f49f", "heart_eyes": "1f60d", "heart_eyes_cat": "1f63b", "heartbeat": "1f493", "heartpulse": "1f497", "hearts": "2665", "heavy_check_mark": "2714", "heavy_division_sign": "2797", "heavy_dollar_sign": "1f4b2", "heavy_exclamation_mark": "2757", "heavy_minus_sign": "2796", "heavy_multiplication_x": "2716", "heavy_plus_sign": "2795", "helicopter": "1f681", "herb": "1f33f", "hibiscus": "1f33a", "high_brightness": "1f506", "high_heel": "1f460", "hocho": "1f52a", "honey_pot": "1f36f", "honeybee": "1f41d", "horse": "1f434", "horse_racing": "1f3c7", "hospital": "1f3e5", "hotel": "1f3e8", "hotsprings": "2668", "hourglass": "231b", "hourglass_flowing_sand": "23f3", "house": "1f3e0", "house_with_garden": "1f3e1", "hushed": "1f62f", "ice_cream": "1f368", "icecream": "1f366", "id": "1f194", "ideograph_advantage": "1f250", "imp": "1f47f", "inbox_tray": "1f4e5", "incoming_envelope": "1f4e8", "information_desk_person": "1f481", "information_source": "2139", "innocent": "1f607", "interrobang": "2049", "iphone": "1f4f1", "it": "1f1ee-1f1f9", "izakaya_lantern": "1f3ee", "jack_o_lantern": "1f383", "japan": "1f5fe", "japanese_castle": "1f3ef", "japanese_goblin": "1f47a", "japanese_ogre": "1f479", "jeans": "1f456", "joy": "1f602", "joy_cat": "1f639", "jp": "1f1ef-1f1f5", "key": "1f511", "keycap_ten": "1f51f", "kimono": "1f458", "kiss": "1f48b", "kissing": "1f617", "kissing_cat": "1f63d", "kissing_closed_eyes": "1f61a", "kissing_heart": "1f618", "kissing_smiling_eyes": "1f619", "knife": "1f52a", "koala": "1f428", "koko": "1f201", "kr": "1f1f0-1f1f7", "lantern": "1f3ee", "large_blue_circle": "1f535", "large_blue_diamond": "1f537", "large_orange_diamond": "1f536", "last_quarter_moon": "1f317", "last_quarter_moon_with_face": "1f31c", "laughing": "1f606", "leaves": "1f343", "ledger": "1f4d2", "left_luggage": "1f6c5", "left_right_arrow": "2194", "leftwards_arrow_with_hook": "21a9", "lemon": "1f34b", "leo": "264c", "leopard": "1f406", "libra": "264e", "light_rail": "1f688", "link": "1f517", "lips": "1f444", "lipstick": "1f484", "lock": "1f512", "lock_with_ink_pen": "1f50f", "lollipop": "1f36d", "loop": "27bf", "loud_sound": "1f50a", "loudspeaker": "1f4e2", "love_hotel": "1f3e9", "love_letter": "1f48c", "low_brightness": "1f505", "m": "24c2", "mag": "1f50d", "mag_right": "1f50e", "mahjong": "1f004", "mailbox": "1f4eb", "mailbox_closed": "1f4ea", "mailbox_with_mail": "1f4ec", "mailbox_with_no_mail": "1f4ed", "man": "1f468", "man_with_gua_pi_mao": "1f472", "man_with_turban": "1f473", "mans_shoe": "1f45e", "maple_leaf": "1f341", "mask": "1f637", "massage": "1f486", "meat_on_bone": "1f356", "mega": "1f4e3", "melon": "1f348", "memo": "1f4dd", "mens": "1f6b9", "metro": "1f687", "microphone": "1f3a4", "microscope": "1f52c", "milky_way": "1f30c", "minibus": "1f690", "minidisc": "1f4bd", "mobile_phone_off": "1f4f4", "money_with_wings": "1f4b8", "moneybag": "1f4b0", "monkey": "1f412", "monkey_face": "1f435", "monorail": "1f69d", "moon": "1f314", "mortar_board": "1f393", "mount_fuji": "1f5fb", "mountain_bicyclist": "1f6b5", "mountain_cableway": "1f6a0", "mountain_railway": "1f69e", "mouse": "1f42d", "mouse2": "1f401", "movie_camera": "1f3a5", "moyai": "1f5ff", "muscle": "1f4aa", "mushroom": "1f344", "musical_keyboard": "1f3b9", "musical_note": "1f3b5", "musical_score": "1f3bc", "mute": "1f507", "nail_care": "1f485", "name_badge": "1f4db", "necktie": "1f454", "negative_squared_cross_mark": "274e", "neutral_face": "1f610", "new": "1f195", "new_moon": "1f311", "new_moon_with_face": "1f31a", "newspaper": "1f4f0", "ng": "1f196", "ng_woman": "1f645", "night_with_stars": "1f303", "nine": "39-20e3", "no_bell": "1f515", "no_bicycles": "1f6b3", "no_entry": "26d4", "no_entry_sign": "1f6ab", "no_good": "1f645", "no_mobile_phones": "1f4f5", "no_mouth": "1f636", "no_pedestrians": "1f6b7", "no_smoking": "1f6ad", "non-potable_water": "1f6b1", "nose": "1f443", "notebook": "1f4d3", "notebook_with_decorative_cover": "1f4d4", "notes": "1f3b6", "nut_and_bolt": "1f529", "o": "2b55", "o2": "1f17e", "ocean": "1f30a", "octopus": "1f419", "oden": "1f362", "office": "1f3e2", "ok": "1f197", "ok_hand": "1f44c", "ok_woman": "1f646", "older_man": "1f474", "older_woman": "1f475", "on": "1f51b", "oncoming_automobile": "1f698", "oncoming_bus": "1f68d", "oncoming_police_car": "1f694", "oncoming_taxi": "1f696", "one": "31-20e3", "open_book": "1f4d6", "open_file_folder": "1f4c2", "open_hands": "1f450", "open_mouth": "1f62e", "ophiuchus": "26ce", "orange_book": "1f4d9", "outbox_tray": "1f4e4", "ox": "1f402", "package": "1f4e6", "page_facing_up": "1f4c4", "page_with_curl": "1f4c3", "pager": "1f4df", "palm_tree": "1f334", "panda_face": "1f43c", "paperclip": "1f4ce", "parking": "1f17f", "part_alternation_mark": "303d", "partly_sunny": "26c5", "passport_control": "1f6c2", "paw_prints": "1f43e", "peach": "1f351", "pear": "1f350", "pencil": "1f4dd", "pencil2": "270f", "penguin": "1f427", "pensive": "1f614", "performing_arts": "1f3ad", "persevere": "1f623", "person_frowning": "1f64d", "person_with_blond_hair": "1f471", "person_with_pouting_face": "1f64e", "phone": "260e", "pig": "1f437", "pig2": "1f416", "pig_nose": "1f43d", "pill": "1f48a", "pineapple": "1f34d", "pisces": "2653", "pizza": "1f355", "point_down": "1f447", "point_left": "1f448", "point_right": "1f449", "point_up": "261d", "point_up_2": "1f446", "police_car": "1f693", "poodle": "1f429", "poop": "1f4a9", "post_office": "1f3e3", "postal_horn": "1f4ef", "postbox": "1f4ee", "potable_water": "1f6b0", "pouch": "1f45d", "poultry_leg": "1f357", "pound": "1f4b7", "pout": "1f621", "pouting_cat": "1f63e", "pray": "1f64f", "princess": "1f478", "punch": "1f44a", "purple_heart": "1f49c", "purse": "1f45b", "pushpin": "1f4cc", "put_litter_in_its_place": "1f6ae", "question": "2753", "rabbit": "1f430", "rabbit2": "1f407", "racehorse": "1f40e", "radio": "1f4fb", "radio_button": "1f518", "rage": "1f621", "railway_car": "1f683", "rainbow": "1f308", "raised_hand": "270b", "raised_hands": "1f64c", "raising_hand": "1f64b", "ram": "1f40f", "ramen": "1f35c", "rat": "1f400", "recycle": "267b", "red_car": "1f697", "red_circle": "1f534", "registered": "ae", "relaxed": "263a", "relieved": "1f60c", "repeat": "1f501", "repeat_one": "1f502", "restroom": "1f6bb", "revolving_hearts": "1f49e", "rewind": "23ea", "ribbon": "1f380", "rice": "1f35a", "rice_ball": "1f359", "rice_cracker": "1f358", "rice_scene": "1f391", "ring": "1f48d", "rocket": "1f680", "roller_coaster": "1f3a2", "rooster": "1f413", "rose": "1f339", "rotating_light": "1f6a8", "round_pushpin": "1f4cd", "rowboat": "1f6a3", "ru": "1f1f7-1f1fa", "rugby_football": "1f3c9", "runner": "1f3c3", "running": "1f3c3", "running_shirt_with_sash": "1f3bd", "sa": "1f202", "sagittarius": "2650", "sailboat": "26f5", "sake": "1f376", "sandal": "1f461", "santa": "1f385", "satellite": "1f4e1", "satisfied": "1f606", "saxophone": "1f3b7", "school": "1f3eb", "school_satchel": "1f392", "scissors": "2702", "scorpius": "264f", "scream": "1f631", "scream_cat": "1f640", "scroll": "1f4dc", "seat": "1f4ba", "secret": "3299", "see_no_evil": "1f648", "seedling": "1f331", "seven": "37-20e3", "shaved_ice": "1f367", "sheep": "1f411", "shell": "1f41a", "ship": "1f6a2", "shirt": "1f455", "shit": "1f4a9", "shoe": "1f45e", "shower": "1f6bf", "signal_strength": "1f4f6", "six": "36-20e3", "six_pointed_star": "1f52f", "ski": "1f3bf", "skull": "1f480", "sleeping": "1f634", "sleepy": "1f62a", "slot_machine": "1f3b0", "small_blue_diamond": "1f539", "small_orange_diamond": "1f538", "small_red_triangle": "1f53a", "small_red_triangle_down": "1f53b", "smile": "1f604", "smile_cat": "1f638", "smiley": "1f603", "smiley_cat": "1f63a", "smiling_imp": "1f608", "smirk": "1f60f", "smirk_cat": "1f63c", "smoking": "1f6ac", "snail": "1f40c", "snake": "1f40d", "snowboarder": "1f3c2", "snowflake": "2744", "snowman": "26c4", "sob": "1f62d", "soccer": "26bd", "soon": "1f51c", "sos": "1f198", "sound": "1f509", "space_invader": "1f47e", "spades": "2660", "spaghetti": "1f35d", "sparkle": "2747", "sparkler": "1f387", "sparkles": "2728", "sparkling_heart": "1f496", "speak_no_evil": "1f64a", "speaker": "1f508", "speech_balloon": "1f4ac", "speedboat": "1f6a4", "star": "2b50", "star2": "1f31f", "stars": "1f320", "station": "1f689", "statue_of_liberty": "1f5fd", "steam_locomotive": "1f682", "stew": "1f372", "straight_ruler": "1f4cf", "strawberry": "1f353", "stuck_out_tongue": "1f61b", "stuck_out_tongue_closed_eyes": "1f61d", "stuck_out_tongue_winking_eye": "1f61c", "sun_with_face": "1f31e", "sunflower": "1f33b", "sunglasses": "1f60e", "sunny": "2600", "sunrise": "1f305", "sunrise_over_mountains": "1f304", "surfer": "1f3c4", "sushi": "1f363", "suspension_railway": "1f69f", "sweat": "1f613", "sweat_drops": "1f4a6", "sweat_smile": "1f605", "sweet_potato": "1f360", "swimmer": "1f3ca", "symbols": "1f523", "syringe": "1f489", "tada": "1f389", "tanabata_tree": "1f38b", "tangerine": "1f34a", "taurus": "2649", "taxi": "1f695", "tea": "1f375", "telephone": "260e", "telephone_receiver": "1f4de", "telescope": "1f52d", "tennis": "1f3be", "tent": "26fa", "thought_balloon": "1f4ad", "three": "33-20e3", "thumbsdown": "1f44e", "thumbsup": "1f44d", "ticket": "1f3ab", "tiger": "1f42f", "tiger2": "1f405", "tired_face": "1f62b", "tm": "2122", "toilet": "1f6bd", "tokyo_tower": "1f5fc", "tomato": "1f345", "tongue": "1f445", "top": "1f51d", "tophat": "1f3a9", "tractor": "1f69c", "traffic_light": "1f6a5", "train": "1f68b", "train2": "1f686", "tram": "1f68a", "triangular_flag_on_post": "1f6a9", "triangular_ruler": "1f4d0", "trident": "1f531", "triumph": "1f624", "trolleybus": "1f68e", "trophy": "1f3c6", "tropical_drink": "1f379", "tropical_fish": "1f420", "truck": "1f69a", "trumpet": "1f3ba", "tshirt": "1f455", "tulip": "1f337", "turtle": "1f422", "tv": "1f4fa", "twisted_rightwards_arrows": "1f500", "two": "32-20e3", "two_hearts": "1f495", "two_men_holding_hands": "1f46c", "two_women_holding_hands": "1f46d", "u5272": "1f239", "u5408": "1f234", "u55b6": "1f23a", "u6307": "1f22f", "u6708": "1f237", "u6709": "1f236", "u6e80": "1f235", "u7121": "1f21a", "u7533": "1f238", "u7981": "1f232", "u7a7a": "1f233", "uk": "1f1ec-1f1e7", "umbrella": "2614", "unamused": "1f612", "underage": "1f51e", "unlock": "1f513", "up": "1f199", "us": "1f1fa-1f1f8", "v": "270c", "vertical_traffic_light": "1f6a6", "vhs": "1f4fc", "vibration_mode": "1f4f3", "video_camera": "1f4f9", "video_game": "1f3ae", "violin": "1f3bb", "virgo": "264d", "volcano": "1f30b", "vs": "1f19a", "walking": "1f6b6", "waning_crescent_moon": "1f318", "waning_gibbous_moon": "1f316", "warning": "26a0", "watch": "231a", "water_buffalo": "1f403", "watermelon": "1f349", "wave": "1f44b", "wavy_dash": "3030", "waxing_crescent_moon": "1f312", "waxing_gibbous_moon": "1f314", "wc": "1f6be", "weary": "1f629", "wedding": "1f492", "whale": "1f433", "whale2": "1f40b", "wheelchair": "267f", "white_check_mark": "2705", "white_circle": "26aa", "white_flower": "1f4ae", "white_large_square": "2b1c", "white_medium_small_square": "25fd", "white_medium_square": "25fb", "white_small_square": "25ab", "white_square_button": "1f533", "wind_chime": "1f390", "wine_glass": "1f377", "wink": "1f609", "wolf": "1f43a", "woman": "1f469", "womans_clothes": "1f45a", "womans_hat": "1f452", "womens": "1f6ba", "worried": "1f61f", "wrench": "1f527", "x": "274c", "yellow_heart": "1f49b", "yen": "1f4b4", "yum": "1f60b", "zap": "26a1", "zero": "30-20e3", "zzz": "1f4a4", "100": "1f4af", "1234": "1f522" }; - var emoji_keys = Object.keys(emoji_map); + var emojiKeys = Object.keys(emojiMap); extend(ComposerBody.prototype, 'config', function (original, isInitialized) { if (isInitialized) return; @@ -199,6 +199,7 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru var makeSuggestion = function makeSuggestion(key) { var code = ':' + key + ':'; + var imageName = (emojiMap[key].indexOf('-20e3') != -1 || emojiMap[key] == 'a9' || emojiMap[key] == 'ae' ? '00' : '') + emojiMap[key]; return m( 'button', { className: 'PostPreview', @@ -211,7 +212,7 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru m( 'span', { className: 'PostPreview-content' }, - m('img', { alt: code, 'class': 'emoji', draggable: 'false', src: '//twemoji.maxcdn.com/36x36/' + emoji_map[key] + '.png' }), + m('img', { alt: code, 'class': 'emoji', draggable: 'false', src: '//cdn.jsdelivr.net/emojione/assets/png/' + imageName + '.png' }), key ) ); @@ -222,15 +223,15 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru var similarEmoji = []; var fuzzyRegexp = function fuzzyRegexp(str) { - var reEscape = new RegExp("\\(([" + "+.*?[]{}()^$|\\".replace(/(.)/g, "\\$1") + "])\\)", "g"); - return new RegExp("(.*)" + str.toLowerCase().replace(/(.)/g, "($1)(.*?)").replace(reEscape, "(\\$1)") + "$", "i"); + var reEscape = new RegExp('\\(([' + '+.*?[]{}()^$|\\'.replace(/(.)/g, '\\$1') + '])\\)', 'g'); + return new RegExp('(.*)' + str.toLowerCase().replace(/(.)/g, '($1)(.*?)').replace(reEscape, '(\\$1)') + '$', 'i'); }; var regTyped = fuzzyRegexp(typed); - for (var i = 0, maxSuggestions = 7; i < emoji_keys.length && maxSuggestions > 0; i++) { - if (regTyped.test(emoji_keys[i])) { + for (var i = 0, maxSuggestions = 7; i < emojiKeys.length && maxSuggestions > 0; i++) { + if (regTyped.test(emojiKeys[i])) { --maxSuggestions; - similarEmoji.push(emoji_keys[i]); + similarEmoji.push(emojiKeys[i]); } } diff --git a/extensions/emoji/js/forum/src/addComposerAutocomplete.js b/extensions/emoji/js/forum/src/addComposerAutocomplete.js index 4548af239..207b1e16e 100644 --- a/extensions/emoji/js/forum/src/addComposerAutocomplete.js +++ b/extensions/emoji/js/forum/src/addComposerAutocomplete.js @@ -7,9 +7,9 @@ import AutocompleteDropdown from 'flarum/emoji/components/AutocompleteDropdown'; export default function addComposerAutocomplete() { - const emoji_map = {"-1":"1f44e","+1":"1f44d","8ball":"1f3b1","a":"1f170","ab":"1f18e","abc":"1f524","abcd":"1f521","accept":"1f251","aerial_tramway":"1f6a1","airplane":"2708","alarm_clock":"23f0","alien":"1f47d","ambulance":"1f691","anchor":"2693","angel":"1f47c","anger":"1f4a2","angry":"1f620","anguished":"1f627","ant":"1f41c","apple":"1f34e","aquarius":"2652","aries":"2648","arrow_backward":"25c0","arrow_double_down":"23ec","arrow_double_up":"23eb","arrow_down":"2b07","arrow_down_small":"1f53d","arrow_forward":"25b6","arrow_heading_down":"2935","arrow_heading_up":"2934","arrow_left":"2b05","arrow_lower_left":"2199","arrow_lower_right":"2198","arrow_right":"27a1","arrow_right_hook":"21aa","arrow_up":"2b06","arrow_up_down":"2195","arrow_up_small":"1f53c","arrow_upper_left":"2196","arrow_upper_right":"2197","arrows_clockwise":"1f503","arrows_counterclockwise":"1f504","art":"1f3a8","articulated_lorry":"1f69b","astonished":"1f632","athletic_shoe":"1f45f","atm":"1f3e7","b":"1f171","baby":"1f476","baby_bottle":"1f37c","baby_chick":"1f424","baby_symbol":"1f6bc","back":"1f519","baggage_claim":"1f6c4","balloon":"1f388","ballot_box_with_check":"2611","bamboo":"1f38d","banana":"1f34c","bangbang":"203c","bank":"1f3e6","bar_chart":"1f4ca","barber":"1f488","baseball":"26be","basketball":"1f3c0","bath":"1f6c0","bathtub":"1f6c1","battery":"1f50b","bear":"1f43b","bee":"1f41d","beer":"1f37a","beers":"1f37b","beetle":"1f41e","beginner":"1f530","bell":"1f514","bento":"1f371","bicyclist":"1f6b4","bike":"1f6b2","bikini":"1f459","bird":"1f426","birthday":"1f382","black_circle":"26ab","black_joker":"1f0cf","black_large_square":"2b1b","black_medium_small_square":"25fe","black_medium_square":"25fc","black_nib":"2712","black_small_square":"25aa","black_square_button":"1f532","blossom":"1f33c","blowfish":"1f421","blue_book":"1f4d8","blue_car":"1f699","blue_heart":"1f499","blush":"1f60a","boar":"1f417","boat":"26f5","bomb":"1f4a3","book":"1f4d6","bookmark":"1f516","bookmark_tabs":"1f4d1","books":"1f4da","boom":"1f4a5","boot":"1f462","bouquet":"1f490","bow":"1f647","bowling":"1f3b3","boy":"1f466","bread":"1f35e","bride_with_veil":"1f470","bridge_at_night":"1f309","briefcase":"1f4bc","broken_heart":"1f494","bug":"1f41b","bulb":"1f4a1","bullettrain_front":"1f685","bullettrain_side":"1f684","bus":"1f68c","busstop":"1f68f","bust_in_silhouette":"1f464","busts_in_silhouette":"1f465","cactus":"1f335","cake":"1f370","calendar":"1f4c6","calling":"1f4f2","camel":"1f42b","camera":"1f4f7","cancer":"264b","candy":"1f36c","capital_abcd":"1f520","capricorn":"2651","car":"1f697","card_index":"1f4c7","carousel_horse":"1f3a0","cat":"1f431","cat2":"1f408","cd":"1f4bf","chart":"1f4b9","chart_with_downwards_trend":"1f4c9","chart_with_upwards_trend":"1f4c8","checkered_flag":"1f3c1","cherries":"1f352","cherry_blossom":"1f338","chestnut":"1f330","chicken":"1f414","children_crossing":"1f6b8","chocolate_bar":"1f36b","christmas_tree":"1f384","church":"26ea","cinema":"1f3a6","circus_tent":"1f3aa","city_sunrise":"1f307","city_sunset":"1f306","cl":"1f191","clap":"1f44f","clapper":"1f3ac","clipboard":"1f4cb","clock1":"1f550","clock10":"1f559","clock1030":"1f565","clock11":"1f55a","clock1130":"1f566","clock12":"1f55b","clock1230":"1f567","clock130":"1f55c","clock2":"1f551","clock230":"1f55d","clock3":"1f552","clock330":"1f55e","clock4":"1f553","clock430":"1f55f","clock5":"1f554","clock530":"1f560","clock6":"1f555","clock630":"1f561","clock7":"1f556","clock730":"1f562","clock8":"1f557","clock830":"1f563","clock9":"1f558","clock930":"1f564","closed_book":"1f4d5","closed_lock_with_key":"1f510","closed_umbrella":"1f302","cloud":"2601","clubs":"2663","cn":"1f1e8-1f1f3","cocktail":"1f378","coffee":"2615","cold_sweat":"1f630","collision":"1f4a5","computer":"1f4bb","confetti_ball":"1f38a","confounded":"1f616","confused":"1f615","congratulations":"3297","construction":"1f6a7","construction_worker":"1f477","convenience_store":"1f3ea","cookie":"1f36a","cool":"1f192","cop":"1f46e","copyright":"a9","corn":"1f33d","couple":"1f46b","couple_with_heart":"1f491","couplekiss":"1f48f","cow":"1f42e","cow2":"1f404","credit_card":"1f4b3","crescent_moon":"1f319","crocodile":"1f40a","crossed_flags":"1f38c","crown":"1f451","cry":"1f622","crying_cat_face":"1f63f","crystal_ball":"1f52e","cupid":"1f498","curly_loop":"27b0","currency_exchange":"1f4b1","curry":"1f35b","custard":"1f36e","customs":"1f6c3","cyclone":"1f300","dancer":"1f483","dancers":"1f46f","dango":"1f361","dart":"1f3af","dash":"1f4a8","date":"1f4c5","de":"1f1e9-1f1ea","deciduous_tree":"1f333","department_store":"1f3ec","diamond_shape_with_a_dot_inside":"1f4a0","diamonds":"2666","disappointed":"1f61e","disappointed_relieved":"1f625","dizzy":"1f4ab","dizzy_face":"1f635","do_not_litter":"1f6af","dog":"1f436","dog2":"1f415","dollar":"1f4b5","dolls":"1f38e","dolphin":"1f42c","door":"1f6aa","doughnut":"1f369","dragon":"1f409","dragon_face":"1f432","dress":"1f457","dromedary_camel":"1f42a","droplet":"1f4a7","dvd":"1f4c0","e-mail":"1f4e7","ear":"1f442","ear_of_rice":"1f33e","earth_africa":"1f30d","earth_americas":"1f30e","earth_asia":"1f30f","egg":"1f373","eggplant":"1f346","eight":"38-20e3","eight_pointed_black_star":"2734","eight_spoked_asterisk":"2733","electric_plug":"1f50c","elephant":"1f418","email":"2709","end":"1f51a","envelope":"2709","envelope_with_arrow":"1f4e9","es":"1f1ea-1f1f8","euro":"1f4b6","european_castle":"1f3f0","european_post_office":"1f3e4","evergreen_tree":"1f332","exclamation":"2757","expressionless":"1f611","eyeglasses":"1f453","eyes":"1f440","facepunch":"1f44a","factory":"1f3ed","fallen_leaf":"1f342","family":"1f46a","fast_forward":"23e9","fax":"1f4e0","fearful":"1f628","feet":"1f43e","ferris_wheel":"1f3a1","file_folder":"1f4c1","fire":"1f525","fire_engine":"1f692","fireworks":"1f386","first_quarter_moon":"1f313","first_quarter_moon_with_face":"1f31b","fish":"1f41f","fish_cake":"1f365","fishing_pole_and_fish":"1f3a3","fist":"270a","five":"35-20e3","flags":"1f38f","flashlight":"1f526","flipper":"1f42c","floppy_disk":"1f4be","flower_playing_cards":"1f3b4","flushed":"1f633","foggy":"1f301","football":"1f3c8","footprints":"1f463","fork_and_knife":"1f374","fountain":"26f2","four":"34-20e3","four_leaf_clover":"1f340","fr":"1f1eb-1f1f7","free":"1f193","fried_shrimp":"1f364","fries":"1f35f","frog":"1f438","frowning":"1f626","fuelpump":"26fd","full_moon":"1f315","full_moon_with_face":"1f31d","game_die":"1f3b2","gb":"1f1ec-1f1e7","gem":"1f48e","gemini":"264a","ghost":"1f47b","gift":"1f381","gift_heart":"1f49d","girl":"1f467","globe_with_meridians":"1f310","goat":"1f410","golf":"26f3","grapes":"1f347","green_apple":"1f34f","green_book":"1f4d7","green_heart":"1f49a","grey_exclamation":"2755","grey_question":"2754","grimacing":"1f62c","grin":"1f601","grinning":"1f600","guardsman":"1f482","guitar":"1f3b8","gun":"1f52b","haircut":"1f487","hamburger":"1f354","hammer":"1f528","hamster":"1f439","hand":"270b","handbag":"1f45c","hankey":"1f4a9","hash":"23-20e3","hatched_chick":"1f425","hatching_chick":"1f423","headphones":"1f3a7","hear_no_evil":"1f649","heart":"2764","heart_decoration":"1f49f","heart_eyes":"1f60d","heart_eyes_cat":"1f63b","heartbeat":"1f493","heartpulse":"1f497","hearts":"2665","heavy_check_mark":"2714","heavy_division_sign":"2797","heavy_dollar_sign":"1f4b2","heavy_exclamation_mark":"2757","heavy_minus_sign":"2796","heavy_multiplication_x":"2716","heavy_plus_sign":"2795","helicopter":"1f681","herb":"1f33f","hibiscus":"1f33a","high_brightness":"1f506","high_heel":"1f460","hocho":"1f52a","honey_pot":"1f36f","honeybee":"1f41d","horse":"1f434","horse_racing":"1f3c7","hospital":"1f3e5","hotel":"1f3e8","hotsprings":"2668","hourglass":"231b","hourglass_flowing_sand":"23f3","house":"1f3e0","house_with_garden":"1f3e1","hushed":"1f62f","ice_cream":"1f368","icecream":"1f366","id":"1f194","ideograph_advantage":"1f250","imp":"1f47f","inbox_tray":"1f4e5","incoming_envelope":"1f4e8","information_desk_person":"1f481","information_source":"2139","innocent":"1f607","interrobang":"2049","iphone":"1f4f1","it":"1f1ee-1f1f9","izakaya_lantern":"1f3ee","jack_o_lantern":"1f383","japan":"1f5fe","japanese_castle":"1f3ef","japanese_goblin":"1f47a","japanese_ogre":"1f479","jeans":"1f456","joy":"1f602","joy_cat":"1f639","jp":"1f1ef-1f1f5","key":"1f511","keycap_ten":"1f51f","kimono":"1f458","kiss":"1f48b","kissing":"1f617","kissing_cat":"1f63d","kissing_closed_eyes":"1f61a","kissing_heart":"1f618","kissing_smiling_eyes":"1f619","knife":"1f52a","koala":"1f428","koko":"1f201","kr":"1f1f0-1f1f7","lantern":"1f3ee","large_blue_circle":"1f535","large_blue_diamond":"1f537","large_orange_diamond":"1f536","last_quarter_moon":"1f317","last_quarter_moon_with_face":"1f31c","laughing":"1f606","leaves":"1f343","ledger":"1f4d2","left_luggage":"1f6c5","left_right_arrow":"2194","leftwards_arrow_with_hook":"21a9","lemon":"1f34b","leo":"264c","leopard":"1f406","libra":"264e","light_rail":"1f688","link":"1f517","lips":"1f444","lipstick":"1f484","lock":"1f512","lock_with_ink_pen":"1f50f","lollipop":"1f36d","loop":"27bf","loud_sound":"1f50a","loudspeaker":"1f4e2","love_hotel":"1f3e9","love_letter":"1f48c","low_brightness":"1f505","m":"24c2","mag":"1f50d","mag_right":"1f50e","mahjong":"1f004","mailbox":"1f4eb","mailbox_closed":"1f4ea","mailbox_with_mail":"1f4ec","mailbox_with_no_mail":"1f4ed","man":"1f468","man_with_gua_pi_mao":"1f472","man_with_turban":"1f473","mans_shoe":"1f45e","maple_leaf":"1f341","mask":"1f637","massage":"1f486","meat_on_bone":"1f356","mega":"1f4e3","melon":"1f348","memo":"1f4dd","mens":"1f6b9","metro":"1f687","microphone":"1f3a4","microscope":"1f52c","milky_way":"1f30c","minibus":"1f690","minidisc":"1f4bd","mobile_phone_off":"1f4f4","money_with_wings":"1f4b8","moneybag":"1f4b0","monkey":"1f412","monkey_face":"1f435","monorail":"1f69d","moon":"1f314","mortar_board":"1f393","mount_fuji":"1f5fb","mountain_bicyclist":"1f6b5","mountain_cableway":"1f6a0","mountain_railway":"1f69e","mouse":"1f42d","mouse2":"1f401","movie_camera":"1f3a5","moyai":"1f5ff","muscle":"1f4aa","mushroom":"1f344","musical_keyboard":"1f3b9","musical_note":"1f3b5","musical_score":"1f3bc","mute":"1f507","nail_care":"1f485","name_badge":"1f4db","necktie":"1f454","negative_squared_cross_mark":"274e","neutral_face":"1f610","new":"1f195","new_moon":"1f311","new_moon_with_face":"1f31a","newspaper":"1f4f0","ng":"1f196","ng_woman":"1f645","night_with_stars":"1f303","nine":"39-20e3","no_bell":"1f515","no_bicycles":"1f6b3","no_entry":"26d4","no_entry_sign":"1f6ab","no_good":"1f645","no_mobile_phones":"1f4f5","no_mouth":"1f636","no_pedestrians":"1f6b7","no_smoking":"1f6ad","non-potable_water":"1f6b1","nose":"1f443","notebook":"1f4d3","notebook_with_decorative_cover":"1f4d4","notes":"1f3b6","nut_and_bolt":"1f529","o":"2b55","o2":"1f17e","ocean":"1f30a","octopus":"1f419","oden":"1f362","office":"1f3e2","ok":"1f197","ok_hand":"1f44c","ok_woman":"1f646","older_man":"1f474","older_woman":"1f475","on":"1f51b","oncoming_automobile":"1f698","oncoming_bus":"1f68d","oncoming_police_car":"1f694","oncoming_taxi":"1f696","one":"31-20e3","open_book":"1f4d6","open_file_folder":"1f4c2","open_hands":"1f450","open_mouth":"1f62e","ophiuchus":"26ce","orange_book":"1f4d9","outbox_tray":"1f4e4","ox":"1f402","package":"1f4e6","page_facing_up":"1f4c4","page_with_curl":"1f4c3","pager":"1f4df","palm_tree":"1f334","panda_face":"1f43c","paperclip":"1f4ce","parking":"1f17f","part_alternation_mark":"303d","partly_sunny":"26c5","passport_control":"1f6c2","paw_prints":"1f43e","peach":"1f351","pear":"1f350","pencil":"1f4dd","pencil2":"270f","penguin":"1f427","pensive":"1f614","performing_arts":"1f3ad","persevere":"1f623","person_frowning":"1f64d","person_with_blond_hair":"1f471","person_with_pouting_face":"1f64e","phone":"260e","pig":"1f437","pig2":"1f416","pig_nose":"1f43d","pill":"1f48a","pineapple":"1f34d","pisces":"2653","pizza":"1f355","point_down":"1f447","point_left":"1f448","point_right":"1f449","point_up":"261d","point_up_2":"1f446","police_car":"1f693","poodle":"1f429","poop":"1f4a9","post_office":"1f3e3","postal_horn":"1f4ef","postbox":"1f4ee","potable_water":"1f6b0","pouch":"1f45d","poultry_leg":"1f357","pound":"1f4b7","pout":"1f621","pouting_cat":"1f63e","pray":"1f64f","princess":"1f478","punch":"1f44a","purple_heart":"1f49c","purse":"1f45b","pushpin":"1f4cc","put_litter_in_its_place":"1f6ae","question":"2753","rabbit":"1f430","rabbit2":"1f407","racehorse":"1f40e","radio":"1f4fb","radio_button":"1f518","rage":"1f621","railway_car":"1f683","rainbow":"1f308","raised_hand":"270b","raised_hands":"1f64c","raising_hand":"1f64b","ram":"1f40f","ramen":"1f35c","rat":"1f400","recycle":"267b","red_car":"1f697","red_circle":"1f534","registered":"ae","relaxed":"263a","relieved":"1f60c","repeat":"1f501","repeat_one":"1f502","restroom":"1f6bb","revolving_hearts":"1f49e","rewind":"23ea","ribbon":"1f380","rice":"1f35a","rice_ball":"1f359","rice_cracker":"1f358","rice_scene":"1f391","ring":"1f48d","rocket":"1f680","roller_coaster":"1f3a2","rooster":"1f413","rose":"1f339","rotating_light":"1f6a8","round_pushpin":"1f4cd","rowboat":"1f6a3","ru":"1f1f7-1f1fa","rugby_football":"1f3c9","runner":"1f3c3","running":"1f3c3","running_shirt_with_sash":"1f3bd","sa":"1f202","sagittarius":"2650","sailboat":"26f5","sake":"1f376","sandal":"1f461","santa":"1f385","satellite":"1f4e1","satisfied":"1f606","saxophone":"1f3b7","school":"1f3eb","school_satchel":"1f392","scissors":"2702","scorpius":"264f","scream":"1f631","scream_cat":"1f640","scroll":"1f4dc","seat":"1f4ba","secret":"3299","see_no_evil":"1f648","seedling":"1f331","seven":"37-20e3","shaved_ice":"1f367","sheep":"1f411","shell":"1f41a","ship":"1f6a2","shirt":"1f455","shit":"1f4a9","shoe":"1f45e","shower":"1f6bf","signal_strength":"1f4f6","six":"36-20e3","six_pointed_star":"1f52f","ski":"1f3bf","skull":"1f480","sleeping":"1f634","sleepy":"1f62a","slot_machine":"1f3b0","small_blue_diamond":"1f539","small_orange_diamond":"1f538","small_red_triangle":"1f53a","small_red_triangle_down":"1f53b","smile":"1f604","smile_cat":"1f638","smiley":"1f603","smiley_cat":"1f63a","smiling_imp":"1f608","smirk":"1f60f","smirk_cat":"1f63c","smoking":"1f6ac","snail":"1f40c","snake":"1f40d","snowboarder":"1f3c2","snowflake":"2744","snowman":"26c4","sob":"1f62d","soccer":"26bd","soon":"1f51c","sos":"1f198","sound":"1f509","space_invader":"1f47e","spades":"2660","spaghetti":"1f35d","sparkle":"2747","sparkler":"1f387","sparkles":"2728","sparkling_heart":"1f496","speak_no_evil":"1f64a","speaker":"1f508","speech_balloon":"1f4ac","speedboat":"1f6a4","star":"2b50","star2":"1f31f","stars":"1f320","station":"1f689","statue_of_liberty":"1f5fd","steam_locomotive":"1f682","stew":"1f372","straight_ruler":"1f4cf","strawberry":"1f353","stuck_out_tongue":"1f61b","stuck_out_tongue_closed_eyes":"1f61d","stuck_out_tongue_winking_eye":"1f61c","sun_with_face":"1f31e","sunflower":"1f33b","sunglasses":"1f60e","sunny":"2600","sunrise":"1f305","sunrise_over_mountains":"1f304","surfer":"1f3c4","sushi":"1f363","suspension_railway":"1f69f","sweat":"1f613","sweat_drops":"1f4a6","sweat_smile":"1f605","sweet_potato":"1f360","swimmer":"1f3ca","symbols":"1f523","syringe":"1f489","tada":"1f389","tanabata_tree":"1f38b","tangerine":"1f34a","taurus":"2649","taxi":"1f695","tea":"1f375","telephone":"260e","telephone_receiver":"1f4de","telescope":"1f52d","tennis":"1f3be","tent":"26fa","thought_balloon":"1f4ad","three":"33-20e3","thumbsdown":"1f44e","thumbsup":"1f44d","ticket":"1f3ab","tiger":"1f42f","tiger2":"1f405","tired_face":"1f62b","tm":"2122","toilet":"1f6bd","tokyo_tower":"1f5fc","tomato":"1f345","tongue":"1f445","top":"1f51d","tophat":"1f3a9","tractor":"1f69c","traffic_light":"1f6a5","train":"1f68b","train2":"1f686","tram":"1f68a","triangular_flag_on_post":"1f6a9","triangular_ruler":"1f4d0","trident":"1f531","triumph":"1f624","trolleybus":"1f68e","trophy":"1f3c6","tropical_drink":"1f379","tropical_fish":"1f420","truck":"1f69a","trumpet":"1f3ba","tshirt":"1f455","tulip":"1f337","turtle":"1f422","tv":"1f4fa","twisted_rightwards_arrows":"1f500","two":"32-20e3","two_hearts":"1f495","two_men_holding_hands":"1f46c","two_women_holding_hands":"1f46d","u5272":"1f239","u5408":"1f234","u55b6":"1f23a","u6307":"1f22f","u6708":"1f237","u6709":"1f236","u6e80":"1f235","u7121":"1f21a","u7533":"1f238","u7981":"1f232","u7a7a":"1f233","uk":"1f1ec-1f1e7","umbrella":"2614","unamused":"1f612","underage":"1f51e","unlock":"1f513","up":"1f199","us":"1f1fa-1f1f8","v":"270c","vertical_traffic_light":"1f6a6","vhs":"1f4fc","vibration_mode":"1f4f3","video_camera":"1f4f9","video_game":"1f3ae","violin":"1f3bb","virgo":"264d","volcano":"1f30b","vs":"1f19a","walking":"1f6b6","waning_crescent_moon":"1f318","waning_gibbous_moon":"1f316","warning":"26a0","watch":"231a","water_buffalo":"1f403","watermelon":"1f349","wave":"1f44b","wavy_dash":"3030","waxing_crescent_moon":"1f312","waxing_gibbous_moon":"1f314","wc":"1f6be","weary":"1f629","wedding":"1f492","whale":"1f433","whale2":"1f40b","wheelchair":"267f","white_check_mark":"2705","white_circle":"26aa","white_flower":"1f4ae","white_large_square":"2b1c","white_medium_small_square":"25fd","white_medium_square":"25fb","white_small_square":"25ab","white_square_button":"1f533","wind_chime":"1f390","wine_glass":"1f377","wink":"1f609","wolf":"1f43a","woman":"1f469","womans_clothes":"1f45a","womans_hat":"1f452","womens":"1f6ba","worried":"1f61f","wrench":"1f527","x":"274c","yellow_heart":"1f49b","yen":"1f4b4","yum":"1f60b","zap":"26a1","zero":"30-20e3","zzz":"1f4a4","100":"1f4af","1234":"1f522"}; + const emojiMap = {"-1":"1f44e","+1":"1f44d","8ball":"1f3b1","a":"1f170","ab":"1f18e","abc":"1f524","abcd":"1f521","accept":"1f251","aerial_tramway":"1f6a1","airplane":"2708","alarm_clock":"23f0","alien":"1f47d","ambulance":"1f691","anchor":"2693","angel":"1f47c","anger":"1f4a2","angry":"1f620","anguished":"1f627","ant":"1f41c","apple":"1f34e","aquarius":"2652","aries":"2648","arrow_backward":"25c0","arrow_double_down":"23ec","arrow_double_up":"23eb","arrow_down":"2b07","arrow_down_small":"1f53d","arrow_forward":"25b6","arrow_heading_down":"2935","arrow_heading_up":"2934","arrow_left":"2b05","arrow_lower_left":"2199","arrow_lower_right":"2198","arrow_right":"27a1","arrow_right_hook":"21aa","arrow_up":"2b06","arrow_up_down":"2195","arrow_up_small":"1f53c","arrow_upper_left":"2196","arrow_upper_right":"2197","arrows_clockwise":"1f503","arrows_counterclockwise":"1f504","art":"1f3a8","articulated_lorry":"1f69b","astonished":"1f632","athletic_shoe":"1f45f","atm":"1f3e7","b":"1f171","baby":"1f476","baby_bottle":"1f37c","baby_chick":"1f424","baby_symbol":"1f6bc","back":"1f519","baggage_claim":"1f6c4","balloon":"1f388","ballot_box_with_check":"2611","bamboo":"1f38d","banana":"1f34c","bangbang":"203c","bank":"1f3e6","bar_chart":"1f4ca","barber":"1f488","baseball":"26be","basketball":"1f3c0","bath":"1f6c0","bathtub":"1f6c1","battery":"1f50b","bear":"1f43b","bee":"1f41d","beer":"1f37a","beers":"1f37b","beetle":"1f41e","beginner":"1f530","bell":"1f514","bento":"1f371","bicyclist":"1f6b4","bike":"1f6b2","bikini":"1f459","bird":"1f426","birthday":"1f382","black_circle":"26ab","black_joker":"1f0cf","black_large_square":"2b1b","black_medium_small_square":"25fe","black_medium_square":"25fc","black_nib":"2712","black_small_square":"25aa","black_square_button":"1f532","blossom":"1f33c","blowfish":"1f421","blue_book":"1f4d8","blue_car":"1f699","blue_heart":"1f499","blush":"1f60a","boar":"1f417","boat":"26f5","bomb":"1f4a3","book":"1f4d6","bookmark":"1f516","bookmark_tabs":"1f4d1","books":"1f4da","boom":"1f4a5","boot":"1f462","bouquet":"1f490","bow":"1f647","bowling":"1f3b3","boy":"1f466","bread":"1f35e","bride_with_veil":"1f470","bridge_at_night":"1f309","briefcase":"1f4bc","broken_heart":"1f494","bug":"1f41b","bulb":"1f4a1","bullettrain_front":"1f685","bullettrain_side":"1f684","bus":"1f68c","busstop":"1f68f","bust_in_silhouette":"1f464","busts_in_silhouette":"1f465","cactus":"1f335","cake":"1f370","calendar":"1f4c6","calling":"1f4f2","camel":"1f42b","camera":"1f4f7","cancer":"264b","candy":"1f36c","capital_abcd":"1f520","capricorn":"2651","car":"1f697","card_index":"1f4c7","carousel_horse":"1f3a0","cat":"1f431","cat2":"1f408","cd":"1f4bf","chart":"1f4b9","chart_with_downwards_trend":"1f4c9","chart_with_upwards_trend":"1f4c8","checkered_flag":"1f3c1","cherries":"1f352","cherry_blossom":"1f338","chestnut":"1f330","chicken":"1f414","children_crossing":"1f6b8","chocolate_bar":"1f36b","christmas_tree":"1f384","church":"26ea","cinema":"1f3a6","circus_tent":"1f3aa","city_sunrise":"1f307","city_sunset":"1f306","cl":"1f191","clap":"1f44f","clapper":"1f3ac","clipboard":"1f4cb","clock1":"1f550","clock10":"1f559","clock1030":"1f565","clock11":"1f55a","clock1130":"1f566","clock12":"1f55b","clock1230":"1f567","clock130":"1f55c","clock2":"1f551","clock230":"1f55d","clock3":"1f552","clock330":"1f55e","clock4":"1f553","clock430":"1f55f","clock5":"1f554","clock530":"1f560","clock6":"1f555","clock630":"1f561","clock7":"1f556","clock730":"1f562","clock8":"1f557","clock830":"1f563","clock9":"1f558","clock930":"1f564","closed_book":"1f4d5","closed_lock_with_key":"1f510","closed_umbrella":"1f302","cloud":"2601","clubs":"2663","cn":"1f1e8-1f1f3","cocktail":"1f378","coffee":"2615","cold_sweat":"1f630","collision":"1f4a5","computer":"1f4bb","confetti_ball":"1f38a","confounded":"1f616","confused":"1f615","congratulations":"3297","construction":"1f6a7","construction_worker":"1f477","convenience_store":"1f3ea","cookie":"1f36a","cool":"1f192","cop":"1f46e","copyright":"a9","corn":"1f33d","couple":"1f46b","couple_with_heart":"1f491","couplekiss":"1f48f","cow":"1f42e","cow2":"1f404","credit_card":"1f4b3","crescent_moon":"1f319","crocodile":"1f40a","crossed_flags":"1f38c","crown":"1f451","cry":"1f622","crying_cat_face":"1f63f","crystal_ball":"1f52e","cupid":"1f498","curly_loop":"27b0","currency_exchange":"1f4b1","curry":"1f35b","custard":"1f36e","customs":"1f6c3","cyclone":"1f300","dancer":"1f483","dancers":"1f46f","dango":"1f361","dart":"1f3af","dash":"1f4a8","date":"1f4c5","de":"1f1e9-1f1ea","deciduous_tree":"1f333","department_store":"1f3ec","diamond_shape_with_a_dot_inside":"1f4a0","diamonds":"2666","disappointed":"1f61e","disappointed_relieved":"1f625","dizzy":"1f4ab","dizzy_face":"1f635","do_not_litter":"1f6af","dog":"1f436","dog2":"1f415","dollar":"1f4b5","dolls":"1f38e","dolphin":"1f42c","door":"1f6aa","doughnut":"1f369","dragon":"1f409","dragon_face":"1f432","dress":"1f457","dromedary_camel":"1f42a","droplet":"1f4a7","dvd":"1f4c0","e-mail":"1f4e7","ear":"1f442","ear_of_rice":"1f33e","earth_africa":"1f30d","earth_americas":"1f30e","earth_asia":"1f30f","egg":"1f373","eggplant":"1f346","eight":"38-20e3","eight_pointed_black_star":"2734","eight_spoked_asterisk":"2733","electric_plug":"1f50c","elephant":"1f418","email":"2709","end":"1f51a","envelope":"2709","envelope_with_arrow":"1f4e9","es":"1f1ea-1f1f8","euro":"1f4b6","european_castle":"1f3f0","european_post_office":"1f3e4","evergreen_tree":"1f332","exclamation":"2757","expressionless":"1f611","eyeglasses":"1f453","eyes":"1f440","facepunch":"1f44a","factory":"1f3ed","fallen_leaf":"1f342","family":"1f46a","fast_forward":"23e9","fax":"1f4e0","fearful":"1f628","feet":"1f43e","ferris_wheel":"1f3a1","file_folder":"1f4c1","fire":"1f525","fire_engine":"1f692","fireworks":"1f386","first_quarter_moon":"1f313","first_quarter_moon_with_face":"1f31b","fish":"1f41f","fish_cake":"1f365","fishing_pole_and_fish":"1f3a3","fist":"270a","five":"35-20e3","flags":"1f38f","flashlight":"1f526","flipper":"1f42c","floppy_disk":"1f4be","flower_playing_cards":"1f3b4","flushed":"1f633","foggy":"1f301","football":"1f3c8","footprints":"1f463","fork_and_knife":"1f374","fountain":"26f2","four":"34-20e3","four_leaf_clover":"1f340","fr":"1f1eb-1f1f7","free":"1f193","fried_shrimp":"1f364","fries":"1f35f","frog":"1f438","frowning":"1f626","fuelpump":"26fd","full_moon":"1f315","full_moon_with_face":"1f31d","game_die":"1f3b2","gb":"1f1ec-1f1e7","gem":"1f48e","gemini":"264a","ghost":"1f47b","gift":"1f381","gift_heart":"1f49d","girl":"1f467","globe_with_meridians":"1f310","goat":"1f410","golf":"26f3","grapes":"1f347","green_apple":"1f34f","green_book":"1f4d7","green_heart":"1f49a","grey_exclamation":"2755","grey_question":"2754","grimacing":"1f62c","grin":"1f601","grinning":"1f600","guardsman":"1f482","guitar":"1f3b8","gun":"1f52b","haircut":"1f487","hamburger":"1f354","hammer":"1f528","hamster":"1f439","hand":"270b","handbag":"1f45c","hankey":"1f4a9","hash":"23-20e3","hatched_chick":"1f425","hatching_chick":"1f423","headphones":"1f3a7","hear_no_evil":"1f649","heart":"2764","heart_decoration":"1f49f","heart_eyes":"1f60d","heart_eyes_cat":"1f63b","heartbeat":"1f493","heartpulse":"1f497","hearts":"2665","heavy_check_mark":"2714","heavy_division_sign":"2797","heavy_dollar_sign":"1f4b2","heavy_exclamation_mark":"2757","heavy_minus_sign":"2796","heavy_multiplication_x":"2716","heavy_plus_sign":"2795","helicopter":"1f681","herb":"1f33f","hibiscus":"1f33a","high_brightness":"1f506","high_heel":"1f460","hocho":"1f52a","honey_pot":"1f36f","honeybee":"1f41d","horse":"1f434","horse_racing":"1f3c7","hospital":"1f3e5","hotel":"1f3e8","hotsprings":"2668","hourglass":"231b","hourglass_flowing_sand":"23f3","house":"1f3e0","house_with_garden":"1f3e1","hushed":"1f62f","ice_cream":"1f368","icecream":"1f366","id":"1f194","ideograph_advantage":"1f250","imp":"1f47f","inbox_tray":"1f4e5","incoming_envelope":"1f4e8","information_desk_person":"1f481","information_source":"2139","innocent":"1f607","interrobang":"2049","iphone":"1f4f1","it":"1f1ee-1f1f9","izakaya_lantern":"1f3ee","jack_o_lantern":"1f383","japan":"1f5fe","japanese_castle":"1f3ef","japanese_goblin":"1f47a","japanese_ogre":"1f479","jeans":"1f456","joy":"1f602","joy_cat":"1f639","jp":"1f1ef-1f1f5","key":"1f511","keycap_ten":"1f51f","kimono":"1f458","kiss":"1f48b","kissing":"1f617","kissing_cat":"1f63d","kissing_closed_eyes":"1f61a","kissing_heart":"1f618","kissing_smiling_eyes":"1f619","knife":"1f52a","koala":"1f428","koko":"1f201","kr":"1f1f0-1f1f7","lantern":"1f3ee","large_blue_circle":"1f535","large_blue_diamond":"1f537","large_orange_diamond":"1f536","last_quarter_moon":"1f317","last_quarter_moon_with_face":"1f31c","laughing":"1f606","leaves":"1f343","ledger":"1f4d2","left_luggage":"1f6c5","left_right_arrow":"2194","leftwards_arrow_with_hook":"21a9","lemon":"1f34b","leo":"264c","leopard":"1f406","libra":"264e","light_rail":"1f688","link":"1f517","lips":"1f444","lipstick":"1f484","lock":"1f512","lock_with_ink_pen":"1f50f","lollipop":"1f36d","loop":"27bf","loud_sound":"1f50a","loudspeaker":"1f4e2","love_hotel":"1f3e9","love_letter":"1f48c","low_brightness":"1f505","m":"24c2","mag":"1f50d","mag_right":"1f50e","mahjong":"1f004","mailbox":"1f4eb","mailbox_closed":"1f4ea","mailbox_with_mail":"1f4ec","mailbox_with_no_mail":"1f4ed","man":"1f468","man_with_gua_pi_mao":"1f472","man_with_turban":"1f473","mans_shoe":"1f45e","maple_leaf":"1f341","mask":"1f637","massage":"1f486","meat_on_bone":"1f356","mega":"1f4e3","melon":"1f348","memo":"1f4dd","mens":"1f6b9","metro":"1f687","microphone":"1f3a4","microscope":"1f52c","milky_way":"1f30c","minibus":"1f690","minidisc":"1f4bd","mobile_phone_off":"1f4f4","money_with_wings":"1f4b8","moneybag":"1f4b0","monkey":"1f412","monkey_face":"1f435","monorail":"1f69d","moon":"1f314","mortar_board":"1f393","mount_fuji":"1f5fb","mountain_bicyclist":"1f6b5","mountain_cableway":"1f6a0","mountain_railway":"1f69e","mouse":"1f42d","mouse2":"1f401","movie_camera":"1f3a5","moyai":"1f5ff","muscle":"1f4aa","mushroom":"1f344","musical_keyboard":"1f3b9","musical_note":"1f3b5","musical_score":"1f3bc","mute":"1f507","nail_care":"1f485","name_badge":"1f4db","necktie":"1f454","negative_squared_cross_mark":"274e","neutral_face":"1f610","new":"1f195","new_moon":"1f311","new_moon_with_face":"1f31a","newspaper":"1f4f0","ng":"1f196","ng_woman":"1f645","night_with_stars":"1f303","nine":"39-20e3","no_bell":"1f515","no_bicycles":"1f6b3","no_entry":"26d4","no_entry_sign":"1f6ab","no_good":"1f645","no_mobile_phones":"1f4f5","no_mouth":"1f636","no_pedestrians":"1f6b7","no_smoking":"1f6ad","non-potable_water":"1f6b1","nose":"1f443","notebook":"1f4d3","notebook_with_decorative_cover":"1f4d4","notes":"1f3b6","nut_and_bolt":"1f529","o":"2b55","o2":"1f17e","ocean":"1f30a","octopus":"1f419","oden":"1f362","office":"1f3e2","ok":"1f197","ok_hand":"1f44c","ok_woman":"1f646","older_man":"1f474","older_woman":"1f475","on":"1f51b","oncoming_automobile":"1f698","oncoming_bus":"1f68d","oncoming_police_car":"1f694","oncoming_taxi":"1f696","one":"31-20e3","open_book":"1f4d6","open_file_folder":"1f4c2","open_hands":"1f450","open_mouth":"1f62e","ophiuchus":"26ce","orange_book":"1f4d9","outbox_tray":"1f4e4","ox":"1f402","package":"1f4e6","page_facing_up":"1f4c4","page_with_curl":"1f4c3","pager":"1f4df","palm_tree":"1f334","panda_face":"1f43c","paperclip":"1f4ce","parking":"1f17f","part_alternation_mark":"303d","partly_sunny":"26c5","passport_control":"1f6c2","paw_prints":"1f43e","peach":"1f351","pear":"1f350","pencil":"1f4dd","pencil2":"270f","penguin":"1f427","pensive":"1f614","performing_arts":"1f3ad","persevere":"1f623","person_frowning":"1f64d","person_with_blond_hair":"1f471","person_with_pouting_face":"1f64e","phone":"260e","pig":"1f437","pig2":"1f416","pig_nose":"1f43d","pill":"1f48a","pineapple":"1f34d","pisces":"2653","pizza":"1f355","point_down":"1f447","point_left":"1f448","point_right":"1f449","point_up":"261d","point_up_2":"1f446","police_car":"1f693","poodle":"1f429","poop":"1f4a9","post_office":"1f3e3","postal_horn":"1f4ef","postbox":"1f4ee","potable_water":"1f6b0","pouch":"1f45d","poultry_leg":"1f357","pound":"1f4b7","pout":"1f621","pouting_cat":"1f63e","pray":"1f64f","princess":"1f478","punch":"1f44a","purple_heart":"1f49c","purse":"1f45b","pushpin":"1f4cc","put_litter_in_its_place":"1f6ae","question":"2753","rabbit":"1f430","rabbit2":"1f407","racehorse":"1f40e","radio":"1f4fb","radio_button":"1f518","rage":"1f621","railway_car":"1f683","rainbow":"1f308","raised_hand":"270b","raised_hands":"1f64c","raising_hand":"1f64b","ram":"1f40f","ramen":"1f35c","rat":"1f400","recycle":"267b","red_car":"1f697","red_circle":"1f534","registered":"ae","relaxed":"263a","relieved":"1f60c","repeat":"1f501","repeat_one":"1f502","restroom":"1f6bb","revolving_hearts":"1f49e","rewind":"23ea","ribbon":"1f380","rice":"1f35a","rice_ball":"1f359","rice_cracker":"1f358","rice_scene":"1f391","ring":"1f48d","rocket":"1f680","roller_coaster":"1f3a2","rooster":"1f413","rose":"1f339","rotating_light":"1f6a8","round_pushpin":"1f4cd","rowboat":"1f6a3","ru":"1f1f7-1f1fa","rugby_football":"1f3c9","runner":"1f3c3","running":"1f3c3","running_shirt_with_sash":"1f3bd","sa":"1f202","sagittarius":"2650","sailboat":"26f5","sake":"1f376","sandal":"1f461","santa":"1f385","satellite":"1f4e1","satisfied":"1f606","saxophone":"1f3b7","school":"1f3eb","school_satchel":"1f392","scissors":"2702","scorpius":"264f","scream":"1f631","scream_cat":"1f640","scroll":"1f4dc","seat":"1f4ba","secret":"3299","see_no_evil":"1f648","seedling":"1f331","seven":"37-20e3","shaved_ice":"1f367","sheep":"1f411","shell":"1f41a","ship":"1f6a2","shirt":"1f455","shit":"1f4a9","shoe":"1f45e","shower":"1f6bf","signal_strength":"1f4f6","six":"36-20e3","six_pointed_star":"1f52f","ski":"1f3bf","skull":"1f480","sleeping":"1f634","sleepy":"1f62a","slot_machine":"1f3b0","small_blue_diamond":"1f539","small_orange_diamond":"1f538","small_red_triangle":"1f53a","small_red_triangle_down":"1f53b","smile":"1f604","smile_cat":"1f638","smiley":"1f603","smiley_cat":"1f63a","smiling_imp":"1f608","smirk":"1f60f","smirk_cat":"1f63c","smoking":"1f6ac","snail":"1f40c","snake":"1f40d","snowboarder":"1f3c2","snowflake":"2744","snowman":"26c4","sob":"1f62d","soccer":"26bd","soon":"1f51c","sos":"1f198","sound":"1f509","space_invader":"1f47e","spades":"2660","spaghetti":"1f35d","sparkle":"2747","sparkler":"1f387","sparkles":"2728","sparkling_heart":"1f496","speak_no_evil":"1f64a","speaker":"1f508","speech_balloon":"1f4ac","speedboat":"1f6a4","star":"2b50","star2":"1f31f","stars":"1f320","station":"1f689","statue_of_liberty":"1f5fd","steam_locomotive":"1f682","stew":"1f372","straight_ruler":"1f4cf","strawberry":"1f353","stuck_out_tongue":"1f61b","stuck_out_tongue_closed_eyes":"1f61d","stuck_out_tongue_winking_eye":"1f61c","sun_with_face":"1f31e","sunflower":"1f33b","sunglasses":"1f60e","sunny":"2600","sunrise":"1f305","sunrise_over_mountains":"1f304","surfer":"1f3c4","sushi":"1f363","suspension_railway":"1f69f","sweat":"1f613","sweat_drops":"1f4a6","sweat_smile":"1f605","sweet_potato":"1f360","swimmer":"1f3ca","symbols":"1f523","syringe":"1f489","tada":"1f389","tanabata_tree":"1f38b","tangerine":"1f34a","taurus":"2649","taxi":"1f695","tea":"1f375","telephone":"260e","telephone_receiver":"1f4de","telescope":"1f52d","tennis":"1f3be","tent":"26fa","thought_balloon":"1f4ad","three":"33-20e3","thumbsdown":"1f44e","thumbsup":"1f44d","ticket":"1f3ab","tiger":"1f42f","tiger2":"1f405","tired_face":"1f62b","tm":"2122","toilet":"1f6bd","tokyo_tower":"1f5fc","tomato":"1f345","tongue":"1f445","top":"1f51d","tophat":"1f3a9","tractor":"1f69c","traffic_light":"1f6a5","train":"1f68b","train2":"1f686","tram":"1f68a","triangular_flag_on_post":"1f6a9","triangular_ruler":"1f4d0","trident":"1f531","triumph":"1f624","trolleybus":"1f68e","trophy":"1f3c6","tropical_drink":"1f379","tropical_fish":"1f420","truck":"1f69a","trumpet":"1f3ba","tshirt":"1f455","tulip":"1f337","turtle":"1f422","tv":"1f4fa","twisted_rightwards_arrows":"1f500","two":"32-20e3","two_hearts":"1f495","two_men_holding_hands":"1f46c","two_women_holding_hands":"1f46d","u5272":"1f239","u5408":"1f234","u55b6":"1f23a","u6307":"1f22f","u6708":"1f237","u6709":"1f236","u6e80":"1f235","u7121":"1f21a","u7533":"1f238","u7981":"1f232","u7a7a":"1f233","uk":"1f1ec-1f1e7","umbrella":"2614","unamused":"1f612","underage":"1f51e","unlock":"1f513","up":"1f199","us":"1f1fa-1f1f8","v":"270c","vertical_traffic_light":"1f6a6","vhs":"1f4fc","vibration_mode":"1f4f3","video_camera":"1f4f9","video_game":"1f3ae","violin":"1f3bb","virgo":"264d","volcano":"1f30b","vs":"1f19a","walking":"1f6b6","waning_crescent_moon":"1f318","waning_gibbous_moon":"1f316","warning":"26a0","watch":"231a","water_buffalo":"1f403","watermelon":"1f349","wave":"1f44b","wavy_dash":"3030","waxing_crescent_moon":"1f312","waxing_gibbous_moon":"1f314","wc":"1f6be","weary":"1f629","wedding":"1f492","whale":"1f433","whale2":"1f40b","wheelchair":"267f","white_check_mark":"2705","white_circle":"26aa","white_flower":"1f4ae","white_large_square":"2b1c","white_medium_small_square":"25fd","white_medium_square":"25fb","white_small_square":"25ab","white_square_button":"1f533","wind_chime":"1f390","wine_glass":"1f377","wink":"1f609","wolf":"1f43a","woman":"1f469","womans_clothes":"1f45a","womans_hat":"1f452","womens":"1f6ba","worried":"1f61f","wrench":"1f527","x":"274c","yellow_heart":"1f49b","yen":"1f4b4","yum":"1f60b","zap":"26a1","zero":"30-20e3","zzz":"1f4a4","100":"1f4af","1234":"1f522"}; - const emoji_keys = Object.keys(emoji_map); + const emojiKeys = Object.keys(emojiMap); extend(ComposerBody.prototype, 'config', function(original, isInitialized) { if (isInitialized) return; @@ -66,6 +66,7 @@ export default function addComposerAutocomplete() { const makeSuggestion = function(key) { const code = ':' + key + ':'; + const imageName = (emojiMap[key].indexOf('-20e3') != -1 || emojiMap[key] == 'a9' || emojiMap[key] == 'ae' ? '00' : '') + emojiMap[key]; return ( @@ -85,15 +86,15 @@ export default function addComposerAutocomplete() { let similarEmoji = []; const fuzzyRegexp = function(str) { - const reEscape = new RegExp("\\(([" + ("+.*?[]{}()^$|\\".replace(/(.)/g, "\\$1")) + "])\\)", "g"); - return new RegExp("(.*)" + (str.toLowerCase().replace(/(.)/g, "($1)(.*?)")).replace(reEscape, "(\\$1)") + "$", "i"); + const reEscape = new RegExp('\\(([' + ('+.*?[]{}()^$|\\'.replace(/(.)/g, '\\$1')) + '])\\)', 'g'); + return new RegExp('(.*)' + (str.toLowerCase().replace(/(.)/g, '($1)(.*?)')).replace(reEscape, '(\\$1)') + '$', 'i'); } const regTyped = fuzzyRegexp(typed); - for (var i=0, maxSuggestions = 7; i < emoji_keys.length && maxSuggestions > 0; i++) { - if(regTyped.test(emoji_keys[i])) { + for (var i=0, maxSuggestions = 7; i < emojiKeys.length && maxSuggestions > 0; i++) { + if(regTyped.test(emojiKeys[i])) { --maxSuggestions; - similarEmoji.push(emoji_keys[i]); + similarEmoji.push(emojiKeys[i]); } } diff --git a/extensions/emoji/src/Listener/FormatEmoticons.php b/extensions/emoji/src/Listener/FormatEmoticons.php index 375b4da1e..6f7b0cfff 100644 --- a/extensions/emoji/src/Listener/FormatEmoticons.php +++ b/extensions/emoji/src/Listener/FormatEmoticons.php @@ -28,8 +28,7 @@ class FormatEmoticons */ public function addEmoticons(ConfigureFormatter $event) { - $event->configurator->Emoji->useTwemoji(); - $event->configurator->Emoji->setImageSize(32); + $event->configurator->Emoji->useEmojiOne(); $event->configurator->Emoji->omitImageSize(); $event->configurator->Emoji->addAlias(':)', '😄'); From 7359407b543db17cef8bb6b8b44c4c171420b2be Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 7 Feb 2016 11:44:48 +1030 Subject: [PATCH 024/154] Tweak emoticon aliases - Make :) and :( map to "slight smile/frown" - Remove :* to solve flarum/core#305 --- extensions/emoji/src/Listener/FormatEmoticons.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/extensions/emoji/src/Listener/FormatEmoticons.php b/extensions/emoji/src/Listener/FormatEmoticons.php index 6f7b0cfff..ef78c7da4 100644 --- a/extensions/emoji/src/Listener/FormatEmoticons.php +++ b/extensions/emoji/src/Listener/FormatEmoticons.php @@ -31,15 +31,13 @@ class FormatEmoticons $event->configurator->Emoji->useEmojiOne(); $event->configurator->Emoji->omitImageSize(); - $event->configurator->Emoji->addAlias(':)', '😄'); + $event->configurator->Emoji->addAlias(':)', '🙂'); $event->configurator->Emoji->addAlias(':D', '😃'); - $event->configurator->Emoji->addAlias(':P', '😜'); - $event->configurator->Emoji->addAlias(':(', '😟'); + $event->configurator->Emoji->addAlias(':P', '😛'); + $event->configurator->Emoji->addAlias(':(', '🙁'); $event->configurator->Emoji->addAlias(':|', '😐'); $event->configurator->Emoji->addAlias(';)', '😉'); - $event->configurator->Emoji->addAlias(':*', '😘'); $event->configurator->Emoji->addAlias(':\'(', '😢'); - $event->configurator->Emoji->addAlias(':\')', '😂'); $event->configurator->Emoji->addAlias(':O', '😮'); $event->configurator->Emoji->addAlias('B)', '😎'); $event->configurator->Emoji->addAlias('>:(', '😡'); From 50d88d4547ce23c067ac15e124b2c583d1ed6270 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 7 Feb 2016 11:47:49 +1030 Subject: [PATCH 025/154] Improve emoji autocomplete dropdown - Add a key to each list item so that Mithril's diffing algorithm is used correctly. This prevents the emoji images from remaining for half a second before they update to a new suggestion. - Clean up styles. The `PostPreview` doesn't really belong here. --- extensions/emoji/js/forum/dist/extension.js | 13 +++++------ .../js/forum/src/addComposerAutocomplete.js | 11 +++++----- .../src/components/AutocompleteDropdown.js | 2 +- extensions/emoji/less/forum/extension.less | 22 +++++-------------- 4 files changed, 17 insertions(+), 31 deletions(-) diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index c66696af3..8308f9f0f 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -202,19 +202,16 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru var imageName = (emojiMap[key].indexOf('-20e3') != -1 || emojiMap[key] == 'a9' || emojiMap[key] == 'ae' ? '00' : '') + emojiMap[key]; return m( 'button', - { className: 'PostPreview', + { + key: key, onclick: function () { return applySuggestion(code); }, onmouseenter: function () { dropdown.setIndex($(this).parent().index()); } }, - m( - 'span', - { className: 'PostPreview-content' }, - m('img', { alt: code, 'class': 'emoji', draggable: 'false', src: '//cdn.jsdelivr.net/emojione/assets/png/' + imageName + '.png' }), - key - ) + m('img', { alt: code, 'class': 'emoji', draggable: 'false', src: '//cdn.jsdelivr.net/emojione/assets/png/' + imageName + '.png' }), + key ); }; @@ -340,7 +337,7 @@ System.register('flarum/emoji/components/AutocompleteDropdown', ['flarum/Compone this.props.items.map(function (item) { return m( 'li', - null, + { key: item.attrs.key }, item ); }) diff --git a/extensions/emoji/js/forum/src/addComposerAutocomplete.js b/extensions/emoji/js/forum/src/addComposerAutocomplete.js index 207b1e16e..ff0bc3379 100644 --- a/extensions/emoji/js/forum/src/addComposerAutocomplete.js +++ b/extensions/emoji/js/forum/src/addComposerAutocomplete.js @@ -68,15 +68,14 @@ export default function addComposerAutocomplete() { const code = ':' + key + ':'; const imageName = (emojiMap[key].indexOf('-20e3') != -1 || emojiMap[key] == 'a9' || emojiMap[key] == 'ae' ? '00' : '') + emojiMap[key]; return ( - ); }; @@ -88,7 +87,7 @@ export default function addComposerAutocomplete() { const fuzzyRegexp = function(str) { const reEscape = new RegExp('\\(([' + ('+.*?[]{}()^$|\\'.replace(/(.)/g, '\\$1')) + '])\\)', 'g'); return new RegExp('(.*)' + (str.toLowerCase().replace(/(.)/g, '($1)(.*?)')).replace(reEscape, '(\\$1)') + '$', 'i'); - } + }; const regTyped = fuzzyRegexp(typed); for (var i=0, maxSuggestions = 7; i < emojiKeys.length && maxSuggestions > 0; i++) { @@ -102,7 +101,7 @@ export default function addComposerAutocomplete() { return a.length - b.length }); - for(let key of similarEmoji) { + for (let key of similarEmoji) { suggestions.push(makeSuggestion(key)); } diff --git a/extensions/emoji/js/forum/src/components/AutocompleteDropdown.js b/extensions/emoji/js/forum/src/components/AutocompleteDropdown.js index 9682e51b1..965911fd3 100644 --- a/extensions/emoji/js/forum/src/components/AutocompleteDropdown.js +++ b/extensions/emoji/js/forum/src/components/AutocompleteDropdown.js @@ -10,7 +10,7 @@ export default class AutocompleteDropdown extends Component { view() { return (
    - {this.props.items.map(item =>
  • {item}
  • )} + {this.props.items.map(item =>
  • {item}
  • )}
); } diff --git a/extensions/emoji/less/forum/extension.less b/extensions/emoji/less/forum/extension.less index 689c80098..5d164eefd 100644 --- a/extensions/emoji/less/forum/extension.less +++ b/extensions/emoji/less/forum/extension.less @@ -11,28 +11,18 @@ img.emoji { position: absolute; margin: 5px 0 !important; - > li > a { - white-space: normal; - border-bottom: 0; - } - - > li > a:hover { - background: none; - } - - .PostPreview { + > li > button { color: @text-color; font-weight: bold; + padding-top: 6px; + padding-bottom: 6px; + padding-left: 45px; .emoji { - margin-right: 5px; + float: left; + margin-left: -30px; } } - .PostPreview-content { - overflow: hidden; - line-height: 1.7em; - display: block; - } } .ComposerBody-emojiWrapper { From 15a87c55ebb733a801775afd5c770fc7471fd9eb Mon Sep 17 00:00:00 2001 From: Sajjad Hasehmian Date: Fri, 12 Feb 2016 20:04:37 +0330 Subject: [PATCH 026/154] improve emoji popup --- extensions/emoji/js/forum/dist/extension.js | 4 ++-- extensions/emoji/js/forum/src/addComposerAutocomplete.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index 8308f9f0f..de0045cbb 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -183,8 +183,8 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru emojiStart = 0; for (var i = cursor - 1; i >= 0; i--) { var character = value.substr(i, 1); - if (/\s/.test(character)) break; - if (character === ':') { + if (!/[a-z0-9]|\+|\-|_|\:/.test(character)) break; + if (character === ':' && (i == 0 || value.substr(i - 1, 1) === ' ')) { emojiStart = i + 1; break; } diff --git a/extensions/emoji/js/forum/src/addComposerAutocomplete.js b/extensions/emoji/js/forum/src/addComposerAutocomplete.js index ff0bc3379..b878b3806 100644 --- a/extensions/emoji/js/forum/src/addComposerAutocomplete.js +++ b/extensions/emoji/js/forum/src/addComposerAutocomplete.js @@ -51,8 +51,8 @@ export default function addComposerAutocomplete() { emojiStart = 0; for (let i = cursor - 1; i >= 0; i--) { const character = value.substr(i, 1); - if (/\s/.test(character)) break; - if (character === ':') { + if (!/[a-z0-9]|\+|\-|_|\:/.test(character)) break; + if (character === ':' && (i == 0 || value.substr(i-1, 1) === ' ')) { emojiStart = i + 1; break; } From 37efc0c6a799a86dc61dadb057f10e013e7bd4ee Mon Sep 17 00:00:00 2001 From: Sajjad Hasehmian Date: Mon, 15 Feb 2016 14:05:35 +0330 Subject: [PATCH 027/154] Update Autocomplete comments --- extensions/emoji/js/forum/dist/extension.js | 7 +++++-- extensions/emoji/js/forum/src/addComposerAutocomplete.js | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index de0045cbb..b5a1ad921 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -176,14 +176,17 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru if (this.selectionEnd - cursor > 0) return; - // Search backwards from the cursor for an ':' symbol, without any - // intervening whitespace. If we find one, we will want to show the + // Search backwards from the cursor for an ':' symbol. If we find + // one and followed by a whitespace, we will want to show the // autocomplete dropdown! var value = this.value; emojiStart = 0; for (var i = cursor - 1; i >= 0; i--) { var character = value.substr(i, 1); + // check what user typed, emoji names only contains alphanumeric, + // underline, '+' and '-' if (!/[a-z0-9]|\+|\-|_|\:/.test(character)) break; + // make sure ':' followed by a whitespace if (character === ':' && (i == 0 || value.substr(i - 1, 1) === ' ')) { emojiStart = i + 1; break; diff --git a/extensions/emoji/js/forum/src/addComposerAutocomplete.js b/extensions/emoji/js/forum/src/addComposerAutocomplete.js index b878b3806..295d5584e 100644 --- a/extensions/emoji/js/forum/src/addComposerAutocomplete.js +++ b/extensions/emoji/js/forum/src/addComposerAutocomplete.js @@ -44,14 +44,17 @@ export default function addComposerAutocomplete() { if (this.selectionEnd - cursor > 0) return; - // Search backwards from the cursor for an ':' symbol, without any - // intervening whitespace. If we find one, we will want to show the + // Search backwards from the cursor for an ':' symbol. If we find + // one and followed by a whitespace, we will want to show the // autocomplete dropdown! const value = this.value; emojiStart = 0; for (let i = cursor - 1; i >= 0; i--) { const character = value.substr(i, 1); + // check what user typed, emoji names only contains alphanumeric, + // underline, '+' and '-' if (!/[a-z0-9]|\+|\-|_|\:/.test(character)) break; + // make sure ':' followed by a whitespace if (character === ':' && (i == 0 || value.substr(i-1, 1) === ' ')) { emojiStart = i + 1; break; From 88bbd8ef3be4c2fc9abd1d251189c1c70cca6623 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 22 Feb 2016 21:51:24 +1030 Subject: [PATCH 028/154] Trigger autocomplete when `:` follows a newline too --- extensions/emoji/js/forum/dist/extension.js | 4 ++-- extensions/emoji/js/forum/src/addComposerAutocomplete.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index b5a1ad921..99a7dd1a2 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -186,8 +186,8 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru // check what user typed, emoji names only contains alphanumeric, // underline, '+' and '-' if (!/[a-z0-9]|\+|\-|_|\:/.test(character)) break; - // make sure ':' followed by a whitespace - if (character === ':' && (i == 0 || value.substr(i - 1, 1) === ' ')) { + // make sure ':' followed by a whitespace or newline + if (character === ':' && (i == 0 || /\s/.test(value.substr(i - 1, 1)))) { emojiStart = i + 1; break; } diff --git a/extensions/emoji/js/forum/src/addComposerAutocomplete.js b/extensions/emoji/js/forum/src/addComposerAutocomplete.js index 295d5584e..449d97f64 100644 --- a/extensions/emoji/js/forum/src/addComposerAutocomplete.js +++ b/extensions/emoji/js/forum/src/addComposerAutocomplete.js @@ -54,8 +54,8 @@ export default function addComposerAutocomplete() { // check what user typed, emoji names only contains alphanumeric, // underline, '+' and '-' if (!/[a-z0-9]|\+|\-|_|\:/.test(character)) break; - // make sure ':' followed by a whitespace - if (character === ':' && (i == 0 || value.substr(i-1, 1) === ' ')) { + // make sure ':' followed by a whitespace or newline + if (character === ':' && (i == 0 || /\s/.test(value.substr(i - 1, 1)))) { emojiStart = i + 1; break; } From d3018a1fc3206386497df089fd7a0ac0882e15a2 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 26 Feb 2016 14:01:58 +1030 Subject: [PATCH 029/154] Add StyleCI config --- extensions/emoji/.styleci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 extensions/emoji/.styleci.yml diff --git a/extensions/emoji/.styleci.yml b/extensions/emoji/.styleci.yml new file mode 100644 index 000000000..00617d9b0 --- /dev/null +++ b/extensions/emoji/.styleci.yml @@ -0,0 +1,13 @@ +preset: recommended + +enabled: + - logical_not_operators_with_successor_space + +disabled: + - align_double_arrow + - multiline_array_trailing_comma + - new_with_braces + - phpdoc_align + - phpdoc_order + - phpdoc_separation + - phpdoc_types From 869277cb106da623c235047d10eaa929fcefeb50 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 25 Feb 2016 22:54:28 -0500 Subject: [PATCH 030/154] Applied fixes from StyleCI --- extensions/emoji/bootstrap.php | 2 +- extensions/emoji/src/Extension.php | 3 ++- extensions/emoji/src/Listener/AddClientAssets.php | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/extensions/emoji/bootstrap.php b/extensions/emoji/bootstrap.php index f632a04d5..b0ee184e2 100644 --- a/extensions/emoji/bootstrap.php +++ b/extensions/emoji/bootstrap.php @@ -15,4 +15,4 @@ use Illuminate\Contracts\Events\Dispatcher; return function (Dispatcher $events) { $events->subscribe(Listener\AddClientAssets::class); $events->subscribe(Listener\FormatEmoticons::class); -}; \ No newline at end of file +}; diff --git a/extensions/emoji/src/Extension.php b/extensions/emoji/src/Extension.php index ad56f2f4a..abe118971 100644 --- a/extensions/emoji/src/Extension.php +++ b/extensions/emoji/src/Extension.php @@ -1,4 +1,5 @@ -isForum()) { $event->addAssets([ - __DIR__ . '/../../js/forum/dist/extension.js', - __DIR__ . '/../../less/forum/extension.less' + __DIR__.'/../../js/forum/dist/extension.js', + __DIR__.'/../../less/forum/extension.less' ]); $event->addBootstrapper('flarum/emoji/main'); } From 87c98b49e72a6079980417d2814b38391df03965 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 7 Mar 2016 22:21:36 +1030 Subject: [PATCH 031/154] Remove old file --- extensions/emoji/src/Extension.php | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 extensions/emoji/src/Extension.php diff --git a/extensions/emoji/src/Extension.php b/extensions/emoji/src/Extension.php deleted file mode 100644 index abe118971..000000000 --- a/extensions/emoji/src/Extension.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Flarum\Emoji; - -use Flarum\Support\Extension as BaseExtension; -use Illuminate\Events\Dispatcher; - -class Extension extends BaseExtension -{ - public function listen(Dispatcher $events) - { - $events->subscribe('Flarum\Emoji\Listeners\AddClientAssets'); - $events->subscribe('Flarum\Emoji\Listeners\AddEmoticons'); - } -} From 45ddf48c69f3b1791bcca584f7d144b9f8c4dad8 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 10 Mar 2016 17:22:49 +1030 Subject: [PATCH 032/154] Clean up linting stuff --- extensions/emoji/.eslintignore | 5 - extensions/emoji/.eslintrc | 176 --------------------------------- extensions/emoji/.php_cs | 26 ----- extensions/emoji/.travis.yml | 23 ----- 4 files changed, 230 deletions(-) delete mode 100644 extensions/emoji/.eslintignore delete mode 100644 extensions/emoji/.eslintrc delete mode 100755 extensions/emoji/.php_cs delete mode 100644 extensions/emoji/.travis.yml diff --git a/extensions/emoji/.eslintignore b/extensions/emoji/.eslintignore deleted file mode 100644 index 86b7c8854..000000000 --- a/extensions/emoji/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -**/bower_components/**/* -**/node_modules/**/* -vendor/**/* -**/Gulpfile.js -**/dist/**/* diff --git a/extensions/emoji/.eslintrc b/extensions/emoji/.eslintrc deleted file mode 100644 index 534b50e27..000000000 --- a/extensions/emoji/.eslintrc +++ /dev/null @@ -1,176 +0,0 @@ -{ - "parser": "babel-eslint", // https://github.com/babel/babel-eslint - "env": { // http://eslint.org/docs/user-guide/configuring.html#specifying-environments - "browser": true // browser global variables - }, - "ecmaFeatures": { - "arrowFunctions": true, - "blockBindings": true, - "classes": true, - "defaultParams": true, - "destructuring": true, - "forOf": true, - "generators": false, - "modules": true, - "objectLiteralComputedProperties": true, - "objectLiteralDuplicateProperties": false, - "objectLiteralShorthandMethods": true, - "objectLiteralShorthandProperties": true, - "spread": true, - "superInFunctions": true, - "templateStrings": true, - "jsx": true - }, - "globals": { - "m": true, - "app": true, - "$": true, - "moment": true - }, - "plugins": [ - "react" - ], - "rules": { - "react/jsx-uses-vars": 1, - -/** - * Strict mode - */ - // babel inserts "use strict"; for us - "strict": [2, "never"], // http://eslint.org/docs/rules/strict - -/** - * ES6 - */ - "no-var": 2, // http://eslint.org/docs/rules/no-var - "prefer-const": 2, // http://eslint.org/docs/rules/prefer-const - -/** - * Variables - */ - "no-shadow": 2, // http://eslint.org/docs/rules/no-shadow - "no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names - "no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars - "vars": "local", - "args": "after-used" - }], - "no-use-before-define": 2, // http://eslint.org/docs/rules/no-use-before-define - -/** - * Possible errors - */ - "comma-dangle": [2, "never"], // http://eslint.org/docs/rules/comma-dangle - "no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign - "no-console": 1, // http://eslint.org/docs/rules/no-console - "no-debugger": 1, // http://eslint.org/docs/rules/no-debugger - "no-alert": 1, // http://eslint.org/docs/rules/no-alert - "no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition - "no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys - "no-duplicate-case": 2, // http://eslint.org/docs/rules/no-duplicate-case - "no-empty": 2, // http://eslint.org/docs/rules/no-empty - "no-ex-assign": 2, // http://eslint.org/docs/rules/no-ex-assign - "no-extra-boolean-cast": 0, // http://eslint.org/docs/rules/no-extra-boolean-cast - "no-extra-semi": 2, // http://eslint.org/docs/rules/no-extra-semi - "no-func-assign": 2, // http://eslint.org/docs/rules/no-func-assign - "no-inner-declarations": 2, // http://eslint.org/docs/rules/no-inner-declarations - "no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp - "no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace - "no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls - "no-reserved-keys": 2, // http://eslint.org/docs/rules/no-reserved-keys - "no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays - "no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable - "use-isnan": 2, // http://eslint.org/docs/rules/use-isnan - "block-scoped-var": 2, // http://eslint.org/docs/rules/block-scoped-var - -/** - * Best practices - */ - "consistent-return": 2, // http://eslint.org/docs/rules/consistent-return - "curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly - "default-case": 2, // http://eslint.org/docs/rules/default-case - "dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation - "allowKeywords": true - }], - "eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq - "no-caller": 2, // http://eslint.org/docs/rules/no-caller - "no-else-return": 2, // http://eslint.org/docs/rules/no-else-return - "no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null - "no-eval": 2, // http://eslint.org/docs/rules/no-eval - "no-extend-native": 2, // http://eslint.org/docs/rules/no-extend-native - "no-extra-bind": 2, // http://eslint.org/docs/rules/no-extra-bind - "no-fallthrough": 2, // http://eslint.org/docs/rules/no-fallthrough - "no-floating-decimal": 2, // http://eslint.org/docs/rules/no-floating-decimal - "no-implied-eval": 2, // http://eslint.org/docs/rules/no-implied-eval - "no-lone-blocks": 2, // http://eslint.org/docs/rules/no-lone-blocks - "no-loop-func": 2, // http://eslint.org/docs/rules/no-loop-func - "no-multi-str": 2, // http://eslint.org/docs/rules/no-multi-str - "no-native-reassign": 2, // http://eslint.org/docs/rules/no-native-reassign - "no-new": 2, // http://eslint.org/docs/rules/no-new - "no-new-func": 2, // http://eslint.org/docs/rules/no-new-func - "no-new-wrappers": 2, // http://eslint.org/docs/rules/no-new-wrappers - "no-octal": 2, // http://eslint.org/docs/rules/no-octal - "no-octal-escape": 2, // http://eslint.org/docs/rules/no-octal-escape - "no-param-reassign": 2, // http://eslint.org/docs/rules/no-param-reassign - "no-proto": 2, // http://eslint.org/docs/rules/no-proto - "no-redeclare": 2, // http://eslint.org/docs/rules/no-redeclare - "no-return-assign": 2, // http://eslint.org/docs/rules/no-return-assign - "no-self-compare": 2, // http://eslint.org/docs/rules/no-self-compare - "no-sequences": 2, // http://eslint.org/docs/rules/no-sequences - "no-throw-literal": 2, // http://eslint.org/docs/rules/no-throw-literal - "no-with": 2, // http://eslint.org/docs/rules/no-with - "radix": 2, // http://eslint.org/docs/rules/radix - "vars-on-top": 2, // http://eslint.org/docs/rules/vars-on-top - "wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife - "yoda": 2, // http://eslint.org/docs/rules/yoda - -/** - * Style - */ - "indent": [2, 2], // http://eslint.org/docs/rules/indent - "brace-style": [2, // http://eslint.org/docs/rules/brace-style - "1tbs", { - "allowSingleLine": true - }], - "quotes": [ - 2, "single", "avoid-escape" // http://eslint.org/docs/rules/quotes - ], - "camelcase": [2, { // http://eslint.org/docs/rules/camelcase - "properties": "never" - }], - "comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing - "before": false, - "after": true - }], - "comma-style": [2, "last"], // http://eslint.org/docs/rules/comma-style - "eol-last": 2, // http://eslint.org/docs/rules/eol-last - "func-names": 1, // http://eslint.org/docs/rules/func-names - "key-spacing": [2, { // http://eslint.org/docs/rules/key-spacing - "beforeColon": false, - "afterColon": true - }], - "new-cap": [2, { // http://eslint.org/docs/rules/new-cap - "newIsCap": true - }], - "no-multiple-empty-lines": [2, { // http://eslint.org/docs/rules/no-multiple-empty-lines - "max": 2 - }], - "no-new-object": 2, // http://eslint.org/docs/rules/no-new-object - "no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func - "no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces - "no-wrap-func": 2, // http://eslint.org/docs/rules/no-wrap-func - "no-underscore-dangle": 0, // http://eslint.org/docs/rules/no-underscore-dangle - "one-var": [2, "never"], // http://eslint.org/docs/rules/one-var - "padded-blocks": [2, "never"], // http://eslint.org/docs/rules/padded-blocks - "semi": [2, "always"], // http://eslint.org/docs/rules/semi - "semi-spacing": [2, { // http://eslint.org/docs/rules/semi-spacing - "before": false, - "after": true - }], - "space-after-keywords": 2, // http://eslint.org/docs/rules/space-after-keywords - "space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks - "space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren - "space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops - "space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case - "spaced-line-comment": 2, // http://eslint.org/docs/rules/spaced-line-comment - } -} diff --git a/extensions/emoji/.php_cs b/extensions/emoji/.php_cs deleted file mode 100755 index 20d29c766..000000000 --- a/extensions/emoji/.php_cs +++ /dev/null @@ -1,26 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header); - -$finder = Symfony\CS\Finder\DefaultFinder::create() - ->exclude('js') - ->exclude('less') - ->in(__DIR__); - -return Symfony\CS\Config\Config::create() - ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) - ->fixers([ - 'short_array_syntax', - 'header_comment', - '-psr0' - ]) - ->finder($finder); diff --git a/extensions/emoji/.travis.yml b/extensions/emoji/.travis.yml deleted file mode 100644 index 692e09f86..000000000 --- a/extensions/emoji/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: php - -php: - - 5.5 - - 5.6 - -matrix: - allow_failures: - - php: hhvm - fast_finish: true - -before_script: - - curl -s http://getcomposer.org/installer | php - - php composer.phar install - -script: - - php composer.phar style - -notifications: - email: - on_failure: change - -sudo: false From fe194a097e730a85ceba463aab4c22d0a7f9098c Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 18 Mar 2016 09:32:03 +1030 Subject: [PATCH 033/154] Upgrade to flarum-gulp 0.2.0 / Babel 6 --- extensions/emoji/js/forum/dist/extension.js | 71 ++++++++++----------- extensions/emoji/js/forum/package.json | 4 +- 2 files changed, 37 insertions(+), 38 deletions(-) diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index 99a7dd1a2..9ff938c4f 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -129,15 +129,10 @@ if (typeof module != 'undefined' && typeof module.exports != 'undefined') { }()); ; -System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flarum/components/ComposerBody', 'flarum/emoji/components/AutocompleteDropdown'], function (_export) { - /*global getCaretCoordinates*/ - - 'use strict'; +'use strict'; +System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flarum/components/ComposerBody', 'flarum/emoji/components/AutocompleteDropdown'], function (_export, _context) { var extend, ComposerBody, AutocompleteDropdown; - - _export('default', addComposerAutocomplete); - function addComposerAutocomplete() { var emojiMap = { "-1": "1f44e", "+1": "1f44d", "8ball": "1f3b1", "a": "1f170", "ab": "1f18e", "abc": "1f524", "abcd": "1f521", "accept": "1f251", "aerial_tramway": "1f6a1", "airplane": "2708", "alarm_clock": "23f0", "alien": "1f47d", "ambulance": "1f691", "anchor": "2693", "angel": "1f47c", "anger": "1f4a2", "angry": "1f620", "anguished": "1f627", "ant": "1f41c", "apple": "1f34e", "aquarius": "2652", "aries": "2648", "arrow_backward": "25c0", "arrow_double_down": "23ec", "arrow_double_up": "23eb", "arrow_down": "2b07", "arrow_down_small": "1f53d", "arrow_forward": "25b6", "arrow_heading_down": "2935", "arrow_heading_up": "2934", "arrow_left": "2b05", "arrow_lower_left": "2199", "arrow_lower_right": "2198", "arrow_right": "27a1", "arrow_right_hook": "21aa", "arrow_up": "2b06", "arrow_up_down": "2195", "arrow_up_small": "1f53c", "arrow_upper_left": "2196", "arrow_upper_right": "2197", "arrows_clockwise": "1f503", "arrows_counterclockwise": "1f504", "art": "1f3a8", "articulated_lorry": "1f69b", "astonished": "1f632", "athletic_shoe": "1f45f", "atm": "1f3e7", "b": "1f171", "baby": "1f476", "baby_bottle": "1f37c", "baby_chick": "1f424", "baby_symbol": "1f6bc", "back": "1f519", "baggage_claim": "1f6c4", "balloon": "1f388", "ballot_box_with_check": "2611", "bamboo": "1f38d", "banana": "1f34c", "bangbang": "203c", "bank": "1f3e6", "bar_chart": "1f4ca", "barber": "1f488", "baseball": "26be", "basketball": "1f3c0", "bath": "1f6c0", "bathtub": "1f6c1", "battery": "1f50b", "bear": "1f43b", "bee": "1f41d", "beer": "1f37a", "beers": "1f37b", "beetle": "1f41e", "beginner": "1f530", "bell": "1f514", "bento": "1f371", "bicyclist": "1f6b4", "bike": "1f6b2", "bikini": "1f459", "bird": "1f426", "birthday": "1f382", "black_circle": "26ab", "black_joker": "1f0cf", "black_large_square": "2b1b", "black_medium_small_square": "25fe", "black_medium_square": "25fc", "black_nib": "2712", "black_small_square": "25aa", "black_square_button": "1f532", "blossom": "1f33c", "blowfish": "1f421", "blue_book": "1f4d8", "blue_car": "1f699", "blue_heart": "1f499", "blush": "1f60a", "boar": "1f417", "boat": "26f5", "bomb": "1f4a3", "book": "1f4d6", "bookmark": "1f516", "bookmark_tabs": "1f4d1", "books": "1f4da", "boom": "1f4a5", "boot": "1f462", "bouquet": "1f490", "bow": "1f647", "bowling": "1f3b3", "boy": "1f466", "bread": "1f35e", "bride_with_veil": "1f470", "bridge_at_night": "1f309", "briefcase": "1f4bc", "broken_heart": "1f494", "bug": "1f41b", "bulb": "1f4a1", "bullettrain_front": "1f685", "bullettrain_side": "1f684", "bus": "1f68c", "busstop": "1f68f", "bust_in_silhouette": "1f464", "busts_in_silhouette": "1f465", "cactus": "1f335", "cake": "1f370", "calendar": "1f4c6", "calling": "1f4f2", "camel": "1f42b", "camera": "1f4f7", "cancer": "264b", "candy": "1f36c", "capital_abcd": "1f520", "capricorn": "2651", "car": "1f697", "card_index": "1f4c7", "carousel_horse": "1f3a0", "cat": "1f431", "cat2": "1f408", "cd": "1f4bf", "chart": "1f4b9", "chart_with_downwards_trend": "1f4c9", "chart_with_upwards_trend": "1f4c8", "checkered_flag": "1f3c1", "cherries": "1f352", "cherry_blossom": "1f338", "chestnut": "1f330", "chicken": "1f414", "children_crossing": "1f6b8", "chocolate_bar": "1f36b", "christmas_tree": "1f384", "church": "26ea", "cinema": "1f3a6", "circus_tent": "1f3aa", "city_sunrise": "1f307", "city_sunset": "1f306", "cl": "1f191", "clap": "1f44f", "clapper": "1f3ac", "clipboard": "1f4cb", "clock1": "1f550", "clock10": "1f559", "clock1030": "1f565", "clock11": "1f55a", "clock1130": "1f566", "clock12": "1f55b", "clock1230": "1f567", "clock130": "1f55c", "clock2": "1f551", "clock230": "1f55d", "clock3": "1f552", "clock330": "1f55e", "clock4": "1f553", "clock430": "1f55f", "clock5": "1f554", "clock530": "1f560", "clock6": "1f555", "clock630": "1f561", "clock7": "1f556", "clock730": "1f562", "clock8": "1f557", "clock830": "1f563", "clock9": "1f558", "clock930": "1f564", "closed_book": "1f4d5", "closed_lock_with_key": "1f510", "closed_umbrella": "1f302", "cloud": "2601", "clubs": "2663", "cn": "1f1e8-1f1f3", "cocktail": "1f378", "coffee": "2615", "cold_sweat": "1f630", "collision": "1f4a5", "computer": "1f4bb", "confetti_ball": "1f38a", "confounded": "1f616", "confused": "1f615", "congratulations": "3297", "construction": "1f6a7", "construction_worker": "1f477", "convenience_store": "1f3ea", "cookie": "1f36a", "cool": "1f192", "cop": "1f46e", "copyright": "a9", "corn": "1f33d", "couple": "1f46b", "couple_with_heart": "1f491", "couplekiss": "1f48f", "cow": "1f42e", "cow2": "1f404", "credit_card": "1f4b3", "crescent_moon": "1f319", "crocodile": "1f40a", "crossed_flags": "1f38c", "crown": "1f451", "cry": "1f622", "crying_cat_face": "1f63f", "crystal_ball": "1f52e", "cupid": "1f498", "curly_loop": "27b0", "currency_exchange": "1f4b1", "curry": "1f35b", "custard": "1f36e", "customs": "1f6c3", "cyclone": "1f300", "dancer": "1f483", "dancers": "1f46f", "dango": "1f361", "dart": "1f3af", "dash": "1f4a8", "date": "1f4c5", "de": "1f1e9-1f1ea", "deciduous_tree": "1f333", "department_store": "1f3ec", "diamond_shape_with_a_dot_inside": "1f4a0", "diamonds": "2666", "disappointed": "1f61e", "disappointed_relieved": "1f625", "dizzy": "1f4ab", "dizzy_face": "1f635", "do_not_litter": "1f6af", "dog": "1f436", "dog2": "1f415", "dollar": "1f4b5", "dolls": "1f38e", "dolphin": "1f42c", "door": "1f6aa", "doughnut": "1f369", "dragon": "1f409", "dragon_face": "1f432", "dress": "1f457", "dromedary_camel": "1f42a", "droplet": "1f4a7", "dvd": "1f4c0", "e-mail": "1f4e7", "ear": "1f442", "ear_of_rice": "1f33e", "earth_africa": "1f30d", "earth_americas": "1f30e", "earth_asia": "1f30f", "egg": "1f373", "eggplant": "1f346", "eight": "38-20e3", "eight_pointed_black_star": "2734", "eight_spoked_asterisk": "2733", "electric_plug": "1f50c", "elephant": "1f418", "email": "2709", "end": "1f51a", "envelope": "2709", "envelope_with_arrow": "1f4e9", "es": "1f1ea-1f1f8", "euro": "1f4b6", "european_castle": "1f3f0", "european_post_office": "1f3e4", "evergreen_tree": "1f332", "exclamation": "2757", "expressionless": "1f611", "eyeglasses": "1f453", "eyes": "1f440", "facepunch": "1f44a", "factory": "1f3ed", "fallen_leaf": "1f342", "family": "1f46a", "fast_forward": "23e9", "fax": "1f4e0", "fearful": "1f628", "feet": "1f43e", "ferris_wheel": "1f3a1", "file_folder": "1f4c1", "fire": "1f525", "fire_engine": "1f692", "fireworks": "1f386", "first_quarter_moon": "1f313", "first_quarter_moon_with_face": "1f31b", "fish": "1f41f", "fish_cake": "1f365", "fishing_pole_and_fish": "1f3a3", "fist": "270a", "five": "35-20e3", "flags": "1f38f", "flashlight": "1f526", "flipper": "1f42c", "floppy_disk": "1f4be", "flower_playing_cards": "1f3b4", "flushed": "1f633", "foggy": "1f301", "football": "1f3c8", "footprints": "1f463", "fork_and_knife": "1f374", "fountain": "26f2", "four": "34-20e3", "four_leaf_clover": "1f340", "fr": "1f1eb-1f1f7", "free": "1f193", "fried_shrimp": "1f364", "fries": "1f35f", "frog": "1f438", "frowning": "1f626", "fuelpump": "26fd", "full_moon": "1f315", "full_moon_with_face": "1f31d", "game_die": "1f3b2", "gb": "1f1ec-1f1e7", "gem": "1f48e", "gemini": "264a", "ghost": "1f47b", "gift": "1f381", "gift_heart": "1f49d", "girl": "1f467", "globe_with_meridians": "1f310", "goat": "1f410", "golf": "26f3", "grapes": "1f347", "green_apple": "1f34f", "green_book": "1f4d7", "green_heart": "1f49a", "grey_exclamation": "2755", "grey_question": "2754", "grimacing": "1f62c", "grin": "1f601", "grinning": "1f600", "guardsman": "1f482", "guitar": "1f3b8", "gun": "1f52b", "haircut": "1f487", "hamburger": "1f354", "hammer": "1f528", "hamster": "1f439", "hand": "270b", "handbag": "1f45c", "hankey": "1f4a9", "hash": "23-20e3", "hatched_chick": "1f425", "hatching_chick": "1f423", "headphones": "1f3a7", "hear_no_evil": "1f649", "heart": "2764", "heart_decoration": "1f49f", "heart_eyes": "1f60d", "heart_eyes_cat": "1f63b", "heartbeat": "1f493", "heartpulse": "1f497", "hearts": "2665", "heavy_check_mark": "2714", "heavy_division_sign": "2797", "heavy_dollar_sign": "1f4b2", "heavy_exclamation_mark": "2757", "heavy_minus_sign": "2796", "heavy_multiplication_x": "2716", "heavy_plus_sign": "2795", "helicopter": "1f681", "herb": "1f33f", "hibiscus": "1f33a", "high_brightness": "1f506", "high_heel": "1f460", "hocho": "1f52a", "honey_pot": "1f36f", "honeybee": "1f41d", "horse": "1f434", "horse_racing": "1f3c7", "hospital": "1f3e5", "hotel": "1f3e8", "hotsprings": "2668", "hourglass": "231b", "hourglass_flowing_sand": "23f3", "house": "1f3e0", "house_with_garden": "1f3e1", "hushed": "1f62f", "ice_cream": "1f368", "icecream": "1f366", "id": "1f194", "ideograph_advantage": "1f250", "imp": "1f47f", "inbox_tray": "1f4e5", "incoming_envelope": "1f4e8", "information_desk_person": "1f481", "information_source": "2139", "innocent": "1f607", "interrobang": "2049", "iphone": "1f4f1", "it": "1f1ee-1f1f9", "izakaya_lantern": "1f3ee", "jack_o_lantern": "1f383", "japan": "1f5fe", "japanese_castle": "1f3ef", "japanese_goblin": "1f47a", "japanese_ogre": "1f479", "jeans": "1f456", "joy": "1f602", "joy_cat": "1f639", "jp": "1f1ef-1f1f5", "key": "1f511", "keycap_ten": "1f51f", "kimono": "1f458", "kiss": "1f48b", "kissing": "1f617", "kissing_cat": "1f63d", "kissing_closed_eyes": "1f61a", "kissing_heart": "1f618", "kissing_smiling_eyes": "1f619", "knife": "1f52a", "koala": "1f428", "koko": "1f201", "kr": "1f1f0-1f1f7", "lantern": "1f3ee", "large_blue_circle": "1f535", "large_blue_diamond": "1f537", "large_orange_diamond": "1f536", "last_quarter_moon": "1f317", "last_quarter_moon_with_face": "1f31c", "laughing": "1f606", "leaves": "1f343", "ledger": "1f4d2", "left_luggage": "1f6c5", "left_right_arrow": "2194", "leftwards_arrow_with_hook": "21a9", "lemon": "1f34b", "leo": "264c", "leopard": "1f406", "libra": "264e", "light_rail": "1f688", "link": "1f517", "lips": "1f444", "lipstick": "1f484", "lock": "1f512", "lock_with_ink_pen": "1f50f", "lollipop": "1f36d", "loop": "27bf", "loud_sound": "1f50a", "loudspeaker": "1f4e2", "love_hotel": "1f3e9", "love_letter": "1f48c", "low_brightness": "1f505", "m": "24c2", "mag": "1f50d", "mag_right": "1f50e", "mahjong": "1f004", "mailbox": "1f4eb", "mailbox_closed": "1f4ea", "mailbox_with_mail": "1f4ec", "mailbox_with_no_mail": "1f4ed", "man": "1f468", "man_with_gua_pi_mao": "1f472", "man_with_turban": "1f473", "mans_shoe": "1f45e", "maple_leaf": "1f341", "mask": "1f637", "massage": "1f486", "meat_on_bone": "1f356", "mega": "1f4e3", "melon": "1f348", "memo": "1f4dd", "mens": "1f6b9", "metro": "1f687", "microphone": "1f3a4", "microscope": "1f52c", "milky_way": "1f30c", "minibus": "1f690", "minidisc": "1f4bd", "mobile_phone_off": "1f4f4", "money_with_wings": "1f4b8", "moneybag": "1f4b0", "monkey": "1f412", "monkey_face": "1f435", "monorail": "1f69d", "moon": "1f314", "mortar_board": "1f393", "mount_fuji": "1f5fb", "mountain_bicyclist": "1f6b5", "mountain_cableway": "1f6a0", "mountain_railway": "1f69e", "mouse": "1f42d", "mouse2": "1f401", "movie_camera": "1f3a5", "moyai": "1f5ff", "muscle": "1f4aa", "mushroom": "1f344", "musical_keyboard": "1f3b9", "musical_note": "1f3b5", "musical_score": "1f3bc", "mute": "1f507", "nail_care": "1f485", "name_badge": "1f4db", "necktie": "1f454", "negative_squared_cross_mark": "274e", "neutral_face": "1f610", "new": "1f195", "new_moon": "1f311", "new_moon_with_face": "1f31a", "newspaper": "1f4f0", "ng": "1f196", "ng_woman": "1f645", "night_with_stars": "1f303", "nine": "39-20e3", "no_bell": "1f515", "no_bicycles": "1f6b3", "no_entry": "26d4", "no_entry_sign": "1f6ab", "no_good": "1f645", "no_mobile_phones": "1f4f5", "no_mouth": "1f636", "no_pedestrians": "1f6b7", "no_smoking": "1f6ad", "non-potable_water": "1f6b1", "nose": "1f443", "notebook": "1f4d3", "notebook_with_decorative_cover": "1f4d4", "notes": "1f3b6", "nut_and_bolt": "1f529", "o": "2b55", "o2": "1f17e", "ocean": "1f30a", "octopus": "1f419", "oden": "1f362", "office": "1f3e2", "ok": "1f197", "ok_hand": "1f44c", "ok_woman": "1f646", "older_man": "1f474", "older_woman": "1f475", "on": "1f51b", "oncoming_automobile": "1f698", "oncoming_bus": "1f68d", "oncoming_police_car": "1f694", "oncoming_taxi": "1f696", "one": "31-20e3", "open_book": "1f4d6", "open_file_folder": "1f4c2", "open_hands": "1f450", "open_mouth": "1f62e", "ophiuchus": "26ce", "orange_book": "1f4d9", "outbox_tray": "1f4e4", "ox": "1f402", "package": "1f4e6", "page_facing_up": "1f4c4", "page_with_curl": "1f4c3", "pager": "1f4df", "palm_tree": "1f334", "panda_face": "1f43c", "paperclip": "1f4ce", "parking": "1f17f", "part_alternation_mark": "303d", "partly_sunny": "26c5", "passport_control": "1f6c2", "paw_prints": "1f43e", "peach": "1f351", "pear": "1f350", "pencil": "1f4dd", "pencil2": "270f", "penguin": "1f427", "pensive": "1f614", "performing_arts": "1f3ad", "persevere": "1f623", "person_frowning": "1f64d", "person_with_blond_hair": "1f471", "person_with_pouting_face": "1f64e", "phone": "260e", "pig": "1f437", "pig2": "1f416", "pig_nose": "1f43d", "pill": "1f48a", "pineapple": "1f34d", "pisces": "2653", "pizza": "1f355", "point_down": "1f447", "point_left": "1f448", "point_right": "1f449", "point_up": "261d", "point_up_2": "1f446", "police_car": "1f693", "poodle": "1f429", "poop": "1f4a9", "post_office": "1f3e3", "postal_horn": "1f4ef", "postbox": "1f4ee", "potable_water": "1f6b0", "pouch": "1f45d", "poultry_leg": "1f357", "pound": "1f4b7", "pout": "1f621", "pouting_cat": "1f63e", "pray": "1f64f", "princess": "1f478", "punch": "1f44a", "purple_heart": "1f49c", "purse": "1f45b", "pushpin": "1f4cc", "put_litter_in_its_place": "1f6ae", "question": "2753", "rabbit": "1f430", "rabbit2": "1f407", "racehorse": "1f40e", "radio": "1f4fb", "radio_button": "1f518", "rage": "1f621", "railway_car": "1f683", "rainbow": "1f308", "raised_hand": "270b", "raised_hands": "1f64c", "raising_hand": "1f64b", "ram": "1f40f", "ramen": "1f35c", "rat": "1f400", "recycle": "267b", "red_car": "1f697", "red_circle": "1f534", "registered": "ae", "relaxed": "263a", "relieved": "1f60c", "repeat": "1f501", "repeat_one": "1f502", "restroom": "1f6bb", "revolving_hearts": "1f49e", "rewind": "23ea", "ribbon": "1f380", "rice": "1f35a", "rice_ball": "1f359", "rice_cracker": "1f358", "rice_scene": "1f391", "ring": "1f48d", "rocket": "1f680", "roller_coaster": "1f3a2", "rooster": "1f413", "rose": "1f339", "rotating_light": "1f6a8", "round_pushpin": "1f4cd", "rowboat": "1f6a3", "ru": "1f1f7-1f1fa", "rugby_football": "1f3c9", "runner": "1f3c3", "running": "1f3c3", "running_shirt_with_sash": "1f3bd", "sa": "1f202", "sagittarius": "2650", "sailboat": "26f5", "sake": "1f376", "sandal": "1f461", "santa": "1f385", "satellite": "1f4e1", "satisfied": "1f606", "saxophone": "1f3b7", "school": "1f3eb", "school_satchel": "1f392", "scissors": "2702", "scorpius": "264f", "scream": "1f631", "scream_cat": "1f640", "scroll": "1f4dc", "seat": "1f4ba", "secret": "3299", "see_no_evil": "1f648", "seedling": "1f331", "seven": "37-20e3", "shaved_ice": "1f367", "sheep": "1f411", "shell": "1f41a", "ship": "1f6a2", "shirt": "1f455", "shit": "1f4a9", "shoe": "1f45e", "shower": "1f6bf", "signal_strength": "1f4f6", "six": "36-20e3", "six_pointed_star": "1f52f", "ski": "1f3bf", "skull": "1f480", "sleeping": "1f634", "sleepy": "1f62a", "slot_machine": "1f3b0", "small_blue_diamond": "1f539", "small_orange_diamond": "1f538", "small_red_triangle": "1f53a", "small_red_triangle_down": "1f53b", "smile": "1f604", "smile_cat": "1f638", "smiley": "1f603", "smiley_cat": "1f63a", "smiling_imp": "1f608", "smirk": "1f60f", "smirk_cat": "1f63c", "smoking": "1f6ac", "snail": "1f40c", "snake": "1f40d", "snowboarder": "1f3c2", "snowflake": "2744", "snowman": "26c4", "sob": "1f62d", "soccer": "26bd", "soon": "1f51c", "sos": "1f198", "sound": "1f509", "space_invader": "1f47e", "spades": "2660", "spaghetti": "1f35d", "sparkle": "2747", "sparkler": "1f387", "sparkles": "2728", "sparkling_heart": "1f496", "speak_no_evil": "1f64a", "speaker": "1f508", "speech_balloon": "1f4ac", "speedboat": "1f6a4", "star": "2b50", "star2": "1f31f", "stars": "1f320", "station": "1f689", "statue_of_liberty": "1f5fd", "steam_locomotive": "1f682", "stew": "1f372", "straight_ruler": "1f4cf", "strawberry": "1f353", "stuck_out_tongue": "1f61b", "stuck_out_tongue_closed_eyes": "1f61d", "stuck_out_tongue_winking_eye": "1f61c", "sun_with_face": "1f31e", "sunflower": "1f33b", "sunglasses": "1f60e", "sunny": "2600", "sunrise": "1f305", "sunrise_over_mountains": "1f304", "surfer": "1f3c4", "sushi": "1f363", "suspension_railway": "1f69f", "sweat": "1f613", "sweat_drops": "1f4a6", "sweat_smile": "1f605", "sweet_potato": "1f360", "swimmer": "1f3ca", "symbols": "1f523", "syringe": "1f489", "tada": "1f389", "tanabata_tree": "1f38b", "tangerine": "1f34a", "taurus": "2649", "taxi": "1f695", "tea": "1f375", "telephone": "260e", "telephone_receiver": "1f4de", "telescope": "1f52d", "tennis": "1f3be", "tent": "26fa", "thought_balloon": "1f4ad", "three": "33-20e3", "thumbsdown": "1f44e", "thumbsup": "1f44d", "ticket": "1f3ab", "tiger": "1f42f", "tiger2": "1f405", "tired_face": "1f62b", "tm": "2122", "toilet": "1f6bd", "tokyo_tower": "1f5fc", "tomato": "1f345", "tongue": "1f445", "top": "1f51d", "tophat": "1f3a9", "tractor": "1f69c", "traffic_light": "1f6a5", "train": "1f68b", "train2": "1f686", "tram": "1f68a", "triangular_flag_on_post": "1f6a9", "triangular_ruler": "1f4d0", "trident": "1f531", "triumph": "1f624", "trolleybus": "1f68e", "trophy": "1f3c6", "tropical_drink": "1f379", "tropical_fish": "1f420", "truck": "1f69a", "trumpet": "1f3ba", "tshirt": "1f455", "tulip": "1f337", "turtle": "1f422", "tv": "1f4fa", "twisted_rightwards_arrows": "1f500", "two": "32-20e3", "two_hearts": "1f495", "two_men_holding_hands": "1f46c", "two_women_holding_hands": "1f46d", "u5272": "1f239", "u5408": "1f234", "u55b6": "1f23a", "u6307": "1f22f", "u6708": "1f237", "u6709": "1f236", "u6e80": "1f235", "u7121": "1f21a", "u7533": "1f238", "u7981": "1f232", "u7a7a": "1f233", "uk": "1f1ec-1f1e7", "umbrella": "2614", "unamused": "1f612", "underage": "1f51e", "unlock": "1f513", "up": "1f199", "us": "1f1fa-1f1f8", "v": "270c", "vertical_traffic_light": "1f6a6", "vhs": "1f4fc", "vibration_mode": "1f4f3", "video_camera": "1f4f9", "video_game": "1f3ae", "violin": "1f3bb", "virgo": "264d", "volcano": "1f30b", "vs": "1f19a", "walking": "1f6b6", "waning_crescent_moon": "1f318", "waning_gibbous_moon": "1f316", "warning": "26a0", "watch": "231a", "water_buffalo": "1f403", "watermelon": "1f349", "wave": "1f44b", "wavy_dash": "3030", "waxing_crescent_moon": "1f312", "waxing_gibbous_moon": "1f314", "wc": "1f6be", "weary": "1f629", "wedding": "1f492", "whale": "1f433", "whale2": "1f40b", "wheelchair": "267f", "white_check_mark": "2705", "white_circle": "26aa", "white_flower": "1f4ae", "white_large_square": "2b1c", "white_medium_small_square": "25fd", "white_medium_square": "25fb", "white_small_square": "25ab", "white_square_button": "1f533", "wind_chime": "1f390", "wine_glass": "1f377", "wink": "1f609", "wolf": "1f43a", "woman": "1f469", "womans_clothes": "1f45a", "womans_hat": "1f452", "womens": "1f6ba", "worried": "1f61f", "wrench": "1f527", "x": "274c", "yellow_heart": "1f49b", "yen": "1f4b4", "yum": "1f60b", "zap": "26a1", "zero": "30-20e3", "zzz": "1f4a4", "100": "1f4af", "1234": "1f522" }; @@ -151,8 +146,8 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru var $container = $('
'); var dropdown = new AutocompleteDropdown({ items: [] }); var $textarea = this.$('textarea').wrap('
'); - var emojiStart = undefined; - var typed = undefined; + var emojiStart = void 0; + var typed = void 0; var applySuggestion = function applySuggestion(replacement) { var insert = replacement + ' '; @@ -207,10 +202,10 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru 'button', { key: key, - onclick: function () { + onclick: function onclick() { return applySuggestion(code); }, - onmouseenter: function () { + onmouseenter: function onmouseenter() { dropdown.setIndex($(this).parent().index()); } }, m('img', { alt: code, 'class': 'emoji', draggable: 'false', src: '//cdn.jsdelivr.net/emojione/assets/png/' + imageName + '.png' }), @@ -254,8 +249,8 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru _iteratorError = err; } finally { try { - if (!_iteratorNormalCompletion && _iterator['return']) { - _iterator['return'](); + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); } } finally { if (_didIteratorError) { @@ -272,16 +267,16 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru var coordinates = getCaretCoordinates(_this, emojiStart); var width = dropdown.$().outerWidth(); var height = dropdown.$().outerHeight(); - var _parent = dropdown.$().offsetParent(); + var parent = dropdown.$().offsetParent(); var left = coordinates.left; - var _top = coordinates.top + 15; - if (_top + height > _parent.height()) { - _top = coordinates.top - height - 15; + var top = coordinates.top + 15; + if (top + height > parent.height()) { + top = coordinates.top - height - 15; } - if (left + width > _parent.width()) { - left = _parent.width() - width; + if (left + width > parent.width()) { + left = parent.width() - width; } - dropdown.show(left, _top); + dropdown.show(left, top); } }; @@ -296,32 +291,36 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru }); } + _export('default', addComposerAutocomplete); + return { setters: [function (_flarumExtend) { + /*global getCaretCoordinates*/ + extend = _flarumExtend.extend; }, function (_flarumComponentsComposerBody) { - ComposerBody = _flarumComponentsComposerBody['default']; + ComposerBody = _flarumComponentsComposerBody.default; }, function (_flarumEmojiComponentsAutocompleteDropdown) { - AutocompleteDropdown = _flarumEmojiComponentsAutocompleteDropdown['default']; + AutocompleteDropdown = _flarumEmojiComponentsAutocompleteDropdown.default; }], execute: function () {} }; });; -System.register('flarum/emoji/components/AutocompleteDropdown', ['flarum/Component'], function (_export) { - 'use strict'; +'use strict'; +System.register('flarum/emoji/components/AutocompleteDropdown', ['flarum/Component'], function (_export, _context) { var Component, AutocompleteDropdown; return { setters: [function (_flarumComponent) { - Component = _flarumComponent['default']; + Component = _flarumComponent.default; }], execute: function () { - AutocompleteDropdown = (function (_Component) { + AutocompleteDropdown = function (_Component) { babelHelpers.inherits(AutocompleteDropdown, _Component); function AutocompleteDropdown() { babelHelpers.classCallCheck(this, AutocompleteDropdown); - babelHelpers.get(Object.getPrototypeOf(AutocompleteDropdown.prototype), 'constructor', this).apply(this, arguments); + return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(AutocompleteDropdown).apply(this, arguments)); } babelHelpers.createClass(AutocompleteDropdown, [{ @@ -364,7 +363,7 @@ System.register('flarum/emoji/components/AutocompleteDropdown', ['flarum/Compone }, { key: 'navigate', value: function navigate(e) { - var _this = this; + var _this2 = this; if (!this.active) return; @@ -375,7 +374,7 @@ System.register('flarum/emoji/components/AutocompleteDropdown', ['flarum/Compone this.setIndex(this.index + (e.which === 40 ? 1 : -1), true); clearTimeout(this.keyWasJustPressedTimeout); this.keyWasJustPressedTimeout = setTimeout(function () { - return _this.keyWasJustPressed = false; + return _this2.keyWasJustPressed = false; }, 500); e.preventDefault(); break; @@ -423,7 +422,7 @@ System.register('flarum/emoji/components/AutocompleteDropdown', ['flarum/Compone var itemTop = $item.offset().top; var itemBottom = itemTop + $item.outerHeight(); - var scrollTop = undefined; + var scrollTop = void 0; if (itemTop < dropdownTop) { scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10); } else if (itemBottom > dropdownBottom) { @@ -437,25 +436,25 @@ System.register('flarum/emoji/components/AutocompleteDropdown', ['flarum/Compone } }]); return AutocompleteDropdown; - })(Component); + }(Component); _export('default', AutocompleteDropdown); } }; });; -System.register('flarum/emoji/main', ['flarum/extend', 'flarum/app', 'flarum/models/Post', 'flarum/emoji/addComposerAutocomplete'], function (_export) { - 'use strict'; +'use strict'; +System.register('flarum/emoji/main', ['flarum/extend', 'flarum/app', 'flarum/models/Post', 'flarum/emoji/addComposerAutocomplete'], function (_export, _context) { var override, app, Post, addComposerAutocomplete; return { setters: [function (_flarumExtend) { override = _flarumExtend.override; }, function (_flarumApp) { - app = _flarumApp['default']; + app = _flarumApp.default; }, function (_flarumModelsPost) { - Post = _flarumModelsPost['default']; + Post = _flarumModelsPost.default; }, function (_flarumEmojiAddComposerAutocomplete) { - addComposerAutocomplete = _flarumEmojiAddComposerAutocomplete['default']; + addComposerAutocomplete = _flarumEmojiAddComposerAutocomplete.default; }], execute: function () { diff --git a/extensions/emoji/js/forum/package.json b/extensions/emoji/js/forum/package.json index 62ea6c691..19a7865d9 100644 --- a/extensions/emoji/js/forum/package.json +++ b/extensions/emoji/js/forum/package.json @@ -1,7 +1,7 @@ { "private": true, "devDependencies": { - "gulp": "^3.8.11", - "flarum-gulp": "^0.1.0" + "gulp": "^3.9.1", + "flarum-gulp": "^0.2.0" } } From 6dd0f040f46b00438abef7806545aa0736a0bf5a Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 29 Mar 2016 18:45:00 +1030 Subject: [PATCH 034/154] Require core v0.1.0-beta.5 --- extensions/emoji/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/emoji/composer.json b/extensions/emoji/composer.json index 376c41ee8..fa3aab0db 100644 --- a/extensions/emoji/composer.json +++ b/extensions/emoji/composer.json @@ -15,7 +15,7 @@ "source": "https://github.com/flarum/flarum-ext-emoji" }, "require": { - "flarum/core": "^0.1.0-beta.3" + "flarum/core": "^0.1.0-beta.5" }, "autoload": { "psr-4": { From c67091709c291dd1b5f42196d9299253e9e9b027 Mon Sep 17 00:00:00 2001 From: cestrensem Date: Sat, 14 May 2016 16:13:03 +0300 Subject: [PATCH 035/154] New icons (#7) * Icons placed separately * Actualized iconpack * import new icons from separate file --- extensions/emoji/js/forum/dist/extension.js | 2079 ++++++++++++++++- .../js/forum/src/addComposerAutocomplete.js | 3 +- .../emoji/js/forum/src/helpers/emojiMap.js | 2062 ++++++++++++++++ 3 files changed, 4138 insertions(+), 6 deletions(-) create mode 100644 extensions/emoji/js/forum/src/helpers/emojiMap.js diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index 9ff938c4f..ff1462373 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -131,12 +131,10 @@ if (typeof module != 'undefined' && typeof module.exports != 'undefined') { ; 'use strict'; -System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flarum/components/ComposerBody', 'flarum/emoji/components/AutocompleteDropdown'], function (_export, _context) { - var extend, ComposerBody, AutocompleteDropdown; +System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flarum/components/ComposerBody', 'flarum/emoji/helpers/emojiMap', 'flarum/emoji/components/AutocompleteDropdown'], function (_export, _context) { + var extend, ComposerBody, emojiMap, AutocompleteDropdown; function addComposerAutocomplete() { - var emojiMap = { "-1": "1f44e", "+1": "1f44d", "8ball": "1f3b1", "a": "1f170", "ab": "1f18e", "abc": "1f524", "abcd": "1f521", "accept": "1f251", "aerial_tramway": "1f6a1", "airplane": "2708", "alarm_clock": "23f0", "alien": "1f47d", "ambulance": "1f691", "anchor": "2693", "angel": "1f47c", "anger": "1f4a2", "angry": "1f620", "anguished": "1f627", "ant": "1f41c", "apple": "1f34e", "aquarius": "2652", "aries": "2648", "arrow_backward": "25c0", "arrow_double_down": "23ec", "arrow_double_up": "23eb", "arrow_down": "2b07", "arrow_down_small": "1f53d", "arrow_forward": "25b6", "arrow_heading_down": "2935", "arrow_heading_up": "2934", "arrow_left": "2b05", "arrow_lower_left": "2199", "arrow_lower_right": "2198", "arrow_right": "27a1", "arrow_right_hook": "21aa", "arrow_up": "2b06", "arrow_up_down": "2195", "arrow_up_small": "1f53c", "arrow_upper_left": "2196", "arrow_upper_right": "2197", "arrows_clockwise": "1f503", "arrows_counterclockwise": "1f504", "art": "1f3a8", "articulated_lorry": "1f69b", "astonished": "1f632", "athletic_shoe": "1f45f", "atm": "1f3e7", "b": "1f171", "baby": "1f476", "baby_bottle": "1f37c", "baby_chick": "1f424", "baby_symbol": "1f6bc", "back": "1f519", "baggage_claim": "1f6c4", "balloon": "1f388", "ballot_box_with_check": "2611", "bamboo": "1f38d", "banana": "1f34c", "bangbang": "203c", "bank": "1f3e6", "bar_chart": "1f4ca", "barber": "1f488", "baseball": "26be", "basketball": "1f3c0", "bath": "1f6c0", "bathtub": "1f6c1", "battery": "1f50b", "bear": "1f43b", "bee": "1f41d", "beer": "1f37a", "beers": "1f37b", "beetle": "1f41e", "beginner": "1f530", "bell": "1f514", "bento": "1f371", "bicyclist": "1f6b4", "bike": "1f6b2", "bikini": "1f459", "bird": "1f426", "birthday": "1f382", "black_circle": "26ab", "black_joker": "1f0cf", "black_large_square": "2b1b", "black_medium_small_square": "25fe", "black_medium_square": "25fc", "black_nib": "2712", "black_small_square": "25aa", "black_square_button": "1f532", "blossom": "1f33c", "blowfish": "1f421", "blue_book": "1f4d8", "blue_car": "1f699", "blue_heart": "1f499", "blush": "1f60a", "boar": "1f417", "boat": "26f5", "bomb": "1f4a3", "book": "1f4d6", "bookmark": "1f516", "bookmark_tabs": "1f4d1", "books": "1f4da", "boom": "1f4a5", "boot": "1f462", "bouquet": "1f490", "bow": "1f647", "bowling": "1f3b3", "boy": "1f466", "bread": "1f35e", "bride_with_veil": "1f470", "bridge_at_night": "1f309", "briefcase": "1f4bc", "broken_heart": "1f494", "bug": "1f41b", "bulb": "1f4a1", "bullettrain_front": "1f685", "bullettrain_side": "1f684", "bus": "1f68c", "busstop": "1f68f", "bust_in_silhouette": "1f464", "busts_in_silhouette": "1f465", "cactus": "1f335", "cake": "1f370", "calendar": "1f4c6", "calling": "1f4f2", "camel": "1f42b", "camera": "1f4f7", "cancer": "264b", "candy": "1f36c", "capital_abcd": "1f520", "capricorn": "2651", "car": "1f697", "card_index": "1f4c7", "carousel_horse": "1f3a0", "cat": "1f431", "cat2": "1f408", "cd": "1f4bf", "chart": "1f4b9", "chart_with_downwards_trend": "1f4c9", "chart_with_upwards_trend": "1f4c8", "checkered_flag": "1f3c1", "cherries": "1f352", "cherry_blossom": "1f338", "chestnut": "1f330", "chicken": "1f414", "children_crossing": "1f6b8", "chocolate_bar": "1f36b", "christmas_tree": "1f384", "church": "26ea", "cinema": "1f3a6", "circus_tent": "1f3aa", "city_sunrise": "1f307", "city_sunset": "1f306", "cl": "1f191", "clap": "1f44f", "clapper": "1f3ac", "clipboard": "1f4cb", "clock1": "1f550", "clock10": "1f559", "clock1030": "1f565", "clock11": "1f55a", "clock1130": "1f566", "clock12": "1f55b", "clock1230": "1f567", "clock130": "1f55c", "clock2": "1f551", "clock230": "1f55d", "clock3": "1f552", "clock330": "1f55e", "clock4": "1f553", "clock430": "1f55f", "clock5": "1f554", "clock530": "1f560", "clock6": "1f555", "clock630": "1f561", "clock7": "1f556", "clock730": "1f562", "clock8": "1f557", "clock830": "1f563", "clock9": "1f558", "clock930": "1f564", "closed_book": "1f4d5", "closed_lock_with_key": "1f510", "closed_umbrella": "1f302", "cloud": "2601", "clubs": "2663", "cn": "1f1e8-1f1f3", "cocktail": "1f378", "coffee": "2615", "cold_sweat": "1f630", "collision": "1f4a5", "computer": "1f4bb", "confetti_ball": "1f38a", "confounded": "1f616", "confused": "1f615", "congratulations": "3297", "construction": "1f6a7", "construction_worker": "1f477", "convenience_store": "1f3ea", "cookie": "1f36a", "cool": "1f192", "cop": "1f46e", "copyright": "a9", "corn": "1f33d", "couple": "1f46b", "couple_with_heart": "1f491", "couplekiss": "1f48f", "cow": "1f42e", "cow2": "1f404", "credit_card": "1f4b3", "crescent_moon": "1f319", "crocodile": "1f40a", "crossed_flags": "1f38c", "crown": "1f451", "cry": "1f622", "crying_cat_face": "1f63f", "crystal_ball": "1f52e", "cupid": "1f498", "curly_loop": "27b0", "currency_exchange": "1f4b1", "curry": "1f35b", "custard": "1f36e", "customs": "1f6c3", "cyclone": "1f300", "dancer": "1f483", "dancers": "1f46f", "dango": "1f361", "dart": "1f3af", "dash": "1f4a8", "date": "1f4c5", "de": "1f1e9-1f1ea", "deciduous_tree": "1f333", "department_store": "1f3ec", "diamond_shape_with_a_dot_inside": "1f4a0", "diamonds": "2666", "disappointed": "1f61e", "disappointed_relieved": "1f625", "dizzy": "1f4ab", "dizzy_face": "1f635", "do_not_litter": "1f6af", "dog": "1f436", "dog2": "1f415", "dollar": "1f4b5", "dolls": "1f38e", "dolphin": "1f42c", "door": "1f6aa", "doughnut": "1f369", "dragon": "1f409", "dragon_face": "1f432", "dress": "1f457", "dromedary_camel": "1f42a", "droplet": "1f4a7", "dvd": "1f4c0", "e-mail": "1f4e7", "ear": "1f442", "ear_of_rice": "1f33e", "earth_africa": "1f30d", "earth_americas": "1f30e", "earth_asia": "1f30f", "egg": "1f373", "eggplant": "1f346", "eight": "38-20e3", "eight_pointed_black_star": "2734", "eight_spoked_asterisk": "2733", "electric_plug": "1f50c", "elephant": "1f418", "email": "2709", "end": "1f51a", "envelope": "2709", "envelope_with_arrow": "1f4e9", "es": "1f1ea-1f1f8", "euro": "1f4b6", "european_castle": "1f3f0", "european_post_office": "1f3e4", "evergreen_tree": "1f332", "exclamation": "2757", "expressionless": "1f611", "eyeglasses": "1f453", "eyes": "1f440", "facepunch": "1f44a", "factory": "1f3ed", "fallen_leaf": "1f342", "family": "1f46a", "fast_forward": "23e9", "fax": "1f4e0", "fearful": "1f628", "feet": "1f43e", "ferris_wheel": "1f3a1", "file_folder": "1f4c1", "fire": "1f525", "fire_engine": "1f692", "fireworks": "1f386", "first_quarter_moon": "1f313", "first_quarter_moon_with_face": "1f31b", "fish": "1f41f", "fish_cake": "1f365", "fishing_pole_and_fish": "1f3a3", "fist": "270a", "five": "35-20e3", "flags": "1f38f", "flashlight": "1f526", "flipper": "1f42c", "floppy_disk": "1f4be", "flower_playing_cards": "1f3b4", "flushed": "1f633", "foggy": "1f301", "football": "1f3c8", "footprints": "1f463", "fork_and_knife": "1f374", "fountain": "26f2", "four": "34-20e3", "four_leaf_clover": "1f340", "fr": "1f1eb-1f1f7", "free": "1f193", "fried_shrimp": "1f364", "fries": "1f35f", "frog": "1f438", "frowning": "1f626", "fuelpump": "26fd", "full_moon": "1f315", "full_moon_with_face": "1f31d", "game_die": "1f3b2", "gb": "1f1ec-1f1e7", "gem": "1f48e", "gemini": "264a", "ghost": "1f47b", "gift": "1f381", "gift_heart": "1f49d", "girl": "1f467", "globe_with_meridians": "1f310", "goat": "1f410", "golf": "26f3", "grapes": "1f347", "green_apple": "1f34f", "green_book": "1f4d7", "green_heart": "1f49a", "grey_exclamation": "2755", "grey_question": "2754", "grimacing": "1f62c", "grin": "1f601", "grinning": "1f600", "guardsman": "1f482", "guitar": "1f3b8", "gun": "1f52b", "haircut": "1f487", "hamburger": "1f354", "hammer": "1f528", "hamster": "1f439", "hand": "270b", "handbag": "1f45c", "hankey": "1f4a9", "hash": "23-20e3", "hatched_chick": "1f425", "hatching_chick": "1f423", "headphones": "1f3a7", "hear_no_evil": "1f649", "heart": "2764", "heart_decoration": "1f49f", "heart_eyes": "1f60d", "heart_eyes_cat": "1f63b", "heartbeat": "1f493", "heartpulse": "1f497", "hearts": "2665", "heavy_check_mark": "2714", "heavy_division_sign": "2797", "heavy_dollar_sign": "1f4b2", "heavy_exclamation_mark": "2757", "heavy_minus_sign": "2796", "heavy_multiplication_x": "2716", "heavy_plus_sign": "2795", "helicopter": "1f681", "herb": "1f33f", "hibiscus": "1f33a", "high_brightness": "1f506", "high_heel": "1f460", "hocho": "1f52a", "honey_pot": "1f36f", "honeybee": "1f41d", "horse": "1f434", "horse_racing": "1f3c7", "hospital": "1f3e5", "hotel": "1f3e8", "hotsprings": "2668", "hourglass": "231b", "hourglass_flowing_sand": "23f3", "house": "1f3e0", "house_with_garden": "1f3e1", "hushed": "1f62f", "ice_cream": "1f368", "icecream": "1f366", "id": "1f194", "ideograph_advantage": "1f250", "imp": "1f47f", "inbox_tray": "1f4e5", "incoming_envelope": "1f4e8", "information_desk_person": "1f481", "information_source": "2139", "innocent": "1f607", "interrobang": "2049", "iphone": "1f4f1", "it": "1f1ee-1f1f9", "izakaya_lantern": "1f3ee", "jack_o_lantern": "1f383", "japan": "1f5fe", "japanese_castle": "1f3ef", "japanese_goblin": "1f47a", "japanese_ogre": "1f479", "jeans": "1f456", "joy": "1f602", "joy_cat": "1f639", "jp": "1f1ef-1f1f5", "key": "1f511", "keycap_ten": "1f51f", "kimono": "1f458", "kiss": "1f48b", "kissing": "1f617", "kissing_cat": "1f63d", "kissing_closed_eyes": "1f61a", "kissing_heart": "1f618", "kissing_smiling_eyes": "1f619", "knife": "1f52a", "koala": "1f428", "koko": "1f201", "kr": "1f1f0-1f1f7", "lantern": "1f3ee", "large_blue_circle": "1f535", "large_blue_diamond": "1f537", "large_orange_diamond": "1f536", "last_quarter_moon": "1f317", "last_quarter_moon_with_face": "1f31c", "laughing": "1f606", "leaves": "1f343", "ledger": "1f4d2", "left_luggage": "1f6c5", "left_right_arrow": "2194", "leftwards_arrow_with_hook": "21a9", "lemon": "1f34b", "leo": "264c", "leopard": "1f406", "libra": "264e", "light_rail": "1f688", "link": "1f517", "lips": "1f444", "lipstick": "1f484", "lock": "1f512", "lock_with_ink_pen": "1f50f", "lollipop": "1f36d", "loop": "27bf", "loud_sound": "1f50a", "loudspeaker": "1f4e2", "love_hotel": "1f3e9", "love_letter": "1f48c", "low_brightness": "1f505", "m": "24c2", "mag": "1f50d", "mag_right": "1f50e", "mahjong": "1f004", "mailbox": "1f4eb", "mailbox_closed": "1f4ea", "mailbox_with_mail": "1f4ec", "mailbox_with_no_mail": "1f4ed", "man": "1f468", "man_with_gua_pi_mao": "1f472", "man_with_turban": "1f473", "mans_shoe": "1f45e", "maple_leaf": "1f341", "mask": "1f637", "massage": "1f486", "meat_on_bone": "1f356", "mega": "1f4e3", "melon": "1f348", "memo": "1f4dd", "mens": "1f6b9", "metro": "1f687", "microphone": "1f3a4", "microscope": "1f52c", "milky_way": "1f30c", "minibus": "1f690", "minidisc": "1f4bd", "mobile_phone_off": "1f4f4", "money_with_wings": "1f4b8", "moneybag": "1f4b0", "monkey": "1f412", "monkey_face": "1f435", "monorail": "1f69d", "moon": "1f314", "mortar_board": "1f393", "mount_fuji": "1f5fb", "mountain_bicyclist": "1f6b5", "mountain_cableway": "1f6a0", "mountain_railway": "1f69e", "mouse": "1f42d", "mouse2": "1f401", "movie_camera": "1f3a5", "moyai": "1f5ff", "muscle": "1f4aa", "mushroom": "1f344", "musical_keyboard": "1f3b9", "musical_note": "1f3b5", "musical_score": "1f3bc", "mute": "1f507", "nail_care": "1f485", "name_badge": "1f4db", "necktie": "1f454", "negative_squared_cross_mark": "274e", "neutral_face": "1f610", "new": "1f195", "new_moon": "1f311", "new_moon_with_face": "1f31a", "newspaper": "1f4f0", "ng": "1f196", "ng_woman": "1f645", "night_with_stars": "1f303", "nine": "39-20e3", "no_bell": "1f515", "no_bicycles": "1f6b3", "no_entry": "26d4", "no_entry_sign": "1f6ab", "no_good": "1f645", "no_mobile_phones": "1f4f5", "no_mouth": "1f636", "no_pedestrians": "1f6b7", "no_smoking": "1f6ad", "non-potable_water": "1f6b1", "nose": "1f443", "notebook": "1f4d3", "notebook_with_decorative_cover": "1f4d4", "notes": "1f3b6", "nut_and_bolt": "1f529", "o": "2b55", "o2": "1f17e", "ocean": "1f30a", "octopus": "1f419", "oden": "1f362", "office": "1f3e2", "ok": "1f197", "ok_hand": "1f44c", "ok_woman": "1f646", "older_man": "1f474", "older_woman": "1f475", "on": "1f51b", "oncoming_automobile": "1f698", "oncoming_bus": "1f68d", "oncoming_police_car": "1f694", "oncoming_taxi": "1f696", "one": "31-20e3", "open_book": "1f4d6", "open_file_folder": "1f4c2", "open_hands": "1f450", "open_mouth": "1f62e", "ophiuchus": "26ce", "orange_book": "1f4d9", "outbox_tray": "1f4e4", "ox": "1f402", "package": "1f4e6", "page_facing_up": "1f4c4", "page_with_curl": "1f4c3", "pager": "1f4df", "palm_tree": "1f334", "panda_face": "1f43c", "paperclip": "1f4ce", "parking": "1f17f", "part_alternation_mark": "303d", "partly_sunny": "26c5", "passport_control": "1f6c2", "paw_prints": "1f43e", "peach": "1f351", "pear": "1f350", "pencil": "1f4dd", "pencil2": "270f", "penguin": "1f427", "pensive": "1f614", "performing_arts": "1f3ad", "persevere": "1f623", "person_frowning": "1f64d", "person_with_blond_hair": "1f471", "person_with_pouting_face": "1f64e", "phone": "260e", "pig": "1f437", "pig2": "1f416", "pig_nose": "1f43d", "pill": "1f48a", "pineapple": "1f34d", "pisces": "2653", "pizza": "1f355", "point_down": "1f447", "point_left": "1f448", "point_right": "1f449", "point_up": "261d", "point_up_2": "1f446", "police_car": "1f693", "poodle": "1f429", "poop": "1f4a9", "post_office": "1f3e3", "postal_horn": "1f4ef", "postbox": "1f4ee", "potable_water": "1f6b0", "pouch": "1f45d", "poultry_leg": "1f357", "pound": "1f4b7", "pout": "1f621", "pouting_cat": "1f63e", "pray": "1f64f", "princess": "1f478", "punch": "1f44a", "purple_heart": "1f49c", "purse": "1f45b", "pushpin": "1f4cc", "put_litter_in_its_place": "1f6ae", "question": "2753", "rabbit": "1f430", "rabbit2": "1f407", "racehorse": "1f40e", "radio": "1f4fb", "radio_button": "1f518", "rage": "1f621", "railway_car": "1f683", "rainbow": "1f308", "raised_hand": "270b", "raised_hands": "1f64c", "raising_hand": "1f64b", "ram": "1f40f", "ramen": "1f35c", "rat": "1f400", "recycle": "267b", "red_car": "1f697", "red_circle": "1f534", "registered": "ae", "relaxed": "263a", "relieved": "1f60c", "repeat": "1f501", "repeat_one": "1f502", "restroom": "1f6bb", "revolving_hearts": "1f49e", "rewind": "23ea", "ribbon": "1f380", "rice": "1f35a", "rice_ball": "1f359", "rice_cracker": "1f358", "rice_scene": "1f391", "ring": "1f48d", "rocket": "1f680", "roller_coaster": "1f3a2", "rooster": "1f413", "rose": "1f339", "rotating_light": "1f6a8", "round_pushpin": "1f4cd", "rowboat": "1f6a3", "ru": "1f1f7-1f1fa", "rugby_football": "1f3c9", "runner": "1f3c3", "running": "1f3c3", "running_shirt_with_sash": "1f3bd", "sa": "1f202", "sagittarius": "2650", "sailboat": "26f5", "sake": "1f376", "sandal": "1f461", "santa": "1f385", "satellite": "1f4e1", "satisfied": "1f606", "saxophone": "1f3b7", "school": "1f3eb", "school_satchel": "1f392", "scissors": "2702", "scorpius": "264f", "scream": "1f631", "scream_cat": "1f640", "scroll": "1f4dc", "seat": "1f4ba", "secret": "3299", "see_no_evil": "1f648", "seedling": "1f331", "seven": "37-20e3", "shaved_ice": "1f367", "sheep": "1f411", "shell": "1f41a", "ship": "1f6a2", "shirt": "1f455", "shit": "1f4a9", "shoe": "1f45e", "shower": "1f6bf", "signal_strength": "1f4f6", "six": "36-20e3", "six_pointed_star": "1f52f", "ski": "1f3bf", "skull": "1f480", "sleeping": "1f634", "sleepy": "1f62a", "slot_machine": "1f3b0", "small_blue_diamond": "1f539", "small_orange_diamond": "1f538", "small_red_triangle": "1f53a", "small_red_triangle_down": "1f53b", "smile": "1f604", "smile_cat": "1f638", "smiley": "1f603", "smiley_cat": "1f63a", "smiling_imp": "1f608", "smirk": "1f60f", "smirk_cat": "1f63c", "smoking": "1f6ac", "snail": "1f40c", "snake": "1f40d", "snowboarder": "1f3c2", "snowflake": "2744", "snowman": "26c4", "sob": "1f62d", "soccer": "26bd", "soon": "1f51c", "sos": "1f198", "sound": "1f509", "space_invader": "1f47e", "spades": "2660", "spaghetti": "1f35d", "sparkle": "2747", "sparkler": "1f387", "sparkles": "2728", "sparkling_heart": "1f496", "speak_no_evil": "1f64a", "speaker": "1f508", "speech_balloon": "1f4ac", "speedboat": "1f6a4", "star": "2b50", "star2": "1f31f", "stars": "1f320", "station": "1f689", "statue_of_liberty": "1f5fd", "steam_locomotive": "1f682", "stew": "1f372", "straight_ruler": "1f4cf", "strawberry": "1f353", "stuck_out_tongue": "1f61b", "stuck_out_tongue_closed_eyes": "1f61d", "stuck_out_tongue_winking_eye": "1f61c", "sun_with_face": "1f31e", "sunflower": "1f33b", "sunglasses": "1f60e", "sunny": "2600", "sunrise": "1f305", "sunrise_over_mountains": "1f304", "surfer": "1f3c4", "sushi": "1f363", "suspension_railway": "1f69f", "sweat": "1f613", "sweat_drops": "1f4a6", "sweat_smile": "1f605", "sweet_potato": "1f360", "swimmer": "1f3ca", "symbols": "1f523", "syringe": "1f489", "tada": "1f389", "tanabata_tree": "1f38b", "tangerine": "1f34a", "taurus": "2649", "taxi": "1f695", "tea": "1f375", "telephone": "260e", "telephone_receiver": "1f4de", "telescope": "1f52d", "tennis": "1f3be", "tent": "26fa", "thought_balloon": "1f4ad", "three": "33-20e3", "thumbsdown": "1f44e", "thumbsup": "1f44d", "ticket": "1f3ab", "tiger": "1f42f", "tiger2": "1f405", "tired_face": "1f62b", "tm": "2122", "toilet": "1f6bd", "tokyo_tower": "1f5fc", "tomato": "1f345", "tongue": "1f445", "top": "1f51d", "tophat": "1f3a9", "tractor": "1f69c", "traffic_light": "1f6a5", "train": "1f68b", "train2": "1f686", "tram": "1f68a", "triangular_flag_on_post": "1f6a9", "triangular_ruler": "1f4d0", "trident": "1f531", "triumph": "1f624", "trolleybus": "1f68e", "trophy": "1f3c6", "tropical_drink": "1f379", "tropical_fish": "1f420", "truck": "1f69a", "trumpet": "1f3ba", "tshirt": "1f455", "tulip": "1f337", "turtle": "1f422", "tv": "1f4fa", "twisted_rightwards_arrows": "1f500", "two": "32-20e3", "two_hearts": "1f495", "two_men_holding_hands": "1f46c", "two_women_holding_hands": "1f46d", "u5272": "1f239", "u5408": "1f234", "u55b6": "1f23a", "u6307": "1f22f", "u6708": "1f237", "u6709": "1f236", "u6e80": "1f235", "u7121": "1f21a", "u7533": "1f238", "u7981": "1f232", "u7a7a": "1f233", "uk": "1f1ec-1f1e7", "umbrella": "2614", "unamused": "1f612", "underage": "1f51e", "unlock": "1f513", "up": "1f199", "us": "1f1fa-1f1f8", "v": "270c", "vertical_traffic_light": "1f6a6", "vhs": "1f4fc", "vibration_mode": "1f4f3", "video_camera": "1f4f9", "video_game": "1f3ae", "violin": "1f3bb", "virgo": "264d", "volcano": "1f30b", "vs": "1f19a", "walking": "1f6b6", "waning_crescent_moon": "1f318", "waning_gibbous_moon": "1f316", "warning": "26a0", "watch": "231a", "water_buffalo": "1f403", "watermelon": "1f349", "wave": "1f44b", "wavy_dash": "3030", "waxing_crescent_moon": "1f312", "waxing_gibbous_moon": "1f314", "wc": "1f6be", "weary": "1f629", "wedding": "1f492", "whale": "1f433", "whale2": "1f40b", "wheelchair": "267f", "white_check_mark": "2705", "white_circle": "26aa", "white_flower": "1f4ae", "white_large_square": "2b1c", "white_medium_small_square": "25fd", "white_medium_square": "25fb", "white_small_square": "25ab", "white_square_button": "1f533", "wind_chime": "1f390", "wine_glass": "1f377", "wink": "1f609", "wolf": "1f43a", "woman": "1f469", "womans_clothes": "1f45a", "womans_hat": "1f452", "womens": "1f6ba", "worried": "1f61f", "wrench": "1f527", "x": "274c", "yellow_heart": "1f49b", "yen": "1f4b4", "yum": "1f60b", "zap": "26a1", "zero": "30-20e3", "zzz": "1f4a4", "100": "1f4af", "1234": "1f522" }; - var emojiKeys = Object.keys(emojiMap); extend(ComposerBody.prototype, 'config', function (original, isInitialized) { @@ -300,6 +298,8 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru extend = _flarumExtend.extend; }, function (_flarumComponentsComposerBody) { ComposerBody = _flarumComponentsComposerBody.default; + }, function (_flarumEmojiHelpersEmojiMap) { + emojiMap = _flarumEmojiHelpersEmojiMap.default; }, function (_flarumEmojiComponentsAutocompleteDropdown) { AutocompleteDropdown = _flarumEmojiComponentsAutocompleteDropdown.default; }], @@ -444,6 +444,2077 @@ System.register('flarum/emoji/components/AutocompleteDropdown', ['flarum/Compone });; 'use strict'; +System.register('flarum/emoji/helpers/emojiMap', [], function (_export, _context) { + return { + setters: [], + execute: function () { + _export('default', { + 'hash': '0023-20e3', + 'zero': '0030-20e3', + 'one': '0031-20e3', + 'two': '0032-20e3', + 'three': '0033-20e3', + 'four': '0034-20e3', + 'five': '0035-20e3', + 'six': '0036-20e3', + 'seven': '0037-20e3', + 'eight': '0038-20e3', + 'nine': '0039-20e3', + 'copyright': '00a9', + 'registered': '00ae', + 'bangbang': '203c', + 'interrobang': '2049', + 'tm': '2122', + 'information_source': '2139', + 'left_right_arrow': '2194', + 'arrow_up_down': '2195', + 'arrow_upper_left': '2196', + 'arrow_upper_right': '2197', + 'arrow_lower_right': '2198', + 'arrow_lower_left': '2199', + 'leftwards_arrow_with_hook': '21a9', + 'arrow_right_hook': '21aa', + 'watch': '231a', + 'hourglass': '231b', + 'fast_forward': '23e9', + 'rewind': '23ea', + 'arrow_double_up': '23eb', + 'arrow_double_down': '23ec', + 'alarm_clock': '23f0', + 'hourglass_flowing_sand': '23f3', + 'm': '24c2', + 'black_small_square': '25aa', + 'white_small_square': '25ab', + 'arrow_forward': '25b6', + 'arrow_backward': '25c0', + 'white_medium_square': '25fb', + 'black_medium_square': '25fc', + 'white_medium_small_square': '25fd', + 'black_medium_small_square': '25fe', + 'sunny': '2600', + 'cloud': '2601', + 'telephone': '260e', + 'ballot_box_with_check': '2611', + 'umbrella': '2614', + 'coffee': '2615', + 'point_up': '261d', + 'relaxed': '263a', + 'aries': '2648', + 'taurus': '2649', + 'gemini': '264a', + 'cancer': '264b', + 'leo': '264c', + 'virgo': '264d', + 'libra': '264e', + 'scorpius': '264f', + 'sagittarius': '2650', + 'capricorn': '2651', + 'aquarius': '2652', + 'pisces': '2653', + 'spades': '2660', + 'clubs': '2663', + 'hearts': '2665', + 'diamonds': '2666', + 'hotsprings': '2668', + 'recycle': '267b', + 'wheelchair': '267f', + 'anchor': '2693', + 'warning': '26a0', + 'zap': '26a1', + 'white_circle': '26aa', + 'black_circle': '26ab', + 'soccer': '26bd', + 'baseball': '26be', + 'snowman': '26c4', + 'partly_sunny': '26c5', + 'ophiuchus': '26ce', + 'no_entry': '26d4', + 'church': '26ea', + 'fountain': '26f2', + 'golf': '26f3', + 'sailboat': '26f5', + 'tent': '26fa', + 'fuelpump': '26fd', + 'scissors': '2702', + 'white_check_mark': '2705', + 'airplane': '2708', + 'envelope': '2709', + 'fist': '270a', + 'raised_hand': '270b', + 'v': '270c', + 'pencil2': '270f', + 'black_nib': '2712', + 'heavy_check_mark': '2714', + 'heavy_multiplication_x': '2716', + 'sparkles': '2728', + 'eight_spoked_asterisk': '2733', + 'eight_pointed_black_star': '2734', + 'snowflake': '2744', + 'sparkle': '2747', + 'x': '274c', + 'negative_squared_cross_mark': '274e', + 'question': '2753', + 'grey_question': '2754', + 'grey_exclamation': '2755', + 'exclamation': '2757', + 'heart': '2764', + 'heavy_plus_sign': '2795', + 'heavy_minus_sign': '2796', + 'heavy_division_sign': '2797', + 'arrow_right': '27a1', + 'curly_loop': '27b0', + 'arrow_heading_up': '2934', + 'arrow_heading_down': '2935', + 'arrow_left': '2b05', + 'arrow_up': '2b06', + 'arrow_down': '2b07', + 'black_large_square': '2b1b', + 'white_large_square': '2b1c', + 'star': '2b50', + 'o': '2b55', + 'wavy_dash': '3030', + 'part_alternation_mark': '303d', + 'congratulations': '3297', + 'secret': '3299', + 'mahjong': '1f004', + 'black_joker': '1f0cf', + 'a': '1f170', + 'b': '1f171', + 'o2': '1f17e', + 'parking': '1f17f', + 'ab': '1f18e', + 'cl': '1f191', + 'cool': '1f192', + 'free': '1f193', + 'id': '1f194', + 'new': '1f195', + 'ng': '1f196', + 'ok': '1f197', + 'sos': '1f198', + 'up': '1f199', + 'vs': '1f19a', + 'flag_cn': '1f1e8-1f1f3', + 'cn': '1f1e8-1f1f3', + 'flag_de': '1f1e9-1f1ea', + 'de': '1f1e9-1f1ea', + 'flag_es': '1f1ea-1f1f8', + 'es': '1f1ea-1f1f8', + 'flag_fr': '1f1eb-1f1f7', + 'fr': '1f1eb-1f1f7', + 'flag_gb': '1f1ec-1f1e7', + 'gb': '1f1ec-1f1e7', + 'flag_it': '1f1ee-1f1f9', + 'it': '1f1ee-1f1f9', + 'flag_jp': '1f1ef-1f1f5', + 'jp': '1f1ef-1f1f5', + 'flag_kr': '1f1f0-1f1f7', + 'kr': '1f1f0-1f1f7', + 'flag_us': '1f1fa-1f1f8', + 'us': '1f1fa-1f1f8', + 'flag_ru': '1f1f7-1f1fa', + 'ru': '1f1f7-1f1fa', + 'koko': '1f201', + 'sa': '1f202', + 'u7121': '1f21a', + 'u6307': '1f22f', + 'u7981': '1f232', + 'u7a7a': '1f233', + 'u5408': '1f234', + 'u6e80': '1f235', + 'u6709': '1f236', + 'u6708': '1f237', + 'u7533': '1f238', + 'u5272': '1f239', + 'u55b6': '1f23a', + 'ideograph_advantage': '1f250', + 'accept': '1f251', + 'cyclone': '1f300', + 'foggy': '1f301', + 'closed_umbrella': '1f302', + 'night_with_stars': '1f303', + 'sunrise_over_mountains': '1f304', + 'sunrise': '1f305', + 'city_dusk': '1f306', + 'city_sunset': '1f307', + 'city_sunrise': '1f307', + 'rainbow': '1f308', + 'bridge_at_night': '1f309', + 'ocean': '1f30a', + 'volcano': '1f30b', + 'milky_way': '1f30c', + 'earth_asia': '1f30f', + 'new_moon': '1f311', + 'first_quarter_moon': '1f313', + 'waxing_gibbous_moon': '1f314', + 'full_moon': '1f315', + 'crescent_moon': '1f319', + 'first_quarter_moon_with_face': '1f31b', + 'star2': '1f31f', + 'stars': '1f320', + 'chestnut': '1f330', + 'seedling': '1f331', + 'palm_tree': '1f334', + 'cactus': '1f335', + 'tulip': '1f337', + 'cherry_blossom': '1f338', + 'rose': '1f339', + 'hibiscus': '1f33a', + 'sunflower': '1f33b', + 'blossom': '1f33c', + 'corn': '1f33d', + 'ear_of_rice': '1f33e', + 'herb': '1f33f', + 'four_leaf_clover': '1f340', + 'maple_leaf': '1f341', + 'fallen_leaf': '1f342', + 'leaves': '1f343', + 'mushroom': '1f344', + 'tomato': '1f345', + 'eggplant': '1f346', + 'grapes': '1f347', + 'melon': '1f348', + 'watermelon': '1f349', + 'tangerine': '1f34a', + 'banana': '1f34c', + 'pineapple': '1f34d', + 'apple': '1f34e', + 'green_apple': '1f34f', + 'peach': '1f351', + 'cherries': '1f352', + 'strawberry': '1f353', + 'hamburger': '1f354', + 'pizza': '1f355', + 'meat_on_bone': '1f356', + 'poultry_leg': '1f357', + 'rice_cracker': '1f358', + 'rice_ball': '1f359', + 'rice': '1f35a', + 'curry': '1f35b', + 'ramen': '1f35c', + 'spaghetti': '1f35d', + 'bread': '1f35e', + 'fries': '1f35f', + 'sweet_potato': '1f360', + 'dango': '1f361', + 'oden': '1f362', + 'sushi': '1f363', + 'fried_shrimp': '1f364', + 'fish_cake': '1f365', + 'icecream': '1f366', + 'shaved_ice': '1f367', + 'ice_cream': '1f368', + 'doughnut': '1f369', + 'cookie': '1f36a', + 'chocolate_bar': '1f36b', + 'candy': '1f36c', + 'lollipop': '1f36d', + 'custard': '1f36e', + 'pudding': '1f36e', + 'flan': '1f36e', + 'honey_pot': '1f36f', + 'cake': '1f370', + 'bento': '1f371', + 'stew': '1f372', + 'egg': '1f373', + 'fork_and_knife': '1f374', + 'tea': '1f375', + 'sake': '1f376', + 'wine_glass': '1f377', + 'cocktail': '1f378', + 'tropical_drink': '1f379', + 'beer': '1f37a', + 'beers': '1f37b', + 'ribbon': '1f380', + 'gift': '1f381', + 'birthday': '1f382', + 'jack_o_lantern': '1f383', + 'christmas_tree': '1f384', + 'santa': '1f385', + 'fireworks': '1f386', + 'sparkler': '1f387', + 'balloon': '1f388', + 'tada': '1f389', + 'confetti_ball': '1f38a', + 'tanabata_tree': '1f38b', + 'crossed_flags': '1f38c', + 'bamboo': '1f38d', + 'dolls': '1f38e', + 'flags': '1f38f', + 'wind_chime': '1f390', + 'rice_scene': '1f391', + 'school_satchel': '1f392', + 'mortar_board': '1f393', + 'carousel_horse': '1f3a0', + 'ferris_wheel': '1f3a1', + 'roller_coaster': '1f3a2', + 'fishing_pole_and_fish': '1f3a3', + 'microphone': '1f3a4', + 'movie_camera': '1f3a5', + 'cinema': '1f3a6', + 'headphones': '1f3a7', + 'art': '1f3a8', + 'tophat': '1f3a9', + 'circus_tent': '1f3aa', + 'ticket': '1f3ab', + 'clapper': '1f3ac', + 'performing_arts': '1f3ad', + 'video_game': '1f3ae', + 'dart': '1f3af', + 'slot_machine': '1f3b0', + '8ball': '1f3b1', + 'game_die': '1f3b2', + 'bowling': '1f3b3', + 'flower_playing_cards': '1f3b4', + 'musical_note': '1f3b5', + 'notes': '1f3b6', + 'saxophone': '1f3b7', + 'guitar': '1f3b8', + 'musical_keyboard': '1f3b9', + 'trumpet': '1f3ba', + 'violin': '1f3bb', + 'musical_score': '1f3bc', + 'running_shirt_with_sash': '1f3bd', + 'tennis': '1f3be', + 'ski': '1f3bf', + 'basketball': '1f3c0', + 'checkered_flag': '1f3c1', + 'snowboarder': '1f3c2', + 'runner': '1f3c3', + 'surfer': '1f3c4', + 'trophy': '1f3c6', + 'football': '1f3c8', + 'swimmer': '1f3ca', + 'house': '1f3e0', + 'house_with_garden': '1f3e1', + 'office': '1f3e2', + 'post_office': '1f3e3', + 'hospital': '1f3e5', + 'bank': '1f3e6', + 'atm': '1f3e7', + 'hotel': '1f3e8', + 'love_hotel': '1f3e9', + 'convenience_store': '1f3ea', + 'school': '1f3eb', + 'department_store': '1f3ec', + 'factory': '1f3ed', + 'izakaya_lantern': '1f3ee', + 'japanese_castle': '1f3ef', + 'european_castle': '1f3f0', + 'snail': '1f40c', + 'snake': '1f40d', + 'racehorse': '1f40e', + 'sheep': '1f411', + 'monkey': '1f412', + 'chicken': '1f414', + 'boar': '1f417', + 'elephant': '1f418', + 'octopus': '1f419', + 'shell': '1f41a', + 'bug': '1f41b', + 'ant': '1f41c', + 'bee': '1f41d', + 'beetle': '1f41e', + 'fish': '1f41f', + 'tropical_fish': '1f420', + 'blowfish': '1f421', + 'turtle': '1f422', + 'hatching_chick': '1f423', + 'baby_chick': '1f424', + 'hatched_chick': '1f425', + 'bird': '1f426', + 'penguin': '1f427', + 'koala': '1f428', + 'poodle': '1f429', + 'camel': '1f42b', + 'dolphin': '1f42c', + 'mouse': '1f42d', + 'cow': '1f42e', + 'tiger': '1f42f', + 'rabbit': '1f430', + 'cat': '1f431', + 'dragon_face': '1f432', + 'whale': '1f433', + 'horse': '1f434', + 'monkey_face': '1f435', + 'dog': '1f436', + 'pig': '1f437', + 'frog': '1f438', + 'hamster': '1f439', + 'wolf': '1f43a', + 'bear': '1f43b', + 'panda_face': '1f43c', + 'pig_nose': '1f43d', + 'feet': '1f43e', + 'paw_prints': '1f43e', + 'eyes': '1f440', + 'ear': '1f442', + 'nose': '1f443', + 'lips': '1f444', + 'tongue': '1f445', + 'point_up_2': '1f446', + 'point_down': '1f447', + 'point_left': '1f448', + 'point_right': '1f449', + 'punch': '1f44a', + 'wave': '1f44b', + 'ok_hand': '1f44c', + 'thumbsup': '1f44d', + '+1': '1f44d', + 'thumbup': '1f44d', + 'thumbsdown': '1f44e', + '-1': '1f44e', + 'thumbdown': '1f44e', + 'clap': '1f44f', + 'open_hands': '1f450', + 'crown': '1f451', + 'womans_hat': '1f452', + 'eyeglasses': '1f453', + 'necktie': '1f454', + 'shirt': '1f455', + 'jeans': '1f456', + 'dress': '1f457', + 'kimono': '1f458', + 'bikini': '1f459', + 'womans_clothes': '1f45a', + 'purse': '1f45b', + 'handbag': '1f45c', + 'pouch': '1f45d', + 'mans_shoe': '1f45e', + 'athletic_shoe': '1f45f', + 'high_heel': '1f460', + 'sandal': '1f461', + 'boot': '1f462', + 'footprints': '1f463', + 'bust_in_silhouette': '1f464', + 'boy': '1f466', + 'girl': '1f467', + 'man': '1f468', + 'woman': '1f469', + 'family': '1f46a', + 'couple': '1f46b', + 'cop': '1f46e', + 'dancers': '1f46f', + 'bride_with_veil': '1f470', + 'person_with_blond_hair': '1f471', + 'man_with_gua_pi_mao': '1f472', + 'man_with_turban': '1f473', + 'older_man': '1f474', + 'older_woman': '1f475', + 'grandma': '1f475', + 'baby': '1f476', + 'construction_worker': '1f477', + 'princess': '1f478', + 'japanese_ogre': '1f479', + 'japanese_goblin': '1f47a', + 'ghost': '1f47b', + 'angel': '1f47c', + 'alien': '1f47d', + 'space_invader': '1f47e', + 'imp': '1f47f', + 'skull': '1f480', + 'skeleton': '1f480', + 'card_index': '1f4c7', + 'information_desk_person': '1f481', + 'guardsman': '1f482', + 'dancer': '1f483', + 'lipstick': '1f484', + 'nail_care': '1f485', + 'ledger': '1f4d2', + 'massage': '1f486', + 'notebook': '1f4d3', + 'haircut': '1f487', + 'notebook_with_decorative_cover': '1f4d4', + 'barber': '1f488', + 'closed_book': '1f4d5', + 'syringe': '1f489', + 'book': '1f4d6', + 'pill': '1f48a', + 'green_book': '1f4d7', + 'kiss': '1f48b', + 'blue_book': '1f4d8', + 'love_letter': '1f48c', + 'orange_book': '1f4d9', + 'ring': '1f48d', + 'books': '1f4da', + 'gem': '1f48e', + 'name_badge': '1f4db', + 'couplekiss': '1f48f', + 'scroll': '1f4dc', + 'bouquet': '1f490', + 'pencil': '1f4dd', + 'couple_with_heart': '1f491', + 'telephone_receiver': '1f4de', + 'wedding': '1f492', + 'pager': '1f4df', + 'fax': '1f4e0', + 'heartbeat': '1f493', + 'satellite': '1f4e1', + 'loudspeaker': '1f4e2', + 'broken_heart': '1f494', + 'mega': '1f4e3', + 'outbox_tray': '1f4e4', + 'two_hearts': '1f495', + 'inbox_tray': '1f4e5', + 'package': '1f4e6', + 'sparkling_heart': '1f496', + 'e-mail': '1f4e7', + 'email': '1f4e7', + 'incoming_envelope': '1f4e8', + 'heartpulse': '1f497', + 'envelope_with_arrow': '1f4e9', + 'mailbox_closed': '1f4ea', + 'cupid': '1f498', + 'mailbox': '1f4eb', + 'postbox': '1f4ee', + 'blue_heart': '1f499', + 'newspaper': '1f4f0', + 'iphone': '1f4f1', + 'green_heart': '1f49a', + 'calling': '1f4f2', + 'vibration_mode': '1f4f3', + 'yellow_heart': '1f49b', + 'mobile_phone_off': '1f4f4', + 'signal_strength': '1f4f6', + 'purple_heart': '1f49c', + 'camera': '1f4f7', + 'video_camera': '1f4f9', + 'gift_heart': '1f49d', + 'tv': '1f4fa', + 'radio': '1f4fb', + 'revolving_hearts': '1f49e', + 'vhs': '1f4fc', + 'arrows_clockwise': '1f503', + 'heart_decoration': '1f49f', + 'loud_sound': '1f50a', + 'battery': '1f50b', + 'diamond_shape_with_a_dot_inside': '1f4a0', + 'electric_plug': '1f50c', + 'mag': '1f50d', + 'bulb': '1f4a1', + 'mag_right': '1f50e', + 'lock_with_ink_pen': '1f50f', + 'anger': '1f4a2', + 'closed_lock_with_key': '1f510', + 'key': '1f511', + 'bomb': '1f4a3', + 'lock': '1f512', + 'unlock': '1f513', + 'zzz': '1f4a4', + 'bell': '1f514', + 'bookmark': '1f516', + 'boom': '1f4a5', + 'link': '1f517', + 'radio_button': '1f518', + 'sweat_drops': '1f4a6', + 'back': '1f519', + 'end': '1f51a', + 'droplet': '1f4a7', + 'on': '1f51b', + 'soon': '1f51c', + 'dash': '1f4a8', + 'top': '1f51d', + 'underage': '1f51e', + 'poop': '1f4a9', + 'shit': '1f4a9', + 'hankey': '1f4a9', + 'poo': '1f4a9', + 'ten': '1f51f', + 'muscle': '1f4aa', + 'capital_abcd': '1f520', + 'abcd': '1f521', + 'dizzy': '1f4ab', + '1234': '1f522', + 'symbols': '1f523', + 'speech_balloon': '1f4ac', + 'abc': '1f524', + 'fire': '1f525', + 'flame': '1f525', + 'white_flower': '1f4ae', + 'flashlight': '1f526', + 'wrench': '1f527', + '100': '1f4af', + 'hammer': '1f528', + 'nut_and_bolt': '1f529', + 'moneybag': '1f4b0', + 'knife': '1f52a', + 'gun': '1f52b', + 'currency_exchange': '1f4b1', + 'crystal_ball': '1f52e', + 'heavy_dollar_sign': '1f4b2', + 'six_pointed_star': '1f52f', + 'credit_card': '1f4b3', + 'beginner': '1f530', + 'trident': '1f531', + 'yen': '1f4b4', + 'black_square_button': '1f532', + 'white_square_button': '1f533', + 'dollar': '1f4b5', + 'red_circle': '1f534', + 'large_blue_circle': '1f535', + 'money_with_wings': '1f4b8', + 'large_orange_diamond': '1f536', + 'large_blue_diamond': '1f537', + 'chart': '1f4b9', + 'small_orange_diamond': '1f538', + 'small_blue_diamond': '1f539', + 'seat': '1f4ba', + 'small_red_triangle': '1f53a', + 'small_red_triangle_down': '1f53b', + 'computer': '1f4bb', + 'arrow_up_small': '1f53c', + 'briefcase': '1f4bc', + 'arrow_down_small': '1f53d', + 'clock1': '1f550', + 'minidisc': '1f4bd', + 'clock2': '1f551', + 'floppy_disk': '1f4be', + 'clock3': '1f552', + 'cd': '1f4bf', + 'clock4': '1f553', + 'dvd': '1f4c0', + 'clock5': '1f554', + 'clock6': '1f555', + 'file_folder': '1f4c1', + 'clock7': '1f556', + 'clock8': '1f557', + 'open_file_folder': '1f4c2', + 'clock9': '1f558', + 'clock10': '1f559', + 'page_with_curl': '1f4c3', + 'clock11': '1f55a', + 'clock12': '1f55b', + 'page_facing_up': '1f4c4', + 'mount_fuji': '1f5fb', + 'tokyo_tower': '1f5fc', + 'date': '1f4c5', + 'statue_of_liberty': '1f5fd', + 'japan': '1f5fe', + 'calendar': '1f4c6', + 'moyai': '1f5ff', + 'grin': '1f601', + 'joy': '1f602', + 'smiley': '1f603', + 'chart_with_upwards_trend': '1f4c8', + 'smile': '1f604', + 'sweat_smile': '1f605', + 'chart_with_downwards_trend': '1f4c9', + 'laughing': '1f606', + 'satisfied': '1f606', + 'wink': '1f609', + 'bar_chart': '1f4ca', + 'blush': '1f60a', + 'yum': '1f60b', + 'clipboard': '1f4cb', + 'relieved': '1f60c', + 'heart_eyes': '1f60d', + 'pushpin': '1f4cc', + 'smirk': '1f60f', + 'unamused': '1f612', + 'round_pushpin': '1f4cd', + 'sweat': '1f613', + 'pensive': '1f614', + 'paperclip': '1f4ce', + 'confounded': '1f616', + 'kissing_heart': '1f618', + 'straight_ruler': '1f4cf', + 'kissing_closed_eyes': '1f61a', + 'stuck_out_tongue_winking_eye': '1f61c', + 'triangular_ruler': '1f4d0', + 'stuck_out_tongue_closed_eyes': '1f61d', + 'disappointed': '1f61e', + 'bookmark_tabs': '1f4d1', + 'angry': '1f620', + 'rage': '1f621', + 'cry': '1f622', + 'persevere': '1f623', + 'triumph': '1f624', + 'disappointed_relieved': '1f625', + 'fearful': '1f628', + 'weary': '1f629', + 'sleepy': '1f62a', + 'tired_face': '1f62b', + 'sob': '1f62d', + 'cold_sweat': '1f630', + 'scream': '1f631', + 'astonished': '1f632', + 'flushed': '1f633', + 'dizzy_face': '1f635', + 'mask': '1f637', + 'smile_cat': '1f638', + 'joy_cat': '1f639', + 'smiley_cat': '1f63a', + 'heart_eyes_cat': '1f63b', + 'smirk_cat': '1f63c', + 'kissing_cat': '1f63d', + 'pouting_cat': '1f63e', + 'crying_cat_face': '1f63f', + 'scream_cat': '1f640', + 'no_good': '1f645', + 'ok_woman': '1f646', + 'bow': '1f647', + 'see_no_evil': '1f648', + 'hear_no_evil': '1f649', + 'speak_no_evil': '1f64a', + 'raising_hand': '1f64b', + 'raised_hands': '1f64c', + 'person_frowning': '1f64d', + 'person_with_pouting_face': '1f64e', + 'pray': '1f64f', + 'rocket': '1f680', + 'railway_car': '1f683', + 'bullettrain_side': '1f684', + 'bullettrain_front': '1f685', + 'metro': '1f687', + 'station': '1f689', + 'bus': '1f68c', + 'busstop': '1f68f', + 'ambulance': '1f691', + 'fire_engine': '1f692', + 'police_car': '1f693', + 'taxi': '1f695', + 'red_car': '1f697', + 'blue_car': '1f699', + 'truck': '1f69a', + 'ship': '1f6a2', + 'speedboat': '1f6a4', + 'traffic_light': '1f6a5', + 'construction': '1f6a7', + 'rotating_light': '1f6a8', + 'triangular_flag_on_post': '1f6a9', + 'door': '1f6aa', + 'no_entry_sign': '1f6ab', + 'smoking': '1f6ac', + 'no_smoking': '1f6ad', + 'bike': '1f6b2', + 'walking': '1f6b6', + 'mens': '1f6b9', + 'womens': '1f6ba', + 'restroom': '1f6bb', + 'baby_symbol': '1f6bc', + 'toilet': '1f6bd', + 'wc': '1f6be', + 'bath': '1f6c0', + 'metal': '1f918', + 'sign_of_the_horns': '1f918', + 'grinning': '1f600', + 'innocent': '1f607', + 'smiling_imp': '1f608', + 'sunglasses': '1f60e', + 'neutral_face': '1f610', + 'expressionless': '1f611', + 'confused': '1f615', + 'kissing': '1f617', + 'kissing_smiling_eyes': '1f619', + 'stuck_out_tongue': '1f61b', + 'worried': '1f61f', + 'frowning': '1f626', + 'anguished': '1f627', + 'grimacing': '1f62c', + 'open_mouth': '1f62e', + 'hushed': '1f62f', + 'sleeping': '1f634', + 'no_mouth': '1f636', + 'helicopter': '1f681', + 'steam_locomotive': '1f682', + 'train2': '1f686', + 'light_rail': '1f688', + 'tram': '1f68a', + 'oncoming_bus': '1f68d', + 'trolleybus': '1f68e', + 'minibus': '1f690', + 'oncoming_police_car': '1f694', + 'oncoming_taxi': '1f696', + 'oncoming_automobile': '1f698', + 'articulated_lorry': '1f69b', + 'tractor': '1f69c', + 'monorail': '1f69d', + 'mountain_railway': '1f69e', + 'suspension_railway': '1f69f', + 'mountain_cableway': '1f6a0', + 'aerial_tramway': '1f6a1', + 'rowboat': '1f6a3', + 'vertical_traffic_light': '1f6a6', + 'put_litter_in_its_place': '1f6ae', + 'do_not_litter': '1f6af', + 'potable_water': '1f6b0', + 'non-potable_water': '1f6b1', + 'no_bicycles': '1f6b3', + 'bicyclist': '1f6b4', + 'mountain_bicyclist': '1f6b5', + 'no_pedestrians': '1f6b7', + 'children_crossing': '1f6b8', + 'shower': '1f6bf', + 'bathtub': '1f6c1', + 'passport_control': '1f6c2', + 'customs': '1f6c3', + 'baggage_claim': '1f6c4', + 'left_luggage': '1f6c5', + 'earth_africa': '1f30d', + 'earth_americas': '1f30e', + 'globe_with_meridians': '1f310', + 'waxing_crescent_moon': '1f312', + 'waning_gibbous_moon': '1f316', + 'last_quarter_moon': '1f317', + 'waning_crescent_moon': '1f318', + 'new_moon_with_face': '1f31a', + 'last_quarter_moon_with_face': '1f31c', + 'full_moon_with_face': '1f31d', + 'sun_with_face': '1f31e', + 'evergreen_tree': '1f332', + 'deciduous_tree': '1f333', + 'lemon': '1f34b', + 'pear': '1f350', + 'baby_bottle': '1f37c', + 'horse_racing': '1f3c7', + 'rugby_football': '1f3c9', + 'european_post_office': '1f3e4', + 'rat': '1f400', + 'mouse2': '1f401', + 'ox': '1f402', + 'water_buffalo': '1f403', + 'cow2': '1f404', + 'tiger2': '1f405', + 'leopard': '1f406', + 'rabbit2': '1f407', + 'cat2': '1f408', + 'dragon': '1f409', + 'crocodile': '1f40a', + 'whale2': '1f40b', + 'ram': '1f40f', + 'goat': '1f410', + 'rooster': '1f413', + 'dog2': '1f415', + 'pig2': '1f416', + 'dromedary_camel': '1f42a', + 'busts_in_silhouette': '1f465', + 'two_men_holding_hands': '1f46c', + 'two_women_holding_hands': '1f46d', + 'thought_balloon': '1f4ad', + 'euro': '1f4b6', + 'pound': '1f4b7', + 'mailbox_with_mail': '1f4ec', + 'mailbox_with_no_mail': '1f4ed', + 'postal_horn': '1f4ef', + 'no_mobile_phones': '1f4f5', + 'twisted_rightwards_arrows': '1f500', + 'repeat': '1f501', + 'repeat_one': '1f502', + 'arrows_counterclockwise': '1f504', + 'low_brightness': '1f505', + 'high_brightness': '1f506', + 'mute': '1f507', + 'sound': '1f509', + 'no_bell': '1f515', + 'microscope': '1f52c', + 'telescope': '1f52d', + 'clock130': '1f55c', + 'clock230': '1f55d', + 'clock330': '1f55e', + 'clock430': '1f55f', + 'clock530': '1f560', + 'clock630': '1f561', + 'clock730': '1f562', + 'clock830': '1f563', + 'clock930': '1f564', + 'clock1030': '1f565', + 'clock1130': '1f566', + 'clock1230': '1f567', + 'speaker': '1f508', + 'train': '1f68b', + 'loop': '27bf', + 'flag_af': '1f1e6-1f1eb', + 'af': '1f1e6-1f1eb', + 'flag_al': '1f1e6-1f1f1', + 'al': '1f1e6-1f1f1', + 'flag_dz': '1f1e9-1f1ff', + 'dz': '1f1e9-1f1ff', + 'flag_ad': '1f1e6-1f1e9', + 'ad': '1f1e6-1f1e9', + 'flag_ao': '1f1e6-1f1f4', + 'ao': '1f1e6-1f1f4', + 'flag_ag': '1f1e6-1f1ec', + 'ag': '1f1e6-1f1ec', + 'flag_ar': '1f1e6-1f1f7', + 'ar': '1f1e6-1f1f7', + 'flag_am': '1f1e6-1f1f2', + 'am': '1f1e6-1f1f2', + 'flag_au': '1f1e6-1f1fa', + 'au': '1f1e6-1f1fa', + 'flag_at': '1f1e6-1f1f9', + 'at': '1f1e6-1f1f9', + 'flag_az': '1f1e6-1f1ff', + 'az': '1f1e6-1f1ff', + 'flag_bs': '1f1e7-1f1f8', + 'bs': '1f1e7-1f1f8', + 'flag_bh': '1f1e7-1f1ed', + 'bh': '1f1e7-1f1ed', + 'flag_bd': '1f1e7-1f1e9', + 'bd': '1f1e7-1f1e9', + 'flag_bb': '1f1e7-1f1e7', + 'bb': '1f1e7-1f1e7', + 'flag_by': '1f1e7-1f1fe', + 'by': '1f1e7-1f1fe', + 'flag_be': '1f1e7-1f1ea', + 'be': '1f1e7-1f1ea', + 'flag_bz': '1f1e7-1f1ff', + 'bz': '1f1e7-1f1ff', + 'flag_bj': '1f1e7-1f1ef', + 'bj': '1f1e7-1f1ef', + 'flag_bt': '1f1e7-1f1f9', + 'bt': '1f1e7-1f1f9', + 'flag_bo': '1f1e7-1f1f4', + 'bo': '1f1e7-1f1f4', + 'flag_ba': '1f1e7-1f1e6', + 'ba': '1f1e7-1f1e6', + 'flag_bw': '1f1e7-1f1fc', + 'bw': '1f1e7-1f1fc', + 'flag_br': '1f1e7-1f1f7', + 'br': '1f1e7-1f1f7', + 'flag_bn': '1f1e7-1f1f3', + 'bn': '1f1e7-1f1f3', + 'flag_bg': '1f1e7-1f1ec', + 'bg': '1f1e7-1f1ec', + 'flag_bf': '1f1e7-1f1eb', + 'bf': '1f1e7-1f1eb', + 'flag_bi': '1f1e7-1f1ee', + 'bi': '1f1e7-1f1ee', + 'flag_kh': '1f1f0-1f1ed', + 'kh': '1f1f0-1f1ed', + 'flag_cm': '1f1e8-1f1f2', + 'cm': '1f1e8-1f1f2', + 'flag_ca': '1f1e8-1f1e6', + 'ca': '1f1e8-1f1e6', + 'flag_cv': '1f1e8-1f1fb', + 'cv': '1f1e8-1f1fb', + 'flag_cf': '1f1e8-1f1eb', + 'cf': '1f1e8-1f1eb', + 'flag_td': '1f1f9-1f1e9', + 'td': '1f1f9-1f1e9', + 'flag_cl': '1f1e8-1f1f1', + 'chile': '1f1e8-1f1f1', + 'flag_co': '1f1e8-1f1f4', + 'co': '1f1e8-1f1f4', + 'flag_km': '1f1f0-1f1f2', + 'km': '1f1f0-1f1f2', + 'flag_cr': '1f1e8-1f1f7', + 'cr': '1f1e8-1f1f7', + 'flag_ci': '1f1e8-1f1ee', + 'ci': '1f1e8-1f1ee', + 'flag_hr': '1f1ed-1f1f7', + 'hr': '1f1ed-1f1f7', + 'flag_cu': '1f1e8-1f1fa', + 'cu': '1f1e8-1f1fa', + 'flag_cy': '1f1e8-1f1fe', + 'cy': '1f1e8-1f1fe', + 'flag_cz': '1f1e8-1f1ff', + 'cz': '1f1e8-1f1ff', + 'flag_cd': '1f1e8-1f1e9', + 'congo': '1f1e8-1f1e9', + 'flag_dk': '1f1e9-1f1f0', + 'dk': '1f1e9-1f1f0', + 'flag_dj': '1f1e9-1f1ef', + 'dj': '1f1e9-1f1ef', + 'flag_dm': '1f1e9-1f1f2', + 'dm': '1f1e9-1f1f2', + 'flag_do': '1f1e9-1f1f4', + 'do': '1f1e9-1f1f4', + 'flag_tl': '1f1f9-1f1f1', + 'tl': '1f1f9-1f1f1', + 'flag_ec': '1f1ea-1f1e8', + 'ec': '1f1ea-1f1e8', + 'flag_eg': '1f1ea-1f1ec', + 'eg': '1f1ea-1f1ec', + 'flag_sv': '1f1f8-1f1fb', + 'sv': '1f1f8-1f1fb', + 'flag_gq': '1f1ec-1f1f6', + 'gq': '1f1ec-1f1f6', + 'flag_er': '1f1ea-1f1f7', + 'er': '1f1ea-1f1f7', + 'flag_ee': '1f1ea-1f1ea', + 'ee': '1f1ea-1f1ea', + 'flag_et': '1f1ea-1f1f9', + 'et': '1f1ea-1f1f9', + 'flag_fj': '1f1eb-1f1ef', + 'fj': '1f1eb-1f1ef', + 'flag_fi': '1f1eb-1f1ee', + 'fi': '1f1eb-1f1ee', + 'flag_ga': '1f1ec-1f1e6', + 'ga': '1f1ec-1f1e6', + 'flag_gm': '1f1ec-1f1f2', + 'gm': '1f1ec-1f1f2', + 'flag_ge': '1f1ec-1f1ea', + 'ge': '1f1ec-1f1ea', + 'flag_gh': '1f1ec-1f1ed', + 'gh': '1f1ec-1f1ed', + 'flag_gr': '1f1ec-1f1f7', + 'gr': '1f1ec-1f1f7', + 'flag_gd': '1f1ec-1f1e9', + 'gd': '1f1ec-1f1e9', + 'flag_gt': '1f1ec-1f1f9', + 'gt': '1f1ec-1f1f9', + 'flag_gn': '1f1ec-1f1f3', + 'gn': '1f1ec-1f1f3', + 'flag_gw': '1f1ec-1f1fc', + 'gw': '1f1ec-1f1fc', + 'flag_gy': '1f1ec-1f1fe', + 'gy': '1f1ec-1f1fe', + 'flag_ht': '1f1ed-1f1f9', + 'ht': '1f1ed-1f1f9', + 'flag_hn': '1f1ed-1f1f3', + 'hn': '1f1ed-1f1f3', + 'flag_hu': '1f1ed-1f1fa', + 'hu': '1f1ed-1f1fa', + 'flag_is': '1f1ee-1f1f8', + 'is': '1f1ee-1f1f8', + 'flag_in': '1f1ee-1f1f3', + 'in': '1f1ee-1f1f3', + 'flag_id': '1f1ee-1f1e9', + 'indonesia': '1f1ee-1f1e9', + 'flag_ir': '1f1ee-1f1f7', + 'ir': '1f1ee-1f1f7', + 'flag_iq': '1f1ee-1f1f6', + 'iq': '1f1ee-1f1f6', + 'flag_ie': '1f1ee-1f1ea', + 'ie': '1f1ee-1f1ea', + 'flag_il': '1f1ee-1f1f1', + 'il': '1f1ee-1f1f1', + 'flag_jm': '1f1ef-1f1f2', + 'jm': '1f1ef-1f1f2', + 'flag_jo': '1f1ef-1f1f4', + 'jo': '1f1ef-1f1f4', + 'flag_kz': '1f1f0-1f1ff', + 'kz': '1f1f0-1f1ff', + 'flag_ke': '1f1f0-1f1ea', + 'ke': '1f1f0-1f1ea', + 'flag_ki': '1f1f0-1f1ee', + 'ki': '1f1f0-1f1ee', + 'flag_xk': '1f1fd-1f1f0', + 'xk': '1f1fd-1f1f0', + 'flag_kw': '1f1f0-1f1fc', + 'kw': '1f1f0-1f1fc', + 'flag_kg': '1f1f0-1f1ec', + 'kg': '1f1f0-1f1ec', + 'flag_la': '1f1f1-1f1e6', + 'la': '1f1f1-1f1e6', + 'flag_lv': '1f1f1-1f1fb', + 'lv': '1f1f1-1f1fb', + 'flag_lb': '1f1f1-1f1e7', + 'lb': '1f1f1-1f1e7', + 'flag_ls': '1f1f1-1f1f8', + 'ls': '1f1f1-1f1f8', + 'flag_lr': '1f1f1-1f1f7', + 'lr': '1f1f1-1f1f7', + 'flag_ly': '1f1f1-1f1fe', + 'ly': '1f1f1-1f1fe', + 'flag_li': '1f1f1-1f1ee', + 'li': '1f1f1-1f1ee', + 'flag_lt': '1f1f1-1f1f9', + 'lt': '1f1f1-1f1f9', + 'flag_lu': '1f1f1-1f1fa', + 'lu': '1f1f1-1f1fa', + 'flag_mk': '1f1f2-1f1f0', + 'mk': '1f1f2-1f1f0', + 'flag_mg': '1f1f2-1f1ec', + 'mg': '1f1f2-1f1ec', + 'flag_mw': '1f1f2-1f1fc', + 'mw': '1f1f2-1f1fc', + 'flag_my': '1f1f2-1f1fe', + 'my': '1f1f2-1f1fe', + 'flag_mv': '1f1f2-1f1fb', + 'mv': '1f1f2-1f1fb', + 'flag_ml': '1f1f2-1f1f1', + 'ml': '1f1f2-1f1f1', + 'flag_mt': '1f1f2-1f1f9', + 'mt': '1f1f2-1f1f9', + 'flag_mh': '1f1f2-1f1ed', + 'mh': '1f1f2-1f1ed', + 'flag_mr': '1f1f2-1f1f7', + 'mr': '1f1f2-1f1f7', + 'flag_mu': '1f1f2-1f1fa', + 'mu': '1f1f2-1f1fa', + 'flag_mx': '1f1f2-1f1fd', + 'mx': '1f1f2-1f1fd', + 'flag_fm': '1f1eb-1f1f2', + 'fm': '1f1eb-1f1f2', + 'flag_md': '1f1f2-1f1e9', + 'md': '1f1f2-1f1e9', + 'flag_mc': '1f1f2-1f1e8', + 'mc': '1f1f2-1f1e8', + 'flag_mn': '1f1f2-1f1f3', + 'mn': '1f1f2-1f1f3', + 'flag_me': '1f1f2-1f1ea', + 'me': '1f1f2-1f1ea', + 'flag_ma': '1f1f2-1f1e6', + 'ma': '1f1f2-1f1e6', + 'flag_mz': '1f1f2-1f1ff', + 'mz': '1f1f2-1f1ff', + 'flag_mm': '1f1f2-1f1f2', + 'mm': '1f1f2-1f1f2', + 'flag_na': '1f1f3-1f1e6', + 'na': '1f1f3-1f1e6', + 'flag_nr': '1f1f3-1f1f7', + 'nr': '1f1f3-1f1f7', + 'flag_np': '1f1f3-1f1f5', + 'np': '1f1f3-1f1f5', + 'flag_nl': '1f1f3-1f1f1', + 'nl': '1f1f3-1f1f1', + 'flag_nz': '1f1f3-1f1ff', + 'nz': '1f1f3-1f1ff', + 'flag_ni': '1f1f3-1f1ee', + 'ni': '1f1f3-1f1ee', + 'flag_ne': '1f1f3-1f1ea', + 'ne': '1f1f3-1f1ea', + 'flag_ng': '1f1f3-1f1ec', + 'nigeria': '1f1f3-1f1ec', + 'flag_kp': '1f1f0-1f1f5', + 'kp': '1f1f0-1f1f5', + 'flag_no': '1f1f3-1f1f4', + 'no': '1f1f3-1f1f4', + 'flag_om': '1f1f4-1f1f2', + 'om': '1f1f4-1f1f2', + 'flag_pk': '1f1f5-1f1f0', + 'pk': '1f1f5-1f1f0', + 'flag_pw': '1f1f5-1f1fc', + 'pw': '1f1f5-1f1fc', + 'flag_pa': '1f1f5-1f1e6', + 'pa': '1f1f5-1f1e6', + 'flag_pg': '1f1f5-1f1ec', + 'pg': '1f1f5-1f1ec', + 'flag_py': '1f1f5-1f1fe', + 'py': '1f1f5-1f1fe', + 'flag_pe': '1f1f5-1f1ea', + 'pe': '1f1f5-1f1ea', + 'flag_ph': '1f1f5-1f1ed', + 'ph': '1f1f5-1f1ed', + 'flag_pl': '1f1f5-1f1f1', + 'pl': '1f1f5-1f1f1', + 'flag_pt': '1f1f5-1f1f9', + 'pt': '1f1f5-1f1f9', + 'flag_qa': '1f1f6-1f1e6', + 'qa': '1f1f6-1f1e6', + 'flag_tw': '1f1f9-1f1fc', + 'tw': '1f1f9-1f1fc', + 'flag_cg': '1f1e8-1f1ec', + 'cg': '1f1e8-1f1ec', + 'flag_ro': '1f1f7-1f1f4', + 'ro': '1f1f7-1f1f4', + 'flag_rw': '1f1f7-1f1fc', + 'rw': '1f1f7-1f1fc', + 'flag_kn': '1f1f0-1f1f3', + 'kn': '1f1f0-1f1f3', + 'flag_lc': '1f1f1-1f1e8', + 'lc': '1f1f1-1f1e8', + 'flag_vc': '1f1fb-1f1e8', + 'vc': '1f1fb-1f1e8', + 'flag_ws': '1f1fc-1f1f8', + 'ws': '1f1fc-1f1f8', + 'flag_sm': '1f1f8-1f1f2', + 'sm': '1f1f8-1f1f2', + 'flag_st': '1f1f8-1f1f9', + 'st': '1f1f8-1f1f9', + 'flag_sa': '1f1f8-1f1e6', + 'saudiarabia': '1f1f8-1f1e6', + 'saudi': '1f1f8-1f1e6', + 'flag_sn': '1f1f8-1f1f3', + 'sn': '1f1f8-1f1f3', + 'flag_rs': '1f1f7-1f1f8', + 'rs': '1f1f7-1f1f8', + 'flag_sc': '1f1f8-1f1e8', + 'sc': '1f1f8-1f1e8', + 'flag_sl': '1f1f8-1f1f1', + 'sl': '1f1f8-1f1f1', + 'flag_sg': '1f1f8-1f1ec', + 'sg': '1f1f8-1f1ec', + 'flag_sk': '1f1f8-1f1f0', + 'sk': '1f1f8-1f1f0', + 'flag_si': '1f1f8-1f1ee', + 'si': '1f1f8-1f1ee', + 'flag_sb': '1f1f8-1f1e7', + 'sb': '1f1f8-1f1e7', + 'flag_so': '1f1f8-1f1f4', + 'so': '1f1f8-1f1f4', + 'flag_za': '1f1ff-1f1e6', + 'za': '1f1ff-1f1e6', + 'flag_lk': '1f1f1-1f1f0', + 'lk': '1f1f1-1f1f0', + 'flag_sd': '1f1f8-1f1e9', + 'sd': '1f1f8-1f1e9', + 'flag_sr': '1f1f8-1f1f7', + 'sr': '1f1f8-1f1f7', + 'flag_sz': '1f1f8-1f1ff', + 'sz': '1f1f8-1f1ff', + 'flag_se': '1f1f8-1f1ea', + 'se': '1f1f8-1f1ea', + 'flag_ch': '1f1e8-1f1ed', + 'ch': '1f1e8-1f1ed', + 'flag_sy': '1f1f8-1f1fe', + 'sy': '1f1f8-1f1fe', + 'flag_tj': '1f1f9-1f1ef', + 'tj': '1f1f9-1f1ef', + 'flag_tz': '1f1f9-1f1ff', + 'tz': '1f1f9-1f1ff', + 'flag_th': '1f1f9-1f1ed', + 'th': '1f1f9-1f1ed', + 'flag_tg': '1f1f9-1f1ec', + 'tg': '1f1f9-1f1ec', + 'flag_to': '1f1f9-1f1f4', + 'to': '1f1f9-1f1f4', + 'flag_tt': '1f1f9-1f1f9', + 'tt': '1f1f9-1f1f9', + 'flag_tn': '1f1f9-1f1f3', + 'tn': '1f1f9-1f1f3', + 'flag_tr': '1f1f9-1f1f7', + 'tr': '1f1f9-1f1f7', + 'flag_tm': '1f1f9-1f1f2', + 'turkmenistan': '1f1f9-1f1f2', + 'flag_tv': '1f1f9-1f1fb', + 'tuvalu': '1f1f9-1f1fb', + 'flag_ug': '1f1fa-1f1ec', + 'ug': '1f1fa-1f1ec', + 'flag_ua': '1f1fa-1f1e6', + 'ua': '1f1fa-1f1e6', + 'flag_ae': '1f1e6-1f1ea', + 'ae': '1f1e6-1f1ea', + 'flag_uy': '1f1fa-1f1fe', + 'uy': '1f1fa-1f1fe', + 'flag_uz': '1f1fa-1f1ff', + 'uz': '1f1fa-1f1ff', + 'flag_vu': '1f1fb-1f1fa', + 'vu': '1f1fb-1f1fa', + 'flag_va': '1f1fb-1f1e6', + 'va': '1f1fb-1f1e6', + 'flag_ve': '1f1fb-1f1ea', + 've': '1f1fb-1f1ea', + 'flag_vn': '1f1fb-1f1f3', + 'vn': '1f1fb-1f1f3', + 'flag_eh': '1f1ea-1f1ed', + 'eh': '1f1ea-1f1ed', + 'flag_ye': '1f1fe-1f1ea', + 'ye': '1f1fe-1f1ea', + 'flag_zm': '1f1ff-1f1f2', + 'zm': '1f1ff-1f1f2', + 'flag_zw': '1f1ff-1f1fc', + 'zw': '1f1ff-1f1fc', + 'flag_pr': '1f1f5-1f1f7', + 'pr': '1f1f5-1f1f7', + 'flag_ky': '1f1f0-1f1fe', + 'ky': '1f1f0-1f1fe', + 'flag_bm': '1f1e7-1f1f2', + 'bm': '1f1e7-1f1f2', + 'flag_pf': '1f1f5-1f1eb', + 'pf': '1f1f5-1f1eb', + 'flag_ps': '1f1f5-1f1f8', + 'ps': '1f1f5-1f1f8', + 'flag_nc': '1f1f3-1f1e8', + 'nc': '1f1f3-1f1e8', + 'flag_sh': '1f1f8-1f1ed', + 'sh': '1f1f8-1f1ed', + 'flag_aw': '1f1e6-1f1fc', + 'aw': '1f1e6-1f1fc', + 'flag_vi': '1f1fb-1f1ee', + 'vi': '1f1fb-1f1ee', + 'flag_hk': '1f1ed-1f1f0', + 'hk': '1f1ed-1f1f0', + 'flag_ac': '1f1e6-1f1e8', + 'ac': '1f1e6-1f1e8', + 'flag_ms': '1f1f2-1f1f8', + 'ms': '1f1f2-1f1f8', + 'flag_gu': '1f1ec-1f1fa', + 'gu': '1f1ec-1f1fa', + 'flag_gl': '1f1ec-1f1f1', + 'gl': '1f1ec-1f1f1', + 'flag_nu': '1f1f3-1f1fa', + 'nu': '1f1f3-1f1fa', + 'flag_wf': '1f1fc-1f1eb', + 'wf': '1f1fc-1f1eb', + 'flag_mo': '1f1f2-1f1f4', + 'mo': '1f1f2-1f1f4', + 'flag_fo': '1f1eb-1f1f4', + 'fo': '1f1eb-1f1f4', + 'flag_fk': '1f1eb-1f1f0', + 'fk': '1f1eb-1f1f0', + 'flag_je': '1f1ef-1f1ea', + 'je': '1f1ef-1f1ea', + 'flag_ai': '1f1e6-1f1ee', + 'ai': '1f1e6-1f1ee', + 'flag_gi': '1f1ec-1f1ee', + 'gi': '1f1ec-1f1ee', + 'film_frames': '1f39e', + 'tickets': '1f39f', + 'admission_tickets': '1f39f', + 'medal': '1f3c5', + 'sports_medal': '1f3c5', + 'lifter': '1f3cb', + 'weight_lifter': '1f3cb', + 'golfer': '1f3cc', + 'motorcycle': '1f3cd', + 'racing_motorcycle': '1f3cd', + 'race_car': '1f3ce', + 'racing_car': '1f3ce', + 'military_medal': '1f396', + 'reminder_ribbon': '1f397', + 'hot_pepper': '1f336', + 'cloud_rain': '1f327', + 'cloud_with_rain': '1f327', + 'cloud_snow': '1f328', + 'cloud_with_snow': '1f328', + 'cloud_lightning': '1f329', + 'cloud_with_lightning': '1f329', + 'cloud_tornado': '1f32a', + 'cloud_with_tornado': '1f32a', + 'fog': '1f32b', + 'wind_blowing_face': '1f32c', + 'chipmunk': '1f43f', + 'spider': '1f577', + 'spider_web': '1f578', + 'thermometer': '1f321', + 'microphone2': '1f399', + 'studio_microphone': '1f399', + 'level_slider': '1f39a', + 'control_knobs': '1f39b', + 'flag_white': '1f3f3', + 'waving_white_flag': '1f3f3', + 'flag_black': '1f3f4', + 'waving_black_flag': '1f3f4', + 'rosette': '1f3f5', + 'label': '1f3f7', + 'camera_with_flash': '1f4f8', + 'projector': '1f4fd', + 'film_projector': '1f4fd', + 'cross': '271d', + 'latin_cross': '271d', + 'om_symbol': '1f549', + 'dove': '1f54a', + 'dove_of_peace': '1f54a', + 'candle': '1f56f', + 'clock': '1f570', + 'mantlepiece_clock': '1f570', + 'hole': '1f573', + 'dark_sunglasses': '1f576', + 'joystick': '1f579', + 'paperclips': '1f587', + 'linked_paperclips': '1f587', + 'pen_ballpoint': '1f58a', + 'lower_left_ballpoint_pen': '1f58a', + 'pen_fountain': '1f58b', + 'lower_left_fountain_pen': '1f58b', + 'paintbrush': '1f58c', + 'lower_left_paintbrush': '1f58c', + 'crayon': '1f58d', + 'lower_left_crayon': '1f58d', + 'desktop': '1f5a5', + 'desktop_computer': '1f5a5', + 'printer': '1f5a8', + 'keyboard': '2328', + 'trackball': '1f5b2', + 'frame_photo': '1f5bc', + 'frame_with_picture': '1f5bc', + 'dividers': '1f5c2', + 'card_index_dividers': '1f5c2', + 'card_box': '1f5c3', + 'card_file_box': '1f5c3', + 'file_cabinet': '1f5c4', + 'wastebasket': '1f5d1', + 'notepad_spiral': '1f5d2', + 'spiral_note_pad': '1f5d2', + 'calendar_spiral': '1f5d3', + 'spiral_calendar_pad': '1f5d3', + 'compression': '1f5dc', + 'key2': '1f5dd', + 'old_key': '1f5dd', + 'newspaper2': '1f5de', + 'rolled_up_newspaper': '1f5de', + 'dagger': '1f5e1', + 'dagger_knife': '1f5e1', + 'speaking_head': '1f5e3', + 'speaking_head_in_silhouette': '1f5e3', + 'anger_right': '1f5ef', + 'right_anger_bubble': '1f5ef', + 'ballot_box': '1f5f3', + 'ballot_box_with_ballot': '1f5f3', + 'map': '1f5fa', + 'world_map': '1f5fa', + 'sleeping_accommodation': '1f6cc', + 'tools': '1f6e0', + 'hammer_and_wrench': '1f6e0', + 'shield': '1f6e1', + 'oil': '1f6e2', + 'oil_drum': '1f6e2', + 'satellite_orbital': '1f6f0', + 'fork_knife_plate': '1f37d', + 'fork_and_knife_with_plate': '1f37d', + 'eye': '1f441', + 'levitate': '1f574', + 'man_in_business_suit_levitating': '1f574', + 'spy': '1f575', + 'sleuth_or_spy': '1f575', + 'writing_hand': '270d', + 'hand_splayed': '1f590', + 'raised_hand_with_fingers_splayed': '1f590', + 'middle_finger': '1f595', + 'reversed_hand_with_middle_finger_extended': '1f595', + 'vulcan': '1f596', + 'raised_hand_with_part_between_middle_and_ring_fingers': '1f596', + 'slight_frown': '1f641', + 'slightly_frowning_face': '1f641', + 'slight_smile': '1f642', + 'slightly_smiling_face': '1f642', + 'mountain_snow': '1f3d4', + 'snow_capped_mountain': '1f3d4', + 'camping': '1f3d5', + 'beach': '1f3d6', + 'beach_with_umbrella': '1f3d6', + 'construction_site': '1f3d7', + 'building_construction': '1f3d7', + 'homes': '1f3d8', + 'house_buildings': '1f3d8', + 'cityscape': '1f3d9', + 'house_abandoned': '1f3da', + 'derelict_house_building': '1f3da', + 'classical_building': '1f3db', + 'desert': '1f3dc', + 'island': '1f3dd', + 'desert_island': '1f3dd', + 'park': '1f3de', + 'national_park': '1f3de', + 'stadium': '1f3df', + 'couch': '1f6cb', + 'couch_and_lamp': '1f6cb', + 'shopping_bags': '1f6cd', + 'bellhop': '1f6ce', + 'bellhop_bell': '1f6ce', + 'bed': '1f6cf', + 'motorway': '1f6e3', + 'railway_track': '1f6e4', + 'railroad_track': '1f6e4', + 'motorboat': '1f6e5', + 'airplane_small': '1f6e9', + 'small_airplane': '1f6e9', + 'airplane_departure': '1f6eb', + 'airplane_arriving': '1f6ec', + 'cruise_ship': '1f6f3', + 'passenger_ship': '1f6f3', + 'baby_tone1': '1f476-1f3fb', + 'baby_tone2': '1f476-1f3fc', + 'baby_tone3': '1f476-1f3fd', + 'baby_tone4': '1f476-1f3fe', + 'baby_tone5': '1f476-1f3ff', + 'boy_tone1': '1f466-1f3fb', + 'boy_tone2': '1f466-1f3fc', + 'boy_tone3': '1f466-1f3fd', + 'boy_tone4': '1f466-1f3fe', + 'boy_tone5': '1f466-1f3ff', + 'girl_tone1': '1f467-1f3fb', + 'girl_tone2': '1f467-1f3fc', + 'girl_tone3': '1f467-1f3fd', + 'girl_tone4': '1f467-1f3fe', + 'girl_tone5': '1f467-1f3ff', + 'man_tone1': '1f468-1f3fb', + 'man_tone2': '1f468-1f3fc', + 'man_tone3': '1f468-1f3fd', + 'man_tone4': '1f468-1f3fe', + 'man_tone5': '1f468-1f3ff', + 'woman_tone1': '1f469-1f3fb', + 'woman_tone2': '1f469-1f3fc', + 'woman_tone3': '1f469-1f3fd', + 'woman_tone4': '1f469-1f3fe', + 'woman_tone5': '1f469-1f3ff', + 'bride_with_veil_tone1': '1f470-1f3fb', + 'bride_with_veil_tone2': '1f470-1f3fc', + 'bride_with_veil_tone3': '1f470-1f3fd', + 'bride_with_veil_tone4': '1f470-1f3fe', + 'bride_with_veil_tone5': '1f470-1f3ff', + 'person_with_blond_hair_tone1': '1f471-1f3fb', + 'person_with_blond_hair_tone2': '1f471-1f3fc', + 'person_with_blond_hair_tone3': '1f471-1f3fd', + 'person_with_blond_hair_tone4': '1f471-1f3fe', + 'person_with_blond_hair_tone5': '1f471-1f3ff', + 'man_with_gua_pi_mao_tone1': '1f472-1f3fb', + 'man_with_gua_pi_mao_tone2': '1f472-1f3fc', + 'man_with_gua_pi_mao_tone3': '1f472-1f3fd', + 'man_with_gua_pi_mao_tone4': '1f472-1f3fe', + 'man_with_gua_pi_mao_tone5': '1f472-1f3ff', + 'man_with_turban_tone1': '1f473-1f3fb', + 'man_with_turban_tone2': '1f473-1f3fc', + 'man_with_turban_tone3': '1f473-1f3fd', + 'man_with_turban_tone4': '1f473-1f3fe', + 'man_with_turban_tone5': '1f473-1f3ff', + 'older_man_tone1': '1f474-1f3fb', + 'older_man_tone2': '1f474-1f3fc', + 'older_man_tone3': '1f474-1f3fd', + 'older_man_tone4': '1f474-1f3fe', + 'older_man_tone5': '1f474-1f3ff', + 'older_woman_tone1': '1f475-1f3fb', + 'grandma_tone1': '1f475-1f3fb', + 'older_woman_tone2': '1f475-1f3fc', + 'grandma_tone2': '1f475-1f3fc', + 'older_woman_tone3': '1f475-1f3fd', + 'grandma_tone3': '1f475-1f3fd', + 'older_woman_tone4': '1f475-1f3fe', + 'grandma_tone4': '1f475-1f3fe', + 'older_woman_tone5': '1f475-1f3ff', + 'grandma_tone5': '1f475-1f3ff', + 'cop_tone1': '1f46e-1f3fb', + 'cop_tone2': '1f46e-1f3fc', + 'cop_tone3': '1f46e-1f3fd', + 'cop_tone4': '1f46e-1f3fe', + 'cop_tone5': '1f46e-1f3ff', + 'construction_worker_tone1': '1f477-1f3fb', + 'construction_worker_tone2': '1f477-1f3fc', + 'construction_worker_tone3': '1f477-1f3fd', + 'construction_worker_tone4': '1f477-1f3fe', + 'construction_worker_tone5': '1f477-1f3ff', + 'princess_tone1': '1f478-1f3fb', + 'princess_tone2': '1f478-1f3fc', + 'princess_tone3': '1f478-1f3fd', + 'princess_tone4': '1f478-1f3fe', + 'princess_tone5': '1f478-1f3ff', + 'guardsman_tone1': '1f482-1f3fb', + 'guardsman_tone2': '1f482-1f3fc', + 'guardsman_tone3': '1f482-1f3fd', + 'guardsman_tone4': '1f482-1f3fe', + 'guardsman_tone5': '1f482-1f3ff', + 'angel_tone1': '1f47c-1f3fb', + 'angel_tone2': '1f47c-1f3fc', + 'angel_tone3': '1f47c-1f3fd', + 'angel_tone4': '1f47c-1f3fe', + 'angel_tone5': '1f47c-1f3ff', + 'bow_tone1': '1f647-1f3fb', + 'bow_tone2': '1f647-1f3fc', + 'bow_tone3': '1f647-1f3fd', + 'bow_tone4': '1f647-1f3fe', + 'bow_tone5': '1f647-1f3ff', + 'information_desk_person_tone1': '1f481-1f3fb', + 'information_desk_person_tone2': '1f481-1f3fc', + 'information_desk_person_tone3': '1f481-1f3fd', + 'information_desk_person_tone4': '1f481-1f3fe', + 'information_desk_person_tone5': '1f481-1f3ff', + 'no_good_tone1': '1f645-1f3fb', + 'no_good_tone2': '1f645-1f3fc', + 'no_good_tone3': '1f645-1f3fd', + 'no_good_tone4': '1f645-1f3fe', + 'no_good_tone5': '1f645-1f3ff', + 'ok_woman_tone1': '1f646-1f3fb', + 'ok_woman_tone2': '1f646-1f3fc', + 'ok_woman_tone3': '1f646-1f3fd', + 'ok_woman_tone4': '1f646-1f3fe', + 'ok_woman_tone5': '1f646-1f3ff', + 'raising_hand_tone1': '1f64b-1f3fb', + 'raising_hand_tone2': '1f64b-1f3fc', + 'raising_hand_tone3': '1f64b-1f3fd', + 'raising_hand_tone4': '1f64b-1f3fe', + 'raising_hand_tone5': '1f64b-1f3ff', + 'person_with_pouting_face_tone1': '1f64e-1f3fb', + 'person_with_pouting_face_tone2': '1f64e-1f3fc', + 'person_with_pouting_face_tone3': '1f64e-1f3fd', + 'person_with_pouting_face_tone4': '1f64e-1f3fe', + 'person_with_pouting_face_tone5': '1f64e-1f3ff', + 'person_frowning_tone1': '1f64d-1f3fb', + 'person_frowning_tone2': '1f64d-1f3fc', + 'person_frowning_tone3': '1f64d-1f3fd', + 'person_frowning_tone4': '1f64d-1f3fe', + 'person_frowning_tone5': '1f64d-1f3ff', + 'massage_tone1': '1f486-1f3fb', + 'massage_tone2': '1f486-1f3fc', + 'massage_tone3': '1f486-1f3fd', + 'massage_tone4': '1f486-1f3fe', + 'massage_tone5': '1f486-1f3ff', + 'haircut_tone1': '1f487-1f3fb', + 'haircut_tone2': '1f487-1f3fc', + 'haircut_tone3': '1f487-1f3fd', + 'haircut_tone4': '1f487-1f3fe', + 'haircut_tone5': '1f487-1f3ff', + 'raised_hands_tone1': '1f64c-1f3fb', + 'raised_hands_tone2': '1f64c-1f3fc', + 'raised_hands_tone3': '1f64c-1f3fd', + 'raised_hands_tone4': '1f64c-1f3fe', + 'raised_hands_tone5': '1f64c-1f3ff', + 'clap_tone1': '1f44f-1f3fb', + 'clap_tone2': '1f44f-1f3fc', + 'clap_tone3': '1f44f-1f3fd', + 'clap_tone4': '1f44f-1f3fe', + 'clap_tone5': '1f44f-1f3ff', + 'ear_tone1': '1f442-1f3fb', + 'ear_tone2': '1f442-1f3fc', + 'ear_tone3': '1f442-1f3fd', + 'ear_tone4': '1f442-1f3fe', + 'ear_tone5': '1f442-1f3ff', + 'nose_tone1': '1f443-1f3fb', + 'nose_tone2': '1f443-1f3fc', + 'nose_tone3': '1f443-1f3fd', + 'nose_tone4': '1f443-1f3fe', + 'nose_tone5': '1f443-1f3ff', + 'nail_care_tone1': '1f485-1f3fb', + 'nail_care_tone2': '1f485-1f3fc', + 'nail_care_tone3': '1f485-1f3fd', + 'nail_care_tone4': '1f485-1f3fe', + 'nail_care_tone5': '1f485-1f3ff', + 'wave_tone1': '1f44b-1f3fb', + 'wave_tone2': '1f44b-1f3fc', + 'wave_tone3': '1f44b-1f3fd', + 'wave_tone4': '1f44b-1f3fe', + 'wave_tone5': '1f44b-1f3ff', + 'thumbsup_tone1': '1f44d-1f3fb', + '+1_tone1': '1f44d-1f3fb', + 'thumbup_tone1': '1f44d-1f3fb', + 'thumbsup_tone2': '1f44d-1f3fc', + '+1_tone2': '1f44d-1f3fc', + 'thumbup_tone2': '1f44d-1f3fc', + 'thumbsup_tone3': '1f44d-1f3fd', + '+1_tone3': '1f44d-1f3fd', + 'thumbup_tone3': '1f44d-1f3fd', + 'thumbsup_tone4': '1f44d-1f3fe', + '+1_tone4': '1f44d-1f3fe', + 'thumbup_tone4': '1f44d-1f3fe', + 'thumbsup_tone5': '1f44d-1f3ff', + '+1_tone5': '1f44d-1f3ff', + 'thumbup_tone5': '1f44d-1f3ff', + 'thumbsdown_tone1': '1f44e-1f3fb', + '-1_tone1': '1f44e-1f3fb', + 'thumbdown_tone1': '1f44e-1f3fb', + 'thumbsdown_tone2': '1f44e-1f3fc', + '-1_tone2': '1f44e-1f3fc', + 'thumbdown_tone2': '1f44e-1f3fc', + 'thumbsdown_tone3': '1f44e-1f3fd', + '-1_tone3': '1f44e-1f3fd', + 'thumbdown_tone3': '1f44e-1f3fd', + 'thumbsdown_tone4': '1f44e-1f3fe', + '-1_tone4': '1f44e-1f3fe', + 'thumbdown_tone4': '1f44e-1f3fe', + 'thumbsdown_tone5': '1f44e-1f3ff', + '-1_tone5': '1f44e-1f3ff', + 'thumbdown_tone5': '1f44e-1f3ff', + 'point_up_tone1': '261d-1f3fb', + 'point_up_tone2': '261d-1f3fc', + 'point_up_tone3': '261d-1f3fd', + 'point_up_tone4': '261d-1f3fe', + 'point_up_tone5': '261d-1f3ff', + 'point_up_2_tone1': '1f446-1f3fb', + 'point_up_2_tone2': '1f446-1f3fc', + 'point_up_2_tone3': '1f446-1f3fd', + 'point_up_2_tone4': '1f446-1f3fe', + 'point_up_2_tone5': '1f446-1f3ff', + 'point_down_tone1': '1f447-1f3fb', + 'point_down_tone2': '1f447-1f3fc', + 'point_down_tone3': '1f447-1f3fd', + 'point_down_tone4': '1f447-1f3fe', + 'point_down_tone5': '1f447-1f3ff', + 'point_left_tone1': '1f448-1f3fb', + 'point_left_tone2': '1f448-1f3fc', + 'point_left_tone3': '1f448-1f3fd', + 'point_left_tone4': '1f448-1f3fe', + 'point_left_tone5': '1f448-1f3ff', + 'point_right_tone1': '1f449-1f3fb', + 'point_right_tone2': '1f449-1f3fc', + 'point_right_tone3': '1f449-1f3fd', + 'point_right_tone4': '1f449-1f3fe', + 'point_right_tone5': '1f449-1f3ff', + 'ok_hand_tone1': '1f44c-1f3fb', + 'ok_hand_tone2': '1f44c-1f3fc', + 'ok_hand_tone3': '1f44c-1f3fd', + 'ok_hand_tone4': '1f44c-1f3fe', + 'ok_hand_tone5': '1f44c-1f3ff', + 'v_tone1': '270c-1f3fb', + 'v_tone2': '270c-1f3fc', + 'v_tone3': '270c-1f3fd', + 'v_tone4': '270c-1f3fe', + 'v_tone5': '270c-1f3ff', + 'punch_tone1': '1f44a-1f3fb', + 'punch_tone2': '1f44a-1f3fc', + 'punch_tone3': '1f44a-1f3fd', + 'punch_tone4': '1f44a-1f3fe', + 'punch_tone5': '1f44a-1f3ff', + 'fist_tone1': '270a-1f3fb', + 'fist_tone2': '270a-1f3fc', + 'fist_tone3': '270a-1f3fd', + 'fist_tone4': '270a-1f3fe', + 'fist_tone5': '270a-1f3ff', + 'raised_hand_tone1': '270b-1f3fb', + 'raised_hand_tone2': '270b-1f3fc', + 'raised_hand_tone3': '270b-1f3fd', + 'raised_hand_tone4': '270b-1f3fe', + 'raised_hand_tone5': '270b-1f3ff', + 'muscle_tone1': '1f4aa-1f3fb', + 'muscle_tone2': '1f4aa-1f3fc', + 'muscle_tone3': '1f4aa-1f3fd', + 'muscle_tone4': '1f4aa-1f3fe', + 'muscle_tone5': '1f4aa-1f3ff', + 'open_hands_tone1': '1f450-1f3fb', + 'open_hands_tone2': '1f450-1f3fc', + 'open_hands_tone3': '1f450-1f3fd', + 'open_hands_tone4': '1f450-1f3fe', + 'open_hands_tone5': '1f450-1f3ff', + 'pray_tone1': '1f64f-1f3fb', + 'pray_tone2': '1f64f-1f3fc', + 'pray_tone3': '1f64f-1f3fd', + 'pray_tone4': '1f64f-1f3fe', + 'pray_tone5': '1f64f-1f3ff', + 'runner_tone1': '1f3c3-1f3fb', + 'runner_tone2': '1f3c3-1f3fc', + 'runner_tone3': '1f3c3-1f3fd', + 'runner_tone4': '1f3c3-1f3fe', + 'runner_tone5': '1f3c3-1f3ff', + 'walking_tone1': '1f6b6-1f3fb', + 'walking_tone2': '1f6b6-1f3fc', + 'walking_tone3': '1f6b6-1f3fd', + 'walking_tone4': '1f6b6-1f3fe', + 'walking_tone5': '1f6b6-1f3ff', + 'dancer_tone1': '1f483-1f3fb', + 'dancer_tone2': '1f483-1f3fc', + 'dancer_tone3': '1f483-1f3fd', + 'dancer_tone4': '1f483-1f3fe', + 'dancer_tone5': '1f483-1f3ff', + 'rowboat_tone1': '1f6a3-1f3fb', + 'rowboat_tone2': '1f6a3-1f3fc', + 'rowboat_tone3': '1f6a3-1f3fd', + 'rowboat_tone4': '1f6a3-1f3fe', + 'rowboat_tone5': '1f6a3-1f3ff', + 'swimmer_tone1': '1f3ca-1f3fb', + 'swimmer_tone2': '1f3ca-1f3fc', + 'swimmer_tone3': '1f3ca-1f3fd', + 'swimmer_tone4': '1f3ca-1f3fe', + 'swimmer_tone5': '1f3ca-1f3ff', + 'surfer_tone1': '1f3c4-1f3fb', + 'surfer_tone2': '1f3c4-1f3fc', + 'surfer_tone3': '1f3c4-1f3fd', + 'surfer_tone4': '1f3c4-1f3fe', + 'surfer_tone5': '1f3c4-1f3ff', + 'bath_tone1': '1f6c0-1f3fb', + 'bath_tone2': '1f6c0-1f3fc', + 'bath_tone3': '1f6c0-1f3fd', + 'bath_tone4': '1f6c0-1f3fe', + 'bath_tone5': '1f6c0-1f3ff', + 'bicyclist_tone1': '1f6b4-1f3fb', + 'bicyclist_tone2': '1f6b4-1f3fc', + 'bicyclist_tone3': '1f6b4-1f3fd', + 'bicyclist_tone4': '1f6b4-1f3fe', + 'bicyclist_tone5': '1f6b4-1f3ff', + 'mountain_bicyclist_tone1': '1f6b5-1f3fb', + 'mountain_bicyclist_tone2': '1f6b5-1f3fc', + 'mountain_bicyclist_tone3': '1f6b5-1f3fd', + 'mountain_bicyclist_tone4': '1f6b5-1f3fe', + 'mountain_bicyclist_tone5': '1f6b5-1f3ff', + 'horse_racing_tone1': '1f3c7-1f3fb', + 'horse_racing_tone2': '1f3c7-1f3fc', + 'horse_racing_tone3': '1f3c7-1f3fd', + 'horse_racing_tone4': '1f3c7-1f3fe', + 'horse_racing_tone5': '1f3c7-1f3ff', + 'writing_hand_tone1': '270d-1f3fb', + 'writing_hand_tone2': '270d-1f3fc', + 'writing_hand_tone3': '270d-1f3fd', + 'writing_hand_tone4': '270d-1f3fe', + 'writing_hand_tone5': '270d-1f3ff', + 'hand_splayed_tone1': '1f590-1f3fb', + 'raised_hand_with_fingers_splayed_tone1': '1f590-1f3fb', + 'hand_splayed_tone2': '1f590-1f3fc', + 'raised_hand_with_fingers_splayed_tone2': '1f590-1f3fc', + 'hand_splayed_tone3': '1f590-1f3fd', + 'raised_hand_with_fingers_splayed_tone3': '1f590-1f3fd', + 'hand_splayed_tone4': '1f590-1f3fe', + 'raised_hand_with_fingers_splayed_tone4': '1f590-1f3fe', + 'hand_splayed_tone5': '1f590-1f3ff', + 'raised_hand_with_fingers_splayed_tone5': '1f590-1f3ff', + 'middle_finger_tone1': '1f595-1f3fb', + 'reversed_hand_with_middle_finger_extended_tone1': '1f595-1f3fb', + 'middle_finger_tone2': '1f595-1f3fc', + 'reversed_hand_with_middle_finger_extended_tone2': '1f595-1f3fc', + 'middle_finger_tone3': '1f595-1f3fd', + 'reversed_hand_with_middle_finger_extended_tone3': '1f595-1f3fd', + 'middle_finger_tone4': '1f595-1f3fe', + 'reversed_hand_with_middle_finger_extended_tone4': '1f595-1f3fe', + 'middle_finger_tone5': '1f595-1f3ff', + 'reversed_hand_with_middle_finger_extended_tone5': '1f595-1f3ff', + 'vulcan_tone1': '1f596-1f3fb', + 'raised_hand_with_part_between_middle_and_ring_fingers_tone1': '1f596-1f3fb', + 'vulcan_tone2': '1f596-1f3fc', + 'raised_hand_with_part_between_middle_and_ring_fingers_tone2': '1f596-1f3fc', + 'vulcan_tone3': '1f596-1f3fd', + 'raised_hand_with_part_between_middle_and_ring_fingers_tone3': '1f596-1f3fd', + 'vulcan_tone4': '1f596-1f3fe', + 'raised_hand_with_part_between_middle_and_ring_fingers_tone4': '1f596-1f3fe', + 'vulcan_tone5': '1f596-1f3ff', + 'raised_hand_with_part_between_middle_and_ring_fingers_tone5': '1f596-1f3ff', + 'family_mmb': '1f468-1f468-1f466', + 'family_mmbb': '1f468-1f468-1f466-1f466', + 'family_mmg': '1f468-1f468-1f467', + 'family_mmgb': '1f468-1f468-1f467-1f466', + 'family_mmgg': '1f468-1f468-1f467-1f467', + 'family_mwbb': '1f468-1f469-1f466-1f466', + 'family_mwg': '1f468-1f469-1f467', + 'family_mwgb': '1f468-1f469-1f467-1f466', + 'family_mwgg': '1f468-1f469-1f467-1f467', + 'family_wwb': '1f469-1f469-1f466', + 'family_wwbb': '1f469-1f469-1f466-1f466', + 'family_wwg': '1f469-1f469-1f467', + 'family_wwgb': '1f469-1f469-1f467-1f466', + 'family_wwgg': '1f469-1f469-1f467-1f467', + 'couple_ww': '1f469-2764-1f469', + 'couple_with_heart_ww': '1f469-2764-1f469', + 'couple_mm': '1f468-2764-1f468', + 'couple_with_heart_mm': '1f468-2764-1f468', + 'kiss_ww': '1f469-2764-1f48b-1f469', + 'couplekiss_ww': '1f469-2764-1f48b-1f469', + 'kiss_mm': '1f468-2764-1f48b-1f468', + 'couplekiss_mm': '1f468-2764-1f48b-1f468', + 'tone1': '1f3fb', + 'tone2': '1f3fc', + 'tone3': '1f3fd', + 'tone4': '1f3fe', + 'tone5': '1f3ff', + 'asterisk': '002a-20e3', + 'keycap_asterisk': '002a-20e3', + 'track_next': '23ed', + 'next_track': '23ed', + 'track_previous': '23ee', + 'previous_track': '23ee', + 'play_pause': '23ef', + 'eye_in_speech_bubble': '1f441-1f5e8', + 'stopwatch': '23f1', + 'timer': '23f2', + 'timer_clock': '23f2', + 'pause_button': '23f8', + 'double_vertical_bar': '23f8', + 'stop_button': '23f9', + 'record_button': '23fa', + 'umbrella2': '2602', + 'snowman2': '2603', + 'comet': '2604', + 'shamrock': '2618', + 'skull_crossbones': '2620', + 'skull_and_crossbones': '2620', + 'radioactive': '2622', + 'radioactive_sign': '2622', + 'biohazard': '2623', + 'biohazard_sign': '2623', + 'orthodox_cross': '2626', + 'star_and_crescent': '262a', + 'peace': '262e', + 'peace_symbol': '262e', + 'yin_yang': '262f', + 'wheel_of_dharma': '2638', + 'frowning2': '2639', + 'white_frowning_face': '2639', + 'hammer_pick': '2692', + 'hammer_and_pick': '2692', + 'crossed_swords': '2694', + 'scales': '2696', + 'alembic': '2697', + 'gear': '2699', + 'atom': '269b', + 'atom_symbol': '269b', + 'fleur-de-lis': '269c', + 'coffin': '26b0', + 'urn': '26b1', + 'funeral_urn': '26b1', + 'thunder_cloud_rain': '26c8', + 'thunder_cloud_and_rain': '26c8', + 'pick': '26cf', + 'helmet_with_cross': '26d1', + 'helmet_with_white_cross': '26d1', + 'chains': '26d3', + 'shinto_shrine': '26e9', + 'mountain': '26f0', + 'beach_umbrella': '26f1', + 'umbrella_on_ground': '26f1', + 'ferry': '26f4', + 'skier': '26f7', + 'ice_skate': '26f8', + 'basketball_player': '26f9', + 'person_with_ball': '26f9', + 'star_of_david': '2721', + 'heart_exclamation': '2763', + 'heavy_heart_exclamation_mark_ornament': '2763', + 'white_sun_small_cloud': '1f324', + 'white_sun_with_small_cloud': '1f324', + 'white_sun_cloud': '1f325', + 'white_sun_behind_cloud': '1f325', + 'white_sun_rain_cloud': '1f326', + 'white_sun_behind_cloud_with_rain': '1f326', + 'mouse_three_button': '1f5b1', + 'three_button_mouse': '1f5b1', + 'santa_tone1': '1f385-1f3fb', + 'santa_tone2': '1f385-1f3fc', + 'santa_tone3': '1f385-1f3fd', + 'santa_tone4': '1f385-1f3fe', + 'santa_tone5': '1f385-1f3ff', + 'metal_tone1': '1f918-1f3fb', + 'sign_of_the_horns_tone1': '1f918-1f3fb', + 'metal_tone2': '1f918-1f3fc', + 'sign_of_the_horns_tone2': '1f918-1f3fc', + 'metal_tone3': '1f918-1f3fd', + 'sign_of_the_horns_tone3': '1f918-1f3fd', + 'metal_tone4': '1f918-1f3fe', + 'sign_of_the_horns_tone4': '1f918-1f3fe', + 'metal_tone5': '1f918-1f3ff', + 'sign_of_the_horns_tone5': '1f918-1f3ff', + 'lifter_tone1': '1f3cb-1f3fb', + 'weight_lifter_tone1': '1f3cb-1f3fb', + 'lifter_tone2': '1f3cb-1f3fc', + 'weight_lifter_tone2': '1f3cb-1f3fc', + 'lifter_tone3': '1f3cb-1f3fd', + 'weight_lifter_tone3': '1f3cb-1f3fd', + 'lifter_tone4': '1f3cb-1f3fe', + 'weight_lifter_tone4': '1f3cb-1f3fe', + 'lifter_tone5': '1f3cb-1f3ff', + 'weight_lifter_tone5': '1f3cb-1f3ff', + 'basketball_player_tone1': '26f9-1f3fb', + 'person_with_ball_tone1': '26f9-1f3fb', + 'basketball_player_tone2': '26f9-1f3fc', + 'person_with_ball_tone2': '26f9-1f3fc', + 'basketball_player_tone3': '26f9-1f3fd', + 'person_with_ball_tone3': '26f9-1f3fd', + 'basketball_player_tone4': '26f9-1f3fe', + 'person_with_ball_tone4': '26f9-1f3fe', + 'basketball_player_tone5': '26f9-1f3ff', + 'person_with_ball_tone5': '26f9-1f3ff', + 'upside_down': '1f643', + 'upside_down_face': '1f643', + 'money_mouth': '1f911', + 'money_mouth_face': '1f911', + 'nerd': '1f913', + 'nerd_face': '1f913', + 'hugging': '1f917', + 'hugging_face': '1f917', + 'rolling_eyes': '1f644', + 'face_with_rolling_eyes': '1f644', + 'thinking': '1f914', + 'thinking_face': '1f914', + 'zipper_mouth': '1f910', + 'zipper_mouth_face': '1f910', + 'thermometer_face': '1f912', + 'face_with_thermometer': '1f912', + 'head_bandage': '1f915', + 'face_with_head_bandage': '1f915', + 'robot': '1f916', + 'robot_face': '1f916', + 'lion_face': '1f981', + 'lion': '1f981', + 'unicorn': '1f984', + 'unicorn_face': '1f984', + 'scorpion': '1f982', + 'crab': '1f980', + 'turkey': '1f983', + 'cheese': '1f9c0', + 'cheese_wedge': '1f9c0', + 'hotdog': '1f32d', + 'hot_dog': '1f32d', + 'taco': '1f32e', + 'burrito': '1f32f', + 'popcorn': '1f37f', + 'champagne': '1f37e', + 'bottle_with_popping_cork': '1f37e', + 'bow_and_arrow': '1f3f9', + 'archery': '1f3f9', + 'amphora': '1f3fa', + 'place_of_worship': '1f6d0', + 'worship_symbol': '1f6d0', + 'kaaba': '1f54b', + 'mosque': '1f54c', + 'synagogue': '1f54d', + 'menorah': '1f54e', + 'prayer_beads': '1f4ff', + 'cricket': '1f3cf', + 'cricket_bat_ball': '1f3cf', + 'volleyball': '1f3d0', + 'field_hockey': '1f3d1', + 'hockey': '1f3d2', + 'ping_pong': '1f3d3', + 'table_tennis': '1f3d3', + 'badminton': '1f3f8', + 'flag_ax': '1f1e6-1f1fd', + 'ax': '1f1e6-1f1fd', + 'flag_ta': '1f1f9-1f1e6', + 'ta': '1f1f9-1f1e6', + 'flag_io': '1f1ee-1f1f4', + 'io': '1f1ee-1f1f4', + 'flag_bq': '1f1e7-1f1f6', + 'bq': '1f1e7-1f1f6', + 'flag_cx': '1f1e8-1f1fd', + 'cx': '1f1e8-1f1fd', + 'flag_cc': '1f1e8-1f1e8', + 'cc': '1f1e8-1f1e8', + 'flag_gg': '1f1ec-1f1ec', + 'gg': '1f1ec-1f1ec', + 'flag_im': '1f1ee-1f1f2', + 'im': '1f1ee-1f1f2', + 'flag_yt': '1f1fe-1f1f9', + 'yt': '1f1fe-1f1f9', + 'flag_nf': '1f1f3-1f1eb', + 'nf': '1f1f3-1f1eb', + 'flag_pn': '1f1f5-1f1f3', + 'pn': '1f1f5-1f1f3', + 'flag_bl': '1f1e7-1f1f1', + 'bl': '1f1e7-1f1f1', + 'flag_pm': '1f1f5-1f1f2', + 'pm': '1f1f5-1f1f2', + 'flag_gs': '1f1ec-1f1f8', + 'gs': '1f1ec-1f1f8', + 'flag_tk': '1f1f9-1f1f0', + 'tk': '1f1f9-1f1f0', + 'flag_bv': '1f1e7-1f1fb', + 'bv': '1f1e7-1f1fb', + 'flag_hm': '1f1ed-1f1f2', + 'hm': '1f1ed-1f1f2', + 'flag_sj': '1f1f8-1f1ef', + 'sj': '1f1f8-1f1ef', + 'flag_um': '1f1fa-1f1f2', + 'um': '1f1fa-1f1f2', + 'flag_ic': '1f1ee-1f1e8', + 'ic': '1f1ee-1f1e8', + 'flag_ea': '1f1ea-1f1e6', + 'ea': '1f1ea-1f1e6', + 'flag_cp': '1f1e8-1f1f5', + 'cp': '1f1e8-1f1f5', + 'flag_dg': '1f1e9-1f1ec', + 'dg': '1f1e9-1f1ec', + 'flag_as': '1f1e6-1f1f8', + 'as': '1f1e6-1f1f8', + 'flag_aq': '1f1e6-1f1f6', + 'aq': '1f1e6-1f1f6', + 'flag_vg': '1f1fb-1f1ec', + 'vg': '1f1fb-1f1ec', + 'flag_ck': '1f1e8-1f1f0', + 'ck': '1f1e8-1f1f0', + 'flag_cw': '1f1e8-1f1fc', + 'cw': '1f1e8-1f1fc', + 'flag_eu': '1f1ea-1f1fa', + 'eu': '1f1ea-1f1fa', + 'flag_gf': '1f1ec-1f1eb', + 'gf': '1f1ec-1f1eb', + 'flag_tf': '1f1f9-1f1eb', + 'tf': '1f1f9-1f1eb', + 'flag_gp': '1f1ec-1f1f5', + 'gp': '1f1ec-1f1f5', + 'flag_mq': '1f1f2-1f1f6', + 'mq': '1f1f2-1f1f6', + 'flag_mp': '1f1f2-1f1f5', + 'mp': '1f1f2-1f1f5', + 'flag_re': '1f1f7-1f1ea', + 're': '1f1f7-1f1ea', + 'flag_sx': '1f1f8-1f1fd', + 'sx': '1f1f8-1f1fd', + 'flag_ss': '1f1f8-1f1f8', + 'ss': '1f1f8-1f1f8', + 'flag_tc': '1f1f9-1f1e8', + 'tc': '1f1f9-1f1e8', + 'flag_mf': '1f1f2-1f1eb', + 'mf': '1f1f2-1f1eb', + 'spy_tone1': '1f575-1f3fb', + 'sleuth_or_spy_tone1': '1f575-1f3fb', + 'spy_tone2': '1f575-1f3fc', + 'sleuth_or_spy_tone2': '1f575-1f3fc', + 'spy_tone3': '1f575-1f3fd', + 'sleuth_or_spy_tone3': '1f575-1f3fd', + 'spy_tone4': '1f575-1f3fe', + 'sleuth_or_spy_tone4': '1f575-1f3fe', + 'spy_tone5': '1f575-1f3ff', + 'sleuth_or_spy_tone5': '1f575-1f3ff' + }); + } + }; +});; +'use strict'; + System.register('flarum/emoji/main', ['flarum/extend', 'flarum/app', 'flarum/models/Post', 'flarum/emoji/addComposerAutocomplete'], function (_export, _context) { var override, app, Post, addComposerAutocomplete; return { diff --git a/extensions/emoji/js/forum/src/addComposerAutocomplete.js b/extensions/emoji/js/forum/src/addComposerAutocomplete.js index 449d97f64..1dfbf3fa4 100644 --- a/extensions/emoji/js/forum/src/addComposerAutocomplete.js +++ b/extensions/emoji/js/forum/src/addComposerAutocomplete.js @@ -2,13 +2,12 @@ import { extend } from 'flarum/extend'; import ComposerBody from 'flarum/components/ComposerBody'; +import emojiMap from 'flarum/emoji/helpers/emojiMap'; import AutocompleteDropdown from 'flarum/emoji/components/AutocompleteDropdown'; export default function addComposerAutocomplete() { - const emojiMap = {"-1":"1f44e","+1":"1f44d","8ball":"1f3b1","a":"1f170","ab":"1f18e","abc":"1f524","abcd":"1f521","accept":"1f251","aerial_tramway":"1f6a1","airplane":"2708","alarm_clock":"23f0","alien":"1f47d","ambulance":"1f691","anchor":"2693","angel":"1f47c","anger":"1f4a2","angry":"1f620","anguished":"1f627","ant":"1f41c","apple":"1f34e","aquarius":"2652","aries":"2648","arrow_backward":"25c0","arrow_double_down":"23ec","arrow_double_up":"23eb","arrow_down":"2b07","arrow_down_small":"1f53d","arrow_forward":"25b6","arrow_heading_down":"2935","arrow_heading_up":"2934","arrow_left":"2b05","arrow_lower_left":"2199","arrow_lower_right":"2198","arrow_right":"27a1","arrow_right_hook":"21aa","arrow_up":"2b06","arrow_up_down":"2195","arrow_up_small":"1f53c","arrow_upper_left":"2196","arrow_upper_right":"2197","arrows_clockwise":"1f503","arrows_counterclockwise":"1f504","art":"1f3a8","articulated_lorry":"1f69b","astonished":"1f632","athletic_shoe":"1f45f","atm":"1f3e7","b":"1f171","baby":"1f476","baby_bottle":"1f37c","baby_chick":"1f424","baby_symbol":"1f6bc","back":"1f519","baggage_claim":"1f6c4","balloon":"1f388","ballot_box_with_check":"2611","bamboo":"1f38d","banana":"1f34c","bangbang":"203c","bank":"1f3e6","bar_chart":"1f4ca","barber":"1f488","baseball":"26be","basketball":"1f3c0","bath":"1f6c0","bathtub":"1f6c1","battery":"1f50b","bear":"1f43b","bee":"1f41d","beer":"1f37a","beers":"1f37b","beetle":"1f41e","beginner":"1f530","bell":"1f514","bento":"1f371","bicyclist":"1f6b4","bike":"1f6b2","bikini":"1f459","bird":"1f426","birthday":"1f382","black_circle":"26ab","black_joker":"1f0cf","black_large_square":"2b1b","black_medium_small_square":"25fe","black_medium_square":"25fc","black_nib":"2712","black_small_square":"25aa","black_square_button":"1f532","blossom":"1f33c","blowfish":"1f421","blue_book":"1f4d8","blue_car":"1f699","blue_heart":"1f499","blush":"1f60a","boar":"1f417","boat":"26f5","bomb":"1f4a3","book":"1f4d6","bookmark":"1f516","bookmark_tabs":"1f4d1","books":"1f4da","boom":"1f4a5","boot":"1f462","bouquet":"1f490","bow":"1f647","bowling":"1f3b3","boy":"1f466","bread":"1f35e","bride_with_veil":"1f470","bridge_at_night":"1f309","briefcase":"1f4bc","broken_heart":"1f494","bug":"1f41b","bulb":"1f4a1","bullettrain_front":"1f685","bullettrain_side":"1f684","bus":"1f68c","busstop":"1f68f","bust_in_silhouette":"1f464","busts_in_silhouette":"1f465","cactus":"1f335","cake":"1f370","calendar":"1f4c6","calling":"1f4f2","camel":"1f42b","camera":"1f4f7","cancer":"264b","candy":"1f36c","capital_abcd":"1f520","capricorn":"2651","car":"1f697","card_index":"1f4c7","carousel_horse":"1f3a0","cat":"1f431","cat2":"1f408","cd":"1f4bf","chart":"1f4b9","chart_with_downwards_trend":"1f4c9","chart_with_upwards_trend":"1f4c8","checkered_flag":"1f3c1","cherries":"1f352","cherry_blossom":"1f338","chestnut":"1f330","chicken":"1f414","children_crossing":"1f6b8","chocolate_bar":"1f36b","christmas_tree":"1f384","church":"26ea","cinema":"1f3a6","circus_tent":"1f3aa","city_sunrise":"1f307","city_sunset":"1f306","cl":"1f191","clap":"1f44f","clapper":"1f3ac","clipboard":"1f4cb","clock1":"1f550","clock10":"1f559","clock1030":"1f565","clock11":"1f55a","clock1130":"1f566","clock12":"1f55b","clock1230":"1f567","clock130":"1f55c","clock2":"1f551","clock230":"1f55d","clock3":"1f552","clock330":"1f55e","clock4":"1f553","clock430":"1f55f","clock5":"1f554","clock530":"1f560","clock6":"1f555","clock630":"1f561","clock7":"1f556","clock730":"1f562","clock8":"1f557","clock830":"1f563","clock9":"1f558","clock930":"1f564","closed_book":"1f4d5","closed_lock_with_key":"1f510","closed_umbrella":"1f302","cloud":"2601","clubs":"2663","cn":"1f1e8-1f1f3","cocktail":"1f378","coffee":"2615","cold_sweat":"1f630","collision":"1f4a5","computer":"1f4bb","confetti_ball":"1f38a","confounded":"1f616","confused":"1f615","congratulations":"3297","construction":"1f6a7","construction_worker":"1f477","convenience_store":"1f3ea","cookie":"1f36a","cool":"1f192","cop":"1f46e","copyright":"a9","corn":"1f33d","couple":"1f46b","couple_with_heart":"1f491","couplekiss":"1f48f","cow":"1f42e","cow2":"1f404","credit_card":"1f4b3","crescent_moon":"1f319","crocodile":"1f40a","crossed_flags":"1f38c","crown":"1f451","cry":"1f622","crying_cat_face":"1f63f","crystal_ball":"1f52e","cupid":"1f498","curly_loop":"27b0","currency_exchange":"1f4b1","curry":"1f35b","custard":"1f36e","customs":"1f6c3","cyclone":"1f300","dancer":"1f483","dancers":"1f46f","dango":"1f361","dart":"1f3af","dash":"1f4a8","date":"1f4c5","de":"1f1e9-1f1ea","deciduous_tree":"1f333","department_store":"1f3ec","diamond_shape_with_a_dot_inside":"1f4a0","diamonds":"2666","disappointed":"1f61e","disappointed_relieved":"1f625","dizzy":"1f4ab","dizzy_face":"1f635","do_not_litter":"1f6af","dog":"1f436","dog2":"1f415","dollar":"1f4b5","dolls":"1f38e","dolphin":"1f42c","door":"1f6aa","doughnut":"1f369","dragon":"1f409","dragon_face":"1f432","dress":"1f457","dromedary_camel":"1f42a","droplet":"1f4a7","dvd":"1f4c0","e-mail":"1f4e7","ear":"1f442","ear_of_rice":"1f33e","earth_africa":"1f30d","earth_americas":"1f30e","earth_asia":"1f30f","egg":"1f373","eggplant":"1f346","eight":"38-20e3","eight_pointed_black_star":"2734","eight_spoked_asterisk":"2733","electric_plug":"1f50c","elephant":"1f418","email":"2709","end":"1f51a","envelope":"2709","envelope_with_arrow":"1f4e9","es":"1f1ea-1f1f8","euro":"1f4b6","european_castle":"1f3f0","european_post_office":"1f3e4","evergreen_tree":"1f332","exclamation":"2757","expressionless":"1f611","eyeglasses":"1f453","eyes":"1f440","facepunch":"1f44a","factory":"1f3ed","fallen_leaf":"1f342","family":"1f46a","fast_forward":"23e9","fax":"1f4e0","fearful":"1f628","feet":"1f43e","ferris_wheel":"1f3a1","file_folder":"1f4c1","fire":"1f525","fire_engine":"1f692","fireworks":"1f386","first_quarter_moon":"1f313","first_quarter_moon_with_face":"1f31b","fish":"1f41f","fish_cake":"1f365","fishing_pole_and_fish":"1f3a3","fist":"270a","five":"35-20e3","flags":"1f38f","flashlight":"1f526","flipper":"1f42c","floppy_disk":"1f4be","flower_playing_cards":"1f3b4","flushed":"1f633","foggy":"1f301","football":"1f3c8","footprints":"1f463","fork_and_knife":"1f374","fountain":"26f2","four":"34-20e3","four_leaf_clover":"1f340","fr":"1f1eb-1f1f7","free":"1f193","fried_shrimp":"1f364","fries":"1f35f","frog":"1f438","frowning":"1f626","fuelpump":"26fd","full_moon":"1f315","full_moon_with_face":"1f31d","game_die":"1f3b2","gb":"1f1ec-1f1e7","gem":"1f48e","gemini":"264a","ghost":"1f47b","gift":"1f381","gift_heart":"1f49d","girl":"1f467","globe_with_meridians":"1f310","goat":"1f410","golf":"26f3","grapes":"1f347","green_apple":"1f34f","green_book":"1f4d7","green_heart":"1f49a","grey_exclamation":"2755","grey_question":"2754","grimacing":"1f62c","grin":"1f601","grinning":"1f600","guardsman":"1f482","guitar":"1f3b8","gun":"1f52b","haircut":"1f487","hamburger":"1f354","hammer":"1f528","hamster":"1f439","hand":"270b","handbag":"1f45c","hankey":"1f4a9","hash":"23-20e3","hatched_chick":"1f425","hatching_chick":"1f423","headphones":"1f3a7","hear_no_evil":"1f649","heart":"2764","heart_decoration":"1f49f","heart_eyes":"1f60d","heart_eyes_cat":"1f63b","heartbeat":"1f493","heartpulse":"1f497","hearts":"2665","heavy_check_mark":"2714","heavy_division_sign":"2797","heavy_dollar_sign":"1f4b2","heavy_exclamation_mark":"2757","heavy_minus_sign":"2796","heavy_multiplication_x":"2716","heavy_plus_sign":"2795","helicopter":"1f681","herb":"1f33f","hibiscus":"1f33a","high_brightness":"1f506","high_heel":"1f460","hocho":"1f52a","honey_pot":"1f36f","honeybee":"1f41d","horse":"1f434","horse_racing":"1f3c7","hospital":"1f3e5","hotel":"1f3e8","hotsprings":"2668","hourglass":"231b","hourglass_flowing_sand":"23f3","house":"1f3e0","house_with_garden":"1f3e1","hushed":"1f62f","ice_cream":"1f368","icecream":"1f366","id":"1f194","ideograph_advantage":"1f250","imp":"1f47f","inbox_tray":"1f4e5","incoming_envelope":"1f4e8","information_desk_person":"1f481","information_source":"2139","innocent":"1f607","interrobang":"2049","iphone":"1f4f1","it":"1f1ee-1f1f9","izakaya_lantern":"1f3ee","jack_o_lantern":"1f383","japan":"1f5fe","japanese_castle":"1f3ef","japanese_goblin":"1f47a","japanese_ogre":"1f479","jeans":"1f456","joy":"1f602","joy_cat":"1f639","jp":"1f1ef-1f1f5","key":"1f511","keycap_ten":"1f51f","kimono":"1f458","kiss":"1f48b","kissing":"1f617","kissing_cat":"1f63d","kissing_closed_eyes":"1f61a","kissing_heart":"1f618","kissing_smiling_eyes":"1f619","knife":"1f52a","koala":"1f428","koko":"1f201","kr":"1f1f0-1f1f7","lantern":"1f3ee","large_blue_circle":"1f535","large_blue_diamond":"1f537","large_orange_diamond":"1f536","last_quarter_moon":"1f317","last_quarter_moon_with_face":"1f31c","laughing":"1f606","leaves":"1f343","ledger":"1f4d2","left_luggage":"1f6c5","left_right_arrow":"2194","leftwards_arrow_with_hook":"21a9","lemon":"1f34b","leo":"264c","leopard":"1f406","libra":"264e","light_rail":"1f688","link":"1f517","lips":"1f444","lipstick":"1f484","lock":"1f512","lock_with_ink_pen":"1f50f","lollipop":"1f36d","loop":"27bf","loud_sound":"1f50a","loudspeaker":"1f4e2","love_hotel":"1f3e9","love_letter":"1f48c","low_brightness":"1f505","m":"24c2","mag":"1f50d","mag_right":"1f50e","mahjong":"1f004","mailbox":"1f4eb","mailbox_closed":"1f4ea","mailbox_with_mail":"1f4ec","mailbox_with_no_mail":"1f4ed","man":"1f468","man_with_gua_pi_mao":"1f472","man_with_turban":"1f473","mans_shoe":"1f45e","maple_leaf":"1f341","mask":"1f637","massage":"1f486","meat_on_bone":"1f356","mega":"1f4e3","melon":"1f348","memo":"1f4dd","mens":"1f6b9","metro":"1f687","microphone":"1f3a4","microscope":"1f52c","milky_way":"1f30c","minibus":"1f690","minidisc":"1f4bd","mobile_phone_off":"1f4f4","money_with_wings":"1f4b8","moneybag":"1f4b0","monkey":"1f412","monkey_face":"1f435","monorail":"1f69d","moon":"1f314","mortar_board":"1f393","mount_fuji":"1f5fb","mountain_bicyclist":"1f6b5","mountain_cableway":"1f6a0","mountain_railway":"1f69e","mouse":"1f42d","mouse2":"1f401","movie_camera":"1f3a5","moyai":"1f5ff","muscle":"1f4aa","mushroom":"1f344","musical_keyboard":"1f3b9","musical_note":"1f3b5","musical_score":"1f3bc","mute":"1f507","nail_care":"1f485","name_badge":"1f4db","necktie":"1f454","negative_squared_cross_mark":"274e","neutral_face":"1f610","new":"1f195","new_moon":"1f311","new_moon_with_face":"1f31a","newspaper":"1f4f0","ng":"1f196","ng_woman":"1f645","night_with_stars":"1f303","nine":"39-20e3","no_bell":"1f515","no_bicycles":"1f6b3","no_entry":"26d4","no_entry_sign":"1f6ab","no_good":"1f645","no_mobile_phones":"1f4f5","no_mouth":"1f636","no_pedestrians":"1f6b7","no_smoking":"1f6ad","non-potable_water":"1f6b1","nose":"1f443","notebook":"1f4d3","notebook_with_decorative_cover":"1f4d4","notes":"1f3b6","nut_and_bolt":"1f529","o":"2b55","o2":"1f17e","ocean":"1f30a","octopus":"1f419","oden":"1f362","office":"1f3e2","ok":"1f197","ok_hand":"1f44c","ok_woman":"1f646","older_man":"1f474","older_woman":"1f475","on":"1f51b","oncoming_automobile":"1f698","oncoming_bus":"1f68d","oncoming_police_car":"1f694","oncoming_taxi":"1f696","one":"31-20e3","open_book":"1f4d6","open_file_folder":"1f4c2","open_hands":"1f450","open_mouth":"1f62e","ophiuchus":"26ce","orange_book":"1f4d9","outbox_tray":"1f4e4","ox":"1f402","package":"1f4e6","page_facing_up":"1f4c4","page_with_curl":"1f4c3","pager":"1f4df","palm_tree":"1f334","panda_face":"1f43c","paperclip":"1f4ce","parking":"1f17f","part_alternation_mark":"303d","partly_sunny":"26c5","passport_control":"1f6c2","paw_prints":"1f43e","peach":"1f351","pear":"1f350","pencil":"1f4dd","pencil2":"270f","penguin":"1f427","pensive":"1f614","performing_arts":"1f3ad","persevere":"1f623","person_frowning":"1f64d","person_with_blond_hair":"1f471","person_with_pouting_face":"1f64e","phone":"260e","pig":"1f437","pig2":"1f416","pig_nose":"1f43d","pill":"1f48a","pineapple":"1f34d","pisces":"2653","pizza":"1f355","point_down":"1f447","point_left":"1f448","point_right":"1f449","point_up":"261d","point_up_2":"1f446","police_car":"1f693","poodle":"1f429","poop":"1f4a9","post_office":"1f3e3","postal_horn":"1f4ef","postbox":"1f4ee","potable_water":"1f6b0","pouch":"1f45d","poultry_leg":"1f357","pound":"1f4b7","pout":"1f621","pouting_cat":"1f63e","pray":"1f64f","princess":"1f478","punch":"1f44a","purple_heart":"1f49c","purse":"1f45b","pushpin":"1f4cc","put_litter_in_its_place":"1f6ae","question":"2753","rabbit":"1f430","rabbit2":"1f407","racehorse":"1f40e","radio":"1f4fb","radio_button":"1f518","rage":"1f621","railway_car":"1f683","rainbow":"1f308","raised_hand":"270b","raised_hands":"1f64c","raising_hand":"1f64b","ram":"1f40f","ramen":"1f35c","rat":"1f400","recycle":"267b","red_car":"1f697","red_circle":"1f534","registered":"ae","relaxed":"263a","relieved":"1f60c","repeat":"1f501","repeat_one":"1f502","restroom":"1f6bb","revolving_hearts":"1f49e","rewind":"23ea","ribbon":"1f380","rice":"1f35a","rice_ball":"1f359","rice_cracker":"1f358","rice_scene":"1f391","ring":"1f48d","rocket":"1f680","roller_coaster":"1f3a2","rooster":"1f413","rose":"1f339","rotating_light":"1f6a8","round_pushpin":"1f4cd","rowboat":"1f6a3","ru":"1f1f7-1f1fa","rugby_football":"1f3c9","runner":"1f3c3","running":"1f3c3","running_shirt_with_sash":"1f3bd","sa":"1f202","sagittarius":"2650","sailboat":"26f5","sake":"1f376","sandal":"1f461","santa":"1f385","satellite":"1f4e1","satisfied":"1f606","saxophone":"1f3b7","school":"1f3eb","school_satchel":"1f392","scissors":"2702","scorpius":"264f","scream":"1f631","scream_cat":"1f640","scroll":"1f4dc","seat":"1f4ba","secret":"3299","see_no_evil":"1f648","seedling":"1f331","seven":"37-20e3","shaved_ice":"1f367","sheep":"1f411","shell":"1f41a","ship":"1f6a2","shirt":"1f455","shit":"1f4a9","shoe":"1f45e","shower":"1f6bf","signal_strength":"1f4f6","six":"36-20e3","six_pointed_star":"1f52f","ski":"1f3bf","skull":"1f480","sleeping":"1f634","sleepy":"1f62a","slot_machine":"1f3b0","small_blue_diamond":"1f539","small_orange_diamond":"1f538","small_red_triangle":"1f53a","small_red_triangle_down":"1f53b","smile":"1f604","smile_cat":"1f638","smiley":"1f603","smiley_cat":"1f63a","smiling_imp":"1f608","smirk":"1f60f","smirk_cat":"1f63c","smoking":"1f6ac","snail":"1f40c","snake":"1f40d","snowboarder":"1f3c2","snowflake":"2744","snowman":"26c4","sob":"1f62d","soccer":"26bd","soon":"1f51c","sos":"1f198","sound":"1f509","space_invader":"1f47e","spades":"2660","spaghetti":"1f35d","sparkle":"2747","sparkler":"1f387","sparkles":"2728","sparkling_heart":"1f496","speak_no_evil":"1f64a","speaker":"1f508","speech_balloon":"1f4ac","speedboat":"1f6a4","star":"2b50","star2":"1f31f","stars":"1f320","station":"1f689","statue_of_liberty":"1f5fd","steam_locomotive":"1f682","stew":"1f372","straight_ruler":"1f4cf","strawberry":"1f353","stuck_out_tongue":"1f61b","stuck_out_tongue_closed_eyes":"1f61d","stuck_out_tongue_winking_eye":"1f61c","sun_with_face":"1f31e","sunflower":"1f33b","sunglasses":"1f60e","sunny":"2600","sunrise":"1f305","sunrise_over_mountains":"1f304","surfer":"1f3c4","sushi":"1f363","suspension_railway":"1f69f","sweat":"1f613","sweat_drops":"1f4a6","sweat_smile":"1f605","sweet_potato":"1f360","swimmer":"1f3ca","symbols":"1f523","syringe":"1f489","tada":"1f389","tanabata_tree":"1f38b","tangerine":"1f34a","taurus":"2649","taxi":"1f695","tea":"1f375","telephone":"260e","telephone_receiver":"1f4de","telescope":"1f52d","tennis":"1f3be","tent":"26fa","thought_balloon":"1f4ad","three":"33-20e3","thumbsdown":"1f44e","thumbsup":"1f44d","ticket":"1f3ab","tiger":"1f42f","tiger2":"1f405","tired_face":"1f62b","tm":"2122","toilet":"1f6bd","tokyo_tower":"1f5fc","tomato":"1f345","tongue":"1f445","top":"1f51d","tophat":"1f3a9","tractor":"1f69c","traffic_light":"1f6a5","train":"1f68b","train2":"1f686","tram":"1f68a","triangular_flag_on_post":"1f6a9","triangular_ruler":"1f4d0","trident":"1f531","triumph":"1f624","trolleybus":"1f68e","trophy":"1f3c6","tropical_drink":"1f379","tropical_fish":"1f420","truck":"1f69a","trumpet":"1f3ba","tshirt":"1f455","tulip":"1f337","turtle":"1f422","tv":"1f4fa","twisted_rightwards_arrows":"1f500","two":"32-20e3","two_hearts":"1f495","two_men_holding_hands":"1f46c","two_women_holding_hands":"1f46d","u5272":"1f239","u5408":"1f234","u55b6":"1f23a","u6307":"1f22f","u6708":"1f237","u6709":"1f236","u6e80":"1f235","u7121":"1f21a","u7533":"1f238","u7981":"1f232","u7a7a":"1f233","uk":"1f1ec-1f1e7","umbrella":"2614","unamused":"1f612","underage":"1f51e","unlock":"1f513","up":"1f199","us":"1f1fa-1f1f8","v":"270c","vertical_traffic_light":"1f6a6","vhs":"1f4fc","vibration_mode":"1f4f3","video_camera":"1f4f9","video_game":"1f3ae","violin":"1f3bb","virgo":"264d","volcano":"1f30b","vs":"1f19a","walking":"1f6b6","waning_crescent_moon":"1f318","waning_gibbous_moon":"1f316","warning":"26a0","watch":"231a","water_buffalo":"1f403","watermelon":"1f349","wave":"1f44b","wavy_dash":"3030","waxing_crescent_moon":"1f312","waxing_gibbous_moon":"1f314","wc":"1f6be","weary":"1f629","wedding":"1f492","whale":"1f433","whale2":"1f40b","wheelchair":"267f","white_check_mark":"2705","white_circle":"26aa","white_flower":"1f4ae","white_large_square":"2b1c","white_medium_small_square":"25fd","white_medium_square":"25fb","white_small_square":"25ab","white_square_button":"1f533","wind_chime":"1f390","wine_glass":"1f377","wink":"1f609","wolf":"1f43a","woman":"1f469","womans_clothes":"1f45a","womans_hat":"1f452","womens":"1f6ba","worried":"1f61f","wrench":"1f527","x":"274c","yellow_heart":"1f49b","yen":"1f4b4","yum":"1f60b","zap":"26a1","zero":"30-20e3","zzz":"1f4a4","100":"1f4af","1234":"1f522"}; - const emojiKeys = Object.keys(emojiMap); extend(ComposerBody.prototype, 'config', function(original, isInitialized) { diff --git a/extensions/emoji/js/forum/src/helpers/emojiMap.js b/extensions/emoji/js/forum/src/helpers/emojiMap.js new file mode 100644 index 000000000..4e6e537b6 --- /dev/null +++ b/extensions/emoji/js/forum/src/helpers/emojiMap.js @@ -0,0 +1,2062 @@ +export default { + 'hash': '0023-20e3', + 'zero': '0030-20e3', + 'one': '0031-20e3', + 'two': '0032-20e3', + 'three': '0033-20e3', + 'four': '0034-20e3', + 'five': '0035-20e3', + 'six': '0036-20e3', + 'seven': '0037-20e3', + 'eight': '0038-20e3', + 'nine': '0039-20e3', + 'copyright': '00a9', + 'registered': '00ae', + 'bangbang': '203c', + 'interrobang': '2049', + 'tm': '2122', + 'information_source': '2139', + 'left_right_arrow': '2194', + 'arrow_up_down': '2195', + 'arrow_upper_left': '2196', + 'arrow_upper_right': '2197', + 'arrow_lower_right': '2198', + 'arrow_lower_left': '2199', + 'leftwards_arrow_with_hook': '21a9', + 'arrow_right_hook': '21aa', + 'watch': '231a', + 'hourglass': '231b', + 'fast_forward': '23e9', + 'rewind': '23ea', + 'arrow_double_up': '23eb', + 'arrow_double_down': '23ec', + 'alarm_clock': '23f0', + 'hourglass_flowing_sand': '23f3', + 'm': '24c2', + 'black_small_square': '25aa', + 'white_small_square': '25ab', + 'arrow_forward': '25b6', + 'arrow_backward': '25c0', + 'white_medium_square': '25fb', + 'black_medium_square': '25fc', + 'white_medium_small_square': '25fd', + 'black_medium_small_square': '25fe', + 'sunny': '2600', + 'cloud': '2601', + 'telephone': '260e', + 'ballot_box_with_check': '2611', + 'umbrella': '2614', + 'coffee': '2615', + 'point_up': '261d', + 'relaxed': '263a', + 'aries': '2648', + 'taurus': '2649', + 'gemini': '264a', + 'cancer': '264b', + 'leo': '264c', + 'virgo': '264d', + 'libra': '264e', + 'scorpius': '264f', + 'sagittarius': '2650', + 'capricorn': '2651', + 'aquarius': '2652', + 'pisces': '2653', + 'spades': '2660', + 'clubs': '2663', + 'hearts': '2665', + 'diamonds': '2666', + 'hotsprings': '2668', + 'recycle': '267b', + 'wheelchair': '267f', + 'anchor': '2693', + 'warning': '26a0', + 'zap': '26a1', + 'white_circle': '26aa', + 'black_circle': '26ab', + 'soccer': '26bd', + 'baseball': '26be', + 'snowman': '26c4', + 'partly_sunny': '26c5', + 'ophiuchus': '26ce', + 'no_entry': '26d4', + 'church': '26ea', + 'fountain': '26f2', + 'golf': '26f3', + 'sailboat': '26f5', + 'tent': '26fa', + 'fuelpump': '26fd', + 'scissors': '2702', + 'white_check_mark': '2705', + 'airplane': '2708', + 'envelope': '2709', + 'fist': '270a', + 'raised_hand': '270b', + 'v': '270c', + 'pencil2': '270f', + 'black_nib': '2712', + 'heavy_check_mark': '2714', + 'heavy_multiplication_x': '2716', + 'sparkles': '2728', + 'eight_spoked_asterisk': '2733', + 'eight_pointed_black_star': '2734', + 'snowflake': '2744', + 'sparkle': '2747', + 'x': '274c', + 'negative_squared_cross_mark': '274e', + 'question': '2753', + 'grey_question': '2754', + 'grey_exclamation': '2755', + 'exclamation': '2757', + 'heart': '2764', + 'heavy_plus_sign': '2795', + 'heavy_minus_sign': '2796', + 'heavy_division_sign': '2797', + 'arrow_right': '27a1', + 'curly_loop': '27b0', + 'arrow_heading_up': '2934', + 'arrow_heading_down': '2935', + 'arrow_left': '2b05', + 'arrow_up': '2b06', + 'arrow_down': '2b07', + 'black_large_square': '2b1b', + 'white_large_square': '2b1c', + 'star': '2b50', + 'o': '2b55', + 'wavy_dash': '3030', + 'part_alternation_mark': '303d', + 'congratulations': '3297', + 'secret': '3299', + 'mahjong': '1f004', + 'black_joker': '1f0cf', + 'a': '1f170', + 'b': '1f171', + 'o2': '1f17e', + 'parking': '1f17f', + 'ab': '1f18e', + 'cl': '1f191', + 'cool': '1f192', + 'free': '1f193', + 'id': '1f194', + 'new': '1f195', + 'ng': '1f196', + 'ok': '1f197', + 'sos': '1f198', + 'up': '1f199', + 'vs': '1f19a', + 'flag_cn': '1f1e8-1f1f3', + 'cn': '1f1e8-1f1f3', + 'flag_de': '1f1e9-1f1ea', + 'de': '1f1e9-1f1ea', + 'flag_es': '1f1ea-1f1f8', + 'es': '1f1ea-1f1f8', + 'flag_fr': '1f1eb-1f1f7', + 'fr': '1f1eb-1f1f7', + 'flag_gb': '1f1ec-1f1e7', + 'gb': '1f1ec-1f1e7', + 'flag_it': '1f1ee-1f1f9', + 'it': '1f1ee-1f1f9', + 'flag_jp': '1f1ef-1f1f5', + 'jp': '1f1ef-1f1f5', + 'flag_kr': '1f1f0-1f1f7', + 'kr': '1f1f0-1f1f7', + 'flag_us': '1f1fa-1f1f8', + 'us': '1f1fa-1f1f8', + 'flag_ru': '1f1f7-1f1fa', + 'ru': '1f1f7-1f1fa', + 'koko': '1f201', + 'sa': '1f202', + 'u7121': '1f21a', + 'u6307': '1f22f', + 'u7981': '1f232', + 'u7a7a': '1f233', + 'u5408': '1f234', + 'u6e80': '1f235', + 'u6709': '1f236', + 'u6708': '1f237', + 'u7533': '1f238', + 'u5272': '1f239', + 'u55b6': '1f23a', + 'ideograph_advantage': '1f250', + 'accept': '1f251', + 'cyclone': '1f300', + 'foggy': '1f301', + 'closed_umbrella': '1f302', + 'night_with_stars': '1f303', + 'sunrise_over_mountains': '1f304', + 'sunrise': '1f305', + 'city_dusk': '1f306', + 'city_sunset': '1f307', + 'city_sunrise': '1f307', + 'rainbow': '1f308', + 'bridge_at_night': '1f309', + 'ocean': '1f30a', + 'volcano': '1f30b', + 'milky_way': '1f30c', + 'earth_asia': '1f30f', + 'new_moon': '1f311', + 'first_quarter_moon': '1f313', + 'waxing_gibbous_moon': '1f314', + 'full_moon': '1f315', + 'crescent_moon': '1f319', + 'first_quarter_moon_with_face': '1f31b', + 'star2': '1f31f', + 'stars': '1f320', + 'chestnut': '1f330', + 'seedling': '1f331', + 'palm_tree': '1f334', + 'cactus': '1f335', + 'tulip': '1f337', + 'cherry_blossom': '1f338', + 'rose': '1f339', + 'hibiscus': '1f33a', + 'sunflower': '1f33b', + 'blossom': '1f33c', + 'corn': '1f33d', + 'ear_of_rice': '1f33e', + 'herb': '1f33f', + 'four_leaf_clover': '1f340', + 'maple_leaf': '1f341', + 'fallen_leaf': '1f342', + 'leaves': '1f343', + 'mushroom': '1f344', + 'tomato': '1f345', + 'eggplant': '1f346', + 'grapes': '1f347', + 'melon': '1f348', + 'watermelon': '1f349', + 'tangerine': '1f34a', + 'banana': '1f34c', + 'pineapple': '1f34d', + 'apple': '1f34e', + 'green_apple': '1f34f', + 'peach': '1f351', + 'cherries': '1f352', + 'strawberry': '1f353', + 'hamburger': '1f354', + 'pizza': '1f355', + 'meat_on_bone': '1f356', + 'poultry_leg': '1f357', + 'rice_cracker': '1f358', + 'rice_ball': '1f359', + 'rice': '1f35a', + 'curry': '1f35b', + 'ramen': '1f35c', + 'spaghetti': '1f35d', + 'bread': '1f35e', + 'fries': '1f35f', + 'sweet_potato': '1f360', + 'dango': '1f361', + 'oden': '1f362', + 'sushi': '1f363', + 'fried_shrimp': '1f364', + 'fish_cake': '1f365', + 'icecream': '1f366', + 'shaved_ice': '1f367', + 'ice_cream': '1f368', + 'doughnut': '1f369', + 'cookie': '1f36a', + 'chocolate_bar': '1f36b', + 'candy': '1f36c', + 'lollipop': '1f36d', + 'custard': '1f36e', + 'pudding': '1f36e', + 'flan': '1f36e', + 'honey_pot': '1f36f', + 'cake': '1f370', + 'bento': '1f371', + 'stew': '1f372', + 'egg': '1f373', + 'fork_and_knife': '1f374', + 'tea': '1f375', + 'sake': '1f376', + 'wine_glass': '1f377', + 'cocktail': '1f378', + 'tropical_drink': '1f379', + 'beer': '1f37a', + 'beers': '1f37b', + 'ribbon': '1f380', + 'gift': '1f381', + 'birthday': '1f382', + 'jack_o_lantern': '1f383', + 'christmas_tree': '1f384', + 'santa': '1f385', + 'fireworks': '1f386', + 'sparkler': '1f387', + 'balloon': '1f388', + 'tada': '1f389', + 'confetti_ball': '1f38a', + 'tanabata_tree': '1f38b', + 'crossed_flags': '1f38c', + 'bamboo': '1f38d', + 'dolls': '1f38e', + 'flags': '1f38f', + 'wind_chime': '1f390', + 'rice_scene': '1f391', + 'school_satchel': '1f392', + 'mortar_board': '1f393', + 'carousel_horse': '1f3a0', + 'ferris_wheel': '1f3a1', + 'roller_coaster': '1f3a2', + 'fishing_pole_and_fish': '1f3a3', + 'microphone': '1f3a4', + 'movie_camera': '1f3a5', + 'cinema': '1f3a6', + 'headphones': '1f3a7', + 'art': '1f3a8', + 'tophat': '1f3a9', + 'circus_tent': '1f3aa', + 'ticket': '1f3ab', + 'clapper': '1f3ac', + 'performing_arts': '1f3ad', + 'video_game': '1f3ae', + 'dart': '1f3af', + 'slot_machine': '1f3b0', + '8ball': '1f3b1', + 'game_die': '1f3b2', + 'bowling': '1f3b3', + 'flower_playing_cards': '1f3b4', + 'musical_note': '1f3b5', + 'notes': '1f3b6', + 'saxophone': '1f3b7', + 'guitar': '1f3b8', + 'musical_keyboard': '1f3b9', + 'trumpet': '1f3ba', + 'violin': '1f3bb', + 'musical_score': '1f3bc', + 'running_shirt_with_sash': '1f3bd', + 'tennis': '1f3be', + 'ski': '1f3bf', + 'basketball': '1f3c0', + 'checkered_flag': '1f3c1', + 'snowboarder': '1f3c2', + 'runner': '1f3c3', + 'surfer': '1f3c4', + 'trophy': '1f3c6', + 'football': '1f3c8', + 'swimmer': '1f3ca', + 'house': '1f3e0', + 'house_with_garden': '1f3e1', + 'office': '1f3e2', + 'post_office': '1f3e3', + 'hospital': '1f3e5', + 'bank': '1f3e6', + 'atm': '1f3e7', + 'hotel': '1f3e8', + 'love_hotel': '1f3e9', + 'convenience_store': '1f3ea', + 'school': '1f3eb', + 'department_store': '1f3ec', + 'factory': '1f3ed', + 'izakaya_lantern': '1f3ee', + 'japanese_castle': '1f3ef', + 'european_castle': '1f3f0', + 'snail': '1f40c', + 'snake': '1f40d', + 'racehorse': '1f40e', + 'sheep': '1f411', + 'monkey': '1f412', + 'chicken': '1f414', + 'boar': '1f417', + 'elephant': '1f418', + 'octopus': '1f419', + 'shell': '1f41a', + 'bug': '1f41b', + 'ant': '1f41c', + 'bee': '1f41d', + 'beetle': '1f41e', + 'fish': '1f41f', + 'tropical_fish': '1f420', + 'blowfish': '1f421', + 'turtle': '1f422', + 'hatching_chick': '1f423', + 'baby_chick': '1f424', + 'hatched_chick': '1f425', + 'bird': '1f426', + 'penguin': '1f427', + 'koala': '1f428', + 'poodle': '1f429', + 'camel': '1f42b', + 'dolphin': '1f42c', + 'mouse': '1f42d', + 'cow': '1f42e', + 'tiger': '1f42f', + 'rabbit': '1f430', + 'cat': '1f431', + 'dragon_face': '1f432', + 'whale': '1f433', + 'horse': '1f434', + 'monkey_face': '1f435', + 'dog': '1f436', + 'pig': '1f437', + 'frog': '1f438', + 'hamster': '1f439', + 'wolf': '1f43a', + 'bear': '1f43b', + 'panda_face': '1f43c', + 'pig_nose': '1f43d', + 'feet': '1f43e', + 'paw_prints': '1f43e', + 'eyes': '1f440', + 'ear': '1f442', + 'nose': '1f443', + 'lips': '1f444', + 'tongue': '1f445', + 'point_up_2': '1f446', + 'point_down': '1f447', + 'point_left': '1f448', + 'point_right': '1f449', + 'punch': '1f44a', + 'wave': '1f44b', + 'ok_hand': '1f44c', + 'thumbsup': '1f44d', + '+1': '1f44d', + 'thumbup': '1f44d', + 'thumbsdown': '1f44e', + '-1': '1f44e', + 'thumbdown': '1f44e', + 'clap': '1f44f', + 'open_hands': '1f450', + 'crown': '1f451', + 'womans_hat': '1f452', + 'eyeglasses': '1f453', + 'necktie': '1f454', + 'shirt': '1f455', + 'jeans': '1f456', + 'dress': '1f457', + 'kimono': '1f458', + 'bikini': '1f459', + 'womans_clothes': '1f45a', + 'purse': '1f45b', + 'handbag': '1f45c', + 'pouch': '1f45d', + 'mans_shoe': '1f45e', + 'athletic_shoe': '1f45f', + 'high_heel': '1f460', + 'sandal': '1f461', + 'boot': '1f462', + 'footprints': '1f463', + 'bust_in_silhouette': '1f464', + 'boy': '1f466', + 'girl': '1f467', + 'man': '1f468', + 'woman': '1f469', + 'family': '1f46a', + 'couple': '1f46b', + 'cop': '1f46e', + 'dancers': '1f46f', + 'bride_with_veil': '1f470', + 'person_with_blond_hair': '1f471', + 'man_with_gua_pi_mao': '1f472', + 'man_with_turban': '1f473', + 'older_man': '1f474', + 'older_woman': '1f475', + 'grandma': '1f475', + 'baby': '1f476', + 'construction_worker': '1f477', + 'princess': '1f478', + 'japanese_ogre': '1f479', + 'japanese_goblin': '1f47a', + 'ghost': '1f47b', + 'angel': '1f47c', + 'alien': '1f47d', + 'space_invader': '1f47e', + 'imp': '1f47f', + 'skull': '1f480', + 'skeleton': '1f480', + 'card_index': '1f4c7', + 'information_desk_person': '1f481', + 'guardsman': '1f482', + 'dancer': '1f483', + 'lipstick': '1f484', + 'nail_care': '1f485', + 'ledger': '1f4d2', + 'massage': '1f486', + 'notebook': '1f4d3', + 'haircut': '1f487', + 'notebook_with_decorative_cover': '1f4d4', + 'barber': '1f488', + 'closed_book': '1f4d5', + 'syringe': '1f489', + 'book': '1f4d6', + 'pill': '1f48a', + 'green_book': '1f4d7', + 'kiss': '1f48b', + 'blue_book': '1f4d8', + 'love_letter': '1f48c', + 'orange_book': '1f4d9', + 'ring': '1f48d', + 'books': '1f4da', + 'gem': '1f48e', + 'name_badge': '1f4db', + 'couplekiss': '1f48f', + 'scroll': '1f4dc', + 'bouquet': '1f490', + 'pencil': '1f4dd', + 'couple_with_heart': '1f491', + 'telephone_receiver': '1f4de', + 'wedding': '1f492', + 'pager': '1f4df', + 'fax': '1f4e0', + 'heartbeat': '1f493', + 'satellite': '1f4e1', + 'loudspeaker': '1f4e2', + 'broken_heart': '1f494', + 'mega': '1f4e3', + 'outbox_tray': '1f4e4', + 'two_hearts': '1f495', + 'inbox_tray': '1f4e5', + 'package': '1f4e6', + 'sparkling_heart': '1f496', + 'e-mail': '1f4e7', + 'email': '1f4e7', + 'incoming_envelope': '1f4e8', + 'heartpulse': '1f497', + 'envelope_with_arrow': '1f4e9', + 'mailbox_closed': '1f4ea', + 'cupid': '1f498', + 'mailbox': '1f4eb', + 'postbox': '1f4ee', + 'blue_heart': '1f499', + 'newspaper': '1f4f0', + 'iphone': '1f4f1', + 'green_heart': '1f49a', + 'calling': '1f4f2', + 'vibration_mode': '1f4f3', + 'yellow_heart': '1f49b', + 'mobile_phone_off': '1f4f4', + 'signal_strength': '1f4f6', + 'purple_heart': '1f49c', + 'camera': '1f4f7', + 'video_camera': '1f4f9', + 'gift_heart': '1f49d', + 'tv': '1f4fa', + 'radio': '1f4fb', + 'revolving_hearts': '1f49e', + 'vhs': '1f4fc', + 'arrows_clockwise': '1f503', + 'heart_decoration': '1f49f', + 'loud_sound': '1f50a', + 'battery': '1f50b', + 'diamond_shape_with_a_dot_inside': '1f4a0', + 'electric_plug': '1f50c', + 'mag': '1f50d', + 'bulb': '1f4a1', + 'mag_right': '1f50e', + 'lock_with_ink_pen': '1f50f', + 'anger': '1f4a2', + 'closed_lock_with_key': '1f510', + 'key': '1f511', + 'bomb': '1f4a3', + 'lock': '1f512', + 'unlock': '1f513', + 'zzz': '1f4a4', + 'bell': '1f514', + 'bookmark': '1f516', + 'boom': '1f4a5', + 'link': '1f517', + 'radio_button': '1f518', + 'sweat_drops': '1f4a6', + 'back': '1f519', + 'end': '1f51a', + 'droplet': '1f4a7', + 'on': '1f51b', + 'soon': '1f51c', + 'dash': '1f4a8', + 'top': '1f51d', + 'underage': '1f51e', + 'poop': '1f4a9', + 'shit': '1f4a9', + 'hankey': '1f4a9', + 'poo': '1f4a9', + 'ten': '1f51f', + 'muscle': '1f4aa', + 'capital_abcd': '1f520', + 'abcd': '1f521', + 'dizzy': '1f4ab', + '1234': '1f522', + 'symbols': '1f523', + 'speech_balloon': '1f4ac', + 'abc': '1f524', + 'fire': '1f525', + 'flame': '1f525', + 'white_flower': '1f4ae', + 'flashlight': '1f526', + 'wrench': '1f527', + '100': '1f4af', + 'hammer': '1f528', + 'nut_and_bolt': '1f529', + 'moneybag': '1f4b0', + 'knife': '1f52a', + 'gun': '1f52b', + 'currency_exchange': '1f4b1', + 'crystal_ball': '1f52e', + 'heavy_dollar_sign': '1f4b2', + 'six_pointed_star': '1f52f', + 'credit_card': '1f4b3', + 'beginner': '1f530', + 'trident': '1f531', + 'yen': '1f4b4', + 'black_square_button': '1f532', + 'white_square_button': '1f533', + 'dollar': '1f4b5', + 'red_circle': '1f534', + 'large_blue_circle': '1f535', + 'money_with_wings': '1f4b8', + 'large_orange_diamond': '1f536', + 'large_blue_diamond': '1f537', + 'chart': '1f4b9', + 'small_orange_diamond': '1f538', + 'small_blue_diamond': '1f539', + 'seat': '1f4ba', + 'small_red_triangle': '1f53a', + 'small_red_triangle_down': '1f53b', + 'computer': '1f4bb', + 'arrow_up_small': '1f53c', + 'briefcase': '1f4bc', + 'arrow_down_small': '1f53d', + 'clock1': '1f550', + 'minidisc': '1f4bd', + 'clock2': '1f551', + 'floppy_disk': '1f4be', + 'clock3': '1f552', + 'cd': '1f4bf', + 'clock4': '1f553', + 'dvd': '1f4c0', + 'clock5': '1f554', + 'clock6': '1f555', + 'file_folder': '1f4c1', + 'clock7': '1f556', + 'clock8': '1f557', + 'open_file_folder': '1f4c2', + 'clock9': '1f558', + 'clock10': '1f559', + 'page_with_curl': '1f4c3', + 'clock11': '1f55a', + 'clock12': '1f55b', + 'page_facing_up': '1f4c4', + 'mount_fuji': '1f5fb', + 'tokyo_tower': '1f5fc', + 'date': '1f4c5', + 'statue_of_liberty': '1f5fd', + 'japan': '1f5fe', + 'calendar': '1f4c6', + 'moyai': '1f5ff', + 'grin': '1f601', + 'joy': '1f602', + 'smiley': '1f603', + 'chart_with_upwards_trend': '1f4c8', + 'smile': '1f604', + 'sweat_smile': '1f605', + 'chart_with_downwards_trend': '1f4c9', + 'laughing': '1f606', + 'satisfied': '1f606', + 'wink': '1f609', + 'bar_chart': '1f4ca', + 'blush': '1f60a', + 'yum': '1f60b', + 'clipboard': '1f4cb', + 'relieved': '1f60c', + 'heart_eyes': '1f60d', + 'pushpin': '1f4cc', + 'smirk': '1f60f', + 'unamused': '1f612', + 'round_pushpin': '1f4cd', + 'sweat': '1f613', + 'pensive': '1f614', + 'paperclip': '1f4ce', + 'confounded': '1f616', + 'kissing_heart': '1f618', + 'straight_ruler': '1f4cf', + 'kissing_closed_eyes': '1f61a', + 'stuck_out_tongue_winking_eye': '1f61c', + 'triangular_ruler': '1f4d0', + 'stuck_out_tongue_closed_eyes': '1f61d', + 'disappointed': '1f61e', + 'bookmark_tabs': '1f4d1', + 'angry': '1f620', + 'rage': '1f621', + 'cry': '1f622', + 'persevere': '1f623', + 'triumph': '1f624', + 'disappointed_relieved': '1f625', + 'fearful': '1f628', + 'weary': '1f629', + 'sleepy': '1f62a', + 'tired_face': '1f62b', + 'sob': '1f62d', + 'cold_sweat': '1f630', + 'scream': '1f631', + 'astonished': '1f632', + 'flushed': '1f633', + 'dizzy_face': '1f635', + 'mask': '1f637', + 'smile_cat': '1f638', + 'joy_cat': '1f639', + 'smiley_cat': '1f63a', + 'heart_eyes_cat': '1f63b', + 'smirk_cat': '1f63c', + 'kissing_cat': '1f63d', + 'pouting_cat': '1f63e', + 'crying_cat_face': '1f63f', + 'scream_cat': '1f640', + 'no_good': '1f645', + 'ok_woman': '1f646', + 'bow': '1f647', + 'see_no_evil': '1f648', + 'hear_no_evil': '1f649', + 'speak_no_evil': '1f64a', + 'raising_hand': '1f64b', + 'raised_hands': '1f64c', + 'person_frowning': '1f64d', + 'person_with_pouting_face': '1f64e', + 'pray': '1f64f', + 'rocket': '1f680', + 'railway_car': '1f683', + 'bullettrain_side': '1f684', + 'bullettrain_front': '1f685', + 'metro': '1f687', + 'station': '1f689', + 'bus': '1f68c', + 'busstop': '1f68f', + 'ambulance': '1f691', + 'fire_engine': '1f692', + 'police_car': '1f693', + 'taxi': '1f695', + 'red_car': '1f697', + 'blue_car': '1f699', + 'truck': '1f69a', + 'ship': '1f6a2', + 'speedboat': '1f6a4', + 'traffic_light': '1f6a5', + 'construction': '1f6a7', + 'rotating_light': '1f6a8', + 'triangular_flag_on_post': '1f6a9', + 'door': '1f6aa', + 'no_entry_sign': '1f6ab', + 'smoking': '1f6ac', + 'no_smoking': '1f6ad', + 'bike': '1f6b2', + 'walking': '1f6b6', + 'mens': '1f6b9', + 'womens': '1f6ba', + 'restroom': '1f6bb', + 'baby_symbol': '1f6bc', + 'toilet': '1f6bd', + 'wc': '1f6be', + 'bath': '1f6c0', + 'metal': '1f918', + 'sign_of_the_horns': '1f918', + 'grinning': '1f600', + 'innocent': '1f607', + 'smiling_imp': '1f608', + 'sunglasses': '1f60e', + 'neutral_face': '1f610', + 'expressionless': '1f611', + 'confused': '1f615', + 'kissing': '1f617', + 'kissing_smiling_eyes': '1f619', + 'stuck_out_tongue': '1f61b', + 'worried': '1f61f', + 'frowning': '1f626', + 'anguished': '1f627', + 'grimacing': '1f62c', + 'open_mouth': '1f62e', + 'hushed': '1f62f', + 'sleeping': '1f634', + 'no_mouth': '1f636', + 'helicopter': '1f681', + 'steam_locomotive': '1f682', + 'train2': '1f686', + 'light_rail': '1f688', + 'tram': '1f68a', + 'oncoming_bus': '1f68d', + 'trolleybus': '1f68e', + 'minibus': '1f690', + 'oncoming_police_car': '1f694', + 'oncoming_taxi': '1f696', + 'oncoming_automobile': '1f698', + 'articulated_lorry': '1f69b', + 'tractor': '1f69c', + 'monorail': '1f69d', + 'mountain_railway': '1f69e', + 'suspension_railway': '1f69f', + 'mountain_cableway': '1f6a0', + 'aerial_tramway': '1f6a1', + 'rowboat': '1f6a3', + 'vertical_traffic_light': '1f6a6', + 'put_litter_in_its_place': '1f6ae', + 'do_not_litter': '1f6af', + 'potable_water': '1f6b0', + 'non-potable_water': '1f6b1', + 'no_bicycles': '1f6b3', + 'bicyclist': '1f6b4', + 'mountain_bicyclist': '1f6b5', + 'no_pedestrians': '1f6b7', + 'children_crossing': '1f6b8', + 'shower': '1f6bf', + 'bathtub': '1f6c1', + 'passport_control': '1f6c2', + 'customs': '1f6c3', + 'baggage_claim': '1f6c4', + 'left_luggage': '1f6c5', + 'earth_africa': '1f30d', + 'earth_americas': '1f30e', + 'globe_with_meridians': '1f310', + 'waxing_crescent_moon': '1f312', + 'waning_gibbous_moon': '1f316', + 'last_quarter_moon': '1f317', + 'waning_crescent_moon': '1f318', + 'new_moon_with_face': '1f31a', + 'last_quarter_moon_with_face': '1f31c', + 'full_moon_with_face': '1f31d', + 'sun_with_face': '1f31e', + 'evergreen_tree': '1f332', + 'deciduous_tree': '1f333', + 'lemon': '1f34b', + 'pear': '1f350', + 'baby_bottle': '1f37c', + 'horse_racing': '1f3c7', + 'rugby_football': '1f3c9', + 'european_post_office': '1f3e4', + 'rat': '1f400', + 'mouse2': '1f401', + 'ox': '1f402', + 'water_buffalo': '1f403', + 'cow2': '1f404', + 'tiger2': '1f405', + 'leopard': '1f406', + 'rabbit2': '1f407', + 'cat2': '1f408', + 'dragon': '1f409', + 'crocodile': '1f40a', + 'whale2': '1f40b', + 'ram': '1f40f', + 'goat': '1f410', + 'rooster': '1f413', + 'dog2': '1f415', + 'pig2': '1f416', + 'dromedary_camel': '1f42a', + 'busts_in_silhouette': '1f465', + 'two_men_holding_hands': '1f46c', + 'two_women_holding_hands': '1f46d', + 'thought_balloon': '1f4ad', + 'euro': '1f4b6', + 'pound': '1f4b7', + 'mailbox_with_mail': '1f4ec', + 'mailbox_with_no_mail': '1f4ed', + 'postal_horn': '1f4ef', + 'no_mobile_phones': '1f4f5', + 'twisted_rightwards_arrows': '1f500', + 'repeat': '1f501', + 'repeat_one': '1f502', + 'arrows_counterclockwise': '1f504', + 'low_brightness': '1f505', + 'high_brightness': '1f506', + 'mute': '1f507', + 'sound': '1f509', + 'no_bell': '1f515', + 'microscope': '1f52c', + 'telescope': '1f52d', + 'clock130': '1f55c', + 'clock230': '1f55d', + 'clock330': '1f55e', + 'clock430': '1f55f', + 'clock530': '1f560', + 'clock630': '1f561', + 'clock730': '1f562', + 'clock830': '1f563', + 'clock930': '1f564', + 'clock1030': '1f565', + 'clock1130': '1f566', + 'clock1230': '1f567', + 'speaker': '1f508', + 'train': '1f68b', + 'loop': '27bf', + 'flag_af': '1f1e6-1f1eb', + 'af': '1f1e6-1f1eb', + 'flag_al': '1f1e6-1f1f1', + 'al': '1f1e6-1f1f1', + 'flag_dz': '1f1e9-1f1ff', + 'dz': '1f1e9-1f1ff', + 'flag_ad': '1f1e6-1f1e9', + 'ad': '1f1e6-1f1e9', + 'flag_ao': '1f1e6-1f1f4', + 'ao': '1f1e6-1f1f4', + 'flag_ag': '1f1e6-1f1ec', + 'ag': '1f1e6-1f1ec', + 'flag_ar': '1f1e6-1f1f7', + 'ar': '1f1e6-1f1f7', + 'flag_am': '1f1e6-1f1f2', + 'am': '1f1e6-1f1f2', + 'flag_au': '1f1e6-1f1fa', + 'au': '1f1e6-1f1fa', + 'flag_at': '1f1e6-1f1f9', + 'at': '1f1e6-1f1f9', + 'flag_az': '1f1e6-1f1ff', + 'az': '1f1e6-1f1ff', + 'flag_bs': '1f1e7-1f1f8', + 'bs': '1f1e7-1f1f8', + 'flag_bh': '1f1e7-1f1ed', + 'bh': '1f1e7-1f1ed', + 'flag_bd': '1f1e7-1f1e9', + 'bd': '1f1e7-1f1e9', + 'flag_bb': '1f1e7-1f1e7', + 'bb': '1f1e7-1f1e7', + 'flag_by': '1f1e7-1f1fe', + 'by': '1f1e7-1f1fe', + 'flag_be': '1f1e7-1f1ea', + 'be': '1f1e7-1f1ea', + 'flag_bz': '1f1e7-1f1ff', + 'bz': '1f1e7-1f1ff', + 'flag_bj': '1f1e7-1f1ef', + 'bj': '1f1e7-1f1ef', + 'flag_bt': '1f1e7-1f1f9', + 'bt': '1f1e7-1f1f9', + 'flag_bo': '1f1e7-1f1f4', + 'bo': '1f1e7-1f1f4', + 'flag_ba': '1f1e7-1f1e6', + 'ba': '1f1e7-1f1e6', + 'flag_bw': '1f1e7-1f1fc', + 'bw': '1f1e7-1f1fc', + 'flag_br': '1f1e7-1f1f7', + 'br': '1f1e7-1f1f7', + 'flag_bn': '1f1e7-1f1f3', + 'bn': '1f1e7-1f1f3', + 'flag_bg': '1f1e7-1f1ec', + 'bg': '1f1e7-1f1ec', + 'flag_bf': '1f1e7-1f1eb', + 'bf': '1f1e7-1f1eb', + 'flag_bi': '1f1e7-1f1ee', + 'bi': '1f1e7-1f1ee', + 'flag_kh': '1f1f0-1f1ed', + 'kh': '1f1f0-1f1ed', + 'flag_cm': '1f1e8-1f1f2', + 'cm': '1f1e8-1f1f2', + 'flag_ca': '1f1e8-1f1e6', + 'ca': '1f1e8-1f1e6', + 'flag_cv': '1f1e8-1f1fb', + 'cv': '1f1e8-1f1fb', + 'flag_cf': '1f1e8-1f1eb', + 'cf': '1f1e8-1f1eb', + 'flag_td': '1f1f9-1f1e9', + 'td': '1f1f9-1f1e9', + 'flag_cl': '1f1e8-1f1f1', + 'chile': '1f1e8-1f1f1', + 'flag_co': '1f1e8-1f1f4', + 'co': '1f1e8-1f1f4', + 'flag_km': '1f1f0-1f1f2', + 'km': '1f1f0-1f1f2', + 'flag_cr': '1f1e8-1f1f7', + 'cr': '1f1e8-1f1f7', + 'flag_ci': '1f1e8-1f1ee', + 'ci': '1f1e8-1f1ee', + 'flag_hr': '1f1ed-1f1f7', + 'hr': '1f1ed-1f1f7', + 'flag_cu': '1f1e8-1f1fa', + 'cu': '1f1e8-1f1fa', + 'flag_cy': '1f1e8-1f1fe', + 'cy': '1f1e8-1f1fe', + 'flag_cz': '1f1e8-1f1ff', + 'cz': '1f1e8-1f1ff', + 'flag_cd': '1f1e8-1f1e9', + 'congo': '1f1e8-1f1e9', + 'flag_dk': '1f1e9-1f1f0', + 'dk': '1f1e9-1f1f0', + 'flag_dj': '1f1e9-1f1ef', + 'dj': '1f1e9-1f1ef', + 'flag_dm': '1f1e9-1f1f2', + 'dm': '1f1e9-1f1f2', + 'flag_do': '1f1e9-1f1f4', + 'do': '1f1e9-1f1f4', + 'flag_tl': '1f1f9-1f1f1', + 'tl': '1f1f9-1f1f1', + 'flag_ec': '1f1ea-1f1e8', + 'ec': '1f1ea-1f1e8', + 'flag_eg': '1f1ea-1f1ec', + 'eg': '1f1ea-1f1ec', + 'flag_sv': '1f1f8-1f1fb', + 'sv': '1f1f8-1f1fb', + 'flag_gq': '1f1ec-1f1f6', + 'gq': '1f1ec-1f1f6', + 'flag_er': '1f1ea-1f1f7', + 'er': '1f1ea-1f1f7', + 'flag_ee': '1f1ea-1f1ea', + 'ee': '1f1ea-1f1ea', + 'flag_et': '1f1ea-1f1f9', + 'et': '1f1ea-1f1f9', + 'flag_fj': '1f1eb-1f1ef', + 'fj': '1f1eb-1f1ef', + 'flag_fi': '1f1eb-1f1ee', + 'fi': '1f1eb-1f1ee', + 'flag_ga': '1f1ec-1f1e6', + 'ga': '1f1ec-1f1e6', + 'flag_gm': '1f1ec-1f1f2', + 'gm': '1f1ec-1f1f2', + 'flag_ge': '1f1ec-1f1ea', + 'ge': '1f1ec-1f1ea', + 'flag_gh': '1f1ec-1f1ed', + 'gh': '1f1ec-1f1ed', + 'flag_gr': '1f1ec-1f1f7', + 'gr': '1f1ec-1f1f7', + 'flag_gd': '1f1ec-1f1e9', + 'gd': '1f1ec-1f1e9', + 'flag_gt': '1f1ec-1f1f9', + 'gt': '1f1ec-1f1f9', + 'flag_gn': '1f1ec-1f1f3', + 'gn': '1f1ec-1f1f3', + 'flag_gw': '1f1ec-1f1fc', + 'gw': '1f1ec-1f1fc', + 'flag_gy': '1f1ec-1f1fe', + 'gy': '1f1ec-1f1fe', + 'flag_ht': '1f1ed-1f1f9', + 'ht': '1f1ed-1f1f9', + 'flag_hn': '1f1ed-1f1f3', + 'hn': '1f1ed-1f1f3', + 'flag_hu': '1f1ed-1f1fa', + 'hu': '1f1ed-1f1fa', + 'flag_is': '1f1ee-1f1f8', + 'is': '1f1ee-1f1f8', + 'flag_in': '1f1ee-1f1f3', + 'in': '1f1ee-1f1f3', + 'flag_id': '1f1ee-1f1e9', + 'indonesia': '1f1ee-1f1e9', + 'flag_ir': '1f1ee-1f1f7', + 'ir': '1f1ee-1f1f7', + 'flag_iq': '1f1ee-1f1f6', + 'iq': '1f1ee-1f1f6', + 'flag_ie': '1f1ee-1f1ea', + 'ie': '1f1ee-1f1ea', + 'flag_il': '1f1ee-1f1f1', + 'il': '1f1ee-1f1f1', + 'flag_jm': '1f1ef-1f1f2', + 'jm': '1f1ef-1f1f2', + 'flag_jo': '1f1ef-1f1f4', + 'jo': '1f1ef-1f1f4', + 'flag_kz': '1f1f0-1f1ff', + 'kz': '1f1f0-1f1ff', + 'flag_ke': '1f1f0-1f1ea', + 'ke': '1f1f0-1f1ea', + 'flag_ki': '1f1f0-1f1ee', + 'ki': '1f1f0-1f1ee', + 'flag_xk': '1f1fd-1f1f0', + 'xk': '1f1fd-1f1f0', + 'flag_kw': '1f1f0-1f1fc', + 'kw': '1f1f0-1f1fc', + 'flag_kg': '1f1f0-1f1ec', + 'kg': '1f1f0-1f1ec', + 'flag_la': '1f1f1-1f1e6', + 'la': '1f1f1-1f1e6', + 'flag_lv': '1f1f1-1f1fb', + 'lv': '1f1f1-1f1fb', + 'flag_lb': '1f1f1-1f1e7', + 'lb': '1f1f1-1f1e7', + 'flag_ls': '1f1f1-1f1f8', + 'ls': '1f1f1-1f1f8', + 'flag_lr': '1f1f1-1f1f7', + 'lr': '1f1f1-1f1f7', + 'flag_ly': '1f1f1-1f1fe', + 'ly': '1f1f1-1f1fe', + 'flag_li': '1f1f1-1f1ee', + 'li': '1f1f1-1f1ee', + 'flag_lt': '1f1f1-1f1f9', + 'lt': '1f1f1-1f1f9', + 'flag_lu': '1f1f1-1f1fa', + 'lu': '1f1f1-1f1fa', + 'flag_mk': '1f1f2-1f1f0', + 'mk': '1f1f2-1f1f0', + 'flag_mg': '1f1f2-1f1ec', + 'mg': '1f1f2-1f1ec', + 'flag_mw': '1f1f2-1f1fc', + 'mw': '1f1f2-1f1fc', + 'flag_my': '1f1f2-1f1fe', + 'my': '1f1f2-1f1fe', + 'flag_mv': '1f1f2-1f1fb', + 'mv': '1f1f2-1f1fb', + 'flag_ml': '1f1f2-1f1f1', + 'ml': '1f1f2-1f1f1', + 'flag_mt': '1f1f2-1f1f9', + 'mt': '1f1f2-1f1f9', + 'flag_mh': '1f1f2-1f1ed', + 'mh': '1f1f2-1f1ed', + 'flag_mr': '1f1f2-1f1f7', + 'mr': '1f1f2-1f1f7', + 'flag_mu': '1f1f2-1f1fa', + 'mu': '1f1f2-1f1fa', + 'flag_mx': '1f1f2-1f1fd', + 'mx': '1f1f2-1f1fd', + 'flag_fm': '1f1eb-1f1f2', + 'fm': '1f1eb-1f1f2', + 'flag_md': '1f1f2-1f1e9', + 'md': '1f1f2-1f1e9', + 'flag_mc': '1f1f2-1f1e8', + 'mc': '1f1f2-1f1e8', + 'flag_mn': '1f1f2-1f1f3', + 'mn': '1f1f2-1f1f3', + 'flag_me': '1f1f2-1f1ea', + 'me': '1f1f2-1f1ea', + 'flag_ma': '1f1f2-1f1e6', + 'ma': '1f1f2-1f1e6', + 'flag_mz': '1f1f2-1f1ff', + 'mz': '1f1f2-1f1ff', + 'flag_mm': '1f1f2-1f1f2', + 'mm': '1f1f2-1f1f2', + 'flag_na': '1f1f3-1f1e6', + 'na': '1f1f3-1f1e6', + 'flag_nr': '1f1f3-1f1f7', + 'nr': '1f1f3-1f1f7', + 'flag_np': '1f1f3-1f1f5', + 'np': '1f1f3-1f1f5', + 'flag_nl': '1f1f3-1f1f1', + 'nl': '1f1f3-1f1f1', + 'flag_nz': '1f1f3-1f1ff', + 'nz': '1f1f3-1f1ff', + 'flag_ni': '1f1f3-1f1ee', + 'ni': '1f1f3-1f1ee', + 'flag_ne': '1f1f3-1f1ea', + 'ne': '1f1f3-1f1ea', + 'flag_ng': '1f1f3-1f1ec', + 'nigeria': '1f1f3-1f1ec', + 'flag_kp': '1f1f0-1f1f5', + 'kp': '1f1f0-1f1f5', + 'flag_no': '1f1f3-1f1f4', + 'no': '1f1f3-1f1f4', + 'flag_om': '1f1f4-1f1f2', + 'om': '1f1f4-1f1f2', + 'flag_pk': '1f1f5-1f1f0', + 'pk': '1f1f5-1f1f0', + 'flag_pw': '1f1f5-1f1fc', + 'pw': '1f1f5-1f1fc', + 'flag_pa': '1f1f5-1f1e6', + 'pa': '1f1f5-1f1e6', + 'flag_pg': '1f1f5-1f1ec', + 'pg': '1f1f5-1f1ec', + 'flag_py': '1f1f5-1f1fe', + 'py': '1f1f5-1f1fe', + 'flag_pe': '1f1f5-1f1ea', + 'pe': '1f1f5-1f1ea', + 'flag_ph': '1f1f5-1f1ed', + 'ph': '1f1f5-1f1ed', + 'flag_pl': '1f1f5-1f1f1', + 'pl': '1f1f5-1f1f1', + 'flag_pt': '1f1f5-1f1f9', + 'pt': '1f1f5-1f1f9', + 'flag_qa': '1f1f6-1f1e6', + 'qa': '1f1f6-1f1e6', + 'flag_tw': '1f1f9-1f1fc', + 'tw': '1f1f9-1f1fc', + 'flag_cg': '1f1e8-1f1ec', + 'cg': '1f1e8-1f1ec', + 'flag_ro': '1f1f7-1f1f4', + 'ro': '1f1f7-1f1f4', + 'flag_rw': '1f1f7-1f1fc', + 'rw': '1f1f7-1f1fc', + 'flag_kn': '1f1f0-1f1f3', + 'kn': '1f1f0-1f1f3', + 'flag_lc': '1f1f1-1f1e8', + 'lc': '1f1f1-1f1e8', + 'flag_vc': '1f1fb-1f1e8', + 'vc': '1f1fb-1f1e8', + 'flag_ws': '1f1fc-1f1f8', + 'ws': '1f1fc-1f1f8', + 'flag_sm': '1f1f8-1f1f2', + 'sm': '1f1f8-1f1f2', + 'flag_st': '1f1f8-1f1f9', + 'st': '1f1f8-1f1f9', + 'flag_sa': '1f1f8-1f1e6', + 'saudiarabia': '1f1f8-1f1e6', + 'saudi': '1f1f8-1f1e6', + 'flag_sn': '1f1f8-1f1f3', + 'sn': '1f1f8-1f1f3', + 'flag_rs': '1f1f7-1f1f8', + 'rs': '1f1f7-1f1f8', + 'flag_sc': '1f1f8-1f1e8', + 'sc': '1f1f8-1f1e8', + 'flag_sl': '1f1f8-1f1f1', + 'sl': '1f1f8-1f1f1', + 'flag_sg': '1f1f8-1f1ec', + 'sg': '1f1f8-1f1ec', + 'flag_sk': '1f1f8-1f1f0', + 'sk': '1f1f8-1f1f0', + 'flag_si': '1f1f8-1f1ee', + 'si': '1f1f8-1f1ee', + 'flag_sb': '1f1f8-1f1e7', + 'sb': '1f1f8-1f1e7', + 'flag_so': '1f1f8-1f1f4', + 'so': '1f1f8-1f1f4', + 'flag_za': '1f1ff-1f1e6', + 'za': '1f1ff-1f1e6', + 'flag_lk': '1f1f1-1f1f0', + 'lk': '1f1f1-1f1f0', + 'flag_sd': '1f1f8-1f1e9', + 'sd': '1f1f8-1f1e9', + 'flag_sr': '1f1f8-1f1f7', + 'sr': '1f1f8-1f1f7', + 'flag_sz': '1f1f8-1f1ff', + 'sz': '1f1f8-1f1ff', + 'flag_se': '1f1f8-1f1ea', + 'se': '1f1f8-1f1ea', + 'flag_ch': '1f1e8-1f1ed', + 'ch': '1f1e8-1f1ed', + 'flag_sy': '1f1f8-1f1fe', + 'sy': '1f1f8-1f1fe', + 'flag_tj': '1f1f9-1f1ef', + 'tj': '1f1f9-1f1ef', + 'flag_tz': '1f1f9-1f1ff', + 'tz': '1f1f9-1f1ff', + 'flag_th': '1f1f9-1f1ed', + 'th': '1f1f9-1f1ed', + 'flag_tg': '1f1f9-1f1ec', + 'tg': '1f1f9-1f1ec', + 'flag_to': '1f1f9-1f1f4', + 'to': '1f1f9-1f1f4', + 'flag_tt': '1f1f9-1f1f9', + 'tt': '1f1f9-1f1f9', + 'flag_tn': '1f1f9-1f1f3', + 'tn': '1f1f9-1f1f3', + 'flag_tr': '1f1f9-1f1f7', + 'tr': '1f1f9-1f1f7', + 'flag_tm': '1f1f9-1f1f2', + 'turkmenistan': '1f1f9-1f1f2', + 'flag_tv': '1f1f9-1f1fb', + 'tuvalu': '1f1f9-1f1fb', + 'flag_ug': '1f1fa-1f1ec', + 'ug': '1f1fa-1f1ec', + 'flag_ua': '1f1fa-1f1e6', + 'ua': '1f1fa-1f1e6', + 'flag_ae': '1f1e6-1f1ea', + 'ae': '1f1e6-1f1ea', + 'flag_uy': '1f1fa-1f1fe', + 'uy': '1f1fa-1f1fe', + 'flag_uz': '1f1fa-1f1ff', + 'uz': '1f1fa-1f1ff', + 'flag_vu': '1f1fb-1f1fa', + 'vu': '1f1fb-1f1fa', + 'flag_va': '1f1fb-1f1e6', + 'va': '1f1fb-1f1e6', + 'flag_ve': '1f1fb-1f1ea', + 've': '1f1fb-1f1ea', + 'flag_vn': '1f1fb-1f1f3', + 'vn': '1f1fb-1f1f3', + 'flag_eh': '1f1ea-1f1ed', + 'eh': '1f1ea-1f1ed', + 'flag_ye': '1f1fe-1f1ea', + 'ye': '1f1fe-1f1ea', + 'flag_zm': '1f1ff-1f1f2', + 'zm': '1f1ff-1f1f2', + 'flag_zw': '1f1ff-1f1fc', + 'zw': '1f1ff-1f1fc', + 'flag_pr': '1f1f5-1f1f7', + 'pr': '1f1f5-1f1f7', + 'flag_ky': '1f1f0-1f1fe', + 'ky': '1f1f0-1f1fe', + 'flag_bm': '1f1e7-1f1f2', + 'bm': '1f1e7-1f1f2', + 'flag_pf': '1f1f5-1f1eb', + 'pf': '1f1f5-1f1eb', + 'flag_ps': '1f1f5-1f1f8', + 'ps': '1f1f5-1f1f8', + 'flag_nc': '1f1f3-1f1e8', + 'nc': '1f1f3-1f1e8', + 'flag_sh': '1f1f8-1f1ed', + 'sh': '1f1f8-1f1ed', + 'flag_aw': '1f1e6-1f1fc', + 'aw': '1f1e6-1f1fc', + 'flag_vi': '1f1fb-1f1ee', + 'vi': '1f1fb-1f1ee', + 'flag_hk': '1f1ed-1f1f0', + 'hk': '1f1ed-1f1f0', + 'flag_ac': '1f1e6-1f1e8', + 'ac': '1f1e6-1f1e8', + 'flag_ms': '1f1f2-1f1f8', + 'ms': '1f1f2-1f1f8', + 'flag_gu': '1f1ec-1f1fa', + 'gu': '1f1ec-1f1fa', + 'flag_gl': '1f1ec-1f1f1', + 'gl': '1f1ec-1f1f1', + 'flag_nu': '1f1f3-1f1fa', + 'nu': '1f1f3-1f1fa', + 'flag_wf': '1f1fc-1f1eb', + 'wf': '1f1fc-1f1eb', + 'flag_mo': '1f1f2-1f1f4', + 'mo': '1f1f2-1f1f4', + 'flag_fo': '1f1eb-1f1f4', + 'fo': '1f1eb-1f1f4', + 'flag_fk': '1f1eb-1f1f0', + 'fk': '1f1eb-1f1f0', + 'flag_je': '1f1ef-1f1ea', + 'je': '1f1ef-1f1ea', + 'flag_ai': '1f1e6-1f1ee', + 'ai': '1f1e6-1f1ee', + 'flag_gi': '1f1ec-1f1ee', + 'gi': '1f1ec-1f1ee', + 'film_frames': '1f39e', + 'tickets': '1f39f', + 'admission_tickets': '1f39f', + 'medal': '1f3c5', + 'sports_medal': '1f3c5', + 'lifter': '1f3cb', + 'weight_lifter': '1f3cb', + 'golfer': '1f3cc', + 'motorcycle': '1f3cd', + 'racing_motorcycle': '1f3cd', + 'race_car': '1f3ce', + 'racing_car': '1f3ce', + 'military_medal': '1f396', + 'reminder_ribbon': '1f397', + 'hot_pepper': '1f336', + 'cloud_rain': '1f327', + 'cloud_with_rain': '1f327', + 'cloud_snow': '1f328', + 'cloud_with_snow': '1f328', + 'cloud_lightning': '1f329', + 'cloud_with_lightning': '1f329', + 'cloud_tornado': '1f32a', + 'cloud_with_tornado': '1f32a', + 'fog': '1f32b', + 'wind_blowing_face': '1f32c', + 'chipmunk': '1f43f', + 'spider': '1f577', + 'spider_web': '1f578', + 'thermometer': '1f321', + 'microphone2': '1f399', + 'studio_microphone': '1f399', + 'level_slider': '1f39a', + 'control_knobs': '1f39b', + 'flag_white': '1f3f3', + 'waving_white_flag': '1f3f3', + 'flag_black': '1f3f4', + 'waving_black_flag': '1f3f4', + 'rosette': '1f3f5', + 'label': '1f3f7', + 'camera_with_flash': '1f4f8', + 'projector': '1f4fd', + 'film_projector': '1f4fd', + 'cross': '271d', + 'latin_cross': '271d', + 'om_symbol': '1f549', + 'dove': '1f54a', + 'dove_of_peace': '1f54a', + 'candle': '1f56f', + 'clock': '1f570', + 'mantlepiece_clock': '1f570', + 'hole': '1f573', + 'dark_sunglasses': '1f576', + 'joystick': '1f579', + 'paperclips': '1f587', + 'linked_paperclips': '1f587', + 'pen_ballpoint': '1f58a', + 'lower_left_ballpoint_pen': '1f58a', + 'pen_fountain': '1f58b', + 'lower_left_fountain_pen': '1f58b', + 'paintbrush': '1f58c', + 'lower_left_paintbrush': '1f58c', + 'crayon': '1f58d', + 'lower_left_crayon': '1f58d', + 'desktop': '1f5a5', + 'desktop_computer': '1f5a5', + 'printer': '1f5a8', + 'keyboard': '2328', + 'trackball': '1f5b2', + 'frame_photo': '1f5bc', + 'frame_with_picture': '1f5bc', + 'dividers': '1f5c2', + 'card_index_dividers': '1f5c2', + 'card_box': '1f5c3', + 'card_file_box': '1f5c3', + 'file_cabinet': '1f5c4', + 'wastebasket': '1f5d1', + 'notepad_spiral': '1f5d2', + 'spiral_note_pad': '1f5d2', + 'calendar_spiral': '1f5d3', + 'spiral_calendar_pad': '1f5d3', + 'compression': '1f5dc', + 'key2': '1f5dd', + 'old_key': '1f5dd', + 'newspaper2': '1f5de', + 'rolled_up_newspaper': '1f5de', + 'dagger': '1f5e1', + 'dagger_knife': '1f5e1', + 'speaking_head': '1f5e3', + 'speaking_head_in_silhouette': '1f5e3', + 'anger_right': '1f5ef', + 'right_anger_bubble': '1f5ef', + 'ballot_box': '1f5f3', + 'ballot_box_with_ballot': '1f5f3', + 'map': '1f5fa', + 'world_map': '1f5fa', + 'sleeping_accommodation': '1f6cc', + 'tools': '1f6e0', + 'hammer_and_wrench': '1f6e0', + 'shield': '1f6e1', + 'oil': '1f6e2', + 'oil_drum': '1f6e2', + 'satellite_orbital': '1f6f0', + 'fork_knife_plate': '1f37d', + 'fork_and_knife_with_plate': '1f37d', + 'eye': '1f441', + 'levitate': '1f574', + 'man_in_business_suit_levitating': '1f574', + 'spy': '1f575', + 'sleuth_or_spy': '1f575', + 'writing_hand': '270d', + 'hand_splayed': '1f590', + 'raised_hand_with_fingers_splayed': '1f590', + 'middle_finger': '1f595', + 'reversed_hand_with_middle_finger_extended': '1f595', + 'vulcan': '1f596', + 'raised_hand_with_part_between_middle_and_ring_fingers': '1f596', + 'slight_frown': '1f641', + 'slightly_frowning_face': '1f641', + 'slight_smile': '1f642', + 'slightly_smiling_face': '1f642', + 'mountain_snow': '1f3d4', + 'snow_capped_mountain': '1f3d4', + 'camping': '1f3d5', + 'beach': '1f3d6', + 'beach_with_umbrella': '1f3d6', + 'construction_site': '1f3d7', + 'building_construction': '1f3d7', + 'homes': '1f3d8', + 'house_buildings': '1f3d8', + 'cityscape': '1f3d9', + 'house_abandoned': '1f3da', + 'derelict_house_building': '1f3da', + 'classical_building': '1f3db', + 'desert': '1f3dc', + 'island': '1f3dd', + 'desert_island': '1f3dd', + 'park': '1f3de', + 'national_park': '1f3de', + 'stadium': '1f3df', + 'couch': '1f6cb', + 'couch_and_lamp': '1f6cb', + 'shopping_bags': '1f6cd', + 'bellhop': '1f6ce', + 'bellhop_bell': '1f6ce', + 'bed': '1f6cf', + 'motorway': '1f6e3', + 'railway_track': '1f6e4', + 'railroad_track': '1f6e4', + 'motorboat': '1f6e5', + 'airplane_small': '1f6e9', + 'small_airplane': '1f6e9', + 'airplane_departure': '1f6eb', + 'airplane_arriving': '1f6ec', + 'cruise_ship': '1f6f3', + 'passenger_ship': '1f6f3', + 'baby_tone1': '1f476-1f3fb', + 'baby_tone2': '1f476-1f3fc', + 'baby_tone3': '1f476-1f3fd', + 'baby_tone4': '1f476-1f3fe', + 'baby_tone5': '1f476-1f3ff', + 'boy_tone1': '1f466-1f3fb', + 'boy_tone2': '1f466-1f3fc', + 'boy_tone3': '1f466-1f3fd', + 'boy_tone4': '1f466-1f3fe', + 'boy_tone5': '1f466-1f3ff', + 'girl_tone1': '1f467-1f3fb', + 'girl_tone2': '1f467-1f3fc', + 'girl_tone3': '1f467-1f3fd', + 'girl_tone4': '1f467-1f3fe', + 'girl_tone5': '1f467-1f3ff', + 'man_tone1': '1f468-1f3fb', + 'man_tone2': '1f468-1f3fc', + 'man_tone3': '1f468-1f3fd', + 'man_tone4': '1f468-1f3fe', + 'man_tone5': '1f468-1f3ff', + 'woman_tone1': '1f469-1f3fb', + 'woman_tone2': '1f469-1f3fc', + 'woman_tone3': '1f469-1f3fd', + 'woman_tone4': '1f469-1f3fe', + 'woman_tone5': '1f469-1f3ff', + 'bride_with_veil_tone1': '1f470-1f3fb', + 'bride_with_veil_tone2': '1f470-1f3fc', + 'bride_with_veil_tone3': '1f470-1f3fd', + 'bride_with_veil_tone4': '1f470-1f3fe', + 'bride_with_veil_tone5': '1f470-1f3ff', + 'person_with_blond_hair_tone1': '1f471-1f3fb', + 'person_with_blond_hair_tone2': '1f471-1f3fc', + 'person_with_blond_hair_tone3': '1f471-1f3fd', + 'person_with_blond_hair_tone4': '1f471-1f3fe', + 'person_with_blond_hair_tone5': '1f471-1f3ff', + 'man_with_gua_pi_mao_tone1': '1f472-1f3fb', + 'man_with_gua_pi_mao_tone2': '1f472-1f3fc', + 'man_with_gua_pi_mao_tone3': '1f472-1f3fd', + 'man_with_gua_pi_mao_tone4': '1f472-1f3fe', + 'man_with_gua_pi_mao_tone5': '1f472-1f3ff', + 'man_with_turban_tone1': '1f473-1f3fb', + 'man_with_turban_tone2': '1f473-1f3fc', + 'man_with_turban_tone3': '1f473-1f3fd', + 'man_with_turban_tone4': '1f473-1f3fe', + 'man_with_turban_tone5': '1f473-1f3ff', + 'older_man_tone1': '1f474-1f3fb', + 'older_man_tone2': '1f474-1f3fc', + 'older_man_tone3': '1f474-1f3fd', + 'older_man_tone4': '1f474-1f3fe', + 'older_man_tone5': '1f474-1f3ff', + 'older_woman_tone1': '1f475-1f3fb', + 'grandma_tone1': '1f475-1f3fb', + 'older_woman_tone2': '1f475-1f3fc', + 'grandma_tone2': '1f475-1f3fc', + 'older_woman_tone3': '1f475-1f3fd', + 'grandma_tone3': '1f475-1f3fd', + 'older_woman_tone4': '1f475-1f3fe', + 'grandma_tone4': '1f475-1f3fe', + 'older_woman_tone5': '1f475-1f3ff', + 'grandma_tone5': '1f475-1f3ff', + 'cop_tone1': '1f46e-1f3fb', + 'cop_tone2': '1f46e-1f3fc', + 'cop_tone3': '1f46e-1f3fd', + 'cop_tone4': '1f46e-1f3fe', + 'cop_tone5': '1f46e-1f3ff', + 'construction_worker_tone1': '1f477-1f3fb', + 'construction_worker_tone2': '1f477-1f3fc', + 'construction_worker_tone3': '1f477-1f3fd', + 'construction_worker_tone4': '1f477-1f3fe', + 'construction_worker_tone5': '1f477-1f3ff', + 'princess_tone1': '1f478-1f3fb', + 'princess_tone2': '1f478-1f3fc', + 'princess_tone3': '1f478-1f3fd', + 'princess_tone4': '1f478-1f3fe', + 'princess_tone5': '1f478-1f3ff', + 'guardsman_tone1': '1f482-1f3fb', + 'guardsman_tone2': '1f482-1f3fc', + 'guardsman_tone3': '1f482-1f3fd', + 'guardsman_tone4': '1f482-1f3fe', + 'guardsman_tone5': '1f482-1f3ff', + 'angel_tone1': '1f47c-1f3fb', + 'angel_tone2': '1f47c-1f3fc', + 'angel_tone3': '1f47c-1f3fd', + 'angel_tone4': '1f47c-1f3fe', + 'angel_tone5': '1f47c-1f3ff', + 'bow_tone1': '1f647-1f3fb', + 'bow_tone2': '1f647-1f3fc', + 'bow_tone3': '1f647-1f3fd', + 'bow_tone4': '1f647-1f3fe', + 'bow_tone5': '1f647-1f3ff', + 'information_desk_person_tone1': '1f481-1f3fb', + 'information_desk_person_tone2': '1f481-1f3fc', + 'information_desk_person_tone3': '1f481-1f3fd', + 'information_desk_person_tone4': '1f481-1f3fe', + 'information_desk_person_tone5': '1f481-1f3ff', + 'no_good_tone1': '1f645-1f3fb', + 'no_good_tone2': '1f645-1f3fc', + 'no_good_tone3': '1f645-1f3fd', + 'no_good_tone4': '1f645-1f3fe', + 'no_good_tone5': '1f645-1f3ff', + 'ok_woman_tone1': '1f646-1f3fb', + 'ok_woman_tone2': '1f646-1f3fc', + 'ok_woman_tone3': '1f646-1f3fd', + 'ok_woman_tone4': '1f646-1f3fe', + 'ok_woman_tone5': '1f646-1f3ff', + 'raising_hand_tone1': '1f64b-1f3fb', + 'raising_hand_tone2': '1f64b-1f3fc', + 'raising_hand_tone3': '1f64b-1f3fd', + 'raising_hand_tone4': '1f64b-1f3fe', + 'raising_hand_tone5': '1f64b-1f3ff', + 'person_with_pouting_face_tone1': '1f64e-1f3fb', + 'person_with_pouting_face_tone2': '1f64e-1f3fc', + 'person_with_pouting_face_tone3': '1f64e-1f3fd', + 'person_with_pouting_face_tone4': '1f64e-1f3fe', + 'person_with_pouting_face_tone5': '1f64e-1f3ff', + 'person_frowning_tone1': '1f64d-1f3fb', + 'person_frowning_tone2': '1f64d-1f3fc', + 'person_frowning_tone3': '1f64d-1f3fd', + 'person_frowning_tone4': '1f64d-1f3fe', + 'person_frowning_tone5': '1f64d-1f3ff', + 'massage_tone1': '1f486-1f3fb', + 'massage_tone2': '1f486-1f3fc', + 'massage_tone3': '1f486-1f3fd', + 'massage_tone4': '1f486-1f3fe', + 'massage_tone5': '1f486-1f3ff', + 'haircut_tone1': '1f487-1f3fb', + 'haircut_tone2': '1f487-1f3fc', + 'haircut_tone3': '1f487-1f3fd', + 'haircut_tone4': '1f487-1f3fe', + 'haircut_tone5': '1f487-1f3ff', + 'raised_hands_tone1': '1f64c-1f3fb', + 'raised_hands_tone2': '1f64c-1f3fc', + 'raised_hands_tone3': '1f64c-1f3fd', + 'raised_hands_tone4': '1f64c-1f3fe', + 'raised_hands_tone5': '1f64c-1f3ff', + 'clap_tone1': '1f44f-1f3fb', + 'clap_tone2': '1f44f-1f3fc', + 'clap_tone3': '1f44f-1f3fd', + 'clap_tone4': '1f44f-1f3fe', + 'clap_tone5': '1f44f-1f3ff', + 'ear_tone1': '1f442-1f3fb', + 'ear_tone2': '1f442-1f3fc', + 'ear_tone3': '1f442-1f3fd', + 'ear_tone4': '1f442-1f3fe', + 'ear_tone5': '1f442-1f3ff', + 'nose_tone1': '1f443-1f3fb', + 'nose_tone2': '1f443-1f3fc', + 'nose_tone3': '1f443-1f3fd', + 'nose_tone4': '1f443-1f3fe', + 'nose_tone5': '1f443-1f3ff', + 'nail_care_tone1': '1f485-1f3fb', + 'nail_care_tone2': '1f485-1f3fc', + 'nail_care_tone3': '1f485-1f3fd', + 'nail_care_tone4': '1f485-1f3fe', + 'nail_care_tone5': '1f485-1f3ff', + 'wave_tone1': '1f44b-1f3fb', + 'wave_tone2': '1f44b-1f3fc', + 'wave_tone3': '1f44b-1f3fd', + 'wave_tone4': '1f44b-1f3fe', + 'wave_tone5': '1f44b-1f3ff', + 'thumbsup_tone1': '1f44d-1f3fb', + '+1_tone1': '1f44d-1f3fb', + 'thumbup_tone1': '1f44d-1f3fb', + 'thumbsup_tone2': '1f44d-1f3fc', + '+1_tone2': '1f44d-1f3fc', + 'thumbup_tone2': '1f44d-1f3fc', + 'thumbsup_tone3': '1f44d-1f3fd', + '+1_tone3': '1f44d-1f3fd', + 'thumbup_tone3': '1f44d-1f3fd', + 'thumbsup_tone4': '1f44d-1f3fe', + '+1_tone4': '1f44d-1f3fe', + 'thumbup_tone4': '1f44d-1f3fe', + 'thumbsup_tone5': '1f44d-1f3ff', + '+1_tone5': '1f44d-1f3ff', + 'thumbup_tone5': '1f44d-1f3ff', + 'thumbsdown_tone1': '1f44e-1f3fb', + '-1_tone1': '1f44e-1f3fb', + 'thumbdown_tone1': '1f44e-1f3fb', + 'thumbsdown_tone2': '1f44e-1f3fc', + '-1_tone2': '1f44e-1f3fc', + 'thumbdown_tone2': '1f44e-1f3fc', + 'thumbsdown_tone3': '1f44e-1f3fd', + '-1_tone3': '1f44e-1f3fd', + 'thumbdown_tone3': '1f44e-1f3fd', + 'thumbsdown_tone4': '1f44e-1f3fe', + '-1_tone4': '1f44e-1f3fe', + 'thumbdown_tone4': '1f44e-1f3fe', + 'thumbsdown_tone5': '1f44e-1f3ff', + '-1_tone5': '1f44e-1f3ff', + 'thumbdown_tone5': '1f44e-1f3ff', + 'point_up_tone1': '261d-1f3fb', + 'point_up_tone2': '261d-1f3fc', + 'point_up_tone3': '261d-1f3fd', + 'point_up_tone4': '261d-1f3fe', + 'point_up_tone5': '261d-1f3ff', + 'point_up_2_tone1': '1f446-1f3fb', + 'point_up_2_tone2': '1f446-1f3fc', + 'point_up_2_tone3': '1f446-1f3fd', + 'point_up_2_tone4': '1f446-1f3fe', + 'point_up_2_tone5': '1f446-1f3ff', + 'point_down_tone1': '1f447-1f3fb', + 'point_down_tone2': '1f447-1f3fc', + 'point_down_tone3': '1f447-1f3fd', + 'point_down_tone4': '1f447-1f3fe', + 'point_down_tone5': '1f447-1f3ff', + 'point_left_tone1': '1f448-1f3fb', + 'point_left_tone2': '1f448-1f3fc', + 'point_left_tone3': '1f448-1f3fd', + 'point_left_tone4': '1f448-1f3fe', + 'point_left_tone5': '1f448-1f3ff', + 'point_right_tone1': '1f449-1f3fb', + 'point_right_tone2': '1f449-1f3fc', + 'point_right_tone3': '1f449-1f3fd', + 'point_right_tone4': '1f449-1f3fe', + 'point_right_tone5': '1f449-1f3ff', + 'ok_hand_tone1': '1f44c-1f3fb', + 'ok_hand_tone2': '1f44c-1f3fc', + 'ok_hand_tone3': '1f44c-1f3fd', + 'ok_hand_tone4': '1f44c-1f3fe', + 'ok_hand_tone5': '1f44c-1f3ff', + 'v_tone1': '270c-1f3fb', + 'v_tone2': '270c-1f3fc', + 'v_tone3': '270c-1f3fd', + 'v_tone4': '270c-1f3fe', + 'v_tone5': '270c-1f3ff', + 'punch_tone1': '1f44a-1f3fb', + 'punch_tone2': '1f44a-1f3fc', + 'punch_tone3': '1f44a-1f3fd', + 'punch_tone4': '1f44a-1f3fe', + 'punch_tone5': '1f44a-1f3ff', + 'fist_tone1': '270a-1f3fb', + 'fist_tone2': '270a-1f3fc', + 'fist_tone3': '270a-1f3fd', + 'fist_tone4': '270a-1f3fe', + 'fist_tone5': '270a-1f3ff', + 'raised_hand_tone1': '270b-1f3fb', + 'raised_hand_tone2': '270b-1f3fc', + 'raised_hand_tone3': '270b-1f3fd', + 'raised_hand_tone4': '270b-1f3fe', + 'raised_hand_tone5': '270b-1f3ff', + 'muscle_tone1': '1f4aa-1f3fb', + 'muscle_tone2': '1f4aa-1f3fc', + 'muscle_tone3': '1f4aa-1f3fd', + 'muscle_tone4': '1f4aa-1f3fe', + 'muscle_tone5': '1f4aa-1f3ff', + 'open_hands_tone1': '1f450-1f3fb', + 'open_hands_tone2': '1f450-1f3fc', + 'open_hands_tone3': '1f450-1f3fd', + 'open_hands_tone4': '1f450-1f3fe', + 'open_hands_tone5': '1f450-1f3ff', + 'pray_tone1': '1f64f-1f3fb', + 'pray_tone2': '1f64f-1f3fc', + 'pray_tone3': '1f64f-1f3fd', + 'pray_tone4': '1f64f-1f3fe', + 'pray_tone5': '1f64f-1f3ff', + 'runner_tone1': '1f3c3-1f3fb', + 'runner_tone2': '1f3c3-1f3fc', + 'runner_tone3': '1f3c3-1f3fd', + 'runner_tone4': '1f3c3-1f3fe', + 'runner_tone5': '1f3c3-1f3ff', + 'walking_tone1': '1f6b6-1f3fb', + 'walking_tone2': '1f6b6-1f3fc', + 'walking_tone3': '1f6b6-1f3fd', + 'walking_tone4': '1f6b6-1f3fe', + 'walking_tone5': '1f6b6-1f3ff', + 'dancer_tone1': '1f483-1f3fb', + 'dancer_tone2': '1f483-1f3fc', + 'dancer_tone3': '1f483-1f3fd', + 'dancer_tone4': '1f483-1f3fe', + 'dancer_tone5': '1f483-1f3ff', + 'rowboat_tone1': '1f6a3-1f3fb', + 'rowboat_tone2': '1f6a3-1f3fc', + 'rowboat_tone3': '1f6a3-1f3fd', + 'rowboat_tone4': '1f6a3-1f3fe', + 'rowboat_tone5': '1f6a3-1f3ff', + 'swimmer_tone1': '1f3ca-1f3fb', + 'swimmer_tone2': '1f3ca-1f3fc', + 'swimmer_tone3': '1f3ca-1f3fd', + 'swimmer_tone4': '1f3ca-1f3fe', + 'swimmer_tone5': '1f3ca-1f3ff', + 'surfer_tone1': '1f3c4-1f3fb', + 'surfer_tone2': '1f3c4-1f3fc', + 'surfer_tone3': '1f3c4-1f3fd', + 'surfer_tone4': '1f3c4-1f3fe', + 'surfer_tone5': '1f3c4-1f3ff', + 'bath_tone1': '1f6c0-1f3fb', + 'bath_tone2': '1f6c0-1f3fc', + 'bath_tone3': '1f6c0-1f3fd', + 'bath_tone4': '1f6c0-1f3fe', + 'bath_tone5': '1f6c0-1f3ff', + 'bicyclist_tone1': '1f6b4-1f3fb', + 'bicyclist_tone2': '1f6b4-1f3fc', + 'bicyclist_tone3': '1f6b4-1f3fd', + 'bicyclist_tone4': '1f6b4-1f3fe', + 'bicyclist_tone5': '1f6b4-1f3ff', + 'mountain_bicyclist_tone1': '1f6b5-1f3fb', + 'mountain_bicyclist_tone2': '1f6b5-1f3fc', + 'mountain_bicyclist_tone3': '1f6b5-1f3fd', + 'mountain_bicyclist_tone4': '1f6b5-1f3fe', + 'mountain_bicyclist_tone5': '1f6b5-1f3ff', + 'horse_racing_tone1': '1f3c7-1f3fb', + 'horse_racing_tone2': '1f3c7-1f3fc', + 'horse_racing_tone3': '1f3c7-1f3fd', + 'horse_racing_tone4': '1f3c7-1f3fe', + 'horse_racing_tone5': '1f3c7-1f3ff', + 'writing_hand_tone1': '270d-1f3fb', + 'writing_hand_tone2': '270d-1f3fc', + 'writing_hand_tone3': '270d-1f3fd', + 'writing_hand_tone4': '270d-1f3fe', + 'writing_hand_tone5': '270d-1f3ff', + 'hand_splayed_tone1': '1f590-1f3fb', + 'raised_hand_with_fingers_splayed_tone1': '1f590-1f3fb', + 'hand_splayed_tone2': '1f590-1f3fc', + 'raised_hand_with_fingers_splayed_tone2': '1f590-1f3fc', + 'hand_splayed_tone3': '1f590-1f3fd', + 'raised_hand_with_fingers_splayed_tone3': '1f590-1f3fd', + 'hand_splayed_tone4': '1f590-1f3fe', + 'raised_hand_with_fingers_splayed_tone4': '1f590-1f3fe', + 'hand_splayed_tone5': '1f590-1f3ff', + 'raised_hand_with_fingers_splayed_tone5': '1f590-1f3ff', + 'middle_finger_tone1': '1f595-1f3fb', + 'reversed_hand_with_middle_finger_extended_tone1': '1f595-1f3fb', + 'middle_finger_tone2': '1f595-1f3fc', + 'reversed_hand_with_middle_finger_extended_tone2': '1f595-1f3fc', + 'middle_finger_tone3': '1f595-1f3fd', + 'reversed_hand_with_middle_finger_extended_tone3': '1f595-1f3fd', + 'middle_finger_tone4': '1f595-1f3fe', + 'reversed_hand_with_middle_finger_extended_tone4': '1f595-1f3fe', + 'middle_finger_tone5': '1f595-1f3ff', + 'reversed_hand_with_middle_finger_extended_tone5': '1f595-1f3ff', + 'vulcan_tone1': '1f596-1f3fb', + 'raised_hand_with_part_between_middle_and_ring_fingers_tone1': '1f596-1f3fb', + 'vulcan_tone2': '1f596-1f3fc', + 'raised_hand_with_part_between_middle_and_ring_fingers_tone2': '1f596-1f3fc', + 'vulcan_tone3': '1f596-1f3fd', + 'raised_hand_with_part_between_middle_and_ring_fingers_tone3': '1f596-1f3fd', + 'vulcan_tone4': '1f596-1f3fe', + 'raised_hand_with_part_between_middle_and_ring_fingers_tone4': '1f596-1f3fe', + 'vulcan_tone5': '1f596-1f3ff', + 'raised_hand_with_part_between_middle_and_ring_fingers_tone5': '1f596-1f3ff', + 'family_mmb': '1f468-1f468-1f466', + 'family_mmbb': '1f468-1f468-1f466-1f466', + 'family_mmg': '1f468-1f468-1f467', + 'family_mmgb': '1f468-1f468-1f467-1f466', + 'family_mmgg': '1f468-1f468-1f467-1f467', + 'family_mwbb': '1f468-1f469-1f466-1f466', + 'family_mwg': '1f468-1f469-1f467', + 'family_mwgb': '1f468-1f469-1f467-1f466', + 'family_mwgg': '1f468-1f469-1f467-1f467', + 'family_wwb': '1f469-1f469-1f466', + 'family_wwbb': '1f469-1f469-1f466-1f466', + 'family_wwg': '1f469-1f469-1f467', + 'family_wwgb': '1f469-1f469-1f467-1f466', + 'family_wwgg': '1f469-1f469-1f467-1f467', + 'couple_ww': '1f469-2764-1f469', + 'couple_with_heart_ww': '1f469-2764-1f469', + 'couple_mm': '1f468-2764-1f468', + 'couple_with_heart_mm': '1f468-2764-1f468', + 'kiss_ww': '1f469-2764-1f48b-1f469', + 'couplekiss_ww': '1f469-2764-1f48b-1f469', + 'kiss_mm': '1f468-2764-1f48b-1f468', + 'couplekiss_mm': '1f468-2764-1f48b-1f468', + 'tone1': '1f3fb', + 'tone2': '1f3fc', + 'tone3': '1f3fd', + 'tone4': '1f3fe', + 'tone5': '1f3ff', + 'asterisk': '002a-20e3', + 'keycap_asterisk': '002a-20e3', + 'track_next': '23ed', + 'next_track': '23ed', + 'track_previous': '23ee', + 'previous_track': '23ee', + 'play_pause': '23ef', + 'eye_in_speech_bubble': '1f441-1f5e8', + 'stopwatch': '23f1', + 'timer': '23f2', + 'timer_clock': '23f2', + 'pause_button': '23f8', + 'double_vertical_bar': '23f8', + 'stop_button': '23f9', + 'record_button': '23fa', + 'umbrella2': '2602', + 'snowman2': '2603', + 'comet': '2604', + 'shamrock': '2618', + 'skull_crossbones': '2620', + 'skull_and_crossbones': '2620', + 'radioactive': '2622', + 'radioactive_sign': '2622', + 'biohazard': '2623', + 'biohazard_sign': '2623', + 'orthodox_cross': '2626', + 'star_and_crescent': '262a', + 'peace': '262e', + 'peace_symbol': '262e', + 'yin_yang': '262f', + 'wheel_of_dharma': '2638', + 'frowning2': '2639', + 'white_frowning_face': '2639', + 'hammer_pick': '2692', + 'hammer_and_pick': '2692', + 'crossed_swords': '2694', + 'scales': '2696', + 'alembic': '2697', + 'gear': '2699', + 'atom': '269b', + 'atom_symbol': '269b', + 'fleur-de-lis': '269c', + 'coffin': '26b0', + 'urn': '26b1', + 'funeral_urn': '26b1', + 'thunder_cloud_rain': '26c8', + 'thunder_cloud_and_rain': '26c8', + 'pick': '26cf', + 'helmet_with_cross': '26d1', + 'helmet_with_white_cross': '26d1', + 'chains': '26d3', + 'shinto_shrine': '26e9', + 'mountain': '26f0', + 'beach_umbrella': '26f1', + 'umbrella_on_ground': '26f1', + 'ferry': '26f4', + 'skier': '26f7', + 'ice_skate': '26f8', + 'basketball_player': '26f9', + 'person_with_ball': '26f9', + 'star_of_david': '2721', + 'heart_exclamation': '2763', + 'heavy_heart_exclamation_mark_ornament': '2763', + 'white_sun_small_cloud': '1f324', + 'white_sun_with_small_cloud': '1f324', + 'white_sun_cloud': '1f325', + 'white_sun_behind_cloud': '1f325', + 'white_sun_rain_cloud': '1f326', + 'white_sun_behind_cloud_with_rain': '1f326', + 'mouse_three_button': '1f5b1', + 'three_button_mouse': '1f5b1', + 'santa_tone1': '1f385-1f3fb', + 'santa_tone2': '1f385-1f3fc', + 'santa_tone3': '1f385-1f3fd', + 'santa_tone4': '1f385-1f3fe', + 'santa_tone5': '1f385-1f3ff', + 'metal_tone1': '1f918-1f3fb', + 'sign_of_the_horns_tone1': '1f918-1f3fb', + 'metal_tone2': '1f918-1f3fc', + 'sign_of_the_horns_tone2': '1f918-1f3fc', + 'metal_tone3': '1f918-1f3fd', + 'sign_of_the_horns_tone3': '1f918-1f3fd', + 'metal_tone4': '1f918-1f3fe', + 'sign_of_the_horns_tone4': '1f918-1f3fe', + 'metal_tone5': '1f918-1f3ff', + 'sign_of_the_horns_tone5': '1f918-1f3ff', + 'lifter_tone1': '1f3cb-1f3fb', + 'weight_lifter_tone1': '1f3cb-1f3fb', + 'lifter_tone2': '1f3cb-1f3fc', + 'weight_lifter_tone2': '1f3cb-1f3fc', + 'lifter_tone3': '1f3cb-1f3fd', + 'weight_lifter_tone3': '1f3cb-1f3fd', + 'lifter_tone4': '1f3cb-1f3fe', + 'weight_lifter_tone4': '1f3cb-1f3fe', + 'lifter_tone5': '1f3cb-1f3ff', + 'weight_lifter_tone5': '1f3cb-1f3ff', + 'basketball_player_tone1': '26f9-1f3fb', + 'person_with_ball_tone1': '26f9-1f3fb', + 'basketball_player_tone2': '26f9-1f3fc', + 'person_with_ball_tone2': '26f9-1f3fc', + 'basketball_player_tone3': '26f9-1f3fd', + 'person_with_ball_tone3': '26f9-1f3fd', + 'basketball_player_tone4': '26f9-1f3fe', + 'person_with_ball_tone4': '26f9-1f3fe', + 'basketball_player_tone5': '26f9-1f3ff', + 'person_with_ball_tone5': '26f9-1f3ff', + 'upside_down': '1f643', + 'upside_down_face': '1f643', + 'money_mouth': '1f911', + 'money_mouth_face': '1f911', + 'nerd': '1f913', + 'nerd_face': '1f913', + 'hugging': '1f917', + 'hugging_face': '1f917', + 'rolling_eyes': '1f644', + 'face_with_rolling_eyes': '1f644', + 'thinking': '1f914', + 'thinking_face': '1f914', + 'zipper_mouth': '1f910', + 'zipper_mouth_face': '1f910', + 'thermometer_face': '1f912', + 'face_with_thermometer': '1f912', + 'head_bandage': '1f915', + 'face_with_head_bandage': '1f915', + 'robot': '1f916', + 'robot_face': '1f916', + 'lion_face': '1f981', + 'lion': '1f981', + 'unicorn': '1f984', + 'unicorn_face': '1f984', + 'scorpion': '1f982', + 'crab': '1f980', + 'turkey': '1f983', + 'cheese': '1f9c0', + 'cheese_wedge': '1f9c0', + 'hotdog': '1f32d', + 'hot_dog': '1f32d', + 'taco': '1f32e', + 'burrito': '1f32f', + 'popcorn': '1f37f', + 'champagne': '1f37e', + 'bottle_with_popping_cork': '1f37e', + 'bow_and_arrow': '1f3f9', + 'archery': '1f3f9', + 'amphora': '1f3fa', + 'place_of_worship': '1f6d0', + 'worship_symbol': '1f6d0', + 'kaaba': '1f54b', + 'mosque': '1f54c', + 'synagogue': '1f54d', + 'menorah': '1f54e', + 'prayer_beads': '1f4ff', + 'cricket': '1f3cf', + 'cricket_bat_ball': '1f3cf', + 'volleyball': '1f3d0', + 'field_hockey': '1f3d1', + 'hockey': '1f3d2', + 'ping_pong': '1f3d3', + 'table_tennis': '1f3d3', + 'badminton': '1f3f8', + 'flag_ax': '1f1e6-1f1fd', + 'ax': '1f1e6-1f1fd', + 'flag_ta': '1f1f9-1f1e6', + 'ta': '1f1f9-1f1e6', + 'flag_io': '1f1ee-1f1f4', + 'io': '1f1ee-1f1f4', + 'flag_bq': '1f1e7-1f1f6', + 'bq': '1f1e7-1f1f6', + 'flag_cx': '1f1e8-1f1fd', + 'cx': '1f1e8-1f1fd', + 'flag_cc': '1f1e8-1f1e8', + 'cc': '1f1e8-1f1e8', + 'flag_gg': '1f1ec-1f1ec', + 'gg': '1f1ec-1f1ec', + 'flag_im': '1f1ee-1f1f2', + 'im': '1f1ee-1f1f2', + 'flag_yt': '1f1fe-1f1f9', + 'yt': '1f1fe-1f1f9', + 'flag_nf': '1f1f3-1f1eb', + 'nf': '1f1f3-1f1eb', + 'flag_pn': '1f1f5-1f1f3', + 'pn': '1f1f5-1f1f3', + 'flag_bl': '1f1e7-1f1f1', + 'bl': '1f1e7-1f1f1', + 'flag_pm': '1f1f5-1f1f2', + 'pm': '1f1f5-1f1f2', + 'flag_gs': '1f1ec-1f1f8', + 'gs': '1f1ec-1f1f8', + 'flag_tk': '1f1f9-1f1f0', + 'tk': '1f1f9-1f1f0', + 'flag_bv': '1f1e7-1f1fb', + 'bv': '1f1e7-1f1fb', + 'flag_hm': '1f1ed-1f1f2', + 'hm': '1f1ed-1f1f2', + 'flag_sj': '1f1f8-1f1ef', + 'sj': '1f1f8-1f1ef', + 'flag_um': '1f1fa-1f1f2', + 'um': '1f1fa-1f1f2', + 'flag_ic': '1f1ee-1f1e8', + 'ic': '1f1ee-1f1e8', + 'flag_ea': '1f1ea-1f1e6', + 'ea': '1f1ea-1f1e6', + 'flag_cp': '1f1e8-1f1f5', + 'cp': '1f1e8-1f1f5', + 'flag_dg': '1f1e9-1f1ec', + 'dg': '1f1e9-1f1ec', + 'flag_as': '1f1e6-1f1f8', + 'as': '1f1e6-1f1f8', + 'flag_aq': '1f1e6-1f1f6', + 'aq': '1f1e6-1f1f6', + 'flag_vg': '1f1fb-1f1ec', + 'vg': '1f1fb-1f1ec', + 'flag_ck': '1f1e8-1f1f0', + 'ck': '1f1e8-1f1f0', + 'flag_cw': '1f1e8-1f1fc', + 'cw': '1f1e8-1f1fc', + 'flag_eu': '1f1ea-1f1fa', + 'eu': '1f1ea-1f1fa', + 'flag_gf': '1f1ec-1f1eb', + 'gf': '1f1ec-1f1eb', + 'flag_tf': '1f1f9-1f1eb', + 'tf': '1f1f9-1f1eb', + 'flag_gp': '1f1ec-1f1f5', + 'gp': '1f1ec-1f1f5', + 'flag_mq': '1f1f2-1f1f6', + 'mq': '1f1f2-1f1f6', + 'flag_mp': '1f1f2-1f1f5', + 'mp': '1f1f2-1f1f5', + 'flag_re': '1f1f7-1f1ea', + 're': '1f1f7-1f1ea', + 'flag_sx': '1f1f8-1f1fd', + 'sx': '1f1f8-1f1fd', + 'flag_ss': '1f1f8-1f1f8', + 'ss': '1f1f8-1f1f8', + 'flag_tc': '1f1f9-1f1e8', + 'tc': '1f1f9-1f1e8', + 'flag_mf': '1f1f2-1f1eb', + 'mf': '1f1f2-1f1eb', + 'spy_tone1': '1f575-1f3fb', + 'sleuth_or_spy_tone1': '1f575-1f3fb', + 'spy_tone2': '1f575-1f3fc', + 'sleuth_or_spy_tone2': '1f575-1f3fc', + 'spy_tone3': '1f575-1f3fd', + 'sleuth_or_spy_tone3': '1f575-1f3fd', + 'spy_tone4': '1f575-1f3fe', + 'sleuth_or_spy_tone4': '1f575-1f3fe', + 'spy_tone5': '1f575-1f3ff', + 'sleuth_or_spy_tone5': '1f575-1f3ff', +}; From 5f7195b3faa1f4e27fe0dce45d13231f41a348be Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sat, 14 May 2016 22:59:25 +0900 Subject: [PATCH 036/154] Match emojis from the beginning before trying fuzzy matches Fixes flarum/core#901. --- extensions/emoji/js/forum/dist/extension.js | 27 ++++++++++++++----- .../js/forum/src/addComposerAutocomplete.js | 27 +++++++++++++------ 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index ff1462373..668b58785 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -215,18 +215,33 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru var suggestions = []; var similarEmoji = []; + // Build a regular expression to do a fuzzy match of the given input string var fuzzyRegexp = function fuzzyRegexp(str) { var reEscape = new RegExp('\\(([' + '+.*?[]{}()^$|\\'.replace(/(.)/g, '\\$1') + '])\\)', 'g'); return new RegExp('(.*)' + str.toLowerCase().replace(/(.)/g, '($1)(.*?)').replace(reEscape, '(\\$1)') + '$', 'i'); }; - var regTyped = fuzzyRegexp(typed); - for (var i = 0, maxSuggestions = 7; i < emojiKeys.length && maxSuggestions > 0; i++) { - if (regTyped.test(emojiKeys[i])) { - --maxSuggestions; - similarEmoji.push(emojiKeys[i]); + + var maxSuggestions = 7; + + var findMatchingEmojis = function findMatchingEmojis(matcher) { + for (var _i = 0; _i < emojiKeys.length && maxSuggestions > 0; _i++) { + if (matcher(emojiKeys[_i])) { + --maxSuggestions; + similarEmoji.push(emojiKeys[_i]); + } } - } + }; + + // First, try to find all emojis starting with the given string + findMatchingEmojis(function (emoji) { + return emoji.indexOf(typed) === 0; + }); + + // If there are still suggestions left, try for some fuzzy matches + findMatchingEmojis(function (emoji) { + return regTyped.test(emoji); + }); similarEmoji = similarEmoji.sort(function (a, b) { return a.length - b.length; diff --git a/extensions/emoji/js/forum/src/addComposerAutocomplete.js b/extensions/emoji/js/forum/src/addComposerAutocomplete.js index 1dfbf3fa4..6f5645fc5 100644 --- a/extensions/emoji/js/forum/src/addComposerAutocomplete.js +++ b/extensions/emoji/js/forum/src/addComposerAutocomplete.js @@ -86,20 +86,31 @@ export default function addComposerAutocomplete() { const suggestions = []; let similarEmoji = []; + // Build a regular expression to do a fuzzy match of the given input string const fuzzyRegexp = function(str) { const reEscape = new RegExp('\\(([' + ('+.*?[]{}()^$|\\'.replace(/(.)/g, '\\$1')) + '])\\)', 'g'); return new RegExp('(.*)' + (str.toLowerCase().replace(/(.)/g, '($1)(.*?)')).replace(reEscape, '(\\$1)') + '$', 'i'); }; - const regTyped = fuzzyRegexp(typed); - for (var i=0, maxSuggestions = 7; i < emojiKeys.length && maxSuggestions > 0; i++) { - if(regTyped.test(emojiKeys[i])) { - --maxSuggestions; - similarEmoji.push(emojiKeys[i]); - } - } - similarEmoji = similarEmoji.sort((a,b) => { + let maxSuggestions = 7; + + const findMatchingEmojis = matcher => { + for (let i = 0; i < emojiKeys.length && maxSuggestions > 0; i++) { + if (matcher(emojiKeys[i])) { + --maxSuggestions; + similarEmoji.push(emojiKeys[i]); + } + } + }; + + // First, try to find all emojis starting with the given string + findMatchingEmojis(emoji => emoji.indexOf(typed) === 0); + + // If there are still suggestions left, try for some fuzzy matches + findMatchingEmojis(emoji => regTyped.test(emoji)); + + similarEmoji = similarEmoji.sort((a, b) => { return a.length - b.length }); From a3b92ed02c62a121571b77a4cf7f8d5aaa8f010d Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sat, 14 May 2016 23:24:06 +0900 Subject: [PATCH 037/154] Remove special case handling for certain emojis This does not seem to be necessary anymore after the recent update of the emoji map. --- extensions/emoji/js/forum/dist/extension.js | 2 +- extensions/emoji/js/forum/src/addComposerAutocomplete.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/emoji/js/forum/dist/extension.js b/extensions/emoji/js/forum/dist/extension.js index 668b58785..894344974 100644 --- a/extensions/emoji/js/forum/dist/extension.js +++ b/extensions/emoji/js/forum/dist/extension.js @@ -195,7 +195,7 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru var makeSuggestion = function makeSuggestion(key) { var code = ':' + key + ':'; - var imageName = (emojiMap[key].indexOf('-20e3') != -1 || emojiMap[key] == 'a9' || emojiMap[key] == 'ae' ? '00' : '') + emojiMap[key]; + var imageName = emojiMap[key]; return m( 'button', { diff --git a/extensions/emoji/js/forum/src/addComposerAutocomplete.js b/extensions/emoji/js/forum/src/addComposerAutocomplete.js index 6f5645fc5..fbebd5427 100644 --- a/extensions/emoji/js/forum/src/addComposerAutocomplete.js +++ b/extensions/emoji/js/forum/src/addComposerAutocomplete.js @@ -68,7 +68,7 @@ export default function addComposerAutocomplete() { const makeSuggestion = function(key) { const code = ':' + key + ':'; - const imageName = (emojiMap[key].indexOf('-20e3') != -1 || emojiMap[key] == 'a9' || emojiMap[key] == 'ae' ? '00' : '') + emojiMap[key]; + const imageName = emojiMap[key]; return (