diff --git a/app/assets/javascripts/components/emoji.jsx b/app/assets/javascripts/components/emoji.jsx index c93c07c74..eee657b86 100644 --- a/app/assets/javascripts/components/emoji.jsx +++ b/app/assets/javascripts/components/emoji.jsx @@ -1,9 +1,35 @@ import emojione from 'emojione'; -emojione.imageType = 'png'; -emojione.sprites = false; -emojione.imagePathPNG = '/emoji/'; +const toImage = str => shortnameToImage(unicodeToImage(str)); + +const unicodeToImage = str => { + const mappedUnicode = emojione.mapUnicodeToShort(); + + return str.replace(emojione.regUnicode, unicodeChar => { + if (typeof unicodeChar === 'undefined' || unicodeChar === '' || !(unicodeChar in emojione.jsEscapeMap)) { + return unicodeChar; + } + + const unicode = emojione.jsEscapeMap[unicodeChar]; + const short = mappedUnicode[unicode]; + const filename = emojione.emojioneList[short].fname; + const alt = emojione.convert(unicode.toUpperCase()); + + return `${alt}`; + }); +}; + +const shortnameToImage = str => str.replace(emojione.regShortNames, shortname => { + if (typeof shortname === 'undefined' || shortname === '' || !(shortname in emojione.emojioneList)) { + return shortname; + } + + const unicode = emojione.emojioneList[shortname].unicode[emojione.emojioneList[shortname].unicode.length - 1]; + const alt = emojione.convert(unicode.toUpperCase()); + + return `${alt}`; +}); export default function emojify(text) { - return emojione.toImage(text); + return toImage(text); }; diff --git a/app/assets/javascripts/components/features/compose/components/emoji_picker_dropdown.jsx b/app/assets/javascripts/components/features/compose/components/emoji_picker_dropdown.jsx index 471f0e1bb..1920b29bf 100644 --- a/app/assets/javascripts/components/features/compose/components/emoji_picker_dropdown.jsx +++ b/app/assets/javascripts/components/features/compose/components/emoji_picker_dropdown.jsx @@ -43,7 +43,7 @@ const EmojiPickerDropdown = React.createClass({ return ( - 🙂 + 🙂 diff --git a/app/assets/javascripts/components/features/getting_started/index.jsx b/app/assets/javascripts/components/features/getting_started/index.jsx index 846e4f53b..6f9e988ba 100644 --- a/app/assets/javascripts/components/features/getting_started/index.jsx +++ b/app/assets/javascripts/components/features/getting_started/index.jsx @@ -41,7 +41,7 @@ const GettingStarted = ({ intl, me }) => { -
+

diff --git a/app/assets/stylesheets/components.scss b/app/assets/stylesheets/components.scss index 45f93ef90..04d37546c 100644 --- a/app/assets/stylesheets/components.scss +++ b/app/assets/stylesheets/components.scss @@ -771,6 +771,7 @@ a.status__content__spoiler-link { padding: 0; display: flex; flex-direction: column; + overflow: hidden; overflow-y: auto; flex-grow: 1; } diff --git a/package.json b/package.json index 35ce56ee5..14c8abe79 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "chai-enzyme": "^0.6.1", "css-loader": "^0.26.2", "dotenv": "^4.0.0", - "emojione": "latest", + "emojione": "^2.2.7", "emojione-picker": "^2.0.1", "enzyme": "^2.7.1", "es6-promise": "^3.2.1", diff --git a/public/emoji/0023-20e3.svg b/public/emoji/0023-20e3.svg new file mode 100644 index 000000000..a29d90113 --- /dev/null +++ b/public/emoji/0023-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/0023.svg b/public/emoji/0023.svg new file mode 100644 index 000000000..76c606dd0 --- /dev/null +++ b/public/emoji/0023.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/002a-20e3.svg b/public/emoji/002a-20e3.svg new file mode 100644 index 000000000..bc3b2e6eb --- /dev/null +++ b/public/emoji/002a-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/002a.svg b/public/emoji/002a.svg new file mode 100644 index 000000000..258414904 --- /dev/null +++ b/public/emoji/002a.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/0030-20e3.svg b/public/emoji/0030-20e3.svg new file mode 100644 index 000000000..57dc88909 --- /dev/null +++ b/public/emoji/0030-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/0030.svg b/public/emoji/0030.svg new file mode 100644 index 000000000..8ea076ce9 --- /dev/null +++ b/public/emoji/0030.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/0031-20e3.svg b/public/emoji/0031-20e3.svg new file mode 100644 index 000000000..e18178a17 --- /dev/null +++ b/public/emoji/0031-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/0031.svg b/public/emoji/0031.svg new file mode 100644 index 000000000..c0ca63e68 --- /dev/null +++ b/public/emoji/0031.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/0032-20e3.svg b/public/emoji/0032-20e3.svg new file mode 100644 index 000000000..c2eb5bd50 --- /dev/null +++ b/public/emoji/0032-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/0032.svg b/public/emoji/0032.svg new file mode 100644 index 000000000..abd01370a --- /dev/null +++ b/public/emoji/0032.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/0033-20e3.svg b/public/emoji/0033-20e3.svg new file mode 100644 index 000000000..295276013 --- /dev/null +++ b/public/emoji/0033-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/0033.svg b/public/emoji/0033.svg new file mode 100644 index 000000000..3136230ff --- /dev/null +++ b/public/emoji/0033.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/0034-20e3.svg b/public/emoji/0034-20e3.svg new file mode 100644 index 000000000..f530a7542 --- /dev/null +++ b/public/emoji/0034-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/0034.svg b/public/emoji/0034.svg new file mode 100644 index 000000000..1722ee958 --- /dev/null +++ b/public/emoji/0034.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/0035-20e3.svg b/public/emoji/0035-20e3.svg new file mode 100644 index 000000000..dc4e1d81a --- /dev/null +++ b/public/emoji/0035-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/0035.svg b/public/emoji/0035.svg new file mode 100644 index 000000000..3e7717f08 --- /dev/null +++ b/public/emoji/0035.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/0036-20e3.svg b/public/emoji/0036-20e3.svg new file mode 100644 index 000000000..9ce3a594f --- /dev/null +++ b/public/emoji/0036-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/0036.svg b/public/emoji/0036.svg new file mode 100644 index 000000000..2ff6d9390 --- /dev/null +++ b/public/emoji/0036.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/0037-20e3.svg b/public/emoji/0037-20e3.svg new file mode 100644 index 000000000..1f01b9db8 --- /dev/null +++ b/public/emoji/0037-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/0037.svg b/public/emoji/0037.svg new file mode 100644 index 000000000..6079e4930 --- /dev/null +++ b/public/emoji/0037.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/0038-20e3.svg b/public/emoji/0038-20e3.svg new file mode 100644 index 000000000..b6ed90a32 --- /dev/null +++ b/public/emoji/0038-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/0038.svg b/public/emoji/0038.svg new file mode 100644 index 000000000..014bf2631 --- /dev/null +++ b/public/emoji/0038.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/0039-20e3.svg b/public/emoji/0039-20e3.svg new file mode 100644 index 000000000..c88341970 --- /dev/null +++ b/public/emoji/0039-20e3.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/0039.svg b/public/emoji/0039.svg new file mode 100644 index 000000000..afda6d7b6 --- /dev/null +++ b/public/emoji/0039.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/00a9.svg b/public/emoji/00a9.svg new file mode 100644 index 000000000..68a770227 --- /dev/null +++ b/public/emoji/00a9.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/00ae.svg b/public/emoji/00ae.svg new file mode 100644 index 000000000..8b084f6bf --- /dev/null +++ b/public/emoji/00ae.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f004.svg b/public/emoji/1f004.svg new file mode 100644 index 000000000..45867fb5a --- /dev/null +++ b/public/emoji/1f004.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f0cf.svg b/public/emoji/1f0cf.svg new file mode 100644 index 000000000..45ae8abcc --- /dev/null +++ b/public/emoji/1f0cf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f170.svg b/public/emoji/1f170.svg new file mode 100644 index 000000000..a2ed41f33 --- /dev/null +++ b/public/emoji/1f170.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f171.svg b/public/emoji/1f171.svg new file mode 100644 index 000000000..d0f8e6494 --- /dev/null +++ b/public/emoji/1f171.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f17e.svg b/public/emoji/1f17e.svg new file mode 100644 index 000000000..8844efa53 --- /dev/null +++ b/public/emoji/1f17e.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f17f.svg b/public/emoji/1f17f.svg new file mode 100644 index 000000000..5d8564444 --- /dev/null +++ b/public/emoji/1f17f.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f18e.svg b/public/emoji/1f18e.svg new file mode 100644 index 000000000..6c5e8866f --- /dev/null +++ b/public/emoji/1f18e.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f191.svg b/public/emoji/1f191.svg new file mode 100644 index 000000000..ef2cbf896 --- /dev/null +++ b/public/emoji/1f191.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f192.svg b/public/emoji/1f192.svg new file mode 100644 index 000000000..4bcdb3b91 --- /dev/null +++ b/public/emoji/1f192.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f193.svg b/public/emoji/1f193.svg new file mode 100644 index 000000000..d26b8c27c --- /dev/null +++ b/public/emoji/1f193.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f194.svg b/public/emoji/1f194.svg new file mode 100644 index 000000000..0c36d517b --- /dev/null +++ b/public/emoji/1f194.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f195.svg b/public/emoji/1f195.svg new file mode 100644 index 000000000..ad6466f5e --- /dev/null +++ b/public/emoji/1f195.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f196.svg b/public/emoji/1f196.svg new file mode 100644 index 000000000..fe38c95a4 --- /dev/null +++ b/public/emoji/1f196.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f197.svg b/public/emoji/1f197.svg new file mode 100644 index 000000000..c45e4e1c9 --- /dev/null +++ b/public/emoji/1f197.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f198.svg b/public/emoji/1f198.svg new file mode 100644 index 000000000..fef773a90 --- /dev/null +++ b/public/emoji/1f198.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f199.svg b/public/emoji/1f199.svg new file mode 100644 index 000000000..f5bc638ac --- /dev/null +++ b/public/emoji/1f199.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f19a.svg b/public/emoji/1f19a.svg new file mode 100644 index 000000000..6d2545d60 --- /dev/null +++ b/public/emoji/1f19a.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1e8.svg b/public/emoji/1f1e6-1f1e8.svg new file mode 100644 index 000000000..23d700999 --- /dev/null +++ b/public/emoji/1f1e6-1f1e8.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1e9.svg b/public/emoji/1f1e6-1f1e9.svg new file mode 100644 index 000000000..0340b9d6d --- /dev/null +++ b/public/emoji/1f1e6-1f1e9.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1ea.svg b/public/emoji/1f1e6-1f1ea.svg new file mode 100644 index 000000000..6610e894c --- /dev/null +++ b/public/emoji/1f1e6-1f1ea.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1eb.svg b/public/emoji/1f1e6-1f1eb.svg new file mode 100644 index 000000000..e1998a6b2 --- /dev/null +++ b/public/emoji/1f1e6-1f1eb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1ec.svg b/public/emoji/1f1e6-1f1ec.svg new file mode 100644 index 000000000..0bcf4ebdc --- /dev/null +++ b/public/emoji/1f1e6-1f1ec.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1ee.svg b/public/emoji/1f1e6-1f1ee.svg new file mode 100644 index 000000000..c117d6087 --- /dev/null +++ b/public/emoji/1f1e6-1f1ee.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1f1.svg b/public/emoji/1f1e6-1f1f1.svg new file mode 100644 index 000000000..62c373cb0 --- /dev/null +++ b/public/emoji/1f1e6-1f1f1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1f2.svg b/public/emoji/1f1e6-1f1f2.svg new file mode 100644 index 000000000..619935b02 --- /dev/null +++ b/public/emoji/1f1e6-1f1f2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1f4.svg b/public/emoji/1f1e6-1f1f4.svg new file mode 100644 index 000000000..7440d2d23 --- /dev/null +++ b/public/emoji/1f1e6-1f1f4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1f6.svg b/public/emoji/1f1e6-1f1f6.svg new file mode 100644 index 000000000..476eac881 --- /dev/null +++ b/public/emoji/1f1e6-1f1f6.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1f7.svg b/public/emoji/1f1e6-1f1f7.svg new file mode 100644 index 000000000..040ef76bb --- /dev/null +++ b/public/emoji/1f1e6-1f1f7.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1f8.svg b/public/emoji/1f1e6-1f1f8.svg new file mode 100644 index 000000000..158d0c6f4 --- /dev/null +++ b/public/emoji/1f1e6-1f1f8.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1f9.svg b/public/emoji/1f1e6-1f1f9.svg new file mode 100644 index 000000000..407ac4035 --- /dev/null +++ b/public/emoji/1f1e6-1f1f9.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1fa.svg b/public/emoji/1f1e6-1f1fa.svg new file mode 100644 index 000000000..48ab1dc09 --- /dev/null +++ b/public/emoji/1f1e6-1f1fa.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1fc.svg b/public/emoji/1f1e6-1f1fc.svg new file mode 100644 index 000000000..ab3f2d057 --- /dev/null +++ b/public/emoji/1f1e6-1f1fc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1fd.svg b/public/emoji/1f1e6-1f1fd.svg new file mode 100644 index 000000000..81ab22551 --- /dev/null +++ b/public/emoji/1f1e6-1f1fd.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/emoji/1f1e6-1f1ff.svg b/public/emoji/1f1e6-1f1ff.svg new file mode 100644 index 000000000..4ac419fbc --- /dev/null +++ b/public/emoji/1f1e6-1f1ff.svg @@ -0,0 +1 @@ +