Can show movies

This commit is contained in:
Pierre HUBERT 2019-01-14 18:48:43 +01:00
parent 3da2455945
commit 100032fa86
2 changed files with 19 additions and 5 deletions

View File

@ -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 //Display the list of comments
let postComments = createElem2({ let postComments = createElem2({
appendTo: cardContent, appendTo: cardContent,

View File

@ -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 * @param {String} url The original URL of the file
* @return {String} Locally accessible path to the image * @return {String} Locally accessible path to the file
*/ */
function getImagePath(url){ function getFilePathFromURL(url){
return STORAGE_URL + url.replace("://", "/"); return STORAGE_URL + url.replace("://", "/");
} }
@ -173,7 +173,7 @@ function timeToStr(time){
* @param {String} url The original URL of the image * @param {String} url The original URL of the image
*/ */
function applyURLToImage(el, url){ function applyURLToImage(el, url){
el.src = getImagePath(url); el.src = getFilePathFromURL(url);
el.className += " responsive-img"; el.className += " responsive-img";
} }