debian-mirror-gitlab/app/assets/javascripts/pages/profiles/index.js

22 lines
549 B
JavaScript
Raw Normal View History

2018-05-09 12:01:36 +05:30
import $ from 'jquery';
2018-03-27 19:54:05 +05:30
import '~/profile/gl_crop';
import Profile from '~/profile/profile';
2021-03-11 19:13:27 +05:30
import initSearchSettings from '~/search_settings';
2018-03-27 19:54:05 +05:30
2021-04-17 20:07:23 +05:30
// 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?$/);
2018-03-27 19:54:05 +05:30
2021-04-17 20:07:23 +05:30
// Extract the SSH Key title from its comment
if (comment && comment.length > 1) {
$title.val(comment[1]).change();
}
});
2018-03-27 19:54:05 +05:30
2021-04-17 20:07:23 +05:30
new Profile(); // eslint-disable-line no-new
2021-03-11 19:13:27 +05:30
2021-04-17 20:07:23 +05:30
initSearchSettings();