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

24 lines
633 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
document.addEventListener('DOMContentLoaded', () => {
2018-12-13 13:39:08 +05:30
// eslint-disable-next-line func-names
2021-03-08 18:12:59 +05:30
$(document).on('input.ssh_key', '#key_key', function () {
2018-03-27 19:54:05 +05:30
const $title = $('#key_title');
2018-12-13 13:39:08 +05:30
const comment = $(this)
.val()
.match(/^\S+ \S+ (.+)\n?$/);
2018-03-27 19:54:05 +05:30
// 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
2021-03-11 19:13:27 +05:30
initSearchSettings();
2018-03-27 19:54:05 +05:30
});