Add an annotation or notes to this step; annotations are available when a workflow is viewed.
'}}),Backbone.View.extend({initialize:function(a){function c(){i.workflow.layout(),i.workflow.fit_canvas_to_nodes(),i.scroll_to_nodes(),i.canvas_manager.draw_overview()}function e(){i.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 g(){$.jStorage.set("overview-off",!0),$("#overview-border").css("right","20000px"),$("#close-viewport").css("background-position","12px 0px")}var i=b.app=this;this.options=a,this.urls=a&&a.urls||{},this.active_ajax_call=!1;var k=function(){i.workflow.check_changes_in_active_form(),workflow&&i.workflow.has_changes?(do_close=function(){window.onbeforeunload=void 0,window.document.location=i.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=i.urls.workflow_index},l=function(a,b){if(show_message("Saving workflow","progress"),i.workflow.check_changes_in_active_form(),!i.workflow.has_changes)return hide_modal(),void(b&&b());i.workflow.rectify_workflow_outputs();var c=function(a){$.ajax({url:i.urls.save_workflow,type:"POST",data:{id:i.options.id,workflow_data:function(){return JSON.stringify(i.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(),i.showWorkflowParameters()},beforeSubmit:function(){show_message("Loading workflow","progress")}}),$(document).ajaxStart(function(){i.active_ajax_call=!0,$(document).bind("ajaxStop.global",function(){i.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=i.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")?g():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")?g():f()}),window.onbeforeunload=function(){return workflow&&i.workflow.has_changes?"There are unsaved changes to your workflow which will be lost.":void 0},this.options.workflows.length>0&&$("#left").find(".toolMenu").append(this._buildToolPanelWorkflows()),$("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)})}),h("workflow-name","workflow-name",i.urls.rename_async,"new_name"),$("#workflow-tag").click(function(){return $(".tag-area").click(),!1}),h("workflow-annotation","workflow-annotation",i.urls.annotate_async,"new_annotation",25,!0,4)},_buildToolPanelWorkflows:function(){var a=this,b=$('
');return _.each(this.options.workflows,function(c){if(c.id!==a.options.id){var d=new g.ButtonIcon({icon:"fa fa-copy",cls:"ui-button-icon-plain",tooltip:"Copy and insert individual steps",onclick:function(){c.step_count<2?a.copy_into_workflow(c.id,c.name):Galaxy.modal.show({title:"Warning",body:"This will copy "+c.step_count+" new steps into your workflow.",buttons:{Cancel:function(){Galaxy.modal.hide()},Copy:function(){Galaxy.modal.hide(),a.copy_into_workflow(c.id,c.name)}}})}}),e=$("").attr("href","#").html(c.name).on("click",function(){a.add_node_for_subworkflow(c.latest_id,c.name)});b.find(".toolSectionBg").append($("").addClass("toolTitle").append(e).append(d.$el))}}),b},copy_into_workflow:function(a){var b=this;this._workflowLoadAjax(a,{success:function(a){b.workflow.from_simple(a,!1),upgrade_message="",$.each(a.upgrade_messages,function(a,c){upgrade_message+="
"}),upgrade_message?window.show_modal("Subworkflow embedded with changes","Problems were encountered loading this workflow (possibly a result of tool upgrades). Please review the following parameters and then save.