2022-01-28 21:00:11 +00:00
|
|
|
import $ from 'jquery';
|
2023-02-19 04:06:14 +00:00
|
|
|
import {hideElem, showElem} from '../utils/dom.js';
|
2022-01-28 21:00:11 +00:00
|
|
|
|
2021-10-16 17:28:04 +00:00
|
|
|
export function initUserSettings() {
|
|
|
|
if ($('.user.settings.profile').length > 0) {
|
|
|
|
$('#username').on('keyup', function () {
|
|
|
|
const $prompt = $('#name-change-prompt');
|
|
|
|
const $prompt_redirect = $('#name-change-redirect-prompt');
|
|
|
|
if ($(this).val().toString().toLowerCase() !== $(this).data('name').toString().toLowerCase()) {
|
2023-02-19 04:06:14 +00:00
|
|
|
showElem($prompt);
|
|
|
|
showElem($prompt_redirect);
|
2021-10-16 17:28:04 +00:00
|
|
|
} else {
|
2023-02-19 04:06:14 +00:00
|
|
|
hideElem($prompt);
|
|
|
|
hideElem($prompt_redirect);
|
2021-10-16 17:28:04 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|