From e1dea40167196405ff4e66a5f823973e8187a9c5 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 14 Jan 2019 19:26:18 +0100 Subject: [PATCH] Display posts with countdown timer. --- .../assets/css/main.css | 4 ++++ .../assets/js/main.js | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/assets/zip/personnal-data-export-navigator/assets/css/main.css b/assets/zip/personnal-data-export-navigator/assets/css/main.css index bcabccab..0195ca32 100644 --- a/assets/zip/personnal-data-export-navigator/assets/css/main.css +++ b/assets/zip/personnal-data-export-navigator/assets/css/main.css @@ -86,4 +86,8 @@ h1 { display: block; width: 100%; max-width: 150px; +} + +.post .post-end-countdown { + text-align: center; } \ No newline at end of file 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 d9959760..58753f99 100644 --- a/assets/zip/personnal-data-export-navigator/assets/js/main.js +++ b/assets/zip/personnal-data-export-navigator/assets/js/main.js @@ -322,6 +322,19 @@ function ApplyPosts(){ } + //Post with countdown timer + if(post.kind == "countdown"){ + + createElem2({ + appendTo: cardContent, + type: "p", + class: "post-end-countdown", + innerHTML: "Countdown terminates on: " + timeToStr(post.time_end) + }); + + } + + //Display the list of comments let postComments = createElem2({