Update button href dynamically

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

View File

@ -32,6 +32,7 @@ body {
cursor: pointer; cursor: pointer;
padding: 12px 22px; padding: 12px 22px;
word-break: break-word; word-break: break-word;
text-decoration: none;
} }
.mx_Center { .mx_Center {
@ -360,7 +361,7 @@ body {
<div class="mx_HomePage_row"> <div class="mx_HomePage_row">
<div> <div>
<h2>2: Configure your app</h2> <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">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">Homeserver: <em id="hs_url"></em></p>
<p class="mx_Subtext" id="default_is">Identity Server: <em>https://vector.im</em> (default)</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 (isUrl && !isUrl.endsWith('/')) isUrl += '/';
if (hsUrl !== 'https://matrix.org/') { 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('step2_container').style.display = 'block';
document.getElementById('hs_url').innerText = hsUrl; document.getElementById('hs_url').innerText = hsUrl;
document.getElementById('step_login_header').innerHTML= '3: Launch the app'; document.getElementById('step_login_header').innerHTML= '3: Launch the app';