mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 20:19:21 +00:00
Added all conversation messages
This commit is contained in:
parent
f9c1f37ac6
commit
4d775494c0
@ -196,8 +196,28 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Entire list of conversation messages -->
|
||||||
<div id="all-conversations-message" class="category container">
|
<div id="all-conversations-message" class="category container">
|
||||||
Loading all conversation messages
|
|
||||||
|
<h1>All your conversation messages</h1>
|
||||||
|
|
||||||
|
<table id="all-conversation-messages-table">
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Number</th>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Message</th>
|
||||||
|
<th>Image</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<!-- Conversation messages will go here -->
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="conversations" class="category container">
|
<div id="conversations" class="category container">
|
||||||
@ -217,6 +237,7 @@
|
|||||||
<script src="assets/js/categories/likes.js"></script>
|
<script src="assets/js/categories/likes.js"></script>
|
||||||
<script src="assets/js/categories/survey.js"></script>
|
<script src="assets/js/categories/survey.js"></script>
|
||||||
<script src="assets/js/categories/movies.js"></script>
|
<script src="assets/js/categories/movies.js"></script>
|
||||||
|
<script src="assets/js/categories/allConversationMessages.js"></script>
|
||||||
<script src="assets/js/main.js"></script>
|
<script src="assets/js/main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -99,4 +99,13 @@ h1 {
|
|||||||
#all-comments-table .comment-img {
|
#all-comments-table .comment-img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 350px;
|
max-width: 350px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All conversation messages rules
|
||||||
|
*/
|
||||||
|
#all-conversation-messages-table .conversation-img {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 300px;
|
||||||
}
|
}
|
@ -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:
|
||||||
|
"<td>" + message.ID + "</td>" +
|
||||||
|
"<td>" + timeToStr(message.time_insert) + "</td>" +
|
||||||
|
"<td>" + message.message + "</td>"
|
||||||
|
});
|
||||||
|
|
||||||
|
//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);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
@ -80,6 +80,7 @@ xhr.onload = function(){
|
|||||||
ApplyUserLikes();
|
ApplyUserLikes();
|
||||||
ApplySurveyResponses();
|
ApplySurveyResponses();
|
||||||
ApplyMovies();
|
ApplyMovies();
|
||||||
|
ApplyAllConversationMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
xhr.send(null);
|
xhr.send(null);
|
Loading…
Reference in New Issue
Block a user