mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
686 B
20 lines
686 B
5 months ago
|
import {hideElem, showElem} from '../utils/dom.ts';
|
||
3 years ago
|
|
||
3 years ago
|
export function initUserSettings() {
|
||
8 months ago
|
if (!document.querySelectorAll('.user.settings.profile').length) return;
|
||
9 months ago
|
|
||
6 months ago
|
const usernameInput = document.querySelector('#username');
|
||
9 months ago
|
if (!usernameInput) return;
|
||
|
usernameInput.addEventListener('input', function () {
|
||
6 months ago
|
const prompt = document.querySelector('#name-change-prompt');
|
||
|
const promptRedirect = document.querySelector('#name-change-redirect-prompt');
|
||
9 months ago
|
if (this.value.toLowerCase() !== this.getAttribute('data-name').toLowerCase()) {
|
||
|
showElem(prompt);
|
||
|
showElem(promptRedirect);
|
||
|
} else {
|
||
|
hideElem(prompt);
|
||
|
hideElem(promptRedirect);
|
||
|
}
|
||
|
});
|
||
3 years ago
|
}
|