Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-08 12:07:23 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-08 12:07:23 +0300
commitfa3a7ef0379ec67706a8923a68dec99082a0face (patch)
tree6759f779ebd3b939181590f2970c6592843cfe75 /app
parent8c12c93e07c536940fc63bf3c5ae824e96d43661 (diff)
parentdaa1796cf9bbdeb88a5b472c6bac34676fe8d8a9 (diff)
Merge pull request #8740 from cinderblock/master
Be less restrictive on key comment extraction
Diffstat (limited to 'app')
-rw-r--r--app/views/profiles/keys/new.html.haml6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/views/profiles/keys/new.html.haml b/app/views/profiles/keys/new.html.haml
index c02b47b0ad5..ccec716d0c6 100644
--- a/app/views/profiles/keys/new.html.haml
+++ b/app/views/profiles/keys/new.html.haml
@@ -8,9 +8,9 @@
$('#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);
+ comment = val.match(/^\S+ \S+ (.+)$/);
- if( key_mail && key_mail.length > 0 && title.val() == '' ){
- $('#key_title').val( key_mail );
+ if( comment && comment.length > 1 && title.val() == '' ){
+ $('#key_title').val( comment[1] );
}
});