\",\n {\n Insert: function() {\n var iRows = $(wym._options.rowsSelector).val();\n var iCols = $(wym._options.colsSelector).val();\n\n if (iRows > 0 && iCols > 0) {\n var table = wym._doc.createElement(WYMeditor.TABLE);\n var newRow = null;\n var newCol = null;\n\n var sCaption = $(wym._options.captionSelector).val();\n\n //we create the caption\n var newCaption = table.createCaption();\n newCaption.innerHTML = sCaption;\n\n //we create the rows and cells\n for (var x = 0; x < iRows; x++) {\n newRow = table.insertRow(x);\n for (var y = 0; y < iCols; y++) {\n newRow.insertCell(y);\n }\n }\n\n //set the summary attr\n $(table).attr(\n \"summary\",\n $(wym._options.summarySelector).val()\n );\n\n //append the table after the selected container\n var node = $(\n wym.findUp(\n wym.container(),\n WYMeditor.MAIN_CONTAINERS\n )\n ).get(0);\n if (!node || !node.parentNode)\n $(wym._doc.body).append(table);\n else $(node).after(table);\n }\n hide_modal();\n },\n Cancel: function() {\n hide_modal();\n }\n }\n );\n }\n\n // INSERT \"GALAXY ITEM\" LINK DIALOG\n if (\n dialogType == CONTROLS.DIALOG_HISTORY_LINK ||\n dialogType == CONTROLS.DIALOG_DATASET_LINK ||\n dialogType == CONTROLS.DIALOG_WORKFLOW_LINK ||\n dialogType == CONTROLS.DIALOG_PAGE_LINK ||\n dialogType == CONTROLS.DIALOG_VISUALIZATION_LINK\n ) {\n // Based on item type, set useful vars.\n var item_info;\n switch (dialogType) {\n case CONTROLS.DIALOG_HISTORY_LINK:\n item_info = get_item_info(CONTROLS.ITEM_HISTORY);\n break;\n case CONTROLS.DIALOG_DATASET_LINK:\n item_info = get_item_info(CONTROLS.ITEM_DATASET);\n break;\n case CONTROLS.DIALOG_WORKFLOW_LINK:\n item_info = get_item_info(CONTROLS.ITEM_WORKFLOW);\n break;\n case CONTROLS.DIALOG_PAGE_LINK:\n item_info = get_item_info(CONTROLS.ITEM_PAGE);\n break;\n case CONTROLS.DIALOG_VISUALIZATION_LINK:\n item_info = get_item_info(CONTROLS.ITEM_VISUALIZATION);\n break;\n }\n\n require([\"mvc/grid/grid-view\"], function(GridView) {\n var grid = new GridView({\n url_base: item_info.list_ajax_url,\n dict_format: true,\n embedded: true\n });\n Galaxy.modal.show({\n title: \"Insert Link to \" + item_info.singular,\n body: $(\"\")\n .append(grid.$el)\n .append(\n $(\"\")\n .append(\n ''\n )\n .append(\n \"Make the selected \" +\n item_info.plural.toLowerCase() +\n \" accessible so that they can viewed by everyone.\"\n )\n ),\n closing_events: true,\n buttons: {\n Insert: function() {\n // Make selected items accessible (importable) ?\n var make_importable = false;\n if ($(\"#make-importable:checked\").val() != null)\n make_importable = true;\n\n // Insert links to history for each checked item.\n var item_ids = new Array();\n grid.$(\"input[name=id]:checked\").each(function() {\n var item_id = $(this).val();\n\n // Make item importable?\n if (make_importable)\n make_item_importable(\n item_info.controller,\n item_id,\n item_info.singular\n );\n\n // Insert link(s) to item(s). This is done by getting item info and then manipulating wym.\n var url_template = get_name_and_link_url + item_id;\n var ajax_url = url_template.replace(\n \"ITEM_CONTROLLER\",\n item_info.controller\n );\n $.getJSON(ajax_url, function(returned_item_info) {\n // Get link text.\n wym._exec(WYMeditor.CREATE_LINK, sStamp);\n var link_text = $(\n \"a[href=\" + sStamp + \"]\",\n wym._doc.body\n ).text();\n\n // Insert link: need to do different actions depending on link text.\n if (\n link_text == \"\" || // Firefox.\n link_text == sStamp // Safari\n ) {\n // User selected no text; create link from scratch and use default text.\n wym.insert(\n \"\" +\n item_info.singular +\n \" '\" +\n returned_item_info.name +\n \"'\"\n );\n } else {\n // Link created from selected text; add href and title.\n $(\"a[href=\" + sStamp + \"]\", wym._doc.body)\n .attr(\n WYMeditor.HREF,\n returned_item_info.link\n )\n .attr(\n WYMeditor.TITLE,\n item_info.singular + item_id\n );\n }\n });\n });\n Galaxy.modal.hide();\n },\n Close: function() {\n Galaxy.modal.hide();\n }\n }\n });\n });\n }\n // EMBED GALAXY OBJECT DIALOGS\n if (\n dialogType == CONTROLS.DIALOG_EMBED_HISTORY ||\n dialogType == CONTROLS.DIALOG_EMBED_DATASET ||\n dialogType == CONTROLS.DIALOG_EMBED_WORKFLOW ||\n dialogType == CONTROLS.DIALOG_EMBED_PAGE ||\n dialogType == CONTROLS.DIALOG_EMBED_VISUALIZATION\n ) {\n // Based on item type, set useful vars.\n var item_info;\n switch (dialogType) {\n case CONTROLS.DIALOG_EMBED_HISTORY:\n item_info = get_item_info(CONTROLS.ITEM_HISTORY);\n break;\n case CONTROLS.DIALOG_EMBED_DATASET:\n item_info = get_item_info(CONTROLS.ITEM_DATASET);\n break;\n case CONTROLS.DIALOG_EMBED_WORKFLOW:\n item_info = get_item_info(CONTROLS.ITEM_WORKFLOW);\n break;\n case CONTROLS.DIALOG_EMBED_PAGE:\n item_info = get_item_info(CONTROLS.ITEM_PAGE);\n break;\n case CONTROLS.DIALOG_EMBED_VISUALIZATION:\n item_info = get_item_info(CONTROLS.ITEM_VISUALIZATION);\n break;\n }\n\n require([\"mvc/grid/grid-view\"], function(GridView) {\n var grid = new GridView({\n url_base: item_info.list_ajax_url,\n dict_format: true,\n embedded: true\n });\n Galaxy.modal.show({\n title: \"Insert Link to \" + item_info.singular,\n body: $(\"\")\n .append(grid.$el)\n .append(\n $(\"\")\n .append(\n ''\n )\n .append(\n \"Make the selected \" +\n item_info.plural.toLowerCase() +\n \" accessible so that they can viewed by everyone.\"\n )\n ),\n closing_events: true,\n buttons: {\n Embed: function() {\n // Make selected items accessible (importable) ?\n var make_importable = false;\n if ($(\"#make-importable:checked\").val() != null)\n make_importable = true;\n\n grid.$(\"input[name=id]:checked\").each(function() {\n // Get item ID and name.\n var item_id = $(this).val();\n // Use ':first' because there are many labels in table; the first one is the item name.\n var item_name = $(\n \"label[for='\" + item_id + \"']:first\"\n ).text();\n\n if (make_importable)\n make_item_importable(\n item_info.controller,\n item_id,\n item_info.singular\n );\n\n // Embedded item HTML; item class is embedded in div container classes; this is necessary because the editor strips\n // all non-standard attributes when it returns its content (e.g. it will not return an element attribute of the form\n // item_class='History').\n var item_elt_id = item_info.iclass + \"-\" + item_id;\n var item_embed_html = [\n \"
\",\n {\n Insert: function() {\n var iRows = $(wym._options.rowsSelector).val();\n var iCols = $(wym._options.colsSelector).val();\n\n if (iRows > 0 && iCols > 0) {\n var table = wym._doc.createElement(WYMeditor.TABLE);\n var newRow = null;\n var newCol = null;\n\n var sCaption = $(wym._options.captionSelector).val();\n\n //we create the caption\n var newCaption = table.createCaption();\n newCaption.innerHTML = sCaption;\n\n //we create the rows and cells\n for (var x = 0; x < iRows; x++) {\n newRow = table.insertRow(x);\n for (var y = 0; y < iCols; y++) {\n newRow.insertCell(y);\n }\n }\n\n //set the summary attr\n $(table).attr(\n \"summary\",\n $(wym._options.summarySelector).val()\n );\n\n //append the table after the selected container\n var node = $(\n wym.findUp(\n wym.container(),\n WYMeditor.MAIN_CONTAINERS\n )\n ).get(0);\n if (!node || !node.parentNode)\n $(wym._doc.body).append(table);\n else $(node).after(table);\n }\n hide_modal();\n },\n Cancel: function() {\n hide_modal();\n }\n }\n );\n }\n\n // INSERT \"GALAXY ITEM\" LINK DIALOG\n if (\n dialogType == CONTROLS.DIALOG_HISTORY_LINK ||\n dialogType == CONTROLS.DIALOG_DATASET_LINK ||\n dialogType == CONTROLS.DIALOG_WORKFLOW_LINK ||\n dialogType == CONTROLS.DIALOG_PAGE_LINK ||\n dialogType == CONTROLS.DIALOG_VISUALIZATION_LINK\n ) {\n // Based on item type, set useful vars.\n var item_info;\n switch (dialogType) {\n case CONTROLS.DIALOG_HISTORY_LINK:\n item_info = get_item_info(CONTROLS.ITEM_HISTORY);\n break;\n case CONTROLS.DIALOG_DATASET_LINK:\n item_info = get_item_info(CONTROLS.ITEM_DATASET);\n break;\n case CONTROLS.DIALOG_WORKFLOW_LINK:\n item_info = get_item_info(CONTROLS.ITEM_WORKFLOW);\n break;\n case CONTROLS.DIALOG_PAGE_LINK:\n item_info = get_item_info(CONTROLS.ITEM_PAGE);\n break;\n case CONTROLS.DIALOG_VISUALIZATION_LINK:\n item_info = get_item_info(CONTROLS.ITEM_VISUALIZATION);\n break;\n }\n\n require([\"mvc/grid/grid-view\"], function(GridView) {\n var grid = new GridView({\n url_base: item_info.list_ajax_url,\n dict_format: true,\n embedded: true\n });\n Galaxy.modal.show({\n title: \"Insert Link to \" + item_info.singular,\n body: $(\"\")\n .append(grid.$el)\n .append(\n $(\"\")\n .append(\n ''\n )\n .append(\n \"Make the selected \" +\n item_info.plural.toLowerCase() +\n \" accessible so that they can viewed by everyone.\"\n )\n ),\n closing_events: true,\n buttons: {\n Insert: function() {\n // Make selected items accessible (importable) ?\n var make_importable = false;\n if ($(\"#make-importable:checked\").val() != null)\n make_importable = true;\n\n // Insert links to history for each checked item.\n var item_ids = new Array();\n grid.$(\"input[name=id]:checked\").each(function() {\n var item_id = $(this).val();\n\n // Make item importable?\n if (make_importable)\n make_item_importable(\n item_info.controller,\n item_id,\n item_info.singular\n );\n\n // Insert link(s) to item(s). This is done by getting item info and then manipulating wym.\n var url_template = get_name_and_link_url + item_id;\n var ajax_url = url_template.replace(\n \"ITEM_CONTROLLER\",\n item_info.controller\n );\n $.getJSON(ajax_url, function(returned_item_info) {\n // Get link text.\n wym._exec(WYMeditor.CREATE_LINK, sStamp);\n var link_text = $(\n \"a[href=\" + sStamp + \"]\",\n wym._doc.body\n ).text();\n\n // Insert link: need to do different actions depending on link text.\n if (\n link_text == \"\" || // Firefox.\n link_text == sStamp // Safari\n ) {\n // User selected no text; create link from scratch and use default text.\n wym.insert(\n \"\" +\n item_info.singular +\n \" '\" +\n returned_item_info.name +\n \"'\"\n );\n } else {\n // Link created from selected text; add href and title.\n $(\"a[href=\" + sStamp + \"]\", wym._doc.body)\n .attr(\n WYMeditor.HREF,\n returned_item_info.link\n )\n .attr(\n WYMeditor.TITLE,\n item_info.singular + item_id\n );\n }\n });\n });\n Galaxy.modal.hide();\n },\n Close: function() {\n Galaxy.modal.hide();\n }\n }\n });\n });\n }\n // EMBED GALAXY OBJECT DIALOGS\n if (\n dialogType == CONTROLS.DIALOG_EMBED_HISTORY ||\n dialogType == CONTROLS.DIALOG_EMBED_DATASET ||\n dialogType == CONTROLS.DIALOG_EMBED_WORKFLOW ||\n dialogType == CONTROLS.DIALOG_EMBED_PAGE ||\n dialogType == CONTROLS.DIALOG_EMBED_VISUALIZATION\n ) {\n // Based on item type, set useful vars.\n var item_info;\n switch (dialogType) {\n case CONTROLS.DIALOG_EMBED_HISTORY:\n item_info = get_item_info(CONTROLS.ITEM_HISTORY);\n break;\n case CONTROLS.DIALOG_EMBED_DATASET:\n item_info = get_item_info(CONTROLS.ITEM_DATASET);\n break;\n case CONTROLS.DIALOG_EMBED_WORKFLOW:\n item_info = get_item_info(CONTROLS.ITEM_WORKFLOW);\n break;\n case CONTROLS.DIALOG_EMBED_PAGE:\n item_info = get_item_info(CONTROLS.ITEM_PAGE);\n break;\n case CONTROLS.DIALOG_EMBED_VISUALIZATION:\n item_info = get_item_info(CONTROLS.ITEM_VISUALIZATION);\n break;\n }\n\n require([\"mvc/grid/grid-view\"], function(GridView) {\n var grid = new GridView({\n url_base: item_info.list_ajax_url,\n dict_format: true,\n embedded: true\n });\n Galaxy.modal.show({\n title: \"Insert Link to \" + item_info.singular,\n body: $(\"\")\n .append(grid.$el)\n .append(\n $(\"\")\n .append(\n ''\n )\n .append(\n \"Make the selected \" +\n item_info.plural.toLowerCase() +\n \" accessible so that they can viewed by everyone.\"\n )\n ),\n closing_events: true,\n buttons: {\n Embed: function() {\n // Make selected items accessible (importable) ?\n var make_importable = false;\n if ($(\"#make-importable:checked\").val() != null)\n make_importable = true;\n\n grid.$(\"input[name=id]:checked\").each(function() {\n // Get item ID and name.\n var item_id = $(this).val();\n // Use ':first' because there are many labels in table; the first one is the item name.\n var item_name = $(\n \"label[for='\" + item_id + \"']:first\"\n ).text();\n\n if (make_importable)\n make_item_importable(\n item_info.controller,\n item_id,\n item_info.singular\n );\n\n // Embedded item HTML; item class is embedded in div container classes; this is necessary because the editor strips\n // all non-standard attributes when it returns its content (e.g. it will not return an element attribute of the form\n // item_class='History').\n var item_elt_id = item_info.iclass + \"-\" + item_id;\n var item_embed_html = [\n \"
",{Insert:function(){var e=$(s._options.rowsSelector).val(),t=$(s._options.colsSelector).val();if(e>0&&t>0){var a=s._doc.createElement(WYMeditor.TABLE),i=null,o=$(s._options.captionSelector).val();a.createCaption().innerHTML=o;for(var l=0;l").append(a.$el).append($("").append('').append("Make the selected "+c.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Insert:function(){var e=!1;null!=$("#make-importable:checked").val()&&(e=!0);new Array;a.$("input[name=id]:checked").each(function(){var a=$(this).val();e&&t(c.controller,a,c.singular);var i=(get_name_and_link_url+a).replace("ITEM_CONTROLLER",c.controller);$.getJSON(i,function(e){s._exec(WYMeditor.CREATE_LINK,r);var t=$("a[href="+r+"]",s._doc.body).text();""==t||t==r?s.insert(""+c.singular+" '"+e.name+"'"):$("a[href="+r+"]",s._doc.body).attr(WYMeditor.HREF,e.link).attr(WYMeditor.TITLE,c.singular+a)})}),Galaxy.modal.hide()},Close:function(){Galaxy.modal.hide()}}})})}if(i==a.DIALOG_EMBED_HISTORY||i==a.DIALOG_EMBED_DATASET||i==a.DIALOG_EMBED_WORKFLOW||i==a.DIALOG_EMBED_PAGE||i==a.DIALOG_EMBED_VISUALIZATION){var c;switch(i){case a.DIALOG_EMBED_HISTORY:c=e(a.ITEM_HISTORY);break;case a.DIALOG_EMBED_DATASET:c=e(a.ITEM_DATASET);break;case a.DIALOG_EMBED_WORKFLOW:c=e(a.ITEM_WORKFLOW);break;case a.DIALOG_EMBED_PAGE:c=e(a.ITEM_PAGE);break;case a.DIALOG_EMBED_VISUALIZATION:c=e(a.ITEM_VISUALIZATION)}require(["mvc/grid/grid-view"],function(e){var a=new e({url_base:c.list_ajax_url,dict_format:!0,embedded:!0});Galaxy.modal.show({title:"Insert Link to "+c.singular,body:$("").append(a.$el).append($("").append('').append("Make the selected "+c.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Embed:function(){var e=!1;null!=$("#make-importable:checked").val()&&(e=!0),a.$("input[name=id]:checked").each(function(){var a=$(this).val(),i=$("label[for='"+a+"']:first").text();e&&t(c.controller,a,c.singular);var o=["
","
","Embedded Galaxy ",c.singular," '",i,"'","
","
","[Do not edit this block; Galaxy will fill it in with the annotated ",c.singular.toLowerCase()," when it is displayed.]","
","
"].join("");s.insert(o)}),Galaxy.modal.hide()},Close:function(){Galaxy.modal.hide()}}})})}},$(function(){$(document).ajaxError(function(e,t){var a=t.responseText||t.statusText||"Could not connect to server";return show_modal("Server error",a,{"Ignore error":hide_modal}),!1}),$("[name=page_content]").wymeditor({skin:"galaxy",basePath:editor_base_path,iframeBasePath:iframe_base_path,boxHtml:"
",{Insert:function(){var e=$(s._options.rowsSelector).val(),t=$(s._options.colsSelector).val();if(e>0&&t>0){var a=s._doc.createElement(WYMeditor.TABLE),i=null,o=$(s._options.captionSelector).val();a.createCaption().innerHTML=o;for(var l=0;l").append(t.$el).append($("").append('').append("Make the selected "+c.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Insert:function(){var e=!1;null!=$("#make-importable:checked").val()&&(e=!0);new Array;t.$("input[name=id]:checked").each(function(){var t=$(this).val();e&&a(c.controller,t,c.singular);var i=(get_name_and_link_url+t).replace("ITEM_CONTROLLER",c.controller);$.getJSON(i,function(e){s._exec(WYMeditor.CREATE_LINK,r);var a=$("a[href="+r+"]",s._doc.body).text();""==a||a==r?s.insert(""+c.singular+" '"+e.name+"'"):$("a[href="+r+"]",s._doc.body).attr(WYMeditor.HREF,e.link).attr(WYMeditor.TITLE,c.singular+t)})}),Galaxy.modal.hide()},Close:function(){Galaxy.modal.hide()}}})})}if(e==i.DIALOG_EMBED_HISTORY||e==i.DIALOG_EMBED_DATASET||e==i.DIALOG_EMBED_WORKFLOW||e==i.DIALOG_EMBED_PAGE||e==i.DIALOG_EMBED_VISUALIZATION){var c;switch(e){case i.DIALOG_EMBED_HISTORY:c=t(i.ITEM_HISTORY);break;case i.DIALOG_EMBED_DATASET:c=t(i.ITEM_DATASET);break;case i.DIALOG_EMBED_WORKFLOW:c=t(i.ITEM_WORKFLOW);break;case i.DIALOG_EMBED_PAGE:c=t(i.ITEM_PAGE);break;case i.DIALOG_EMBED_VISUALIZATION:c=t(i.ITEM_VISUALIZATION)}require(["mvc/grid/grid-view"],function(e){var t=new e({url_base:c.list_ajax_url,dict_format:!0,embedded:!0});Galaxy.modal.show({title:"Insert Link to "+c.singular,body:$("").append(t.$el).append($("").append('').append("Make the selected "+c.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Embed:function(){var e=!1;null!=$("#make-importable:checked").val()&&(e=!0),t.$("input[name=id]:checked").each(function(){var t=$(this).val(),i=$("label[for='"+t+"']:first").text();e&&a(c.controller,t,c.singular);var o=["
","
","Embedded Galaxy ",c.singular," '",i,"'","
","
","[Do not edit this block; Galaxy will fill it in with the annotated ",c.singular.toLowerCase()," when it is displayed.]","