summaryrefslogtreecommitdiff
path: root/app/views/profiles/keys/new.html.haml
blob: c02b47b0ad59f75e8a8563782b6164f11568bb70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
%h3.page-title Add an SSH Key
%p.light
  Paste your public key here. Read more about how to generate a key on #{link_to "the SSH help page", help_page_path("ssh", "README")}.
%hr
= render 'form'

:javascript
  $('#key_key').on('focusout', 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 );
    }
  });