mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-24 18:08:50 +00:00
Update all conversation messages screen
This commit is contained in:
parent
349b66939c
commit
30353c5277
@ -178,8 +178,8 @@
|
||||
<tr>
|
||||
<th>Number</th>
|
||||
<th>Date</th>
|
||||
<th>File (if any)</th>
|
||||
<th>Message</th>
|
||||
<th>Image</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
@ -17,22 +17,39 @@ function ApplyAllConversationMessages(){
|
||||
appendTo: target,
|
||||
type: "tr",
|
||||
innerHTML:
|
||||
"<td>" + message.ID + "</td>" +
|
||||
"<td>" + timeToStr(message.time_insert) + "</td>" +
|
||||
"<td>" + message.message + "</td>"
|
||||
"<td>" + message.id + "</td>" +
|
||||
"<td>" + timeToStr(message.time_sent) + "</td>" +
|
||||
"<td class='file-cell'></td>"
|
||||
|
||||
});
|
||||
|
||||
//Add conversation image (if any)
|
||||
if(message.image_path != null){
|
||||
let imageElem = createElem2({
|
||||
appendTo: messageEl,
|
||||
type: "img",
|
||||
class: "conversation-img"
|
||||
});
|
||||
if(message.file != null){
|
||||
let cell = messageEl.querySelector(".file-cell");
|
||||
|
||||
applyURLToImage(imageElem, message.image_path);
|
||||
if (message.file.type.startsWith("image/")) {
|
||||
let imageElem = createElem2({
|
||||
appendTo: cell,
|
||||
type: "img",
|
||||
class: "conversation-img"
|
||||
});
|
||||
|
||||
applyURLToImage(imageElem, message.file.url);
|
||||
}
|
||||
|
||||
else {
|
||||
let link = createElem2({
|
||||
appendTo: cell,
|
||||
type: "a",
|
||||
href: getFilePathFromURL(message.file.url),
|
||||
innerHTML: message.file.url
|
||||
})
|
||||
link.target = "_blank"
|
||||
}
|
||||
}
|
||||
|
||||
if (message.message)
|
||||
messageEl.innerHTML += "<td>" + message.message + "</td>";
|
||||
});
|
||||
|
||||
}
|
@ -186,6 +186,7 @@ function ApplyConversations(){
|
||||
});
|
||||
|
||||
messageFileContainer.innerHTML =
|
||||
"Name: " + message.file.name +
|
||||
"Size: "+ fileSizeToHuman(message.file.size) + "<br />" +
|
||||
"Type: " + message.file.type + "<br />" +
|
||||
"URL: <a target='_blank' href='" + getFilePathFromURL(message.file.url) + "'>"+message.file.url+"</a><br />";
|
||||
|
Loading…
Reference in New Issue
Block a user