1 function run_pipeline_button_state() {
2 var a = $('a.editable.required.editable-empty,input.form-control.required[value=]');
4 $(".run-pipeline-button").addClass("disabled");
7 $(".run-pipeline-button").removeClass("disabled");
11 $(document).on('editable:success', function(event, tag, response, newValue) {
13 if ($('.run-pipeline-button').length == 0)
15 if ($tag.hasClass("required")) {
16 if (newValue && newValue.trim() != "") {
17 $tag.removeClass("editable-empty");
18 $tag.parent().css("background-color", "");
19 $tag.parent().prev().css("background-color", "");
22 $tag.addClass("editable-empty");
23 $tag.parent().css("background-color", "#ffdddd");
24 $tag.parent().prev().css("background-color", "#ffdddd");
27 if ($tag.attr('data-name')) {
28 // Update other inputs representing the same piece of data
29 $('.editable[data-name="' + $tag.attr('data-name') + '"]').
30 editable('setValue', newValue);
32 run_pipeline_button_state();
35 $(document).on('ready ajax:complete', function() {
36 $('a.editable.required').each(function() {
38 if ($tag.hasClass("editable-empty")) {
39 $tag.parent().css("background-color", "#ffdddd");
40 $tag.parent().prev().css("background-color", "#ffdddd");
43 $tag.parent().css("background-color", "");
44 $tag.parent().prev().css("background-color", "");
47 run_pipeline_button_state();
50 $(document).on('ajax:complete ready', function() {
51 var a = $('.arv-log-event-listener');
53 $('.arv-log-event-listener').each(function() {
54 subscribeToEventLog(this.id);
59 $(document).on('arv-log-event', '.arv-log-event-handler-append-logs', function(event, eventData){
60 var wasatbottom = ($(this).scrollTop() + $(this).height() >=
62 var parsedData = JSON.parse(eventData);
63 var propertyText = undefined;
64 var properties = parsedData.properties;
66 if (properties !== null) {
67 propertyText = properties.text;
69 if (propertyText !== undefined) {
70 $(this).append(propertyText + "<br/>");
72 $(this).append(parsedData.summary + "<br/>");
75 this.scrollTop = this.scrollHeight;
76 }).on('ready ajax:complete', function(){
77 $('.arv-log-event-handler-append-logs').each(function() {
78 this.scrollTop = this.scrollHeight;
82 var showhide_compare = function() {
83 var form = $('form#compare')[0];
84 $('input[type=hidden][name="uuids[]"]', form).remove();
85 $('input[type=submit]', form).prop('disabled',true).show();
86 var checked_inputs = $('[data-object-uuid*=-d1hrv-] input[name="uuids[]"]:checked');
87 if (checked_inputs.length >= 2 && checked_inputs.length <= 3) {
88 checked_inputs.each(function(){
90 $('input[type=submit]', form).prop('disabled',false).show();
91 $(form).append($('<input type="hidden" name="uuids[]"/>').val(this.value));
96 $('[data-object-uuid*=-d1hrv-] input[name="uuids[]"]').on('click', showhide_compare);