From 4d775494c03dff8db26f0f2e03717f075fd98474 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 15 Jan 2019 07:32:07 +0100 Subject: [PATCH] Added all conversation messages --- .../Export.html | 23 ++++++++++- .../assets/css/main.css | 9 +++++ .../js/categories/allConversationMessages.js | 38 +++++++++++++++++++ .../assets/js/main.js | 1 + 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 assets/zip/personnal-data-export-navigator/assets/js/categories/allConversationMessages.js diff --git a/assets/zip/personnal-data-export-navigator/Export.html b/assets/zip/personnal-data-export-navigator/Export.html index 109e9710..173eefaa 100644 --- a/assets/zip/personnal-data-export-navigator/Export.html +++ b/assets/zip/personnal-data-export-navigator/Export.html @@ -196,8 +196,28 @@ +
- Loading all conversation messages + +

All your conversation messages

+ + + + + + + + + + + + + + + + +
NumberDateMessageImage
+
@@ -217,6 +237,7 @@ + \ No newline at end of file diff --git a/assets/zip/personnal-data-export-navigator/assets/css/main.css b/assets/zip/personnal-data-export-navigator/assets/css/main.css index 7d543387..934ae657 100644 --- a/assets/zip/personnal-data-export-navigator/assets/css/main.css +++ b/assets/zip/personnal-data-export-navigator/assets/css/main.css @@ -99,4 +99,13 @@ h1 { #all-comments-table .comment-img { width: 100%; max-width: 350px; +} + + +/** + * All conversation messages rules + */ +#all-conversation-messages-table .conversation-img { + width: 100%; + max-width: 300px; } \ No newline at end of file diff --git a/assets/zip/personnal-data-export-navigator/assets/js/categories/allConversationMessages.js b/assets/zip/personnal-data-export-navigator/assets/js/categories/allConversationMessages.js new file mode 100644 index 00000000..7d38ff09 --- /dev/null +++ b/assets/zip/personnal-data-export-navigator/assets/js/categories/allConversationMessages.js @@ -0,0 +1,38 @@ +/** + * All conversation messages category + * + * @author Pierre HUBERT + */ + +/** + * Apply the entire list of conversation messages of the user + */ +function ApplyAllConversationMessages(){ + + let target = document.querySelector("#all-conversation-messages-table tbody"); + + data.all_conversation_messages.forEach(message => { + + let messageEl = createElem2({ + appendTo: target, + type: "tr", + innerHTML: + "" + message.ID + "" + + "" + timeToStr(message.time_insert) + "" + + "" + message.message + "" + }); + + //Add conversation image (if any) + if(message.image_path != null){ + let imageElem = createElem2({ + appendTo: messageEl, + type: "img", + class: "conversation-img" + }); + + applyURLToImage(imageElem, message.image_path); + } + + }); + +} \ No newline at end of file diff --git a/assets/zip/personnal-data-export-navigator/assets/js/main.js b/assets/zip/personnal-data-export-navigator/assets/js/main.js index 6f4cbe67..fe9fa3e9 100644 --- a/assets/zip/personnal-data-export-navigator/assets/js/main.js +++ b/assets/zip/personnal-data-export-navigator/assets/js/main.js @@ -80,6 +80,7 @@ xhr.onload = function(){ ApplyUserLikes(); ApplySurveyResponses(); ApplyMovies(); + ApplyAllConversationMessages(); } xhr.send(null); \ No newline at end of file