cockpit/js/instance.js in cpee-1.4.10 vs cockpit/js/instance.js in cpee-1.4.11

- old
+ new

@@ -1,8 +1,9 @@ var ws; var suspended_monitoring = false; var myid = ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)); +var paths = '#dat_details input, #dat_details textarea, #dat_details select, #dat_details button, #dat_details [contenteditable], #dat_dataelements input, #dat_dataelements textarea, #dat_dataelements select, #dat_dataelements button, #dat_dataelements [contenteditable], #dat_endpoints input, #dat_endpoints textarea, #dat_endpoints select, #dat_endpoints button, #dat_endpoints [contenteditable], #dat_attributes input, #dat_attributes textarea, #dat_attributes select, #dat_attributes button, #dat_attributes [contenteditable]'; var loading = false; var subscription; var subscription_state = 'less'; var save = {}; save['state']= undefined; @@ -524,10 +525,17 @@ } if (notification == "running") { but = " ⇒ <button onclick='$(this).attr(\"disabled\",\"disabled\");stop_instance();'>stop</button>"; } + // disable all input, also check themes + format_visual_forms(); + // remove all markings with state change + if (save['graph_adaptor'] && save['graph_adaptor'].illustrator) { + save['graph_adaptor'].illustrator.get_elements().removeClass('marked'); + } + if (notification == "finished") { $('.tabbehind button').hide(); } else { $('#parameters .tabbehind button').show(); } @@ -824,11 +832,11 @@ var name = $("#modeltypes div.menuitem[data-selected=selected]").text(); $.ajax({ cache: false, dataType: 'xml', - url: $('body').attr('current-testsets') + name + ".xml", + url: $('body').attr('current-testsets') + "." + name + ".xml", success: function(res){ $.ajax({ type: "PUT", url: url + "/properties/values/attributes/modeltype", data: ({value: name}), @@ -1060,9 +1068,21 @@ function format_visual_vote_clear() {//{{{ node_state = {}; $('.super .vote').each(function(a,b){b.setAttribute("class","vote");}); $("#votes").empty(); }//}}} + +function format_visual_forms() { //{{{ + if (save['state'] != "ready" && save['state'] != "stopped") { + $(paths).each(function(k,e){ + $(e).attr('disabled','disable'); + }); + } else { + $(paths).each(function(k,e){ + $(e).removeAttr('disabled'); + }); + } +} //}}} function format_code(res,skim,lnums) {// {{{ try { res = res.replace(/&/g,'&amp;'); res = res.replace(/</g,'&lt;');