From 482cc114015c15077552931854065776fedcc719 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 3 Mar 2018 14:52:52 +0100 Subject: [PATCH] Display emojies in posts and comments --- assets/css/components/comments/ui.css | 6 ++++++ assets/js/components/comments/ui.js | 6 ++++++ assets/js/components/posts/ui.js | 5 ++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/assets/css/components/comments/ui.css b/assets/css/components/comments/ui.css index 2b978a2b..3d9ade23 100644 --- a/assets/css/components/comments/ui.css +++ b/assets/css/components/comments/ui.css @@ -27,4 +27,10 @@ .post-comments .delete-comment-link:active, .post-comments .edit-comment-link:active { color: black; +} + +.post-comments .comment-content .emoji { + float: none; + height: 1em !important; + width: auto !important; } \ No newline at end of file diff --git a/assets/js/components/comments/ui.js b/assets/js/components/comments/ui.js index 9755d5e1..d1bf3211 100644 --- a/assets/js/components/comments/ui.js +++ b/assets/js/components/comments/ui.js @@ -225,9 +225,15 @@ ComunicWeb.components.comments.ui = { var commentContent = createElem2({ appendTo: commentText, type: "div", + class: "comment-content", innerHTML: infos.content }); + //Parse emojies + ComunicWeb.components.emoji.parser.parse({ + element: commentContent + }); + //Add comment image (if any) if(infos.img_url != null){ diff --git a/assets/js/components/posts/ui.js b/assets/js/components/posts/ui.js index d46036d0..61d77f2f 100644 --- a/assets/js/components/posts/ui.js +++ b/assets/js/components/posts/ui.js @@ -720,7 +720,10 @@ ComunicWeb.components.posts.ui = { innerHTML: infos.content }); - + //Parse emojies + ComunicWeb.components.emoji.parser.parse({ + element: postContent + }); //Add bottom elements container var bottomArea = createElem2({