Add user scalable query parameter (#74)

This commit is contained in:
Jeremy Zhang 2018-02-02 08:49:48 +00:00
parent 61a6d9ff69
commit 8b4877cc4b
3 changed files with 23 additions and 1 deletions

View File

@ -85,7 +85,8 @@ def guild_embed(guild_id):
recaptcha_site_key=config["recaptcha-site-key"], recaptcha_site_key=config["recaptcha-site-key"],
css=customcss, css=customcss,
cssvariables=parse_css_variable(customcss), cssvariables=parse_css_variable(customcss),
same_target=request.args.get("sametarget", False) == "true" same_target=request.args.get("sametarget", False) == "true",
userscalable=request.args.get("userscalable", "True").lower().startswith("t")
) )
abort(404) abort(404)

View File

@ -72,6 +72,22 @@ QUERY_PARAMETERS = [
"description": "Prefills the guest username field with the given username.", "description": "Prefills the guest username field with the given username.",
"example": "Rainbow%20Dash", "example": "Rainbow%20Dash",
}, },
{
"name": "userscalable",
"type": "boolean",
"description": "Enables pinch-to-zoom and auto zoom on input fields for most mobile browsers on touch-enabled devices. Disabling this will give your embed a more app-like experience. Keep in mind that disabling this might prevent accessibility features disabled people rely on from functioning.",
"example": "false",
"options": [
{
"name": "true",
"default": True,
},
{
"name": "false",
"default": False,
},
],
},
] ]
LANGUAGES = [ LANGUAGES = [

View File

@ -18,6 +18,11 @@
<!--Let browser know website is optimized for mobile--> <!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
{% if not userscalable %}
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="HandheldFriendly" content="true" />
{% endif %}
{% include 'seo_meta.html.j2' %} {% include 'seo_meta.html.j2' %}
<!--Provide default mobile metadata--> <!--Provide default mobile metadata-->