Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « profiles « pages « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 535fe5fa4eb827b7eea18a0d00bbcb6d62d3d7df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import $ from 'jquery';
import '~/profile/gl_crop';
import Profile from '~/profile/profile';
import initSearchSettings from '~/search_settings';

document.addEventListener('DOMContentLoaded', () => {
  // eslint-disable-next-line func-names
  $(document).on('input.ssh_key', '#key_key', function () {
    const $title = $('#key_title');
    const comment = $(this)
      .val()
      .match(/^\S+ \S+ (.+)\n?$/);

    // Extract the SSH Key title from its comment
    if (comment && comment.length > 1) {
      $title.val(comment[1]).change();
    }
  });

  new Profile(); // eslint-disable-line no-new

  initSearchSettings();
});