Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
7e76610d
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7e76610d
编写于
9月 04, 2012
作者:
R
Robert Speicher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update the projects js file to coffeescript; refactor the clone panel switcher
上级
c1ff89fa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
45 deletion
+18
-45
app/assets/javascripts/projects.js.coffee
app/assets/javascripts/projects.js.coffee
+18
-22
app/views/projects/empty.html.haml
app/views/projects/empty.html.haml
+0
-13
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+0
-5
app/views/refs/_head.html.haml
app/views/refs/_head.html.haml
+0
-5
未找到文件。
app/assets/javascripts/projects.js.coffee
浏览文件 @
7e76610d
function
Projects
()
{
$
(
"#project_name"
).
live
(
"change"
,
function
(){
var
slug
=
slugify
(
$
(
this
).
val
());
$
(
"#project_code"
).
val
(
slug
);
$
(
"#project_path"
).
val
(
slug
);
});
window
.
Projects
=
->
$
(
"#project_name"
).
live
"change"
,
->
slug
=
slugify
(
$
(
this
).
val
())
$
(
"#project_code"
).
val
(
slug
)
$
(
"#project_path"
).
val
(
slug
)
$
(
'.new_project, .edit_project'
).
live
(
'ajax:before'
,
function
()
{
$
(
'.project_new_holder, .project_edit_holder'
).
hide
();
$
(
'.save-project-loader'
).
show
();
});
$
(
".new_project, .edit_project"
).
live
"ajax:before"
,
->
$
(
".project_new_holder, .project_edit_holder"
).
hide
()
$
(
".save-project-loader"
).
show
()
$
(
'form #project_default_branch'
).
chosen
();
$
(
"form #project_default_branch"
).
chosen
()
disableButtonIfEmtpyField
"#project_name"
,
".project-submit"
disableButtonIfEmtpyField
(
"#project_name"
,
".project-submit"
)
}
function
initGitCloneSwitcher
()
{
var
link_sel
=
".project_clone_holder button"
;
$
(
link_sel
).
bind
(
"click"
,
function
(
e
)
{
$
(
link_sel
).
removeClass
(
"active"
);
$
(
this
).
addClass
(
"active"
);
$
(
"#project_clone"
).
val
(
$
(
this
).
attr
(
"data-clone"
));
})
}
# Git clone panel switcher
$
->
scope
=
$
(
'.project_clone_holder'
)
if
scope
.
length
>
0
$
(
'a, button'
,
scope
).
click
->
$
(
'a, button'
,
scope
).
removeClass
(
'active'
)
$
(
this
).
addClass
(
'active'
)
$
(
'#project_clone'
,
scope
).
val
(
$
(
this
).
data
(
'clone'
))
app/views/projects/empty.html.haml
浏览文件 @
7e76610d
...
...
@@ -36,16 +36,3 @@
-
if
can?
current_user
,
:admin_project
,
@project
.prepend-top-20
=
link_to
'Remove project'
,
@project
,
confirm:
'Are you sure?'
,
method: :delete
,
class:
"btn danger right"
:javascript
$
(
function
(){
var
link_sel
=
"
.project_clone_holder a
"
;
$
(
link_sel
).
bind
(
"
click
"
,
function
()
{
$
(
link_sel
).
removeClass
(
"
active
"
);
$
(
this
).
addClass
(
"
active
"
);
$
(
"
#project_clone
"
).
val
(
$
(
this
).
attr
(
"
data-clone
"
));
})
})
app/views/projects/show.html.haml
浏览文件 @
7e76610d
...
...
@@ -2,8 +2,3 @@
=
render
'clone_panel'
=
render
"events/event_last_push"
,
event:
@last_push
.content_list
=
render
@events
:javascript
$
(
function
(){
initGitCloneSwitcher
();
})
app/views/refs/_head.html.haml
浏览文件 @
7e76610d
...
...
@@ -12,8 +12,3 @@
%button
{
class:
"btn small active"
,
:"data-clone"
=>
@project
.
ssh_url_to_repo
}
SSH
%button
{
class:
"btn small"
,
:"data-clone"
=>
@project
.
http_url_to_repo
}
HTTP
=
text_field_tag
:project_clone
,
@project
.
url_to_repo
,
class:
"one_click_select span5"
:javascript
$
(
function
(){
initGitCloneSwitcher
();
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录