Update query parameters form to include iframe

This commit is contained in:
Jeremy Zhang 2018-04-26 03:19:40 +00:00
parent 0be77e0a50
commit d7590a2915
4 changed files with 10 additions and 3 deletions

View File

@ -8,7 +8,7 @@ QUERY_PARAMETERS = [
{ {
"name": "defaultchannel", "name": "defaultchannel",
"type": "snowflake", "type": "snowflake",
"description": "Instead of having the top channel as the first channel your users see, you may change it. Enable Discord's Developer mode in the Appearances tab of the User Settings and copy the channel ID.", "description": "Instead of having the top channel as the first channel your users see, you may change it. Enable Discord's Developer mode in the Appearances tab of the User Settings and copy the channel ID. Here is a <a href=\"https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-server-ID-\" target=\"_blank\">tutorial</a> on obtaining the channel ID.",
"example": "1234567890", "example": "1234567890",
}, },
{ {

View File

@ -20,10 +20,12 @@
url += `${name}=${value}`; url += `${name}=${value}`;
} }
$("#queryparam_url").val(url); $("#queryparam_url").val(url);
$("#queryparam_iframe").val("<iframe src=\"" + url + "\" height=\"600\" width=\"800\" frameborder=\"0\"></iframe>");
} }
$(function () { $(function () {
$("input.queryparam").change(updateQueryParameters); $("input.queryparam").change(updateQueryParameters);
$("#queryparam_guildid").change(updateQueryParameters); $("#queryparam_guildid").change(updateQueryParameters);
updateQueryParameters();
}); });
})(); })();

View File

@ -40,6 +40,7 @@
<input readonly value="{{ url_for("embed.guild_embed", guild_id=guild['id'], _external=True) }}" id="disabled" type="text" onClick="this.setSelectionRange(0, this.value.length)"> <input readonly value="{{ url_for("embed.guild_embed", guild_id=guild['id'], _external=True) }}" id="disabled" type="text" onClick="this.setSelectionRange(0, this.value.length)">
<p class="flow-text">iFrame Embed</p> <p class="flow-text">iFrame Embed</p>
<input readonly value="&lt;iframe src=&quot;{{ url_for("embed.guild_embed", guild_id=guild['id'], _external=True) }}&quot; height=&quot;600&quot; width=&quot;800&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;" id="disabled" type="text" onClick="this.setSelectionRange(0, this.value.length)"> <input readonly value="&lt;iframe src=&quot;{{ url_for("embed.guild_embed", guild_id=guild['id'], _external=True) }}&quot; height=&quot;600&quot; width=&quot;800&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;" id="disabled" type="text" onClick="this.setSelectionRange(0, this.value.length)">
<p>For client side customization (such as setting the Default Channel or a Prefilled Guest Username), see Query Parameters section at the bottom of this page.</p>
</div> </div>
</div> </div>
</div> </div>

View File

@ -36,7 +36,7 @@
</div> </div>
{% if "administrate_guild" in request.url %} {% if "administrate_guild" in request.url %}
<div class="col s12 black-text"> <div class="col s12 black-text">
<p class="flow-text">Copy this URL for your iFrame src (or as a direct link) after entering the parameters in the form.</p> <p class="flow-text">Copy these URL/iframe code after entering the parameters in the form.</p>
<ul class="collection"> <ul class="collection">
<li class="collection-item"> <li class="collection-item">
<strong>Embed/Server ID</strong> <strong>Embed/Server ID</strong>
@ -44,7 +44,11 @@
</li> </li>
<li class="collection-item"> <li class="collection-item">
Embed URL after query parameters appled Embed URL after query parameters appled
<input id="queryparam_url" readonly value="{{ url_for("embed.guild_embed", guild_id=guild['id'], _external=True) }}" id="disabled" type="text" onclick="this.setSelectionRange(0, this.value.length)"> <input id="queryparam_url" readonly value="{{ url_for("embed.guild_embed", guild_id=guild['id'], _external=True) }}" type="text" onclick="this.setSelectionRange(0, this.value.length)">
</li>
<li class="collection-item">
Embed iFrame after query parameters appled
<input id="queryparam_iframe" readonly type="text" onclick="this.setSelectionRange(0, this.value.length)">
</li> </li>
</ul> </ul>
</div> </div>