From 4c92f3398d2055a7f343ac7ae28991a3c51d0d44 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 4 May 2020 20:43:49 +0200 Subject: [PATCH] Manon's special easter egg --- assets/js/components/posts/ui.js | 34 ++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/assets/js/components/posts/ui.js b/assets/js/components/posts/ui.js index c542f00a..6c8c0bf4 100644 --- a/assets/js/components/posts/ui.js +++ b/assets/js/components/posts/ui.js @@ -572,9 +572,39 @@ ComunicWeb.components.posts.ui = { type: "div", class: "post-countdown" }); + - //Initialize countdown timer - ComunicWeb.components.countdown.init(info.time_end, target); + // Manon's birthday is a sacred day, like the end of the world + // nobody must know when it will happen ! + // + // Psst: it is on May 25, 11h10m00s + // + // => Easter egg + // + const endDate = new Date(info.time_end*1000); + if(endDate.getMonth() == 4 && endDate.getDate() == 25 && endDate.getHours() == 11 && endDate.getMinutes() == 10) { + target.appendChild(ComunicWeb.common.messages.createCalloutElem("Hold up!", "You MAY NOT KNOW when this countdown will end!", "danger")); + + createElem2({ + appendTo: target, + type: "p", + innerHTML: "Ends in ∞ days ∞ hours ∞ minutes ∞ seconds" + }) + + createElem2({ + appendTo: target, + type: "p", + innerHTML: "This is not a common behavior of the Countdown timer. If you want this message to disappear, just create a new post with another end date..." + }) + + add_p(target); + add_p(target); + } + + + else + //Initialize countdown timer + ComunicWeb.components.countdown.init(info.time_end, target); } //In case of survey