Add an annotation or notes to this step; annotations are available when a workflow is viewed.
'}}),Backbone.View.extend({initialize:function(a){function c(){j.workflow.layout(),j.workflow.fit_canvas_to_nodes(),j.scroll_to_nodes(),j.canvas_manager.draw_overview()}function e(){j.workflow.clear_active_node(),$(".right-content").hide(),$("#edit-attributes").show()}function f(){$.jStorage.set("overview-off",!1),$("#overview-border").css("right","0px"),$("#close-viewport").css("background-position","0px 0px")}function h(){$.jStorage.set("overview-off",!0),$("#overview-border").css("right","20000px"),$("#close-viewport").css("background-position","12px 0px")}var j=b.app=this;this.options=a,this.urls=a&&a.urls||{},this.active_ajax_call=!1;var k=function(){j.workflow.check_changes_in_active_form(),workflow&&j.workflow.has_changes?(do_close=function(){window.onbeforeunload=void 0,window.document.location=j.urls.workflow_index},window.show_modal("Close workflow editor","There are unsaved changes to your workflow which will be lost.",{Cancel:hide_modal,"Save Changes":function(){l(null,do_close)}},{"Don't Save":do_close})):window.document.location=j.urls.workflow_index},l=function(a,b){if(show_message("Saving workflow","progress"),j.workflow.check_changes_in_active_form(),!j.workflow.has_changes)return hide_modal(),void(b&&b());j.workflow.rectify_workflow_outputs();var c=function(a){$.ajax({url:j.urls.save_workflow,type:"POST",data:{id:j.options.id,workflow_data:function(){return JSON.stringify(j.workflow.to_simple())},_:"true"},dataType:"json",success:function(b){var c=$("").text(b.message);if(b.errors){c.addClass("warningmark");var d=$("
"}),upgrade_message?window.show_modal("Workflow loaded with changes","Problems were encountered loading this workflow (possibly a result of tool upgrades). Please review the following parameters and then save.
"+upgrade_message+"
",{Continue:hide_modal}):hide_modal(),j.showWorkflowParameters()},beforeSubmit:function(){show_message("Loading workflow","progress")}}),$(document).ajaxStart(function(){j.active_ajax_call=!0,$(document).bind("ajaxStop.global",function(){j.active_ajax_call=!1})}),$(document).ajaxError(function(a,b){var c=b.responseText||b.statusText||"Could not connect to server";return window.show_modal("Server error",c,{"Ignore error":hide_modal}),!1}),window.make_popupmenu&&make_popupmenu($("#workflow-options-button"),{Save:l,Run:function(){window.location=j.urls.run_workflow},"Edit Attributes":e,"Auto Re-layout":c,Close:k}),overview_size=$.jStorage.get("overview-size"),void 0!==overview_size&&$("#overview-border").css({width:overview_size,height:overview_size}),$.jStorage.get("overview-off")?h():f(),$("#overview-border").bind("dragend",function(a,b){var c=$(this).offsetParent(),d=c.offset(),e=Math.max(c.width()-(b.offsetX-d.left),c.height()-(b.offsetY-d.top));$.jStorage.set("overview-size",e+"px")}),$("#close-viewport").click(function(){"0px"===$("#overview-border").css("right")?h():f()}),window.onbeforeunload=function(){return workflow&&j.workflow.has_changes?"There are unsaved changes to your workflow which will be lost.":void 0},$("div.toolSectionBody").hide(),$("div.toolSectionTitle > span").wrap("");var m=null;$("div.toolSectionTitle").each(function(){var a=$(this).next("div.toolSectionBody");$(this).click(function(){a.is(":hidden")?(m&&m.slideUp("fast"),m=a,a.slideDown("fast")):(a.slideUp("fast"),m=null)})}),g("workflow-name","workflow-name",j.urls.rename_async,"new_name"),$("#workflow-tag").click(function(){return $(".tag-area").click(),!1}),g("workflow-annotation","workflow-annotation",j.urls.annotate_async,"new_annotation",25,!0,4)},reset:function(){this.workflow&&this.workflow.remove_all(),this.workflow=b.workflow=new c(this,$("#canvas-container"))},scroll_to_nodes:function(){var a,b,c=$("#canvas-viewport"),d=$("#canvas-container");b=d.width().toolForm:last>.toolFormTitle>.buttons").click(function(){action_to_rem=$(this).closest(".toolForm",".action_tag").children(".action_tag:first").text(),$(this).closest(".toolForm").remove(),delete c.workflow.active_node.post_job_actions[action_to_rem],c.workflow.active_form_has_changes=!0})},display_pja_list:function(){return pja_list},display_file_list:function(a){addlist="",addlist},new_pja:function(a,b,c){if(void 0===c.post_job_actions&&(c.post_job_actions={}),void 0===c.post_job_actions[a+b]){var d={};return d.action_type=a,d.output_name=b,c.post_job_actions[a+b]=null,c.post_job_actions[a+b]=d,display_pja(d,c),this.workflow.active_form_has_changes=!0,!0}return!1},showWorkflowParameters:function(){var a=/\$\{.+?\}/g,b=[],c=$("#workflow-parameters-container"),d=$("#workflow-parameters-box"),e="",f=[];$.each(this.workflow.nodes,function(c,d){var e=d.form_html.match(a);e&&(f=f.concat(e)),d.post_job_actions&&($.each(d.post_job_actions,function(b,c){c.action_arguments&&$.each(c.action_arguments,function(b,c){var d=c.match(a);d&&(f=f.concat(d))})}),f&&$.each(f,function(a,c){-1===$.inArray(c,b)&&b.push(c)}))}),b&&0!==b.length?($.each(b,function(a,b){e+="