Commit fa3a7ef0 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #8740 from cinderblock/master

Be less restrictive on key comment extraction
parents 8c12c93e daa1796c
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
$('#key_key').on('focusout', function(){ $('#key_key').on('focusout', function(){
var title = $('#key_title'), var title = $('#key_title'),
val = $('#key_key').val(), val = $('#key_key').val(),
key_mail = val.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+|\.[a-zA-Z0-9._-]+)/gi); comment = val.match(/^\S+ \S+ (.+)$/);
if( key_mail && key_mail.length > 0 && title.val() == '' ){ if( comment && comment.length > 1 && title.val() == '' ){
$('#key_title').val( key_mail ); $('#key_title').val( comment[1] );
} }
}); });
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