From b1186fecfe1cbdce9e338257c9876f2db9bd1261 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Mon, 13 Nov 2017 22:01:34 +0000 Subject: [PATCH] Add sametarget query parameter to not have discord login open in new tab --- webapp/titanembeds/blueprints/embed/embed.py | 3 ++- .../titanembeds/templates/card_queryparams.html.j2 | 12 ++++++++++++ webapp/titanembeds/templates/embed.html.j2 | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/webapp/titanembeds/blueprints/embed/embed.py b/webapp/titanembeds/blueprints/embed/embed.py index ed86b83..3ea16cd 100644 --- a/webapp/titanembeds/blueprints/embed/embed.py +++ b/webapp/titanembeds/blueprints/embed/embed.py @@ -74,7 +74,8 @@ def guild_embed(guild_id): client_id=config['client-id'], recaptcha_site_key=config["recaptcha-site-key"], css=customcss, - cssvariables=parse_css_variable(customcss) + cssvariables=parse_css_variable(customcss), + same_target=request.args.get("sametarget", False) == "true" ) abort(404) diff --git a/webapp/titanembeds/templates/card_queryparams.html.j2 b/webapp/titanembeds/templates/card_queryparams.html.j2 index b4b9d19..80b76cb 100644 --- a/webapp/titanembeds/templates/card_queryparams.html.j2 +++ b/webapp/titanembeds/templates/card_queryparams.html.j2 @@ -30,6 +30,18 @@
Eg: noscroll=true +
  • + sametarget=<boolean>
    + For those who don't want the Discord Login to open in a new tab/window... (Does not work for iframe loaded embeds!!! This is a direct link option only.) +
    + Avaliable Options: + +
    + Eg: sametarget=true +
  • theme=<string>
    Want your embed to use one of our premade themes? Look no further!
    diff --git a/webapp/titanembeds/templates/embed.html.j2 b/webapp/titanembeds/templates/embed.html.j2 index 62b4a88..6a24778 100644 --- a/webapp/titanembeds/templates/embed.html.j2 +++ b/webapp/titanembeds/templates/embed.html.j2 @@ -102,7 +102,7 @@
    - Discord Login + Discord Login

    *You will be invited into this server.

    {% if unauth_enabled %}