Открыть боковую панель
nt_test133
nt_project_uxpg8lvcuq8w
Коммиты
9db57bc6
Коммит
9db57bc6
создал
Мар 03, 2016
по автору
Robert Speicher
Просмотр файлов
Move SSH key JS to Profile CS class
владелец
2c760487
Изменения
2
Скрыть пробелы
Построчно
Рядом
app/assets/javascripts/profile.js.coffee
Просмотр файла @
9db57bc6
...
...
@@ -62,3 +62,12 @@ class @Profile
$modalCropImg
.
attr
(
'src'
,
event
.
target
.
result
)
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
Просмотр файла @
9db57bc6
...
...
@@ -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"
)
}
.
%hr
=
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
();
}
});
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать