giteabot backport / giteabot (push) Canceled after 0s
giteabot / giteabot (push) Canceled after 0s
release-nightly / nightly-binary (push) Canceled after 0s
release-nightly / nightly-container (push) Canceled after 0s
cache-seeder / gobuild (push) Canceled after 0s
cache-seeder / lint (bindata, lint-backend) (push) Canceled after 0s
release-nightly-snapcraft / build-and-publish (push) Canceled after 0s
Includes direct password setup links in registration emails. Assisted-by: Codex:GPT-5
20 lines
697 B
TypeScript
20 lines
697 B
TypeScript
import {hideElem, showElem} from '../utils/dom.ts';
|
|
|
|
export function initUserSettings() {
|
|
if (!document.querySelector('.user.settings.profile')) return;
|
|
|
|
const usernameInput = document.querySelector<HTMLInputElement>('#username');
|
|
if (!usernameInput) return;
|
|
usernameInput.addEventListener('input', function () {
|
|
const prompt = document.querySelector('#name-change-prompt')!;
|
|
const promptRedirect = document.querySelector('#name-change-redirect-prompt')!;
|
|
if (this.value.toLowerCase() !== this.getAttribute('data-name')!.toLowerCase()) {
|
|
showElem(prompt);
|
|
showElem(promptRedirect);
|
|
} else {
|
|
hideElem(prompt);
|
|
hideElem(promptRedirect);
|
|
}
|
|
});
|
|
}
|