galaxy-commits
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 15302 discussions
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/0a06df7da177/
Changeset: 0a06df7da177
Branch: stable
User: chapmanb
Date: 2013-07-02 02:24:07
Summary: Add new engine parameter to downgrade function for 0112
Affected #: 1 file
diff -r 64bc5a64b19ea3161f95e74702cc1d44fb50e4e3 -r 0a06df7da177a204c7f3800ee39e5b9fd0956d7a lib/galaxy/model/migrate/versions/0112_add_data_manager_history_association_and_data_manager_job_association_tables.py
--- a/lib/galaxy/model/migrate/versions/0112_add_data_manager_history_association_and_data_manager_job_association_tables.py
+++ b/lib/galaxy/model/migrate/versions/0112_add_data_manager_history_association_and_data_manager_job_association_tables.py
@@ -54,7 +54,7 @@
log.debug( "Creating data_manager_job_association table failed: %s" % str( e ) )
-def downgrade():
+def downgrade(migrate_engine):
metadata.bind = migrate_engine
metadata.reflect()
try:
https://bitbucket.org/galaxy/galaxy-central/commits/8bf64d933704/
Changeset: 8bf64d933704
User: chapmanb
Date: 2013-07-02 02:24:07
Summary: Add new engine parameter to downgrade function for 0112
Affected #: 1 file
diff -r c7a07f350887fe3b4e822ba6b26b63ac3ac14bdf -r 8bf64d93370436a9f5e55b6c04990a382f63b3b9 lib/galaxy/model/migrate/versions/0112_add_data_manager_history_association_and_data_manager_job_association_tables.py
--- a/lib/galaxy/model/migrate/versions/0112_add_data_manager_history_association_and_data_manager_job_association_tables.py
+++ b/lib/galaxy/model/migrate/versions/0112_add_data_manager_history_association_and_data_manager_job_association_tables.py
@@ -54,7 +54,7 @@
log.debug( "Creating data_manager_job_association table failed: %s" % str( e ) )
-def downgrade():
+def downgrade(migrate_engine):
metadata.bind = migrate_engine
metadata.reflect()
try:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Make SAM_to_BAM tool write temporary files to job working directory rather than generic temp space.
by commits-noreply@bitbucket.org 02 Jul '13
by commits-noreply@bitbucket.org 02 Jul '13
02 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c7a07f350887/
Changeset: c7a07f350887
User: jgoecks
Date: 2013-07-02 15:25:55
Summary: Make SAM_to_BAM tool write temporary files to job working directory rather than generic temp space.
Affected #: 1 file
diff -r a600d1f3f9009f383d8f4667f48592450b9154cf -r c7a07f350887fe3b4e822ba6b26b63ac3ac14bdf tools/samtools/sam_to_bam.py
--- a/tools/samtools/sam_to_bam.py
+++ b/tools/samtools/sam_to_bam.py
@@ -42,7 +42,7 @@
except:
sys.stdout.write( 'Could not determine Samtools version\n' )
- tmp_dir = tempfile.mkdtemp()
+ tmp_dir = tempfile.mkdtemp( dir='.' )
if not options.ref_file or options.ref_file == 'None':
# We're using locally cached reference sequences( e.g., /galaxy/data/equCab2/sam_index/equCab2.fa ).
# The indexes for /galaxy/data/equCab2/sam_index/equCab2.fa will be contained in
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/46c5752b2bbb/
Changeset: 46c5752b2bbb
User: natefoo
Date: 2013-07-02 10:12:45
Summary: Bugfix for distributed object store free space monitor thread.
Affected #: 1 file
diff -r 2cabbf3687634090fbbc024726f15f43db4ff314 -r 46c5752b2bbbc0a606ecfd04356f6e9a6635c19c lib/galaxy/objectstore/__init__.py
--- a/lib/galaxy/objectstore/__init__.py
+++ b/lib/galaxy/objectstore/__init__.py
@@ -880,7 +880,8 @@
self.__parse_distributed_config(config)
- if self.global_max_percent_full or filter(lambda x: x is not None, self.max_percent_full.values()):
+ self.sleeper = None
+ if self.global_max_percent_full or filter(lambda x: x != 0.0, self.max_percent_full.values()):
self.sleeper = Sleeper()
self.filesystem_monitor_thread = threading.Thread(target=self.__filesystem_monitor)
self.filesystem_monitor_thread.start()
@@ -931,7 +932,8 @@
def shutdown(self):
super(DistributedObjectStore, self).shutdown()
- self.sleeper.wake()
+ if self.sleeper is not None:
+ self.sleeper.wake()
def exists(self, obj, **kwargs):
return self.__call_method('exists', obj, False, False, **kwargs)
https://bitbucket.org/galaxy/galaxy-central/commits/a600d1f3f900/
Changeset: a600d1f3f900
User: natefoo
Date: 2013-07-02 10:13:02
Summary: Upgrade pbs_python to 4.3.5
Affected #: 1 file
diff -r 46c5752b2bbbc0a606ecfd04356f6e9a6635c19c -r a600d1f3f9009f383d8f4667f48592450b9154cf eggs.ini
--- a/eggs.ini
+++ b/eggs.ini
@@ -19,7 +19,7 @@
mercurial = 2.2.3
MySQL_python = 1.2.3c1
numpy = 1.6.0
-pbs_python = 4.1.0
+pbs_python = 4.3.5
psycopg2 = 2.0.13
pycrypto = 2.5
pysam = 0.4.2
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Galaxy pages: (a) move JS code out of mako template and into galaxy.pages.js; (b) make WYMEditor work with Chrome and jQuery 1.9+; (c) fix bug that showed meaningless text when inserting a link. Pack scripts.
by commits-noreply@bitbucket.org 01 Jul '13
by commits-noreply@bitbucket.org 01 Jul '13
01 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2cabbf368763/
Changeset: 2cabbf368763
User: jgoecks
Date: 2013-07-01 18:37:44
Summary: Galaxy pages: (a) move JS code out of mako template and into galaxy.pages.js; (b) make WYMEditor work with Chrome and jQuery 1.9+; (c) fix bug that showed meaningless text when inserting a link. Pack scripts.
Affected #: 8 files
diff -r 5b27b92310d044cfd2f9b3711e5ef446048de110 -r 2cabbf3687634090fbbc024726f15f43db4ff314 static/scripts/galaxy.pages.js
--- /dev/null
+++ b/static/scripts/galaxy.pages.js
@@ -0,0 +1,708 @@
+// Useful Galaxy stuff.
+var Galaxy =
+{
+ // Item types.
+ ITEM_HISTORY : "item_history",
+ ITEM_DATASET : "item_dataset",
+ ITEM_WORKFLOW : "item_workflow",
+ ITEM_PAGE : "item_page",
+ ITEM_VISUALIZATION : "item_visualization",
+
+ // Link dialogs.
+ DIALOG_HISTORY_LINK : "link_history",
+ DIALOG_DATASET_LINK : "link_dataset",
+ DIALOG_WORKFLOW_LINK : "link_workflow",
+ DIALOG_PAGE_LINK : "link_page",
+ DIALOG_VISUALIZATION_LINK : "link_visualization",
+
+ // Embed dialogs.
+ DIALOG_EMBED_HISTORY : "embed_history",
+ DIALOG_EMBED_DATASET : "embed_dataset",
+ DIALOG_EMBED_WORKFLOW : "embed_workflow",
+ DIALOG_EMBED_PAGE : "embed_page",
+ DIALOG_EMBED_VISUALIZATION : "embed_visualization",
+
+ // Annotation dialogs.
+ DIALOG_HISTORY_ANNOTATE : "history_annotate",
+};
+
+// Initialize Galaxy elements.
+function init_galaxy_elts(wym)
+{
+ // Set up events to make annotation easy.
+ $('.annotation', wym._doc.body).each( function()
+ {
+ $(this).click( function() {
+ // Works in Safari, not in Firefox.
+ var range = wym._doc.createRange();
+ range.selectNodeContents( this );
+ var selection = window.getSelection();
+ selection.removeAllRanges();
+ selection.addRange(range);
+ var t = "";
+ });
+ });
+
+};
+
+// Based on the dialog type, return a dictionary of information about an item
+function get_item_info( dialog_type )
+{
+ var
+ item_singular,
+ item_plural,
+ item_controller;
+ switch( dialog_type ) {
+ case( Galaxy.ITEM_HISTORY ):
+ item_singular = "History";
+ item_plural = "Histories";
+ item_controller = "history";
+ item_class = "History";
+ break;
+ case( Galaxy.ITEM_DATASET ):
+ item_singular = "Dataset";
+ item_plural = "Datasets";
+ item_controller = "dataset";
+ item_class = "HistoryDatasetAssociation";
+ break;
+ case( Galaxy.ITEM_WORKFLOW ):
+ item_singular = "Workflow";
+ item_plural = "Workflows";
+ item_controller = "workflow";
+ item_class = "StoredWorkflow";
+ break;
+ case( Galaxy.ITEM_PAGE ):
+ item_singular = "Page";
+ item_plural = "Pages";
+ item_controller = "page";
+ item_class = "Page";
+ break;
+ case( Galaxy.ITEM_VISUALIZATION ):
+ item_singular = "Visualization";
+ item_plural = "Visualizations";
+ item_controller = "visualization";
+ item_class = "Visualization";
+ break;
+ }
+
+ // Build ajax URL that lists items for selection.
+ var item_list_action = "list_" + item_plural.toLowerCase() + "_for_selection";
+ var ajax_url = list_objects_url.replace( "LIST_ACTION", item_list_action );
+
+ // Set up and return dict.
+ return {
+ singular : item_singular,
+ plural : item_plural,
+ controller : item_controller,
+ iclass : item_class,
+ list_ajax_url : ajax_url
+ };
+};
+
+// Make an item importable.
+function make_item_importable( item_controller, item_id, item_type )
+{
+ ajax_url = set_accessible_url.replace( "ITEM_CONTROLLER", item_controller );
+ $.ajax({
+ type: "POST",
+ url: ajax_url,
+ data: { id: item_id, accessible: 'True' },
+ error: function() { alert("Making " + item_type + " accessible failed"); }
+ });
+};
+
+// Completely replace WYM's dialog handling
+WYMeditor.editor.prototype.dialog = function( dialogType, dialogFeatures, bodyHtml ) {
+
+ var wym = this;
+ var sStamp = wym.uniqueStamp();
+ var selected = wym.selected();
+
+ // Swap out URL attribute for id/name attribute in link creation to enable anchor creation in page.
+ function set_link_id()
+ {
+ // When "set link id" link clicked, update UI.
+ $('#set_link_id').click( function()
+ {
+ // Set label.
+ $("#link_attribute_label").text("ID/Name");
+
+ // Set input elt class, value.
+ var attribute_input = $(".wym_href");
+ attribute_input.addClass("wym_id").removeClass("wym_href");
+ if (selected)
+ attribute_input.val( $(selected).attr('id') );
+
+ // Remove link.
+ $(this).remove();
+ });
+ }
+
+ // LINK DIALOG
+ if ( dialogType == WYMeditor.DIALOG_LINK ) {
+ if(selected) {
+ $(wym._options.hrefSelector).val($(selected).attr(WYMeditor.HREF));
+ $(wym._options.srcSelector).val($(selected).attr(WYMeditor.SRC));
+ $(wym._options.titleSelector).val($(selected).attr(WYMeditor.TITLE));
+ $(wym._options.altSelector).val($(selected).attr(WYMeditor.ALT));
+ }
+ // Get current URL, title.
+ var curURL, curTitle;
+ if (selected)
+ {
+ curURL = $(selected).attr("href");
+ if (curURL == undefined)
+ curURL = "";
+ curTitle = $(selected).attr("title");
+ if (curTitle == undefined)
+ curTitle = "";
+ }
+ show_modal(
+ "Create Link",
+ "<div><div><label id='link_attribute_label'>URL <span style='float: right; font-size: 90%'><a href='#' id='set_link_id'>Create in-page anchor</a></span></label><br><input type='text' class='wym_href' value='" + curURL + "' size='40' /></div>"
+ + "<div><label>Title</label><br><input type='text' class='wym_title' value='" + curTitle + "' size='40' /></div><div>",
+ {
+ "Make link": function() {
+ // Get URL, name/title.
+ var sUrl = $(wym._options.hrefSelector).val(),
+ sName = $(".wym_title").val();
+
+ if (sUrl && sName) {
+ // Create link.
+ wym._exec(WYMeditor.CREATE_LINK, sStamp);
+
+ // Set link attributes.
+ var link = $("a[href=" + sStamp + "]", wym._doc.body);
+ link.attr(WYMeditor.HREF, sUrl)
+ .attr(WYMeditor.TITLE, $(wym._options.titleSelector).val())
+ .attr("id", sName);
+
+ // If link's text is default (wym-...), change it to the title.
+ if (link.text().indexOf('wym-') === 0) {
+ link.text(sName);
+ }
+ }
+ hide_modal();
+ },
+ "Cancel": function() {
+ hide_modal();
+ }
+ },
+ {},
+ set_link_id
+ );
+ }
+
+ // IMAGE DIALOG
+ if ( dialogType == WYMeditor.DIALOG_IMAGE ) {
+ if(wym._selected_image) {
+ $(wym._options.dialogImageSelector + " " + wym._options.srcSelector)
+ .val($(wym._selected_image).attr(WYMeditor.SRC));
+ $(wym._options.dialogImageSelector + " " + wym._options.titleSelector)
+ .val($(wym._selected_image).attr(WYMeditor.TITLE));
+ $(wym._options.dialogImageSelector + " " + wym._options.altSelector)
+ .val($(wym._selected_image).attr(WYMeditor.ALT));
+ }
+ show_modal(
+ "Image",
+ "<div class='row'>"
+ + "<label>URL</label><br>"
+ + "<input type='text' class='wym_src' value='' size='40' />"
+ + "</div>"
+ + "<div class='row'>"
+ + "<label>Alt text</label><br>"
+ + "<input type='text' class='wym_alt' value='' size='40' />"
+ + "</div>"
+ + "<div class='row'>"
+ + "<label>Title</label><br>"
+ + "<input type='text' class='wym_title' value='' size='40' />"
+ + "</div>",
+ {
+ "Insert": function() {
+ var sUrl = $(wym._options.srcSelector).val();
+ if(sUrl.length > 0) {
+ wym._exec(WYMeditor.INSERT_IMAGE, sStamp);
+ $("img[src$=" + sStamp + "]", wym._doc.body)
+ .attr(WYMeditor.SRC, sUrl)
+ .attr(WYMeditor.TITLE, $(wym._options.titleSelector).val())
+ .attr(WYMeditor.ALT, $(wym._options.altSelector).val());
+ }
+ hide_modal();
+ },
+ "Cancel": function() {
+ hide_modal();
+ }
+ }
+ );
+ return;
+ }
+
+ // TABLE DIALOG
+ if ( dialogType == WYMeditor.DIALOG_TABLE ) {
+ show_modal(
+ "Table",
+ "<div class='row'>"
+ + "<label>Caption</label><br>"
+ + "<input type='text' class='wym_caption' value='' size='40' />"
+ + "</div>"
+ + "<div class='row'>"
+ + "<label>Summary</label><br>"
+ + "<input type='text' class='wym_summary' value='' size='40' />"
+ + "</div>"
+ + "<div class='row'>"
+ + "<label>Number Of Rows<br></label>"
+ + "<input type='text' class='wym_rows' value='3' size='3' />"
+ + "</div>"
+ + "<div class='row'>"
+ + "<label>Number Of Cols<br></label>"
+ + "<input type='text' class='wym_cols' value='2' size='3' />"
+ + "</div>",
+ {
+ "Insert": function() {
+ var iRows = $(wym._options.rowsSelector).val();
+ var iCols = $(wym._options.colsSelector).val();
+
+ if(iRows > 0 && iCols > 0) {
+
+ var table = wym._doc.createElement(WYMeditor.TABLE);
+ var newRow = null;
+ var newCol = null;
+
+ var sCaption = $(wym._options.captionSelector).val();
+
+ //we create the caption
+ var newCaption = table.createCaption();
+ newCaption.innerHTML = sCaption;
+
+ //we create the rows and cells
+ for(x=0; x<iRows; x++) {
+ newRow = table.insertRow(x);
+ for(y=0; y<iCols; y++) {newRow.insertCell(y);}
+ }
+
+ //set the summary attr
+ $(table).attr('summary',
+ $(wym._options.summarySelector).val());
+
+ //append the table after the selected container
+ var node = $(wym.findUp(wym.container(),
+ WYMeditor.MAIN_CONTAINERS)).get(0);
+ if(!node || !node.parentNode) $(wym._doc.body).append(table);
+ else $(node).after(table);
+ }
+ hide_modal();
+ },
+ "Cancel": function() {
+ hide_modal();
+ }
+ }
+ );
+ }
+
+ // INSERT "GALAXY ITEM" LINK DIALOG
+ if ( dialogType == Galaxy.DIALOG_HISTORY_LINK || dialogType == Galaxy.DIALOG_DATASET_LINK ||
+ dialogType == Galaxy.DIALOG_WORKFLOW_LINK || dialogType == Galaxy.DIALOG_PAGE_LINK ||
+ dialogType == Galaxy.DIALOG_VISUALIZATION_LINK ) {
+ // Based on item type, set useful vars.
+ var item_info;
+ switch(dialogType)
+ {
+ case(Galaxy.DIALOG_HISTORY_LINK):
+ item_info = get_item_info(Galaxy.ITEM_HISTORY);
+ break;
+ case(Galaxy.DIALOG_DATASET_LINK):
+ item_info = get_item_info(Galaxy.ITEM_DATASET);
+ break;
+ case(Galaxy.DIALOG_WORKFLOW_LINK):
+ item_info = get_item_info(Galaxy.ITEM_WORKFLOW);
+ break;
+ case(Galaxy.DIALOG_PAGE_LINK):
+ item_info = get_item_info(Galaxy.ITEM_PAGE);
+ break;
+ case(Galaxy.DIALOG_VISUALIZATION_LINK):
+ item_info = get_item_info(Galaxy.ITEM_VISUALIZATION);
+ break;
+ }
+
+ $.ajax(
+ {
+ url: item_info.list_ajax_url,
+ data: {},
+ error: function() { alert( "Failed to list " + item_info.plural.toLowerCase() + " for selection"); },
+ success: function(table_html)
+ {
+ show_modal(
+ "Insert Link to " + item_info.singular,
+ table_html +
+ "<div><input id='make-importable' type='checkbox' checked/>" +
+ "Make the selected " + item_info.plural.toLowerCase() + " accessible so that they can viewed by everyone.</div>"
+ ,
+ {
+ "Insert": function()
+ {
+ // Make selected items accessible (importable) ?
+ var make_importable = false;
+ if ( $('#make-importable:checked').val() !== null )
+ make_importable = true;
+
+ // Insert links to history for each checked item.
+ var item_ids = new Array();
+ $('input[name=id]:checked').each(function() {
+ var item_id = $(this).val();
+
+ // Make item importable?
+ if (make_importable)
+ make_item_importable(item_info.controller, item_id, item_info.singular);
+
+ // Insert link(s) to item(s). This is done by getting item info and then manipulating wym.
+ url_template = get_name_and_link_url + item_id;
+ ajax_url = url_template.replace( "ITEM_CONTROLLER", item_info.controller);
+ $.getJSON( ajax_url, function( returned_item_info ) {
+ // Get link text.
+ wym._exec(WYMeditor.CREATE_LINK, sStamp);
+ var link_text = $("a[href=" + sStamp + "]", wym._doc.body).text();
+
+ // Insert link: need to do different actions depending on link text.
+ if (
+ link_text == "" // Firefox.
+ ||
+ link_text == sStamp // Safari
+ )
+ {
+ // User selected no text; create link from scratch and use default text.
+ wym.insert("<a href='" + returned_item_info.link + "'>" + item_info.singular + " '" + returned_item_info.name + "'</a>");
+ }
+ else
+ {
+ // Link created from selected text; add href and title.
+ $("a[href=" + sStamp + "]", wym._doc.body).attr(WYMeditor.HREF, returned_item_info.link).attr(WYMeditor.TITLE, item_info.singular + item_id);
+ }
+ });
+ });
+
+ hide_modal();
+ },
+ "Cancel": function()
+ {
+ hide_modal();
+ }
+ }
+ );
+ }
+ });
+ }
+ // EMBED GALAXY OBJECT DIALOGS
+ if ( dialogType == Galaxy.DIALOG_EMBED_HISTORY || dialogType == Galaxy.DIALOG_EMBED_DATASET || dialogType == Galaxy.DIALOG_EMBED_WORKFLOW || dialogType == Galaxy.DIALOG_EMBED_PAGE || dialogType == Galaxy.DIALOG_EMBED_VISUALIZATION ) {
+ // Based on item type, set useful vars.
+ var item_info;
+ switch(dialogType)
+ {
+ case(Galaxy.DIALOG_EMBED_HISTORY):
+ item_info = get_item_info(Galaxy.ITEM_HISTORY);
+ break;
+ case(Galaxy.DIALOG_EMBED_DATASET):
+ item_info = get_item_info(Galaxy.ITEM_DATASET);
+ break;
+ case(Galaxy.DIALOG_EMBED_WORKFLOW):
+ item_info = get_item_info(Galaxy.ITEM_WORKFLOW);
+ break;
+ case(Galaxy.DIALOG_EMBED_PAGE):
+ item_info = get_item_info(Galaxy.ITEM_PAGE);
+ break;
+ case(Galaxy.DIALOG_EMBED_VISUALIZATION):
+ item_info = get_item_info(Galaxy.ITEM_VISUALIZATION);
+ break;
+ }
+
+ $.ajax(
+ {
+ url: item_info.list_ajax_url,
+ data: {},
+ error: function() { alert( "Failed to list " + item_info.plural.toLowerCase() + " for selection"); },
+ success: function(list_html)
+ {
+ // Can make histories, workflows importable; cannot make datasets importable.
+ if (dialogType == Galaxy.DIALOG_EMBED_HISTORY || dialogType == Galaxy.DIALOG_EMBED_WORKFLOW
+ || dialogType == Galaxy.DIALOG_EMBED_VISUALIZATION)
+ list_html = list_html + "<div><input id='make-importable' type='checkbox' checked/>" +
+ "Make the selected " + item_info.plural.toLowerCase() + " accessible so that they can viewed by everyone.</div>";
+ show_modal(
+ "Embed " + item_info.plural,
+ list_html,
+ {
+ "Embed": function()
+ {
+ // Make selected items accessible (importable) ?
+ var make_importable = false;
+ if ( $('#make-importable:checked').val() != null )
+ make_importable = true;
+
+ $('input[name=id]:checked').each(function() {
+ // Get item ID and name.
+ var item_id = $(this).val();
+ // Use ':first' because there are many labels in table; the first one is the item name.
+ var item_name = $("label[for='" + item_id + "']:first").text();
+
+ if (make_importable)
+ make_item_importable(item_info.controller, item_id, item_info.singular);
+
+ // Embedded item HTML; item class is embedded in div container classes; this is necessary because the editor strips
+ // all non-standard attributes when it returns its content (e.g. it will not return an element attribute of the form
+ // item_class='History').
+ var item_elt_id = item_info.iclass + "-" + item_id;
+ var item_embed_html =
+ "<p><div id='" + item_elt_id + "' class='embedded-item " + item_info.singular.toLowerCase() +
+ " placeholder'> \
+ <p class='title'>Embedded Galaxy " + item_info.singular + " '" + item_name + "'</p> \
+ <p class='content'> \
+ [Do not edit this block; Galaxy will fill it in with the annotated " +
+ item_info.singular.toLowerCase() + " when it is displayed.] \
+ </p> \
+ </div></p>";
+
+ // Insert embedded item into document.
+ wym.insert(" "); // Needed to prevent insertion from occurring in child element in webkit browsers.
+ wym.insert(item_embed_html);
+
+ // TODO: can we fix this?
+ // Due to oddities of wym.insert() [likely due to inserting a <div> and/or a complete paragraph], an
+ // empty paragraph (or two!) may be included either before an embedded item. Remove these paragraphs.
+ $("#" + item_elt_id, wym._doc.body).each( function() {
+ // Remove previous empty paragraphs.
+ var removing = true;
+ while (removing)
+ {
+ var prev_elt = $(this).prev();
+ if ( prev_elt.length != 0 && jQuery.trim(prev_elt.text()) == "" )
+ prev_elt.remove();
+ else
+ removing = false;
+ }
+ });
+
+ });
+ hide_modal();
+ },
+ "Cancel": function()
+ {
+ hide_modal();
+ }
+ }
+ );
+ }
+ });
+ }
+
+ // ANNOTATE HISTORY DIALOG
+ if ( dialogType == Galaxy.DIALOG_ANNOTATE_HISTORY ) {
+ $.ajax(
+ {
+ url: list_histories_for_selection_url,
+ data: {},
+ error: function() { alert( "Grid refresh failed" ) },
+ success: function(table_html)
+ {
+ show_modal(
+ "Insert Link to History",
+ table_html,
+ {
+ "Annotate": function()
+ {
+ // Insert links to history for each checked item.
+ var item_ids = new Array();
+ $('input[name=id]:checked').each(function() {
+ var item_id = $(this).val();
+
+ // Get annotation table for history.
+ $.ajax(
+ {
+ url: get_history_annotation_table_url,
+ data: { id : item_id },
+ error: function() { alert( "Grid refresh failed" ) },
+ success: function(result)
+ {
+ // Insert into document.
+ wym.insert(result);
+
+ init_galaxy_elts(wym);
+
+ }
+ });
+ });
+
+ hide_modal();
+ },
+ "Cancel": function()
+ {
+ hide_modal();
+ }
+ }
+ );
+ }
+ });
+ }
+};
+
+$(function(){
+ // Generic error handling
+ $(document).ajaxError( function ( e, x ) {
+ // console.log( e, x );
+ var message = x.responseText || x.statusText || "Could not connect to server";
+ show_modal( "Server error", message, { "Ignore error" : hide_modal } );
+ return false;
+ });
+ // Create editor
+ $("[name=page_content]").wymeditor( {
+ skin: 'galaxy',
+ basePath: editor_base_path,
+ iframeBasePath: iframe_base_path,
+ boxHtml: "<table class='wym_box' width='100%' height='100%'>"
+ + "<tr><td><div class='wym_area_top'>"
+ + WYMeditor.TOOLS
+ + "</div></td></tr>"
+ + "<tr height='100%'><td>"
+ + "<div class='wym_area_main' style='height: 100%;'>"
+ // + WYMeditor.HTML
+ + WYMeditor.IFRAME
+ + WYMeditor.STATUS
+ + "</div>"
+ + "</div>"
+ + "</td></tr></table>",
+ 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'},
+ ]
+ });
+ // Get the editor object
+ var editor = $.wymeditors(0);
+ var save = function ( callback ) {
+ show_modal( "Saving page", "progress" );
+
+ // Do save.
+ $.ajax( {
+ url: save_url,
+ type: "POST",
+ data: {
+ id: page_id,
+ content: editor.xhtml(),
+ annotations: JSON.stringify(new Object()),
+ // annotations: JSON.stringify(annotations),
+ "_": "true"
+ },
+ success: function() {
+ callback();
+ }
+ });
+ }
+ // Save button
+ $("#save-button").click( function() {
+ save( function() { hide_modal(); } )
+ });
+ // Close button
+ $("#close-button").click(function() {
+ // var new_content = editor.xhtml();
+ // var changed = ( initial_content != new_content );
+ var changed = false;
+ if ( changed ) {
+ var do_close = function() {
+ window.onbeforeunload = undefined;
+ 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() {
+ save( do_close );
+ }
+ }, {
+ "Don't Save": do_close
+ } );
+ } else {
+ window.document.location = page_list_url;
+ }
+ });
+
+ // Initialize galaxy elements.
+ //init_galaxy_elts(editor);
+
+ //
+ // Containers, Galaxy style
+ //
+ var containers_menu = $("<div class='galaxy-page-editor-button'><a id='insert-galaxy-link' class='action-button popup' href='#'>Paragraph type</a></div>");
+ $(".wym_area_top").append( containers_menu );
+
+ // Add menu options.
+ var items = {}
+ $.each( editor._options.containersItems, function( k, v ) {
+ var tagname = v.name;
+ items[ v.title.replace( '_', ' ' ) ] = function() { editor.container( tagname ) }
+ });
+ make_popupmenu( containers_menu, items);
+
+ //
+ // Create 'Insert Link to Galaxy Object' menu.
+ //
+
+ // Add menu button.
+ var insert_link_menu_button = $("<div><a id='insert-galaxy-link' class='action-button popup' href='#'>Insert Link to Galaxy Object</a></div>").addClass('galaxy-page-editor-button');
+ $(".wym_area_top").append(insert_link_menu_button);
+
+ // Add menu options.
+ make_popupmenu( insert_link_menu_button, {
+ "Insert History Link": function() {
+ editor.dialog(Galaxy.DIALOG_HISTORY_LINK);
+ },
+ "Insert Dataset Link": function() {
+ editor.dialog(Galaxy.DIALOG_DATASET_LINK);
+ },
+ "Insert Workflow Link": function() {
+ editor.dialog(Galaxy.DIALOG_WORKFLOW_LINK);
+ },
+ "Insert Page Link": function() {
+ editor.dialog(Galaxy.DIALOG_PAGE_LINK);
+ },
+ "Insert Visualization Link": function() {
+ editor.dialog(Galaxy.DIALOG_VISUALIZATION_LINK);
+ },
+ });
+
+ //
+ // Create 'Embed Galaxy Object' menu.
+ //
+
+ // Add menu button.
+ var embed_object_button = $("<div><a id='embed-galaxy-object' class='action-button popup' href='#'>Embed Galaxy Object</a></div>").addClass('galaxy-page-editor-button');
+ $(".wym_area_top").append(embed_object_button);
+
+ // Add menu options.
+ make_popupmenu( embed_object_button, {
+ "Embed History": function() {
+ editor.dialog(Galaxy.DIALOG_EMBED_HISTORY);
+ },
+ "Embed Dataset": function() {
+ editor.dialog(Galaxy.DIALOG_EMBED_DATASET);
+ },
+ "Embed Workflow": function() {
+ editor.dialog(Galaxy.DIALOG_EMBED_WORKFLOW);
+ },
+ "Embed Visualization": function() {
+ editor.dialog(Galaxy.DIALOG_EMBED_VISUALIZATION);
+ },
+ //"Embed Page": function() {
+ // editor.dialog(Galaxy.DIALOG_EMBED_PAGE);
+ //}
+ });
+});
\ No newline at end of file
diff -r 5b27b92310d044cfd2f9b3711e5ef446048de110 -r 2cabbf3687634090fbbc024726f15f43db4ff314 static/scripts/libs/jquery/jquery.wymeditor.js
--- a/static/scripts/libs/jquery/jquery.wymeditor.js
+++ b/static/scripts/libs/jquery/jquery.wymeditor.js
@@ -713,7 +713,8 @@
else if (jQuery.browser.opera) {
var WymClass = new WYMeditor.WymClassOpera(this);
}
- else if (jQuery.browser.safari) {
+ // Galaxy HACK: add Chrome to browser detection; this is fixed in later versions of WYMEditor.
+ else if (jQuery.browser.safari || jQuery.browser.chrome) {
var WymClass = new WYMeditor.WymClassSafari(this);
}
diff -r 5b27b92310d044cfd2f9b3711e5ef446048de110 -r 2cabbf3687634090fbbc024726f15f43db4ff314 static/scripts/packed/galaxy.frame.js
--- a/static/scripts/packed/galaxy.frame.js
+++ b/static/scripts/packed/galaxy.frame.js
@@ -1,1 +1,1 @@
-define(["utils/galaxy.css","libs/backbone/backbone-relational"],function(b){b.load_file("/static/style/galaxy.frame.css");b.load_file("/static/style/base.css");var a=Backbone.View.extend({el:"#everything",el_header:"#masthead",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:10},cols:0,top:0,top_max:0,frame_counter:0,frame_counter_id:0,frame_list:[],galaxy_frame_shadow:null,visible:false,active:false,initialize:function(d){if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;$(this.el).append(this.frame_template_background());$(this.el).append(this.frame_template_menu());$(this.el_header).append(this.frame_template_load());var e="#galaxy-frame-shadow";$(this.el).append(this.frame_template_shadow(e.substring(1)));this.galaxy_frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_resize(this.galaxy_frame_shadow,{width:0,height:0});this.frame_list[e]=this.galaxy_frame_shadow;this.panel_refresh();this.event_initialize();var c=this;$(window).resize(function(){c.panel_refresh()});window.onbeforeunload=function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}},is_mobile:function(){return navigator.userAgent.match(/mobile|(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i)},event:{type:null,target:null,xy:null},event_initialize:function(){this.events={mousedown:"event_frame_mouse_down","mousedown .f-close":"event_frame_close","mousedown .f-pin":"event_frame_lock",mousemove:"event_frame_mouse_move",mouseup:"event_frame_mouse_up",mouseleave:"event_frame_mouse_up","mousedown .galaxy-frame-active":"event_panel_active","mousedown .galaxy-frame-load":"event_panel_load","mousedown .galaxy-frame-background":"event_panel_load",mousewheel:"event_panel_scroll",DOMMouseScroll:"event_panel_scroll","mousedown .galaxy-frame-scroll-up":"event_panel_scroll_up","mousedown .galaxy-frame-scroll-down":"event_panel_scroll_down"};this.delegateEvents(this.events)},event_frame_mouse_down:function(c){c.preventDefault();if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}this.event.target=this.event_get_frame(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this.frame_drag_start(this.event.target)},event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this.frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this.frame_resize(this.event.target,h);h.width=this.to_grid_coord("width",h.width)+1;h.height=this.to_grid_coord("height",h.height)+1;h.width=this.to_pixel_coord("width",h.width);h.height=this.to_pixel_coord("height",h.height);this.frame_resize(this.galaxy_frame_shadow,h);this.frame_insert(this.galaxy_frame_shadow,{top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this.frame_offset(this.event.target,h);var c={top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this.frame_insert(this.galaxy_frame_shadow,c)}},event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this.frame_drag_stop(this.event.target);this.event.type=null},event_frame_close:function(d){if(this.event.type!==null){return}var f=this.event_get_frame(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c.panel_refresh(true);c.panel_animation_complete();if(c.visible&&c.frame_counter==0){c.panel_show_hide()}})},event_frame_lock:function(c){if(this.event.type!==null){return}var d=this.event_get_frame(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("f-toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("f-toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},event_panel_load:function(){if(this.event.type!==null){return}this.panel_show_hide()},event_panel_active:function(){if(this.event.type!==null){return}this.panel_active_disable()},event_panel_scroll:function(c){var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this.panel_scroll(d)},event_panel_scroll_up:function(){this.panel_scroll(-this.options.scroll)},event_panel_scroll_down:function(){this.panel_scroll(this.options.scroll)},event_get_frame:function(c){return this.frame_list["#"+$(c).closest(".galaxy-frame").attr("id")]},frame_drag_start:function(d){this.frame_focus(d,true);var c=this.frame_screen(d);this.frame_resize(this.galaxy_frame_shadow,c);this.frame_grid(this.galaxy_frame_shadow,d.grid_location);d.grid_location=null;$(this.galaxy_frame_shadow.id).show();$(".f-cover").show()},frame_drag_stop:function(d){this.frame_focus(d,false);var c=this.frame_screen(this.galaxy_frame_shadow);this.frame_resize(d,c);this.frame_grid(d,this.galaxy_frame_shadow.grid_location,true);this.galaxy_frame_shadow.grid_location=null;$(this.galaxy_frame_shadow.id).hide();$(".f-cover").hide();this.panel_animation_complete()},to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},to_grid:function(c){return{top:this.to_grid_coord("top",c.top),left:this.to_grid_coord("left",c.left),width:this.to_grid_coord("width",c.width),height:this.to_grid_coord("height",c.height)}},to_pixel:function(c){return{top:this.to_pixel_coord("top",c.top),left:this.to_pixel_coord("left",c.left),width:this.to_pixel_coord("width",c.width),height:this.to_pixel_coord("height",c.height)}},is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},location_rank:function(c){return(c.top*this.cols)+c.left},menu_refresh:function(){$(".galaxy-frame-load .number").text(this.frame_counter);if(this.frame_counter==0){$(".galaxy-frame-load").hide()}else{$(".galaxy-frame-load").show()}if(this.top==this.options.top_min){$(".galaxy-frame-scroll-up").hide()}else{$(".galaxy-frame-scroll-up").show()}if(this.top==this.top_max){$(".galaxy-frame-scroll-down").hide()}else{$(".galaxy-frame-scroll-down").show()}},panel_animation_complete:function(){var c=this;$(".galaxy-frame").promise().done(function(){c.panel_scroll(0,true)})},panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this.frame_insert(null,null,c)},panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this.frame_offset(g,f,c)}}this.top=e}this.menu_refresh()},panel_show_hide:function(){if(this.visible){this.visible=false;for(var c in this.frame_list){$(this.frame_list[c].id).fadeOut("fast")}$(".galaxy-frame-load .icon").addClass("fa-icon-eye-close");$(".galaxy-frame-load .icon").removeClass("fa-icon-eye-open");$(".galaxy-frame-background").hide();$(".galaxy-frame-menu").hide()}else{this.visible=true;for(var c in this.frame_list){$(this.frame_list[c].id).fadeIn("fast")}$(".galaxy-frame-load .icon").addClass("fa-icon-eye-open");$(".galaxy-frame-load .icon").removeClass("fa-icon-eye-close");$(this.galaxy_frame_shadow.id).hide();$(".galaxy-frame-background").show();this.menu_refresh()}},panel_active_disable:function(){if(this.active){this.active=false;$(".galaxy-frame-active .icon").removeClass("f-toggle")}else{this.active=true;$(".galaxy-frame-active .icon").addClass("f-toggle")}},frame_new:function(d){if(!this.active){if(d.center){var c=$(window.parent.document).find("iframe#galaxy_main");c.attr("src",d.content)}else{window.location=d.content}return}var e="#galaxy-frame-"+(this.frame_counter_id++);if($(e).length===0&&this.options.frame_max>this.frame_counter){this.top=this.options.top_min;d.width=this.to_pixel_coord("width",this.options.frame.cols);d.height=this.to_pixel_coord("height",this.options.frame.rows);$(this.el).append(this.frame_template(e.substring(1),d.title,d.type,d.content));var f={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_counter++;this.frame_list[e]=f;this.frame_resize(f,{width:d.width,height:d.height});this.frame_insert(f,{top:0,left:0},true);if(!this.visible){this.panel_show_hide()}}else{alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").")}},frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this.location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this.frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this.menu_refresh()},frame_place:function(k,d){k.grid_location=null;var h=this.to_grid(this.frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this.is_collision(h)){c=true;break}}if(c){break}}if(c){this.frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},frame_focus:function(e,c){var d=parseInt(b.get_attribute("galaxy-frame","z-index"))+(c?1:0);$(e.id).css("z-index",d)},frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this.frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c.frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},frame_grid:function(e,c,d){e.grid_location=c;this.frame_offset(e,this.to_pixel(c),d);e.grid_rank=this.location_rank(c)},frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},frame_template:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="galaxy-frame f-corner"><div class="f-header f-corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa-icon-pushpin"></span><span class="f-icon f-close fa-icon-trash"></span></div><div class="f-content f-corner">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon f-corner fa-icon-resize-full"></span></div>'},frame_template_shadow:function(c){return'<div id="'+c+'" class="galaxy-frame-shadow f-corner"></div>'},frame_template_background:function(){return'<div class="galaxy-frame-background"></div>'},frame_template_load:function(){return'<div class="galaxy-frame-load f-corner"><div class="number f-corner">0</div><div class="icon fa-icon-2x"></div></div><div class="galaxy-frame-active f-corner"><div class="icon fa-icon-2x fa-icon-th"></div></div>'},frame_template_menu:function(){return'<div class="galaxy-frame-scroll-up galaxy-frame-menu fa-icon-chevron-up fa-icon-2x"></div><div class="galaxy-frame-scroll-down galaxy-frame-menu fa-icon-chevron-down fa-icon-2x"></div>'}});return{GalaxyFrameManager:a}});
\ No newline at end of file
+define(["utils/galaxy.css","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el:"#everything",el_header:"#masthead",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:10},cols:0,top:0,top_max:0,frame_counter:0,frame_counter_id:0,frame_list:[],galaxy_frame_shadow:null,visible:false,active:false,initialize:function(d){b.load_file(d.url.styles+"/galaxy.frame.css");if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;$(this.el).append(this.frame_template_background());$(this.el).append(this.frame_template_menu());$(this.el_header).append(this.frame_template_header());var e="#galaxy-frame-shadow";$(this.el).append(this.frame_template_shadow(e.substring(1)));this.galaxy_frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_resize(this.galaxy_frame_shadow,{width:0,height:0});this.frame_list[e]=this.galaxy_frame_shadow;this.panel_refresh();this.event_initialize();var c=this;$(window).resize(function(){c.panel_refresh()});window.onbeforeunload=function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}},is_mobile:function(){return navigator.userAgent.match(/mobile|(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i)},event:{type:null,target:null,xy:null},event_initialize:function(){this.events={mousemove:"event_frame_mouse_move",mouseup:"event_frame_mouse_up",mouseleave:"event_frame_mouse_up",mousewheel:"event_panel_scroll",DOMMouseScroll:"event_panel_scroll","mousedown .galaxy-frame":"event_frame_mouse_down","mousedown .galaxy-frame-active":"event_panel_active","mousedown .galaxy-frame-load":"event_panel_load","mousedown .galaxy-frame-background":"event_panel_load","mousedown .galaxy-frame-scroll-up":"event_panel_scroll_up","mousedown .galaxy-frame-scroll-down":"event_panel_scroll_down","mousedown .f-close":"event_frame_close","mousedown .f-pin":"event_frame_lock"};this.delegateEvents(this.events)},event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this.event_get_frame(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this.frame_drag_start(this.event.target)},event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this.frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this.frame_resize(this.event.target,h);h.width=this.to_grid_coord("width",h.width)+1;h.height=this.to_grid_coord("height",h.height)+1;h.width=this.to_pixel_coord("width",h.width);h.height=this.to_pixel_coord("height",h.height);this.frame_resize(this.galaxy_frame_shadow,h);this.frame_insert(this.galaxy_frame_shadow,{top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this.frame_offset(this.event.target,h);var c={top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this.frame_insert(this.galaxy_frame_shadow,c)}},event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this.frame_drag_stop(this.event.target);this.event.type=null},event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this.event_get_frame(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c.panel_refresh(true);c.panel_animation_complete();if(c.visible&&c.frame_counter==0){c.panel_show_hide()}})},event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this.event_get_frame(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("f-toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("f-toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},event_panel_load:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_show_hide()},event_panel_active:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_active_disable()},event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this.panel_scroll(d)},event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(-this.options.scroll)},event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(this.options.scroll)},event_get_frame:function(c){return this.frame_list["#"+$(c).closest(".galaxy-frame").attr("id")]},frame_drag_start:function(d){this.frame_focus(d,true);var c=this.frame_screen(d);this.frame_resize(this.galaxy_frame_shadow,c);this.frame_grid(this.galaxy_frame_shadow,d.grid_location);d.grid_location=null;$(this.galaxy_frame_shadow.id).show();$(".f-cover").show()},frame_drag_stop:function(d){this.frame_focus(d,false);var c=this.frame_screen(this.galaxy_frame_shadow);this.frame_resize(d,c);this.frame_grid(d,this.galaxy_frame_shadow.grid_location,true);this.galaxy_frame_shadow.grid_location=null;$(this.galaxy_frame_shadow.id).hide();$(".f-cover").hide();this.panel_animation_complete()},to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},to_grid:function(c){return{top:this.to_grid_coord("top",c.top),left:this.to_grid_coord("left",c.left),width:this.to_grid_coord("width",c.width),height:this.to_grid_coord("height",c.height)}},to_pixel:function(c){return{top:this.to_pixel_coord("top",c.top),left:this.to_pixel_coord("left",c.left),width:this.to_pixel_coord("width",c.width),height:this.to_pixel_coord("height",c.height)}},is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},location_rank:function(c){return(c.top*this.cols)+c.left},menu_refresh:function(){$(".galaxy-frame-load .number").text(this.frame_counter);if(this.frame_counter==0){$(".galaxy-frame-load").hide()}else{$(".galaxy-frame-load").show()}if(this.top==this.options.top_min){$(".galaxy-frame-scroll-up").hide()}else{$(".galaxy-frame-scroll-up").show()}if(this.top==this.top_max){$(".galaxy-frame-scroll-down").hide()}else{$(".galaxy-frame-scroll-down").show()}},panel_animation_complete:function(){var c=this;$(".galaxy-frame").promise().done(function(){c.panel_scroll(0,true)})},panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this.frame_insert(null,null,c)},panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this.frame_offset(g,f,c)}}this.top=e}this.menu_refresh()},panel_show_hide:function(){if(this.visible){this.visible=false;for(var c in this.frame_list){$(this.frame_list[c].id).fadeOut("fast")}$(".galaxy-frame-load .icon").addClass("fa-icon-eye-close");$(".galaxy-frame-load .icon").removeClass("fa-icon-eye-open");$(".galaxy-frame-background").hide();$(".galaxy-frame-menu").hide()}else{this.visible=true;for(var c in this.frame_list){$(this.frame_list[c].id).fadeIn("fast")}$(".galaxy-frame-load .icon").addClass("fa-icon-eye-open");$(".galaxy-frame-load .icon").removeClass("fa-icon-eye-close");$(this.galaxy_frame_shadow.id).hide();$(".galaxy-frame-background").show();this.menu_refresh()}},panel_active_disable:function(){if(this.active){this.active=false;$(".galaxy-frame-active .icon").removeClass("f-toggle");if(this.visible){this.panel_show_hide()}}else{this.active=true;$(".galaxy-frame-active .icon").addClass("f-toggle")}},frame_new:function(d){if(!this.active){if(d.center){var c=$(window.parent.document).find("iframe#galaxy_main");c.attr("src",d.content)}else{window.location=d.content}return}var e="#galaxy-frame-"+(this.frame_counter_id++);if($(e).length===0&&this.options.frame_max>this.frame_counter){this.top=this.options.top_min;d.width=this.to_pixel_coord("width",this.options.frame.cols);d.height=this.to_pixel_coord("height",this.options.frame.rows);$(this.el).append(this.frame_template(e.substring(1),d.title,d.type,d.content));var f={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_counter++;this.frame_list[e]=f;this.frame_resize(f,{width:d.width,height:d.height});this.frame_insert(f,{top:0,left:0},true);if(!this.visible){this.panel_show_hide()}}else{alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").")}},frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this.location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this.frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this.menu_refresh()},frame_place:function(k,d){k.grid_location=null;var h=this.to_grid(this.frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this.is_collision(h)){c=true;break}}if(c){break}}if(c){this.frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},frame_focus:function(e,c){var d=parseInt(b.get_attribute("galaxy-frame","z-index"))+(c?1:0);$(e.id).css("z-index",d)},frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this.frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c.frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},frame_grid:function(e,c,d){e.grid_location=c;this.frame_offset(e,this.to_pixel(c),d);e.grid_rank=this.location_rank(c)},frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},frame_template:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="galaxy-frame f-corner"><div class="f-header f-corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa-icon-pushpin"></span><span class="f-icon f-close fa-icon-trash"></span></div><div class="f-content f-corner">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon f-corner fa-icon-resize-full"></span></div>'},frame_template_shadow:function(c){return'<div id="'+c+'" class="galaxy-frame-shadow f-corner"></div>'},frame_template_background:function(){return'<div class="galaxy-frame-background"></div>'},frame_template_header:function(){return'<div class="galaxy-frame-load f-corner"><div class="number f-corner">0</div><div class="icon fa-icon-2x"></div></div><div class="galaxy-frame-active f-corner" style="position: absolute; top: 8px;"><div class="icon fa-icon-2x fa-icon-th"></div></div>'},frame_template_menu:function(){return'<div class="galaxy-frame-scroll-up galaxy-frame-menu fa-icon-chevron-up fa-icon-2x"></div><div class="galaxy-frame-scroll-down galaxy-frame-menu fa-icon-chevron-down fa-icon-2x"></div>'}});return{GalaxyFrameManager:a}});
\ No newline at end of file
diff -r 5b27b92310d044cfd2f9b3711e5ef446048de110 -r 2cabbf3687634090fbbc024726f15f43db4ff314 static/scripts/packed/galaxy.pages.js
--- /dev/null
+++ b/static/scripts/packed/galaxy.pages.js
@@ -0,0 +1,1 @@
+var Galaxy={ITEM_HISTORY:"item_history",ITEM_DATASET:"item_dataset",ITEM_WORKFLOW:"item_workflow",ITEM_PAGE:"item_page",ITEM_VISUALIZATION:"item_visualization",DIALOG_HISTORY_LINK:"link_history",DIALOG_DATASET_LINK:"link_dataset",DIALOG_WORKFLOW_LINK:"link_workflow",DIALOG_PAGE_LINK:"link_page",DIALOG_VISUALIZATION_LINK:"link_visualization",DIALOG_EMBED_HISTORY:"embed_history",DIALOG_EMBED_DATASET:"embed_dataset",DIALOG_EMBED_WORKFLOW:"embed_workflow",DIALOG_EMBED_PAGE:"embed_page",DIALOG_EMBED_VISUALIZATION:"embed_visualization",DIALOG_HISTORY_ANNOTATE:"history_annotate",};function init_galaxy_elts(a){$(".annotation",a._doc.body).each(function(){$(this).click(function(){var b=a._doc.createRange();b.selectNodeContents(this);var d=window.getSelection();d.removeAllRanges();d.addRange(b);var c=""})})}function get_item_info(d){var f,c,b;switch(d){case (Galaxy.ITEM_HISTORY):f="History";c="Histories";b="history";item_class="History";break;case (Galaxy.ITEM_DATASET):f="Dataset";c="Datasets";b="dataset";item_class="HistoryDatasetAssociation";break;case (Galaxy.ITEM_WORKFLOW):f="Workflow";c="Workflows";b="workflow";item_class="StoredWorkflow";break;case (Galaxy.ITEM_PAGE):f="Page";c="Pages";b="page";item_class="Page";break;case (Galaxy.ITEM_VISUALIZATION):f="Visualization";c="Visualizations";b="visualization";item_class="Visualization";break}var e="list_"+c.toLowerCase()+"_for_selection";var a=list_objects_url.replace("LIST_ACTION",e);return{singular:f,plural:c,controller:b,iclass:item_class,list_ajax_url:a}}function make_item_importable(a,c,b){ajax_url=set_accessible_url.replace("ITEM_CONTROLLER",a);$.ajax({type:"POST",url:ajax_url,data:{id:c,accessible:"True"},error:function(){alert("Making "+b+" accessible failed")}})}WYMeditor.editor.prototype.dialog=function(i,e,g){var a=this;var b=a.uniqueStamp();var f=a.selected();function h(){$("#set_link_id").click(function(){$("#link_attribute_label").text("ID/Name");var k=$(".wym_href");k.addClass("wym_id").removeClass("wym_href");if(f){k.val($(f).attr("id"))}$(this).remove()})}if(i==WYMeditor.DIALOG_LINK){if(f){$(a._options.hrefSelector).val($(f).attr(WYMeditor.HREF));$(a._options.srcSelector).val($(f).attr(WYMeditor.SRC));$(a._options.titleSelector).val($(f).attr(WYMeditor.TITLE));$(a._options.altSelector).val($(f).attr(WYMeditor.ALT))}var c,d;if(f){c=$(f).attr("href");if(c==undefined){c=""}d=$(f).attr("title");if(d==undefined){d=""}}show_modal("Create Link","<div><div><label id='link_attribute_label'>URL <span style='float: right; font-size: 90%'><a href='#' id='set_link_id'>Create in-page anchor</a></span></label><br><input type='text' class='wym_href' value='"+c+"' size='40' /></div><div><label>Title</label><br><input type='text' class='wym_title' value='"+d+"' size='40' /></div><div>",{"Make link":function(){var l=$(a._options.hrefSelector).val(),m=$(".wym_title").val();if(l&&m){a._exec(WYMeditor.CREATE_LINK,b);var k=$("a[href="+b+"]",a._doc.body);k.attr(WYMeditor.HREF,l).attr(WYMeditor.TITLE,$(a._options.titleSelector).val()).attr("id",m);if(k.text().indexOf("wym-")===0){k.text(m)}}hide_modal()},Cancel:function(){hide_modal()}},{},h)}if(i==WYMeditor.DIALOG_IMAGE){if(a._selected_image){$(a._options.dialogImageSelector+" "+a._options.srcSelector).val($(a._selected_image).attr(WYMeditor.SRC));$(a._options.dialogImageSelector+" "+a._options.titleSelector).val($(a._selected_image).attr(WYMeditor.TITLE));$(a._options.dialogImageSelector+" "+a._options.altSelector).val($(a._selected_image).attr(WYMeditor.ALT))}show_modal("Image","<div class='row'><label>URL</label><br><input type='text' class='wym_src' value='' size='40' /></div><div class='row'><label>Alt text</label><br><input type='text' class='wym_alt' value='' size='40' /></div><div class='row'><label>Title</label><br><input type='text' class='wym_title' value='' size='40' /></div>",{Insert:function(){var k=$(a._options.srcSelector).val();if(k.length>0){a._exec(WYMeditor.INSERT_IMAGE,b);$("img[src$="+b+"]",a._doc.body).attr(WYMeditor.SRC,k).attr(WYMeditor.TITLE,$(a._options.titleSelector).val()).attr(WYMeditor.ALT,$(a._options.altSelector).val())}hide_modal()},Cancel:function(){hide_modal()}});return}if(i==WYMeditor.DIALOG_TABLE){show_modal("Table","<div class='row'><label>Caption</label><br><input type='text' class='wym_caption' value='' size='40' /></div><div class='row'><label>Summary</label><br><input type='text' class='wym_summary' value='' size='40' /></div><div class='row'><label>Number Of Rows<br></label><input type='text' class='wym_rows' value='3' size='3' /></div><div class='row'><label>Number Of Cols<br></label><input type='text' class='wym_cols' value='2' size='3' /></div>",{Insert:function(){var o=$(a._options.rowsSelector).val();var r=$(a._options.colsSelector).val();if(o>0&&r>0){var n=a._doc.createElement(WYMeditor.TABLE);var l=null;var q=null;var k=$(a._options.captionSelector).val();var p=n.createCaption();p.innerHTML=k;for(x=0;x<o;x++){l=n.insertRow(x);for(y=0;y<r;y++){l.insertCell(y)}}$(n).attr("summary",$(a._options.summarySelector).val());var m=$(a.findUp(a.container(),WYMeditor.MAIN_CONTAINERS)).get(0);if(!m||!m.parentNode){$(a._doc.body).append(n)}else{$(m).after(n)}}hide_modal()},Cancel:function(){hide_modal()}})}if(i==Galaxy.DIALOG_HISTORY_LINK||i==Galaxy.DIALOG_DATASET_LINK||i==Galaxy.DIALOG_WORKFLOW_LINK||i==Galaxy.DIALOG_PAGE_LINK||i==Galaxy.DIALOG_VISUALIZATION_LINK){var j;switch(i){case (Galaxy.DIALOG_HISTORY_LINK):j=get_item_info(Galaxy.ITEM_HISTORY);break;case (Galaxy.DIALOG_DATASET_LINK):j=get_item_info(Galaxy.ITEM_DATASET);break;case (Galaxy.DIALOG_WORKFLOW_LINK):j=get_item_info(Galaxy.ITEM_WORKFLOW);break;case (Galaxy.DIALOG_PAGE_LINK):j=get_item_info(Galaxy.ITEM_PAGE);break;case (Galaxy.DIALOG_VISUALIZATION_LINK):j=get_item_info(Galaxy.ITEM_VISUALIZATION);break}$.ajax({url:j.list_ajax_url,data:{},error:function(){alert("Failed to list "+j.plural.toLowerCase()+" for selection")},success:function(k){show_modal("Insert Link to "+j.singular,k+"<div><input id='make-importable' type='checkbox' checked/>Make the selected "+j.plural.toLowerCase()+" accessible so that they can viewed by everyone.</div>",{Insert:function(){var m=false;if($("#make-importable:checked").val()!==null){m=true}var l=new Array();$("input[name=id]:checked").each(function(){var n=$(this).val();if(m){make_item_importable(j.controller,n,j.singular)}url_template=get_name_and_link_url+n;ajax_url=url_template.replace("ITEM_CONTROLLER",j.controller);$.getJSON(ajax_url,function(p){a._exec(WYMeditor.CREATE_LINK,b);var o=$("a[href="+b+"]",a._doc.body).text();if(o==""||o==b){a.insert("<a href='"+p.link+"'>"+j.singular+" '"+p.name+"'</a>")}else{$("a[href="+b+"]",a._doc.body).attr(WYMeditor.HREF,p.link).attr(WYMeditor.TITLE,j.singular+n)}})});hide_modal()},Cancel:function(){hide_modal()}})}})}if(i==Galaxy.DIALOG_EMBED_HISTORY||i==Galaxy.DIALOG_EMBED_DATASET||i==Galaxy.DIALOG_EMBED_WORKFLOW||i==Galaxy.DIALOG_EMBED_PAGE||i==Galaxy.DIALOG_EMBED_VISUALIZATION){var j;switch(i){case (Galaxy.DIALOG_EMBED_HISTORY):j=get_item_info(Galaxy.ITEM_HISTORY);break;case (Galaxy.DIALOG_EMBED_DATASET):j=get_item_info(Galaxy.ITEM_DATASET);break;case (Galaxy.DIALOG_EMBED_WORKFLOW):j=get_item_info(Galaxy.ITEM_WORKFLOW);break;case (Galaxy.DIALOG_EMBED_PAGE):j=get_item_info(Galaxy.ITEM_PAGE);break;case (Galaxy.DIALOG_EMBED_VISUALIZATION):j=get_item_info(Galaxy.ITEM_VISUALIZATION);break}$.ajax({url:j.list_ajax_url,data:{},error:function(){alert("Failed to list "+j.plural.toLowerCase()+" for selection")},success:function(k){if(i==Galaxy.DIALOG_EMBED_HISTORY||i==Galaxy.DIALOG_EMBED_WORKFLOW||i==Galaxy.DIALOG_EMBED_VISUALIZATION){k=k+"<div><input id='make-importable' type='checkbox' checked/>Make the selected "+j.plural.toLowerCase()+" accessible so that they can viewed by everyone.</div>"}show_modal("Embed "+j.plural,k,{Embed:function(){var l=false;if($("#make-importable:checked").val()!=null){l=true}$("input[name=id]:checked").each(function(){var m=$(this).val();var p=$("label[for='"+m+"']:first").text();if(l){make_item_importable(j.controller,m,j.singular)}var n=j.iclass+"-"+m;var o="<p><div id='"+n+"' class='embedded-item "+j.singular.toLowerCase()+" placeholder'><p class='title'>Embedded Galaxy "+j.singular+" '"+p+"'</p><p class='content'> [Do not edit this block; Galaxy will fill it in with the annotated "+j.singular.toLowerCase()+" when it is displayed.] </p></div></p>";a.insert(" ");a.insert(o);$("#"+n,a._doc.body).each(function(){var q=true;while(q){var r=$(this).prev();if(r.length!=0&&jQuery.trim(r.text())==""){r.remove()}else{q=false}}})});hide_modal()},Cancel:function(){hide_modal()}})}})}if(i==Galaxy.DIALOG_ANNOTATE_HISTORY){$.ajax({url:list_histories_for_selection_url,data:{},error:function(){alert("Grid refresh failed")},success:function(k){show_modal("Insert Link to History",k,{Annotate:function(){var l=new Array();$("input[name=id]:checked").each(function(){var m=$(this).val();$.ajax({url:get_history_annotation_table_url,data:{id:m},error:function(){alert("Grid refresh failed")},success:function(n){a.insert(n);init_galaxy_elts(a)}})});hide_modal()},Cancel:function(){hide_modal()}})}})}};$(function(){$(document).ajaxError(function(i,g){var h=g.responseText||g.statusText||"Could not connect to server";show_modal("Server error",h,{"Ignore error":hide_modal});return false});$("[name=page_content]").wymeditor({skin:"galaxy",basePath:editor_base_path,iframeBasePath:iframe_base_path,boxHtml:"<table class='wym_box' width='100%' height='100%'><tr><td><div class='wym_area_top'>"+WYMeditor.TOOLS+"</div></td></tr><tr height='100%'><td><div class='wym_area_main' style='height: 100%;'>"+WYMeditor.IFRAME+WYMeditor.STATUS+"</div></div></td></tr></table>",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 d=$.wymeditors(0);var f=function(g){show_modal("Saving page","progress");$.ajax({url:save_url,type:"POST",data:{id:page_id,content:d.xhtml(),annotations:JSON.stringify(new Object()),_:"true"},success:function(){g()}})};$("#save-button").click(function(){f(function(){hide_modal()})});$("#close-button").click(function(){var h=false;if(h){var g=function(){window.onbeforeunload=undefined;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(){f(g)}},{"Don't Save":g})}else{window.document.location=page_list_url}});var a=$("<div class='galaxy-page-editor-button'><a id='insert-galaxy-link' class='action-button popup' href='#'>Paragraph type</a></div>");$(".wym_area_top").append(a);var b={};$.each(d._options.containersItems,function(h,g){var i=g.name;b[g.title.replace("_"," ")]=function(){d.container(i)}});make_popupmenu(a,b);var c=$("<div><a id='insert-galaxy-link' class='action-button popup' href='#'>Insert Link to Galaxy Object</a></div>").addClass("galaxy-page-editor-button");$(".wym_area_top").append(c);make_popupmenu(c,{"Insert History Link":function(){d.dialog(Galaxy.DIALOG_HISTORY_LINK)},"Insert Dataset Link":function(){d.dialog(Galaxy.DIALOG_DATASET_LINK)},"Insert Workflow Link":function(){d.dialog(Galaxy.DIALOG_WORKFLOW_LINK)},"Insert Page Link":function(){d.dialog(Galaxy.DIALOG_PAGE_LINK)},"Insert Visualization Link":function(){d.dialog(Galaxy.DIALOG_VISUALIZATION_LINK)},});var e=$("<div><a id='embed-galaxy-object' class='action-button popup' href='#'>Embed Galaxy Object</a></div>").addClass("galaxy-page-editor-button");$(".wym_area_top").append(e);make_popupmenu(e,{"Embed History":function(){d.dialog(Galaxy.DIALOG_EMBED_HISTORY)},"Embed Dataset":function(){d.dialog(Galaxy.DIALOG_EMBED_DATASET)},"Embed Workflow":function(){d.dialog(Galaxy.DIALOG_EMBED_WORKFLOW)},"Embed Visualization":function(){d.dialog(Galaxy.DIALOG_EMBED_VISUALIZATION)},})});
\ No newline at end of file
diff -r 5b27b92310d044cfd2f9b3711e5ef446048de110 -r 2cabbf3687634090fbbc024726f15f43db4ff314 static/scripts/packed/libs/jquery/jquery.wymeditor.js
--- a/static/scripts/packed/libs/jquery/jquery.wymeditor.js
+++ b/static/scripts/packed/libs/jquery/jquery.wymeditor.js
@@ -1,1 +1,1 @@
-if(!WYMeditor){var WYMeditor={}}(function(){if(!window.console||!console.firebug){var b=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];WYMeditor.console={};for(var a=0;a<b.length;++a){WYMeditor.console[b[a]]=function(){}}}else{WYMeditor.console=window.console}})();jQuery.extend(WYMeditor,{VERSION:"0.5-rc1",INSTANCES:[],STRINGS:[],SKINS:[],NAME:"name",INDEX:"{Wym_Index}",WYM_INDEX:"wym_index",BASE_PATH:"{Wym_Base_Path}",CSS_PATH:"{Wym_Css_Path}",WYM_PATH:"{Wym_Wym_Path}",SKINS_DEFAULT_PATH:"skins/",SKINS_DEFAULT_CSS:"skin.css",SKINS_DEFAULT_JS:"skin.js",LANG_DEFAULT_PATH:"lang/",IFRAME_BASE_PATH:"{Wym_Iframe_Base_Path}",IFRAME_DEFAULT:"iframe/default/",JQUERY_PATH:"{Wym_Jquery_Path}",DIRECTION:"{Wym_Direction}",LOGO:"{Wym_Logo}",TOOLS:"{Wym_Tools}",TOOLS_ITEMS:"{Wym_Tools_Items}",TOOL_NAME:"{Wym_Tool_Name}",TOOL_TITLE:"{Wym_Tool_Title}",TOOL_CLASS:"{Wym_Tool_Class}",CLASSES:"{Wym_Classes}",CLASSES_ITEMS:"{Wym_Classes_Items}",CLASS_NAME:"{Wym_Class_Name}",CLASS_TITLE:"{Wym_Class_Title}",CONTAINERS:"{Wym_Containers}",CONTAINERS_ITEMS:"{Wym_Containers_Items}",CONTAINER_NAME:"{Wym_Container_Name}",CONTAINER_TITLE:"{Wym_Containers_Title}",CONTAINER_CLASS:"{Wym_Container_Class}",HTML:"{Wym_Html}",IFRAME:"{Wym_Iframe}",STATUS:"{Wym_Status}",DIALOG_TITLE:"{Wym_Dialog_Title}",DIALOG_BODY:"{Wym_Dialog_Body}",STRING:"string",BODY:"body",DIV:"div",P:"p",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",PRE:"pre",BLOCKQUOTE:"blockquote",A:"a",BR:"br",IMG:"img",TABLE:"table",TD:"td",TH:"th",UL:"ul",OL:"ol",LI:"li",CLASS:"class",HREF:"href",SRC:"src",TITLE:"title",ALT:"alt",DIALOG_LINK:"Link",DIALOG_IMAGE:"Image",DIALOG_TABLE:"Table",DIALOG_PASTE:"Paste_From_Word",BOLD:"Bold",ITALIC:"Italic",CREATE_LINK:"CreateLink",INSERT_IMAGE:"InsertImage",INSERT_TABLE:"InsertTable",INSERT_HTML:"InsertHTML",PASTE:"Paste",INDENT:"Indent",OUTDENT:"Outdent",TOGGLE_HTML:"ToggleHtml",FORMAT_BLOCK:"FormatBlock",PREVIEW:"Preview",UNLINK:"Unlink",INSERT_UNORDEREDLIST:"InsertUnorderedList",INSERT_ORDEREDLIST:"InsertOrderedList",MAIN_CONTAINERS:new Array("p","h1","h2","h3","h4","h5","h6","pre","blockquote"),BLOCKS:new Array("address","blockquote","div","dl","fieldset","form","h1","h2","h3","h4","h5","h6","hr","noscript","ol","p","pre","table","ul","dd","dt","li","tbody","td","tfoot","th","thead","tr"),KEY:{BACKSPACE:8,ENTER:13,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,CURSOR:new Array(37,38,39,40),DELETE:46},NODE:{ELEMENT:1,ATTRIBUTE:2,TEXT:3},editor:function(b,a){this._index=WYMeditor.INSTANCES.push(this)-1;this._element=b;this._options=a;this._html=jQuery(b).val();if(this._options.html){this._html=this._options.html}this._options.basePath=this._options.basePath||this.computeBasePath();this._options.skinPath=this._options.skinPath||this._options.basePath+WYMeditor.SKINS_DEFAULT_PATH+this._options.skin+"/";this._options.wymPath=this._options.wymPath||this.computeWymPath();this._options.langPath=this._options.langPath||this._options.basePath+WYMeditor.LANG_DEFAULT_PATH;this._options.iframeBasePath=this._options.iframeBasePath||this._options.basePath+WYMeditor.IFRAME_DEFAULT;this._options.jQueryPath=this._options.jQueryPath||this.computeJqueryPath();this.init()}});jQuery.fn.wymeditor=function(a){a=jQuery.extend({html:"",basePath:false,skinPath:false,wymPath:false,iframeBasePath:false,jQueryPath:false,styles:false,stylesheet:false,skin:"default",initSkin:true,loadSkin:true,lang:"en",direction:"ltr",boxHtml:"<div class='wym_box'><div class='wym_area_top'>"+WYMeditor.TOOLS+"</div><div class='wym_area_left'></div><div class='wym_area_right'>"+WYMeditor.CONTAINERS+WYMeditor.CLASSES+"</div><div class='wym_area_main'>"+WYMeditor.HTML+WYMeditor.IFRAME+WYMeditor.STATUS+"</div><div class='wym_area_bottom'>"+WYMeditor.LOGO+"</div></div>",logoHtml:"<a class='wym_wymeditor_link' href='http://www.wymeditor.org/'>WYMeditor</a>",iframeHtml:"<div class='wym_iframe wym_section'><iframe src='/page/get_editor_iframe' onload='this.contentWindow.parent.WYMeditor.INSTANCES["+WYMeditor.INDEX+"].initIframe(this)'></iframe></div>",editorStyles:[],toolsHtml:"<div class='wym_tools wym_section'><h2>{Tools}</h2><ul>"+WYMeditor.TOOLS_ITEMS+"</ul></div>",toolsItemHtml:"<li class='"+WYMeditor.TOOL_CLASS+"'><a href='#' name='"+WYMeditor.TOOL_NAME+"' title='"+WYMeditor.TOOL_TITLE+"'>"+WYMeditor.TOOL_TITLE+"</a></li>",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"},{name:"Paste",title:"Paste_From_Word",css:"wym_tools_paste"},{name:"ToggleHtml",title:"HTML",css:"wym_tools_html"},{name:"Preview",title:"Preview",css:"wym_tools_preview"}],containersHtml:"<div class='wym_containers wym_section'><h2>{Containers}</h2><ul>"+WYMeditor.CONTAINERS_ITEMS+"</ul></div>",containersItemHtml:"<li class='"+WYMeditor.CONTAINER_CLASS+"'><a href='#' name='"+WYMeditor.CONTAINER_NAME+"'>"+WYMeditor.CONTAINER_TITLE+"</a></li>",containersItems:[{name:"P",title:"Paragraph",css:"wym_containers_p"},{name:"H1",title:"Heading_1",css:"wym_containers_h1"},{name:"H2",title:"Heading_2",css:"wym_containers_h2"},{name:"H3",title:"Heading_3",css:"wym_containers_h3"},{name:"H4",title:"Heading_4",css:"wym_containers_h4"},{name:"H5",title:"Heading_5",css:"wym_containers_h5"},{name:"H6",title:"Heading_6",css:"wym_containers_h6"},{name:"PRE",title:"Preformatted",css:"wym_containers_pre"},{name:"BLOCKQUOTE",title:"Blockquote",css:"wym_containers_blockquote"},{name:"TH",title:"Table_Header",css:"wym_containers_th"}],classesHtml:"<div class='wym_classes wym_section'><h2>{Classes}</h2><ul>"+WYMeditor.CLASSES_ITEMS+"</ul></div>",classesItemHtml:"<li><a href='#' name='"+WYMeditor.CLASS_NAME+"'>"+WYMeditor.CLASS_TITLE+"</a></li>",classesItems:[],statusHtml:"<div class='wym_status wym_section'><h2>{Status}</h2></div>",htmlHtml:"<div class='wym_html wym_section'><h2>{Source_Code}</h2><textarea class='wym_html_val'></textarea></div>",boxSelector:".wym_box",toolsSelector:".wym_tools",toolsListSelector:" ul",containersSelector:".wym_containers",classesSelector:".wym_classes",htmlSelector:".wym_html",iframeSelector:".wym_iframe iframe",iframeBodySelector:".wym_iframe",statusSelector:".wym_status",toolSelector:".wym_tools a",containerSelector:".wym_containers a",classSelector:".wym_classes a",htmlValSelector:".wym_html_val",hrefSelector:".wym_href",srcSelector:".wym_src",titleSelector:".wym_title",altSelector:".wym_alt",textSelector:".wym_text",rowsSelector:".wym_rows",colsSelector:".wym_cols",captionSelector:".wym_caption",summarySelector:".wym_summary",submitSelector:".wym_submit",cancelSelector:".wym_cancel",previewSelector:"",dialogTypeSelector:".wym_dialog_type",dialogLinkSelector:".wym_dialog_link",dialogImageSelector:".wym_dialog_image",dialogTableSelector:".wym_dialog_table",dialogPasteSelector:".wym_dialog_paste",dialogPreviewSelector:".wym_dialog_preview",updateSelector:".wymupdate",updateEvent:"click",dialogFeatures:"menubar=no,titlebar=no,toolbar=no,resizable=no,width=560,height=300,top=0,left=0",dialogFeaturesPreview:"menubar=no,titlebar=no,toolbar=no,resizable=no,scrollbars=yes,width=560,height=300,top=0,left=0",dialogHtml:"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'><html dir='"+WYMeditor.DIRECTION+"'><head><link rel='stylesheet' type='text/css' media='screen' href='"+WYMeditor.CSS_PATH+"' /><title>"+WYMeditor.DIALOG_TITLE+"</title><script type='text/javascript' src='"+WYMeditor.JQUERY_PATH+"'><\/script><script type='text/javascript' src='"+WYMeditor.WYM_PATH+"'><\/script></head>"+WYMeditor.DIALOG_BODY+"</html>",dialogLinkHtml:"<body class='wym_dialog wym_dialog_link' onload='WYMeditor.INIT_DIALOG("+WYMeditor.INDEX+")'><form><fieldset><input type='hidden' class='wym_dialog_type' value='"+WYMeditor.DIALOG_LINK+"' /><legend>{Link}</legend><div class='row'><label>{URL}</label><input type='text' class='wym_href' value='' size='40' /></div><div class='row'><label>{Title}</label><input type='text' class='wym_title' value='' size='40' /></div><div class='row row-indent'><input class='wym_submit' type='button' value='{Submit}' /><input class='wym_cancel' type='button'value='{Cancel}' /></div></fieldset></form></body>",dialogImageHtml:"<body class='wym_dialog wym_dialog_image' onload='WYMeditor.INIT_DIALOG("+WYMeditor.INDEX+")'><form><fieldset><input type='hidden' class='wym_dialog_type' value='"+WYMeditor.DIALOG_IMAGE+"' /><legend>{Image}</legend><div class='row'><label>{URL}</label><input type='text' class='wym_src' value='' size='40' /></div><div class='row'><label>{Alternative_Text}</label><input type='text' class='wym_alt' value='' size='40' /></div><div class='row'><label>{Title}</label><input type='text' class='wym_title' value='' size='40' /></div><div class='row row-indent'><input class='wym_submit' type='button' value='{Submit}' /><input class='wym_cancel' type='button'value='{Cancel}' /></div></fieldset></form></body>",dialogTableHtml:"<body class='wym_dialog wym_dialog_table' onload='WYMeditor.INIT_DIALOG("+WYMeditor.INDEX+")'><form><fieldset><input type='hidden' class='wym_dialog_type' value='"+WYMeditor.DIALOG_TABLE+"' /><legend>{Table}</legend><div class='row'><label>{Caption}</label><input type='text' class='wym_caption' value='' size='40' /></div><div class='row'><label>{Summary}</label><input type='text' class='wym_summary' value='' size='40' /></div><div class='row'><label>{Number_Of_Rows}</label><input type='text' class='wym_rows' value='3' size='3' /></div><div class='row'><label>{Number_Of_Cols}</label><input type='text' class='wym_cols' value='2' size='3' /></div><div class='row row-indent'><input class='wym_submit' type='button' value='{Submit}' /><input class='wym_cancel' type='button'value='{Cancel}' /></div></fieldset></form></body>",dialogPasteHtml:"<body class='wym_dialog wym_dialog_paste' onload='WYMeditor.INIT_DIALOG("+WYMeditor.INDEX+")'><form><input type='hidden' class='wym_dialog_type' value='"+WYMeditor.DIALOG_PASTE+"' /><fieldset><legend>{Paste_From_Word}</legend><div class='row'><textarea class='wym_text' rows='10' cols='50'></textarea></div><div class='row'><input class='wym_submit' type='button' value='{Submit}' /><input class='wym_cancel' type='button'value='{Cancel}' /></div></fieldset></form></body>",dialogPreviewHtml:"<body class='wym_dialog wym_dialog_preview' onload='WYMeditor.INIT_DIALOG("+WYMeditor.INDEX+")'></body>",dialogStyles:[],stringDelimiterLeft:"{",stringDelimiterRight:"}",preInit:null,preBind:null,postInit:null,preInitDialog:null,postInitDialog:null},a);return this.each(function(){new WYMeditor.editor(jQuery(this),a)})};jQuery.extend({wymeditors:function(a){return(WYMeditor.INSTANCES[a])}});WYMeditor.editor.prototype.init=function(){if(jQuery.browser.msie){var WymClass=new WYMeditor.WymClassExplorer(this)}else{if(jQuery.browser.mozilla){var WymClass=new WYMeditor.WymClassMozilla(this)}else{if(jQuery.browser.opera){var WymClass=new WYMeditor.WymClassOpera(this)}else{if(jQuery.browser.safari){var WymClass=new WYMeditor.WymClassSafari(this)}}}}if(WymClass){if(jQuery.isFunction(this._options.preInit)){this._options.preInit(this)}var SaxListener=new WYMeditor.XhtmlSaxListener();jQuery.extend(SaxListener,WymClass);this.parser=new WYMeditor.XhtmlParser(SaxListener);if(this._options.styles||this._options.stylesheet){this.configureEditorUsingRawCss()}this.helper=new WYMeditor.XmlHelper();for(var prop in WymClass){this[prop]=WymClass[prop]}this._box=jQuery(this._element).hide().after(this._options.boxHtml).next().addClass("wym_box_"+this._index);if(jQuery.isFunction(jQuery.fn.data)){jQuery.data(this._box.get(0),WYMeditor.WYM_INDEX,this._index);jQuery.data(this._element.get(0),WYMeditor.WYM_INDEX,this._index)}var h=WYMeditor.Helper;var iframeHtml=this._options.iframeHtml;iframeHtml=h.replaceAll(iframeHtml,WYMeditor.INDEX,this._index);iframeHtml=h.replaceAll(iframeHtml,WYMeditor.IFRAME_BASE_PATH,this._options.iframeBasePath);var boxHtml=jQuery(this._box).html();boxHtml=h.replaceAll(boxHtml,WYMeditor.LOGO,this._options.logoHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.TOOLS,this._options.toolsHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.CONTAINERS,this._options.containersHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.CLASSES,this._options.classesHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.HTML,this._options.htmlHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.IFRAME,iframeHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.STATUS,this._options.statusHtml);var aTools=eval(this._options.toolsItems);var sTools="";for(var i=0;i<aTools.length;i++){var oTool=aTools[i];if(oTool.name&&oTool.title){var sTool=this._options.toolsItemHtml}var sTool=h.replaceAll(sTool,WYMeditor.TOOL_NAME,oTool.name);sTool=h.replaceAll(sTool,WYMeditor.TOOL_TITLE,this._options.stringDelimiterLeft+oTool.title+this._options.stringDelimiterRight);sTool=h.replaceAll(sTool,WYMeditor.TOOL_CLASS,oTool.css);sTools+=sTool}boxHtml=h.replaceAll(boxHtml,WYMeditor.TOOLS_ITEMS,sTools);var aClasses=eval(this._options.classesItems);var sClasses="";for(var i=0;i<aClasses.length;i++){var oClass=aClasses[i];if(oClass.name&&oClass.title){var sClass=this._options.classesItemHtml}sClass=h.replaceAll(sClass,WYMeditor.CLASS_NAME,oClass.name);sClass=h.replaceAll(sClass,WYMeditor.CLASS_TITLE,oClass.title);sClasses+=sClass}boxHtml=h.replaceAll(boxHtml,WYMeditor.CLASSES_ITEMS,sClasses);var aContainers=eval(this._options.containersItems);var sContainers="";for(var i=0;i<aContainers.length;i++){var oContainer=aContainers[i];if(oContainer.name&&oContainer.title){var sContainer=this._options.containersItemHtml}sContainer=h.replaceAll(sContainer,WYMeditor.CONTAINER_NAME,oContainer.name);sContainer=h.replaceAll(sContainer,WYMeditor.CONTAINER_TITLE,this._options.stringDelimiterLeft+oContainer.title+this._options.stringDelimiterRight);sContainer=h.replaceAll(sContainer,WYMeditor.CONTAINER_CLASS,oContainer.css);sContainers+=sContainer}boxHtml=h.replaceAll(boxHtml,WYMeditor.CONTAINERS_ITEMS,sContainers);boxHtml=this.replaceStrings(boxHtml);jQuery(this._box).html(boxHtml);jQuery(this._box).find(this._options.htmlSelector).hide();this.loadSkin()}};WYMeditor.editor.prototype.bindEvents=function(){var wym=this;jQuery(this._box).find(this._options.toolSelector).click(function(){wym._iframe.contentWindow.focus();wym.exec(jQuery(this).attr(WYMeditor.NAME));return(false)});jQuery(this._box).find(this._options.containerSelector).click(function(){wym.container(jQuery(this).attr(WYMeditor.NAME));return(false)});jQuery(this._box).find(this._options.htmlValSelector).keyup(function(){jQuery(wym._doc.body).html(jQuery(this).val())}).focus(function(){jQuery(this).toggleClass("hasfocus")}).blur(function(){jQuery(this).toggleClass("hasfocus")});jQuery(this._box).find(this._options.classSelector).click(function(){var aClasses=eval(wym._options.classesItems);var sName=jQuery(this).attr(WYMeditor.NAME);var oClass=WYMeditor.Helper.findByName(aClasses,sName);if(oClass){var jqexpr=oClass.expr;wym.toggleClass(sName,jqexpr)}wym._iframe.contentWindow.focus();return(false)});jQuery(this._options.updateSelector).bind(this._options.updateEvent,function(){wym.update()})};WYMeditor.editor.prototype.ready=function(){return(this._doc!=null)};WYMeditor.editor.prototype.box=function(){return(this._box)};WYMeditor.editor.prototype.html=function(a){if(typeof a==="string"){jQuery(this._doc.body).html(a)}else{return(jQuery(this._doc.body).html())}};WYMeditor.editor.prototype.xhtml=function(){return this.parser.parse(this.html())};WYMeditor.editor.prototype.exec=function(b){switch(b){case WYMeditor.CREATE_LINK:var a=this.container();if(a||this._selected_image){this.dialog(WYMeditor.DIALOG_LINK)}break;case WYMeditor.INSERT_IMAGE:this.dialog(WYMeditor.DIALOG_IMAGE);break;case WYMeditor.INSERT_TABLE:this.dialog(WYMeditor.DIALOG_TABLE);break;case WYMeditor.PASTE:this.dialog(WYMeditor.DIALOG_PASTE);break;case WYMeditor.TOGGLE_HTML:this.update();this.toggleHtml();if(!jQuery(this._box).find(this._options.htmlSelector).is(":visible")){this.listen()}break;case WYMeditor.PREVIEW:this.dialog(WYMeditor.PREVIEW,this._options.dialogFeaturesPreview);break;default:this._exec(b);break}};WYMeditor.editor.prototype.container=function(a){if(a){var d=null;if(a.toLowerCase()==WYMeditor.TH){d=this.container();switch(d.tagName.toLowerCase()){case WYMeditor.TD:case WYMeditor.TH:break;default:var e=new Array(WYMeditor.TD,WYMeditor.TH);d=this.findUp(this.container(),e);break}if(d!=null){a=(d.tagName.toLowerCase()==WYMeditor.TD)?WYMeditor.TH:WYMeditor.TD;this.switchTo(d,a);this.update()}}else{var e=new Array(WYMeditor.P,WYMeditor.H1,WYMeditor.H2,WYMeditor.H3,WYMeditor.H4,WYMeditor.H5,WYMeditor.H6,WYMeditor.PRE,WYMeditor.BLOCKQUOTE);d=this.findUp(this.container(),e);if(d){var i=null;if(a.toLowerCase()==WYMeditor.BLOCKQUOTE){var f=this.findUp(this.container(),WYMeditor.BLOCKQUOTE);if(f==null){i=this._doc.createElement(a);d.parentNode.insertBefore(i,d);i.appendChild(d);this.setFocusToNode(i.firstChild)}else{var c=f.childNodes;var g=c.length;var b=null;if(g>0){b=c.item(0)}for(var h=0;h<g;h++){f.parentNode.insertBefore(c.item(0),f)}f.parentNode.removeChild(f);if(b){this.setFocusToNode(b)}}}else{this.switchTo(d,a)}this.update()}}}else{return(this.selected())}};WYMeditor.editor.prototype.toggleClass=function(c,b){var a=(this._selected_image?this._selected_image:jQuery(this.selected()));a=jQuery(a).parentsOrSelf(b);jQuery(a).toggleClass(c);if(!jQuery(a).attr(WYMeditor.CLASS)){jQuery(a).removeAttr(this._class)}};WYMeditor.editor.prototype.findUp=function(d,c){if(d){var e=d.tagName.toLowerCase();if(typeof(c)==WYMeditor.STRING){while(e!=c&&e!=WYMeditor.BODY){d=d.parentNode;e=d.tagName.toLowerCase()}}else{var b=false;while(!b&&e!=WYMeditor.BODY){for(var a=0;a<c.length;a++){if(e==c[a]){b=true;break}}if(!b){d=d.parentNode;e=d.tagName.toLowerCase()}}}if(e!=WYMeditor.BODY){return(d)}else{return(null)}}else{return(null)}};WYMeditor.editor.prototype.switchTo=function(c,d){var b=this._doc.createElement(d);var a=jQuery(c).html();c.parentNode.replaceChild(b,c);jQuery(b).html(a);this.setFocusToNode(b)};WYMeditor.editor.prototype.replaceStrings=function(sVal){if(!WYMeditor.STRINGS[this._options.lang]){try{eval(jQuery.ajax({url:this._options.langPath+this._options.lang+".js",async:false}).responseText)}catch(e){WYMeditor.console.error("WYMeditor: error while parsing language file.");return sVal}}for(var key in WYMeditor.STRINGS[this._options.lang]){sVal=WYMeditor.Helper.replaceAll(sVal,this._options.stringDelimiterLeft+key+this._options.stringDelimiterRight,WYMeditor.STRINGS[this._options.lang][key])}return(sVal)};WYMeditor.editor.prototype.encloseString=function(a){return(this._options.stringDelimiterLeft+a+this._options.stringDelimiterRight)};WYMeditor.editor.prototype.status=function(a){jQuery(this._box).find(this._options.statusSelector).html(a)};WYMeditor.editor.prototype.update=function(){var a=this.xhtml();jQuery(this._element).val(a);jQuery(this._box).find(this._options.htmlValSelector).not(".hasfocus").val(a)};WYMeditor.editor.prototype.dialog=function(j,c,f){var a=c||this._wym._options.dialogFeatures;var d=window.open("","dialog",a);if(d){var b="";switch(j){case (WYMeditor.DIALOG_LINK):b=this._options.dialogLinkHtml;break;case (WYMeditor.DIALOG_IMAGE):b=this._options.dialogImageHtml;break;case (WYMeditor.DIALOG_TABLE):b=this._options.dialogTableHtml;break;case (WYMeditor.DIALOG_PASTE):b=this._options.dialogPasteHtml;break;case (WYMeditor.PREVIEW):b=this._options.dialogPreviewHtml;break;default:b=f}var e=WYMeditor.Helper;var g=this._options.dialogHtml;g=e.replaceAll(g,WYMeditor.BASE_PATH,this._options.basePath);g=e.replaceAll(g,WYMeditor.DIRECTION,this._options.direction);g=e.replaceAll(g,WYMeditor.CSS_PATH,this._options.skinPath+WYMeditor.SKINS_DEFAULT_CSS);g=e.replaceAll(g,WYMeditor.WYM_PATH,this._options.wymPath);g=e.replaceAll(g,WYMeditor.JQUERY_PATH,this._options.jQueryPath);g=e.replaceAll(g,WYMeditor.DIALOG_TITLE,this.encloseString(j));g=e.replaceAll(g,WYMeditor.DIALOG_BODY,b);g=e.replaceAll(g,WYMeditor.INDEX,this._index);g=this.replaceStrings(g);var i=d.document;i.write(g);i.close()}};WYMeditor.editor.prototype.toggleHtml=function(){jQuery(this._box).find(this._options.htmlSelector).toggle()};WYMeditor.editor.prototype.uniqueStamp=function(){var a=new Date();return("wym-"+a.getTime())};WYMeditor.editor.prototype.paste=function(b){var e;var a=this.selected();var c=b.split(this._newLine+this._newLine);var d=new RegExp(this._newLine,"g");if(a&&a.tagName.toLowerCase()!=WYMeditor.BODY){for(x=c.length-1;x>=0;x--){e=c[x];e=e.replace(d,"<br />");jQuery(a).after("<p>"+e+"</p>")}}else{for(x=0;x<c.length;x++){e=c[x];e=e.replace(d,"<br />");jQuery(this._doc.body).append("<p>"+e+"</p>")}}};WYMeditor.editor.prototype.insert=function(a){if(this._iframe.contentWindow.getSelection().focusNode!=null){this._exec(WYMeditor.INSERT_HTML,a)}else{this.paste(a)}};WYMeditor.editor.prototype.wrap=function(b,a){if(this._iframe.contentWindow.getSelection().focusNode!=null){this._exec(WYMeditor.INSERT_HTML,b+this._iframe.contentWindow.getSelection().toString()+a)}};WYMeditor.editor.prototype.unwrap=function(){if(this._iframe.contentWindow.getSelection().focusNode!=null){this._exec(WYMeditor.INSERT_HTML,this._iframe.contentWindow.getSelection().toString())}};WYMeditor.editor.prototype.addCssRules=function(e,c){var b=e.styleSheets[0];if(b){for(var a=0;a<c.length;a++){var d=c[a];if(d.name&&d.css){this.addCssRule(b,d)}}}};WYMeditor.editor.prototype.computeBasePath=function(){return jQuery(jQuery.grep(jQuery("script"),function(a){return(a.src&&a.src.match(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/))})).attr("src").replace(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/,"")};WYMeditor.editor.prototype.computeWymPath=function(){return jQuery(jQuery.grep(jQuery("script"),function(a){return(a.src&&a.src.match(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/))})).attr("src")};WYMeditor.editor.prototype.computeJqueryPath=function(){return jQuery(jQuery.grep(jQuery("script"),function(a){return(a.src&&a.src.match(/jquery(-(.*)){0,1}(\.pack|\.min|\.packed)?\.js(\?.*)?$/))})).attr("src")};WYMeditor.editor.prototype.computeCssPath=function(){return jQuery(jQuery.grep(jQuery("link"),function(a){return(a.href&&a.href.match(/wymeditor\/skins\/(.*)screen\.css(\?.*)?$/))})).attr("href")};WYMeditor.editor.prototype.configureEditorUsingRawCss=function(){var a=new WYMeditor.WymCssParser();if(this._options.stylesheet){a.parse(jQuery.ajax({url:this._options.stylesheet,async:false}).responseText)}else{a.parse(this._options.styles,false)}if(this._options.classesItems.length==0){this._options.classesItems=a.css_settings.classesItems}if(this._options.editorStyles.length==0){this._options.editorStyles=a.css_settings.editorStyles}if(this._options.dialogStyles.length==0){this._options.dialogStyles=a.css_settings.dialogStyles}};WYMeditor.editor.prototype.listen=function(){jQuery(this._doc.body).bind("mousedown",this.mousedown);var a=this._doc.body.getElementsByTagName("img");for(var b=0;b<a.length;b++){jQuery(a[b]).bind("mousedown",this.mousedown)}};WYMeditor.editor.prototype.mousedown=function(a){var b=WYMeditor.INSTANCES[this.ownerDocument.title];b._selected_image=(this.tagName.toLowerCase()==WYMeditor.IMG)?this:null;a.stopPropagation()};WYMeditor.loadCss=function(a){var c=document.createElement("link");c.rel="stylesheet";c.href=a;var b=jQuery("head").get(0);b.appendChild(c)};WYMeditor.editor.prototype.loadSkin=function(){if(this._options.loadSkin&&!WYMeditor.SKINS[this._options.skin]){var found=false;var rExp=new RegExp(this._options.skin+"/"+WYMeditor.SKINS_DEFAULT_CSS+"$");jQuery("link").each(function(){if(this.href.match(rExp)){found=true}});if(!found){WYMeditor.loadCss(this._options.skinPath+WYMeditor.SKINS_DEFAULT_CSS)}}jQuery(this._box).addClass("wym_skin_"+this._options.skin);if(this._options.initSkin&&!WYMeditor.SKINS[this._options.skin]){eval(jQuery.ajax({url:this._options.skinPath+WYMeditor.SKINS_DEFAULT_JS,async:false}).responseText)}if(WYMeditor.SKINS[this._options.skin]&&WYMeditor.SKINS[this._options.skin].init){WYMeditor.SKINS[this._options.skin].init(this)}};WYMeditor.INIT_DIALOG=function(index){var wym=window.opener.WYMeditor.INSTANCES[index];var doc=window.document;var selected=wym.selected();var dialogType=jQuery(wym._options.dialogTypeSelector).val();var sStamp=wym.uniqueStamp();switch(dialogType){case WYMeditor.DIALOG_LINK:if(selected&&selected.tagName&&selected.tagName.toLowerCase!=WYMeditor.A){selected=jQuery(selected).parentsOrSelf(WYMeditor.A)}if(!selected&&wym._selected_image){selected=jQuery(wym._selected_image).parentsOrSelf(WYMeditor.A)}break}if(jQuery.isFunction(wym._options.preInitDialog)){wym._options.preInitDialog(wym,window)}var styles=doc.styleSheets[0];var aCss=eval(wym._options.dialogStyles);wym.addCssRules(doc,aCss);if(selected){jQuery(wym._options.hrefSelector).val(jQuery(selected).attr(WYMeditor.HREF));jQuery(wym._options.srcSelector).val(jQuery(selected).attr(WYMeditor.SRC));jQuery(wym._options.titleSelector).val(jQuery(selected).attr(WYMeditor.TITLE));jQuery(wym._options.altSelector).val(jQuery(selected).attr(WYMeditor.ALT))}if(wym._selected_image){jQuery(wym._options.dialogImageSelector+" "+wym._options.srcSelector).val(jQuery(wym._selected_image).attr(WYMeditor.SRC));jQuery(wym._options.dialogImageSelector+" "+wym._options.titleSelector).val(jQuery(wym._selected_image).attr(WYMeditor.TITLE));jQuery(wym._options.dialogImageSelector+" "+wym._options.altSelector).val(jQuery(wym._selected_image).attr(WYMeditor.ALT))}jQuery(wym._options.dialogLinkSelector+" "+wym._options.submitSelector).click(function(){var sUrl=jQuery(wym._options.hrefSelector).val();if(sUrl.length>0){wym._exec(WYMeditor.CREATE_LINK,sStamp);jQuery("a[href="+sStamp+"]",wym._doc.body).attr(WYMeditor.HREF,sUrl).attr(WYMeditor.TITLE,jQuery(wym._options.titleSelector).val())}window.close()});jQuery(wym._options.dialogImageSelector+" "+wym._options.submitSelector).click(function(){var sUrl=jQuery(wym._options.srcSelector).val();if(sUrl.length>0){wym._exec(WYMeditor.INSERT_IMAGE,sStamp);jQuery("img[src$="+sStamp+"]",wym._doc.body).attr(WYMeditor.SRC,sUrl).attr(WYMeditor.TITLE,jQuery(wym._options.titleSelector).val()).attr(WYMeditor.ALT,jQuery(wym._options.altSelector).val())}window.close()});jQuery(wym._options.dialogTableSelector+" "+wym._options.submitSelector).click(function(){var iRows=jQuery(wym._options.rowsSelector).val();var iCols=jQuery(wym._options.colsSelector).val();if(iRows>0&&iCols>0){var table=wym._doc.createElement(WYMeditor.TABLE);var newRow=null;var newCol=null;var sCaption=jQuery(wym._options.captionSelector).val();var newCaption=table.createCaption();newCaption.innerHTML=sCaption;for(x=0;x<iRows;x++){newRow=table.insertRow(x);for(y=0;y<iCols;y++){newRow.insertCell(y)}}jQuery(table).attr("summary",jQuery(wym._options.summarySelector).val());var node=jQuery(wym.findUp(wym.container(),WYMeditor.MAIN_CONTAINERS)).get(0);if(!node||!node.parentNode){jQuery(wym._doc.body).append(table)}else{jQuery(node).after(table)}}window.close()});jQuery(wym._options.dialogPasteSelector+" "+wym._options.submitSelector).click(function(){var sText=jQuery(wym._options.textSelector).val();wym.paste(sText);window.close()});jQuery(wym._options.dialogPreviewSelector+" "+wym._options.previewSelector).html(wym.xhtml());jQuery(wym._options.cancelSelector).mousedown(function(){window.close()});if(jQuery.isFunction(wym._options.postInitDialog)){wym._options.postInitDialog(wym,window)}};WYMeditor.XmlHelper=function(){this._entitiesDiv=document.createElement("div");return this};WYMeditor.XmlHelper.prototype.tag=function(c,b,a){b=b||false;a=a||false;return"<"+c+(b?this.tagOptions(b):"")+(a?">":" />")};WYMeditor.XmlHelper.prototype.contentTag=function(b,c,a){a=a||false;return"<"+b+(a?this.tagOptions(a):"")+">"+c+"</"+b+">"};WYMeditor.XmlHelper.prototype.cdataSection=function(a){return"<![CDATA["+a+"]]>"};WYMeditor.XmlHelper.prototype.escapeOnce=function(a){return this._fixDoubleEscape(this.escapeEntities(a))};WYMeditor.XmlHelper.prototype._fixDoubleEscape=function(a){return a.replace(/&([a-z]+|(#\d+));/ig,"&$1;")};WYMeditor.XmlHelper.prototype.tagOptions=function(b){var a=this;a._formated_options="";for(var c in b){var d="";var e=b[c];if(typeof e!="function"&&e.length>0){if(parseInt(c)==c&&typeof e=="object"){c=e.shift();e=e.pop()}if(c!=""&&e!=""){a._formated_options+=" "+c+'="'+a.escapeOnce(e)+'"'}}}return a._formated_options};WYMeditor.XmlHelper.prototype.escapeEntities=function(c,b){this._entitiesDiv.innerHTML=c;this._entitiesDiv.textContent=c;var a=this._entitiesDiv.innerHTML;if(typeof b=="undefined"){if(b!=false){a=a.replace('"',""")}if(b==true){a=a.replace('"',"'")}}return a};WYMeditor.XmlHelper.prototype.parseAttributes=function(h){var a=[];var g=h.split(/((=\s*")(")("))|((=\s*\')(\')(\'))|((=\s*[^>\s]*))/g);if(g.toString()!=h){for(var d in g){var c=g[d];if(typeof c!="function"&&c.length!=0){var e=new RegExp("(\\w+)\\s*"+c);if(match=h.match(e)){var f=c.replace(/^[\s=]+/,"");var b=f.charAt(0);b=b=='"'?'"':(b=="'"?"'":"");if(b!=""){f=b=='"'?f.replace(/^"|"+$/g,""):f.replace(/^'|'+$/g,"")}h=h.replace(match[0],"");a.push([match[1],f])}}}}return a};WYMeditor.XhtmlValidator={_attributes:{core:{except:["base","head","html","meta","param","script","style","title"],attributes:["class","id","style","title","accesskey","tabindex"]},language:{except:["base","br","hr","iframe","param","script"],attributes:{dir:["ltr","rtl"],"0":"lang","1":"xml:lang"}},keyboard:{attributes:{accesskey:/^(\w){1}$/,tabindex:/^(\d)+$/}}},_events:{window:{only:["body"],attributes:["onload","onunload"]},form:{only:["form","input","textarea","select","a","label","button"],attributes:["onchange","onsubmit","onreset","onselect","onblur","onfocus"]},keyboard:{except:["base","bdo","br","frame","frameset","head","html","iframe","meta","param","script","style","title"],attributes:["onkeydown","onkeypress","onkeyup"]},mouse:{except:["base","bdo","br","head","html","meta","param","script","style","title"],attributes:["onclick","ondblclick","onmousedown","onmousemove","onmouseover","onmouseout","onmouseup"]}},_tags:{a:{attributes:{"0":"charset","1":"coords","2":"href","3":"hreflang","4":"name",rel:/^(alternate|designates|stylesheet|start|next|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark| |shortcut|icon)+$/,rev:/^(alternate|designates|stylesheet|start|next|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark| |shortcut|icon)+$/,shape:/^(rect|rectangle|circ|circle|poly|polygon)$/,"5":"type"}},"0":"abbr","1":"acronym","2":"address",area:{attributes:{"0":"alt","1":"coords","2":"href",nohref:/^(true|false)$/,shape:/^(rect|rectangle|circ|circle|poly|polygon)$/},required:["alt"]},"3":"b",base:{attributes:["href"],required:["href"]},bdo:{attributes:{dir:/^(ltr|rtl)$/},required:["dir"]},"4":"big",blockquote:{attributes:["cite"]},"5":"body","6":"br",button:{attributes:{disabled:/^(disabled)$/,type:/^(button|reset|submit)$/,"0":"value"},inside:"form"},"7":"caption","8":"cite","9":"code",col:{attributes:{align:/^(right|left|center|justify)$/,"0":"char","1":"charoff",span:/^(\d)+$/,valign:/^(top|middle|bottom|baseline)$/,"2":"width"},inside:"colgroup"},colgroup:{attributes:{align:/^(right|left|center|justify)$/,"0":"char","1":"charoff",span:/^(\d)+$/,valign:/^(top|middle|bottom|baseline)$/,"2":"width"}},"10":"dd",del:{attributes:{"0":"cite",datetime:/^([0-9]){8}/}},"11":"div","12":"dfn","13":"dl","14":"dt","15":"em",fieldset:{inside:"form"},form:{attributes:{"0":"action","1":"accept","2":"accept-charset","3":"enctype",method:/^(get|post)$/},required:["action"]},head:{attributes:["profile"]},"16":"h1","17":"h2","18":"h3","19":"h4","20":"h5","21":"h6","22":"hr",html:{attributes:["xmlns"]},"23":"i",img:{attributes:["alt","src","height","ismap","longdesc","usemap","width"],required:["alt","src"]},input:{attributes:{"0":"accept","1":"alt",checked:/^(checked)$/,disabled:/^(disabled)$/,maxlength:/^(\d)+$/,"2":"name",readonly:/^(readonly)$/,size:/^(\d)+$/,"3":"src",type:/^(button|checkbox|file|hidden|image|password|radio|reset|submit|text)$/,"4":"value"},inside:"form"},ins:{attributes:{"0":"cite",datetime:/^([0-9]){8}/}},"24":"kbd",label:{attributes:["for"],inside:"form"},"25":"legend","26":"li",link:{attributes:{"0":"charset","1":"href","2":"hreflang",media:/^(all|braille|print|projection|screen|speech|,|;| )+$/i,rel:/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,rev:/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,"3":"type"},inside:"head"},map:{attributes:["id","name"],required:["id"]},meta:{attributes:{"0":"content","http-equiv":/^(content\-type|expires|refresh|set\-cookie)$/i,"1":"name","2":"scheme"},required:["content"]},"27":"noscript",object:{attributes:["archive","classid","codebase","codetype","data","declare","height","name","standby","type","usemap","width"]},"28":"ol",optgroup:{attributes:{"0":"label",disabled:/^(disabled)$/},required:["label"]},option:{attributes:{"0":"label",disabled:/^(disabled)$/,selected:/^(selected)$/,"1":"value"},inside:"select"},"29":"p",param:{attributes:{"0":"type",valuetype:/^(data|ref|object)$/,"1":"valuetype","2":"value"},required:["name"]},"30":"pre",q:{attributes:["cite"]},"31":"samp",script:{attributes:{type:/^(text\/ecmascript|text\/javascript|text\/jscript|text\/vbscript|text\/vbs|text\/xml)$/,"0":"charset",defer:/^(defer)$/,"1":"src"},required:["type"]},select:{attributes:{disabled:/^(disabled)$/,multiple:/^(multiple)$/,"0":"name","1":"size"},inside:"form"},"32":"small","33":"span","34":"strong",style:{attributes:{"0":"type",media:/^(screen|tty|tv|projection|handheld|print|braille|aural|all)$/},required:["type"]},"35":"sub","36":"sup",table:{attributes:{"0":"border","1":"cellpadding","2":"cellspacing",frame:/^(void|above|below|hsides|lhs|rhs|vsides|box|border)$/,rules:/^(none|groups|rows|cols|all)$/,"3":"summary","4":"width"}},tbody:{attributes:{align:/^(right|left|center|justify)$/,"0":"char","1":"charoff",valign:/^(top|middle|bottom|baseline)$/}},td:{attributes:{"0":"abbr",align:/^(left|right|center|justify|char)$/,"1":"axis","2":"char","3":"charoff",colspan:/^(\d)+$/,"4":"headers",rowspan:/^(\d)+$/,scope:/^(col|colgroup|row|rowgroup)$/,valign:/^(top|middle|bottom|baseline)$/}},textarea:{attributes:["cols","rows","disabled","name","readonly"],required:["cols","rows"],inside:"form"},tfoot:{attributes:{align:/^(right|left|center|justify)$/,"0":"char","1":"charoff",valign:/^(top|middle|bottom)$/,"2":"baseline"}},th:{attributes:{"0":"abbr",align:/^(left|right|center|justify|char)$/,"1":"axis","2":"char","3":"charoff",colspan:/^(\d)+$/,"4":"headers",rowspan:/^(\d)+$/,scope:/^(col|colgroup|row|rowgroup)$/,valign:/^(top|middle|bottom|baseline)$/}},thead:{attributes:{align:/^(right|left|center|justify)$/,"0":"char","1":"charoff",valign:/^(top|middle|bottom|baseline)$/}},"37":"title",tr:{attributes:{align:/^(right|left|center|justify|char)$/,"0":"char","1":"charoff",valign:/^(top|middle|bottom|baseline)$/}},"38":"tt","39":"ul","40":"var"},skiped_attributes:[],skiped_attribute_values:[],getValidTagAttributes:function(a,b){var c={};var g=this.getPossibleTagAttributes(a);for(var e in b){var f=b[e];var d=WYMeditor.Helper;if(!d.contains(this.skiped_attributes,e)&&!d.contains(this.skiped_attribute_values,f)){if(typeof f!="function"&&d.contains(g,e)){if(this.doesAttributeNeedsValidation(a,e)){if(this.validateAttribute(a,e,f)){c[e]=f}}else{c[e]=f}}}}return c},getUniqueAttributesAndEventsForTag:function(b){var a=[];if(this._tags[b]&&this._tags[b]["attributes"]){for(k in this._tags[b]["attributes"]){a.push(parseInt(k)==k?this._tags[b]["attributes"][k]:k)}}return a},getDefaultAttributesAndEventsForTags:function(){var a=[];for(var b in this._events){a.push(this._events[b])}for(var b in this._attributes){a.push(this._attributes[b])}return a},isValidTag:function(a){if(this._tags[a]){return true}for(var b in this._tags){if(this._tags[b]==a){return true}}return false},getDefaultAttributesAndEventsForTag:function(a){var i=[];if(this.isValidTag(a)){var g=this.getDefaultAttributesAndEventsForTags();for(var d in g){var f=g[d];if(typeof f=="object"){var e=WYMeditor.Helper;if((f.except&&e.contains(f.except,a))||(f.only&&!e.contains(f.only,a))){continue}var c=f.attributes?f.attributes:f.events;for(var b in c){i.push(typeof c[b]!="string"?b:c[b])}}}}return i},doesAttributeNeedsValidation:function(a,b){return this._tags[a]&&((this._tags[a]["attributes"]&&this._tags[a]["attributes"][b])||(this._tags[a]["required"]&&WYMeditor.Helper.contains(this._tags[a]["required"],b)))},validateAttribute:function(a,b,c){if(this._tags[a]&&(this._tags[a]["attributes"]&&this._tags[a]["attributes"][b]&&c.length>0&&!c.match(this._tags[a]["attributes"][b]))||(this._tags[a]&&this._tags[a]["required"]&&WYMeditor.Helper.contains(this._tags[a]["required"],b)&&c.length==0)){return false}return typeof this._tags[a]!="undefined"},getPossibleTagAttributes:function(a){if(!this._possible_tag_attributes){this._possible_tag_attributes={}}if(!this._possible_tag_attributes[a]){this._possible_tag_attributes[a]=this.getUniqueAttributesAndEventsForTag(a).concat(this.getDefaultAttributesAndEventsForTag(a))}return this._possible_tag_attributes[a]}};WYMeditor.ParallelRegex=function(a){this._case=a;this._patterns=[];this._labels=[];this._regex=null;return this};WYMeditor.ParallelRegex.prototype.addPattern=function(c,a){a=a||true;var b=this._patterns.length;this._patterns[b]=c;this._labels[b]=a;this._regex=null};WYMeditor.ParallelRegex.prototype.match=function(c){if(this._patterns.length==0){return[false,""]}var d=c.match(this._getCompoundedRegex());if(!d){return[false,""]}var a=d[0];for(var b=1;b<d.length;b++){if(d[b]){return[this._labels[b-1],a]}}return[true,d[0]]};WYMeditor.ParallelRegex.prototype._getCompoundedRegex=function(){if(this._regex==null){for(var a=0,b=this._patterns.length;a<b;a++){this._patterns[a]="("+this._untokenizeRegex(this._tokenizeRegex(this._patterns[a]).replace(/([\/\(\)])/g,"\\$1"))+")"}this._regex=new RegExp(this._patterns.join("|"),this._getPerlMatchingFlags())}return this._regex};WYMeditor.ParallelRegex.prototype._tokenizeRegex=function(a){return a.replace(/\(\?(i|m|s|x|U)\)/,"~~~~~~Tk1$1~~~~~~").replace(/\(\?(\-[i|m|s|x|U])\)/,"~~~~~~Tk2$1~~~~~~").replace(/\(\?\=(.*)\)/,"~~~~~~Tk3$1~~~~~~").replace(/\(\?\!(.*)\)/,"~~~~~~Tk4$1~~~~~~").replace(/\(\?\<\=(.*)\)/,"~~~~~~Tk5$1~~~~~~").replace(/\(\?\<\!(.*)\)/,"~~~~~~Tk6$1~~~~~~").replace(/\(\?\:(.*)\)/,"~~~~~~Tk7$1~~~~~~")};WYMeditor.ParallelRegex.prototype._untokenizeRegex=function(a){return a.replace(/~~~~~~Tk1(.{1})~~~~~~/,"(?$1)").replace(/~~~~~~Tk2(.{2})~~~~~~/,"(?$1)").replace(/~~~~~~Tk3(.*)~~~~~~/,"(?=$1)").replace(/~~~~~~Tk4(.*)~~~~~~/,"(?!$1)").replace(/~~~~~~Tk5(.*)~~~~~~/,"(?<=$1)").replace(/~~~~~~Tk6(.*)~~~~~~/,"(?<!$1)").replace(/~~~~~~Tk7(.*)~~~~~~/,"(?:$1)")};WYMeditor.ParallelRegex.prototype._getPerlMatchingFlags=function(){return(this._case?"m":"mi")};WYMeditor.StateStack=function(a){this._stack=[a];return this};WYMeditor.StateStack.prototype.getCurrent=function(){return this._stack[this._stack.length-1]};WYMeditor.StateStack.prototype.enter=function(a){this._stack.push(a)};WYMeditor.StateStack.prototype.leave=function(){if(this._stack.length==1){return false}this._stack.pop();return true};WYMeditor.LEXER_ENTER=1;WYMeditor.LEXER_MATCHED=2;WYMeditor.LEXER_UNMATCHED=3;WYMeditor.LEXER_EXIT=4;WYMeditor.LEXER_SPECIAL=5;WYMeditor.Lexer=function(c,b,a){b=b||"accept";this._case=a||false;this._regexes={};this._parser=c;this._mode=new WYMeditor.StateStack(b);this._mode_handlers={};this._mode_handlers[b]=b;return this};WYMeditor.Lexer.prototype.addPattern=function(a,b){var b=b||"accept";if(typeof this._regexes[b]=="undefined"){this._regexes[b]=new WYMeditor.ParallelRegex(this._case)}this._regexes[b].addPattern(a);if(typeof this._mode_handlers[b]=="undefined"){this._mode_handlers[b]=b}};WYMeditor.Lexer.prototype.addEntryPattern=function(b,c,a){if(typeof this._regexes[c]=="undefined"){this._regexes[c]=new WYMeditor.ParallelRegex(this._case)}this._regexes[c].addPattern(b,a);if(typeof this._mode_handlers[a]=="undefined"){this._mode_handlers[a]=a}};WYMeditor.Lexer.prototype.addExitPattern=function(a,b){if(typeof this._regexes[b]=="undefined"){this._regexes[b]=new WYMeditor.ParallelRegex(this._case)}this._regexes[b].addPattern(a,"__exit");if(typeof this._mode_handlers[b]=="undefined"){this._mode_handlers[b]=b}};WYMeditor.Lexer.prototype.addSpecialPattern=function(b,c,a){if(typeof this._regexes[c]=="undefined"){this._regexes[c]=new WYMeditor.ParallelRegex(this._case)}this._regexes[c].addPattern(b,"_"+a);if(typeof this._mode_handlers[a]=="undefined"){this._mode_handlers[a]=a}};WYMeditor.Lexer.prototype.mapHandler=function(b,a){this._mode_handlers[b]=a};WYMeditor.Lexer.prototype.parse=function(d){if(typeof this._parser=="undefined"){return false}var e=d.length;var c;while(typeof(c=this._reduce(d))=="object"){var d=c[0];var b=c[1];var a=c[2];var f=c[3];if(!this._dispatchTokens(b,a,f)){return false}if(d==""){return true}if(d.length==e){return false}e=d.length}if(!c){return false}return this._invokeParser(d,WYMeditor.LEXER_UNMATCHED)};WYMeditor.Lexer.prototype._dispatchTokens=function(b,a,c){c=c||false;if(!this._invokeParser(b,WYMeditor.LEXER_UNMATCHED)){return false}if(typeof c=="boolean"){return this._invokeParser(a,WYMeditor.LEXER_MATCHED)}if(this._isModeEnd(c)){if(!this._invokeParser(a,WYMeditor.LEXER_EXIT)){return false}return this._mode.leave()}if(this._isSpecialMode(c)){this._mode.enter(this._decodeSpecial(c));if(!this._invokeParser(a,WYMeditor.LEXER_SPECIAL)){return false}return this._mode.leave()}this._mode.enter(c);return this._invokeParser(a,WYMeditor.LEXER_ENTER)};WYMeditor.Lexer.prototype._isModeEnd=function(a){return(a==="__exit")};WYMeditor.Lexer.prototype._isSpecialMode=function(a){return(a.substring(0,1)=="_")};WYMeditor.Lexer.prototype._decodeSpecial=function(a){return a.substring(1)};WYMeditor.Lexer.prototype._invokeParser=function(content,is_match){if(!/ +/.test(content)&&((content==="")||(content==false))){return true}var current=this._mode.getCurrent();var handler=this._mode_handlers[current];var result;eval("result = this._parser."+handler+"(content, is_match);");return result};WYMeditor.Lexer.prototype._reduce=function(c){var a=this._regexes[this._mode.getCurrent()].match(c);var b=a[1];var e=a[0];if(e){var f=c.indexOf(b);var d=c.substr(0,f);c=c.substring(f+b.length);return[c,d,b,e]}return true};WYMeditor.XhtmlLexer=function(a){jQuery.extend(this,new WYMeditor.Lexer(a,"Text"));this.mapHandler("Text","Text");this.addTokens();this.init();return this};WYMeditor.XhtmlLexer.prototype.init=function(){};WYMeditor.XhtmlLexer.prototype.addTokens=function(){this.addCommentTokens("Text");this.addScriptTokens("Text");this.addCssTokens("Text");this.addTagTokens("Text")};WYMeditor.XhtmlLexer.prototype.addCommentTokens=function(a){this.addEntryPattern("<!--",a,"Comment");this.addExitPattern("-->","Comment")};WYMeditor.XhtmlLexer.prototype.addScriptTokens=function(a){this.addEntryPattern("<script",a,"Script");this.addExitPattern("<\/script>","Script")};WYMeditor.XhtmlLexer.prototype.addCssTokens=function(a){this.addEntryPattern("<style",a,"Css");this.addExitPattern("</style>","Css")};WYMeditor.XhtmlLexer.prototype.addTagTokens=function(a){this.addSpecialPattern("<\\s*[a-z0-9:-]+\\s*>",a,"OpeningTag");this.addEntryPattern("<[a-z0-9:-]+[\\/ \\>]+",a,"OpeningTag");this.addInTagDeclarationTokens("OpeningTag");this.addSpecialPattern("</\\s*[a-z0-9:-]+\\s*>",a,"ClosingTag")};WYMeditor.XhtmlLexer.prototype.addInTagDeclarationTokens=function(a){this.addSpecialPattern("\\s+",a,"Ignore");this.addAttributeTokens(a);this.addExitPattern("/>",a);this.addExitPattern(">",a)};WYMeditor.XhtmlLexer.prototype.addAttributeTokens=function(a){this.addSpecialPattern("\\s*[a-z-_0-9]*:?[a-z-_0-9]+\\s*(?==)\\s*",a,"TagAttributes");this.addEntryPattern('=\\s*"',a,"DoubleQuotedAttribute");this.addPattern('\\\\"',"DoubleQuotedAttribute");this.addExitPattern('"',"DoubleQuotedAttribute");this.addEntryPattern("=\\s*'",a,"SingleQuotedAttribute");this.addPattern("\\\\'","SingleQuotedAttribute");this.addExitPattern("'","SingleQuotedAttribute");this.addSpecialPattern("=\\s*[^>\\s]*",a,"UnquotedAttribute")};WYMeditor.XhtmlParser=function(a,b){var b=b||"Text";this._Lexer=new WYMeditor.XhtmlLexer(this);this._Listener=a;this._mode=b;this._matches=[];this._last_match="";this._current_match="";return this};WYMeditor.XhtmlParser.prototype.parse=function(a){this._Lexer.parse(this.beforeParsing(a));return this.afterParsing(this._Listener.getResult())};WYMeditor.XhtmlParser.prototype.beforeParsing=function(a){if(a.match(/class="MsoNormal"/)||a.match(/ns = "urn:schemas-microsoft-com/)){this._Listener.avoidStylingTagsAndAttributes()}return this._Listener.beforeParsing(a)};WYMeditor.XhtmlParser.prototype.afterParsing=function(a){if(this._Listener._avoiding_tags_implicitly){this._Listener.allowStylingTagsAndAttributes()}return this._Listener.afterParsing(a)};WYMeditor.XhtmlParser.prototype.Ignore=function(a,b){return true};WYMeditor.XhtmlParser.prototype.Text=function(a){this._Listener.addContent(a);return true};WYMeditor.XhtmlParser.prototype.Comment=function(b,a){return this._addNonTagBlock(b,a,"addComment")};WYMeditor.XhtmlParser.prototype.Script=function(b,a){return this._addNonTagBlock(b,a,"addScript")};WYMeditor.XhtmlParser.prototype.Css=function(b,a){return this._addNonTagBlock(b,a,"addCss")};WYMeditor.XhtmlParser.prototype._addNonTagBlock=function(a,c,b){switch(c){case WYMeditor.LEXER_ENTER:this._non_tag=a;break;case WYMeditor.LEXER_UNMATCHED:this._non_tag+=a;break;case WYMeditor.LEXER_EXIT:switch(b){case"addComment":this._Listener.addComment(this._non_tag+a);break;case"addScript":this._Listener.addScript(this._non_tag+a);break;case"addCss":this._Listener.addCss(this._non_tag+a);break}}return true};WYMeditor.XhtmlParser.prototype.OpeningTag=function(a,b){switch(b){case WYMeditor.LEXER_ENTER:this._tag=this.normalizeTag(a);this._tag_attributes={};break;case WYMeditor.LEXER_SPECIAL:this._callOpenTagListener(this.normalizeTag(a));break;case WYMeditor.LEXER_EXIT:this._callOpenTagListener(this._tag,this._tag_attributes)}return true};WYMeditor.XhtmlParser.prototype.ClosingTag=function(a,b){this._callCloseTagListener(this.normalizeTag(a));return true};WYMeditor.XhtmlParser.prototype._callOpenTagListener=function(a,b){var b=b||{};this.autoCloseUnclosedBeforeNewOpening(a);if(this._Listener.isBlockTag(a)){this._Listener._tag_stack.push(a);this._Listener.fixNestingBeforeOpeningBlockTag(a,b);this._Listener.openBlockTag(a,b);this._increaseOpenTagCounter(a)}else{if(this._Listener.isInlineTag(a)){this._Listener.inlineTag(a,b)}else{this._Listener.openUnknownTag(a,b);this._increaseOpenTagCounter(a)}}this._Listener.last_tag=a;this._Listener.last_tag_opened=true;this._Listener.last_tag_attributes=b};WYMeditor.XhtmlParser.prototype._callCloseTagListener=function(a){if(this._decreaseOpenTagCounter(a)){this.autoCloseUnclosedBeforeTagClosing(a);if(this._Listener.isBlockTag(a)){var b=this._Listener._tag_stack.pop();if(b==false){return}else{if(b!=a){a=b}}this._Listener.closeBlockTag(a)}else{this._Listener.closeUnknownTag(a)}}else{this._Listener.closeUnopenedTag(a)}this._Listener.last_tag=a;this._Listener.last_tag_opened=false};WYMeditor.XhtmlParser.prototype._increaseOpenTagCounter=function(a){this._Listener._open_tags[a]=this._Listener._open_tags[a]||0;this._Listener._open_tags[a]++};WYMeditor.XhtmlParser.prototype._decreaseOpenTagCounter=function(a){if(this._Listener._open_tags[a]){this._Listener._open_tags[a]--;if(this._Listener._open_tags[a]==0){this._Listener._open_tags[a]=undefined}return true}return false};WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeNewOpening=function(a){this._autoCloseUnclosed(a,false)};WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeTagClosing=function(a){this._autoCloseUnclosed(a,true)};WYMeditor.XhtmlParser.prototype._autoCloseUnclosed=function(c,d){var d=d||false;if(this._Listener._open_tags){for(var a in this._Listener._open_tags){var b=this._Listener._open_tags[a];if(b>0&&this._Listener.shouldCloseTagAutomatically(a,c,d)){this._callCloseTagListener(a,true)}}}};WYMeditor.XhtmlParser.prototype.getTagReplacements=function(){return this._Listener.getTagReplacements()};WYMeditor.XhtmlParser.prototype.normalizeTag=function(a){a=a.replace(/^([\s<\/>]*)|([\s<\/>]*)$/gm,"").toLowerCase();var b=this._Listener.getTagReplacements();if(b[a]){return b[a]}return a};WYMeditor.XhtmlParser.prototype.TagAttributes=function(a,b){if(WYMeditor.LEXER_SPECIAL==b){this._current_attribute=a}return true};WYMeditor.XhtmlParser.prototype.DoubleQuotedAttribute=function(a,b){if(WYMeditor.LEXER_UNMATCHED==b){this._tag_attributes[this._current_attribute]=a}return true};WYMeditor.XhtmlParser.prototype.SingleQuotedAttribute=function(a,b){if(WYMeditor.LEXER_UNMATCHED==b){this._tag_attributes[this._current_attribute]=a}return true};WYMeditor.XhtmlParser.prototype.UnquotedAttribute=function(a,b){this._tag_attributes[this._current_attribute]=a.replace(/^=/,"");return true};WYMeditor.XhtmlSaxListener=function(){this.output="";this.helper=new WYMeditor.XmlHelper();this._open_tags={};this.validator=WYMeditor.XhtmlValidator;this._tag_stack=[];this.avoided_tags=[];this.entities={" ":" ","¡":"¡","¢":"¢","£":"£","¤":"¤","¥":"¥","¦":"¦","§":"§","¨":"¨","©":"©","ª":"ª","«":"«","¬":"¬","­":"­","®":"®","¯":"¯","°":"°","±":"±","²":"²","³":"³","´":"´","µ":"µ","¶":"¶","·":"·","¸":"¸","¹":"¹","º":"º","»":"»","¼":"¼","½":"½","¾":"¾","¿":"¿","À":"À","Á":"Á","Â":"Â","Ã":"Ã","Ä":"Ä","Å":"Å","Æ":"Æ","Ç":"Ç","È":"È","É":"É","Ê":"Ê","Ë":"Ë","Ì":"Ì","Í":"Í","Î":"Î","Ï":"Ï","Ð":"Ð","Ñ":"Ñ","Ò":"Ò","Ó":"Ó","Ô":"Ô","Õ":"Õ","Ö":"Ö","×":"×","Ø":"Ø","Ù":"Ù","Ú":"Ú","Û":"Û","Ü":"Ü","Ý":"Ý","Þ":"Þ","ß":"ß","à":"à","á":"á","â":"â","ã":"ã","ä":"ä","å":"å","æ":"æ","ç":"ç","è":"è","é":"é","ê":"ê","ë":"ë","ì":"ì","í":"í","î":"î","ï":"ï","ð":"ð","ñ":"ñ","ò":"ò","ó":"ó","ô":"ô","õ":"õ","ö":"ö","÷":"÷","ø":"ø","ù":"ù","ú":"ú","û":"û","ü":"ü","ý":"ý","þ":"þ","ÿ":"ÿ","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ƒ":"ƒ","ˆ":"ˆ","˜":"˜","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","ς":"ς","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","ϑ":"ϑ","ϒ":"ϒ","ϖ":"ϖ"," ":" "," ":" "," ":" ","‌":"‌","‍":"‍","‎":"‎","‏":"‏","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","…":"…","‰":"‰","′":"′","″":"″","‹":"‹","›":"›","‾":"‾","⁄":"⁄","€":"€","ℑ":"ℑ","℘":"℘","ℜ":"ℜ","™":"™","ℵ":"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","⟨":"〈","⟩":"〉","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"};this.block_tags=["a","abbr","acronym","address","area","b","base","bdo","big","blockquote","body","button","caption","cite","code","col","colgroup","dd","del","div","dfn","dl","dt","em","fieldset","form","head","h1","h2","h3","h4","h5","h6","html","i","ins","kbd","label","legend","li","map","noscript","object","ol","optgroup","option","p","param","pre","q","samp","script","select","small","span","strong","style","sub","sup","table","tbody","td","textarea","tfoot","th","thead","title","tr","tt","ul","var","extends"];this.inline_tags=["br","hr","img","input"];return this};WYMeditor.XhtmlSaxListener.prototype.shouldCloseTagAutomatically=function(a,c,b){var b=b||false;if(a=="td"){if((b&&c=="tr")||(!b&&c=="td")){return true}}if(a=="option"){if((b&&c=="select")||(!b&&c=="option")){return true}}return false};WYMeditor.XhtmlSaxListener.prototype.beforeParsing=function(a){this.output="";return a};WYMeditor.XhtmlSaxListener.prototype.afterParsing=function(a){a=this.replaceNamedEntities(a);a=this.joinRepeatedEntities(a);a=this.removeEmptyTags(a);a=this.removeBrInPre(a);return a};WYMeditor.XhtmlSaxListener.prototype.replaceNamedEntities=function(b){for(var a in this.entities){b=b.replace(new RegExp(a,"g"),this.entities[a])}return b};WYMeditor.XhtmlSaxListener.prototype.joinRepeatedEntities=function(b){var a="em|strong|sub|sup|acronym|pre|del|address";return b.replace(new RegExp("</("+a+")><\\1>",""),"").replace(new RegExp("(s*<("+a+")>s*){2}(.*)(s*</\\2>s*){2}",""),"<$2>$3<$2>")};WYMeditor.XhtmlSaxListener.prototype.removeEmptyTags=function(a){return a.replace(new RegExp("<("+this.block_tags.join("|").replace(/\|td/,"").replace(/\|th/,"")+")>(<br />| | |\\s)*</\\1>","g"),"")};WYMeditor.XhtmlSaxListener.prototype.removeBrInPre=function(c){var b=c.match(new RegExp("<pre[^>]*>(.*?)</pre>","gmi"));if(b){for(var a=0;a<b.length;a++){c=c.replace(b[a],b[a].replace(new RegExp("<br />","g"),String.fromCharCode(13,10)))}}return c};WYMeditor.XhtmlSaxListener.prototype.getResult=function(){return this.output};WYMeditor.XhtmlSaxListener.prototype.getTagReplacements=function(){return{b:"strong",i:"em"}};WYMeditor.XhtmlSaxListener.prototype.addContent=function(a){this.output+=a};WYMeditor.XhtmlSaxListener.prototype.addComment=function(a){if(this.remove_comments){this.output+=a}};WYMeditor.XhtmlSaxListener.prototype.addScript=function(a){if(!this.remove_scripts){this.output+=a}};WYMeditor.XhtmlSaxListener.prototype.addCss=function(a){if(!this.remove_embeded_styles){this.output+=a}};WYMeditor.XhtmlSaxListener.prototype.openBlockTag=function(a,b){this.output+=this.helper.tag(a,this.validator.getValidTagAttributes(a,b),true)};WYMeditor.XhtmlSaxListener.prototype.inlineTag=function(a,b){this.output+=this.helper.tag(a,this.validator.getValidTagAttributes(a,b))};WYMeditor.XhtmlSaxListener.prototype.openUnknownTag=function(a,b){};WYMeditor.XhtmlSaxListener.prototype.closeBlockTag=function(a){this.output=this.output.replace(/<br \/>$/,"")+this._getClosingTagContent("before",a)+"</"+a+">"+this._getClosingTagContent("after",a)};WYMeditor.XhtmlSaxListener.prototype.closeUnknownTag=function(a){};WYMeditor.XhtmlSaxListener.prototype.closeUnopenedTag=function(a){this.output+="</"+a+">"};WYMeditor.XhtmlSaxListener.prototype.avoidStylingTagsAndAttributes=function(){this.avoided_tags=["div","span"];this.validator.skiped_attributes=["style"];this.validator.skiped_attribute_values=["MsoNormal","main1"];this._avoiding_tags_implicitly=true};WYMeditor.XhtmlSaxListener.prototype.allowStylingTagsAndAttributes=function(){this.avoided_tags=[];this.validator.skiped_attributes=[];this.validator.skiped_attribute_values=[];this._avoiding_tags_implicitly=false};WYMeditor.XhtmlSaxListener.prototype.isBlockTag=function(a){return !WYMeditor.Helper.contains(this.avoided_tags,a)&&WYMeditor.Helper.contains(this.block_tags,a)};WYMeditor.XhtmlSaxListener.prototype.isInlineTag=function(a){return !WYMeditor.Helper.contains(this.avoided_tags,a)&&WYMeditor.Helper.contains(this.inline_tags,a)};WYMeditor.XhtmlSaxListener.prototype.insertContentAfterClosingTag=function(a,b){this._insertContentWhenClosingTag("after",a,b)};WYMeditor.XhtmlSaxListener.prototype.insertContentBeforeClosingTag=function(a,b){this._insertContentWhenClosingTag("before",a,b)};WYMeditor.XhtmlSaxListener.prototype.fixNestingBeforeOpeningBlockTag=function(a,b){if(a!="li"&&(a=="ul"||a=="ol")&&this.last_tag&&!this.last_tag_opened&&this.last_tag=="li"){this.output=this.output.replace(/<\/li>$/,"");this.insertContentAfterClosingTag(a,"</li>")}};WYMeditor.XhtmlSaxListener.prototype._insertContentWhenClosingTag=function(b,a,c){if(!this["_insert_"+b+"_closing"]){this["_insert_"+b+"_closing"]=[]}if(!this["_insert_"+b+"_closing"][a]){this["_insert_"+b+"_closing"][a]=[]}this["_insert_"+b+"_closing"][a].push(c)};WYMeditor.XhtmlSaxListener.prototype._getClosingTagContent=function(b,a){if(this["_insert_"+b+"_closing"]&&this["_insert_"+b+"_closing"][a]&&this["_insert_"+b+"_closing"][a].length>0){return this["_insert_"+b+"_closing"][a].pop()}return""};WYMeditor.WymCssLexer=function(b,a){var a=(typeof a=="undefined"?true:a);jQuery.extend(this,new WYMeditor.Lexer(b,(a?"Ignore":"WymCss")));this.mapHandler("WymCss","Ignore");if(a==true){this.addEntryPattern("/\\\x2a[<\\s]*WYMeditor[>\\s]*\\\x2a/","Ignore","WymCss");this.addExitPattern("/\\\x2a[</\\s]*WYMeditor[>\\s]*\\\x2a/","WymCss")}this.addSpecialPattern("[\\sa-z1-6]*\\\x2e[a-z-_0-9]+","WymCss","WymCssStyleDeclaration");this.addEntryPattern("/\\\x2a","WymCss","WymCssComment");this.addExitPattern("\\\x2a/","WymCssComment");this.addEntryPattern("\x7b","WymCss","WymCssStyle");this.addExitPattern("\x7d","WymCssStyle");this.addEntryPattern("/\\\x2a","WymCssStyle","WymCssFeedbackStyle");this.addExitPattern("\\\x2a/","WymCssFeedbackStyle");return this};WYMeditor.WymCssParser=function(){this._in_style=false;this._has_title=false;this.only_wym_blocks=true;this.css_settings={classesItems:[],editorStyles:[],dialogStyles:[]};return this};WYMeditor.WymCssParser.prototype.parse=function(a,b){var b=(typeof b=="undefined"?this.only_wym_blocks:b);this._Lexer=new WYMeditor.WymCssLexer(this,b);this._Lexer.parse(a)};WYMeditor.WymCssParser.prototype.Ignore=function(a,b){return true};WYMeditor.WymCssParser.prototype.WymCssComment=function(b,a){if(b.match(/end[a-z0-9\s]*wym[a-z0-9\s]*/mi)){return false}if(a==WYMeditor.LEXER_UNMATCHED){if(!this._in_style){this._has_title=true;this._current_item={title:WYMeditor.Helper.trim(b)}}else{if(this._current_item[this._current_element]){if(!this._current_item[this._current_element].expressions){this._current_item[this._current_element].expressions=[b]}else{this._current_item[this._current_element].expressions.push(b)}}}this._in_style=true}return true};WYMeditor.WymCssParser.prototype.WymCssStyle=function(b,a){if(a==WYMeditor.LEXER_UNMATCHED){b=WYMeditor.Helper.trim(b);if(b!=""){this._current_item[this._current_element].style=b}}else{if(a==WYMeditor.LEXER_EXIT){this._in_style=false;this._has_title=false;this.addStyleSetting(this._current_item)}}return true};WYMeditor.WymCssParser.prototype.WymCssFeedbackStyle=function(b,a){if(a==WYMeditor.LEXER_UNMATCHED){this._current_item[this._current_element].feedback_style=b.replace(/^([\s\/\*]*)|([\s\/\*]*)$/gm,"")}return true};WYMeditor.WymCssParser.prototype.WymCssStyleDeclaration=function(b){b=b.replace(/^([\s\.]*)|([\s\.*]*)$/gm,"");var a="";if(b.indexOf(".")>0){var c=b.split(".");this._current_element=c[1];var a=c[0]}else{this._current_element=b}if(!this._has_title){this._current_item={title:(!a?"":a.toUpperCase()+": ")+this._current_element};this._has_title=true}if(!this._current_item[this._current_element]){this._current_item[this._current_element]={name:this._current_element}}if(a){if(!this._current_item[this._current_element].tags){this._current_item[this._current_element].tags=[a]}else{this._current_item[this._current_element].tags.push(a)}}return true};WYMeditor.WymCssParser.prototype.addStyleSetting=function(a){for(var b in a){var c=a[b];if(typeof c=="object"&&b!="title"){this.css_settings.classesItems.push({name:WYMeditor.Helper.trim(c.name),title:a.title,expr:WYMeditor.Helper.trim((c.expressions||c.tags).join(", "))});if(c.feedback_style){this.css_settings.editorStyles.push({name:"."+WYMeditor.Helper.trim(c.name),css:c.feedback_style})}if(c.style){this.css_settings.dialogStyles.push({name:"."+WYMeditor.Helper.trim(c.name),css:c.style})}}}};jQuery.fn.isPhantomNode=function(){if(this[0].nodeType==3){return !(/[^\t\n\r ]/.test(this[0].data))}return false};WYMeditor.isPhantomNode=function(a){if(a.nodeType==3){return !(/[^\t\n\r ]/.test(a.data))}return false};WYMeditor.isPhantomString=function(a){return !(/[^\t\n\r ]/.test(a))};jQuery.fn.parentsOrSelf=function(b){var a=this;if(a[0].nodeType==3){a=a.parents().slice(0,1)}if(a.filter(b).size()==1){return a}else{return a.parents(b).slice(0,1)}};WYMeditor.Helper={replaceAll:function(d,a,c){var b=new RegExp(a,"g");return(d.replace(b,c))},insertAt:function(b,a,c){return(b.substr(0,c)+a+b.substring(c))},trim:function(a){return a.replace(/^(\s*)|(\s*)$/gm,"")},contains:function(a,c){for(var b=0;b<a.length;b++){if(a[b]===c){return true}}return false},indexOf:function(a,d){var b=-1;for(var c=0;c<a.length;c++){if(a[c]==d){b=c;break}}return(b)},findByName:function(a,b){for(var c=0;c<a.length;c++){var d=a[c];if(d.name==b){return(d)}}return(null)}};WYMeditor.WymClassExplorer=function(a){this._wym=a;this._class="className";this._newLine="\r\n"};WYMeditor.WymClassExplorer.prototype.initIframe=function(iframe){this._iframe=iframe;this._doc=iframe.contentWindow.document;var styles=this._doc.styleSheets[0];var aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss);this._doc.title=this._wym._index;jQuery("html",this._doc).attr("dir",this._options.direction);jQuery(this._doc.body).html(this._wym._html);var wym=this;this._doc.body.onfocus=function(){wym._doc.designMode="on";wym._doc=iframe.contentWindow.document};this._doc.onbeforedeactivate=function(){wym.saveCaret()};this._doc.onkeyup=function(){wym.saveCaret();wym.keyup()};this._doc.onclick=function(){wym.saveCaret()};this._doc.body.onbeforepaste=function(){wym._iframe.contentWindow.event.returnValue=false};this._doc.body.onpaste=function(){wym._iframe.contentWindow.event.returnValue=false;wym.paste(window.clipboardData.getData("Text"))};if(this._initialized){if(jQuery.isFunction(this._options.preBind)){this._options.preBind(this)}this._wym.bindEvents();if(jQuery.isFunction(this._options.postInit)){this._options.postInit(this)}this.listen()}this._initialized=true;this._doc.designMode="on";try{this._doc=iframe.contentWindow.document}catch(e){}};WYMeditor.WymClassExplorer.prototype._exec=function(c,d){switch(c){case WYMeditor.INDENT:case WYMeditor.OUTDENT:var a=this.findUp(this.container(),WYMeditor.LI);if(a){var b=a.parentNode.parentNode;if(a.parentNode.childNodes.length>1||b.tagName.toLowerCase()==WYMeditor.OL||b.tagName.toLowerCase()==WYMeditor.UL){this._doc.execCommand(c)}}break;default:if(d){this._doc.execCommand(c,false,d)}else{this._doc.execCommand(c)}break}this.listen()};WYMeditor.WymClassExplorer.prototype.selected=function(){var a=this._iframe.contentWindow.document.caretPos;if(a!=null){if(a.parentElement!=undefined){return(a.parentElement())}}};WYMeditor.WymClassExplorer.prototype.saveCaret=function(){this._doc.caretPos=this._doc.selection.createRange()};WYMeditor.WymClassExplorer.prototype.addCssRule=function(a,b){a.addRule(b.name,b.css)};WYMeditor.WymClassExplorer.prototype.insert=function(b){var a=this._doc.selection.createRange();if(jQuery(a.parentElement()).parents(this._options.iframeBodySelector).is("*")){try{a.pasteHTML(b)}catch(c){}}else{this.paste(b)}};WYMeditor.WymClassExplorer.prototype.wrap=function(d,b){var a=this._doc.selection.createRange();if(jQuery(a.parentElement()).parents(this._options.iframeBodySelector).is("*")){try{a.pasteHTML(d+a.text+b)}catch(c){}}};WYMeditor.WymClassExplorer.prototype.unwrap=function(){var a=this._doc.selection.createRange();if(jQuery(a.parentElement()).parents(this._options.iframeBodySelector).is("*")){try{var c=a.text;this._exec("Cut");a.pasteHTML(c)}catch(b){}}};WYMeditor.WymClassExplorer.prototype.keyup=function(){this._selected_image=null};WYMeditor.WymClassExplorer.prototype.setFocusToNode=function(b){var a=this._doc.selection.createRange();a.moveToElementText(b);a.collapse(false);a.move("character",-1);a.select();b.focus()};WYMeditor.WymClassMozilla=function(a){this._wym=a;this._class="class";this._newLine="\n"};WYMeditor.WymClassMozilla.prototype.initIframe=function(iframe){this._iframe=iframe;this._doc=iframe.contentDocument;var styles=this._doc.styleSheets[0];var aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss);this._doc.title=this._wym._index;jQuery("html",this._doc).attr("dir",this._options.direction);this.html(this._wym._html);this.enableDesignMode();if(jQuery.isFunction(this._options.preBind)){this._options.preBind(this)}this._wym.bindEvents();jQuery(this._doc).bind("keydown",this.keydown);jQuery(this._doc).bind("keyup",this.keyup);jQuery(this._doc).bind("focus",this.enableDesignMode);if(jQuery.isFunction(this._options.postInit)){this._options.postInit(this)}this.listen()};WYMeditor.WymClassMozilla.prototype.html=function(a){if(typeof a==="string"){try{this._doc.designMode="off"}catch(b){}a=a.replace(/<em(\b[^>]*)>/gi,"<i$1>").replace(/<\/em>/gi,"</i>").replace(/<strong(\b[^>]*)>/gi,"<b$1>").replace(/<\/strong>/gi,"</b>");jQuery(this._doc.body).html(a);this.enableDesignMode()}else{return(jQuery(this._doc.body).html())}};WYMeditor.WymClassMozilla.prototype._exec=function(e,g){if(!this.selected()){return(false)}switch(e){case WYMeditor.INDENT:case WYMeditor.OUTDENT:var f=this.selected();var d=this._iframe.contentWindow.getSelection();var b=d.anchorNode;if(b.nodeName=="#text"){b=b.parentNode}f=this.findUp(f,WYMeditor.BLOCKS);b=this.findUp(b,WYMeditor.BLOCKS);if(f&&f==b&&f.tagName.toLowerCase()==WYMeditor.LI){var c=f.parentNode.parentNode;if(f.parentNode.childNodes.length>1||c.tagName.toLowerCase()==WYMeditor.OL||c.tagName.toLowerCase()==WYMeditor.UL){this._doc.execCommand(e,"",null)}}break;default:if(g){this._doc.execCommand(e,"",g)}else{this._doc.execCommand(e,"",null)}}var a=this.selected();if(a.tagName.toLowerCase()==WYMeditor.BODY){this._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}this.listen()};WYMeditor.WymClassMozilla.prototype.selected=function(){var b=this._iframe.contentWindow.getSelection();var a=b.focusNode;if(a){if(a.nodeName=="#text"){return(a.parentNode)}else{return(a)}}else{return(null)}};WYMeditor.WymClassMozilla.prototype.addCssRule=function(a,b){a.insertRule(b.name+" {"+b.css+"}",a.cssRules.length)};WYMeditor.WymClassMozilla.prototype.keydown=function(b){var c=WYMeditor.INSTANCES[this.title];var a=null;if(b.ctrlKey){if(b.keyCode==66){c._exec(WYMeditor.BOLD);return false}if(b.keyCode==73){c._exec(WYMeditor.ITALIC);return false}}else{if(b.keyCode==13){if(!b.shiftKey){a=c.selected();if(a&&a.tagName.toLowerCase()==WYMeditor.PRE){b.preventDefault();c.insert("<p></p>")}}}}};WYMeditor.WymClassMozilla.prototype.keyup=function(b){var d=WYMeditor.INSTANCES[this.title];d._selected_image=null;var a=null;if(b.keyCode==13&&!b.shiftKey){jQuery(d._doc.body).children(WYMeditor.BR).remove()}else{if(b.keyCode!=8&&b.keyCode!=17&&b.keyCode!=46&&b.keyCode!=224&&!b.metaKey&&!b.ctrlKey){a=d.selected();var c=a.tagName.toLowerCase();if(c=="strong"||c=="b"||c=="em"||c=="i"||c=="sub"||c=="sup"||c=="a"){c=a.parentNode.tagName.toLowerCase()}if(c==WYMeditor.BODY){d._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}}}};WYMeditor.WymClassMozilla.prototype.enableDesignMode=function(){if(this.designMode=="off"){try{this.designMode="on";this.execCommand("styleWithCSS","",false)}catch(a){}}};WYMeditor.WymClassMozilla.prototype.setFocusToNode=function(c){var a=document.createRange();a.selectNode(c);var b=this._iframe.contentWindow.getSelection();b.addRange(a);b.collapse(c,c.childNodes.length);this._iframe.contentWindow.focus()};WYMeditor.WymClassMozilla.prototype.openBlockTag=function(a,c){var c=this.validator.getValidTagAttributes(a,c);if(a=="span"&&c.style){var b=this.getTagForStyle(c.style);if(b){this._tag_stack.pop();var a=b;this._tag_stack.push(b);c.style=""}else{return}}this.output+=this.helper.tag(a,c,true)};WYMeditor.WymClassMozilla.prototype.getTagForStyle=function(a){if(/bold/.test(a)){return"strong"}if(/italic/.test(a)){return"em"}if(/sub/.test(a)){return"sub"}if(/sub/.test(a)){return"super"}return false};WYMeditor.WymClassOpera=function(a){this._wym=a;this._class="class";this._newLine="\r\n"};WYMeditor.WymClassOpera.prototype.initIframe=function(iframe){this._iframe=iframe;this._doc=iframe.contentWindow.document;var styles=this._doc.styleSheets[0];var aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss);this._doc.title=this._wym._index;jQuery("html",this._doc).attr("dir",this._options.direction);this._doc.designMode="on";this.html(this._wym._html);if(jQuery.isFunction(this._options.preBind)){this._options.preBind(this)}this._wym.bindEvents();jQuery(this._doc).bind("keydown",this.keydown);jQuery(this._doc).bind("keyup",this.keyup);if(jQuery.isFunction(this._options.postInit)){this._options.postInit(this)}this.listen()};WYMeditor.WymClassOpera.prototype._exec=function(a,b){if(b){this._doc.execCommand(a,false,b)}else{this._doc.execCommand(a)}this.listen()};WYMeditor.WymClassOpera.prototype.selected=function(){var b=this._iframe.contentWindow.getSelection();var a=b.focusNode;if(a){if(a.nodeName=="#text"){return(a.parentNode)}else{return(a)}}else{return(null)}};WYMeditor.WymClassOpera.prototype.addCssRule=function(a,b){a.insertRule(b.name+" {"+b.css+"}",a.cssRules.length)};WYMeditor.WymClassOpera.prototype.keydown=function(a){var c=WYMeditor.INSTANCES[this.title];var b=c._iframe.contentWindow.getSelection();startNode=b.getRangeAt(0).startContainer;if(!jQuery(startNode).parentsOrSelf(WYMeditor.MAIN_CONTAINERS.join(","))[0]&&!jQuery(startNode).parentsOrSelf("li")&&a.keyCode!=WYMeditor.KEY.ENTER&&a.keyCode!=WYMeditor.KEY.LEFT&&a.keyCode!=WYMeditor.KEY.UP&&a.keyCode!=WYMeditor.KEY.RIGHT&&a.keyCode!=WYMeditor.KEY.DOWN&&a.keyCode!=WYMeditor.KEY.BACKSPACE&&a.keyCode!=WYMeditor.KEY.DELETE){c._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}};WYMeditor.WymClassOpera.prototype.keyup=function(a){var b=WYMeditor.INSTANCES[this.title];b._selected_image=null};WYMeditor.WymClassOpera.prototype.setFocusToNode=function(a){};WYMeditor.WymClassSafari=function(a){this._wym=a;this._class="class";this._newLine="\n"};WYMeditor.WymClassSafari.prototype.initIframe=function(iframe){this._iframe=iframe;this._doc=iframe.contentDocument;var styles=this._doc.styleSheets[0];var aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss);this._doc.title=this._wym._index;jQuery("html",this._doc).attr("dir",this._options.direction);this._doc.designMode="on";this.html(this._wym._html);if(jQuery.isFunction(this._options.preBind)){this._options.preBind(this)}this._wym.bindEvents();jQuery(this._doc).bind("keydown",this.keydown);jQuery(this._doc).bind("keyup",this.keyup);if(jQuery.isFunction(this._options.postInit)){this._options.postInit(this)}this.listen()};WYMeditor.WymClassSafari.prototype._exec=function(e,g){if(!this.selected()){return(false)}switch(e){case WYMeditor.INDENT:case WYMeditor.OUTDENT:var f=this.selected();var d=this._iframe.contentWindow.getSelection();var b=d.anchorNode;if(b.nodeName=="#text"){b=b.parentNode}f=this.findUp(f,WYMeditor.BLOCKS);b=this.findUp(b,WYMeditor.BLOCKS);if(f&&f==b&&f.tagName.toLowerCase()==WYMeditor.LI){var c=f.parentNode.parentNode;if(f.parentNode.childNodes.length>1||c.tagName.toLowerCase()==WYMeditor.OL||c.tagName.toLowerCase()==WYMeditor.UL){this._doc.execCommand(e,"",null)}}break;case WYMeditor.INSERT_ORDEREDLIST:case WYMeditor.INSERT_UNORDEREDLIST:this._doc.execCommand(e,"",null);var f=this.selected();var a=this.findUp(f,WYMeditor.MAIN_CONTAINERS);if(a){jQuery(a).replaceWith(jQuery(a).html())}break;default:if(g){this._doc.execCommand(e,"",g)}else{this._doc.execCommand(e,"",null)}}var a=this.selected();if(a&&a.tagName.toLowerCase()==WYMeditor.BODY){this._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}this.listen()};WYMeditor.WymClassSafari.prototype.selected=function(){var b=this._iframe.contentWindow.getSelection();var a=b.focusNode;if(a){if(a.nodeName=="#text"){return(a.parentNode)}else{return(a)}}else{return(null)}};WYMeditor.WymClassSafari.prototype.addCssRule=function(a,b){a.insertRule(b.name+" {"+b.css+"}",a.cssRules.length)};WYMeditor.WymClassSafari.prototype.keydown=function(a){var b=WYMeditor.INSTANCES[this.title];if(a.ctrlKey){if(a.keyCode==66){b._exec(WYMeditor.BOLD);return false}if(a.keyCode==73){b._exec(WYMeditor.ITALIC);return false}}};WYMeditor.WymClassSafari.prototype.keyup=function(b){var d=WYMeditor.INSTANCES[this.title];d._selected_image=null;var a=null;if(b.keyCode==13&&!b.shiftKey){jQuery(d._doc.body).children(WYMeditor.BR).remove();a=d.selected();if(a&&a.tagName.toLowerCase()==WYMeditor.PRE){d._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}}if(b.keyCode==13&&b.shiftKey){d._exec("InsertLineBreak")}if(b.keyCode!=8&&b.keyCode!=17&&b.keyCode!=46&&b.keyCode!=224&&!b.metaKey&&!b.ctrlKey){a=d.selected();var c=a.tagName.toLowerCase();if(c=="strong"||c=="b"||c=="em"||c=="i"||c=="sub"||c=="sup"||c=="a"||c=="span"){c=a.parentNode.tagName.toLowerCase()}if(c==WYMeditor.BODY||c==WYMeditor.DIV){d._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}}};WYMeditor.WymClassSafari.prototype.setFocusToNode=function(c){var a=this._iframe.contentDocument.createRange();a.selectNode(c);var b=this._iframe.contentWindow.getSelection();b.addRange(a);b.collapse(c,c.childNodes.length);this._iframe.contentWindow.focus()};WYMeditor.WymClassSafari.prototype.openBlockTag=function(a,c){var c=this.validator.getValidTagAttributes(a,c);if(a=="span"&&c.style){var b=this.getTagForStyle(c.style);if(b){this._tag_stack.pop();var a=b;this._tag_stack.push(b);c.style="";if(typeof c["class"]=="string"){c["class"]=c["class"].replace(/apple-style-span/gi,"")}}else{return}}this.output+=this.helper.tag(a,c,true)};WYMeditor.WymClassSafari.prototype.getTagForStyle=function(a){if(/bold/.test(a)){return"strong"}if(/italic/.test(a)){return"em"}if(/sub/.test(a)){return"sub"}if(/super/.test(a)){return"sup"}return false};
\ No newline at end of file
+if(!WYMeditor){var WYMeditor={}}(function(){if(!window.console||!console.firebug){var b=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];WYMeditor.console={};for(var a=0;a<b.length;++a){WYMeditor.console[b[a]]=function(){}}}else{WYMeditor.console=window.console}})();jQuery.extend(WYMeditor,{VERSION:"0.5-rc1",INSTANCES:[],STRINGS:[],SKINS:[],NAME:"name",INDEX:"{Wym_Index}",WYM_INDEX:"wym_index",BASE_PATH:"{Wym_Base_Path}",CSS_PATH:"{Wym_Css_Path}",WYM_PATH:"{Wym_Wym_Path}",SKINS_DEFAULT_PATH:"skins/",SKINS_DEFAULT_CSS:"skin.css",SKINS_DEFAULT_JS:"skin.js",LANG_DEFAULT_PATH:"lang/",IFRAME_BASE_PATH:"{Wym_Iframe_Base_Path}",IFRAME_DEFAULT:"iframe/default/",JQUERY_PATH:"{Wym_Jquery_Path}",DIRECTION:"{Wym_Direction}",LOGO:"{Wym_Logo}",TOOLS:"{Wym_Tools}",TOOLS_ITEMS:"{Wym_Tools_Items}",TOOL_NAME:"{Wym_Tool_Name}",TOOL_TITLE:"{Wym_Tool_Title}",TOOL_CLASS:"{Wym_Tool_Class}",CLASSES:"{Wym_Classes}",CLASSES_ITEMS:"{Wym_Classes_Items}",CLASS_NAME:"{Wym_Class_Name}",CLASS_TITLE:"{Wym_Class_Title}",CONTAINERS:"{Wym_Containers}",CONTAINERS_ITEMS:"{Wym_Containers_Items}",CONTAINER_NAME:"{Wym_Container_Name}",CONTAINER_TITLE:"{Wym_Containers_Title}",CONTAINER_CLASS:"{Wym_Container_Class}",HTML:"{Wym_Html}",IFRAME:"{Wym_Iframe}",STATUS:"{Wym_Status}",DIALOG_TITLE:"{Wym_Dialog_Title}",DIALOG_BODY:"{Wym_Dialog_Body}",STRING:"string",BODY:"body",DIV:"div",P:"p",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",PRE:"pre",BLOCKQUOTE:"blockquote",A:"a",BR:"br",IMG:"img",TABLE:"table",TD:"td",TH:"th",UL:"ul",OL:"ol",LI:"li",CLASS:"class",HREF:"href",SRC:"src",TITLE:"title",ALT:"alt",DIALOG_LINK:"Link",DIALOG_IMAGE:"Image",DIALOG_TABLE:"Table",DIALOG_PASTE:"Paste_From_Word",BOLD:"Bold",ITALIC:"Italic",CREATE_LINK:"CreateLink",INSERT_IMAGE:"InsertImage",INSERT_TABLE:"InsertTable",INSERT_HTML:"InsertHTML",PASTE:"Paste",INDENT:"Indent",OUTDENT:"Outdent",TOGGLE_HTML:"ToggleHtml",FORMAT_BLOCK:"FormatBlock",PREVIEW:"Preview",UNLINK:"Unlink",INSERT_UNORDEREDLIST:"InsertUnorderedList",INSERT_ORDEREDLIST:"InsertOrderedList",MAIN_CONTAINERS:new Array("p","h1","h2","h3","h4","h5","h6","pre","blockquote"),BLOCKS:new Array("address","blockquote","div","dl","fieldset","form","h1","h2","h3","h4","h5","h6","hr","noscript","ol","p","pre","table","ul","dd","dt","li","tbody","td","tfoot","th","thead","tr"),KEY:{BACKSPACE:8,ENTER:13,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,CURSOR:new Array(37,38,39,40),DELETE:46},NODE:{ELEMENT:1,ATTRIBUTE:2,TEXT:3},editor:function(b,a){this._index=WYMeditor.INSTANCES.push(this)-1;this._element=b;this._options=a;this._html=jQuery(b).val();if(this._options.html){this._html=this._options.html}this._options.basePath=this._options.basePath||this.computeBasePath();this._options.skinPath=this._options.skinPath||this._options.basePath+WYMeditor.SKINS_DEFAULT_PATH+this._options.skin+"/";this._options.wymPath=this._options.wymPath||this.computeWymPath();this._options.langPath=this._options.langPath||this._options.basePath+WYMeditor.LANG_DEFAULT_PATH;this._options.iframeBasePath=this._options.iframeBasePath||this._options.basePath+WYMeditor.IFRAME_DEFAULT;this._options.jQueryPath=this._options.jQueryPath||this.computeJqueryPath();this.init()}});jQuery.fn.wymeditor=function(a){a=jQuery.extend({html:"",basePath:false,skinPath:false,wymPath:false,iframeBasePath:false,jQueryPath:false,styles:false,stylesheet:false,skin:"default",initSkin:true,loadSkin:true,lang:"en",direction:"ltr",boxHtml:"<div class='wym_box'><div class='wym_area_top'>"+WYMeditor.TOOLS+"</div><div class='wym_area_left'></div><div class='wym_area_right'>"+WYMeditor.CONTAINERS+WYMeditor.CLASSES+"</div><div class='wym_area_main'>"+WYMeditor.HTML+WYMeditor.IFRAME+WYMeditor.STATUS+"</div><div class='wym_area_bottom'>"+WYMeditor.LOGO+"</div></div>",logoHtml:"<a class='wym_wymeditor_link' href='http://www.wymeditor.org/'>WYMeditor</a>",iframeHtml:"<div class='wym_iframe wym_section'><iframe src='/page/get_editor_iframe' onload='this.contentWindow.parent.WYMeditor.INSTANCES["+WYMeditor.INDEX+"].initIframe(this)'></iframe></div>",editorStyles:[],toolsHtml:"<div class='wym_tools wym_section'><h2>{Tools}</h2><ul>"+WYMeditor.TOOLS_ITEMS+"</ul></div>",toolsItemHtml:"<li class='"+WYMeditor.TOOL_CLASS+"'><a href='#' name='"+WYMeditor.TOOL_NAME+"' title='"+WYMeditor.TOOL_TITLE+"'>"+WYMeditor.TOOL_TITLE+"</a></li>",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"},{name:"Paste",title:"Paste_From_Word",css:"wym_tools_paste"},{name:"ToggleHtml",title:"HTML",css:"wym_tools_html"},{name:"Preview",title:"Preview",css:"wym_tools_preview"}],containersHtml:"<div class='wym_containers wym_section'><h2>{Containers}</h2><ul>"+WYMeditor.CONTAINERS_ITEMS+"</ul></div>",containersItemHtml:"<li class='"+WYMeditor.CONTAINER_CLASS+"'><a href='#' name='"+WYMeditor.CONTAINER_NAME+"'>"+WYMeditor.CONTAINER_TITLE+"</a></li>",containersItems:[{name:"P",title:"Paragraph",css:"wym_containers_p"},{name:"H1",title:"Heading_1",css:"wym_containers_h1"},{name:"H2",title:"Heading_2",css:"wym_containers_h2"},{name:"H3",title:"Heading_3",css:"wym_containers_h3"},{name:"H4",title:"Heading_4",css:"wym_containers_h4"},{name:"H5",title:"Heading_5",css:"wym_containers_h5"},{name:"H6",title:"Heading_6",css:"wym_containers_h6"},{name:"PRE",title:"Preformatted",css:"wym_containers_pre"},{name:"BLOCKQUOTE",title:"Blockquote",css:"wym_containers_blockquote"},{name:"TH",title:"Table_Header",css:"wym_containers_th"}],classesHtml:"<div class='wym_classes wym_section'><h2>{Classes}</h2><ul>"+WYMeditor.CLASSES_ITEMS+"</ul></div>",classesItemHtml:"<li><a href='#' name='"+WYMeditor.CLASS_NAME+"'>"+WYMeditor.CLASS_TITLE+"</a></li>",classesItems:[],statusHtml:"<div class='wym_status wym_section'><h2>{Status}</h2></div>",htmlHtml:"<div class='wym_html wym_section'><h2>{Source_Code}</h2><textarea class='wym_html_val'></textarea></div>",boxSelector:".wym_box",toolsSelector:".wym_tools",toolsListSelector:" ul",containersSelector:".wym_containers",classesSelector:".wym_classes",htmlSelector:".wym_html",iframeSelector:".wym_iframe iframe",iframeBodySelector:".wym_iframe",statusSelector:".wym_status",toolSelector:".wym_tools a",containerSelector:".wym_containers a",classSelector:".wym_classes a",htmlValSelector:".wym_html_val",hrefSelector:".wym_href",srcSelector:".wym_src",titleSelector:".wym_title",altSelector:".wym_alt",textSelector:".wym_text",rowsSelector:".wym_rows",colsSelector:".wym_cols",captionSelector:".wym_caption",summarySelector:".wym_summary",submitSelector:".wym_submit",cancelSelector:".wym_cancel",previewSelector:"",dialogTypeSelector:".wym_dialog_type",dialogLinkSelector:".wym_dialog_link",dialogImageSelector:".wym_dialog_image",dialogTableSelector:".wym_dialog_table",dialogPasteSelector:".wym_dialog_paste",dialogPreviewSelector:".wym_dialog_preview",updateSelector:".wymupdate",updateEvent:"click",dialogFeatures:"menubar=no,titlebar=no,toolbar=no,resizable=no,width=560,height=300,top=0,left=0",dialogFeaturesPreview:"menubar=no,titlebar=no,toolbar=no,resizable=no,scrollbars=yes,width=560,height=300,top=0,left=0",dialogHtml:"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'><html dir='"+WYMeditor.DIRECTION+"'><head><link rel='stylesheet' type='text/css' media='screen' href='"+WYMeditor.CSS_PATH+"' /><title>"+WYMeditor.DIALOG_TITLE+"</title><script type='text/javascript' src='"+WYMeditor.JQUERY_PATH+"'><\/script><script type='text/javascript' src='"+WYMeditor.WYM_PATH+"'><\/script></head>"+WYMeditor.DIALOG_BODY+"</html>",dialogLinkHtml:"<body class='wym_dialog wym_dialog_link' onload='WYMeditor.INIT_DIALOG("+WYMeditor.INDEX+")'><form><fieldset><input type='hidden' class='wym_dialog_type' value='"+WYMeditor.DIALOG_LINK+"' /><legend>{Link}</legend><div class='row'><label>{URL}</label><input type='text' class='wym_href' value='' size='40' /></div><div class='row'><label>{Title}</label><input type='text' class='wym_title' value='' size='40' /></div><div class='row row-indent'><input class='wym_submit' type='button' value='{Submit}' /><input class='wym_cancel' type='button'value='{Cancel}' /></div></fieldset></form></body>",dialogImageHtml:"<body class='wym_dialog wym_dialog_image' onload='WYMeditor.INIT_DIALOG("+WYMeditor.INDEX+")'><form><fieldset><input type='hidden' class='wym_dialog_type' value='"+WYMeditor.DIALOG_IMAGE+"' /><legend>{Image}</legend><div class='row'><label>{URL}</label><input type='text' class='wym_src' value='' size='40' /></div><div class='row'><label>{Alternative_Text}</label><input type='text' class='wym_alt' value='' size='40' /></div><div class='row'><label>{Title}</label><input type='text' class='wym_title' value='' size='40' /></div><div class='row row-indent'><input class='wym_submit' type='button' value='{Submit}' /><input class='wym_cancel' type='button'value='{Cancel}' /></div></fieldset></form></body>",dialogTableHtml:"<body class='wym_dialog wym_dialog_table' onload='WYMeditor.INIT_DIALOG("+WYMeditor.INDEX+")'><form><fieldset><input type='hidden' class='wym_dialog_type' value='"+WYMeditor.DIALOG_TABLE+"' /><legend>{Table}</legend><div class='row'><label>{Caption}</label><input type='text' class='wym_caption' value='' size='40' /></div><div class='row'><label>{Summary}</label><input type='text' class='wym_summary' value='' size='40' /></div><div class='row'><label>{Number_Of_Rows}</label><input type='text' class='wym_rows' value='3' size='3' /></div><div class='row'><label>{Number_Of_Cols}</label><input type='text' class='wym_cols' value='2' size='3' /></div><div class='row row-indent'><input class='wym_submit' type='button' value='{Submit}' /><input class='wym_cancel' type='button'value='{Cancel}' /></div></fieldset></form></body>",dialogPasteHtml:"<body class='wym_dialog wym_dialog_paste' onload='WYMeditor.INIT_DIALOG("+WYMeditor.INDEX+")'><form><input type='hidden' class='wym_dialog_type' value='"+WYMeditor.DIALOG_PASTE+"' /><fieldset><legend>{Paste_From_Word}</legend><div class='row'><textarea class='wym_text' rows='10' cols='50'></textarea></div><div class='row'><input class='wym_submit' type='button' value='{Submit}' /><input class='wym_cancel' type='button'value='{Cancel}' /></div></fieldset></form></body>",dialogPreviewHtml:"<body class='wym_dialog wym_dialog_preview' onload='WYMeditor.INIT_DIALOG("+WYMeditor.INDEX+")'></body>",dialogStyles:[],stringDelimiterLeft:"{",stringDelimiterRight:"}",preInit:null,preBind:null,postInit:null,preInitDialog:null,postInitDialog:null},a);return this.each(function(){new WYMeditor.editor(jQuery(this),a)})};jQuery.extend({wymeditors:function(a){return(WYMeditor.INSTANCES[a])}});WYMeditor.editor.prototype.init=function(){if(jQuery.browser.msie){var WymClass=new WYMeditor.WymClassExplorer(this)}else{if(jQuery.browser.mozilla){var WymClass=new WYMeditor.WymClassMozilla(this)}else{if(jQuery.browser.opera){var WymClass=new WYMeditor.WymClassOpera(this)}else{if(jQuery.browser.safari||jQuery.browser.chrome){var WymClass=new WYMeditor.WymClassSafari(this)}}}}if(WymClass){if(jQuery.isFunction(this._options.preInit)){this._options.preInit(this)}var SaxListener=new WYMeditor.XhtmlSaxListener();jQuery.extend(SaxListener,WymClass);this.parser=new WYMeditor.XhtmlParser(SaxListener);if(this._options.styles||this._options.stylesheet){this.configureEditorUsingRawCss()}this.helper=new WYMeditor.XmlHelper();for(var prop in WymClass){this[prop]=WymClass[prop]}this._box=jQuery(this._element).hide().after(this._options.boxHtml).next().addClass("wym_box_"+this._index);if(jQuery.isFunction(jQuery.fn.data)){jQuery.data(this._box.get(0),WYMeditor.WYM_INDEX,this._index);jQuery.data(this._element.get(0),WYMeditor.WYM_INDEX,this._index)}var h=WYMeditor.Helper;var iframeHtml=this._options.iframeHtml;iframeHtml=h.replaceAll(iframeHtml,WYMeditor.INDEX,this._index);iframeHtml=h.replaceAll(iframeHtml,WYMeditor.IFRAME_BASE_PATH,this._options.iframeBasePath);var boxHtml=jQuery(this._box).html();boxHtml=h.replaceAll(boxHtml,WYMeditor.LOGO,this._options.logoHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.TOOLS,this._options.toolsHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.CONTAINERS,this._options.containersHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.CLASSES,this._options.classesHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.HTML,this._options.htmlHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.IFRAME,iframeHtml);boxHtml=h.replaceAll(boxHtml,WYMeditor.STATUS,this._options.statusHtml);var aTools=eval(this._options.toolsItems);var sTools="";for(var i=0;i<aTools.length;i++){var oTool=aTools[i];if(oTool.name&&oTool.title){var sTool=this._options.toolsItemHtml}var sTool=h.replaceAll(sTool,WYMeditor.TOOL_NAME,oTool.name);sTool=h.replaceAll(sTool,WYMeditor.TOOL_TITLE,this._options.stringDelimiterLeft+oTool.title+this._options.stringDelimiterRight);sTool=h.replaceAll(sTool,WYMeditor.TOOL_CLASS,oTool.css);sTools+=sTool}boxHtml=h.replaceAll(boxHtml,WYMeditor.TOOLS_ITEMS,sTools);var aClasses=eval(this._options.classesItems);var sClasses="";for(var i=0;i<aClasses.length;i++){var oClass=aClasses[i];if(oClass.name&&oClass.title){var sClass=this._options.classesItemHtml}sClass=h.replaceAll(sClass,WYMeditor.CLASS_NAME,oClass.name);sClass=h.replaceAll(sClass,WYMeditor.CLASS_TITLE,oClass.title);sClasses+=sClass}boxHtml=h.replaceAll(boxHtml,WYMeditor.CLASSES_ITEMS,sClasses);var aContainers=eval(this._options.containersItems);var sContainers="";for(var i=0;i<aContainers.length;i++){var oContainer=aContainers[i];if(oContainer.name&&oContainer.title){var sContainer=this._options.containersItemHtml}sContainer=h.replaceAll(sContainer,WYMeditor.CONTAINER_NAME,oContainer.name);sContainer=h.replaceAll(sContainer,WYMeditor.CONTAINER_TITLE,this._options.stringDelimiterLeft+oContainer.title+this._options.stringDelimiterRight);sContainer=h.replaceAll(sContainer,WYMeditor.CONTAINER_CLASS,oContainer.css);sContainers+=sContainer}boxHtml=h.replaceAll(boxHtml,WYMeditor.CONTAINERS_ITEMS,sContainers);boxHtml=this.replaceStrings(boxHtml);jQuery(this._box).html(boxHtml);jQuery(this._box).find(this._options.htmlSelector).hide();this.loadSkin()}};WYMeditor.editor.prototype.bindEvents=function(){var wym=this;jQuery(this._box).find(this._options.toolSelector).click(function(){wym._iframe.contentWindow.focus();wym.exec(jQuery(this).attr(WYMeditor.NAME));return(false)});jQuery(this._box).find(this._options.containerSelector).click(function(){wym.container(jQuery(this).attr(WYMeditor.NAME));return(false)});jQuery(this._box).find(this._options.htmlValSelector).keyup(function(){jQuery(wym._doc.body).html(jQuery(this).val())}).focus(function(){jQuery(this).toggleClass("hasfocus")}).blur(function(){jQuery(this).toggleClass("hasfocus")});jQuery(this._box).find(this._options.classSelector).click(function(){var aClasses=eval(wym._options.classesItems);var sName=jQuery(this).attr(WYMeditor.NAME);var oClass=WYMeditor.Helper.findByName(aClasses,sName);if(oClass){var jqexpr=oClass.expr;wym.toggleClass(sName,jqexpr)}wym._iframe.contentWindow.focus();return(false)});jQuery(this._options.updateSelector).bind(this._options.updateEvent,function(){wym.update()})};WYMeditor.editor.prototype.ready=function(){return(this._doc!=null)};WYMeditor.editor.prototype.box=function(){return(this._box)};WYMeditor.editor.prototype.html=function(a){if(typeof a==="string"){jQuery(this._doc.body).html(a)}else{return(jQuery(this._doc.body).html())}};WYMeditor.editor.prototype.xhtml=function(){return this.parser.parse(this.html())};WYMeditor.editor.prototype.exec=function(b){switch(b){case WYMeditor.CREATE_LINK:var a=this.container();if(a||this._selected_image){this.dialog(WYMeditor.DIALOG_LINK)}break;case WYMeditor.INSERT_IMAGE:this.dialog(WYMeditor.DIALOG_IMAGE);break;case WYMeditor.INSERT_TABLE:this.dialog(WYMeditor.DIALOG_TABLE);break;case WYMeditor.PASTE:this.dialog(WYMeditor.DIALOG_PASTE);break;case WYMeditor.TOGGLE_HTML:this.update();this.toggleHtml();if(!jQuery(this._box).find(this._options.htmlSelector).is(":visible")){this.listen()}break;case WYMeditor.PREVIEW:this.dialog(WYMeditor.PREVIEW,this._options.dialogFeaturesPreview);break;default:this._exec(b);break}};WYMeditor.editor.prototype.container=function(a){if(a){var d=null;if(a.toLowerCase()==WYMeditor.TH){d=this.container();switch(d.tagName.toLowerCase()){case WYMeditor.TD:case WYMeditor.TH:break;default:var e=new Array(WYMeditor.TD,WYMeditor.TH);d=this.findUp(this.container(),e);break}if(d!=null){a=(d.tagName.toLowerCase()==WYMeditor.TD)?WYMeditor.TH:WYMeditor.TD;this.switchTo(d,a);this.update()}}else{var e=new Array(WYMeditor.P,WYMeditor.H1,WYMeditor.H2,WYMeditor.H3,WYMeditor.H4,WYMeditor.H5,WYMeditor.H6,WYMeditor.PRE,WYMeditor.BLOCKQUOTE);d=this.findUp(this.container(),e);if(d){var i=null;if(a.toLowerCase()==WYMeditor.BLOCKQUOTE){var f=this.findUp(this.container(),WYMeditor.BLOCKQUOTE);if(f==null){i=this._doc.createElement(a);d.parentNode.insertBefore(i,d);i.appendChild(d);this.setFocusToNode(i.firstChild)}else{var c=f.childNodes;var g=c.length;var b=null;if(g>0){b=c.item(0)}for(var h=0;h<g;h++){f.parentNode.insertBefore(c.item(0),f)}f.parentNode.removeChild(f);if(b){this.setFocusToNode(b)}}}else{this.switchTo(d,a)}this.update()}}}else{return(this.selected())}};WYMeditor.editor.prototype.toggleClass=function(c,b){var a=(this._selected_image?this._selected_image:jQuery(this.selected()));a=jQuery(a).parentsOrSelf(b);jQuery(a).toggleClass(c);if(!jQuery(a).attr(WYMeditor.CLASS)){jQuery(a).removeAttr(this._class)}};WYMeditor.editor.prototype.findUp=function(d,c){if(d){var e=d.tagName.toLowerCase();if(typeof(c)==WYMeditor.STRING){while(e!=c&&e!=WYMeditor.BODY){d=d.parentNode;e=d.tagName.toLowerCase()}}else{var b=false;while(!b&&e!=WYMeditor.BODY){for(var a=0;a<c.length;a++){if(e==c[a]){b=true;break}}if(!b){d=d.parentNode;e=d.tagName.toLowerCase()}}}if(e!=WYMeditor.BODY){return(d)}else{return(null)}}else{return(null)}};WYMeditor.editor.prototype.switchTo=function(c,d){var b=this._doc.createElement(d);var a=jQuery(c).html();c.parentNode.replaceChild(b,c);jQuery(b).html(a);this.setFocusToNode(b)};WYMeditor.editor.prototype.replaceStrings=function(sVal){if(!WYMeditor.STRINGS[this._options.lang]){try{eval(jQuery.ajax({url:this._options.langPath+this._options.lang+".js",async:false}).responseText)}catch(e){WYMeditor.console.error("WYMeditor: error while parsing language file.");return sVal}}for(var key in WYMeditor.STRINGS[this._options.lang]){sVal=WYMeditor.Helper.replaceAll(sVal,this._options.stringDelimiterLeft+key+this._options.stringDelimiterRight,WYMeditor.STRINGS[this._options.lang][key])}return(sVal)};WYMeditor.editor.prototype.encloseString=function(a){return(this._options.stringDelimiterLeft+a+this._options.stringDelimiterRight)};WYMeditor.editor.prototype.status=function(a){jQuery(this._box).find(this._options.statusSelector).html(a)};WYMeditor.editor.prototype.update=function(){var a=this.xhtml();jQuery(this._element).val(a);jQuery(this._box).find(this._options.htmlValSelector).not(".hasfocus").val(a)};WYMeditor.editor.prototype.dialog=function(j,c,f){var a=c||this._wym._options.dialogFeatures;var d=window.open("","dialog",a);if(d){var b="";switch(j){case (WYMeditor.DIALOG_LINK):b=this._options.dialogLinkHtml;break;case (WYMeditor.DIALOG_IMAGE):b=this._options.dialogImageHtml;break;case (WYMeditor.DIALOG_TABLE):b=this._options.dialogTableHtml;break;case (WYMeditor.DIALOG_PASTE):b=this._options.dialogPasteHtml;break;case (WYMeditor.PREVIEW):b=this._options.dialogPreviewHtml;break;default:b=f}var e=WYMeditor.Helper;var g=this._options.dialogHtml;g=e.replaceAll(g,WYMeditor.BASE_PATH,this._options.basePath);g=e.replaceAll(g,WYMeditor.DIRECTION,this._options.direction);g=e.replaceAll(g,WYMeditor.CSS_PATH,this._options.skinPath+WYMeditor.SKINS_DEFAULT_CSS);g=e.replaceAll(g,WYMeditor.WYM_PATH,this._options.wymPath);g=e.replaceAll(g,WYMeditor.JQUERY_PATH,this._options.jQueryPath);g=e.replaceAll(g,WYMeditor.DIALOG_TITLE,this.encloseString(j));g=e.replaceAll(g,WYMeditor.DIALOG_BODY,b);g=e.replaceAll(g,WYMeditor.INDEX,this._index);g=this.replaceStrings(g);var i=d.document;i.write(g);i.close()}};WYMeditor.editor.prototype.toggleHtml=function(){jQuery(this._box).find(this._options.htmlSelector).toggle()};WYMeditor.editor.prototype.uniqueStamp=function(){var a=new Date();return("wym-"+a.getTime())};WYMeditor.editor.prototype.paste=function(b){var e;var a=this.selected();var c=b.split(this._newLine+this._newLine);var d=new RegExp(this._newLine,"g");if(a&&a.tagName.toLowerCase()!=WYMeditor.BODY){for(x=c.length-1;x>=0;x--){e=c[x];e=e.replace(d,"<br />");jQuery(a).after("<p>"+e+"</p>")}}else{for(x=0;x<c.length;x++){e=c[x];e=e.replace(d,"<br />");jQuery(this._doc.body).append("<p>"+e+"</p>")}}};WYMeditor.editor.prototype.insert=function(a){if(this._iframe.contentWindow.getSelection().focusNode!=null){this._exec(WYMeditor.INSERT_HTML,a)}else{this.paste(a)}};WYMeditor.editor.prototype.wrap=function(b,a){if(this._iframe.contentWindow.getSelection().focusNode!=null){this._exec(WYMeditor.INSERT_HTML,b+this._iframe.contentWindow.getSelection().toString()+a)}};WYMeditor.editor.prototype.unwrap=function(){if(this._iframe.contentWindow.getSelection().focusNode!=null){this._exec(WYMeditor.INSERT_HTML,this._iframe.contentWindow.getSelection().toString())}};WYMeditor.editor.prototype.addCssRules=function(e,c){var b=e.styleSheets[0];if(b){for(var a=0;a<c.length;a++){var d=c[a];if(d.name&&d.css){this.addCssRule(b,d)}}}};WYMeditor.editor.prototype.computeBasePath=function(){return jQuery(jQuery.grep(jQuery("script"),function(a){return(a.src&&a.src.match(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/))})).attr("src").replace(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/,"")};WYMeditor.editor.prototype.computeWymPath=function(){return jQuery(jQuery.grep(jQuery("script"),function(a){return(a.src&&a.src.match(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/))})).attr("src")};WYMeditor.editor.prototype.computeJqueryPath=function(){return jQuery(jQuery.grep(jQuery("script"),function(a){return(a.src&&a.src.match(/jquery(-(.*)){0,1}(\.pack|\.min|\.packed)?\.js(\?.*)?$/))})).attr("src")};WYMeditor.editor.prototype.computeCssPath=function(){return jQuery(jQuery.grep(jQuery("link"),function(a){return(a.href&&a.href.match(/wymeditor\/skins\/(.*)screen\.css(\?.*)?$/))})).attr("href")};WYMeditor.editor.prototype.configureEditorUsingRawCss=function(){var a=new WYMeditor.WymCssParser();if(this._options.stylesheet){a.parse(jQuery.ajax({url:this._options.stylesheet,async:false}).responseText)}else{a.parse(this._options.styles,false)}if(this._options.classesItems.length==0){this._options.classesItems=a.css_settings.classesItems}if(this._options.editorStyles.length==0){this._options.editorStyles=a.css_settings.editorStyles}if(this._options.dialogStyles.length==0){this._options.dialogStyles=a.css_settings.dialogStyles}};WYMeditor.editor.prototype.listen=function(){jQuery(this._doc.body).bind("mousedown",this.mousedown);var a=this._doc.body.getElementsByTagName("img");for(var b=0;b<a.length;b++){jQuery(a[b]).bind("mousedown",this.mousedown)}};WYMeditor.editor.prototype.mousedown=function(a){var b=WYMeditor.INSTANCES[this.ownerDocument.title];b._selected_image=(this.tagName.toLowerCase()==WYMeditor.IMG)?this:null;a.stopPropagation()};WYMeditor.loadCss=function(a){var c=document.createElement("link");c.rel="stylesheet";c.href=a;var b=jQuery("head").get(0);b.appendChild(c)};WYMeditor.editor.prototype.loadSkin=function(){if(this._options.loadSkin&&!WYMeditor.SKINS[this._options.skin]){var found=false;var rExp=new RegExp(this._options.skin+"/"+WYMeditor.SKINS_DEFAULT_CSS+"$");jQuery("link").each(function(){if(this.href.match(rExp)){found=true}});if(!found){WYMeditor.loadCss(this._options.skinPath+WYMeditor.SKINS_DEFAULT_CSS)}}jQuery(this._box).addClass("wym_skin_"+this._options.skin);if(this._options.initSkin&&!WYMeditor.SKINS[this._options.skin]){eval(jQuery.ajax({url:this._options.skinPath+WYMeditor.SKINS_DEFAULT_JS,async:false}).responseText)}if(WYMeditor.SKINS[this._options.skin]&&WYMeditor.SKINS[this._options.skin].init){WYMeditor.SKINS[this._options.skin].init(this)}};WYMeditor.INIT_DIALOG=function(index){var wym=window.opener.WYMeditor.INSTANCES[index];var doc=window.document;var selected=wym.selected();var dialogType=jQuery(wym._options.dialogTypeSelector).val();var sStamp=wym.uniqueStamp();switch(dialogType){case WYMeditor.DIALOG_LINK:if(selected&&selected.tagName&&selected.tagName.toLowerCase!=WYMeditor.A){selected=jQuery(selected).parentsOrSelf(WYMeditor.A)}if(!selected&&wym._selected_image){selected=jQuery(wym._selected_image).parentsOrSelf(WYMeditor.A)}break}if(jQuery.isFunction(wym._options.preInitDialog)){wym._options.preInitDialog(wym,window)}var styles=doc.styleSheets[0];var aCss=eval(wym._options.dialogStyles);wym.addCssRules(doc,aCss);if(selected){jQuery(wym._options.hrefSelector).val(jQuery(selected).attr(WYMeditor.HREF));jQuery(wym._options.srcSelector).val(jQuery(selected).attr(WYMeditor.SRC));jQuery(wym._options.titleSelector).val(jQuery(selected).attr(WYMeditor.TITLE));jQuery(wym._options.altSelector).val(jQuery(selected).attr(WYMeditor.ALT))}if(wym._selected_image){jQuery(wym._options.dialogImageSelector+" "+wym._options.srcSelector).val(jQuery(wym._selected_image).attr(WYMeditor.SRC));jQuery(wym._options.dialogImageSelector+" "+wym._options.titleSelector).val(jQuery(wym._selected_image).attr(WYMeditor.TITLE));jQuery(wym._options.dialogImageSelector+" "+wym._options.altSelector).val(jQuery(wym._selected_image).attr(WYMeditor.ALT))}jQuery(wym._options.dialogLinkSelector+" "+wym._options.submitSelector).click(function(){var sUrl=jQuery(wym._options.hrefSelector).val();if(sUrl.length>0){wym._exec(WYMeditor.CREATE_LINK,sStamp);jQuery("a[href="+sStamp+"]",wym._doc.body).attr(WYMeditor.HREF,sUrl).attr(WYMeditor.TITLE,jQuery(wym._options.titleSelector).val())}window.close()});jQuery(wym._options.dialogImageSelector+" "+wym._options.submitSelector).click(function(){var sUrl=jQuery(wym._options.srcSelector).val();if(sUrl.length>0){wym._exec(WYMeditor.INSERT_IMAGE,sStamp);jQuery("img[src$="+sStamp+"]",wym._doc.body).attr(WYMeditor.SRC,sUrl).attr(WYMeditor.TITLE,jQuery(wym._options.titleSelector).val()).attr(WYMeditor.ALT,jQuery(wym._options.altSelector).val())}window.close()});jQuery(wym._options.dialogTableSelector+" "+wym._options.submitSelector).click(function(){var iRows=jQuery(wym._options.rowsSelector).val();var iCols=jQuery(wym._options.colsSelector).val();if(iRows>0&&iCols>0){var table=wym._doc.createElement(WYMeditor.TABLE);var newRow=null;var newCol=null;var sCaption=jQuery(wym._options.captionSelector).val();var newCaption=table.createCaption();newCaption.innerHTML=sCaption;for(x=0;x<iRows;x++){newRow=table.insertRow(x);for(y=0;y<iCols;y++){newRow.insertCell(y)}}jQuery(table).attr("summary",jQuery(wym._options.summarySelector).val());var node=jQuery(wym.findUp(wym.container(),WYMeditor.MAIN_CONTAINERS)).get(0);if(!node||!node.parentNode){jQuery(wym._doc.body).append(table)}else{jQuery(node).after(table)}}window.close()});jQuery(wym._options.dialogPasteSelector+" "+wym._options.submitSelector).click(function(){var sText=jQuery(wym._options.textSelector).val();wym.paste(sText);window.close()});jQuery(wym._options.dialogPreviewSelector+" "+wym._options.previewSelector).html(wym.xhtml());jQuery(wym._options.cancelSelector).mousedown(function(){window.close()});if(jQuery.isFunction(wym._options.postInitDialog)){wym._options.postInitDialog(wym,window)}};WYMeditor.XmlHelper=function(){this._entitiesDiv=document.createElement("div");return this};WYMeditor.XmlHelper.prototype.tag=function(c,b,a){b=b||false;a=a||false;return"<"+c+(b?this.tagOptions(b):"")+(a?">":" />")};WYMeditor.XmlHelper.prototype.contentTag=function(b,c,a){a=a||false;return"<"+b+(a?this.tagOptions(a):"")+">"+c+"</"+b+">"};WYMeditor.XmlHelper.prototype.cdataSection=function(a){return"<![CDATA["+a+"]]>"};WYMeditor.XmlHelper.prototype.escapeOnce=function(a){return this._fixDoubleEscape(this.escapeEntities(a))};WYMeditor.XmlHelper.prototype._fixDoubleEscape=function(a){return a.replace(/&([a-z]+|(#\d+));/ig,"&$1;")};WYMeditor.XmlHelper.prototype.tagOptions=function(b){var a=this;a._formated_options="";for(var c in b){var d="";var e=b[c];if(typeof e!="function"&&e.length>0){if(parseInt(c)==c&&typeof e=="object"){c=e.shift();e=e.pop()}if(c!=""&&e!=""){a._formated_options+=" "+c+'="'+a.escapeOnce(e)+'"'}}}return a._formated_options};WYMeditor.XmlHelper.prototype.escapeEntities=function(c,b){this._entitiesDiv.innerHTML=c;this._entitiesDiv.textContent=c;var a=this._entitiesDiv.innerHTML;if(typeof b=="undefined"){if(b!=false){a=a.replace('"',""")}if(b==true){a=a.replace('"',"'")}}return a};WYMeditor.XmlHelper.prototype.parseAttributes=function(h){var a=[];var g=h.split(/((=\s*")(")("))|((=\s*\')(\')(\'))|((=\s*[^>\s]*))/g);if(g.toString()!=h){for(var d in g){var c=g[d];if(typeof c!="function"&&c.length!=0){var e=new RegExp("(\\w+)\\s*"+c);if(match=h.match(e)){var f=c.replace(/^[\s=]+/,"");var b=f.charAt(0);b=b=='"'?'"':(b=="'"?"'":"");if(b!=""){f=b=='"'?f.replace(/^"|"+$/g,""):f.replace(/^'|'+$/g,"")}h=h.replace(match[0],"");a.push([match[1],f])}}}}return a};WYMeditor.XhtmlValidator={_attributes:{core:{except:["base","head","html","meta","param","script","style","title"],attributes:["class","id","style","title","accesskey","tabindex"]},language:{except:["base","br","hr","iframe","param","script"],attributes:{dir:["ltr","rtl"],"0":"lang","1":"xml:lang"}},keyboard:{attributes:{accesskey:/^(\w){1}$/,tabindex:/^(\d)+$/}}},_events:{window:{only:["body"],attributes:["onload","onunload"]},form:{only:["form","input","textarea","select","a","label","button"],attributes:["onchange","onsubmit","onreset","onselect","onblur","onfocus"]},keyboard:{except:["base","bdo","br","frame","frameset","head","html","iframe","meta","param","script","style","title"],attributes:["onkeydown","onkeypress","onkeyup"]},mouse:{except:["base","bdo","br","head","html","meta","param","script","style","title"],attributes:["onclick","ondblclick","onmousedown","onmousemove","onmouseover","onmouseout","onmouseup"]}},_tags:{a:{attributes:{"0":"charset","1":"coords","2":"href","3":"hreflang","4":"name",rel:/^(alternate|designates|stylesheet|start|next|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark| |shortcut|icon)+$/,rev:/^(alternate|designates|stylesheet|start|next|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark| |shortcut|icon)+$/,shape:/^(rect|rectangle|circ|circle|poly|polygon)$/,"5":"type"}},"0":"abbr","1":"acronym","2":"address",area:{attributes:{"0":"alt","1":"coords","2":"href",nohref:/^(true|false)$/,shape:/^(rect|rectangle|circ|circle|poly|polygon)$/},required:["alt"]},"3":"b",base:{attributes:["href"],required:["href"]},bdo:{attributes:{dir:/^(ltr|rtl)$/},required:["dir"]},"4":"big",blockquote:{attributes:["cite"]},"5":"body","6":"br",button:{attributes:{disabled:/^(disabled)$/,type:/^(button|reset|submit)$/,"0":"value"},inside:"form"},"7":"caption","8":"cite","9":"code",col:{attributes:{align:/^(right|left|center|justify)$/,"0":"char","1":"charoff",span:/^(\d)+$/,valign:/^(top|middle|bottom|baseline)$/,"2":"width"},inside:"colgroup"},colgroup:{attributes:{align:/^(right|left|center|justify)$/,"0":"char","1":"charoff",span:/^(\d)+$/,valign:/^(top|middle|bottom|baseline)$/,"2":"width"}},"10":"dd",del:{attributes:{"0":"cite",datetime:/^([0-9]){8}/}},"11":"div","12":"dfn","13":"dl","14":"dt","15":"em",fieldset:{inside:"form"},form:{attributes:{"0":"action","1":"accept","2":"accept-charset","3":"enctype",method:/^(get|post)$/},required:["action"]},head:{attributes:["profile"]},"16":"h1","17":"h2","18":"h3","19":"h4","20":"h5","21":"h6","22":"hr",html:{attributes:["xmlns"]},"23":"i",img:{attributes:["alt","src","height","ismap","longdesc","usemap","width"],required:["alt","src"]},input:{attributes:{"0":"accept","1":"alt",checked:/^(checked)$/,disabled:/^(disabled)$/,maxlength:/^(\d)+$/,"2":"name",readonly:/^(readonly)$/,size:/^(\d)+$/,"3":"src",type:/^(button|checkbox|file|hidden|image|password|radio|reset|submit|text)$/,"4":"value"},inside:"form"},ins:{attributes:{"0":"cite",datetime:/^([0-9]){8}/}},"24":"kbd",label:{attributes:["for"],inside:"form"},"25":"legend","26":"li",link:{attributes:{"0":"charset","1":"href","2":"hreflang",media:/^(all|braille|print|projection|screen|speech|,|;| )+$/i,rel:/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,rev:/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,"3":"type"},inside:"head"},map:{attributes:["id","name"],required:["id"]},meta:{attributes:{"0":"content","http-equiv":/^(content\-type|expires|refresh|set\-cookie)$/i,"1":"name","2":"scheme"},required:["content"]},"27":"noscript",object:{attributes:["archive","classid","codebase","codetype","data","declare","height","name","standby","type","usemap","width"]},"28":"ol",optgroup:{attributes:{"0":"label",disabled:/^(disabled)$/},required:["label"]},option:{attributes:{"0":"label",disabled:/^(disabled)$/,selected:/^(selected)$/,"1":"value"},inside:"select"},"29":"p",param:{attributes:{"0":"type",valuetype:/^(data|ref|object)$/,"1":"valuetype","2":"value"},required:["name"]},"30":"pre",q:{attributes:["cite"]},"31":"samp",script:{attributes:{type:/^(text\/ecmascript|text\/javascript|text\/jscript|text\/vbscript|text\/vbs|text\/xml)$/,"0":"charset",defer:/^(defer)$/,"1":"src"},required:["type"]},select:{attributes:{disabled:/^(disabled)$/,multiple:/^(multiple)$/,"0":"name","1":"size"},inside:"form"},"32":"small","33":"span","34":"strong",style:{attributes:{"0":"type",media:/^(screen|tty|tv|projection|handheld|print|braille|aural|all)$/},required:["type"]},"35":"sub","36":"sup",table:{attributes:{"0":"border","1":"cellpadding","2":"cellspacing",frame:/^(void|above|below|hsides|lhs|rhs|vsides|box|border)$/,rules:/^(none|groups|rows|cols|all)$/,"3":"summary","4":"width"}},tbody:{attributes:{align:/^(right|left|center|justify)$/,"0":"char","1":"charoff",valign:/^(top|middle|bottom|baseline)$/}},td:{attributes:{"0":"abbr",align:/^(left|right|center|justify|char)$/,"1":"axis","2":"char","3":"charoff",colspan:/^(\d)+$/,"4":"headers",rowspan:/^(\d)+$/,scope:/^(col|colgroup|row|rowgroup)$/,valign:/^(top|middle|bottom|baseline)$/}},textarea:{attributes:["cols","rows","disabled","name","readonly"],required:["cols","rows"],inside:"form"},tfoot:{attributes:{align:/^(right|left|center|justify)$/,"0":"char","1":"charoff",valign:/^(top|middle|bottom)$/,"2":"baseline"}},th:{attributes:{"0":"abbr",align:/^(left|right|center|justify|char)$/,"1":"axis","2":"char","3":"charoff",colspan:/^(\d)+$/,"4":"headers",rowspan:/^(\d)+$/,scope:/^(col|colgroup|row|rowgroup)$/,valign:/^(top|middle|bottom|baseline)$/}},thead:{attributes:{align:/^(right|left|center|justify)$/,"0":"char","1":"charoff",valign:/^(top|middle|bottom|baseline)$/}},"37":"title",tr:{attributes:{align:/^(right|left|center|justify|char)$/,"0":"char","1":"charoff",valign:/^(top|middle|bottom|baseline)$/}},"38":"tt","39":"ul","40":"var"},skiped_attributes:[],skiped_attribute_values:[],getValidTagAttributes:function(a,b){var c={};var g=this.getPossibleTagAttributes(a);for(var e in b){var f=b[e];var d=WYMeditor.Helper;if(!d.contains(this.skiped_attributes,e)&&!d.contains(this.skiped_attribute_values,f)){if(typeof f!="function"&&d.contains(g,e)){if(this.doesAttributeNeedsValidation(a,e)){if(this.validateAttribute(a,e,f)){c[e]=f}}else{c[e]=f}}}}return c},getUniqueAttributesAndEventsForTag:function(b){var a=[];if(this._tags[b]&&this._tags[b]["attributes"]){for(k in this._tags[b]["attributes"]){a.push(parseInt(k)==k?this._tags[b]["attributes"][k]:k)}}return a},getDefaultAttributesAndEventsForTags:function(){var a=[];for(var b in this._events){a.push(this._events[b])}for(var b in this._attributes){a.push(this._attributes[b])}return a},isValidTag:function(a){if(this._tags[a]){return true}for(var b in this._tags){if(this._tags[b]==a){return true}}return false},getDefaultAttributesAndEventsForTag:function(a){var i=[];if(this.isValidTag(a)){var g=this.getDefaultAttributesAndEventsForTags();for(var d in g){var f=g[d];if(typeof f=="object"){var e=WYMeditor.Helper;if((f.except&&e.contains(f.except,a))||(f.only&&!e.contains(f.only,a))){continue}var c=f.attributes?f.attributes:f.events;for(var b in c){i.push(typeof c[b]!="string"?b:c[b])}}}}return i},doesAttributeNeedsValidation:function(a,b){return this._tags[a]&&((this._tags[a]["attributes"]&&this._tags[a]["attributes"][b])||(this._tags[a]["required"]&&WYMeditor.Helper.contains(this._tags[a]["required"],b)))},validateAttribute:function(a,b,c){if(this._tags[a]&&(this._tags[a]["attributes"]&&this._tags[a]["attributes"][b]&&c.length>0&&!c.match(this._tags[a]["attributes"][b]))||(this._tags[a]&&this._tags[a]["required"]&&WYMeditor.Helper.contains(this._tags[a]["required"],b)&&c.length==0)){return false}return typeof this._tags[a]!="undefined"},getPossibleTagAttributes:function(a){if(!this._possible_tag_attributes){this._possible_tag_attributes={}}if(!this._possible_tag_attributes[a]){this._possible_tag_attributes[a]=this.getUniqueAttributesAndEventsForTag(a).concat(this.getDefaultAttributesAndEventsForTag(a))}return this._possible_tag_attributes[a]}};WYMeditor.ParallelRegex=function(a){this._case=a;this._patterns=[];this._labels=[];this._regex=null;return this};WYMeditor.ParallelRegex.prototype.addPattern=function(c,a){a=a||true;var b=this._patterns.length;this._patterns[b]=c;this._labels[b]=a;this._regex=null};WYMeditor.ParallelRegex.prototype.match=function(c){if(this._patterns.length==0){return[false,""]}var d=c.match(this._getCompoundedRegex());if(!d){return[false,""]}var a=d[0];for(var b=1;b<d.length;b++){if(d[b]){return[this._labels[b-1],a]}}return[true,d[0]]};WYMeditor.ParallelRegex.prototype._getCompoundedRegex=function(){if(this._regex==null){for(var a=0,b=this._patterns.length;a<b;a++){this._patterns[a]="("+this._untokenizeRegex(this._tokenizeRegex(this._patterns[a]).replace(/([\/\(\)])/g,"\\$1"))+")"}this._regex=new RegExp(this._patterns.join("|"),this._getPerlMatchingFlags())}return this._regex};WYMeditor.ParallelRegex.prototype._tokenizeRegex=function(a){return a.replace(/\(\?(i|m|s|x|U)\)/,"~~~~~~Tk1$1~~~~~~").replace(/\(\?(\-[i|m|s|x|U])\)/,"~~~~~~Tk2$1~~~~~~").replace(/\(\?\=(.*)\)/,"~~~~~~Tk3$1~~~~~~").replace(/\(\?\!(.*)\)/,"~~~~~~Tk4$1~~~~~~").replace(/\(\?\<\=(.*)\)/,"~~~~~~Tk5$1~~~~~~").replace(/\(\?\<\!(.*)\)/,"~~~~~~Tk6$1~~~~~~").replace(/\(\?\:(.*)\)/,"~~~~~~Tk7$1~~~~~~")};WYMeditor.ParallelRegex.prototype._untokenizeRegex=function(a){return a.replace(/~~~~~~Tk1(.{1})~~~~~~/,"(?$1)").replace(/~~~~~~Tk2(.{2})~~~~~~/,"(?$1)").replace(/~~~~~~Tk3(.*)~~~~~~/,"(?=$1)").replace(/~~~~~~Tk4(.*)~~~~~~/,"(?!$1)").replace(/~~~~~~Tk5(.*)~~~~~~/,"(?<=$1)").replace(/~~~~~~Tk6(.*)~~~~~~/,"(?<!$1)").replace(/~~~~~~Tk7(.*)~~~~~~/,"(?:$1)")};WYMeditor.ParallelRegex.prototype._getPerlMatchingFlags=function(){return(this._case?"m":"mi")};WYMeditor.StateStack=function(a){this._stack=[a];return this};WYMeditor.StateStack.prototype.getCurrent=function(){return this._stack[this._stack.length-1]};WYMeditor.StateStack.prototype.enter=function(a){this._stack.push(a)};WYMeditor.StateStack.prototype.leave=function(){if(this._stack.length==1){return false}this._stack.pop();return true};WYMeditor.LEXER_ENTER=1;WYMeditor.LEXER_MATCHED=2;WYMeditor.LEXER_UNMATCHED=3;WYMeditor.LEXER_EXIT=4;WYMeditor.LEXER_SPECIAL=5;WYMeditor.Lexer=function(c,b,a){b=b||"accept";this._case=a||false;this._regexes={};this._parser=c;this._mode=new WYMeditor.StateStack(b);this._mode_handlers={};this._mode_handlers[b]=b;return this};WYMeditor.Lexer.prototype.addPattern=function(a,b){var b=b||"accept";if(typeof this._regexes[b]=="undefined"){this._regexes[b]=new WYMeditor.ParallelRegex(this._case)}this._regexes[b].addPattern(a);if(typeof this._mode_handlers[b]=="undefined"){this._mode_handlers[b]=b}};WYMeditor.Lexer.prototype.addEntryPattern=function(b,c,a){if(typeof this._regexes[c]=="undefined"){this._regexes[c]=new WYMeditor.ParallelRegex(this._case)}this._regexes[c].addPattern(b,a);if(typeof this._mode_handlers[a]=="undefined"){this._mode_handlers[a]=a}};WYMeditor.Lexer.prototype.addExitPattern=function(a,b){if(typeof this._regexes[b]=="undefined"){this._regexes[b]=new WYMeditor.ParallelRegex(this._case)}this._regexes[b].addPattern(a,"__exit");if(typeof this._mode_handlers[b]=="undefined"){this._mode_handlers[b]=b}};WYMeditor.Lexer.prototype.addSpecialPattern=function(b,c,a){if(typeof this._regexes[c]=="undefined"){this._regexes[c]=new WYMeditor.ParallelRegex(this._case)}this._regexes[c].addPattern(b,"_"+a);if(typeof this._mode_handlers[a]=="undefined"){this._mode_handlers[a]=a}};WYMeditor.Lexer.prototype.mapHandler=function(b,a){this._mode_handlers[b]=a};WYMeditor.Lexer.prototype.parse=function(d){if(typeof this._parser=="undefined"){return false}var e=d.length;var c;while(typeof(c=this._reduce(d))=="object"){var d=c[0];var b=c[1];var a=c[2];var f=c[3];if(!this._dispatchTokens(b,a,f)){return false}if(d==""){return true}if(d.length==e){return false}e=d.length}if(!c){return false}return this._invokeParser(d,WYMeditor.LEXER_UNMATCHED)};WYMeditor.Lexer.prototype._dispatchTokens=function(b,a,c){c=c||false;if(!this._invokeParser(b,WYMeditor.LEXER_UNMATCHED)){return false}if(typeof c=="boolean"){return this._invokeParser(a,WYMeditor.LEXER_MATCHED)}if(this._isModeEnd(c)){if(!this._invokeParser(a,WYMeditor.LEXER_EXIT)){return false}return this._mode.leave()}if(this._isSpecialMode(c)){this._mode.enter(this._decodeSpecial(c));if(!this._invokeParser(a,WYMeditor.LEXER_SPECIAL)){return false}return this._mode.leave()}this._mode.enter(c);return this._invokeParser(a,WYMeditor.LEXER_ENTER)};WYMeditor.Lexer.prototype._isModeEnd=function(a){return(a==="__exit")};WYMeditor.Lexer.prototype._isSpecialMode=function(a){return(a.substring(0,1)=="_")};WYMeditor.Lexer.prototype._decodeSpecial=function(a){return a.substring(1)};WYMeditor.Lexer.prototype._invokeParser=function(content,is_match){if(!/ +/.test(content)&&((content==="")||(content==false))){return true}var current=this._mode.getCurrent();var handler=this._mode_handlers[current];var result;eval("result = this._parser."+handler+"(content, is_match);");return result};WYMeditor.Lexer.prototype._reduce=function(c){var a=this._regexes[this._mode.getCurrent()].match(c);var b=a[1];var e=a[0];if(e){var f=c.indexOf(b);var d=c.substr(0,f);c=c.substring(f+b.length);return[c,d,b,e]}return true};WYMeditor.XhtmlLexer=function(a){jQuery.extend(this,new WYMeditor.Lexer(a,"Text"));this.mapHandler("Text","Text");this.addTokens();this.init();return this};WYMeditor.XhtmlLexer.prototype.init=function(){};WYMeditor.XhtmlLexer.prototype.addTokens=function(){this.addCommentTokens("Text");this.addScriptTokens("Text");this.addCssTokens("Text");this.addTagTokens("Text")};WYMeditor.XhtmlLexer.prototype.addCommentTokens=function(a){this.addEntryPattern("<!--",a,"Comment");this.addExitPattern("-->","Comment")};WYMeditor.XhtmlLexer.prototype.addScriptTokens=function(a){this.addEntryPattern("<script",a,"Script");this.addExitPattern("<\/script>","Script")};WYMeditor.XhtmlLexer.prototype.addCssTokens=function(a){this.addEntryPattern("<style",a,"Css");this.addExitPattern("</style>","Css")};WYMeditor.XhtmlLexer.prototype.addTagTokens=function(a){this.addSpecialPattern("<\\s*[a-z0-9:-]+\\s*>",a,"OpeningTag");this.addEntryPattern("<[a-z0-9:-]+[\\/ \\>]+",a,"OpeningTag");this.addInTagDeclarationTokens("OpeningTag");this.addSpecialPattern("</\\s*[a-z0-9:-]+\\s*>",a,"ClosingTag")};WYMeditor.XhtmlLexer.prototype.addInTagDeclarationTokens=function(a){this.addSpecialPattern("\\s+",a,"Ignore");this.addAttributeTokens(a);this.addExitPattern("/>",a);this.addExitPattern(">",a)};WYMeditor.XhtmlLexer.prototype.addAttributeTokens=function(a){this.addSpecialPattern("\\s*[a-z-_0-9]*:?[a-z-_0-9]+\\s*(?==)\\s*",a,"TagAttributes");this.addEntryPattern('=\\s*"',a,"DoubleQuotedAttribute");this.addPattern('\\\\"',"DoubleQuotedAttribute");this.addExitPattern('"',"DoubleQuotedAttribute");this.addEntryPattern("=\\s*'",a,"SingleQuotedAttribute");this.addPattern("\\\\'","SingleQuotedAttribute");this.addExitPattern("'","SingleQuotedAttribute");this.addSpecialPattern("=\\s*[^>\\s]*",a,"UnquotedAttribute")};WYMeditor.XhtmlParser=function(a,b){var b=b||"Text";this._Lexer=new WYMeditor.XhtmlLexer(this);this._Listener=a;this._mode=b;this._matches=[];this._last_match="";this._current_match="";return this};WYMeditor.XhtmlParser.prototype.parse=function(a){this._Lexer.parse(this.beforeParsing(a));return this.afterParsing(this._Listener.getResult())};WYMeditor.XhtmlParser.prototype.beforeParsing=function(a){if(a.match(/class="MsoNormal"/)||a.match(/ns = "urn:schemas-microsoft-com/)){this._Listener.avoidStylingTagsAndAttributes()}return this._Listener.beforeParsing(a)};WYMeditor.XhtmlParser.prototype.afterParsing=function(a){if(this._Listener._avoiding_tags_implicitly){this._Listener.allowStylingTagsAndAttributes()}return this._Listener.afterParsing(a)};WYMeditor.XhtmlParser.prototype.Ignore=function(a,b){return true};WYMeditor.XhtmlParser.prototype.Text=function(a){this._Listener.addContent(a);return true};WYMeditor.XhtmlParser.prototype.Comment=function(b,a){return this._addNonTagBlock(b,a,"addComment")};WYMeditor.XhtmlParser.prototype.Script=function(b,a){return this._addNonTagBlock(b,a,"addScript")};WYMeditor.XhtmlParser.prototype.Css=function(b,a){return this._addNonTagBlock(b,a,"addCss")};WYMeditor.XhtmlParser.prototype._addNonTagBlock=function(a,c,b){switch(c){case WYMeditor.LEXER_ENTER:this._non_tag=a;break;case WYMeditor.LEXER_UNMATCHED:this._non_tag+=a;break;case WYMeditor.LEXER_EXIT:switch(b){case"addComment":this._Listener.addComment(this._non_tag+a);break;case"addScript":this._Listener.addScript(this._non_tag+a);break;case"addCss":this._Listener.addCss(this._non_tag+a);break}}return true};WYMeditor.XhtmlParser.prototype.OpeningTag=function(a,b){switch(b){case WYMeditor.LEXER_ENTER:this._tag=this.normalizeTag(a);this._tag_attributes={};break;case WYMeditor.LEXER_SPECIAL:this._callOpenTagListener(this.normalizeTag(a));break;case WYMeditor.LEXER_EXIT:this._callOpenTagListener(this._tag,this._tag_attributes)}return true};WYMeditor.XhtmlParser.prototype.ClosingTag=function(a,b){this._callCloseTagListener(this.normalizeTag(a));return true};WYMeditor.XhtmlParser.prototype._callOpenTagListener=function(a,b){var b=b||{};this.autoCloseUnclosedBeforeNewOpening(a);if(this._Listener.isBlockTag(a)){this._Listener._tag_stack.push(a);this._Listener.fixNestingBeforeOpeningBlockTag(a,b);this._Listener.openBlockTag(a,b);this._increaseOpenTagCounter(a)}else{if(this._Listener.isInlineTag(a)){this._Listener.inlineTag(a,b)}else{this._Listener.openUnknownTag(a,b);this._increaseOpenTagCounter(a)}}this._Listener.last_tag=a;this._Listener.last_tag_opened=true;this._Listener.last_tag_attributes=b};WYMeditor.XhtmlParser.prototype._callCloseTagListener=function(a){if(this._decreaseOpenTagCounter(a)){this.autoCloseUnclosedBeforeTagClosing(a);if(this._Listener.isBlockTag(a)){var b=this._Listener._tag_stack.pop();if(b==false){return}else{if(b!=a){a=b}}this._Listener.closeBlockTag(a)}else{this._Listener.closeUnknownTag(a)}}else{this._Listener.closeUnopenedTag(a)}this._Listener.last_tag=a;this._Listener.last_tag_opened=false};WYMeditor.XhtmlParser.prototype._increaseOpenTagCounter=function(a){this._Listener._open_tags[a]=this._Listener._open_tags[a]||0;this._Listener._open_tags[a]++};WYMeditor.XhtmlParser.prototype._decreaseOpenTagCounter=function(a){if(this._Listener._open_tags[a]){this._Listener._open_tags[a]--;if(this._Listener._open_tags[a]==0){this._Listener._open_tags[a]=undefined}return true}return false};WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeNewOpening=function(a){this._autoCloseUnclosed(a,false)};WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeTagClosing=function(a){this._autoCloseUnclosed(a,true)};WYMeditor.XhtmlParser.prototype._autoCloseUnclosed=function(c,d){var d=d||false;if(this._Listener._open_tags){for(var a in this._Listener._open_tags){var b=this._Listener._open_tags[a];if(b>0&&this._Listener.shouldCloseTagAutomatically(a,c,d)){this._callCloseTagListener(a,true)}}}};WYMeditor.XhtmlParser.prototype.getTagReplacements=function(){return this._Listener.getTagReplacements()};WYMeditor.XhtmlParser.prototype.normalizeTag=function(a){a=a.replace(/^([\s<\/>]*)|([\s<\/>]*)$/gm,"").toLowerCase();var b=this._Listener.getTagReplacements();if(b[a]){return b[a]}return a};WYMeditor.XhtmlParser.prototype.TagAttributes=function(a,b){if(WYMeditor.LEXER_SPECIAL==b){this._current_attribute=a}return true};WYMeditor.XhtmlParser.prototype.DoubleQuotedAttribute=function(a,b){if(WYMeditor.LEXER_UNMATCHED==b){this._tag_attributes[this._current_attribute]=a}return true};WYMeditor.XhtmlParser.prototype.SingleQuotedAttribute=function(a,b){if(WYMeditor.LEXER_UNMATCHED==b){this._tag_attributes[this._current_attribute]=a}return true};WYMeditor.XhtmlParser.prototype.UnquotedAttribute=function(a,b){this._tag_attributes[this._current_attribute]=a.replace(/^=/,"");return true};WYMeditor.XhtmlSaxListener=function(){this.output="";this.helper=new WYMeditor.XmlHelper();this._open_tags={};this.validator=WYMeditor.XhtmlValidator;this._tag_stack=[];this.avoided_tags=[];this.entities={" ":" ","¡":"¡","¢":"¢","£":"£","¤":"¤","¥":"¥","¦":"¦","§":"§","¨":"¨","©":"©","ª":"ª","«":"«","¬":"¬","­":"­","®":"®","¯":"¯","°":"°","±":"±","²":"²","³":"³","´":"´","µ":"µ","¶":"¶","·":"·","¸":"¸","¹":"¹","º":"º","»":"»","¼":"¼","½":"½","¾":"¾","¿":"¿","À":"À","Á":"Á","Â":"Â","Ã":"Ã","Ä":"Ä","Å":"Å","Æ":"Æ","Ç":"Ç","È":"È","É":"É","Ê":"Ê","Ë":"Ë","Ì":"Ì","Í":"Í","Î":"Î","Ï":"Ï","Ð":"Ð","Ñ":"Ñ","Ò":"Ò","Ó":"Ó","Ô":"Ô","Õ":"Õ","Ö":"Ö","×":"×","Ø":"Ø","Ù":"Ù","Ú":"Ú","Û":"Û","Ü":"Ü","Ý":"Ý","Þ":"Þ","ß":"ß","à":"à","á":"á","â":"â","ã":"ã","ä":"ä","å":"å","æ":"æ","ç":"ç","è":"è","é":"é","ê":"ê","ë":"ë","ì":"ì","í":"í","î":"î","ï":"ï","ð":"ð","ñ":"ñ","ò":"ò","ó":"ó","ô":"ô","õ":"õ","ö":"ö","÷":"÷","ø":"ø","ù":"ù","ú":"ú","û":"û","ü":"ü","ý":"ý","þ":"þ","ÿ":"ÿ","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ƒ":"ƒ","ˆ":"ˆ","˜":"˜","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","ς":"ς","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","ϑ":"ϑ","ϒ":"ϒ","ϖ":"ϖ"," ":" "," ":" "," ":" ","‌":"‌","‍":"‍","‎":"‎","‏":"‏","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","…":"…","‰":"‰","′":"′","″":"″","‹":"‹","›":"›","‾":"‾","⁄":"⁄","€":"€","ℑ":"ℑ","℘":"℘","ℜ":"ℜ","™":"™","ℵ":"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","⟨":"〈","⟩":"〉","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"};this.block_tags=["a","abbr","acronym","address","area","b","base","bdo","big","blockquote","body","button","caption","cite","code","col","colgroup","dd","del","div","dfn","dl","dt","em","fieldset","form","head","h1","h2","h3","h4","h5","h6","html","i","ins","kbd","label","legend","li","map","noscript","object","ol","optgroup","option","p","param","pre","q","samp","script","select","small","span","strong","style","sub","sup","table","tbody","td","textarea","tfoot","th","thead","title","tr","tt","ul","var","extends"];this.inline_tags=["br","hr","img","input"];return this};WYMeditor.XhtmlSaxListener.prototype.shouldCloseTagAutomatically=function(a,c,b){var b=b||false;if(a=="td"){if((b&&c=="tr")||(!b&&c=="td")){return true}}if(a=="option"){if((b&&c=="select")||(!b&&c=="option")){return true}}return false};WYMeditor.XhtmlSaxListener.prototype.beforeParsing=function(a){this.output="";return a};WYMeditor.XhtmlSaxListener.prototype.afterParsing=function(a){a=this.replaceNamedEntities(a);a=this.joinRepeatedEntities(a);a=this.removeEmptyTags(a);a=this.removeBrInPre(a);return a};WYMeditor.XhtmlSaxListener.prototype.replaceNamedEntities=function(b){for(var a in this.entities){b=b.replace(new RegExp(a,"g"),this.entities[a])}return b};WYMeditor.XhtmlSaxListener.prototype.joinRepeatedEntities=function(b){var a="em|strong|sub|sup|acronym|pre|del|address";return b.replace(new RegExp("</("+a+")><\\1>",""),"").replace(new RegExp("(s*<("+a+")>s*){2}(.*)(s*</\\2>s*){2}",""),"<$2>$3<$2>")};WYMeditor.XhtmlSaxListener.prototype.removeEmptyTags=function(a){return a.replace(new RegExp("<("+this.block_tags.join("|").replace(/\|td/,"").replace(/\|th/,"")+")>(<br />| | |\\s)*</\\1>","g"),"")};WYMeditor.XhtmlSaxListener.prototype.removeBrInPre=function(c){var b=c.match(new RegExp("<pre[^>]*>(.*?)</pre>","gmi"));if(b){for(var a=0;a<b.length;a++){c=c.replace(b[a],b[a].replace(new RegExp("<br />","g"),String.fromCharCode(13,10)))}}return c};WYMeditor.XhtmlSaxListener.prototype.getResult=function(){return this.output};WYMeditor.XhtmlSaxListener.prototype.getTagReplacements=function(){return{b:"strong",i:"em"}};WYMeditor.XhtmlSaxListener.prototype.addContent=function(a){this.output+=a};WYMeditor.XhtmlSaxListener.prototype.addComment=function(a){if(this.remove_comments){this.output+=a}};WYMeditor.XhtmlSaxListener.prototype.addScript=function(a){if(!this.remove_scripts){this.output+=a}};WYMeditor.XhtmlSaxListener.prototype.addCss=function(a){if(!this.remove_embeded_styles){this.output+=a}};WYMeditor.XhtmlSaxListener.prototype.openBlockTag=function(a,b){this.output+=this.helper.tag(a,this.validator.getValidTagAttributes(a,b),true)};WYMeditor.XhtmlSaxListener.prototype.inlineTag=function(a,b){this.output+=this.helper.tag(a,this.validator.getValidTagAttributes(a,b))};WYMeditor.XhtmlSaxListener.prototype.openUnknownTag=function(a,b){};WYMeditor.XhtmlSaxListener.prototype.closeBlockTag=function(a){this.output=this.output.replace(/<br \/>$/,"")+this._getClosingTagContent("before",a)+"</"+a+">"+this._getClosingTagContent("after",a)};WYMeditor.XhtmlSaxListener.prototype.closeUnknownTag=function(a){};WYMeditor.XhtmlSaxListener.prototype.closeUnopenedTag=function(a){this.output+="</"+a+">"};WYMeditor.XhtmlSaxListener.prototype.avoidStylingTagsAndAttributes=function(){this.avoided_tags=["div","span"];this.validator.skiped_attributes=["style"];this.validator.skiped_attribute_values=["MsoNormal","main1"];this._avoiding_tags_implicitly=true};WYMeditor.XhtmlSaxListener.prototype.allowStylingTagsAndAttributes=function(){this.avoided_tags=[];this.validator.skiped_attributes=[];this.validator.skiped_attribute_values=[];this._avoiding_tags_implicitly=false};WYMeditor.XhtmlSaxListener.prototype.isBlockTag=function(a){return !WYMeditor.Helper.contains(this.avoided_tags,a)&&WYMeditor.Helper.contains(this.block_tags,a)};WYMeditor.XhtmlSaxListener.prototype.isInlineTag=function(a){return !WYMeditor.Helper.contains(this.avoided_tags,a)&&WYMeditor.Helper.contains(this.inline_tags,a)};WYMeditor.XhtmlSaxListener.prototype.insertContentAfterClosingTag=function(a,b){this._insertContentWhenClosingTag("after",a,b)};WYMeditor.XhtmlSaxListener.prototype.insertContentBeforeClosingTag=function(a,b){this._insertContentWhenClosingTag("before",a,b)};WYMeditor.XhtmlSaxListener.prototype.fixNestingBeforeOpeningBlockTag=function(a,b){if(a!="li"&&(a=="ul"||a=="ol")&&this.last_tag&&!this.last_tag_opened&&this.last_tag=="li"){this.output=this.output.replace(/<\/li>$/,"");this.insertContentAfterClosingTag(a,"</li>")}};WYMeditor.XhtmlSaxListener.prototype._insertContentWhenClosingTag=function(b,a,c){if(!this["_insert_"+b+"_closing"]){this["_insert_"+b+"_closing"]=[]}if(!this["_insert_"+b+"_closing"][a]){this["_insert_"+b+"_closing"][a]=[]}this["_insert_"+b+"_closing"][a].push(c)};WYMeditor.XhtmlSaxListener.prototype._getClosingTagContent=function(b,a){if(this["_insert_"+b+"_closing"]&&this["_insert_"+b+"_closing"][a]&&this["_insert_"+b+"_closing"][a].length>0){return this["_insert_"+b+"_closing"][a].pop()}return""};WYMeditor.WymCssLexer=function(b,a){var a=(typeof a=="undefined"?true:a);jQuery.extend(this,new WYMeditor.Lexer(b,(a?"Ignore":"WymCss")));this.mapHandler("WymCss","Ignore");if(a==true){this.addEntryPattern("/\\\x2a[<\\s]*WYMeditor[>\\s]*\\\x2a/","Ignore","WymCss");this.addExitPattern("/\\\x2a[</\\s]*WYMeditor[>\\s]*\\\x2a/","WymCss")}this.addSpecialPattern("[\\sa-z1-6]*\\\x2e[a-z-_0-9]+","WymCss","WymCssStyleDeclaration");this.addEntryPattern("/\\\x2a","WymCss","WymCssComment");this.addExitPattern("\\\x2a/","WymCssComment");this.addEntryPattern("\x7b","WymCss","WymCssStyle");this.addExitPattern("\x7d","WymCssStyle");this.addEntryPattern("/\\\x2a","WymCssStyle","WymCssFeedbackStyle");this.addExitPattern("\\\x2a/","WymCssFeedbackStyle");return this};WYMeditor.WymCssParser=function(){this._in_style=false;this._has_title=false;this.only_wym_blocks=true;this.css_settings={classesItems:[],editorStyles:[],dialogStyles:[]};return this};WYMeditor.WymCssParser.prototype.parse=function(a,b){var b=(typeof b=="undefined"?this.only_wym_blocks:b);this._Lexer=new WYMeditor.WymCssLexer(this,b);this._Lexer.parse(a)};WYMeditor.WymCssParser.prototype.Ignore=function(a,b){return true};WYMeditor.WymCssParser.prototype.WymCssComment=function(b,a){if(b.match(/end[a-z0-9\s]*wym[a-z0-9\s]*/mi)){return false}if(a==WYMeditor.LEXER_UNMATCHED){if(!this._in_style){this._has_title=true;this._current_item={title:WYMeditor.Helper.trim(b)}}else{if(this._current_item[this._current_element]){if(!this._current_item[this._current_element].expressions){this._current_item[this._current_element].expressions=[b]}else{this._current_item[this._current_element].expressions.push(b)}}}this._in_style=true}return true};WYMeditor.WymCssParser.prototype.WymCssStyle=function(b,a){if(a==WYMeditor.LEXER_UNMATCHED){b=WYMeditor.Helper.trim(b);if(b!=""){this._current_item[this._current_element].style=b}}else{if(a==WYMeditor.LEXER_EXIT){this._in_style=false;this._has_title=false;this.addStyleSetting(this._current_item)}}return true};WYMeditor.WymCssParser.prototype.WymCssFeedbackStyle=function(b,a){if(a==WYMeditor.LEXER_UNMATCHED){this._current_item[this._current_element].feedback_style=b.replace(/^([\s\/\*]*)|([\s\/\*]*)$/gm,"")}return true};WYMeditor.WymCssParser.prototype.WymCssStyleDeclaration=function(b){b=b.replace(/^([\s\.]*)|([\s\.*]*)$/gm,"");var a="";if(b.indexOf(".")>0){var c=b.split(".");this._current_element=c[1];var a=c[0]}else{this._current_element=b}if(!this._has_title){this._current_item={title:(!a?"":a.toUpperCase()+": ")+this._current_element};this._has_title=true}if(!this._current_item[this._current_element]){this._current_item[this._current_element]={name:this._current_element}}if(a){if(!this._current_item[this._current_element].tags){this._current_item[this._current_element].tags=[a]}else{this._current_item[this._current_element].tags.push(a)}}return true};WYMeditor.WymCssParser.prototype.addStyleSetting=function(a){for(var b in a){var c=a[b];if(typeof c=="object"&&b!="title"){this.css_settings.classesItems.push({name:WYMeditor.Helper.trim(c.name),title:a.title,expr:WYMeditor.Helper.trim((c.expressions||c.tags).join(", "))});if(c.feedback_style){this.css_settings.editorStyles.push({name:"."+WYMeditor.Helper.trim(c.name),css:c.feedback_style})}if(c.style){this.css_settings.dialogStyles.push({name:"."+WYMeditor.Helper.trim(c.name),css:c.style})}}}};jQuery.fn.isPhantomNode=function(){if(this[0].nodeType==3){return !(/[^\t\n\r ]/.test(this[0].data))}return false};WYMeditor.isPhantomNode=function(a){if(a.nodeType==3){return !(/[^\t\n\r ]/.test(a.data))}return false};WYMeditor.isPhantomString=function(a){return !(/[^\t\n\r ]/.test(a))};jQuery.fn.parentsOrSelf=function(b){var a=this;if(a[0].nodeType==3){a=a.parents().slice(0,1)}if(a.filter(b).size()==1){return a}else{return a.parents(b).slice(0,1)}};WYMeditor.Helper={replaceAll:function(d,a,c){var b=new RegExp(a,"g");return(d.replace(b,c))},insertAt:function(b,a,c){return(b.substr(0,c)+a+b.substring(c))},trim:function(a){return a.replace(/^(\s*)|(\s*)$/gm,"")},contains:function(a,c){for(var b=0;b<a.length;b++){if(a[b]===c){return true}}return false},indexOf:function(a,d){var b=-1;for(var c=0;c<a.length;c++){if(a[c]==d){b=c;break}}return(b)},findByName:function(a,b){for(var c=0;c<a.length;c++){var d=a[c];if(d.name==b){return(d)}}return(null)}};WYMeditor.WymClassExplorer=function(a){this._wym=a;this._class="className";this._newLine="\r\n"};WYMeditor.WymClassExplorer.prototype.initIframe=function(iframe){this._iframe=iframe;this._doc=iframe.contentWindow.document;var styles=this._doc.styleSheets[0];var aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss);this._doc.title=this._wym._index;jQuery("html",this._doc).attr("dir",this._options.direction);jQuery(this._doc.body).html(this._wym._html);var wym=this;this._doc.body.onfocus=function(){wym._doc.designMode="on";wym._doc=iframe.contentWindow.document};this._doc.onbeforedeactivate=function(){wym.saveCaret()};this._doc.onkeyup=function(){wym.saveCaret();wym.keyup()};this._doc.onclick=function(){wym.saveCaret()};this._doc.body.onbeforepaste=function(){wym._iframe.contentWindow.event.returnValue=false};this._doc.body.onpaste=function(){wym._iframe.contentWindow.event.returnValue=false;wym.paste(window.clipboardData.getData("Text"))};if(this._initialized){if(jQuery.isFunction(this._options.preBind)){this._options.preBind(this)}this._wym.bindEvents();if(jQuery.isFunction(this._options.postInit)){this._options.postInit(this)}this.listen()}this._initialized=true;this._doc.designMode="on";try{this._doc=iframe.contentWindow.document}catch(e){}};WYMeditor.WymClassExplorer.prototype._exec=function(c,d){switch(c){case WYMeditor.INDENT:case WYMeditor.OUTDENT:var a=this.findUp(this.container(),WYMeditor.LI);if(a){var b=a.parentNode.parentNode;if(a.parentNode.childNodes.length>1||b.tagName.toLowerCase()==WYMeditor.OL||b.tagName.toLowerCase()==WYMeditor.UL){this._doc.execCommand(c)}}break;default:if(d){this._doc.execCommand(c,false,d)}else{this._doc.execCommand(c)}break}this.listen()};WYMeditor.WymClassExplorer.prototype.selected=function(){var a=this._iframe.contentWindow.document.caretPos;if(a!=null){if(a.parentElement!=undefined){return(a.parentElement())}}};WYMeditor.WymClassExplorer.prototype.saveCaret=function(){this._doc.caretPos=this._doc.selection.createRange()};WYMeditor.WymClassExplorer.prototype.addCssRule=function(a,b){a.addRule(b.name,b.css)};WYMeditor.WymClassExplorer.prototype.insert=function(b){var a=this._doc.selection.createRange();if(jQuery(a.parentElement()).parents(this._options.iframeBodySelector).is("*")){try{a.pasteHTML(b)}catch(c){}}else{this.paste(b)}};WYMeditor.WymClassExplorer.prototype.wrap=function(d,b){var a=this._doc.selection.createRange();if(jQuery(a.parentElement()).parents(this._options.iframeBodySelector).is("*")){try{a.pasteHTML(d+a.text+b)}catch(c){}}};WYMeditor.WymClassExplorer.prototype.unwrap=function(){var a=this._doc.selection.createRange();if(jQuery(a.parentElement()).parents(this._options.iframeBodySelector).is("*")){try{var c=a.text;this._exec("Cut");a.pasteHTML(c)}catch(b){}}};WYMeditor.WymClassExplorer.prototype.keyup=function(){this._selected_image=null};WYMeditor.WymClassExplorer.prototype.setFocusToNode=function(b){var a=this._doc.selection.createRange();a.moveToElementText(b);a.collapse(false);a.move("character",-1);a.select();b.focus()};WYMeditor.WymClassMozilla=function(a){this._wym=a;this._class="class";this._newLine="\n"};WYMeditor.WymClassMozilla.prototype.initIframe=function(iframe){this._iframe=iframe;this._doc=iframe.contentDocument;var styles=this._doc.styleSheets[0];var aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss);this._doc.title=this._wym._index;jQuery("html",this._doc).attr("dir",this._options.direction);this.html(this._wym._html);this.enableDesignMode();if(jQuery.isFunction(this._options.preBind)){this._options.preBind(this)}this._wym.bindEvents();jQuery(this._doc).bind("keydown",this.keydown);jQuery(this._doc).bind("keyup",this.keyup);jQuery(this._doc).bind("focus",this.enableDesignMode);if(jQuery.isFunction(this._options.postInit)){this._options.postInit(this)}this.listen()};WYMeditor.WymClassMozilla.prototype.html=function(a){if(typeof a==="string"){try{this._doc.designMode="off"}catch(b){}a=a.replace(/<em(\b[^>]*)>/gi,"<i$1>").replace(/<\/em>/gi,"</i>").replace(/<strong(\b[^>]*)>/gi,"<b$1>").replace(/<\/strong>/gi,"</b>");jQuery(this._doc.body).html(a);this.enableDesignMode()}else{return(jQuery(this._doc.body).html())}};WYMeditor.WymClassMozilla.prototype._exec=function(e,g){if(!this.selected()){return(false)}switch(e){case WYMeditor.INDENT:case WYMeditor.OUTDENT:var f=this.selected();var d=this._iframe.contentWindow.getSelection();var b=d.anchorNode;if(b.nodeName=="#text"){b=b.parentNode}f=this.findUp(f,WYMeditor.BLOCKS);b=this.findUp(b,WYMeditor.BLOCKS);if(f&&f==b&&f.tagName.toLowerCase()==WYMeditor.LI){var c=f.parentNode.parentNode;if(f.parentNode.childNodes.length>1||c.tagName.toLowerCase()==WYMeditor.OL||c.tagName.toLowerCase()==WYMeditor.UL){this._doc.execCommand(e,"",null)}}break;default:if(g){this._doc.execCommand(e,"",g)}else{this._doc.execCommand(e,"",null)}}var a=this.selected();if(a.tagName.toLowerCase()==WYMeditor.BODY){this._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}this.listen()};WYMeditor.WymClassMozilla.prototype.selected=function(){var b=this._iframe.contentWindow.getSelection();var a=b.focusNode;if(a){if(a.nodeName=="#text"){return(a.parentNode)}else{return(a)}}else{return(null)}};WYMeditor.WymClassMozilla.prototype.addCssRule=function(a,b){a.insertRule(b.name+" {"+b.css+"}",a.cssRules.length)};WYMeditor.WymClassMozilla.prototype.keydown=function(b){var c=WYMeditor.INSTANCES[this.title];var a=null;if(b.ctrlKey){if(b.keyCode==66){c._exec(WYMeditor.BOLD);return false}if(b.keyCode==73){c._exec(WYMeditor.ITALIC);return false}}else{if(b.keyCode==13){if(!b.shiftKey){a=c.selected();if(a&&a.tagName.toLowerCase()==WYMeditor.PRE){b.preventDefault();c.insert("<p></p>")}}}}};WYMeditor.WymClassMozilla.prototype.keyup=function(b){var d=WYMeditor.INSTANCES[this.title];d._selected_image=null;var a=null;if(b.keyCode==13&&!b.shiftKey){jQuery(d._doc.body).children(WYMeditor.BR).remove()}else{if(b.keyCode!=8&&b.keyCode!=17&&b.keyCode!=46&&b.keyCode!=224&&!b.metaKey&&!b.ctrlKey){a=d.selected();var c=a.tagName.toLowerCase();if(c=="strong"||c=="b"||c=="em"||c=="i"||c=="sub"||c=="sup"||c=="a"){c=a.parentNode.tagName.toLowerCase()}if(c==WYMeditor.BODY){d._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}}}};WYMeditor.WymClassMozilla.prototype.enableDesignMode=function(){if(this.designMode=="off"){try{this.designMode="on";this.execCommand("styleWithCSS","",false)}catch(a){}}};WYMeditor.WymClassMozilla.prototype.setFocusToNode=function(c){var a=document.createRange();a.selectNode(c);var b=this._iframe.contentWindow.getSelection();b.addRange(a);b.collapse(c,c.childNodes.length);this._iframe.contentWindow.focus()};WYMeditor.WymClassMozilla.prototype.openBlockTag=function(a,c){var c=this.validator.getValidTagAttributes(a,c);if(a=="span"&&c.style){var b=this.getTagForStyle(c.style);if(b){this._tag_stack.pop();var a=b;this._tag_stack.push(b);c.style=""}else{return}}this.output+=this.helper.tag(a,c,true)};WYMeditor.WymClassMozilla.prototype.getTagForStyle=function(a){if(/bold/.test(a)){return"strong"}if(/italic/.test(a)){return"em"}if(/sub/.test(a)){return"sub"}if(/sub/.test(a)){return"super"}return false};WYMeditor.WymClassOpera=function(a){this._wym=a;this._class="class";this._newLine="\r\n"};WYMeditor.WymClassOpera.prototype.initIframe=function(iframe){this._iframe=iframe;this._doc=iframe.contentWindow.document;var styles=this._doc.styleSheets[0];var aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss);this._doc.title=this._wym._index;jQuery("html",this._doc).attr("dir",this._options.direction);this._doc.designMode="on";this.html(this._wym._html);if(jQuery.isFunction(this._options.preBind)){this._options.preBind(this)}this._wym.bindEvents();jQuery(this._doc).bind("keydown",this.keydown);jQuery(this._doc).bind("keyup",this.keyup);if(jQuery.isFunction(this._options.postInit)){this._options.postInit(this)}this.listen()};WYMeditor.WymClassOpera.prototype._exec=function(a,b){if(b){this._doc.execCommand(a,false,b)}else{this._doc.execCommand(a)}this.listen()};WYMeditor.WymClassOpera.prototype.selected=function(){var b=this._iframe.contentWindow.getSelection();var a=b.focusNode;if(a){if(a.nodeName=="#text"){return(a.parentNode)}else{return(a)}}else{return(null)}};WYMeditor.WymClassOpera.prototype.addCssRule=function(a,b){a.insertRule(b.name+" {"+b.css+"}",a.cssRules.length)};WYMeditor.WymClassOpera.prototype.keydown=function(a){var c=WYMeditor.INSTANCES[this.title];var b=c._iframe.contentWindow.getSelection();startNode=b.getRangeAt(0).startContainer;if(!jQuery(startNode).parentsOrSelf(WYMeditor.MAIN_CONTAINERS.join(","))[0]&&!jQuery(startNode).parentsOrSelf("li")&&a.keyCode!=WYMeditor.KEY.ENTER&&a.keyCode!=WYMeditor.KEY.LEFT&&a.keyCode!=WYMeditor.KEY.UP&&a.keyCode!=WYMeditor.KEY.RIGHT&&a.keyCode!=WYMeditor.KEY.DOWN&&a.keyCode!=WYMeditor.KEY.BACKSPACE&&a.keyCode!=WYMeditor.KEY.DELETE){c._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}};WYMeditor.WymClassOpera.prototype.keyup=function(a){var b=WYMeditor.INSTANCES[this.title];b._selected_image=null};WYMeditor.WymClassOpera.prototype.setFocusToNode=function(a){};WYMeditor.WymClassSafari=function(a){this._wym=a;this._class="class";this._newLine="\n"};WYMeditor.WymClassSafari.prototype.initIframe=function(iframe){this._iframe=iframe;this._doc=iframe.contentDocument;var styles=this._doc.styleSheets[0];var aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss);this._doc.title=this._wym._index;jQuery("html",this._doc).attr("dir",this._options.direction);this._doc.designMode="on";this.html(this._wym._html);if(jQuery.isFunction(this._options.preBind)){this._options.preBind(this)}this._wym.bindEvents();jQuery(this._doc).bind("keydown",this.keydown);jQuery(this._doc).bind("keyup",this.keyup);if(jQuery.isFunction(this._options.postInit)){this._options.postInit(this)}this.listen()};WYMeditor.WymClassSafari.prototype._exec=function(e,g){if(!this.selected()){return(false)}switch(e){case WYMeditor.INDENT:case WYMeditor.OUTDENT:var f=this.selected();var d=this._iframe.contentWindow.getSelection();var b=d.anchorNode;if(b.nodeName=="#text"){b=b.parentNode}f=this.findUp(f,WYMeditor.BLOCKS);b=this.findUp(b,WYMeditor.BLOCKS);if(f&&f==b&&f.tagName.toLowerCase()==WYMeditor.LI){var c=f.parentNode.parentNode;if(f.parentNode.childNodes.length>1||c.tagName.toLowerCase()==WYMeditor.OL||c.tagName.toLowerCase()==WYMeditor.UL){this._doc.execCommand(e,"",null)}}break;case WYMeditor.INSERT_ORDEREDLIST:case WYMeditor.INSERT_UNORDEREDLIST:this._doc.execCommand(e,"",null);var f=this.selected();var a=this.findUp(f,WYMeditor.MAIN_CONTAINERS);if(a){jQuery(a).replaceWith(jQuery(a).html())}break;default:if(g){this._doc.execCommand(e,"",g)}else{this._doc.execCommand(e,"",null)}}var a=this.selected();if(a&&a.tagName.toLowerCase()==WYMeditor.BODY){this._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}this.listen()};WYMeditor.WymClassSafari.prototype.selected=function(){var b=this._iframe.contentWindow.getSelection();var a=b.focusNode;if(a){if(a.nodeName=="#text"){return(a.parentNode)}else{return(a)}}else{return(null)}};WYMeditor.WymClassSafari.prototype.addCssRule=function(a,b){a.insertRule(b.name+" {"+b.css+"}",a.cssRules.length)};WYMeditor.WymClassSafari.prototype.keydown=function(a){var b=WYMeditor.INSTANCES[this.title];if(a.ctrlKey){if(a.keyCode==66){b._exec(WYMeditor.BOLD);return false}if(a.keyCode==73){b._exec(WYMeditor.ITALIC);return false}}};WYMeditor.WymClassSafari.prototype.keyup=function(b){var d=WYMeditor.INSTANCES[this.title];d._selected_image=null;var a=null;if(b.keyCode==13&&!b.shiftKey){jQuery(d._doc.body).children(WYMeditor.BR).remove();a=d.selected();if(a&&a.tagName.toLowerCase()==WYMeditor.PRE){d._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}}if(b.keyCode==13&&b.shiftKey){d._exec("InsertLineBreak")}if(b.keyCode!=8&&b.keyCode!=17&&b.keyCode!=46&&b.keyCode!=224&&!b.metaKey&&!b.ctrlKey){a=d.selected();var c=a.tagName.toLowerCase();if(c=="strong"||c=="b"||c=="em"||c=="i"||c=="sub"||c=="sup"||c=="a"||c=="span"){c=a.parentNode.tagName.toLowerCase()}if(c==WYMeditor.BODY||c==WYMeditor.DIV){d._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}}};WYMeditor.WymClassSafari.prototype.setFocusToNode=function(c){var a=this._iframe.contentDocument.createRange();a.selectNode(c);var b=this._iframe.contentWindow.getSelection();b.addRange(a);b.collapse(c,c.childNodes.length);this._iframe.contentWindow.focus()};WYMeditor.WymClassSafari.prototype.openBlockTag=function(a,c){var c=this.validator.getValidTagAttributes(a,c);if(a=="span"&&c.style){var b=this.getTagForStyle(c.style);if(b){this._tag_stack.pop();var a=b;this._tag_stack.push(b);c.style="";if(typeof c["class"]=="string"){c["class"]=c["class"].replace(/apple-style-span/gi,"")}}else{return}}this.output+=this.helper.tag(a,c,true)};WYMeditor.WymClassSafari.prototype.getTagForStyle=function(a){if(/bold/.test(a)){return"strong"}if(/italic/.test(a)){return"em"}if(/sub/.test(a)){return"sub"}if(/super/.test(a)){return"sup"}return false};
\ No newline at end of file
diff -r 5b27b92310d044cfd2f9b3711e5ef446048de110 -r 2cabbf3687634090fbbc024726f15f43db4ff314 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["libs/backbone/backbone-relational"],function(){var d=Backbone.RelationalModel.extend({});var e=Backbone.RelationalModel.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var i=new d();_.each(_.keys(this.attributes),function(j){if(j.indexOf("metadata_")===0){var l=j.split("metadata_")[1];i.set(l,this.attributes[j]);delete this.attributes[j]}},this);this.set("metadata",i,{silent:true})},get_metadata:function(i){return this.attributes.metadata.get(i)},urlRoot:galaxy_paths.get("datasets_url")});var c=e.extend({defaults:_.extend({},e.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(i){e.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var i=this,j=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:i.attributes.chunk_index++}).success(function(k){var l;if(k.ck_data!==""){l=k}else{i.attributes.at_eof=true;l=null}j.resolve(l)});return j}});var g=Backbone.Collection.extend({model:e});var f=Backbone.View.extend({initialize:function(i){(new b(i)).render()},render:function(){var m=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(m);var i=this.model.get_metadata("column_names");if(i){m.append("<tr><th>"+i.join("</th><th>")+"</th></tr>")}var k=this.model.get("first_data_chunk");if(k){this._renderChunk(k)}var j=this,n=_.find(this.$el.parents(),function(o){return $(o).css("overflow")==="auto"}),l=false;if(!n){n=window}n=$(n);n.scroll(function(){if(!l&&(j.$el.height()-n.scrollTop()-n.height()<=0)){l=true;$.when(j.model.get_next_chunk()).then(function(o){if(o){j._renderChunk(o);l=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},_renderCell:function(k,i,l){var j=this.model.get_metadata("column_types");if(l!==undefined){return $("<td>").attr("colspan",l).addClass("stringalign").text(k)}else{if(j[i]==="str"||j==="list"){return $("<td>").addClass("stringalign").text(k)}else{return $("<td>").text(k)}}},_renderRow:function(i){var j=i.split("\t"),l=$("<tr>"),k=this.model.get_metadata("columns");if(j.length===k){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this)}else{if(j.length>k){_.each(j.slice(0,k-1),function(n,m){l.append(this._renderCell(n,m))},this);l.append(this._renderCell(j.slice(k-1).join("\t"),k-1))}else{if(k>5&&j.length===k-1){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this);l.append($("<td>"))}else{l.append(this._renderCell(i,0,k))}}}return l},_renderChunk:function(i){var j=this.$el.find("table");_.each(i.ck_data.split("\n"),function(k,l){j.append(this._renderRow(k))},this)}});var b=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,initialize:function(i){var j=i.model.attributes.metadata.attributes;if(typeof j.chromCol==="undefined"||typeof j.startCol==="undefined"||typeof j.endCol==="undefined"){console.log("TabularButtonTrackster : Metadata for column identification is missing.")}else{this.col.chrom=j.chromCol-1;this.col.start=j.startCol-1;this.col.end=j.endCol-1}if(this.col.chrom===null){return}if(typeof i.model.attributes.id==="undefined"){console.log("TabularButtonTrackster : Dataset identification is missing.")}else{this.dataset_id=i.model.attributes.id}if(typeof i.model.attributes.url_viz==="undefined"){console.log("TabularButtonTrackster : Url for visualization controller is missing.")}else{this.url_viz=i.model.attributes.url_viz}if(typeof i.model.attributes.genome_build!=="undefined"){this.genome_build=i.model.attributes.genome_build}},events:{"mouseover tr":"btn_viz_show",mouseleave:"btn_viz_hide"},btn_viz_show:function(m){if(this.col.chrom===null){return}var q=$(m.target).parent();var n=q.children().eq(this.col.chrom).html();var i=q.children().eq(this.col.start).html();var k=q.children().eq(this.col.end).html();if(n!==""&&i!==""&&k!==""){var p={dataset_id:this.dataset_id,gene_region:n+":"+i+"-"+k};var l=q.offset();var j=l.left-10;var o=l.top;$("#btn_viz").css({position:"fixed",top:o+"px",left:j+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,p,this.genome_build));$("#btn_viz").show()}},btn_viz_hide:function(){$("#btn_viz").hide()},create_trackster_action:function(i,k,j){return function(){var l={};if(j){l["f-dbkey"]=j}$.ajax({url:i+"/list_tracks?"+$.param(l),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(m){var n=window.parent;n.show_modal(("View Data in a New or Saved Visualization"),"",{Cancel:function(){n.hide_modal()},"View in saved visualization":function(){n.show_modal(("Add Data to Saved Visualization"),m,{Cancel:function(){n.hide_modal()},"Add to visualization":function(){$(n.document).find("input[name=id]:checked").each(function(){var o=$(this).val();k.id=o;n.frame_manager.frame_new({title:"Trackster",type:"url",content:i+"/trackster?"+$.param(k)});n.hide_modal()})}})},"View in new visualization":function(){var o=i+"/trackster?"+$.param(k);n.frame_manager.frame_new({title:"Trackster",type:"url",content:o});n.hide_modal()}})}});return false}},render:function(){var i=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.$el.append(i.render().$el);$("#btn_viz").hide()}});var a=function(l,j,m,i){var k=new j({model:new l(m)});k.render();if(i){i.append(k.$el)}return k};var h=function(k,i){var j=$("<div/>").appendTo(i);return new f({el:j,model:new c(k)}).render()};return{Dataset:e,TabularDataset:c,DatasetCollection:g,TabularDatasetChunkedView:f,createTabularDatasetChunkedView:h}});
\ No newline at end of file
+define(["libs/backbone/backbone-relational"],function(){var d=Backbone.RelationalModel.extend({});var e=Backbone.RelationalModel.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var i=new d();_.each(_.keys(this.attributes),function(j){if(j.indexOf("metadata_")===0){var l=j.split("metadata_")[1];i.set(l,this.attributes[j]);delete this.attributes[j]}},this);this.set("metadata",i,{silent:true})},get_metadata:function(i){return this.attributes.metadata.get(i)},urlRoot:galaxy_paths.get("datasets_url")});var c=e.extend({defaults:_.extend({},e.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(i){e.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var i=this,j=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:i.attributes.chunk_index++}).success(function(k){var l;if(k.ck_data!==""){l=k}else{i.attributes.at_eof=true;l=null}j.resolve(l)});return j}});var g=Backbone.Collection.extend({model:e});var f=Backbone.View.extend({initialize:function(i){new b(i)},render:function(){var m=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(m);var i=this.model.get_metadata("column_names");if(i){m.append("<tr><th>"+i.join("</th><th>")+"</th></tr>")}var k=this.model.get("first_data_chunk");if(k){this._renderChunk(k)}var j=this,n=_.find(this.$el.parents(),function(o){return $(o).css("overflow")==="auto"}),l=false;if(!n){n=window}n=$(n);n.scroll(function(){if(!l&&(j.$el.height()-n.scrollTop()-n.height()<=0)){l=true;$.when(j.model.get_next_chunk()).then(function(o){if(o){j._renderChunk(o);l=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},_renderCell:function(k,i,l){var j=this.model.get_metadata("column_types");if(l!==undefined){return $("<td>").attr("colspan",l).addClass("stringalign").text(k)}else{if(j[i]==="str"||j==="list"){return $("<td>").addClass("stringalign").text(k)}else{return $("<td>").text(k)}}},_renderRow:function(i){var j=i.split("\t"),l=$("<tr>"),k=this.model.get_metadata("columns");if(j.length===k){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this)}else{if(j.length>k){_.each(j.slice(0,k-1),function(n,m){l.append(this._renderCell(n,m))},this);l.append(this._renderCell(j.slice(k-1).join("\t"),k-1))}else{if(k>5&&j.length===k-1){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this);l.append($("<td>"))}else{l.append(this._renderCell(i,0,k))}}}return l},_renderChunk:function(i){var j=this.$el.find("table");_.each(i.ck_data.split("\n"),function(k,l){j.append(this._renderRow(k))},this)}});var b=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(k){var j=k.model.attributes;var m=k.model.attributes.metadata.attributes;if(typeof j.data_type!=="undefined"){this.data_type=j.data_type}else{console.log("TabularButtonTrackster : Data type missing.")}if(this.data_type=="bed"){if(typeof m.chromCol!=="undefined"||typeof m.startCol!=="undefined"||typeof m.endCol!=="undefined"){this.col.chrom=m.chromCol-1;this.col.start=m.startCol-1;this.col.end=m.endCol-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.")}}if(this.data_type=="vcf"){function l(o,p){for(var n=0;n<p.length;n++){if(p[n].match(o)){return n}}return -1}this.col.chrom=l("Chrom",m.column_names);this.col.start=l("Pos",m.column_names);this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.")}}if(this.col.chrom===null){console.log("TabularButtonTrackster : Chromosome column undefined.");return}if(typeof k.model.attributes.id==="undefined"){console.log("TabularButtonTrackster : Dataset identification is missing.")}else{this.dataset_id=k.model.attributes.id}if(typeof k.model.attributes.url_viz==="undefined"){console.log("TabularButtonTrackster : Url for visualization controller is missing.")}else{this.url_viz=k.model.attributes.url_viz}if(typeof k.model.attributes.genome_build!=="undefined"){this.genome_build=k.model.attributes.genome_build}var i=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.$el.append(i.render().$el);$("#btn_viz").hide()},events:{"mouseover tr":"btn_viz_show",mouseleave:"btn_viz_hide"},btn_viz_show:function(n){function m(s){return !isNaN(parseFloat(s))&&isFinite(s)}if(this.col.chrom===null){return}var r=$(n.target).parent();var o=r.children().eq(this.col.chrom).html();var i=r.children().eq(this.col.start).html();var k=this.col.end?r.children().eq(this.col.end).html():i;if(!o.match("^#")&&o!==""&&m(i)){var q={dataset_id:this.dataset_id,gene_region:o+":"+i+"-"+k};var l=r.offset();var j=l.left-10;var p=l.top-$(window).scrollTop();$("#btn_viz").css({position:"fixed",top:p+"px",left:j+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,q,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},btn_viz_hide:function(){$("#btn_viz").hide()},create_trackster_action:function(i,k,j){return function(){var l={};if(j){l["f-dbkey"]=j}$.ajax({url:i+"/list_tracks?"+$.param(l),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(m){var n=window.parent;n.show_modal(("View Data in a New or Saved Visualization"),"",{Cancel:function(){n.hide_modal()},"View in saved visualization":function(){n.show_modal(("Add Data to Saved Visualization"),m,{Cancel:function(){n.hide_modal()},"Add to visualization":function(){$(n.document).find("input[name=id]:checked").each(function(){var o=$(this).val();k.id=o;n.frame_manager.frame_new({title:"Trackster",type:"url",content:i+"/trackster?"+$.param(k)});n.hide_modal()})}})},"View in new visualization":function(){var o=i+"/trackster?"+$.param(k);n.frame_manager.frame_new({title:"Trackster",type:"url",content:o});n.hide_modal()}})}});return false}}});var a=function(l,j,m,i){var k=new j({model:new l(m)});k.render();if(i){i.append(k.$el)}return k};var h=function(k,i){var j=$("<div/>").appendTo(i);return new f({el:j,model:new c(k)}).render()};return{Dataset:e,TabularDataset:c,DatasetCollection:g,TabularDatasetChunkedView:f,createTabularDatasetChunkedView:h}});
\ No newline at end of file
diff -r 5b27b92310d044cfd2f9b3711e5ef446048de110 -r 2cabbf3687634090fbbc024726f15f43db4ff314 static/scripts/packed/utils/galaxy.css.js
--- a/static/scripts/packed/utils/galaxy.css.js
+++ b/static/scripts/packed/utils/galaxy.css.js
@@ -1,1 +1,1 @@
-define(["libs/underscore"],function(a){function b(g,d){var e=$('<div class="'+g+'"></div>');e.appendTo(":eq(0)");var f=e.css(d).replace(/[^-\d\.]/g,"");e.remove();return f}function c(d){if(!$('link[href="'+d+'"]').length){$('<link href="'+d+'" rel="stylesheet">').appendTo("head")}}return{load_file:c,get_attribute:b}});
\ No newline at end of file
+define(["libs/underscore"],function(a){function b(g,d){var e=$('<div class="'+g+'"></div>');e.appendTo(":eq(0)");var f=e.css(d);e.remove();return f}function c(d){if(!$('link[href^="'+d+'"]').length){$('<link href="'+d+'" rel="stylesheet">').appendTo("head")}}return{load_file:c,get_attribute:b}});
\ No newline at end of file
diff -r 5b27b92310d044cfd2f9b3711e5ef446048de110 -r 2cabbf3687634090fbbc024726f15f43db4ff314 templates/webapps/galaxy/page/editor.mako
--- a/templates/webapps/galaxy/page/editor.mako
+++ b/templates/webapps/galaxy/page/editor.mako
@@ -9,751 +9,22 @@
%></%def>
-<%def name="late_javascripts()">
- <script type='text/javascript' src="${h.url_for('/static/scripts/galaxy.panels.js')}"></script>
- <script type="text/javascript">
- ensure_dd_helper();
- ##make_left_panel( $("#left"), $("#center"), $("#left-border" ) );
- ##make_right_panel( $("#right"), $("#center"), $("#right-border" ) );
- ## handle_minwidth_hint = rp.handle_minwidth_hint;
- </script>
-</%def>
-
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.drop", "libs/jquery/jquery.event.hover", "libs/jquery/jquery.form",
- "libs/jquery/jstorage", "libs/jquery/jquery.wymeditor", "libs/jquery/jquery.autocomplete", "galaxy.autocom_tagging")}
<script type="text/javascript">
-
- // Useful Galaxy stuff.
- var Galaxy =
- {
- // Item types.
- ITEM_HISTORY : "item_history",
- ITEM_DATASET : "item_dataset",
- ITEM_WORKFLOW : "item_workflow",
- ITEM_PAGE : "item_page",
- ITEM_VISUALIZATION : "item_visualization",
-
- // Link dialogs.
- DIALOG_HISTORY_LINK : "link_history",
- DIALOG_DATASET_LINK : "link_dataset",
- DIALOG_WORKFLOW_LINK : "link_workflow",
- DIALOG_PAGE_LINK : "link_page",
- DIALOG_VISUALIZATION_LINK : "link_visualization",
-
- // Embed dialogs.
- DIALOG_EMBED_HISTORY : "embed_history",
- DIALOG_EMBED_DATASET : "embed_dataset",
- DIALOG_EMBED_WORKFLOW : "embed_workflow",
- DIALOG_EMBED_PAGE : "embed_page",
- DIALOG_EMBED_VISUALIZATION : "embed_visualization",
-
- // Annotation dialogs.
- DIALOG_HISTORY_ANNOTATE : "history_annotate",
- };
-
- // Initialize Galaxy elements.
- function init_galaxy_elts(wym)
- {
- // Set up events to make annotation easy.
- $('.annotation', wym._doc.body).each( function()
- {
- $(this).click( function() {
- // Works in Safari, not in Firefox.
- var range = wym._doc.createRange();
- range.selectNodeContents( this );
- var selection = window.getSelection();
- selection.removeAllRanges();
- selection.addRange(range);
- var t = "";
- });
- });
-
- };
-
- // Based on the dialog type, return a dictionary of information about an item
- function get_item_info( dialog_type )
- {
- var
- item_singular,
- item_plural,
- item_controller;
- switch( dialog_type ) {
- case( Galaxy.ITEM_HISTORY ):
- item_singular = "History";
- item_plural = "Histories";
- item_controller = "history";
- item_class = "History";
- break;
- case( Galaxy.ITEM_DATASET ):
- item_singular = "Dataset";
- item_plural = "Datasets";
- item_controller = "dataset";
- item_class = "HistoryDatasetAssociation";
- break;
- case( Galaxy.ITEM_WORKFLOW ):
- item_singular = "Workflow";
- item_plural = "Workflows";
- item_controller = "workflow";
- item_class = "StoredWorkflow";
- break;
- case( Galaxy.ITEM_PAGE ):
- item_singular = "Page";
- item_plural = "Pages";
- item_controller = "page";
- item_class = "Page";
- break;
- case( Galaxy.ITEM_VISUALIZATION ):
- item_singular = "Visualization";
- item_plural = "Visualizations";
- item_controller = "visualization";
- item_class = "Visualization";
- break;
- }
-
- // Build ajax URL that lists items for selection.
- var item_list_action = "list_" + item_plural.toLowerCase() + "_for_selection";
- var url_template = "${h.url_for(controller='page', action='LIST_ACTION' )}";
- var ajax_url = url_template.replace( "LIST_ACTION", item_list_action );
-
- // Set up and return dict.
- return {
- singular : item_singular,
- plural : item_plural,
- controller : item_controller,
- iclass : item_class,
- list_ajax_url : ajax_url
- };
- };
-
- // Make an item importable.
- function make_item_importable( item_controller, item_id, item_type )
- {
- url_template = "${h.url_for( controller='ITEM_CONTROLLER', action='set_accessible_async' )}";
- ajax_url = url_template.replace( "ITEM_CONTROLLER", item_controller );
- $.ajax({
- type: "POST",
- url: ajax_url,
- data: { id: item_id, accessible: 'True' },
- error: function() { alert("Making " + item_type + " accessible failed"); }
- });
- };
-
- ## Completely replace WYM's dialog handling
- WYMeditor.editor.prototype.dialog = function( dialogType, dialogFeatures, bodyHtml ) {
-
- var wym = this;
- var sStamp = wym.uniqueStamp();
- var selected = wym.selected();
-
- // Swap out URL attribute for id/name attribute in link creation to enable anchor creation in page.
- function set_link_id()
- {
- // When "set link id" link clicked, update UI.
- $('#set_link_id').click( function()
- {
- // Set label.
- $("#link_attribute_label").text("ID/Name");
-
- // Set input elt class, value.
- var attribute_input = $(".wym_href");
- attribute_input.addClass("wym_id").removeClass("wym_href");
- if (selected)
- attribute_input.val( $(selected).attr('id') );
-
- // Remove link.
- $(this).remove();
- });
- }
-
- // LINK DIALOG
- if ( dialogType == WYMeditor.DIALOG_LINK ) {
- if(selected) {
- jQuery(wym._options.hrefSelector).val(jQuery(selected).attr(WYMeditor.HREF));
- jQuery(wym._options.srcSelector).val(jQuery(selected).attr(WYMeditor.SRC));
- jQuery(wym._options.titleSelector).val(jQuery(selected).attr(WYMeditor.TITLE));
- jQuery(wym._options.altSelector).val(jQuery(selected).attr(WYMeditor.ALT));
- }
- // Get current URL, title.
- var curURL, curTitle;
- if (selected)
- {
- curURL = $(selected).attr("href");
- if (curURL == undefined)
- curURL = "";
- curTitle = $(selected).attr("title");
- if (curTitle == undefined)
- curTitle = "";
- }
- show_modal(
- "Create Link",
- "<div><div><label id='link_attribute_label'>URL <span style='float: right; font-size: 90%'><a href='#' id='set_link_id'>Create in-page anchor</a></span></label><br><input type='text' class='wym_href' value='" + curURL + "' size='40' /></div>"
- + "<div><label>Title</label><br><input type='text' class='wym_title' value='" + curTitle + "' size='40' /></div><div>",
- {
- "Make link": function() {
- var sUrl = jQuery(wym._options.hrefSelector).val();
- sUrl = ( sUrl ? sUrl : "" );
- var sName = $(".wym_id").val();
- sName = ( sName ? sName : "" );
- if ( (sUrl.length > 0) || (sName.length > 0) ) {
- // Create link.
- wym._exec(WYMeditor.CREATE_LINK, sStamp);
-
- var link = jQuery("a[href=" + sStamp + "]", wym._doc.body);
- link.attr(WYMeditor.HREF, sUrl);
- link.attr(WYMeditor.TITLE, jQuery(wym._options.titleSelector).val());
- if (sName.length > 0)
- link.attr("id", sName);
- }
- hide_modal();
- },
- "Cancel": function() {
- hide_modal();
- }
- },
- {},
- set_link_id
- );
- return;
- }
-
- // IMAGE DIALOG
- if ( dialogType == WYMeditor.DIALOG_IMAGE ) {
- if(wym._selected_image) {
- jQuery(wym._options.dialogImageSelector + " " + wym._options.srcSelector)
- .val(jQuery(wym._selected_image).attr(WYMeditor.SRC));
- jQuery(wym._options.dialogImageSelector + " " + wym._options.titleSelector)
- .val(jQuery(wym._selected_image).attr(WYMeditor.TITLE));
- jQuery(wym._options.dialogImageSelector + " " + wym._options.altSelector)
- .val(jQuery(wym._selected_image).attr(WYMeditor.ALT));
- }
- show_modal(
- "Image",
- "<div class='row'>"
- + "<label>URL</label><br>"
- + "<input type='text' class='wym_src' value='' size='40' />"
- + "</div>"
- + "<div class='row'>"
- + "<label>Alt text</label><br>"
- + "<input type='text' class='wym_alt' value='' size='40' />"
- + "</div>"
- + "<div class='row'>"
- + "<label>Title</label><br>"
- + "<input type='text' class='wym_title' value='' size='40' />"
- + "</div>",
- {
- "Insert": function() {
- var sUrl = jQuery(wym._options.srcSelector).val();
- if(sUrl.length > 0) {
- wym._exec(WYMeditor.INSERT_IMAGE, sStamp);
- jQuery("img[src$=" + sStamp + "]", wym._doc.body)
- .attr(WYMeditor.SRC, sUrl)
- .attr(WYMeditor.TITLE, jQuery(wym._options.titleSelector).val())
- .attr(WYMeditor.ALT, jQuery(wym._options.altSelector).val());
- }
- hide_modal();
- },
- "Cancel": function() {
- hide_modal();
- }
- }
- );
- return;
- }
-
- // TABLE DIALOG
- if ( dialogType == WYMeditor.DIALOG_TABLE ) {
- show_modal(
- "Table",
- "<div class='row'>"
- + "<label>Caption</label><br>"
- + "<input type='text' class='wym_caption' value='' size='40' />"
- + "</div>"
- + "<div class='row'>"
- + "<label>Summary</label><br>"
- + "<input type='text' class='wym_summary' value='' size='40' />"
- + "</div>"
- + "<div class='row'>"
- + "<label>Number Of Rows<br></label>"
- + "<input type='text' class='wym_rows' value='3' size='3' />"
- + "</div>"
- + "<div class='row'>"
- + "<label>Number Of Cols<br></label>"
- + "<input type='text' class='wym_cols' value='2' size='3' />"
- + "</div>",
- {
- "Insert": function() {
- var iRows = jQuery(wym._options.rowsSelector).val();
- var iCols = jQuery(wym._options.colsSelector).val();
-
- if(iRows > 0 && iCols > 0) {
-
- var table = wym._doc.createElement(WYMeditor.TABLE);
- var newRow = null;
- var newCol = null;
-
- var sCaption = jQuery(wym._options.captionSelector).val();
-
- //we create the caption
- var newCaption = table.createCaption();
- newCaption.innerHTML = sCaption;
-
- //we create the rows and cells
- for(x=0; x<iRows; x++) {
- newRow = table.insertRow(x);
- for(y=0; y<iCols; y++) {newRow.insertCell(y);}
- }
-
- //set the summary attr
- jQuery(table).attr('summary',
- jQuery(wym._options.summarySelector).val());
-
- //append the table after the selected container
- var node = jQuery(wym.findUp(wym.container(),
- WYMeditor.MAIN_CONTAINERS)).get(0);
- if(!node || !node.parentNode) jQuery(wym._doc.body).append(table);
- else jQuery(node).after(table);
- }
- hide_modal();
- },
- "Cancel": function() {
- hide_modal();
- }
- }
- );
- }
-
- // INSERT "GALAXY ITEM" LINK DIALOG
- if ( dialogType == Galaxy.DIALOG_HISTORY_LINK || dialogType == Galaxy.DIALOG_DATASET_LINK ||
- dialogType == Galaxy.DIALOG_WORKFLOW_LINK || dialogType == Galaxy.DIALOG_PAGE_LINK ||
- dialogType == Galaxy.DIALOG_VISUALIZATION_LINK ) {
- // Based on item type, set useful vars.
- var item_info;
- switch(dialogType)
- {
- case(Galaxy.DIALOG_HISTORY_LINK):
- item_info = get_item_info(Galaxy.ITEM_HISTORY);
- break;
- case(Galaxy.DIALOG_DATASET_LINK):
- item_info = get_item_info(Galaxy.ITEM_DATASET);
- break;
- case(Galaxy.DIALOG_WORKFLOW_LINK):
- item_info = get_item_info(Galaxy.ITEM_WORKFLOW);
- break;
- case(Galaxy.DIALOG_PAGE_LINK):
- item_info = get_item_info(Galaxy.ITEM_PAGE);
- break;
- case(Galaxy.DIALOG_VISUALIZATION_LINK):
- item_info = get_item_info(Galaxy.ITEM_VISUALIZATION);
- break;
- }
-
- $.ajax(
- {
- url: item_info.list_ajax_url,
- data: {},
- error: function() { alert( "Failed to list " + item_info.plural.toLowerCase() + " for selection"); },
- success: function(table_html)
- {
- show_modal(
- "Insert Link to " + item_info.singular,
- table_html +
- "<div><input id='make-importable' type='checkbox' checked/>" +
- "Make the selected " + item_info.plural.toLowerCase() + " accessible so that they can viewed by everyone.</div>"
- ,
- {
- "Insert": function()
- {
- // Make selected items accessible (importable) ?
- var make_importable = false;
- if ( $('#make-importable:checked').val() !== null )
- make_importable = true;
-
- // Insert links to history for each checked item.
- var item_ids = new Array();
- $('input[name=id]:checked').each(function() {
- var item_id = $(this).val();
-
- // Make item importable?
- if (make_importable)
- make_item_importable(item_info.controller, item_id, item_info.singular);
-
- // Insert link(s) to item(s). This is done by getting item info and then manipulating wym.
- url_template = "${h.url_for( controller='ITEM_CONTROLLER', action='get_name_and_link_async' )}?id=" + item_id;
- ajax_url = url_template.replace( "ITEM_CONTROLLER", item_info.controller);
- $.getJSON( ajax_url, function( returned_item_info ) {
- // Get link text.
- wym._exec(WYMeditor.CREATE_LINK, sStamp);
- var link_text = $("a[href=" + sStamp + "]", wym._doc.body).text();
-
- // Insert link: need to do different actions depending on link text.
- if (
- link_text == "" // Firefox.
- ||
- link_text == sStamp // Safari
- )
- {
- // User selected no text; create link from scratch and use default text.
- wym.insert("<a href='" + returned_item_info.link + "'>" + item_info.singular + " '" + returned_item_info.name + "'</a>");
- }
- else
- {
- // Link created from selected text; add href and title.
- $("a[href=" + sStamp + "]", wym._doc.body).attr(WYMeditor.HREF, returned_item_info.link).attr(WYMeditor.TITLE, item_info.singular + item_id);
- }
- });
- });
-
- hide_modal();
- },
- "Cancel": function()
- {
- hide_modal();
- }
- }
- );
- }
- });
- }
- // EMBED GALAXY OBJECT DIALOGS
- if ( dialogType == Galaxy.DIALOG_EMBED_HISTORY || dialogType == Galaxy.DIALOG_EMBED_DATASET || dialogType == Galaxy.DIALOG_EMBED_WORKFLOW || dialogType == Galaxy.DIALOG_EMBED_PAGE || dialogType == Galaxy.DIALOG_EMBED_VISUALIZATION ) {
- // Based on item type, set useful vars.
- var item_info;
- switch(dialogType)
- {
- case(Galaxy.DIALOG_EMBED_HISTORY):
- item_info = get_item_info(Galaxy.ITEM_HISTORY);
- break;
- case(Galaxy.DIALOG_EMBED_DATASET):
- item_info = get_item_info(Galaxy.ITEM_DATASET);
- break;
- case(Galaxy.DIALOG_EMBED_WORKFLOW):
- item_info = get_item_info(Galaxy.ITEM_WORKFLOW);
- break;
- case(Galaxy.DIALOG_EMBED_PAGE):
- item_info = get_item_info(Galaxy.ITEM_PAGE);
- break;
- case(Galaxy.DIALOG_EMBED_VISUALIZATION):
- item_info = get_item_info(Galaxy.ITEM_VISUALIZATION);
- break;
- }
-
- $.ajax(
- {
- url: item_info.list_ajax_url,
- data: {},
- error: function() { alert( "Failed to list " + item_info.plural.toLowerCase() + " for selection"); },
- success: function(list_html)
- {
- // Can make histories, workflows importable; cannot make datasets importable.
- if (dialogType == Galaxy.DIALOG_EMBED_HISTORY || dialogType == Galaxy.DIALOG_EMBED_WORKFLOW
- || dialogType == Galaxy.DIALOG_EMBED_VISUALIZATION)
- list_html = list_html + "<div><input id='make-importable' type='checkbox' checked/>" +
- "Make the selected " + item_info.plural.toLowerCase() + " accessible so that they can viewed by everyone.</div>";
- show_modal(
- "Embed " + item_info.plural,
- list_html,
- {
- "Embed": function()
- {
- // Make selected items accessible (importable) ?
- var make_importable = false;
- if ( $('#make-importable:checked').val() != null )
- make_importable = true;
-
- $('input[name=id]:checked').each(function() {
- // Get item ID and name.
- var item_id = $(this).val();
- // Use ':first' because there are many labels in table; the first one is the item name.
- var item_name = $("label[for='" + item_id + "']:first").text();
-
- if (make_importable)
- make_item_importable(item_info.controller, item_id, item_info.singular);
-
- // Embedded item HTML; item class is embedded in div container classes; this is necessary because the editor strips
- // all non-standard attributes when it returns its content (e.g. it will not return an element attribute of the form
- // item_class='History').
- var item_elt_id = item_info.iclass + "-" + item_id;
- var item_embed_html =
- "<p><div id='" + item_elt_id + "' class='embedded-item " + item_info.singular.toLowerCase() +
- " placeholder'> \
- <p class='title'>Embedded Galaxy " + item_info.singular + " '" + item_name + "'</p> \
- <p class='content'> \
- [Do not edit this block; Galaxy will fill it in with the annotated " +
- item_info.singular.toLowerCase() + " when it is displayed.] \
- </p> \
- </div></p>";
-
- // Insert embedded item into document.
- wym.insert(" "); // Needed to prevent insertion from occurring in child element in webkit browsers.
- wym.insert(item_embed_html);
-
- // TODO: can we fix this?
- // Due to oddities of wym.insert() [likely due to inserting a <div> and/or a complete paragraph], an
- // empty paragraph (or two!) may be included either before an embedded item. Remove these paragraphs.
- $("#" + item_elt_id, wym._doc.body).each( function() {
- // Remove previous empty paragraphs.
- var removing = true;
- while (removing)
- {
- var prev_elt = $(this).prev();
- if ( prev_elt.length != 0 && jQuery.trim(prev_elt.text()) == "" )
- prev_elt.remove();
- else
- removing = false;
- }
- });
-
- });
- hide_modal();
- },
- "Cancel": function()
- {
- hide_modal();
- }
- }
- );
- }
- });
- }
-
- // ANNOTATE HISTORY DIALOG
- if ( dialogType == Galaxy.DIALOG_ANNOTATE_HISTORY ) {
- $.ajax(
- {
- url: "${h.url_for(controller='page', action='list_histories_for_selection' )}",
- data: {},
- error: function() { alert( "Grid refresh failed" ) },
- success: function(table_html)
- {
- show_modal(
- "Insert Link to History",
- table_html,
- {
- "Annotate": function()
- {
- // Insert links to history for each checked item.
- var item_ids = new Array();
- $('input[name=id]:checked').each(function() {
- var item_id = $(this).val();
-
- // Get annotation table for history.
- $.ajax(
- {
- url: "${h.url_for(controller='page', action='get_history_annotation_table' )}",
- data: { id : item_id },
- error: function() { alert( "Grid refresh failed" ) },
- success: function(result)
- {
- // Insert into document.
- wym.insert(result);
-
- init_galaxy_elts(wym);
-
- }
- });
- });
-
- hide_modal();
- },
- "Cancel": function()
- {
- hide_modal();
- }
- }
- );
- }
- });
- }
- };
+ // Define variables needed by galaxy.pages script.
+ var page_id = "${trans.security.encode_id(page.id)}",
+ page_list_url = '${h.url_for( controller='page', action='list' )}',
+ list_objects_url = "${h.url_for(controller='page', action='LIST_ACTION' )}",
+ set_accessible_url = "${h.url_for( controller='ITEM_CONTROLLER', action='set_accessible_async' )}",
+ get_name_and_link_url = "${h.url_for( controller='ITEM_CONTROLLER', action='get_name_and_link_async' )}?id=",
+ list_histories_for_selection_url = "${h.url_for(controller='page', action='list_histories_for_selection' )}",
+ get_history_annotation_table_url = "${h.url_for(controller='page', action='get_history_annotation_table' )}",
+ editor_base_path = "${h.url_for('/static/wymeditor')}/",
+ iframe_base_path = "${h.url_for('/static/wymeditor/iframe/galaxy')}/",
+ save_url = "${h.url_for(controller='page', action='save' )}";
</script>
-
- <script type='text/javascript'>
- $(function(){
- ## Generic error handling
- $(document).ajaxError( function ( e, x ) {
- // console.log( e, x );
- var message = x.responseText || x.statusText || "Could not connect to server";
- show_modal( "Server error", message, { "Ignore error" : hide_modal } );
- return false;
- });
- ## Create editor
- $("[name=page_content]").wymeditor( {
- skin: 'galaxy',
- basePath: "${h.url_for('/static/wymeditor')}/",
- iframeBasePath: "${h.url_for('/static/wymeditor/iframe/galaxy')}/",
- boxHtml: "<table class='wym_box' width='100%' height='100%'>"
- + "<tr><td><div class='wym_area_top'>"
- + WYMeditor.TOOLS
- + "</div></td></tr>"
- + "<tr height='100%'><td>"
- + "<div class='wym_area_main' style='height: 100%;'>"
- // + WYMeditor.HTML
- + WYMeditor.IFRAME
- + WYMeditor.STATUS
- + "</div>"
- + "</div>"
- + "</td></tr></table>",
- 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'},
- ]
- });
- ## Get the editor object
- var editor = $.wymeditors(0);
- var save = function ( callback ) {
- show_modal( "Saving page", "progress" );
-
- /*
- Not used right now.
- // Gather annotations.
- var annotations = new Array();
-
- $('.annotation', editor._doc.body).each( function() {
- var item_class = $(this).attr( 'item_class' );
- var item_id = $(this).attr( 'item_id' );
- var text = $(this).text();
- annotation = {
- "item_class" : item_class,
- "item_id" : item_id,
- "text" : text
- };
- annotations[ annotations.length ] = annotation;
- });
-
- */
-
- // Do save.
- $.ajax( {
- url: "${h.url_for(controller='page', action='save' )}",
- type: "POST",
- data: {
- id: "${trans.security.encode_id(page.id)}",
- content: editor.xhtml(),
- annotations: JSON.stringify(new Object()),
- ## annotations: JSON.stringify(annotations),
- "_": "true"
- },
- success: function() {
- callback();
- }
- });
- }
- ## Save button
- $("#save-button").click( function() {
- save( function() { hide_modal(); } )
- });
- ## Close button
- $("#close-button").click(function() {
- <% next_url = h.url_for( controller='page', action='list' ) %>
- // var new_content = editor.xhtml();
- // var changed = ( initial_content != new_content );
- var changed = false;
- if ( changed ) {
- var do_close = function() {
- window.onbeforeunload = undefined;
- window.document.location = "${next_url}"
- };
- show_modal( "Close editor",
- "There are unsaved changes to your page which will be lost.",
- {
- "Cancel" : hide_modal,
- "Save Changes" : function() {
- save( do_close );
- }
- }, {
- "Don't Save": do_close
- } );
- } else {
- window.document.location = "${next_url}";
- }
- });
-
- // Initialize galaxy elements.
- //init_galaxy_elts(editor);
-
- //
- // Containers, Galaxy style
- //
- var containers_menu = $("<div class='galaxy-page-editor-button'><a id='insert-galaxy-link' class='action-button popup' href='#'>${_('Paragraph type')}</a></div>");
- $(".wym_area_top").append( containers_menu );
-
- // Add menu options.
- var items = {}
- $.each( editor._options.containersItems, function( k, v ) {
- var tagname = v.name;
- items[ v.title.replace( '_', ' ' ) ] = function() { editor.container( tagname ) }
- });
- make_popupmenu( containers_menu, items);
-
- //
- // Create 'Insert Link to Galaxy Object' menu.
- //
-
- // Add menu button.
- var insert_link_menu_button = $("<div><a id='insert-galaxy-link' class='action-button popup' href='#'>${_('Insert Link to Galaxy Object')}</a></div>").addClass('galaxy-page-editor-button');
- $(".wym_area_top").append(insert_link_menu_button);
-
- // Add menu options.
- make_popupmenu( insert_link_menu_button, {
- "Insert History Link": function() {
- editor.dialog(Galaxy.DIALOG_HISTORY_LINK);
- },
- "Insert Dataset Link": function() {
- editor.dialog(Galaxy.DIALOG_DATASET_LINK);
- },
- "Insert Workflow Link": function() {
- editor.dialog(Galaxy.DIALOG_WORKFLOW_LINK);
- },
- "Insert Page Link": function() {
- editor.dialog(Galaxy.DIALOG_PAGE_LINK);
- },
- "Insert Visualization Link": function() {
- editor.dialog(Galaxy.DIALOG_VISUALIZATION_LINK);
- },
- });
-
- //
- // Create 'Embed Galaxy Object' menu.
- //
-
- // Add menu button.
- var embed_object_button = $("<div><a id='embed-galaxy-object' class='action-button popup' href='#'>${_('Embed Galaxy Object')}</a></div>").addClass('galaxy-page-editor-button');
- $(".wym_area_top").append(embed_object_button);
-
- // Add menu options.
- make_popupmenu( embed_object_button, {
- "Embed History": function() {
- editor.dialog(Galaxy.DIALOG_EMBED_HISTORY);
- },
- "Embed Dataset": function() {
- editor.dialog(Galaxy.DIALOG_EMBED_DATASET);
- },
- "Embed Workflow": function() {
- editor.dialog(Galaxy.DIALOG_EMBED_WORKFLOW);
- },
- "Embed Visualization": function() {
- editor.dialog(Galaxy.DIALOG_EMBED_VISUALIZATION);
- },
- ##"Embed Page": function() {
- ## editor.dialog(Galaxy.DIALOG_EMBED_PAGE);
- ##}
- });
- });
- </script>
+ ${h.js( "libs/jquery/jquery.form", "libs/jquery/jstorage", "libs/jquery/jquery.wymeditor", "libs/jquery/jquery.autocomplete", "galaxy.autocom_tagging", "galaxy.pages")}
</%def><%def name="stylesheets()">
@@ -782,7 +53,7 @@
</div><div class="unified-panel-body">
- <textarea name="page_content">${util.unicodify( page.latest_revision.content) }</textarea>
+ <textarea name="page_content">${util.unicodify( page.latest_revision.content )}</textarea></div></%def>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Allow spaces and commas in Cuffdiff labels.
by commits-noreply@bitbucket.org 01 Jul '13
by commits-noreply@bitbucket.org 01 Jul '13
01 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5b27b92310d0/
Changeset: 5b27b92310d0
User: jgoecks
Date: 2013-07-01 15:46:09
Summary: Allow spaces and commas in Cuffdiff labels.
Affected #: 1 file
diff -r 5a73d78e0a4782d9c57d8c1d6cea167e4f4671b6 -r 5b27b92310d044cfd2f9b3711e5ef446048de110 tools/ngs_rna/cuffdiff_wrapper.xml
--- a/tools/ngs_rna/cuffdiff_wrapper.xml
+++ b/tools/ngs_rna/cuffdiff_wrapper.xml
@@ -59,7 +59,9 @@
## Replicates.
--labels
#for $group in $group_analysis.groups
- "${group.group}"
+ ## Cuffdiff uses commas as delimiters, so replace them with underscores to avoid
+ ## parsing problems.
+ "${group.group.replace(',', '_')}"
#end for
--files
#for $group in $group_analysis.groups
@@ -80,7 +82,7 @@
</param><when value="Yes"><repeat name="groups" title="Group">
- <param name="group" title="Group name" type="text" label="Group name (no spaces or commas)"/>
+ <param name="group" title="Group name" type="text" label="Group name"/><repeat name="files" title="Replicate"><param name="file" label="Add file" type="data" format="sam,bam"/></repeat>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dannon: Fix converter imports -- resolves failing unit tests
by commits-noreply@bitbucket.org 01 Jul '13
by commits-noreply@bitbucket.org 01 Jul '13
01 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5a73d78e0a47/
Changeset: 5a73d78e0a47
User: dannon
Date: 2013-07-01 11:57:51
Summary: Fix converter imports -- resolves failing unit tests
Affected #: 2 files
diff -r 6673bd3bf4571c4134797077ca85350a6319e444 -r 5a73d78e0a4782d9c57d8c1d6cea167e4f4671b6 lib/galaxy/datatypes/converters/interval_to_interval_index_converter.py
--- a/lib/galaxy/datatypes/converters/interval_to_interval_index_converter.py
+++ b/lib/galaxy/datatypes/converters/interval_to_interval_index_converter.py
@@ -11,15 +11,13 @@
from __future__ import division
-import sys, fileinput, optparse
+import optparse
from galaxy import eggs
-import pkg_resources; pkg_resources.require( "bx-python" )
-from galaxy.visualization.tracks.summary import *
-from galaxy.datatypes.util.gff_util import convert_gff_coords_to_bed
+eggs.require( "bx-python" )
from bx.interval_index_file import Indexes
def main():
-
+
# Read options, args.
parser = optparse.OptionParser()
parser.add_option( '-c', '--chr-col', type='int', dest='chrom_col', default=1 )
@@ -27,12 +25,12 @@
parser.add_option( '-e', '--end-col', type='int', dest='end_col', default=3 )
(options, args) = parser.parse_args()
input_fname, output_fname = args
-
+
# Make column indices 0-based.
options.chrom_col -= 1
options.start_col -= 1
options.end_col -= 1
-
+
# Do conversion.
index = Indexes()
offset = 0
@@ -46,9 +44,9 @@
chrom_end = int( feature[ options.end_col ] )
index.add( chrom, chrom_start, chrom_end, offset )
offset += len(line)
-
+
index.write( open(output_fname, "w") )
-if __name__ == "__main__":
+if __name__ == "__main__":
main()
-
\ No newline at end of file
+
diff -r 6673bd3bf4571c4134797077ca85350a6319e444 -r 5a73d78e0a4782d9c57d8c1d6cea167e4f4671b6 lib/galaxy/datatypes/converters/pileup_to_interval_index_converter.py
--- a/lib/galaxy/datatypes/converters/pileup_to_interval_index_converter.py
+++ b/lib/galaxy/datatypes/converters/pileup_to_interval_index_converter.py
@@ -8,20 +8,18 @@
from __future__ import division
-import sys, fileinput, optparse
+import optparse
from galaxy import eggs
-import pkg_resources; pkg_resources.require( "bx-python" )
-from galaxy.visualization.tracks.summary import *
-from galaxy.datatypes.util.gff_util import convert_gff_coords_to_bed
+eggs.require( "bx-python" )
from bx.interval_index_file import Indexes
def main():
-
+
# Read options, args.
parser = optparse.OptionParser()
(options, args) = parser.parse_args()
input_fname, output_fname = args
-
+
# Do conversion.
index = Indexes()
offset = 0
@@ -31,9 +29,9 @@
start = int( start ) - 1
index.add( chrom, start, start + 1, offset )
offset += len( line )
-
+
index.write( open(output_fname, "w") )
-if __name__ == "__main__":
+if __name__ == "__main__":
main()
-
\ No newline at end of file
+
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/682bc706f5d6/
Changeset: 682bc706f5d6
User: jmchilton
Date: 2013-06-24 16:28:14
Summary: Create unit test directory with example test. Enable coverage report generation of unit tests (run_unit_tests.sh will automatically add --with-coverage to nosetests call if coverage is on the path, coverage report can than be generated with 'coverage html' and viewed at htmlcov/index.html). Update .hgignore to reflect these changes.
Affected #: 6 files
diff -r dc6e0347edffb96fe4e633b362ad21a9f5a83e81 -r 682bc706f5d6c8caab7a46e405cdee158268c373 .coveragerc
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,3 @@
+[run]
+branch = True
+include = lib/galaxy/*
diff -r dc6e0347edffb96fe4e633b362ad21a9f5a83e81 -r 682bc706f5d6c8caab7a46e405cdee158268c373 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -82,6 +82,9 @@
# Test output
run_functional_tests.html
test/tool_shed/tmp/*
+.coverage
+htmlcov
+run_unit_tests.html
# Project files
*.kpf
diff -r dc6e0347edffb96fe4e633b362ad21a9f5a83e81 -r 682bc706f5d6c8caab7a46e405cdee158268c373 lib/galaxy/tools/loader.py
--- a/lib/galaxy/tools/loader.py
+++ b/lib/galaxy/tools/loader.py
@@ -202,199 +202,3 @@
current_index += 1
parent_el.insert(current_index, deepcopy(target))
parent_el.remove(query)
-
-
-def test_loader():
- """
- Function to test this module. Galaxy doesn't seem to have a
- place to put unit tests that are not doctests. These tests can
- be run with nosetests via the following command:
-
- % nosetests lib/galaxy/tools/loader.py
-
- """
- from tempfile import mkdtemp
- from shutil import rmtree
-
- class TestToolDirectory(object):
- def __init__(self):
- self.temp_directory = mkdtemp()
-
- def __enter__(self):
- return self
-
- def __exit__(self, type, value, tb):
- rmtree(self.temp_directory)
-
- def write(self, contents, name="tool.xml"):
- open(os.path.join(self.temp_directory, name), "w").write(contents)
-
- def load(self, name="tool.xml", preprocess=True):
- if preprocess:
- loader = load_tool
- else:
- loader = parse_xml
- return loader(os.path.join(self.temp_directory, name))
-
- ## Test simple macro replacement.
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs" />
- <macros>
- <macro name="inputs">
- <inputs />
- </macro>
- </macros>
-</tool>''')
- xml = tool_dir.load(preprocess=False)
- assert xml.find("inputs") is None
- xml = tool_dir.load(preprocess=True)
- assert xml.find("inputs") is not None
-
- # Test importing macros from external files
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs" />
- <macros>
- <import>external.xml</import>
- </macros>
-</tool>''')
-
- tool_dir.write('''
-<macros>
- <macro name="inputs">
- <inputs />
- </macro>
-</macros>''', name="external.xml")
- xml = tool_dir.load(preprocess=False)
- assert xml.find("inputs") is None
- xml = tool_dir.load(preprocess=True)
- assert xml.find("inputs") is not None
-
- # Test macros with unnamed yield statements.
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs">
- <input name="first_input" />
- </expand>
- <macros>
- <macro name="inputs">
- <inputs>
- <yield />
- </inputs>
- </macro>
- </macros>
-</tool>''')
- xml = tool_dir.load()
- assert xml.find("inputs").find("input").get("name") == "first_input"
-
- # Test recursive macro applications.
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs">
- <input name="first_input" />
- <expand macro="second" />
- </expand>
- <macros>
- <macro name="inputs">
- <inputs>
- <yield />
- </inputs>
- </macro>
- <macro name="second">
- <input name="second_input" />
- </macro>
- </macros>
-</tool>''')
- xml = tool_dir.load()
- assert xml.find("inputs").findall("input")[1].get("name") == "second_input"
-
- # Test recursive macro applications.
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs">
- <input name="first_input" />
- <expand macro="second" />
- </expand>
- <macros>
- <macro name="inputs">
- <inputs>
- <yield />
- </inputs>
- </macro>
- <macro name="second">
- <expand macro="second_delegate" />
- </macro>
- <macro name="second_delegate">
- <input name="second_input" />
- </macro>
- </macros>
-</tool>''')
- xml = tool_dir.load()
- assert xml.find("inputs").findall("input")[1].get("name") == "second_input"
-
- # Test <xml> is shortcut for macro type="xml"
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs" />
- <macros>
- <xml name="inputs">
- <inputs />
- </xml>
- </macros>
-</tool>''')
- xml = tool_dir.load()
- assert xml.find("inputs") is not None
-
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <command interpreter="python">tool_wrapper.py
- #include source=$tool_params
- </command>
- <macros>
- <template name="tool_params">-a 1 -b 2</template>
- </macros>
-</tool>
-''')
- xml = tool_dir.load()
- params_dict = template_macro_params(xml.getroot())
- assert params_dict['tool_params'] == "-a 1 -b 2"
-
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <macros>
- <token name="@CITATION@">The citation.</token>
- </macros>
- <help>@CITATION@</help>
- <another>
- <tag />
- </another>
-</tool>
-''')
- xml = tool_dir.load()
- help_el = xml.find("help")
- assert help_el.text == "The citation.", help_el.text
-
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <macros>
- <token name="@TAG_VAL@">The value.</token>
- </macros>
- <another>
- <tag value="@TAG_VAL@" />
- </another>
-</tool>
-''')
- xml = tool_dir.load()
- tag_el = xml.find("another").find("tag")
- value = tag_el.get('value')
- assert value == "The value.", value
diff -r dc6e0347edffb96fe4e633b362ad21a9f5a83e81 -r 682bc706f5d6c8caab7a46e405cdee158268c373 run_unit_tests.sh
--- a/run_unit_tests.sh
+++ b/run_unit_tests.sh
@@ -3,7 +3,14 @@
## Excluding controllers due to the problematic genetrack dependency
## Excluding job runners due to various external dependencies
-python ./scripts/nosetests.py -v -w lib \
+COVERAGE=`which coverage`
+COVERAGE_ARG=""
+if [ $COVERAGE ]; then
+ COVERAGE_ARG="--with-coverage"
+fi
+
+python ./scripts/nosetests.py -v \
+ $COVERAGE_ARG \
--with-nosehtml --html-report-file run_unit_tests.html \
--with-doctest --exclude=functional --exclude="^get" \
- --exclude=controllers --exclude=runners
+ --exclude=controllers --exclude=runners lib test/unit
diff -r dc6e0347edffb96fe4e633b362ad21a9f5a83e81 -r 682bc706f5d6c8caab7a46e405cdee158268c373 test/TESTING.md
--- /dev/null
+++ b/test/TESTING.md
@@ -0,0 +1,7 @@
+Galaxy Testing
+==============
+
+The Galaxy code base is large and contains many kinds of tests. Please
+consult the [Galaxy
+wiki](http://wiki.galaxyproject.org/Admin/Running%20Tests) for more
+information on testing Galaxy.
diff -r dc6e0347edffb96fe4e633b362ad21a9f5a83e81 -r 682bc706f5d6c8caab7a46e405cdee158268c373 test/unit/test_tool_loader.py
--- /dev/null
+++ b/test/unit/test_tool_loader.py
@@ -0,0 +1,191 @@
+from tempfile import mkdtemp
+from shutil import rmtree
+import os
+
+from galaxy.util import parse_xml
+from galaxy.tools.loader import template_macro_params, load_tool
+
+def test_loader():
+
+ class TestToolDirectory(object):
+ def __init__(self):
+ self.temp_directory = mkdtemp()
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, tb):
+ rmtree(self.temp_directory)
+
+ def write(self, contents, name="tool.xml"):
+ open(os.path.join(self.temp_directory, name), "w").write(contents)
+
+ def load(self, name="tool.xml", preprocess=True):
+ if preprocess:
+ loader = load_tool
+ else:
+ loader = parse_xml
+ return loader(os.path.join(self.temp_directory, name))
+
+ ## Test simple macro replacement.
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs" />
+ <macros>
+ <macro name="inputs">
+ <inputs />
+ </macro>
+ </macros>
+</tool>''')
+ xml = tool_dir.load(preprocess=False)
+ assert xml.find("inputs") is None
+ xml = tool_dir.load(preprocess=True)
+ assert xml.find("inputs") is not None
+
+ # Test importing macros from external files
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs" />
+ <macros>
+ <import>external.xml</import>
+ </macros>
+</tool>''')
+
+ tool_dir.write('''
+<macros>
+ <macro name="inputs">
+ <inputs />
+ </macro>
+</macros>''', name="external.xml")
+ xml = tool_dir.load(preprocess=False)
+ assert xml.find("inputs") is None
+ xml = tool_dir.load(preprocess=True)
+ assert xml.find("inputs") is not None
+
+ # Test macros with unnamed yield statements.
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs">
+ <input name="first_input" />
+ </expand>
+ <macros>
+ <macro name="inputs">
+ <inputs>
+ <yield />
+ </inputs>
+ </macro>
+ </macros>
+</tool>''')
+ xml = tool_dir.load()
+ assert xml.find("inputs").find("input").get("name") == "first_input"
+
+ # Test recursive macro applications.
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs">
+ <input name="first_input" />
+ <expand macro="second" />
+ </expand>
+ <macros>
+ <macro name="inputs">
+ <inputs>
+ <yield />
+ </inputs>
+ </macro>
+ <macro name="second">
+ <input name="second_input" />
+ </macro>
+ </macros>
+</tool>''')
+ xml = tool_dir.load()
+ assert xml.find("inputs").findall("input")[1].get("name") == "second_input"
+
+ # Test recursive macro applications.
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs">
+ <input name="first_input" />
+ <expand macro="second" />
+ </expand>
+ <macros>
+ <macro name="inputs">
+ <inputs>
+ <yield />
+ </inputs>
+ </macro>
+ <macro name="second">
+ <expand macro="second_delegate" />
+ </macro>
+ <macro name="second_delegate">
+ <input name="second_input" />
+ </macro>
+ </macros>
+</tool>''')
+ xml = tool_dir.load()
+ assert xml.find("inputs").findall("input")[1].get("name") == "second_input"
+
+ # Test <xml> is shortcut for macro type="xml"
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs" />
+ <macros>
+ <xml name="inputs">
+ <inputs />
+ </xml>
+ </macros>
+</tool>''')
+ xml = tool_dir.load()
+ assert xml.find("inputs") is not None
+
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <command interpreter="python">tool_wrapper.py
+ #include source=$tool_params
+ </command>
+ <macros>
+ <template name="tool_params">-a 1 -b 2</template>
+ </macros>
+</tool>
+''')
+ xml = tool_dir.load()
+ params_dict = template_macro_params(xml.getroot())
+ assert params_dict['tool_params'] == "-a 1 -b 2"
+
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <macros>
+ <token name="@CITATION@">The citation.</token>
+ </macros>
+ <help>@CITATION@</help>
+ <another>
+ <tag />
+ </another>
+</tool>
+''')
+ xml = tool_dir.load()
+ help_el = xml.find("help")
+ assert help_el.text == "The citation.", help_el.text
+
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <macros>
+ <token name="@TAG_VAL@">The value.</token>
+ </macros>
+ <another>
+ <tag value="@TAG_VAL@" />
+ </another>
+</tool>
+''')
+ xml = tool_dir.load()
+ tag_el = xml.find("another").find("tag")
+ value = tag_el.get('value')
+ assert value == "The value.", value
https://bitbucket.org/galaxy/galaxy-central/commits/71bd004a3354/
Changeset: 71bd004a3354
User: jmchilton
Date: 2013-06-24 16:29:46
Summary: Update README.txt to reflect Python 2.5 is no longer supported.
Affected #: 1 file
diff -r 682bc706f5d6c8caab7a46e405cdee158268c373 -r 71bd004a3354b7132db03cb17b6a45997677e100 README.txt
--- a/README.txt
+++ b/README.txt
@@ -7,7 +7,7 @@
HOW TO START
============
-Galaxy requires Python 2.5, 2.6 or 2.7. To check your python version, run:
+Galaxy requires Python 2.6 or 2.7. To check your python version, run:
% python -V
Python 2.7.3
https://bitbucket.org/galaxy/galaxy-central/commits/6673bd3bf457/
Changeset: 6673bd3bf457
User: dannon
Date: 2013-07-01 11:53:46
Summary: Merged in jmchilton/galaxy-central-multi-input-tool-fixes-2 (pull request #189)
Small Unit Testing Improvements
Affected #: 7 files
diff -r 9ddb3130b98d450ca2be3f447f171ff5f192b8a1 -r 6673bd3bf4571c4134797077ca85350a6319e444 .coveragerc
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,3 @@
+[run]
+branch = True
+include = lib/galaxy/*
diff -r 9ddb3130b98d450ca2be3f447f171ff5f192b8a1 -r 6673bd3bf4571c4134797077ca85350a6319e444 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -82,6 +82,9 @@
# Test output
run_functional_tests.html
test/tool_shed/tmp/*
+.coverage
+htmlcov
+run_unit_tests.html
# Project files
*.kpf
diff -r 9ddb3130b98d450ca2be3f447f171ff5f192b8a1 -r 6673bd3bf4571c4134797077ca85350a6319e444 README.txt
--- a/README.txt
+++ b/README.txt
@@ -7,7 +7,7 @@
HOW TO START
============
-Galaxy requires Python 2.5, 2.6 or 2.7. To check your python version, run:
+Galaxy requires Python 2.6 or 2.7. To check your python version, run:
% python -V
Python 2.7.3
diff -r 9ddb3130b98d450ca2be3f447f171ff5f192b8a1 -r 6673bd3bf4571c4134797077ca85350a6319e444 lib/galaxy/tools/loader.py
--- a/lib/galaxy/tools/loader.py
+++ b/lib/galaxy/tools/loader.py
@@ -202,199 +202,3 @@
current_index += 1
parent_el.insert(current_index, deepcopy(target))
parent_el.remove(query)
-
-
-def test_loader():
- """
- Function to test this module. Galaxy doesn't seem to have a
- place to put unit tests that are not doctests. These tests can
- be run with nosetests via the following command:
-
- % nosetests lib/galaxy/tools/loader.py
-
- """
- from tempfile import mkdtemp
- from shutil import rmtree
-
- class TestToolDirectory(object):
- def __init__(self):
- self.temp_directory = mkdtemp()
-
- def __enter__(self):
- return self
-
- def __exit__(self, type, value, tb):
- rmtree(self.temp_directory)
-
- def write(self, contents, name="tool.xml"):
- open(os.path.join(self.temp_directory, name), "w").write(contents)
-
- def load(self, name="tool.xml", preprocess=True):
- if preprocess:
- loader = load_tool
- else:
- loader = parse_xml
- return loader(os.path.join(self.temp_directory, name))
-
- ## Test simple macro replacement.
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs" />
- <macros>
- <macro name="inputs">
- <inputs />
- </macro>
- </macros>
-</tool>''')
- xml = tool_dir.load(preprocess=False)
- assert xml.find("inputs") is None
- xml = tool_dir.load(preprocess=True)
- assert xml.find("inputs") is not None
-
- # Test importing macros from external files
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs" />
- <macros>
- <import>external.xml</import>
- </macros>
-</tool>''')
-
- tool_dir.write('''
-<macros>
- <macro name="inputs">
- <inputs />
- </macro>
-</macros>''', name="external.xml")
- xml = tool_dir.load(preprocess=False)
- assert xml.find("inputs") is None
- xml = tool_dir.load(preprocess=True)
- assert xml.find("inputs") is not None
-
- # Test macros with unnamed yield statements.
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs">
- <input name="first_input" />
- </expand>
- <macros>
- <macro name="inputs">
- <inputs>
- <yield />
- </inputs>
- </macro>
- </macros>
-</tool>''')
- xml = tool_dir.load()
- assert xml.find("inputs").find("input").get("name") == "first_input"
-
- # Test recursive macro applications.
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs">
- <input name="first_input" />
- <expand macro="second" />
- </expand>
- <macros>
- <macro name="inputs">
- <inputs>
- <yield />
- </inputs>
- </macro>
- <macro name="second">
- <input name="second_input" />
- </macro>
- </macros>
-</tool>''')
- xml = tool_dir.load()
- assert xml.find("inputs").findall("input")[1].get("name") == "second_input"
-
- # Test recursive macro applications.
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs">
- <input name="first_input" />
- <expand macro="second" />
- </expand>
- <macros>
- <macro name="inputs">
- <inputs>
- <yield />
- </inputs>
- </macro>
- <macro name="second">
- <expand macro="second_delegate" />
- </macro>
- <macro name="second_delegate">
- <input name="second_input" />
- </macro>
- </macros>
-</tool>''')
- xml = tool_dir.load()
- assert xml.find("inputs").findall("input")[1].get("name") == "second_input"
-
- # Test <xml> is shortcut for macro type="xml"
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <expand macro="inputs" />
- <macros>
- <xml name="inputs">
- <inputs />
- </xml>
- </macros>
-</tool>''')
- xml = tool_dir.load()
- assert xml.find("inputs") is not None
-
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <command interpreter="python">tool_wrapper.py
- #include source=$tool_params
- </command>
- <macros>
- <template name="tool_params">-a 1 -b 2</template>
- </macros>
-</tool>
-''')
- xml = tool_dir.load()
- params_dict = template_macro_params(xml.getroot())
- assert params_dict['tool_params'] == "-a 1 -b 2"
-
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <macros>
- <token name="@CITATION@">The citation.</token>
- </macros>
- <help>@CITATION@</help>
- <another>
- <tag />
- </another>
-</tool>
-''')
- xml = tool_dir.load()
- help_el = xml.find("help")
- assert help_el.text == "The citation.", help_el.text
-
- with TestToolDirectory() as tool_dir:
- tool_dir.write('''
-<tool>
- <macros>
- <token name="@TAG_VAL@">The value.</token>
- </macros>
- <another>
- <tag value="@TAG_VAL@" />
- </another>
-</tool>
-''')
- xml = tool_dir.load()
- tag_el = xml.find("another").find("tag")
- value = tag_el.get('value')
- assert value == "The value.", value
diff -r 9ddb3130b98d450ca2be3f447f171ff5f192b8a1 -r 6673bd3bf4571c4134797077ca85350a6319e444 run_unit_tests.sh
--- a/run_unit_tests.sh
+++ b/run_unit_tests.sh
@@ -3,7 +3,14 @@
## Excluding controllers due to the problematic genetrack dependency
## Excluding job runners due to various external dependencies
-python ./scripts/nosetests.py -v -w lib \
+COVERAGE=`which coverage`
+COVERAGE_ARG=""
+if [ $COVERAGE ]; then
+ COVERAGE_ARG="--with-coverage"
+fi
+
+python ./scripts/nosetests.py -v \
+ $COVERAGE_ARG \
--with-nosehtml --html-report-file run_unit_tests.html \
--with-doctest --exclude=functional --exclude="^get" \
- --exclude=controllers --exclude=runners
+ --exclude=controllers --exclude=runners lib test/unit
diff -r 9ddb3130b98d450ca2be3f447f171ff5f192b8a1 -r 6673bd3bf4571c4134797077ca85350a6319e444 test/TESTING.md
--- /dev/null
+++ b/test/TESTING.md
@@ -0,0 +1,7 @@
+Galaxy Testing
+==============
+
+The Galaxy code base is large and contains many kinds of tests. Please
+consult the [Galaxy
+wiki](http://wiki.galaxyproject.org/Admin/Running%20Tests) for more
+information on testing Galaxy.
diff -r 9ddb3130b98d450ca2be3f447f171ff5f192b8a1 -r 6673bd3bf4571c4134797077ca85350a6319e444 test/unit/test_tool_loader.py
--- /dev/null
+++ b/test/unit/test_tool_loader.py
@@ -0,0 +1,191 @@
+from tempfile import mkdtemp
+from shutil import rmtree
+import os
+
+from galaxy.util import parse_xml
+from galaxy.tools.loader import template_macro_params, load_tool
+
+def test_loader():
+
+ class TestToolDirectory(object):
+ def __init__(self):
+ self.temp_directory = mkdtemp()
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, tb):
+ rmtree(self.temp_directory)
+
+ def write(self, contents, name="tool.xml"):
+ open(os.path.join(self.temp_directory, name), "w").write(contents)
+
+ def load(self, name="tool.xml", preprocess=True):
+ if preprocess:
+ loader = load_tool
+ else:
+ loader = parse_xml
+ return loader(os.path.join(self.temp_directory, name))
+
+ ## Test simple macro replacement.
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs" />
+ <macros>
+ <macro name="inputs">
+ <inputs />
+ </macro>
+ </macros>
+</tool>''')
+ xml = tool_dir.load(preprocess=False)
+ assert xml.find("inputs") is None
+ xml = tool_dir.load(preprocess=True)
+ assert xml.find("inputs") is not None
+
+ # Test importing macros from external files
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs" />
+ <macros>
+ <import>external.xml</import>
+ </macros>
+</tool>''')
+
+ tool_dir.write('''
+<macros>
+ <macro name="inputs">
+ <inputs />
+ </macro>
+</macros>''', name="external.xml")
+ xml = tool_dir.load(preprocess=False)
+ assert xml.find("inputs") is None
+ xml = tool_dir.load(preprocess=True)
+ assert xml.find("inputs") is not None
+
+ # Test macros with unnamed yield statements.
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs">
+ <input name="first_input" />
+ </expand>
+ <macros>
+ <macro name="inputs">
+ <inputs>
+ <yield />
+ </inputs>
+ </macro>
+ </macros>
+</tool>''')
+ xml = tool_dir.load()
+ assert xml.find("inputs").find("input").get("name") == "first_input"
+
+ # Test recursive macro applications.
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs">
+ <input name="first_input" />
+ <expand macro="second" />
+ </expand>
+ <macros>
+ <macro name="inputs">
+ <inputs>
+ <yield />
+ </inputs>
+ </macro>
+ <macro name="second">
+ <input name="second_input" />
+ </macro>
+ </macros>
+</tool>''')
+ xml = tool_dir.load()
+ assert xml.find("inputs").findall("input")[1].get("name") == "second_input"
+
+ # Test recursive macro applications.
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs">
+ <input name="first_input" />
+ <expand macro="second" />
+ </expand>
+ <macros>
+ <macro name="inputs">
+ <inputs>
+ <yield />
+ </inputs>
+ </macro>
+ <macro name="second">
+ <expand macro="second_delegate" />
+ </macro>
+ <macro name="second_delegate">
+ <input name="second_input" />
+ </macro>
+ </macros>
+</tool>''')
+ xml = tool_dir.load()
+ assert xml.find("inputs").findall("input")[1].get("name") == "second_input"
+
+ # Test <xml> is shortcut for macro type="xml"
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <expand macro="inputs" />
+ <macros>
+ <xml name="inputs">
+ <inputs />
+ </xml>
+ </macros>
+</tool>''')
+ xml = tool_dir.load()
+ assert xml.find("inputs") is not None
+
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <command interpreter="python">tool_wrapper.py
+ #include source=$tool_params
+ </command>
+ <macros>
+ <template name="tool_params">-a 1 -b 2</template>
+ </macros>
+</tool>
+''')
+ xml = tool_dir.load()
+ params_dict = template_macro_params(xml.getroot())
+ assert params_dict['tool_params'] == "-a 1 -b 2"
+
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <macros>
+ <token name="@CITATION@">The citation.</token>
+ </macros>
+ <help>@CITATION@</help>
+ <another>
+ <tag />
+ </another>
+</tool>
+''')
+ xml = tool_dir.load()
+ help_el = xml.find("help")
+ assert help_el.text == "The citation.", help_el.text
+
+ with TestToolDirectory() as tool_dir:
+ tool_dir.write('''
+<tool>
+ <macros>
+ <token name="@TAG_VAL@">The value.</token>
+ </macros>
+ <another>
+ <tag value="@TAG_VAL@" />
+ </another>
+</tool>
+''')
+ xml = tool_dir.load()
+ tag_el = xml.find("another").find("tag")
+ value = tag_el.get('value')
+ assert value == "The value.", value
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: scratchbook: hide on disable
by commits-noreply@bitbucket.org 30 Jun '13
by commits-noreply@bitbucket.org 30 Jun '13
30 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9ddb3130b98d/
Changeset: 9ddb3130b98d
User: guerler
Date: 2013-07-01 01:29:04
Summary: scratchbook: hide on disable
Affected #: 2 files
diff -r 27a8341736452288e7324559ff74df38abaa3931 -r 9ddb3130b98d450ca2be3f447f171ff5f192b8a1 static/scripts/galaxy.frame.js
--- a/static/scripts/galaxy.frame.js
+++ b/static/scripts/galaxy.frame.js
@@ -123,8 +123,8 @@
this.event_initialize();
// add
- $(".galaxy-frame-active").tooltip({title: "Enable/Disable Scratchbook"});
- $(".galaxy-frame-load").tooltip({title: "Show/Hide Scratchbook"});
+ //$(".galaxy-frame-active").tooltip({title: "Enable/Disable Scratchbook"});
+ //$(".galaxy-frame-load").tooltip({title: "Show/Hide Scratchbook"});
// catch window resize event
var self = this;
@@ -218,7 +218,7 @@
if (this.event.type === null)
return;
- // prevent text selection
+ // prevent
e.preventDefault();
// identify frame
@@ -340,6 +340,9 @@
if (this.event.type !== null)
return;
+ // prevent
+ e.preventDefault();
+
// get frame
var frame = this.event_get_frame(e.target);
var self = this;
@@ -375,7 +378,7 @@
if (this.event.type !== null)
return;
- // prevent text selection
+ // prevent
e.preventDefault();
// get frame
@@ -413,7 +416,7 @@
if (this.event.type !== null)
return;
- // prevent text selection
+ // prevent
e.preventDefault();
// load panel
@@ -427,7 +430,7 @@
if (this.event.type !== null)
return;
- // prevent text selection
+ // prevent
e.preventDefault();
// load panel
@@ -441,7 +444,7 @@
if (this.event.type !== null || !this.visible)
return;
- // prevent text selection
+ // prevent
e.preventDefault();
// get wheel delta
@@ -458,7 +461,7 @@
if (this.event.type !== null)
return;
- // prevent text selection
+ // prevent
e.preventDefault();
// scroll up
@@ -472,7 +475,7 @@
if (this.event.type !== null)
return;
- // prevent text selection
+ // prevent
e.preventDefault();
// scroll down
@@ -774,6 +777,10 @@
// untoggle
$(".galaxy-frame-active .icon").removeClass("f-toggle");
+
+ // hide panel
+ if (this.visible)
+ this.panel_show_hide();
} else {
// activate
this.active = true;
@@ -789,9 +796,6 @@
// adds and displays a new frame/window
frame_new: function(options)
{
- // trigger mouse leave
- $(document).trigger('mouseleave');
-
// validate
if (!this.active)
{
diff -r 27a8341736452288e7324559ff74df38abaa3931 -r 9ddb3130b98d450ca2be3f447f171ff5f192b8a1 static/style/blue/galaxy.frame.css
--- a/static/style/blue/galaxy.frame.css
+++ b/static/style/blue/galaxy.frame.css
@@ -95,7 +95,7 @@
z-index : 34010;
position : absolute;
top : 6px;
- right : 165px;
+ right : 170px;
cursor : pointer;
color : #BCC800;
}
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: natefoo: GCC2013 Advanced Tool and Data Source Configuration workshop: "The test framework uses tool_conf.xml.sample for reasons unknown and lost to time."
by commits-noreply@bitbucket.org 30 Jun '13
by commits-noreply@bitbucket.org 30 Jun '13
30 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/27a834173645/
Changeset: 27a834173645
User: natefoo
Date: 2013-06-30 16:04:58
Summary: GCC2013 Advanced Tool and Data Source Configuration workshop: "The test framework uses tool_conf.xml.sample for reasons unknown and lost to time."
Use tool_conf.xml for running functional tests, rather than tool_conf.xml.sample.
Affected #: 3 files
diff -r 9c4b7f8d2f980ff69a0e7947c9360dd7154c65eb -r 27a8341736452288e7324559ff74df38abaa3931 buildbot_setup.sh
--- a/buildbot_setup.sh
+++ b/buildbot_setup.sh
@@ -65,6 +65,7 @@
"
SAMPLES="
+tool_conf.xml.sample
datatypes_conf.xml.sample
universe_wsgi.ini.sample
tool_data_table_conf.xml.sample
diff -r 9c4b7f8d2f980ff69a0e7947c9360dd7154c65eb -r 27a8341736452288e7324559ff74df38abaa3931 run_functional_tests.sh
--- a/run_functional_tests.sh
+++ b/run_functional_tests.sh
@@ -51,4 +51,3 @@
fi
echo "'run_functional_tests.sh help' for help"
-echo "Note: galaxy test framework uses tool_conf.xml.sample, not tool_conf.xml"
diff -r 9c4b7f8d2f980ff69a0e7947c9360dd7154c65eb -r 27a8341736452288e7324559ff74df38abaa3931 scripts/functional_tests.py
--- a/scripts/functional_tests.py
+++ b/scripts/functional_tests.py
@@ -129,7 +129,7 @@
# Exclude all files except test_toolbox.py.
ignore_files = ( re.compile( r'^test_[adghlmsu]*' ), re.compile( r'^test_ta*' ) )
else:
- tool_config_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', 'tool_conf.xml.sample' )
+ tool_config_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', 'tool_conf.xml' )
galaxy_test_file_dir = os.environ.get( 'GALAXY_TEST_FILE_DIR', default_galaxy_test_file_dir )
if not os.path.isabs( galaxy_test_file_dir ):
galaxy_test_file_dir = os.path.join( os.getcwd(), galaxy_test_file_dir )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Scratchbook: Improve event handling
by commits-noreply@bitbucket.org 30 Jun '13
by commits-noreply@bitbucket.org 30 Jun '13
30 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9c4b7f8d2f98/
Changeset: 9c4b7f8d2f98
User: guerler
Date: 2013-06-30 09:27:29
Summary: Scratchbook: Improve event handling
Affected #: 1 file
diff -r d748871f160f9bf1b13df57d34a9f3cf13a9f947 -r 9c4b7f8d2f980ff69a0e7947c9360dd7154c65eb static/scripts/galaxy.frame.js
--- a/static/scripts/galaxy.frame.js
+++ b/static/scripts/galaxy.frame.js
@@ -375,6 +375,9 @@
if (this.event.type !== null)
return;
+ // prevent text selection
+ e.preventDefault();
+
// get frame
var frame = this.event_get_frame(e.target);
@@ -404,23 +407,29 @@
},
// show/hide panel
- event_panel_load: function ()
+ event_panel_load: function (e)
{
// check
if (this.event.type !== null)
return;
+ // prevent text selection
+ e.preventDefault();
+
// load panel
this.panel_show_hide();
},
// activate/disable panel
- event_panel_active: function ()
+ event_panel_active: function (e)
{
// check
if (this.event.type !== null)
return;
+ // prevent text selection
+ e.preventDefault();
+
// load panel
this.panel_active_disable();
},
@@ -432,6 +441,9 @@
if (this.event.type !== null || !this.visible)
return;
+ // prevent text selection
+ e.preventDefault();
+
// get wheel delta
var delta = e.originalEvent.detail ? e.originalEvent.detail : e.originalEvent.wheelDelta / -3;
@@ -440,23 +452,29 @@
},
// scroll up
- event_panel_scroll_up: function()
+ event_panel_scroll_up: function(e)
{
// check
if (this.event.type !== null)
return;
+ // prevent text selection
+ e.preventDefault();
+
// scroll up
this.panel_scroll(-this.options.scroll);
},
// scroll down
- event_panel_scroll_down: function()
+ event_panel_scroll_down: function(e)
{
// check
if (this.event.type !== null)
return;
+ // prevent text selection
+ e.preventDefault();
+
// scroll down
this.panel_scroll(this.options.scroll);
},
@@ -771,6 +789,9 @@
// adds and displays a new frame/window
frame_new: function(options)
{
+ // trigger mouse leave
+ $(document).trigger('mouseleave');
+
// validate
if (!this.active)
{
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Fix event handling, tooltip
by commits-noreply@bitbucket.org 30 Jun '13
by commits-noreply@bitbucket.org 30 Jun '13
30 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d748871f160f/
Changeset: d748871f160f
User: guerler
Date: 2013-06-30 08:34:19
Summary: Fix event handling, tooltip
Affected #: 1 file
diff -r 019ad31c3c2502005846dadc5c0457bbb6f80712 -r d748871f160f9bf1b13df57d34a9f3cf13a9f947 static/scripts/galaxy.frame.js
--- a/static/scripts/galaxy.frame.js
+++ b/static/scripts/galaxy.frame.js
@@ -91,8 +91,8 @@
$(this.el).append(this.frame_template_menu());
// load load button
- $(this.el_header).append(this.frame_template_load());
-
+ $(this.el_header).append(this.frame_template_header());
+
//
// define shadow frame
//
@@ -121,7 +121,11 @@
// link events
this.event_initialize();
-
+
+ // add
+ $(".galaxy-frame-active").tooltip({title: "Enable/Disable Scratchbook"});
+ $(".galaxy-frame-load").tooltip({title: "Show/Hide Scratchbook"});
+
// catch window resize event
var self = this;
$(window).resize(function ()
@@ -162,7 +166,6 @@
{*/
this.events = {
// global page events
- 'mousedown' : 'event_frame_mouse_down',
'mousemove' : 'event_frame_mouse_move',
'mouseup' : 'event_frame_mouse_up',
'mouseleave' : 'event_frame_mouse_up',
@@ -170,13 +173,14 @@
'DOMMouseScroll' : 'event_panel_scroll',
// events fixed to elements
- 'mousedown .f-close' : 'event_frame_close',
- 'mousedown .f-pin' : 'event_frame_lock',
+ 'mousedown .galaxy-frame' : 'event_frame_mouse_down',
'mousedown .galaxy-frame-active' : 'event_panel_active',
'mousedown .galaxy-frame-load' : 'event_panel_load',
'mousedown .galaxy-frame-background' : 'event_panel_load',
'mousedown .galaxy-frame-scroll-up' : 'event_panel_scroll_up',
- 'mousedown .galaxy-frame-scroll-down' : 'event_panel_scroll_down'
+ 'mousedown .galaxy-frame-scroll-down' : 'event_panel_scroll_down',
+ 'mousedown .f-close' : 'event_frame_close',
+ 'mousedown .f-pin' : 'event_frame_lock'
};
/*} else {
this.events = {
@@ -197,9 +201,6 @@
// drag start
event_frame_mouse_down: function (e)
{
- // prevent text selection
- e.preventDefault();
-
// skip if event is already active
if (this.event.type !== null)
return;
@@ -212,11 +213,14 @@
// check for resize event
if ($(e.target).hasClass('f-resize'))
this.event.type = 'resize';
-
+
// skip if no event has to be handled
if (this.event.type === null)
return;
-
+
+ // prevent text selection
+ e.preventDefault();
+
// identify frame
this.event.target = this.event_get_frame(e.target);
@@ -1044,13 +1048,13 @@
},
// fill load button template
- frame_template_load: function()
+ frame_template_header: function()
{
return '<div class="galaxy-frame-load f-corner">' +
'<div class="number f-corner">0</div>' +
'<div class="icon fa-icon-2x"></div>' +
- '</div>'+
- '<div class="galaxy-frame-active f-corner">' +
+ '</div>' +
+ '<div class="galaxy-frame-active f-corner" style="position: absolute; top: 8px;">' +
'<div class="icon fa-icon-2x fa-icon-th"></div>' +
'</div>';
},
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/bf69f8db6dbb/
Changeset: bf69f8db6dbb
Branch: stable
User: dannon
Date: 2013-05-30 17:23:29
Summary: Add specific ami functionality (via GET param) to cloudlaunch. Prevent existing instance selection when using a share string.
Affected #: 2 files
diff -r be47a7f089f91c4b72c0c5f89182a62589389e1f -r bf69f8db6dbb1fd7c6ec16fb97b2e7c763f2ab55 lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
--- a/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
+++ b/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
@@ -35,8 +35,8 @@
BaseUIController.__init__(self, app)
@web.expose
- def index(self, trans, share_string=None):
- return trans.fill_template("cloud/index.mako", default_keypair = DEFAULT_KEYPAIR, share_string=share_string)
+ def index(self, trans, share_string=None, ami=None):
+ return trans.fill_template("cloud/index.mako", default_keypair = DEFAULT_KEYPAIR, share_string=share_string, ami=ami)
@web.expose
def get_account_info(self, trans, key_id, secret, **kwargs):
@@ -92,7 +92,7 @@
return to_json_string(account_info)
@web.expose
- def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, zone=None, **kwargs):
+ def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, ami=DEFAULT_AMI, zone=None, **kwargs):
ec2_error = None
try:
# Create security group & key pair used when starting an instance
@@ -113,11 +113,14 @@
user_provided_data['password'] = password
if share_string:
user_provided_data['share_string'] = share_string
+
rs = run_instance(ec2_conn=ec2_conn,
+ image_id = ami,
user_provided_data=user_provided_data,
key_name=kp_name,
security_groups=[sg_name],
- placement=zone)
+ placement=zone
+ )
if rs:
instance = rs.instances[0]
ct = 0
@@ -266,7 +269,7 @@
return None, None
return kp.name, kp.material
-def run_instance(ec2_conn, user_provided_data, image_id=DEFAULT_AMI,
+def run_instance(ec2_conn, user_provided_data, image_id=None,
kernel_id=None, ramdisk_id=None, key_name=DEFAULT_KEYPAIR,
placement=None, security_groups=['CloudMan']):
""" Start an instance. If instance start was OK, return the ResultSet object
diff -r be47a7f089f91c4b72c0c5f89182a62589389e1f -r bf69f8db6dbb1fd7c6ec16fb97b2e7c763f2ab55 templates/webapps/galaxy/cloud/index.mako
--- a/templates/webapps/galaxy/cloud/index.mako
+++ b/templates/webapps/galaxy/cloud/index.mako
@@ -202,12 +202,14 @@
</div><div id="hidden_options">
+ %if not share_string:
<div id='existing_instance_wrapper' style="display:none;" class="form-row"><label for="id_existing_instance">Instances in your account</label><select name="existing_instance" id="id_existing_instance"></select><input id='id_zone' type='hidden' name='zone' value=''/></div>
+ %endif
<div id='cluster_name_wrapper' class="form-row"><label for="id_cluster_name">Cluster Name</label><input type="text" size="40" class="text-and-autocomplete-select" name="cluster_name" id="id_cluster_name"/><br/>
@@ -244,6 +246,10 @@
</div>
%endif
+ %if ami:
+ <input type='hidden' name='ami' value='${ami}'/>
+ %endif
+
<div class="form-row"><label for="id_instance_type">Instance Type</label><select name="instance_type" id="id_instance_type">
https://bitbucket.org/galaxy/galaxy-central/commits/51c57629182d/
Changeset: 51c57629182d
Branch: stable
User: dannon
Date: 2013-05-31 17:55:46
Summary: Add bucket_default userData (param-based only) to cloudlaunch.
Affected #: 2 files
diff -r bf69f8db6dbb1fd7c6ec16fb97b2e7c763f2ab55 -r 51c57629182d2a77e5ddfe2742919a2412d42898 lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
--- a/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
+++ b/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
@@ -35,8 +35,12 @@
BaseUIController.__init__(self, app)
@web.expose
- def index(self, trans, share_string=None, ami=None):
- return trans.fill_template("cloud/index.mako", default_keypair = DEFAULT_KEYPAIR, share_string=share_string, ami=ami)
+ def index(self, trans, share_string=None, ami=None, bucket_default = None):
+ return trans.fill_template("cloud/index.mako",
+ default_keypair = DEFAULT_KEYPAIR,
+ share_string=share_string,
+ ami=ami,
+ bucket_default=bucket_default)
@web.expose
def get_account_info(self, trans, key_id, secret, **kwargs):
@@ -92,7 +96,7 @@
return to_json_string(account_info)
@web.expose
- def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, ami=DEFAULT_AMI, zone=None, **kwargs):
+ def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, ami=DEFAULT_AMI, zone=None, bucket_default=None, **kwargs):
ec2_error = None
try:
# Create security group & key pair used when starting an instance
@@ -113,6 +117,8 @@
user_provided_data['password'] = password
if share_string:
user_provided_data['share_string'] = share_string
+ if bucket_default:
+ user_provided_data['bucket_default'] = bucket_default
rs = run_instance(ec2_conn=ec2_conn,
image_id = ami,
diff -r bf69f8db6dbb1fd7c6ec16fb97b2e7c763f2ab55 -r 51c57629182d2a77e5ddfe2742919a2412d42898 templates/webapps/galaxy/cloud/index.mako
--- a/templates/webapps/galaxy/cloud/index.mako
+++ b/templates/webapps/galaxy/cloud/index.mako
@@ -250,6 +250,10 @@
<input type='hidden' name='ami' value='${ami}'/>
%endif
+ %if bucket_default:
+ <input type='hidden' name='bucket_default' value='${bucket_default}'/>
+ %endif
+
<div class="form-row"><label for="id_instance_type">Instance Type</label><select name="instance_type" id="id_instance_type">
https://bitbucket.org/galaxy/galaxy-central/commits/64bc5a64b19e/
Changeset: 64bc5a64b19e
Branch: stable
User: dannon
Date: 2013-06-30 07:26:31
Summary: Make default ami configurable via universe
Affected #: 3 files
diff -r 51c57629182d2a77e5ddfe2742919a2412d42898 -r 64bc5a64b19ea3161f95e74702cc1d44fb50e4e3 lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -251,6 +251,7 @@
self.datatypes_config = kwargs.get( 'datatypes_config_file', 'datatypes_conf.xml' )
# Cloud configuration options
self.enable_cloud_launch = string_as_bool( kwargs.get( 'enable_cloud_launch', False ) )
+ self.cloudlaunch_default_ami = kwargs.get( 'cloudlaunch_default_ami', 'ami-118bfc78' )
# Galaxy messaging (AMQP) configuration options
self.amqp = {}
try:
diff -r 51c57629182d2a77e5ddfe2742919a2412d42898 -r 64bc5a64b19ea3161f95e74702cc1d44fb50e4e3 lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
--- a/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
+++ b/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
@@ -26,7 +26,6 @@
PKEY_PREFIX = 'gxy_pkey'
DEFAULT_KEYPAIR = 'cloudman_keypair'
-DEFAULT_AMI = 'ami-da58aab3'
class CloudController(BaseUIController):
@@ -96,7 +95,7 @@
return to_json_string(account_info)
@web.expose
- def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, ami=DEFAULT_AMI, zone=None, bucket_default=None, **kwargs):
+ def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, ami=None, zone=None, bucket_default=None, **kwargs):
ec2_error = None
try:
# Create security group & key pair used when starting an instance
@@ -120,6 +119,9 @@
if bucket_default:
user_provided_data['bucket_default'] = bucket_default
+ if not ami:
+ ami = trans.app.config.cloudlaunch_default_ami
+
rs = run_instance(ec2_conn=ec2_conn,
image_id = ami,
user_provided_data=user_provided_data,
diff -r 51c57629182d2a77e5ddfe2742919a2412d42898 -r 64bc5a64b19ea3161f95e74702cc1d44fb50e4e3 universe_wsgi.ini.sample
--- a/universe_wsgi.ini.sample
+++ b/universe_wsgi.ini.sample
@@ -316,9 +316,10 @@
# Note that this requires java > 1.4 for executing yuicompressor.jar
#pack_scripts = False
-# Enable Cloud Launch
+# Cloud Launch
#enable_cloud_launch = False
+#cloudlaunch_default_ami = ami-118bfc78
# -- Advanced proxy features
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/be47a7f089f9/
Changeset: be47a7f089f9
Branch: stable
User: jgoecks
Date: 2013-06-28 21:26:27
Summary: Enhance multi-value select parsing to split on all whitespace; this fixes a bug that prevents multi-value selects from being used in workflows due to web browsers using \r\n for newline designation.
Affected #: 1 file
diff -r 8c663e656f64a60dac55979841947e78ce23a473 -r be47a7f089f91c4b72c0c5f89182a62589389e1f lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -703,7 +703,10 @@
value = None
else:
if not isinstance( value, list ):
- value = value.split( "\n" )
+ # Split on all whitespace. This not only provides flexibility
+ # in interpreting values but also is needed because many browsers
+ # use \r\n to separate lines.
+ value = value.split()
return UnvalidatedValue( value )
legal_values = self.get_legal_values( trans, context )
if isinstance( value, list ):
https://bitbucket.org/galaxy/galaxy-central/commits/019ad31c3c25/
Changeset: 019ad31c3c25
User: jgoecks
Date: 2013-06-28 21:28:01
Summary: Automated merge of stable branch.
Affected #: 1 file
diff -r b89b721a0b3db47cdeddef35f03ce4c2ffcb47b5 -r 019ad31c3c2502005846dadc5c0457bbb6f80712 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -703,7 +703,10 @@
value = None
else:
if not isinstance( value, list ):
- value = value.split( "\n" )
+ # Split on all whitespace. This not only provides flexibility
+ # in interpreting values but also is needed because many browsers
+ # use \r\n to separate lines.
+ value = value.split()
return UnvalidatedValue( value )
legal_values = self.get_legal_values( trans, context )
if isinstance( value, list ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: Adam Brenner: Replaced "binary" with "package" for eXpress according to my listsrv report of not picking up the correct environmental variables.
by commits-noreply@bitbucket.org 27 Jun '13
by commits-noreply@bitbucket.org 27 Jun '13
27 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b89b721a0b3d/
Changeset: b89b721a0b3d
User: Adam Brenner
Date: 2013-06-27 22:50:57
Summary: Replaced "binary" with "package" for eXpress according to my listsrv report of not picking up the correct environmental variables.
http://dev.list.galaxyproject.org/Tool-Dependency-Check-for-eXpress-require…
Signed-off-by: Adam Brenner <aebrenne(a)uci.edu>
Affected #: 1 file
diff -r 4227472b7640e6689d13d428949be363b4bbc637 -r b89b721a0b3db47cdeddef35f03ce4c2ffcb47b5 tools/ngs_rna/express_wrapper.xml
--- a/tools/ngs_rna/express_wrapper.xml
+++ b/tools/ngs_rna/express_wrapper.xml
@@ -1,7 +1,7 @@
<tool id="express" name="eXpress" version="1.1.1"><description>Quantify the abundances of a set of target sequences from sampled subsequences</description><requirements>
- <requirement type="binary">eXpress</requirement>
+ <requirement type="package">eXpress</requirement></requirements><command>
express --no-update-check
@@ -122,4 +122,4 @@
- If you choose to use to calculate the covariance between targets and outputs, an other output would be : varcov.xprs.
</help>
-</tool>
\ No newline at end of file
+</tool>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: When repairing a repository via the browser, display the ordered list of repositories that will be inspected and repaired.
by commits-noreply@bitbucket.org 27 Jun '13
by commits-noreply@bitbucket.org 27 Jun '13
27 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4227472b7640/
Changeset: 4227472b7640
User: greg
Date: 2013-06-27 21:52:45
Summary: When repairing a repository via the browser, display the ordered list of repositories that will be inspected and repaired.
Affected #: 2 files
diff -r 43e609a791a13c37612e5e440d5890acc070a351 -r 4227472b7640e6689d13d428949be363b4bbc637 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -1147,8 +1147,6 @@
Inspect the repository dependency hierarchy for a specified repository and attempt to make sure they are all properly installed as well as
each repository's tool dependencies.
"""
- # TODO: figure out how to handle installing repositories and tool dependencies consecutively since each redirects to an ajaxian grid. This
- # is not a problem in that Galaxy API.
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
repository_id = kwd.get( 'id', None )
@@ -1160,15 +1158,27 @@
message=message,
status=status ) )
tool_shed_repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ if kwd.get( 'repair_repository_button', False ):
+ repair_dict = kwd.get( 'repair_dict', None )
+ if not repair_dict:
+ repair_dict = repository_util.get_repair_dict( trans, tool_shed_repository )
+ ordered_tsr_ids = repair_dict.get( 'ordered_tsr_ids', [] )
+ ordered_repo_info_dicts = repair_dict.get( 'ordered_repo_info_dicts', [] )
+ if ordered_tsr_ids and ordered_repo_info_dicts:
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='manage_repositories',
+ operation='repair',
+ ordered_tsr_ids=ordered_tsr_ids,
+ ordered_repo_info_dicts=ordered_repo_info_dicts ) )
+ tool_shed_repository = suc.get_installed_tool_shed_repository( trans, repository_id )
repair_dict = repository_util.get_repair_dict( trans, tool_shed_repository )
ordered_tsr_ids = repair_dict.get( 'ordered_tsr_ids', [] )
ordered_repo_info_dicts = repair_dict.get( 'ordered_repo_info_dicts', [] )
- if ordered_tsr_ids and ordered_repo_info_dicts:
- return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
- action='manage_repositories',
- operation='repair',
- ordered_tsr_ids=ordered_tsr_ids,
- ordered_repo_info_dicts=ordered_repo_info_dicts ) )
+ return trans.fill_template( 'admin/tool_shed_repository/repair_repository.mako',
+ repository=tool_shed_repository,
+ repair_dict=repair_dict,
+ message=message,
+ status=status )
@web.json
def repository_installation_status_updates( self, trans, ids=None, status_list=None ):
diff -r 43e609a791a13c37612e5e440d5890acc070a351 -r 4227472b7640e6689d13d428949be363b4bbc637 templates/admin/tool_shed_repository/repair_repository.mako
--- /dev/null
+++ b/templates/admin/tool_shed_repository/repair_repository.mako
@@ -0,0 +1,51 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" />
+
+<%def name="stylesheets()">
+ ${parent.stylesheets()}
+ ${h.css( "library" )}
+</%def>
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+</%def>
+
+${render_galaxy_repository_actions( repository )}
+
+%if message:
+ ${render_msg( message, status )}
+%endif
+
+<div class="warningmessage">
+ The following repositories will be inspected and repaired in the order listed to ensure each repository and all of it's tool dependencies are correctly
+ installed. Click <b>Repair</b> to inspect and repair these repositories.
+</div>
+
+<div class="toolForm">
+ <div class="toolFormTitle">Repair tool shed repository '${repository.name}'</div>
+ <br/><br/>
+ <form name="repair_repository" id="repair_repository" action="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ), repair_dict=repair_dict )}" method="post" >
+ <% ordered_repo_info_dicts = repair_dict.get( 'ordered_repo_info_dicts', [] ) %>
+ <table class="grid">
+ <tr><th bgcolor="#D8D8D8">Name</th><th bgcolor="#D8D8D8">Owner</th><th bgcolor="#D8D8D8">Changeset revision</th></tr>
+ %for repo_info_dict in ordered_repo_info_dicts:
+ <%
+ for name, repo_info_tuple in repo_info_dict.items():
+ description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, tool_dependencies = repo_info_tuple
+ break
+ %>
+ <tr>
+ <td>${name | h}</td>
+ <td>${repository_owner | h}</td>
+ <td>${changeset_revision | h}</td>
+ </tr>
+ %endfor
+ </table>
+ <div style="clear: both"></div>
+ <div class="form-row">
+ <input type="submit" name="repair_repository_button" value="Repair"/>
+ </div>
+ </form>
+ </div>
+</div>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Add VCF visualization support for dataset viewer
by commits-noreply@bitbucket.org 27 Jun '13
by commits-noreply@bitbucket.org 27 Jun '13
27 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/43e609a791a1/
Changeset: 43e609a791a1
User: guerler
Date: 2013-06-27 20:35:37
Summary: Add VCF visualization support for dataset viewer
Affected #: 1 file
diff -r 507ac09f587d2e0c40c1d8f06ed385817a209626 -r 43e609a791a13c37612e5e440d5890acc070a351 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -120,7 +120,7 @@
initialize: function(options)
{
// load trackster button
- (new TabularButtonTracksterView(options)).render();
+ new TabularButtonTracksterView(options);
},
render: function()
@@ -252,23 +252,63 @@
// database key
genome_build: null,
+ // data type
+ data_type: null,
+
// backbone initialize
initialize: function (options)
{
- // verify that metadata exists
- var metadata = options.model.attributes.metadata.attributes;
- if (typeof metadata.chromCol === "undefined" || typeof metadata.startCol === "undefined" || typeof metadata.endCol === "undefined")
- console.log("TabularButtonTrackster : Metadata for column identification is missing.");
- else {
- // read in columns
- this.col.chrom = metadata.chromCol - 1;
- this.col.start = metadata.startCol - 1;
- this.col.end = metadata.endCol - 1;
+ // get options
+ var attributes = options.model.attributes;
+ var metadata = options.model.attributes.metadata.attributes;
+
+ // check for datatype
+ if (typeof attributes.data_type !== "undefined")
+ this.data_type = attributes.data_type;
+ else
+ console.log("TabularButtonTrackster : Data type missing.");
+
+ // check for bed-file format
+ if (this.data_type == "bed")
+ {
+ // verify that metadata exists
+ if (typeof metadata.chromCol !== "undefined" || typeof metadata.startCol !== "undefined" || typeof metadata.endCol !== "undefined")
+ {
+ // read in columns
+ this.col.chrom = metadata.chromCol - 1;
+ this.col.start = metadata.startCol - 1;
+ this.col.end = metadata.endCol - 1;
+ } else
+ console.log("TabularButtonTrackster : Bed-file metadata incomplete.");
+ }
+
+ // check for vcf-file format
+ if (this.data_type == "vcf")
+ {
+ // search array
+ function search (str, array)
+ {
+ for (var j = 0; j < array.length; j++)
+ if (array[j].match(str)) return j;
+ return -1;
+ };
+
+ // load
+ this.col.chrom = search("Chrom", metadata.column_names);
+ this.col.start = search("Pos", metadata.column_names);
+ this.col.end = null;
+
+ // verify that metadata exists
+ if (this.col.chrom == -1 || this.col.start == -1)
+ console.log("TabularButtonTrackster : VCF-file metadata incomplete.");
}
// check
if(this.col.chrom === null)
+ {
+ console.log("TabularButtonTrackster : Chromosome column undefined.");
return;
+ }
// get dataset id
if (typeof options.model.attributes.id === "undefined")
@@ -285,6 +325,19 @@
// get genome_build / database key
if (typeof options.model.attributes.genome_build !== "undefined")
this.genome_build = options.model.attributes.genome_build;
+
+ // render the icon from template
+ var btn_viz = new IconButtonView({ model : new IconButton({
+ title : 'Visualize',
+ icon_class : 'chart_curve',
+ id : 'btn_viz'
+ })});
+
+ // add it to the screen
+ this.$el.append(btn_viz.render().$el);
+
+ // hide the button
+ $('#btn_viz').hide();
},
// backbone events
@@ -297,29 +350,39 @@
// show button
btn_viz_show: function (e)
{
+ // is numeric
+ function is_numeric(n)
+ {
+ return !isNaN(parseFloat(n)) && isFinite(n);
+ };
+
// check
if(this.col.chrom === null)
return;
-
+
// get selected data line
var row = $(e.target).parent();
-
+
// verify that location has been found
var chrom = row.children().eq(this.col.chrom).html();
var start = row.children().eq(this.col.start).html();
- var end = row.children().eq(this.col.end).html();
- if (chrom !== "" && start !== "" && end !== "")
+
+ // end is optional
+ var end = this.col.end ? row.children().eq(this.col.end).html() : start;
+
+ // double check location
+ if (!chrom.match("^#") && chrom !== "" && is_numeric(start))
{
// get target gene region
var btn_viz_pars = {
dataset_id : this.dataset_id,
gene_region : chrom + ":" + start + "-" + end
};
-
+
// get button position
var offset = row.offset();
var left = offset.left - 10;
- var top = offset.top;
+ var top = offset.top - $(window).scrollTop();
// update css
$('#btn_viz').css({'position': 'fixed', 'top': top + 'px', 'left': left + 'px'});
@@ -328,6 +391,9 @@
// show the button
$('#btn_viz').show();
+ } else {
+ // hide the button
+ $('#btn_viz').hide();
}
},
@@ -401,24 +467,7 @@
});
return false;
};
- },
-
- // render frame
- render: function()
- {
- // render the icon from template
- var btn_viz = new IconButtonView({ model : new IconButton({
- title : 'Visualize',
- icon_class : 'chart_curve',
- id : 'btn_viz'
- })});
-
- // add it to the screen
- this.$el.append(btn_viz.render().$el);
-
- // hide the button
- $('#btn_viz').hide();
- }
+ }
});
// -- Utility functions. --
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8c663e656f64/
Changeset: 8c663e656f64
Branch: stable
User: jgoecks
Date: 2013-06-27 18:11:21
Summary: Fix unicode issues in page editor.
Affected #: 1 file
diff -r 53f9bc7009f4c7c93177eb1f71d014e822b43640 -r 8c663e656f64a60dac55979841947e78ce23a473 templates/webapps/galaxy/page/editor.mako
--- a/templates/webapps/galaxy/page/editor.mako
+++ b/templates/webapps/galaxy/page/editor.mako
@@ -782,7 +782,7 @@
</div><div class="unified-panel-body">
- <textarea name="page_content">${page.latest_revision.content.decode('utf-8')}</textarea>
+ <textarea name="page_content">${util.unicodify( page.latest_revision.content) }</textarea></div></%def>
https://bitbucket.org/galaxy/galaxy-central/commits/507ac09f587d/
Changeset: 507ac09f587d
User: jgoecks
Date: 2013-06-27 18:12:07
Summary: Automated merge of stable branch.
Affected #: 3 files
diff -r e1955f57e73a8ce096bf77fd6c9d0e0ad8c5f086 -r 507ac09f587d2e0c40c1d8f06ed385817a209626 templates/webapps/galaxy/page/editor.mako
--- a/templates/webapps/galaxy/page/editor.mako
+++ b/templates/webapps/galaxy/page/editor.mako
@@ -782,7 +782,7 @@
</div><div class="unified-panel-body">
- <textarea name="page_content">${page.latest_revision.content.decode('utf-8')}</textarea>
+ <textarea name="page_content">${util.unicodify( page.latest_revision.content) }</textarea></div></%def>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
27 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e1955f57e73a/
Changeset: e1955f57e73a
User: guerler
Date: 2013-06-27 17:54:19
Summary: Fix IE compatibility
Affected #: 2 files
diff -r 4a33c32fe1a5b33f98fd1b5d9292588cbe82b6be -r e1955f57e73a8ce096bf77fd6c9d0e0ad8c5f086 static/scripts/utils/galaxy.css.js
--- a/static/scripts/utils/galaxy.css.js
+++ b/static/scripts/utils/galaxy.css.js
@@ -15,7 +15,7 @@
el.appendTo(':eq(0)');
// get value
- var value = el.css(name).replace(/[^-\d\.]/g, '');
+ var value = el.css(name);
// remove element
el.remove();
diff -r 4a33c32fe1a5b33f98fd1b5d9292588cbe82b6be -r e1955f57e73a8ce096bf77fd6c9d0e0ad8c5f086 static/style/blue/galaxy.frame.css
--- a/static/style/blue/galaxy.frame.css
+++ b/static/style/blue/galaxy.frame.css
@@ -48,11 +48,6 @@
z-index : 14002;
overflow : hidden;
position : absolute;
- top : 0px;
- left : 0px;
- height : 100%;
- width : 100%;
- opacity : 1.0;
background : #FFFFFF;
border : 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 5px rgba(0,0,0,0.3);
@@ -88,7 +83,6 @@
position : absolute;
top : 8px;
right : 120px;
- padding : 0px 0px 0px 0px;
cursor : pointer;
color : #D0D0D0;
}
@@ -102,7 +96,6 @@
position : absolute;
top : 6px;
right : 165px;
- padding : 0px 0px 0px 0px;
cursor : pointer;
color : #BCC800;
}
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: Dave Bouvier: Fix path issue that was introduced with the refactoring of common_util.url_download.
by commits-noreply@bitbucket.org 27 Jun '13
by commits-noreply@bitbucket.org 27 Jun '13
27 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4a33c32fe1a5/
Changeset: 4a33c32fe1a5
User: Dave Bouvier
Date: 2013-06-27 16:17:04
Summary: Fix path issue that was introduced with the refactoring of common_util.url_download.
Affected #: 1 file
diff -r 3fa9df444b4b81f94b1c42a033c685a6e23827be -r 4a33c32fe1a5b33f98fd1b5d9292588cbe82b6be lib/tool_shed/galaxy_install/tool_dependencies/common_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py
@@ -248,9 +248,9 @@
zip_archive_extracted = extract_zip( file_path, install_dir )
dir = zip_extraction_directory( install_dir, downloaded_file_name )
else:
- dir = install_dir
+ dir = os.path.abspath( install_dir )
else:
- dir = install_dir
+ dir = os.path.abspath( install_dir )
return dir
def zip_extraction_directory( file_path, file_name ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Add support for repairing an installed tool shed repository and all of it's repository dependency hierarchy. Repairing a repository hierarchy will attempt to ensure all repositories in the hierarchy are correctly installed and all tool dependencies of each repository in the hierarchy are correctly installed.
by commits-noreply@bitbucket.org 27 Jun '13
by commits-noreply@bitbucket.org 27 Jun '13
27 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3fa9df444b4b/
Changeset: 3fa9df444b4b
User: greg
Date: 2013-06-27 03:17:00
Summary: Add support for repairing an installed tool shed repository and all of it's repository dependency hierarchy. Repairing a repository hierarchy will attempt to ensure all repositories in the hierarchy are correctly installed and all tool dependencies of each repository in the hierarchy are correctly installed.
There is a new Repository Actions pop-up menu item for each repository labeled "Repair repository" that enables this in the browser.
This is also supported in the enhanced Galaxy API using a command like the following from the ~/scripts/api directory:
python ./repair_tool_shed_repository.py --api <Galaxy admin API key> -l http://localhost:8763 --url http://localhost:9009/ -o test -r 1018e3cee313 --name chemicaltoolbox
Affected #: 10 files
diff -r eaa5112fefcd41ce6509bc22791303a155007680 -r 3fa9df444b4b81f94b1c42a033c685a6e23827be lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
--- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
+++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
@@ -9,6 +9,7 @@
from tool_shed.galaxy_install import repository_util
from tool_shed.util import common_util
+from tool_shed.util import encoding_util
import tool_shed.util.shed_util_common as suc
log = logging.getLogger( __name__ )
@@ -244,7 +245,7 @@
# order the list of tsr_ids to ensure all repositories install in the required order.
tsr_ids = [ trans.security.encode_id( tool_shed_repository.id ) for tool_shed_repository in tool_shed_repositories ]
ordered_tsr_ids, ordered_repo_info_dicts, ordered_tool_panel_section_keys = \
- repository_util.order_components_for_installation( trans, tsr_ids, repo_info_dicts, tool_panel_section_keys )
+ repository_util.order_components_for_installation( trans, tsr_ids, repo_info_dicts, tool_panel_section_keys=tool_panel_section_keys )
# Install the repositories, keeping track of each one for later display.
for index, tsr_id in enumerate( ordered_tsr_ids ):
tool_shed_repository = trans.sa_session.query( trans.model.ToolShedRepository ).get( trans.security.decode_id( tsr_id ) )
@@ -358,3 +359,56 @@
elif isinstance( installed_tool_shed_repositories, list ):
all_installed_tool_shed_repositories.extend( installed_tool_shed_repositories )
return all_installed_tool_shed_repositories
+
+ @web.expose_api
+ def repair_repository_revision( self, trans, payload, **kwd ):
+ """
+ POST /api/tool_shed_repositories/repair_repository_revision
+ Repair a specified repository revision previously installed into Galaxy.
+
+ :param key: the current Galaxy admin user's API key
+
+ The following parameters are included in the payload.
+ :param tool_shed_url (required): the base URL of the Tool Shed from which the Repository was installed
+ :param name (required): the name of the Repository
+ :param owner (required): the owner of the Repository
+ :param changset_revision (required): the changset_revision of the RepositoryMetadata object associated with the Repository
+ """
+ api_key = kwd.get( 'key', None )
+ # Get the information about the repository to be installed from the payload.
+ tool_shed_url = payload.get( 'tool_shed_url', '' )
+ if not tool_shed_url:
+ raise HTTPBadRequest( detail="Missing required parameter 'tool_shed_url'." )
+ name = payload.get( 'name', '' )
+ if not name:
+ raise HTTPBadRequest( detail="Missing required parameter 'name'." )
+ owner = payload.get( 'owner', '' )
+ if not owner:
+ raise HTTPBadRequest( detail="Missing required parameter 'owner'." )
+ changeset_revision = payload.get( 'changeset_revision', '' )
+ if not changeset_revision:
+ raise HTTPBadRequest( detail="Missing required parameter 'changeset_revision'." )
+ tool_shed_repositories = []
+ tool_shed_repository = suc.get_tool_shed_repository_by_shed_name_owner_changeset_revision( trans.app, tool_shed_url, name, owner, changeset_revision )
+ repair_dict = repository_util.get_repair_dict( trans, tool_shed_repository )
+ ordered_tsr_ids = repair_dict.get( 'ordered_tsr_ids', [] )
+ ordered_repo_info_dicts = repair_dict.get( 'ordered_repo_info_dicts', [] )
+ if ordered_tsr_ids and ordered_repo_info_dicts:
+ repositories_for_repair = []
+ for index, tsr_id in enumerate( ordered_tsr_ids ):
+ repository = trans.sa_session.query( trans.model.ToolShedRepository ).get( trans.security.decode_id( tsr_id ) )
+ repo_info_dict = ordered_repo_info_dicts[ index ]
+ # TODO: handle errors in repair_dict.
+ repair_dict = repository_util.repair_tool_shed_repository( trans,
+ repository,
+ encoding_util.tool_shed_encode( repo_info_dict ) )
+ repository_dict = repository.get_api_value( value_mapper=default_tool_shed_repository_value_mapper( trans, repository ) )
+ repository_dict[ 'url' ] = web.url_for( controller='tool_shed_repositories',
+ action='show',
+ id=trans.security.encode_id( repository.id ) )
+ if repair_dict:
+ errors = repair_dict.get( repository.name, [] )
+ repository_dict[ 'errors_attempting_repair' ] = ' '.join( errors )
+ tool_shed_repositories.append( repository_dict )
+ # Display the list of repaired repositories.
+ return tool_shed_repositories
diff -r eaa5112fefcd41ce6509bc22791303a155007680 -r 3fa9df444b4b81f94b1c42a033c685a6e23827be lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -163,12 +163,13 @@
webapp.mapper.connect("workflow_dict", '/api/workflows/download/{workflow_id}', controller='workflows', action='workflow_dict', conditions=dict(method=['GET']))
# Galaxy API for tool shed features.
webapp.mapper.resource( 'tool_shed_repository',
- 'tool_shed_repositories',
- controller='tool_shed_repositories',
- name_prefix='tool_shed_repository_',
- path_prefix='/api',
- new={ 'install_repository_revision' : 'POST' },
- parent_resources=dict( member_name='tool_shed_repository', collection_name='tool_shed_repositories' ) )
+ 'tool_shed_repositories',
+ member={ 'repair_repository_revision' : 'POST' },
+ controller='tool_shed_repositories',
+ name_prefix='tool_shed_repository_',
+ path_prefix='/api',
+ new={ 'install_repository_revision' : 'POST' },
+ parent_resources=dict( member_name='tool_shed_repository', collection_name='tool_shed_repositories' ) )
# Connect logger from app
if app.trace_logger:
webapp.trace_logger = app.trace_logger
diff -r eaa5112fefcd41ce6509bc22791303a155007680 -r 3fa9df444b4b81f94b1c42a033c685a6e23827be lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -319,27 +319,6 @@
@web.expose
@web.require_admin
- def get_repository_dependencies( self, trans, repository_id, repository_name, repository_owner, changeset_revision ):
- """
- Send a request to the appropriate tool shed to retrieve the dictionary of repository dependencies defined for the received repository
- name, owner and changeset revision. The received repository_id is the encoded id of the installed tool shed repository in Galaxy. We
- need it so that we can derive the tool shed from which it was installed.
- """
- repository = suc.get_installed_tool_shed_repository( trans, repository_id )
- tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
- url = suc.url_join( tool_shed_url,
- 'repository/get_repository_dependencies?name=%s&owner=%s&changeset_revision=%s' % \
- ( repository_name, repository_owner, changeset_revision ) )
- raw_text = common_util.tool_shed_get( trans.app, tool_shed_url, url )
- if len( raw_text ) > 2:
- encoded_text = json.from_json_string( raw_text )
- text = encoding_util.tool_shed_decode( encoded_text )
- else:
- text = ''
- return text
-
- @web.expose
- @web.require_admin
def get_tool_dependencies( self, trans, repository_id, repository_name, repository_owner, changeset_revision ):
"""
Send a request to the appropriate tool shed to retrieve the dictionary of tool dependencies defined for the received repository name,
@@ -548,12 +527,7 @@
def manage_repositories( self, trans, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- tsrid = kwd.get( 'tool_shed_repository_id', None )
- tsridslist = util.listify( kwd.get( 'tool_shed_repository_ids', None ) )
- if not tsridslist:
- tsridslist = util.listify( kwd.get( 'id', None ) )
- if tsrid and tsrid not in tsridslist:
- tsridslist.append( tsrid )
+ tsridslist = repository_util.get_tool_shed_repository_ids( **kwd )
if 'operation' in kwd:
operation = kwd[ 'operation' ].lower()
if not tsridslist:
@@ -596,7 +570,7 @@
# Some repositories may have repository dependencies that are required to be installed before the dependent repository, so we'll
# order the list of tsr_ids to ensure all repositories install in the required order.
ordered_tsr_ids, ordered_repo_info_dicts, ordered_tool_panel_section_keys = \
- repository_util.order_components_for_installation( trans, tsr_ids, repo_info_dicts, tool_panel_section_keys )
+ repository_util.order_components_for_installation( trans, tsr_ids, repo_info_dicts, tool_panel_section_keys=tool_panel_section_keys )
for tsr_id in ordered_tsr_ids:
repository = trans.sa_session.query( trans.model.ToolShedRepository ).get( trans.security.decode_id( tsr_id ) )
if repository.status in [ trans.model.ToolShedRepository.installation_status.NEW,
@@ -615,6 +589,14 @@
else:
kwd[ 'message' ] = 'All selected tool shed repositories are already installed.'
kwd[ 'status' ] = 'error'
+ elif operation == "repair":
+ # In this case, tsridslist is ordered.
+ repositories_for_repair = []
+ for tsr_id in tsridslist:
+ repository = trans.sa_session.query( trans.model.ToolShedRepository ).get( trans.security.decode_id( tsr_id ) )
+ repositories_for_repair.append( repository )
+ ordered_repo_info_dicts = kwd.get( 'ordered_repo_info_dicts', [] )
+ self.repair_tool_shed_repositories( trans, repositories_for_repair, ordered_repo_info_dicts )
return self.repository_installation_grid( trans, **kwd )
@web.expose
@@ -799,14 +781,9 @@
@web.expose
@web.require_admin
def monitor_repository_installation( self, trans, **kwd ):
- tsrid = kwd.get( 'tool_shed_repository_id', None )
- tsridslist = util.listify( kwd.get( 'tool_shed_repository_ids', None ) )
+ tsridslist = repository_util.get_tool_shed_repository_ids( **kwd )
if not tsridslist:
- tsridslist = util.listify( kwd.get( 'id', None ) )
- if tsrid and tsrid not in tsridslist:
- tsridslist.append( tsrid )
- if not tsridslist:
- tsridslist = get_ids_of_tool_shed_repositories_being_installed( trans, as_string=False )
+ tsridslist = suc.get_ids_of_tool_shed_repositories_being_installed( trans, as_string=False )
kwd[ 'tool_shed_repository_ids' ] = tsridslist
return self.repository_installation_grid( trans, **kwd )
@@ -1097,11 +1074,7 @@
else:
# Entering this else block occurs only if the tool_shed_repository does not include any valid tools.
if install_repository_dependencies:
- repository_dependencies = self.get_repository_dependencies( trans=trans,
- repository_id=repository_id,
- repository_name=tool_shed_repository.name,
- repository_owner=tool_shed_repository.owner,
- changeset_revision=tool_shed_repository.changeset_revision )
+ repository_dependencies = repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, tool_shed_repository )
else:
repository_dependencies = None
if metadata:
@@ -1174,10 +1147,28 @@
Inspect the repository dependency hierarchy for a specified repository and attempt to make sure they are all properly installed as well as
each repository's tool dependencies.
"""
+ # TODO: figure out how to handle installing repositories and tool dependencies consecutively since each redirects to an ajaxian grid. This
+ # is not a problem in that Galaxy API.
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository_id = kwd[ 'id' ]
+ repository_id = kwd.get( 'id', None )
+ if not repository_id:
+ message = 'Invalid installed tool shed repository id %s received.' % str( repository_id )
+ status = 'error'
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='browse_repositories',
+ message=message,
+ status=status ) )
tool_shed_repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ repair_dict = repository_util.get_repair_dict( trans, tool_shed_repository )
+ ordered_tsr_ids = repair_dict.get( 'ordered_tsr_ids', [] )
+ ordered_repo_info_dicts = repair_dict.get( 'ordered_repo_info_dicts', [] )
+ if ordered_tsr_ids and ordered_repo_info_dicts:
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='manage_repositories',
+ operation='repair',
+ ordered_tsr_ids=ordered_tsr_ids,
+ ordered_repo_info_dicts=ordered_repo_info_dicts ) )
@web.json
def repository_installation_status_updates( self, trans, ids=None, status_list=None ):
@@ -1202,6 +1193,21 @@
@web.expose
@web.require_admin
+ def repair_tool_shed_repositories( self, trans, tool_shed_repositories, repo_info_dicts, **kwd ):
+ """Repair specified tool shed repositories."""
+ # The received lists of tool_shed_repositories and repo_info_dicts are ordered.
+ for index, tool_shed_repository in enumerate( tool_shed_repositories ):
+ repo_info_dict = repo_info_dicts[ index ]
+ repair_dict = repository_util.repair_tool_shed_repository( trans,
+ tool_shed_repository,
+ encoding_util.tool_shed_encode( repo_info_dict ) )
+ tsr_ids_for_monitoring = [ trans.security.encode_id( tsr.id ) for tsr in tool_shed_repositories ]
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='monitor_repository_installation',
+ tool_shed_repository_ids=tsr_ids_for_monitoring ) )
+
+ @web.expose
+ @web.require_admin
def reselect_tool_panel_section( self, trans, **kwd ):
"""
Select or change the tool panel section to contain the tools included in the tool shed repository being reinstalled. If there are updates
@@ -1268,11 +1274,7 @@
raw_text = common_util.tool_shed_get( trans.app, tool_shed_url, url )
readme_files_dict = json.from_json_string( raw_text )
tool_dependencies = metadata.get( 'tool_dependencies', None )
- repository_dependencies = self.get_repository_dependencies( trans=trans,
- repository_id=repository_id,
- repository_name=tool_shed_repository.name,
- repository_owner=tool_shed_repository.owner,
- changeset_revision=tool_shed_repository.changeset_revision )
+ repository_dependencies = repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, tool_shed_repository )
repo_info_dict = repository_util.create_repo_info_dict( trans=trans,
repository_clone_url=repository_clone_url,
changeset_revision=tool_shed_repository.changeset_revision,
@@ -1439,13 +1441,13 @@
"""An error occurred while cloning the repository, so reset everything necessary to enable another attempt."""
repository = suc.get_installed_tool_shed_repository( trans, kwd[ 'id' ] )
if kwd.get( 'reset_repository', False ):
- suc.set_repository_attributes( trans,
- repository,
- status=trans.model.ToolShedRepository.installation_status.NEW,
- error_message=None,
- deleted=False,
- uninstalled=False,
- remove_from_disk=True )
+ repository_util.set_repository_attributes( trans,
+ repository,
+ status=trans.model.ToolShedRepository.installation_status.NEW,
+ error_message=None,
+ deleted=False,
+ uninstalled=False,
+ remove_from_disk=True )
new_kwd = {}
new_kwd[ 'message' ] = "You can now attempt to install the repository named <b>%s</b> again." % repository.name
new_kwd[ 'status' ] = "done"
diff -r eaa5112fefcd41ce6509bc22791303a155007680 -r 3fa9df444b4b81f94b1c42a033c685a6e23827be lib/tool_shed/galaxy_install/repository_util.py
--- a/lib/tool_shed/galaxy_install/repository_util.py
+++ b/lib/tool_shed/galaxy_install/repository_util.py
@@ -6,6 +6,7 @@
from galaxy import tools
from galaxy.util import asbool
from galaxy.util import json
+from galaxy import util
from galaxy import web
from galaxy.model.orm import or_
from galaxy.webapps.tool_shed.util import container_util
@@ -93,6 +94,30 @@
tool_dependencies )
return repo_info_dict
+def get_installed_repositories_from_repository_dependencies( trans, repository_dependencies_dict ):
+ installed_repositories = []
+ for rd_key, rd_vals in repository_dependencies_dict.items():
+ if rd_key in [ 'root_key', 'description' ]:
+ continue
+ # rd_key is something like: 'http://localhost:9009__ESEP__package_rdkit_2012_12__ESEP__test__ESEP__d635f…'
+ # rd_val is something like: [['http://localhost:9009', 'package_numpy_1_7', 'test', 'cddd64ecd985', 'True']]
+ try:
+ tool_shed, name, owner, changeset_revision, prior_installation_required = container_util.get_components_from_key( rd_key )
+ except:
+ tool_shed, name, owner, changeset_revision = container_util.get_components_from_key( rd_val )
+ installed_repository = suc.get_tool_shed_repository_by_shed_name_owner_changeset_revision( trans.app, tool_shed, name, owner, changeset_revision )
+ if installed_repository not in installed_repositories:
+ installed_repositories.append( installed_repository )
+ for rd_val in rd_vals:
+ try:
+ tool_shed, name, owner, changeset_revision, prior_installation_required = container_util.get_components_from_key( rd_key )
+ except:
+ tool_shed, name, owner, changeset_revision = container_util.get_components_from_key( rd_val )
+ installed_repository = suc.get_tool_shed_repository_by_shed_name_owner_changeset_revision( trans.app, tool_shed, name, owner, changeset_revision )
+ if installed_repository not in installed_repositories:
+ installed_repositories.append( installed_repository )
+ return installed_repositories
+
def get_next_prior_install_required_dict_entry( prior_install_required_dict, processed_tsr_ids ):
"""
The order in which the prior_install_required_dict is processed is critical in order to ensure that the ultimate repository installation order is correctly
@@ -142,6 +167,51 @@
prior_install_required_dict[ encoded_repository_id ] = prior_install_ids
return prior_install_required_dict
+def get_repair_dict( trans, repository ):
+ """
+ Inspect the installed repository dependency hierarchy for a specified repository and attempt to make sure they are all properly installed as well as
+ each repository's tool dependencies. This method is called only from Galaxy when attempting to correct issues with an installed repository that has
+ installation problems somewhere in it's dependency hierarchy.
+ """
+ repair_dict = {}
+ # Get a dictionary of all repositories upon which the contents of the current repository_metadata record depend.
+ repository_dependencies_dict = repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, repository )
+ # Generate the list of installed repositories from the information contained in the repository_dependencies dictionary.
+ installed_repositories = get_installed_repositories_from_repository_dependencies( trans, repository_dependencies_dict )
+ # Some repositories may have repository dependencies that are required to be installed before the dependent repository, so we'll order the list of
+ # tsr_ids to ensure all repositories are repaired in the required order.
+ tsr_ids = []
+ repo_info_dicts = []
+ for installed_repository in installed_repositories:
+ tsr_ids.append( trans.security.encode_id( installed_repository.id ) )
+ repository_clone_url = suc.generate_clone_url_for_installed_repository( trans.app, installed_repository )
+ repository_dependencies = repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, installed_repository )
+ metadata = installed_repository.metadata
+ if metadata:
+ tool_dependencies = metadata.get( 'tool_dependencies', None )
+ else:
+ tool_dependencies = None
+ repo_info_dict = create_repo_info_dict( trans=trans,
+ repository_clone_url=repository_clone_url,
+ changeset_revision=installed_repository.changeset_revision,
+ ctx_rev=installed_repository.ctx_rev,
+ repository_owner=installed_repository.owner,
+ repository_name=installed_repository.name,
+ repository=None,
+ repository_metadata=None,
+ tool_dependencies=tool_dependencies,
+ repository_dependencies=repository_dependencies )
+ repo_info_dicts.append( repo_info_dict )
+ # We don't consider tool_panel_section_keys since the repository database records already exist.
+ ordered_tsr_ids, ordered_repo_info_dicts, ordered_tool_panel_section_keys = order_components_for_installation( trans,
+ tsr_ids,
+ repo_info_dicts,
+ tool_panel_section_keys=None )
+ repair_dict[ 'ordered_tsr_ids' ] = ordered_tsr_ids
+ repair_dict[ 'ordered_repo_info_dicts' ] = ordered_repo_info_dicts
+ repair_dict[ 'ordered_tool_panel_section_keys' ] = ordered_tool_panel_section_keys
+ return repair_dict
+
def get_repo_info_dict( trans, repository_id, changeset_revision ):
repository = suc.get_repository_in_tool_shed( trans, repository_id )
repository_clone_url = suc.generate_clone_url_for_repository_in_tool_shed( trans, repository )
@@ -175,7 +245,7 @@
repository_dependencies=None )
return repo_info_dict, includes_tools, includes_tool_dependencies, includes_tools_for_display_in_tool_panel, has_repository_dependencies
-def get_repository_components_for_installation( encoded_tsr_id, encoded_tsr_ids, repo_info_dicts, tool_panel_section_keys ):
+def get_repository_components_for_installation( encoded_tsr_id, encoded_tsr_ids, repo_info_dicts, tool_panel_section_keys=None ):
"""
The received encoded_tsr_ids, repo_info_dicts, and tool_panel_section_keys are 3 lists that contain associated elements at each location in
the list. This method will return the elements from repo_info_dicts and tool_panel_section_keys associated with the received encoded_tsr_id
@@ -184,7 +254,10 @@
for index, tsr_id in enumerate( encoded_tsr_ids ):
if tsr_id == encoded_tsr_id:
repo_info_dict = repo_info_dicts[ index ]
- tool_panel_section_key = tool_panel_section_keys[ index ]
+ if tool_panel_section_keys:
+ tool_panel_section_key = tool_panel_section_keys[ index ]
+ else:
+ tool_panel_section_key = None
return repo_info_dict, tool_panel_section_key
return None, None
@@ -220,6 +293,26 @@
prior_install_ids.append( encoded_repository_id )
return prior_install_ids
+def get_tool_shed_repository_ids( as_string=False, **kwd ):
+ tsrid = kwd.get( 'tool_shed_repository_id', None )
+ tsridslist = util.listify( kwd.get( 'tool_shed_repository_ids', None ) )
+ if not tsridslist:
+ tsridslist = util.listify( kwd.get( 'id', None ) )
+ if tsridslist:
+ if tsrid and tsrid not in tsridslist:
+ tsridslist.append( tsrid )
+ if as_string:
+ return ','.join( tsridslist )
+ return tsridslist
+ else:
+ tsridslist = util.listify( kwd.get( 'ordered_tsr_ids', None ) )
+ if as_string:
+ return ','.join( tsridslist )
+ return tsridslist
+ if as_string:
+ ''
+ return []
+
def get_update_to_changeset_revision_and_ctx_rev( trans, repository ):
"""Return the changeset revision hash to which the repository can be updated."""
changeset_revision_dict = {}
@@ -447,7 +540,7 @@
cloned_ok, error_message = suc.clone_repository( repository_clone_url, os.path.abspath( install_dir ), ctx_rev )
if cloned_ok:
if reinstalling:
- # Since we're reinstalling the repository we need to find the latest changeset revision to which is can be updated.
+ # Since we're reinstalling the repository we need to find the latest changeset revision to which it can be updated.
changeset_revision_dict = get_update_to_changeset_revision_and_ctx_rev( trans, tool_shed_repository )
current_changeset_revision = changeset_revision_dict.get( 'changeset_revision', None )
current_ctx_rev = changeset_revision_dict.get( 'ctx_rev', None )
@@ -503,13 +596,13 @@
suc.update_tool_shed_repository_status( trans.app, tool_shed_repository, trans.model.ToolShedRepository.installation_status.INSTALLED )
else:
# An error occurred while cloning the repository, so reset everything necessary to enable another attempt.
- suc.set_repository_attributes( trans,
- tool_shed_repository,
- status=trans.model.ToolShedRepository.installation_status.ERROR,
- error_message=error_message,
- deleted=False,
- uninstalled=False,
- remove_from_disk=True )
+ set_repository_attributes( trans,
+ tool_shed_repository,
+ status=trans.model.ToolShedRepository.installation_status.ERROR,
+ error_message=error_message,
+ deleted=False,
+ uninstalled=False,
+ remove_from_disk=True )
def merge_containers_dicts_for_new_install( containers_dicts ):
"""
@@ -591,7 +684,7 @@
lock.release()
return new_containers_dict
-def order_components_for_installation( trans, tsr_ids, repo_info_dicts, tool_panel_section_keys ):
+def order_components_for_installation( trans, tsr_ids, repo_info_dicts, tool_panel_section_keys=None ):
"""
Some repositories may have repository dependencies that are required to be installed before the dependent repository. This method will inspect the list of
repositories about to be installed and make sure to order them appropriately. For each repository about to be installed, if required repositories are not
@@ -617,14 +710,19 @@
prior_repo_info_dict, prior_tool_panel_section_key = get_repository_components_for_installation( prior_install_required_id,
tsr_ids,
repo_info_dicts,
- tool_panel_section_keys )
+ tool_panel_section_keys=tool_panel_section_keys )
ordered_tsr_ids.append( prior_install_required_id )
ordered_repo_info_dicts.append( prior_repo_info_dict )
- ordered_tool_panel_section_keys.append( prior_tool_panel_section_key )
- repo_info_dict, tool_panel_section_key = get_repository_components_for_installation( tsr_id, tsr_ids, repo_info_dicts, tool_panel_section_keys )
+ if tool_panel_section_keys:
+ ordered_tool_panel_section_keys.append( prior_tool_panel_section_key )
+ repo_info_dict, tool_panel_section_key = get_repository_components_for_installation( tsr_id,
+ tsr_ids,
+ repo_info_dicts,
+ tool_panel_section_keys=tool_panel_section_keys )
ordered_tsr_ids.append( tsr_id )
ordered_repo_info_dicts.append( repo_info_dict )
- ordered_tool_panel_section_keys.append( tool_panel_section_key )
+ if tool_panel_section_keys:
+ ordered_tool_panel_section_keys.append( tool_panel_section_key )
return ordered_tsr_ids, ordered_repo_info_dicts, ordered_tool_panel_section_keys
def populate_containers_dict_for_new_install( trans, tool_shed_url, tool_path, readme_files_dict, installed_repository_dependencies, missing_repository_dependencies,
@@ -663,3 +761,101 @@
def pull_repository( repo, repository_clone_url, ctx_rev ):
"""Pull changes from a remote repository to a local one."""
commands.pull( suc.get_configured_ui(), repo, source=repository_clone_url, rev=[ ctx_rev ] )
+
+def repair_tool_shed_repository( trans, repository, repo_info_dict ):
+
+ def add_repair_dict_entry( repository_name, error_message ):
+ if repository_name in repair_dict:
+ repair_dict[ repository_name ].append( error_message )
+ else:
+ repair_dict[ repository_name ] = [ error_message ]
+ return repair_dict
+
+ metadata = repository.metadata
+ repair_dict = {}
+ if repository.status in [ trans.model.ToolShedRepository.installation_status.DEACTIVATED ]:
+ try:
+ common_install_util.activate_repository( trans, repository )
+ except Exception, e:
+ error_message = "Error activating repository %s: %s" % ( repository.name, str( e ) )
+ log.debug( error_message )
+ repair_dict [ repository.name ] = error_message
+ elif repository.status not in [ trans.model.ToolShedRepository.installation_status.INSTALLED ]:
+ # TODO: this may cause problems if the repository is currently being installed.
+ shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, repository )
+ # Reset the repository attributes to the New state for installation.
+ if metadata:
+ tool_panel_section_key = tool_util.handle_tool_panel_selection( trans,
+ metadata,
+ no_changes_checked=True,
+ tool_panel_section=None,
+ new_tool_panel_section=None )
+ else:
+ # The tools will be loaded outside of any sections in the tool panel.
+ tool_panel_section_key = None
+ set_repository_attributes( trans,
+ repository,
+ status=trans.model.ToolShedRepository.installation_status.NEW,
+ error_message=None,
+ deleted=False,
+ uninstalled=False,
+ remove_from_disk=True )
+ install_tool_shed_repository( trans,
+ repository,
+ repo_info_dict,
+ tool_panel_section_key,
+ shed_tool_conf,
+ tool_path,
+ install_tool_dependencies=True,
+ reinstalling=True )
+ if repository.status in [ trans.model.ToolShedRepository.installation_status.ERROR ]:
+ repair_dict = add_repair_dict_entry( repository.name, repository.error_message )
+ else:
+ # We have an installed tool shed repository, so handle tool dependencies if necessary.
+ if repository.missing_tool_dependencies and metadata and 'tool_dependencies' in metadata:
+ work_dir = tempfile.mkdtemp( prefix="tmp-toolshed-itdep" )
+ # Reset missing tool dependencies.
+ for tool_dependency in repository.missing_tool_dependencies:
+ if tool_dependency.status in [ trans.model.ToolDependency.installation_status.ERROR ]:
+ tool_dependency_util.set_tool_dependency_attributes( trans,
+ tool_dependency,
+ trans.model.ToolDependency.installation_status.UNINSTALLED,
+ None,
+ remove_from_disk=True )
+ trans.sa_session.refresh( tool_dependency )
+ # Install tool dependencies.
+ suc.update_tool_shed_repository_status( trans.app,
+ repository,
+ trans.model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES )
+ # Get the tool_dependencies.xml file from the repository.
+ tool_dependencies_config = suc.get_config_from_disk( 'tool_dependencies.xml', repository.repo_path( trans.app ) )
+ installed_tool_dependencies = common_install_util.handle_tool_dependencies( app=trans.app,
+ tool_shed_repository=repository,
+ tool_dependencies_config=tool_dependencies_config,
+ tool_dependencies=repository.tool_dependencies )
+ for installed_tool_dependency in installed_tool_dependencies:
+ if installed_tool_dependency.status in [ trans.model.ToolDependency.installation_status.ERROR ]:
+ repair_dict = add_repair_dict_entry( repository.name, installed_tool_dependency.error_message )
+ try:
+ shutil.rmtree( work_dir )
+ except:
+ pass
+ suc.update_tool_shed_repository_status( trans.app, repository, trans.model.ToolShedRepository.installation_status.INSTALLED )
+ return repair_dict
+
+def set_repository_attributes( trans, repository, status, error_message, deleted, uninstalled, remove_from_disk=False ):
+ if remove_from_disk:
+ relative_install_dir = repository.repo_path( trans.app )
+ if relative_install_dir:
+ clone_dir = os.path.abspath( relative_install_dir )
+ try:
+ shutil.rmtree( clone_dir )
+ log.debug( "Removed repository installation directory: %s" % str( clone_dir ) )
+ except Exception, e:
+ log.debug( "Error removing repository installation directory %s: %s" % ( str( clone_dir ), str( e ) ) )
+ repository.error_message = error_message
+ repository.status = status
+ repository.deleted = deleted
+ repository.uninstalled = uninstalled
+ trans.sa_session.add( repository )
+ trans.sa_session.flush()
diff -r eaa5112fefcd41ce6509bc22791303a155007680 -r 3fa9df444b4b81f94b1c42a033c685a6e23827be lib/tool_shed/util/repository_dependency_util.py
--- a/lib/tool_shed/util/repository_dependency_util.py
+++ b/lib/tool_shed/util/repository_dependency_util.py
@@ -4,6 +4,7 @@
from galaxy.util import json
from galaxy.webapps.tool_shed.util import container_util
import tool_shed.util.shed_util_common as suc
+from tool_shed.util import common_util
from tool_shed.util import common_install_util
from tool_shed.util import encoding_util
from tool_shed.util import metadata_util
@@ -285,6 +286,23 @@
# Default prior_installation_required to False.
return False
+def get_repository_dependencies_for_installed_tool_shed_repository( trans, repository ):
+ """
+ Send a request to the appropriate tool shed to retrieve the dictionary of repository dependencies defined for the received repository which is
+ installed into Galaxy. This method is called only from Galaxy.
+ """
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
+ url = suc.url_join( tool_shed_url,
+ 'repository/get_repository_dependencies?name=%s&owner=%s&changeset_revision=%s' % \
+ ( str( repository.name ), str( repository.owner ), str( repository.changeset_revision ) ) )
+ raw_text = common_util.tool_shed_get( trans.app, tool_shed_url, url )
+ if len( raw_text ) > 2:
+ encoded_text = json.from_json_string( raw_text )
+ text = encoding_util.tool_shed_decode( encoded_text )
+ else:
+ text = ''
+ return text
+
def get_repository_dependencies_for_changeset_revision( trans, repository, repository_metadata, toolshed_base_url,
key_rd_dicts_to_be_processed=None, all_repository_dependencies=None,
handled_key_rd_dicts=None, circular_repository_dependencies=None ):
diff -r eaa5112fefcd41ce6509bc22791303a155007680 -r 3fa9df444b4b81f94b1c42a033c685a6e23827be lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -547,6 +547,24 @@
return 'DELETED'
return None
+def get_ids_of_tool_shed_repositories_being_installed( trans, as_string=False ):
+ installing_repository_ids = []
+ new_status = trans.model.ToolShedRepository.installation_status.NEW
+ cloning_status = trans.model.ToolShedRepository.installation_status.CLONING
+ setting_tool_versions_status = trans.model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS
+ installing_dependencies_status = trans.model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES
+ loading_datatypes_status = trans.model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES
+ for tool_shed_repository in trans.sa_session.query( trans.model.ToolShedRepository ) \
+ .filter( or_( trans.model.ToolShedRepository.status == new_status,
+ trans.model.ToolShedRepository.status == cloning_status,
+ trans.model.ToolShedRepository.status == setting_tool_versions_status,
+ trans.model.ToolShedRepository.status == installing_dependencies_status,
+ trans.model.ToolShedRepository.status == loading_datatypes_status ) ):
+ installing_repository_ids.append( trans.security.encode_id( tool_shed_repository.id ) )
+ if as_string:
+ return ','.join( installing_repository_ids )
+ return installing_repository_ids
+
def get_installed_tool_shed_repository( trans, id ):
"""Get a tool shed repository record from the Galaxy database defined by the id."""
return trans.sa_session.query( trans.model.ToolShedRepository ).get( trans.security.decode_id( id ) )
@@ -1223,20 +1241,6 @@
"""Return a reversed list of changesets in the repository changelog up to and including the included_upper_bounds_changeset_revision."""
return reversed_lower_upper_bounded_changelog( repo, INITIAL_CHANGELOG_HASH, included_upper_bounds_changeset_revision )
-def set_repository_attributes( trans, repository, status, error_message, deleted, uninstalled, remove_from_disk=False ):
- if remove_from_disk:
- relative_install_dir = repository.repo_path( trans.app )
- if relative_install_dir:
- clone_dir = os.path.abspath( relative_install_dir )
- shutil.rmtree( clone_dir )
- log.debug( "Removed repository installation directory: %s" % str( clone_dir ) )
- repository.error_message = error_message
- repository.status = status
- repository.deleted = deleted
- repository.uninstalled = uninstalled
- trans.sa_session.add( repository )
- trans.sa_session.flush()
-
def set_prior_installation_required( repository, required_repository ):
"""Return True if the received required_repository must be installed before the received repository."""
# This method is called only from Galaxy when rendering repository dependencies for an installed tool shed repository.
diff -r eaa5112fefcd41ce6509bc22791303a155007680 -r 3fa9df444b4b81f94b1c42a033c685a6e23827be lib/tool_shed/util/tool_dependency_util.py
--- a/lib/tool_shed/util/tool_dependency_util.py
+++ b/lib/tool_shed/util/tool_dependency_util.py
@@ -344,3 +344,12 @@
removed = True
error_message = ''
return removed, error_message
+
+def set_tool_dependency_attributes( trans, tool_dependency, status, error_message, remove_from_disk=False ):
+ if remove_from_disk:
+ installation_directory = tool_dependency.installation_directory( trans.app )
+ removed, err_msg = remove_tool_dependency_installation_directory( installation_directory )
+ tool_dependency.error_message = error_message
+ tool_dependency.status = status
+ trans.sa_session.add( tool_dependency )
+ trans.sa_session.flush()
diff -r eaa5112fefcd41ce6509bc22791303a155007680 -r 3fa9df444b4b81f94b1c42a033c685a6e23827be scripts/api/install_tool_shed_repositories.py
--- a/scripts/api/install_tool_shed_repositories.py
+++ b/scripts/api/install_tool_shed_repositories.py
@@ -10,7 +10,7 @@
</section>
Here is a working example of how to use this script to install a repository from the test tool shed.
-./install_repository_tools.py --api <api key> --local <galaxy base url> --url http://testtoolshed.g2.bx.psu.edu --name gregs_filter --owner greg --revision f28d5018f9cb --tool-deps
+./install_tool_shed_repositories.py --api <api key> --local <galaxy base url> --url http://testtoolshed.g2.bx.psu.edu --name gregs_filter --owner greg --revision f28d5018f9cb --tool-deps
"""
import os
@@ -34,7 +34,7 @@
data[ 'install_repository_dependencies' ] = options.install_repository_dependencies
if options.install_tool_dependencies:
data[ 'install_tool_dependencies' ] = options.install_tool_dependencies
- submit( options.api, '%s%s' % ( options.local_url.strip('/'), '/api/tool_shed_repositories/new/install_repository_revision' ), data )
+ submit( options.api, '%s%s' % ( options.local_url.strip( '/' ), '/api/tool_shed_repositories/new/install_repository_revision' ), data )
if __name__ == '__main__':
parser = argparse.ArgumentParser( description='Installation of tool shed repositories via the Galaxy API.' )
diff -r eaa5112fefcd41ce6509bc22791303a155007680 -r 3fa9df444b4b81f94b1c42a033c685a6e23827be scripts/api/repair_tool_shed_repository.py
--- /dev/null
+++ b/scripts/api/repair_tool_shed_repository.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+"""
+Repair a specified repository revision previously installed into Galaxy.
+</section>
+
+Here is a working example of how to use this script to repair a repository installed into Galaxy.
+./repair_tool_shed_repository.py --api <api key> --local <galaxy base url> --url http://testtoolshed.g2.bx.psu.edu --name gregs_filter --owner greg --revision f28d5018f9cb
+"""
+
+import os
+import sys
+import argparse
+sys.path.insert( 0, os.path.dirname( __file__ ) )
+from common import display
+from common import submit
+
+def clean_url( url ):
+ if url.find( '//' ) > 0:
+ # We have an url that includes a protocol, something like: http://localhost:9009
+ items = url.split( '//' )
+ return items[ 1 ].rstrip( '/' )
+ return url.rstrip( '/' )
+
+def main( options ):
+ """Collect all user data and install the tools via the Galaxy API."""
+ api_key = options.api
+ base_galaxy_url = options.local_url.rstrip( '/' )
+ base_tool_shed_url = options.tool_shed_url.rstrip( '/' )
+ cleaned_tool_shed_url = clean_url( base_tool_shed_url )
+ installed_tool_shed_repositories_url = '%s/api/%s' % ( base_galaxy_url, 'tool_shed_repositories' )
+ data = {}
+ data[ 'tool_shed_url' ] = cleaned_tool_shed_url
+ data[ 'name' ] = options.name
+ data[ 'owner' ] = options.owner
+ data[ 'changeset_revision' ] = options.changeset_revision
+ tool_shed_repository_id = None
+ installed_tool_shed_repositories = display( api_key, installed_tool_shed_repositories_url, return_formatted=False )
+ for installed_tool_shed_repository in installed_tool_shed_repositories:
+ tool_shed = str( installed_tool_shed_repository[ 'tool_shed' ] )
+ name = str( installed_tool_shed_repository[ 'name' ] )
+ owner = str( installed_tool_shed_repository[ 'owner' ] )
+ changeset_revision = str( installed_tool_shed_repository[ 'changeset_revision' ] )
+ if tool_shed == cleaned_tool_shed_url and name == options.name and owner == options.owner and changeset_revision == options.changeset_revision:
+ tool_shed_repository_id = installed_tool_shed_repository[ 'id' ]
+ break
+ if tool_shed_repository_id:
+ url = '%s%s' % ( base_galaxy_url, '/api/tool_shed_repositories/%s/repair_repository_revision' % str( tool_shed_repository_id ) )
+ submit( options.api, url, data )
+ else:
+ print "Invalid tool_shed / name / owner / changeset_revision."
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser( description='Installation of tool shed repositories via the Galaxy API.' )
+ parser.add_argument( "-u", "--url", dest="tool_shed_url", required=True, help="Tool Shed URL" )
+ parser.add_argument( "-a", "--api", dest="api", required=True, help="API Key" )
+ parser.add_argument( "-l", "--local", dest="local_url", required=True, help="URL of the galaxy instance." )
+ parser.add_argument( "-n", "--name", required=True, help="Repository name." )
+ parser.add_argument( "-o", "--owner", required=True, help="Repository owner." )
+ parser.add_argument( "-r", "--revision", dest="changeset_revision", required=True, help="Repository owner." )
+ options = parser.parse_args()
+ main( options )
diff -r eaa5112fefcd41ce6509bc22791303a155007680 -r 3fa9df444b4b81f94b1c42a033c685a6e23827be templates/admin/tool_shed_repository/repository_actions_menu.mako
--- a/templates/admin/tool_shed_repository/repository_actions_menu.mako
+++ b/templates/admin/tool_shed_repository/repository_actions_menu.mako
@@ -24,6 +24,7 @@
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a><a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
+ <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ) )}">Repair repository</a>
%if repository.can_reset_metadata:
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='reset_repository_metadata', id=trans.security.encode_id( repository.id ) )}">Reset repository metadata</a>
%endif
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: Dave Bouvier: Make test results folders expand and collapse correctly.
by commits-noreply@bitbucket.org 26 Jun '13
by commits-noreply@bitbucket.org 26 Jun '13
26 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/eaa5112fefcd/
Changeset: eaa5112fefcd
User: Dave Bouvier
Date: 2013-06-26 22:53:33
Summary: Make test results folders expand and collapse correctly.
Affected #: 1 file
diff -r 4ddc245c20043ee648b9568a70f5b8b8632212fe -r eaa5112fefcd41ce6509bc22791303a155007680 templates/webapps/tool_shed/repository/common.mako
--- a/templates/webapps/tool_shed/repository/common.mako
+++ b/templates/webapps/tool_shed/repository/common.mako
@@ -400,21 +400,21 @@
<%def name="render_failed_test( failed_test, pad, parent, row_counter, row_is_header=False )"><% encoded_id = trans.security.encode_id( failed_test.id ) %>
- <style type="text/css">
- #failed_test_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><tr class="datasetRow"
%if parent is not None:
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
+ <style type="text/css">
+ #failed_test_table{ table-layout:fixed;
+ width:100%;
+ overflow-wrap:normal;
+ overflow:hidden;
+ border:0px;
+ word-break:keep-all;
+ word-wrap:break-word;
+ line-break:strict; }
+ </style><td style="padding-left: ${pad+20}px;"><table id="failed_test_table"><tr><td bgcolor="#FFFFCC"><b>Tool id:</b> ${failed_test.tool_id | h}</td></tr>
@@ -528,21 +528,21 @@
<%def name="render_missing_test_component( missing_test_component, pad, parent, row_counter, row_is_header=False )"><% encoded_id = trans.security.encode_id( missing_test_component.id ) %>
- <style type="text/css">
- #missing_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><tr class="datasetRow"
%if parent is not None:
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
+ <style type="text/css">
+ #missing_table{ table-layout:fixed;
+ width:100%;
+ overflow-wrap:normal;
+ overflow:hidden;
+ border:0px;
+ word-break:keep-all;
+ word-wrap:break-word;
+ line-break:strict; }
+ </style><td style="padding-left: ${pad+20}px;"><table id="missing_table"><tr><td bgcolor="#FFFFCC"><b>Tool id:</b> ${missing_test_component.tool_id | h}</td></tr>
@@ -659,21 +659,21 @@
<%def name="render_tool_dependency_installation_error( installation_error, pad, parent, row_counter, row_is_header=False )"><% encoded_id = trans.security.encode_id( installation_error.id ) %>
- <style type="text/css">
- #td_install_error_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><tr class="datasetRow"
%if parent is not None:
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
+ <style type="text/css">
+ #td_install_error_table{ table-layout:fixed;
+ width:100%;
+ overflow-wrap:normal;
+ overflow:hidden;
+ border:0px;
+ word-break:keep-all;
+ word-wrap:break-word;
+ line-break:strict; }
+ </style><td style="padding-left: ${pad+20}px;"><table id="td_install_error_table"><tr bgcolor="#FFFFCC">
@@ -697,21 +697,21 @@
<%def name="render_repository_installation_error( installation_error, pad, parent, row_counter, row_is_header=False, is_current_repository=False )"><% encoded_id = trans.security.encode_id( installation_error.id ) %>
- <style type="text/css">
- #rd_install_error_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><tr class="datasetRow"
%if parent is not None:
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
+ <style type="text/css">
+ #rd_install_error_table{ table-layout:fixed;
+ width:100%;
+ overflow-wrap:normal;
+ overflow:hidden;
+ border:0px;
+ word-break:keep-all;
+ word-wrap:break-word;
+ line-break:strict; }
+ </style><td style="padding-left: ${pad+20}px;"><table id="rd_install_error_table">
%if not is_current_repository:
@@ -738,21 +738,21 @@
<%def name="render_not_tested( not_tested, pad, parent, row_counter, row_is_header=False )"><% encoded_id = trans.security.encode_id( not_tested.id ) %>
- <style type="text/css">
- #not_tested_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><tr class="datasetRow"
%if parent is not None:
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
+ <style type="text/css">
+ #not_tested_table{ table-layout:fixed;
+ width:100%;
+ overflow-wrap:normal;
+ overflow:hidden;
+ border:0px;
+ word-break:keep-all;
+ word-wrap:break-word;
+ line-break:strict; }
+ </style><td style="padding-left: ${pad+20}px;"><table id="not_tested_table"><tr><td>${not_tested.reason | h}</td></tr>
@@ -767,21 +767,21 @@
<%def name="render_passed_test( passed_test, pad, parent, row_counter, row_is_header=False )"><% encoded_id = trans.security.encode_id( passed_test.id ) %>
- <style type="text/css">
- #passed_tests_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><tr class="datasetRow"
%if parent is not None:
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
+ <style type="text/css">
+ #passed_tests_table{ table-layout:fixed;
+ width:100%;
+ overflow-wrap:normal;
+ overflow:hidden;
+ border:0px;
+ word-break:keep-all;
+ word-wrap:break-word;
+ line-break:strict; }
+ </style><td style="padding-left: ${pad+20}px;"><table id="passed_tests_table"><tr><td bgcolor="#FFFFCC"><b>Tool id:</b> ${passed_test.tool_id | h}</td></tr>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Update standard IO parsing level to recognized level.
by commits-noreply@bitbucket.org 26 Jun '13
by commits-noreply@bitbucket.org 26 Jun '13
26 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4ddc245c2004/
Changeset: 4ddc245c2004
User: jgoecks
Date: 2013-06-26 22:26:13
Summary: Update standard IO parsing level to recognized level.
Affected #: 1 file
diff -r 47446977285f4a8ec634b1b8a6d78ddc9d73b243 -r 4ddc245c20043ee648b9568a70f5b8b8632212fe tools/ngs_rna/tophat2_wrapper.xml
--- a/tools/ngs_rna/tophat2_wrapper.xml
+++ b/tools/ngs_rna/tophat2_wrapper.xml
@@ -268,7 +268,7 @@
</inputs><stdio>
- <regex match="Exception" source="both" level="error" description="Tool exception"/>
+ <regex match="Exception" source="both" level="fatal" description="Tool exception"/><regex match=".*" source="both" level="log" description="tool progress"/></stdio>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Add tool id to error message when parsing standard IO level.
by commits-noreply@bitbucket.org 26 Jun '13
by commits-noreply@bitbucket.org 26 Jun '13
26 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/47446977285f/
Changeset: 47446977285f
User: jgoecks
Date: 2013-06-26 22:22:53
Summary: Add tool id to error message when parsing standard IO level.
Affected #: 1 file
diff -r 4440f4de1828f11439a88d1417ea914d1e6fec8f -r 47446977285f4a8ec634b1b8a6d78ddc9d73b243 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -1528,7 +1528,8 @@
elif ( re.search( "fatal", err_level, re.IGNORECASE ) ):
return_level = StdioErrorLevel.FATAL
else:
- log.debug( "Error level %s did not match warning/fatal" % err_level )
+ log.debug( "Tool %s: error level %s did not match log/warning/fatal" %
+ ( self.id, err_level ) )
except Exception:
log.error( "Exception in parse_error_level "
+ str(sys.exc_info() ) )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Fix fixed path definitions
by commits-noreply@bitbucket.org 26 Jun '13
by commits-noreply@bitbucket.org 26 Jun '13
26 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4440f4de1828/
Changeset: 4440f4de1828
User: guerler
Date: 2013-06-26 18:36:21
Summary: Fix fixed path definitions
Affected #: 3 files
diff -r 9a4e6dd2d863e3e233f7e54382989d95810dbe9e -r 4440f4de1828f11439a88d1417ea914d1e6fec8f static/scripts/galaxy.frame.js
--- a/static/scripts/galaxy.frame.js
+++ b/static/scripts/galaxy.frame.js
@@ -5,9 +5,6 @@
// dependencies
define(["utils/galaxy.css", "libs/backbone/backbone-relational"], function(css) {
-// load required css files
-css.load_file("/static/style/galaxy.frame.css");
-css.load_file("/static/style/base.css");
// frame manager
var GalaxyFrameManager = Backbone.View.extend(
@@ -77,6 +74,9 @@
// initialize
initialize : function(options)
{
+ // load required css files
+ css.load_file(options.url.styles + "/galaxy.frame.css");
+
// read in defaults
if (options)
this.options = _.defaults(options, this.options);
diff -r 9a4e6dd2d863e3e233f7e54382989d95810dbe9e -r 4440f4de1828f11439a88d1417ea914d1e6fec8f templates/base/base_panels.mako
--- a/templates/base/base_panels.mako
+++ b/templates/base/base_panels.mako
@@ -72,6 +72,13 @@
)}
<script type="text/javascript">
+ ## path to style sheets
+ var galaxy_config = {
+ url: {
+ styles : "${h.url_for('/static/style')}"
+ }
+ };
+
## check if its in a galaxy iframe
function is_in_galaxy_frame()
{
@@ -92,7 +99,7 @@
## load additional style sheet
if (is_in_galaxy_frame())
- load_css('/static/style/galaxy.frame.masthead.css');
+ load_css(galaxy_config.url.styles + '/galaxy.frame.masthead.css');
// console protection
window.console = window.console || {
@@ -129,7 +136,7 @@
## frame manager
var frame_manager = null;
- require(['galaxy.frame'], function(frame) { this.frame_manager = new frame.GalaxyFrameManager(); });
+ require(['galaxy.frame'], function(frame) { this.frame_manager = new frame.GalaxyFrameManager(galaxy_config); });
</script></%def>
diff -r 9a4e6dd2d863e3e233f7e54382989d95810dbe9e -r 4440f4de1828f11439a88d1417ea914d1e6fec8f templates/webapps/galaxy/base_panels.mako
--- a/templates/webapps/galaxy/base_panels.mako
+++ b/templates/webapps/galaxy/base_panels.mako
@@ -147,10 +147,10 @@
## Visualization menu.
<%
menu_options = [
- [_('New Track Browser'), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '/visualization/trackster'});"],
- [_('Saved Visualizations'), "javascript:frame_manager.frame_new({ type: 'url', content : '/visualization/list'});" ]
+ [_('New Track Browser'), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '" + h.url_for( controller='/visualization', action='trackster' ) + "'});"],
+ [_('Saved Visualizations'), "javascript:frame_manager.frame_new({ type: 'url', content : '" + h.url_for( controller='/visualization', action='list' ) + "'});" ]
]
- tab( "visualization", _("Visualization"), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '/visualization/list'});", menu_options=menu_options )
+ tab( "visualization", _("Visualization"), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '" + h.url_for( controller='/visualization', action='list' ) + "'});", menu_options=menu_options )
%>
## Cloud menu.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9a4e6dd2d863/
Changeset: 9a4e6dd2d863
User: dan
Date: 2013-06-26 17:57:51
Summary: Change EBI SRA tool to use auto detect for format determination now that they are providing additional formats. Fixes issue seen when sending SFF files.
Affected #: 1 file
diff -r 5a09adb8c39363a32aa373658635cf20ae2cc718 -r 9a4e6dd2d863e3e233f7e54382989d95810dbe9e tools/data_source/ebi_sra.xml
--- a/tools/data_source/ebi_sra.xml
+++ b/tools/data_source/ebi_sra.xml
@@ -9,7 +9,7 @@
</inputs><uihints minwidth="800"/><outputs>
- <data name="output" format="fastq"/>
+ <data name="output" format="auto"/></outputs><options sanitize="False" refresh="True"/></tool>
https://bitbucket.org/galaxy/galaxy-central/commits/53f9bc7009f4/
Changeset: 53f9bc7009f4
Branch: stable
User: dan
Date: 2013-06-26 17:57:51
Summary: Change EBI SRA tool to use auto detect for format determination now that they are providing additional formats. Fixes issue seen when sending SFF files.
Affected #: 1 file
diff -r f35d85e4b4d582cd50aee062bb1c2eaf89b131c2 -r 53f9bc7009f4c7c93177eb1f71d014e822b43640 tools/data_source/ebi_sra.xml
--- a/tools/data_source/ebi_sra.xml
+++ b/tools/data_source/ebi_sra.xml
@@ -9,7 +9,7 @@
</inputs><uihints minwidth="800"/><outputs>
- <data name="output" format="fastq"/>
+ <data name="output" format="auto"/></outputs><options sanitize="False" refresh="True"/></tool>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0