2012-09-04 17:36:14 +02:00
|
|
|
window.Projects = ->
|
|
|
|
$("#project_name").live "change", ->
|
|
|
|
slug = slugify($(this).val())
|
|
|
|
$("#project_code").val(slug)
|
|
|
|
$("#project_path").val(slug)
|
2012-03-26 20:41:58 +02:00
|
|
|
|
2012-09-04 17:36:14 +02:00
|
|
|
$(".new_project, .edit_project").live "ajax:before", ->
|
|
|
|
$(".project_new_holder, .project_edit_holder").hide()
|
|
|
|
$(".save-project-loader").show()
|
2012-03-26 20:41:58 +02:00
|
|
|
|
2012-09-04 17:36:14 +02:00
|
|
|
$("form #project_default_branch").chosen()
|
|
|
|
disableButtonIfEmtpyField "#project_name", ".project-submit"
|
2012-08-30 21:15:34 +02:00
|
|
|
|
2012-09-04 17:36:14 +02:00
|
|
|
# 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'))
|