code.gitea.io/gitea@v1.22.3/web_src/js/features/sshkey-helper.js (about)

     1  export function initSshKeyFormParser() {
     2    // Parse SSH Key
     3    document.getElementById('ssh-key-content')?.addEventListener('input', function () {
     4      const arrays = this.value.split(' ');
     5      const title = document.getElementById('ssh-key-title');
     6      if (!title.value && arrays.length === 3 && arrays[2] !== '') {
     7        title.value = arrays[2];
     8      }
     9    });
    10  }