mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 12:09:21 +00:00
Can show movies
This commit is contained in:
parent
3da2455945
commit
100032fa86
@ -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";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user