Commit 2b01c65e authored by Staicu Ionut's avatar Staicu Ionut

- when you add a new ssh key, the title field automatically fills with the...

- when you add a new ssh key, the title field automatically fills with the email (if is present in the key sting)
parent 1031ca9b
%h3 New key %h3 New key
%hr %hr
= render 'form' = render 'form'
:javascript
$('#key_key').on('keyup', function(){
var title = $('#key_title'),
val = $('#key_key').val(),
key_mail = val.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+|\.[a-zA-Z0-9._-]+)/gi);
if( key_mail && key_mail.length > 0 && title.val() == '' ){
$('#key_title').val( key_mail );
}
});
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment