X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=static%2Fsrc%2Fprojecthandler%2Fdescriptorslist.js;fp=static%2Fsrc%2Fprojecthandler%2Fdescriptorslist.js;h=4a5975a106a24048a07affd82fa97e2870cb4caa;hb=fb37bca4b7e8178c65df2f1496afe372c1d55e78;hp=0000000000000000000000000000000000000000;hpb=199337977b1a7cd6ec26de3272d6cca2c1260e2f;p=osm%2FLW-UI.git diff --git a/static/src/projecthandler/descriptorslist.js b/static/src/projecthandler/descriptorslist.js new file mode 100644 index 0000000..4a5975a --- /dev/null +++ b/static/src/projecthandler/descriptorslist.js @@ -0,0 +1,69 @@ + +function startFromAgent(start) { + + + if (start == 'exist'){ + $('#div_new_agent').hide(); + $('#div_available_agent').show(); + } + else if (start == 'new'){ + $('#div_available_agent').hide(); + $('#div_new_agent').show(); + } + + $('.required').prop('required', function(){ + return $(this).is(':visible'); + }); + +} +/* +function InvalidGitUrl(textbox) { + console.log('InvalidGitUrl', textbox,textbox.value == '' ,textbox.validity.typeMismatch) + if (textbox.value === '') { + textbox.setCustomValidity('Required git URL'); + } + else if (textbox.validity.typeMismatch){ + textbox.setCustomValidity('please enter a valid git URL'); + + } + else { + textbox.setCustomValidity('please enter a valid git URL'); + } + return true; +} +*/ +function startFromRepo(start) { + + + if (start == 'exist'){ + $('#div_new_repo').hide(); + $('#div_available_repo').show(); + } + else if (start == 'new'){ + $('#div_available_repo').hide(); + $('#div_new_repo').show(); + } + + $('.required').prop('required', function(){ + return $(this).is(':visible'); + }); + +} + +$(document).ready(function () { + $("#startButtonsSelect :input").change(function () { + console.log("select") + startFromAgent(this.value); + }); + $("#push_start_buttons_select :input").change(function () { + console.log("select") + startFromRepo(this.value); + }); + + // Bind events + $("form").submit(function(e) { + console.log("on submit form") + $("#start_new_deployment").button('loading'); + }); + +}); \ No newline at end of file