Notice to vote on DBL

This commit is contained in:
Jeremy Zhang 2018-02-22 11:43:35 +00:00
parent bb4bf70fb1
commit d368fdf686
3 changed files with 35 additions and 0 deletions

View File

@ -462,15 +462,39 @@
prepare_guild(data);
$('#loginmodal').modal('close');
unlock_login_fields();
setTimeout(displayDblAdvert, 1500);
});
} else {
switch_to_default_channel(guildobj.channels);
prepare_guild(guildobj);
$('#loginmodal').modal('close');
unlock_login_fields();
setTimeout(displayDblAdvert, 1500);
}
}
function displayDblAdvert() {
var hideDbl = localStorage.getItem("hideDiscordBotsOrgVoteAd") == "true";
if (hideDbl) {
return;
}
var dblAdContents = "<i class=\"material-icons right\">close</i></span><span id=\"dblBalloon\"><h6>Loving the Titan, the Discord server widget?</h6><br>Show your appreciation <strong>by voting for Titan</strong> on <a href=\"https://discordbots.org/bot/Titan/vote\" target=\"_blank\">Discord Bot List</a> and get a <span class=\"yellow-text\">golden</span> name!";
$(".brand-logo").showBalloon({
html: true,
position: "bottom",
contents: dblAdContents,
classname: "dblballoon",
showComplete: function () {
$(".dblballoon").css("top", $(".brand-logo").outerHeight() + "px").css("position", "fixed");
$(".dblballoon").find("i").click(function (event) {
event.preventDefault();
$(".brand-logo").hideBalloon();
localStorage.setItem("hideDiscordBotsOrgVoteAd", "true");
}).css("cursor", "pointer");
}
});
}
function switch_to_default_channel(guildchannels) {
var defaultChannel = getParameterByName("defaultchannel");
if (!defaultChannel) {

File diff suppressed because one or more lines are too long

View File

@ -294,6 +294,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.3/es6-shim.min.js" integrity="sha256-THlgZSjqt7idNSdnUvGypTuXB5C4hV9kSuPYrbiq19o=" crossorigin="anonymous"></script>
<script src="{{ url_for("static", filename="js/vendor/highlight.pack.js") }}"></script>
<script src="{{ url_for("static", filename="js/vendor/jquery.balloon.min.js") }}"></script>
{% raw %}
<script id="mustache_channellistings" type="text/template">