",{Insert:function(){var a=$(c._options.rowsSelector).val(),b=$(c._options.colsSelector).val();if(a>0&&b>0){var d=c._doc.createElement(WYMeditor.TABLE),e=null,f=$(c._options.captionSelector).val(),g=d.createCaption();g.innerHTML=f;for(var h=0;a>h;h++){e=d.insertRow(h);for(var i=0;b>i;i++)e.insertCell(i)}$(d).attr("summary",$(c._options.summarySelector).val());var j=$(c.findUp(c.container(),WYMeditor.MAIN_CONTAINERS)).get(0);j&&j.parentNode?$(j).after(d):$(c._doc.body).append(d)}hide_modal()},Cancel:function(){hide_modal()}}),a==CONTROLS.DIALOG_HISTORY_LINK||a==CONTROLS.DIALOG_DATASET_LINK||a==CONTROLS.DIALOG_WORKFLOW_LINK||a==CONTROLS.DIALOG_PAGE_LINK||a==CONTROLS.DIALOG_VISUALIZATION_LINK){var h;switch(a){case CONTROLS.DIALOG_HISTORY_LINK:h=get_item_info(CONTROLS.ITEM_HISTORY);break;case CONTROLS.DIALOG_DATASET_LINK:h=get_item_info(CONTROLS.ITEM_DATASET);break;case CONTROLS.DIALOG_WORKFLOW_LINK:h=get_item_info(CONTROLS.ITEM_WORKFLOW);break;case CONTROLS.DIALOG_PAGE_LINK:h=get_item_info(CONTROLS.ITEM_PAGE);break;case CONTROLS.DIALOG_VISUALIZATION_LINK:h=get_item_info(CONTROLS.ITEM_VISUALIZATION)}require(["mvc/grid/grid-view"],function(a){var b=new a({url_base:h.list_ajax_url,dict_format:!0,embedded:!0});Galaxy.modal.show({title:"Insert Link to "+h.singular,body:$("").append(b.$el).append($("").append('').append("Make the selected "+h.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Insert:function(){var a=!1;null!=$("#make-importable:checked").val()&&(a=!0);new Array;b.$("input[name=id]:checked").each(function(){var b=$(this).val();a&&make_item_importable(h.controller,b,h.singular);var e=get_name_and_link_url+b,f=e.replace("ITEM_CONTROLLER",h.controller);$.getJSON(f,function(a){c._exec(WYMeditor.CREATE_LINK,d);var e=$("a[href="+d+"]",c._doc.body).text();""==e||e==d?c.insert(""+h.singular+" '"+a.name+"'"):$("a[href="+d+"]",c._doc.body).attr(WYMeditor.HREF,a.link).attr(WYMeditor.TITLE,h.singular+b)})}),Galaxy.modal.hide()},Close:function(){Galaxy.modal.hide()}}})})}if(a==CONTROLS.DIALOG_EMBED_HISTORY||a==CONTROLS.DIALOG_EMBED_DATASET||a==CONTROLS.DIALOG_EMBED_WORKFLOW||a==CONTROLS.DIALOG_EMBED_PAGE||a==CONTROLS.DIALOG_EMBED_VISUALIZATION){var h;switch(a){case CONTROLS.DIALOG_EMBED_HISTORY:h=get_item_info(CONTROLS.ITEM_HISTORY);break;case CONTROLS.DIALOG_EMBED_DATASET:h=get_item_info(CONTROLS.ITEM_DATASET);break;case CONTROLS.DIALOG_EMBED_WORKFLOW:h=get_item_info(CONTROLS.ITEM_WORKFLOW);break;case CONTROLS.DIALOG_EMBED_PAGE:h=get_item_info(CONTROLS.ITEM_PAGE);break;case CONTROLS.DIALOG_EMBED_VISUALIZATION:h=get_item_info(CONTROLS.ITEM_VISUALIZATION)}require(["mvc/grid/grid-view"],function(a){var b=new a({url_base:h.list_ajax_url,dict_format:!0,embedded:!0});Galaxy.modal.show({title:"Insert Link to "+h.singular,body:$("").append(b.$el).append($("").append('').append("Make the selected "+h.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Embed:function(){var a=!1;null!=$("#make-importable:checked").val()&&(a=!0),b.$("input[name=id]:checked").each(function(){var b=$(this).val(),d=$("label[for='"+b+"']:first").text();a&&make_item_importable(h.controller,b,h.singular);var e=h.iclass+"-"+b,f=["
","
","Embedded Galaxy ",h.singular," '",d,"'","
","
","[Do not edit this block; Galaxy will fill it in with the annotated ",h.singular.toLowerCase()," when it is displayed.]","
","
"].join("");c.insert(f)}),Galaxy.modal.hide()},Close:function(){Galaxy.modal.hide()}}})})}},$(function(){$(document).ajaxError(function(a,b){var c=b.responseText||b.statusText||"Could not connect to server";return show_modal("Server error",c,{"Ignore error":hide_modal}),!1}),$("[name=page_content]").wymeditor({skin:"galaxy",basePath:editor_base_path,iframeBasePath:iframe_base_path,boxHtml:"
"+WYMeditor.TOOLS+"
"+WYMeditor.IFRAME+WYMeditor.STATUS+"
",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"}]});var a=$.wymeditors(0),b=function(b){show_modal("Saving page","progress"),$.ajax({url:save_url,type:"POST",data:{id:page_id,content:a.xhtml(),annotations:JSON.stringify(new Object),_:"true"},success:function(){b()}})};$("#save-button").click(function(){b(function(){hide_modal()})}),$("#close-button").click(function(){var a=!1;if(a){var c=function(){window.onbeforeunload=void 0,window.document.location=page_list_url};show_modal("Close editor","There are unsaved changes to your page which will be lost.",{Cancel:hide_modal,"Save Changes":function(){b(c)}},{"Don't Save":c})}else window.document.location=page_list_url});var c=$("