code.gitea.io/gitea@v1.21.7/web_src/js/features/user-settings.js (about)

     1  import $ from 'jquery';
     2  import {hideElem, showElem} from '../utils/dom.js';
     3  
     4  export function initUserSettings() {
     5    if ($('.user.settings.profile').length > 0) {
     6      $('#username').on('keyup', function () {
     7        const $prompt = $('#name-change-prompt');
     8        const $prompt_redirect = $('#name-change-redirect-prompt');
     9        if ($(this).val().toString().toLowerCase() !== $(this).data('name').toString().toLowerCase()) {
    10          showElem($prompt);
    11          showElem($prompt_redirect);
    12        } else {
    13          hideElem($prompt);
    14          hideElem($prompt_redirect);
    15        }
    16      });
    17    }
    18  }