From 5f160e1b9f16bf4f54a413d8dc578616a0c9c79b Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Mon, 26 Feb 2018 05:12:19 +0000 Subject: [PATCH] Change DBL balloon from dismissing perm to 3 days --- webapp/titanembeds/static/js/embed.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/webapp/titanembeds/static/js/embed.js b/webapp/titanembeds/static/js/embed.js index f83753d..78c567e 100644 --- a/webapp/titanembeds/static/js/embed.js +++ b/webapp/titanembeds/static/js/embed.js @@ -474,11 +474,16 @@ } function displayDblAdvert() { - var hideDbl = localStorage.getItem("hideDiscordBotsOrgVoteAd") == "true"; - if (hideDbl) { - return; + var hideDblUntil = localStorage.getItem("hideDiscordBotsOrgVoteAdUntil"); + var now = moment(); + var hideDblUntilMoment = null; + if (hideDblUntil) { + hideDblUntilMoment = moment(hideDblUntil); + if (hideDblUntilMoment.isValid() && hideDblUntilMoment > now) { + return; + } } - var dblAdContents = "close
Loving the Titan, the Discord server widget?

Show your appreciation by voting for Titan on Discord Bot List and get a golden name!"; + var dblAdContents = "close
Loving the Titan, the Discord server widget?

Show your appreciation by voting for Titan daily on Discord Bot List and get a golden name!"; $(".brand-logo").showBalloon({ html: true, position: "bottom", @@ -489,7 +494,7 @@ $(".dblballoon").find("i").click(function (event) { event.preventDefault(); $(".brand-logo").hideBalloon(); - localStorage.setItem("hideDiscordBotsOrgVoteAd", "true"); + localStorage.setItem("hideDiscordBotsOrgVoteAdUntil", now.add(3, "days").toISOString()); }).css("cursor", "pointer"); } });