Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
9db57bc6
Commit
9db57bc6
authored
Mar 03, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move SSH key JS to Profile CS class
parent
2c760487
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
app/assets/javascripts/profile.js.coffee
app/assets/javascripts/profile.js.coffee
+9
-0
app/views/profiles/keys/new.html.haml
app/views/profiles/keys/new.html.haml
+0
-11
No files found.
app/assets/javascripts/profile.js.coffee
View file @
9db57bc6
...
@@ -62,3 +62,12 @@ class @Profile
...
@@ -62,3 +62,12 @@ class @Profile
$modalCropImg
.
attr
(
'src'
,
event
.
target
.
result
)
$modalCropImg
.
attr
(
'src'
,
event
.
target
.
result
)
fileData
=
reader
.
readAsDataURL
(
this
.
files
[
0
])
fileData
=
reader
.
readAsDataURL
(
this
.
files
[
0
])
$
->
# Extract the SSH Key title from its comment
$
(
document
).
on
'focusout.ssh_key'
,
'#key_key'
,
->
$title
=
$
(
'#key_title'
)
comment
=
$
(
@
).
val
().
match
(
/^\S+ \S+ (.+)\n?$/
)
if
comment
&&
comment
.
length
>
1
&&
$title
.
val
()
==
''
$title
.
val
(
comment
[
1
]).
change
()
app/views/profiles/keys/new.html.haml
View file @
9db57bc6
...
@@ -4,14 +4,3 @@
...
@@ -4,14 +4,3 @@
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"
)
}
.
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
%hr
=
render
'form'
=
render
'form'
:javascript
$
(
'
#key_key
'
).
on
(
'
focusout
'
,
function
(){
var
title
=
$
(
'
#key_title
'
),
val
=
$
(
'
#key_key
'
).
val
(),
comment
=
val
.
match
(
/^
\S
+
\S
+
(
.+
)\n?
$/
);
if
(
comment
&&
comment
.
length
>
1
&&
title
.
val
()
==
''
){
$
(
'
#key_title
'
).
val
(
comment
[
1
]
).
change
();
}
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment