2 function startFromAgent(start
) {
6 $('#div_new_agent').hide();
7 $('#div_available_agent').show();
9 else if (start
== 'new'){
10 $('#div_available_agent').hide();
11 $('#div_new_agent').show();
14 $('.required').prop('required', function(){
15 return $(this).is(':visible');
20 function InvalidGitUrl(textbox) {
21 console.log('InvalidGitUrl', textbox,textbox.value == '' ,textbox.validity.typeMismatch)
22 if (textbox.value === '') {
23 textbox.setCustomValidity('Required git URL');
25 else if (textbox.validity.typeMismatch){
26 textbox.setCustomValidity('please enter a valid git URL');
30 textbox.setCustomValidity('please enter a valid git URL');
35 function startFromRepo(start
) {
38 if (start
== 'exist'){
39 $('#div_new_repo').hide();
40 $('#div_available_repo').show();
42 else if (start
== 'new'){
43 $('#div_available_repo').hide();
44 $('#div_new_repo').show();
47 $('.required').prop('required', function(){
48 return $(this).is(':visible');
53 $(document
).ready(function () {
54 $("#startButtonsSelect :input").change(function () {
56 startFromAgent(this.value
);
58 $("#push_start_buttons_select :input").change(function () {
60 startFromRepo(this.value
);
64 $("form").submit(function(e
) {
65 console
.log("on submit form")
66 $("#start_new_deployment").button('loading');