mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Can show movies
This commit is contained in:
		@@ -242,6 +242,20 @@ function ApplyPosts(){
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		//Post with movie
 | 
			
		||||
		if(post.kind == "movie"){
 | 
			
		||||
 | 
			
		||||
			//Display the movie only (movies have a dedicated tab)
 | 
			
		||||
			createElem2({
 | 
			
		||||
				appendTo: cardContent,
 | 
			
		||||
				type: "a",
 | 
			
		||||
				href: getFilePathFromURL(post.video_info.url),
 | 
			
		||||
				innerHTML: "Open movie"
 | 
			
		||||
			});
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		//Display the list of comments
 | 
			
		||||
		let postComments = createElem2({
 | 
			
		||||
			appendTo: cardContent,
 | 
			
		||||
 
 | 
			
		||||
@@ -143,12 +143,12 @@ function error(message){
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get the path to an image
 | 
			
		||||
 * Get the path to a file originally hosted on user data server
 | 
			
		||||
 *
 | 
			
		||||
 * @param {String} url The original URL of the image
 | 
			
		||||
 * @return {String} Locally accessible path to the image
 | 
			
		||||
 * @param {String} url The original URL of the file
 | 
			
		||||
 * @return {String} Locally accessible path to the file
 | 
			
		||||
 */
 | 
			
		||||
function getImagePath(url){
 | 
			
		||||
function getFilePathFromURL(url){
 | 
			
		||||
	return STORAGE_URL + url.replace("://", "/");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -173,7 +173,7 @@ function timeToStr(time){
 | 
			
		||||
 * @param {String} url The original URL of the image
 | 
			
		||||
 */
 | 
			
		||||
function applyURLToImage(el, url){
 | 
			
		||||
	el.src = getImagePath(url);
 | 
			
		||||
	el.src = getFilePathFromURL(url);
 | 
			
		||||
	el.className += " responsive-img";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user