mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Update all conversation messages screen
This commit is contained in:
		@@ -178,8 +178,8 @@
 | 
				
			|||||||
					<tr>
 | 
										<tr>
 | 
				
			||||||
						<th>Number</th>
 | 
											<th>Number</th>
 | 
				
			||||||
						<th>Date</th>
 | 
											<th>Date</th>
 | 
				
			||||||
 | 
											<th>File (if any)</th>
 | 
				
			||||||
						<th>Message</th>
 | 
											<th>Message</th>
 | 
				
			||||||
						<th>Image</th>
 | 
					 | 
				
			||||||
					</tr>
 | 
										</tr>
 | 
				
			||||||
				</thead>
 | 
									</thead>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,22 +17,39 @@ function ApplyAllConversationMessages(){
 | 
				
			|||||||
            appendTo: target,
 | 
					            appendTo: target,
 | 
				
			||||||
            type: "tr",
 | 
					            type: "tr",
 | 
				
			||||||
            innerHTML:
 | 
					            innerHTML:
 | 
				
			||||||
                "<td>" + message.ID + "</td>" +
 | 
					                "<td>" + message.id + "</td>" +
 | 
				
			||||||
                "<td>" + timeToStr(message.time_insert) + "</td>" +
 | 
					                "<td>" + timeToStr(message.time_sent) + "</td>" +
 | 
				
			||||||
                "<td>" + message.message + "</td>" 
 | 
					                "<td class='file-cell'></td>" 
 | 
				
			||||||
 | 
					                 
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Add conversation image (if any)
 | 
					        //Add conversation image (if any)
 | 
				
			||||||
        if(message.image_path != null){
 | 
					        if(message.file != null){
 | 
				
			||||||
            let imageElem = createElem2({
 | 
					            let cell = messageEl.querySelector(".file-cell");
 | 
				
			||||||
                appendTo: messageEl,
 | 
					 | 
				
			||||||
                type: "img",
 | 
					 | 
				
			||||||
                class: "conversation-img"
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            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 = 
 | 
					                    messageFileContainer.innerHTML = 
 | 
				
			||||||
 | 
					                        "Name: " + message.file.name +
 | 
				
			||||||
                        "Size: "+ fileSizeToHuman(message.file.size) + "<br />" +
 | 
					                        "Size: "+ fileSizeToHuman(message.file.size) + "<br />" +
 | 
				
			||||||
                        "Type: " + message.file.type + "<br />" +
 | 
					                        "Type: " + message.file.type + "<br />" +
 | 
				
			||||||
                        "URL: <a target='_blank' href='" + getFilePathFromURL(message.file.url) + "'>"+message.file.url+"</a><br />";
 | 
					                        "URL: <a target='_blank' href='" + getFilePathFromURL(message.file.url) + "'>"+message.file.url+"</a><br />";
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user