From 47c6c64b8ae01117008536b38097e2aec71648af Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 3 Jul 2017 18:37:50 +0200 Subject: [PATCH] Allow emojis in default avatars --- customize.dist/src/less/toolbar.less | 1 + www/common/cryptpad-common.js | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/customize.dist/src/less/toolbar.less b/customize.dist/src/less/toolbar.less index c93cc72af..9f76cec05 100644 --- a/customize.dist/src/less/toolbar.less +++ b/customize.dist/src/less/toolbar.less @@ -142,6 +142,7 @@ body .userlist-drawer { flex: 1; overflow: hidden; text-overflow: ellipsis; + white-space: nowrap; } media-tag { min-height: 50px; diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index b0d6ea424..1cd37e5c9 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1194,6 +1194,27 @@ define([ return button; }; + + var emoji_patt = /([\uD800-\uDBFF][\uDC00-\uDFFF])/; + var isEmoji = function (str) { + return emoji_patt.test(str); + }; + var emojiStringToArray = function (str) { + var split = str.split(emoji_patt); + var arr = []; + for (var i=0; i', {'class': 'default'}).text(text); $container.append($avatar); if (cb) { cb(); }