Adjust auth toggle labels and hide logout when unauthenticated
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
<input id="authPassword" type="password" maxlength="64" autocomplete="current-password" />
|
<input id="authPassword" type="password" maxlength="64" autocomplete="current-password" />
|
||||||
</div>
|
</div>
|
||||||
<p id="authPolicyHintLogin" class="auth-hint"></p>
|
<p id="authPolicyHintLogin" class="auth-hint"></p>
|
||||||
<button id="showRegisterButton" type="button">Create account</button>
|
<button id="showRegisterButton" type="button">Need an account? Register</button>
|
||||||
</section>
|
</section>
|
||||||
<section id="registerView" class="auth-panel hidden">
|
<section id="registerView" class="auth-panel hidden">
|
||||||
<h2>Register</h2>
|
<h2>Register</h2>
|
||||||
@@ -37,11 +37,11 @@
|
|||||||
<input id="registerEmail" type="email" maxlength="320" autocomplete="email" />
|
<input id="registerEmail" type="email" maxlength="320" autocomplete="email" />
|
||||||
</div>
|
</div>
|
||||||
<p id="authPolicyHintRegister" class="auth-hint"></p>
|
<p id="authPolicyHintRegister" class="auth-hint"></p>
|
||||||
<button id="showLoginButton" type="button">Back to login</button>
|
<button id="showLoginButton" type="button">Have an account? Log in</button>
|
||||||
</section>
|
</section>
|
||||||
<div class="controls" id="button-container">
|
<div class="controls" id="button-container">
|
||||||
<button id="connectButton">Connect</button>
|
<button id="connectButton">Connect</button>
|
||||||
<button id="logoutButton">Log out</button>
|
<button id="logoutButton" class="hidden">Log out</button>
|
||||||
<button id="settingsButton">Settings</button>
|
<button id="settingsButton">Settings</button>
|
||||||
<button id="disconnectButton" class="hidden">Disconnect</button>
|
<button id="disconnectButton" class="hidden">Disconnect</button>
|
||||||
<button id="focusGridButton" class="hidden" aria-controls="gameCanvas">Chat Grid</button>
|
<button id="focusGridButton" class="hidden" aria-controls="gameCanvas">Chat Grid</button>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// Maintainer-controlled web client version.
|
// Maintainer-controlled web client version.
|
||||||
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
|
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
|
||||||
window.CHGRID_WEB_VERSION = "2026.02.25 R245";
|
window.CHGRID_WEB_VERSION = "2026.02.25 R246";
|
||||||
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
||||||
window.CHGRID_TIME_ZONE = "America/Detroit";
|
window.CHGRID_TIME_ZONE = "America/Detroit";
|
||||||
|
|||||||
@@ -578,7 +578,10 @@ function loadPersistedAuthPolicy(): void {
|
|||||||
|
|
||||||
/** Enables/disables the connect button based on state and nickname validity. */
|
/** Enables/disables the connect button based on state and nickname validity. */
|
||||||
function updateConnectAvailability(): void {
|
function updateConnectAvailability(): void {
|
||||||
dom.logoutButton.disabled = !authSessionToken.trim() && !state.running;
|
const hasSessionToken = authSessionToken.trim().length > 0;
|
||||||
|
const showLogout = state.running || hasSessionToken;
|
||||||
|
dom.logoutButton.classList.toggle('hidden', !showLogout);
|
||||||
|
dom.logoutButton.disabled = !showLogout;
|
||||||
if (state.running) {
|
if (state.running) {
|
||||||
dom.connectButton.textContent = 'Connect';
|
dom.connectButton.textContent = 'Connect';
|
||||||
dom.connectButton.disabled = true;
|
dom.connectButton.disabled = true;
|
||||||
@@ -588,7 +591,6 @@ function updateConnectAvailability(): void {
|
|||||||
}
|
}
|
||||||
dom.loginView.classList.toggle('hidden', authMode !== 'login');
|
dom.loginView.classList.toggle('hidden', authMode !== 'login');
|
||||||
dom.registerView.classList.toggle('hidden', authMode !== 'register');
|
dom.registerView.classList.toggle('hidden', authMode !== 'register');
|
||||||
const hasSessionToken = authSessionToken.trim().length > 0;
|
|
||||||
const usernameMin = authPolicy?.usernameMinLength ?? 1;
|
const usernameMin = authPolicy?.usernameMinLength ?? 1;
|
||||||
const passwordMin = authPolicy?.passwordMinLength ?? 1;
|
const passwordMin = authPolicy?.passwordMinLength ?? 1;
|
||||||
const hasLoginCredentials =
|
const hasLoginCredentials =
|
||||||
|
|||||||
Reference in New Issue
Block a user