Update button href dynamically

also make button a link 'cos buttons can't have hrefs
pull/10831/head
David Baker 2019-09-10 18:27:57 +01:00
parent ae18186290
commit 3c62829525
2 changed files with 5 additions and 1 deletions

View File

@ -32,6 +32,7 @@ body {
cursor: pointer;
padding: 12px 22px;
word-break: break-word;
text-decoration: none;
}
.mx_Center {
@ -360,7 +361,7 @@ body {
<div class="mx_HomePage_row">
<div>
<h2>2: Configure your app</h2>
<button class="mx_Button" id="configure_riot_button" href="#">Configure</button>
<a class="mx_Button" id="configure_riot_button" href="#">Configure</a>
<p class="mx_Subtext">Tap the button above, or manually enable <em>Use custom server</em> and enter:</p>
<p class="mx_Subtext">Homeserver: <em id="hs_url"></em></p>
<p class="mx_Subtext" id="default_is">Identity Server: <em>https://vector.im</em> (default)</p>

View File

@ -92,6 +92,9 @@ async function initPage() {
if (isUrl && !isUrl.endsWith('/')) isUrl += '/';
if (hsUrl !== 'https://matrix.org/') {
document.getElementById('configure_riot_button').href =
"https://riot.im/config/config?hs_url=" + encodeURIComponent(hsUrl) +
"&is_url=" + encodeURIComponent(isUrl);
document.getElementById('step2_container').style.display = 'block';
document.getElementById('hs_url').innerText = hsUrl;
document.getElementById('step_login_header').innerHTML= '3: Launch the app';