From 100032fa86ae6f06cf3928cd2c4d92a9a899ebb8 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 14 Jan 2019 18:48:43 +0100 Subject: [PATCH] Can show movies --- .../assets/js/main.js | 14 ++++++++++++++ .../assets/js/utils.js | 10 +++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/assets/zip/personnal-data-export-navigator/assets/js/main.js b/assets/zip/personnal-data-export-navigator/assets/js/main.js index ad82a206..55b987d9 100644 --- a/assets/zip/personnal-data-export-navigator/assets/js/main.js +++ b/assets/zip/personnal-data-export-navigator/assets/js/main.js @@ -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, diff --git a/assets/zip/personnal-data-export-navigator/assets/js/utils.js b/assets/zip/personnal-data-export-navigator/assets/js/utils.js index 284bcc81..2910c682 100644 --- a/assets/zip/personnal-data-export-navigator/assets/js/utils.js +++ b/assets/zip/personnal-data-export-navigator/assets/js/utils.js @@ -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"; }