From 71a1a1b9d12120fadd9c7c66922f904da6547a36 Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 26 Jun 2017 10:56:12 +0200 Subject: [PATCH] Smiley are parsed in conversation element --- assets/css/components/conversations/windows.css | 4 ++++ assets/js/components/conversations/chatWindows.js | 8 +++++++- assets/js/components/emoji/parser.js | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/assets/css/components/conversations/windows.css b/assets/css/components/conversations/windows.css index 3ab1307a..28bf7184 100644 --- a/assets/css/components/conversations/windows.css +++ b/assets/css/components/conversations/windows.css @@ -69,4 +69,8 @@ */ #conversationsElem .conversation-msg-image { height: 50px; +} + +#conversationsElem .direct-chat-text .emoji { + height: 1em; } \ No newline at end of file diff --git a/assets/js/components/conversations/chatWindows.js b/assets/js/components/conversations/chatWindows.js index 39bf8b81..5d861d19 100644 --- a/assets/js/components/conversations/chatWindows.js +++ b/assets/js/components/conversations/chatWindows.js @@ -141,6 +141,7 @@ ComunicWeb.components.conversations.chatWindows = { class: "form-control", placeholder: "New message...", }); + inputText.maxLength = 200; //Enable textarea 2.0 on the message var textarea2 = new ComunicWeb.components.textarea(); @@ -747,7 +748,7 @@ ComunicWeb.components.conversations.chatWindows = { }); //Add text message - createElem2({ + var textMessage = createElem2({ appendTo: messageTargetElem, type: "span", innerHTML: messageInfos.message, @@ -774,6 +775,11 @@ ComunicWeb.components.conversations.chatWindows = { userAccountImage.src = userInfos.accountImage; } + //Parse emojies in text message + ComunicWeb.components.emoji.parser.parse({ + element: textMessage, + }); + //Enable (again) slimscrool $(convInfos.box.messagesArea).slimscroll({ height: "250px", diff --git a/assets/js/components/emoji/parser.js b/assets/js/components/emoji/parser.js index 0d280fdd..5a7fdf1e 100644 --- a/assets/js/components/emoji/parser.js +++ b/assets/js/components/emoji/parser.js @@ -18,7 +18,7 @@ ComunicWeb.components.emoji.parser = { * Parse emojies * * @param {Object} infos Informations about the area to parse - * @info {HTMLElement} element The element to parser + * @info {HTMLElement} element The element to parse * @return {Boolean} True for a success */ parse: function(infos){