2018-03-09 20:18:59 +00:00
|
|
|
import $ from 'jquery';
|
2018-02-23 16:18:24 +00:00
|
|
|
import '~/profile/gl_crop';
|
|
|
|
import Profile from '~/profile/profile';
|
2021-02-09 12:09:48 +00:00
|
|
|
import initSearchSettings from '~/search_settings';
|
2018-02-23 16:18:24 +00:00
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
2018-10-10 06:41:22 +00:00
|
|
|
// eslint-disable-next-line func-names
|
2020-12-23 12:10:26 +00:00
|
|
|
$(document).on('input.ssh_key', '#key_key', function () {
|
2018-02-23 16:18:24 +00:00
|
|
|
const $title = $('#key_title');
|
2018-10-10 06:41:22 +00:00
|
|
|
const comment = $(this)
|
|
|
|
.val()
|
|
|
|
.match(/^\S+ \S+ (.+)\n?$/);
|
2018-02-23 16:18:24 +00:00
|
|
|
|
|
|
|
// Extract the SSH Key title from its comment
|
|
|
|
if (comment && comment.length > 1) {
|
|
|
|
$title.val(comment[1]).change();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-02-26 16:37:08 +00:00
|
|
|
new Profile(); // eslint-disable-line no-new
|
2021-02-09 12:09:48 +00:00
|
|
|
|
|
|
|
initSearchSettings();
|
2018-02-23 16:18:24 +00:00
|
|
|
});
|